@geotab/zenith 3.8.0-beta.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/button/button.d.ts +1 -2
- package/dist/button/button.js +3 -3
- package/dist/calendar/calendar.js +1 -1
- package/dist/card/components/cardButton/cardButton.d.ts +1 -2
- package/dist/card/components/cardButton/cardButton.js +3 -5
- package/dist/dateInputInner/dateInputInnerControlBlock.js +8 -12
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +0 -3
- package/dist/formFieldError/formFieldError.d.ts +1 -2
- package/dist/formFieldError/formFieldError.js +2 -2
- package/dist/rangeRaw/rangeRaw.js +1 -7
- package/dist/summaryTile/summaryTile.d.ts +1 -3
- package/dist/summaryTile/summaryTile.js +1 -2
- package/dist/toggleButtonRaw/toggleButtonRaw.js +1 -3
- package/dist/toggleButtonRaw/types.d.ts +0 -1
- package/dist/tooltip/tooltip.js +2 -10
- package/esm/button/button.d.ts +1 -2
- package/esm/button/button.js +3 -3
- package/esm/calendar/calendar.js +1 -1
- package/esm/card/components/cardButton/cardButton.d.ts +1 -2
- package/esm/card/components/cardButton/cardButton.js +3 -5
- package/esm/dateInputInner/dateInputInnerControlBlock.js +9 -13
- package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +0 -3
- package/esm/formFieldError/formFieldError.d.ts +1 -2
- package/esm/formFieldError/formFieldError.js +2 -2
- package/esm/rangeRaw/rangeRaw.js +1 -7
- package/esm/summaryTile/summaryTile.d.ts +1 -3
- package/esm/summaryTile/summaryTile.js +1 -2
- package/esm/toggleButtonRaw/toggleButtonRaw.js +1 -3
- package/esm/toggleButtonRaw/types.d.ts +0 -1
- package/esm/tooltip/tooltip.js +2 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
56
56
|
|
|
57
57
|
### 3.8.0
|
|
58
58
|
|
|
59
|
-
- Create
|
|
59
|
+
- Create FileUpload component
|
|
60
60
|
- Improve Accordion component Storybook documentation
|
|
61
61
|
- Improve Divider component Storybook documentation
|
|
62
62
|
- Improve accessibility for DataGrid sorting
|
package/dist/button/button.d.ts
CHANGED
|
@@ -24,9 +24,8 @@ export interface IButton extends IZenComponentProps, IZenGridItem {
|
|
|
24
24
|
ref?: Ref<HTMLButtonElement | null>;
|
|
25
25
|
role?: string;
|
|
26
26
|
ariaLabel?: string;
|
|
27
|
-
dataAnalyticsId?: string;
|
|
28
27
|
}
|
|
29
28
|
export declare const Button: {
|
|
30
|
-
({ className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel,
|
|
29
|
+
({ className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel, ...other }: IButton): import("react/jsx-runtime").JSX.Element;
|
|
31
30
|
displayName: string;
|
|
32
31
|
};
|
package/dist/button/button.js
CHANGED
|
@@ -19,14 +19,14 @@ const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
|
19
19
|
const filterGridProps_1 = require("../gridLayout/utils/filterGridProps");
|
|
20
20
|
const useMobileClassName_1 = require("../utils/theme/useMobileClassName");
|
|
21
21
|
const Button = (_a) => {
|
|
22
|
-
var { className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel
|
|
22
|
+
var { className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel } = _a, other = __rest(_a, ["className", "type", "disabled", "id", "title", "onClick", "onMouseOver", "onMouseOut", "onMouseDown", "onMouseUp", "onKeyDown", "onKeyUp", "children", "link", "target", "htmlType", "rel", "ref", "name", "onBlur", "role", "ariaLabel"]);
|
|
23
23
|
const modifierClassName = type && type !== buttonType_1.ButtonType.Secondary ? `zen-button--${type}` : "";
|
|
24
24
|
const disabledClassName = disabled ? "zen-button--disabled" : "";
|
|
25
25
|
const driveClasses = (0, useDriveClassName_1.useDriveClassName)("zen-button");
|
|
26
26
|
const ariaLabelValue = ariaLabel || title;
|
|
27
27
|
const mobileClasses = (0, useMobileClassName_1.useMobileClassName)("zen-button");
|
|
28
|
-
const commonArgs = Object.assign(Object.assign(
|
|
29
|
-
title }, (ariaLabelValue ? { "aria-label": ariaLabelValue } : {})),
|
|
28
|
+
const commonArgs = Object.assign(Object.assign({ id,
|
|
29
|
+
title }, (ariaLabelValue ? { "aria-label": ariaLabelValue } : {})), { className: (0, classNames_1.classNames)(["zen-button", mobileClasses || driveClasses || "", modifierClassName, disabledClassName, className !== null && className !== void 0 ? className : ""]) });
|
|
30
30
|
if (link) {
|
|
31
31
|
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ role: "link", rel: rel, target: target, href: disabled ? undefined : link, "aria-disabled": disabled, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onClick: onClick }, commonArgs, (0, filterGridProps_1.filterGridProps)(other), { children: children })));
|
|
32
32
|
}
|
|
@@ -645,7 +645,7 @@ const buttonType_1 = require("../button/buttonType");
|
|
|
645
645
|
const zen_1 = require("../utils/zen");
|
|
646
646
|
const DEFAULT_START_DAY_OF_WEEK = 0;
|
|
647
647
|
const DEFAULT_YEAR_RANGE = 20;
|
|
648
|
-
exports.monthLabelsArray = ["Jan", "Feb", "Mar", "Apr", "
|
|
648
|
+
exports.monthLabelsArray = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
649
649
|
const Calendar = ({
|
|
650
650
|
id,
|
|
651
651
|
value,
|
|
@@ -10,6 +10,5 @@ export interface ICardButton extends IZenIdComponentProps {
|
|
|
10
10
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
11
11
|
link?: string;
|
|
12
12
|
target?: HTMLAttributeAnchorTarget;
|
|
13
|
-
dataAnalyticsId?: string;
|
|
14
13
|
}
|
|
15
|
-
export declare const CardButton: ({ children, disabled, icon, name, onClick, link, className, target: linkTarget
|
|
14
|
+
export declare const CardButton: ({ children, disabled, icon, name, onClick, link, className, target: linkTarget }: ICardButton) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,14 +11,12 @@ const iconChevronTopSmall_1 = require("../../../icons/iconChevronTopSmall");
|
|
|
11
11
|
const menu_1 = require("../../../menu/menu");
|
|
12
12
|
const useDriveClassName_1 = require("../../../utils/theme/useDriveClassName");
|
|
13
13
|
const useDrive_1 = require("../../../utils/theme/useDrive");
|
|
14
|
-
const
|
|
15
|
-
const CardButton = ({ children, disabled = false, icon, name, onClick, link, className, target: linkTarget, dataAnalyticsId }) => {
|
|
14
|
+
const CardButton = ({ children, disabled = false, icon, name, onClick, link, className, target: linkTarget }) => {
|
|
16
15
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
17
16
|
const triggerRef = (0, react_1.useRef)(null);
|
|
18
17
|
const content = [];
|
|
19
18
|
const cardButtonDriveClasses = (0, useDriveClassName_1.useDriveClassName)("zen-card-button");
|
|
20
19
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
21
|
-
const analyticsId = dataAnalyticsId || (0, toKebabCase_1.toKebabCase)(name);
|
|
22
20
|
react_1.Children.forEach(children, (el) => {
|
|
23
21
|
if (el.type === menu_1.Menu.Item) {
|
|
24
22
|
content.push(el);
|
|
@@ -32,9 +30,9 @@ const CardButton = ({ children, disabled = false, icon, name, onClick, link, cla
|
|
|
32
30
|
}
|
|
33
31
|
onClick === null || onClick === void 0 ? void 0 : onClick(...args);
|
|
34
32
|
};
|
|
35
|
-
const renderLink = () => ((0, jsx_runtime_1.jsxs)(button_1.Button, { disabled: disabled, type: "tertiary", link: link, target: linkTarget, title: name,
|
|
33
|
+
const renderLink = () => ((0, jsx_runtime_1.jsxs)(button_1.Button, { disabled: disabled, type: "tertiary", link: link, target: linkTarget, title: name, className: (0, classNames_1.classNames)([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && (0, react_1.createElement)(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: name })] }));
|
|
36
34
|
const renderButton = () => {
|
|
37
|
-
const trigger = ((0, jsx_runtime_1.jsxs)(button_1.Button, { htmlType: "button", ref: triggerRef, disabled: disabled, type: "tertiary", onClick: onButtonClickHandler, title: name,
|
|
35
|
+
const trigger = ((0, jsx_runtime_1.jsxs)(button_1.Button, { htmlType: "button", ref: triggerRef, disabled: disabled, type: "tertiary", onClick: onButtonClickHandler, title: name, className: (0, classNames_1.classNames)([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && (0, react_1.createElement)(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: name }), !!content.length &&
|
|
38
36
|
(isOpen ? ((0, jsx_runtime_1.jsx)(iconChevronTopSmall_1.IconChevronTopSmall, { size: isDrive ? "huge" : "large", className: "zen-caption__post-content" })) : ((0, jsx_runtime_1.jsx)(iconChevronDownSmall_1.IconChevronDownSmall, { size: isDrive ? "huge" : "large", className: "zen-caption__post-content" })))] }));
|
|
39
37
|
return content.length ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [trigger, (0, jsx_runtime_1.jsx)(controlledMenu_1.ControlledMenu, { title: name, isOpen: isOpen, setIsOpen: setIsOpen, triggerRef: triggerRef, children: content })] })) : (trigger);
|
|
40
38
|
};
|
|
@@ -87,28 +87,23 @@ const DateInputInnerControlBlock = props => {
|
|
|
87
87
|
assistiveText,
|
|
88
88
|
ref
|
|
89
89
|
} = props;
|
|
90
|
-
const generatedId = (0, react_1.useId)();
|
|
91
|
-
const fieldId = id || generatedId;
|
|
92
90
|
const {
|
|
93
91
|
translate
|
|
94
92
|
} = (0, useLanguage_1.useLanguage)();
|
|
95
93
|
const driveAssistiveClass = (0, useDriveClassName_1.useDriveClassName)("zen-form-field__text");
|
|
96
94
|
const isHasDateError = requireSelection && !dateText;
|
|
97
95
|
const isHasTimeError = requireSelection && !timePickerValue;
|
|
98
|
-
const dateErrorId = `${fieldId}-date-error`;
|
|
99
|
-
const timeErrorId = `${fieldId}-time-error`;
|
|
100
96
|
const memoizedDateInput = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(textInputRaw_1.TextInputRaw, {
|
|
101
97
|
className: (0, classNames_1.classNames)(["zen-date-input-inner__text-input", isActiveField ? "zen-date-input-inner__text-input--active" : ""]),
|
|
102
|
-
id:
|
|
98
|
+
id: id,
|
|
103
99
|
value: dateText,
|
|
104
100
|
onChange: handleSetDateText,
|
|
105
101
|
onBlur: onBlurDateChangeHandler,
|
|
106
102
|
placeholder: placeholder,
|
|
107
103
|
autocomplete: "off",
|
|
108
104
|
isError: isHasDateError,
|
|
109
|
-
ariaDescribedby: isHasDateError ? dateErrorId : undefined,
|
|
110
105
|
ref: ref
|
|
111
|
-
}), [dateText, handleSetDateText,
|
|
106
|
+
}), [dateText, handleSetDateText, id, isActiveField, isHasDateError, onBlurDateChangeHandler, placeholder, ref]);
|
|
112
107
|
const memoizedTimeSelect = (0, react_1.useMemo)(() => selectTime ? (0, jsx_runtime_1.jsxs)("div", {
|
|
113
108
|
className: "zen-date-input-inner__inputs-block-item",
|
|
114
109
|
children: [(0, jsx_runtime_1.jsx)(timePicker_1.TimePicker, {
|
|
@@ -116,16 +111,18 @@ const DateInputInnerControlBlock = props => {
|
|
|
116
111
|
value: timePickerValue,
|
|
117
112
|
onChange: timeChangeHandler,
|
|
118
113
|
isMobileView: isMobileView,
|
|
119
|
-
fullWidth: true
|
|
114
|
+
fullWidth: true,
|
|
115
|
+
// eslint-disable-next-line
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
dataTimeId: id
|
|
120
118
|
}), isHasTimeError ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, {
|
|
121
|
-
id: timeErrorId,
|
|
122
119
|
error: translate("The time must be set")
|
|
123
120
|
}) : null]
|
|
124
|
-
}) : null, [isActiveField, isHasTimeError, isMobileView, selectTime, timeChangeHandler, timePickerValue, translate,
|
|
121
|
+
}) : null, [isActiveField, isHasTimeError, isMobileView, selectTime, timeChangeHandler, timePickerValue, translate, id]);
|
|
125
122
|
return (0, jsx_runtime_1.jsxs)("div", {
|
|
126
123
|
className: (0, classNames_1.classNames)(["zen-date-input-inner__control-block", className || ""]),
|
|
127
124
|
children: [title ? (0, jsx_runtime_1.jsx)("label", {
|
|
128
|
-
htmlFor:
|
|
125
|
+
htmlFor: id,
|
|
129
126
|
className: "zen-date-input-inner__label",
|
|
130
127
|
children: title
|
|
131
128
|
}) : null, (0, jsx_runtime_1.jsxs)("div", {
|
|
@@ -133,7 +130,6 @@ const DateInputInnerControlBlock = props => {
|
|
|
133
130
|
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
134
131
|
className: "zen-date-input-inner__inputs-block-item",
|
|
135
132
|
children: [memoizedDateInput, isHasDateError ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, {
|
|
136
|
-
id: dateErrorId,
|
|
137
133
|
error: translate("The date must be set")
|
|
138
134
|
}) : null]
|
|
139
135
|
}), memoizedTimeSelect]
|
|
@@ -86,7 +86,6 @@ const FiltersBarSidePanelRange = ({
|
|
|
86
86
|
}) => {
|
|
87
87
|
const generatedId = (0, react_1.useId)();
|
|
88
88
|
const intId = id || generatedId;
|
|
89
|
-
const rangeErrorId = `${intId}-error`;
|
|
90
89
|
const [currentValue, setCurrentValue] = (0, react_1.useState)(value);
|
|
91
90
|
const [errorType, setErrorType] = (0, react_1.useState)(undefined);
|
|
92
91
|
const prevValueRef = (0, react_1.useRef)(value);
|
|
@@ -161,13 +160,11 @@ const FiltersBarSidePanelRange = ({
|
|
|
161
160
|
return (0, jsx_runtime_1.jsxs)("div", {
|
|
162
161
|
ref: setFieldsContainerRef,
|
|
163
162
|
id: intId,
|
|
164
|
-
"aria-describedby": errorType !== undefined && directionState === "row" ? rangeErrorId : undefined,
|
|
165
163
|
className: (0, classNames_1.classNames)(["zen-filters-bar-side-panel-range", className || ""]),
|
|
166
164
|
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
167
165
|
className: rangeFieldContainerClasses,
|
|
168
166
|
children: [memoizedMinRangeField, memoizedMaxRangeField]
|
|
169
167
|
}), errorType !== undefined && directionState === "row" ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, {
|
|
170
|
-
id: rangeErrorId,
|
|
171
168
|
className: "zen-filters-bar-side-panel-range__error",
|
|
172
169
|
error: [(0, rangeHelper_1.getErrorString)("min", currentValue.min, translate, errorType, min, max) || "", (0, rangeHelper_1.getErrorString)("max", currentValue.max, translate, errorType, min, max) || ""]
|
|
173
170
|
}) : null]
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "./formFieldError.less";
|
|
2
2
|
interface IFormFieldError {
|
|
3
|
-
id?: string;
|
|
4
3
|
className?: string;
|
|
5
4
|
error?: string | string[];
|
|
6
5
|
}
|
|
7
|
-
export declare const FormFieldError: ({
|
|
6
|
+
export declare const FormFieldError: ({ className, error }: IFormFieldError) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
7
|
export {};
|
|
@@ -6,12 +6,12 @@ const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
|
6
6
|
const iconException_1 = require("../icons/iconException");
|
|
7
7
|
const useDrive_1 = require("../utils/theme/useDrive");
|
|
8
8
|
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
9
|
-
const FormFieldError = ({
|
|
9
|
+
const FormFieldError = ({ className, error }) => {
|
|
10
10
|
const driveComponentClass = (0, useDriveClassName_1.useDriveClassName)("zen-form-field-error");
|
|
11
11
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
12
12
|
const errorStrings = Array.isArray(error)
|
|
13
13
|
? error.filter(el => el).map((erStr, ind) => (0, jsx_runtime_1.jsx)("div", { children: erStr }, `error_str_${ind}`))
|
|
14
14
|
: error && (0, jsx_runtime_1.jsx)("div", { children: error });
|
|
15
|
-
return error ? ((0, jsx_runtime_1.jsxs)("
|
|
15
|
+
return error ? ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-form-field-error", driveComponentClass || "", className || ""]), children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-form-field-error__icon-container", children: (0, jsx_runtime_1.jsx)(iconException_1.IconException, { className: "zen-form-field-error__error-icon", size: isDrive ? "large" : "bigger" }) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-form-field-error__error-text", children: errorStrings })] })) : null;
|
|
16
16
|
};
|
|
17
17
|
exports.FormFieldError = FormFieldError;
|
|
@@ -260,9 +260,6 @@ const RangeRaw = props => {
|
|
|
260
260
|
} else {
|
|
261
261
|
defaultValueInner = defaultValue;
|
|
262
262
|
}
|
|
263
|
-
const generatedId = (0, react_1.useId)();
|
|
264
|
-
const intId = id || generatedId;
|
|
265
|
-
const rangeErrorId = `${intId}-error`;
|
|
266
263
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
267
264
|
const [currentValue, setCurrentValue] = (0, react_1.useState)(value);
|
|
268
265
|
const [errorType, setErrorType] = (0, react_1.useState)(undefined);
|
|
@@ -411,17 +408,14 @@ const RangeRaw = props => {
|
|
|
411
408
|
const memoizedContent = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsxs)("div", {
|
|
412
409
|
className: "zen-range__fields-wrapper",
|
|
413
410
|
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
414
|
-
id: intId,
|
|
415
411
|
ref: setFieldsContainerRef,
|
|
416
|
-
"aria-describedby": errorType !== undefined && directionState === "row" ? rangeErrorId : undefined,
|
|
417
412
|
className: (0, classNames_1.classNames)(["zen-range__fields-container", directionState === "row" ? "zen-range__fields-container--row" : "zen-range__fields-container--column"]),
|
|
418
413
|
children: [memoizedMinRangeField, memoizedMaxRangeField]
|
|
419
414
|
}), errorType !== undefined && directionState === "row" ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, {
|
|
420
|
-
id: rangeErrorId,
|
|
421
415
|
className: "zen-range__error",
|
|
422
416
|
error: [(0, rangeHelper_1.getErrorString)("min", currentValue.min, translate, errorType, min, max) || "", (0, rangeHelper_1.getErrorString)("max", currentValue.max, translate, errorType, min, max) || ""]
|
|
423
417
|
}) : null]
|
|
424
|
-
}), [setFieldsContainerRef, directionState, memoizedMinRangeField, memoizedMaxRangeField, errorType, currentValue.min, currentValue.max, translate, min, max
|
|
418
|
+
}), [setFieldsContainerRef, directionState, memoizedMinRangeField, memoizedMaxRangeField, errorType, currentValue.min, currentValue.max, translate, min, max]);
|
|
425
419
|
const memoizedDesktopView = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, {
|
|
426
420
|
isOpen: isOpen,
|
|
427
421
|
className: (0, classNames_1.classNames)(["zen-range-popup zen-shadow-dropdown-default", className ? className : ""]),
|
|
@@ -54,8 +54,6 @@ export interface ISummaryTile extends IZenComponentProps, IZenGridItem {
|
|
|
54
54
|
tooltipSize?: TooltipSize;
|
|
55
55
|
/** When `true`, shows a skeleton placeholder while data is being fetched — two skeleton elements replace the title and content areas. */
|
|
56
56
|
isLoading?: boolean;
|
|
57
|
-
/** When `true` and the tile is interactive, sets `aria-current="page"` on the tile. */
|
|
58
|
-
isSelected?: boolean;
|
|
59
57
|
/** Analytics identifier applied as `data-analytics-id`. Defaults to a kebab-cased version of `title`. */
|
|
60
58
|
dataAnalyticsId?: string;
|
|
61
59
|
}
|
|
@@ -75,6 +73,6 @@ export declare const SummaryTileDisplayName = "SummaryTile";
|
|
|
75
73
|
* Use inside `SummaryTileBar` to group multiple tiles in a scrollable row.
|
|
76
74
|
*/
|
|
77
75
|
export declare const SummaryTile: {
|
|
78
|
-
({ className, children, size, title, tileType, id, onClick, tooltipText, tooltipAlignment, isLoading,
|
|
76
|
+
({ className, children, size, title, tileType, id, onClick, tooltipText, tooltipAlignment, isLoading, dataAnalyticsId }: ISummaryTile): import("react/jsx-runtime").JSX.Element;
|
|
79
77
|
displayName: string;
|
|
80
78
|
};
|
|
@@ -122,7 +122,6 @@ const SummaryTile = ({
|
|
|
122
122
|
tooltipText,
|
|
123
123
|
tooltipAlignment = "top",
|
|
124
124
|
isLoading = false,
|
|
125
|
-
isSelected = false,
|
|
126
125
|
dataAnalyticsId
|
|
127
126
|
}) => {
|
|
128
127
|
const {
|
|
@@ -178,7 +177,7 @@ const SummaryTile = ({
|
|
|
178
177
|
}),
|
|
179
178
|
children: tooltipText
|
|
180
179
|
}) : null;
|
|
181
|
-
const ariaCurrentProps =
|
|
180
|
+
const ariaCurrentProps = tileType === SummaryTileType.Active && isInteractive ? {
|
|
182
181
|
"aria-current": "page"
|
|
183
182
|
} : {};
|
|
184
183
|
// When both onClick and tooltipText are present, the tooltip trigger
|
|
@@ -110,8 +110,7 @@ const ToggleButtonRaw = props => {
|
|
|
110
110
|
children,
|
|
111
111
|
isReverted,
|
|
112
112
|
isReadOnly,
|
|
113
|
-
value: valueProp
|
|
114
|
-
dataAnalyticsId
|
|
113
|
+
value: valueProp
|
|
115
114
|
} = props;
|
|
116
115
|
const driveClassesToggler = (0, useDriveClassName_1.useDriveClassName)("zen-toggler");
|
|
117
116
|
const driveClassesComponent = (0, useDriveClassName_1.useDriveClassName)("zen-toggler-component");
|
|
@@ -141,7 +140,6 @@ const ToggleButtonRaw = props => {
|
|
|
141
140
|
}
|
|
142
141
|
return (0, jsx_runtime_1.jsxs)("div", {
|
|
143
142
|
className: (0, classNames_1.classNames)(["zen-toggler", driveClassesToggler || "", className || ""]),
|
|
144
|
-
"data-analytics-id": dataAnalyticsId,
|
|
145
143
|
children: [(0, jsx_runtime_1.jsx)(triStateCheckbox_1.TriStateCheckbox, {
|
|
146
144
|
name: name,
|
|
147
145
|
className: "zen-toggler__input",
|
|
@@ -6,7 +6,6 @@ interface IToggleButtonBaseRaw extends IZenComponentProps {
|
|
|
6
6
|
title?: string;
|
|
7
7
|
isReverted?: boolean;
|
|
8
8
|
isReadOnly?: boolean;
|
|
9
|
-
dataAnalyticsId?: string;
|
|
10
9
|
}
|
|
11
10
|
export interface IToggleButtonDefaultRaw extends IToggleButtonBaseRaw {
|
|
12
11
|
onChange?: (checked: boolean) => void;
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -138,8 +138,7 @@ const EventWrapper = ({
|
|
|
138
138
|
handleUniversalClick,
|
|
139
139
|
setTooltipVisible,
|
|
140
140
|
timerRef,
|
|
141
|
-
timerMouseOutRef
|
|
142
|
-
tooltipRef
|
|
141
|
+
timerMouseOutRef
|
|
143
142
|
}) => {
|
|
144
143
|
const isCurrentDeviceDesktop = deviceType === deviceType_1.DeviceType.Desktop;
|
|
145
144
|
const originalOnClick = children.props.onClick;
|
|
@@ -164,13 +163,7 @@ const EventWrapper = ({
|
|
|
164
163
|
}, TOOLTIP_VISIBILITY_DELAY);
|
|
165
164
|
},
|
|
166
165
|
onFocus: () => setTooltipVisible(true),
|
|
167
|
-
onBlur: () =>
|
|
168
|
-
// Skip if the tooltip DOM was already detached
|
|
169
|
-
if (tooltipRef.current && !tooltipRef.current.isConnected) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
setTooltipVisible(false);
|
|
173
|
-
},
|
|
166
|
+
onBlur: () => setTooltipVisible(false),
|
|
174
167
|
onKeyDown: onKeyDownHandler,
|
|
175
168
|
onClick: composedOnClick
|
|
176
169
|
};
|
|
@@ -272,7 +265,6 @@ const Tooltip = ({
|
|
|
272
265
|
setTooltipVisible: setTooltipVisible,
|
|
273
266
|
timerRef: timerRef,
|
|
274
267
|
timerMouseOutRef: timerMouseOutRef,
|
|
275
|
-
tooltipRef: tooltipRef,
|
|
276
268
|
children: react_1.default.cloneElement(tooltipTrigger, Object.assign({
|
|
277
269
|
ref: triggerRef
|
|
278
270
|
}, triggerCloneProps))
|
package/esm/button/button.d.ts
CHANGED
|
@@ -24,9 +24,8 @@ export interface IButton extends IZenComponentProps, IZenGridItem {
|
|
|
24
24
|
ref?: Ref<HTMLButtonElement | null>;
|
|
25
25
|
role?: string;
|
|
26
26
|
ariaLabel?: string;
|
|
27
|
-
dataAnalyticsId?: string;
|
|
28
27
|
}
|
|
29
28
|
export declare const Button: {
|
|
30
|
-
({ className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel,
|
|
29
|
+
({ className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel, ...other }: IButton): import("react/jsx-runtime").JSX.Element;
|
|
31
30
|
displayName: string;
|
|
32
31
|
};
|
package/esm/button/button.js
CHANGED
|
@@ -16,14 +16,14 @@ import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
|
16
16
|
import { filterGridProps } from "../gridLayout/utils/filterGridProps";
|
|
17
17
|
import { useMobileClassName } from "../utils/theme/useMobileClassName";
|
|
18
18
|
export const Button = (_a) => {
|
|
19
|
-
var { className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel
|
|
19
|
+
var { className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel } = _a, other = __rest(_a, ["className", "type", "disabled", "id", "title", "onClick", "onMouseOver", "onMouseOut", "onMouseDown", "onMouseUp", "onKeyDown", "onKeyUp", "children", "link", "target", "htmlType", "rel", "ref", "name", "onBlur", "role", "ariaLabel"]);
|
|
20
20
|
const modifierClassName = type && type !== ButtonType.Secondary ? `zen-button--${type}` : "";
|
|
21
21
|
const disabledClassName = disabled ? "zen-button--disabled" : "";
|
|
22
22
|
const driveClasses = useDriveClassName("zen-button");
|
|
23
23
|
const ariaLabelValue = ariaLabel || title;
|
|
24
24
|
const mobileClasses = useMobileClassName("zen-button");
|
|
25
|
-
const commonArgs = Object.assign(Object.assign(
|
|
26
|
-
title }, (ariaLabelValue ? { "aria-label": ariaLabelValue } : {})),
|
|
25
|
+
const commonArgs = Object.assign(Object.assign({ id,
|
|
26
|
+
title }, (ariaLabelValue ? { "aria-label": ariaLabelValue } : {})), { className: classNames(["zen-button", mobileClasses || driveClasses || "", modifierClassName, disabledClassName, className !== null && className !== void 0 ? className : ""]) });
|
|
27
27
|
if (link) {
|
|
28
28
|
return (_jsx("a", Object.assign({ role: "link", rel: rel, target: target, href: disabled ? undefined : link, "aria-disabled": disabled, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onClick: onClick }, commonArgs, filterGridProps(other), { children: children })));
|
|
29
29
|
}
|
package/esm/calendar/calendar.js
CHANGED
|
@@ -637,7 +637,7 @@ injectString("ro-RO", "Next month", "Luna urm\u0103toare");
|
|
|
637
637
|
injectString("ar-SA", "Next month", "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u062A\u0627\u0644\u064A");
|
|
638
638
|
const DEFAULT_START_DAY_OF_WEEK = 0;
|
|
639
639
|
const DEFAULT_YEAR_RANGE = 20;
|
|
640
|
-
export const monthLabelsArray = ["Jan", "Feb", "Mar", "Apr", "
|
|
640
|
+
export const monthLabelsArray = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
641
641
|
export const Calendar = ({
|
|
642
642
|
id,
|
|
643
643
|
value,
|
|
@@ -10,6 +10,5 @@ export interface ICardButton extends IZenIdComponentProps {
|
|
|
10
10
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
11
11
|
link?: string;
|
|
12
12
|
target?: HTMLAttributeAnchorTarget;
|
|
13
|
-
dataAnalyticsId?: string;
|
|
14
13
|
}
|
|
15
|
-
export declare const CardButton: ({ children, disabled, icon, name, onClick, link, className, target: linkTarget
|
|
14
|
+
export declare const CardButton: ({ children, disabled, icon, name, onClick, link, className, target: linkTarget }: ICardButton) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,14 +8,12 @@ import { IconChevronTopSmall } from "../../../icons/iconChevronTopSmall";
|
|
|
8
8
|
import { Menu } from "../../../menu/menu";
|
|
9
9
|
import { useDriveClassName } from "../../../utils/theme/useDriveClassName";
|
|
10
10
|
import { useDrive } from "../../../utils/theme/useDrive";
|
|
11
|
-
|
|
12
|
-
export const CardButton = ({ children, disabled = false, icon, name, onClick, link, className, target: linkTarget, dataAnalyticsId }) => {
|
|
11
|
+
export const CardButton = ({ children, disabled = false, icon, name, onClick, link, className, target: linkTarget }) => {
|
|
13
12
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
13
|
const triggerRef = useRef(null);
|
|
15
14
|
const content = [];
|
|
16
15
|
const cardButtonDriveClasses = useDriveClassName("zen-card-button");
|
|
17
16
|
const isDrive = useDrive();
|
|
18
|
-
const analyticsId = dataAnalyticsId || toKebabCase(name);
|
|
19
17
|
Children.forEach(children, (el) => {
|
|
20
18
|
if (el.type === Menu.Item) {
|
|
21
19
|
content.push(el);
|
|
@@ -29,9 +27,9 @@ export const CardButton = ({ children, disabled = false, icon, name, onClick, li
|
|
|
29
27
|
}
|
|
30
28
|
onClick === null || onClick === void 0 ? void 0 : onClick(...args);
|
|
31
29
|
};
|
|
32
|
-
const renderLink = () => (_jsxs(Button, { disabled: disabled, type: "tertiary", link: link, target: linkTarget, title: name,
|
|
30
|
+
const renderLink = () => (_jsxs(Button, { disabled: disabled, type: "tertiary", link: link, target: linkTarget, title: name, className: classNames([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && createElement(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), _jsx("span", { className: "zen-caption__content", children: name })] }));
|
|
33
31
|
const renderButton = () => {
|
|
34
|
-
const trigger = (_jsxs(Button, { htmlType: "button", ref: triggerRef, disabled: disabled, type: "tertiary", onClick: onButtonClickHandler, title: name,
|
|
32
|
+
const trigger = (_jsxs(Button, { htmlType: "button", ref: triggerRef, disabled: disabled, type: "tertiary", onClick: onButtonClickHandler, title: name, className: classNames([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && createElement(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), _jsx("span", { className: "zen-caption__content", children: name }), !!content.length &&
|
|
35
33
|
(isOpen ? (_jsx(IconChevronTopSmall, { size: isDrive ? "huge" : "large", className: "zen-caption__post-content" })) : (_jsx(IconChevronDownSmall, { size: isDrive ? "huge" : "large", className: "zen-caption__post-content" })))] }));
|
|
36
34
|
return content.length ? (_jsxs(_Fragment, { children: [trigger, _jsx(ControlledMenu, { title: name, isOpen: isOpen, setIsOpen: setIsOpen, triggerRef: triggerRef, children: content })] })) : (trigger);
|
|
37
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { injectString } from "../utils/localization/translationsDictionary";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useMemo } from "react";
|
|
4
4
|
import { TextInputRaw } from "../textInputRaw/textInputRaw";
|
|
5
5
|
import { TimePicker } from "../timePicker/timePicker";
|
|
6
6
|
import { useLanguage } from "../utils/localization/useLanguage";
|
|
@@ -79,28 +79,23 @@ export const DateInputInnerControlBlock = props => {
|
|
|
79
79
|
assistiveText,
|
|
80
80
|
ref
|
|
81
81
|
} = props;
|
|
82
|
-
const generatedId = useId();
|
|
83
|
-
const fieldId = id || generatedId;
|
|
84
82
|
const {
|
|
85
83
|
translate
|
|
86
84
|
} = useLanguage();
|
|
87
85
|
const driveAssistiveClass = useDriveClassName("zen-form-field__text");
|
|
88
86
|
const isHasDateError = requireSelection && !dateText;
|
|
89
87
|
const isHasTimeError = requireSelection && !timePickerValue;
|
|
90
|
-
const dateErrorId = `${fieldId}-date-error`;
|
|
91
|
-
const timeErrorId = `${fieldId}-time-error`;
|
|
92
88
|
const memoizedDateInput = useMemo(() => _jsx(TextInputRaw, {
|
|
93
89
|
className: classNames(["zen-date-input-inner__text-input", isActiveField ? "zen-date-input-inner__text-input--active" : ""]),
|
|
94
|
-
id:
|
|
90
|
+
id: id,
|
|
95
91
|
value: dateText,
|
|
96
92
|
onChange: handleSetDateText,
|
|
97
93
|
onBlur: onBlurDateChangeHandler,
|
|
98
94
|
placeholder: placeholder,
|
|
99
95
|
autocomplete: "off",
|
|
100
96
|
isError: isHasDateError,
|
|
101
|
-
ariaDescribedby: isHasDateError ? dateErrorId : undefined,
|
|
102
97
|
ref: ref
|
|
103
|
-
}), [dateText, handleSetDateText,
|
|
98
|
+
}), [dateText, handleSetDateText, id, isActiveField, isHasDateError, onBlurDateChangeHandler, placeholder, ref]);
|
|
104
99
|
const memoizedTimeSelect = useMemo(() => selectTime ? _jsxs("div", {
|
|
105
100
|
className: "zen-date-input-inner__inputs-block-item",
|
|
106
101
|
children: [_jsx(TimePicker, {
|
|
@@ -108,16 +103,18 @@ export const DateInputInnerControlBlock = props => {
|
|
|
108
103
|
value: timePickerValue,
|
|
109
104
|
onChange: timeChangeHandler,
|
|
110
105
|
isMobileView: isMobileView,
|
|
111
|
-
fullWidth: true
|
|
106
|
+
fullWidth: true,
|
|
107
|
+
// eslint-disable-next-line
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
dataTimeId: id
|
|
112
110
|
}), isHasTimeError ? _jsx(FormFieldError, {
|
|
113
|
-
id: timeErrorId,
|
|
114
111
|
error: translate("The time must be set")
|
|
115
112
|
}) : null]
|
|
116
|
-
}) : null, [isActiveField, isHasTimeError, isMobileView, selectTime, timeChangeHandler, timePickerValue, translate,
|
|
113
|
+
}) : null, [isActiveField, isHasTimeError, isMobileView, selectTime, timeChangeHandler, timePickerValue, translate, id]);
|
|
117
114
|
return _jsxs("div", {
|
|
118
115
|
className: classNames(["zen-date-input-inner__control-block", className || ""]),
|
|
119
116
|
children: [title ? _jsx("label", {
|
|
120
|
-
htmlFor:
|
|
117
|
+
htmlFor: id,
|
|
121
118
|
className: "zen-date-input-inner__label",
|
|
122
119
|
children: title
|
|
123
120
|
}) : null, _jsxs("div", {
|
|
@@ -125,7 +122,6 @@ export const DateInputInnerControlBlock = props => {
|
|
|
125
122
|
children: [_jsxs("div", {
|
|
126
123
|
className: "zen-date-input-inner__inputs-block-item",
|
|
127
124
|
children: [memoizedDateInput, isHasDateError ? _jsx(FormFieldError, {
|
|
128
|
-
id: dateErrorId,
|
|
129
125
|
error: translate("The date must be set")
|
|
130
126
|
}) : null]
|
|
131
127
|
}), memoizedTimeSelect]
|
|
@@ -78,7 +78,6 @@ export const FiltersBarSidePanelRange = ({
|
|
|
78
78
|
}) => {
|
|
79
79
|
const generatedId = useId();
|
|
80
80
|
const intId = id || generatedId;
|
|
81
|
-
const rangeErrorId = `${intId}-error`;
|
|
82
81
|
const [currentValue, setCurrentValue] = useState(value);
|
|
83
82
|
const [errorType, setErrorType] = useState(undefined);
|
|
84
83
|
const prevValueRef = useRef(value);
|
|
@@ -153,13 +152,11 @@ export const FiltersBarSidePanelRange = ({
|
|
|
153
152
|
return _jsxs("div", {
|
|
154
153
|
ref: setFieldsContainerRef,
|
|
155
154
|
id: intId,
|
|
156
|
-
"aria-describedby": errorType !== undefined && directionState === "row" ? rangeErrorId : undefined,
|
|
157
155
|
className: classNames(["zen-filters-bar-side-panel-range", className || ""]),
|
|
158
156
|
children: [_jsxs("div", {
|
|
159
157
|
className: rangeFieldContainerClasses,
|
|
160
158
|
children: [memoizedMinRangeField, memoizedMaxRangeField]
|
|
161
159
|
}), errorType !== undefined && directionState === "row" ? _jsx(FormFieldError, {
|
|
162
|
-
id: rangeErrorId,
|
|
163
160
|
className: "zen-filters-bar-side-panel-range__error",
|
|
164
161
|
error: [getErrorString("min", currentValue.min, translate, errorType, min, max) || "", getErrorString("max", currentValue.max, translate, errorType, min, max) || ""]
|
|
165
162
|
}) : null]
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "./formFieldError.less";
|
|
2
2
|
interface IFormFieldError {
|
|
3
|
-
id?: string;
|
|
4
3
|
className?: string;
|
|
5
4
|
error?: string | string[];
|
|
6
5
|
}
|
|
7
|
-
export declare const FormFieldError: ({
|
|
6
|
+
export declare const FormFieldError: ({ className, error }: IFormFieldError) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
7
|
export {};
|
|
@@ -3,11 +3,11 @@ import { classNames } from "../commonHelpers/classNames/classNames";
|
|
|
3
3
|
import { IconException } from "../icons/iconException";
|
|
4
4
|
import { useDrive } from "../utils/theme/useDrive";
|
|
5
5
|
import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
6
|
-
export const FormFieldError = ({
|
|
6
|
+
export const FormFieldError = ({ className, error }) => {
|
|
7
7
|
const driveComponentClass = useDriveClassName("zen-form-field-error");
|
|
8
8
|
const isDrive = useDrive();
|
|
9
9
|
const errorStrings = Array.isArray(error)
|
|
10
10
|
? error.filter(el => el).map((erStr, ind) => _jsx("div", { children: erStr }, `error_str_${ind}`))
|
|
11
11
|
: error && _jsx("div", { children: error });
|
|
12
|
-
return error ? (_jsxs("
|
|
12
|
+
return error ? (_jsxs("div", { className: classNames(["zen-form-field-error", driveComponentClass || "", className || ""]), children: [_jsx("div", { className: "zen-form-field-error__icon-container", children: _jsx(IconException, { className: "zen-form-field-error__error-icon", size: isDrive ? "large" : "bigger" }) }), _jsx("div", { className: "zen-form-field-error__error-text", children: errorStrings })] })) : null;
|
|
13
13
|
};
|
package/esm/rangeRaw/rangeRaw.js
CHANGED
|
@@ -252,9 +252,6 @@ export const RangeRaw = props => {
|
|
|
252
252
|
} else {
|
|
253
253
|
defaultValueInner = defaultValue;
|
|
254
254
|
}
|
|
255
|
-
const generatedId = useId();
|
|
256
|
-
const intId = id || generatedId;
|
|
257
|
-
const rangeErrorId = `${intId}-error`;
|
|
258
255
|
const [isOpen, setIsOpen] = useState(false);
|
|
259
256
|
const [currentValue, setCurrentValue] = useState(value);
|
|
260
257
|
const [errorType, setErrorType] = useState(undefined);
|
|
@@ -403,17 +400,14 @@ export const RangeRaw = props => {
|
|
|
403
400
|
const memoizedContent = useMemo(() => _jsxs("div", {
|
|
404
401
|
className: "zen-range__fields-wrapper",
|
|
405
402
|
children: [_jsxs("div", {
|
|
406
|
-
id: intId,
|
|
407
403
|
ref: setFieldsContainerRef,
|
|
408
|
-
"aria-describedby": errorType !== undefined && directionState === "row" ? rangeErrorId : undefined,
|
|
409
404
|
className: classNames(["zen-range__fields-container", directionState === "row" ? "zen-range__fields-container--row" : "zen-range__fields-container--column"]),
|
|
410
405
|
children: [memoizedMinRangeField, memoizedMaxRangeField]
|
|
411
406
|
}), errorType !== undefined && directionState === "row" ? _jsx(FormFieldError, {
|
|
412
|
-
id: rangeErrorId,
|
|
413
407
|
className: "zen-range__error",
|
|
414
408
|
error: [getErrorString("min", currentValue.min, translate, errorType, min, max) || "", getErrorString("max", currentValue.max, translate, errorType, min, max) || ""]
|
|
415
409
|
}) : null]
|
|
416
|
-
}), [setFieldsContainerRef, directionState, memoizedMinRangeField, memoizedMaxRangeField, errorType, currentValue.min, currentValue.max, translate, min, max
|
|
410
|
+
}), [setFieldsContainerRef, directionState, memoizedMinRangeField, memoizedMaxRangeField, errorType, currentValue.min, currentValue.max, translate, min, max]);
|
|
417
411
|
const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, {
|
|
418
412
|
isOpen: isOpen,
|
|
419
413
|
className: classNames(["zen-range-popup zen-shadow-dropdown-default", className ? className : ""]),
|
|
@@ -54,8 +54,6 @@ export interface ISummaryTile extends IZenComponentProps, IZenGridItem {
|
|
|
54
54
|
tooltipSize?: TooltipSize;
|
|
55
55
|
/** When `true`, shows a skeleton placeholder while data is being fetched — two skeleton elements replace the title and content areas. */
|
|
56
56
|
isLoading?: boolean;
|
|
57
|
-
/** When `true` and the tile is interactive, sets `aria-current="page"` on the tile. */
|
|
58
|
-
isSelected?: boolean;
|
|
59
57
|
/** Analytics identifier applied as `data-analytics-id`. Defaults to a kebab-cased version of `title`. */
|
|
60
58
|
dataAnalyticsId?: string;
|
|
61
59
|
}
|
|
@@ -75,6 +73,6 @@ export declare const SummaryTileDisplayName = "SummaryTile";
|
|
|
75
73
|
* Use inside `SummaryTileBar` to group multiple tiles in a scrollable row.
|
|
76
74
|
*/
|
|
77
75
|
export declare const SummaryTile: {
|
|
78
|
-
({ className, children, size, title, tileType, id, onClick, tooltipText, tooltipAlignment, isLoading,
|
|
76
|
+
({ className, children, size, title, tileType, id, onClick, tooltipText, tooltipAlignment, isLoading, dataAnalyticsId }: ISummaryTile): import("react/jsx-runtime").JSX.Element;
|
|
79
77
|
displayName: string;
|
|
80
78
|
};
|
|
@@ -83,7 +83,6 @@ export const SummaryTile = ({
|
|
|
83
83
|
tooltipText,
|
|
84
84
|
tooltipAlignment = "top",
|
|
85
85
|
isLoading = false,
|
|
86
|
-
isSelected = false,
|
|
87
86
|
dataAnalyticsId
|
|
88
87
|
}) => {
|
|
89
88
|
const {
|
|
@@ -139,7 +138,7 @@ export const SummaryTile = ({
|
|
|
139
138
|
}),
|
|
140
139
|
children: tooltipText
|
|
141
140
|
}) : null;
|
|
142
|
-
const ariaCurrentProps =
|
|
141
|
+
const ariaCurrentProps = tileType === SummaryTileType.Active && isInteractive ? {
|
|
143
142
|
"aria-current": "page"
|
|
144
143
|
} : {};
|
|
145
144
|
// When both onClick and tooltipText are present, the tooltip trigger
|
|
@@ -71,8 +71,7 @@ export const ToggleButtonRaw = props => {
|
|
|
71
71
|
children,
|
|
72
72
|
isReverted,
|
|
73
73
|
isReadOnly,
|
|
74
|
-
value: valueProp
|
|
75
|
-
dataAnalyticsId
|
|
74
|
+
value: valueProp
|
|
76
75
|
} = props;
|
|
77
76
|
const driveClassesToggler = useDriveClassName("zen-toggler");
|
|
78
77
|
const driveClassesComponent = useDriveClassName("zen-toggler-component");
|
|
@@ -102,7 +101,6 @@ export const ToggleButtonRaw = props => {
|
|
|
102
101
|
}
|
|
103
102
|
return _jsxs("div", {
|
|
104
103
|
className: classNames(["zen-toggler", driveClassesToggler || "", className || ""]),
|
|
105
|
-
"data-analytics-id": dataAnalyticsId,
|
|
106
104
|
children: [_jsx(TriStateCheckbox, {
|
|
107
105
|
name: name,
|
|
108
106
|
className: "zen-toggler__input",
|
|
@@ -6,7 +6,6 @@ interface IToggleButtonBaseRaw extends IZenComponentProps {
|
|
|
6
6
|
title?: string;
|
|
7
7
|
isReverted?: boolean;
|
|
8
8
|
isReadOnly?: boolean;
|
|
9
|
-
dataAnalyticsId?: string;
|
|
10
9
|
}
|
|
11
10
|
export interface IToggleButtonDefaultRaw extends IToggleButtonBaseRaw {
|
|
12
11
|
onChange?: (checked: boolean) => void;
|
package/esm/tooltip/tooltip.js
CHANGED
|
@@ -99,8 +99,7 @@ const EventWrapper = ({
|
|
|
99
99
|
handleUniversalClick,
|
|
100
100
|
setTooltipVisible,
|
|
101
101
|
timerRef,
|
|
102
|
-
timerMouseOutRef
|
|
103
|
-
tooltipRef
|
|
102
|
+
timerMouseOutRef
|
|
104
103
|
}) => {
|
|
105
104
|
const isCurrentDeviceDesktop = deviceType === DeviceType.Desktop;
|
|
106
105
|
const originalOnClick = children.props.onClick;
|
|
@@ -125,13 +124,7 @@ const EventWrapper = ({
|
|
|
125
124
|
}, TOOLTIP_VISIBILITY_DELAY);
|
|
126
125
|
},
|
|
127
126
|
onFocus: () => setTooltipVisible(true),
|
|
128
|
-
onBlur: () =>
|
|
129
|
-
// Skip if the tooltip DOM was already detached
|
|
130
|
-
if (tooltipRef.current && !tooltipRef.current.isConnected) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
setTooltipVisible(false);
|
|
134
|
-
},
|
|
127
|
+
onBlur: () => setTooltipVisible(false),
|
|
135
128
|
onKeyDown: onKeyDownHandler,
|
|
136
129
|
onClick: composedOnClick
|
|
137
130
|
};
|
|
@@ -233,7 +226,6 @@ export const Tooltip = ({
|
|
|
233
226
|
setTooltipVisible: setTooltipVisible,
|
|
234
227
|
timerRef: timerRef,
|
|
235
228
|
timerMouseOutRef: timerMouseOutRef,
|
|
236
|
-
tooltipRef: tooltipRef,
|
|
237
229
|
children: React.cloneElement(tooltipTrigger, Object.assign({
|
|
238
230
|
ref: triggerRef
|
|
239
231
|
}, triggerCloneProps))
|