@geotab/zenith 3.10.0-beta.1 → 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.
Files changed (57) hide show
  1. package/README.md +9 -6
  2. package/dist/betaPill/betaPill.d.ts +9 -4
  3. package/dist/betaPill/betaPill.js +8 -7
  4. package/dist/card/card.d.ts +2 -1
  5. package/dist/card/card.js +4 -2
  6. package/dist/card/components/title.d.ts +3 -1
  7. package/dist/card/components/title.js +5 -3
  8. package/dist/checkboxListWithAction/checkboxListWithAction.js +2 -1
  9. package/dist/commonStyles/colors/colorsConstant.d.ts +44 -0
  10. package/dist/commonStyles/colors/colorsConstant.js +361 -0
  11. package/dist/commonStyles/typography/components/typographyItem.d.ts +8 -0
  12. package/dist/commonStyles/typography/components/typographyItem.js +45 -0
  13. package/dist/dropdown/dropdown.js +1 -1
  14. package/dist/dropdownRaw/dropdownList.d.ts +4 -2
  15. package/dist/dropdownRaw/dropdownList.js +15 -36
  16. package/dist/dropdownRaw/dropdownRaw.js +9 -23
  17. package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +1 -0
  18. package/dist/dropdownRaw/stateReducer/stateReducer.js +13 -14
  19. package/dist/dropdownRaw/stateReducer/stateReducerHelper.d.ts +1 -2
  20. package/dist/dropdownRaw/stateReducer/stateReducerHelper.js +5 -12
  21. package/dist/headerTitle/headerTitle.d.ts +9 -3
  22. package/dist/headerTitle/headerTitle.js +3 -2
  23. package/dist/index.css +34 -2
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.js +3 -1
  26. package/dist/testHelpers/fakeFetch.d.ts +1 -0
  27. package/dist/testHelpers/fakeFetch.js +14 -0
  28. package/dist/testHelpers/geotab-axe/index.d.ts +2 -0
  29. package/dist/testHelpers/geotab-axe/index.js +81 -0
  30. package/dist/testHelpers/jestRetry.d.ts +0 -0
  31. package/dist/testHelpers/jestRetry.js +2 -0
  32. package/dist/testHelpers/renderAsync.d.ts +2 -0
  33. package/dist/testHelpers/renderAsync.js +12 -0
  34. package/dist/testHelpers/setReadonlyHtmlProperty.d.ts +1 -0
  35. package/dist/testHelpers/setReadonlyHtmlProperty.js +15 -0
  36. package/dist/testHelpers/styled-output.d.ts +30 -0
  37. package/dist/testHelpers/styled-output.js +42 -0
  38. package/esm/betaPill/betaPill.d.ts +9 -4
  39. package/esm/betaPill/betaPill.js +8 -7
  40. package/esm/card/card.d.ts +2 -1
  41. package/esm/card/card.js +4 -2
  42. package/esm/card/components/title.d.ts +3 -1
  43. package/esm/card/components/title.js +5 -3
  44. package/esm/checkboxListWithAction/checkboxListWithAction.js +2 -1
  45. package/esm/dropdown/dropdown.js +1 -1
  46. package/esm/dropdownRaw/dropdownList.d.ts +4 -2
  47. package/esm/dropdownRaw/dropdownList.js +15 -36
  48. package/esm/dropdownRaw/dropdownRaw.js +10 -24
  49. package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +1 -0
  50. package/esm/dropdownRaw/stateReducer/stateReducer.js +14 -15
  51. package/esm/dropdownRaw/stateReducer/stateReducerHelper.d.ts +1 -2
  52. package/esm/dropdownRaw/stateReducer/stateReducerHelper.js +3 -10
  53. package/esm/headerTitle/headerTitle.d.ts +9 -3
  54. package/esm/headerTitle/headerTitle.js +3 -2
  55. package/esm/index.d.ts +3 -1
  56. package/esm/index.js +1 -0
  57. package/package.json +1 -1
package/README.md CHANGED
@@ -56,12 +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 system font fallback in Storybook pages
60
- - [MYG-128651](https://geotab.atlassian.net/browse/MYG-128651): Update Zenith beta pill parameters to take optional custom text
61
- - Increase max height of zen popup
62
- - [MYG-128520](https://geotab.atlassian.net/browse/MYG-128520): Fix SidePanel not animating open due to RTL regression
63
- - [MYG-121631](https://geotab.atlassian.net/browse/MYG-121631): Add `closeOnScroll` prop to close `ContextMenu` on scroll
64
- - [MYG-123578](https://geotab.atlassian.net/browse/MYG-123578): Fix checkbox accessibility by moving input inside label wrapper
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
65
68
 
66
69
  ### 3.9.1
67
70
 
@@ -6,21 +6,26 @@ export interface IBetaPillActions {
6
6
  link?: string;
7
7
  linkOptions?: ILinkOptions;
8
8
  }
9
+ /**
10
+ * @internal - temporary escape hatch
11
+ * @deprecated
12
+ */
13
+ export interface IBetaPillBaseInternal {
14
+ name?: string;
15
+ description?: string;
16
+ }
9
17
  interface IBetaPillBase {
10
18
  className?: string;
11
- name?: string;
12
19
  }
13
20
  interface IBetaPillWithActions extends IBetaPillBase {
14
21
  feedbackAction?: IBetaPillActions;
15
22
  betaOptionAction?: IBetaPillActions;
16
- description?: string;
17
23
  }
18
24
  interface IBetaPillWithoutActions extends IBetaPillBase {
19
25
  feedbackAction?: never;
20
26
  betaOptionAction?: never;
21
- description?: never;
22
27
  }
23
28
  export type IBetaPill = IBetaPillWithActions | IBetaPillWithoutActions;
24
- export declare const BetaPill: ({ className, feedbackAction, betaOptionAction, name, description }: IBetaPill) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const BetaPill: (props: IBetaPill) => import("react/jsx-runtime").JSX.Element;
25
30
  export declare const TRANSLATIONS: string[];
26
31
  export {};
@@ -124,13 +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
- className,
129
- feedbackAction,
130
- betaOptionAction,
131
- name,
132
- description
133
- }) => {
127
+ const BetaPill = props => {
128
+ const {
129
+ className,
130
+ feedbackAction,
131
+ betaOptionAction,
132
+ name,
133
+ description
134
+ } = props;
134
135
  const {
135
136
  translate
136
137
  } = (0, useLanguage_1.useLanguage)();
@@ -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 Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
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)("div", { className: (0, classNames_1.classNames)(["zen-card-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
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
- return ((0, jsx_runtime_1.jsxs)("div", { className: titleClasses, children: [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 })] }));
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;
@@ -379,7 +379,8 @@ const CheckboxListWithAction = ({
379
379
  onClick: handleClick,
380
380
  title: title,
381
381
  className: classN,
382
- tabIndex: -1
382
+ tabIndex: -1,
383
+ disabled: option.blocked
383
384
  }, otherArgs, {
384
385
  children: childEl
385
386
  })) : (0, jsx_runtime_1.jsx)("div", {
@@ -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;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypographyItem = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const classNames_1 = require("../../../commonHelpers/classNames/classNames");
7
+ const useMobile_1 = require("../../../commonHelpers/hooks/useMobile");
8
+ const useDrive_1 = require("../../../utils/theme/useDrive");
9
+ const zen_1 = require("../../../utils/zen");
10
+ const getFontWeightName = (value) => {
11
+ switch (value) {
12
+ case 300:
13
+ return "Light";
14
+ case 400:
15
+ return "Regular";
16
+ case 500:
17
+ return "Medium";
18
+ case 700:
19
+ return "Bold";
20
+ default:
21
+ return "Unknown";
22
+ }
23
+ };
24
+ const TypographyItem = ({ content = "The brown fox jumped over the lazy dog.", contentClassName = "", font = "Roboto", device = "", tag }) => {
25
+ const ref = (0, react_1.useRef)(null);
26
+ const [fontWeightState, setFontWeight] = (0, react_1.useState)("Unknown");
27
+ const [fontSizeState, setFontSize] = (0, react_1.useState)("Unknown");
28
+ const [lineHeightState, setLineHeight] = (0, react_1.useState)("Unknown");
29
+ const [letterSpacingState, setLetterSpacing] = (0, react_1.useState)("Unknown");
30
+ const isMobile = (0, useMobile_1.useMobile)();
31
+ const isDrive = (0, useDrive_1.useDrive)();
32
+ const bigScreenName = isDrive ? "Tablet" : "Desktop";
33
+ const deviceName = device || (isMobile ? "Mobile" : bigScreenName);
34
+ (0, react_1.useLayoutEffect)(() => {
35
+ if (ref.current && zen_1.zen.getComputedStyle) {
36
+ const { fontWeight, fontSize, lineHeight, letterSpacing } = zen_1.zen.getComputedStyle(ref.current);
37
+ setFontWeight(getFontWeightName(parseInt(fontWeight)));
38
+ setFontSize(fontSize);
39
+ setLineHeight(lineHeight);
40
+ setLetterSpacing(letterSpacing === "normal" ? "0px" : letterSpacing);
41
+ }
42
+ }, [isMobile]);
43
+ return ((0, jsx_runtime_1.jsx)("div", { className: "story-typography-item", children: (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-wrapper", children: [(0, jsx_runtime_1.jsx)("p", { ref: ref, className: (0, classNames_1.classNames)(["story-typography-item__content", contentClassName]), children: content }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description", children: [(0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-column", children: [(0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Font" }), (0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-value heading-04", children: font })] }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Weight" }), (0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-value heading-04", children: fontWeightState })] }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Size" }), (0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-value heading-04", children: fontSizeState })] }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Line Height" }), (0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-value heading-04", children: lineHeightState })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-column", children: [(0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Letter Spacing" }), (0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-value heading-04", children: letterSpacingState })] }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Device" }), (0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-value heading-04", children: deviceName })] }), (0, jsx_runtime_1.jsxs)("div", { className: "story-typography-item__content-description-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "story-typography-item__content-description-name label-01-desktop", children: "Tag" }), (0, jsx_runtime_1.jsxs)("span", { className: "story-typography-item__content-description-value heading-04", children: ["<", tag, ">"] })] })] })] })] }) }));
44
+ };
45
+ exports.TypographyItem = TypographyItem;
@@ -24,4 +24,4 @@ const Dropdown = (_a) => {
24
24
  return (0, jsx_runtime_1.jsx)(DropDownFormField, Object.assign({}, props));
25
25
  };
26
26
  exports.Dropdown = Dropdown;
27
- exports.TRANSLATIONS = ["Filter by group", "Open filter", "Clear search", "Select all", "Deselect all", "Clear", "Back", "No data"];
27
+ exports.TRANSLATIONS = ["Filter by group", "Open filter", "Clear search", "Select all", "Clear", "Back", "No data"];
@@ -13,7 +13,9 @@ export interface IDropdownList extends IZenComponentProps {
13
13
  onSelect: (id: string) => void;
14
14
  onSingleSelect: (reset: boolean, selected?: string) => void;
15
15
  backButtonName?: string;
16
- isAllSelected: boolean;
16
+ isAllSelected?: boolean;
17
+ isSelectAllActive?: boolean;
18
+ shouldBlockItems?: boolean;
17
19
  listData: ICheckboxListWithActionOption[] | ISelectListItem[];
18
20
  isWithFooter: boolean;
19
21
  width?: number;
@@ -39,6 +41,6 @@ interface IDropdownEmptyList extends Pick<IDropdownList, "className" | "width" |
39
41
  hasError: boolean;
40
42
  }
41
43
  export declare const EmptyList: ({ className, width, onClearClick, onApplyClick, onCancelClick, hasApplyButton, isApplyDisabled, isClearButtonDisabled, isWithFooter, hasError }: IDropdownEmptyList) => import("react/jsx-runtime").JSX.Element;
42
- export declare const DropdownList: ({ onBackButtonClick, onSelectAllClick, onClearClick, onApplyClick, onCancelClick, onChange, onSelect, onSingleSelect, listData, isAllSelected, backButtonName, width, minWidth, isSelectAllButtonDisable, hasSelectAllButton, filterName, isMultiselect, hasApplyButton, isApplyDisabled, isClearButtonDisabled, activeValue, forceSelection, isWithFooter, isMobile, handleCheckboxChange, checkboxLabel, isChecked, listElementRef, listId }: IDropdownList) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const DropdownList: ({ onBackButtonClick, onSelectAllClick, onClearClick, onApplyClick, onCancelClick, onChange, onSelect, onSingleSelect, listData, isSelectAllActive, shouldBlockItems, backButtonName, width, minWidth, isSelectAllButtonDisable, hasSelectAllButton, filterName, isMultiselect, hasApplyButton, isApplyDisabled, isClearButtonDisabled, activeValue, forceSelection, isWithFooter, isMobile, handleCheckboxChange, checkboxLabel, isChecked, listElementRef, listId }: IDropdownList) => import("react/jsx-runtime").JSX.Element;
43
45
  export declare const TRANSLATIONS: string[];
44
46
  export {};