@kaizen/components 2.4.0 → 3.0.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/src/Button/Button.cjs +2 -4
- package/dist/cjs/src/GuidanceBlock/GuidanceBlock.cjs +16 -82
- package/dist/cjs/src/GuidanceBlock/GuidanceBlock.module.css.cjs +0 -1
- package/dist/cjs/src/Heading/Heading.cjs +1 -1
- package/dist/cjs/src/Heading/Heading.module.css.cjs +22 -0
- package/dist/cjs/src/Label/Label.cjs +1 -1
- package/dist/cjs/src/Label/Label.module.css.cjs +16 -0
- package/dist/cjs/src/LabelledMessage/LabelledMessage.cjs +1 -1
- package/dist/cjs/src/LabelledMessage/LabelledMessage.module.css.cjs +7 -0
- package/dist/cjs/src/LinkButton/LinkButton.cjs +2 -4
- package/dist/cjs/src/Modal/ConfirmationModal/ConfirmationModal.cjs +3 -2
- package/dist/cjs/src/Modal/ContextModal/ContextModal.cjs +0 -1
- package/dist/cjs/src/Modal/GenericModal/GenericModal.cjs +2 -2
- package/dist/cjs/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.cjs +3 -6
- package/dist/cjs/src/Notification/InlineNotification/InlineNotification.cjs +1 -1
- package/dist/cjs/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs +1 -1
- package/dist/cjs/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss.cjs → ToastNotificationsList.module.css.cjs} +1 -1
- package/dist/cjs/src/Notification/subcomponents/CancelButton/CancelButton.cjs +1 -1
- package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.cjs +1 -1
- package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css.cjs +29 -0
- package/dist/cjs/src/Notification/subcomponents/NotificationHeading/NotificationHeading.cjs +1 -1
- package/dist/cjs/src/Select/Select.cjs +23 -22
- package/dist/cjs/src/Select/Select.module.scss.cjs +0 -1
- package/dist/cjs/src/SingleSelect/SingleSelect.cjs +12 -19
- package/dist/cjs/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.cjs +3 -5
- package/dist/cjs/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.module.scss.cjs +0 -1
- package/dist/cjs/src/Text/Text.cjs +1 -1
- package/dist/cjs/src/Text/Text.module.css.cjs +16 -0
- package/dist/cjs/src/TimeField/TimeField.cjs +2 -3
- package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +1 -1
- package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css.cjs +13 -0
- package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.cjs +1 -1
- package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.css.cjs +9 -0
- package/dist/cjs/src/Tooltip/OverlayArrow.cjs +1 -1
- package/dist/cjs/src/Tooltip/OverlayArrow.module.css.cjs +7 -0
- package/dist/cjs/src/Tooltip/Tooltip.cjs +1 -1
- package/dist/cjs/src/Tooltip/Tooltip.module.css.cjs +7 -0
- package/dist/esm/src/Button/Button.mjs +2 -4
- package/dist/esm/src/GuidanceBlock/GuidanceBlock.mjs +18 -84
- package/dist/esm/src/GuidanceBlock/GuidanceBlock.module.css.mjs +0 -1
- package/dist/esm/src/Heading/Heading.mjs +1 -1
- package/dist/esm/src/Heading/Heading.module.css.mjs +20 -0
- package/dist/esm/src/Label/Label.mjs +1 -1
- package/dist/esm/src/Label/Label.module.css.mjs +14 -0
- package/dist/esm/src/LabelledMessage/LabelledMessage.mjs +1 -1
- package/dist/esm/src/LabelledMessage/LabelledMessage.module.css.mjs +5 -0
- package/dist/esm/src/LinkButton/LinkButton.mjs +2 -4
- package/dist/esm/src/Modal/ConfirmationModal/ConfirmationModal.mjs +3 -2
- package/dist/esm/src/Modal/ContextModal/ContextModal.mjs +0 -1
- package/dist/esm/src/Modal/GenericModal/GenericModal.mjs +2 -2
- package/dist/esm/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.mjs +3 -6
- package/dist/esm/src/Notification/InlineNotification/InlineNotification.mjs +1 -1
- package/dist/esm/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.mjs +1 -1
- package/dist/esm/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss.mjs → ToastNotificationsList.module.css.mjs} +1 -1
- package/dist/esm/src/Notification/subcomponents/CancelButton/CancelButton.mjs +1 -1
- package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.mjs +1 -1
- package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css.mjs +27 -0
- package/dist/esm/src/Notification/subcomponents/NotificationHeading/NotificationHeading.mjs +1 -1
- package/dist/esm/src/Select/Select.mjs +23 -22
- package/dist/esm/src/Select/Select.module.scss.mjs +0 -1
- package/dist/esm/src/SingleSelect/SingleSelect.mjs +12 -19
- package/dist/esm/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.mjs +3 -5
- package/dist/esm/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.module.scss.mjs +0 -1
- package/dist/esm/src/Text/Text.mjs +1 -1
- package/dist/esm/src/Text/Text.module.css.mjs +14 -0
- package/dist/esm/src/TimeField/TimeField.mjs +2 -3
- package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +1 -1
- package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css.mjs +11 -0
- package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.mjs +1 -1
- package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.css.mjs +7 -0
- package/dist/esm/src/Tooltip/OverlayArrow.mjs +1 -1
- package/dist/esm/src/Tooltip/OverlayArrow.module.css.mjs +5 -0
- package/dist/esm/src/Tooltip/Tooltip.mjs +1 -1
- package/dist/esm/src/Tooltip/Tooltip.module.css.mjs +5 -0
- package/dist/styles.css +725 -613
- package/dist/types/Button/Button.d.ts +0 -5
- package/dist/types/Calendar/CalendarRange/CalendarRange.d.ts +2 -1
- package/dist/types/Calendar/CalendarSingle/CalendarSingle.d.ts +2 -1
- package/dist/types/Calendar/types.d.ts +1 -0
- package/dist/types/GuidanceBlock/GuidanceBlock.d.ts +1 -26
- package/dist/types/Input/Input/Input.d.ts +1 -6
- package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +1 -5
- package/dist/types/Select/Select.d.ts +3 -13
- package/dist/types/SingleSelect/SingleSelect.d.ts +2 -24
- package/dist/types/SingleSelect/subcomponents/SelectToggle/SelectToggle.d.ts +2 -12
- package/dist/types/TextArea/TextArea.d.ts +1 -6
- package/dist/types/TimeField/TimeField.d.ts +1 -1
- package/locales/ar.json +4 -0
- package/locales/bg.json +4 -0
- package/locales/cs.json +4 -0
- package/locales/cy.json +4 -0
- package/locales/da.json +4 -0
- package/locales/de.json +4 -0
- package/locales/el.json +4 -0
- package/locales/en-GB.json +4 -0
- package/locales/en.json +4 -0
- package/locales/es-419.json +4 -0
- package/locales/es.json +4 -0
- package/locales/et.json +4 -0
- package/locales/fi.json +4 -0
- package/locales/fr-CA.json +4 -0
- package/locales/fr.json +4 -0
- package/locales/he.json +4 -0
- package/locales/hi.json +4 -0
- package/locales/ht.json +4 -0
- package/locales/hu.json +4 -0
- package/locales/id.json +4 -0
- package/locales/it.json +4 -0
- package/locales/ja.json +4 -0
- package/locales/km-KH.json +4 -0
- package/locales/ko.json +4 -0
- package/locales/lt.json +4 -0
- package/locales/lv.json +4 -0
- package/locales/mi.json +4 -0
- package/locales/ms.json +4 -0
- package/locales/nb.json +4 -0
- package/locales/nl.json +4 -0
- package/locales/pl.json +4 -0
- package/locales/pt-BR.json +4 -0
- package/locales/pt.json +4 -0
- package/locales/ro.json +4 -0
- package/locales/ru.json +4 -0
- package/locales/si-LK.json +4 -0
- package/locales/sk.json +4 -0
- package/locales/sr.json +4 -0
- package/locales/sv.json +4 -0
- package/locales/th.json +4 -0
- package/locales/tl.json +4 -0
- package/locales/tr.json +4 -0
- package/locales/uk.json +4 -0
- package/locales/vi.json +4 -0
- package/locales/zh-TW.json +4 -0
- package/locales/zh.json +4 -0
- package/package.json +1 -2
- package/src/Button/Button.tsx +1 -8
- package/src/Button/_docs/Button--api-specification.mdx +0 -1
- package/src/Calendar/CalendarRange/CalendarRange.tsx +4 -1
- package/src/Calendar/CalendarSingle/CalendarSingle.tsx +4 -1
- package/src/Calendar/types.ts +18 -0
- package/src/GuidanceBlock/GuidanceBlock.module.css +0 -8
- package/src/GuidanceBlock/GuidanceBlock.spec.tsx +1 -26
- package/src/GuidanceBlock/GuidanceBlock.tsx +2 -112
- package/src/GuidanceBlock/_docs/GuidanceBlock.stories.tsx +0 -90
- package/src/Heading/Heading.module.css +111 -0
- package/src/Heading/Heading.tsx +1 -1
- package/src/Input/Input/Input.module.scss +0 -31
- package/src/Input/Input/Input.tsx +1 -6
- package/src/Label/Label.module.css +97 -0
- package/src/Label/Label.tsx +1 -1
- package/src/Label/_docs/Label.stickersheet.stories.tsx +9 -4
- package/src/LabelledMessage/{LabelledMessage.module.scss → LabelledMessage.module.css} +1 -3
- package/src/LabelledMessage/LabelledMessage.tsx +1 -1
- package/src/LinkButton/LinkButton.tsx +1 -3
- package/src/LinkButton/_docs/LinkButton--api-specification.mdx +0 -1
- package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +7 -6
- package/src/Modal/ContextModal/ContextModal.tsx +0 -1
- package/src/Modal/GenericModal/GenericModal.tsx +3 -4
- package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +2 -8
- package/src/Notification/InlineNotification/InlineNotification.tsx +1 -1
- package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +1 -1
- package/src/Notification/ToastNotification/ToastNotificationsList/{ToastNotificationsList.module.scss → ToastNotificationsList.module.css} +6 -8
- package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.tsx +1 -1
- package/src/Notification/subcomponents/CancelButton/CancelButton.tsx +1 -1
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.css +392 -0
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +1 -1
- package/src/Notification/subcomponents/NotificationHeading/NotificationHeading.tsx +1 -1
- package/src/Select/Select.module.scss +0 -16
- package/src/Select/Select.tsx +24 -25
- package/src/SingleSelect/SingleSelect.tsx +1 -14
- package/src/SingleSelect/_docs/SingleSelect.stories.tsx +5 -2
- package/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.module.scss +0 -8
- package/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.tsx +2 -9
- package/src/Text/Text.module.css +71 -0
- package/src/Text/Text.tsx +1 -1
- package/src/TextArea/TextArea.tsx +1 -6
- package/src/TimeField/TimeField.tsx +2 -9
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.css +141 -0
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +1 -1
- package/src/ToggleSwitch/ToggleSwitchField/{ToggleSwitchField.module.scss → ToggleSwitchField.module.css} +1 -3
- package/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.tsx +1 -1
- package/src/Tooltip/OverlayArrow.module.css +45 -0
- package/src/Tooltip/OverlayArrow.tsx +1 -1
- package/src/Tooltip/Tooltip.module.css +62 -0
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/dist/cjs/src/Heading/Heading.module.scss.cjs +0 -22
- package/dist/cjs/src/Label/Label.module.scss.cjs +0 -15
- package/dist/cjs/src/LabelledMessage/LabelledMessage.module.scss.cjs +0 -7
- package/dist/cjs/src/Modal/util/console.cjs +0 -16
- package/dist/cjs/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +0 -29
- package/dist/cjs/src/Text/Text.module.scss.cjs +0 -16
- package/dist/cjs/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.cjs +0 -13
- package/dist/cjs/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss.cjs +0 -9
- package/dist/cjs/src/Tooltip/OverlayArrow.module.scss.cjs +0 -7
- package/dist/cjs/src/Tooltip/Tooltip.module.scss.cjs +0 -7
- package/dist/esm/src/Heading/Heading.module.scss.mjs +0 -20
- package/dist/esm/src/Label/Label.module.scss.mjs +0 -13
- package/dist/esm/src/LabelledMessage/LabelledMessage.module.scss.mjs +0 -5
- package/dist/esm/src/Modal/util/console.mjs +0 -13
- package/dist/esm/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +0 -27
- package/dist/esm/src/Text/Text.module.scss.mjs +0 -14
- package/dist/esm/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.mjs +0 -11
- package/dist/esm/src/ToggleSwitch/ToggleSwitchField/ToggleSwitchField.module.scss.mjs +0 -7
- package/dist/esm/src/Tooltip/OverlayArrow.module.scss.mjs +0 -5
- package/dist/esm/src/Tooltip/Tooltip.module.scss.mjs +0 -5
- package/dist/types/Modal/util/console.d.ts +0 -5
- package/dist/types/utils/useResizeObserver.d.ts +0 -22
- package/src/Heading/Heading.module.scss +0 -115
- package/src/Label/Label.module.scss +0 -105
- package/src/Modal/util/console.ts +0 -13
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +0 -138
- package/src/Notification/subcomponents/GenericNotification/_mixins.scss +0 -366
- package/src/Text/Text.module.scss +0 -74
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +0 -139
- package/src/Tooltip/OverlayArrow.module.scss +0 -45
- package/src/Tooltip/Tooltip.module.scss +0 -68
- package/src/utils/useResizeObserver.ts +0 -73
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import React, { useId, useState } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
+
import { useButton } from 'react-aria';
|
|
4
5
|
import ReactSelect, { components } from 'react-select';
|
|
5
6
|
import Async from 'react-select/async';
|
|
7
|
+
import { ClearButton } from '../ClearButton/ClearButton.mjs';
|
|
6
8
|
import { FieldMessage } from '../FieldMessage/FieldMessage.mjs';
|
|
7
9
|
import { Icon } from '../Icon/Icon.mjs';
|
|
8
10
|
import { Label } from '../Label/Label.mjs';
|
|
9
11
|
import { Tag } from '../Tag/Tag.mjs';
|
|
10
12
|
import styles from './Select.module.scss.mjs';
|
|
11
13
|
|
|
14
|
+
// react-select defaults to showing "Select..." placeholder text, which goes against our a11y
|
|
15
|
+
// standards — use `label` for the field name and `description` for help text instead.
|
|
16
|
+
// `noPlaceholderText` overrides the default string; `NullPlaceholder` removes the empty DOM node
|
|
17
|
+
// that react-select still renders even when the text is empty.
|
|
18
|
+
var noPlaceholderText = '';
|
|
19
|
+
var NullPlaceholder = function () {
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
12
22
|
/**
|
|
13
23
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896474/Select Guidance} |
|
|
14
24
|
* {@link https://cultureamp.design/?path=/docs/components-select--docs Storybook}
|
|
@@ -26,8 +36,7 @@ const Select = /*#__PURE__*/function () {
|
|
|
26
36
|
description = _a.description,
|
|
27
37
|
propsFullWidth = _a.fullWidth,
|
|
28
38
|
propsClassName = _a.className,
|
|
29
|
-
|
|
30
|
-
props = __rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "placeholder"]);
|
|
39
|
+
props = __rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className"]);
|
|
31
40
|
var reactId = useId();
|
|
32
41
|
// the default for fullWidth depends on the variant
|
|
33
42
|
var fullWidth = propsFullWidth !== null && propsFullWidth !== void 0 ? propsFullWidth : !['secondary', 'secondary-small'].includes(variant);
|
|
@@ -39,10 +48,10 @@ const Select = /*#__PURE__*/function () {
|
|
|
39
48
|
}, label)) : null, /*#__PURE__*/React.createElement(ReactSelect, __assign({}, props, {
|
|
40
49
|
ref: ref,
|
|
41
50
|
"aria-labelledby": labelId,
|
|
42
|
-
placeholder:
|
|
51
|
+
placeholder: noPlaceholderText,
|
|
43
52
|
components: {
|
|
44
53
|
Control: Control,
|
|
45
|
-
Placeholder:
|
|
54
|
+
Placeholder: NullPlaceholder,
|
|
46
55
|
DropdownIndicator: DropdownIndicator,
|
|
47
56
|
Menu: Menu,
|
|
48
57
|
GroupHeading: GroupHeading,
|
|
@@ -70,14 +79,13 @@ const Select = /*#__PURE__*/function () {
|
|
|
70
79
|
const AsyncSelect = /*#__PURE__*/function () {
|
|
71
80
|
const AsyncSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
72
81
|
var propsClassName = _a.className,
|
|
73
|
-
|
|
74
|
-
props = __rest(_a, ["className", "placeholder"]);
|
|
82
|
+
props = __rest(_a, ["className"]);
|
|
75
83
|
return /*#__PURE__*/React.createElement(Async, __assign({}, props, {
|
|
76
84
|
ref: ref,
|
|
77
|
-
placeholder:
|
|
85
|
+
placeholder: noPlaceholderText,
|
|
78
86
|
components: {
|
|
79
87
|
Control: Control,
|
|
80
|
-
Placeholder:
|
|
88
|
+
Placeholder: NullPlaceholder,
|
|
81
89
|
DropdownIndicator: DropdownIndicator,
|
|
82
90
|
Menu: Menu,
|
|
83
91
|
Option: Option,
|
|
@@ -87,7 +95,7 @@ const AsyncSelect = /*#__PURE__*/function () {
|
|
|
87
95
|
MultiValue: MultiValue,
|
|
88
96
|
IndicatorsContainer: IndicatorsContainer,
|
|
89
97
|
ValueContainer: ValueContainer,
|
|
90
|
-
ClearIndicator:
|
|
98
|
+
ClearIndicator: ClearIndicator,
|
|
91
99
|
IndicatorSeparator: null,
|
|
92
100
|
LoadingMessage: LoadingMessage
|
|
93
101
|
},
|
|
@@ -104,13 +112,6 @@ var Control = function (props) {
|
|
|
104
112
|
className: classnames(styles.control, props.isFocused && styles.focusedControl, props.isDisabled && styles.disabled)
|
|
105
113
|
})));
|
|
106
114
|
};
|
|
107
|
-
var Placeholder = function (props) {
|
|
108
|
-
return /*#__PURE__*/React.createElement(components.Placeholder, __assign({}, props, {
|
|
109
|
-
className: styles.placeholderOverrides
|
|
110
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
111
|
-
className: styles.placeholder
|
|
112
|
-
}, props.children));
|
|
113
|
-
};
|
|
114
115
|
var DropdownIndicator = function (props) {
|
|
115
116
|
return /*#__PURE__*/React.createElement(components.DropdownIndicator, __assign({}, props, {
|
|
116
117
|
className: styles.dropdownIndicator
|
|
@@ -179,12 +180,12 @@ var ValueContainer = function (props) {
|
|
|
179
180
|
}));
|
|
180
181
|
};
|
|
181
182
|
var ClearIndicator = function (props) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
var buttonRef = React.useRef(null);
|
|
184
|
+
var buttonProps = useButton(__assign(__assign({}, props), {
|
|
185
|
+
onClick: props.clearValue
|
|
186
|
+
}), buttonRef).buttonProps;
|
|
187
|
+
return /*#__PURE__*/React.createElement(ClearButton, __assign({}, buttonProps, {
|
|
188
|
+
classNameOverride: styles.clearIndicator
|
|
188
189
|
}));
|
|
189
190
|
};
|
|
190
191
|
export { AsyncSelect, Select };
|
|
@@ -11,7 +11,6 @@ var styles = {
|
|
|
11
11
|
"valueContainer": "Select-module_valueContainer__MGkpr",
|
|
12
12
|
"indicatorsContainer": "Select-module_indicatorsContainer__2xCsm",
|
|
13
13
|
"loadingMessage": "Select-module_loadingMessage__4Ej9T",
|
|
14
|
-
"placeholder": "Select-module_placeholder__OAeGA",
|
|
15
14
|
"menu": "Select-module_menu__axmUL",
|
|
16
15
|
"groupHeading": "Select-module_groupHeading__eNw6U",
|
|
17
16
|
"option": "Select-module_option__EdP-F",
|
|
@@ -8,7 +8,7 @@ import { FieldMessage } from '../FieldMessage/FieldMessage.mjs';
|
|
|
8
8
|
import { Popover } from '../MultiSelect/subcomponents/Popover/Popover.mjs';
|
|
9
9
|
import { useFloating } from '@floating-ui/react-dom';
|
|
10
10
|
import { SelectProvider } from './context/SelectContext.mjs';
|
|
11
|
-
import
|
|
11
|
+
import './subcomponents/ListBox/ListBox.mjs';
|
|
12
12
|
import { ListBoxSection } from './subcomponents/ListBoxSection/ListBoxSection.mjs';
|
|
13
13
|
import { ListItem } from './subcomponents/ListItem/ListItem.mjs';
|
|
14
14
|
import './subcomponents/ListItems/ListItems.mjs';
|
|
@@ -42,12 +42,10 @@ const SingleSelect = /*#__PURE__*/function () {
|
|
|
42
42
|
classNameOverride = _a.classNameOverride,
|
|
43
43
|
selectedKey = _a.selectedKey,
|
|
44
44
|
description = _a.description,
|
|
45
|
-
_d = _a.placeholder,
|
|
46
|
-
placeholder = _d === void 0 ? '' : _d,
|
|
47
45
|
isDisabled = _a.isDisabled,
|
|
48
46
|
onSelectionChange = _a.onSelectionChange,
|
|
49
47
|
portalContainerId = _a.portalContainerId,
|
|
50
|
-
restProps = __rest(_a, ["label", "items", "id", "trigger", "children", "status", "validationMessage", "isReversed", "isRequired", "isFullWidth", "classNameOverride", "selectedKey", "description", "
|
|
48
|
+
restProps = __rest(_a, ["label", "items", "id", "trigger", "children", "status", "validationMessage", "isReversed", "isRequired", "isFullWidth", "classNameOverride", "selectedKey", "description", "isDisabled", "onSelectionChange", "portalContainerId"]);
|
|
51
49
|
var refs = useFloating().refs;
|
|
52
50
|
var triggerRef = refs.reference;
|
|
53
51
|
var fallbackId = useId();
|
|
@@ -63,7 +61,6 @@ const SingleSelect = /*#__PURE__*/function () {
|
|
|
63
61
|
disabledKeys: disabledKeys,
|
|
64
62
|
selectedKey: typeof selectedKey === 'number' ? selectedKey.toString() : selectedKey,
|
|
65
63
|
description: description,
|
|
66
|
-
placeholder: placeholder,
|
|
67
64
|
isDisabled: isDisabled,
|
|
68
65
|
isRequired: isRequired,
|
|
69
66
|
onSelectionChange: onSelectionChange ? function (key) {
|
|
@@ -71,13 +68,13 @@ const SingleSelect = /*#__PURE__*/function () {
|
|
|
71
68
|
} : undefined
|
|
72
69
|
}, restProps);
|
|
73
70
|
var state = useSelectState(ariaSelectProps);
|
|
74
|
-
var
|
|
75
|
-
labelProps =
|
|
76
|
-
reactAriaTriggerProps =
|
|
77
|
-
valueProps =
|
|
78
|
-
menuProps =
|
|
79
|
-
errorMessageProps =
|
|
80
|
-
descriptionProps =
|
|
71
|
+
var _d = useSelect(ariaSelectProps, state, triggerRef),
|
|
72
|
+
labelProps = _d.labelProps,
|
|
73
|
+
reactAriaTriggerProps = _d.triggerProps,
|
|
74
|
+
valueProps = _d.valueProps,
|
|
75
|
+
menuProps = _d.menuProps,
|
|
76
|
+
errorMessageProps = _d.errorMessageProps,
|
|
77
|
+
descriptionProps = _d.descriptionProps;
|
|
81
78
|
// Hack incoming:
|
|
82
79
|
// react-aria/useSelect wants to prefix the combobox's accessible name with the value of the select.
|
|
83
80
|
// We use role=combobox, meaning screen readers will read the value.
|
|
@@ -94,7 +91,6 @@ const SingleSelect = /*#__PURE__*/function () {
|
|
|
94
91
|
'value': (_b = state === null || state === void 0 ? void 0 : state.selectedItem) === null || _b === void 0 ? void 0 : _b.rendered,
|
|
95
92
|
valueProps: valueProps,
|
|
96
93
|
'isOpen': state.isOpen,
|
|
97
|
-
placeholder: placeholder,
|
|
98
94
|
status: status,
|
|
99
95
|
'isDisabled': triggerProps.isDisabled,
|
|
100
96
|
isReversed: isReversed,
|
|
@@ -102,9 +98,9 @@ const SingleSelect = /*#__PURE__*/function () {
|
|
|
102
98
|
'aria-describedby': classnames(validationMessage && validationId, description && descriptionId),
|
|
103
99
|
'aria-required': isRequired
|
|
104
100
|
});
|
|
105
|
-
var
|
|
106
|
-
portalContainer =
|
|
107
|
-
setPortalContainer =
|
|
101
|
+
var _e = useState(),
|
|
102
|
+
portalContainer = _e[0],
|
|
103
|
+
setPortalContainer = _e[1];
|
|
108
104
|
useEffect(function () {
|
|
109
105
|
if (portalContainerId) {
|
|
110
106
|
var portalElement = document.getElementById(portalContainerId);
|
|
@@ -145,9 +141,6 @@ const SingleSelect = /*#__PURE__*/function () {
|
|
|
145
141
|
SingleSelect.SectionDivider = SectionDivider;
|
|
146
142
|
SingleSelect.Option = Option;
|
|
147
143
|
SingleSelect.ItemDefaultRender = ListItem;
|
|
148
|
-
// @deprecated Legacy exported aliases
|
|
149
|
-
SingleSelect.TriggerButton = SelectToggle;
|
|
150
|
-
SingleSelect.ListBox = ListBox;
|
|
151
144
|
return SingleSelect;
|
|
152
145
|
}();
|
|
153
146
|
export { SingleSelect };
|
|
@@ -11,13 +11,11 @@ const SelectToggle = /*#__PURE__*/function () {
|
|
|
11
11
|
value = _a.value,
|
|
12
12
|
valueProps = _a.valueProps,
|
|
13
13
|
isOpen = _a.isOpen,
|
|
14
|
-
_b = _a.placeholder,
|
|
15
|
-
placeholder = _b === void 0 ? 'Select' : _b,
|
|
16
14
|
status = _a.status,
|
|
17
15
|
isDisabled = _a.isDisabled,
|
|
18
16
|
isReversed = _a.isReversed,
|
|
19
17
|
classNameOverride = _a.classNameOverride,
|
|
20
|
-
restProps = __rest(_a, ["label", "labelProps", "value", "valueProps", "isOpen", "
|
|
18
|
+
restProps = __rest(_a, ["label", "labelProps", "value", "valueProps", "isOpen", "status", "isDisabled", "isReversed", "classNameOverride"]);
|
|
21
19
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Label, __assign({}, labelProps, {
|
|
22
20
|
reversed: isReversed,
|
|
23
21
|
disabled: isDisabled
|
|
@@ -28,10 +26,10 @@ const SelectToggle = /*#__PURE__*/function () {
|
|
|
28
26
|
role: "combobox"
|
|
29
27
|
}, restProps, {
|
|
30
28
|
ref: ref,
|
|
31
|
-
className: classnames(styles.selectToggle,
|
|
29
|
+
className: classnames(styles.selectToggle, status === 'error' && styles.error, status === 'caution' && styles.caution, isDisabled && styles.disabled, isReversed && styles.reversed, classNameOverride)
|
|
32
30
|
}), /*#__PURE__*/React.createElement("span", __assign({}, valueProps, {
|
|
33
31
|
className: styles.value
|
|
34
|
-
}), value
|
|
32
|
+
}), value), /*#__PURE__*/React.createElement(Icon, {
|
|
35
33
|
name: isOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
|
|
36
34
|
isPresentational: true,
|
|
37
35
|
className: styles.icon
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"icon": "SelectToggle-module_icon__rsV9A",
|
|
3
3
|
"selectToggle": "SelectToggle-module_selectToggle__e6slL",
|
|
4
|
-
"placeholder": "SelectToggle-module_placeholder__w7o7S",
|
|
5
4
|
"error": "SelectToggle-module_error__npEgr",
|
|
6
5
|
"caution": "SelectToggle-module_caution__9jSK0",
|
|
7
6
|
"disabled": "SelectToggle-module_disabled__2MKmF",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import { createElement } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import styles from './Text.module.
|
|
4
|
+
import styles from './Text.module.css.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3074885298/Typography#Paragraph Guidance}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var styles = {
|
|
2
|
+
"text": "Text-module_text__3xRq3",
|
|
3
|
+
"intro-lede": "Text-module_intro-lede__Pf95y",
|
|
4
|
+
"body": "Text-module_body__o-QuI",
|
|
5
|
+
"small": "Text-module_small__d6k-f",
|
|
6
|
+
"extra-small": "Text-module_extra-small__jP3Xx",
|
|
7
|
+
"dark": "Text-module_dark__ApVTx",
|
|
8
|
+
"dark-reduced-opacity": "Text-module_dark-reduced-opacity__-ef8o",
|
|
9
|
+
"white": "Text-module_white__Vj0Na",
|
|
10
|
+
"white-reduced-opacity": "Text-module_white-reduced-opacity__kYl0h",
|
|
11
|
+
"positive": "Text-module_positive__ngZQ5",
|
|
12
|
+
"negative": "Text-module_negative__729Es"
|
|
13
|
+
};
|
|
14
|
+
export { styles as default };
|
|
@@ -55,8 +55,7 @@ const TimeFieldComponent = /*#__PURE__*/function () {
|
|
|
55
55
|
onChange: handleOnChange,
|
|
56
56
|
isDisabled: isDisabled,
|
|
57
57
|
hideTimeZone: true,
|
|
58
|
-
locale: locale
|
|
59
|
-
validationState: status === 'default' ? 'valid' : 'invalid'
|
|
58
|
+
locale: locale
|
|
60
59
|
}));
|
|
61
60
|
var hasError = !!validationMessage && status === 'error';
|
|
62
61
|
var descriptionId = hasError ? "".concat(id, "-field-message") : undefined;
|
|
@@ -79,7 +78,7 @@ const TimeFieldComponent = /*#__PURE__*/function () {
|
|
|
79
78
|
}, /*#__PURE__*/React.createElement("div", __assign({}, fieldProps, {
|
|
80
79
|
id: id,
|
|
81
80
|
ref: inputRef,
|
|
82
|
-
className: classnames(styles.input, state.isDisabled && styles.isDisabled,
|
|
81
|
+
className: classnames(styles.input, state.isDisabled && styles.isDisabled, status === 'error' && styles.error)
|
|
83
82
|
}), state.segments.map(function (segment, i) {
|
|
84
83
|
return /*#__PURE__*/React.createElement(TimeSegment, {
|
|
85
84
|
key: i,
|
|
@@ -2,7 +2,7 @@ import { __rest, __assign } from 'tslib';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { Icon } from '../../Icon/Icon.mjs';
|
|
5
|
-
import styles from './ToggleSwitch.module.
|
|
5
|
+
import styles from './ToggleSwitch.module.css.mjs';
|
|
6
6
|
const ToggleSwitch = /*#__PURE__*/function () {
|
|
7
7
|
const ToggleSwitch = function (_a) {
|
|
8
8
|
var toggledStatus = _a.toggledStatus,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var styles = {
|
|
2
|
+
"checkbox": "ToggleSwitch-module_checkbox__NmNyg",
|
|
3
|
+
"track": "ToggleSwitch-module_track__Zvo6N",
|
|
4
|
+
"disabled": "ToggleSwitch-module_disabled__qntEm",
|
|
5
|
+
"thumb": "ToggleSwitch-module_thumb__YIdcS",
|
|
6
|
+
"checkIcon": "ToggleSwitch-module_checkIcon__J4eSM",
|
|
7
|
+
"on": "ToggleSwitch-module_on__-OJbU",
|
|
8
|
+
"off": "ToggleSwitch-module_off__e-dto",
|
|
9
|
+
"reversed": "ToggleSwitch-module_reversed__5Jz8i"
|
|
10
|
+
};
|
|
11
|
+
export { styles as default };
|
|
@@ -4,7 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { FieldGroup } from '../../FieldGroup/FieldGroup.mjs';
|
|
5
5
|
import { Label } from '../../Label/Label.mjs';
|
|
6
6
|
import { ToggleSwitch } from '../ToggleSwitch/ToggleSwitch.mjs';
|
|
7
|
-
import styles from './ToggleSwitchField.module.
|
|
7
|
+
import styles from './ToggleSwitchField.module.css.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3075638160/Toggle+Switch Guidance} |
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var styles = {
|
|
2
|
+
"container": "ToggleSwitchField-module_container__6c4oG",
|
|
3
|
+
"fullWidth": "ToggleSwitchField-module_fullWidth__iGJSg",
|
|
4
|
+
"inner": "ToggleSwitchField-module_inner__k1hyg",
|
|
5
|
+
"on": "ToggleSwitchField-module_on__8RJfp"
|
|
6
|
+
};
|
|
7
|
+
export { styles as default };
|
|
@@ -4,7 +4,7 @@ import { OverlayArrow as OverlayArrow$1 } from 'react-aria-components';
|
|
|
4
4
|
import 'use-debounce';
|
|
5
5
|
import { useReversedColors } from '../utils/ReversedColors/ReversedColors.mjs';
|
|
6
6
|
import { mergeClassNames } from '../utils/mergeClassNames.mjs';
|
|
7
|
-
import styles from './OverlayArrow.module.
|
|
7
|
+
import styles from './OverlayArrow.module.css.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* An OverlayArrow renders a custom arrow element relative to an overlay element
|
|
@@ -7,7 +7,7 @@ import 'use-debounce';
|
|
|
7
7
|
import { useReversedColors } from '../utils/ReversedColors/ReversedColors.mjs';
|
|
8
8
|
import { mergeClassNames } from '../utils/mergeClassNames.mjs';
|
|
9
9
|
import { OverlayArrow } from './OverlayArrow.mjs';
|
|
10
|
-
import styles from './Tooltip.module.
|
|
10
|
+
import styles from './Tooltip.module.css.mjs';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* A tooltip displays a description of an element on hover or focus.
|