@kaizen/components 1.68.7 → 1.68.9
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/codemods/README.md +2 -1
- package/dist/cjs/__overlays__/Tooltip/v3/Tooltip.cjs +1 -1
- package/dist/esm/Calendar/CalendarPopover/CalendarPopover.mjs +1 -1
- package/dist/esm/EmptyState/EmptyState.mjs +1 -1
- package/dist/esm/Filter/FilterMultiSelect/subcomponents/ListBox/ListBox.mjs +1 -1
- package/dist/esm/MultiSelect/subcomponents/Popover/Popover.mjs +1 -1
- package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +1 -1
- package/dist/esm/RichTextEditor/RichTextEditor/schema.mjs +1 -1
- package/dist/esm/RichTextEditor/utils/schema/nodes.mjs +1 -1
- package/dist/esm/TimeField/TimeField.mjs +1 -1
- package/dist/esm/__overlays__/Tooltip/v1/Tooltip.mjs +1 -1
- package/dist/esm/__overlays__/Tooltip/v3/Tooltip.mjs +1 -1
- package/dist/styles.css +50 -50
- package/dist/types/__overlays__/Tooltip/v3/Tooltip.d.ts +1 -1
- package/package.json +30 -30
- package/src/Avatar/_docs/Avatar.mdx +3 -4
- package/src/AvatarGroup/_docs/AvatarGroup.mdx +3 -3
- package/src/Badge/_docs/Badge.mdx +3 -3
- package/src/Brand/_docs/Brand.mdx +3 -4
- package/src/BrandMoment/_docs/BrandMoment.mdx +3 -3
- package/src/ButtonGroup/_docs/ButtonGroup.mdx +3 -3
- package/src/Calendar/CalendarRange/_docs/CalendarRange.mdx +3 -3
- package/src/Calendar/CalendarSingle/_docs/CalendarSingle.mdx +3 -3
- package/src/Card/_docs/Card.mdx +5 -4
- package/src/Checkbox/Checkbox/_docs/Checkbox.mdx +4 -5
- package/src/Checkbox/CheckboxField/_docs/CheckboxField.mdx +5 -3
- package/src/Checkbox/CheckboxGroup/_docs/CheckboxGroup.mdx +4 -3
- package/src/Collapsible/Collapsible/_docs/Collapsible.mdx +3 -3
- package/src/Collapsible/CollapsibleGroup/_docs/CollapsibleGroup.mdx +8 -7
- package/src/Collapsible/ExpertAdviceCollapsible/_docs/ExpertAdviceCollapsible.mdx +3 -3
- package/src/Container/_docs/Container.mdx +6 -4
- package/src/Content/_docs/Content.mdx +6 -4
- package/src/DatePicker/_docs/DatePicker.mdx +3 -3
- package/src/DateRangePicker/_docs/DateRangePicker.mdx +3 -4
- package/src/Divider/_docs/Divider.mdx +3 -3
- package/src/EmptyState/_docs/EmptyState.mdx +3 -3
- package/src/ErrorPage/_docs/ErrorPage.mdx +3 -3
- package/src/FieldGroup/_docs/FieldGroup.mdx +6 -4
- package/src/FieldMessage/_docs/FieldMessage.mdx +3 -4
- package/src/Filter/Filter/_docs/Filter.mdx +13 -14
- package/src/Filter/FilterBar/_docs/FilterBar.mdx +49 -48
- package/src/Filter/FilterButton/_docs/filter-buttons.mdx +5 -5
- package/src/Filter/FilterDatePicker/_docs/FilterDatePicker.mdx +8 -3
- package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.mdx +9 -3
- package/src/Filter/FilterMultiSelect/_docs/FilterMultiSelect.mdx +90 -39
- package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.spec.tsx +1 -0
- package/src/Filter/FilterSelect/_docs/FilterSelect.mdx +4 -4
- package/src/GuidanceBlock/_docs/GuidanceBlock.mdx +3 -3
- package/src/Heading/_docs/Heading.mdx +4 -4
- package/src/Icon/_docs/Icon.mdx +5 -7
- package/src/Illustration/Scene/BrandMomentCaptureIntro/_docs/BrandMomentCaptureIntro.mdx +10 -3
- package/src/Illustration/Scene/_docs/Scene.mdx +5 -8
- package/src/Illustration/Spot/_docs/Spot.mdx +4 -4
- package/src/Input/Input/_docs/Input.mdx +8 -4
- package/src/Input/InputRange/_docs/InputRange.mdx +3 -3
- package/src/Input/InputSearch/_docs/InputSearch.mdx +4 -3
- package/src/KaizenProvider/_docs/KaizenProvider.mdx +9 -9
- package/src/KaizenProvider/_docs/internationalization-in-kaizen.mdx +10 -11
- package/src/Label/_docs/Label.mdx +9 -3
- package/src/LabelledMessage/_docs/LabelledMessage.mdx +3 -3
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.mdx +3 -3
- package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.mdx +5 -5
- package/src/Loading/LoadingHeading/_docs/LoadingHeading.mdx +3 -3
- package/src/Loading/LoadingInput/_docs/LoadingInput.mdx +3 -3
- package/src/Loading/LoadingParagraph/_docs/LoadingParagraph.mdx +3 -3
- package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.mdx +3 -4
- package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +3 -3
- package/src/Modal/ContextModal/_docs/ContextModal.mdx +6 -3
- package/src/Modal/GenericModal/_docs/GenericModal.mdx +5 -4
- package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +3 -4
- package/src/MultiSelect/_docs/MultiSelect.mdx +3 -4
- package/src/Notification/GlobalNotification/_docs/GlobalNotification.mdx +3 -3
- package/src/Notification/InlineNotification/_docs/InlineNotification.mdx +3 -4
- package/src/Notification/ToastNotification/_docs/ToastNotification.mdx +3 -3
- package/src/Pagination/_docs/Pagination.mdx +3 -3
- package/src/Pagination/subcomponents/DirectionalLink/_docs/DirectionalLink.mdx +3 -3
- package/src/Pagination/subcomponents/PaginationLink/_docs/PaginationLink.mdx +3 -3
- package/src/Popover/_docs/Popover.mdx +12 -10
- package/src/ProgressBar/_docs/ProgressBar.mdx +3 -4
- package/src/Radio/Radio/_docs/Radio.mdx +4 -4
- package/src/Radio/RadioField/_docs/RadioField.mdx +3 -3
- package/src/Radio/RadioGroup/_docs/RadioGroup.mdx +3 -3
- package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.mdx +7 -10
- package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.mdx +3 -5
- package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.mdx +7 -9
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.mdx +3 -3
- package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/_docs/Toolbar.mdx +3 -3
- package/src/SearchField/_docs/SearchField.mdx +3 -3
- package/src/Select/_docs/Select.mdx +7 -3
- package/src/Skirt/_docs/Skirt.mdx +4 -4
- package/src/Slider/_docs/Slider.mdx +3 -3
- package/src/SplitButton/_docs/SplitButton.mdx +4 -3
- package/src/Table/_docs/Table.mdx +19 -6
- package/src/Tabs/_docs/Tabs.mdx +4 -7
- package/src/Tag/_docs/Tag.mdx +16 -5
- package/src/Text/_docs/Text.mdx +3 -3
- package/src/TextArea/_docs/TextArea.mdx +5 -4
- package/src/TextAreaField/_docs/TextAreaField.mdx +9 -4
- package/src/TextField/_docs/TextField.mdx +9 -4
- package/src/Tile/InformationTile/_docs/InformationTile.mdx +5 -4
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +5 -3
- package/src/Tile/TileGrid/_docs/TileGrid.mdx +3 -3
- package/src/TimeField/_docs/TimeField.mdx +3 -3
- package/src/TitleBlockZen/_docs/TitleBlockZen.mdx +5 -3
- package/src/ToggleSwitch/ToggleSwitch/_docs/ToggleSwitch.mdx +3 -3
- package/src/ToggleSwitch/ToggleSwitchField/_docs/ToggleSwitchField.mdx +3 -3
- package/src/VisuallyHidden/_docs/VisuallyHidden.mdx +6 -4
- package/src/Well/_docs/Well.mdx +5 -5
- package/src/Workflow/_docs/ProgressStepper.mdx +3 -3
- package/src/Workflow/_docs/Workflow.mdx +25 -19
- package/src/Workflow/_docs/WorkflowFooter.mdx +3 -3
- package/src/Workflow/_docs/WorkflowHeader.mdx +3 -3
- package/src/__actions__/Button/v1/Button/_docs/Button.mdx +4 -4
- package/src/__actions__/Button/v1/IconButton/_docs/IconButton.mdx +3 -3
- package/src/__actions__/Button/v2/Button/_docs/Button.mdx +4 -4
- package/src/__actions__/Button/v2/IconButton/_docs/IconButton.mdx +3 -3
- package/src/__actions__/Button/v3/_docs/Button--api-specification.mdx +49 -17
- package/src/__actions__/Button/v3/_docs/Button--usage-guidelines.mdx +8 -6
- package/src/__actions__/Menu/v1/_docs/Menu.mdx +3 -4
- package/src/__actions__/Menu/v2/_docs/Menu.mdx +8 -4
- package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +35 -24
- package/src/__actions__/Menu/v3/_docs/Menu.mdx +52 -39
- package/src/__future__/Icon/_docs/Icon--api-specification.mdx +17 -10
- package/src/__future__/Icon/_docs/Icon--usage-guidelines.mdx +5 -4
- package/src/__future__/Select/_docs/Select.mdx +9 -5
- package/src/__future__/Tabs/_docs/Tabs--api-specification.mdx +4 -8
- package/src/__future__/Tabs/_docs/Tabs--migration-guide.mdx +11 -4
- package/src/__future__/Tag/RemovableTag/_docs/RemovableTag.mdx +4 -6
- package/src/__future__/Tag/Tag/_docs/Tag-migration-guide.mdx +12 -20
- package/src/__future__/Tag/Tag/_docs/Tag.mdx +3 -4
- package/src/__overlays__/Focusable/v3/_docs/ApiSpecification.mdx +14 -13
- package/src/__overlays__/Tooltip/v1/_docs/Tooltip.mdx +5 -7
- package/src/__overlays__/Tooltip/v2/_docs/Tooltip.mdx +5 -6
- package/src/__overlays__/Tooltip/v3/Tooltip.tsx +3 -2
- package/src/__overlays__/Tooltip/v3/_docs/ApiSpecification.mdx +50 -46
- package/src/__overlays__/Tooltip/v3/_docs/Tooltip.mdx +63 -48
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Controls, Meta, Canvas } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, NoClipCanvas } from
|
|
3
|
-
import * as FilterMultiSelectStories from
|
|
1
|
+
import { Controls, Meta, Canvas } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, NoClipCanvas } from '~storybook/components'
|
|
3
|
+
import * as FilterMultiSelectStories from './FilterMultiSelect.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={FilterMultiSelectStories} />
|
|
6
6
|
|
|
@@ -35,42 +35,63 @@ The FilterMultiSelect is a component relies heavily on consumer implemntation. I
|
|
|
35
35
|
The following is an example of how you may create an async FilterMultiSelect using `@tanstack/react-query`.
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
QueryClientProvider,
|
|
40
|
+
QueryClient,
|
|
41
|
+
useInfiniteQuery,
|
|
42
|
+
useQueryClient,
|
|
43
|
+
keepPreviousData,
|
|
44
|
+
} from '@tanstack/react-query'
|
|
39
45
|
|
|
40
46
|
const AsyncExample = () => {
|
|
41
47
|
const client = new QueryClient()
|
|
42
48
|
const [open, setOpen] = useState(false)
|
|
43
49
|
const [selectedPeople, setSelectedPeople] = useState<string[]>([])
|
|
44
|
-
const [searchState, setSearchState] = useState(
|
|
50
|
+
const [searchState, setSearchState] = useState('')
|
|
45
51
|
const queryClient = useQueryClient()
|
|
46
52
|
|
|
47
|
-
const fetchSWAPI = async ({
|
|
53
|
+
const fetchSWAPI = async ({
|
|
54
|
+
pageParam,
|
|
55
|
+
}): Promise<{ results: Array<{ name: string; url: string }>; next: string }> => {
|
|
48
56
|
const res = await fetch(`https://swapi.dev/api/people/?page=${pageParam}&search=${searchState}`)
|
|
49
57
|
return res.json()
|
|
50
58
|
}
|
|
51
59
|
|
|
52
|
-
const { data, isLoading, fetchNextPage, isFetchingNextPage, hasNextPage, isRefetching } =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
60
|
+
const { data, isLoading, fetchNextPage, isFetchingNextPage, hasNextPage, isRefetching } =
|
|
61
|
+
useInfiniteQuery({
|
|
62
|
+
enabled: true,
|
|
63
|
+
initialPageParam: '1',
|
|
64
|
+
queryKey: ['startrek-sg1', searchState],
|
|
65
|
+
queryFn: fetchSWAPI,
|
|
66
|
+
placeholderData: keepPreviousData,
|
|
67
|
+
getNextPageParam: (lastPage) => {
|
|
68
|
+
if (!lastPage.next) return undefined
|
|
69
|
+
const url = new URL(lastPage.next)
|
|
70
|
+
const params = new URLSearchParams(url.searchParams)
|
|
71
|
+
return params.get('page')
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const cachedPeople = queryClient
|
|
76
|
+
.getQueriesData({ queryKey: ['startrek-sg1'] })
|
|
77
|
+
.flatMap(([, cachedData]) => cachedData?.pages ?? [])
|
|
78
|
+
.flatMap((page) => page.results)
|
|
79
|
+
.map((item) => ({ label: item.name, value: item.url }))
|
|
80
|
+
const currentPeople = React.useMemo(
|
|
81
|
+
() =>
|
|
82
|
+
data?.pages
|
|
83
|
+
.flatMap((res) => res.results)
|
|
84
|
+
.flatMap((person) => ({ label: person.name, value: person.url })) || [],
|
|
85
|
+
[data],
|
|
86
|
+
)
|
|
68
87
|
|
|
69
88
|
// Expose the selected items and float them to the top
|
|
70
|
-
const mergedPeople = [...currentPeople, ...cachedPeople].filter(
|
|
89
|
+
const mergedPeople = [...currentPeople, ...cachedPeople].filter(
|
|
90
|
+
(item, index, a) => a.findIndex((currItem) => currItem.value === item.value) === index,
|
|
91
|
+
)
|
|
71
92
|
|
|
72
93
|
// Only show the current filtered people when there is a search query
|
|
73
|
-
const items = searchState !==
|
|
94
|
+
const items = searchState !== '' ? currentPeople : Array.from(mergedPeople)
|
|
74
95
|
const filteredCount = currentPeople.length
|
|
75
96
|
const totalCount = cachedPeople.length
|
|
76
97
|
|
|
@@ -81,11 +102,16 @@ const AsyncExample = () => {
|
|
|
81
102
|
isLoading={isLoading}
|
|
82
103
|
loadingSkeleton={<FilterMultiSelect.MenuLoadingSkeleton />}
|
|
83
104
|
items={items}
|
|
84
|
-
trigger={() =>
|
|
105
|
+
trigger={() => (
|
|
106
|
+
<FilterMultiSelect.TriggerButton
|
|
107
|
+
label="People"
|
|
108
|
+
selectedOptionLabels={getSelectedOptionLabels(new Set(selectedPeople), cachedPeople)}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
85
111
|
onSearchInputChange={setSearchState}
|
|
86
112
|
onOpenChange={setOpen}
|
|
87
113
|
onSelectionChange={(keys): void => {
|
|
88
|
-
if (keys ===
|
|
114
|
+
if (keys === 'all') return
|
|
89
115
|
setSelectedPeople(Array.from(keys) as string[])
|
|
90
116
|
}}
|
|
91
117
|
isOpen={open}
|
|
@@ -93,24 +119,49 @@ const AsyncExample = () => {
|
|
|
93
119
|
>
|
|
94
120
|
{(): JSX.Element => (
|
|
95
121
|
<>
|
|
96
|
-
<FilterMultiSelect.SearchInput isLoading={isRefetching && searchState !==
|
|
122
|
+
<FilterMultiSelect.SearchInput isLoading={isRefetching && searchState !== ''} />
|
|
97
123
|
<FilterMultiSelect.ListBox>
|
|
98
124
|
{({ selectedItems, unselectedItems, hasNoItems }) => (
|
|
99
125
|
<>
|
|
100
|
-
{hasNoItems
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
126
|
+
{hasNoItems ? (
|
|
127
|
+
<FilterMultiSelect.NoResults>
|
|
128
|
+
No results found for {searchState}.
|
|
129
|
+
</FilterMultiSelect.NoResults>
|
|
130
|
+
) : searchState !== '' ? (
|
|
131
|
+
<Text variant="extra-small" tag="span" color="dark-reduced-opacity">
|
|
132
|
+
Showing {filteredCount} of {totalCount}
|
|
133
|
+
</Text>
|
|
134
|
+
) : (
|
|
135
|
+
hasNextPage && (
|
|
136
|
+
<Text variant="extra-small" tag="span" color="dark-reduced-opacity">
|
|
137
|
+
There are a lot of options. Narrow them further by searching for a more
|
|
138
|
+
precise term.
|
|
139
|
+
</Text>
|
|
140
|
+
)
|
|
141
|
+
)}
|
|
142
|
+
<FilterMultiSelect.ListBoxSection
|
|
143
|
+
items={selectedItems}
|
|
144
|
+
sectionName="Selected items"
|
|
145
|
+
>
|
|
146
|
+
{(item) => <FilterMultiSelect.Option key={item.key} item={item} />}
|
|
108
147
|
</FilterMultiSelect.ListBoxSection>
|
|
109
|
-
{unselectedItems.length > 0 && selectedItems.length > 0 &&
|
|
110
|
-
|
|
111
|
-
|
|
148
|
+
{unselectedItems.length > 0 && selectedItems.length > 0 && (
|
|
149
|
+
<FilterMultiSelect.SectionDivider />
|
|
150
|
+
)}
|
|
151
|
+
<FilterMultiSelect.ListBoxSection
|
|
152
|
+
items={unselectedItems}
|
|
153
|
+
sectionName="Unselected items"
|
|
154
|
+
>
|
|
155
|
+
{(item) => <FilterMultiSelect.Option key={item.key} item={item} />}
|
|
112
156
|
</FilterMultiSelect.ListBoxSection>
|
|
113
|
-
{hasNextPage &&
|
|
157
|
+
{hasNextPage && (
|
|
158
|
+
<FilterMultiSelect.LoadMoreButton
|
|
159
|
+
label="View more"
|
|
160
|
+
workingLabel="Loading…"
|
|
161
|
+
working={isFetchingNextPage}
|
|
162
|
+
onClick={fetchNextPage}
|
|
163
|
+
/>
|
|
164
|
+
)}
|
|
114
165
|
</>
|
|
115
166
|
)}
|
|
116
167
|
</FilterMultiSelect.ListBox>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Canvas, Controls, Description, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, NoClipCanvas } from
|
|
3
|
-
import * as FilterSelectStickerSheet from
|
|
4
|
-
import * as FilterSelectStories from
|
|
1
|
+
import { Canvas, Controls, Description, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, NoClipCanvas } from '~storybook/components'
|
|
3
|
+
import * as FilterSelectStickerSheet from './FilterSelect.stickersheet.stories'
|
|
4
|
+
import * as FilterSelectStories from './FilterSelect.stories'
|
|
5
5
|
|
|
6
6
|
<Meta of={FilterSelectStories} />
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, DocsStory, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as GuidanceBlockStories from
|
|
1
|
+
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as GuidanceBlockStories from './GuidanceBlock.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={GuidanceBlockStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as HeadingStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as HeadingStories from './Heading.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={HeadingStories} />
|
|
6
6
|
|
|
@@ -15,6 +15,7 @@ import * as HeadingStories from "./Heading.stories"
|
|
|
15
15
|
<KAIOInstallation exportNames="Heading" />
|
|
16
16
|
|
|
17
17
|
## Overview
|
|
18
|
+
|
|
18
19
|
Renders a heading element `h1-h6` and applies styling for headings.
|
|
19
20
|
|
|
20
21
|
<Canvas of={HeadingStories.Playground} />
|
|
@@ -38,4 +39,3 @@ Use this variant only for the title within the composable header. [See documenta
|
|
|
38
39
|
Defaults to `h1` element.
|
|
39
40
|
|
|
40
41
|
<Canvas of={HeadingStories.ComposableHeaderTitle} />
|
|
41
|
-
|
package/src/Icon/_docs/Icon.mdx
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta, Story } from
|
|
2
|
-
import { ResourceLinks } from
|
|
3
|
-
import * as IconStories from
|
|
1
|
+
import { Canvas, Controls, Meta, Story } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks } from '~storybook/components'
|
|
3
|
+
import * as IconStories from './Icon.docs.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={IconStories} />
|
|
6
6
|
|
|
7
7
|
# Icon
|
|
8
8
|
|
|
9
|
-
<ResourceLinks
|
|
10
|
-
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Icons"
|
|
11
|
-
/>
|
|
9
|
+
<ResourceLinks sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Icons" />
|
|
12
10
|
|
|
13
11
|
## Installation
|
|
14
12
|
|
|
15
13
|
Each icon is imported separately, for example if you'd like the `AddIcon` you will use the following import.
|
|
16
14
|
|
|
17
15
|
```js
|
|
18
|
-
import { AddIcon } from
|
|
16
|
+
import { AddIcon } from '@kaizen/components'
|
|
19
17
|
```
|
|
20
18
|
|
|
21
19
|
See: Reference for all icons available to import.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as BrandMomentCaptureIntroStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as BrandMomentCaptureIntroStories from './BrandMomentCaptureIntro.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={BrandMomentCaptureIntroStories} />
|
|
6
6
|
|
|
@@ -18,6 +18,7 @@ import * as BrandMomentCaptureIntroStories from "./BrandMomentCaptureIntro.stori
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
20
|
Functionally similar to an animation Scene illustration but has 3 different states based on the properties passed in:
|
|
21
|
+
|
|
21
22
|
- An initial animation that is only ever played once, never looping.
|
|
22
23
|
- An ambient animation that can be looped.
|
|
23
24
|
- A static image that is not animated.
|
|
@@ -28,13 +29,19 @@ Functionally similar to an animation Scene illustration but has 3 different stat
|
|
|
28
29
|
## API
|
|
29
30
|
|
|
30
31
|
### Single animation
|
|
32
|
+
|
|
31
33
|
Will trigger the animation once.
|
|
34
|
+
|
|
32
35
|
<Canvas of={BrandMomentCaptureIntroStories.Animated} />
|
|
33
36
|
|
|
34
37
|
### Looped animation
|
|
38
|
+
|
|
35
39
|
Will render the a looped animation. Should be used with `isAnimated` to render the "initial" intro animation.
|
|
40
|
+
|
|
36
41
|
<Canvas of={BrandMomentCaptureIntroStories.Looped} />
|
|
37
42
|
|
|
38
43
|
### Autoplay disabled
|
|
44
|
+
|
|
39
45
|
If false will render the animation paused. This can be re-enabled clicking the pause sign on hover.
|
|
46
|
+
|
|
40
47
|
<Canvas of={BrandMomentCaptureIntroStories.Autoplay} />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as Stickersheets from
|
|
4
|
-
import * as SceneStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as Stickersheets from './Scene.stickersheet.stories'
|
|
4
|
+
import * as SceneStories from './Scene.stories'
|
|
5
5
|
|
|
6
6
|
<Meta of={SceneStories} />
|
|
7
7
|
|
|
@@ -12,10 +12,7 @@ import * as SceneStories from "./Scene.stories"
|
|
|
12
12
|
|
|
13
13
|
/>
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
<KAIOInstallation
|
|
17
|
-
exportNames="BrandMomentPositiveOutro"
|
|
18
|
-
/>
|
|
15
|
+
<KAIOInstallation exportNames="BrandMomentPositiveOutro" />
|
|
19
16
|
|
|
20
17
|
## Overview
|
|
21
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as StickerSheetStories from
|
|
4
|
-
import * as SpotIllustrationStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as StickerSheetStories from './Spot.stickersheet.stories'
|
|
4
|
+
import * as SpotIllustrationStories from './Spot.stories'
|
|
5
5
|
|
|
6
6
|
<Meta of={SpotIllustrationStories} />
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import { LinkTo } from
|
|
4
|
-
import * as InputStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import { LinkTo } from '~storybook/components/LinkTo'
|
|
4
|
+
import * as InputStories from './Input.stories'
|
|
5
5
|
|
|
6
6
|
<Meta of={InputStories} />
|
|
7
7
|
|
|
@@ -24,13 +24,17 @@ An input of different types. Usually part of compositions such as <LinkTo pageId
|
|
|
24
24
|
## API
|
|
25
25
|
|
|
26
26
|
### Types
|
|
27
|
+
|
|
27
28
|
<Canvas of={InputStories.Types} />
|
|
28
29
|
|
|
29
30
|
### Status
|
|
31
|
+
|
|
30
32
|
<Canvas of={InputStories.Status} />
|
|
31
33
|
|
|
32
34
|
### Icon adornments
|
|
35
|
+
|
|
33
36
|
<Canvas of={InputStories.Icons} />
|
|
34
37
|
|
|
35
38
|
### Reversed
|
|
39
|
+
|
|
36
40
|
<Canvas of={InputStories.Reversed} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as InputRangeStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as InputRangeStories from './InputRange.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={InputRangeStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as InputSearchStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as InputSearchStories from './InputSearch.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={InputSearchStories} />
|
|
6
6
|
|
|
@@ -23,6 +23,7 @@ A range of things.
|
|
|
23
23
|
## API
|
|
24
24
|
|
|
25
25
|
## Showing the clear button
|
|
26
|
+
|
|
26
27
|
Adding text will automatically show the clear button.
|
|
27
28
|
|
|
28
29
|
<Canvas of={InputSearchStories.Filled} />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import { Diff } from
|
|
3
|
-
import migrationBonus from
|
|
4
|
-
import migrationFETBonus from
|
|
5
|
-
import migrationFETToV1 from
|
|
6
|
-
import migrationToV1 from
|
|
1
|
+
import { Meta } from '@storybook/blocks'
|
|
2
|
+
import { Diff } from '~storybook/components'
|
|
3
|
+
import migrationBonus from './code-diffs/migration-bonus.diff?raw'
|
|
4
|
+
import migrationFETBonus from './code-diffs/migration-fe-template-bonus.diff?raw'
|
|
5
|
+
import migrationFETToV1 from './code-diffs/migration-fe-template-to-v1.diff?raw'
|
|
6
|
+
import migrationToV1 from './code-diffs/migration-to-v1.diff?raw'
|
|
7
7
|
|
|
8
8
|
<Meta title="Components/Kaizen Provider/Installation" />
|
|
9
9
|
|
|
@@ -11,19 +11,19 @@ import migrationToV1 from "./code-diffs/migration-to-v1.diff?raw"
|
|
|
11
11
|
|
|
12
12
|
Provides the necessary global contexts for all Kaizen components, as well as any global level Kaizen component/wrappers.
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
## Usage
|
|
16
15
|
|
|
17
16
|
Ideally, there should only be one `KaizenProvider` that should wrap your entire application.
|
|
18
17
|
|
|
19
18
|
```jsx
|
|
20
|
-
import { KaizenProvider } from
|
|
21
|
-
|
|
19
|
+
import { KaizenProvider } from '@kaizen/components'
|
|
20
|
+
;<KaizenProvider>
|
|
22
21
|
<App />
|
|
23
22
|
</KaizenProvider>
|
|
24
23
|
```
|
|
25
24
|
|
|
26
25
|
### Internationalization support
|
|
26
|
+
|
|
27
27
|
- [Internationalization in Kaizen](/story/components-kaizen-provider-internationalization-in-kaizen--docs)
|
|
28
28
|
|
|
29
29
|
## Migrating to KaizenProvider v1.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import { LinkTo } from
|
|
1
|
+
import { Meta } from '@storybook/blocks'
|
|
2
|
+
import { LinkTo } from '~storybook/components/LinkTo'
|
|
3
3
|
|
|
4
4
|
<Meta title="Components/Kaizen Provider/Internationalization in Kaizen" />
|
|
5
5
|
|
|
@@ -38,13 +38,13 @@ There is a slight difference in the implementation of the `KaizenProvider`, depe
|
|
|
38
38
|
For more information on `@cultureamp/i18n-react-intl`, see their docs here.
|
|
39
39
|
|
|
40
40
|
Note: This will work with StaticIntlProvider or DynamicIntlProvider.
|
|
41
|
-
```tsx
|
|
42
|
-
import { DynamicIntlProvider } from "@cultureamp/i18n-react-intl"
|
|
43
|
-
import { KaizenProvider } from "@kaizen/components"
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
```tsx
|
|
43
|
+
import { DynamicIntlProvider } from '@cultureamp/i18n-react-intl'
|
|
44
|
+
import { KaizenProvider } from '@kaizen/components'
|
|
45
|
+
;<DynamicIntlProvider>
|
|
46
46
|
<KaizenProvider>
|
|
47
|
-
|
|
47
|
+
<YourApp />
|
|
48
48
|
</KaizenProvider>
|
|
49
49
|
</DynamicIntlProvider>
|
|
50
50
|
```
|
|
@@ -54,9 +54,8 @@ import { KaizenProvider } from "@kaizen/components"
|
|
|
54
54
|
In these cases, you'll need to pass the current locale as a prop to the `KaizenProvider`, so it knows which language is currently active.
|
|
55
55
|
|
|
56
56
|
```tsx
|
|
57
|
-
import { KaizenProvider } from
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
<YourApp/>
|
|
57
|
+
import { KaizenProvider } from '@kaizen/components'
|
|
58
|
+
;<KaizenProvider locale={locale}>
|
|
59
|
+
<YourApp />
|
|
61
60
|
</KaizenProvider>
|
|
62
61
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as LabelStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as LabelStories from './Label.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LabelStories} />
|
|
6
6
|
|
|
@@ -23,12 +23,15 @@ Atomic `Label` component for use in `Field` components.
|
|
|
23
23
|
## API
|
|
24
24
|
|
|
25
25
|
### Variants
|
|
26
|
+
|
|
26
27
|
<Canvas of={LabelStories.Variant} />
|
|
27
28
|
|
|
28
29
|
### Types
|
|
30
|
+
|
|
29
31
|
<Canvas of={LabelStories.Types} />
|
|
30
32
|
|
|
31
33
|
### Position
|
|
34
|
+
|
|
32
35
|
By default, your label text will always sit to the right of the inline form control (ie. in RTL terms, the "end").
|
|
33
36
|
Using the `labelPosition` you can flip the label text to sit to the left (ie. in RTL terms, the "start").
|
|
34
37
|
|
|
@@ -37,6 +40,7 @@ Note: this only works when you have an inline form control passed in via `childr
|
|
|
37
40
|
<Canvas of={LabelStories.Position} />
|
|
38
41
|
|
|
39
42
|
### Label text
|
|
43
|
+
|
|
40
44
|
Adds text to your form control. `labelText` styling greatly depends on how you compose and what `labelType` you apply, please see Composing below for examples.
|
|
41
45
|
|
|
42
46
|
<Canvas of={LabelStories.LabelText} />
|
|
@@ -48,7 +52,9 @@ There are two different ways to utilise the `Label` component depending on the t
|
|
|
48
52
|
The main difference is that when dealing with an inline form control, the form control is passed as children.
|
|
49
53
|
|
|
50
54
|
#### Inline form controls
|
|
55
|
+
|
|
51
56
|
<Canvas of={LabelStories.InlineControls} />
|
|
52
57
|
|
|
53
58
|
#### Block form controls
|
|
59
|
+
|
|
54
60
|
<Canvas of={LabelStories.BlockControls} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as LabelledMessageStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as LabelledMessageStories from './LabelledMessage.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LabelledMessageStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as LikertScaleLegacyStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as LikertScaleLegacyStories from './LikertScaleLegacy.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LikertScaleLegacyStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, DocsStory, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, LinkTo } from
|
|
3
|
-
import * as LoadingGraphicStories from
|
|
1
|
+
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, LinkTo } from '~storybook/components'
|
|
3
|
+
import * as LoadingGraphicStories from './LoadingGraphic.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LoadingGraphicStories} />
|
|
6
6
|
|
|
@@ -19,9 +19,9 @@ import * as LoadingGraphicStories from "./LoadingGraphic.stories"
|
|
|
19
19
|
|
|
20
20
|
Loading skeleton for graphics
|
|
21
21
|
(<LinkTo pageId="components-icons">Icon</LinkTo>,
|
|
22
|
+
|
|
22
23
|
<LinkTo pageId="components-avatar">Avatar</LinkTo>,
|
|
23
|
-
<LinkTo pageId="components-illustrations-spot">Spot Illustration</LinkTo>,
|
|
24
|
-
Scene Illustration).
|
|
24
|
+
<LinkTo pageId="components-illustrations-spot">Spot Illustration</LinkTo>, Scene Illustration).
|
|
25
25
|
|
|
26
26
|
<Canvas of={LoadingGraphicStories.Playground} />
|
|
27
27
|
<Controls of={LoadingGraphicStories.Playground} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, DocsStory, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, LinkTo } from
|
|
3
|
-
import * as LoadingHeadingStories from
|
|
1
|
+
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, LinkTo } from '~storybook/components'
|
|
3
|
+
import * as LoadingHeadingStories from './LoadingHeading.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LoadingHeadingStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, DocsStory, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, LinkTo } from
|
|
3
|
-
import * as LoadingInputStories from
|
|
1
|
+
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, LinkTo } from '~storybook/components'
|
|
3
|
+
import * as LoadingInputStories from './LoadingInput.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LoadingInputStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, DocsStory, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation, LinkTo } from
|
|
3
|
-
import * as LoadingParagraphStories from
|
|
1
|
+
import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, LinkTo } from '~storybook/components'
|
|
3
|
+
import * as LoadingParagraphStories from './LoadingParagraph.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LoadingParagraphStories} />
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as LoadingSpinnerStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as LoadingSpinnerStories from './LoadingSpinner.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={LoadingSpinnerStories} />
|
|
6
6
|
|
|
@@ -44,4 +44,3 @@ Below is an example of how to apply the current color tokens used in designs.
|
|
|
44
44
|
Generally use `"md"` (default value) unless spinner is inside a form field, in which case use `sm`. The `xs` size is for buttons or content dense layouts.
|
|
45
45
|
|
|
46
46
|
<Canvas of={LoadingSpinnerStories.Size} />
|
|
47
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Controls, Meta } from
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from
|
|
3
|
-
import * as ConfirmationModalStories from
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
+
import * as ConfirmationModalStories from './ConfirmationModal.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={ConfirmationModalStories} />
|
|
6
6
|
|