@kaizen/components 2.5.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.
Files changed (73) hide show
  1. package/dist/cjs/src/Button/Button.cjs +2 -4
  2. package/dist/cjs/src/GuidanceBlock/GuidanceBlock.cjs +16 -82
  3. package/dist/cjs/src/GuidanceBlock/GuidanceBlock.module.css.cjs +0 -1
  4. package/dist/cjs/src/LinkButton/LinkButton.cjs +2 -4
  5. package/dist/cjs/src/Modal/ConfirmationModal/ConfirmationModal.cjs +3 -2
  6. package/dist/cjs/src/Modal/ContextModal/ContextModal.cjs +0 -1
  7. package/dist/cjs/src/Modal/GenericModal/GenericModal.cjs +2 -2
  8. package/dist/cjs/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.cjs +3 -6
  9. package/dist/cjs/src/Select/Select.cjs +14 -15
  10. package/dist/cjs/src/Select/Select.module.scss.cjs +0 -1
  11. package/dist/cjs/src/SingleSelect/SingleSelect.cjs +12 -19
  12. package/dist/cjs/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.cjs +3 -5
  13. package/dist/cjs/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.module.scss.cjs +0 -1
  14. package/dist/cjs/src/TimeField/TimeField.cjs +2 -3
  15. package/dist/esm/src/Button/Button.mjs +2 -4
  16. package/dist/esm/src/GuidanceBlock/GuidanceBlock.mjs +18 -84
  17. package/dist/esm/src/GuidanceBlock/GuidanceBlock.module.css.mjs +0 -1
  18. package/dist/esm/src/LinkButton/LinkButton.mjs +2 -4
  19. package/dist/esm/src/Modal/ConfirmationModal/ConfirmationModal.mjs +3 -2
  20. package/dist/esm/src/Modal/ContextModal/ContextModal.mjs +0 -1
  21. package/dist/esm/src/Modal/GenericModal/GenericModal.mjs +2 -2
  22. package/dist/esm/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.mjs +3 -6
  23. package/dist/esm/src/Select/Select.mjs +14 -15
  24. package/dist/esm/src/Select/Select.module.scss.mjs +0 -1
  25. package/dist/esm/src/SingleSelect/SingleSelect.mjs +12 -19
  26. package/dist/esm/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.mjs +3 -5
  27. package/dist/esm/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.module.scss.mjs +0 -1
  28. package/dist/esm/src/TimeField/TimeField.mjs +2 -3
  29. package/dist/styles.css +0 -94
  30. package/dist/types/Button/Button.d.ts +0 -5
  31. package/dist/types/Calendar/CalendarRange/CalendarRange.d.ts +2 -1
  32. package/dist/types/Calendar/CalendarSingle/CalendarSingle.d.ts +2 -1
  33. package/dist/types/Calendar/types.d.ts +1 -0
  34. package/dist/types/GuidanceBlock/GuidanceBlock.d.ts +1 -26
  35. package/dist/types/Input/Input/Input.d.ts +1 -6
  36. package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +1 -5
  37. package/dist/types/Select/Select.d.ts +3 -13
  38. package/dist/types/SingleSelect/SingleSelect.d.ts +2 -24
  39. package/dist/types/SingleSelect/subcomponents/SelectToggle/SelectToggle.d.ts +2 -12
  40. package/dist/types/TextArea/TextArea.d.ts +1 -6
  41. package/dist/types/TimeField/TimeField.d.ts +1 -1
  42. package/package.json +1 -2
  43. package/src/Button/Button.tsx +1 -8
  44. package/src/Button/_docs/Button--api-specification.mdx +0 -1
  45. package/src/Calendar/CalendarRange/CalendarRange.tsx +4 -1
  46. package/src/Calendar/CalendarSingle/CalendarSingle.tsx +4 -1
  47. package/src/Calendar/types.ts +18 -0
  48. package/src/GuidanceBlock/GuidanceBlock.module.css +0 -8
  49. package/src/GuidanceBlock/GuidanceBlock.spec.tsx +1 -26
  50. package/src/GuidanceBlock/GuidanceBlock.tsx +2 -112
  51. package/src/GuidanceBlock/_docs/GuidanceBlock.stories.tsx +0 -90
  52. package/src/Input/Input/Input.module.scss +0 -31
  53. package/src/Input/Input/Input.tsx +1 -6
  54. package/src/LinkButton/LinkButton.tsx +1 -3
  55. package/src/LinkButton/_docs/LinkButton--api-specification.mdx +0 -1
  56. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +7 -6
  57. package/src/Modal/ContextModal/ContextModal.tsx +0 -1
  58. package/src/Modal/GenericModal/GenericModal.tsx +3 -4
  59. package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +2 -8
  60. package/src/Select/Select.module.scss +0 -16
  61. package/src/Select/Select.tsx +16 -19
  62. package/src/SingleSelect/SingleSelect.tsx +1 -14
  63. package/src/SingleSelect/_docs/SingleSelect.stories.tsx +5 -2
  64. package/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.module.scss +0 -8
  65. package/src/SingleSelect/subcomponents/SelectToggle/SelectToggle.tsx +2 -9
  66. package/src/TextArea/TextArea.tsx +1 -6
  67. package/src/TimeField/TimeField.tsx +2 -9
  68. package/dist/cjs/src/Modal/util/console.cjs +0 -16
  69. package/dist/esm/src/Modal/util/console.mjs +0 -13
  70. package/dist/types/Modal/util/console.d.ts +0 -5
  71. package/dist/types/utils/useResizeObserver.d.ts +0 -22
  72. package/src/Modal/util/console.ts +0 -13
  73. package/src/utils/useResizeObserver.ts +0 -73
@@ -33,10 +33,8 @@ var Button = React.forwardRef(function (_a, ref) {
33
33
  _f = _a.hasHiddenPendingLabel,
34
34
  propsHasHiddenPendingLabel = _f === void 0 ? false : _f,
35
35
  pendingLabel = _a.pendingLabel,
36
- isReversed = _a.isReversed,
37
- restProps = tslib.__rest(_a, ["variant", "size", "className", "children", "isDisabled", "isFullWidth", "icon", "iconPosition", "hasHiddenLabel", "isPending", "hasHiddenPendingLabel", "pendingLabel", "isReversed"]);
38
- var shouldUseReverse = ReversedColors.useReversedColors();
39
- var isReversedVariant = isReversed !== null && isReversed !== void 0 ? isReversed : shouldUseReverse;
36
+ restProps = tslib.__rest(_a, ["variant", "size", "className", "children", "isDisabled", "isFullWidth", "icon", "iconPosition", "hasHiddenLabel", "isPending", "hasHiddenPendingLabel", "pendingLabel"]);
37
+ var isReversedVariant = ReversedColors.useReversedColors();
40
38
  var pendingProps = isPending ? {
41
39
  isPending: isPending,
42
40
  hasHiddenPendingLabel: hasHiddenLabel || propsHasHiddenPendingLabel,
@@ -3,12 +3,8 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var classnames = require('classnames');
6
- var Button = require('../ButtonV1/Button/Button.cjs');
7
- require('../ButtonV1/IconButton/IconButton.cjs');
8
6
  var Heading = require('../Heading/Heading.cjs');
9
- var Icon = require('../Icon/Icon.cjs');
10
7
  var Text = require('../Text/Text.cjs');
11
- var Tooltip = require('../TooltipV1/Tooltip.cjs');
12
8
  var useMediaQueries = require('../utils/useMediaQueries.cjs');
13
9
  var GuidanceBlock_module = require('./GuidanceBlock.module.css.cjs');
14
10
  function _interopDefault(e) {
@@ -18,69 +14,29 @@ function _interopDefault(e) {
18
14
  }
19
15
  var React__default = /*#__PURE__*/_interopDefault(React);
20
16
  var classnames__default = /*#__PURE__*/_interopDefault(classnames);
21
- var WithTooltip = function (_a) {
22
- var tooltipProps = _a.tooltipProps,
23
- children = _a.children;
24
- return tooltipProps ? React__default.default.createElement(Tooltip.Tooltip, tslib.__assign({}, tooltipProps), children) : React__default.default.createElement(React__default.default.Fragment, null, children);
25
- };
17
+
26
18
  /**
27
19
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093807/Guidance+Block Guidance} |
28
20
  * {@link https://cultureamp.design/?path=/docs/components-guidanceblock--docs Storybook}
29
21
  */
30
22
  var GuidanceBlock = function (_a) {
31
- var _b, _c, _d, _e, _f;
32
- var _g = _a.layout,
33
- layout = _g === void 0 ? 'default' : _g,
34
- _h = _a.variant,
35
- variant = _h === void 0 ? 'default' : _h,
36
- _j = _a.withActionButtonArrow,
37
- withActionButtonArrow = _j === void 0 ? true : _j,
38
- _k = _a.noMaxWidth,
39
- noMaxWidth = _k === void 0 ? false : _k,
40
- _l = _a.illustrationType,
41
- illustrationType = _l === void 0 ? 'spot' : _l,
42
- _m = _a.smallScreenTextAlignment,
43
- smallScreenTextAlignment = _m === void 0 ? 'center' : _m,
44
- actions = _a.actions,
23
+ var _b, _c, _d, _e;
24
+ var _f = _a.layout,
25
+ layout = _f === void 0 ? 'default' : _f,
26
+ _g = _a.variant,
27
+ variant = _g === void 0 ? 'default' : _g,
28
+ _h = _a.noMaxWidth,
29
+ noMaxWidth = _h === void 0 ? false : _h,
30
+ _j = _a.illustrationType,
31
+ illustrationType = _j === void 0 ? 'spot' : _j,
32
+ _k = _a.smallScreenTextAlignment,
33
+ smallScreenTextAlignment = _k === void 0 ? 'center' : _k,
45
34
  illustration = _a.illustration,
46
- secondaryDismiss = _a.secondaryDismiss,
47
35
  actionsSlot = _a.actionsSlot,
48
- restProps = tslib.__rest(_a, ["layout", "variant", "withActionButtonArrow", "noMaxWidth", "illustrationType", "smallScreenTextAlignment", "actions", "illustration", "secondaryDismiss", "actionsSlot"]);
49
- var _o = React.useState(false),
50
- hidden = _o[0],
51
- setHidden = _o[1];
52
- var _p = React.useState(false),
53
- removed = _p[0],
54
- setRemoved = _p[1];
36
+ restProps = tslib.__rest(_a, ["layout", "variant", "noMaxWidth", "illustrationType", "smallScreenTextAlignment", "illustration", "actionsSlot"]);
55
37
  var queries = useMediaQueries.useMediaQueries().queries;
56
- var containerRef = React__default.default.createRef();
57
- var handleDismissBanner = function () {
58
- var _a;
59
- setHidden(true);
60
- (_a = actions === null || actions === void 0 ? void 0 : actions.dismiss) === null || _a === void 0 ? void 0 : _a.onClick();
61
- };
62
- var onTransitionEnd = function (e) {
63
- // Be careful: this assumes the final CSS property to be animated is "margin-top".
64
- if (hidden && e.propertyName === 'margin-top') {
65
- setRemoved(true);
66
- }
67
- };
68
- var marginTop = function () {
69
- if (hidden && containerRef.current) {
70
- return -containerRef.current.clientHeight + 'px';
71
- }
72
- return '0';
73
- };
74
- if (removed) {
75
- return React__default.default.createElement(React__default.default.Fragment, null);
76
- }
77
38
  return React__default.default.createElement("div", {
78
- className: classnames__default.default(GuidanceBlock_module.banner, variant && GuidanceBlock_module[variant], layout && GuidanceBlock_module[layout], hidden && GuidanceBlock_module.hidden, queries.isSmall && GuidanceBlock_module.centerContent, noMaxWidth && GuidanceBlock_module.noMaxWidth, illustrationType === 'scene' && GuidanceBlock_module.hasSceneIllustration, smallScreenTextAlignment === 'left' && GuidanceBlock_module.smallScreenTextAlignment),
79
- style: {
80
- marginTop: marginTop()
81
- },
82
- ref: containerRef,
83
- onTransitionEnd: onTransitionEnd
39
+ className: classnames__default.default(GuidanceBlock_module.banner, variant && GuidanceBlock_module[variant], layout && GuidanceBlock_module[layout], queries.isSmall && GuidanceBlock_module.centerContent, noMaxWidth && GuidanceBlock_module.noMaxWidth, illustrationType === 'scene' && GuidanceBlock_module.hasSceneIllustration, smallScreenTextAlignment === 'left' && GuidanceBlock_module.smallScreenTextAlignment)
84
40
  }, React__default.default.createElement("div", {
85
41
  className: GuidanceBlock_module.illustrationWrapper
86
42
  }, React__default.default.createElement("div", {
@@ -99,31 +55,9 @@ var GuidanceBlock = function (_a) {
99
55
  }, (_d = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _d === void 0 ? void 0 : _d.title)), React__default.default.createElement(Text.Text, {
100
56
  tag: "p",
101
57
  variant: "body"
102
- }, (_e = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _e === void 0 ? void 0 : _e.description))), (actions === null || actions === void 0 ? void 0 : actions.primary) || actionsSlot ? React__default.default.createElement("div", {
58
+ }, (_e = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _e === void 0 ? void 0 : _e.description))), actionsSlot && React__default.default.createElement("div", {
103
59
  className: GuidanceBlock_module.buttonContainer
104
- }, (actions === null || actions === void 0 ? void 0 : actions.primary) && React__default.default.createElement(React__default.default.Fragment, null, React__default.default.createElement(WithTooltip, {
105
- tooltipProps: actions.primary.tooltip
106
- }, React__default.default.createElement(Button.Button, tslib.__assign({
107
- icon: withActionButtonArrow ? React__default.default.createElement(Icon.Icon, {
108
- name: "arrow_forward",
109
- isPresentational: true,
110
- shouldMirrorInRTL: true
111
- }) : undefined,
112
- iconPosition: "end"
113
- }, actions.primary, {
114
- fullWidth: queries.isSmall
115
- }))), (actions === null || actions === void 0 ? void 0 : actions.secondary) && React__default.default.createElement(WithTooltip, {
116
- tooltipProps: actions.secondary.tooltip
117
- }, React__default.default.createElement("div", {
118
- className: GuidanceBlock_module.secondaryAction
119
- }, React__default.default.createElement(Button.Button, tslib.__assign({
120
- secondary: true
121
- }, actions.secondary, {
122
- onClick: secondaryDismiss ? function () {
123
- return handleDismissBanner();
124
- } : (_f = actions === null || actions === void 0 ? void 0 : actions.secondary) === null || _f === void 0 ? void 0 : _f.onClick,
125
- fullWidth: queries.isSmall
126
- }))))), !actions && actionsSlot && actionsSlot) : null));
60
+ }, actionsSlot)));
127
61
  };
128
62
  GuidanceBlock.displayName = 'GuidanceBlock';
129
63
  exports.GuidanceBlock = GuidanceBlock;
@@ -9,7 +9,6 @@ var styles = {
9
9
  "descriptionContainer": "GuidanceBlock-module_descriptionContainer__w1-P-",
10
10
  "descriptionAndActions": "GuidanceBlock-module_descriptionAndActions__aQhc9",
11
11
  "buttonContainer": "GuidanceBlock-module_buttonContainer__bcVmB",
12
- "hidden": "GuidanceBlock-module_hidden__mwvrs",
13
12
  "headingWrapper": "GuidanceBlock-module_headingWrapper__OfZB5",
14
13
  "default": "GuidanceBlock-module_default__7naG4",
15
14
  "positive": "GuidanceBlock-module_positive__iCp-1",
@@ -37,10 +37,8 @@ var LinkButton = React.forwardRef(function (_a, ref) {
37
37
  isFullWidth = _f === void 0 ? false : _f,
38
38
  isDisabled = _a.isDisabled,
39
39
  className = _a.className,
40
- isReversed = _a.isReversed,
41
- otherProps = tslib.__rest(_a, ["children", "variant", "size", "icon", "iconPosition", "hasHiddenLabel", "isFullWidth", "isDisabled", "className", "isReversed"]);
42
- var shouldUseReverse = ReversedColors.useReversedColors();
43
- var isReversedVariant = isReversed !== null && isReversed !== void 0 ? isReversed : shouldUseReverse;
40
+ otherProps = tslib.__rest(_a, ["children", "variant", "size", "icon", "iconPosition", "hasHiddenLabel", "isFullWidth", "isDisabled", "className"]);
41
+ var isReversedVariant = ReversedColors.useReversedColors();
44
42
  return React__default.default.createElement(reactAriaComponents.Link, tslib.__assign({
45
43
  ref: ref,
46
44
  className: mergeClassNames.mergeClassNames(LinkButton_module.linkButton, Button_module.button, Button_module[size], hasHiddenLabel && Button_module["".concat(size, "IconButton")], isDisabled && Button_module.isDisabled, isReversedVariant ? Button_module["".concat(variant, "Reversed")] : Button_module[variant], isFullWidth && Button_module.fullWidth, className),
@@ -85,7 +85,9 @@ var ConfirmationModal = function (_a) {
85
85
  if (onConfirm) {
86
86
  var confirmAction = {
87
87
  label: confirmLabel,
88
- onClick: onConfirm
88
+ onClick: onConfirm,
89
+ destructive: variant === 'warning',
90
+ primary: variant !== 'warning'
89
91
  };
90
92
  var workingProps = confirmWorking ? {
91
93
  working: true,
@@ -126,7 +128,6 @@ var ConfirmationModal = function (_a) {
126
128
  className: classnames__default.default(isProminent && ConfirmationModal_module.prominent, !unpadded && ConfirmationModal_module.padded)
127
129
  }, React__default.default.createElement(ModalAccessibleDescription.ModalAccessibleDescription, null, children))), React__default.default.createElement(ModalFooter.ModalFooter, {
128
130
  actions: footerActions,
129
- appearance: variant == 'warning' ? 'destructive' : 'primary',
130
131
  unpadded: unpadded
131
132
  })));
132
133
  };
@@ -97,7 +97,6 @@ var ContextModal = function (_a) {
97
97
  })))), React__default.default.createElement(ModalFooter.ModalFooter, {
98
98
  variant: image ? 'context' : undefined,
99
99
  actions: footerActions,
100
- appearance: "primary",
101
100
  unpadded: unpadded
102
101
  })));
103
102
  };
@@ -6,7 +6,6 @@ var react = require('@headlessui/react');
6
6
  var classnames = require('classnames');
7
7
  var reactFocusOn = require('react-focus-on');
8
8
  var useIsClientReady = require('../../utils/useIsClientReady/useIsClientReady.cjs');
9
- var console = require('../util/console.cjs');
10
9
  var ModalContext = require('./context/ModalContext.cjs');
11
10
  var GenericModal_module = require('./GenericModal.module.scss.cjs');
12
11
  function _interopDefault(e) {
@@ -50,7 +49,8 @@ var GenericModal = function (_a) {
50
49
  // Ensure that consumers have provided an element that labels the modal
51
50
  // to meet ARIA accessibility guidelines.
52
51
  if (!document.getElementById(labelledByID)) {
53
- console.warn("When using the Modal component, you must provide a label for the modal.\n Make sure you have a <ModalAccessibleLabel /> component with content that labels the modal.");
52
+ // eslint-disable-next-line no-console
53
+ console.warn('When using the Modal component, you must provide a label for the modal. Make sure you have a <ModalAccessibleLabel /> component with content that labels the modal.');
54
54
  }
55
55
  };
56
56
  var focusOnAccessibleLabel = function () {
@@ -18,11 +18,9 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
18
18
  var ModalFooter = function (_a) {
19
19
  var unpadded = _a.unpadded,
20
20
  actions = _a.actions,
21
- _b = _a.appearance,
22
- appearance = _b === void 0 ? 'primary' : _b,
23
21
  alignStart = _a.alignStart,
24
22
  variant = _a.variant,
25
- props = tslib.__rest(_a, ["unpadded", "actions", "appearance", "alignStart", "variant"]);
23
+ props = tslib.__rest(_a, ["unpadded", "actions", "alignStart", "variant"]);
26
24
  var queries = useMediaQueries.useMediaQueries().queries;
27
25
  return React__default.default.createElement(ModalBody.ModalBody, {
28
26
  inputEdit: variant === 'inputEdit'
@@ -34,9 +32,8 @@ var ModalFooter = function (_a) {
34
32
  key: index
35
33
  }, React__default.default.createElement(Button.Button, tslib.__assign({
36
34
  type: "button",
37
- primary: index === 0 && appearance === 'primary',
38
- destructive: index === 0 && appearance === 'destructive',
39
- secondary: index > 0,
35
+ primary: index === 0 && !action.destructive && !action.secondary,
36
+ secondary: index > 0 && !action.destructive && !action.primary,
40
37
  fullWidth: queries.isSmall
41
38
  }, action)));
42
39
  })));
@@ -22,6 +22,14 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
22
22
  var ReactSelect__default = /*#__PURE__*/_interopDefault(ReactSelect);
23
23
  var Async__default = /*#__PURE__*/_interopDefault(Async);
24
24
 
25
+ // react-select defaults to showing "Select..." placeholder text, which goes against our a11y
26
+ // standards — use `label` for the field name and `description` for help text instead.
27
+ // `noPlaceholderText` overrides the default string; `NullPlaceholder` removes the empty DOM node
28
+ // that react-select still renders even when the text is empty.
29
+ var noPlaceholderText = '';
30
+ var NullPlaceholder = function () {
31
+ return null;
32
+ };
25
33
  /**
26
34
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896474/Select Guidance} |
27
35
  * {@link https://cultureamp.design/?path=/docs/components-select--docs Storybook}
@@ -38,8 +46,7 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
38
46
  description = _a.description,
39
47
  propsFullWidth = _a.fullWidth,
40
48
  propsClassName = _a.className,
41
- placeholder = _a.placeholder,
42
- props = tslib.__rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "placeholder"]);
49
+ props = tslib.__rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className"]);
43
50
  var reactId = React.useId();
44
51
  // the default for fullWidth depends on the variant
45
52
  var fullWidth = propsFullWidth !== null && propsFullWidth !== void 0 ? propsFullWidth : !['secondary', 'secondary-small'].includes(variant);
@@ -51,10 +58,10 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
51
58
  }, label) : null, React__default.default.createElement(ReactSelect__default.default, tslib.__assign({}, props, {
52
59
  ref: ref,
53
60
  "aria-labelledby": labelId,
54
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '',
61
+ placeholder: noPlaceholderText,
55
62
  components: {
56
63
  Control: Control,
57
- Placeholder: Placeholder,
64
+ Placeholder: NullPlaceholder,
58
65
  DropdownIndicator: DropdownIndicator,
59
66
  Menu: Menu,
60
67
  GroupHeading: GroupHeading,
@@ -79,14 +86,13 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
79
86
  Select.displayName = 'Select';
80
87
  var AsyncSelect = React__default.default.forwardRef(function (_a, ref) {
81
88
  var propsClassName = _a.className,
82
- placeholder = _a.placeholder,
83
- props = tslib.__rest(_a, ["className", "placeholder"]);
89
+ props = tslib.__rest(_a, ["className"]);
84
90
  return React__default.default.createElement(Async__default.default, tslib.__assign({}, props, {
85
91
  ref: ref,
86
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '',
92
+ placeholder: noPlaceholderText,
87
93
  components: {
88
94
  Control: Control,
89
- Placeholder: Placeholder,
95
+ Placeholder: NullPlaceholder,
90
96
  DropdownIndicator: DropdownIndicator,
91
97
  Menu: Menu,
92
98
  Option: Option,
@@ -111,13 +117,6 @@ var Control = function (props) {
111
117
  className: classnames__default.default(Select_module.control, props.isFocused && Select_module.focusedControl, props.isDisabled && Select_module.disabled)
112
118
  })));
113
119
  };
114
- var Placeholder = function (props) {
115
- return React__default.default.createElement(ReactSelect.components.Placeholder, tslib.__assign({}, props, {
116
- className: Select_module.placeholderOverrides
117
- }), React__default.default.createElement("span", {
118
- className: Select_module.placeholder
119
- }, props.children));
120
- };
121
120
  var DropdownIndicator = function (props) {
122
121
  return React__default.default.createElement(ReactSelect.components.DropdownIndicator, tslib.__assign({}, props, {
123
122
  className: Select_module.dropdownIndicator
@@ -13,7 +13,6 @@ var styles = {
13
13
  "valueContainer": "Select-module_valueContainer__MGkpr",
14
14
  "indicatorsContainer": "Select-module_indicatorsContainer__2xCsm",
15
15
  "loadingMessage": "Select-module_loadingMessage__4Ej9T",
16
- "placeholder": "Select-module_placeholder__OAeGA",
17
16
  "menu": "Select-module_menu__axmUL",
18
17
  "groupHeading": "Select-module_groupHeading__eNw6U",
19
18
  "option": "Select-module_option__EdP-F",
@@ -10,7 +10,7 @@ var FieldMessage = require('../FieldMessage/FieldMessage.cjs');
10
10
  var Popover = require('../MultiSelect/subcomponents/Popover/Popover.cjs');
11
11
  var reactDom = require('@floating-ui/react-dom');
12
12
  var SelectContext = require('./context/SelectContext.cjs');
13
- var ListBox = require('./subcomponents/ListBox/ListBox.cjs');
13
+ require('./subcomponents/ListBox/ListBox.cjs');
14
14
  var ListBoxSection = require('./subcomponents/ListBoxSection/ListBoxSection.cjs');
15
15
  var ListItem = require('./subcomponents/ListItem/ListItem.cjs');
16
16
  require('./subcomponents/ListItems/ListItems.cjs');
@@ -50,12 +50,10 @@ var SingleSelect = function (_a) {
50
50
  classNameOverride = _a.classNameOverride,
51
51
  selectedKey = _a.selectedKey,
52
52
  description = _a.description,
53
- _d = _a.placeholder,
54
- placeholder = _d === void 0 ? '' : _d,
55
53
  isDisabled = _a.isDisabled,
56
54
  onSelectionChange = _a.onSelectionChange,
57
55
  portalContainerId = _a.portalContainerId,
58
- restProps = tslib.__rest(_a, ["label", "items", "id", "trigger", "children", "status", "validationMessage", "isReversed", "isRequired", "isFullWidth", "classNameOverride", "selectedKey", "description", "placeholder", "isDisabled", "onSelectionChange", "portalContainerId"]);
56
+ restProps = tslib.__rest(_a, ["label", "items", "id", "trigger", "children", "status", "validationMessage", "isReversed", "isRequired", "isFullWidth", "classNameOverride", "selectedKey", "description", "isDisabled", "onSelectionChange", "portalContainerId"]);
59
57
  var refs = reactDom.useFloating().refs;
60
58
  var triggerRef = refs.reference;
61
59
  var fallbackId = React.useId();
@@ -71,7 +69,6 @@ var SingleSelect = function (_a) {
71
69
  disabledKeys: disabledKeys,
72
70
  selectedKey: typeof selectedKey === 'number' ? selectedKey.toString() : selectedKey,
73
71
  description: description,
74
- placeholder: placeholder,
75
72
  isDisabled: isDisabled,
76
73
  isRequired: isRequired,
77
74
  onSelectionChange: onSelectionChange ? function (key) {
@@ -79,13 +76,13 @@ var SingleSelect = function (_a) {
79
76
  } : undefined
80
77
  }, restProps);
81
78
  var state = select.useSelectState(ariaSelectProps);
82
- var _e = select$1.useSelect(ariaSelectProps, state, triggerRef),
83
- labelProps = _e.labelProps,
84
- reactAriaTriggerProps = _e.triggerProps,
85
- valueProps = _e.valueProps,
86
- menuProps = _e.menuProps,
87
- errorMessageProps = _e.errorMessageProps,
88
- descriptionProps = _e.descriptionProps;
79
+ var _d = select$1.useSelect(ariaSelectProps, state, triggerRef),
80
+ labelProps = _d.labelProps,
81
+ reactAriaTriggerProps = _d.triggerProps,
82
+ valueProps = _d.valueProps,
83
+ menuProps = _d.menuProps,
84
+ errorMessageProps = _d.errorMessageProps,
85
+ descriptionProps = _d.descriptionProps;
89
86
  // Hack incoming:
90
87
  // react-aria/useSelect wants to prefix the combobox's accessible name with the value of the select.
91
88
  // We use role=combobox, meaning screen readers will read the value.
@@ -102,7 +99,6 @@ var SingleSelect = function (_a) {
102
99
  'value': (_b = state === null || state === void 0 ? void 0 : state.selectedItem) === null || _b === void 0 ? void 0 : _b.rendered,
103
100
  valueProps: valueProps,
104
101
  'isOpen': state.isOpen,
105
- placeholder: placeholder,
106
102
  status: status,
107
103
  'isDisabled': triggerProps.isDisabled,
108
104
  isReversed: isReversed,
@@ -110,9 +106,9 @@ var SingleSelect = function (_a) {
110
106
  'aria-describedby': classnames__default.default(validationMessage && validationId, description && descriptionId),
111
107
  'aria-required': isRequired
112
108
  });
113
- var _f = React.useState(),
114
- portalContainer = _f[0],
115
- setPortalContainer = _f[1];
109
+ var _e = React.useState(),
110
+ portalContainer = _e[0],
111
+ setPortalContainer = _e[1];
116
112
  React.useEffect(function () {
117
113
  if (portalContainerId) {
118
114
  var portalElement = document.getElementById(portalContainerId);
@@ -153,7 +149,4 @@ SingleSelect.Section = ListBoxSection.ListBoxSection;
153
149
  SingleSelect.SectionDivider = SectionDivider.SectionDivider;
154
150
  SingleSelect.Option = Option.Option;
155
151
  SingleSelect.ItemDefaultRender = ListItem.ListItem;
156
- // @deprecated Legacy exported aliases
157
- SingleSelect.TriggerButton = SelectToggle.SelectToggle;
158
- SingleSelect.ListBox = ListBox.ListBox;
159
152
  exports.SingleSelect = SingleSelect;
@@ -19,13 +19,11 @@ var SelectToggle = React__default.default.forwardRef(function (_a, ref) {
19
19
  value = _a.value,
20
20
  valueProps = _a.valueProps,
21
21
  isOpen = _a.isOpen,
22
- _b = _a.placeholder,
23
- placeholder = _b === void 0 ? 'Select' : _b,
24
22
  status = _a.status,
25
23
  isDisabled = _a.isDisabled,
26
24
  isReversed = _a.isReversed,
27
25
  classNameOverride = _a.classNameOverride,
28
- restProps = tslib.__rest(_a, ["label", "labelProps", "value", "valueProps", "isOpen", "placeholder", "status", "isDisabled", "isReversed", "classNameOverride"]);
26
+ restProps = tslib.__rest(_a, ["label", "labelProps", "value", "valueProps", "isOpen", "status", "isDisabled", "isReversed", "classNameOverride"]);
29
27
  return React__default.default.createElement("div", null, React__default.default.createElement(Label.Label, tslib.__assign({}, labelProps, {
30
28
  reversed: isReversed,
31
29
  disabled: isDisabled
@@ -36,10 +34,10 @@ var SelectToggle = React__default.default.forwardRef(function (_a, ref) {
36
34
  role: "combobox"
37
35
  }, restProps, {
38
36
  ref: ref,
39
- className: classnames__default.default(SelectToggle_module.selectToggle, (value === null || value === undefined) && SelectToggle_module.placeholder, status === 'error' && SelectToggle_module.error, status === 'caution' && SelectToggle_module.caution, isDisabled && SelectToggle_module.disabled, isReversed && SelectToggle_module.reversed, classNameOverride)
37
+ className: classnames__default.default(SelectToggle_module.selectToggle, status === 'error' && SelectToggle_module.error, status === 'caution' && SelectToggle_module.caution, isDisabled && SelectToggle_module.disabled, isReversed && SelectToggle_module.reversed, classNameOverride)
40
38
  }), React__default.default.createElement("span", tslib.__assign({}, valueProps, {
41
39
  className: SelectToggle_module.value
42
- }), value !== null && value !== void 0 ? value : placeholder), React__default.default.createElement(Icon.Icon, {
40
+ }), value), React__default.default.createElement(Icon.Icon, {
43
41
  name: isOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
44
42
  isPresentational: true,
45
43
  className: SelectToggle_module.icon
@@ -3,7 +3,6 @@
3
3
  var styles = {
4
4
  "icon": "SelectToggle-module_icon__rsV9A",
5
5
  "selectToggle": "SelectToggle-module_selectToggle__e6slL",
6
- "placeholder": "SelectToggle-module_placeholder__w7o7S",
7
6
  "error": "SelectToggle-module_error__npEgr",
8
7
  "caution": "SelectToggle-module_caution__9jSK0",
9
8
  "disabled": "SelectToggle-module_disabled__2MKmF",
@@ -60,8 +60,7 @@ var TimeFieldComponent = function (_a) {
60
60
  onChange: handleOnChange,
61
61
  isDisabled: isDisabled,
62
62
  hideTimeZone: true,
63
- locale: locale,
64
- validationState: status === 'default' ? 'valid' : 'invalid'
63
+ locale: locale
65
64
  }));
66
65
  var hasError = !!validationMessage && status === 'error';
67
66
  var descriptionId = hasError ? "".concat(id, "-field-message") : undefined;
@@ -84,7 +83,7 @@ var TimeFieldComponent = function (_a) {
84
83
  }, React__default.default.createElement("div", tslib.__assign({}, fieldProps, {
85
84
  id: id,
86
85
  ref: inputRef,
87
- className: classnames__default.default(TimeField_module.input, state.isDisabled && TimeField_module.isDisabled, state.validationState === 'invalid' && TimeField_module.error)
86
+ className: classnames__default.default(TimeField_module.input, state.isDisabled && TimeField_module.isDisabled, status === 'error' && TimeField_module.error)
88
87
  }), state.segments.map(function (segment, i) {
89
88
  return React__default.default.createElement(TimeSegment.TimeSegment, {
90
89
  key: i,
@@ -26,10 +26,8 @@ const Button = /*#__PURE__*/function () {
26
26
  _f = _a.hasHiddenPendingLabel,
27
27
  propsHasHiddenPendingLabel = _f === void 0 ? false : _f,
28
28
  pendingLabel = _a.pendingLabel,
29
- isReversed = _a.isReversed,
30
- restProps = __rest(_a, ["variant", "size", "className", "children", "isDisabled", "isFullWidth", "icon", "iconPosition", "hasHiddenLabel", "isPending", "hasHiddenPendingLabel", "pendingLabel", "isReversed"]);
31
- var shouldUseReverse = useReversedColors();
32
- var isReversedVariant = isReversed !== null && isReversed !== void 0 ? isReversed : shouldUseReverse;
29
+ restProps = __rest(_a, ["variant", "size", "className", "children", "isDisabled", "isFullWidth", "icon", "iconPosition", "hasHiddenLabel", "isPending", "hasHiddenPendingLabel", "pendingLabel"]);
30
+ var isReversedVariant = useReversedColors();
33
31
  var pendingProps = isPending ? {
34
32
  isPending: isPending,
35
33
  hasHiddenPendingLabel: hasHiddenLabel || propsHasHiddenPendingLabel,
@@ -1,78 +1,34 @@
1
- import { __rest, __assign } from 'tslib';
2
- import React, { useState } from 'react';
1
+ import { __rest } from 'tslib';
2
+ import React from 'react';
3
3
  import classnames from 'classnames';
4
- import { Button } from '../ButtonV1/Button/Button.mjs';
5
- import '../ButtonV1/IconButton/IconButton.mjs';
6
4
  import { Heading } from '../Heading/Heading.mjs';
7
- import { Icon } from '../Icon/Icon.mjs';
8
5
  import { Text } from '../Text/Text.mjs';
9
- import { Tooltip } from '../TooltipV1/Tooltip.mjs';
10
6
  import { useMediaQueries } from '../utils/useMediaQueries.mjs';
11
7
  import styles from './GuidanceBlock.module.css.mjs';
12
- var WithTooltip = function (_a) {
13
- var tooltipProps = _a.tooltipProps,
14
- children = _a.children;
15
- return tooltipProps ? /*#__PURE__*/React.createElement(Tooltip, __assign({}, tooltipProps), children) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
16
- };
8
+
17
9
  /**
18
10
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093807/Guidance+Block Guidance} |
19
11
  * {@link https://cultureamp.design/?path=/docs/components-guidanceblock--docs Storybook}
20
12
  */
21
13
  const GuidanceBlock = /*#__PURE__*/function () {
22
14
  const GuidanceBlock = function (_a) {
23
- var _b, _c, _d, _e, _f;
24
- var _g = _a.layout,
25
- layout = _g === void 0 ? 'default' : _g,
26
- _h = _a.variant,
27
- variant = _h === void 0 ? 'default' : _h,
28
- _j = _a.withActionButtonArrow,
29
- withActionButtonArrow = _j === void 0 ? true : _j,
30
- _k = _a.noMaxWidth,
31
- noMaxWidth = _k === void 0 ? false : _k,
32
- _l = _a.illustrationType,
33
- illustrationType = _l === void 0 ? 'spot' : _l,
34
- _m = _a.smallScreenTextAlignment,
35
- smallScreenTextAlignment = _m === void 0 ? 'center' : _m,
36
- actions = _a.actions,
15
+ var _b, _c, _d, _e;
16
+ var _f = _a.layout,
17
+ layout = _f === void 0 ? 'default' : _f,
18
+ _g = _a.variant,
19
+ variant = _g === void 0 ? 'default' : _g,
20
+ _h = _a.noMaxWidth,
21
+ noMaxWidth = _h === void 0 ? false : _h,
22
+ _j = _a.illustrationType,
23
+ illustrationType = _j === void 0 ? 'spot' : _j,
24
+ _k = _a.smallScreenTextAlignment,
25
+ smallScreenTextAlignment = _k === void 0 ? 'center' : _k,
37
26
  illustration = _a.illustration,
38
- secondaryDismiss = _a.secondaryDismiss,
39
27
  actionsSlot = _a.actionsSlot,
40
- restProps = __rest(_a, ["layout", "variant", "withActionButtonArrow", "noMaxWidth", "illustrationType", "smallScreenTextAlignment", "actions", "illustration", "secondaryDismiss", "actionsSlot"]);
41
- var _o = useState(false),
42
- hidden = _o[0],
43
- setHidden = _o[1];
44
- var _p = useState(false),
45
- removed = _p[0],
46
- setRemoved = _p[1];
28
+ restProps = __rest(_a, ["layout", "variant", "noMaxWidth", "illustrationType", "smallScreenTextAlignment", "illustration", "actionsSlot"]);
47
29
  var queries = useMediaQueries().queries;
48
- var containerRef = /*#__PURE__*/React.createRef();
49
- var handleDismissBanner = function () {
50
- var _a;
51
- setHidden(true);
52
- (_a = actions === null || actions === void 0 ? void 0 : actions.dismiss) === null || _a === void 0 ? void 0 : _a.onClick();
53
- };
54
- var onTransitionEnd = function (e) {
55
- // Be careful: this assumes the final CSS property to be animated is "margin-top".
56
- if (hidden && e.propertyName === 'margin-top') {
57
- setRemoved(true);
58
- }
59
- };
60
- var marginTop = function () {
61
- if (hidden && containerRef.current) {
62
- return -containerRef.current.clientHeight + 'px';
63
- }
64
- return '0';
65
- };
66
- if (removed) {
67
- return /*#__PURE__*/React.createElement(React.Fragment, null);
68
- }
69
30
  return /*#__PURE__*/React.createElement("div", {
70
- className: classnames(styles.banner, variant && styles[variant], layout && styles[layout], hidden && styles.hidden, queries.isSmall && styles.centerContent, noMaxWidth && styles.noMaxWidth, illustrationType === 'scene' && styles.hasSceneIllustration, smallScreenTextAlignment === 'left' && styles.smallScreenTextAlignment),
71
- style: {
72
- marginTop: marginTop()
73
- },
74
- ref: containerRef,
75
- onTransitionEnd: onTransitionEnd
31
+ className: classnames(styles.banner, variant && styles[variant], layout && styles[layout], queries.isSmall && styles.centerContent, noMaxWidth && styles.noMaxWidth, illustrationType === 'scene' && styles.hasSceneIllustration, smallScreenTextAlignment === 'left' && styles.smallScreenTextAlignment)
76
32
  }, /*#__PURE__*/React.createElement("div", {
77
33
  className: styles.illustrationWrapper
78
34
  }, /*#__PURE__*/React.createElement("div", {
@@ -91,31 +47,9 @@ const GuidanceBlock = /*#__PURE__*/function () {
91
47
  }, (_d = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _d === void 0 ? void 0 : _d.title)), /*#__PURE__*/React.createElement(Text, {
92
48
  tag: "p",
93
49
  variant: "body"
94
- }, (_e = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _e === void 0 ? void 0 : _e.description)))), (actions === null || actions === void 0 ? void 0 : actions.primary) || actionsSlot ? (/*#__PURE__*/React.createElement("div", {
50
+ }, (_e = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _e === void 0 ? void 0 : _e.description)))), actionsSlot && /*#__PURE__*/React.createElement("div", {
95
51
  className: styles.buttonContainer
96
- }, (actions === null || actions === void 0 ? void 0 : actions.primary) && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WithTooltip, {
97
- tooltipProps: actions.primary.tooltip
98
- }, /*#__PURE__*/React.createElement(Button, __assign({
99
- icon: withActionButtonArrow ? (/*#__PURE__*/React.createElement(Icon, {
100
- name: "arrow_forward",
101
- isPresentational: true,
102
- shouldMirrorInRTL: true
103
- })) : undefined,
104
- iconPosition: "end"
105
- }, actions.primary, {
106
- fullWidth: queries.isSmall
107
- }))), (actions === null || actions === void 0 ? void 0 : actions.secondary) && (/*#__PURE__*/React.createElement(WithTooltip, {
108
- tooltipProps: actions.secondary.tooltip
109
- }, /*#__PURE__*/React.createElement("div", {
110
- className: styles.secondaryAction
111
- }, /*#__PURE__*/React.createElement(Button, __assign({
112
- secondary: true
113
- }, actions.secondary, {
114
- onClick: secondaryDismiss ? function () {
115
- return handleDismissBanner();
116
- } : (_f = actions === null || actions === void 0 ? void 0 : actions.secondary) === null || _f === void 0 ? void 0 : _f.onClick,
117
- fullWidth: queries.isSmall
118
- }))))))), !actions && actionsSlot && actionsSlot)) : null));
52
+ }, actionsSlot)));
119
53
  };
120
54
  GuidanceBlock.displayName = 'GuidanceBlock';
121
55
  return GuidanceBlock;
@@ -7,7 +7,6 @@ var styles = {
7
7
  "descriptionContainer": "GuidanceBlock-module_descriptionContainer__w1-P-",
8
8
  "descriptionAndActions": "GuidanceBlock-module_descriptionAndActions__aQhc9",
9
9
  "buttonContainer": "GuidanceBlock-module_buttonContainer__bcVmB",
10
- "hidden": "GuidanceBlock-module_hidden__mwvrs",
11
10
  "headingWrapper": "GuidanceBlock-module_headingWrapper__OfZB5",
12
11
  "default": "GuidanceBlock-module_default__7naG4",
13
12
  "positive": "GuidanceBlock-module_positive__iCp-1",
@@ -30,10 +30,8 @@ const LinkButton = /*#__PURE__*/function () {
30
30
  isFullWidth = _f === void 0 ? false : _f,
31
31
  isDisabled = _a.isDisabled,
32
32
  className = _a.className,
33
- isReversed = _a.isReversed,
34
- otherProps = __rest(_a, ["children", "variant", "size", "icon", "iconPosition", "hasHiddenLabel", "isFullWidth", "isDisabled", "className", "isReversed"]);
35
- var shouldUseReverse = useReversedColors();
36
- var isReversedVariant = isReversed !== null && isReversed !== void 0 ? isReversed : shouldUseReverse;
33
+ otherProps = __rest(_a, ["children", "variant", "size", "icon", "iconPosition", "hasHiddenLabel", "isFullWidth", "isDisabled", "className"]);
34
+ var isReversedVariant = useReversedColors();
37
35
  return /*#__PURE__*/React.createElement(Link, __assign({
38
36
  ref: ref,
39
37
  className: mergeClassNames(styles.linkButton, buttonStyles.button, buttonStyles[size], hasHiddenLabel && buttonStyles["".concat(size, "IconButton")], isDisabled && buttonStyles.isDisabled, isReversedVariant ? buttonStyles["".concat(variant, "Reversed")] : buttonStyles[variant], isFullWidth && buttonStyles.fullWidth, className),