@kaizen/components 1.79.6 → 1.79.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/alpha.cjs +4 -0
- package/dist/cjs/src/Button/Button/Button.cjs +5 -0
- package/dist/cjs/src/Button/IconButton/IconButton.cjs +5 -0
- package/dist/cjs/src/LikertScaleLegacy/LikertScaleLegacy.cjs +3 -0
- package/dist/cjs/src/Modal/GenericModal/GenericModal.cjs +11 -1
- package/dist/cjs/src/Skirt/Skirt.cjs +3 -0
- package/dist/cjs/src/Skirt/subcomponents/SkirtCard/SkirtCard.cjs +4 -0
- package/dist/cjs/src/SplitButton/SplitButton.cjs +2 -0
- package/dist/cjs/src/TitleBlockZen/TitleBlockZen.cjs +3 -0
- package/dist/cjs/src/__alpha__/SingleSelect/SingleSelect.cjs +32 -0
- package/dist/cjs/src/__alpha__/SingleSelect/SingleSelect.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/List/List.cjs +24 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/List/List.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.cjs +24 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.cjs +25 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.cjs +21 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css.cjs +6 -0
- package/dist/esm/alpha.mjs +1 -0
- package/dist/esm/src/Button/Button/Button.mjs +5 -0
- package/dist/esm/src/Button/IconButton/IconButton.mjs +5 -0
- package/dist/esm/src/LikertScaleLegacy/LikertScaleLegacy.mjs +3 -0
- package/dist/esm/src/Modal/GenericModal/GenericModal.mjs +11 -1
- package/dist/esm/src/Skirt/Skirt.mjs +3 -0
- package/dist/esm/src/Skirt/subcomponents/SkirtCard/SkirtCard.mjs +4 -0
- package/dist/esm/src/SplitButton/SplitButton.mjs +2 -0
- package/dist/esm/src/TitleBlockZen/TitleBlockZen.mjs +3 -0
- package/dist/esm/src/__alpha__/SingleSelect/SingleSelect.mjs +27 -0
- package/dist/esm/src/__alpha__/SingleSelect/SingleSelect.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/List/List.mjs +18 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/List/List.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.mjs +18 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.mjs +19 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.mjs +13 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css.mjs +4 -0
- package/dist/styles.css +57 -0
- package/dist/types/Button/Button/Button.d.ts +5 -0
- package/dist/types/Button/IconButton/IconButton.d.ts +5 -0
- package/dist/types/LikertScaleLegacy/LikertScaleLegacy.d.ts +3 -0
- package/dist/types/Skirt/Skirt.d.ts +3 -0
- package/dist/types/Skirt/subcomponents/SkirtCard/SkirtCard.d.ts +3 -0
- package/dist/types/SplitButton/SplitButton.d.ts +2 -0
- package/dist/types/TitleBlockZen/TitleBlockZen.d.ts +3 -0
- package/dist/types/__alpha__/SingleSelect/SingleSelect.d.ts +23 -0
- package/dist/types/__alpha__/SingleSelect/_docs/mockData.d.ts +59 -0
- package/dist/types/__alpha__/SingleSelect/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/List/List.d.ts +6 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/List/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.d.ts +6 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListItem/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.d.ts +8 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListSection/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/Trigger/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/index.d.ts +4 -0
- package/dist/types/__alpha__/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/Button/Button/Button.tsx +5 -0
- package/src/Button/IconButton/IconButton.tsx +5 -0
- package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +3 -0
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.mdx +3 -2
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stickersheet.stories.tsx +1 -1
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stories.tsx +1 -1
- package/src/Modal/GenericModal/GenericModal.tsx +18 -1
- package/src/Skirt/Skirt.tsx +4 -0
- package/src/Skirt/_docs/Skirt.mdx +3 -1
- package/src/Skirt/_docs/Skirt.stories.tsx +1 -1
- package/src/Skirt/subcomponents/SkirtCard/SkirtCard.tsx +4 -0
- package/src/SplitButton/SplitButton.tsx +2 -0
- package/src/SplitButton/_docs/SplitButton.mdx +3 -1
- package/src/SplitButton/_docs/SplitButton.stickersheet.stories.tsx +1 -1
- package/src/SplitButton/_docs/SplitButton.stories.tsx +1 -1
- package/src/TitleBlockZen/TitleBlockZen.tsx +3 -0
- package/src/TitleBlockZen/_docs/TitleBlockZen.mdx +3 -2
- package/src/__alpha__/SingleSelect/SingleSelect.module.css +9 -0
- package/src/__alpha__/SingleSelect/SingleSelect.spec.tsx +26 -0
- package/src/__alpha__/SingleSelect/SingleSelect.tsx +27 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.mdx +27 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.stickersheet.stories.tsx +83 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.stories.tsx +23 -0
- package/src/__alpha__/SingleSelect/_docs/mockData.ts +92 -0
- package/src/__alpha__/SingleSelect/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/List.module.css +7 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/List.tsx +17 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css +9 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.tsx +17 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css +9 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.tsx +23 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css +18 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.tsx +13 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/index.ts +4 -0
- package/src/__alpha__/index.ts +1 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { type HTMLAttributes, type PropsWithChildren } from 'react'
|
|
2
|
+
import { Popover as RACPopover, Select as RACSelect } from 'react-aria-components'
|
|
3
|
+
import { type OverrideClassName } from '~components/types/OverrideClassName'
|
|
4
|
+
import { List, ListItem, ListSection, Trigger } from './subcomponents'
|
|
5
|
+
import styles from './SingleSelect.module.css'
|
|
6
|
+
|
|
7
|
+
export type SingleSelectProps = {
|
|
8
|
+
children?: React.ReactNode
|
|
9
|
+
} & OverrideClassName<HTMLAttributes<Element>>
|
|
10
|
+
|
|
11
|
+
export const SingleSelect = ({
|
|
12
|
+
classNameOverride,
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
}: PropsWithChildren<SingleSelectProps>): JSX.Element => {
|
|
16
|
+
return (
|
|
17
|
+
<RACSelect className={classNameOverride} placeholder="" {...restProps}>
|
|
18
|
+
<Trigger />
|
|
19
|
+
<RACPopover className={styles.popover}>{children}</RACPopover>
|
|
20
|
+
</RACSelect>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
SingleSelect.displayName = 'SingleSelect'
|
|
25
|
+
SingleSelect.List = List
|
|
26
|
+
SingleSelect.ListItem = ListItem
|
|
27
|
+
SingleSelect.ListSection = ListSection
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, AlphaNotice } from '~storybook/components'
|
|
3
|
+
import * as SingleSelectStories from './SingleSelect.stories'
|
|
4
|
+
|
|
5
|
+
<Meta of={SingleSelectStories} />
|
|
6
|
+
|
|
7
|
+
# SingleSelect
|
|
8
|
+
|
|
9
|
+
<ResourceLinks
|
|
10
|
+
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__alpha__/SingleSelect"
|
|
11
|
+
figma=""
|
|
12
|
+
designGuidelines=""
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<AlphaNotice />
|
|
16
|
+
|
|
17
|
+
<KAIOInstallation exportNames="SingleSelect" isAlpha />
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
{/* @todo: Update summary. */}
|
|
22
|
+
Brief summary of the component here.
|
|
23
|
+
|
|
24
|
+
<Canvas of={SingleSelectStories.Playground} />
|
|
25
|
+
<Controls of={SingleSelectStories.Playground} />
|
|
26
|
+
|
|
27
|
+
## API
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { type Meta } from '@storybook/react'
|
|
3
|
+
import { StickerSheet, type StickerSheetStory } from '~storybook/components/StickerSheet'
|
|
4
|
+
import { SingleSelect } from '../index'
|
|
5
|
+
import { groupedMockItems, singleMockItems } from './mockData'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/SingleSelect/SingleSelect (alpha)',
|
|
9
|
+
parameters: {
|
|
10
|
+
chromatic: { disable: false },
|
|
11
|
+
controls: { disable: true },
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta
|
|
14
|
+
|
|
15
|
+
const StickerSheetTemplate: StickerSheetStory = {
|
|
16
|
+
render: ({ isReversed }) => {
|
|
17
|
+
return (
|
|
18
|
+
<StickerSheet isReversed={isReversed} title="SingleSelect" headers={['Items', 'Grouped']}>
|
|
19
|
+
<StickerSheet.Row>
|
|
20
|
+
<SingleSelect>
|
|
21
|
+
<SingleSelect.List>
|
|
22
|
+
{singleMockItems.map((item) => (
|
|
23
|
+
<SingleSelect.ListItem key={item.value} value={{ value: item.value }}>
|
|
24
|
+
{item.label}
|
|
25
|
+
</SingleSelect.ListItem>
|
|
26
|
+
))}
|
|
27
|
+
</SingleSelect.List>
|
|
28
|
+
</SingleSelect>
|
|
29
|
+
|
|
30
|
+
<SingleSelect>
|
|
31
|
+
<SingleSelect.List>
|
|
32
|
+
{groupedMockItems.map((section) => (
|
|
33
|
+
<SingleSelect.ListSection name={section.label} key={section.label}>
|
|
34
|
+
{section.options.map((item) => (
|
|
35
|
+
<SingleSelect.ListItem key={item.value} value={{ value: item.value }}>
|
|
36
|
+
{item.label}
|
|
37
|
+
</SingleSelect.ListItem>
|
|
38
|
+
))}
|
|
39
|
+
</SingleSelect.ListSection>
|
|
40
|
+
))}
|
|
41
|
+
</SingleSelect.List>
|
|
42
|
+
</SingleSelect>
|
|
43
|
+
</StickerSheet.Row>
|
|
44
|
+
</StickerSheet>
|
|
45
|
+
)
|
|
46
|
+
},
|
|
47
|
+
/** @note: Only required if you have pseudo states, otherwise this can be removed */
|
|
48
|
+
parameters: {
|
|
49
|
+
/** @todo: Remove any inapplicable pseudo states */
|
|
50
|
+
pseudo: {
|
|
51
|
+
hover: '[data-sb-pseudo-styles="hover"]',
|
|
52
|
+
active: '[data-sb-pseudo-styles="active"]',
|
|
53
|
+
focus: '[data-sb-pseudo-styles="focus"]',
|
|
54
|
+
focusVisible: '[data-sb-pseudo-styles="focus"]',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const StickerSheetDefault: StickerSheetStory = {
|
|
60
|
+
...StickerSheetTemplate,
|
|
61
|
+
name: 'Sticker Sheet (Default)',
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const StickerSheetReversed: StickerSheetStory = {
|
|
65
|
+
...StickerSheetTemplate,
|
|
66
|
+
name: 'Sticker Sheet (Reversed)',
|
|
67
|
+
parameters: {
|
|
68
|
+
/** @note: Only required if template has parameters, otherwise this spread can be removed */
|
|
69
|
+
...StickerSheetTemplate.parameters,
|
|
70
|
+
backgrounds: { default: 'Purple 700' },
|
|
71
|
+
},
|
|
72
|
+
args: { isReversed: true },
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const StickerSheetRTL: StickerSheetStory = {
|
|
76
|
+
...StickerSheetTemplate,
|
|
77
|
+
name: 'Sticker Sheet (RTL)',
|
|
78
|
+
parameters: {
|
|
79
|
+
/** @note: Only required if template has parameters, otherwise this spread can be removed */
|
|
80
|
+
...StickerSheetTemplate.parameters,
|
|
81
|
+
textDirection: 'rtl',
|
|
82
|
+
},
|
|
83
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react'
|
|
2
|
+
import { SingleSelect } from '../index'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/SingleSelect/SingleSelect (alpha)',
|
|
6
|
+
component: SingleSelect,
|
|
7
|
+
args: {},
|
|
8
|
+
} satisfies Meta<typeof SingleSelect>
|
|
9
|
+
|
|
10
|
+
export default meta
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof meta>
|
|
13
|
+
|
|
14
|
+
export const Playground: Story = {
|
|
15
|
+
args: {},
|
|
16
|
+
parameters: {
|
|
17
|
+
docs: {
|
|
18
|
+
canvas: {
|
|
19
|
+
sourceState: 'shown',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export const singleMockItems = [
|
|
2
|
+
{ label: 'Short black', value: 'short-black' },
|
|
3
|
+
{ label: 'Long black', value: 'long-black' },
|
|
4
|
+
{ label: 'Batch brew', value: 'batch-brew' },
|
|
5
|
+
{ label: 'Latte', value: 'latte' },
|
|
6
|
+
{ label: 'Flat white', value: 'flat-white' },
|
|
7
|
+
{ label: 'Mocha', value: 'mocha' },
|
|
8
|
+
{ label: 'Cappuccino', value: 'cappuccino' },
|
|
9
|
+
{ label: 'Magic', value: 'magic' },
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
export const groupedMockItems = [
|
|
13
|
+
{
|
|
14
|
+
label: 'Colours',
|
|
15
|
+
options: [
|
|
16
|
+
{ label: 'Blue', value: 'blue' },
|
|
17
|
+
{ label: 'Red', value: 'red' },
|
|
18
|
+
{ label: 'Green', value: 'green' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'Flavours',
|
|
23
|
+
options: [
|
|
24
|
+
{ label: 'Vanilla', value: 'vanilla' },
|
|
25
|
+
{ label: 'Chocolate', value: 'chocolate' },
|
|
26
|
+
{ label: 'Strawberry', value: 'strawberry' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
export const mixedMockItemsDisabled = [
|
|
32
|
+
{ label: 'Short black', value: 'short-black', disabled: true },
|
|
33
|
+
{ label: 'Long black', value: 'long-black' },
|
|
34
|
+
{ label: 'Batch brew', value: 'batch-brew', disabled: true },
|
|
35
|
+
{
|
|
36
|
+
label: 'Size',
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'Regular', value: 'regular' },
|
|
39
|
+
{ label: 'Large', value: 'large', disabled: true },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Syrup',
|
|
44
|
+
options: [
|
|
45
|
+
{ label: 'Vanilla', value: 'vanilla', disabled: true },
|
|
46
|
+
{ label: 'Caramel', value: 'caramel' },
|
|
47
|
+
{ label: 'Hazelnut', value: 'hazelnut' },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
export const mixedMockItemsUngroupedFirst = [
|
|
53
|
+
{ label: 'Batch brew', value: 'batch-brew' },
|
|
54
|
+
{ label: 'Latte', value: 'latte' },
|
|
55
|
+
{ label: 'Magic', value: 'magic' },
|
|
56
|
+
{
|
|
57
|
+
label: 'Size',
|
|
58
|
+
options: [
|
|
59
|
+
{ label: 'Regular', value: 'regular' },
|
|
60
|
+
{ label: 'Large', value: 'large' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Syrup',
|
|
65
|
+
options: [
|
|
66
|
+
{ label: 'Vanilla', value: 'vanilla' },
|
|
67
|
+
{ label: 'Caramel', value: 'caramel' },
|
|
68
|
+
{ label: 'Hazelnut', value: 'hazelnut' },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
export const mixedMockItemsUnordered = [
|
|
74
|
+
{
|
|
75
|
+
label: 'Size',
|
|
76
|
+
options: [
|
|
77
|
+
{ label: 'Regular', value: 'regular' },
|
|
78
|
+
{ label: 'Large', value: 'large' },
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{ label: 'Batch brew', value: 'batch-brew' },
|
|
82
|
+
{ label: 'Latte', value: 'latte' },
|
|
83
|
+
{ label: 'Magic', value: 'magic' },
|
|
84
|
+
{
|
|
85
|
+
label: 'Syrup',
|
|
86
|
+
options: [
|
|
87
|
+
{ label: 'Vanilla', value: 'vanilla' },
|
|
88
|
+
{ label: 'Caramel', value: 'caramel' },
|
|
89
|
+
{ label: 'Hazelnut', value: 'hazelnut' },
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SingleSelect'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import { ListBox as RACListBox, type ListBoxProps } from 'react-aria-components'
|
|
4
|
+
import styles from './List.module.css'
|
|
5
|
+
|
|
6
|
+
export const List = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ListBoxProps<object> & PropsWithChildren): React.ReactElement => {
|
|
11
|
+
return (
|
|
12
|
+
<RACListBox className={classNames(styles.list, className)} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</RACListBox>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
List.displayName = 'SingleSelect.List'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './List'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.listItem {
|
|
3
|
+
font-family: var(--typography-paragraph-body-font-family);
|
|
4
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
5
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
6
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
7
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import { ListBoxItem as RACListBoxItem, type ListBoxItemProps } from 'react-aria-components'
|
|
4
|
+
import styles from './ListItem.module.css'
|
|
5
|
+
|
|
6
|
+
export const ListItem = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ListBoxItemProps<object> & PropsWithChildren): React.ReactElement => {
|
|
11
|
+
return (
|
|
12
|
+
<RACListBoxItem className={classNames(styles.listItem, className)} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</RACListBoxItem>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
ListItem.displayName = 'SingleSelect.ListItem'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListItem'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.listSectionHeader {
|
|
3
|
+
font-family: var(--typography-heading-5-font-family);
|
|
4
|
+
font-weight: var(--typography-heading-5-font-weight);
|
|
5
|
+
font-size: var(--typography-heading-5-font-size);
|
|
6
|
+
line-height: var(--typography-heading-5-line-height);
|
|
7
|
+
letter-spacing: var(--typography-heading-5-letter-spacing);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import {
|
|
4
|
+
Header as RACHeader,
|
|
5
|
+
ListBoxSection as RACListBoxSection,
|
|
6
|
+
type ListBoxSectionProps,
|
|
7
|
+
} from 'react-aria-components'
|
|
8
|
+
import styles from './ListSection.module.css'
|
|
9
|
+
|
|
10
|
+
export const ListSection = ({
|
|
11
|
+
name,
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}: ListBoxSectionProps<object> & PropsWithChildren & { name: string }): React.ReactElement => {
|
|
16
|
+
return (
|
|
17
|
+
<RACListBoxSection {...props}>
|
|
18
|
+
<RACHeader className={classNames(styles.listSectionHeader, className)}>{name}</RACHeader>
|
|
19
|
+
{children}
|
|
20
|
+
</RACListBoxSection>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
ListSection.displayName = 'SingleSelect.ListSection'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListSection'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.button {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
font-family: var(--typography-paragraph-body-font-family);
|
|
7
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
8
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
9
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
10
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
11
|
+
padding: var(--spacing-12);
|
|
12
|
+
min-height: var(--spacing-48);
|
|
13
|
+
min-width: var(--spacing-200);
|
|
14
|
+
background-color: var(--color-white);
|
|
15
|
+
border-radius: var(--spacing-8);
|
|
16
|
+
border: 1px solid var(--color-gray-500);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Button as RACButton, SelectValue } from 'react-aria-components'
|
|
3
|
+
import { Icon } from '~components/__next__/Icon'
|
|
4
|
+
import styles from './Trigger.module.css'
|
|
5
|
+
|
|
6
|
+
export const Trigger = (): JSX.Element => {
|
|
7
|
+
return (
|
|
8
|
+
<RACButton className={styles.button}>
|
|
9
|
+
<SelectValue />
|
|
10
|
+
<Icon name="keyboard_arrow_down" isPresentational />
|
|
11
|
+
</RACButton>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Trigger'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SingleSelect'
|