@kaizen/components 1.67.21 → 1.68.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/EmptyState/EmptyState.cjs +15 -17
- package/dist/cjs/EmptyState/EmptyState.module.css.cjs +20 -0
- package/dist/cjs/__actions__/Button/v3/Button.cjs +43 -8
- package/dist/cjs/__actions__/Button/v3/Button.module.css.cjs +21 -0
- package/dist/cjs/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.cjs +37 -0
- package/dist/cjs/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.module.css.cjs +9 -0
- package/dist/cjs/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.cjs +35 -0
- package/dist/cjs/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.module.css.cjs +8 -0
- package/dist/cjs/__overlays__/Tooltip/v3/Tooltip.cjs +2 -2
- package/dist/esm/EmptyState/EmptyState.mjs +15 -17
- package/dist/esm/EmptyState/EmptyState.module.css.mjs +18 -0
- package/dist/esm/__actions__/Button/v3/Button.mjs +44 -9
- package/dist/esm/__actions__/Button/v3/Button.module.css.mjs +19 -0
- package/dist/esm/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.mjs +28 -0
- package/dist/esm/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.module.css.mjs +7 -0
- package/dist/esm/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.mjs +26 -0
- package/dist/esm/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.module.css.mjs +6 -0
- package/dist/esm/__overlays__/Tooltip/v3/Tooltip.mjs +1 -1
- package/dist/styles.css +360 -246
- package/dist/types/EmptyState/EmptyState.d.ts +2 -1
- package/dist/types/__actions__/Button/v3/Button.d.ts +17 -4
- package/dist/types/__actions__/Button/v3/index.d.ts +1 -0
- package/dist/types/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.d.ts +11 -0
- package/dist/types/__actions__/Button/v3/subcomponents/ButtonContent/index.d.ts +1 -0
- package/dist/types/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.d.ts +5 -0
- package/dist/types/__actions__/Button/v3/subcomponents/PendingContent/index.d.ts +1 -0
- package/dist/types/__actions__/Button/v3/subcomponents/index.d.ts +2 -0
- package/dist/types/__actions__/Button/v3/types.d.ts +21 -0
- package/package.json +1 -1
- package/src/EmptyState/EmptyState.module.css +114 -0
- package/src/EmptyState/EmptyState.tsx +18 -20
- package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +55 -39
- package/src/__actions__/Button/v3/Button.module.css +235 -0
- package/src/__actions__/Button/v3/Button.tsx +92 -29
- package/src/__actions__/Button/v3/_docs/Button--api-specification.mdx +150 -0
- package/src/__actions__/Button/v3/_docs/Button--usage-guidelines.mdx +30 -0
- package/src/__actions__/Button/v3/_docs/Button.docs.stories.tsx +112 -50
- package/src/__actions__/Button/v3/_docs/Button.spec.stories.tsx +80 -120
- package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +183 -81
- package/src/__actions__/Button/v3/index.ts +1 -0
- package/src/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.module.css +19 -0
- package/src/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.tsx +40 -0
- package/src/__actions__/Button/v3/subcomponents/ButtonContent/index.ts +1 -0
- package/src/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.module.css +16 -0
- package/src/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.tsx +28 -0
- package/src/__actions__/Button/v3/subcomponents/PendingContent/index.ts +1 -0
- package/src/__actions__/Button/v3/subcomponents/index.ts +2 -0
- package/src/__actions__/Button/v3/types.ts +25 -0
- package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +54 -18
- package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +30 -10
- package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +12 -4
- package/src/__future__/Icon/_docs/Icon.docs.stories.tsx +7 -7
- package/src/__overlays__/Tooltip/v3/Tooltip.tsx +1 -1
- package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +2 -0
- package/dist/cjs/EmptyState/EmptyState.module.scss.cjs +0 -23
- package/dist/cjs/__actions__/Button/v3/Button.module.scss.cjs +0 -9
- package/dist/esm/EmptyState/EmptyState.module.scss.mjs +0 -21
- package/dist/esm/__actions__/Button/v3/Button.module.scss.mjs +0 -7
- package/src/EmptyState/EmptyState.module.scss +0 -186
- package/src/EmptyState/EmptyState.spec.tsx +0 -48
- package/src/EmptyState/_mixins.scss +0 -44
- package/src/__actions__/Button/v3/Button.module.scss +0 -104
- package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +0 -173
- package/src/__actions__/Button/v3/_docs/Button.mdx +0 -41
- package/src/__actions__/Button/v3/_docs/Button.stories.tsx +0 -98
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ButtonVariants = "primary" | "secondary" | "tertiary"
|
|
2
|
+
|
|
3
|
+
export type ButtonSizes = "small" | "medium" | "large"
|
|
4
|
+
|
|
5
|
+
export type PendingPropsUndefined = {
|
|
6
|
+
isPending?: undefined
|
|
7
|
+
/** Rendered as the child while `isPending` is `true`. This determines the accessible label for the Button while pending. */
|
|
8
|
+
pendingLabel?: never
|
|
9
|
+
/** Visually hides the `pendingLabel` and renders the loading spinner. This will maintain the width of the Button's `children` to avoid layout shifts.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
hasHiddenPendingLabel?: never
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type PendingProps = {
|
|
16
|
+
isPending: boolean
|
|
17
|
+
/** Rendered as the child while `pendingLabel` is `true`. This determines the accessible label for the Button while pending. */
|
|
18
|
+
pendingLabel: string
|
|
19
|
+
/** Visually Hides the `pendingLabel` and renders the loading spinner. This will maintain the width of the Button's `children` to avoid layout shifts.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
hasHiddenPendingLabel?: boolean
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type PendingButtonProps = PendingProps | PendingPropsUndefined
|
|
@@ -41,8 +41,12 @@ const DefaultMenuItems = (): ReactNode => (
|
|
|
41
41
|
export const Actions: Story = {
|
|
42
42
|
render: ({ defaultOpen: _, ...args }) => (
|
|
43
43
|
<MenuTrigger {...args}>
|
|
44
|
-
<Button
|
|
45
|
-
|
|
44
|
+
<Button
|
|
45
|
+
size="large"
|
|
46
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
47
|
+
hasHiddenLabel
|
|
48
|
+
>
|
|
49
|
+
Additional actions
|
|
46
50
|
</Button>
|
|
47
51
|
<Popover>
|
|
48
52
|
<Menu>
|
|
@@ -59,8 +63,12 @@ export const Actions: Story = {
|
|
|
59
63
|
export const ItemsDo: Story = {
|
|
60
64
|
render: ({ defaultOpen, ...args }) => (
|
|
61
65
|
<MenuTrigger defaultOpen={defaultOpen} {...args}>
|
|
62
|
-
<Button
|
|
63
|
-
|
|
66
|
+
<Button
|
|
67
|
+
size="large"
|
|
68
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
69
|
+
hasHiddenLabel
|
|
70
|
+
>
|
|
71
|
+
Additional actions
|
|
64
72
|
</Button>
|
|
65
73
|
<Popover>
|
|
66
74
|
<Menu>
|
|
@@ -74,8 +82,12 @@ export const ItemsDo: Story = {
|
|
|
74
82
|
export const ItemsDont: Story = {
|
|
75
83
|
render: ({ defaultOpen, ...args }) => (
|
|
76
84
|
<MenuTrigger defaultOpen={defaultOpen} {...args}>
|
|
77
|
-
<Button
|
|
78
|
-
|
|
85
|
+
<Button
|
|
86
|
+
size="large"
|
|
87
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
88
|
+
hasHiddenLabel
|
|
89
|
+
>
|
|
90
|
+
Additional actions
|
|
79
91
|
</Button>
|
|
80
92
|
<Popover>
|
|
81
93
|
<Menu>
|
|
@@ -171,8 +183,12 @@ export const LabelDont: Story = {
|
|
|
171
183
|
export const IconsDont: Story = {
|
|
172
184
|
render: ({ defaultOpen, ...args }) => (
|
|
173
185
|
<MenuTrigger defaultOpen={defaultOpen}>
|
|
174
|
-
<Button
|
|
175
|
-
|
|
186
|
+
<Button
|
|
187
|
+
size="large"
|
|
188
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
189
|
+
hasHiddenLabel
|
|
190
|
+
>
|
|
191
|
+
Additional actions
|
|
176
192
|
</Button>
|
|
177
193
|
<Popover>
|
|
178
194
|
<Menu {...args}>
|
|
@@ -193,8 +209,12 @@ export const IconsDont: Story = {
|
|
|
193
209
|
export const MenuItemLabelsDont: Story = {
|
|
194
210
|
render: ({ defaultOpen, ...args }) => (
|
|
195
211
|
<MenuTrigger defaultOpen={defaultOpen}>
|
|
196
|
-
<Button
|
|
197
|
-
|
|
212
|
+
<Button
|
|
213
|
+
size="large"
|
|
214
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
215
|
+
hasHiddenLabel
|
|
216
|
+
>
|
|
217
|
+
Additional actions
|
|
198
218
|
</Button>
|
|
199
219
|
<Popover>
|
|
200
220
|
<Menu {...args}>
|
|
@@ -210,8 +230,12 @@ export const MenuItemLabelsDont: Story = {
|
|
|
210
230
|
export const SentenceCaseDo: Story = {
|
|
211
231
|
render: ({ defaultOpen, ...args }) => (
|
|
212
232
|
<MenuTrigger defaultOpen={defaultOpen}>
|
|
213
|
-
<Button
|
|
214
|
-
|
|
233
|
+
<Button
|
|
234
|
+
size="large"
|
|
235
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
236
|
+
hasHiddenLabel
|
|
237
|
+
>
|
|
238
|
+
Additional actions
|
|
215
239
|
</Button>
|
|
216
240
|
<Popover>
|
|
217
241
|
<Menu {...args}>
|
|
@@ -227,8 +251,12 @@ export const SentenceCaseDo: Story = {
|
|
|
227
251
|
export const SentenceCaseDont: Story = {
|
|
228
252
|
render: ({ defaultOpen, ...args }) => (
|
|
229
253
|
<MenuTrigger defaultOpen={defaultOpen}>
|
|
230
|
-
<Button
|
|
231
|
-
|
|
254
|
+
<Button
|
|
255
|
+
size="large"
|
|
256
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
257
|
+
hasHiddenLabel
|
|
258
|
+
>
|
|
259
|
+
Additional actions
|
|
232
260
|
</Button>
|
|
233
261
|
<Popover>
|
|
234
262
|
<Menu {...args}>
|
|
@@ -244,8 +272,12 @@ export const SentenceCaseDont: Story = {
|
|
|
244
272
|
export const ElipsesDo: Story = {
|
|
245
273
|
render: ({ defaultOpen, ...args }) => (
|
|
246
274
|
<MenuTrigger defaultOpen={defaultOpen}>
|
|
247
|
-
<Button
|
|
248
|
-
|
|
275
|
+
<Button
|
|
276
|
+
size="large"
|
|
277
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
278
|
+
hasHiddenLabel
|
|
279
|
+
>
|
|
280
|
+
Additional actions
|
|
249
281
|
</Button>
|
|
250
282
|
<Popover>
|
|
251
283
|
<Menu {...args}>
|
|
@@ -261,8 +293,12 @@ export const ElipsesDo: Story = {
|
|
|
261
293
|
export const ElipsesDont: Story = {
|
|
262
294
|
render: ({ defaultOpen, ...args }) => (
|
|
263
295
|
<MenuTrigger defaultOpen={defaultOpen}>
|
|
264
|
-
<Button
|
|
265
|
-
|
|
296
|
+
<Button
|
|
297
|
+
size="large"
|
|
298
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
299
|
+
hasHiddenLabel
|
|
300
|
+
>
|
|
301
|
+
Additional actions
|
|
266
302
|
</Button>
|
|
267
303
|
<Popover>
|
|
268
304
|
<Menu {...args}>
|
|
@@ -36,8 +36,12 @@ export const KitchenSink: Story = {
|
|
|
36
36
|
],
|
|
37
37
|
render: ({ defaultOpen, ...args }) => (
|
|
38
38
|
<MenuTrigger defaultOpen={defaultOpen} {...args}>
|
|
39
|
-
<Button
|
|
40
|
-
|
|
39
|
+
<Button
|
|
40
|
+
size="large"
|
|
41
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
42
|
+
hasHiddenLabel
|
|
43
|
+
>
|
|
44
|
+
Additional actions
|
|
41
45
|
</Button>
|
|
42
46
|
<Popover>
|
|
43
47
|
<Menu>
|
|
@@ -84,9 +88,14 @@ export const KitchenSink: Story = {
|
|
|
84
88
|
export const Basic: Story = {
|
|
85
89
|
render: ({ defaultOpen, ...args }) => (
|
|
86
90
|
<MenuTrigger defaultOpen={defaultOpen} {...args}>
|
|
87
|
-
<Button
|
|
88
|
-
|
|
91
|
+
<Button
|
|
92
|
+
size="large"
|
|
93
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
94
|
+
hasHiddenLabel
|
|
95
|
+
>
|
|
96
|
+
Additional actions
|
|
89
97
|
</Button>
|
|
98
|
+
|
|
90
99
|
<Popover>
|
|
91
100
|
<Menu>
|
|
92
101
|
<MenuItem
|
|
@@ -165,8 +174,12 @@ const mockOnClick = fn()
|
|
|
165
174
|
export const DisabledItems: Story = {
|
|
166
175
|
render: () => (
|
|
167
176
|
<MenuTrigger>
|
|
168
|
-
<Button
|
|
169
|
-
|
|
177
|
+
<Button
|
|
178
|
+
size="large"
|
|
179
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
180
|
+
hasHiddenLabel
|
|
181
|
+
>
|
|
182
|
+
Additional actions
|
|
170
183
|
</Button>
|
|
171
184
|
<Popover>
|
|
172
185
|
<Menu>
|
|
@@ -205,8 +218,12 @@ export const DisabledItems: Story = {
|
|
|
205
218
|
export const WithSections: Story = {
|
|
206
219
|
render: () => (
|
|
207
220
|
<MenuTrigger>
|
|
208
|
-
<Button
|
|
209
|
-
|
|
221
|
+
<Button
|
|
222
|
+
size="large"
|
|
223
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
224
|
+
hasHiddenLabel
|
|
225
|
+
>
|
|
226
|
+
Additional actions
|
|
210
227
|
</Button>
|
|
211
228
|
<Popover>
|
|
212
229
|
<Menu>
|
|
@@ -237,8 +254,11 @@ export const Controlled: Story = {
|
|
|
237
254
|
Toggle open
|
|
238
255
|
</button>
|
|
239
256
|
<MenuTrigger isOpen={isOpen} onOpenChange={setOpen}>
|
|
240
|
-
<Button
|
|
241
|
-
<Icon name="more_horiz"
|
|
257
|
+
<Button
|
|
258
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
259
|
+
hasHiddenLabel
|
|
260
|
+
>
|
|
261
|
+
Additional actions
|
|
242
262
|
</Button>
|
|
243
263
|
<Popover>
|
|
244
264
|
<Menu>
|
|
@@ -25,8 +25,12 @@ type Story = StoryObj<typeof meta>
|
|
|
25
25
|
export const Playground: Story = {
|
|
26
26
|
render: ({ defaultOpen: _, ...args }) => (
|
|
27
27
|
<MenuTrigger {...args}>
|
|
28
|
-
<Button
|
|
29
|
-
|
|
28
|
+
<Button
|
|
29
|
+
size="large"
|
|
30
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
31
|
+
hasHiddenLabel
|
|
32
|
+
>
|
|
33
|
+
Additional actions
|
|
30
34
|
</Button>
|
|
31
35
|
<Popover>
|
|
32
36
|
<Menu>
|
|
@@ -68,8 +72,12 @@ export const Controlled: Story = {
|
|
|
68
72
|
export const RichContent: Story = {
|
|
69
73
|
render: ({ defaultOpen: _, ...args }) => (
|
|
70
74
|
<MenuTrigger {...args}>
|
|
71
|
-
<Button
|
|
72
|
-
|
|
75
|
+
<Button
|
|
76
|
+
size="large"
|
|
77
|
+
icon={<Icon name="more_horiz" isPresentational />}
|
|
78
|
+
hasHiddenLabel
|
|
79
|
+
>
|
|
80
|
+
Additional actions
|
|
73
81
|
</Button>
|
|
74
82
|
<Popover>
|
|
75
83
|
<Menu>
|
|
@@ -124,20 +124,20 @@ export const Size: Story = {
|
|
|
124
124
|
|
|
125
125
|
export const MeaningfulIcon: Story = {
|
|
126
126
|
render: args => (
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
</
|
|
127
|
+
<Tag color="blue" icon={<Icon {...args} />}>
|
|
128
|
+
Meaningful icons can be helpful
|
|
129
|
+
</Tag>
|
|
130
130
|
),
|
|
131
|
-
args: { isPresentational: false, alt: "
|
|
131
|
+
args: { isPresentational: false, alt: "Info:", name: "info", isFilled: true },
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
export const PresentationalIcon: Story = {
|
|
135
135
|
render: args => (
|
|
136
|
-
<Button>
|
|
137
|
-
|
|
136
|
+
<Button icon={<Icon {...args} />} hasHiddenLabel>
|
|
137
|
+
Label
|
|
138
138
|
</Button>
|
|
139
139
|
),
|
|
140
|
-
args: { isPresentational: true },
|
|
140
|
+
args: { isPresentational: true, name: "add" },
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
const IconSetButton = ({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { forwardRef, useContext, useLayoutEffect, useState } from "react"
|
|
2
|
-
import { VisuallyHidden } from "react-aria"
|
|
3
2
|
import {
|
|
4
3
|
Tooltip as RACTooltip,
|
|
5
4
|
TooltipContext,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
TooltipTriggerStateContext,
|
|
8
7
|
useContextProps,
|
|
9
8
|
} from "react-aria-components"
|
|
9
|
+
import { VisuallyHidden } from "~components/VisuallyHidden"
|
|
10
10
|
import { useReversedColors } from "~components/__utilities__/v3"
|
|
11
11
|
import { mergeClassNames } from "~components/utils/mergeClassNames"
|
|
12
12
|
import { OverlayArrow } from "./OverlayArrow"
|
|
@@ -33,6 +33,8 @@ export default meta
|
|
|
33
33
|
|
|
34
34
|
type Story = StoryObj<typeof meta>
|
|
35
35
|
|
|
36
|
+
// TODO: update this to use the new button component v3
|
|
37
|
+
|
|
36
38
|
export const OnButton: Story = {
|
|
37
39
|
render: ({ defaultOpen, isOpen, ...args }) => (
|
|
38
40
|
<TooltipTrigger defaultOpen={defaultOpen} isOpen={isOpen}>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var styles = {
|
|
4
|
-
"container": "EmptyState-module_container__-B5OU",
|
|
5
|
-
"straightCorners": "EmptyState-module_straightCorners__Aeou0",
|
|
6
|
-
"sidebarAndContent": "EmptyState-module_sidebarAndContent__Eysay",
|
|
7
|
-
"contentOnly": "EmptyState-module_contentOnly__RWVVX",
|
|
8
|
-
"positive": "EmptyState-module_positive__o3dXR",
|
|
9
|
-
"negative": "EmptyState-module_negative__e5ci6",
|
|
10
|
-
"action": "EmptyState-module_action__OdsgJ",
|
|
11
|
-
"neutral": "EmptyState-module_neutral__L6fBb",
|
|
12
|
-
"success": "EmptyState-module_success__y7jKP",
|
|
13
|
-
"warning": "EmptyState-module_warning__-PrRp",
|
|
14
|
-
"informative": "EmptyState-module_informative__x0GSr",
|
|
15
|
-
"expert-advice": "EmptyState-module_expert-advice__VVB8i",
|
|
16
|
-
"illustrationSide": "EmptyState-module_illustrationSide__ZSjF3",
|
|
17
|
-
"textSide": "EmptyState-module_textSide__tv54w",
|
|
18
|
-
"illustration": "EmptyState-module_illustration__HyD2k",
|
|
19
|
-
"textSideInner": "EmptyState-module_textSideInner__Yynhi",
|
|
20
|
-
"heading": "EmptyState-module_heading__y-yvC",
|
|
21
|
-
"description": "EmptyState-module_description__fsJOc"
|
|
22
|
-
};
|
|
23
|
-
module.exports = styles;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var styles = {
|
|
2
|
-
"container": "EmptyState-module_container__-B5OU",
|
|
3
|
-
"straightCorners": "EmptyState-module_straightCorners__Aeou0",
|
|
4
|
-
"sidebarAndContent": "EmptyState-module_sidebarAndContent__Eysay",
|
|
5
|
-
"contentOnly": "EmptyState-module_contentOnly__RWVVX",
|
|
6
|
-
"positive": "EmptyState-module_positive__o3dXR",
|
|
7
|
-
"negative": "EmptyState-module_negative__e5ci6",
|
|
8
|
-
"action": "EmptyState-module_action__OdsgJ",
|
|
9
|
-
"neutral": "EmptyState-module_neutral__L6fBb",
|
|
10
|
-
"success": "EmptyState-module_success__y7jKP",
|
|
11
|
-
"warning": "EmptyState-module_warning__-PrRp",
|
|
12
|
-
"informative": "EmptyState-module_informative__x0GSr",
|
|
13
|
-
"expert-advice": "EmptyState-module_expert-advice__VVB8i",
|
|
14
|
-
"illustrationSide": "EmptyState-module_illustrationSide__ZSjF3",
|
|
15
|
-
"textSide": "EmptyState-module_textSide__tv54w",
|
|
16
|
-
"illustration": "EmptyState-module_illustration__HyD2k",
|
|
17
|
-
"textSideInner": "EmptyState-module_textSideInner__Yynhi",
|
|
18
|
-
"heading": "EmptyState-module_heading__y-yvC",
|
|
19
|
-
"description": "EmptyState-module_description__fsJOc"
|
|
20
|
-
};
|
|
21
|
-
export { styles as default };
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
@import "~@kaizen/design-tokens/sass/spacing";
|
|
2
|
-
@import "~@kaizen/design-tokens/sass/color";
|
|
3
|
-
@import "~@kaizen/design-tokens/sass/border";
|
|
4
|
-
@import "./mixins";
|
|
5
|
-
|
|
6
|
-
.container {
|
|
7
|
-
--empty-state-border-width: var(--border-width-1);
|
|
8
|
-
|
|
9
|
-
display: flex;
|
|
10
|
-
width: 100%;
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
justify-content: space-around;
|
|
13
|
-
padding: calc(2% - var(--empty-state-border-width))
|
|
14
|
-
calc(var(--spacing-24) - var(--empty-state-border-width));
|
|
15
|
-
color: $color-purple-800;
|
|
16
|
-
border: var(--empty-state-border-width) solid var(--empty-state-border-color);
|
|
17
|
-
border-radius: var(--border-solid-border-radius);
|
|
18
|
-
background-color: var(--empty-state-background-color);
|
|
19
|
-
flex-wrap: wrap;
|
|
20
|
-
|
|
21
|
-
@include small {
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
padding: calc(var(--spacing-24) - var(--empty-state-border-width));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&.straightCorners {
|
|
28
|
-
border-radius: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// These class names must match the possible values of the component's layoutContext prop
|
|
32
|
-
&.sidebarAndContent {
|
|
33
|
-
@include large-sidebar-and-content {
|
|
34
|
-
padding-top: $spacing-md;
|
|
35
|
-
padding-bottom: $spacing-md;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.contentOnly {
|
|
40
|
-
@include large-content-only {
|
|
41
|
-
padding-top: $spacing-md;
|
|
42
|
-
padding-bottom: $spacing-md;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** @deprecated */
|
|
48
|
-
.positive {
|
|
49
|
-
--empty-state-border-color: var(--color-green-500);
|
|
50
|
-
--empty-state-background-color: var(--color-green-100);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.negative,
|
|
54
|
-
.action {
|
|
55
|
-
--empty-state-border-color: var(--color-red-500);
|
|
56
|
-
--empty-state-background-color: var(--color-red-100);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.neutral {
|
|
60
|
-
--empty-state-border-color: var(--color-purple-400);
|
|
61
|
-
--empty-state-background-color: var(--color-purple-100);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** end @deprecated */
|
|
65
|
-
.success {
|
|
66
|
-
--empty-state-border-color: var(--color-green-500);
|
|
67
|
-
--empty-state-background-color: var(--color-green-100);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.warning {
|
|
71
|
-
--empty-state-border-color: var(--color-red-500);
|
|
72
|
-
--empty-state-background-color: var(--color-red-100);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.informative {
|
|
76
|
-
--empty-state-border-color: var(--color-blue-400);
|
|
77
|
-
--empty-state-background-color: var(--color-blue-100);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.expert-advice {
|
|
81
|
-
--empty-state-border-color: var(--color-purple-400);
|
|
82
|
-
--empty-state-background-color: var(--color-purple-100);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.illustrationSide,
|
|
86
|
-
.textSide {
|
|
87
|
-
display: flex;
|
|
88
|
-
box-sizing: border-box;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.illustrationSide {
|
|
92
|
-
justify-content: center;
|
|
93
|
-
align-items: center;
|
|
94
|
-
flex: 0 1 auto;
|
|
95
|
-
min-width: 0;
|
|
96
|
-
max-width: 100%;
|
|
97
|
-
margin-bottom: $spacing-md;
|
|
98
|
-
|
|
99
|
-
@include small {
|
|
100
|
-
width: 100%;
|
|
101
|
-
max-width: 224px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@include medium {
|
|
105
|
-
flex-direction: column;
|
|
106
|
-
justify-content: center;
|
|
107
|
-
align-items: flex-end;
|
|
108
|
-
margin-bottom: 0;
|
|
109
|
-
width: auto;
|
|
110
|
-
max-width: 40%;
|
|
111
|
-
padding-inline-end: $spacing-md;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.sidebarAndContent & {
|
|
115
|
-
@include large-sidebar-and-content {
|
|
116
|
-
flex-shrink: 1;
|
|
117
|
-
flex-basis: auto;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.contentOnly & {
|
|
122
|
-
@include large-content-only {
|
|
123
|
-
flex-shrink: 1;
|
|
124
|
-
flex-basis: auto;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.illustration,
|
|
130
|
-
.illustrationSide video {
|
|
131
|
-
max-width: 100%;
|
|
132
|
-
max-height: 366px;
|
|
133
|
-
width: auto;
|
|
134
|
-
height: auto;
|
|
135
|
-
|
|
136
|
-
// Fixes for IE11 Flexbox issues
|
|
137
|
-
min-height: 196px;
|
|
138
|
-
|
|
139
|
-
@include small {
|
|
140
|
-
max-height: 196px;
|
|
141
|
-
width: 100%;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.textSide {
|
|
146
|
-
flex: 1 1 auto;
|
|
147
|
-
min-width: 0;
|
|
148
|
-
max-width: 100%;
|
|
149
|
-
align-items: center;
|
|
150
|
-
-webkit-font-smoothing: antialiased;
|
|
151
|
-
|
|
152
|
-
@include medium {
|
|
153
|
-
flex: 0 1 50%;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.textSideInner {
|
|
158
|
-
width: 100%;
|
|
159
|
-
max-width: 100%;
|
|
160
|
-
box-sizing: border-box;
|
|
161
|
-
margin: 0 $spacing-sm;
|
|
162
|
-
word-wrap: break-word;
|
|
163
|
-
overflow-wrap: break-word;
|
|
164
|
-
|
|
165
|
-
@include small {
|
|
166
|
-
margin-bottom: 0;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@include medium {
|
|
170
|
-
max-width: 426px;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.heading {
|
|
175
|
-
margin-bottom: $spacing-md;
|
|
176
|
-
max-width: 100%;
|
|
177
|
-
|
|
178
|
-
@media (max-width: (375px)) {
|
|
179
|
-
@include typography-heading-3-sm;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.description {
|
|
184
|
-
margin-bottom: $spacing-md;
|
|
185
|
-
max-width: 100%;
|
|
186
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { cleanup, render } from "@testing-library/react"
|
|
3
|
-
import { EmptyState, EmptyStateProps } from "./EmptyState"
|
|
4
|
-
|
|
5
|
-
vi.mock("~components/Illustration", () => ({
|
|
6
|
-
EmptyStatesPositive: (): JSX.Element => (
|
|
7
|
-
<div>EmptyStatesPositive_Component</div>
|
|
8
|
-
),
|
|
9
|
-
EmptyStatesNeutral: (): JSX.Element => (
|
|
10
|
-
<div>EmptyStatesNeutral_Component</div>
|
|
11
|
-
),
|
|
12
|
-
EmptyStatesNegative: (): JSX.Element => (
|
|
13
|
-
<div>EmptyStatesNegative_Component</div>
|
|
14
|
-
),
|
|
15
|
-
EmptyStatesInformative: (): JSX.Element => (
|
|
16
|
-
<div>EmptyStatesInformative_Component</div>
|
|
17
|
-
),
|
|
18
|
-
EmptyStatesAction: (): JSX.Element => <div>EmptyStatesAction_Component</div>,
|
|
19
|
-
}))
|
|
20
|
-
|
|
21
|
-
describe("<EmptyState />", () => {
|
|
22
|
-
afterEach(cleanup)
|
|
23
|
-
|
|
24
|
-
const defaultProps: EmptyStateProps = {
|
|
25
|
-
id: "someId",
|
|
26
|
-
headingProps: {
|
|
27
|
-
children: "Some heading",
|
|
28
|
-
variant: "heading-1",
|
|
29
|
-
},
|
|
30
|
-
bodyText: "Lorem ipsum dolor...",
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
it("renders an `id` attribute", () => {
|
|
34
|
-
const { container } = render(<EmptyState {...defaultProps} />)
|
|
35
|
-
|
|
36
|
-
expect(container.querySelector("#someId")).toBeTruthy()
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
it("renders given children", () => {
|
|
40
|
-
const { getByText } = render(
|
|
41
|
-
<EmptyState {...defaultProps}>
|
|
42
|
-
<h1>Child Heading</h1>
|
|
43
|
-
</EmptyState>
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
expect(getByText("Child Heading")).toBeTruthy()
|
|
47
|
-
})
|
|
48
|
-
})
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
@import "~@kaizen/design-tokens/sass/layout";
|
|
2
|
-
|
|
3
|
-
$small: 300px;
|
|
4
|
-
$medium: $layout-breakpoints-medium;
|
|
5
|
-
$large: $layout-breakpoints-large;
|
|
6
|
-
|
|
7
|
-
// comes from ca-layout-padding x2 which is no longer used
|
|
8
|
-
$side-padding: 48px;
|
|
9
|
-
$sidebarWidth: 240px;
|
|
10
|
-
$sidebarWithPadding: $sidebarWidth + $side-padding;
|
|
11
|
-
|
|
12
|
-
$typography-heading-3-font-size-small: 1.25rem;
|
|
13
|
-
$typography-heading-3-font-weight-small: 700;
|
|
14
|
-
$typography-heading-3-line-height-small: 1.5rem;
|
|
15
|
-
|
|
16
|
-
@mixin large-sidebar-and-content {
|
|
17
|
-
@media (min-width: ($large + $sidebarWithPadding + $side-padding)) {
|
|
18
|
-
@content;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@mixin large-content-only {
|
|
23
|
-
@media (min-width: ($large + $side-padding)) {
|
|
24
|
-
@content;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@mixin medium {
|
|
29
|
-
@media (min-width: ($medium + $side-padding)) {
|
|
30
|
-
@content;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@mixin small {
|
|
35
|
-
@media (max-width: ($medium + $side-padding - 1px)) {
|
|
36
|
-
@content;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@mixin typography-heading-3-sm {
|
|
41
|
-
font-size: $typography-heading-3-font-size-small;
|
|
42
|
-
line-height: $typography-heading-3-line-height-small;
|
|
43
|
-
font-weight: $typography-heading-3-font-weight-small;
|
|
44
|
-
}
|