@geotab/zenith 3.10.0-beta.2 → 3.10.0-beta.3

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.
@@ -870,7 +870,7 @@ const DropdownRaw = props => {
870
870
  listData: currentListData,
871
871
  width: width || currentWidth === 180 ? undefined : currentWidth,
872
872
  minWidth: currentWidth,
873
- hasSelectAllButton: selectAllButton && multiselect && !state.inputValue,
873
+ hasSelectAllButton: selectAllButton && multiselect,
874
874
  hasApplyButton: hasApplyButton,
875
875
  isApplyDisabled: memoizedIsApplyButtonDisabled,
876
876
  isSelectAllButtonDisable: currentListData.length === 0 || isSearchMode && state.isNestedList && (0, dropdownHelper_1.isAllItemsHasOneParent)(state.listData.filter(el => el.id !== state.rootId), (((_c = state.groupsMap[state.rootId]) === null || _c === void 0 ? void 0 : _c.children) || []).map(el => el.id)),
package/dist/index.d.ts CHANGED
@@ -774,8 +774,6 @@ export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvid
774
774
  export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelpers";
775
775
  export { LanguageProvider } from "./utils/localization/languageProvider";
776
776
  export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
777
- export { directionContext } from "./utils/localization/directionContext";
778
- export type { TTextDirection } from "./utils/localization/getTextDirection";
779
777
  export { useDirection } from "./utils/localization/useDirection";
780
778
  export { useLanguage } from "./utils/localization/useLanguage";
781
779
  export { ThemeDark } from "./utils/theme/themeDark";
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ exports.IconShield3 = exports.IconShield2 = exports.IconShield = exports.IconSha
17
17
  exports.IconVolumeHalf = exports.IconVolumeFull = exports.IconVolumeDown = exports.IconVoice = exports.IconVisitPage = exports.IconVideoReplay = exports.IconVideo2 = exports.IconVideo = exports.IconUsbHub = exports.IconUsb = exports.IconUpload = exports.IconUnlocked = exports.IconUndock = exports.IconUndo2 = exports.IconUndo = exports.IconUnderline = exports.IconUmbrella = exports.IconTrailer = exports.IconThumbsUp = exports.IconThumbsDown = exports.IconThermometer = exports.IconThermograph = exports.IconTextSize = exports.IconTelevision2 = exports.IconTelevision = exports.IconTarget3 = exports.IconTarget2 = exports.IconTarget = exports.IconTachographTimeCard = exports.IconTachograph = exports.IconTable = exports.IconSupport = exports.IconSun = exports.IconStrikeThrough = exports.IconStore = exports.IconStorage = exports.IconStopwatch = exports.IconStarFilled = exports.IconStarAi = exports.IconStar = exports.IconSquare = exports.IconSpeaker = exports.IconSortVertical = exports.IconSortHorizontal = exports.IconSort2Vertical = exports.IconSort2Horizontal = exports.IconSmiley = exports.IconSign = exports.IconSidebar = exports.IconShield4 = void 0;
18
18
  exports.isButton = exports.findPrevFocusable = exports.findNextFocusable = exports.findLastFocusable = exports.findFirstFocusable = exports.Menu = exports.ControlledMenu = exports.isDragNotClick = exports.changeOrder = exports.ListItem = exports.List = exports.ItemData = exports.ItemCompact = exports.LineChartMini = exports.getDefaultDatasetStyle = exports.htmlLegendPlugin = exports.LEGEND_PLUGIN_ID = exports.LineChart = exports.useLayoutSize = exports.LayoutFullScreenProvider = exports.useLayoutFullScreen = exports.LayoutFullScreenElementProvider = exports.useLayoutFullScreenElement = exports.Layout = exports.ImageTapToUpload = exports.ImageNothingFound = exports.ImageNoMatchingAssets = exports.ImageLooking = exports.ImageCloudUpload = exports.ImageAdjustFilter = exports.IconZoom2 = exports.IconZoom = exports.IconZone = exports.IconYen = exports.IconWrite = exports.IconWrench = exports.IconWorld = exports.IconWorkday = exports.IconWifi2 = exports.IconWifi = exports.IconWhisper = exports.IconWebcam = exports.IconWatch2 = exports.IconWatch = exports.IconWarning = exports.IconWallet1 = exports.IconWallet = exports.IconVolumeOn = exports.IconVolumeOff = exports.IconVolumeMinimum = void 0;
19
19
  exports.SummaryTileBarDisplayName = exports.SummaryTileBar = exports.getTypeClassName = exports.SummaryTileTrigger = exports.SummaryTile = exports.SummaryTileDisplayName = exports.SummaryTileSize = exports.SummaryTileType = exports.Summary = exports.Summaries = exports.Stepper = exports.SortControl = exports.SortDirections = exports.Skeleton = exports.LazyContent = exports.SidePanel = exports.CUSTOM_POPUP_COMPONENT_CLASSNAME = exports.SidePanelCloseReason = exports.isChildPopup = exports.SelectField = exports.Select = exports.SearchInput = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressBar = exports.ProgreesBarSize = exports.ProgressBarType = exports.PrimaryIcon = exports.Popup = exports.PillExpandable = exports.Pill = exports.PaginationType = exports.Pagination = exports.PageLayout = exports.PageContentLayout = exports.PageHeaderMenu = exports.PageHeaderMenuDisplayName = exports.PageHeaderButton = exports.PageHeaderButtonDisplayName = exports.PageHeader = exports.PageHeaderDisplayName = exports.Notification = exports.getPredefinedFocusableItem = exports.DialogContentNew = exports.Modal = exports.MobileSheet = exports.MiniTabs = exports.MiniTabsSize = exports.isLink = void 0;
20
- exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.useDirection = exports.directionContext = exports.injectString = exports.dictionaries = exports.LanguageProvider = exports.getFirstFocusableItem = exports.getNewFocusableItem = exports.HeaderButtonsProvider = exports.AbortablePromise = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButtonRaw = exports.ToggleButton = exports.Toast = exports.useToast = exports.TimePicker = exports.TextareaRaw = exports.Textarea = exports.TextInputRaw = exports.TextInput = exports.TextIconButton = exports.ButtonIconPosition = exports.Tabs = exports.TabsDisplayName = exports.ActionLinkColumn = exports.CheckboxColumn = exports.MainColumn = exports.ActionsColumn = exports.getSortableValue = exports.ColumnSortDirection = exports.getEmptySelection = exports.Table = exports.useNestedRows = exports.NestedData = exports.TabBarContent = exports.TabBar = void 0;
20
+ exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.useDirection = exports.injectString = exports.dictionaries = exports.LanguageProvider = exports.getFirstFocusableItem = exports.getNewFocusableItem = exports.HeaderButtonsProvider = exports.AbortablePromise = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButtonRaw = exports.ToggleButton = exports.Toast = exports.useToast = exports.TimePicker = exports.TextareaRaw = exports.Textarea = exports.TextInputRaw = exports.TextInput = exports.TextIconButton = exports.ButtonIconPosition = exports.Tabs = exports.TabsDisplayName = exports.ActionLinkColumn = exports.CheckboxColumn = exports.MainColumn = exports.ActionsColumn = exports.getSortableValue = exports.ColumnSortDirection = exports.getEmptySelection = exports.Table = exports.useNestedRows = exports.NestedData = exports.TabBarContent = exports.TabBar = void 0;
21
21
  /* eslint-disable max-len */
22
22
  var absolute_1 = require("./absolute/absolute");
23
23
  Object.defineProperty(exports, "Absolute", { enumerable: true, get: function () { return absolute_1.Absolute; } });
@@ -1663,8 +1663,6 @@ Object.defineProperty(exports, "LanguageProvider", { enumerable: true, get: func
1663
1663
  var translationsDictionary_1 = require("./utils/localization/translationsDictionary");
1664
1664
  Object.defineProperty(exports, "dictionaries", { enumerable: true, get: function () { return translationsDictionary_1.dictionaries; } });
1665
1665
  Object.defineProperty(exports, "injectString", { enumerable: true, get: function () { return translationsDictionary_1.injectString; } });
1666
- var directionContext_1 = require("./utils/localization/directionContext");
1667
- Object.defineProperty(exports, "directionContext", { enumerable: true, get: function () { return directionContext_1.directionContext; } });
1668
1666
  var useDirection_1 = require("./utils/localization/useDirection");
1669
1667
  Object.defineProperty(exports, "useDirection", { enumerable: true, get: function () { return useDirection_1.useDirection; } });
1670
1668
  var useLanguage_1 = require("./utils/localization/useLanguage");
@@ -862,7 +862,7 @@ export const DropdownRaw = props => {
862
862
  listData: currentListData,
863
863
  width: width || currentWidth === 180 ? undefined : currentWidth,
864
864
  minWidth: currentWidth,
865
- hasSelectAllButton: selectAllButton && multiselect && !state.inputValue,
865
+ hasSelectAllButton: selectAllButton && multiselect,
866
866
  hasApplyButton: hasApplyButton,
867
867
  isApplyDisabled: memoizedIsApplyButtonDisabled,
868
868
  isSelectAllButtonDisable: currentListData.length === 0 || isSearchMode && state.isNestedList && isAllItemsHasOneParent(state.listData.filter(el => el.id !== state.rootId), (((_c = state.groupsMap[state.rootId]) === null || _c === void 0 ? void 0 : _c.children) || []).map(el => el.id)),
package/esm/index.d.ts CHANGED
@@ -774,8 +774,6 @@ export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvid
774
774
  export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelpers";
775
775
  export { LanguageProvider } from "./utils/localization/languageProvider";
776
776
  export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
777
- export { directionContext } from "./utils/localization/directionContext";
778
- export type { TTextDirection } from "./utils/localization/getTextDirection";
779
777
  export { useDirection } from "./utils/localization/useDirection";
780
778
  export { useLanguage } from "./utils/localization/useLanguage";
781
779
  export { ThemeDark } from "./utils/theme/themeDark";
package/esm/index.js CHANGED
@@ -758,7 +758,6 @@ export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvid
758
758
  export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelpers";
759
759
  export { LanguageProvider } from "./utils/localization/languageProvider";
760
760
  export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
761
- export { directionContext } from "./utils/localization/directionContext";
762
761
  export { useDirection } from "./utils/localization/useDirection";
763
762
  export { useLanguage } from "./utils/localization/useLanguage";
764
763
  export { ThemeDark } from "./utils/theme/themeDark";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geotab/zenith",
3
- "version": "3.10.0-beta.2",
3
+ "version": "3.10.0-beta.3",
4
4
  "description": "Zenith components library on React",
5
5
  "main": "dist/index.js",
6
6
  "types": "esm/index.d.ts",
@@ -1,44 +0,0 @@
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
- };
@@ -1,361 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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;
@@ -1,45 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export declare const fetchData: () => Promise<string>;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchData = void 0;
4
- const zen_1 = require("../utils/zen");
5
- let loadTimeout = null;
6
- const fetchData = () => {
7
- var _a;
8
- loadTimeout && ((_a = zen_1.zen.clearTimeout) === null || _a === void 0 ? void 0 : _a.call(zen_1.zen, loadTimeout));
9
- return new Promise((res, rej) => {
10
- var _a;
11
- loadTimeout = (_a = zen_1.zen.setTimeout) === null || _a === void 0 ? void 0 : _a.call(zen_1.zen, () => Math.random() > 0.5 ? res("Fetched Data") : rej(new Error("Error while fetching data")), 5000);
12
- });
13
- };
14
- exports.fetchData = fetchData;
@@ -1,2 +0,0 @@
1
- /// <reference path="../../../testHelpers/geotab-axe/index.d.ts" />
2
- export {};
@@ -1,81 +0,0 @@
1
- "use strict";
2
- /// <reference path="./index.d.ts" />
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const axe_core_1 = __importDefault(require("axe-core"));
8
- const styled_output_1 = require("../styled-output");
9
- const domParser = new DOMParser();
10
- const lineBreak = "\n\n";
11
- const horizontalLine = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
12
- const runAxe = (el) => new Promise(resolve => {
13
- const parent = el.parentNode;
14
- const sibling = el.nextSibling;
15
- document === null || document === void 0 ? void 0 : document.body.appendChild(el);
16
- axe_core_1.default.configure({
17
- rules: [{
18
- id: "target-size",
19
- enabled: true
20
- }],
21
- checks: [
22
- {
23
- // color contrast checking doesnt work in a jsdom environment.
24
- id: "color-contrast",
25
- enabled: false
26
- }
27
- ]
28
- });
29
- axe_core_1.default.run(el, {}, (err, results) => {
30
- if (err) {
31
- throw err;
32
- }
33
- resolve(results);
34
- parent ? parent.insertBefore(el, sibling) : document === null || document === void 0 ? void 0 : document.body.removeChild(el);
35
- });
36
- });
37
- const toHtml = (str) => {
38
- if (str.indexOf("<html") > -1) {
39
- return domParser.parseFromString(str, "text/html").body;
40
- }
41
- const html = document === null || document === void 0 ? void 0 : document.createElement("template");
42
- html.insertAdjacentHTML("afterbegin", str);
43
- return html;
44
- };
45
- const formatViolations = (violations) => {
46
- if (violations.length === 0) {
47
- return [];
48
- }
49
- return violations.map(violation => {
50
- const errorText = violation.nodes.map(node => {
51
- const selector = node.target.join(", ");
52
- const expectedText = `Availability violation for selector $('${selector}'):` + lineBreak;
53
- return (expectedText +
54
- (0, styled_output_1.stylize)(node.html, styled_output_1.Color.Gray) +
55
- lineBreak +
56
- (0, styled_output_1.stylize)(`---Explanation---`, styled_output_1.Color.Black, styled_output_1.BackgroundColor.White, styled_output_1.Style.Bold, styled_output_1.Style.Underline) +
57
- lineBreak +
58
- `${violation.help} (${violation.id})` +
59
- lineBreak +
60
- (0, styled_output_1.stylize)(node.failureSummary || "", styled_output_1.Color.Yellow) +
61
- lineBreak + (violation.helpUrl
62
- ? `You can find more about it here: \n${(0, styled_output_1.stylize)(violation.helpUrl, styled_output_1.Color.Blue)}`
63
- : ""));
64
- }).join(lineBreak);
65
- return (errorText);
66
- }).join(lineBreak + horizontalLine + lineBreak);
67
- };
68
- const toBeAccessible = async (element, errorMsg) => {
69
- if (!element) {
70
- return { pass: true, message: () => "ok" };
71
- }
72
- const html = element instanceof Node ? element : toHtml(element);
73
- const results = await runAxe(html);
74
- if (results.violations.length) {
75
- const formatedViolations = formatViolations(results.violations);
76
- const message = () => (errorMsg ? errorMsg + lineBreak : "") + formatedViolations;
77
- return { pass: false, message };
78
- }
79
- return { pass: true, message: () => "ok" };
80
- };
81
- expect.extend({ toBeAccessible });
File without changes
@@ -1,2 +0,0 @@
1
- "use strict";
2
- jest.retryTimes(3, { logErrorsBeforeRetry: true });
@@ -1,2 +0,0 @@
1
- import { ReactNode } from "react";
2
- export declare const renderAsync: (component: ReactNode) => Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderAsync = void 0;
4
- const react_1 = require("react");
5
- const react_2 = require("@testing-library/react");
6
- const renderAsync = async (component) => (0, react_1.act)(async () => {
7
- const result = (0, react_2.render)(component);
8
- await Promise.resolve();
9
- await Promise.resolve();
10
- return result;
11
- });
12
- exports.renderAsync = renderAsync;
@@ -1 +0,0 @@
1
- export declare const setReadonlyHtmlProperty: (propName: keyof HTMLElement, values: Map<string, Required<HTMLElement>[keyof HTMLElement]>) => void;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setReadonlyHtmlProperty = void 0;
4
- const setReadonlyHtmlProperty = (propName, values) => {
5
- jest.spyOn(HTMLElement.prototype, propName, "get").mockImplementation(function () {
6
- var _a;
7
- for (const [selector, value] of values) {
8
- if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.querySelector(selector)) === this) {
9
- return value;
10
- }
11
- }
12
- return this[propName];
13
- });
14
- };
15
- exports.setReadonlyHtmlProperty = setReadonlyHtmlProperty;
@@ -1,30 +0,0 @@
1
- export declare enum Color {
2
- No = 39,
3
- Black = 30,
4
- Red = 31,
5
- Green = 32,
6
- Yellow = 33,
7
- Blue = 34,
8
- Purple = 35,
9
- Cyan = 36,
10
- White = 37,
11
- Gray = 90
12
- }
13
- export declare enum BackgroundColor {
14
- No = 49,
15
- Black = 40,
16
- Red = 41,
17
- Green = 42,
18
- Yellow = 43,
19
- Blue = 44,
20
- Purple = 45,
21
- Cyan = 46,
22
- White = 47,
23
- Gray = 100
24
- }
25
- export declare enum Style {
26
- No = 0,
27
- Bold = 1,
28
- Underline = 4
29
- }
30
- export declare function stylize(text: string, ...styles: (Color | BackgroundColor | Style)[]): string;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stylize = exports.Style = exports.BackgroundColor = exports.Color = void 0;
4
- var Color;
5
- (function (Color) {
6
- Color[Color["No"] = 39] = "No";
7
- Color[Color["Black"] = 30] = "Black";
8
- Color[Color["Red"] = 31] = "Red";
9
- Color[Color["Green"] = 32] = "Green";
10
- Color[Color["Yellow"] = 33] = "Yellow";
11
- Color[Color["Blue"] = 34] = "Blue";
12
- Color[Color["Purple"] = 35] = "Purple";
13
- Color[Color["Cyan"] = 36] = "Cyan";
14
- Color[Color["White"] = 37] = "White";
15
- Color[Color["Gray"] = 90] = "Gray";
16
- })(Color || (exports.Color = Color = {}));
17
- var BackgroundColor;
18
- (function (BackgroundColor) {
19
- BackgroundColor[BackgroundColor["No"] = 49] = "No";
20
- BackgroundColor[BackgroundColor["Black"] = 40] = "Black";
21
- BackgroundColor[BackgroundColor["Red"] = 41] = "Red";
22
- BackgroundColor[BackgroundColor["Green"] = 42] = "Green";
23
- BackgroundColor[BackgroundColor["Yellow"] = 43] = "Yellow";
24
- BackgroundColor[BackgroundColor["Blue"] = 44] = "Blue";
25
- BackgroundColor[BackgroundColor["Purple"] = 45] = "Purple";
26
- BackgroundColor[BackgroundColor["Cyan"] = 46] = "Cyan";
27
- BackgroundColor[BackgroundColor["White"] = 47] = "White";
28
- BackgroundColor[BackgroundColor["Gray"] = 100] = "Gray";
29
- })(BackgroundColor || (exports.BackgroundColor = BackgroundColor = {}));
30
- var Style;
31
- (function (Style) {
32
- Style[Style["No"] = 0] = "No";
33
- Style[Style["Bold"] = 1] = "Bold";
34
- Style[Style["Underline"] = 4] = "Underline";
35
- })(Style || (exports.Style = Style = {}));
36
- function stylize(text, ...styles) {
37
- if (!styles.length) {
38
- return text;
39
- }
40
- return styles.reduce((res, style) => `\x1b[${style}m${res}\x1b[0m`, text);
41
- }
42
- exports.stylize = stylize;