@kaizen/components 0.0.0-canary-package-bundler-v2-20241113071536 → 0.0.0-canary-link-button-wip-canary-20241121043208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codemods/README.md +16 -1
- package/codemods/upgradeIconV1/getNewIconPropsFromOldIconName.ts +9 -9
- package/dist/cjs/EmptyState/EmptyState.cjs +15 -17
- package/dist/cjs/EmptyState/EmptyState.module.css.cjs +20 -0
- package/dist/cjs/GuidanceBlock/GuidanceBlock.cjs +1 -1
- package/dist/cjs/GuidanceBlock/GuidanceBlock.module.css.cjs +28 -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/__actions__/LinkButton/v3/LinkButton.cjs +56 -0
- package/dist/cjs/__actions__/LinkButton/v3/LinkButton.module.css.cjs +6 -0
- package/dist/cjs/__overlays__/Tooltip/v3/Tooltip.cjs +2 -2
- package/dist/cjs/actionsV3.cjs +2 -0
- package/dist/esm/Calendar/CalendarPopover/CalendarPopover.mjs +1 -1
- package/dist/esm/EmptyState/EmptyState.mjs +16 -18
- package/dist/esm/EmptyState/EmptyState.module.css.mjs +18 -0
- package/dist/esm/Filter/FilterMultiSelect/subcomponents/ListBox/ListBox.mjs +1 -1
- package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +1 -1
- package/dist/esm/GuidanceBlock/GuidanceBlock.module.css.mjs +26 -0
- package/dist/esm/MultiSelect/subcomponents/Popover/Popover.mjs +1 -1
- package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +1 -1
- package/dist/esm/RichTextEditor/RichTextEditor/schema.mjs +1 -1
- package/dist/esm/RichTextEditor/utils/schema/nodes.mjs +1 -1
- package/dist/esm/TimeField/TimeField.mjs +1 -1
- package/dist/esm/__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/__actions__/LinkButton/v3/LinkButton.mjs +47 -0
- package/dist/esm/__actions__/LinkButton/v3/LinkButton.module.css.mjs +4 -0
- package/dist/esm/__overlays__/Tooltip/v1/Tooltip.mjs +1 -1
- package/dist/esm/__overlays__/Tooltip/v3/Tooltip.mjs +1 -1
- package/dist/esm/actionsV3.mjs +1 -0
- package/dist/styles.css +552 -463
- 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/dist/types/__actions__/LinkButton/index.d.ts +1 -0
- package/dist/types/__actions__/LinkButton/v3/LinkButton.d.ts +11 -0
- package/dist/types/__actions__/LinkButton/v3/index.d.ts +1 -0
- package/dist/types/__actions__/v3.d.ts +1 -0
- package/package.json +8 -8
- 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/GuidanceBlock/{GuidanceBlock.module.scss → GuidanceBlock.module.css} +60 -114
- package/src/GuidanceBlock/GuidanceBlock.tsx +1 -1
- package/src/__actions__/Button/v3/Button.module.css +235 -0
- package/src/__actions__/Button/v3/Button.tsx +95 -29
- package/src/__actions__/Button/v3/_docs/Button--api-specification.mdx +151 -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__/LinkButton/index.ts +1 -0
- package/src/__actions__/LinkButton/v3/LinkButton.module.css +4 -0
- package/src/__actions__/LinkButton/v3/LinkButton.tsx +72 -0
- package/src/__actions__/LinkButton/v3/_docs/LinkButton--api-specification.mdx +210 -0
- package/src/__actions__/LinkButton/v3/_docs/LinkButton.doc.stories.tsx +132 -0
- package/src/__actions__/LinkButton/v3/_docs/LinkButton.spec.stories.tsx +100 -0
- package/src/__actions__/LinkButton/v3/_docs/LinkButton.stickersheet.stories.tsx +176 -0
- package/src/__actions__/LinkButton/v3/index.ts +1 -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/__actions__/v3.ts +1 -0
- 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/GuidanceBlock/GuidanceBlock.module.scss.cjs +0 -33
- 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/GuidanceBlock/GuidanceBlock.module.scss.mjs +0 -31
- package/dist/esm/__actions__/Button/v3/Button.module.scss.mjs +0 -7
- package/src/EmptyState/EmptyState.module.scss +0 -177
- 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
|
@@ -17,6 +17,7 @@ export type EmptyStateProps = {
|
|
|
17
17
|
* @default informative
|
|
18
18
|
*/
|
|
19
19
|
variant?: "success" | "warning" | "informative" | "expert-advice";
|
|
20
|
+
/** @deprecated - This prop no longer has any effect */
|
|
20
21
|
layoutContext?: "sidebarAndContent" | "contentOnly";
|
|
21
22
|
bodyText: string | React.ReactNode;
|
|
22
23
|
straightCorners?: boolean;
|
|
@@ -27,6 +28,6 @@ export type EmptyStateProps = {
|
|
|
27
28
|
* {@link https://cultureamp.design/?path=/docs/components-empty-state--docs Storybook}
|
|
28
29
|
*/
|
|
29
30
|
export declare const EmptyState: {
|
|
30
|
-
({ children, id, illustrationType, variant, layoutContext, headingProps, bodyText, straightCorners, isAnimated, loop, classNameOverride, ...props }: EmptyStateProps): JSX.Element;
|
|
31
|
+
({ children, id, illustrationType, variant, layoutContext: _, headingProps, bodyText, straightCorners, isAnimated, loop, classNameOverride, ...props }: EmptyStateProps): JSX.Element;
|
|
31
32
|
displayName: string;
|
|
32
33
|
};
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { ButtonProps as RACButtonProps } from "react-aria-components";
|
|
2
|
-
|
|
3
|
-
export type
|
|
3
|
+
import { ButtonSizes, ButtonVariants, PendingButtonProps } from "./types";
|
|
4
|
+
export type ButtonBaseProps = {
|
|
5
|
+
/** Visually hides the Button's child content used as the label and the `pendingLabel`. Use for icon-only `Button`. @default "false" */
|
|
6
|
+
hasHiddenLabel?: boolean;
|
|
4
7
|
/** The visual style of the button.
|
|
5
8
|
* @default "default" */
|
|
6
9
|
variant?: ButtonVariants;
|
|
7
10
|
/** The visual size of the button. `medium` was formerly `regular`
|
|
8
11
|
* @default "medium" */
|
|
9
|
-
size?:
|
|
12
|
+
size?: ButtonSizes;
|
|
13
|
+
/** Renders an icon at the `iconPosition` provided. To the size scales with the button, we recommend using the `Icon` component from `"@kaizen/components/future"` */
|
|
14
|
+
icon?: JSX.Element;
|
|
15
|
+
/** Controls the position of the Icon passed in as props. @default "start" */
|
|
16
|
+
iconPosition?: "start" | "end";
|
|
17
|
+
/** Controls if the button inherits width from its parent. @default "false" */
|
|
18
|
+
isFullWidth?: boolean;
|
|
10
19
|
};
|
|
11
|
-
export
|
|
20
|
+
export type ButtonProps = ButtonBaseProps & PendingButtonProps & Omit<RACButtonProps, "children"> & {
|
|
21
|
+
/** Used as the label for the button. */
|
|
22
|
+
children: RACButtonProps["children"];
|
|
23
|
+
};
|
|
24
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { ButtonProps } from "../../Button";
|
|
3
|
+
type ButtonContentProps = {
|
|
4
|
+
size?: ButtonProps["size"];
|
|
5
|
+
icon?: ButtonProps["icon"];
|
|
6
|
+
iconPosition?: ButtonProps["iconPosition"];
|
|
7
|
+
hasHiddenLabel?: ButtonProps["hasHiddenLabel"];
|
|
8
|
+
} & HTMLAttributes<HTMLSpanElement>;
|
|
9
|
+
/** Renders the inner content of the button, handling icon and label visibility */
|
|
10
|
+
export declare const ButtonContent: ({ children, hasHiddenLabel, size, icon, iconPosition, className, ...restProps }: ButtonContentProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ButtonContent";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ButtonSizes, PendingProps } from "../../types";
|
|
2
|
+
/** Renders the pending content of the button, handling pending label visibility and spinner positioning */
|
|
3
|
+
export declare const PendingContent: ({ pendingLabel, hasHiddenPendingLabel, size, }: PendingProps & {
|
|
4
|
+
size?: ButtonSizes;
|
|
5
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PendingContent";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ButtonVariants = "primary" | "secondary" | "tertiary";
|
|
2
|
+
export type ButtonSizes = "small" | "medium" | "large";
|
|
3
|
+
export type PendingPropsUndefined = {
|
|
4
|
+
isPending?: undefined;
|
|
5
|
+
/** Rendered as the child while `isPending` is `true`. This determines the accessible label for the Button while pending. */
|
|
6
|
+
pendingLabel?: never;
|
|
7
|
+
/** Visually hides the `pendingLabel` and renders the loading spinner. This will maintain the width of the Button's `children` to avoid layout shifts.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
hasHiddenPendingLabel?: never;
|
|
11
|
+
};
|
|
12
|
+
export type PendingProps = {
|
|
13
|
+
isPending: boolean;
|
|
14
|
+
/** Rendered as the child while `pendingLabel` is `true`. This determines the accessible label for the Button while pending. */
|
|
15
|
+
pendingLabel: string;
|
|
16
|
+
/** Visually Hides the `pendingLabel` and renders the loading spinner. This will maintain the width of the Button's `children` to avoid layout shifts.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
hasHiddenPendingLabel?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type PendingButtonProps = PendingProps | PendingPropsUndefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./v3";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LinkProps as RACLinkProps } from "react-aria-components";
|
|
3
|
+
import { ButtonBaseProps } from "../../Button/v3";
|
|
4
|
+
export type LinkButtonProps = ButtonBaseProps & Omit<RACLinkProps, "children"> & {
|
|
5
|
+
/** Used as the label for the LinkButton. */
|
|
6
|
+
children: RACLinkProps["children"];
|
|
7
|
+
};
|
|
8
|
+
export declare const LinkButton: React.ForwardRefExoticComponent<ButtonBaseProps & Omit<RACLinkProps, "children"> & {
|
|
9
|
+
/** Used as the label for the LinkButton. */
|
|
10
|
+
children: RACLinkProps["children"];
|
|
11
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LinkButton";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-link-button-wip-canary-20241121043208",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"react-focus-on": "^3.9.4",
|
|
78
78
|
"react-media": "^1.10.0",
|
|
79
79
|
"react-popper": "^2.3.0",
|
|
80
|
-
"react-select": "^5.8.
|
|
80
|
+
"react-select": "^5.8.3",
|
|
81
81
|
"react-textfit": "^1.1.1",
|
|
82
82
|
"resize-observer-polyfill": "^1.5.1",
|
|
83
83
|
"use-debounce": "^10.0.4",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"react-day-picker": "Version locked until a11y gets fixed (https://github.com/gpbl/react-day-picker/pull/1708)"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@cultureamp/frontend-apis": "^
|
|
90
|
+
"@cultureamp/frontend-apis": "^11.0.0",
|
|
91
91
|
"@cultureamp/i18n-react-intl": "^2.7.1",
|
|
92
|
-
"@tanstack/react-query": "^5.
|
|
92
|
+
"@tanstack/react-query": "^5.60.5",
|
|
93
93
|
"@testing-library/dom": "^10.4.0",
|
|
94
94
|
"@types/jest-axe": "^3.5.9",
|
|
95
95
|
"@types/lodash.debounce": "^4.0.9",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"jest-axe": "^9.0.0",
|
|
103
103
|
"lodash.isempty": "^4.4.0",
|
|
104
104
|
"normalize.css": "^8.0.1",
|
|
105
|
-
"postcss": "^8.4.
|
|
105
|
+
"postcss": "^8.4.49",
|
|
106
106
|
"postcss-cli": "^11.0.0",
|
|
107
107
|
"postcss-import": "^16.1.0",
|
|
108
108
|
"postcss-preset-env": "^10.0.8",
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
"react-dom": "^18.3.1",
|
|
113
113
|
"react-highlight": "^0.15.0",
|
|
114
114
|
"react-intl": "^6.8.4",
|
|
115
|
-
"rollup": "^4.
|
|
115
|
+
"rollup": "^4.27.2",
|
|
116
116
|
"sass": "1.79.6",
|
|
117
117
|
"serialize-query-params": "^2.0.2",
|
|
118
118
|
"svgo": "^3.3.2",
|
|
119
119
|
"tslib": "^2.8.0",
|
|
120
120
|
"tsx": "^4.19.2",
|
|
121
|
-
"@kaizen/
|
|
122
|
-
"@kaizen/
|
|
121
|
+
"@kaizen/package-bundler": "2.0.1",
|
|
122
|
+
"@kaizen/design-tokens": "10.8.4"
|
|
123
123
|
},
|
|
124
124
|
"devDependenciesComments": {
|
|
125
125
|
"sass": "Prevent deprecation warnings introduced in 1.80 as we plan to move away from sass",
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
--empty-state-border-width: var(--border-width-1);
|
|
3
|
+
--empty-state-illustration-max-height: 366px;
|
|
4
|
+
--empty-state-illustration-max-width: 420px;
|
|
5
|
+
--empty-state-text-container-max-width: 426px;
|
|
6
|
+
|
|
7
|
+
container-type: inline-size;
|
|
8
|
+
width: 100%;
|
|
9
|
+
border: var(--empty-state-border-width) solid var(--empty-state-border-color);
|
|
10
|
+
border-radius: var(--border-solid-border-radius);
|
|
11
|
+
background-color: var(--empty-state-background-color);
|
|
12
|
+
color: var(--color-purple-800);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.straightCorners {
|
|
16
|
+
border-radius: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** @deprecated */
|
|
20
|
+
.positive {
|
|
21
|
+
--empty-state-border-color: var(--color-green-500);
|
|
22
|
+
--empty-state-background-color: var(--color-green-100);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.negative,
|
|
26
|
+
.action {
|
|
27
|
+
--empty-state-border-color: var(--color-red-500);
|
|
28
|
+
--empty-state-background-color: var(--color-red-100);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.neutral {
|
|
32
|
+
--empty-state-border-color: var(--color-purple-400);
|
|
33
|
+
--empty-state-background-color: var(--color-purple-100);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** end @deprecated */
|
|
37
|
+
.success {
|
|
38
|
+
--empty-state-border-color: var(--color-green-500);
|
|
39
|
+
--empty-state-background-color: var(--color-green-100);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.warning {
|
|
43
|
+
--empty-state-border-color: var(--color-red-500);
|
|
44
|
+
--empty-state-background-color: var(--color-red-100);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.informative {
|
|
48
|
+
--empty-state-border-color: var(--color-blue-400);
|
|
49
|
+
--empty-state-background-color: var(--color-blue-100);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.expert-advice {
|
|
53
|
+
--empty-state-border-color: var(--color-purple-400);
|
|
54
|
+
--empty-state-background-color: var(--color-purple-100);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.content {
|
|
58
|
+
justify-content: center;
|
|
59
|
+
display: grid;
|
|
60
|
+
grid-template-columns: minmax(auto, var(--empty-state-illustration-max-width)) minmax(
|
|
61
|
+
auto,
|
|
62
|
+
var(--empty-state-text-container-max-width)
|
|
63
|
+
);
|
|
64
|
+
grid-template-rows: minmax(auto, var(--empty-state-illustration-max-height)) auto;
|
|
65
|
+
padding: var(--spacing-24);
|
|
66
|
+
grid-column-gap: var(--spacing-32);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.illustrationContainer {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.illustration,
|
|
75
|
+
.illustrationContainer video {
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
max-height: var(--empty-state-illustration-max-height);
|
|
78
|
+
height: 100%;
|
|
79
|
+
width: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.textContainer {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: var(--spacing-24);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@container (width <=1024px) {
|
|
90
|
+
.content {
|
|
91
|
+
padding: var(--spacing-16);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@container (width <=560px) {
|
|
96
|
+
.content {
|
|
97
|
+
grid-template-columns: 1fr;
|
|
98
|
+
grid-template-rows: auto;
|
|
99
|
+
grid-column-gap: unset;
|
|
100
|
+
grid-row-gap: var(--spacing-24);
|
|
101
|
+
padding: var(--spacing-24);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.illustrationContainer {
|
|
105
|
+
--empty-state-illustration-max-height: 210px;
|
|
106
|
+
|
|
107
|
+
justify-content: center;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.heading {
|
|
111
|
+
font-size: 1.25rem;
|
|
112
|
+
line-height: 1.5rem;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "~components/Illustration"
|
|
11
11
|
import { Text } from "~components/Text"
|
|
12
12
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
13
|
-
import styles from "./EmptyState.module.
|
|
13
|
+
import styles from "./EmptyState.module.css"
|
|
14
14
|
|
|
15
15
|
const ILLUSTRATIONS: Record<
|
|
16
16
|
string,
|
|
@@ -50,6 +50,7 @@ export type EmptyStateProps = {
|
|
|
50
50
|
* @default informative
|
|
51
51
|
*/
|
|
52
52
|
variant?: "success" | "warning" | "informative" | "expert-advice"
|
|
53
|
+
/** @deprecated - This prop no longer has any effect */
|
|
53
54
|
layoutContext?: "sidebarAndContent" | "contentOnly"
|
|
54
55
|
bodyText: string | React.ReactNode
|
|
55
56
|
straightCorners?: boolean
|
|
@@ -66,7 +67,7 @@ export const EmptyState = ({
|
|
|
66
67
|
id,
|
|
67
68
|
illustrationType,
|
|
68
69
|
variant = "informative",
|
|
69
|
-
layoutContext
|
|
70
|
+
layoutContext: _,
|
|
70
71
|
headingProps,
|
|
71
72
|
bodyText,
|
|
72
73
|
straightCorners,
|
|
@@ -82,33 +83,30 @@ export const EmptyState = ({
|
|
|
82
83
|
className={classnames(
|
|
83
84
|
styles.container,
|
|
84
85
|
illustrationType ? styles[illustrationType] : styles[variant],
|
|
85
|
-
styles[layoutContext],
|
|
86
86
|
straightCorners && styles.straightCorners,
|
|
87
87
|
classNameOverride
|
|
88
88
|
)}
|
|
89
89
|
id={id}
|
|
90
90
|
{...props}
|
|
91
91
|
>
|
|
92
|
-
<div className={styles.
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<div className={styles.
|
|
92
|
+
<div className={styles.content}>
|
|
93
|
+
<div className={styles.illustrationContainer}>
|
|
94
|
+
{isAnimated ? (
|
|
95
|
+
<IllustrationComponent
|
|
96
|
+
isAnimated
|
|
97
|
+
loop={loop}
|
|
98
|
+
classNameOverride={styles.illustration}
|
|
99
|
+
/>
|
|
100
|
+
) : (
|
|
101
|
+
<IllustrationComponent classNameOverride={styles.illustration} />
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
<div className={styles.textContainer}>
|
|
105
105
|
{headingProps && (
|
|
106
106
|
<Heading classNameOverride={styles.heading} {...headingProps} />
|
|
107
107
|
)}
|
|
108
|
-
<Text variant="body"
|
|
109
|
-
|
|
110
|
-
</Text>
|
|
111
|
-
{children}
|
|
108
|
+
<Text variant="body">{bodyText}</Text>
|
|
109
|
+
{children && <span>{children}</span>}
|
|
112
110
|
</div>
|
|
113
111
|
</div>
|
|
114
112
|
</div>
|
|
@@ -6,7 +6,7 @@ import { Icon } from "~components/__future__/Icon"
|
|
|
6
6
|
import {
|
|
7
7
|
StickerSheet,
|
|
8
8
|
StickerSheetStory,
|
|
9
|
-
} from "~storybook/components/StickerSheet"
|
|
9
|
+
} from "~storybook/components/_future/StickerSheet"
|
|
10
10
|
import { EmptyState, EmptyStateProps } from "../index"
|
|
11
11
|
|
|
12
12
|
export default {
|
|
@@ -23,7 +23,9 @@ const EmptyStateWrapper = ({
|
|
|
23
23
|
isAnimated,
|
|
24
24
|
...args
|
|
25
25
|
}: EmptyStateProps): JSX.Element => (
|
|
26
|
-
<
|
|
26
|
+
<div>
|
|
27
|
+
<EmptyState isAnimated={IS_CHROMATIC ? false : isAnimated} {...args} />
|
|
28
|
+
</div>
|
|
27
29
|
)
|
|
28
30
|
|
|
29
31
|
const StickerSheetTemplate: StickerSheetStory = {
|
|
@@ -54,50 +56,64 @@ const StickerSheetTemplate: StickerSheetStory = {
|
|
|
54
56
|
|
|
55
57
|
return (
|
|
56
58
|
<>
|
|
57
|
-
<StickerSheet isReversed={isReversed}
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
<
|
|
61
|
-
<EmptyStateWrapper {...defaultProps} variant={variant} />
|
|
62
|
-
</StickerSheet.Row>
|
|
63
|
-
))}
|
|
64
|
-
</StickerSheet.Body>
|
|
65
|
-
<StickerSheet.Body>
|
|
66
|
-
<StickerSheet.Row rowTitle="straightCorners">
|
|
67
|
-
<EmptyStateWrapper {...defaultProps} straightCorners />
|
|
59
|
+
<StickerSheet isReversed={isReversed} title="EmptyState">
|
|
60
|
+
{variants.map(variant => (
|
|
61
|
+
<StickerSheet.Row key={variant} header={variant}>
|
|
62
|
+
<EmptyStateWrapper {...defaultProps} variant={variant} />
|
|
68
63
|
</StickerSheet.Row>
|
|
69
|
-
|
|
64
|
+
))}
|
|
65
|
+
<StickerSheet.Row header="straightCorners">
|
|
66
|
+
<EmptyStateWrapper {...defaultProps} straightCorners />
|
|
67
|
+
</StickerSheet.Row>
|
|
68
|
+
</StickerSheet>
|
|
69
|
+
|
|
70
|
+
<StickerSheet isReversed={isReversed} title="Responsive breakpoints">
|
|
71
|
+
<StickerSheet.Row header="Above 1024px">
|
|
72
|
+
<StickerSheet.Cell style={{ width: 1025 }}>
|
|
73
|
+
<EmptyStateWrapper {...defaultProps} />
|
|
74
|
+
</StickerSheet.Cell>
|
|
75
|
+
</StickerSheet.Row>
|
|
76
|
+
<StickerSheet.Row header="Above 560px and below or equal to 1024px (max)">
|
|
77
|
+
<StickerSheet.Cell style={{ width: 1024 }}>
|
|
78
|
+
<EmptyStateWrapper {...defaultProps} />
|
|
79
|
+
</StickerSheet.Cell>
|
|
80
|
+
</StickerSheet.Row>
|
|
81
|
+
<StickerSheet.Row header="Above 560px and below or equal to 1024px (min)">
|
|
82
|
+
<StickerSheet.Cell style={{ width: 561 }}>
|
|
83
|
+
<EmptyStateWrapper {...defaultProps} />
|
|
84
|
+
</StickerSheet.Cell>
|
|
85
|
+
</StickerSheet.Row>
|
|
86
|
+
<StickerSheet.Row header="Below or equal to 560px">
|
|
87
|
+
<StickerSheet.Cell style={{ width: 560 }}>
|
|
88
|
+
<EmptyStateWrapper {...defaultProps} />
|
|
89
|
+
</StickerSheet.Cell>
|
|
90
|
+
</StickerSheet.Row>
|
|
70
91
|
</StickerSheet>
|
|
71
92
|
|
|
72
93
|
<StickerSheet
|
|
73
94
|
isReversed={isReversed}
|
|
74
|
-
|
|
95
|
+
title="Illustration type (deprecated)"
|
|
75
96
|
>
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
{illustrationTypes.map(illustrationType => (
|
|
98
|
+
<StickerSheet.Row key={illustrationType} header={illustrationType}>
|
|
99
|
+
<EmptyStateWrapper
|
|
100
|
+
{...defaultProps}
|
|
101
|
+
illustrationType={illustrationType}
|
|
81
102
|
>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/>
|
|
97
|
-
</EmptyStateWrapper>
|
|
98
|
-
</StickerSheet.Row>
|
|
99
|
-
))}
|
|
100
|
-
</StickerSheet.Body>
|
|
103
|
+
<Button
|
|
104
|
+
label="Label"
|
|
105
|
+
icon={
|
|
106
|
+
<Icon
|
|
107
|
+
name="chevron_right"
|
|
108
|
+
isPresentational
|
|
109
|
+
shouldMirrorInRTL
|
|
110
|
+
/>
|
|
111
|
+
}
|
|
112
|
+
iconPosition="end"
|
|
113
|
+
/>
|
|
114
|
+
</EmptyStateWrapper>
|
|
115
|
+
</StickerSheet.Row>
|
|
116
|
+
))}
|
|
101
117
|
</StickerSheet>
|
|
102
118
|
</>
|
|
103
119
|
)
|