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.
100 lines
2.7 KiB
TypeScript
100 lines
2.7 KiB
TypeScript
import { AlignCenter, AlignLeft, AlignRight, Bold } from '@signozhq/icons';
|
|
import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
|
const meta: Meta<typeof ToggleGroupItem> = {
|
|
title: 'Primitive Components/ToggleGroup/ToggleGroupItem',
|
|
component: ToggleGroupItem,
|
|
argTypes: {
|
|
value: {
|
|
control: 'text',
|
|
description: 'The value of the toggle group item.',
|
|
table: { category: 'Form', type: { summary: 'string' } },
|
|
},
|
|
disabled: {
|
|
control: 'boolean',
|
|
description: 'When true, prevents the user from interacting with the item.',
|
|
table: { category: 'Behavior', defaultValue: { summary: 'false' } },
|
|
},
|
|
className: {
|
|
control: 'text',
|
|
description: 'Additional CSS classes to apply.',
|
|
table: { category: 'Styling' },
|
|
},
|
|
id: {
|
|
control: 'text',
|
|
description: 'A unique identifier for the item.',
|
|
table: { category: 'Accessibility' },
|
|
},
|
|
testId: {
|
|
control: 'text',
|
|
description: 'The testId for testing purposes.',
|
|
table: { category: 'Testing' },
|
|
},
|
|
children: {
|
|
control: 'text',
|
|
description: 'The content inside the toggle item (icon, label, or both).',
|
|
table: { category: 'Content' },
|
|
},
|
|
},
|
|
parameters: {
|
|
layout: 'fullscreen',
|
|
},
|
|
tags: ['autodocs'],
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof ToggleGroupItem>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
value: 'center',
|
|
disabled: false,
|
|
children: <AlignCenter style={{ height: 12, width: 12 }} />,
|
|
},
|
|
render: (args) => (
|
|
<ToggleGroup type="single" defaultValue="center">
|
|
<ToggleGroupItem value="left" aria-label="Align left">
|
|
<AlignLeft style={{ height: 12, width: 12 }} />
|
|
</ToggleGroupItem>
|
|
<ToggleGroupItem {...args} aria-label="Align center" />
|
|
<ToggleGroupItem value="right" aria-label="Align right">
|
|
<AlignRight style={{ height: 12, width: 12 }} />
|
|
</ToggleGroupItem>
|
|
</ToggleGroup>
|
|
),
|
|
};
|
|
|
|
export const IconOnly: Story = {
|
|
args: {
|
|
value: 'bold',
|
|
disabled: false,
|
|
},
|
|
render: (args) => (
|
|
<ToggleGroup type="multiple" defaultValue={['bold']}>
|
|
<ToggleGroupItem {...args} aria-label="Bold">
|
|
<Bold style={{ height: 12, width: 12 }} />
|
|
</ToggleGroupItem>
|
|
</ToggleGroup>
|
|
),
|
|
};
|
|
|
|
export const Disabled: Story = {
|
|
args: {
|
|
value: 'center',
|
|
disabled: true,
|
|
children: <AlignCenter style={{ height: 12, width: 12 }} />,
|
|
},
|
|
render: (args) => (
|
|
<ToggleGroup type="single" defaultValue="left">
|
|
<ToggleGroupItem value="left" aria-label="Align left">
|
|
<AlignLeft style={{ height: 12, width: 12 }} />
|
|
</ToggleGroupItem>
|
|
<ToggleGroupItem {...args} aria-label="Align center" />
|
|
<ToggleGroupItem value="right" aria-label="Align right">
|
|
<AlignRight style={{ height: 12, width: 12 }} />
|
|
</ToggleGroupItem>
|
|
</ToggleGroup>
|
|
),
|
|
};
|