@kaizen/components 0.0.0-canary-workflow-export-20240910075656 → 0.0.0-canary-remove-type-module-20241002054901

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 (49) hide show
  1. package/dist/cjs/Brand/Brand.cjs +7 -5
  2. package/dist/cjs/Notification/InlineNotification/InlineNotification.cjs +4 -3
  3. package/dist/cjs/Notification/ToastNotification/context/ToastNotificationContext.cjs +5 -6
  4. package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.cjs +5 -3
  5. package/dist/cjs/Tile/MultiActionTile/MultiActionTile.cjs +3 -6
  6. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +9 -14
  7. package/dist/cjs/__future__/Select/subcomponents/Option/Option.cjs +18 -6
  8. package/dist/cjs/utils/useMediaQueries.cjs +5 -3
  9. package/dist/esm/Brand/Brand.mjs +6 -5
  10. package/dist/esm/Notification/InlineNotification/InlineNotification.mjs +5 -4
  11. package/dist/esm/Notification/ToastNotification/context/ToastNotificationContext.mjs +5 -6
  12. package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.mjs +6 -4
  13. package/dist/esm/Tile/MultiActionTile/MultiActionTile.mjs +3 -6
  14. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +9 -14
  15. package/dist/esm/__future__/Select/subcomponents/Option/Option.mjs +16 -4
  16. package/dist/esm/utils/useMediaQueries.mjs +5 -3
  17. package/dist/styles.css +74 -71
  18. package/dist/types/GuidanceBlock/GuidanceBlock.d.ts +3 -0
  19. package/dist/types/Notification/InlineNotification/InlineNotification.d.ts +4 -7
  20. package/dist/types/Notification/subcomponents/GenericNotification/GenericNotification.d.ts +1 -4
  21. package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +1 -11
  22. package/dist/types/ToggleSwitch/ToggleSwitch/ToggleSwitch.d.ts +1 -1
  23. package/package.json +17 -18
  24. package/src/Brand/Brand.tsx +5 -3
  25. package/src/GuidanceBlock/GuidanceBlock.tsx +3 -0
  26. package/src/Notification/InlineNotification/InlineNotification.tsx +28 -18
  27. package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +18 -0
  28. package/src/Notification/ToastNotification/context/ToastNotificationContext.tsx +1 -6
  29. package/src/Notification/subcomponents/GenericNotification/GenericNotification.stories.tsx +44 -1
  30. package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +93 -72
  31. package/src/Notification/subcomponents/GenericNotification/_mixins.scss +5 -0
  32. package/src/Tile/MultiActionTile/MultiActionTile.tsx +3 -3
  33. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -31
  34. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +3 -1
  35. package/src/Workflow/_docs/ProgressStepper.stories.tsx +1 -1
  36. package/src/Workflow/_docs/Workflow.stories.tsx +1 -1
  37. package/src/Workflow/_docs/WorkflowFooter.stories.tsx +1 -1
  38. package/src/Workflow/_docs/WorkflowHeader.stories.tsx +1 -1
  39. package/src/Workflow/subcomponents/Header/components/Branding/Branding.module.css +3 -4
  40. package/src/__future__/Select/_docs/Select.stories.tsx +47 -0
  41. package/src/__future__/Select/subcomponents/Option/Option.tsx +15 -4
  42. package/src/utils/useMediaQueries.tsx +5 -3
  43. package/dist/cjs/Tile/subcomponents/GenericTile/Action.cjs +0 -34
  44. package/dist/esm/Tile/subcomponents/GenericTile/Action.mjs +0 -26
  45. package/dist/types/Tile/subcomponents/GenericTile/Action.d.ts +0 -8
  46. package/dist/types/__layout__/Workflow/v2/subcomponents/Footer/components/ProgressStepper/ProgressStepper.d.ts +0 -16
  47. package/src/Tile/subcomponents/GenericTile/Action.tsx +0 -41
  48. package/src/__layout__/Workflow/v2/subcomponents/Footer/components/ProgressStepper/ProgressStepper.module.scss +0 -111
  49. package/src/__layout__/Workflow/v2/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx +0 -143
@@ -2,6 +2,7 @@
2
2
 
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
+ var classnames = require('classnames');
5
6
  var hostedAssets = require('../utils/hostedAssets.cjs');
6
7
  var BrandCollectiveIntelligence = require('./BrandCollectiveIntelligence/BrandCollectiveIntelligence.cjs');
7
8
  var Brand_module = require('./Brand.module.scss.cjs');
@@ -11,6 +12,7 @@ function _interopDefault(e) {
11
12
  };
12
13
  }
13
14
  var React__default = /*#__PURE__*/_interopDefault(React);
15
+ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
14
16
  var isSVG = function (variant, restProps) {
15
17
  return variant === "collective-intelligence";
16
18
  };
@@ -42,11 +44,10 @@ var Brand = function (_a) {
42
44
  }
43
45
  var alt = restProps.alt,
44
46
  classNameOverride = restProps.classNameOverride,
45
- otherProps = tslib.__rest(restProps, ["alt", "classNameOverride"]);
47
+ style = restProps.style,
48
+ otherProps = tslib.__rest(restProps, ["alt", "classNameOverride", "style"]);
46
49
  var brandTheme = reversed ? "-reversed" : "-default";
47
- return React__default.default.createElement("picture", tslib.__assign({
48
- className: classNameOverride
49
- }, otherProps), React__default.default.createElement("source", {
50
+ return React__default.default.createElement("picture", tslib.__assign({}, otherProps), React__default.default.createElement("source", {
50
51
  srcSet: hostedAssets.assetUrl("brand/".concat(variant, "-reversed.svg")),
51
52
  media: "(forced-colors: active) and (prefers-color-scheme: dark)"
52
53
  }), React__default.default.createElement("source", {
@@ -55,7 +56,8 @@ var Brand = function (_a) {
55
56
  }), React__default.default.createElement("img", {
56
57
  src: hostedAssets.assetUrl("brand/".concat(variant).concat(brandTheme, ".svg")),
57
58
  alt: alt,
58
- className: Brand_module.img
59
+ className: classnames__default.default(Brand_module.img, classNameOverride),
60
+ style: style
59
61
  }));
60
62
  };
61
63
  Brand.displayName = "Brand";
@@ -17,7 +17,7 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
17
17
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093392/Inline+Notification Guidance} |
18
18
  * {@link https://cultureamp.design/storybook/?path=/docs/components-notifications-inline-notification--docs Storybook}
19
19
  */
20
- var InlineNotification = function (_a) {
20
+ var InlineNotification = React.forwardRef(function (_a, ref) {
21
21
  var isSubtle = _a.isSubtle,
22
22
  _b = _a.hideCloseIcon,
23
23
  hideCloseIcon = _b === void 0 ? false : _b,
@@ -28,8 +28,9 @@ var InlineNotification = function (_a) {
28
28
  return React__default.default.createElement(GenericNotification.GenericNotification, tslib.__assign({
29
29
  style: "inline",
30
30
  persistent: persistent || hideCloseIcon,
31
- classNameOverride: classnames__default.default(classNameOverride, [isSubtle && GenericNotification_module.subtle])
31
+ classNameOverride: classnames__default.default(classNameOverride, [isSubtle && GenericNotification_module.subtle]),
32
+ ref: ref
32
33
  }, otherProps));
33
- };
34
+ });
34
35
  InlineNotification.displayName = "InlineNotification";
35
36
  exports.InlineNotification = InlineNotification;
@@ -45,13 +45,12 @@ var ToastNotificationProvider = function (_a) {
45
45
  setNotifications(copy);
46
46
  };
47
47
  var removeToastNotification = function (notificationID) {
48
- var notificationIndex = notifications.findIndex(function (_a) {
49
- var id = _a.id;
50
- return id === notificationID;
48
+ setNotifications(function (prev) {
49
+ return prev.filter(function (_a) {
50
+ var id = _a.id;
51
+ return id !== notificationID;
52
+ });
51
53
  });
52
- var copy = notifications.slice();
53
- copy.splice(notificationIndex, 1); // Mutation
54
- setNotifications(copy);
55
54
  };
56
55
  var clearToastNotifications = function () {
57
56
  setNotifications([]);
@@ -3,6 +3,7 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var classnames = require('classnames');
6
+ var isRefObject = require('../../../utils/isRefObject.cjs');
6
7
  var CancelButton = require('../CancelButton/CancelButton.cjs');
7
8
  var NotificationHeading = require('../NotificationHeading/NotificationHeading.cjs');
8
9
  var NotificationIcon = require('../NotificationIcon/NotificationIcon.cjs');
@@ -14,7 +15,7 @@ function _interopDefault(e) {
14
15
  }
15
16
  var React__default = /*#__PURE__*/_interopDefault(React);
16
17
  var classnames__default = /*#__PURE__*/_interopDefault(classnames);
17
- var GenericNotification = function (_a) {
18
+ var GenericNotification = React.forwardRef(function (_a, ref) {
18
19
  var type = _a.type,
19
20
  variant = _a.variant,
20
21
  style = _a.style,
@@ -34,7 +35,8 @@ var GenericNotification = function (_a) {
34
35
  var _d = React.useState(false),
35
36
  isRemoved = _d[0],
36
37
  setIsRemoved = _d[1];
37
- var containerRef = React.useRef(null);
38
+ var fallbackRef = React.useRef(null);
39
+ var containerRef = isRefObject.isRefObject(ref) ? ref : fallbackRef;
38
40
  React.useEffect(function () {
39
41
  requestAnimationFrame(function () {
40
42
  if (containerRef.current) {
@@ -83,6 +85,6 @@ var GenericNotification = function (_a) {
83
85
  return setIsHidden(true);
84
86
  }
85
87
  }));
86
- };
88
+ });
87
89
  GenericNotification.displayName = "GenericNotification";
88
90
  exports.GenericNotification = GenericNotification;
@@ -3,8 +3,8 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var GenericTile = require('../subcomponents/GenericTile/GenericTile.cjs');
6
- var Action = require('../subcomponents/GenericTile/Action.cjs');
7
6
  var MultiActionTile_module = require('./MultiActionTile.module.scss.cjs');
7
+ var Button = require('../../__actions__/Button/v1/Button/Button.cjs');
8
8
  function _interopDefault(e) {
9
9
  return e && e.__esModule ? e : {
10
10
  default: e
@@ -16,12 +16,9 @@ var renderActions = function (primaryAction, secondaryAction) {
16
16
  className: MultiActionTile_module.actions
17
17
  }, secondaryAction && React__default.default.createElement("div", {
18
18
  className: MultiActionTile_module.secondaryAction
19
- }, React__default.default.createElement(Action, {
20
- action: secondaryAction,
19
+ }, React__default.default.createElement(Button.Button, tslib.__assign({
21
20
  secondary: true
22
- })), React__default.default.createElement(Action, {
23
- action: primaryAction
24
- }));
21
+ }, secondaryAction))), React__default.default.createElement(Button.Button, tslib.__assign({}, primaryAction)));
25
22
  };
26
23
  /**
27
24
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#MultiActionTile.1 Guidance} |
@@ -8,9 +8,9 @@ require('../../../Icon/subcomponents/SVG/SVG.cjs');
8
8
  var ArrowBackwardIcon = require('../../../Icon/ArrowBackwardIcon.cjs');
9
9
  var InformationIcon = require('../../../Icon/InformationIcon.cjs');
10
10
  var Text = require('../../../Text/Text.cjs');
11
- var Action = require('./Action.cjs');
12
11
  var GenericTile_module = require('./GenericTile.module.scss.cjs');
13
12
  var IconButton = require('../../../__actions__/Button/v1/IconButton/IconButton.cjs');
13
+ var Button = require('../../../__actions__/Button/v1/Button/Button.cjs');
14
14
  function _interopDefault(e) {
15
15
  return e && e.__esModule ? e : {
16
16
  default: e
@@ -47,18 +47,6 @@ var GenericTile = function (_a) {
47
47
  color: "dark-reduced-opacity"
48
48
  }, metadata)));
49
49
  };
50
- var renderActions = function (primaryAction, secondaryAction, disabled) {
51
- return React__default.default.createElement("div", {
52
- className: GenericTile_module.actions
53
- }, secondaryAction && React__default.default.createElement(Action, {
54
- action: secondaryAction,
55
- secondary: true,
56
- disabled: disabled
57
- }), primaryAction && React__default.default.createElement(Action, {
58
- action: primaryAction,
59
- disabled: disabled
60
- }));
61
- };
62
50
  var renderFront = function () {
63
51
  return React__default.default.createElement("div", {
64
52
  className: classnames__default.default(GenericTile_module.face, GenericTile_module.faceFront, mood ? GenericTile_module[mood] : GenericTile_module[variant])
@@ -86,7 +74,14 @@ var GenericTile = function (_a) {
86
74
  variant: "body"
87
75
  }, informationProp.text), (informationProp.primaryAction || informationProp.secondaryAction) && React__default.default.createElement("div", {
88
76
  className: GenericTile_module.footer
89
- }, renderActions(informationProp.primaryAction, informationProp.secondaryAction, !isFlipped)));
77
+ }, React__default.default.createElement("div", {
78
+ className: GenericTile_module.actions
79
+ }, informationProp.secondaryAction && React__default.default.createElement(Button.Button, tslib.__assign({
80
+ secondary: true,
81
+ disabled: !isFlipped
82
+ }, informationProp.secondaryAction)), informationProp.primaryAction && React__default.default.createElement(Button.Button, tslib.__assign({
83
+ disabled: !isFlipped
84
+ }, informationProp.primaryAction)))));
90
85
  }
91
86
  return informationProp;
92
87
  };
@@ -2,10 +2,8 @@
2
2
 
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
- var focus = require('@react-aria/focus');
6
- var listbox = require('@react-aria/listbox');
7
- var utils = require('@react-aria/utils');
8
5
  var classnames = require('classnames');
6
+ var reactAria = require('react-aria');
9
7
  require('../../../../Icon/subcomponents/SVG/SVG.cjs');
10
8
  var CheckIcon = require('../../../../Icon/CheckIcon.cjs');
11
9
  var SelectContext = require('../../context/SelectContext.cjs');
@@ -23,16 +21,30 @@ var Option = function (_a) {
23
21
  props = tslib.__rest(_a, ["item", "classNameOverride"]);
24
22
  var state = SelectContext.useSelectContext().state;
25
23
  var ref = React__default.default.useRef(null);
26
- var _b = listbox.useOption({
24
+ var _b = reactAria.useOption({
27
25
  key: item.key
28
26
  }, state, ref),
29
27
  optionProps = _b.optionProps,
30
28
  isSelected = _b.isSelected,
31
29
  isDisabled = _b.isDisabled;
32
- var _c = focus.useFocusRing(),
30
+ var onPointerUp = optionProps.onPointerUp,
31
+ restOptionProps = tslib.__rest(optionProps, ["onPointerUp"]);
32
+ var _c = reactAria.useFocusRing(),
33
33
  isFocusVisible = _c.isFocusVisible,
34
34
  focusProps = _c.focusProps;
35
- return React__default.default.createElement("li", tslib.__assign({}, utils.mergeProps(optionProps, focusProps, props), {
35
+ return React__default.default.createElement("li", tslib.__assign({}, reactAria.mergeProps(restOptionProps, focusProps, props, {
36
+ onPointerUp: function (e) {
37
+ if (e.pointerType === "touch") {
38
+ // On touch devices, the listbox closes too quickly so below elements will trigger their pointer events.
39
+ // Slow it down a bit to prevent the appearance of propagation.
40
+ setTimeout(function () {
41
+ return state.setSelectedKey(item.key);
42
+ }, 250);
43
+ } else {
44
+ onPointerUp === null || onPointerUp === void 0 ? void 0 : onPointerUp(e);
45
+ }
46
+ }
47
+ }), {
36
48
  ref: ref,
37
49
  className: classnames__default.default(Option_module.option, isSelected && Option_module.isSelected, isFocusVisible && Option_module.isFocusVisible, isDisabled && Option_module.disabled, classNameOverride),
38
50
  "aria-label": item.textValue
@@ -78,7 +78,7 @@ var useMediaQueries = function (propQueries) {
78
78
  kaizenMatches = _a[0],
79
79
  setKaizenMatches = _a[1];
80
80
  // ---------------------------------------
81
- // Create an event listener based on the medium breakpoint and update state whenever it changes
81
+ // Create an event listener based on the small and large breakpoints and update state whenever one of those changes
82
82
  // ---------------------------------------
83
83
  React.useEffect(function () {
84
84
  if (isLegacyEdge || isUnsupportedSafari) {
@@ -96,9 +96,11 @@ var useMediaQueries = function (propQueries) {
96
96
  isMediumOrLarger: !isSmallAfterUpdate
97
97
  });
98
98
  };
99
- mediumMatchMedia.addEventListener("change", updateMatches, true);
99
+ smallMatchMedia.addEventListener("change", updateMatches, true);
100
+ largeMatchMedia.addEventListener("change", updateMatches, true);
100
101
  return function () {
101
- mediumMatchMedia.removeEventListener("change", updateMatches);
102
+ smallMatchMedia.removeEventListener("change", updateMatches);
103
+ largeMatchMedia.removeEventListener("change", updateMatches);
102
104
  };
103
105
  }, []);
104
106
  // ---------------------------------------
@@ -1,5 +1,6 @@
1
1
  import { __rest, __assign } from 'tslib';
2
2
  import React from 'react';
3
+ import classnames from 'classnames';
3
4
  import { assetUrl } from '../utils/hostedAssets.mjs';
4
5
  import { BrandCollectiveIntelligence } from './BrandCollectiveIntelligence/BrandCollectiveIntelligence.mjs';
5
6
  import styles from './Brand.module.scss.mjs';
@@ -35,11 +36,10 @@ const Brand = /*#__PURE__*/function () {
35
36
  }
36
37
  var alt = restProps.alt,
37
38
  classNameOverride = restProps.classNameOverride,
38
- otherProps = __rest(restProps, ["alt", "classNameOverride"]);
39
+ style = restProps.style,
40
+ otherProps = __rest(restProps, ["alt", "classNameOverride", "style"]);
39
41
  var brandTheme = reversed ? "-reversed" : "-default";
40
- return /*#__PURE__*/React.createElement("picture", __assign({
41
- className: classNameOverride
42
- }, otherProps), /*#__PURE__*/React.createElement("source", {
42
+ return /*#__PURE__*/React.createElement("picture", __assign({}, otherProps), /*#__PURE__*/React.createElement("source", {
43
43
  srcSet: assetUrl("brand/".concat(variant, "-reversed.svg")),
44
44
  media: "(forced-colors: active) and (prefers-color-scheme: dark)"
45
45
  }), /*#__PURE__*/React.createElement("source", {
@@ -48,7 +48,8 @@ const Brand = /*#__PURE__*/function () {
48
48
  }), /*#__PURE__*/React.createElement("img", {
49
49
  src: assetUrl("brand/".concat(variant).concat(brandTheme, ".svg")),
50
50
  alt: alt,
51
- className: styles.img
51
+ className: classnames(styles.img, classNameOverride),
52
+ style: style
52
53
  }));
53
54
  };
54
55
  Brand.displayName = "Brand";
@@ -1,5 +1,5 @@
1
1
  import { __rest, __assign } from 'tslib';
2
- import React from 'react';
2
+ import React, { forwardRef } from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { GenericNotification } from '../subcomponents/GenericNotification/GenericNotification.mjs';
5
5
  import styles from '../subcomponents/GenericNotification/GenericNotification.module.scss.mjs';
@@ -9,7 +9,7 @@ import styles from '../subcomponents/GenericNotification/GenericNotification.mod
9
9
  * {@link https://cultureamp.design/storybook/?path=/docs/components-notifications-inline-notification--docs Storybook}
10
10
  */
11
11
  const InlineNotification = /*#__PURE__*/function () {
12
- const InlineNotification = function (_a) {
12
+ const InlineNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
13
13
  var isSubtle = _a.isSubtle,
14
14
  _b = _a.hideCloseIcon,
15
15
  hideCloseIcon = _b === void 0 ? false : _b,
@@ -20,9 +20,10 @@ const InlineNotification = /*#__PURE__*/function () {
20
20
  return /*#__PURE__*/React.createElement(GenericNotification, __assign({
21
21
  style: "inline",
22
22
  persistent: persistent || hideCloseIcon,
23
- classNameOverride: classnames(classNameOverride, [isSubtle && styles.subtle])
23
+ classNameOverride: classnames(classNameOverride, [isSubtle && styles.subtle]),
24
+ ref: ref
24
25
  }, otherProps));
25
- };
26
+ });
26
27
  InlineNotification.displayName = "InlineNotification";
27
28
  return InlineNotification;
28
29
  }();
@@ -38,13 +38,12 @@ const ToastNotificationProvider = /*#__PURE__*/function () {
38
38
  setNotifications(copy);
39
39
  };
40
40
  var removeToastNotification = function (notificationID) {
41
- var notificationIndex = notifications.findIndex(function (_a) {
42
- var id = _a.id;
43
- return id === notificationID;
41
+ setNotifications(function (prev) {
42
+ return prev.filter(function (_a) {
43
+ var id = _a.id;
44
+ return id !== notificationID;
45
+ });
44
46
  });
45
- var copy = notifications.slice();
46
- copy.splice(notificationIndex, 1); // Mutation
47
- setNotifications(copy);
48
47
  };
49
48
  var clearToastNotifications = function () {
50
49
  setNotifications([]);
@@ -1,12 +1,13 @@
1
1
  import { __rest, __assign } from 'tslib';
2
- import React, { useState, useRef, useEffect } from 'react';
2
+ import React, { forwardRef, useState, useRef, useEffect } from 'react';
3
3
  import classnames from 'classnames';
4
+ import { isRefObject } from '../../../utils/isRefObject.mjs';
4
5
  import { CancelButton } from '../CancelButton/CancelButton.mjs';
5
6
  import { NotificationHeading } from '../NotificationHeading/NotificationHeading.mjs';
6
7
  import { NotificationIconType, NotificationIconVariant } from '../NotificationIcon/NotificationIcon.mjs';
7
8
  import styles from './GenericNotification.module.scss.mjs';
8
9
  const GenericNotification = /*#__PURE__*/function () {
9
- const GenericNotification = function (_a) {
10
+ const GenericNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
10
11
  var type = _a.type,
11
12
  variant = _a.variant,
12
13
  style = _a.style,
@@ -26,7 +27,8 @@ const GenericNotification = /*#__PURE__*/function () {
26
27
  var _d = useState(false),
27
28
  isRemoved = _d[0],
28
29
  setIsRemoved = _d[1];
29
- var containerRef = useRef(null);
30
+ var fallbackRef = useRef(null);
31
+ var containerRef = isRefObject(ref) ? ref : fallbackRef;
30
32
  useEffect(function () {
31
33
  requestAnimationFrame(function () {
32
34
  if (containerRef.current) {
@@ -75,7 +77,7 @@ const GenericNotification = /*#__PURE__*/function () {
75
77
  return setIsHidden(true);
76
78
  }
77
79
  }));
78
- };
80
+ });
79
81
  GenericNotification.displayName = "GenericNotification";
80
82
  return GenericNotification;
81
83
  }();
@@ -1,19 +1,16 @@
1
1
  import { __rest, __assign } from 'tslib';
2
2
  import React from 'react';
3
3
  import { GenericTile } from '../subcomponents/GenericTile/GenericTile.mjs';
4
- import Action from '../subcomponents/GenericTile/Action.mjs';
5
4
  import styles from './MultiActionTile.module.scss.mjs';
5
+ import { Button } from '../../__actions__/Button/v1/Button/Button.mjs';
6
6
  var renderActions = function (primaryAction, secondaryAction) {
7
7
  return /*#__PURE__*/React.createElement("div", {
8
8
  className: styles.actions
9
9
  }, secondaryAction && ( /*#__PURE__*/React.createElement("div", {
10
10
  className: styles.secondaryAction
11
- }, /*#__PURE__*/React.createElement(Action, {
12
- action: secondaryAction,
11
+ }, /*#__PURE__*/React.createElement(Button, __assign({
13
12
  secondary: true
14
- }))), /*#__PURE__*/React.createElement(Action, {
15
- action: primaryAction
16
- }));
13
+ }, secondaryAction)))), /*#__PURE__*/React.createElement(Button, __assign({}, primaryAction)));
17
14
  };
18
15
  /**
19
16
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#MultiActionTile.1 Guidance} |
@@ -6,9 +6,9 @@ import '../../../Icon/subcomponents/SVG/SVG.mjs';
6
6
  import { ArrowBackwardIcon } from '../../../Icon/ArrowBackwardIcon.mjs';
7
7
  import { InformationIcon } from '../../../Icon/InformationIcon.mjs';
8
8
  import { Text } from '../../../Text/Text.mjs';
9
- import Action from './Action.mjs';
10
9
  import styles from './GenericTile.module.scss.mjs';
11
10
  import { IconButton } from '../../../__actions__/Button/v1/IconButton/IconButton.mjs';
11
+ import { Button } from '../../../__actions__/Button/v1/Button/Button.mjs';
12
12
  const GenericTile = /*#__PURE__*/function () {
13
13
  const GenericTile = function (_a) {
14
14
  var children = _a.children,
@@ -39,18 +39,6 @@ const GenericTile = /*#__PURE__*/function () {
39
39
  color: "dark-reduced-opacity"
40
40
  }, metadata))));
41
41
  };
42
- var renderActions = function (primaryAction, secondaryAction, disabled) {
43
- return /*#__PURE__*/React.createElement("div", {
44
- className: styles.actions
45
- }, secondaryAction && ( /*#__PURE__*/React.createElement(Action, {
46
- action: secondaryAction,
47
- secondary: true,
48
- disabled: disabled
49
- })), primaryAction && /*#__PURE__*/React.createElement(Action, {
50
- action: primaryAction,
51
- disabled: disabled
52
- }));
53
- };
54
42
  var renderFront = function () {
55
43
  return /*#__PURE__*/React.createElement("div", {
56
44
  className: classnames(styles.face, styles.faceFront, mood ? styles[mood] : styles[variant])
@@ -78,7 +66,14 @@ const GenericTile = /*#__PURE__*/function () {
78
66
  variant: "body"
79
67
  }, informationProp.text), (informationProp.primaryAction || informationProp.secondaryAction) && ( /*#__PURE__*/React.createElement("div", {
80
68
  className: styles.footer
81
- }, renderActions(informationProp.primaryAction, informationProp.secondaryAction, !isFlipped))));
69
+ }, /*#__PURE__*/React.createElement("div", {
70
+ className: styles.actions
71
+ }, informationProp.secondaryAction && ( /*#__PURE__*/React.createElement(Button, __assign({
72
+ secondary: true,
73
+ disabled: !isFlipped
74
+ }, informationProp.secondaryAction))), informationProp.primaryAction && ( /*#__PURE__*/React.createElement(Button, __assign({
75
+ disabled: !isFlipped
76
+ }, informationProp.primaryAction)))))));
82
77
  }
83
78
  return informationProp;
84
79
  };
@@ -1,9 +1,7 @@
1
1
  import { __rest, __assign } from 'tslib';
2
2
  import React from 'react';
3
- import { useFocusRing } from '@react-aria/focus';
4
- import { useOption } from '@react-aria/listbox';
5
- import { mergeProps } from '@react-aria/utils';
6
3
  import classnames from 'classnames';
4
+ import { useOption, useFocusRing, mergeProps } from 'react-aria';
7
5
  import '../../../../Icon/subcomponents/SVG/SVG.mjs';
8
6
  import { CheckIcon } from '../../../../Icon/CheckIcon.mjs';
9
7
  import { useSelectContext } from '../../context/SelectContext.mjs';
@@ -21,10 +19,24 @@ const Option = /*#__PURE__*/function () {
21
19
  optionProps = _b.optionProps,
22
20
  isSelected = _b.isSelected,
23
21
  isDisabled = _b.isDisabled;
22
+ var onPointerUp = optionProps.onPointerUp,
23
+ restOptionProps = __rest(optionProps, ["onPointerUp"]);
24
24
  var _c = useFocusRing(),
25
25
  isFocusVisible = _c.isFocusVisible,
26
26
  focusProps = _c.focusProps;
27
- return /*#__PURE__*/React.createElement("li", __assign({}, mergeProps(optionProps, focusProps, props), {
27
+ return /*#__PURE__*/React.createElement("li", __assign({}, mergeProps(restOptionProps, focusProps, props, {
28
+ onPointerUp: function (e) {
29
+ if (e.pointerType === "touch") {
30
+ // On touch devices, the listbox closes too quickly so below elements will trigger their pointer events.
31
+ // Slow it down a bit to prevent the appearance of propagation.
32
+ setTimeout(function () {
33
+ return state.setSelectedKey(item.key);
34
+ }, 250);
35
+ } else {
36
+ onPointerUp === null || onPointerUp === void 0 ? void 0 : onPointerUp(e);
37
+ }
38
+ }
39
+ }), {
28
40
  ref: ref,
29
41
  className: classnames(styles.option, isSelected && styles.isSelected, isFocusVisible && styles.isFocusVisible, isDisabled && styles.disabled, classNameOverride),
30
42
  "aria-label": item.textValue
@@ -70,7 +70,7 @@ var useMediaQueries = function (propQueries) {
70
70
  kaizenMatches = _a[0],
71
71
  setKaizenMatches = _a[1];
72
72
  // ---------------------------------------
73
- // Create an event listener based on the medium breakpoint and update state whenever it changes
73
+ // Create an event listener based on the small and large breakpoints and update state whenever one of those changes
74
74
  // ---------------------------------------
75
75
  useEffect(function () {
76
76
  if (isLegacyEdge || isUnsupportedSafari) {
@@ -88,9 +88,11 @@ var useMediaQueries = function (propQueries) {
88
88
  isMediumOrLarger: !isSmallAfterUpdate
89
89
  });
90
90
  };
91
- mediumMatchMedia.addEventListener("change", updateMatches, true);
91
+ smallMatchMedia.addEventListener("change", updateMatches, true);
92
+ largeMatchMedia.addEventListener("change", updateMatches, true);
92
93
  return function () {
93
- mediumMatchMedia.removeEventListener("change", updateMatches);
94
+ smallMatchMedia.removeEventListener("change", updateMatches);
95
+ largeMatchMedia.removeEventListener("change", updateMatches);
94
96
  };
95
97
  }, []);
96
98
  // ---------------------------------------