@geotab/zenith 3.6.3-beta.0 → 3.7.0-beta.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 +15 -1
- package/dist/absolute/absolute.d.ts +3 -1
- package/dist/absolute/absolute.js +4 -4
- package/dist/controlledPopup/controlledPopup.d.ts +3 -1
- package/dist/controlledPopup/controlledPopup.js +2 -2
- package/dist/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +8 -2
- package/dist/groupsFilterRaw/groupsFilterRaw.js +43 -9
- package/dist/groupsFilterRaw/groupsFilterTrigger.d.ts +2 -1
- package/dist/groupsFilterRaw/groupsFilterTrigger.js +9 -2
- package/dist/index.css +208 -18
- package/dist/index.d.ts +1 -1
- package/dist/list/hooks/useDragAndDrop.d.ts +3 -1
- package/dist/list/hooks/useDragAndDrop.js +11 -4
- package/dist/menu/components/menuItem.js +12 -2
- package/dist/menu/contexts/pathContext.d.ts +3 -1
- package/dist/menu/contexts/pathProvider.d.ts +1 -1
- package/dist/menu/contexts/pathProvider.js +1 -1
- package/dist/menu/controlledMenu.js +97 -29
- package/dist/nav/nav.d.ts +2 -1
- package/dist/nav/nav.js +3 -2
- package/dist/nav/navEditList/navEditList.js +2 -1
- package/dist/pillExpandable/pillContent.d.ts +2 -1
- package/dist/pillExpandable/pillContent.js +8 -3
- package/dist/pillExpandable/pillExpandable.d.ts +27 -4
- package/dist/pillExpandable/pillExpandable.js +426 -196
- package/dist/pillExpandable/pillExpandablePopoverContent.d.ts +19 -0
- package/dist/pillExpandable/pillExpandablePopoverContent.js +7 -0
- package/dist/pillExpandable/pillExpandableSimple.d.ts +5 -3
- package/dist/pillExpandable/pillExpandableSimple.js +12 -5
- package/dist/summary/summary.js +29 -1
- package/dist/summaryTile/summaryTile.d.ts +2 -1
- package/dist/summaryTile/summaryTile.js +175 -65
- package/dist/summaryTile/summaryTileTrigger.d.ts +1 -1
- package/dist/summaryTile/summaryTileTrigger.js +1 -1
- package/dist/toggleButtonRaw/toggleButtonRaw.js +2 -1
- package/dist/utils/localization/getSupportedLanguage.d.ts +2 -2
- package/dist/utils/localization/getSupportedLanguage.js +28 -8
- package/dist/utils/localization/languageContext.d.ts +1 -1
- package/esm/absolute/absolute.d.ts +3 -1
- package/esm/absolute/absolute.js +4 -4
- package/esm/controlledPopup/controlledPopup.d.ts +3 -1
- package/esm/controlledPopup/controlledPopup.js +2 -2
- package/esm/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +9 -3
- package/esm/groupsFilterRaw/groupsFilterRaw.js +43 -9
- package/esm/groupsFilterRaw/groupsFilterTrigger.d.ts +2 -1
- package/esm/groupsFilterRaw/groupsFilterTrigger.js +9 -2
- package/esm/index.d.ts +1 -1
- package/esm/list/hooks/useDragAndDrop.d.ts +3 -1
- package/esm/list/hooks/useDragAndDrop.js +11 -4
- package/esm/menu/components/menuItem.js +12 -2
- package/esm/menu/contexts/pathContext.d.ts +3 -1
- package/esm/menu/contexts/pathProvider.d.ts +1 -1
- package/esm/menu/contexts/pathProvider.js +1 -1
- package/esm/menu/controlledMenu.js +98 -30
- package/esm/nav/nav.d.ts +2 -1
- package/esm/nav/nav.js +3 -2
- package/esm/nav/navEditList/navEditList.js +2 -1
- package/esm/pillExpandable/pillContent.d.ts +2 -1
- package/esm/pillExpandable/pillContent.js +8 -3
- package/esm/pillExpandable/pillExpandable.d.ts +27 -4
- package/esm/pillExpandable/pillExpandable.js +427 -197
- package/esm/pillExpandable/pillExpandablePopoverContent.d.ts +19 -0
- package/esm/pillExpandable/pillExpandablePopoverContent.js +3 -0
- package/esm/pillExpandable/pillExpandableSimple.d.ts +5 -3
- package/esm/pillExpandable/pillExpandableSimple.js +12 -5
- package/esm/summary/summary.js +29 -1
- package/esm/summaryTile/summaryTile.d.ts +2 -1
- package/esm/summaryTile/summaryTile.js +140 -43
- package/esm/summaryTile/summaryTileTrigger.d.ts +1 -1
- package/esm/summaryTile/summaryTileTrigger.js +1 -1
- package/esm/toggleButtonRaw/toggleButtonRaw.js +2 -1
- package/esm/utils/localization/getSupportedLanguage.d.ts +2 -2
- package/esm/utils/localization/getSupportedLanguage.js +28 -8
- package/esm/utils/localization/languageContext.d.ts +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { TLazyContent } from "../skeleton/lazyContent";
|
|
3
|
+
import { IPillExpandableAction, TPopoverVariant } from "./pillExpandable";
|
|
4
|
+
interface IPillExpandablePopoverContent {
|
|
5
|
+
variant: TPopoverVariant;
|
|
6
|
+
customContent?: ReactNode;
|
|
7
|
+
onActionClick: () => void;
|
|
8
|
+
descriptionText?: TLazyContent<ReactNode>;
|
|
9
|
+
date?: TLazyContent<string>;
|
|
10
|
+
count?: TLazyContent<number>;
|
|
11
|
+
mainAction?: TLazyContent<IPillExpandableAction>;
|
|
12
|
+
secondaryAction?: TLazyContent<IPillExpandableAction>;
|
|
13
|
+
tertiaryAction?: TLazyContent<IPillExpandableAction>;
|
|
14
|
+
errorHandler: (e: unknown) => ReactNode | undefined;
|
|
15
|
+
descriptionId?: string;
|
|
16
|
+
childToDisplay: ReactNode[];
|
|
17
|
+
}
|
|
18
|
+
export declare const PillExpandablePopoverContent: ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, childToDisplay }: IPillExpandablePopoverContent) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PillContent } from "./pillContent";
|
|
3
|
+
export const PillExpandablePopoverContent = ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, childToDisplay }) => (_jsxs(_Fragment, { children: [variant === "placeholder" && customContent, variant === "default" && (_jsx(PillContent, { onActionClick: onActionClick, descriptionText: descriptionText, date: date, count: count, mainAction: mainAction, secondaryAction: secondaryAction, tertiaryAction: tertiaryAction, errorHandler: errorHandler, descriptionId: descriptionId })), childToDisplay.length > 0 && (_jsx("div", { className: "zen-status-pill-popup__children", children: childToDisplay }))] }));
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { FC, RefObject } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { IPillExpandableBase, TPillType } from "./pillExpandable";
|
|
3
3
|
import { IIcon } from "../icons/icon";
|
|
4
|
-
interface IPillExpandableSimple extends
|
|
4
|
+
interface IPillExpandableSimple extends IPillExpandableBase {
|
|
5
5
|
includeExpandIcon?: boolean;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
expandAriaText?: string;
|
|
8
8
|
onExpand?: () => void;
|
|
9
9
|
icon?: FC<IIcon> | false;
|
|
10
10
|
isBeta?: boolean;
|
|
11
|
+
isMobile?: boolean;
|
|
11
12
|
ref?: RefObject<HTMLButtonElement | null>;
|
|
12
13
|
descriptionId?: string;
|
|
14
|
+
type?: TPillType;
|
|
13
15
|
}
|
|
14
16
|
export declare const PillExpandableSimple: {
|
|
15
|
-
({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, ref, className, descriptionId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
displayName: string;
|
|
17
19
|
};
|
|
18
20
|
export {};
|
|
@@ -5,26 +5,33 @@ import { IconChevronTop } from "../icons/iconChevronTop";
|
|
|
5
5
|
import { IconChevronBottom } from "../icons/iconChevronBottom";
|
|
6
6
|
import { IconException } from "../icons/iconException";
|
|
7
7
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
8
|
-
export const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = IconException, isBeta, ref, className, descriptionId }) => {
|
|
8
|
+
export const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = IconException, isBeta, isMobile, ref, className, descriptionId }) => {
|
|
9
9
|
const iconDriveClassName = useDriveClassName("icon");
|
|
10
10
|
const containerDriveClassName = useDriveClassName("zen-status-pill__container");
|
|
11
11
|
const onExpandHandler = useCallback(() => {
|
|
12
12
|
onExpand && onExpand();
|
|
13
13
|
}, [onExpand]);
|
|
14
14
|
const ChevronIcon = expanded ? IconChevronTop : IconChevronBottom;
|
|
15
|
-
const
|
|
16
|
-
const iconSize = isBeta ? "big" :
|
|
15
|
+
const isLargeIcon = Boolean(iconDriveClassName || isMobile);
|
|
16
|
+
const iconSize = isBeta ? "big" : isLargeIcon ? "large" : "big";
|
|
17
17
|
const hasText = (text || "").trim().length > 0;
|
|
18
|
+
const isTextCentered = icon === false && !includeExpandIcon;
|
|
18
19
|
return _jsxs("button", { type: "button", className: classNames([
|
|
19
20
|
"zen-status-pill__container", `zen-status-pill__container--${type}`, containerDriveClassName || "", className || "", "zen-ellipsis"
|
|
20
21
|
]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-describedby": descriptionId, children: [icon !== false && _jsx("div", { className: classNames([
|
|
21
22
|
"zen-status-pill__icon",
|
|
22
23
|
`zen-status-pill__icon--${type}`,
|
|
24
|
+
isLargeIcon ? "zen-status-pill__icon--large" : "",
|
|
23
25
|
hasText ? "" : "zen-status-pill__icon--standalone"
|
|
24
26
|
]), children: createElement(icon, {
|
|
25
27
|
size: iconSize
|
|
26
|
-
}) }), hasText && _jsx("div", { className:
|
|
27
|
-
|
|
28
|
+
}) }), hasText && _jsx("div", { className: classNames([
|
|
29
|
+
"zen-status-pill__text",
|
|
30
|
+
`zen-status-pill__text--${type}`,
|
|
31
|
+
"zen-ellipsis",
|
|
32
|
+
isTextCentered ? "zen-status-pill__text--centered" : ""
|
|
33
|
+
]), children: text }), includeExpandIcon && _jsx("div", { className: `zen-status-pill__expand-button zen-status-pill__expand-button--${type}`, "aria-label": expandAriaText, children: _jsx("div", { className: "zen-status-pill__icon", children: createElement(ChevronIcon, {
|
|
34
|
+
size: iconSize
|
|
28
35
|
}) }) })] });
|
|
29
36
|
};
|
|
30
37
|
PillExpandableSimple.displayName = "PillExpandableSimple";
|
package/esm/summary/summary.js
CHANGED
|
@@ -31,6 +31,32 @@ injectString("tr", "Summary color", "\xD6zet rengi");
|
|
|
31
31
|
injectString("zh-Hans", "Summary color", "\u6458\u8981\u989C\u8272");
|
|
32
32
|
injectString("zh-TW", "Summary color", "\u6458\u8981\u8272\u5F69");
|
|
33
33
|
injectString("ro-RO", "Summary color", "Culoare sumar");
|
|
34
|
+
injectString("cs", "Information", "Informace");
|
|
35
|
+
injectString("da-DK", "Information", "Information");
|
|
36
|
+
injectString("de", "Information", "Information");
|
|
37
|
+
injectString("en", "Information", "Information");
|
|
38
|
+
injectString("es", "Information", "Informaci\xF3n");
|
|
39
|
+
injectString("fi-FI", "Information", "Tiedot");
|
|
40
|
+
injectString("fr", "Information", "Renseignements");
|
|
41
|
+
injectString("fr-FR", "Information", "Informations");
|
|
42
|
+
injectString("hu-HU", "Information", "Inform\xE1ci\xF3");
|
|
43
|
+
injectString("id", "Information", "Informasi");
|
|
44
|
+
injectString("it", "Information", "Informazioni");
|
|
45
|
+
injectString("ja", "Information", "\u60C5\u5831");
|
|
46
|
+
injectString("ko-KR", "Information", "\uC815\uBCF4");
|
|
47
|
+
injectString("ms", "Information", "Maklumat");
|
|
48
|
+
injectString("nb-NO", "Information", "Informasjon");
|
|
49
|
+
injectString("nl", "Information", "Informatie");
|
|
50
|
+
injectString("pl", "Information", "Informacje");
|
|
51
|
+
injectString("pt-BR", "Information", "Informa\xE7\xF5es");
|
|
52
|
+
injectString("pt-PT", "Information", "Informa\xE7\xE3o");
|
|
53
|
+
injectString("sk-SK", "Information", "Inform\xE1cie");
|
|
54
|
+
injectString("sv", "Information", "Information");
|
|
55
|
+
injectString("th", "Information", "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25");
|
|
56
|
+
injectString("tr", "Information", "Bilgi");
|
|
57
|
+
injectString("zh-Hans", "Information", "\u4FE1\u606F");
|
|
58
|
+
injectString("zh-TW", "Information", "\u8CC7\u8A0A");
|
|
59
|
+
injectString("ro-RO", "Information", "Informa\u021Bii");
|
|
34
60
|
export const Summary = ({
|
|
35
61
|
color,
|
|
36
62
|
title,
|
|
@@ -66,8 +92,10 @@ export const Summary = ({
|
|
|
66
92
|
children: title
|
|
67
93
|
}), tooltip && _jsx(Tooltip, {
|
|
68
94
|
alignment: "top",
|
|
69
|
-
trigger: _jsx("
|
|
95
|
+
trigger: _jsx("button", {
|
|
96
|
+
type: "button",
|
|
70
97
|
className: "zen-summary__trigger",
|
|
98
|
+
"aria-label": translate("Information"),
|
|
71
99
|
children: _jsx(IconInfoCircle, {
|
|
72
100
|
size: "large",
|
|
73
101
|
className: "zen-summary__title-icon"
|
|
@@ -28,9 +28,10 @@ export interface ISummaryTile extends IZenComponentProps, IZenGridItem {
|
|
|
28
28
|
tooltipText?: React.ReactNode;
|
|
29
29
|
tooltipAlignment?: TAlignment;
|
|
30
30
|
tooltipSize?: TooltipSize;
|
|
31
|
+
isLoading?: boolean;
|
|
31
32
|
}
|
|
32
33
|
export declare const SummaryTileDisplayName = "SummaryTile";
|
|
33
34
|
export declare const SummaryTile: {
|
|
34
|
-
({ className, children, size, title, tileType, id, onClick, tooltipText, tooltipAlignment }: ISummaryTile): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
({ className, children, size, title, tileType, id, onClick, tooltipText, tooltipAlignment, isLoading }: ISummaryTile): import("react/jsx-runtime").JSX.Element;
|
|
35
36
|
displayName: string;
|
|
36
37
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { injectString } from "../utils/localization/translationsDictionary";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
@@ -5,58 +6,154 @@ import { Tooltip } from "../tooltip/tooltip";
|
|
|
5
6
|
import { SummaryTileTrigger } from "./summaryTileTrigger";
|
|
6
7
|
import { getTypeClassName } from "./utils/getTypeClassName";
|
|
7
8
|
import { IconInfoCircle } from "../icons/iconInfoCircle";
|
|
9
|
+
import { useLanguage } from "../utils/localization/useLanguage";
|
|
8
10
|
import { IconWarning } from "../icons/iconWarning";
|
|
9
11
|
import { IconCheckRadio } from "../icons/iconCheckRadio";
|
|
10
12
|
import { IconException } from "../icons/iconException";
|
|
13
|
+
import { Skeleton } from "../skeleton/skeleton";
|
|
14
|
+
injectString("cs", "Information", "Informace");
|
|
15
|
+
injectString("da-DK", "Information", "Information");
|
|
16
|
+
injectString("de", "Information", "Information");
|
|
17
|
+
injectString("en", "Information", "Information");
|
|
18
|
+
injectString("es", "Information", "Informaci\xF3n");
|
|
19
|
+
injectString("fi-FI", "Information", "Tiedot");
|
|
20
|
+
injectString("fr", "Information", "Renseignements");
|
|
21
|
+
injectString("fr-FR", "Information", "Informations");
|
|
22
|
+
injectString("hu-HU", "Information", "Inform\xE1ci\xF3");
|
|
23
|
+
injectString("id", "Information", "Informasi");
|
|
24
|
+
injectString("it", "Information", "Informazioni");
|
|
25
|
+
injectString("ja", "Information", "\u60C5\u5831");
|
|
26
|
+
injectString("ko-KR", "Information", "\uC815\uBCF4");
|
|
27
|
+
injectString("ms", "Information", "Maklumat");
|
|
28
|
+
injectString("nb-NO", "Information", "Informasjon");
|
|
29
|
+
injectString("nl", "Information", "Informatie");
|
|
30
|
+
injectString("pl", "Information", "Informacje");
|
|
31
|
+
injectString("pt-BR", "Information", "Informa\xE7\xF5es");
|
|
32
|
+
injectString("pt-PT", "Information", "Informa\xE7\xE3o");
|
|
33
|
+
injectString("sk-SK", "Information", "Inform\xE1cie");
|
|
34
|
+
injectString("sv", "Information", "Information");
|
|
35
|
+
injectString("th", "Information", "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25");
|
|
36
|
+
injectString("tr", "Information", "Bilgi");
|
|
37
|
+
injectString("zh-Hans", "Information", "\u4FE1\u606F");
|
|
38
|
+
injectString("zh-TW", "Information", "\u8CC7\u8A0A");
|
|
39
|
+
injectString("ro-RO", "Information", "Informa\u021Bii");
|
|
11
40
|
export var SummaryTileType;
|
|
12
41
|
(function (SummaryTileType) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
42
|
+
SummaryTileType["Error"] = "error";
|
|
43
|
+
SummaryTileType["Success"] = "success";
|
|
44
|
+
SummaryTileType["Warning"] = "warning";
|
|
45
|
+
SummaryTileType["Active"] = "active";
|
|
46
|
+
SummaryTileType["Default"] = "default";
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated - will be removed in the next releases.
|
|
49
|
+
* Please use {@link SummaryTileType.Active} instead.
|
|
50
|
+
*/
|
|
51
|
+
SummaryTileType["Info"] = "info";
|
|
23
52
|
})(SummaryTileType || (SummaryTileType = {}));
|
|
24
53
|
export var SummaryTileSize;
|
|
25
54
|
(function (SummaryTileSize) {
|
|
26
|
-
|
|
27
|
-
|
|
55
|
+
SummaryTileSize["Small"] = "small";
|
|
56
|
+
SummaryTileSize["Medium"] = "medium";
|
|
28
57
|
})(SummaryTileSize || (SummaryTileSize = {}));
|
|
29
58
|
export const SummaryTileDisplayName = "SummaryTile";
|
|
30
|
-
export const SummaryTile = ({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
export const SummaryTile = ({
|
|
60
|
+
className,
|
|
61
|
+
children,
|
|
62
|
+
size = SummaryTileSize.Small,
|
|
63
|
+
title,
|
|
64
|
+
tileType = SummaryTileType.Default,
|
|
65
|
+
id,
|
|
66
|
+
onClick,
|
|
67
|
+
tooltipText,
|
|
68
|
+
tooltipAlignment = "top",
|
|
69
|
+
isLoading = false
|
|
70
|
+
}) => {
|
|
71
|
+
const {
|
|
72
|
+
translate
|
|
73
|
+
} = useLanguage();
|
|
74
|
+
const generatedId = React.useId();
|
|
75
|
+
const eltId = id || generatedId;
|
|
76
|
+
const memoizedGetIconId = React.useMemo(() => {
|
|
77
|
+
const iconIds = {
|
|
78
|
+
[SummaryTileType.Warning]: IconException,
|
|
79
|
+
[SummaryTileType.Success]: IconCheckRadio,
|
|
80
|
+
[SummaryTileType.Error]: IconWarning,
|
|
81
|
+
[SummaryTileType.Active]: IconInfoCircle,
|
|
82
|
+
[SummaryTileType.Default]: IconInfoCircle,
|
|
83
|
+
[SummaryTileType.Info]: IconInfoCircle
|
|
53
84
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
85
|
+
return iconIds[tileType];
|
|
86
|
+
}, [tileType]);
|
|
87
|
+
const isInteractive = onClick && !isLoading;
|
|
88
|
+
const componentProps = {
|
|
89
|
+
className: classNames(["zen-summary-tile", getTypeClassName(tileType), `zen-summary-tile--${size}`, isInteractive ? "zen-summary-tile--action" : "", className || ""]),
|
|
90
|
+
"data-summary-tile-id": eltId
|
|
91
|
+
};
|
|
92
|
+
if (isInteractive) {
|
|
93
|
+
componentProps.onClick = () => {
|
|
94
|
+
onClick(eltId);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (isLoading) {
|
|
98
|
+
return _jsxs("div", Object.assign({}, componentProps, {
|
|
99
|
+
children: [_jsx("div", {
|
|
100
|
+
className: "zen-summary-tile__title-block",
|
|
101
|
+
children: _jsx(Skeleton, {
|
|
102
|
+
type: "text",
|
|
103
|
+
height: 16
|
|
104
|
+
})
|
|
105
|
+
}), _jsx("div", {
|
|
106
|
+
className: "zen-summary-tile__content",
|
|
107
|
+
children: _jsx(Skeleton, {
|
|
108
|
+
type: "text",
|
|
109
|
+
height: 32
|
|
110
|
+
})
|
|
111
|
+
})]
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
const tooltipTrigger = tooltipText ? _jsx(Tooltip, {
|
|
115
|
+
alignment: tooltipAlignment,
|
|
116
|
+
trigger: _jsx(SummaryTileTrigger, {
|
|
117
|
+
icon: memoizedGetIconId,
|
|
118
|
+
"aria-label": translate("Information")
|
|
119
|
+
}),
|
|
120
|
+
children: tooltipText
|
|
121
|
+
}) : null;
|
|
122
|
+
const Tag = isInteractive ? "button" : "div";
|
|
123
|
+
// When both onClick and tooltipText are present, the tooltip trigger
|
|
124
|
+
// (a <button>) cannot be nested inside the tile <button>. Render the
|
|
125
|
+
// tooltip trigger as a sibling outside the clickable tile.
|
|
126
|
+
if (onClick && tooltipText) {
|
|
127
|
+
return _jsxs("div", {
|
|
128
|
+
className: componentProps.className,
|
|
129
|
+
"data-summary-tile-id": componentProps["data-summary-tile-id"],
|
|
130
|
+
children: [_jsxs(Tag, {
|
|
131
|
+
className: "zen-summary-tile__clickable-area",
|
|
132
|
+
onClick: componentProps.onClick,
|
|
133
|
+
children: [_jsx("div", {
|
|
134
|
+
className: "zen-summary-tile__title-block",
|
|
135
|
+
children: _jsx("div", {
|
|
136
|
+
className: "zen-summary-tile__title-text zen-ellipsis heading-05",
|
|
137
|
+
children: title
|
|
138
|
+
})
|
|
139
|
+
}), _jsx("div", {
|
|
140
|
+
className: "zen-summary-tile__content",
|
|
141
|
+
children: children
|
|
142
|
+
})]
|
|
143
|
+
}), tooltipTrigger]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return _jsxs(Tag, Object.assign({}, componentProps, {
|
|
147
|
+
children: [_jsxs("div", {
|
|
148
|
+
className: "zen-summary-tile__title-block",
|
|
149
|
+
children: [_jsx("div", {
|
|
150
|
+
className: "zen-summary-tile__title-text zen-ellipsis heading-05",
|
|
151
|
+
children: title
|
|
152
|
+
}), tooltipTrigger]
|
|
153
|
+
}), _jsx("div", {
|
|
154
|
+
className: "zen-summary-tile__content",
|
|
155
|
+
children: children
|
|
156
|
+
})]
|
|
157
|
+
}));
|
|
61
158
|
};
|
|
62
|
-
SummaryTile.displayName = SummaryTileDisplayName;
|
|
159
|
+
SummaryTile.displayName = SummaryTileDisplayName;
|
|
@@ -3,6 +3,6 @@ import { IIcon } from "../icons/icon";
|
|
|
3
3
|
import { RefObject } from "react";
|
|
4
4
|
export interface ISummaryTileTrigger {
|
|
5
5
|
icon: React.FC<IIcon>;
|
|
6
|
-
ref?: RefObject<
|
|
6
|
+
ref?: RefObject<HTMLButtonElement | null>;
|
|
7
7
|
}
|
|
8
8
|
export declare const SummaryTileTrigger: ({ icon, ref, ...restProps }: ISummaryTileTrigger) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
export const SummaryTileTrigger = (_a) => {
|
|
15
15
|
var { icon, ref } = _a, restProps = __rest(_a, ["icon", "ref"]);
|
|
16
|
-
return _jsx("
|
|
16
|
+
return _jsx("button", Object.assign({ type: "button", className: "zen-summary-tile__trigger", ref: ref }, restProps, { children: React.createElement(icon, {
|
|
17
17
|
className: "zen-summary-tile__title-icon",
|
|
18
18
|
size: "large"
|
|
19
19
|
}) }));
|
|
@@ -105,7 +105,8 @@ export const ToggleButtonRaw = props => {
|
|
|
105
105
|
id: checkBoxId,
|
|
106
106
|
onChange: onChangeHandler,
|
|
107
107
|
checked: value,
|
|
108
|
-
disabled: disabled
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
role: "switch"
|
|
109
110
|
}), _jsxs("label", {
|
|
110
111
|
className: classNames(["zen-toggler__label", isReverted ? "zen-toggler__label--reverted" : ""]),
|
|
111
112
|
htmlFor: checkBoxId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const supportedLanguages: readonly ["en", "es", "de", "cs", "fr-FR", "fr", "id", "it", "ja", "ms", "nl", "pl", "pt-BR", "sv", "th", "tr", "zh-Hans", "ko-KR", "zh-TW", "da-DK", "fi-FI", "hu-HU", "nb-NO", "sk-SK", "pt-PT", "ro-RO"];
|
|
2
|
-
export type TSupportedLanguage = typeof supportedLanguages[number];
|
|
1
|
+
declare const supportedLanguages: readonly ["en", "es", "de", "cs", "fr-FR", "fr", "id", "it", "ja", "ms", "nl", "pl", "pt-BR", "sv", "th", "tr", "zh-Hans", "ko-KR", "zh-TW", "da-DK", "fi-FI", "hu-HU", "nb-NO", "sk-SK", "pt-PT", "ro-RO", "ar"];
|
|
2
|
+
export type TSupportedLanguage = (typeof supportedLanguages)[number];
|
|
3
3
|
export declare const getSupportedLanguage: (language: string) => TSupportedLanguage;
|
|
4
4
|
export {};
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
const supportedLanguages = [
|
|
2
|
-
"en",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
2
|
+
"en",
|
|
3
|
+
"es",
|
|
4
|
+
"de",
|
|
5
|
+
"cs",
|
|
6
|
+
"fr-FR",
|
|
7
|
+
"fr",
|
|
8
|
+
"id",
|
|
9
|
+
"it",
|
|
10
|
+
"ja",
|
|
11
|
+
"ms",
|
|
12
|
+
"nl",
|
|
13
|
+
"pl",
|
|
14
|
+
"pt-BR",
|
|
15
|
+
"sv",
|
|
16
|
+
"th",
|
|
17
|
+
"tr",
|
|
18
|
+
"zh-Hans",
|
|
19
|
+
"ko-KR",
|
|
20
|
+
"zh-TW",
|
|
21
|
+
"da-DK",
|
|
22
|
+
"fi-FI",
|
|
23
|
+
"hu-HU",
|
|
24
|
+
"nb-NO",
|
|
25
|
+
"sk-SK",
|
|
26
|
+
"pt-PT",
|
|
27
|
+
"ro-RO",
|
|
28
|
+
"ar"
|
|
7
29
|
];
|
|
8
|
-
export const getSupportedLanguage = (language) => supportedLanguages.includes(language)
|
|
9
|
-
? language
|
|
10
|
-
: "en";
|
|
30
|
+
export const getSupportedLanguage = (language) => supportedLanguages.includes(language) ? language : "en";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const languageContext: import("react").Context<"it" | "th" | "tr" | "ms" | "id" | "en" | "es" | "de" | "cs" | "fr-FR" | "fr" | "ja" | "nl" | "pl" | "pt-BR" | "sv" | "zh-Hans" | "ko-KR" | "zh-TW" | "da-DK" | "fi-FI" | "hu-HU" | "nb-NO" | "sk-SK" | "pt-PT" | "ro-RO">;
|
|
2
|
+
export declare const languageContext: import("react").Context<"it" | "th" | "tr" | "ms" | "id" | "en" | "es" | "de" | "cs" | "fr-FR" | "fr" | "ja" | "nl" | "pl" | "pt-BR" | "sv" | "zh-Hans" | "ko-KR" | "zh-TW" | "da-DK" | "fi-FI" | "hu-HU" | "nb-NO" | "sk-SK" | "pt-PT" | "ro-RO" | "ar">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geotab/zenith",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0-beta.0",
|
|
4
4
|
"description": "Zenith components library on React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "esm/index.d.ts",
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
"**/react-chartjs/dateAdapter.ts",
|
|
12
12
|
"**/react-chartjs/dateAdapter.js"
|
|
13
13
|
],
|
|
14
|
-
"publishConfig": {
|
|
15
|
-
"access": "public"
|
|
16
|
-
},
|
|
17
14
|
"scripts": {
|
|
18
15
|
"test": "npm run clean && npm run test-build && node build-utils/translations/inject-translations.js && jest --clearCache && jest",
|
|
19
16
|
"start": "npm run storybook --loglevel verbose",
|
|
@@ -119,5 +116,8 @@
|
|
|
119
116
|
"last 1 firefox version",
|
|
120
117
|
"last 1 safari version"
|
|
121
118
|
]
|
|
119
|
+
},
|
|
120
|
+
"publishConfig": {
|
|
121
|
+
"access": "public"
|
|
122
122
|
}
|
|
123
123
|
}
|