@kaizen/components 1.68.4 → 1.68.6
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/subcomponents/GenericTile/GenericTile.cjs +23 -2
- package/dist/cjs/__actions__/Button/v3/Button.cjs +5 -3
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +24 -3
- package/dist/esm/__actions__/Button/v3/Button.mjs +5 -3
- package/dist/styles.css +124 -312
- package/dist/types/__actions__/Button/v3/Button.d.ts +5 -0
- package/locales/ar.json +8 -0
- package/locales/bg.json +8 -0
- package/locales/cs.json +8 -0
- package/locales/cy.json +8 -0
- package/locales/da.json +8 -0
- package/locales/de.json +8 -0
- package/locales/el.json +8 -0
- package/locales/en-GB.json +8 -0
- package/locales/es-419.json +8 -0
- package/locales/es.json +8 -0
- package/locales/et.json +8 -0
- package/locales/fi.json +8 -0
- package/locales/fr-CA.json +8 -0
- package/locales/fr.json +8 -0
- package/locales/he.json +8 -0
- package/locales/hi.json +8 -0
- package/locales/ht.json +8 -0
- package/locales/hu.json +8 -0
- package/locales/id.json +8 -0
- package/locales/it.json +8 -0
- package/locales/ja.json +8 -0
- package/locales/km-KH.json +8 -0
- package/locales/ko.json +8 -0
- package/locales/lt.json +8 -0
- package/locales/lv.json +8 -0
- package/locales/mi.json +8 -0
- package/locales/ms.json +8 -0
- package/locales/nb.json +8 -0
- package/locales/nl.json +8 -0
- package/locales/pl.json +8 -0
- package/locales/pt-BR.json +8 -0
- package/locales/pt.json +8 -0
- package/locales/ro.json +8 -0
- package/locales/ru.json +8 -0
- package/locales/si-LK.json +8 -0
- package/locales/sk.json +8 -0
- package/locales/sr.json +8 -0
- package/locales/sv.json +8 -0
- package/locales/th.json +8 -0
- package/locales/tl.json +8 -0
- package/locales/tr.json +8 -0
- package/locales/uk.json +8 -0
- package/locales/vi.json +8 -0
- package/locales/zh-TW.json +8 -0
- package/locales/zh.json +8 -0
- package/package.json +1 -1
- package/src/AvatarGroup/AvatarGroup.module.scss +1 -4
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +1 -5
- package/src/DateRangePicker/DateRangePicker.module.scss +5 -29
- package/src/Filter/FilterMultiSelect/subcomponents/MenuPopup/MenuPopup.module.scss +1 -5
- package/src/GuidanceBlock/GuidanceBlock.module.css +5 -42
- package/src/Input/Input/Input.module.scss +5 -40
- package/src/LikertScaleLegacy/LikertScaleLegacy.module.scss +11 -63
- package/src/Tag/_docs/Tag.mdx +7 -6
- package/src/TextField/_docs/TextField.mdx +1 -1
- package/src/Tile/TileGrid/_docs/TileGrid.stories.tsx +41 -8
- package/src/Tile/subcomponents/GenericTile/GenericTile.spec.stories.tsx +58 -0
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +24 -1
- package/src/TitleBlockZen/subcomponents/NavigationTabs.module.scss +2 -14
- package/src/TitleBlockZen/subcomponents/TitleBlockMenuItem.module.scss +1 -5
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +2 -14
- package/src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.module.css +1 -7
- package/src/__actions__/Button/v3/Button.tsx +9 -2
- package/src/__actions__/Button/v3/_docs/Button--api-specification.mdx +2 -2
- package/src/__actions__/Menu/v1/subcomponents/MenuDropdown/MenuDropdown.module.scss +1 -5
- package/src/__actions__/Menu/v1/subcomponents/MenuItem/MenuItem.module.scss +1 -5
- package/src/__future__/Icon/Icon.module.css +7 -11
- package/src/__future__/Tag/Tag/_docs/Tag.mdx +1 -3
|
@@ -34,7 +34,26 @@ var GenericTile = function (_a) {
|
|
|
34
34
|
var _d = React.useState(false),
|
|
35
35
|
isFlipped = _d[0],
|
|
36
36
|
setIsFlipped = _d[1];
|
|
37
|
+
var _e = React.useState(false),
|
|
38
|
+
isDocumentReady = _e[0],
|
|
39
|
+
setIsDocumentReady = _e[1];
|
|
37
40
|
var formatMessage = i18nReactIntl.useIntl().formatMessage;
|
|
41
|
+
var infoButtonRef = React.useRef(null);
|
|
42
|
+
var infoButtonReturnRef = React.useRef(null);
|
|
43
|
+
React.useEffect(function () {
|
|
44
|
+
setIsDocumentReady(true);
|
|
45
|
+
}, []);
|
|
46
|
+
React.useEffect(function () {
|
|
47
|
+
if (!isDocumentReady) {
|
|
48
|
+
setIsDocumentReady(true);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (isFlipped) {
|
|
52
|
+
infoButtonReturnRef.current.focus();
|
|
53
|
+
} else {
|
|
54
|
+
infoButtonRef.current.focus();
|
|
55
|
+
}
|
|
56
|
+
}, [isFlipped]);
|
|
38
57
|
var translatedInfoLabel = formatMessage({
|
|
39
58
|
id: "kzGenericTile.infoButtonLabel",
|
|
40
59
|
defaultMessage: "View more information:",
|
|
@@ -69,7 +88,8 @@ var GenericTile = function (_a) {
|
|
|
69
88
|
return setIsFlipped(true);
|
|
70
89
|
},
|
|
71
90
|
disabled: isFlipped,
|
|
72
|
-
"aria-hidden": isFlipped
|
|
91
|
+
"aria-hidden": isFlipped,
|
|
92
|
+
ref: infoButtonRef
|
|
73
93
|
})), renderTitle(), React__default.default.createElement("div", {
|
|
74
94
|
className: GenericTile_module.children
|
|
75
95
|
}, children && children), footer && React__default.default.createElement("div", {
|
|
@@ -114,7 +134,8 @@ var GenericTile = function (_a) {
|
|
|
114
134
|
return setIsFlipped(false);
|
|
115
135
|
},
|
|
116
136
|
disabled: !isFlipped,
|
|
117
|
-
"aria-hidden": !isFlipped
|
|
137
|
+
"aria-hidden": !isFlipped,
|
|
138
|
+
ref: infoButtonReturnRef
|
|
118
139
|
})), React__default.default.createElement("div", {
|
|
119
140
|
className: GenericTile_module.information
|
|
120
141
|
}, renderInformation(information)));
|
|
@@ -32,8 +32,10 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
32
32
|
_f = _a.hasHiddenPendingLabel,
|
|
33
33
|
propsHasHiddenPendingLabel = _f === void 0 ? false : _f,
|
|
34
34
|
pendingLabel = _a.pendingLabel,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
isReversed = _a.isReversed,
|
|
36
|
+
restProps = tslib.__rest(_a, ["variant", "size", "className", "children", "isDisabled", "isFullWidth", "icon", "iconPosition", "hasHiddenLabel", "isPending", "hasHiddenPendingLabel", "pendingLabel", "isReversed"]);
|
|
37
|
+
var shouldUseReverse = ReversedColors.useReversedColors();
|
|
38
|
+
var isReversedVariant = isReversed !== null && isReversed !== void 0 ? isReversed : shouldUseReverse;
|
|
37
39
|
var pendingProps = isPending ? {
|
|
38
40
|
isPending: isPending,
|
|
39
41
|
hasHiddenPendingLabel: hasHiddenLabel || propsHasHiddenPendingLabel,
|
|
@@ -42,7 +44,7 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
42
44
|
var buttonContentClass = isPending ? !hasHiddenLabel && propsHasHiddenPendingLabel ? Button_module.retainContentWidth : Button_module.hideContentWidth : undefined;
|
|
43
45
|
return React__default.default.createElement(reactAriaComponents.Button, tslib.__assign({
|
|
44
46
|
ref: ref,
|
|
45
|
-
className: mergeClassNames.mergeClassNames(Button_module.button, Button_module[size], hasHiddenLabel && Button_module["".concat(size, "IconButton")], isDisabled && Button_module.isDisabled,
|
|
47
|
+
className: mergeClassNames.mergeClassNames(Button_module.button, Button_module[size], hasHiddenLabel && Button_module["".concat(size, "IconButton")], isDisabled && Button_module.isDisabled, isReversedVariant ? Button_module["".concat(variant, "Reversed")] : Button_module[variant], isFullWidth && Button_module.fullWidth, className),
|
|
46
48
|
isDisabled: isDisabled,
|
|
47
49
|
isPending: isPending
|
|
48
50
|
}, restProps), function (racStateProps) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { useIntl } from '@cultureamp/i18n-react-intl';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { Heading } from '../../../Heading/Heading.mjs';
|
|
@@ -26,7 +26,26 @@ const GenericTile = /*#__PURE__*/function () {
|
|
|
26
26
|
var _d = useState(false),
|
|
27
27
|
isFlipped = _d[0],
|
|
28
28
|
setIsFlipped = _d[1];
|
|
29
|
+
var _e = useState(false),
|
|
30
|
+
isDocumentReady = _e[0],
|
|
31
|
+
setIsDocumentReady = _e[1];
|
|
29
32
|
var formatMessage = useIntl().formatMessage;
|
|
33
|
+
var infoButtonRef = useRef(null);
|
|
34
|
+
var infoButtonReturnRef = useRef(null);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
setIsDocumentReady(true);
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
if (!isDocumentReady) {
|
|
40
|
+
setIsDocumentReady(true);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (isFlipped) {
|
|
44
|
+
infoButtonReturnRef.current.focus();
|
|
45
|
+
} else {
|
|
46
|
+
infoButtonRef.current.focus();
|
|
47
|
+
}
|
|
48
|
+
}, [isFlipped]);
|
|
30
49
|
var translatedInfoLabel = formatMessage({
|
|
31
50
|
id: "kzGenericTile.infoButtonLabel",
|
|
32
51
|
defaultMessage: "View more information:",
|
|
@@ -61,7 +80,8 @@ const GenericTile = /*#__PURE__*/function () {
|
|
|
61
80
|
return setIsFlipped(true);
|
|
62
81
|
},
|
|
63
82
|
disabled: isFlipped,
|
|
64
|
-
"aria-hidden": isFlipped
|
|
83
|
+
"aria-hidden": isFlipped,
|
|
84
|
+
ref: infoButtonRef
|
|
65
85
|
}))), renderTitle(), /*#__PURE__*/React.createElement("div", {
|
|
66
86
|
className: styles.children
|
|
67
87
|
}, children && children), footer && /*#__PURE__*/React.createElement("div", {
|
|
@@ -106,7 +126,8 @@ const GenericTile = /*#__PURE__*/function () {
|
|
|
106
126
|
return setIsFlipped(false);
|
|
107
127
|
},
|
|
108
128
|
disabled: !isFlipped,
|
|
109
|
-
"aria-hidden": !isFlipped
|
|
129
|
+
"aria-hidden": !isFlipped,
|
|
130
|
+
ref: infoButtonReturnRef
|
|
110
131
|
})), /*#__PURE__*/React.createElement("div", {
|
|
111
132
|
className: styles.information
|
|
112
133
|
}, renderInformation(information)));
|
|
@@ -24,8 +24,10 @@ var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
24
24
|
_f = _a.hasHiddenPendingLabel,
|
|
25
25
|
propsHasHiddenPendingLabel = _f === void 0 ? false : _f,
|
|
26
26
|
pendingLabel = _a.pendingLabel,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
isReversed = _a.isReversed,
|
|
28
|
+
restProps = __rest(_a, ["variant", "size", "className", "children", "isDisabled", "isFullWidth", "icon", "iconPosition", "hasHiddenLabel", "isPending", "hasHiddenPendingLabel", "pendingLabel", "isReversed"]);
|
|
29
|
+
var shouldUseReverse = useReversedColors();
|
|
30
|
+
var isReversedVariant = isReversed !== null && isReversed !== void 0 ? isReversed : shouldUseReverse;
|
|
29
31
|
var pendingProps = isPending ? {
|
|
30
32
|
isPending: isPending,
|
|
31
33
|
hasHiddenPendingLabel: hasHiddenLabel || propsHasHiddenPendingLabel,
|
|
@@ -34,7 +36,7 @@ var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
34
36
|
var buttonContentClass = isPending ? !hasHiddenLabel && propsHasHiddenPendingLabel ? styles.retainContentWidth : styles.hideContentWidth : undefined;
|
|
35
37
|
return /*#__PURE__*/React.createElement(Button$1, __assign({
|
|
36
38
|
ref: ref,
|
|
37
|
-
className: mergeClassNames(styles.button, styles[size], hasHiddenLabel && styles["".concat(size, "IconButton")], isDisabled && styles.isDisabled,
|
|
39
|
+
className: mergeClassNames(styles.button, styles[size], hasHiddenLabel && styles["".concat(size, "IconButton")], isDisabled && styles.isDisabled, isReversedVariant ? styles["".concat(variant, "Reversed")] : styles[variant], isFullWidth && styles.fullWidth, className),
|
|
38
40
|
isDisabled: isDisabled,
|
|
39
41
|
isPending: isPending
|
|
40
42
|
}, restProps), function (racStateProps) {
|