mirror of
https://github.com/hanzoai/o11y-components.git
synced 2026-10-30 14:54:15 +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.
107 lines
3.0 KiB
TypeScript
107 lines
3.0 KiB
TypeScript
import { ChevronDown, ChevronsUpDown, ChevronUp } from '@signozhq/icons';
|
|
import { Select, SelectContent, SelectIcon, SelectItem, SelectTrigger } from '@signozhq/ui';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { useState } from 'react';
|
|
|
|
const meta: Meta<typeof SelectIcon> = {
|
|
title: 'Primitive Components/Select/SelectIcon',
|
|
component: SelectIcon,
|
|
argTypes: {
|
|
asChild: {
|
|
control: 'boolean',
|
|
description: 'Render as child element instead of default.',
|
|
table: {
|
|
category: 'Behavior',
|
|
type: { summary: 'boolean' },
|
|
defaultValue: { summary: 'false' },
|
|
},
|
|
},
|
|
className: {
|
|
control: 'text',
|
|
description: 'Additional CSS classes.',
|
|
table: { category: 'Styling', type: { summary: 'string' } },
|
|
},
|
|
},
|
|
parameters: {
|
|
layout: 'fullscreen',
|
|
},
|
|
tags: ['autodocs'],
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof SelectIcon>;
|
|
|
|
const frameworks = [
|
|
{ value: 'react', label: 'React' },
|
|
{ value: 'vue', label: 'Vue' },
|
|
{ value: 'angular', label: 'Angular' },
|
|
];
|
|
|
|
export const Default: Story = {
|
|
render: () => {
|
|
const [value, setValue] = useState('');
|
|
|
|
return (
|
|
<div style={{ padding: 32, width: '100%', maxWidth: 384 }}>
|
|
<p
|
|
style={{
|
|
marginBottom: 16,
|
|
fontSize: 14,
|
|
lineHeight: 1.42857,
|
|
color: 'var(--muted-foreground)',
|
|
}}
|
|
>
|
|
SelectIcon is typically used internally by SelectTrigger. This example shows the default
|
|
chevron icon.
|
|
</p>
|
|
<Select value={value} onChange={(v) => setValue(v as string)}>
|
|
<SelectTrigger placeholder="Select a framework..." />
|
|
<SelectContent>
|
|
{frameworks.map((f) => (
|
|
<SelectItem key={f.value} value={f.value}>
|
|
{f.label}
|
|
</SelectItem>
|
|
))}
|
|
</SelectContent>
|
|
</Select>
|
|
</div>
|
|
);
|
|
},
|
|
};
|
|
|
|
export const StandaloneUsage: Story = {
|
|
render: () => {
|
|
return (
|
|
<div className="stack-24" style={{ padding: 32, width: '100%', maxWidth: 384 }}>
|
|
<p style={{ fontSize: 14, lineHeight: 1.42857, color: 'var(--muted-foreground)' }}>
|
|
SelectIcon is primarily an internal component used by SelectTrigger. These examples show
|
|
the icon styling when rendered standalone.
|
|
</p>
|
|
|
|
<div className="stack-16">
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
<span style={{ fontSize: 14, lineHeight: 1.42857, width: 128 }}>ChevronDown:</span>
|
|
<SelectIcon asChild>
|
|
<ChevronDown style={{ height: 16, width: 16 }} />
|
|
</SelectIcon>
|
|
</div>
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
<span style={{ fontSize: 14, lineHeight: 1.42857, width: 128 }}>ChevronUp:</span>
|
|
<SelectIcon asChild>
|
|
<ChevronUp style={{ height: 16, width: 16 }} />
|
|
</SelectIcon>
|
|
</div>
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
<span style={{ fontSize: 14, lineHeight: 1.42857, width: 128 }}>ChevronsUpDown:</span>
|
|
<SelectIcon asChild>
|
|
<ChevronsUpDown style={{ height: 16, width: 16 }} />
|
|
</SelectIcon>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
},
|
|
};
|