@geotab/zenith 3.17.0-beta.2 → 3.17.0-nightly.20261028.0fd371d

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 (215) hide show
  1. package/README.md +2 -0
  2. package/dist/banner/banner.d.ts +2 -1
  3. package/dist/banner/bannerMultipLine.d.ts +1 -1
  4. package/dist/banner/bannerMultipLine.js +4 -2
  5. package/dist/banner/bannerSingleLine.d.ts +1 -1
  6. package/dist/banner/bannerSingleLine.js +2 -1
  7. package/dist/banner/typeIcon.d.ts +3 -1
  8. package/dist/banner/typeIcon.js +87 -14
  9. package/dist/button/button.d.ts +1 -2
  10. package/dist/button/button.js +5 -22
  11. package/dist/button/buttonDisabledProps.d.ts +35 -0
  12. package/dist/button/buttonDisabledProps.js +33 -0
  13. package/dist/chart/pieChart/pieLegendPlugin.js +3 -0
  14. package/dist/chart/pieChart/renderPieLegend.js +6 -4
  15. package/dist/chart/plugins/legend/legendFocus.d.ts +2 -0
  16. package/dist/chart/plugins/legend/legendFocus.js +20 -0
  17. package/dist/chart/plugins/legend/legendPlugin.js +3 -0
  18. package/dist/chart/plugins/legend/renderLegend.js +9 -5
  19. package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +13 -0
  20. package/dist/checkboxListWithAction/checkboxListWithAction.js +112 -22
  21. package/dist/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.d.ts +2 -1
  22. package/dist/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.js +1 -0
  23. package/dist/commonHelpers/hooks/useMergedRef.d.ts +6 -0
  24. package/dist/commonHelpers/hooks/useMergedRef.js +37 -0
  25. package/dist/commonStyles/typography/typography.less +9 -0
  26. package/dist/dataGrid/cell/cell.d.ts +7 -1
  27. package/dist/dataGrid/cell/cell.js +8 -2
  28. package/dist/dataGrid/dataGrid.d.ts +2 -1
  29. package/dist/dataGrid/dataGrid.js +26 -8
  30. package/dist/dataGrid/extensions/getStickyOffsets.d.ts +32 -0
  31. package/dist/dataGrid/extensions/getStickyOffsets.js +47 -0
  32. package/dist/dataGrid/headerCell/headerCell.d.ts +7 -1
  33. package/dist/dataGrid/headerCell/headerCell.js +5 -3
  34. package/dist/dataGrid/listColumn.d.ts +7 -0
  35. package/dist/dataGrid/row/row.d.ts +2 -2
  36. package/dist/dataGrid/row/row.js +13 -7
  37. package/dist/dateRangeRaw/dateRangeRaw.js +50 -9
  38. package/dist/dropdown/dropdown.js +11 -1
  39. package/dist/dropdownRaw/dropdownHelper.d.ts +22 -0
  40. package/dist/dropdownRaw/dropdownHelper.js +234 -142
  41. package/dist/dropdownRaw/dropdownRaw.js +52 -35
  42. package/dist/dropdownRaw/types.d.ts +13 -0
  43. package/dist/fileUpload/components/filePreview.d.ts +15 -0
  44. package/dist/fileUpload/components/filePreview.js +272 -0
  45. package/dist/fileUpload/components/previewableFile.d.ts +16 -0
  46. package/dist/fileUpload/components/previewableFile.js +48 -0
  47. package/dist/fileUpload/components/resolveFileActions.d.ts +10 -0
  48. package/dist/fileUpload/components/resolveFileActions.js +11 -0
  49. package/dist/fileUpload/components/uploadedFilesSection.d.ts +9 -1
  50. package/dist/fileUpload/components/uploadedFilesSection.js +91 -16
  51. package/dist/fileUpload/components/useFilePreview.d.ts +12 -0
  52. package/dist/fileUpload/components/useFilePreview.js +85 -0
  53. package/dist/fileUpload/fileUpload.d.ts +1 -1
  54. package/dist/fileUpload/fileUpload.js +63 -2
  55. package/dist/fileUpload/fileUploadType.d.ts +35 -0
  56. package/dist/filters/components/filtersContainer.js +2 -2
  57. package/dist/filters/components/filtersDateRange.d.ts +1 -1
  58. package/dist/filters/components/filtersDropdown.js +2 -1
  59. package/dist/filters/components/filtersGroups.d.ts +1 -1
  60. package/dist/filters/components/filtersGroups.js +2 -4
  61. package/dist/filters/components/filtersSidePanelDateRange.js +1 -1
  62. package/dist/formSection/components/formSectionCard.js +1 -1
  63. package/dist/groupsFilterRaw/groupsFilterRaw.d.ts +2 -0
  64. package/dist/groupsFilterRaw/groupsFilterRaw.js +10 -2
  65. package/dist/groupsFilterRaw/types.d.ts +2 -0
  66. package/dist/header/headerButton.d.ts +15 -1
  67. package/dist/header/headerButton.js +11 -6
  68. package/dist/icons/iconDoorClosed.d.ts +3 -0
  69. package/dist/icons/iconDoorClosed.js +12 -0
  70. package/dist/icons/iconDoorOpen.d.ts +3 -0
  71. package/dist/icons/iconDoorOpen.js +12 -0
  72. package/dist/icons/iconHumidity.d.ts +3 -0
  73. package/dist/icons/iconHumidity.js +12 -0
  74. package/dist/index.css +420 -12
  75. package/dist/index.d.ts +4 -1
  76. package/dist/index.js +16 -10
  77. package/dist/menu/components/menuButton.js +40 -58
  78. package/dist/miniTabs/miniTabs.d.ts +2 -1
  79. package/dist/miniTabs/miniTabs.js +2 -2
  80. package/dist/miniTabs/miniTabsItem.js +1 -1
  81. package/dist/modal/modal.d.ts +2 -0
  82. package/dist/pageHeader/pageHeaderButton.d.ts +15 -1
  83. package/dist/pageHeader/pageHeaderButton.js +8 -6
  84. package/dist/selectList/selectList.js +25 -1
  85. package/dist/selectList/selectListItem.d.ts +14 -1
  86. package/dist/selectList/selectListItem.js +291 -43
  87. package/dist/stepperRaw/stepperRaw.js +5 -2
  88. package/dist/table/columnMenu/columnMenuHeader.d.ts +28 -0
  89. package/dist/table/columnMenu/columnMenuHeader.js +132 -0
  90. package/dist/table/columnMenu/useColumnMenu.d.ts +24 -0
  91. package/dist/table/columnMenu/useColumnMenu.js +61 -0
  92. package/dist/table/flexible/getDefaultSettings.d.ts +1 -0
  93. package/dist/table/flexible/getDefaultSettings.js +2 -1
  94. package/dist/table/flexible/interfaces.d.ts +7 -0
  95. package/dist/table/flexible/mergeColumnSettings.js +2 -1
  96. package/dist/table/flexible/useFlexibleColumns.d.ts +16 -0
  97. package/dist/table/flexible/useFlexibleColumns.js +123 -49
  98. package/dist/table/flexible/useSettingsStorage.d.ts +2 -1
  99. package/dist/table/loading/useLoading.d.ts +1 -0
  100. package/dist/table/sortable/useSortableColumns.d.ts +1 -0
  101. package/dist/table/sortable/useSortableColumns.js +4 -1
  102. package/dist/table/table.d.ts +14 -1
  103. package/dist/table/table.js +16 -3
  104. package/dist/textInputRaw/textInputRaw.js +4 -2
  105. package/dist/textareaRaw/textareaRaw.js +4 -2
  106. package/dist/tooltip/tooltip.d.ts +5 -3
  107. package/dist/tooltip/tooltip.js +11 -9
  108. package/dist/utils/localization/translations/en.json +10 -1
  109. package/esm/banner/banner.d.ts +2 -1
  110. package/esm/banner/bannerMultipLine.d.ts +1 -1
  111. package/esm/banner/bannerMultipLine.js +4 -2
  112. package/esm/banner/bannerSingleLine.d.ts +1 -1
  113. package/esm/banner/bannerSingleLine.js +2 -1
  114. package/esm/banner/typeIcon.d.ts +3 -1
  115. package/esm/banner/typeIcon.js +81 -14
  116. package/esm/button/button.d.ts +1 -2
  117. package/esm/button/button.js +5 -22
  118. package/esm/button/buttonDisabledProps.d.ts +35 -0
  119. package/esm/button/buttonDisabledProps.js +29 -0
  120. package/esm/chart/pieChart/pieLegendPlugin.js +3 -0
  121. package/esm/chart/pieChart/renderPieLegend.js +6 -4
  122. package/esm/chart/plugins/legend/legendFocus.d.ts +2 -0
  123. package/esm/chart/plugins/legend/legendFocus.js +15 -0
  124. package/esm/chart/plugins/legend/legendPlugin.js +3 -0
  125. package/esm/chart/plugins/legend/renderLegend.js +9 -5
  126. package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +13 -0
  127. package/esm/checkboxListWithAction/checkboxListWithAction.js +107 -22
  128. package/esm/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.d.ts +2 -1
  129. package/esm/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.js +1 -0
  130. package/esm/commonHelpers/hooks/useMergedRef.d.ts +6 -0
  131. package/esm/commonHelpers/hooks/useMergedRef.js +33 -0
  132. package/esm/dataGrid/cell/cell.d.ts +7 -1
  133. package/esm/dataGrid/cell/cell.js +8 -2
  134. package/esm/dataGrid/dataGrid.d.ts +2 -1
  135. package/esm/dataGrid/dataGrid.js +18 -5
  136. package/esm/dataGrid/extensions/getStickyOffsets.d.ts +32 -0
  137. package/esm/dataGrid/extensions/getStickyOffsets.js +41 -0
  138. package/esm/dataGrid/headerCell/headerCell.d.ts +7 -1
  139. package/esm/dataGrid/headerCell/headerCell.js +5 -3
  140. package/esm/dataGrid/listColumn.d.ts +7 -0
  141. package/esm/dataGrid/row/row.d.ts +2 -2
  142. package/esm/dataGrid/row/row.js +12 -6
  143. package/esm/dateRangeRaw/dateRangeRaw.js +51 -10
  144. package/esm/dropdown/dropdown.js +11 -1
  145. package/esm/dropdownRaw/dropdownHelper.d.ts +22 -0
  146. package/esm/dropdownRaw/dropdownHelper.js +227 -142
  147. package/esm/dropdownRaw/dropdownRaw.js +53 -36
  148. package/esm/dropdownRaw/types.d.ts +13 -0
  149. package/esm/fileUpload/components/filePreview.d.ts +15 -0
  150. package/esm/fileUpload/components/filePreview.js +263 -0
  151. package/esm/fileUpload/components/previewableFile.d.ts +16 -0
  152. package/esm/fileUpload/components/previewableFile.js +43 -0
  153. package/esm/fileUpload/components/resolveFileActions.d.ts +10 -0
  154. package/esm/fileUpload/components/resolveFileActions.js +7 -0
  155. package/esm/fileUpload/components/uploadedFilesSection.d.ts +9 -1
  156. package/esm/fileUpload/components/uploadedFilesSection.js +91 -16
  157. package/esm/fileUpload/components/useFilePreview.d.ts +12 -0
  158. package/esm/fileUpload/components/useFilePreview.js +81 -0
  159. package/esm/fileUpload/fileUpload.d.ts +1 -1
  160. package/esm/fileUpload/fileUpload.js +63 -2
  161. package/esm/fileUpload/fileUploadType.d.ts +35 -0
  162. package/esm/filters/components/filtersContainer.js +2 -2
  163. package/esm/filters/components/filtersDateRange.d.ts +1 -1
  164. package/esm/filters/components/filtersDropdown.js +2 -1
  165. package/esm/filters/components/filtersGroups.d.ts +1 -1
  166. package/esm/filters/components/filtersGroups.js +2 -4
  167. package/esm/filters/components/filtersSidePanelDateRange.js +1 -1
  168. package/esm/formSection/components/formSectionCard.js +1 -1
  169. package/esm/groupsFilterRaw/groupsFilterRaw.d.ts +2 -0
  170. package/esm/groupsFilterRaw/groupsFilterRaw.js +10 -2
  171. package/esm/groupsFilterRaw/types.d.ts +2 -0
  172. package/esm/header/headerButton.d.ts +15 -1
  173. package/esm/header/headerButton.js +11 -6
  174. package/esm/icons/iconDoorClosed.d.ts +3 -0
  175. package/esm/icons/iconDoorClosed.js +8 -0
  176. package/esm/icons/iconDoorOpen.d.ts +3 -0
  177. package/esm/icons/iconDoorOpen.js +8 -0
  178. package/esm/icons/iconHumidity.d.ts +3 -0
  179. package/esm/icons/iconHumidity.js +8 -0
  180. package/esm/index.d.ts +4 -1
  181. package/esm/index.js +3 -0
  182. package/esm/menu/components/menuButton.js +40 -58
  183. package/esm/miniTabs/miniTabs.d.ts +2 -1
  184. package/esm/miniTabs/miniTabs.js +2 -2
  185. package/esm/miniTabs/miniTabsItem.js +1 -1
  186. package/esm/modal/modal.d.ts +2 -0
  187. package/esm/pageHeader/pageHeaderButton.d.ts +15 -1
  188. package/esm/pageHeader/pageHeaderButton.js +8 -6
  189. package/esm/selectList/selectList.js +25 -1
  190. package/esm/selectList/selectListItem.d.ts +14 -1
  191. package/esm/selectList/selectListItem.js +280 -42
  192. package/esm/stepperRaw/stepperRaw.js +5 -2
  193. package/esm/table/columnMenu/columnMenuHeader.d.ts +28 -0
  194. package/esm/table/columnMenu/columnMenuHeader.js +123 -0
  195. package/esm/table/columnMenu/useColumnMenu.d.ts +24 -0
  196. package/esm/table/columnMenu/useColumnMenu.js +57 -0
  197. package/esm/table/flexible/getDefaultSettings.d.ts +1 -0
  198. package/esm/table/flexible/getDefaultSettings.js +2 -1
  199. package/esm/table/flexible/interfaces.d.ts +7 -0
  200. package/esm/table/flexible/mergeColumnSettings.js +2 -1
  201. package/esm/table/flexible/useFlexibleColumns.d.ts +16 -0
  202. package/esm/table/flexible/useFlexibleColumns.js +123 -49
  203. package/esm/table/flexible/useSettingsStorage.d.ts +2 -1
  204. package/esm/table/loading/useLoading.d.ts +1 -0
  205. package/esm/table/sortable/useSortableColumns.d.ts +1 -0
  206. package/esm/table/sortable/useSortableColumns.js +4 -1
  207. package/esm/table/table.d.ts +14 -1
  208. package/esm/table/table.js +16 -3
  209. package/esm/testHelpers/renderAsync.d.ts +2 -1
  210. package/esm/textInputRaw/textInputRaw.js +4 -2
  211. package/esm/textareaRaw/textareaRaw.js +4 -2
  212. package/esm/tooltip/tooltip.d.ts +5 -3
  213. package/esm/tooltip/tooltip.js +11 -9
  214. package/esm/utils/localization/translations/en.json +10 -1
  215. package/package.json +155 -158
package/README.md CHANGED
@@ -78,6 +78,8 @@ Zenith library provides components defined in Zenith Design System. It includes
78
78
 
79
79
  ### 3.16.0
80
80
 
81
+ - Add `stepper` support to `Filters.DateRange`; the stepper now renders as a single pill around the chip and shows the selected period
82
+ - Make the `Filters` side panel date range full width
81
83
  - Add `Tooltip.InlineTrigger` subcomponent for inline tooltip triggers
82
84
  - Add `TrendIndicator` component, the `getTrendIndicatorDirection` helper, and `Table.TrendIndicator`
83
85
  - Add popup button variant for `Nav` items
@@ -17,7 +17,8 @@ export interface IBanner extends Partial<IZenIdComponentProps> {
17
17
  header?: string;
18
18
  type?: BannerType;
19
19
  multiline?: boolean;
20
- icon?: boolean;
20
+ /** Use "loading" to replace the banner type icon with an inline loading indicator. */
21
+ icon?: boolean | "loading";
21
22
  action?: IBannerAction;
22
23
  onClose?: (e: any) => void;
23
24
  size?: TBannerSize;
@@ -8,7 +8,7 @@ export interface IBanner extends Partial<IZenIdComponentProps> {
8
8
  children: React.ReactNode;
9
9
  header?: string;
10
10
  type?: BannerType;
11
- icon?: boolean;
11
+ icon?: boolean | "loading";
12
12
  action?: IBannerAction;
13
13
  onClose?: (e: any) => void;
14
14
  size?: TBannerSize;
@@ -97,7 +97,8 @@ const BannerMultiline = ({
97
97
  children: [(0, jsx_runtime_1.jsxs)("div", {
98
98
  className: "zen-banner__header-container",
99
99
  children: [icon && header && (0, jsx_runtime_1.jsx)(typeIcon_1.default, {
100
- type: type
100
+ type: type,
101
+ loading: icon === "loading"
101
102
  }), header && (0, jsx_runtime_1.jsx)("div", {
102
103
  className: (0, classNames_1.classNames)(["zen-banner__header", bannerHeaderClassName || ""]),
103
104
  children: header
@@ -116,7 +117,8 @@ const BannerMultiline = ({
116
117
  className: "zen-banner__message-container",
117
118
  children: [icon && !header && (0, jsx_runtime_1.jsx)(typeIcon_1.default, {
118
119
  className: "zen-banner__icon-block--top-gap",
119
- type: type
120
+ type: type,
121
+ loading: icon === "loading"
120
122
  }), (0, jsx_runtime_1.jsx)("div", {
121
123
  ref: contentRef,
122
124
  title: text,
@@ -8,7 +8,7 @@ export interface IBanner extends Partial<IZenIdComponentProps> {
8
8
  children: React.ReactNode;
9
9
  header?: string;
10
10
  type?: BannerType;
11
- icon?: boolean;
11
+ icon?: boolean | "loading";
12
12
  action?: IBannerAction;
13
13
  onClose?: (e: any) => void;
14
14
  size?: TBannerSize;
@@ -93,7 +93,8 @@ const BannerSingleLine = ({
93
93
  children: [(0, jsx_runtime_1.jsxs)("div", {
94
94
  className: (0, classNames_1.classNames)(["zen-banner__content", `zen-banner__content--${size}`]),
95
95
  children: [icon && (0, jsx_runtime_1.jsx)(typeIcon_1.default, {
96
- type: type
96
+ type: type,
97
+ loading: icon === "loading"
97
98
  }), header && (0, jsx_runtime_1.jsx)("div", {
98
99
  className: (0, classNames_1.classNames)(["zen-banner__header", bannerHeaderClassName || ""]),
99
100
  children: header
@@ -3,6 +3,8 @@ import "./banner.less";
3
3
  interface ITypeIcon {
4
4
  type: BannerType | "upsell";
5
5
  className?: string;
6
+ loading?: boolean;
6
7
  }
7
- declare const TypeIcon: ({ type, className }: ITypeIcon) => import("react/jsx-runtime").JSX.Element;
8
+ declare const TypeIcon: ({ type, className, loading }: ITypeIcon) => import("react/jsx-runtime").JSX.Element;
8
9
  export default TypeIcon;
10
+ export declare const TRANSLATIONS: string[];
@@ -1,26 +1,99 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ const {
4
+ injectString
5
+ } = require("../utils/localization/translationsDictionary");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.TRANSLATIONS = void 0;
3
10
  const jsx_runtime_1 = require("react/jsx-runtime");
4
11
  const react_1 = require("react");
5
12
  const iconCheckRadio_1 = require("../icons/iconCheckRadio");
6
13
  const iconInfoCircle_1 = require("../icons/iconInfoCircle");
14
+ injectString("cs", "Loading", "Na\u010D\xEDt\xE1n\xED");
15
+ injectString("da-DK", "Loading", "Indl\xE6ser");
16
+ injectString("de", "Loading", "Wird geladen");
17
+ injectString("en", "Loading", "Loading");
18
+ injectString("es", "Loading", "Cargando");
19
+ injectString("fi-FI", "Loading", "Ladataan");
20
+ injectString("fr", "Loading", "Chargement en cours");
21
+ injectString("fr-FR", "Loading", "En cours de chargement");
22
+ injectString("hu-HU", "Loading", "Bet\xF6lt\xE9s");
23
+ injectString("id", "Loading", "Memuat");
24
+ injectString("it", "Loading", "Caricamento in corso");
25
+ injectString("ja", "Loading", "\u8AAD\u307F\u8FBC\u307F\u4E2D");
26
+ injectString("ko-KR", "Loading", "\uB85C\uB4DC \uC911");
27
+ injectString("ms", "Loading", "Memuatkan");
28
+ injectString("nb-NO", "Loading", "Laster");
29
+ injectString("nl", "Loading", "Laden");
30
+ injectString("pl", "Loading", "\u0141adowanie");
31
+ injectString("pt-BR", "Loading", "Carregando");
32
+ injectString("pt-PT", "Loading", "A carregar");
33
+ injectString("sk-SK", "Loading", "Na\u010D\xEDtanie");
34
+ injectString("sv", "Loading", "Laddar");
35
+ injectString("th", "Loading", "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14");
36
+ injectString("tr", "Loading", "Y\xFCkleniyor");
37
+ injectString("zh-Hans", "Loading", "\u6B63\u5728\u52A0\u8F7D");
38
+ injectString("zh-TW", "Loading", "\u8F09\u5165\u4E2D");
39
+ injectString("ro-RO", "Loading", "Se \xEEncarc\u0103");
40
+ injectString("ar-001", "Loading", "\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644");
41
+ injectString("lt-LT", "Loading", "\u012Ekeliama");
42
+ injectString("lv-LV", "Loading", "Iel\u0101d\u0113");
43
+ injectString("ka-GE", "Loading", "\u10E9\u10D0\u10E2\u10D5\u10D8\u10E0\u10D7\u10D5\u10D0");
44
+ injectString("el-GR", "Loading", "\u03A6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7");
45
+ injectString("et-EE", "Loading", "Laadimine");
46
+ injectString("bg-BG", "Loading", "\u0417\u0430\u0440\u0435\u0436\u0434\u0430\u043D\u0435");
7
47
  const iconWarning_1 = require("../icons/iconWarning");
8
48
  const iconException_1 = require("../icons/iconException");
9
49
  const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
10
50
  const classNames_1 = require("../commonHelpers/classNames/classNames");
11
51
  const iconGraphPresentation_1 = require("../icons/iconGraphPresentation");
12
- const TypeIcon = ({ type, className }) => {
13
- const iconsByType = (0, react_1.useMemo)(() => ({
14
- error: iconException_1.IconException,
15
- success: iconCheckRadio_1.IconCheckRadio,
16
- warning: iconWarning_1.IconWarning,
17
- info: iconInfoCircle_1.IconInfoCircle,
18
- upsell: iconGraphPresentation_1.IconGraphPresentation
19
- }), []);
20
- const bannerDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-banner__icon-block");
21
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-banner__icon-block", className || ""]), children: (0, react_1.createElement)(iconsByType[type], {
22
- size: bannerDriveClassName ? "huge" : "large",
23
- className: `zen-push__icon--${type}`
24
- }) }));
52
+ const useLanguage_1 = require("../utils/localization/useLanguage");
53
+ const TypeIcon = ({
54
+ type,
55
+ className,
56
+ loading = false
57
+ }) => {
58
+ const iconsByType = (0, react_1.useMemo)(() => ({
59
+ error: iconException_1.IconException,
60
+ success: iconCheckRadio_1.IconCheckRadio,
61
+ warning: iconWarning_1.IconWarning,
62
+ info: iconInfoCircle_1.IconInfoCircle,
63
+ upsell: iconGraphPresentation_1.IconGraphPresentation
64
+ }), []);
65
+ const bannerDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-banner__icon-block");
66
+ const {
67
+ translate
68
+ } = (0, useLanguage_1.useLanguage)();
69
+ return (0, jsx_runtime_1.jsx)("div", {
70
+ className: (0, classNames_1.classNames)(["zen-banner__icon-block", className || ""]),
71
+ children: loading ? (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
72
+ children: [(0, jsx_runtime_1.jsxs)("svg", {
73
+ "aria-hidden": "true",
74
+ className: (0, classNames_1.classNames)(["zen-icon", bannerDriveClassName ? "zen-icon--huge" : "zen-icon--large", "zen-banner__loading-icon"]),
75
+ viewBox: "0 0 24 24",
76
+ children: [(0, jsx_runtime_1.jsx)("circle", {
77
+ className: "zen-banner__loading-icon-track",
78
+ cx: "12",
79
+ cy: "12",
80
+ r: "9"
81
+ }), (0, jsx_runtime_1.jsx)("circle", {
82
+ className: "zen-banner__loading-icon-arc",
83
+ cx: "12",
84
+ cy: "12",
85
+ r: "9",
86
+ pathLength: "100"
87
+ })]
88
+ }), (0, jsx_runtime_1.jsx)("span", {
89
+ className: "zen-visually-hidden",
90
+ children: translate("Loading")
91
+ })]
92
+ }) : (0, react_1.createElement)(iconsByType[type], {
93
+ size: bannerDriveClassName ? "huge" : "large",
94
+ className: `zen-push__icon--${type}`
95
+ })
96
+ });
25
97
  };
26
98
  exports.default = TypeIcon;
99
+ exports.TRANSLATIONS = ["Loading"];
@@ -9,7 +9,6 @@ export interface IButton extends IZenComponentProps, IZenGridItem {
9
9
  title?: string;
10
10
  type?: TButton;
11
11
  disabled?: boolean;
12
- focusableWhenDisabled?: boolean;
13
12
  onClick?: React.MouseEventHandler;
14
13
  onBlur?: React.FocusEventHandler;
15
14
  onMouseOver?: (e: React.MouseEvent<HTMLElement>) => void;
@@ -28,6 +27,6 @@ export interface IButton extends IZenComponentProps, IZenGridItem {
28
27
  dataAnalyticsId?: string;
29
28
  }
30
29
  export declare const Button: {
31
- ({ className, type, disabled, focusableWhenDisabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel, dataAnalyticsId, ...other }: IButton): import("react/jsx-runtime").JSX.Element;
30
+ ({ className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel, dataAnalyticsId, ...other }: IButton): import("react/jsx-runtime").JSX.Element;
32
31
  displayName: string;
33
32
  };
@@ -18,36 +18,19 @@ const classNames_1 = require("../commonHelpers/classNames/classNames");
18
18
  const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
19
19
  const filterGridProps_1 = require("../gridLayout/utils/filterGridProps");
20
20
  const useMobileClassName_1 = require("../utils/theme/useMobileClassName");
21
- const blockActivation = (event) => {
22
- event.preventDefault();
23
- event.stopPropagation();
24
- };
25
- // Guards on `disabled` alone, not just `focusableWhenDisabled`, so clicks are blocked in JS regardless of
26
- // CSS. `onKeyDown`/`onKeyUp` stay unguarded — Tooltip needs them.
27
- const getDisabledGuardedHandlers = (disabled, isFocusableWhenDisabled, onClick, onMouseDown, onMouseUp) => ({
28
- onClick: disabled ? blockActivation : onClick,
29
- onMouseDown: isFocusableWhenDisabled ? blockActivation : onMouseDown,
30
- onMouseUp: isFocusableWhenDisabled ? blockActivation : onMouseUp
31
- });
32
- const getButtonClassName = (type, disabled, isFocusableWhenDisabled, mobileOrDriveClasses, className) => {
21
+ const Button = (_a) => {
22
+ var { className, type, disabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel, dataAnalyticsId } = _a, other = __rest(_a, ["className", "type", "disabled", "id", "title", "onClick", "onMouseOver", "onMouseOut", "onMouseDown", "onMouseUp", "onKeyDown", "onKeyUp", "children", "link", "target", "htmlType", "rel", "ref", "name", "onBlur", "role", "ariaLabel", "dataAnalyticsId"]);
33
23
  const modifierClassName = type && type !== buttonType_1.ButtonType.Secondary ? `zen-button--${type}` : "";
34
24
  const disabledClassName = disabled ? "zen-button--disabled" : "";
35
- const disabledFocusableClassName = isFocusableWhenDisabled ? "zen-button--disabled-focusable" : "";
36
- return (0, classNames_1.classNames)(["zen-button", mobileOrDriveClasses, modifierClassName, disabledClassName, disabledFocusableClassName, className !== null && className !== void 0 ? className : ""]);
37
- };
38
- const Button = (_a) => {
39
- var { className, type, disabled, focusableWhenDisabled, id, title, onClick, onMouseOver, onMouseOut, onMouseDown, onMouseUp, onKeyDown, onKeyUp, children, link, target, htmlType, rel, ref, name, onBlur, role, ariaLabel, dataAnalyticsId } = _a, other = __rest(_a, ["className", "type", "disabled", "focusableWhenDisabled", "id", "title", "onClick", "onMouseOver", "onMouseOut", "onMouseDown", "onMouseUp", "onKeyDown", "onKeyUp", "children", "link", "target", "htmlType", "rel", "ref", "name", "onBlur", "role", "ariaLabel", "dataAnalyticsId"]);
40
- const isFocusableWhenDisabled = Boolean(disabled) && Boolean(focusableWhenDisabled);
41
25
  const driveClasses = (0, useDriveClassName_1.useDriveClassName)("zen-button");
42
26
  const ariaLabelValue = ariaLabel || title;
43
27
  const mobileClasses = (0, useMobileClassName_1.useMobileClassName)("zen-button");
44
28
  const commonArgs = Object.assign(Object.assign(Object.assign({ id,
45
- title }, (ariaLabelValue ? { "aria-label": ariaLabelValue } : {})), (dataAnalyticsId ? { "data-analytics-id": dataAnalyticsId } : {})), { className: getButtonClassName(type, disabled, isFocusableWhenDisabled, mobileClasses || driveClasses || "", className) });
46
- const { onClick: onClickWithDisabledGuard, onMouseDown: onMouseDownWithDisabledGuard, onMouseUp: onMouseUpWithDisabledGuard } = getDisabledGuardedHandlers(disabled, isFocusableWhenDisabled, onClick, onMouseDown, onMouseUp);
29
+ title }, (ariaLabelValue ? { "aria-label": ariaLabelValue } : {})), (dataAnalyticsId ? { "data-analytics-id": dataAnalyticsId } : {})), { className: (0, classNames_1.classNames)(["zen-button", mobileClasses || driveClasses || "", modifierClassName, disabledClassName, className !== null && className !== void 0 ? className : ""]) });
47
30
  if (link) {
48
- return ((0, jsx_runtime_1.jsx)("a", Object.assign({ role: "link", rel: rel, target: target, href: disabled ? undefined : link, tabIndex: isFocusableWhenDisabled ? 0 : undefined, "aria-disabled": disabled ? true : undefined, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onClick: onClickWithDisabledGuard }, commonArgs, (0, filterGridProps_1.filterGridProps)(other), { children: children })));
31
+ return ((0, jsx_runtime_1.jsx)("a", Object.assign({ role: "link", rel: rel, target: target, href: disabled ? undefined : link, "aria-disabled": disabled, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onClick: onClick }, commonArgs, (0, filterGridProps_1.filterGridProps)(other), { children: children })));
49
32
  }
50
- return ((0, jsx_runtime_1.jsx)("button", Object.assign({ name: name, onBlur: onBlur, onClick: onClickWithDisabledGuard, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onMouseDown: onMouseDownWithDisabledGuard, onMouseUp: onMouseUpWithDisabledGuard, onKeyDown: onKeyDown, onKeyUp: onKeyUp, ref: ref, type: htmlType, disabled: isFocusableWhenDisabled ? undefined : disabled, "aria-disabled": isFocusableWhenDisabled ? true : undefined, role: role }, commonArgs, (0, filterGridProps_1.filterGridProps)(other), { children: children })));
33
+ return ((0, jsx_runtime_1.jsx)("button", Object.assign({ name: name, onBlur: onBlur, onClick: onClick, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onKeyDown: onKeyDown, onKeyUp: onKeyUp, ref: ref, type: htmlType, disabled: disabled, role: role }, commonArgs, (0, filterGridProps_1.filterGridProps)(other), { children: children })));
51
34
  };
52
35
  exports.Button = Button;
53
36
  exports.Button.displayName = "Button";
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ export declare const BUTTON_DISABLED_CLASS = "zen-button--disabled";
3
+ export declare const BUTTON_DISABLED_FOCUSABLE_CLASS = "zen-button--disabled-focusable";
4
+ export interface IButtonDisabledOptions {
5
+ disabled?: boolean;
6
+ /**
7
+ * Keeps a disabled button in the tab order and hoverable, using `aria-disabled` instead of the native
8
+ * `disabled` attribute. Has no effect while the button is enabled.
9
+ */
10
+ focusable?: boolean;
11
+ /** The `link` prop of the button, a link without `href` is not tabbable, so it needs an explicit `tabIndex`. */
12
+ link?: string;
13
+ }
14
+ export interface IButtonDisabledProps {
15
+ disabled?: boolean;
16
+ "aria-disabled"?: boolean;
17
+ tabIndex?: number;
18
+ className?: string;
19
+ onClick?: (event: React.SyntheticEvent) => void;
20
+ onMouseDown?: (event: React.SyntheticEvent) => void;
21
+ onMouseUp?: (event: React.SyntheticEvent) => void;
22
+ }
23
+ /**
24
+ * Props that make `Button` (or `TextIconButton`) disabled. `Button` itself only applies them.
25
+ *
26
+ * - enabled: `{ disabled }`
27
+ * - disabled: native `disabled`, the button leaves the tab order
28
+ * - disabled and `focusable`: `aria-disabled`, activation is blocked, the button stays focusable and hoverable
29
+ *
30
+ * `onKeyDown`/`onKeyUp` are left untouched: Tooltip needs them. Enter/Space on a focused button without the native
31
+ * `disabled` attribute fire a click, which is blocked here.
32
+ *
33
+ * The caller merges the returned `className` with its own and wraps the button in whatever explains the state.
34
+ */
35
+ export declare const getButtonDisabledProps: ({ disabled, focusable, link }: IButtonDisabledOptions) => IButtonDisabledProps;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getButtonDisabledProps = exports.BUTTON_DISABLED_FOCUSABLE_CLASS = exports.BUTTON_DISABLED_CLASS = void 0;
4
+ const classNames_1 = require("../commonHelpers/classNames/classNames");
5
+ // `button.less` styles these classes: `--disabled-focusable` keeps pointer events so hover/tooltip still work.
6
+ exports.BUTTON_DISABLED_CLASS = "zen-button--disabled";
7
+ exports.BUTTON_DISABLED_FOCUSABLE_CLASS = "zen-button--disabled-focusable";
8
+ const blockActivation = (event) => {
9
+ event.preventDefault();
10
+ event.stopPropagation();
11
+ };
12
+ /**
13
+ * Props that make `Button` (or `TextIconButton`) disabled. `Button` itself only applies them.
14
+ *
15
+ * - enabled: `{ disabled }`
16
+ * - disabled: native `disabled`, the button leaves the tab order
17
+ * - disabled and `focusable`: `aria-disabled`, activation is blocked, the button stays focusable and hoverable
18
+ *
19
+ * `onKeyDown`/`onKeyUp` are left untouched: Tooltip needs them. Enter/Space on a focused button without the native
20
+ * `disabled` attribute fire a click, which is blocked here.
21
+ *
22
+ * The caller merges the returned `className` with its own and wraps the button in whatever explains the state.
23
+ */
24
+ const getButtonDisabledProps = ({ disabled, focusable, link }) => {
25
+ if (!disabled || !focusable) {
26
+ return { disabled };
27
+ }
28
+ const hasLink = Boolean(link);
29
+ return Object.assign(Object.assign({}, (hasLink ? { disabled: true, tabIndex: 0 } : { "aria-disabled": true })), {
30
+ // Button adds `zen-button--disabled` to a disabled link itself.
31
+ className: (0, classNames_1.classNames)([hasLink ? "" : exports.BUTTON_DISABLED_CLASS, exports.BUTTON_DISABLED_FOCUSABLE_CLASS]), onClick: blockActivation, onMouseDown: blockActivation, onMouseUp: blockActivation });
32
+ };
33
+ exports.getButtonDisabledProps = getButtonDisabledProps;
@@ -4,6 +4,7 @@ exports.pieLegendPlugin = void 0;
4
4
  const zen_1 = require("../../utils/zen");
5
5
  const getPieLegendItems_1 = require("./getPieLegendItems");
6
6
  const renderPieLegend_1 = require("./renderPieLegend");
7
+ const legendFocus_1 = require("../plugins/legend/legendFocus");
7
8
  const pieLegendPlugin = (containerId, options, isDrive, rawData, isHidden, toggleHidden) => ({
8
9
  id: "zenithPieLegend",
9
10
  isDrive,
@@ -37,9 +38,11 @@ const pieLegendPlugin = (containerId, options, isDrive, rawData, isHidden, toggl
37
38
  barWidth: hidden ? 0 : total > 0 ? (rawValues[item.index] / total) * 100 : 0
38
39
  }));
39
40
  });
41
+ const focusedIndex = (0, legendFocus_1.getFocusedLegendIndex)(container);
40
42
  container.innerHTML = "";
41
43
  container.classList.remove("zen-legend--hidden");
42
44
  (0, renderPieLegend_1.renderPieLegend)(container, isDrive, items, options);
45
+ (0, legendFocus_1.restoreLegendFocus)(container, focusedIndex);
43
46
  }
44
47
  });
45
48
  exports.pieLegendPlugin = pieLegendPlugin;
@@ -19,8 +19,7 @@ const renderPieLegend = (element, isDrive, items, options) => {
19
19
  <div class="zen-pie-legend__item-bar" data-bar-width="${(_a = item.barWidth) !== null && _a !== void 0 ? _a : 0}"></div>
20
20
  </div>`
21
21
  : "";
22
- return `<li class="zen-pie-legend__item" data-index="${item.index}">
23
- <span class="zen-pie-legend__item-color"></span>
22
+ const content = `<span class="zen-pie-legend__item-color"></span>
24
23
  <div class="zen-pie-legend__item-content">
25
24
  <div class="zen-pie-legend__item-row">
26
25
  <p class="${labelClass}">${(0, escapeHtml_1.htmlEscape)(item.text)}</p>
@@ -28,8 +27,11 @@ const renderPieLegend = (element, isDrive, items, options) => {
28
27
  ${percentageHtml}
29
28
  </div>
30
29
  ${barHtml}
31
- </div>
32
- </li>`;
30
+ </div>`;
31
+ const control = item.onClick
32
+ ? `<button type="button" class="zen-pie-legend__button" aria-pressed="${!item.hidden}">${content}</button>`
33
+ : `<span class="zen-pie-legend__button">${content}</span>`;
34
+ return `<li class="zen-pie-legend__item" data-index="${item.index}">${control}</li>`;
33
35
  })
34
36
  .join("");
35
37
  element.innerHTML = `<ul class="${classes}">${listItems}</ul>`;
@@ -0,0 +1,2 @@
1
+ export declare const getFocusedLegendIndex: (container: HTMLElement) => string | undefined;
2
+ export declare const restoreLegendFocus: (container: HTMLElement, index: string | undefined) => void;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.restoreLegendFocus = exports.getFocusedLegendIndex = void 0;
4
+ const getFocusedLegendIndex = (container) => {
5
+ var _a, _b;
6
+ const active = container.ownerDocument.activeElement;
7
+ if (!active || !container.contains(active)) {
8
+ return undefined;
9
+ }
10
+ return (_b = (_a = active.closest("[data-index]")) === null || _a === void 0 ? void 0 : _a.getAttribute("data-index")) !== null && _b !== void 0 ? _b : undefined;
11
+ };
12
+ exports.getFocusedLegendIndex = getFocusedLegendIndex;
13
+ const restoreLegendFocus = (container, index) => {
14
+ var _a;
15
+ if (index === undefined) {
16
+ return;
17
+ }
18
+ (_a = container.querySelector(`[data-index="${index}"] button`)) === null || _a === void 0 ? void 0 : _a.focus();
19
+ };
20
+ exports.restoreLegendFocus = restoreLegendFocus;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.legendPlugin = exports.LEGEND_PLUGIN_ID = void 0;
4
4
  const renderLegend_1 = require("./renderLegend");
5
+ const legendFocus_1 = require("./legendFocus");
5
6
  const getLineLegendItems_1 = require("../../lineChart/getLineLegendItems");
6
7
  const getBarLegendItems_1 = require("../../barChart/getBarLegendItems");
7
8
  const getPieLegendItems_1 = require("../../pieChart/getPieLegendItems");
@@ -20,6 +21,7 @@ const legendPlugin = (containerId, options, isDrive, isHidden, toggleHidden) =>
20
21
  container.classList.add("zen-legend--hidden");
21
22
  return;
22
23
  }
24
+ const focusedIndex = (0, legendFocus_1.getFocusedLegendIndex)(container);
23
25
  container.innerHTML = "";
24
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
27
  const chartType = chart.config.type;
@@ -46,6 +48,7 @@ const legendPlugin = (containerId, options, isDrive, isHidden, toggleHidden) =>
46
48
  }
47
49
  container.classList.remove("zen-legend--hidden");
48
50
  (0, renderLegend_1.renderLegend)(container, this.isDrive, items);
51
+ (0, legendFocus_1.restoreLegendFocus)(container, focusedIndex);
49
52
  }
50
53
  });
51
54
  exports.legendPlugin = legendPlugin;
@@ -6,13 +6,17 @@ const escapeHtml_1 = require("../../../utils/escapeHtml");
6
6
  const renderLegend = (element, isDrive, items) => {
7
7
  const classes = (0, classNames_1.classNames)(["zen-legend", isDrive ? "zen-legend--drive" : ""]);
8
8
  const listItems = items
9
- .map((item, index) => `<li class="zen-legend__item" data-index="${index}">
10
- <span class="zen-legend__item-color" style="background-color: ${item.color};"></span>
9
+ .map((item, index) => {
10
+ const content = `<span class="zen-legend__item-color" style="background-color: ${item.color};"></span>
11
11
  <p class="${(0, classNames_1.classNames)(["zen-legend__item-label", item.hidden ? "zen-legend__item-label--hidden" : ""])}">${(0, escapeHtml_1.htmlEscape)(item.text)}</p>
12
12
  ${item.value !== undefined
13
- ? `<p class="${(0, classNames_1.classNames)(["zen-legend__item-value", item.hidden ? "zen-legend__item-value--hidden" : ""])}">${(0, escapeHtml_1.htmlEscape)(item.value)}</p>`
14
- : ""}
15
- </li>`)
13
+ ? `<p class="${(0, classNames_1.classNames)(["zen-legend__item-value", item.hidden ? "zen-legend__item-value--hidden" : ""])}">${(0, escapeHtml_1.htmlEscape)(item.value)}</p>`
14
+ : ""}`;
15
+ const control = item.onClick
16
+ ? `<button type="button" class="zen-legend__button" aria-pressed="${!item.hidden}">${content}</button>`
17
+ : `<span class="zen-legend__button">${content}</span>`;
18
+ return `<li class="zen-legend__item" data-index="${index}">${control}</li>`;
19
+ })
16
20
  .join("");
17
21
  element.innerHTML = `<ul class='${classes}'>${listItems}</ul>`;
18
22
  const itemElements = element.querySelectorAll(".zen-legend__item");
@@ -1,6 +1,9 @@
1
+ import { FC } from "react";
2
+ import React from "react";
1
3
  import "./checkboxListWithAction.less";
2
4
  import { IZenComponentProps } from "../commonHelpers/zenComponent";
3
5
  import { IColor } from "../groupsFilterRaw/groupsFilterInterfaces";
6
+ import { IIcon } from "../icons/icon";
4
7
  export interface ICheckboxListWithActionOption {
5
8
  label: string;
6
9
  title?: string;
@@ -11,6 +14,16 @@ export interface ICheckboxListWithActionOption {
11
14
  isWithAction: boolean;
12
15
  countSelectedChild?: number;
13
16
  color?: IColor;
17
+ /** Leading 16×16 icon rendered before the label text. */
18
+ icon?: FC<IIcon>;
19
+ /** Secondary text rendered on a second line below the primary label. */
20
+ metaData?: string;
21
+ /** Right-aligned trailing action button; clicking it does NOT toggle the checkbox. */
22
+ trailingAction?: {
23
+ icon: FC<IIcon>;
24
+ onClick: (id: string) => void;
25
+ ariaLabel?: string;
26
+ };
14
27
  /** When true, renders a 1px separator line below this item. */
15
28
  divider?: boolean;
16
29
  }