@kaizen/components 1.64.7 → 1.64.9
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/Tile/MultiActionTile/MultiActionTile.cjs +3 -6
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +9 -14
- package/dist/cjs/__future__/Select/subcomponents/Option/Option.cjs +18 -6
- package/dist/esm/Tile/MultiActionTile/MultiActionTile.mjs +3 -6
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +9 -14
- package/dist/esm/__future__/Select/subcomponents/Option/Option.mjs +16 -4
- package/dist/styles.css +58 -58
- package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +1 -11
- package/package.json +1 -1
- package/src/Tile/MultiActionTile/MultiActionTile.tsx +3 -3
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -31
- package/src/__future__/Select/_docs/Select.stories.tsx +47 -0
- package/src/__future__/Select/subcomponents/Option/Option.tsx +15 -4
- package/dist/cjs/Tile/subcomponents/GenericTile/Action.cjs +0 -34
- package/dist/esm/Tile/subcomponents/GenericTile/Action.mjs +0 -26
- package/dist/types/Tile/subcomponents/GenericTile/Action.d.ts +0 -8
- package/src/Tile/subcomponents/GenericTile/Action.tsx +0 -41
|
@@ -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(
|
|
20
|
-
action: secondaryAction,
|
|
19
|
+
}, React__default.default.createElement(Button.Button, tslib.__assign({
|
|
21
20
|
secondary: true
|
|
22
|
-
})), React__default.default.createElement(
|
|
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
|
-
},
|
|
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 =
|
|
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
|
|
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({},
|
|
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
|
|
@@ -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(
|
|
12
|
-
action: secondaryAction,
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Button, __assign({
|
|
13
12
|
secondary: true
|
|
14
|
-
}))), /*#__PURE__*/React.createElement(
|
|
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
|
-
},
|
|
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(
|
|
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
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
@layer tokens, normalize, reset;@layer tokens{:root{--theme-key:heart;--animation-easing-function-ease-in-out:cubic-bezier(0.455,0.03,0.515,0.955);--animation-easing-function-ease-in:cubic-bezier(0.55,0.085,0.68,0.53);--animation-easing-function-ease-out:cubic-bezier(0.25,0.46,0.45,0.94);--animation-easing-function-linear:linear;--animation-easing-function-bounce-in:cubic-bezier(0.485,0.155,0.24,1.245);--animation-easing-function-bounce-out:cubic-bezier(0.485,0.155,0.515,0.845);--animation-easing-function-bounce-in-out:cubic-bezier(0.76,-0.245,0.24,1.245);--animation-duration-instant:0ms;--animation-duration-immediate:100ms;--animation-duration-rapid:200ms;--animation-duration-fast:300ms;--animation-duration-slow:400ms;--animation-duration-deliberate:700ms;--border-solid-border-width:2px;--border-solid-border-radius:7px;--border-solid-border-style:solid;--border-solid-border-color:#e1e2ea;--border-solid-border-color-rgb:225,226,234;--border-dashed-border-width:2px;--border-dashed-border-radius:7px;--border-dashed-border-style:dashed;--border-borderless-border-width:2px;--border-borderless-border-radius:7px;--border-borderless-border-style:solid;--border-borderless-border-color:transparent;--border-borderless-border-color-rgb:0,0,0;--border-focus-ring-border-width:2px;--border-focus-ring-border-radius:10px;--border-focus-ring-border-style:solid;--border-width-1:1px;--color-purple-100:#f4edf8;--color-purple-100-rgb:244,237,248;--color-purple-200:#dfc9ea;--color-purple-200-rgb:223,201,234;--color-purple-300:#c9a5dd;--color-purple-300-rgb:201,165,221;--color-purple-400:#ae67b1;--color-purple-400-rgb:174,103,177;--color-purple-500:#844587;--color-purple-500-rgb:132,69,135;--color-purple-600:#5f3361;--color-purple-600-rgb:95,51,97;--color-purple-700:#4a234d;--color-purple-700-rgb:74,35,77;--color-purple-800:#2f2438;--color-purple-800-rgb:47,36,56;--color-blue-100:#e6f6ff;--color-blue-100-rgb:230,246,255;--color-blue-200:#bde2f5;--color-blue-200-rgb:189,226,245;--color-blue-300:#73c0e8;--color-blue-300-rgb:115,192,232;--color-blue-400:#008bd6;--color-blue-400-rgb:0,139,214;--color-blue-500:#0168b3;--color-blue-500-rgb:1,104,179;--color-blue-600:#004970;--color-blue-600-rgb:0,73,112;--color-blue-700:#003157;--color-blue-700-rgb:0,49,87;--color-green-100:#e8f8f4;--color-green-100-rgb:232,248,244;--color-green-200:#c4ede2;--color-green-200-rgb:196,237,226;--color-green-300:#8fdbc7;--color-green-300-rgb:143,219,199;--color-green-400:#5dcaad;--color-green-400-rgb:93,202,173;--color-green-500:#3f9a86;--color-green-500-rgb:63,154,134;--color-green-600:#2c7d67;--color-green-600-rgb:44,125,103;--color-green-700:#22594a;--color-green-700-rgb:34,89,74;--color-yellow-100:#fff9e4;--color-yellow-100-rgb:255,249,228;--color-yellow-200:#ffeeb3;--color-yellow-200-rgb:255,238,179;--color-yellow-300:#ffe36e;--color-yellow-300-rgb:255,227,110;--color-yellow-400:#ffca4d;--color-yellow-400-rgb:255,202,77;--color-yellow-500:#ffb600;--color-yellow-500-rgb:255,182,0;--color-yellow-600:#c68600;--color-yellow-600-rgb:198,134,0;--color-yellow-700:#876400;--color-yellow-700-rgb:135,100,0;--color-red-100:#fdeaee;--color-red-100-rgb:253,234,238;--color-red-200:#f9c2cb;--color-red-200-rgb:249,194,203;--color-red-300:#f597a8;--color-red-300-rgb:245,151,168;--color-red-400:#e0707d;--color-red-400-rgb:224,112,125;--color-red-500:#c93b55;--color-red-500-rgb:201,59,85;--color-red-600:#a82433;--color-red-600-rgb:168,36,51;--color-red-700:#6c1e20;--color-red-700-rgb:108,30,32;--color-orange-100:#fff0e8;--color-orange-100-rgb:255,240,232;--color-orange-200:#ffd1b9;--color-orange-200-rgb:255,209,185;--color-orange-300:#ffb08a;--color-orange-300-rgb:255,176,138;--color-orange-400:#ff9461;--color-orange-400-rgb:255,148,97;--color-orange-500:#e96c2f;--color-orange-500-rgb:233,108,47;--color-orange-600:#b74302;--color-orange-600-rgb:183,67,2;--color-orange-700:#903c00;--color-orange-700-rgb:144,60,0;--color-gray-100:#f9f9f9;--color-gray-100-rgb:249,249,249;--color-gray-200:#f4f4f5;--color-gray-200-rgb:244,244,245;--color-gray-300:#eaeaec;--color-gray-300-rgb:234,234,236;--color-gray-400:#cdcdd0;--color-gray-400-rgb:205,205,208;--color-gray-500:#878792;--color-gray-500-rgb:135,135,146;--color-gray-600:#524e56;--color-gray-600-rgb:82,78,86;--color-white:#fff;--color-white-rgb:255,255,255;--color-black:#000;--color-black-rgb:0,0,0;--data-viz-favorable:#7dd5bd;--data-viz-favorable-rgb:125,213,189;--data-viz-unfavorable:#e68d97;--data-viz-unfavorable-rgb:230,141,151;--layout-content-max-width:1392px;--layout-content-max-width-with-sidebar:1080px;--layout-content-side-margin:72px;--layout-mobile-actions-drawer-height:60px;--layout-navigation-bar-height:72px;--layout-breakpoints-medium:768px;--layout-breakpoints-large:1080px;--shadow-small-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 3px 16px 0 rgba(0,0,0,.06);--shadow-large-box-shadow:0 3px 9px 0 rgba(0,0,0,.1),0 8px 40px 0 rgba(0,0,0,.08);--spacing-0:0;--spacing-1:.0625rem;--spacing-2:.125rem;--spacing-4:.25rem;--spacing-6:.375rem;--spacing-8:.5rem;--spacing-12:.75rem;--spacing-16:1rem;--spacing-20:1.25rem;--spacing-24:1.5rem;--spacing-32:2rem;--spacing-40:2.5rem;--spacing-48:3rem;--spacing-56:3.5rem;--spacing-64:4rem;--spacing-72:4.5rem;--spacing-80:5rem;--spacing-96:6rem;--spacing-112:7rem;--spacing-128:8rem;--spacing-160:10rem;--spacing-200:12.5rem;--spacing-240:15rem;--spacing-280:17.5rem;--spacing-320:20rem;--spacing-xs:0.375rem;--spacing-sm:0.75rem;--spacing-md:1.5rem;--spacing-lg:2.25rem;--spacing-xl:3rem;--spacing-xxl:3.75rem;--spacing-xxxl:4.5rem;--spacing-xxxxl:5.25rem;--spacing-xxxxxl:6rem;--typography-data-large-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-large-font-weight:700;--typography-data-large-font-size:5.25rem;--typography-data-large-line-height:5.25rem;--typography-data-large-letter-spacing:normal;--typography-data-large-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-large-units-font-weight:700;--typography-data-large-units-font-size:2.625rem;--typography-data-large-units-line-height:5.25rem;--typography-data-large-units-letter-spacing:normal;--typography-data-medium-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-medium-font-weight:700;--typography-data-medium-font-size:3rem;--typography-data-medium-line-height:5rem;--typography-data-medium-letter-spacing:normal;--typography-data-medium-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-medium-units-font-weight:700;--typography-data-medium-units-font-size:1.5rem;--typography-data-medium-units-line-height:5rem;--typography-data-medium-units-letter-spacing:normal;--typography-data-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-small-font-weight:700;--typography-data-small-font-size:1.5rem;--typography-data-small-line-height:1.5rem;--typography-data-small-letter-spacing:normal;--typography-data-small-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-small-units-font-weight:700;--typography-data-small-units-font-size:1.125rem;--typography-data-small-units-line-height:1.5rem;--typography-data-small-units-letter-spacing:normal;--typography-display-0-font-family:"Tiempos Headline",Georgia,serif;--typography-display-0-font-weight:800;--typography-display-0-font-size:4.5rem;--typography-display-0-line-height:5.25rem;--typography-display-0-letter-spacing:0em;--typography-heading-1-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-1-font-weight:700;--typography-heading-1-font-size:2.125rem;--typography-heading-1-line-height:2.625rem;--typography-heading-1-letter-spacing:normal;--typography-heading-2-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-2-font-weight:700;--typography-heading-2-font-size:1.75rem;--typography-heading-2-line-height:2.25rem;--typography-heading-2-letter-spacing:normal;--typography-heading-3-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-3-font-weight:700;--typography-heading-3-font-size:1.375rem;--typography-heading-3-line-height:1.875rem;--typography-heading-3-letter-spacing:normal;--typography-heading-4-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-4-font-weight:600;--typography-heading-4-font-size:1.125rem;--typography-heading-4-line-height:1.5rem;--typography-heading-4-letter-spacing:normal;--typography-heading-5-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-5-font-weight:600;--typography-heading-5-font-size:1rem;--typography-heading-5-line-height:1.5rem;--typography-heading-5-letter-spacing:normal;--typography-heading-6-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-6-font-weight:700;--typography-heading-6-font-size:0.875rem;--typography-heading-6-line-height:1.5rem;--typography-heading-6-letter-spacing:normal;--typography-paragraph-intro-lede-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-intro-lede-font-weight:400;--typography-paragraph-intro-lede-font-size:1.25rem;--typography-paragraph-intro-lede-line-height:1.875rem;--typography-paragraph-intro-lede-letter-spacing:0;--typography-paragraph-intro-lede-max-width:975px;--typography-paragraph-body-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-body-font-weight:400;--typography-paragraph-body-font-size:1rem;--typography-paragraph-body-line-height:1.5rem;--typography-paragraph-body-letter-spacing:normal;--typography-paragraph-body-max-width:780px;--typography-paragraph-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-small-font-weight:400;--typography-paragraph-small-font-size:0.875rem;--typography-paragraph-small-line-height:1.125rem;--typography-paragraph-small-letter-spacing:normal;--typography-paragraph-small-max-width:680px;--typography-paragraph-extra-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-extra-small-font-weight:400;--typography-paragraph-extra-small-font-size:0.75rem;--typography-paragraph-extra-small-line-height:1.125rem;--typography-paragraph-extra-small-letter-spacing:normal;--typography-paragraph-extra-small-max-width:600px;--typography-paragraph-bold-font-weight:600;--typography-button-primary-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-button-primary-font-weight:700;--typography-button-primary-font-size:1.125rem;--typography-button-primary-line-height:1.5rem;--typography-button-primary-letter-spacing:normal;--typography-button-secondary-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-button-secondary-font-weight:500;--typography-button-secondary-font-size:1rem;--typography-button-secondary-line-height:1.5rem;--typography-button-secondary-letter-spacing:normal}}@layer normalize{html{text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}}@layer reset{@font-face{font-family:Tiempos Headline;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff)}@font-face{font-family:Tiempos Headline;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-medium.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-medium.woff)}@font-face{font-family:Greycliff CF;font-weight:300;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-light.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:400;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-regular.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-medium.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:600;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-demi-bold.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:700;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-bold.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-extra-bold.woff) format("woff")}@font-face{font-family:Inter;font-weight:300;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-light.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-light.woff)}@font-face{font-family:Inter;font-weight:400;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff)}@font-face{font-family:Inter;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff)}@font-face{font-family:Inter;font-weight:600;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff)}@font-face{font-family:Inter;font-weight:700;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff)}@font-face{font-family:Inter;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-extra-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-extra-bold.woff)}@font-face{font-family:IBM Plex Mono;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff)}}@layer reset{*,:after,:before{border-color:var(--border-solid-border-color,"currentColor");border-style:solid;border-width:0}}
|
|
2
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
3
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
4
|
+
.OverlayArrow-module_overlayArrow__hoDyK {
|
|
5
|
+
display: flex;
|
|
6
|
+
padding: 8px;
|
|
7
|
+
}
|
|
8
|
+
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=top], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] {
|
|
9
|
+
padding: 0 8px;
|
|
10
|
+
}
|
|
11
|
+
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=left], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] {
|
|
12
|
+
padding: 8px 0;
|
|
13
|
+
}
|
|
14
|
+
.OverlayArrow-module_overlayArrow__hoDyK path {
|
|
15
|
+
fill: var(--color-purple-800, #2f2438);
|
|
16
|
+
box-shadow: var(--shadow-small-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 16px 0 rgba(0, 0, 0, 0.06));
|
|
17
|
+
}
|
|
18
|
+
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] svg {
|
|
19
|
+
transform: rotate(90deg);
|
|
20
|
+
}
|
|
21
|
+
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] svg {
|
|
22
|
+
transform: rotate(180deg);
|
|
23
|
+
}
|
|
24
|
+
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=left] svg {
|
|
25
|
+
transform: rotate(270deg);
|
|
26
|
+
}
|
|
27
|
+
.OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
|
|
28
|
+
fill: var(--color-white, #ffffff);
|
|
29
|
+
}
|
|
2
30
|
.MenuItem-module_item__DPerF {
|
|
3
31
|
font-family: var(--typography-paragraph-body-font-family);
|
|
4
32
|
font-size: var(--typography-paragraph-body-font-size);
|
|
@@ -33,6 +61,36 @@
|
|
|
33
61
|
.MenuItem-module_item__DPerF[data-disabled] {
|
|
34
62
|
opacity: 0.3;
|
|
35
63
|
}
|
|
64
|
+
.Menu-module_menu__iHYqh {
|
|
65
|
+
background-color: var(--color-white);
|
|
66
|
+
color: var(--color-purple-800);
|
|
67
|
+
width: 248px;
|
|
68
|
+
max-height: 22rem;
|
|
69
|
+
overflow: auto;
|
|
70
|
+
padding-block: var(--spacing-6);
|
|
71
|
+
outline: none;
|
|
72
|
+
border-radius: var(--border-solid-border-radius);
|
|
73
|
+
box-shadow: var(--shadow-large-box-shadow);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.Menu-module_menu__iHYqh .react-aria-Header {
|
|
77
|
+
font-family: var(--typography-heading-6-font-family);
|
|
78
|
+
font-size: var(--typography-heading-6-font-size);
|
|
79
|
+
letter-spacing: var(--typography-heading-6-letter-spacing);
|
|
80
|
+
font-weight: var(--typography-heading-6-font-weight);
|
|
81
|
+
line-height: var(--typography-heading-6-line-height);
|
|
82
|
+
padding: var(--spacing-6) 10px;
|
|
83
|
+
margin-inline: var(--spacing-6);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.Menu-module_menu__iHYqh section:not(:last-of-type)::after {
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 1px;
|
|
89
|
+
background-color: var(--border-solid-border-color);
|
|
90
|
+
content: "";
|
|
91
|
+
display: block;
|
|
92
|
+
margin-block: var(--spacing-6);
|
|
93
|
+
}
|
|
36
94
|
.Button-module_button__QOSYH {
|
|
37
95
|
--button-min-height-width: var(--spacing-48);
|
|
38
96
|
--button-padding-x: calc(
|
|
@@ -121,36 +179,6 @@
|
|
|
121
179
|
--button-icon-size: var(--spacing-16);
|
|
122
180
|
gap: var(--spacing-8);
|
|
123
181
|
}
|
|
124
|
-
.Menu-module_menu__iHYqh {
|
|
125
|
-
background-color: var(--color-white);
|
|
126
|
-
color: var(--color-purple-800);
|
|
127
|
-
width: 248px;
|
|
128
|
-
max-height: 22rem;
|
|
129
|
-
overflow: auto;
|
|
130
|
-
padding-block: var(--spacing-6);
|
|
131
|
-
outline: none;
|
|
132
|
-
border-radius: var(--border-solid-border-radius);
|
|
133
|
-
box-shadow: var(--shadow-large-box-shadow);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.Menu-module_menu__iHYqh .react-aria-Header {
|
|
137
|
-
font-family: var(--typography-heading-6-font-family);
|
|
138
|
-
font-size: var(--typography-heading-6-font-size);
|
|
139
|
-
letter-spacing: var(--typography-heading-6-letter-spacing);
|
|
140
|
-
font-weight: var(--typography-heading-6-font-weight);
|
|
141
|
-
line-height: var(--typography-heading-6-line-height);
|
|
142
|
-
padding: var(--spacing-6) 10px;
|
|
143
|
-
margin-inline: var(--spacing-6);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.Menu-module_menu__iHYqh section:not(:last-of-type)::after {
|
|
147
|
-
width: 100%;
|
|
148
|
-
height: 1px;
|
|
149
|
-
background-color: var(--border-solid-border-color);
|
|
150
|
-
content: "";
|
|
151
|
-
display: block;
|
|
152
|
-
margin-block: var(--spacing-6);
|
|
153
|
-
}
|
|
154
182
|
.Focusable-module_focusableWrapper__NfuIi {
|
|
155
183
|
display: inline-flex;
|
|
156
184
|
}
|
|
@@ -210,34 +238,6 @@
|
|
|
210
238
|
opacity: 1;
|
|
211
239
|
}
|
|
212
240
|
}
|
|
213
|
-
/** THIS IS AN AUTOGENERATED FILE **/
|
|
214
|
-
/** THIS IS AN AUTOGENERATED FILE **/
|
|
215
|
-
.OverlayArrow-module_overlayArrow__hoDyK {
|
|
216
|
-
display: flex;
|
|
217
|
-
padding: 8px;
|
|
218
|
-
}
|
|
219
|
-
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=top], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] {
|
|
220
|
-
padding: 0 8px;
|
|
221
|
-
}
|
|
222
|
-
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=left], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] {
|
|
223
|
-
padding: 8px 0;
|
|
224
|
-
}
|
|
225
|
-
.OverlayArrow-module_overlayArrow__hoDyK path {
|
|
226
|
-
fill: var(--color-purple-800, #2f2438);
|
|
227
|
-
box-shadow: var(--shadow-small-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 16px 0 rgba(0, 0, 0, 0.06));
|
|
228
|
-
}
|
|
229
|
-
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] svg {
|
|
230
|
-
transform: rotate(90deg);
|
|
231
|
-
}
|
|
232
|
-
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] svg {
|
|
233
|
-
transform: rotate(180deg);
|
|
234
|
-
}
|
|
235
|
-
.OverlayArrow-module_overlayArrow__hoDyK[data-placement=left] svg {
|
|
236
|
-
transform: rotate(270deg);
|
|
237
|
-
}
|
|
238
|
-
.OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
|
|
239
|
-
fill: var(--color-white, #ffffff);
|
|
240
|
-
}
|
|
241
241
|
.SVG-module_icon__8J5Ev {
|
|
242
242
|
width: 20px;
|
|
243
243
|
height: 20px;
|
|
@@ -2,17 +2,7 @@ import React, { HTMLAttributes } from "react";
|
|
|
2
2
|
import { AllowedHeadingTags } from "../../../Heading";
|
|
3
3
|
import { GenericButtonProps } from "../../../__actions__/Button/v1/GenericButton";
|
|
4
4
|
import { OverrideClassName } from "../../../types/OverrideClassName";
|
|
5
|
-
export type TileAction =
|
|
6
|
-
label: string;
|
|
7
|
-
onClick?: GenericButtonProps["onClick"];
|
|
8
|
-
href?: string;
|
|
9
|
-
icon?: JSX.Element;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated use data-testid instead
|
|
12
|
-
*/
|
|
13
|
-
automationId?: string;
|
|
14
|
-
newTabAndIUnderstandTheAccessibilityImplications?: boolean;
|
|
15
|
-
} & HTMLAttributes<HTMLButtonElement>;
|
|
5
|
+
export type TileAction = GenericButtonProps;
|
|
16
6
|
export type TileInformation = {
|
|
17
7
|
text: string;
|
|
18
8
|
primaryAction?: TileAction;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
+
import { Button } from "~components/__actions__/v2"
|
|
2
3
|
import {
|
|
3
4
|
GenericTile,
|
|
4
5
|
GenericTileProps,
|
|
5
6
|
TileAction,
|
|
6
7
|
} from "../subcomponents/GenericTile"
|
|
7
|
-
import Action from "../subcomponents/GenericTile/Action"
|
|
8
8
|
import styles from "./MultiActionTile.module.scss"
|
|
9
9
|
|
|
10
10
|
export type MultiActionTileProps = {
|
|
@@ -19,10 +19,10 @@ const renderActions = (
|
|
|
19
19
|
<div className={styles.actions}>
|
|
20
20
|
{secondaryAction && (
|
|
21
21
|
<div className={styles.secondaryAction}>
|
|
22
|
-
<
|
|
22
|
+
<Button secondary {...secondaryAction} />
|
|
23
23
|
</div>
|
|
24
24
|
)}
|
|
25
|
-
<
|
|
25
|
+
<Button {...primaryAction} />
|
|
26
26
|
</div>
|
|
27
27
|
)
|
|
28
28
|
|
|
@@ -4,22 +4,11 @@ import { AllowedHeadingTags, Heading } from "~components/Heading"
|
|
|
4
4
|
import { ArrowBackwardIcon, InformationIcon } from "~components/Icon"
|
|
5
5
|
import { Text } from "~components/Text"
|
|
6
6
|
import { GenericButtonProps } from "~components/__actions__/Button/v1/GenericButton"
|
|
7
|
-
import { IconButton } from "~components/__actions__/v2"
|
|
7
|
+
import { IconButton, Button } from "~components/__actions__/v2"
|
|
8
8
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
9
|
-
import Action from "./Action"
|
|
10
9
|
import styles from "./GenericTile.module.scss"
|
|
11
10
|
|
|
12
|
-
export type TileAction =
|
|
13
|
-
label: string
|
|
14
|
-
onClick?: GenericButtonProps["onClick"]
|
|
15
|
-
href?: string
|
|
16
|
-
icon?: JSX.Element
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated use data-testid instead
|
|
19
|
-
*/
|
|
20
|
-
automationId?: string
|
|
21
|
-
newTabAndIUnderstandTheAccessibilityImplications?: boolean
|
|
22
|
-
} & HTMLAttributes<HTMLButtonElement>
|
|
11
|
+
export type TileAction = GenericButtonProps
|
|
23
12
|
|
|
24
13
|
export type TileInformation = {
|
|
25
14
|
text: string
|
|
@@ -80,19 +69,6 @@ export const GenericTile = ({
|
|
|
80
69
|
</div>
|
|
81
70
|
)
|
|
82
71
|
|
|
83
|
-
const renderActions = (
|
|
84
|
-
primaryAction?: TileAction,
|
|
85
|
-
secondaryAction?: TileAction,
|
|
86
|
-
disabled?: boolean
|
|
87
|
-
): JSX.Element => (
|
|
88
|
-
<div className={styles.actions}>
|
|
89
|
-
{secondaryAction && (
|
|
90
|
-
<Action action={secondaryAction} secondary disabled={disabled} />
|
|
91
|
-
)}
|
|
92
|
-
{primaryAction && <Action action={primaryAction} disabled={disabled} />}
|
|
93
|
-
</div>
|
|
94
|
-
)
|
|
95
|
-
|
|
96
72
|
const renderFront = (): JSX.Element => (
|
|
97
73
|
<div
|
|
98
74
|
className={classnames(
|
|
@@ -132,11 +108,21 @@ export const GenericTile = ({
|
|
|
132
108
|
{(informationProp.primaryAction ||
|
|
133
109
|
informationProp.secondaryAction) && (
|
|
134
110
|
<div className={styles.footer}>
|
|
135
|
-
{
|
|
136
|
-
informationProp.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
111
|
+
<div className={styles.actions}>
|
|
112
|
+
{informationProp.secondaryAction && (
|
|
113
|
+
<Button
|
|
114
|
+
secondary
|
|
115
|
+
disabled={!isFlipped}
|
|
116
|
+
{...informationProp.secondaryAction}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
{informationProp.primaryAction && (
|
|
120
|
+
<Button
|
|
121
|
+
disabled={!isFlipped}
|
|
122
|
+
{...informationProp.primaryAction}
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
140
126
|
</div>
|
|
141
127
|
)}
|
|
142
128
|
</>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { RadioField, RadioGroup } from "~components/Radio"
|
|
3
4
|
import { Select } from "../Select"
|
|
4
5
|
import { SelectOption } from "../types"
|
|
5
6
|
import {
|
|
@@ -26,6 +27,10 @@ const meta = {
|
|
|
26
27
|
args: {
|
|
27
28
|
label: "Label",
|
|
28
29
|
items: singleMockItems,
|
|
30
|
+
onFocus: undefined,
|
|
31
|
+
onFocusChange: undefined,
|
|
32
|
+
onOpenChange: undefined,
|
|
33
|
+
onSelectionChange: undefined,
|
|
29
34
|
},
|
|
30
35
|
parameters: {
|
|
31
36
|
actions: {
|
|
@@ -190,3 +195,45 @@ export const PortalContainer: Story = {
|
|
|
190
195
|
},
|
|
191
196
|
parameters: { docs: { source: { type: "code" } } },
|
|
192
197
|
}
|
|
198
|
+
|
|
199
|
+
export const TouchDeviceTest: Story = {
|
|
200
|
+
name: "Touch Device Pointer Event (Manual Test)",
|
|
201
|
+
render: args => {
|
|
202
|
+
const [selected, setSelected] = React.useState("radio-1")
|
|
203
|
+
return (
|
|
204
|
+
<div>
|
|
205
|
+
<p>
|
|
206
|
+
On touch devices, the radios below were changing when selecting an
|
|
207
|
+
option sitting above it.
|
|
208
|
+
<br />
|
|
209
|
+
At this time, we could not automate this test, so this story exists
|
|
210
|
+
for manual testing.
|
|
211
|
+
</p>
|
|
212
|
+
<Select {...args} />
|
|
213
|
+
<RadioGroup labelText="Radio group">
|
|
214
|
+
<RadioField
|
|
215
|
+
labelText="Label 1"
|
|
216
|
+
name="radio-group"
|
|
217
|
+
value="radio-value-1"
|
|
218
|
+
onChange={() => setSelected("radio-1")}
|
|
219
|
+
selectedStatus={selected === "radio-1"}
|
|
220
|
+
/>
|
|
221
|
+
<RadioField
|
|
222
|
+
labelText="Label 2"
|
|
223
|
+
name="radio-group"
|
|
224
|
+
value="radio-value-2"
|
|
225
|
+
onChange={() => setSelected("radio-2")}
|
|
226
|
+
selectedStatus={selected === "radio-2"}
|
|
227
|
+
/>
|
|
228
|
+
<RadioField
|
|
229
|
+
labelText="Label 3"
|
|
230
|
+
name="radio-group"
|
|
231
|
+
value="radio-value-3"
|
|
232
|
+
onChange={() => setSelected("radio-3")}
|
|
233
|
+
selectedStatus={selected === "radio-3"}
|
|
234
|
+
/>
|
|
235
|
+
</RadioGroup>
|
|
236
|
+
</div>
|
|
237
|
+
)
|
|
238
|
+
},
|
|
239
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react"
|
|
2
|
-
import {
|
|
3
|
-
import { useOption } from "@react-aria/listbox"
|
|
4
|
-
import { mergeProps } from "@react-aria/utils"
|
|
2
|
+
import { FocusableElement } from "@react-types/shared"
|
|
5
3
|
import classnames from "classnames"
|
|
4
|
+
import { mergeProps, useFocusRing, useOption } from "react-aria"
|
|
6
5
|
import { CheckIcon } from "~components/Icon"
|
|
7
6
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
8
7
|
import { useSelectContext } from "../../context"
|
|
@@ -26,11 +25,23 @@ export const Option = <Option extends SelectOption = SelectOption>({
|
|
|
26
25
|
ref
|
|
27
26
|
)
|
|
28
27
|
|
|
28
|
+
const { onPointerUp, ...restOptionProps } = optionProps
|
|
29
|
+
|
|
29
30
|
const { isFocusVisible, focusProps } = useFocusRing()
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<li
|
|
33
|
-
{...mergeProps(
|
|
34
|
+
{...mergeProps(restOptionProps, focusProps, props, {
|
|
35
|
+
onPointerUp: (e: React.PointerEvent<FocusableElement>) => {
|
|
36
|
+
if (e.pointerType === "touch") {
|
|
37
|
+
// On touch devices, the listbox closes too quickly so below elements will trigger their pointer events.
|
|
38
|
+
// Slow it down a bit to prevent the appearance of propagation.
|
|
39
|
+
setTimeout(() => state.setSelectedKey(item.key), 250)
|
|
40
|
+
} else {
|
|
41
|
+
onPointerUp?.(e)
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
})}
|
|
34
45
|
ref={ref}
|
|
35
46
|
className={classnames(
|
|
36
47
|
styles.option,
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var Button = require('../../../__actions__/Button/v1/Button/Button.cjs');
|
|
5
|
-
function _interopDefault(e) {
|
|
6
|
-
return e && e.__esModule ? e : {
|
|
7
|
-
default: e
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
-
var Action = function (_a) {
|
|
12
|
-
var action = _a.action,
|
|
13
|
-
_b = _a.secondary,
|
|
14
|
-
secondary = _b === void 0 ? false : _b,
|
|
15
|
-
_c = _a.disabled,
|
|
16
|
-
disabled = _c === void 0 ? false : _c;
|
|
17
|
-
var label = action.label,
|
|
18
|
-
href = action.href,
|
|
19
|
-
onClick = action.onClick,
|
|
20
|
-
icon = action.icon,
|
|
21
|
-
automationId = action.automationId,
|
|
22
|
-
newTabAndIUnderstandTheAccessibilityImplications = action.newTabAndIUnderstandTheAccessibilityImplications;
|
|
23
|
-
return React__default.default.createElement(Button.Button, {
|
|
24
|
-
label: label,
|
|
25
|
-
href: href,
|
|
26
|
-
onClick: onClick,
|
|
27
|
-
secondary: secondary,
|
|
28
|
-
icon: icon,
|
|
29
|
-
"data-automation-id": automationId,
|
|
30
|
-
disabled: disabled,
|
|
31
|
-
newTabAndIUnderstandTheAccessibilityImplications: newTabAndIUnderstandTheAccessibilityImplications
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
module.exports = Action;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from '../../../__actions__/Button/v1/Button/Button.mjs';
|
|
3
|
-
var Action = function (_a) {
|
|
4
|
-
var action = _a.action,
|
|
5
|
-
_b = _a.secondary,
|
|
6
|
-
secondary = _b === void 0 ? false : _b,
|
|
7
|
-
_c = _a.disabled,
|
|
8
|
-
disabled = _c === void 0 ? false : _c;
|
|
9
|
-
var label = action.label,
|
|
10
|
-
href = action.href,
|
|
11
|
-
onClick = action.onClick,
|
|
12
|
-
icon = action.icon,
|
|
13
|
-
automationId = action.automationId,
|
|
14
|
-
newTabAndIUnderstandTheAccessibilityImplications = action.newTabAndIUnderstandTheAccessibilityImplications;
|
|
15
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
16
|
-
label: label,
|
|
17
|
-
href: href,
|
|
18
|
-
onClick: onClick,
|
|
19
|
-
secondary: secondary,
|
|
20
|
-
icon: icon,
|
|
21
|
-
"data-automation-id": automationId,
|
|
22
|
-
disabled: disabled,
|
|
23
|
-
newTabAndIUnderstandTheAccessibilityImplications: newTabAndIUnderstandTheAccessibilityImplications
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
export { Action as default };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { Button } from "~components/__actions__/v2"
|
|
3
|
-
import { TileAction } from "./GenericTile"
|
|
4
|
-
|
|
5
|
-
type ActionProps = {
|
|
6
|
-
action: TileAction
|
|
7
|
-
secondary?: boolean
|
|
8
|
-
disabled?: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Action = ({
|
|
12
|
-
action,
|
|
13
|
-
secondary = false,
|
|
14
|
-
disabled = false,
|
|
15
|
-
}: ActionProps): JSX.Element => {
|
|
16
|
-
const {
|
|
17
|
-
label,
|
|
18
|
-
href,
|
|
19
|
-
onClick,
|
|
20
|
-
icon,
|
|
21
|
-
automationId,
|
|
22
|
-
newTabAndIUnderstandTheAccessibilityImplications,
|
|
23
|
-
} = action
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Button
|
|
27
|
-
label={label}
|
|
28
|
-
href={href}
|
|
29
|
-
onClick={onClick}
|
|
30
|
-
secondary={secondary}
|
|
31
|
-
icon={icon}
|
|
32
|
-
data-automation-id={automationId}
|
|
33
|
-
disabled={disabled}
|
|
34
|
-
newTabAndIUnderstandTheAccessibilityImplications={
|
|
35
|
-
newTabAndIUnderstandTheAccessibilityImplications
|
|
36
|
-
}
|
|
37
|
-
/>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default Action
|