@kaizen/components 1.79.5 → 1.79.7
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/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/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 +60 -1
- 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/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
- package/src/__next__/Menu/_docs/Menu--migration-guide.mdx +91 -0
- package/src/__next__/Tabs/subcomponents/TabList/TabList.module.css +3 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type CardProps } from "../../../Card";
|
|
2
2
|
export type SkirtCardProps = CardProps;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated This component will be removed in v2. Use a regular Card component instead.
|
|
5
|
+
*/
|
|
3
6
|
export declare const SkirtCard: {
|
|
4
7
|
(props: SkirtCardProps): JSX.Element;
|
|
5
8
|
displayName: string;
|
|
@@ -36,6 +36,8 @@ export type SplitButtonProps = {
|
|
|
36
36
|
dir?: 'ltr' | 'rtl';
|
|
37
37
|
} & OverrideClassName<HTMLAttributes<HTMLDivElement>>;
|
|
38
38
|
/**
|
|
39
|
+
* @deprecated This component will be removed in v2. Use a Button and Menu component instead.
|
|
40
|
+
*
|
|
39
41
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896196/Split+Button Guidance} |
|
|
40
42
|
* {@link https://cultureamp.design/storybook/?path=/docs/components-splitbutton--docs Storybook}
|
|
41
43
|
*/
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type TitleBlockProps } from './types';
|
|
2
2
|
/**
|
|
3
|
+
* @deprecated This component will be renamed to TitleBlock in v2.
|
|
4
|
+
* Start importing as TitleBlock instead.
|
|
5
|
+
*
|
|
3
6
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075605782/Title+Block Guidance} |
|
|
4
7
|
* {@link https://cultureamp.design/?path=/story/components-titleblock--docs Storybook}
|
|
5
8
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { type HTMLAttributes, type PropsWithChildren } from 'react';
|
|
2
|
+
import { type OverrideClassName } from "../../types/OverrideClassName";
|
|
3
|
+
export type SingleSelectProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & OverrideClassName<HTMLAttributes<Element>>;
|
|
6
|
+
export declare const SingleSelect: {
|
|
7
|
+
({ classNameOverride, children, ...restProps }: PropsWithChildren<SingleSelectProps>): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
List: {
|
|
10
|
+
({ children, className, ...props }: import("react-aria-components").ListBoxProps<object> & PropsWithChildren): React.ReactElement;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
ListItem: {
|
|
14
|
+
({ children, className, ...props }: import("react-aria-components").ListBoxItemProps<object> & PropsWithChildren): React.ReactElement;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
ListSection: {
|
|
18
|
+
({ name, className, children, ...props }: import("react-aria-components").ListBoxSectionProps<object> & PropsWithChildren & {
|
|
19
|
+
name: string;
|
|
20
|
+
}): React.ReactElement;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare const singleMockItems: {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const groupedMockItems: {
|
|
6
|
+
label: string;
|
|
7
|
+
options: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
}[];
|
|
12
|
+
export declare const mixedMockItemsDisabled: ({
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
options?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
disabled?: undefined;
|
|
21
|
+
options?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
label: string;
|
|
24
|
+
options: ({
|
|
25
|
+
label: string;
|
|
26
|
+
value: string;
|
|
27
|
+
disabled?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
label: string;
|
|
30
|
+
value: string;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
})[];
|
|
33
|
+
value?: undefined;
|
|
34
|
+
disabled?: undefined;
|
|
35
|
+
})[];
|
|
36
|
+
export declare const mixedMockItemsUngroupedFirst: ({
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
options?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
label: string;
|
|
42
|
+
options: {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}[];
|
|
46
|
+
value?: undefined;
|
|
47
|
+
})[];
|
|
48
|
+
export declare const mixedMockItemsUnordered: ({
|
|
49
|
+
label: string;
|
|
50
|
+
options: {
|
|
51
|
+
label: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}[];
|
|
54
|
+
value?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
label: string;
|
|
57
|
+
value: string;
|
|
58
|
+
options?: undefined;
|
|
59
|
+
})[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SingleSelect';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ListBoxProps } from 'react-aria-components';
|
|
3
|
+
export declare const List: {
|
|
4
|
+
({ children, className, ...props }: ListBoxProps<object> & PropsWithChildren): React.ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './List';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ListBoxItemProps } from 'react-aria-components';
|
|
3
|
+
export declare const ListItem: {
|
|
4
|
+
({ children, className, ...props }: ListBoxItemProps<object> & PropsWithChildren): React.ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListItem';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ListBoxSectionProps } from 'react-aria-components';
|
|
3
|
+
export declare const ListSection: {
|
|
4
|
+
({ name, className, children, ...props }: ListBoxSectionProps<object> & PropsWithChildren & {
|
|
5
|
+
name: string;
|
|
6
|
+
}): React.ReactElement;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListSection';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Trigger: () => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Trigger';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SingleSelect';
|
package/package.json
CHANGED
|
@@ -5,6 +5,11 @@ import { GenericButton, type ButtonRef, type GenericButtonProps } from '../Gener
|
|
|
5
5
|
export type ButtonProps = GenericButtonProps
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* @deprecated This component will be replaced by the next Button component in v2.
|
|
9
|
+
* Use `@kaizen/components/next` Button instead.
|
|
10
|
+
* Migration guide: {@link https://cultureamp.design/?path=/docs/components-button-migration-guide--docs}
|
|
11
|
+
* Codemod available: `upgradeV1Buttons`
|
|
12
|
+
*
|
|
8
13
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button Guidance} |
|
|
9
14
|
* {@link https://cultureamp.design/?path=/docs/components-buttons-button--docs Storybook}
|
|
10
15
|
*/
|
|
@@ -9,6 +9,11 @@ import {
|
|
|
9
9
|
export type IconButtonProps = Omit<BaseButtonProps, 'iconPosition'> & WorkingButtonProps
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
+
* @deprecated This component will be replaced by the next Button component in v2.
|
|
13
|
+
* Use `@kaizen/components/next` Button instead.
|
|
14
|
+
* Migration guide: {@link https://cultureamp.design/?path=/docs/components-button-migration-guide--docs}
|
|
15
|
+
* Codemod available: `upgradeV1Buttons`
|
|
16
|
+
*
|
|
12
17
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button Guidance} |
|
|
13
18
|
* {@link https://cultureamp.design/?path=/docs/components-iconbutton--docs Storybook}
|
|
14
19
|
*/
|
|
@@ -37,6 +37,9 @@ const SelectedItemIcon = (): JSX.Element => (
|
|
|
37
37
|
)
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
+
* @deprecated This component will be renamed to LikertScale in v2.
|
|
41
|
+
* Start importing as LikertScale instead.
|
|
42
|
+
*
|
|
40
43
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082060201/Likert+Scale Guidance} |
|
|
41
44
|
* {@link https://cultureamp.design/?path=/docs/components-likertscalelegacy--docs Storybook}
|
|
42
45
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, RenameNotice } from '~storybook/components'
|
|
3
3
|
import * as LikertScaleLegacyStories from './LikertScaleLegacy.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LikertScaleLegacyStories} />
|
|
@@ -10,9 +10,10 @@ import * as LikertScaleLegacyStories from './LikertScaleLegacy.stories'
|
|
|
10
10
|
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/LikertScaleLegacy"
|
|
11
11
|
figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A39905&t=P1w10jr2cpPuaayw-1"
|
|
12
12
|
designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082060201/Likert+Scale"
|
|
13
|
-
|
|
14
13
|
/>
|
|
15
14
|
|
|
15
|
+
<RenameNotice />
|
|
16
|
+
|
|
16
17
|
<KAIOInstallation exportNames="LikertScaleLegacy" />
|
|
17
18
|
|
|
18
19
|
## Overview
|
|
@@ -5,7 +5,7 @@ import { LikertScaleLegacy, type LikertScaleProps } from '../index'
|
|
|
5
5
|
import { type Scale } from '../types'
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
title: 'Components/LikertScaleLegacy',
|
|
8
|
+
title: 'Components/LikertScaleLegacy (deprecated)',
|
|
9
9
|
parameters: {
|
|
10
10
|
chromatic: { disable: false },
|
|
11
11
|
controls: { disable: true },
|
package/src/Skirt/Skirt.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, RemovalNotice } from '~storybook/components'
|
|
3
3
|
import * as SkirtStories from './Skirt.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={SkirtStories} />
|
|
@@ -13,6 +13,8 @@ import * as SkirtStories from './Skirt.stories'
|
|
|
13
13
|
|
|
14
14
|
/>
|
|
15
15
|
|
|
16
|
+
<RemovalNotice />
|
|
17
|
+
|
|
16
18
|
<KAIOInstallation exportNames={['Skirt', 'SkirtCard']} />
|
|
17
19
|
|
|
18
20
|
## Overview
|
|
@@ -5,6 +5,10 @@ import styles from './SkirtCard.module.scss'
|
|
|
5
5
|
|
|
6
6
|
export type SkirtCardProps = CardProps
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated This component will be removed in v2. Use a regular Card component instead.
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
export const SkirtCard = (props: SkirtCardProps): JSX.Element => {
|
|
9
13
|
const { classNameOverride, ...restProps } = props
|
|
10
14
|
return <Card classNameOverride={classnames(styles.wrapper, classNameOverride)} {...restProps} />
|
|
@@ -41,6 +41,8 @@ export type SplitButtonProps = {
|
|
|
41
41
|
} & OverrideClassName<HTMLAttributes<HTMLDivElement>>
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
+
* @deprecated This component will be removed in v2. Use a Button and Menu component instead.
|
|
45
|
+
*
|
|
44
46
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896196/Split+Button Guidance} |
|
|
45
47
|
* {@link https://cultureamp.design/storybook/?path=/docs/components-splitbutton--docs Storybook}
|
|
46
48
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, LinkTo } from '~storybook/components'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, LinkTo, RemovalNotice } from '~storybook/components'
|
|
3
3
|
import * as SplitButtonStories from './SplitButton.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={SplitButtonStories} />
|
|
@@ -13,6 +13,8 @@ import * as SplitButtonStories from './SplitButton.stories'
|
|
|
13
13
|
|
|
14
14
|
/>
|
|
15
15
|
|
|
16
|
+
<RemovalNotice />
|
|
17
|
+
|
|
16
18
|
<KAIOInstallation exportNames="SplitButton" />
|
|
17
19
|
|
|
18
20
|
## Overview
|
|
@@ -9,7 +9,7 @@ import { StickerSheet, type StickerSheetStory } from '~storybook/components/Stic
|
|
|
9
9
|
import { SplitButton, type SplitButtonProps } from '../index'
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
title: 'Components/SplitButton',
|
|
12
|
+
title: 'Components/SplitButton (deprecated)',
|
|
13
13
|
parameters: {
|
|
14
14
|
chromatic: { disable: false },
|
|
15
15
|
controls: { disable: true },
|
|
@@ -228,6 +228,9 @@ const renderNavigationTabs = (
|
|
|
228
228
|
)
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
|
+
* @deprecated This component will be renamed to TitleBlock in v2.
|
|
232
|
+
* Start importing as TitleBlock instead.
|
|
233
|
+
*
|
|
231
234
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075605782/Title+Block Guidance} |
|
|
232
235
|
* {@link https://cultureamp.design/?path=/story/components-titleblock--docs Storybook}
|
|
233
236
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Meta } from '@storybook/blocks'
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, RenameNotice } from '~storybook/components'
|
|
3
3
|
import * as TitleBlockZenStories from './TitleBlockZen.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={TitleBlockZenStories} />
|
|
@@ -9,9 +9,10 @@ import * as TitleBlockZenStories from './TitleBlockZen.stories'
|
|
|
9
9
|
<ResourceLinks
|
|
10
10
|
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/TitleBlockZen"
|
|
11
11
|
designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075605782/Title+Block"
|
|
12
|
-
|
|
13
12
|
/>
|
|
14
13
|
|
|
14
|
+
<RenameNotice />
|
|
15
|
+
|
|
15
16
|
<KAIOInstallation exportNames="TitleBlockZen" />
|
|
16
17
|
|
|
17
18
|
## Overview
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
import { SingleSelect } from './SingleSelect'
|
|
4
|
+
import { singleMockItems } from './_docs/mockData'
|
|
5
|
+
|
|
6
|
+
const SingleSelectWrapper = (): JSX.Element => (
|
|
7
|
+
<SingleSelect>
|
|
8
|
+
<SingleSelect.List>
|
|
9
|
+
{singleMockItems.map((item) => (
|
|
10
|
+
<SingleSelect.ListItem key={item.value} value={{ value: item.value }}>
|
|
11
|
+
{item.label}
|
|
12
|
+
</SingleSelect.ListItem>
|
|
13
|
+
))}
|
|
14
|
+
</SingleSelect.List>
|
|
15
|
+
</SingleSelect>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
describe('<SingleSelect />', () => {
|
|
19
|
+
describe('renders', () => {
|
|
20
|
+
it('a basic select component', () => {
|
|
21
|
+
const { getByRole } = render(<SingleSelectWrapper />)
|
|
22
|
+
const select = getByRole('button')
|
|
23
|
+
expect(select).toBeInTheDocument()
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -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
|
+
}
|