@kaizen/components 1.79.6 → 1.79.8
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/alpha.cjs +4 -0
- package/dist/cjs/src/Button/Button/Button.cjs +5 -0
- package/dist/cjs/src/Button/IconButton/IconButton.cjs +5 -0
- package/dist/cjs/src/LikertScaleLegacy/LikertScaleLegacy.cjs +3 -0
- package/dist/cjs/src/Modal/GenericModal/GenericModal.cjs +11 -1
- package/dist/cjs/src/Skirt/Skirt.cjs +3 -0
- package/dist/cjs/src/Skirt/subcomponents/SkirtCard/SkirtCard.cjs +4 -0
- package/dist/cjs/src/SplitButton/SplitButton.cjs +2 -0
- package/dist/cjs/src/TitleBlockZen/TitleBlockZen.cjs +3 -0
- package/dist/cjs/src/__alpha__/SingleSelect/SingleSelect.cjs +32 -0
- package/dist/cjs/src/__alpha__/SingleSelect/SingleSelect.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/List/List.cjs +24 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/List/List.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.cjs +24 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.cjs +25 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.cjs +21 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css.cjs +6 -0
- package/dist/esm/alpha.mjs +1 -0
- package/dist/esm/src/Button/Button/Button.mjs +5 -0
- package/dist/esm/src/Button/IconButton/IconButton.mjs +5 -0
- package/dist/esm/src/LikertScaleLegacy/LikertScaleLegacy.mjs +3 -0
- package/dist/esm/src/Modal/GenericModal/GenericModal.mjs +11 -1
- package/dist/esm/src/Skirt/Skirt.mjs +3 -0
- package/dist/esm/src/Skirt/subcomponents/SkirtCard/SkirtCard.mjs +4 -0
- package/dist/esm/src/SplitButton/SplitButton.mjs +2 -0
- package/dist/esm/src/TitleBlockZen/TitleBlockZen.mjs +3 -0
- package/dist/esm/src/__alpha__/SingleSelect/SingleSelect.mjs +27 -0
- package/dist/esm/src/__alpha__/SingleSelect/SingleSelect.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/List/List.mjs +18 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/List/List.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.mjs +18 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.mjs +19 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.mjs +13 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css.mjs +4 -0
- package/dist/styles.css +57 -0
- package/dist/types/Button/Button/Button.d.ts +5 -0
- package/dist/types/Button/IconButton/IconButton.d.ts +5 -0
- package/dist/types/LikertScaleLegacy/LikertScaleLegacy.d.ts +3 -0
- package/dist/types/Skirt/Skirt.d.ts +3 -0
- package/dist/types/Skirt/subcomponents/SkirtCard/SkirtCard.d.ts +3 -0
- package/dist/types/SplitButton/SplitButton.d.ts +2 -0
- package/dist/types/TitleBlockZen/TitleBlockZen.d.ts +3 -0
- package/dist/types/__alpha__/SingleSelect/SingleSelect.d.ts +23 -0
- package/dist/types/__alpha__/SingleSelect/_docs/mockData.d.ts +59 -0
- package/dist/types/__alpha__/SingleSelect/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/List/List.d.ts +6 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/List/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.d.ts +6 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListItem/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.d.ts +8 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListSection/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/Trigger/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/index.d.ts +4 -0
- package/dist/types/__alpha__/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/Button/Button/Button.tsx +5 -0
- package/src/Button/IconButton/IconButton.tsx +5 -0
- package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +3 -0
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.mdx +3 -2
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stickersheet.stories.tsx +1 -1
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stories.tsx +1 -1
- package/src/Modal/GenericModal/GenericModal.tsx +18 -1
- package/src/Skirt/Skirt.tsx +4 -0
- package/src/Skirt/_docs/Skirt.mdx +3 -1
- package/src/Skirt/_docs/Skirt.stories.tsx +1 -1
- package/src/Skirt/subcomponents/SkirtCard/SkirtCard.tsx +4 -0
- package/src/SplitButton/SplitButton.tsx +2 -0
- package/src/SplitButton/_docs/SplitButton.mdx +3 -1
- package/src/SplitButton/_docs/SplitButton.stickersheet.stories.tsx +1 -1
- package/src/SplitButton/_docs/SplitButton.stories.tsx +1 -1
- package/src/TitleBlockZen/TitleBlockZen.tsx +3 -0
- package/src/TitleBlockZen/_docs/TitleBlockZen.mdx +3 -2
- package/src/__alpha__/SingleSelect/SingleSelect.module.css +9 -0
- package/src/__alpha__/SingleSelect/SingleSelect.spec.tsx +26 -0
- package/src/__alpha__/SingleSelect/SingleSelect.tsx +27 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.mdx +27 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.stickersheet.stories.tsx +83 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.stories.tsx +23 -0
- package/src/__alpha__/SingleSelect/_docs/mockData.ts +92 -0
- package/src/__alpha__/SingleSelect/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/List.module.css +7 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/List.tsx +17 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css +9 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.tsx +17 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css +9 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.tsx +23 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css +18 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.tsx +13 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/index.ts +4 -0
- package/src/__alpha__/index.ts +1 -0
|
@@ -11,6 +11,11 @@ function _interopDefault(e) {
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* @deprecated This component will be replaced by the next Button component in v2.
|
|
15
|
+
* Use `@kaizen/components/next` Button instead.
|
|
16
|
+
* Migration guide: {@link https://cultureamp.design/?path=/docs/components-button-migration-guide--docs}
|
|
17
|
+
* Codemod available: `upgradeV1Buttons`
|
|
18
|
+
*
|
|
14
19
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button Guidance} |
|
|
15
20
|
* {@link https://cultureamp.design/?path=/docs/components-buttons-button--docs Storybook}
|
|
16
21
|
*/
|
|
@@ -11,6 +11,11 @@ function _interopDefault(e) {
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* @deprecated This component will be replaced by the next Button component in v2.
|
|
15
|
+
* Use `@kaizen/components/next` Button instead.
|
|
16
|
+
* Migration guide: {@link https://cultureamp.design/?path=/docs/components-button-migration-guide--docs}
|
|
17
|
+
* Codemod available: `upgradeV1Buttons`
|
|
18
|
+
*
|
|
14
19
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button Guidance} |
|
|
15
20
|
* {@link https://cultureamp.design/?path=/docs/components-iconbutton--docs Storybook}
|
|
16
21
|
*/
|
|
@@ -22,6 +22,9 @@ var SelectedItemIcon = function () {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
+
* @deprecated This component will be renamed to LikertScale in v2.
|
|
26
|
+
* Start importing as LikertScale instead.
|
|
27
|
+
*
|
|
25
28
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082060201/Likert+Scale Guidance} |
|
|
26
29
|
* {@link https://cultureamp.design/?path=/docs/components-likertscalelegacy--docs Storybook}
|
|
27
30
|
*/
|
|
@@ -5,6 +5,7 @@ var ReactDOM = require('react-dom');
|
|
|
5
5
|
var react = require('@headlessui/react');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
var FocusLock = require('react-focus-lock');
|
|
8
|
+
var useIsClientReady = require('../../utils/useIsClientReady/useIsClientReady.cjs');
|
|
8
9
|
var console = require('../util/console.cjs');
|
|
9
10
|
var ModalContext = require('./context/ModalContext.cjs');
|
|
10
11
|
var GenericModal_module = require('./GenericModal.module.scss.cjs');
|
|
@@ -31,6 +32,7 @@ var GenericModal = function (_a) {
|
|
|
31
32
|
var id = propsId !== null && propsId !== void 0 ? propsId : reactId;
|
|
32
33
|
var labelledByID = React.useId();
|
|
33
34
|
var describedByID = React.useId();
|
|
35
|
+
var isClientReady = useIsClientReady.useIsClientReady();
|
|
34
36
|
var _c = React.useState(null),
|
|
35
37
|
scrollLayer = _c[0],
|
|
36
38
|
setScrollLayer = _c[1];
|
|
@@ -52,6 +54,7 @@ var GenericModal = function (_a) {
|
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
var focusOnAccessibleLabel = function () {
|
|
57
|
+
if (!isClientReady) return;
|
|
55
58
|
// Check if focus already exists within the modal
|
|
56
59
|
if (modalLayer === null || modalLayer === void 0 ? void 0 : modalLayer.contains(document.activeElement)) {
|
|
57
60
|
return;
|
|
@@ -60,6 +63,7 @@ var GenericModal = function (_a) {
|
|
|
60
63
|
labelElement === null || labelElement === void 0 ? void 0 : labelElement.focus();
|
|
61
64
|
};
|
|
62
65
|
var a11yWarn = function () {
|
|
66
|
+
if (!isClientReady) return;
|
|
63
67
|
// Ensure that consumers have provided an element that labels the modal
|
|
64
68
|
// to meet ARIA accessibility guidelines.
|
|
65
69
|
if (!document.getElementById(labelledByID)) {
|
|
@@ -68,6 +72,7 @@ var GenericModal = function (_a) {
|
|
|
68
72
|
};
|
|
69
73
|
var preventBodyScroll = function () {
|
|
70
74
|
var _a;
|
|
75
|
+
if (!isClientReady) return;
|
|
71
76
|
var hasScrollbar = window.innerWidth > document.documentElement.clientWidth;
|
|
72
77
|
var scrollStyles = [GenericModal_module.unscrollable];
|
|
73
78
|
if (hasScrollbar) {
|
|
@@ -90,11 +95,12 @@ var GenericModal = function (_a) {
|
|
|
90
95
|
}, [onEscapeKeyup]);
|
|
91
96
|
var onBeforeEnterHandler = function () {
|
|
92
97
|
preventBodyScroll();
|
|
93
|
-
if (onEscapeKeyup) {
|
|
98
|
+
if (onEscapeKeyup && isClientReady) {
|
|
94
99
|
document.addEventListener('keyup', escapeKeyHandler);
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
102
|
var cleanUpAfterClose = function () {
|
|
103
|
+
if (!isClientReady) return;
|
|
98
104
|
document.documentElement.classList.remove(GenericModal_module.unscrollable, GenericModal_module.pseudoScrollbar);
|
|
99
105
|
if (onEscapeKeyup) {
|
|
100
106
|
document.removeEventListener('keyup', escapeKeyHandler);
|
|
@@ -112,6 +118,10 @@ var GenericModal = function (_a) {
|
|
|
112
118
|
cleanUpAfterClose();
|
|
113
119
|
propsOnAfterLeave === null || propsOnAfterLeave === void 0 ? void 0 : propsOnAfterLeave();
|
|
114
120
|
};
|
|
121
|
+
// Don't render portal during SSR
|
|
122
|
+
if (!isClientReady) {
|
|
123
|
+
return React__default.default.createElement(React__default.default.Fragment, null);
|
|
124
|
+
}
|
|
115
125
|
return ReactDOM.createPortal(React__default.default.createElement(react.Transition, {
|
|
116
126
|
appear: true,
|
|
117
127
|
show: isOpen,
|
|
@@ -17,6 +17,9 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
|
17
17
|
var spacing = 24;
|
|
18
18
|
var maxHeight = 222;
|
|
19
19
|
var fallbackPercentage = 0.8;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated This component will be removed in v2. Please remove any usages.
|
|
22
|
+
*/
|
|
20
23
|
var Skirt = function (_a) {
|
|
21
24
|
var children = _a.children,
|
|
22
25
|
_b = _a.variant,
|
|
@@ -12,6 +12,10 @@ function _interopDefault(e) {
|
|
|
12
12
|
}
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
14
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated This component will be removed in v2. Use a regular Card component instead.
|
|
18
|
+
*/
|
|
15
19
|
var SkirtCard = function (props) {
|
|
16
20
|
var classNameOverride = props.classNameOverride,
|
|
17
21
|
restProps = tslib.__rest(props, ["classNameOverride"]);
|
|
@@ -16,6 +16,8 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
16
16
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
+
* @deprecated This component will be removed in v2. Use a Button and Menu component instead.
|
|
20
|
+
*
|
|
19
21
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896196/Split+Button Guidance} |
|
|
20
22
|
* {@link https://cultureamp.design/storybook/?path=/docs/components-splitbutton--docs Storybook}
|
|
21
23
|
*/
|
|
@@ -168,6 +168,9 @@ var renderNavigationTabs = function (navigationTabs, collapse, ariaLabel) {
|
|
|
168
168
|
}))));
|
|
169
169
|
};
|
|
170
170
|
/**
|
|
171
|
+
* @deprecated This component will be renamed to TitleBlock in v2.
|
|
172
|
+
* Start importing as TitleBlock instead.
|
|
173
|
+
*
|
|
171
174
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075605782/Title+Block Guidance} |
|
|
172
175
|
* {@link https://cultureamp.design/?path=/story/components-titleblock--docs Storybook}
|
|
173
176
|
*/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
var List = require('./subcomponents/List/List.cjs');
|
|
7
|
+
var ListSection = require('./subcomponents/ListSection/ListSection.cjs');
|
|
8
|
+
var ListItem = require('./subcomponents/ListItem/ListItem.cjs');
|
|
9
|
+
var Trigger = require('./subcomponents/Trigger/Trigger.cjs');
|
|
10
|
+
var SingleSelect_module = require('./SingleSelect.module.css.cjs');
|
|
11
|
+
function _interopDefault(e) {
|
|
12
|
+
return e && e.__esModule ? e : {
|
|
13
|
+
default: e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
17
|
+
var SingleSelect = function (_a) {
|
|
18
|
+
var classNameOverride = _a.classNameOverride,
|
|
19
|
+
children = _a.children,
|
|
20
|
+
restProps = tslib.__rest(_a, ["classNameOverride", "children"]);
|
|
21
|
+
return React__default.default.createElement(reactAriaComponents.Select, tslib.__assign({
|
|
22
|
+
className: classNameOverride,
|
|
23
|
+
placeholder: ""
|
|
24
|
+
}, restProps), React__default.default.createElement(Trigger.Trigger, null), React__default.default.createElement(reactAriaComponents.Popover, {
|
|
25
|
+
className: SingleSelect_module.popover
|
|
26
|
+
}, children));
|
|
27
|
+
};
|
|
28
|
+
SingleSelect.displayName = 'SingleSelect';
|
|
29
|
+
SingleSelect.List = List.List;
|
|
30
|
+
SingleSelect.ListItem = ListItem.ListItem;
|
|
31
|
+
SingleSelect.ListSection = ListSection.ListSection;
|
|
32
|
+
exports.SingleSelect = SingleSelect;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var reactAriaComponents = require('react-aria-components');
|
|
7
|
+
var List_module = require('./List.module.css.cjs');
|
|
8
|
+
function _interopDefault(e) {
|
|
9
|
+
return e && e.__esModule ? e : {
|
|
10
|
+
default: e
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
|
+
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
15
|
+
var List = function (_a) {
|
|
16
|
+
var children = _a.children,
|
|
17
|
+
className = _a.className,
|
|
18
|
+
props = tslib.__rest(_a, ["children", "className"]);
|
|
19
|
+
return React__default.default.createElement(reactAriaComponents.ListBox, tslib.__assign({
|
|
20
|
+
className: classnames__default.default(List_module.list, className)
|
|
21
|
+
}, props), children);
|
|
22
|
+
};
|
|
23
|
+
List.displayName = 'SingleSelect.List';
|
|
24
|
+
exports.List = List;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var reactAriaComponents = require('react-aria-components');
|
|
7
|
+
var ListItem_module = require('./ListItem.module.css.cjs');
|
|
8
|
+
function _interopDefault(e) {
|
|
9
|
+
return e && e.__esModule ? e : {
|
|
10
|
+
default: e
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
|
+
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
15
|
+
var ListItem = function (_a) {
|
|
16
|
+
var children = _a.children,
|
|
17
|
+
className = _a.className,
|
|
18
|
+
props = tslib.__rest(_a, ["children", "className"]);
|
|
19
|
+
return React__default.default.createElement(reactAriaComponents.ListBoxItem, tslib.__assign({
|
|
20
|
+
className: classnames__default.default(ListItem_module.listItem, className)
|
|
21
|
+
}, props), children);
|
|
22
|
+
};
|
|
23
|
+
ListItem.displayName = 'SingleSelect.ListItem';
|
|
24
|
+
exports.ListItem = ListItem;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var reactAriaComponents = require('react-aria-components');
|
|
7
|
+
var ListSection_module = require('./ListSection.module.css.cjs');
|
|
8
|
+
function _interopDefault(e) {
|
|
9
|
+
return e && e.__esModule ? e : {
|
|
10
|
+
default: e
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
|
+
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
15
|
+
var ListSection = function (_a) {
|
|
16
|
+
var name = _a.name,
|
|
17
|
+
className = _a.className,
|
|
18
|
+
children = _a.children,
|
|
19
|
+
props = tslib.__rest(_a, ["name", "className", "children"]);
|
|
20
|
+
return React__default.default.createElement(reactAriaComponents.ListBoxSection, tslib.__assign({}, props), React__default.default.createElement(reactAriaComponents.Header, {
|
|
21
|
+
className: classnames__default.default(ListSection_module.listSectionHeader, className)
|
|
22
|
+
}, name), children);
|
|
23
|
+
};
|
|
24
|
+
ListSection.displayName = 'SingleSelect.ListSection';
|
|
25
|
+
exports.ListSection = ListSection;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactAriaComponents = require('react-aria-components');
|
|
5
|
+
var Icon = require('../../../../__next__/Icon/Icon.cjs');
|
|
6
|
+
var Trigger_module = require('./Trigger.module.css.cjs');
|
|
7
|
+
function _interopDefault(e) {
|
|
8
|
+
return e && e.__esModule ? e : {
|
|
9
|
+
default: e
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
|
+
var Trigger = function () {
|
|
14
|
+
return React__default.default.createElement(reactAriaComponents.Button, {
|
|
15
|
+
className: Trigger_module.button
|
|
16
|
+
}, React__default.default.createElement(reactAriaComponents.SelectValue, null), React__default.default.createElement(Icon.Icon, {
|
|
17
|
+
name: "keyboard_arrow_down",
|
|
18
|
+
isPresentational: true
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
exports.Trigger = Trigger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SingleSelect } from './src/__alpha__/SingleSelect/SingleSelect.mjs';
|
|
@@ -3,6 +3,11 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import { GenericButton } from '../GenericButton/GenericButton.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated This component will be replaced by the next Button component in v2.
|
|
7
|
+
* Use `@kaizen/components/next` Button instead.
|
|
8
|
+
* Migration guide: {@link https://cultureamp.design/?path=/docs/components-button-migration-guide--docs}
|
|
9
|
+
* Codemod available: `upgradeV1Buttons`
|
|
10
|
+
*
|
|
6
11
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button Guidance} |
|
|
7
12
|
* {@link https://cultureamp.design/?path=/docs/components-buttons-button--docs Storybook}
|
|
8
13
|
*/
|
|
@@ -3,6 +3,11 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import { GenericButton } from '../GenericButton/GenericButton.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated This component will be replaced by the next Button component in v2.
|
|
7
|
+
* Use `@kaizen/components/next` Button instead.
|
|
8
|
+
* Migration guide: {@link https://cultureamp.design/?path=/docs/components-button-migration-guide--docs}
|
|
9
|
+
* Codemod available: `upgradeV1Buttons`
|
|
10
|
+
*
|
|
6
11
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button Guidance} |
|
|
7
12
|
* {@link https://cultureamp.design/?path=/docs/components-iconbutton--docs Storybook}
|
|
8
13
|
*/
|
|
@@ -13,6 +13,9 @@ var SelectedItemIcon = function () {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
+
* @deprecated This component will be renamed to LikertScale in v2.
|
|
17
|
+
* Start importing as LikertScale instead.
|
|
18
|
+
*
|
|
16
19
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082060201/Likert+Scale Guidance} |
|
|
17
20
|
* {@link https://cultureamp.design/?path=/docs/components-likertscalelegacy--docs Storybook}
|
|
18
21
|
*/
|
|
@@ -3,6 +3,7 @@ import { createPortal } from 'react-dom';
|
|
|
3
3
|
import { Transition } from '@headlessui/react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import FocusLock from 'react-focus-lock';
|
|
6
|
+
import { useIsClientReady } from '../../utils/useIsClientReady/useIsClientReady.mjs';
|
|
6
7
|
import { warn } from '../util/console.mjs';
|
|
7
8
|
import { ModalContext } from './context/ModalContext.mjs';
|
|
8
9
|
import styles from './GenericModal.module.scss.mjs';
|
|
@@ -22,6 +23,7 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
22
23
|
var id = propsId !== null && propsId !== void 0 ? propsId : reactId;
|
|
23
24
|
var labelledByID = useId();
|
|
24
25
|
var describedByID = useId();
|
|
26
|
+
var isClientReady = useIsClientReady();
|
|
25
27
|
var _c = useState(null),
|
|
26
28
|
scrollLayer = _c[0],
|
|
27
29
|
setScrollLayer = _c[1];
|
|
@@ -43,6 +45,7 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
43
45
|
}
|
|
44
46
|
};
|
|
45
47
|
var focusOnAccessibleLabel = function () {
|
|
48
|
+
if (!isClientReady) return;
|
|
46
49
|
// Check if focus already exists within the modal
|
|
47
50
|
if (modalLayer === null || modalLayer === void 0 ? void 0 : modalLayer.contains(document.activeElement)) {
|
|
48
51
|
return;
|
|
@@ -51,6 +54,7 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
51
54
|
labelElement === null || labelElement === void 0 ? void 0 : labelElement.focus();
|
|
52
55
|
};
|
|
53
56
|
var a11yWarn = function () {
|
|
57
|
+
if (!isClientReady) return;
|
|
54
58
|
// Ensure that consumers have provided an element that labels the modal
|
|
55
59
|
// to meet ARIA accessibility guidelines.
|
|
56
60
|
if (!document.getElementById(labelledByID)) {
|
|
@@ -59,6 +63,7 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
59
63
|
};
|
|
60
64
|
var preventBodyScroll = function () {
|
|
61
65
|
var _a;
|
|
66
|
+
if (!isClientReady) return;
|
|
62
67
|
var hasScrollbar = window.innerWidth > document.documentElement.clientWidth;
|
|
63
68
|
var scrollStyles = [styles.unscrollable];
|
|
64
69
|
if (hasScrollbar) {
|
|
@@ -81,11 +86,12 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
81
86
|
}, [onEscapeKeyup]);
|
|
82
87
|
var onBeforeEnterHandler = function () {
|
|
83
88
|
preventBodyScroll();
|
|
84
|
-
if (onEscapeKeyup) {
|
|
89
|
+
if (onEscapeKeyup && isClientReady) {
|
|
85
90
|
document.addEventListener('keyup', escapeKeyHandler);
|
|
86
91
|
}
|
|
87
92
|
};
|
|
88
93
|
var cleanUpAfterClose = function () {
|
|
94
|
+
if (!isClientReady) return;
|
|
89
95
|
document.documentElement.classList.remove(styles.unscrollable, styles.pseudoScrollbar);
|
|
90
96
|
if (onEscapeKeyup) {
|
|
91
97
|
document.removeEventListener('keyup', escapeKeyHandler);
|
|
@@ -103,6 +109,10 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
103
109
|
cleanUpAfterClose();
|
|
104
110
|
propsOnAfterLeave === null || propsOnAfterLeave === void 0 ? void 0 : propsOnAfterLeave();
|
|
105
111
|
};
|
|
112
|
+
// Don't render portal during SSR
|
|
113
|
+
if (!isClientReady) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
115
|
+
}
|
|
106
116
|
return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(Transition, {
|
|
107
117
|
appear: true,
|
|
108
118
|
show: isOpen,
|
|
@@ -8,6 +8,9 @@ import styles from './Skirt.module.scss.mjs';
|
|
|
8
8
|
var spacing = 24;
|
|
9
9
|
var maxHeight = 222;
|
|
10
10
|
var fallbackPercentage = 0.8;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated This component will be removed in v2. Please remove any usages.
|
|
13
|
+
*/
|
|
11
14
|
const Skirt = /*#__PURE__*/function () {
|
|
12
15
|
const Skirt = function (_a) {
|
|
13
16
|
var children = _a.children,
|
|
@@ -3,6 +3,10 @@ import React from 'react';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { Card } from '../../../Card/Card.mjs';
|
|
5
5
|
import styles from './SkirtCard.module.scss.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated This component will be removed in v2. Use a regular Card component instead.
|
|
9
|
+
*/
|
|
6
10
|
const SkirtCard = /*#__PURE__*/function () {
|
|
7
11
|
const SkirtCard = function (props) {
|
|
8
12
|
var classNameOverride = props.classNameOverride,
|
|
@@ -7,6 +7,8 @@ import { DropdownButton } from './subcomponents/DropdownButton/DropdownButton.mj
|
|
|
7
7
|
import styles from './SplitButton.module.scss.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated This component will be removed in v2. Use a Button and Menu component instead.
|
|
11
|
+
*
|
|
10
12
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896196/Split+Button Guidance} |
|
|
11
13
|
* {@link https://cultureamp.design/storybook/?path=/docs/components-splitbutton--docs Storybook}
|
|
12
14
|
*/
|
|
@@ -159,6 +159,9 @@ var renderNavigationTabs = function (navigationTabs, collapse, ariaLabel) {
|
|
|
159
159
|
})))));
|
|
160
160
|
};
|
|
161
161
|
/**
|
|
162
|
+
* @deprecated This component will be renamed to TitleBlock in v2.
|
|
163
|
+
* Start importing as TitleBlock instead.
|
|
164
|
+
*
|
|
162
165
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075605782/Title+Block Guidance} |
|
|
163
166
|
* {@link https://cultureamp.design/?path=/story/components-titleblock--docs Storybook}
|
|
164
167
|
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Select, Popover } from 'react-aria-components';
|
|
4
|
+
import { List } from './subcomponents/List/List.mjs';
|
|
5
|
+
import { ListSection } from './subcomponents/ListSection/ListSection.mjs';
|
|
6
|
+
import { ListItem } from './subcomponents/ListItem/ListItem.mjs';
|
|
7
|
+
import { Trigger } from './subcomponents/Trigger/Trigger.mjs';
|
|
8
|
+
import styles from './SingleSelect.module.css.mjs';
|
|
9
|
+
const SingleSelect = /*#__PURE__*/function () {
|
|
10
|
+
const SingleSelect = function (_a) {
|
|
11
|
+
var classNameOverride = _a.classNameOverride,
|
|
12
|
+
children = _a.children,
|
|
13
|
+
restProps = __rest(_a, ["classNameOverride", "children"]);
|
|
14
|
+
return /*#__PURE__*/React.createElement(Select, __assign({
|
|
15
|
+
className: classNameOverride,
|
|
16
|
+
placeholder: ""
|
|
17
|
+
}, restProps), /*#__PURE__*/React.createElement(Trigger, null), /*#__PURE__*/React.createElement(Popover, {
|
|
18
|
+
className: styles.popover
|
|
19
|
+
}, children));
|
|
20
|
+
};
|
|
21
|
+
SingleSelect.displayName = 'SingleSelect';
|
|
22
|
+
SingleSelect.List = List;
|
|
23
|
+
SingleSelect.ListItem = ListItem;
|
|
24
|
+
SingleSelect.ListSection = ListSection;
|
|
25
|
+
return SingleSelect;
|
|
26
|
+
}();
|
|
27
|
+
export { SingleSelect };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { ListBox } from 'react-aria-components';
|
|
5
|
+
import styles from './List.module.css.mjs';
|
|
6
|
+
const List = /*#__PURE__*/function () {
|
|
7
|
+
const List = function (_a) {
|
|
8
|
+
var children = _a.children,
|
|
9
|
+
className = _a.className,
|
|
10
|
+
props = __rest(_a, ["children", "className"]);
|
|
11
|
+
return /*#__PURE__*/React.createElement(ListBox, __assign({
|
|
12
|
+
className: classnames(styles.list, className)
|
|
13
|
+
}, props), children);
|
|
14
|
+
};
|
|
15
|
+
List.displayName = 'SingleSelect.List';
|
|
16
|
+
return List;
|
|
17
|
+
}();
|
|
18
|
+
export { List };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { ListBoxItem } from 'react-aria-components';
|
|
5
|
+
import styles from './ListItem.module.css.mjs';
|
|
6
|
+
const ListItem = /*#__PURE__*/function () {
|
|
7
|
+
const ListItem = function (_a) {
|
|
8
|
+
var children = _a.children,
|
|
9
|
+
className = _a.className,
|
|
10
|
+
props = __rest(_a, ["children", "className"]);
|
|
11
|
+
return /*#__PURE__*/React.createElement(ListBoxItem, __assign({
|
|
12
|
+
className: classnames(styles.listItem, className)
|
|
13
|
+
}, props), children);
|
|
14
|
+
};
|
|
15
|
+
ListItem.displayName = 'SingleSelect.ListItem';
|
|
16
|
+
return ListItem;
|
|
17
|
+
}();
|
|
18
|
+
export { ListItem };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { ListBoxSection, Header } from 'react-aria-components';
|
|
5
|
+
import styles from './ListSection.module.css.mjs';
|
|
6
|
+
const ListSection = /*#__PURE__*/function () {
|
|
7
|
+
const ListSection = function (_a) {
|
|
8
|
+
var name = _a.name,
|
|
9
|
+
className = _a.className,
|
|
10
|
+
children = _a.children,
|
|
11
|
+
props = __rest(_a, ["name", "className", "children"]);
|
|
12
|
+
return /*#__PURE__*/React.createElement(ListBoxSection, __assign({}, props), /*#__PURE__*/React.createElement(Header, {
|
|
13
|
+
className: classnames(styles.listSectionHeader, className)
|
|
14
|
+
}, name), children);
|
|
15
|
+
};
|
|
16
|
+
ListSection.displayName = 'SingleSelect.ListSection';
|
|
17
|
+
return ListSection;
|
|
18
|
+
}();
|
|
19
|
+
export { ListSection };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, SelectValue } from 'react-aria-components';
|
|
3
|
+
import { Icon } from '../../../../__next__/Icon/Icon.mjs';
|
|
4
|
+
import styles from './Trigger.module.css.mjs';
|
|
5
|
+
var Trigger = function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
7
|
+
className: styles.button
|
|
8
|
+
}, /*#__PURE__*/React.createElement(SelectValue, null), /*#__PURE__*/React.createElement(Icon, {
|
|
9
|
+
name: "keyboard_arrow_down",
|
|
10
|
+
isPresentational: true
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
export { Trigger };
|