mirror of
https://github.com/hanzoai/o11y-components.git
synced 2026-11-02 09:37:38 +00:00
A version written into a manifest is written into every manifest that wants it, which is how eslint came to exist in a hundred and four forms across this estate and how a package came to resolve twice at run time. The catalog moves the number out of the manifest: a manifest names the package, the workspace names the version. Four are held below their latest because the newer release cannot be used, and the reason is recorded rather than the version alone: @noble/hashes 2 renamed every subpath the web3 stack imports, @splinetool/runtime 2 depends on a package that was never published, @dynamic-labs 5.4.1 the same, and react-resizable-panels 3 points its types condition at the bundle.
91 lines
2.3 KiB
TypeScript
91 lines
2.3 KiB
TypeScript
import {
|
|
Combobox,
|
|
ComboboxCommand,
|
|
ComboboxContent,
|
|
ComboboxEmpty,
|
|
ComboboxInput,
|
|
ComboboxItem,
|
|
ComboboxList,
|
|
ComboboxTrigger,
|
|
} from '@signozhq/ui';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { useState } from 'react';
|
|
|
|
const meta: Meta<typeof ComboboxContent> = {
|
|
title: 'Primitive Components/Combobox/ComboboxContent',
|
|
component: ComboboxContent,
|
|
argTypes: {
|
|
className: {
|
|
control: 'text',
|
|
description: 'Additional CSS classes to apply to the content container.',
|
|
table: { category: 'Styling', type: { summary: 'string' } },
|
|
},
|
|
align: {
|
|
control: 'select',
|
|
options: ['start', 'center', 'end'],
|
|
description: 'Alignment of the content relative to the trigger.',
|
|
table: { category: 'Layout', type: { summary: "'start' | 'center' | 'end'" } },
|
|
},
|
|
sideOffset: {
|
|
control: 'number',
|
|
description: 'Offset from the trigger.',
|
|
table: { category: 'Layout', type: { summary: 'number' } },
|
|
},
|
|
},
|
|
parameters: {
|
|
layout: 'fullscreen',
|
|
},
|
|
tags: ['autodocs'],
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof ComboboxContent>;
|
|
|
|
const frameworks = [
|
|
{ value: 'react', label: 'React' },
|
|
{ value: 'vue', label: 'Vue' },
|
|
{ value: 'angular', label: 'Angular' },
|
|
];
|
|
|
|
export const Default: Story = {
|
|
args: {},
|
|
render: (args) => {
|
|
const [value, setValue] = useState('');
|
|
const [open, setOpen] = useState(true);
|
|
|
|
return (
|
|
<div style={{ padding: 32, width: '100%', maxWidth: 384 }}>
|
|
<Combobox open={open} onOpenChange={setOpen}>
|
|
<ComboboxTrigger
|
|
placeholder="Select a framework..."
|
|
value={frameworks.find((f) => f.value === value)?.label || ''}
|
|
/>
|
|
{open && (
|
|
<ComboboxContent {...args}>
|
|
<ComboboxCommand>
|
|
<ComboboxInput placeholder="Search frameworks..." />
|
|
<ComboboxList>
|
|
{frameworks.map((f) => (
|
|
<ComboboxItem
|
|
key={f.value}
|
|
value={f.value}
|
|
onSelect={() => {
|
|
setValue(f.value);
|
|
setOpen(false);
|
|
}}
|
|
isSelected={value === f.value}
|
|
>
|
|
{f.label}
|
|
</ComboboxItem>
|
|
))}
|
|
<ComboboxEmpty>No results.</ComboboxEmpty>
|
|
</ComboboxList>
|
|
</ComboboxCommand>
|
|
</ComboboxContent>
|
|
)}
|
|
</Combobox>
|
|
</div>
|
|
);
|
|
},
|
|
};
|