@kaizen/components 1.41.0 → 1.42.0
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/Heading/Heading.cjs +1 -0
- package/dist/cjs/Heading/Heading.cjs.map +1 -1
- package/dist/cjs/Heading/Heading.module.scss.cjs +1 -0
- package/dist/cjs/Heading/Heading.module.scss.cjs.map +1 -1
- package/dist/cjs/Modal/InputEditModal/InputEditModal.cjs.map +1 -1
- package/dist/cjs/SplitButton/subcomponents/DropdownButton/DropdownButton.cjs +7 -1
- package/dist/cjs/SplitButton/subcomponents/DropdownButton/DropdownButton.cjs.map +1 -1
- package/dist/cjs/Workflow/subcomponents/Header/Header.cjs +1 -1
- package/dist/cjs/Workflow/subcomponents/Header/Header.cjs.map +1 -1
- package/dist/cjs/dts/Filter/FilterBar/context/utils/getInactiveFilters.d.ts +1 -1
- package/dist/cjs/dts/Filter/FilterMultiSelect/FilterMultiSelect.d.ts +1 -1
- package/dist/cjs/dts/Heading/Heading.d.ts +1 -1
- package/dist/cjs/dts/Modal/InputEditModal/InputEditModal.d.ts +1 -1
- package/dist/cjs/dts/__future__/Select/utils/getDisabledKeysFromItems.d.ts +1 -1
- package/dist/cjs/dts/utils/useResizeObserver.d.ts +2 -2
- package/dist/cjs/index.css +3 -3
- package/dist/esm/Heading/Heading.mjs +1 -0
- package/dist/esm/Heading/Heading.mjs.map +1 -1
- package/dist/esm/Heading/Heading.module.scss.mjs +1 -0
- package/dist/esm/Heading/Heading.module.scss.mjs.map +1 -1
- package/dist/esm/Modal/InputEditModal/InputEditModal.mjs.map +1 -1
- package/dist/esm/SplitButton/subcomponents/DropdownButton/DropdownButton.mjs +7 -1
- package/dist/esm/SplitButton/subcomponents/DropdownButton/DropdownButton.mjs.map +1 -1
- package/dist/esm/Workflow/subcomponents/Header/Header.mjs +1 -1
- package/dist/esm/Workflow/subcomponents/Header/Header.mjs.map +1 -1
- package/dist/esm/dts/Filter/FilterBar/context/utils/getInactiveFilters.d.ts +1 -1
- package/dist/esm/dts/Filter/FilterMultiSelect/FilterMultiSelect.d.ts +1 -1
- package/dist/esm/dts/Heading/Heading.d.ts +1 -1
- package/dist/esm/dts/Modal/InputEditModal/InputEditModal.d.ts +1 -1
- package/dist/esm/dts/__future__/Select/utils/getDisabledKeysFromItems.d.ts +1 -1
- package/dist/esm/dts/utils/useResizeObserver.d.ts +2 -2
- package/dist/esm/index.css +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/styles.css +1 -1
- package/locales/ar.json +4 -0
- package/locales/bg.json +4 -0
- package/locales/cs.json +4 -0
- package/locales/cy.json +4 -0
- package/locales/da.json +4 -0
- package/locales/de.json +4 -0
- package/locales/el.json +4 -0
- package/locales/en-GB.json +4 -0
- package/locales/en.json +4 -0
- package/locales/es-419.json +4 -0
- package/locales/es.json +4 -0
- package/locales/et.json +4 -0
- package/locales/fi.json +4 -0
- package/locales/fr-CA.json +5 -1
- package/locales/fr.json +4 -0
- package/locales/he.json +4 -0
- package/locales/hi.json +4 -0
- package/locales/ht.json +4 -0
- package/locales/hu.json +4 -0
- package/locales/id.json +4 -0
- package/locales/it.json +4 -0
- package/locales/ja.json +4 -0
- package/locales/km-KH.json +4 -0
- package/locales/ko.json +4 -0
- package/locales/lt.json +4 -0
- package/locales/lv.json +4 -0
- package/locales/mi.json +15 -11
- package/locales/ms.json +4 -0
- package/locales/nb.json +4 -0
- package/locales/nl.json +4 -0
- package/locales/pl.json +4 -0
- package/locales/pt-BR.json +4 -0
- package/locales/pt.json +4 -0
- package/locales/ro.json +4 -0
- package/locales/ru.json +4 -0
- package/locales/si-LK.json +4 -0
- package/locales/sk.json +4 -0
- package/locales/sr.json +4 -0
- package/locales/sv.json +4 -0
- package/locales/th.json +4 -0
- package/locales/tl.json +4 -0
- package/locales/tr.json +4 -0
- package/locales/uk.json +4 -0
- package/locales/vi.json +4 -0
- package/locales/zh-TW.json +4 -0
- package/locales/zh.json +4 -0
- package/package.json +8 -8
- package/src/DateRangePicker/_docs/DateRangePicker.stories.tsx +2 -0
- package/src/Filter/Filter/_docs/Filter.stories.tsx +2 -0
- package/src/Filter/FilterBar/_docs/FilterBar.stories.tsx +2 -0
- package/src/Filter/FilterDatePicker/_docs/FilterDatePicker.stories.tsx +3 -0
- package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.stories.tsx +3 -0
- package/src/Filter/FilterSelect/_docs/FilterSelect.stories.tsx +2 -0
- package/src/Heading/Heading.module.scss +8 -0
- package/src/Heading/Heading.tsx +2 -0
- package/src/Heading/_docs/Heading.mdx +9 -0
- package/src/Heading/_docs/Heading.stickersheet.stories.tsx +5 -0
- package/src/Heading/_docs/Heading.stories.tsx +7 -0
- package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.stories.tsx +28 -25
- package/src/Modal/ContextModal/_docs/ContextModal.stories.tsx +21 -19
- package/src/Modal/InputEditModal/InputEditModal.tsx +1 -1
- package/src/Modal/InputEditModal/_docs/InputEditModal.stories.tsx +30 -27
- package/src/MultiSelect/_docs/MultiSelect.stories.tsx +3 -0
- package/src/MultiSelect/subcomponents/MultiSelectOptions/_docs/MultiSelectOptions.stories.tsx +2 -0
- package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stories.tsx +2 -0
- package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.spec.tsx +2 -2
- package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.tsx +19 -8
- package/src/TimeField/_docs/TimeField.stories.tsx +2 -0
- package/src/Workflow/subcomponents/Header/Header.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@react-stately/select": "^3.6.2",
|
|
48
48
|
"@react-types/shared": "^3.22.1",
|
|
49
49
|
"classnames": "^2.5.1",
|
|
50
|
-
"date-fns": "^3.
|
|
50
|
+
"date-fns": "^3.5.0",
|
|
51
51
|
"lodash.debounce": "^4.0.8",
|
|
52
52
|
"nanobus": "^4.5.0",
|
|
53
53
|
"prosemirror-commands": "^1.5.2",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
83
|
-
"@cultureamp/frontend-apis": "^9.4.
|
|
84
|
-
"@cultureamp/i18n-react-intl": "^2.5.
|
|
83
|
+
"@cultureamp/frontend-apis": "^9.4.2",
|
|
84
|
+
"@cultureamp/i18n-react-intl": "^2.5.3",
|
|
85
85
|
"@rollup/plugin-alias": "^5.1.0",
|
|
86
86
|
"@rollup/plugin-babel": "^6.0.4",
|
|
87
87
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
91
91
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
92
92
|
"@types/lodash.debounce": "^4.0.9",
|
|
93
|
-
"@types/react-dom": "^18.2.
|
|
93
|
+
"@types/react-dom": "^18.2.22",
|
|
94
94
|
"@types/react-textfit": "^1.1.4",
|
|
95
95
|
"@types/uuid": "^9.0.8",
|
|
96
96
|
"agadoo": "^3.0.0",
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"concat-cli": "^4.0.0",
|
|
100
100
|
"query-string": "^9.0.0",
|
|
101
101
|
"react-intl": "^6.6.2",
|
|
102
|
-
"rollup": "^4.12.
|
|
102
|
+
"rollup": "^4.12.1",
|
|
103
103
|
"rollup-plugin-dts": "^6.1.0",
|
|
104
104
|
"rollup-plugin-ignore": "^1.0.10",
|
|
105
105
|
"rollup-plugin-node-externals": "^7.0.1",
|
|
106
106
|
"rollup-plugin-postcss": "^4.0.2",
|
|
107
|
-
"sass": "^1.
|
|
107
|
+
"sass": "^1.72.0",
|
|
108
108
|
"serialize-query-params": "^2.0.2",
|
|
109
109
|
"svgo": "^3.2.0",
|
|
110
110
|
"ts-jest": "^29.1.2",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@kaizen/tailwind": "1.2.5"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
|
-
"@cultureamp/i18n-react-intl": "^2.5.
|
|
118
|
+
"@cultureamp/i18n-react-intl": "^2.5.3",
|
|
119
119
|
"react": "^18.2.0",
|
|
120
120
|
"react-intl": "^6.6.2"
|
|
121
121
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import { DateRange } from "react-day-picker"
|
|
4
5
|
import { DateRangePicker, formatDateRangeValue } from "../index"
|
|
5
6
|
|
|
@@ -8,6 +9,7 @@ const meta = {
|
|
|
8
9
|
component: DateRangePicker,
|
|
9
10
|
args: {
|
|
10
11
|
labelText: "Label",
|
|
12
|
+
onChange: fn(),
|
|
11
13
|
},
|
|
12
14
|
} satisfies Meta<typeof DateRangePicker>
|
|
13
15
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { action } from "@storybook/addon-actions"
|
|
3
3
|
import { Meta, StoryObj } from "@storybook/react"
|
|
4
|
+
import { fn } from "@storybook/test"
|
|
4
5
|
import { FilterButton, FilterButtonRemovable } from "~components/Filter"
|
|
5
6
|
import { Filter, FilterContents } from "../index"
|
|
6
7
|
|
|
@@ -20,6 +21,7 @@ const meta = {
|
|
|
20
21
|
<FilterButton label="Label" {...triggerProps} />
|
|
21
22
|
),
|
|
22
23
|
isOpen: false,
|
|
24
|
+
setIsOpen: fn(),
|
|
23
25
|
},
|
|
24
26
|
} satisfies Meta<typeof Filter>
|
|
25
27
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import queryString from "query-string"
|
|
4
5
|
import Highlight from "react-highlight"
|
|
5
6
|
import {
|
|
@@ -30,6 +31,7 @@ const meta = {
|
|
|
30
31
|
args: {
|
|
31
32
|
filters: [], // Defined in stories
|
|
32
33
|
values: {}, // Defined in stories
|
|
34
|
+
onValuesChange: fn(),
|
|
33
35
|
},
|
|
34
36
|
} satisfies Meta<typeof FilterBar>
|
|
35
37
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import Highlight from "react-highlight"
|
|
4
5
|
import { defaultMonthControls } from "~components/Calendar/_docs/controls/defaultMonthControls"
|
|
5
6
|
import {
|
|
@@ -56,6 +57,8 @@ const meta = {
|
|
|
56
57
|
),
|
|
57
58
|
isOpen: false,
|
|
58
59
|
selectedDate: undefined,
|
|
60
|
+
setIsOpen: fn(),
|
|
61
|
+
onDateChange: fn(),
|
|
59
62
|
},
|
|
60
63
|
} satisfies Meta<typeof FilterDatePicker>
|
|
61
64
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import Highlight from "react-highlight"
|
|
4
5
|
import { DateRange } from "~components/Calendar"
|
|
5
6
|
import { defaultMonthControls } from "~components/Calendar/_docs/controls/defaultMonthControls"
|
|
@@ -75,6 +76,8 @@ const meta = {
|
|
|
75
76
|
renderTrigger: (triggerButtonProps: FilterButtonProps): JSX.Element => (
|
|
76
77
|
<FilterButton {...triggerButtonProps} />
|
|
77
78
|
),
|
|
79
|
+
setIsOpen: fn(),
|
|
80
|
+
onRangeChange: fn(),
|
|
78
81
|
},
|
|
79
82
|
} satisfies Meta<typeof FilterDateRangePicker>
|
|
80
83
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import { renderTriggerControls } from "~components/Filter/_docs/controls/renderTriggerControls"
|
|
4
5
|
import { FilterButton } from "../../FilterButton"
|
|
5
6
|
import { FilterSelect } from "../FilterSelect"
|
|
@@ -29,6 +30,7 @@ const meta = {
|
|
|
29
30
|
renderTrigger: (triggerProps): JSX.Element => (
|
|
30
31
|
<FilterButton {...triggerProps} />
|
|
31
32
|
),
|
|
33
|
+
setIsOpen: fn(),
|
|
32
34
|
},
|
|
33
35
|
parameters: {
|
|
34
36
|
actions: {
|
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
letter-spacing: $typography-display-0-letter-spacing;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
.composable-header-title {
|
|
19
|
+
font-family: $typography-display-0-font-family; // Tiempos
|
|
20
|
+
font-weight: 500; // Medium
|
|
21
|
+
font-size: $typography-heading-1-font-size;
|
|
22
|
+
line-height: $typography-heading-1-line-height;
|
|
23
|
+
letter-spacing: $typography-heading-1-letter-spacing;
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
.heading-1 {
|
|
19
27
|
font-family: $typography-heading-1-font-family;
|
|
20
28
|
font-weight: $typography-heading-1-font-weight;
|
package/src/Heading/Heading.tsx
CHANGED
|
@@ -7,6 +7,7 @@ const VARIANTS_24PX_OR_GREATER = ["display-0", "heading-1", "heading-2"]
|
|
|
7
7
|
|
|
8
8
|
export type HeadingVariants =
|
|
9
9
|
| "display-0"
|
|
10
|
+
| "composable-header-title"
|
|
10
11
|
| "heading-1"
|
|
11
12
|
| "heading-2"
|
|
12
13
|
| "heading-3"
|
|
@@ -84,6 +85,7 @@ Heading.displayName = "Heading"
|
|
|
84
85
|
const translateHeadingLevelToTag = (headingLevel: HeadingVariants): string => {
|
|
85
86
|
switch (headingLevel) {
|
|
86
87
|
case "display-0":
|
|
88
|
+
case "composable-header-title":
|
|
87
89
|
case "heading-1":
|
|
88
90
|
return "h1"
|
|
89
91
|
case "heading-2":
|
|
@@ -30,3 +30,12 @@ People using a screen reader rely on heading elements to get an understanding of
|
|
|
30
30
|
In most cases, you will need to use the `tag` prop to adjust the heading level to suit your page.
|
|
31
31
|
|
|
32
32
|
There will the odd case where you want heading styling, but the text isn't actually acting as a heading. In those cases, use `tag="div"` or `tag="span"`.
|
|
33
|
+
|
|
34
|
+
## Variant - Composable Header Title
|
|
35
|
+
|
|
36
|
+
Use this variant only for the title within the composable header. [See documentation](https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3456565336/Composable+Header+-+IN+DRAFT)
|
|
37
|
+
|
|
38
|
+
Defaults to `h1` element.
|
|
39
|
+
|
|
40
|
+
<Canvas of={HeadingStories.ComposableHeaderTitle} />
|
|
41
|
+
|
|
@@ -26,6 +26,11 @@ const StickerSheetTemplate: StickerSheetStory = {
|
|
|
26
26
|
Let's create a better world of work
|
|
27
27
|
</Heading>
|
|
28
28
|
</StickerSheet.Row>
|
|
29
|
+
<StickerSheet.Row rowTitle="Composable header title">
|
|
30
|
+
<Heading variant="composable-header-title" color={fontColour}>
|
|
31
|
+
Use me in the composable header!
|
|
32
|
+
</Heading>
|
|
33
|
+
</StickerSheet.Row>
|
|
29
34
|
<StickerSheet.Row rowTitle="Heading 1">
|
|
30
35
|
<div>
|
|
31
36
|
<Heading variant="heading-1" color={fontColour}>
|
|
@@ -28,6 +28,13 @@ export const Playground: Story = {
|
|
|
28
28
|
},
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export const ComposableHeaderTitle: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
variant: "composable-header-title",
|
|
34
|
+
children: "Page title within composable header",
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
export const Reversed: Story = {
|
|
32
39
|
args: { color: "white" },
|
|
33
40
|
parameters: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import isChromatic from "chromatic"
|
|
4
5
|
import { Text } from "~components/Text"
|
|
5
6
|
import { chromaticModalSettings } from "../../_docs/controls"
|
|
@@ -7,6 +8,33 @@ import { ConfirmationModal } from "../index"
|
|
|
7
8
|
|
|
8
9
|
const IS_CHROMATIC = isChromatic()
|
|
9
10
|
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "Components/Modals/Confirmation Modal",
|
|
13
|
+
component: ConfirmationModal,
|
|
14
|
+
args: {
|
|
15
|
+
isOpen: false,
|
|
16
|
+
title: "Confirmation modal title",
|
|
17
|
+
mood: "cautionary",
|
|
18
|
+
children: (
|
|
19
|
+
<Text variant="body">
|
|
20
|
+
Confirmation modals contain smaller pieces of content and can provide
|
|
21
|
+
additional information to aide the user.
|
|
22
|
+
</Text>
|
|
23
|
+
),
|
|
24
|
+
onConfirm: fn(),
|
|
25
|
+
onDismiss: fn(),
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
children: {
|
|
29
|
+
control: false,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
} satisfies Meta<typeof ConfirmationModal>
|
|
33
|
+
|
|
34
|
+
export default meta
|
|
35
|
+
|
|
36
|
+
type Story = StoryObj<typeof meta>
|
|
37
|
+
|
|
10
38
|
const ConfirmationModalTemplate: Story = {
|
|
11
39
|
render: args => {
|
|
12
40
|
const [isOpen, setIsOpen] = useState(IS_CHROMATIC)
|
|
@@ -35,31 +63,6 @@ const ConfirmationModalTemplate: Story = {
|
|
|
35
63
|
...chromaticModalSettings,
|
|
36
64
|
}
|
|
37
65
|
|
|
38
|
-
const meta = {
|
|
39
|
-
title: "Components/Modals/Confirmation Modal",
|
|
40
|
-
component: ConfirmationModal,
|
|
41
|
-
args: {
|
|
42
|
-
isOpen: false,
|
|
43
|
-
title: "Confirmation modal title",
|
|
44
|
-
mood: "cautionary",
|
|
45
|
-
children: (
|
|
46
|
-
<Text variant="body">
|
|
47
|
-
Confirmation modals contain smaller pieces of content and can provide
|
|
48
|
-
additional information to aide the user.
|
|
49
|
-
</Text>
|
|
50
|
-
),
|
|
51
|
-
},
|
|
52
|
-
argTypes: {
|
|
53
|
-
children: {
|
|
54
|
-
control: false,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
} satisfies Meta<typeof ConfirmationModal>
|
|
58
|
-
|
|
59
|
-
export default meta
|
|
60
|
-
|
|
61
|
-
type Story = StoryObj<typeof meta>
|
|
62
|
-
|
|
63
66
|
export const Playground: Story = {
|
|
64
67
|
...ConfirmationModalTemplate,
|
|
65
68
|
parameters: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import isChromatic from "chromatic"
|
|
4
5
|
import { AddImage } from "~components/Illustration"
|
|
5
6
|
import { ModalAccessibleDescription } from "~components/Modal/GenericModal/subcomponents/ModalAccessibleDescription"
|
|
@@ -9,6 +10,26 @@ import { ContextModal } from "../index"
|
|
|
9
10
|
|
|
10
11
|
const IS_CHROMATIC = isChromatic()
|
|
11
12
|
|
|
13
|
+
const meta = {
|
|
14
|
+
title: "Components/Modals/Context Modal",
|
|
15
|
+
component: ContextModal,
|
|
16
|
+
args: {
|
|
17
|
+
isOpen: false,
|
|
18
|
+
title: "Context modal title",
|
|
19
|
+
children: undefined,
|
|
20
|
+
onDismiss: fn(),
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
children: {
|
|
24
|
+
control: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta<typeof ContextModal>
|
|
28
|
+
|
|
29
|
+
export default meta
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj<typeof meta>
|
|
32
|
+
|
|
12
33
|
const ContextModalTemplate: Story = {
|
|
13
34
|
render: args => {
|
|
14
35
|
const [isOpen, setIsOpen] = useState(IS_CHROMATIC)
|
|
@@ -72,25 +93,6 @@ const ContextModalTemplate: Story = {
|
|
|
72
93
|
},
|
|
73
94
|
}
|
|
74
95
|
|
|
75
|
-
const meta = {
|
|
76
|
-
title: "Components/Modals/Context Modal",
|
|
77
|
-
component: ContextModal,
|
|
78
|
-
args: {
|
|
79
|
-
isOpen: false,
|
|
80
|
-
title: "Context modal title",
|
|
81
|
-
children: undefined,
|
|
82
|
-
},
|
|
83
|
-
argTypes: {
|
|
84
|
-
children: {
|
|
85
|
-
control: false,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
} satisfies Meta<typeof ContextModal>
|
|
89
|
-
|
|
90
|
-
export default meta
|
|
91
|
-
|
|
92
|
-
type Story = StoryObj<typeof meta>
|
|
93
|
-
|
|
94
96
|
export const Playground: Story = {
|
|
95
97
|
...ContextModalTemplate,
|
|
96
98
|
parameters: {
|
|
@@ -30,7 +30,7 @@ export type InputEditModalProps = {
|
|
|
30
30
|
automationId?: string
|
|
31
31
|
children: React.ReactNode
|
|
32
32
|
submitWorking?: { label: string; labelHidden?: boolean }
|
|
33
|
-
} & HTMLAttributes<HTMLDivElement>
|
|
33
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "onSubmit">
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093114/Modal#Input-Edit-Modal Guidance} |
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import isChromatic from "chromatic"
|
|
4
5
|
import { ModalAccessibleDescription } from "~components/Modal"
|
|
5
6
|
import { Text } from "~components/Text"
|
|
@@ -9,33 +10,6 @@ import { InputEditModal } from "../index"
|
|
|
9
10
|
|
|
10
11
|
const IS_CHROMATIC = isChromatic()
|
|
11
12
|
|
|
12
|
-
const InputModalTemplate: Story = {
|
|
13
|
-
render: args => {
|
|
14
|
-
const [isOpen, setIsOpen] = useState(IS_CHROMATIC)
|
|
15
|
-
|
|
16
|
-
const handleOpen = (): void => setIsOpen(true)
|
|
17
|
-
const handleClose = (): void => setIsOpen(false)
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<>
|
|
21
|
-
<button
|
|
22
|
-
type="button"
|
|
23
|
-
className="border border-gray-500"
|
|
24
|
-
onClick={handleOpen}
|
|
25
|
-
>
|
|
26
|
-
Open Modal
|
|
27
|
-
</button>
|
|
28
|
-
<InputEditModal
|
|
29
|
-
{...args}
|
|
30
|
-
isOpen={isOpen}
|
|
31
|
-
onSubmit={handleClose}
|
|
32
|
-
onDismiss={handleClose}
|
|
33
|
-
/>
|
|
34
|
-
</>
|
|
35
|
-
)
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
|
|
39
13
|
const ExampleForm = (): JSX.Element => (
|
|
40
14
|
<>
|
|
41
15
|
<ModalAccessibleDescription>
|
|
@@ -58,6 +32,8 @@ const meta = {
|
|
|
58
32
|
mood: "positive",
|
|
59
33
|
children: <ExampleForm />,
|
|
60
34
|
submitLabel: "Submit label",
|
|
35
|
+
onSubmit: fn(),
|
|
36
|
+
onDismiss: fn(),
|
|
61
37
|
},
|
|
62
38
|
argTypes: {
|
|
63
39
|
children: {
|
|
@@ -70,6 +46,33 @@ export default meta
|
|
|
70
46
|
|
|
71
47
|
type Story = StoryObj<typeof meta>
|
|
72
48
|
|
|
49
|
+
const InputModalTemplate: Story = {
|
|
50
|
+
render: args => {
|
|
51
|
+
const [isOpen, setIsOpen] = useState(IS_CHROMATIC)
|
|
52
|
+
|
|
53
|
+
const handleOpen = (): void => setIsOpen(true)
|
|
54
|
+
const handleClose = (): void => setIsOpen(false)
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<button
|
|
59
|
+
type="button"
|
|
60
|
+
className="border border-gray-500"
|
|
61
|
+
onClick={handleOpen}
|
|
62
|
+
>
|
|
63
|
+
Open Modal
|
|
64
|
+
</button>
|
|
65
|
+
<InputEditModal
|
|
66
|
+
{...args}
|
|
67
|
+
isOpen={isOpen}
|
|
68
|
+
onSubmit={handleClose}
|
|
69
|
+
onDismiss={handleClose}
|
|
70
|
+
/>
|
|
71
|
+
</>
|
|
72
|
+
)
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
73
76
|
export const Playground: Story = {
|
|
74
77
|
...InputModalTemplate,
|
|
75
78
|
parameters: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import { MultiSelect, MultiSelectProps } from "../index"
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
@@ -41,6 +42,8 @@ const meta = {
|
|
|
41
42
|
value: "toastie",
|
|
42
43
|
},
|
|
43
44
|
],
|
|
45
|
+
onSelectedValuesChange: fn(),
|
|
46
|
+
onOpenChange: fn(),
|
|
44
47
|
},
|
|
45
48
|
} satisfies Meta<typeof MultiSelect>
|
|
46
49
|
|
package/src/MultiSelect/subcomponents/MultiSelectOptions/_docs/MultiSelectOptions.stories.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import { MultiSelectOptions, MultiSelectOptionsProps } from "../index"
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
@@ -22,6 +23,7 @@ const meta = {
|
|
|
22
23
|
value: "toastie",
|
|
23
24
|
},
|
|
24
25
|
],
|
|
26
|
+
onChange: fn(),
|
|
25
27
|
},
|
|
26
28
|
} satisfies Meta<typeof MultiSelectOptions>
|
|
27
29
|
|
package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stories.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import { Button } from "~components/Button"
|
|
4
5
|
import {
|
|
5
6
|
EditorContentArray,
|
|
@@ -15,6 +16,7 @@ const meta = {
|
|
|
15
16
|
args: {
|
|
16
17
|
content: dummyContent,
|
|
17
18
|
labelText: "Editable rich text content",
|
|
19
|
+
onClick: fn(),
|
|
18
20
|
},
|
|
19
21
|
argTypes: {
|
|
20
22
|
content: { control: "disabled" },
|
|
@@ -9,8 +9,8 @@ const DropdownButtonWrapper = (
|
|
|
9
9
|
describe("<DropdownButton />", () => {
|
|
10
10
|
it("renders icon with default aria-label", () => {
|
|
11
11
|
render(<DropdownButtonWrapper />)
|
|
12
|
-
const button = screen.getByRole("button", { name: "
|
|
13
|
-
expect(button.getAttribute("aria-label")).toBe("
|
|
12
|
+
const button = screen.getByRole("button", { name: "Additional actions" })
|
|
13
|
+
expect(button.getAttribute("aria-label")).toBe("Additional actions")
|
|
14
14
|
expect(button.firstChild?.nodeName).toEqual("svg")
|
|
15
15
|
})
|
|
16
16
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
+
import { useIntl } from "@cultureamp/i18n-react-intl"
|
|
2
3
|
import classnames from "classnames"
|
|
3
4
|
import { ChevronDownIcon } from "~components/Icon"
|
|
4
5
|
import { BaseButton, BaseButtonProps } from "../BaseButton"
|
|
@@ -10,13 +11,23 @@ export const DropdownButton = ({
|
|
|
10
11
|
classNameOverride,
|
|
11
12
|
"aria-label": ariaLabel,
|
|
12
13
|
...restProps
|
|
13
|
-
}: DropdownButtonProps): JSX.Element =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
}: DropdownButtonProps): JSX.Element => {
|
|
15
|
+
const { formatMessage } = useIntl()
|
|
16
|
+
return (
|
|
17
|
+
<BaseButton
|
|
18
|
+
label={
|
|
19
|
+
ariaLabel ||
|
|
20
|
+
formatMessage({
|
|
21
|
+
id: "splitButton.dropdownButton.label",
|
|
22
|
+
defaultMessage: "Additional actions",
|
|
23
|
+
description: "Label for a dropdown menu holding additional actions",
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
icon={<ChevronDownIcon role="presentation" />}
|
|
27
|
+
classNameOverride={classnames(styles.dropdownButton, classNameOverride)}
|
|
28
|
+
{...restProps}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
21
32
|
|
|
22
33
|
DropdownButton.displayName = "DropdownButton"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { fn } from "@storybook/test"
|
|
3
4
|
import { TimeField } from "../index"
|
|
4
5
|
import { ValueType } from "../types"
|
|
5
6
|
|
|
@@ -18,6 +19,7 @@ const meta = {
|
|
|
18
19
|
label: "Time",
|
|
19
20
|
locale: "en-US",
|
|
20
21
|
value: null,
|
|
22
|
+
onChange: fn(),
|
|
21
23
|
},
|
|
22
24
|
} satisfies Meta<typeof TimeField>
|
|
23
25
|
|
|
@@ -18,7 +18,7 @@ export const Header = ({
|
|
|
18
18
|
...restProps
|
|
19
19
|
}: HeaderProps): JSX.Element => (
|
|
20
20
|
<HeaderRoot {...restProps}>
|
|
21
|
-
<Branding alt="
|
|
21
|
+
<Branding alt="Culture Amp" />
|
|
22
22
|
<Titles workflowName={workflowName} stepName={stepName} status={status} />
|
|
23
23
|
<Actions headerActions={headerActions} />
|
|
24
24
|
</HeaderRoot>
|