@geotab/zenith 3.8.0-beta.1 → 3.9.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +11 -12
  2. package/dist/button/button.d.ts +2 -1
  3. package/dist/button/button.js +3 -3
  4. package/dist/calendar/calendar.js +201 -4
  5. package/dist/card/card.d.ts +1 -1
  6. package/dist/card/card.js +1 -1
  7. package/dist/card/components/cardButton/cardButton.d.ts +2 -1
  8. package/dist/card/components/cardButton/cardButton.js +5 -3
  9. package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
  10. package/dist/chart/barChart/getBarLegendItems.js +3 -5
  11. package/dist/chart/lineChart/getLineLegendItems.js +7 -7
  12. package/dist/chart/pieChart/centerTextPlugin.js +13 -5
  13. package/dist/chart/pieChart/getPieLegendItems.js +8 -12
  14. package/dist/chart/pieChart.js +13 -11
  15. package/dist/chart/plugins/legend/interfaces.d.ts +1 -1
  16. package/dist/commonHelpers/generateId.d.ts +8 -0
  17. package/dist/commonHelpers/generateId.js +8 -0
  18. package/dist/commonHelpers/hooks/ssrProvider.d.ts +14 -0
  19. package/dist/commonHelpers/hooks/ssrProvider.js +12 -0
  20. package/dist/commonHelpers/hooks/useClientReady.js +3 -1
  21. package/dist/commonHelpers/hooks/useDeviceType.js +6 -2
  22. package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  23. package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.js +6 -0
  24. package/dist/commonHelpers/hooks/useMobile.js +4 -3
  25. package/dist/commonHelpers/hooks/usePortal.js +2 -5
  26. package/dist/commonHelpers/isDomEnv.js +1 -2
  27. package/dist/commonHelpers/useUniqueId.d.ts +6 -0
  28. package/dist/commonHelpers/useUniqueId.js +8 -2
  29. package/dist/commonHelpers/utils.d.ts +0 -1
  30. package/dist/commonHelpers/utils.js +1 -3
  31. package/dist/commonStyles/common.less +13 -1
  32. package/dist/commonStyles/fonts/notosarabic/LICENSE.txt +93 -0
  33. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff +0 -0
  34. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff2 +0 -0
  35. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff +0 -0
  36. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff2 +0 -0
  37. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff +0 -0
  38. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff2 +0 -0
  39. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff +0 -0
  40. package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff2 +0 -0
  41. package/dist/commonStyles/fonts/notosarabic.less +43 -0
  42. package/dist/commonStyles/pillStyles/pillContent.less +2 -3
  43. package/dist/commonStyles/pillStyles/pillStyles.less +1 -2
  44. package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
  45. package/dist/commonStyles/typography/typography.less +440 -305
  46. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
  47. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
  48. package/dist/dateInputInner/dateInputInnerControlBlock.js +12 -8
  49. package/dist/dateRangeRaw/dateRangeRaw.js +5 -1
  50. package/dist/dialog/dialog.js +4 -3
  51. package/dist/feedbackContainer/feedbackContainer.js +4 -4
  52. package/dist/fileUpload/fileUpload.js +21 -12
  53. package/dist/filters/components/filtersSidePanel.d.ts +1 -1
  54. package/dist/filters/components/filtersSidePanel.js +123 -116
  55. package/dist/filters/filters.js +1 -2
  56. package/dist/filtersBar/filtersBar.d.ts +2 -0
  57. package/dist/filtersBar/filtersBar.js +5 -3
  58. package/dist/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
  59. package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +3 -0
  60. package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
  61. package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
  62. package/dist/formFieldError/formFieldError.d.ts +2 -1
  63. package/dist/formFieldError/formFieldError.js +2 -2
  64. package/dist/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
  65. package/dist/index.css +3210 -2238
  66. package/dist/index.d.ts +3 -5
  67. package/dist/index.js +24 -29
  68. package/dist/menu/components/menuItem.js +4 -4
  69. package/dist/menu/controlledMenu.js +4 -4
  70. package/dist/nav/nav.js +10 -5
  71. package/dist/nav/navAddMenu/navAddMenu.js +1 -2
  72. package/dist/nav/navEditList/navEditListUtils.d.ts +1 -1
  73. package/dist/nav/navEditList/navEditListUtils.js +2 -1
  74. package/dist/nav/navItem/navActionItem.js +3 -3
  75. package/dist/nav/navItem/navItem.js +1 -2
  76. package/dist/pageHeader/pageHeaderActions.js +4 -3
  77. package/dist/rangeRaw/rangeRaw.js +7 -1
  78. package/dist/selectList/selectList.js +11 -7
  79. package/dist/selectRaw/selectRaw.js +1 -1
  80. package/dist/shield/shield.js +5 -3
  81. package/dist/sidePanel/sidePanel.js +9 -8
  82. package/dist/summaryTile/summaryTile.d.ts +1 -3
  83. package/dist/summaryTile/summaryTile.js +1 -2
  84. package/dist/table/children/useTableChildren.d.ts +1 -1
  85. package/dist/table/children/useTableChildren.js +3 -3
  86. package/dist/table/flexible/useFlexibleColumns.js +39 -1
  87. package/dist/table/nested/useNestedRows.d.ts +1 -0
  88. package/dist/table/nested/useNestedRows.js +3 -3
  89. package/dist/table/selectable/useSelectableRows.d.ts +9 -0
  90. package/dist/table/selectable/useSelectableRows.js +18 -11
  91. package/dist/table/table.js +1 -7
  92. package/dist/{card/components → title}/title.d.ts +1 -1
  93. package/dist/title/title.js +27 -0
  94. package/dist/toggleButtonRaw/toggleButtonRaw.js +3 -1
  95. package/dist/toggleButtonRaw/types.d.ts +1 -0
  96. package/dist/tooltip/tooltip.d.ts +2 -1
  97. package/dist/tooltip/tooltip.js +68 -64
  98. package/dist/utils/localization/directionContext.d.ts +3 -0
  99. package/dist/utils/localization/directionContext.js +5 -0
  100. package/dist/utils/localization/getTextDirection.d.ts +2 -0
  101. package/dist/utils/localization/getTextDirection.js +6 -0
  102. package/dist/utils/localization/languageProvider.js +15 -1
  103. package/dist/utils/localization/translations/en-json.d.ts +2 -0
  104. package/dist/utils/localization/translations/en-json.js +3 -1
  105. package/dist/utils/localization/translations/en.json +3 -0
  106. package/dist/utils/localization/useDirection.d.ts +2 -0
  107. package/dist/utils/localization/useDirection.js +7 -0
  108. package/esm/button/button.d.ts +2 -1
  109. package/esm/button/button.js +3 -3
  110. package/esm/calendar/calendar.js +201 -4
  111. package/esm/card/card.d.ts +1 -1
  112. package/esm/card/card.js +1 -1
  113. package/esm/card/components/cardButton/cardButton.d.ts +2 -1
  114. package/esm/card/components/cardButton/cardButton.js +5 -3
  115. package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
  116. package/esm/chart/barChart/getBarLegendItems.js +3 -5
  117. package/esm/chart/lineChart/getLineLegendItems.js +7 -7
  118. package/esm/chart/pieChart/centerTextPlugin.js +13 -5
  119. package/esm/chart/pieChart/getPieLegendItems.js +8 -12
  120. package/esm/chart/pieChart.js +14 -12
  121. package/esm/chart/plugins/legend/interfaces.d.ts +1 -1
  122. package/esm/commonHelpers/generateId.d.ts +8 -0
  123. package/esm/commonHelpers/generateId.js +8 -0
  124. package/esm/commonHelpers/hooks/ssrProvider.d.ts +14 -0
  125. package/esm/commonHelpers/hooks/ssrProvider.js +6 -0
  126. package/esm/commonHelpers/hooks/useClientReady.js +4 -2
  127. package/esm/commonHelpers/hooks/useDeviceType.js +7 -3
  128. package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  129. package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.js +3 -0
  130. package/esm/commonHelpers/hooks/useMobile.js +4 -3
  131. package/esm/commonHelpers/hooks/usePortal.js +2 -5
  132. package/esm/commonHelpers/isDomEnv.js +1 -2
  133. package/esm/commonHelpers/useUniqueId.d.ts +6 -0
  134. package/esm/commonHelpers/useUniqueId.js +7 -1
  135. package/esm/commonHelpers/utils.d.ts +0 -1
  136. package/esm/commonHelpers/utils.js +0 -1
  137. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
  138. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
  139. package/esm/dateInputInner/dateInputInnerControlBlock.js +13 -9
  140. package/esm/dateRangeRaw/dateRangeRaw.js +5 -1
  141. package/esm/dialog/dialog.js +4 -3
  142. package/esm/feedbackContainer/feedbackContainer.js +4 -4
  143. package/esm/fileUpload/fileUpload.js +21 -12
  144. package/esm/filters/components/filtersSidePanel.d.ts +1 -1
  145. package/esm/filters/components/filtersSidePanel.js +123 -116
  146. package/esm/filters/filters.js +2 -3
  147. package/esm/filtersBar/filtersBar.d.ts +2 -0
  148. package/esm/filtersBar/filtersBar.js +5 -3
  149. package/esm/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
  150. package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +3 -0
  151. package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
  152. package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
  153. package/esm/formFieldError/formFieldError.d.ts +2 -1
  154. package/esm/formFieldError/formFieldError.js +2 -2
  155. package/esm/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
  156. package/esm/index.d.ts +3 -5
  157. package/esm/index.js +3 -5
  158. package/esm/menu/components/menuItem.js +1 -1
  159. package/esm/menu/controlledMenu.js +1 -1
  160. package/esm/nav/nav.js +10 -5
  161. package/esm/nav/navAddMenu/navAddMenu.js +2 -3
  162. package/esm/nav/navEditList/navEditListUtils.d.ts +1 -1
  163. package/esm/nav/navEditList/navEditListUtils.js +2 -1
  164. package/esm/nav/navItem/navActionItem.js +3 -2
  165. package/esm/nav/navItem/navItem.js +2 -3
  166. package/esm/pageHeader/pageHeaderActions.js +4 -3
  167. package/esm/rangeRaw/rangeRaw.js +7 -1
  168. package/esm/selectList/selectList.js +11 -7
  169. package/esm/selectRaw/selectRaw.js +1 -1
  170. package/esm/shield/shield.js +5 -3
  171. package/esm/sidePanel/sidePanel.js +9 -8
  172. package/esm/summaryTile/summaryTile.d.ts +1 -3
  173. package/esm/summaryTile/summaryTile.js +1 -2
  174. package/esm/table/children/useTableChildren.d.ts +1 -1
  175. package/esm/table/children/useTableChildren.js +3 -3
  176. package/esm/table/flexible/useFlexibleColumns.js +39 -1
  177. package/esm/table/nested/useNestedRows.d.ts +1 -0
  178. package/esm/table/nested/useNestedRows.js +1 -1
  179. package/esm/table/selectable/useSelectableRows.d.ts +9 -0
  180. package/esm/table/selectable/useSelectableRows.js +15 -8
  181. package/esm/table/table.js +1 -7
  182. package/esm/{card/components → title}/title.d.ts +1 -1
  183. package/esm/title/title.js +23 -0
  184. package/esm/toggleButtonRaw/toggleButtonRaw.js +3 -1
  185. package/esm/toggleButtonRaw/types.d.ts +1 -0
  186. package/esm/tooltip/tooltip.d.ts +2 -1
  187. package/esm/tooltip/tooltip.js +68 -64
  188. package/esm/utils/localization/directionContext.d.ts +3 -0
  189. package/esm/utils/localization/directionContext.js +2 -0
  190. package/esm/utils/localization/getTextDirection.d.ts +2 -0
  191. package/esm/utils/localization/getTextDirection.js +2 -0
  192. package/esm/utils/localization/languageProvider.js +15 -1
  193. package/esm/utils/localization/translations/en-json.d.ts +2 -0
  194. package/esm/utils/localization/translations/en-json.js +3 -1
  195. package/esm/utils/localization/translations/en.json +3 -0
  196. package/esm/utils/localization/useDirection.d.ts +2 -0
  197. package/esm/utils/localization/useDirection.js +3 -0
  198. package/package.json +33 -31
  199. package/dist/card/components/title.js +0 -22
  200. package/dist/commonHelpers/hooks/deviceProvider.d.ts +0 -7
  201. package/dist/commonHelpers/hooks/deviceProvider.js +0 -11
  202. package/esm/card/components/title.js +0 -18
  203. package/esm/commonHelpers/hooks/deviceProvider.d.ts +0 -7
  204. package/esm/commonHelpers/hooks/deviceProvider.js +0 -4
@@ -1,7 +1,9 @@
1
- import { useEffect, useState } from "react";
1
+ import { useContext, useEffect, useState } from "react";
2
2
  import { isDomEnv } from "../isDomEnv";
3
+ import { SSRContext } from "./ssrProvider";
3
4
  export const useClientReady = () => {
4
- const [isClientReady, setIsClientReady] = useState(true);
5
+ const ctx = useContext(SSRContext);
6
+ const [isClientReady, setIsClientReady] = useState(ctx !== null ? ctx.isClientReady : true);
5
7
  useEffect(() => {
6
8
  if (isDomEnv()) {
7
9
  setIsClientReady(true);
@@ -1,9 +1,11 @@
1
- import { useContext, useLayoutEffect, useMemo, useState } from "react";
1
+ import { useContext, useMemo, useState } from "react";
2
+ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
2
3
  import { useResize } from "./useResize";
3
4
  import { DeviceType } from "./deviceType";
4
5
  import { topWindowContext } from "../../utils/topWindow/topWindowContext";
5
6
  import { getParentWindow } from "../../utils/getParentWindow";
6
7
  import { zen } from "../../utils/zen";
8
+ import { SSRContext } from "./ssrProvider";
7
9
  const MobileMaxWidth = 640;
8
10
  export const getDeviceType = (width) => {
9
11
  if (width > MobileMaxWidth) {
@@ -12,13 +14,15 @@ export const getDeviceType = (width) => {
12
14
  return DeviceType.Mobile;
13
15
  };
14
16
  export const useDeviceType = (callback) => {
17
+ const ctx = useContext(SSRContext);
18
+ const ssrDeviceType = ctx === null || ctx === void 0 ? void 0 : ctx.deviceType;
15
19
  const { topWindow } = useContext(topWindowContext);
16
20
  const win = useMemo(() => topWindow || getParentWindow(zen), [topWindow]);
17
- const [deviceType, setDeviceType] = useState(getDeviceType(win.innerWidth));
21
+ const [deviceType, setDeviceType] = useState(ssrDeviceType !== null && ssrDeviceType !== void 0 ? ssrDeviceType : getDeviceType(win.innerWidth));
18
22
  useResize(() => {
19
23
  setDeviceType(getDeviceType(win.innerWidth));
20
24
  }, true);
21
- useLayoutEffect(() => {
25
+ useIsomorphicLayoutEffect(() => {
22
26
  callback(deviceType);
23
27
  }, [deviceType, callback]);
24
28
  };
@@ -0,0 +1,2 @@
1
+ import { useEffect } from "react";
2
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
@@ -0,0 +1,3 @@
1
+ import { useEffect, useLayoutEffect } from "react";
2
+ import { isDomEnv } from "../isDomEnv";
3
+ export const useIsomorphicLayoutEffect = isDomEnv() ? useLayoutEffect : useEffect;
@@ -2,13 +2,14 @@ import { useContext, useMemo, useState } from "react";
2
2
  import { DeviceType } from "./deviceType";
3
3
  import { getDeviceType, useDeviceType } from "./useDeviceType";
4
4
  import { getParentWindow } from "../../utils/getParentWindow";
5
- import { DeviceContext } from "./deviceProvider";
5
+ import { SSRContext } from "./ssrProvider";
6
6
  import { zen } from "../../utils/zen";
7
7
  const initialParent = getParentWindow(zen);
8
8
  export const initialValue = getDeviceType(initialParent.innerWidth);
9
9
  export const useMobile = () => {
10
- const deviceTypeFromProvider = useContext(DeviceContext);
11
- const [deviceType, setDeviceType] = useState(deviceTypeFromProvider || initialValue);
10
+ var _a;
11
+ const ctx = useContext(SSRContext);
12
+ const [deviceType, setDeviceType] = useState((_a = ctx === null || ctx === void 0 ? void 0 : ctx.deviceType) !== null && _a !== void 0 ? _a : initialValue);
12
13
  useDeviceType(setDeviceType);
13
14
  const isMobile = useMemo(() => deviceType === DeviceType.Mobile, [deviceType]);
14
15
  return isMobile;
@@ -1,12 +1,9 @@
1
1
  import { useEffect, useState } from "react";
2
2
  import { createPortal } from "react-dom";
3
3
  export const usePortal = (children, container, key) => {
4
- const [portalContainer, setPortalContainer] = useState(container);
4
+ const [portalContainer, setPortalContainer] = useState(undefined);
5
5
  useEffect(() => {
6
- if (portalContainer || !container) {
7
- return;
8
- }
9
6
  setPortalContainer(container);
10
- }, [portalContainer, container]);
7
+ }, [container]);
11
8
  return portalContainer ? createPortal(children, portalContainer, key) : null;
12
9
  };
@@ -1,2 +1 @@
1
- /* eslint-disable */
2
- export const isDomEnv = () => { var _a; return !!(typeof window !== "undefined" && typeof (window === null || window === void 0 ? void 0 : window.document) !== "undefined" && typeof ((_a = window === null || window === void 0 ? void 0 : window.document) === null || _a === void 0 ? void 0 : _a.createElement) !== "undefined"); };
1
+ export const isDomEnv = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
@@ -6,6 +6,12 @@
6
6
  * component. This can be particularly useful for assigning unique keys to elements
7
7
  * in a list, or for generating unique identifiers for form inputs, labels, etc.
8
8
  *
9
+ * @remarks
10
+ * **Prefer `React.useId()`** when possible. `useId` generates IDs that are stable
11
+ * across server and client renders, preventing SSR hydration mismatches.
12
+ * Use `useUniqueId` only when `useId` is not suitable — for example, when the ID
13
+ * must be truly random and is never rendered during SSR.
14
+ *
9
15
  * @returns {string} A unique identifier.
10
16
  *
11
17
  * Example usage:
@@ -1,5 +1,5 @@
1
1
  import { useState } from "react";
2
- import { generateId } from "./utils";
2
+ import { generateId } from "./generateId";
3
3
  /**
4
4
  * `useUniqueId` is a custom React hook that generates and returns a unique identifier.
5
5
  *
@@ -8,6 +8,12 @@ import { generateId } from "./utils";
8
8
  * component. This can be particularly useful for assigning unique keys to elements
9
9
  * in a list, or for generating unique identifiers for form inputs, labels, etc.
10
10
  *
11
+ * @remarks
12
+ * **Prefer `React.useId()`** when possible. `useId` generates IDs that are stable
13
+ * across server and client renders, preventing SSR hydration mismatches.
14
+ * Use `useUniqueId` only when `useId` is not suitable — for example, when the ID
15
+ * must be truly random and is never rendered during SSR.
16
+ *
11
17
  * @returns {string} A unique identifier.
12
18
  *
13
19
  * Example usage:
@@ -1,4 +1,3 @@
1
- export declare const generateId: () => string;
2
1
  export declare const echo: <T = unknown>(_: T) => T;
3
2
  export declare function flattenArrays<T>(arrayOfArrays: T[][]): T[];
4
3
  type TPlainObject = Record<string, unknown>;
@@ -1,5 +1,4 @@
1
1
  import { zen } from "../utils/zen";
2
- export const generateId = () => "id" + Math.random().toString().substring(2);
3
2
  export const echo = (_) => _;
4
3
  export function flattenArrays(arrayOfArrays) {
5
4
  return arrayOfArrays.reduce((akk, arr) => akk.concat(arr), []);
@@ -7,19 +7,21 @@ import { DeviceType } from "../../../../commonHelpers/hooks/deviceType";
7
7
  type TBulkAction = IBulkActionLink | IBulkActionButton;
8
8
  export interface IBulkActionsProps extends IZenComponentProps {
9
9
  selected: number;
10
+ /**
11
+ * When `true`, displays "All selected" instead of a count, and enables action buttons
12
+ * even when `selected` is 0 (i.e., cross-page "select all" is active).
13
+ */
10
14
  allSelected?: boolean;
11
15
  onClearSelection: () => void;
12
- onSelectAll?: () => void;
13
16
  gridType?: DeviceType;
14
17
  children?: ReactElement<TBulkAction> | null | (ReactElement<TBulkAction> | null)[];
15
- turnOffSelectAll?: boolean;
16
18
  }
17
19
  export interface IBulkActions extends IBulkActionsProps {
18
20
  ActionLink: (props: IBulkActionLink) => ReactNode;
19
21
  ActionButton: (props: IBulkActionButton) => ReactNode;
20
22
  }
21
23
  export declare const BulkActions: {
22
- ({ selected, allSelected, className, onClearSelection, onSelectAll, gridType, children, turnOffSelectAll }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
24
+ ({ selected, allSelected, className, onClearSelection, gridType, children }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
23
25
  ActionLink: ({ title, icon, link, disabled, type, ref }: IBulkActionLink) => import("react/jsx-runtime").JSX.Element;
24
26
  ActionButton: ({ title, icon, clickHandler, onClick, disabled, type, ref }: IBulkActionButton) => import("react/jsx-runtime").JSX.Element;
25
27
  translations: string[];
@@ -12,7 +12,6 @@ import { useNonFittingElements } from "../../../../header/hooks/useNonFittingEle
12
12
  import { useResizeObserver } from "../../../../commonHelpers/hooks/useResizeObserver";
13
13
  import { Menu } from "../../../../menu/menu";
14
14
  import { IconDotVertical } from "../../../../icons/iconDotVertical";
15
- import { Button } from "../../../../button/button";
16
15
  injectString("cs", "{1} selected", "{1} vybran\xFD/vybran\xE9");
17
16
  injectString("da-DK", "{1} selected", "{1} valgt");
18
17
  injectString("de", "{1} selected", "{1} ausgew\xE4hlt");
@@ -94,33 +93,6 @@ injectString("zh-Hans", "Clear selection", "\u6E05\u9664\u9009\u62E9");
94
93
  injectString("zh-TW", "Clear selection", "\u6E05\u9664\u9078\u53D6\u9805\u76EE");
95
94
  injectString("ro-RO", "Clear selection", "\u0218terge\u021Bi selec\u021Bia");
96
95
  injectString("ar-SA", "Clear selection", "\u0645\u0633\u062D \u0627\u0644\u062A\u062D\u062F\u064A\u062F");
97
- injectString("cs", "Select all", "Vybrat v\u0161e");
98
- injectString("da-DK", "Select all", "V\xE6lg alle");
99
- injectString("de", "Select all", "Alle ausw\xE4hlen");
100
- injectString("en", "Select all", "Select all");
101
- injectString("es", "Select all", "Seleccionar todo");
102
- injectString("fi-FI", "Select all", "Valitse kaikki");
103
- injectString("fr", "Select all", "S\xE9lectionner tout");
104
- injectString("fr-FR", "Select all", "S\xE9lectionner tout");
105
- injectString("hu-HU", "Select all", "V\xE1laszd ki az \xF6sszeset.");
106
- injectString("id", "Select all", "Pilih semua");
107
- injectString("it", "Select all", "Selezionare tutto");
108
- injectString("ja", "Select all", "\u3059\u3079\u3066\u9078\u629E");
109
- injectString("ko-KR", "Select all", "\uBAA8\uB450 \uC120\uD0DD");
110
- injectString("ms", "Select all", "Pilih semua");
111
- injectString("nb-NO", "Select all", "Velg alle");
112
- injectString("nl", "Select all", "Alles selecteren");
113
- injectString("pl", "Select all", "Wybierz wszystko");
114
- injectString("pt-BR", "Select all", "Selecionar tudo");
115
- injectString("pt-PT", "Select all", "Selecionar tudo");
116
- injectString("sk-SK", "Select all", "Vyber v\u0161etko.");
117
- injectString("sv", "Select all", "V\xE4lj alla");
118
- injectString("th", "Select all", "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
119
- injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
120
- injectString("zh-Hans", "Select all", "\u5168\u9009");
121
- injectString("zh-TW", "Select all", "\u5168\u9078");
122
- injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
123
- injectString("ar-SA", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
124
96
  injectString("cs", "More", "V\xEDce");
125
97
  injectString("da-DK", "More", "Mere");
126
98
  injectString("de", "More", "Mehr");
@@ -153,10 +125,8 @@ export const BulkActions = ({
153
125
  allSelected,
154
126
  className,
155
127
  onClearSelection,
156
- onSelectAll,
157
128
  gridType = DeviceType.Desktop,
158
- children,
159
- turnOffSelectAll
129
+ children
160
130
  }) => {
161
131
  var _a;
162
132
  const {
@@ -200,13 +170,7 @@ export const BulkActions = ({
200
170
  }), _jsx("span", {
201
171
  className: "zen-bulk-actions__number-of-selected ellipsis",
202
172
  children: text
203
- }), onSelectAll && !turnOffSelectAll ? _jsx(Button, {
204
- type: "tertiary",
205
- className: "zen-bulk-actions__select-all",
206
- disabled: allSelected,
207
- onClick: onSelectAll,
208
- children: translate("Select all")
209
- }) : null, _jsxs("div", {
173
+ }), _jsxs("div", {
210
174
  className: "zen-bulk-actions__action-button-holder",
211
175
  ref: buttonHolder,
212
176
  children: [Children.map(visibleElements, element => cloneElement(element, {
@@ -1,6 +1,6 @@
1
1
  import { injectString } from "../utils/localization/translationsDictionary";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useMemo } from "react";
3
+ import { useId, useMemo } from "react";
4
4
  import { TextInputRaw } from "../textInputRaw/textInputRaw";
5
5
  import { TimePicker } from "../timePicker/timePicker";
6
6
  import { useLanguage } from "../utils/localization/useLanguage";
@@ -79,23 +79,28 @@ export const DateInputInnerControlBlock = props => {
79
79
  assistiveText,
80
80
  ref
81
81
  } = props;
82
+ const generatedId = useId();
83
+ const fieldId = id || generatedId;
82
84
  const {
83
85
  translate
84
86
  } = useLanguage();
85
87
  const driveAssistiveClass = useDriveClassName("zen-form-field__text");
86
88
  const isHasDateError = requireSelection && !dateText;
87
89
  const isHasTimeError = requireSelection && !timePickerValue;
90
+ const dateErrorId = `${fieldId}-date-error`;
91
+ const timeErrorId = `${fieldId}-time-error`;
88
92
  const memoizedDateInput = useMemo(() => _jsx(TextInputRaw, {
89
93
  className: classNames(["zen-date-input-inner__text-input", isActiveField ? "zen-date-input-inner__text-input--active" : ""]),
90
- id: id,
94
+ id: fieldId,
91
95
  value: dateText,
92
96
  onChange: handleSetDateText,
93
97
  onBlur: onBlurDateChangeHandler,
94
98
  placeholder: placeholder,
95
99
  autocomplete: "off",
96
100
  isError: isHasDateError,
101
+ ariaDescribedby: isHasDateError ? dateErrorId : undefined,
97
102
  ref: ref
98
- }), [dateText, handleSetDateText, id, isActiveField, isHasDateError, onBlurDateChangeHandler, placeholder, ref]);
103
+ }), [dateText, handleSetDateText, fieldId, isActiveField, isHasDateError, onBlurDateChangeHandler, placeholder, ref, dateErrorId]);
99
104
  const memoizedTimeSelect = useMemo(() => selectTime ? _jsxs("div", {
100
105
  className: "zen-date-input-inner__inputs-block-item",
101
106
  children: [_jsx(TimePicker, {
@@ -103,18 +108,16 @@ export const DateInputInnerControlBlock = props => {
103
108
  value: timePickerValue,
104
109
  onChange: timeChangeHandler,
105
110
  isMobileView: isMobileView,
106
- fullWidth: true,
107
- // eslint-disable-next-line
108
- // @ts-ignore
109
- dataTimeId: id
111
+ fullWidth: true
110
112
  }), isHasTimeError ? _jsx(FormFieldError, {
113
+ id: timeErrorId,
111
114
  error: translate("The time must be set")
112
115
  }) : null]
113
- }) : null, [isActiveField, isHasTimeError, isMobileView, selectTime, timeChangeHandler, timePickerValue, translate, id]);
116
+ }) : null, [isActiveField, isHasTimeError, isMobileView, selectTime, timeChangeHandler, timePickerValue, translate, timeErrorId]);
114
117
  return _jsxs("div", {
115
118
  className: classNames(["zen-date-input-inner__control-block", className || ""]),
116
119
  children: [title ? _jsx("label", {
117
- htmlFor: id,
120
+ htmlFor: fieldId,
118
121
  className: "zen-date-input-inner__label",
119
122
  children: title
120
123
  }) : null, _jsxs("div", {
@@ -122,6 +125,7 @@ export const DateInputInnerControlBlock = props => {
122
125
  children: [_jsxs("div", {
123
126
  className: "zen-date-input-inner__inputs-block-item",
124
127
  children: [memoizedDateInput, isHasDateError ? _jsx(FormFieldError, {
128
+ id: dateErrorId,
125
129
  error: translate("The date must be set")
126
130
  }) : null]
127
131
  }), memoizedTimeSelect]
@@ -219,6 +219,7 @@ injectString("zh-Hans", "Previous", "\u524D\u4E00");
219
219
  injectString("zh-TW", "Previous", "\u4E0A\u4E00\u500B");
220
220
  injectString("ro-RO", "Previous", "\xCEnapoi");
221
221
  injectString("ar-SA", "Previous", "\u0627\u0644\u0633\u0627\u0628\u0642");
222
+ injectString("en", "Previous date period", "Previous date period");
222
223
  injectString("cs", "Next", "Dal\u0161\xED");
223
224
  injectString("da-DK", "Next", "N\xE6ste");
224
225
  injectString("de", "Next", "N\xE4chstes");
@@ -246,6 +247,7 @@ injectString("zh-Hans", "Next", "\u4E0B\u4E00\u4E2A");
246
247
  injectString("zh-TW", "Next", "\u4E0B\u4E00\u6B65");
247
248
  injectString("ro-RO", "Next", "\xCEnainte");
248
249
  injectString("ar-SA", "Next", "\u0627\u0644\u062A\u0627\u0644\u064A");
250
+ injectString("en", "Next date period", "Next date period");
249
251
  export const DateRangeRaw = props => {
250
252
  var _a;
251
253
  const {
@@ -693,6 +695,7 @@ export const DateRangeRaw = props => {
693
695
  onClick: decreaseRange,
694
696
  className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--left"]),
695
697
  title: translate("Previous"),
698
+ "aria-label": translate("Previous date period"),
696
699
  children: _jsx(IconChevronLeftSmall, {
697
700
  size: isDrive || isMobile ? "huge" : "large"
698
701
  })
@@ -702,6 +705,7 @@ export const DateRangeRaw = props => {
702
705
  onClick: increaseRange,
703
706
  className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--right"]),
704
707
  title: translate("Next"),
708
+ "aria-label": translate("Next date period"),
705
709
  children: _jsx(IconChevronRightSmall, {
706
710
  size: isDrive || isMobile ? "huge" : "large"
707
711
  })
@@ -709,4 +713,4 @@ export const DateRangeRaw = props => {
709
713
  }) : chip ? chipTriggerComponent : popupTriggerComponent, isMobile ? memoizedMobileView : memoizedDesktopView]
710
714
  });
711
715
  };
712
- export const TRANSLATIONS = ["Custom", "Date range", "Clear", "Cancel", "Apply", "Reset", "Today", "Next", "Previous", "Choose dates", "Date range not available", "Choose your date range", "Some of the dates you selected aren't available. Please try a different range.", "Please select the dates you want to view."];
716
+ export const TRANSLATIONS = ["Custom", "Date range", "Clear", "Cancel", "Apply", "Reset", "Today", "Next", "Previous", "Choose dates", "Date range not available", "Choose your date range", "Some of the dates you selected arent available. Please try a different range.", "Please select the dates you want to view.", "Previous date period", "Next date period"];
@@ -7,7 +7,7 @@ import { classNames } from "../commonHelpers/classNames/classNames";
7
7
  import { useBodyScroll } from "../utils/useBodyScroll";
8
8
  import { useClientReady } from "../commonHelpers/hooks/useClientReady";
9
9
  import { zen } from "../utils/zen";
10
- import { createPortal } from "react-dom";
10
+ import { usePortal } from "../commonHelpers/hooks/usePortal";
11
11
  /**
12
12
  * @deprecated - use Modal instead
13
13
  */
@@ -42,9 +42,10 @@ export const Dialog = ({ isOpen, children, isElementVisible }) => {
42
42
  const labeledId = useId();
43
43
  const darkClass = dark ? "zen-dark" : "";
44
44
  const createDialog = id => (_jsxs("div", { className: classNames(["zen-dialog", darkClass]), "aria-modal": "true", role: "dialog", "aria-labelledby": labeledId, style: { top: `${zen.pageYOffset || 0}px` }, children: [_jsx(DialogContent, Object.assign({}, children.props, { labeledId: id, isElementVisible: isElementVisible })), _jsx("div", { className: "zen-dialog__shield" })] }));
45
+ const modalRoot = ((_b = zen.document) === null || _b === void 0 ? void 0 : _b.fullscreenElement) || ((_c = zen.document) === null || _c === void 0 ? void 0 : _c.body);
46
+ const portal = usePortal(isOpen && isValidElement(children) ? createDialog(labeledId) : null, modalRoot, "ModalPortal");
45
47
  if (!isClientReady) {
46
48
  return null;
47
49
  }
48
- const modalRoot = ((_b = zen.document) === null || _b === void 0 ? void 0 : _b.fullscreenElement) || ((_c = zen.document) === null || _c === void 0 ? void 0 : _c.body);
49
- return createPortal(isOpen && isValidElement(children) ? createDialog(labeledId) : null, modalRoot);
50
+ return portal;
50
51
  };
@@ -9,9 +9,9 @@ import { getAlertAnimation } from "./utils/getAlertAnimation";
9
9
  import { getToastAnimation } from "./utils/getToastAnimation";
10
10
  import { useClientReady } from "../commonHelpers/hooks/useClientReady";
11
11
  import { zen } from "../utils/zen";
12
- import { createPortal } from "react-dom";
12
+ import { usePortal } from "../commonHelpers/hooks/usePortal";
13
13
  export const FeedbackContainer = () => {
14
- var _a, _b;
14
+ var _a, _b, _c, _d;
15
15
  const { alerts, removeAlert, toasts, removeToast, activeFeedback, removedAlertId, removedToastId, mode } = React.useContext(FeedbackContext);
16
16
  const prevAlertsLength = React.useRef(alerts.length);
17
17
  const prevToastsLength = React.useRef(toasts.length);
@@ -48,10 +48,10 @@ export const FeedbackContainer = () => {
48
48
  removedToastId.current = indx;
49
49
  toast.onClose();
50
50
  }, type: toast.type, hasIcon: toast.hasIcon, action: toast.action }, toast.id))), [toasts, sameToastsLength, isToastAdded, removedToastId, isMobile, activeFeedback, removeToast]);
51
+ const alertsPortal = usePortal(_jsx("div", { className: alertClasses, children: alertsToRender }), (_b = (_a = zen.document) === null || _a === void 0 ? void 0 : _a.body) !== null && _b !== void 0 ? _b : undefined);
52
+ const toastsPortal = usePortal(_jsx("div", { className: toastClasses, children: toastsToRender }), (_d = (_c = zen.document) === null || _c === void 0 ? void 0 : _c.body) !== null && _d !== void 0 ? _d : undefined);
51
53
  if (!isClientReady) {
52
54
  return null;
53
55
  }
54
- const alertsPortal = ((_a = zen.document) === null || _a === void 0 ? void 0 : _a.body) ? createPortal(_jsx("div", { className: alertClasses, children: alertsToRender }), zen.document.body) : null;
55
- const toastsPortal = ((_b = zen.document) === null || _b === void 0 ? void 0 : _b.body) ? createPortal(_jsx("div", { className: toastClasses, children: toastsToRender }), zen.document.body) : null;
56
56
  return (_jsxs(_Fragment, { children: [!isAPIMode && alertsPortal, !isAPIMode && toastsPortal] }));
57
57
  };
@@ -204,28 +204,37 @@ export const FileUpload = ({
204
204
  const pendingFocusIndexRef = useRef(null);
205
205
  const driveClasses = useDriveClassName("zen-file-upload");
206
206
  const classes = useMemo(() => classNames(["zen-file-upload", `zen-file-upload--${size}`, isMobile ? "zen-file-upload--mobile" : "", driveClasses || "", disabled ? "zen-file-upload--disabled" : "", className !== null && className !== void 0 ? className : ""]), [size, isMobile, driveClasses, disabled, className]);
207
- const hasReachedLimit = !allowMultiple && value.length > 0;
208
- const isUploadDisabled = disabled || hasReachedLimit;
207
+ const isUploadDisabled = disabled;
209
208
  const isInteractionDisabled = isUploadDisabled || isUploading;
210
209
  const dropZoneClasses = useMemo(() => classNames(["zen-file-upload__drop-zone", `zen-file-upload__drop-zone--${size}`, isMobile ? "zen-file-upload__drop-zone--mobile" : "", isDragOver ? "zen-file-upload__drop-zone--drag-over" : "", isInteractionDisabled ? "zen-file-upload__drop-zone--disabled" : ""]), [size, isMobile, isDragOver, isInteractionDisabled]);
211
210
  const handleFilesAdded = useCallback(fileList => {
212
211
  if (!onChange) {
213
212
  return;
214
213
  }
215
- const newFiles = createUploadedFiles(fileList);
216
- const merged = [...value, ...newFiles];
214
+ let newFiles = createUploadedFiles(fileList);
215
+ let addedFiles = fileList;
216
+ // when allowMultiple is false, only take first file
217
+ if (!allowMultiple && newFiles.length > 1) {
218
+ newFiles = [newFiles[0]];
219
+ const firstFile = fileList[0];
220
+ const singleFileArray = [firstFile];
221
+ addedFiles = Object.assign(singleFileArray, {
222
+ item: index => singleFileArray[index] || null
223
+ });
224
+ }
225
+ const merged = allowMultiple ? [...value, ...newFiles] : newFiles;
217
226
  onChange(merged, {
218
227
  action: "add",
219
- addedFiles: fileList
228
+ addedFiles
220
229
  });
221
- }, [onChange, value]);
230
+ }, [onChange, value, allowMultiple]);
222
231
  const handleDragOver = useCallback(e => {
223
232
  e.preventDefault();
224
233
  e.stopPropagation();
225
- if (!disabled && !isUploading && !hasReachedLimit) {
234
+ if (!disabled && !isUploading) {
226
235
  setIsDragOver(true);
227
236
  }
228
- }, [disabled, isUploading, hasReachedLimit]);
237
+ }, [disabled, isUploading]);
229
238
  const handleDragLeave = useCallback(e => {
230
239
  e.preventDefault();
231
240
  e.stopPropagation();
@@ -235,7 +244,7 @@ export const FileUpload = ({
235
244
  e.preventDefault();
236
245
  e.stopPropagation();
237
246
  setIsDragOver(false);
238
- if (!disabled && !isUploading && !hasReachedLimit && onChange && e.dataTransfer.files.length > 0) {
247
+ if (!disabled && !isUploading && onChange && e.dataTransfer.files.length > 0) {
239
248
  // DataTransfer.files becomes inaccessible after event, so preserve it
240
249
  const filesArray = Array.from(e.dataTransfer.files);
241
250
  // Create a simple FileList-like object
@@ -244,12 +253,12 @@ export const FileUpload = ({
244
253
  });
245
254
  handleFilesAdded(fileList);
246
255
  }
247
- }, [disabled, isUploading, hasReachedLimit, onChange, handleFilesAdded]);
256
+ }, [disabled, isUploading, onChange, handleFilesAdded]);
248
257
  const handleBrowseClick = useCallback(() => {
249
- if (!disabled && !isUploading && !hasReachedLimit && fileInputRef.current) {
258
+ if (!disabled && !isUploading && fileInputRef.current) {
250
259
  fileInputRef.current.click();
251
260
  }
252
- }, [disabled, isUploading, hasReachedLimit]);
261
+ }, [disabled, isUploading]);
253
262
  const handleFileInputChange = useCallback(e => {
254
263
  if (e.target.files && e.target.files.length > 0 && onChange) {
255
264
  handleFilesAdded(e.target.files);
@@ -12,4 +12,4 @@ export interface IFiltersSidePanel {
12
12
  setExternalState?: (newState: Partial<Record<string, TFiltersComponentsItemState>>) => void;
13
13
  triggerRef: React.RefObject<HTMLElement>;
14
14
  }
15
- export declare const FiltersSidePanel: ({ isOpen, onApply, onClose, onPin, isPinned, filters, externalState, setExternalState, triggerRef }: IFiltersSidePanel) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const FiltersSidePanel: ({ isOpen, onApply, onClose, onPin, isPinned, filters, externalState, setExternalState, triggerRef }: IFiltersSidePanel) => import("react/jsx-runtime").JSX.Element | null;