@kaizen/components 0.0.0-canary-package-bundler-v2-20241113071536 → 0.0.0-canary-link-button-wip-canary-20241121010628

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 (93) hide show
  1. package/codemods/README.md +16 -1
  2. package/codemods/upgradeIconV1/getNewIconPropsFromOldIconName.ts +9 -9
  3. package/dist/cjs/EmptyState/EmptyState.cjs +15 -17
  4. package/dist/cjs/EmptyState/EmptyState.module.css.cjs +20 -0
  5. package/dist/cjs/GuidanceBlock/GuidanceBlock.cjs +1 -1
  6. package/dist/cjs/GuidanceBlock/GuidanceBlock.module.css.cjs +28 -0
  7. package/dist/cjs/__actions__/Button/v3/Button.cjs +43 -8
  8. package/dist/cjs/__actions__/Button/v3/Button.module.css.cjs +21 -0
  9. package/dist/cjs/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.cjs +37 -0
  10. package/dist/cjs/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.module.css.cjs +9 -0
  11. package/dist/cjs/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.cjs +35 -0
  12. package/dist/cjs/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.module.css.cjs +8 -0
  13. package/dist/cjs/__overlays__/Tooltip/v3/Tooltip.cjs +2 -2
  14. package/dist/esm/Calendar/CalendarPopover/CalendarPopover.mjs +1 -1
  15. package/dist/esm/EmptyState/EmptyState.mjs +16 -18
  16. package/dist/esm/EmptyState/EmptyState.module.css.mjs +18 -0
  17. package/dist/esm/Filter/FilterMultiSelect/subcomponents/ListBox/ListBox.mjs +1 -1
  18. package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +1 -1
  19. package/dist/esm/GuidanceBlock/GuidanceBlock.module.css.mjs +26 -0
  20. package/dist/esm/MultiSelect/subcomponents/Popover/Popover.mjs +1 -1
  21. package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +1 -1
  22. package/dist/esm/RichTextEditor/RichTextEditor/schema.mjs +1 -1
  23. package/dist/esm/RichTextEditor/utils/schema/nodes.mjs +1 -1
  24. package/dist/esm/TimeField/TimeField.mjs +1 -1
  25. package/dist/esm/__actions__/Button/v3/Button.mjs +44 -9
  26. package/dist/esm/__actions__/Button/v3/Button.module.css.mjs +19 -0
  27. package/dist/esm/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.mjs +28 -0
  28. package/dist/esm/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.module.css.mjs +7 -0
  29. package/dist/esm/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.mjs +26 -0
  30. package/dist/esm/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.module.css.mjs +6 -0
  31. package/dist/esm/__overlays__/Tooltip/v1/Tooltip.mjs +1 -1
  32. package/dist/esm/__overlays__/Tooltip/v3/Tooltip.mjs +1 -1
  33. package/dist/styles.css +547 -463
  34. package/dist/types/EmptyState/EmptyState.d.ts +2 -1
  35. package/dist/types/__actions__/Button/v3/Button.d.ts +17 -4
  36. package/dist/types/__actions__/Button/v3/index.d.ts +1 -0
  37. package/dist/types/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.d.ts +11 -0
  38. package/dist/types/__actions__/Button/v3/subcomponents/ButtonContent/index.d.ts +1 -0
  39. package/dist/types/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.d.ts +5 -0
  40. package/dist/types/__actions__/Button/v3/subcomponents/PendingContent/index.d.ts +1 -0
  41. package/dist/types/__actions__/Button/v3/subcomponents/index.d.ts +2 -0
  42. package/dist/types/__actions__/Button/v3/types.d.ts +21 -0
  43. package/dist/types/__actions__/LinkButton/index.d.ts +1 -0
  44. package/dist/types/__actions__/LinkButton/v3/LinkButton.d.ts +11 -0
  45. package/dist/types/__actions__/LinkButton/v3/index.d.ts +1 -0
  46. package/package.json +8 -8
  47. package/src/EmptyState/EmptyState.module.css +114 -0
  48. package/src/EmptyState/EmptyState.tsx +18 -20
  49. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +55 -39
  50. package/src/GuidanceBlock/{GuidanceBlock.module.scss → GuidanceBlock.module.css} +60 -114
  51. package/src/GuidanceBlock/GuidanceBlock.tsx +1 -1
  52. package/src/__actions__/Button/v3/Button.module.css +235 -0
  53. package/src/__actions__/Button/v3/Button.tsx +95 -29
  54. package/src/__actions__/Button/v3/_docs/Button--api-specification.mdx +151 -0
  55. package/src/__actions__/Button/v3/_docs/Button--usage-guidelines.mdx +30 -0
  56. package/src/__actions__/Button/v3/_docs/Button.docs.stories.tsx +112 -50
  57. package/src/__actions__/Button/v3/_docs/Button.spec.stories.tsx +80 -120
  58. package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +183 -81
  59. package/src/__actions__/Button/v3/index.ts +1 -0
  60. package/src/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.module.css +19 -0
  61. package/src/__actions__/Button/v3/subcomponents/ButtonContent/ButtonContent.tsx +40 -0
  62. package/src/__actions__/Button/v3/subcomponents/ButtonContent/index.ts +1 -0
  63. package/src/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.module.css +16 -0
  64. package/src/__actions__/Button/v3/subcomponents/PendingContent/PendingContent.tsx +28 -0
  65. package/src/__actions__/Button/v3/subcomponents/PendingContent/index.ts +1 -0
  66. package/src/__actions__/Button/v3/subcomponents/index.ts +2 -0
  67. package/src/__actions__/Button/v3/types.ts +25 -0
  68. package/src/__actions__/LinkButton/index.ts +1 -0
  69. package/src/__actions__/LinkButton/v3/LinkButton.module.css +4 -0
  70. package/src/__actions__/LinkButton/v3/LinkButton.tsx +71 -0
  71. package/src/__actions__/LinkButton/v3/_docs/LinkButton--api-specification.mdx +200 -0
  72. package/src/__actions__/LinkButton/v3/_docs/LinkButton.doc.stories.tsx +131 -0
  73. package/src/__actions__/LinkButton/v3/_docs/LinkButton.spec.stories.tsx +100 -0
  74. package/src/__actions__/LinkButton/v3/index.ts +1 -0
  75. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +54 -18
  76. package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +30 -10
  77. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +12 -4
  78. package/src/__future__/Icon/_docs/Icon.docs.stories.tsx +7 -7
  79. package/src/__overlays__/Tooltip/v3/Tooltip.tsx +1 -1
  80. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +2 -0
  81. package/dist/cjs/EmptyState/EmptyState.module.scss.cjs +0 -23
  82. package/dist/cjs/GuidanceBlock/GuidanceBlock.module.scss.cjs +0 -33
  83. package/dist/cjs/__actions__/Button/v3/Button.module.scss.cjs +0 -9
  84. package/dist/esm/EmptyState/EmptyState.module.scss.mjs +0 -21
  85. package/dist/esm/GuidanceBlock/GuidanceBlock.module.scss.mjs +0 -31
  86. package/dist/esm/__actions__/Button/v3/Button.module.scss.mjs +0 -7
  87. package/src/EmptyState/EmptyState.module.scss +0 -177
  88. package/src/EmptyState/EmptyState.spec.tsx +0 -48
  89. package/src/EmptyState/_mixins.scss +0 -44
  90. package/src/__actions__/Button/v3/Button.module.scss +0 -104
  91. package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +0 -173
  92. package/src/__actions__/Button/v3/_docs/Button.mdx +0 -41
  93. package/src/__actions__/Button/v3/_docs/Button.stories.tsx +0 -98
@@ -36,8 +36,12 @@ export const KitchenSink: Story = {
36
36
  ],
37
37
  render: ({ defaultOpen, ...args }) => (
38
38
  <MenuTrigger defaultOpen={defaultOpen} {...args}>
39
- <Button>
40
- <Icon name="more_horiz" alt="Additional actions" />
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
- <Icon name="more_horiz" alt="Additional actions" />
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
- <Icon name="more_horiz" alt="Additional actions" />
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
- <Icon name="more_horiz" alt="Additional actions" />
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" alt="Additional actions" />
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 className="[--icon-size:24]">
29
- <Icon name="more_horiz" alt="Additional actions" />
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 className="[--icon-size:24]">
72
- <Icon name="more_horiz" alt="Additional actions" />
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
- <Button>
128
- <Icon {...args} />
129
- </Button>
127
+ <Tag color="blue" icon={<Icon {...args} />}>
128
+ Meaningful icons can be helpful
129
+ </Tag>
130
130
  ),
131
- args: { isPresentational: false, alt: "Favourite" },
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
- <Icon {...args} /> Favourite
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,33 +0,0 @@
1
- 'use strict';
2
-
3
- var styles = {
4
- "rightMargin": "GuidanceBlock-module_rightMargin__-iEFa",
5
- "noRightMargin": "GuidanceBlock-module_noRightMargin__4Uy9N",
6
- "banner": "GuidanceBlock-module_banner__FxKcd",
7
- "noMaxWidth": "GuidanceBlock-module_noMaxWidth__UzHP1",
8
- "illustrationWrapper": "GuidanceBlock-module_illustrationWrapper__AEljX",
9
- "illustration": "GuidanceBlock-module_illustration__sU1Vu",
10
- "hasSceneIllustration": "GuidanceBlock-module_hasSceneIllustration__tvFRD",
11
- "descriptionContainer": "GuidanceBlock-module_descriptionContainer__aywtY",
12
- "descriptionAndActions": "GuidanceBlock-module_descriptionAndActions__E5BcL",
13
- "buttonContainer": "GuidanceBlock-module_buttonContainer__U2Hxn",
14
- "hidden": "GuidanceBlock-module_hidden__CbgXn",
15
- "headingWrapper": "GuidanceBlock-module_headingWrapper__zgVmA",
16
- "cancel": "GuidanceBlock-module_cancel__UaIA-",
17
- "icon": "GuidanceBlock-module_icon__y2xz8",
18
- "disabled": "GuidanceBlock-module_disabled__Uhgsr",
19
- "hover": "GuidanceBlock-module_hover__7V9x1",
20
- "active": "GuidanceBlock-module_active__YJaZt",
21
- "default": "GuidanceBlock-module_default__Ffblg",
22
- "positive": "GuidanceBlock-module_positive__yENlT",
23
- "negative": "GuidanceBlock-module_negative__E-Jvh",
24
- "assertive": "GuidanceBlock-module_assertive__6PZlM",
25
- "informative": "GuidanceBlock-module_informative__ZUH4j",
26
- "cautionary": "GuidanceBlock-module_cautionary__sJ1CE",
27
- "prominent": "GuidanceBlock-module_prominent__nn-r4",
28
- "inline": "GuidanceBlock-module_inline__GwOWR",
29
- "stacked": "GuidanceBlock-module_stacked__rDupX",
30
- "centerContent": "GuidanceBlock-module_centerContent__m3IhB",
31
- "smallScreenTextAlignment": "GuidanceBlock-module_smallScreenTextAlignment__oWufj"
32
- };
33
- module.exports = styles;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- var styles = {
4
- "button": "Button-module_button__QOSYH",
5
- "default": "Button-module_default__gSx3e",
6
- "reversed": "Button-module_reversed__DT-Id",
7
- "small": "Button-module_small__S-t5B"
8
- };
9
- 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,31 +0,0 @@
1
- var styles = {
2
- "rightMargin": "GuidanceBlock-module_rightMargin__-iEFa",
3
- "noRightMargin": "GuidanceBlock-module_noRightMargin__4Uy9N",
4
- "banner": "GuidanceBlock-module_banner__FxKcd",
5
- "noMaxWidth": "GuidanceBlock-module_noMaxWidth__UzHP1",
6
- "illustrationWrapper": "GuidanceBlock-module_illustrationWrapper__AEljX",
7
- "illustration": "GuidanceBlock-module_illustration__sU1Vu",
8
- "hasSceneIllustration": "GuidanceBlock-module_hasSceneIllustration__tvFRD",
9
- "descriptionContainer": "GuidanceBlock-module_descriptionContainer__aywtY",
10
- "descriptionAndActions": "GuidanceBlock-module_descriptionAndActions__E5BcL",
11
- "buttonContainer": "GuidanceBlock-module_buttonContainer__U2Hxn",
12
- "hidden": "GuidanceBlock-module_hidden__CbgXn",
13
- "headingWrapper": "GuidanceBlock-module_headingWrapper__zgVmA",
14
- "cancel": "GuidanceBlock-module_cancel__UaIA-",
15
- "icon": "GuidanceBlock-module_icon__y2xz8",
16
- "disabled": "GuidanceBlock-module_disabled__Uhgsr",
17
- "hover": "GuidanceBlock-module_hover__7V9x1",
18
- "active": "GuidanceBlock-module_active__YJaZt",
19
- "default": "GuidanceBlock-module_default__Ffblg",
20
- "positive": "GuidanceBlock-module_positive__yENlT",
21
- "negative": "GuidanceBlock-module_negative__E-Jvh",
22
- "assertive": "GuidanceBlock-module_assertive__6PZlM",
23
- "informative": "GuidanceBlock-module_informative__ZUH4j",
24
- "cautionary": "GuidanceBlock-module_cautionary__sJ1CE",
25
- "prominent": "GuidanceBlock-module_prominent__nn-r4",
26
- "inline": "GuidanceBlock-module_inline__GwOWR",
27
- "stacked": "GuidanceBlock-module_stacked__rDupX",
28
- "centerContent": "GuidanceBlock-module_centerContent__m3IhB",
29
- "smallScreenTextAlignment": "GuidanceBlock-module_smallScreenTextAlignment__oWufj"
30
- };
31
- export { styles as default };
@@ -1,7 +0,0 @@
1
- var styles = {
2
- "button": "Button-module_button__QOSYH",
3
- "default": "Button-module_default__gSx3e",
4
- "reversed": "Button-module_reversed__DT-Id",
5
- "small": "Button-module_small__S-t5B"
6
- };
7
- export { styles as default };
@@ -1,177 +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
- justify-content: space-around;
11
- width: 100%;
12
- padding: calc(2% - var(--empty-state-border-width))
13
- calc(var(--spacing-24) - var(--empty-state-border-width));
14
- color: $color-purple-800;
15
- border: var(--empty-state-border-width) solid var(--empty-state-border-color);
16
- border-radius: var(--border-solid-border-radius);
17
- background-color: var(--empty-state-background-color);
18
-
19
- @include small {
20
- flex-direction: column;
21
- align-items: center;
22
- padding-block: calc(var(--spacing-24) - var(--empty-state-border-width));
23
- }
24
-
25
- &.straightCorners {
26
- border-radius: 0;
27
- }
28
-
29
- // These class names must match the possible values of the component's layoutContext prop
30
- &.sidebarAndContent {
31
- @include large-sidebar-and-content {
32
- padding-top: $spacing-md;
33
- padding-bottom: $spacing-md;
34
- }
35
- }
36
-
37
- &.contentOnly {
38
- @include large-content-only {
39
- padding-top: $spacing-md;
40
- padding-bottom: $spacing-md;
41
- }
42
- }
43
- }
44
-
45
- /** @deprecated */
46
- .positive {
47
- --empty-state-border-color: var(--color-green-500);
48
- --empty-state-background-color: var(--color-green-100);
49
- }
50
-
51
- .negative,
52
- .action {
53
- --empty-state-border-color: var(--color-red-500);
54
- --empty-state-background-color: var(--color-red-100);
55
- }
56
-
57
- .neutral {
58
- --empty-state-border-color: var(--color-purple-400);
59
- --empty-state-background-color: var(--color-purple-100);
60
- }
61
-
62
- /** end @deprecated */
63
- .success {
64
- --empty-state-border-color: var(--color-green-500);
65
- --empty-state-background-color: var(--color-green-100);
66
- }
67
-
68
- .warning {
69
- --empty-state-border-color: var(--color-red-500);
70
- --empty-state-background-color: var(--color-red-100);
71
- }
72
-
73
- .informative {
74
- --empty-state-border-color: var(--color-blue-400);
75
- --empty-state-background-color: var(--color-blue-100);
76
- }
77
-
78
- .expert-advice {
79
- --empty-state-border-color: var(--color-purple-400);
80
- --empty-state-background-color: var(--color-purple-100);
81
- }
82
-
83
- .illustrationSide,
84
- .textSide {
85
- display: inline-block;
86
- }
87
-
88
- .illustrationSide {
89
- min-width: 224px;
90
- flex-grow: 0;
91
- flex-shrink: 1;
92
- margin-bottom: $spacing-md;
93
-
94
- @include small {
95
- width: 224px;
96
- }
97
-
98
- @include medium {
99
- display: flex;
100
- flex-direction: column;
101
- justify-content: center;
102
- align-items: flex-end;
103
- margin-bottom: 0;
104
- min-width: 40%;
105
- max-width: 50%;
106
- flex-grow: 1;
107
- box-sizing: border-box;
108
- padding-inline-end: $spacing-md;
109
- }
110
-
111
- .sidebarAndContent & {
112
- @include large-sidebar-and-content {
113
- flex-shrink: 1;
114
- flex-basis: auto;
115
- }
116
- }
117
-
118
- .contentOnly & {
119
- @include large-content-only {
120
- flex-shrink: 1;
121
- flex-basis: auto;
122
- }
123
- }
124
- }
125
-
126
- .illustration,
127
- .illustrationSide video {
128
- max-width: 100%;
129
- max-height: 366px;
130
- width: auto;
131
-
132
- // Fixes for IE11 Flexbox issues
133
- min-height: 196px;
134
-
135
- @include small {
136
- max-height: 196px;
137
- }
138
- }
139
-
140
- .textSide {
141
- display: flex;
142
- flex-grow: 1;
143
- flex-shrink: 1;
144
- align-items: center;
145
- -webkit-font-smoothing: antialiased;
146
-
147
- @include medium {
148
- flex-basis: 50%;
149
- flex-grow: 0;
150
- }
151
- }
152
-
153
- .textSideInner {
154
- flex-grow: 0;
155
- height: auto;
156
- margin: 0 $spacing-sm;
157
-
158
- @include small {
159
- margin-bottom: 0;
160
- }
161
-
162
- @include medium {
163
- max-width: 426px;
164
- }
165
- }
166
-
167
- .heading {
168
- margin-bottom: $spacing-md;
169
-
170
- @media (max-width: (375px)) {
171
- @include typography-heading-3-sm;
172
- }
173
- }
174
-
175
- .description {
176
- margin-bottom: $spacing-md;
177
- }
@@ -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
- }
@@ -1,104 +0,0 @@
1
- .button {
2
- --button-min-height-width: var(--spacing-48);
3
- --button-padding-x: calc(
4
- #{var(--spacing-12)} - #{var(--border-solid-border-width)}
5
- );
6
- --button-padding-y: calc(
7
- #{var(--spacing-8)} - #{var(--border-solid-border-width)}
8
- );
9
- --button-icon-size: var(--spacing-24);
10
-
11
- // RESET
12
- appearance: none;
13
- background: transparent;
14
- color: inherit;
15
- font: inherit;
16
- margin: 0;
17
- border: none;
18
- // RESET
19
- border: var(--border-solid-border-width) var(--border-solid-border-style);
20
- border-radius: var(--border-solid-border-radius);
21
- box-sizing: border-box;
22
- display: inline-flex;
23
- align-items: center;
24
- justify-content: center;
25
- text-align: left;
26
- gap: var(--spacing-8);
27
- font-family: var(--typography-button-primary-font-family);
28
- font-weight: var(--typography-button-primary-font-weight);
29
- font-size: var(--typography-button-primary-font-size);
30
- line-height: var(--typography-button-primary-line-height);
31
- min-height: var(--button-min-height-width);
32
- min-width: var(--button-min-height-width);
33
- outline: none;
34
- position: relative;
35
- padding: var(--button-padding-y) var(--button-padding-x);
36
- -webkit-font-smoothing: antialiased;
37
- -moz-osx-font-smoothing: grayscale;
38
-
39
- &[data-focus-visible]::after {
40
- content: "";
41
- position: absolute;
42
- background: transparent;
43
- border-color: var(--color-blue-500);
44
- border-radius: var(--border-focus-ring-border-radius);
45
- border-width: var(--border-focus-ring-border-width);
46
- border-style: var(--border-focus-ring-border-style);
47
- inset: calc(-1 * ((#{var(--border-focus-ring-border-width)} * 2) + 1px));
48
- }
49
-
50
- svg {
51
- height: var(--button-icon-size);
52
- width: var(--button-icon-size);
53
- }
54
- }
55
-
56
- .default {
57
- border-color: var(--color-gray-500);
58
- color: var(--color-purple-800);
59
-
60
- &[data-hovered],
61
- &[data-focus-visible],
62
- &[data-pressed] {
63
- background-color: var(--color-gray-200);
64
- border-color: var(--color-purple-800);
65
- }
66
-
67
- &[data-disabled] {
68
- opacity: 0.3;
69
- }
70
-
71
- &.reversed {
72
- background-color: transparent;
73
- border-color: rgba(var(--color-white-rgb), 0.65);
74
- color: var(--color-white);
75
-
76
- &[data-hovered],
77
- &[data-focus-visible] {
78
- background-color: rgba(var(--color-white-rgb), 0.1);
79
- border-color: var(--color-white);
80
- }
81
-
82
- &[data-focus-visible]::after {
83
- border-color: var(--color-blue-300);
84
- }
85
-
86
- &[data-disabled]::after {
87
- border-color: var(--color-gray-400);
88
- }
89
- }
90
- }
91
-
92
- .small {
93
- // spacing-40 does not currently exist. Holding on adding this until the button rfc has been signed off
94
- --button-min-height-width: 2.5rem;
95
- --button-padding-x: calc(
96
- #{var(--spacing-8)} - #{var(--border-solid-border-width)}
97
- );
98
- --button-padding-y: calc(
99
- #{var(--spacing-8)} - #{var(--border-solid-border-width)}
100
- );
101
- --button-icon-size: var(--spacing-16);
102
-
103
- gap: var(--spacing-8);
104
- }