feat(SW-375): new tokens
new asset generation logic BREAKING CHANGE: New tokens.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { ComponentPropsWithoutRef } from 'react'
|
||||
import {
|
||||
Button,
|
||||
Label,
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
Popover,
|
||||
Select,
|
||||
SelectValue,
|
||||
} from 'react-aria-components'
|
||||
|
||||
import { themes } from '../../.storybook/preview'
|
||||
|
||||
type ThemeSwitcherProps = Pick<
|
||||
ComponentPropsWithoutRef<typeof Select>,
|
||||
'defaultSelectedKey' | 'onSelectionChange'
|
||||
>
|
||||
|
||||
export function ThemeSwitcher(props: ThemeSwitcherProps) {
|
||||
return (
|
||||
<Select {...props}>
|
||||
<Label>Theme: </Label>
|
||||
<Button>
|
||||
<SelectValue />
|
||||
<span aria-hidden="true">▼</span>
|
||||
</Button>
|
||||
<Popover style={{ border: 'solid 1px #000', background: '#fff' }}>
|
||||
<ListBox>
|
||||
{Array.from(Object.entries(themes.themes)).map(([label, key]) => {
|
||||
return (
|
||||
<ListBoxItem key={key} id={key} style={{ padding: '0.5em' }}>
|
||||
{label}
|
||||
</ListBoxItem>
|
||||
)
|
||||
})}
|
||||
</ListBox>
|
||||
</Popover>
|
||||
</Select>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user