import React from 'react' import { type Meta } from '@storybook/react' import { Avatar } from '~components/Avatar' import { Icon } from '~components/Icon' import { Text } from '~components/Text' import { StickerSheet, type StickerSheetStory } from '~storybook/components/StickerSheet' import { SingleSelect } from '../index' import { groupedMockItems, singleMockItems } from './mockData' export default { title: 'Components/SingleSelect/SingleSelect (alpha)', parameters: { chromatic: { disable: false }, controls: { disable: true }, }, } satisfies Meta const StickerSheetTemplate: StickerSheetStory = { render: ({ isReversed }) => { const [filterText, setFilterText] = React.useState('') return ( {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} item.label.toLowerCase().includes(filterText.toLowerCase()), )} onInputChange={setFilterText} > {(item) => ( {item.label} )} {(item) => ( {item.label} )} {groupedMockItems.map((section) => ( {section.options.map((item) => ( {item.label} ))} ))} {groupedMockItems.map((section) => ( {section.options.map((item) => ( {item.label} ))} ))} {groupedMockItems.map((section) => ( {section.options.map((item) => ( {item.label} ))} ))} {groupedMockItems.map((section) => ( {section.options.map((item) => ( {item.label} ))} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} ))} {singleMockItems.map((item) => ( {item.label} Supporting text ))} {singleMockItems.map((item) => ( {item.label} Supporting text ))} {singleMockItems.map((item) => (
{item.label} Supporting text
))}
{singleMockItems.map((item) => (
{item.label} Supporting text
))}
) }, /** @note: Only required if you have pseudo states, otherwise this can be removed */ parameters: { /** @todo: Remove any inapplicable pseudo states */ pseudo: { hover: '[data-sb-pseudo-styles="hover"]', active: '[data-sb-pseudo-styles="active"]', focus: '[data-sb-pseudo-styles="focus"]', focusVisible: '[data-sb-pseudo-styles="focus"]', }, }, } export const StickerSheetDefault: StickerSheetStory = { ...StickerSheetTemplate, name: 'Sticker Sheet (Default)', } export const StickerSheetRTL: StickerSheetStory = { ...StickerSheetTemplate, name: 'Sticker Sheet (RTL)', parameters: { /** @note: Only required if template has parameters, otherwise this spread can be removed */ ...StickerSheetTemplate.parameters, textDirection: 'rtl', }, }