@kaizen/components 1.64.8 → 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/esm/Tile/MultiActionTile/MultiActionTile.mjs +3 -6
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +9 -14
- package/dist/styles.css +80 -80
- package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +1 -11
- package/package.json +3 -3
- package/src/Tile/MultiActionTile/MultiActionTile.tsx +3 -3
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -31
- 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
|
};
|
|
@@ -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
|
};
|
package/dist/styles.css
CHANGED
|
@@ -27,61 +27,39 @@
|
|
|
27
27
|
.OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
|
|
28
28
|
fill: var(--color-white, #ffffff);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
border-radius: var(--border-solid-border-radius, 7px);
|
|
47
|
-
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));
|
|
48
|
-
background-color: var(--color-purple-800, #2f2438);
|
|
49
|
-
text-wrap: pretty;
|
|
50
|
-
/* fixes FF gap */
|
|
51
|
-
transform: translate3d(0, 0, 0);
|
|
52
|
-
}
|
|
53
|
-
.Tooltip-module_tooltip__efL1m.Tooltip-module_reversed__NnCbZ {
|
|
54
|
-
background-color: var(--color-white, #ffffff);
|
|
55
|
-
color: var(--color-purple-800, #2f2438);
|
|
56
|
-
}
|
|
57
|
-
.Tooltip-module_tooltip__efL1m[data-placement=top] {
|
|
58
|
-
--origin: translateY(4px);
|
|
59
|
-
}
|
|
60
|
-
.Tooltip-module_tooltip__efL1m[data-placement=bottom] {
|
|
61
|
-
--origin: translateY(-4px);
|
|
62
|
-
}
|
|
63
|
-
.Tooltip-module_tooltip__efL1m[data-placement=right] {
|
|
64
|
-
--origin: translateX(-4px);
|
|
65
|
-
}
|
|
66
|
-
.Tooltip-module_tooltip__efL1m[data-placement=left] {
|
|
67
|
-
--origin: translateX(4px);
|
|
30
|
+
.MenuItem-module_item__DPerF {
|
|
31
|
+
font-family: var(--typography-paragraph-body-font-family);
|
|
32
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
33
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
34
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
35
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
36
|
+
color: rgba(var(--color-purple-800-rgb), 0.7);
|
|
37
|
+
padding: var(--spacing-6) var(--spacing-8);
|
|
38
|
+
border: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style) transparent;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
display: flex;
|
|
41
|
+
gap: 0 var(--spacing-8);
|
|
42
|
+
align-items: center;
|
|
43
|
+
margin-inline: var(--spacing-6);
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
cursor: pointer;
|
|
68
46
|
}
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
|
|
48
|
+
.MenuItem-module_iconWrapper__bRdQN {
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
71
52
|
}
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
|
|
54
|
+
.MenuItem-module_item__DPerF[data-focused] {
|
|
55
|
+
background-color: var(--color-blue-100);
|
|
56
|
+
color: var(--color-blue-500);
|
|
57
|
+
outline: none;
|
|
58
|
+
border-color: var(--color-blue-500);
|
|
74
59
|
}
|
|
75
60
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
transform: var(--origin);
|
|
79
|
-
opacity: 0;
|
|
80
|
-
}
|
|
81
|
-
to {
|
|
82
|
-
transform: translateY(0);
|
|
83
|
-
opacity: 1;
|
|
84
|
-
}
|
|
61
|
+
.MenuItem-module_item__DPerF[data-disabled] {
|
|
62
|
+
opacity: 0.3;
|
|
85
63
|
}
|
|
86
64
|
.Menu-module_menu__iHYqh {
|
|
87
65
|
background-color: var(--color-white);
|
|
@@ -204,39 +182,61 @@
|
|
|
204
182
|
.Focusable-module_focusableWrapper__NfuIi {
|
|
205
183
|
display: inline-flex;
|
|
206
184
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
185
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
186
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
187
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
188
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
189
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
190
|
+
/** THIS IS AN AUTOGENERATED FILE **/
|
|
191
|
+
.Tooltip-module_tooltip__efL1m {
|
|
192
|
+
max-width: 200px;
|
|
193
|
+
padding: var(--spacing-8, 0.5rem) var(--spacing-12, 0.75rem);
|
|
194
|
+
color: var(--color-white, #ffffff);
|
|
195
|
+
text-align: center;
|
|
196
|
+
font-family: var(--typography-paragraph-extra-small-font-family, "Inter", "Noto Sans", Helvetica, Arial, sans-serif);
|
|
197
|
+
font-size: var(--typography-paragraph-extra-small-font-size, 0.75rem);
|
|
198
|
+
font-weight: var(--typography-paragraph-extra-small-font-weight, 400);
|
|
199
|
+
letter-spacing: var(--typography-paragraph-extra-small-letter-spacing, normal);
|
|
200
|
+
line-height: var(--typography-paragraph-extra-small-line-height, 1.125rem);
|
|
201
|
+
border-radius: var(--border-solid-border-radius, 7px);
|
|
202
|
+
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));
|
|
203
|
+
background-color: var(--color-purple-800, #2f2438);
|
|
204
|
+
text-wrap: pretty;
|
|
205
|
+
/* fixes FF gap */
|
|
206
|
+
transform: translate3d(0, 0, 0);
|
|
223
207
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
display: flex;
|
|
228
|
-
align-items: center;
|
|
208
|
+
.Tooltip-module_tooltip__efL1m.Tooltip-module_reversed__NnCbZ {
|
|
209
|
+
background-color: var(--color-white, #ffffff);
|
|
210
|
+
color: var(--color-purple-800, #2f2438);
|
|
229
211
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
212
|
+
.Tooltip-module_tooltip__efL1m[data-placement=top] {
|
|
213
|
+
--origin: translateY(4px);
|
|
214
|
+
}
|
|
215
|
+
.Tooltip-module_tooltip__efL1m[data-placement=bottom] {
|
|
216
|
+
--origin: translateY(-4px);
|
|
217
|
+
}
|
|
218
|
+
.Tooltip-module_tooltip__efL1m[data-placement=right] {
|
|
219
|
+
--origin: translateX(-4px);
|
|
220
|
+
}
|
|
221
|
+
.Tooltip-module_tooltip__efL1m[data-placement=left] {
|
|
222
|
+
--origin: translateX(4px);
|
|
223
|
+
}
|
|
224
|
+
.Tooltip-module_tooltip__efL1m[data-entering] {
|
|
225
|
+
animation: Tooltip-module_slide__lFdGA var(--animation-duration-fast, 300ms);
|
|
226
|
+
}
|
|
227
|
+
.Tooltip-module_tooltip__efL1m[data-exiting] {
|
|
228
|
+
animation: Tooltip-module_slide__lFdGA var(--animation-duration-fast, 300ms) reverse var(--animation-easing-function-ease-in, cubic-bezier(0.55, 0.085, 0.68, 0.53));
|
|
236
229
|
}
|
|
237
230
|
|
|
238
|
-
|
|
239
|
-
|
|
231
|
+
@keyframes Tooltip-module_slide__lFdGA {
|
|
232
|
+
from {
|
|
233
|
+
transform: var(--origin);
|
|
234
|
+
opacity: 0;
|
|
235
|
+
}
|
|
236
|
+
to {
|
|
237
|
+
transform: translateY(0);
|
|
238
|
+
opacity: 1;
|
|
239
|
+
}
|
|
240
240
|
}
|
|
241
241
|
.SVG-module_icon__8J5Ev {
|
|
242
242
|
width: 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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.64.
|
|
3
|
+
"version": "1.64.9",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
"svgo": "^3.3.2",
|
|
121
121
|
"tslib": "^2.7.0",
|
|
122
122
|
"tsx": "^4.17.0",
|
|
123
|
-
"@kaizen/
|
|
124
|
-
"@kaizen/
|
|
123
|
+
"@kaizen/design-tokens": "10.6.2",
|
|
124
|
+
"@kaizen/package-bundler": "1.1.6"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
127
|
"@cultureamp/i18n-react-intl": "^2.5.9",
|
|
@@ -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,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
|