@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.
Files changed (136) hide show
  1. package/codemods/README.md +2 -1
  2. package/dist/cjs/__overlays__/Tooltip/v3/Tooltip.cjs +1 -1
  3. package/dist/esm/Calendar/CalendarPopover/CalendarPopover.mjs +1 -1
  4. package/dist/esm/EmptyState/EmptyState.mjs +1 -1
  5. package/dist/esm/Filter/FilterMultiSelect/subcomponents/ListBox/ListBox.mjs +1 -1
  6. package/dist/esm/MultiSelect/subcomponents/Popover/Popover.mjs +1 -1
  7. package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +1 -1
  8. package/dist/esm/RichTextEditor/RichTextEditor/schema.mjs +1 -1
  9. package/dist/esm/RichTextEditor/utils/schema/nodes.mjs +1 -1
  10. package/dist/esm/TimeField/TimeField.mjs +1 -1
  11. package/dist/esm/__overlays__/Tooltip/v1/Tooltip.mjs +1 -1
  12. package/dist/esm/__overlays__/Tooltip/v3/Tooltip.mjs +1 -1
  13. package/dist/styles.css +50 -50
  14. package/dist/types/__overlays__/Tooltip/v3/Tooltip.d.ts +1 -1
  15. package/package.json +30 -30
  16. package/src/Avatar/_docs/Avatar.mdx +3 -4
  17. package/src/AvatarGroup/_docs/AvatarGroup.mdx +3 -3
  18. package/src/Badge/_docs/Badge.mdx +3 -3
  19. package/src/Brand/_docs/Brand.mdx +3 -4
  20. package/src/BrandMoment/_docs/BrandMoment.mdx +3 -3
  21. package/src/ButtonGroup/_docs/ButtonGroup.mdx +3 -3
  22. package/src/Calendar/CalendarRange/_docs/CalendarRange.mdx +3 -3
  23. package/src/Calendar/CalendarSingle/_docs/CalendarSingle.mdx +3 -3
  24. package/src/Card/_docs/Card.mdx +5 -4
  25. package/src/Checkbox/Checkbox/_docs/Checkbox.mdx +4 -5
  26. package/src/Checkbox/CheckboxField/_docs/CheckboxField.mdx +5 -3
  27. package/src/Checkbox/CheckboxGroup/_docs/CheckboxGroup.mdx +4 -3
  28. package/src/Collapsible/Collapsible/_docs/Collapsible.mdx +3 -3
  29. package/src/Collapsible/CollapsibleGroup/_docs/CollapsibleGroup.mdx +8 -7
  30. package/src/Collapsible/ExpertAdviceCollapsible/_docs/ExpertAdviceCollapsible.mdx +3 -3
  31. package/src/Container/_docs/Container.mdx +6 -4
  32. package/src/Content/_docs/Content.mdx +6 -4
  33. package/src/DatePicker/_docs/DatePicker.mdx +3 -3
  34. package/src/DateRangePicker/_docs/DateRangePicker.mdx +3 -4
  35. package/src/Divider/_docs/Divider.mdx +3 -3
  36. package/src/EmptyState/_docs/EmptyState.mdx +3 -3
  37. package/src/ErrorPage/_docs/ErrorPage.mdx +3 -3
  38. package/src/FieldGroup/_docs/FieldGroup.mdx +6 -4
  39. package/src/FieldMessage/_docs/FieldMessage.mdx +3 -4
  40. package/src/Filter/Filter/_docs/Filter.mdx +13 -14
  41. package/src/Filter/FilterBar/_docs/FilterBar.mdx +49 -48
  42. package/src/Filter/FilterButton/_docs/filter-buttons.mdx +5 -5
  43. package/src/Filter/FilterDatePicker/_docs/FilterDatePicker.mdx +8 -3
  44. package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.mdx +9 -3
  45. package/src/Filter/FilterMultiSelect/_docs/FilterMultiSelect.mdx +90 -39
  46. package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.spec.tsx +1 -0
  47. package/src/Filter/FilterSelect/_docs/FilterSelect.mdx +4 -4
  48. package/src/GuidanceBlock/_docs/GuidanceBlock.mdx +3 -3
  49. package/src/Heading/_docs/Heading.mdx +4 -4
  50. package/src/Icon/_docs/Icon.mdx +5 -7
  51. package/src/Illustration/Scene/BrandMomentCaptureIntro/_docs/BrandMomentCaptureIntro.mdx +10 -3
  52. package/src/Illustration/Scene/_docs/Scene.mdx +5 -8
  53. package/src/Illustration/Spot/_docs/Spot.mdx +4 -4
  54. package/src/Input/Input/_docs/Input.mdx +8 -4
  55. package/src/Input/InputRange/_docs/InputRange.mdx +3 -3
  56. package/src/Input/InputSearch/_docs/InputSearch.mdx +4 -3
  57. package/src/KaizenProvider/_docs/KaizenProvider.mdx +9 -9
  58. package/src/KaizenProvider/_docs/internationalization-in-kaizen.mdx +10 -11
  59. package/src/Label/_docs/Label.mdx +9 -3
  60. package/src/LabelledMessage/_docs/LabelledMessage.mdx +3 -3
  61. package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.mdx +3 -3
  62. package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.mdx +5 -5
  63. package/src/Loading/LoadingHeading/_docs/LoadingHeading.mdx +3 -3
  64. package/src/Loading/LoadingInput/_docs/LoadingInput.mdx +3 -3
  65. package/src/Loading/LoadingParagraph/_docs/LoadingParagraph.mdx +3 -3
  66. package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.mdx +3 -4
  67. package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +3 -3
  68. package/src/Modal/ContextModal/_docs/ContextModal.mdx +6 -3
  69. package/src/Modal/GenericModal/_docs/GenericModal.mdx +5 -4
  70. package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +3 -4
  71. package/src/MultiSelect/_docs/MultiSelect.mdx +3 -4
  72. package/src/Notification/GlobalNotification/_docs/GlobalNotification.mdx +3 -3
  73. package/src/Notification/InlineNotification/_docs/InlineNotification.mdx +3 -4
  74. package/src/Notification/ToastNotification/_docs/ToastNotification.mdx +3 -3
  75. package/src/Pagination/_docs/Pagination.mdx +3 -3
  76. package/src/Pagination/subcomponents/DirectionalLink/_docs/DirectionalLink.mdx +3 -3
  77. package/src/Pagination/subcomponents/PaginationLink/_docs/PaginationLink.mdx +3 -3
  78. package/src/Popover/_docs/Popover.mdx +12 -10
  79. package/src/ProgressBar/_docs/ProgressBar.mdx +3 -4
  80. package/src/Radio/Radio/_docs/Radio.mdx +4 -4
  81. package/src/Radio/RadioField/_docs/RadioField.mdx +3 -3
  82. package/src/Radio/RadioGroup/_docs/RadioGroup.mdx +3 -3
  83. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.mdx +7 -10
  84. package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.mdx +3 -5
  85. package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.mdx +7 -9
  86. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.mdx +3 -3
  87. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/_docs/Toolbar.mdx +3 -3
  88. package/src/SearchField/_docs/SearchField.mdx +3 -3
  89. package/src/Select/_docs/Select.mdx +7 -3
  90. package/src/Skirt/_docs/Skirt.mdx +4 -4
  91. package/src/Slider/_docs/Slider.mdx +3 -3
  92. package/src/SplitButton/_docs/SplitButton.mdx +4 -3
  93. package/src/Table/_docs/Table.mdx +19 -6
  94. package/src/Tabs/_docs/Tabs.mdx +4 -7
  95. package/src/Tag/_docs/Tag.mdx +16 -5
  96. package/src/Text/_docs/Text.mdx +3 -3
  97. package/src/TextArea/_docs/TextArea.mdx +5 -4
  98. package/src/TextAreaField/_docs/TextAreaField.mdx +9 -4
  99. package/src/TextField/_docs/TextField.mdx +9 -4
  100. package/src/Tile/InformationTile/_docs/InformationTile.mdx +5 -4
  101. package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +5 -3
  102. package/src/Tile/TileGrid/_docs/TileGrid.mdx +3 -3
  103. package/src/TimeField/_docs/TimeField.mdx +3 -3
  104. package/src/TitleBlockZen/_docs/TitleBlockZen.mdx +5 -3
  105. package/src/ToggleSwitch/ToggleSwitch/_docs/ToggleSwitch.mdx +3 -3
  106. package/src/ToggleSwitch/ToggleSwitchField/_docs/ToggleSwitchField.mdx +3 -3
  107. package/src/VisuallyHidden/_docs/VisuallyHidden.mdx +6 -4
  108. package/src/Well/_docs/Well.mdx +5 -5
  109. package/src/Workflow/_docs/ProgressStepper.mdx +3 -3
  110. package/src/Workflow/_docs/Workflow.mdx +25 -19
  111. package/src/Workflow/_docs/WorkflowFooter.mdx +3 -3
  112. package/src/Workflow/_docs/WorkflowHeader.mdx +3 -3
  113. package/src/__actions__/Button/v1/Button/_docs/Button.mdx +4 -4
  114. package/src/__actions__/Button/v1/IconButton/_docs/IconButton.mdx +3 -3
  115. package/src/__actions__/Button/v2/Button/_docs/Button.mdx +4 -4
  116. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.mdx +3 -3
  117. package/src/__actions__/Button/v3/_docs/Button--api-specification.mdx +49 -17
  118. package/src/__actions__/Button/v3/_docs/Button--usage-guidelines.mdx +8 -6
  119. package/src/__actions__/Menu/v1/_docs/Menu.mdx +3 -4
  120. package/src/__actions__/Menu/v2/_docs/Menu.mdx +8 -4
  121. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +35 -24
  122. package/src/__actions__/Menu/v3/_docs/Menu.mdx +52 -39
  123. package/src/__future__/Icon/_docs/Icon--api-specification.mdx +17 -10
  124. package/src/__future__/Icon/_docs/Icon--usage-guidelines.mdx +5 -4
  125. package/src/__future__/Select/_docs/Select.mdx +9 -5
  126. package/src/__future__/Tabs/_docs/Tabs--api-specification.mdx +4 -8
  127. package/src/__future__/Tabs/_docs/Tabs--migration-guide.mdx +11 -4
  128. package/src/__future__/Tag/RemovableTag/_docs/RemovableTag.mdx +4 -6
  129. package/src/__future__/Tag/Tag/_docs/Tag-migration-guide.mdx +12 -20
  130. package/src/__future__/Tag/Tag/_docs/Tag.mdx +3 -4
  131. package/src/__overlays__/Focusable/v3/_docs/ApiSpecification.mdx +14 -13
  132. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.mdx +5 -7
  133. package/src/__overlays__/Tooltip/v2/_docs/Tooltip.mdx +5 -6
  134. package/src/__overlays__/Tooltip/v3/Tooltip.tsx +3 -2
  135. package/src/__overlays__/Tooltip/v3/_docs/ApiSpecification.mdx +50 -46
  136. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.mdx +63 -48
@@ -1,6 +1,6 @@
1
- import { Canvas, Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as ExpertAdviceCollapsibleStories from "./ExpertAdviceCollapsible.stories"
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as ExpertAdviceCollapsibleStories from './ExpertAdviceCollapsible.stories'
4
4
 
5
5
  <Meta of={ExpertAdviceCollapsibleStories} />
6
6
 
@@ -1,7 +1,7 @@
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 ContainerStories from "./Container.stories"
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 ContainerStories from './Container.stories'
5
5
 
6
6
  <Meta of={ContainerStories} />
7
7
 
@@ -23,5 +23,7 @@ Wraps your entire page.
23
23
  <Controls of={ContainerStories.Playground} />
24
24
 
25
25
  ## Use Case
26
+
26
27
  Usually wraps a <LinkTo pageId="components-content">Content</LinkTo> component.
28
+
27
29
  <Canvas of={ContainerStories.Example} />
@@ -1,7 +1,7 @@
1
- import { Canvas, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import { LinkTo } from "~storybook/components/LinkTo"
4
- import * as ContentStories from "./Content.stories"
1
+ import { Canvas, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import { LinkTo } from '~storybook/components/LinkTo'
4
+ import * as ContentStories from './Content.stories'
5
5
 
6
6
  <Meta of={ContentStories} />
7
7
 
@@ -22,5 +22,7 @@ Wraps your content at a **page level** in the standard minimum width and margins
22
22
  <Canvas of={ContentStories.Playground} />
23
23
 
24
24
  ## Use Case
25
+
25
26
  Usually wrapped in a <LinkTo pageId="components-container">Container</LinkTo>
27
+
26
28
  <Canvas of={ContentStories.Example} />
@@ -1,6 +1,6 @@
1
- import { Canvas, Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as DatePickerStories from "./DatePicker.stories"
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as DatePickerStories from './DatePicker.stories'
4
4
 
5
5
  <Meta of={DatePickerStories} />
6
6
 
@@ -1,6 +1,6 @@
1
- import { Canvas, DocsStory, Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as DateRangePickerStories from "./DateRangePicker.stories"
1
+ import { Canvas, DocsStory, Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as DateRangePickerStories from './DateRangePicker.stories'
4
4
 
5
5
  <Meta of={DateRangePickerStories} />
6
6
 
@@ -24,7 +24,6 @@ Date range picker form field.
24
24
  <Canvas of={DateRangePickerStories.Playground} />
25
25
  <Controls of={DateRangePickerStories.Playground} />
26
26
 
27
-
28
27
  ## Responsive behaviour
29
28
 
30
29
  As both the `DatePicker` and `DateRangePicker` use the `CalendarPopover` component under the hood, they share the same responsive behaviour. You can read more on this [here](/docs/components-date-controls-datepicker--docs#responsive-behaviour).
@@ -1,6 +1,6 @@
1
- import { Canvas, Controls, DocsStory, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as DividerStories from "./Divider.stories"
1
+ import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as DividerStories from './Divider.stories'
4
4
 
5
5
  <Meta of={DividerStories} />
6
6
 
@@ -1,6 +1,6 @@
1
- import { Canvas, Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as EmptyStateStories from "./EmptyState.stories"
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as EmptyStateStories from './EmptyState.stories'
4
4
 
5
5
  <Meta of={EmptyStateStories} />
6
6
 
@@ -1,6 +1,6 @@
1
- import { Canvas, Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as ErrorPageStories from "./ErrorPage.stories"
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as ErrorPageStories from './ErrorPage.stories'
4
4
 
5
5
  <Meta of={ErrorPageStories} />
6
6
 
@@ -1,7 +1,7 @@
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 FieldGroupStories from "./FieldGroup.stories"
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 FieldGroupStories from './FieldGroup.stories'
5
5
 
6
6
  <Meta of={FieldGroupStories} />
7
7
 
@@ -24,9 +24,11 @@ A simple wrapper to wrap form field components and their related siblings. This
24
24
  ## API
25
25
 
26
26
  ### Inline
27
+
27
28
  Changes the FieldGroup to an inline element with no bottom margin. This can be seen in the `Slider`<LinkTo pageId="components-slider--docs">component</LinkTo>. You can see inline vs block scope in the following stories:
28
29
 
29
30
  #### Inline
31
+
30
32
  <Canvas of={FieldGroupStories.Inline} />
31
33
 
32
34
  #### Default (block)
@@ -1,6 +1,6 @@
1
- import { Canvas, Controls, DocsStory, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
- import * as FieldMessageStories from "./FieldMessage.stories"
1
+ import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation } from '~storybook/components'
3
+ import * as FieldMessageStories from './FieldMessage.stories'
4
4
 
5
5
  <Meta of={FieldMessageStories} />
6
6
 
@@ -36,7 +36,6 @@ Simple `string`s will be wrapped in a `p` tag with the default `small` text styl
36
36
 
37
37
  Note that when using this for helper text, the component should not recieve `status` - this is reserved for validation messages.
38
38
 
39
-
40
39
  ### Status
41
40
 
42
41
  `status` can used to create form validation message that provide additional context to a form field's state, ie: `error`, `caution` or `success`.
@@ -1,7 +1,7 @@
1
- import { Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation, NoClipCanvas } from "~storybook/components"
3
- import { LinkTo } from "~storybook/components/LinkTo"
4
- import * as FilterStories from "./Filter.stories"
1
+ import { Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation, NoClipCanvas } from '~storybook/components'
3
+ import { LinkTo } from '~storybook/components/LinkTo'
4
+ import * as FilterStories from './Filter.stories'
5
5
 
6
6
  <Meta of={FilterStories} />
7
7
 
@@ -14,11 +14,12 @@ import * as FilterStories from "./Filter.stories"
14
14
 
15
15
  />
16
16
 
17
- <KAIOInstallation exportNames={["Filter", "FilterContents"]} />
17
+ <KAIOInstallation exportNames={['Filter', 'FilterContents']} />
18
18
 
19
19
  ## Overview
20
20
 
21
21
  These components are mainly used for constructing Filter components (eg. <LinkTo pageId="components-filter-select">FilterSelect</LinkTo>):
22
+
22
23
  - <LinkTo pageId="components-filter-filter-buttons">FilterButton</LinkTo> for the renderTrigger
23
24
  - `FilterContents` to wrap the contents within a Filter
24
25
 
@@ -51,7 +52,6 @@ type TriggerButtonProps = {
51
52
  onClick: () => void // Calls `setIsOpen(!isOpen)`
52
53
  isOpen: boolean // The value from the `isOpen` prop
53
54
  }
54
-
55
55
  ```
56
56
 
57
57
  If a `ref` is provided to the FilterButton it will be used, otherwise a fallback `ref`
@@ -61,16 +61,14 @@ will be created (this is required to tie the trigger to the popover).
61
61
  type FilterTriggerRef = {
62
62
  ref: { triggerRef?: React.RefObject<HTMLButtonElement> }
63
63
  }
64
-
65
64
  ```
66
65
 
67
66
  #### Simple Filter
68
67
 
69
68
  ```tsx
70
- <Filter {...props}
71
- renderTrigger={(triggerProps): JSX.Element => (
72
- <FilterButton label="Label" {...triggerProps} />
73
- )}
69
+ <Filter
70
+ {...props}
71
+ renderTrigger={(triggerProps): JSX.Element => <FilterButton label="Label" {...triggerProps} />}
74
72
  />
75
73
  ```
76
74
 
@@ -79,11 +77,12 @@ type FilterTriggerRef = {
79
77
  #### Removable Filter
80
78
 
81
79
  ```tsx
82
- <Filter {...props}
80
+ <Filter
81
+ {...props}
83
82
  renderTrigger={(triggerProps): JSX.Element => (
84
83
  <FilterButtonRemovable
85
- triggerButtonProps={{ label: "Label", ...triggerProps }}
86
- removeButtonProps={{ onClick: action("remove button clicked") }}
84
+ triggerButtonProps={{ label: 'Label', ...triggerProps }}
85
+ removeButtonProps={{ onClick: action('remove button clicked') }}
87
86
  />
88
87
  )}
89
88
  />
@@ -1,7 +1,7 @@
1
- import { Controls, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation, NoClipCanvas } from "~storybook/components"
3
- import { LinkTo } from "~storybook/components/LinkTo"
4
- import * as FilterBarStories from "./FilterBar.stories"
1
+ import { Controls, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation, NoClipCanvas } from '~storybook/components'
3
+ import { LinkTo } from '~storybook/components/LinkTo'
4
+ import * as FilterBarStories from './FilterBar.stories'
5
5
 
6
6
  <Meta of={FilterBarStories} />
7
7
 
@@ -37,7 +37,7 @@ We also provide a `Filters` type which can accept the same generic to provide im
37
37
  `ValuesMap` should be in the shape of `{ [filterId]: filterValueType }`.
38
38
 
39
39
  ```tsx
40
- import { FilterBar, Filters } from "@kaizen/components"
40
+ import { FilterBar, Filters } from '@kaizen/components'
41
41
 
42
42
  type ValuesMap = {
43
43
  filterId1: string
@@ -45,21 +45,15 @@ type ValuesMap = {
45
45
  }
46
46
 
47
47
  const [values, setValues] = useState<Partial<ValuesMap>>({
48
- filterId1: "default-value"
48
+ filterId1: 'default-value',
49
49
  })
50
50
 
51
51
  const filters = [
52
- { id: "filterId1", ...rest },
53
- { id: "filterId2", ...rest },
52
+ { id: 'filterId1', ...rest },
53
+ { id: 'filterId2', ...rest },
54
54
  ] satisfies Filters<ValuesMap>
55
55
 
56
- return (
57
- <FilterBar<ValuesMap>
58
- filters={filters}
59
- values={values}
60
- onValuesChange={setValues}
61
- />
62
- )
56
+ return <FilterBar<ValuesMap> filters={filters} values={values} onValuesChange={setValues} />
63
57
  ```
64
58
 
65
59
  ### `filters`
@@ -71,7 +65,7 @@ The `filters` prop is an array of attributes used to create the list of filters.
71
65
  We provide a `Filters<ValuesMap>` type you can use for improved type safety.
72
66
 
73
67
  ```tsx
74
- import { FilterBar, Filters, DateRange, FilterMultiSelect } from "@kaizen/components"
68
+ import { FilterBar, Filters, DateRange, FilterMultiSelect } from '@kaizen/components'
75
69
 
76
70
  type ValuesMap = {
77
71
  filterId1: string
@@ -81,13 +75,13 @@ type ValuesMap = {
81
75
 
82
76
  const filters = [
83
77
  {
84
- id: "filterId1",
85
- name: "Filter 1",
78
+ id: 'filterId1',
79
+ name: 'Filter 1',
86
80
  Component: <FilterBar.Select {...props} />,
87
81
  },
88
82
  {
89
- id: "filterId2",
90
- name: "Filter 2",
83
+ id: 'filterId2',
84
+ name: 'Filter 2',
91
85
  Component: (
92
86
  <FilterBar.MultiSelect {...props}>
93
87
  {/* Compose your structure using subcomponents of FilterMultiSelect */}
@@ -96,11 +90,11 @@ const filters = [
96
90
  ),
97
91
  },
98
92
  {
99
- id: "filterId3",
100
- name: "Filter 3",
93
+ id: 'filterId3',
94
+ name: 'Filter 3',
101
95
  Component: <FilterBar.DateRangePicker {...props} />,
102
96
  isRemovable: true,
103
- isUsableWhen: state => state.filterId1.value !== undefined
97
+ isUsableWhen: (state) => state.filterId1.value !== undefined,
104
98
  },
105
99
  ] satisfies Filters<ValuesMap>
106
100
  ```
@@ -133,6 +127,7 @@ Provided Filter components are built on top of their base component, and have th
133
127
  If the component comes with an `onChange` (or similar) prop, it will be made optional and it can be used for additional actions (eg. adding analytics).
134
128
 
135
129
  Available Filter components:
130
+
136
131
  - `<FilterBar.DatePicker>` - extends <LinkTo pageId="components-filter-date-picker">FilterDatePicker</LinkTo>
137
132
  - `selectedDate` is omitted
138
133
  - `onDateChange` is now optional
@@ -176,23 +171,28 @@ type ValuesMap = {
176
171
 
177
172
  const filters = [
178
173
  {
179
- id: "coffee",
180
- name: "Coffee",
181
- Component: <FilterBar.Select items={[
182
- { value: "long-black", label: "Long Black" },
183
- { value: "latte", label: "Latte" },
184
- ]} />,
174
+ id: 'coffee',
175
+ name: 'Coffee',
176
+ Component: (
177
+ <FilterBar.Select
178
+ items={[
179
+ { value: 'long-black', label: 'Long Black' },
180
+ { value: 'latte', label: 'Latte' },
181
+ ]}
182
+ />
183
+ ),
185
184
  },
186
185
  {
187
- id: "milk",
188
- name: "Milk",
186
+ id: 'milk',
187
+ name: 'Milk',
189
188
  Component: <FilterBar.Select {...props} />,
190
- isUsableWhen: state => state.coffee.value === "latte",
189
+ isUsableWhen: (state) => state.coffee.value === 'latte',
191
190
  },
192
191
  ] satisfies Filters<ValuesMap>
193
192
  ```
194
193
 
195
194
  The `state` arg will provide you with the following attributes for all the filters (mapped to the keys of the `ValuesMap`):
195
+
196
196
  ```
197
197
  id: keyof ValuesMap
198
198
  name: string
@@ -201,6 +201,7 @@ isActive: boolean
201
201
  ```
202
202
 
203
203
  When a dependent filter has not met its condition (not _Usable_):
204
+
204
205
  - it will be removed from the FilterBar
205
206
  - if it has a value, the value will be cleared
206
207
 
@@ -223,12 +224,10 @@ type ValuesMap = {
223
224
  // @note: Unless you are providing a default value for all the filters,
224
225
  // you will want to wrap it in Partial.
225
226
  const [values, setValues] = useState<Partial<ValuesMap>>({
226
- filterId1: "default-value"
227
+ filterId1: 'default-value',
227
228
  })
228
229
 
229
- return (
230
- <FilterBar<ValuesMap> values={values} {...rest} />
231
- )
230
+ return <FilterBar<ValuesMap> values={values} {...rest} />
232
231
  ```
233
232
 
234
233
  ### `onValuesChange`
@@ -247,6 +246,7 @@ Filters that do not meet their condition will not be shown amongst the Active Fi
247
246
  See [filter attribute `isUsableWhen`](#isusablewhen-state-filtersstatevaluesmap--boolean) for api.
248
247
 
249
248
  This example shows the following dependencies:
249
+
250
250
  - **Milk** is only usable when **Coffee** _is Latte_
251
251
  - `isUsableWhen: state => state.coffee.value === "latte"`
252
252
  - An initial value of _Full Cream_ is passed in, but immediately cleared
@@ -283,10 +283,10 @@ type Values = {
283
283
  * Using `getFilterState` as dependency source is known
284
284
  */
285
285
  const ExampleDependentFilter = () => {
286
- const { getFilterState } = useFilterBarContext<Values["dependent"], Values>()
287
- const sourceFilter = getFilterState("source")
286
+ const { getFilterState } = useFilterBarContext<Values['dependent'], Values>()
287
+ const sourceFilter = getFilterState('source')
288
288
  const items = retrieveItems(sourceFilter.value)
289
- return (<FilterBar.Select<Option> id="dependent" items={items} />)
289
+ return <FilterBar.Select<Option> id="dependent" items={items} />
290
290
  }
291
291
 
292
292
  /**
@@ -301,13 +301,13 @@ const ExampleDependentFilter = (props: {
301
301
  const { getActiveFilterValues } = useFilterBarContext<Values[Id], Values>()
302
302
  const activeValues = getActiveFilterValues()
303
303
  const items = props.retrieveItemsCallback(activeValues)
304
- return (<FilterBar.Select<Option> id={props.id} items={items} />)
304
+ return <FilterBar.Select<Option> id={props.id} items={items} />
305
305
  }
306
306
 
307
307
  const CustomFilterBar = () => {
308
308
  const filters = [
309
- { id: "source", ...rest },
310
- { id: "dependent", Component: <ExampleDependentFilter />, ...rest },
309
+ { id: 'source', ...rest },
310
+ { id: 'dependent', Component: <ExampleDependentFilter />, ...rest },
311
311
  ] satisfies Filters<Values>
312
312
 
313
313
  return <FilterBar<Values> filters={filters} {...rest} />
@@ -331,6 +331,7 @@ Out of the box, we do not make assumptions about your state management tool, so
331
331
  the types to match the expected format of your chosen query param library.
332
332
 
333
333
  The following example uses the
334
+
334
335
  <a href="https://www.npmjs.com/package/serialize-query-params">serialize-query-params</a>
335
336
  and <a href="https://www.npmjs.com/package/query-string">query-string</a>
336
337
  packages.
@@ -357,14 +358,14 @@ type Values = {
357
358
  }
358
359
 
359
360
  const CycleFilter = () => {
360
- const { openFilter } = useFilterBarContext<Values["cycle"], Values>()
361
+ const { openFilter } = useFilterBarContext<Values['cycle'], Values>()
361
362
 
362
363
  return (
363
364
  <FilterBar.Select
364
365
  id="cycle"
365
- items={[{ value: "custom", label: "Custom Range" }]}
366
- onSelectionChange={key => {
367
- if (key === "custom") openFilter("customRange")
366
+ items={[{ value: 'custom', label: 'Custom Range' }]}
367
+ onSelectionChange={(key) => {
368
+ if (key === 'custom') openFilter('customRange')
368
369
  }}
369
370
  />
370
371
  )
@@ -372,8 +373,8 @@ const CycleFilter = () => {
372
373
 
373
374
  const CustomFilterBar = () => {
374
375
  const filters = [
375
- { id: "cycle", Component: <CycleFilter />, ...rest },
376
- { id: "customRange", isUsableWhen: state => state.cycle.value === "custom", ...rest },
376
+ { id: 'cycle', Component: <CycleFilter />, ...rest },
377
+ { id: 'customRange', isUsableWhen: (state) => state.cycle.value === 'custom', ...rest },
377
378
  ] satisfies Filters<Values>
378
379
 
379
380
  return <FilterBar<Values> filters={filters} {...rest} />
@@ -1,7 +1,7 @@
1
- import { Canvas, Controls, DocsStory, Meta } from "@storybook/blocks"
2
- import { KAIOInstallation, ResourceLinks } from "~storybook/components"
3
- import * as FilterButtonExamples from "./FilterButton.stories"
4
- import * as FilterButtonRemovableExamples from "./FilterButtonRemovable.stories"
1
+ import { Canvas, Controls, DocsStory, Meta } from '@storybook/blocks'
2
+ import { KAIOInstallation, ResourceLinks } from '~storybook/components'
3
+ import * as FilterButtonExamples from './FilterButton.stories'
4
+ import * as FilterButtonRemovableExamples from './FilterButtonRemovable.stories'
5
5
 
6
6
  <Meta title="Components/Filter Base/Filter Buttons" />
7
7
 
@@ -14,7 +14,7 @@ import * as FilterButtonRemovableExamples from "./FilterButtonRemovable.stories"
14
14
 
15
15
  Trigger buttons for use by components using the `<Filter>` abstraction.
16
16
 
17
- <KAIOInstallation exportNames={["FilterButton", "FilterButtonRemovable"]} />
17
+ <KAIOInstallation exportNames={['FilterButton', 'FilterButtonRemovable']} />
18
18
 
19
19
  ## Filter Button
20
20
 
@@ -1,6 +1,6 @@
1
- import { Controls, Description, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation, NoClipCanvas } from "~storybook/components"
3
- import * as FilterDPStories from "./FilterDatePicker.stories"
1
+ import { Controls, Description, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation, NoClipCanvas } from '~storybook/components'
3
+ import * as FilterDPStories from './FilterDatePicker.stories'
4
4
 
5
5
  <Meta of={FilterDPStories} />
6
6
 
@@ -18,23 +18,28 @@ Date Picker to use for Filtering by a single date.
18
18
  <KAIOInstallation exportNames="FilterDatePicker" />
19
19
 
20
20
  ## Playground
21
+
21
22
  <NoClipCanvas of={FilterDPStories.Playground} />
22
23
  <Controls of={FilterDPStories.Playground} />
23
24
 
24
25
  ## API
25
26
 
26
27
  ### Render Trigger
28
+
27
29
  <Description of={FilterDPStories.RenderTrigger} />
28
30
  <NoClipCanvas of={FilterDPStories.RenderTrigger} />
29
31
 
30
32
  ### Description
33
+
31
34
  <Description of={FilterDPStories.Description} />
32
35
  <NoClipCanvas of={FilterDPStories.Description} />
33
36
 
34
37
  ### Extend Input Props
38
+
35
39
  <Description of={FilterDPStories.ExtendInputProps} />
36
40
  <NoClipCanvas of={FilterDPStories.ExtendInputProps} />
37
41
 
38
42
  ### Validation
43
+
39
44
  <Description of={FilterDPStories.Validation} />
40
45
  <NoClipCanvas of={FilterDPStories.Validation} />
@@ -1,6 +1,6 @@
1
- import { Controls, Description, Meta } from "@storybook/blocks"
2
- import { ResourceLinks, KAIOInstallation, NoClipCanvas } from "~storybook/components"
3
- import * as FilterDRPStories from "./FilterDateRangePicker.stories"
1
+ import { Controls, Description, Meta } from '@storybook/blocks'
2
+ import { ResourceLinks, KAIOInstallation, NoClipCanvas } from '~storybook/components'
3
+ import * as FilterDRPStories from './FilterDateRangePicker.stories'
4
4
 
5
5
  <Meta of={FilterDRPStories} />
6
6
 
@@ -18,27 +18,33 @@ Date Range Picker to use for Filtering.
18
18
  <KAIOInstallation exportNames="FilterDateRangePicker" />
19
19
 
20
20
  ## Playground
21
+
21
22
  <NoClipCanvas of={FilterDRPStories.Playground} />
22
23
  <Controls of={FilterDRPStories.Playground} />
23
24
 
24
25
  ## API
25
26
 
26
27
  ### Render Trigger
28
+
27
29
  <Description of={FilterDRPStories.RenderTrigger} />
28
30
  <NoClipCanvas of={FilterDRPStories.RenderTrigger} />
29
31
 
30
32
  ### Selected Range
33
+
31
34
  <Description of={FilterDRPStories.SelectedRange} />
32
35
  <NoClipCanvas of={FilterDRPStories.SelectedRange} />
33
36
 
34
37
  ### Description
38
+
35
39
  <Description of={FilterDRPStories.Description} />
36
40
  <NoClipCanvas of={FilterDRPStories.Description} />
37
41
 
38
42
  ### Extend Input Props
43
+
39
44
  <Description of={FilterDRPStories.ExtendInputProps} />
40
45
  <NoClipCanvas of={FilterDRPStories.ExtendInputProps} />
41
46
 
42
47
  ### Validation
48
+
43
49
  <Description of={FilterDRPStories.Validation} />
44
50
  <NoClipCanvas of={FilterDRPStories.Validation} />