@geotab/zenith 3.10.0-beta.0 → 3.10.0-beta.2
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 +9 -1
- package/dist/absolute/absolute.d.ts +7 -1
- package/dist/absolute/absolute.js +8 -4
- package/dist/betaPill/betaPill.d.ts +18 -2
- package/dist/betaPill/betaPill.js +11 -8
- package/dist/card/card.d.ts +2 -1
- package/dist/card/card.js +4 -2
- package/dist/card/components/title.d.ts +3 -1
- package/dist/card/components/title.js +5 -3
- package/dist/checkbox/checkbox.js +2 -2
- package/dist/checkboxListWithAction/checkboxListWithAction.js +2 -1
- package/dist/commonStyles/colors/colorsConstant.d.ts +44 -0
- package/dist/commonStyles/colors/colorsConstant.js +361 -0
- package/dist/commonStyles/typography/components/typographyItem.d.ts +8 -0
- package/dist/commonStyles/typography/components/typographyItem.js +45 -0
- package/dist/controlledPopup/controlledPopup.d.ts +2 -1
- package/dist/controlledPopup/controlledPopup.js +2 -2
- package/dist/dropdown/dropdown.js +1 -1
- package/dist/dropdownRaw/dropdownList.d.ts +4 -2
- package/dist/dropdownRaw/dropdownList.js +15 -36
- package/dist/dropdownRaw/dropdownRaw.js +9 -23
- package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +1 -0
- package/dist/dropdownRaw/stateReducer/stateReducer.js +13 -14
- package/dist/dropdownRaw/stateReducer/stateReducerHelper.d.ts +1 -2
- package/dist/dropdownRaw/stateReducer/stateReducerHelper.js +5 -12
- package/dist/headerTitle/headerTitle.d.ts +9 -1
- package/dist/headerTitle/headerTitle.js +3 -2
- package/dist/index.css +52 -14
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/menu/controlledMenu.d.ts +1 -0
- package/dist/menu/controlledMenu.js +2 -2
- package/dist/testHelpers/fakeFetch.d.ts +1 -0
- package/dist/testHelpers/fakeFetch.js +14 -0
- package/dist/testHelpers/geotab-axe/index.d.ts +2 -0
- package/dist/testHelpers/geotab-axe/index.js +81 -0
- package/dist/testHelpers/jestRetry.d.ts +0 -0
- package/dist/testHelpers/jestRetry.js +2 -0
- package/dist/testHelpers/renderAsync.d.ts +2 -0
- package/dist/testHelpers/renderAsync.js +12 -0
- package/dist/testHelpers/setReadonlyHtmlProperty.d.ts +1 -0
- package/dist/testHelpers/setReadonlyHtmlProperty.js +15 -0
- package/dist/testHelpers/styled-output.d.ts +30 -0
- package/dist/testHelpers/styled-output.js +42 -0
- package/esm/absolute/absolute.d.ts +7 -1
- package/esm/absolute/absolute.js +8 -4
- package/esm/betaPill/betaPill.d.ts +18 -2
- package/esm/betaPill/betaPill.js +11 -8
- package/esm/card/card.d.ts +2 -1
- package/esm/card/card.js +4 -2
- package/esm/card/components/title.d.ts +3 -1
- package/esm/card/components/title.js +5 -3
- package/esm/checkbox/checkbox.js +2 -2
- package/esm/checkboxListWithAction/checkboxListWithAction.js +2 -1
- package/esm/controlledPopup/controlledPopup.d.ts +2 -1
- package/esm/controlledPopup/controlledPopup.js +2 -2
- package/esm/dropdown/dropdown.js +1 -1
- package/esm/dropdownRaw/dropdownList.d.ts +4 -2
- package/esm/dropdownRaw/dropdownList.js +15 -36
- package/esm/dropdownRaw/dropdownRaw.js +10 -24
- package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +1 -0
- package/esm/dropdownRaw/stateReducer/stateReducer.js +14 -15
- package/esm/dropdownRaw/stateReducer/stateReducerHelper.d.ts +1 -2
- package/esm/dropdownRaw/stateReducer/stateReducerHelper.js +3 -10
- package/esm/headerTitle/headerTitle.d.ts +9 -1
- package/esm/headerTitle/headerTitle.js +3 -2
- package/esm/index.d.ts +3 -1
- package/esm/index.js +1 -0
- package/esm/menu/controlledMenu.d.ts +1 -0
- package/esm/menu/controlledMenu.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,7 +56,15 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
56
56
|
- Allow multiple columns to be disabled in `ColumnsList`
|
|
57
57
|
- Flip icons for Arabic (RTL) language
|
|
58
58
|
- `Dropdown` search and select-all improvements
|
|
59
|
-
- Fix
|
|
59
|
+
- Fix `SidePanel` not animating open due to RTL regression
|
|
60
|
+
- Add `closeOnScroll` prop to close `ContextMenu` on scroll
|
|
61
|
+
- Fix checkbox accessibility by moving input inside label wrapper
|
|
62
|
+
- Fix multi-page selection in `Table` selectable rows
|
|
63
|
+
- Add `titleAs` prop to `Card` title to control heading tag (`h1`–`h6`)
|
|
64
|
+
|
|
65
|
+
### 3.9.2
|
|
66
|
+
|
|
67
|
+
- Fix `ControlledPopup` max-height
|
|
60
68
|
|
|
61
69
|
### 3.9.1
|
|
62
70
|
|
|
@@ -22,8 +22,14 @@ export interface IAbsolute extends IZenComponentProps {
|
|
|
22
22
|
ariaLabelledby?: string;
|
|
23
23
|
alignmentsFn?: IAlignment;
|
|
24
24
|
recalculateOnScroll?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* When true, closes the popup on scroll instead of repositioning it.
|
|
27
|
+
* Mutually exclusive with `recalculateOnScroll` — setting both causes a
|
|
28
|
+
* wasted position recalculation before the popup closes.
|
|
29
|
+
*/
|
|
30
|
+
closeOnScroll?: boolean;
|
|
25
31
|
recalculateTrigger?: boolean;
|
|
26
32
|
/** Whether to focus the first focusable element when popup opens. Default: true */
|
|
27
33
|
focusOnOpen?: boolean;
|
|
28
34
|
}
|
|
29
|
-
export declare const Absolute: ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, recalculateTrigger, focusOnOpen }: IAbsolute) => import("react/jsx-runtime").JSX.Element | "" | null;
|
|
35
|
+
export declare const Absolute: ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, closeOnScroll, recalculateTrigger, focusOnOpen }: IAbsolute) => import("react/jsx-runtime").JSX.Element | "" | null;
|
|
@@ -19,7 +19,7 @@ const useScroll_1 = require("../commonHelpers/hooks/useScroll");
|
|
|
19
19
|
const getScrollableParent_1 = require("../utils/getScrollableParent");
|
|
20
20
|
const useClientReady_1 = require("../commonHelpers/hooks/useClientReady");
|
|
21
21
|
const zen_1 = require("../utils/zen");
|
|
22
|
-
const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger = "off", shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, recalculateTrigger = true, focusOnOpen = true }) => {
|
|
22
|
+
const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger = "off", shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, closeOnScroll, recalculateTrigger = true, focusOnOpen = true }) => {
|
|
23
23
|
const popupRef = (0, react_1.useRef)(null);
|
|
24
24
|
const prevScroll = (0, react_1.useRef)(0);
|
|
25
25
|
const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
|
|
@@ -47,14 +47,18 @@ const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, trigger
|
|
|
47
47
|
return "";
|
|
48
48
|
};
|
|
49
49
|
const parent = (0, react_1.useMemo)(() => {
|
|
50
|
-
if (!isOpen || !recalculateOnScroll) {
|
|
50
|
+
if (!isOpen || (!recalculateOnScroll && !closeOnScroll)) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
return (0, getScrollableParent_1.getScrollableParent)(triggerRef.current);
|
|
54
|
-
}, [triggerRef, isOpen, recalculateOnScroll]);
|
|
54
|
+
}, [triggerRef, isOpen, recalculateOnScroll, closeOnScroll]);
|
|
55
55
|
const calculatePosition = (0, react_1.useCallback)(() => (0, calculatePosition_1.calculatePosition)(triggerRef, popupRef, paddingX, paddingY, inline, alignment, alignmentsFn, parent ? parent : undefined), [triggerRef, paddingX, paddingY, inline, alignment, alignmentsFn, popupRef, parent]);
|
|
56
|
+
const handleCloseOnScroll = (0, react_1.useCallback)(() => {
|
|
57
|
+
onOpenChange(false);
|
|
58
|
+
}, [onOpenChange]);
|
|
56
59
|
(0, useResize_1.useResize)(calculatePosition, isOpen);
|
|
57
|
-
(0, useScroll_1.useScroll)(calculatePosition, isOpen, parent);
|
|
60
|
+
(0, useScroll_1.useScroll)(calculatePosition, isOpen && !!recalculateOnScroll, parent);
|
|
61
|
+
(0, useScroll_1.useScroll)(handleCloseOnScroll, isOpen && !!closeOnScroll, parent);
|
|
58
62
|
(0, react_1.useLayoutEffect)(calculatePosition, [isOpen, children, recalculateTrigger, calculatePosition]);
|
|
59
63
|
function handleEscape() {
|
|
60
64
|
onOpenChange(false);
|
|
@@ -6,10 +6,26 @@ export interface IBetaPillActions {
|
|
|
6
6
|
link?: string;
|
|
7
7
|
linkOptions?: ILinkOptions;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @internal - temporary escape hatch
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
export interface IBetaPillBaseInternal {
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
interface IBetaPillBase {
|
|
10
18
|
className?: string;
|
|
19
|
+
}
|
|
20
|
+
interface IBetaPillWithActions extends IBetaPillBase {
|
|
11
21
|
feedbackAction?: IBetaPillActions;
|
|
12
22
|
betaOptionAction?: IBetaPillActions;
|
|
13
23
|
}
|
|
14
|
-
|
|
24
|
+
interface IBetaPillWithoutActions extends IBetaPillBase {
|
|
25
|
+
feedbackAction?: never;
|
|
26
|
+
betaOptionAction?: never;
|
|
27
|
+
}
|
|
28
|
+
export type IBetaPill = IBetaPillWithActions | IBetaPillWithoutActions;
|
|
29
|
+
export declare const BetaPill: (props: IBetaPill) => import("react/jsx-runtime").JSX.Element;
|
|
15
30
|
export declare const TRANSLATIONS: string[];
|
|
31
|
+
export {};
|
|
@@ -124,11 +124,14 @@ injectString("zh-Hans", "Beta", "\u6D4B\u8BD5\u7248");
|
|
|
124
124
|
injectString("zh-TW", "Beta", "\u6E2C\u8A66\u7248");
|
|
125
125
|
injectString("ro-RO", "Beta", "Beta");
|
|
126
126
|
injectString("ar-SA", "Beta", "\u062A\u062C\u0631\u064A\u0628\u064A");
|
|
127
|
-
const BetaPill =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
const BetaPill = props => {
|
|
128
|
+
const {
|
|
129
|
+
className,
|
|
130
|
+
feedbackAction,
|
|
131
|
+
betaOptionAction,
|
|
132
|
+
name,
|
|
133
|
+
description
|
|
134
|
+
} = props;
|
|
132
135
|
const {
|
|
133
136
|
translate
|
|
134
137
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -147,8 +150,8 @@ const BetaPill = ({
|
|
|
147
150
|
return (0, jsx_runtime_1.jsx)(pillExpandable_1.PillExpandable, {
|
|
148
151
|
isBeta: true,
|
|
149
152
|
icon: iconLab_1.IconLab,
|
|
150
|
-
description: translate("This feature is still in testing, and is not fully supported yet. Your feedback is valuable to help guide future enhancements."),
|
|
151
|
-
text: translate("Beta"),
|
|
153
|
+
description: description !== null && description !== void 0 ? description : translate("This feature is still in testing, and is not fully supported yet. Your feedback is valuable to help guide future enhancements."),
|
|
154
|
+
text: name !== null && name !== void 0 ? name : translate("Beta"),
|
|
152
155
|
type: "info",
|
|
153
156
|
className: pillClasses,
|
|
154
157
|
mainAction: resolvedMainAction,
|
|
@@ -161,7 +164,7 @@ const BetaPill = ({
|
|
|
161
164
|
type: "info",
|
|
162
165
|
children: !isMobile && (0, jsx_runtime_1.jsx)("span", {
|
|
163
166
|
className: "zen-caption__content",
|
|
164
|
-
children: translate("Beta")
|
|
167
|
+
children: name !== null && name !== void 0 ? name : translate("Beta")
|
|
165
168
|
})
|
|
166
169
|
});
|
|
167
170
|
};
|
package/dist/card/card.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, FunctionComponent, ReactNode } from "react";
|
|
2
2
|
import { IAbsoluteSize, TContainerSize } from "../cardContainer/cardContainer";
|
|
3
3
|
import { TCardStatus } from "./components/status";
|
|
4
|
-
import { TIconType } from "./components/title";
|
|
4
|
+
import { THeadingTag, TIconType } from "./components/title";
|
|
5
5
|
import { IActions } from "./components/actions";
|
|
6
6
|
import { IContent } from "./components/content";
|
|
7
7
|
import "./card.less";
|
|
@@ -42,6 +42,7 @@ export interface ICard extends IZenComponentProps, IZenGridItem, IZenFormLayoutI
|
|
|
42
42
|
scrollableContent?: boolean;
|
|
43
43
|
autoHeight?: boolean;
|
|
44
44
|
fullHeight?: boolean;
|
|
45
|
+
titleAs?: THeadingTag;
|
|
45
46
|
}
|
|
46
47
|
export declare const Card: FC<ICard> & {
|
|
47
48
|
Actions: FC<IActions>;
|
package/dist/card/card.js
CHANGED
|
@@ -121,7 +121,8 @@ props => {
|
|
|
121
121
|
fullWidth,
|
|
122
122
|
scrollableContent = true,
|
|
123
123
|
autoHeight = false,
|
|
124
|
-
fullHeight = false
|
|
124
|
+
fullHeight = false,
|
|
125
|
+
titleAs
|
|
125
126
|
} = props;
|
|
126
127
|
const {
|
|
127
128
|
translate
|
|
@@ -281,7 +282,8 @@ props => {
|
|
|
281
282
|
isMobile: isMobile,
|
|
282
283
|
title: title,
|
|
283
284
|
icon: titleIcon,
|
|
284
|
-
iconType: titleIconType
|
|
285
|
+
iconType: titleIconType,
|
|
286
|
+
titleAs: titleAs
|
|
285
287
|
}), (0, jsx_runtime_1.jsxs)("div", {
|
|
286
288
|
className: "zen-card__header-right",
|
|
287
289
|
children: [!!headerActions.length && headerActions, date ? (0, jsx_runtime_1.jsx)("span", {
|
|
@@ -2,6 +2,7 @@ import { FunctionComponent } from "react";
|
|
|
2
2
|
import "./title.less";
|
|
3
3
|
import { IIcon } from "../../icons/icon";
|
|
4
4
|
export type TIconType = "info" | "warning" | "error" | "success" | "default";
|
|
5
|
+
export type THeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
6
|
interface ITitle {
|
|
6
7
|
isMobile: boolean;
|
|
7
8
|
title: string;
|
|
@@ -12,6 +13,7 @@ interface ITitle {
|
|
|
12
13
|
icon?: FunctionComponent<IIcon>;
|
|
13
14
|
iconType?: TIconType;
|
|
14
15
|
onClick?: () => void;
|
|
16
|
+
titleAs?: THeadingTag;
|
|
15
17
|
}
|
|
16
|
-
export declare const Title: ({ isMobile, link, target, title, id, icon, iconType, className, onClick }: ITitle) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Title: ({ isMobile, link, target, title, id, icon, iconType, className, onClick, titleAs }: ITitle) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -7,12 +7,13 @@ const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
|
7
7
|
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
8
8
|
const useDrive_1 = require("../../utils/theme/useDrive");
|
|
9
9
|
const iconChevronRightSmall_1 = require("../../icons/iconChevronRightSmall");
|
|
10
|
-
const
|
|
10
|
+
const VALID_HEADING_TAGS = new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
11
|
+
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick, titleAs }) => {
|
|
11
12
|
const driveClassNames = (0, useDriveClassName_1.useDriveClassName)("zen-card-title");
|
|
12
13
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
13
14
|
const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
|
|
14
15
|
const iconSize = (0, react_1.useMemo)(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
15
|
-
const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("
|
|
16
|
+
const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("span", { className: (0, classNames_1.classNames)(["zen-card-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
16
17
|
const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-card-title__link-chevron", children: (0, jsx_runtime_1.jsx)(iconChevronRightSmall_1.IconChevronRightSmall, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [iconSize]);
|
|
17
18
|
const titleClasses = (0, classNames_1.classNames)(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
|
|
18
19
|
if (onClick) {
|
|
@@ -21,6 +22,7 @@ const Title = ({ isMobile, link, target, title, id, icon, iconType, className =
|
|
|
21
22
|
if (link) {
|
|
22
23
|
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: titleClasses, href: link, target: target, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-card-title__link-text"]), children: [title, chevron] })] }));
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
const tag = titleAs && VALID_HEADING_TAGS.has(titleAs) ? titleAs : "div";
|
|
26
|
+
return (0, react_1.createElement)(tag, { className: titleClasses }, iconElement, (0, jsx_runtime_1.jsx)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: title }, "text"));
|
|
25
27
|
};
|
|
26
28
|
exports.Title = Title;
|
|
@@ -54,10 +54,10 @@ const Checkbox = (_a) => {
|
|
|
54
54
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
55
55
|
const checkboxIconClasses = (0, react_1.useMemo)(() => (0, classNames_1.classNames)(["zen-checkbox__icon", disabled ? "zen-checkbox__icon--disabled" : ""]), [disabled]);
|
|
56
56
|
const checkbox = ((0, jsx_runtime_1.jsx)(triStateCheckbox_1.TriStateCheckbox, Object.assign({ className: "zen-checkbox__input", id: intId, checked: checked, indeterminate: indeterminate, disabled: disabled, "aria-label": title, "aria-describedby": describedBy }, rest)));
|
|
57
|
-
const iconAndLabel = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-checkbox__box", children: state === checkboxState_1.CheckboxState.Indeterminate ? ((0, jsx_runtime_1.jsx)(checkboxIconMinus_1.CheckboxIconMinus, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : state === checkboxState_1.CheckboxState.On ? ((0, jsx_runtime_1.jsx)(checkboxIconCheckmark_1.CheckboxIconCheckmark, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : null }), children ? ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox__label-text", fullWidth ? "zen-checkbox__label-text--full-width" : ""]), children: children })) : null] }));
|
|
57
|
+
const iconAndLabel = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-checkbox__box", "aria-hidden": true, children: state === checkboxState_1.CheckboxState.Indeterminate ? ((0, jsx_runtime_1.jsx)(checkboxIconMinus_1.CheckboxIconMinus, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : state === checkboxState_1.CheckboxState.On ? ((0, jsx_runtime_1.jsx)(checkboxIconCheckmark_1.CheckboxIconCheckmark, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : null }), children ? ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox__label-text", fullWidth ? "zen-checkbox__label-text--full-width" : ""]), children: children })) : null] }));
|
|
58
58
|
if (wrapped) {
|
|
59
59
|
return ((0, jsx_runtime_1.jsxs)("label", { className: (0, classNames_1.classNames)(["zen-checkbox", driveClasses || "", className]), title: title, children: [checkbox, (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox__label", reverse ? "zen-checkbox__label--reverse" : ""]), children: iconAndLabel })] }));
|
|
60
60
|
}
|
|
61
|
-
return ((0, jsx_runtime_1.
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox", isMobile && !driveClasses ? "zen-checkbox--mobile" : "", driveClasses || "", className]), children: (0, jsx_runtime_1.jsxs)("label", { className: (0, classNames_1.classNames)(["zen-checkbox__label", reverse ? "zen-checkbox__label--reverse" : ""]), title: title, children: [checkbox, iconAndLabel] }) }));
|
|
62
62
|
};
|
|
63
63
|
exports.Checkbox = Checkbox;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const Colors: {
|
|
2
|
+
Text: {
|
|
3
|
+
colorName: string;
|
|
4
|
+
text: string;
|
|
5
|
+
variable: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}[];
|
|
8
|
+
Actions: {
|
|
9
|
+
colorName: string;
|
|
10
|
+
text: string;
|
|
11
|
+
variable: string;
|
|
12
|
+
description: string;
|
|
13
|
+
}[];
|
|
14
|
+
Backgrounds: {
|
|
15
|
+
colorName: string;
|
|
16
|
+
text: string;
|
|
17
|
+
variable: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}[];
|
|
20
|
+
Borders: {
|
|
21
|
+
colorName: string;
|
|
22
|
+
text: string;
|
|
23
|
+
variable: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}[];
|
|
26
|
+
Accents: {
|
|
27
|
+
colorName: string;
|
|
28
|
+
text: string;
|
|
29
|
+
variable: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}[];
|
|
32
|
+
DutyStatus: {
|
|
33
|
+
colorName: string;
|
|
34
|
+
text: string;
|
|
35
|
+
variable: string;
|
|
36
|
+
description: string;
|
|
37
|
+
}[];
|
|
38
|
+
Categorical: {
|
|
39
|
+
colorName: string;
|
|
40
|
+
text: string;
|
|
41
|
+
variable: string;
|
|
42
|
+
description: string;
|
|
43
|
+
}[];
|
|
44
|
+
};
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Colors = void 0;
|
|
4
|
+
exports.Colors = {
|
|
5
|
+
Text: [
|
|
6
|
+
{
|
|
7
|
+
colorName: "primary",
|
|
8
|
+
text: "Primary",
|
|
9
|
+
variable: "--text-primary",
|
|
10
|
+
description: "For primary text and icons"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
colorName: "secondary",
|
|
14
|
+
text: "Secondary",
|
|
15
|
+
variable: "--text-secondary",
|
|
16
|
+
description: "For less prominent text and icon"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
colorName: "placeholder",
|
|
20
|
+
text: "Placeholder",
|
|
21
|
+
variable: "--text-placeholder",
|
|
22
|
+
description: "For visual cues for input fields"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
colorName: "hyperlink",
|
|
26
|
+
text: "Hyperlink",
|
|
27
|
+
variable: "--text-hyperlink",
|
|
28
|
+
description: "For distinguishing clickable links from regular text"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
colorName: "nav-highlight",
|
|
32
|
+
variable: "--text-nav-highlight",
|
|
33
|
+
text: "Nav Highlight",
|
|
34
|
+
description: "For indication of currently selected or active menu item"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
colorName: "error",
|
|
38
|
+
text: "Error Message",
|
|
39
|
+
variable: "--text-error-message",
|
|
40
|
+
description: "For highlighting critical information, such as validation errors or warnings"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
colorName: "disabled",
|
|
44
|
+
text: "Text button disabled",
|
|
45
|
+
variable: "--text-button-disabled",
|
|
46
|
+
description: "For inactive or unavailable elements"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
colorName: "reverse",
|
|
50
|
+
text: "Reverse - Primary",
|
|
51
|
+
variable: "--text-reverse-primary",
|
|
52
|
+
description: "For high-contrast readability on dark backgrounds"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
Actions: [
|
|
56
|
+
{
|
|
57
|
+
colorName: "action-primary",
|
|
58
|
+
text: "Primary",
|
|
59
|
+
variable: "--text-primary--default",
|
|
60
|
+
description: "For immediate attention to interactive elements"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
colorName: "action-primary-hover",
|
|
64
|
+
text: "Primary - Hover",
|
|
65
|
+
variable: "--text-primary--hover",
|
|
66
|
+
description: "For indication when users hover over interactive elements"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
colorName: "action-primary-active",
|
|
70
|
+
text: "Primary - Active",
|
|
71
|
+
variable: "--text-primary--active",
|
|
72
|
+
description: "For indication when an element is clicked or tapped"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
colorName: "action-secondary",
|
|
76
|
+
text: "Secondary - Default",
|
|
77
|
+
variable: "--text-secondary--default",
|
|
78
|
+
description: "Primary text and icons colour for text and icons"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
colorName: "action-secondary-hover",
|
|
82
|
+
text: "Secondary - Hover",
|
|
83
|
+
variable: "--text-secondary--hover",
|
|
84
|
+
description: "For indication when users hover over less prominent interactive elements"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
colorName: "action-secondary-active",
|
|
88
|
+
text: "Secondary - Active",
|
|
89
|
+
variable: "--text-secondary--active",
|
|
90
|
+
description: "For indication when a secondary element is clicked or tapped"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
colorName: "action-destructive",
|
|
94
|
+
text: "Destructive - Default",
|
|
95
|
+
variable: "--text-destructive--default",
|
|
96
|
+
description: "For highlighting actions or elements that carry significant consequences"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
colorName: "action-destructive-hover",
|
|
100
|
+
text: "Destructive Hover",
|
|
101
|
+
variable: "--text-destructive--hover",
|
|
102
|
+
description: "For visual feedback when users hover over elements representing potentially irreversible actions"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
colorName: "action-destructive-active",
|
|
106
|
+
text: "Destructive - Active",
|
|
107
|
+
variable: "--text-destructive--active",
|
|
108
|
+
description: "For when potentially irreversible actions are clicked"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
colorName: "action-tertiary-hover",
|
|
112
|
+
text: "Tertiary hover",
|
|
113
|
+
variable: "--text-tertiary--hover",
|
|
114
|
+
description: "For subtle visual feedback when users hover over less prominent interactive elements"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
colorName: "action-tertiary-active",
|
|
118
|
+
text: "Tertiary active",
|
|
119
|
+
variable: "--text-tertiary--active",
|
|
120
|
+
description: "For less prominent interactive elements, when they are clicked or tapped"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
Backgrounds: [
|
|
124
|
+
{
|
|
125
|
+
colorName: "backgrounds-main",
|
|
126
|
+
text: "Main",
|
|
127
|
+
variable: "--backgrounds-main",
|
|
128
|
+
description: "Default background for optimized readability"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
colorName: "backgrounds-content-0",
|
|
132
|
+
text: "Content 0",
|
|
133
|
+
variable: "--backgrounds-content-0",
|
|
134
|
+
description: "For contrast above main background"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
colorName: "backgrounds-content-1",
|
|
138
|
+
text: "Content 1",
|
|
139
|
+
variable: "--backgrounds-content-1",
|
|
140
|
+
description: "For additional contrast above main and content 0 background"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
colorName: "backgrounds-content-2",
|
|
144
|
+
text: "Content 2",
|
|
145
|
+
variable: "--backgrounds-content-2",
|
|
146
|
+
description: "Providing contrast to distinguish components"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
colorName: "backgrounds-generic-hover",
|
|
150
|
+
text: "Generic Hover",
|
|
151
|
+
variable: "--backgrounds-hover",
|
|
152
|
+
description: "For visual feedback when users hover over an interactive element with an background"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
colorName: "backgrounds-disabled",
|
|
156
|
+
text: "Field Disabled",
|
|
157
|
+
variable: "--backgrounds-field-disabled",
|
|
158
|
+
description: "For the background of elements that are disabled"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
colorName: "backgrounds-text-button-disabled",
|
|
162
|
+
text: "Text Button - Disabled",
|
|
163
|
+
variable: "--backgrounds-text-button-disabled",
|
|
164
|
+
description: "For the background of text Buttons that are disabled"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
colorName: "backgrounds-primary-brand",
|
|
168
|
+
text: "Primary Brand",
|
|
169
|
+
variable: "--backgrounds-primary-brand",
|
|
170
|
+
description: "For Geotab Branding Background"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
colorName: "backgrounds-reverse-0",
|
|
174
|
+
text: "Reverse 0",
|
|
175
|
+
variable: "--backgrounds-reverse-0",
|
|
176
|
+
description: "For contrast against light backgrounds"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
colorName: "backgrounds-reverse-1",
|
|
180
|
+
text: "Reverse 1",
|
|
181
|
+
variable: "--backgrounds-reverse-1",
|
|
182
|
+
description: "For high contrast against light backgrounds"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
colorName: "backgrounds-reverse-2",
|
|
186
|
+
text: "Reverse 2",
|
|
187
|
+
variable: "--backgrounds-reverse-2",
|
|
188
|
+
description: "For a light contrast background"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
colorName: "backgrounds-overlay",
|
|
192
|
+
text: "Overlay",
|
|
193
|
+
variable: "--backgrounds-overlay",
|
|
194
|
+
description: "For Scrims and overlay"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
Borders: [
|
|
198
|
+
{
|
|
199
|
+
colorName: "borders-main",
|
|
200
|
+
text: "General",
|
|
201
|
+
variable: "--borders-general",
|
|
202
|
+
description: "For the default border to subtly visually separate elements"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
colorName: "borders-secondary",
|
|
206
|
+
text: "Secondary",
|
|
207
|
+
variable: "--borders-secondary",
|
|
208
|
+
description: "For visually separating elements elements with higher contrast"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
colorName: "borders-formfield-active",
|
|
212
|
+
text: "Formfield - Active",
|
|
213
|
+
variable: "--borders-form-field--active",
|
|
214
|
+
description: "For visual indication that an input field is active"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
colorName: "borders-formfield-error",
|
|
218
|
+
text: "Formfield - Error",
|
|
219
|
+
variable: "--borders-form-field--error",
|
|
220
|
+
description: "For visual indication that an input field has an incorrect input"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
colorName: "borders-formfield-reverse",
|
|
224
|
+
text: "Formfield - Reverse",
|
|
225
|
+
variable: "--borders-form-field--reverse",
|
|
226
|
+
description: "For a contrasting border against a darker background"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
Accents: [
|
|
230
|
+
{
|
|
231
|
+
colorName: "accents-warning--main",
|
|
232
|
+
text: "Warning - Main",
|
|
233
|
+
variable: "--accents-warning--main",
|
|
234
|
+
description: "Use for a background colour for an element with an accent to highlight a warning"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
colorName: "accents-warning--detail",
|
|
238
|
+
text: "Warning - Detail",
|
|
239
|
+
variable: "--accents-warning--detail",
|
|
240
|
+
description: "Use for a foreground colour for an element with an accent to highlight a warning"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
colorName: "accents-error--main",
|
|
244
|
+
text: "Error - Main",
|
|
245
|
+
variable: "--accents-error--main",
|
|
246
|
+
description: "Use for a background colour for an element with an accent to highlight an error"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
colorName: "accents-error--detail",
|
|
250
|
+
text: "Warning - Detail",
|
|
251
|
+
variable: "--accents-error--detail",
|
|
252
|
+
description: "Use for a foreground colour for an element with an accent to highlight an error"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
colorName: "accents-success--main",
|
|
256
|
+
text: "Success - Main",
|
|
257
|
+
variable: "--accents-success--main",
|
|
258
|
+
description: "Use for a background colour for an element with an accent to highlight a success"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
colorName: "accents-success--detail",
|
|
262
|
+
text: "Success - Detail",
|
|
263
|
+
variable: "--accents-success--detail",
|
|
264
|
+
description: "Use for a foreground colour for an element with an accent to highlight a success"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
colorName: "accents-general--main",
|
|
268
|
+
text: "General - Main",
|
|
269
|
+
variable: "--accents-general--main",
|
|
270
|
+
description: "Use for a default background colour for an element with an accent "
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
colorName: "accents-general--detail",
|
|
274
|
+
text: "General - Detail",
|
|
275
|
+
variable: "--accents-general--detail",
|
|
276
|
+
description: "Use for a default foreground colour for an element with an accent "
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
DutyStatus: [
|
|
280
|
+
{
|
|
281
|
+
colorName: "duty-status-workday",
|
|
282
|
+
text: "Workday",
|
|
283
|
+
variable: "--duty-status-workday",
|
|
284
|
+
description: "To indicate the driver is on duty"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
colorName: "duty-status-cycle",
|
|
288
|
+
text: "Cycle",
|
|
289
|
+
variable: "--duty-status-cycle",
|
|
290
|
+
description: "To indicate off duty"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
colorName: "duty-status-rest",
|
|
294
|
+
text: "Rest",
|
|
295
|
+
variable: "--duty-status-rest",
|
|
296
|
+
description: "To indicate driver is on rest"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
colorName: "duty-status-drive",
|
|
300
|
+
text: "Drive",
|
|
301
|
+
variable: "--duty-status-drive",
|
|
302
|
+
description: "To indicate driver is driving"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
colorName: "duty-status-exemption",
|
|
306
|
+
text: "Exemption",
|
|
307
|
+
variable: "--duty-status-exemption",
|
|
308
|
+
description: "To indicate an exemption "
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
Categorical: [
|
|
312
|
+
{
|
|
313
|
+
colorName: "categorical-light-blue",
|
|
314
|
+
text: "Light blue",
|
|
315
|
+
variable: "--data--categorical-light-blue",
|
|
316
|
+
description: "This color is the first color in the categorical color set."
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
colorName: "categorical-blue",
|
|
320
|
+
text: "Blue",
|
|
321
|
+
variable: "--data--categorical-blue",
|
|
322
|
+
description: "This color is the second color in the categorical color set."
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
colorName: "categorical-purple",
|
|
326
|
+
text: "Purple",
|
|
327
|
+
variable: "--data--categorical-purple",
|
|
328
|
+
description: "This color is the third color in the categorical color set."
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
colorName: "categorical-green",
|
|
332
|
+
text: "Green",
|
|
333
|
+
variable: "--data--categorical-green",
|
|
334
|
+
description: "This color is the fourth color in the categorical color set."
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
colorName: "categorical-orange",
|
|
338
|
+
text: "Orange",
|
|
339
|
+
variable: "--data--categorical-orange",
|
|
340
|
+
description: "This color is the fifth color in the categorical color set."
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
colorName: "categorical-yellow",
|
|
344
|
+
text: "Yellow",
|
|
345
|
+
variable: "--data--categorical-yellow",
|
|
346
|
+
description: "This color is the sixth color in the categorical color set."
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
colorName: "categorical-red",
|
|
350
|
+
text: "Red",
|
|
351
|
+
variable: "--data--categorical-red",
|
|
352
|
+
description: "This color is the seventh color in the categorical color set."
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
colorName: "categorical-grey",
|
|
356
|
+
text: "Grey",
|
|
357
|
+
variable: "--data--categorical-grey",
|
|
358
|
+
description: "This color is the eighth color in the categorical color set."
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./typographyItem.less";
|
|
2
|
+
export declare const TypographyItem: ({ content, contentClassName, font, device, tag }: {
|
|
3
|
+
content?: string | undefined;
|
|
4
|
+
contentClassName?: string | undefined;
|
|
5
|
+
font?: string | undefined;
|
|
6
|
+
device?: string | undefined;
|
|
7
|
+
tag: any;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|