@geotab/zenith 3.9.0-beta.no.ssr.0 → 3.9.0-beta.ssr.1

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 (116) hide show
  1. package/README.md +1 -0
  2. package/dist/card/card.d.ts +1 -1
  3. package/dist/card/card.js +1 -1
  4. package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
  5. package/dist/chart/pieChart/centerTextPlugin.js +2 -1
  6. package/dist/chart/pieChart.js +3 -10
  7. package/dist/commonHelpers/generateId.d.ts +8 -0
  8. package/dist/commonHelpers/generateId.js +8 -0
  9. package/dist/commonHelpers/hooks/ssrProvider.d.ts +14 -0
  10. package/dist/commonHelpers/hooks/ssrProvider.js +12 -0
  11. package/dist/commonHelpers/hooks/useClientReady.js +3 -1
  12. package/dist/commonHelpers/hooks/useDeviceType.js +4 -1
  13. package/dist/commonHelpers/hooks/useMobile.js +4 -3
  14. package/dist/commonHelpers/hooks/usePortal.js +2 -5
  15. package/dist/commonHelpers/useUniqueId.d.ts +6 -0
  16. package/dist/commonHelpers/useUniqueId.js +6 -0
  17. package/dist/commonHelpers/utils.d.ts +8 -0
  18. package/dist/commonHelpers/utils.js +8 -0
  19. package/dist/commonStyles/common.less +11 -1
  20. package/dist/commonStyles/pillStyles/pillContent.less +2 -3
  21. package/dist/commonStyles/pillStyles/pillStyles.less +1 -2
  22. package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
  23. package/dist/commonStyles/typography/typography.less +436 -305
  24. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
  25. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
  26. package/dist/dialog/dialog.js +4 -3
  27. package/dist/feedbackContainer/feedbackContainer.js +4 -4
  28. package/dist/filters/components/filtersSidePanel.d.ts +1 -1
  29. package/dist/filters/components/filtersSidePanel.js +123 -116
  30. package/dist/filters/filters.js +1 -2
  31. package/dist/filtersBar/filtersBar.js +3 -1
  32. package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
  33. package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
  34. package/dist/index.css +2383 -2193
  35. package/dist/index.d.ts +6 -3
  36. package/dist/index.js +30 -23
  37. package/dist/nav/navAddMenu/navAddMenu.js +1 -2
  38. package/dist/nav/navItem/navItem.js +1 -2
  39. package/dist/pageHeader/pageHeaderActions.js +4 -3
  40. package/dist/sidePanel/sidePanel.js +9 -8
  41. package/dist/table/children/useTableChildren.d.ts +1 -1
  42. package/dist/table/children/useTableChildren.js +3 -3
  43. package/dist/table/flexible/useFlexibleColumns.js +39 -1
  44. package/dist/table/nested/useNestedRows.d.ts +1 -0
  45. package/dist/table/nested/useNestedRows.js +3 -3
  46. package/dist/table/selectable/useSelectableRows.d.ts +9 -0
  47. package/dist/table/selectable/useSelectableRows.js +18 -11
  48. package/dist/table/table.js +1 -7
  49. package/dist/{card/components → title}/title.d.ts +1 -1
  50. package/dist/title/title.js +27 -0
  51. package/dist/tooltip/tooltip.js +11 -3
  52. package/dist/utils/localization/directionContext.d.ts +3 -0
  53. package/dist/utils/localization/directionContext.js +5 -0
  54. package/dist/utils/localization/getTextDirection.d.ts +2 -0
  55. package/dist/utils/localization/getTextDirection.js +6 -0
  56. package/dist/utils/localization/languageProvider.js +12 -1
  57. package/dist/utils/localization/useDirection.d.ts +2 -0
  58. package/dist/utils/localization/useDirection.js +7 -0
  59. package/esm/card/card.d.ts +1 -1
  60. package/esm/card/card.js +1 -1
  61. package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
  62. package/esm/chart/pieChart/centerTextPlugin.js +2 -1
  63. package/esm/chart/pieChart.js +4 -11
  64. package/esm/commonHelpers/generateId.d.ts +8 -0
  65. package/esm/commonHelpers/generateId.js +8 -0
  66. package/esm/commonHelpers/hooks/ssrProvider.d.ts +14 -0
  67. package/esm/commonHelpers/hooks/ssrProvider.js +6 -0
  68. package/esm/commonHelpers/hooks/useClientReady.js +4 -2
  69. package/esm/commonHelpers/hooks/useDeviceType.js +4 -1
  70. package/esm/commonHelpers/hooks/useMobile.js +4 -3
  71. package/esm/commonHelpers/hooks/usePortal.js +2 -5
  72. package/esm/commonHelpers/useUniqueId.d.ts +6 -0
  73. package/esm/commonHelpers/useUniqueId.js +6 -0
  74. package/esm/commonHelpers/utils.d.ts +8 -0
  75. package/esm/commonHelpers/utils.js +8 -0
  76. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
  77. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
  78. package/esm/dialog/dialog.js +4 -3
  79. package/esm/feedbackContainer/feedbackContainer.js +4 -4
  80. package/esm/filters/components/filtersSidePanel.d.ts +1 -1
  81. package/esm/filters/components/filtersSidePanel.js +123 -116
  82. package/esm/filters/filters.js +2 -3
  83. package/esm/filtersBar/filtersBar.js +3 -1
  84. package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
  85. package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
  86. package/esm/index.d.ts +6 -3
  87. package/esm/index.js +6 -3
  88. package/esm/nav/navAddMenu/navAddMenu.js +2 -3
  89. package/esm/nav/navItem/navItem.js +2 -3
  90. package/esm/pageHeader/pageHeaderActions.js +4 -3
  91. package/esm/sidePanel/sidePanel.js +9 -8
  92. package/esm/table/children/useTableChildren.d.ts +1 -1
  93. package/esm/table/children/useTableChildren.js +3 -3
  94. package/esm/table/flexible/useFlexibleColumns.js +39 -1
  95. package/esm/table/nested/useNestedRows.d.ts +1 -0
  96. package/esm/table/nested/useNestedRows.js +1 -1
  97. package/esm/table/selectable/useSelectableRows.d.ts +9 -0
  98. package/esm/table/selectable/useSelectableRows.js +15 -8
  99. package/esm/table/table.js +1 -7
  100. package/esm/{card/components → title}/title.d.ts +1 -1
  101. package/esm/title/title.js +23 -0
  102. package/esm/tooltip/tooltip.js +11 -3
  103. package/esm/utils/localization/directionContext.d.ts +3 -0
  104. package/esm/utils/localization/directionContext.js +2 -0
  105. package/esm/utils/localization/getTextDirection.d.ts +2 -0
  106. package/esm/utils/localization/getTextDirection.js +2 -0
  107. package/esm/utils/localization/languageProvider.js +12 -1
  108. package/esm/utils/localization/useDirection.d.ts +2 -0
  109. package/esm/utils/localization/useDirection.js +3 -0
  110. package/package.json +6 -6
  111. package/dist/card/components/title.js +0 -26
  112. package/dist/commonHelpers/hooks/deviceProvider.d.ts +0 -7
  113. package/dist/commonHelpers/hooks/deviceProvider.js +0 -11
  114. package/esm/card/components/title.js +0 -22
  115. package/esm/commonHelpers/hooks/deviceProvider.d.ts +0 -7
  116. package/esm/commonHelpers/hooks/deviceProvider.js +0 -4
package/README.md CHANGED
@@ -69,6 +69,7 @@ Zenith library provides components defined in Zenith Design System. It includes
69
69
  - Updated translations
70
70
  - Add multiline table header support (word wrap for long strings)
71
71
  - `SidePanel` outside click improvements
72
+ - Add Horizontal Layout for pie `Chart` component
72
73
 
73
74
  ### 3.7.0
74
75
 
@@ -1,7 +1,7 @@
1
1
  import React, { FC, FunctionComponent, ReactNode } from "react";
2
2
  import { IAbsoluteSize, TContainerSize } from "../cardContainer/cardContainer";
3
3
  import { TCardStatus } from "./components/status";
4
- import { TIconType } from "./components/title";
4
+ import { TIconType } from "../title/title";
5
5
  import { IActions } from "./components/actions";
6
6
  import { IContent } from "./components/content";
7
7
  import "./card.less";
package/dist/card/card.js CHANGED
@@ -71,7 +71,7 @@ const cardContainer_1 = require("../cardContainer/cardContainer");
71
71
  const deviceType_1 = require("../commonHelpers/hooks/deviceType");
72
72
  const useDeviceType_1 = require("../commonHelpers/hooks/useDeviceType");
73
73
  const status_1 = require("./components/status");
74
- const title_1 = require("./components/title");
74
+ const title_1 = require("../title/title");
75
75
  const actions_1 = require("./components/actions");
76
76
  const content_1 = require("./components/content");
77
77
  const useCardSize_1 = require("./hooks/useCardSize");
@@ -1,3 +1,3 @@
1
1
  import { TCardStatus } from "../components/status";
2
- import { TIconType } from "../components/title";
2
+ import { TIconType } from "../../title/title";
3
3
  export declare const getIconTypeFromStatus: (status: TCardStatus) => TIconType | undefined;
@@ -6,6 +6,7 @@ const getCssVar = (el, name) => { var _a, _b; return (_b = (_a = zen_1.zen.getCo
6
6
  const centerTextPlugin = (centerText) => ({
7
7
  id: "zenithPieCenterText",
8
8
  afterDraw(chart) {
9
+ var _a;
9
10
  if (!centerText || centerText.value === undefined) {
10
11
  return;
11
12
  }
@@ -14,7 +15,7 @@ const centerTextPlugin = (centerText) => ({
14
15
  const centerX = left + width / 2;
15
16
  const centerY = top + height / 2;
16
17
  const css = (name) => getCssVar(chart.canvas, name);
17
- const fontFamily = css("--main-font");
18
+ const fontFamily = ((_a = zen_1.zen.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(zen_1.zen, chart.canvas).fontFamily) || "Roboto";
18
19
  const hasLabel = !!centerText.label;
19
20
  const valueY = hasLabel ? centerY - 14 : centerY;
20
21
  ctx.textAlign = "center";
@@ -18,7 +18,6 @@ const typedCharts_1 = require("../react-chartjs/typedCharts");
18
18
  const auto_1 = require("chart.js/auto");
19
19
  require("../react-chartjs/dateAdapter");
20
20
  const utils_1 = require("../commonHelpers/utils");
21
- const zen_1 = require("../utils/zen");
22
21
  const useDrive_1 = require("../utils/theme/useDrive");
23
22
  const useMobile_1 = require("../commonHelpers/hooks/useMobile");
24
23
  const themeContext_1 = require("../utils/theme/themeContext");
@@ -44,18 +43,12 @@ const PieChart = (_a) => {
44
43
  const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
45
44
  const legendId = (0, react_1.useId)();
46
45
  const tooltipId = (0, react_1.useId)();
47
- const containerRef = (0, react_1.useRef)(null);
48
46
  (0, react_1.useEffect)(() => {
49
- var _a;
50
- const el = containerRef.current;
51
- const styles = el ? (_a = zen_1.zen.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(zen_1.zen, el) : undefined;
52
- const fontFamily = (styles === null || styles === void 0 ? void 0 : styles.getPropertyValue("--main-font").trim()) || "Roboto";
53
- const color = (styles === null || styles === void 0 ? void 0 : styles.getPropertyValue("--text-primary").trim()) || "";
54
47
  auto_1.Chart.defaults.font = {
55
- family: fontFamily,
48
+ family: "Roboto",
56
49
  size: fontSize
57
50
  };
58
- auto_1.Chart.defaults.color = color;
51
+ auto_1.Chart.defaults.color = dark ? "#FFFFFF" : "#1F2833";
59
52
  }, [fontSize, dark]);
60
53
  const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(), []);
61
54
  const chartOptions = (0, utils_1.deepMerge)(defOptions, options);
@@ -89,6 +82,6 @@ const PieChart = (_a) => {
89
82
  const chartPlugins = (0, react_1.useMemo)(() => [...(plugins || []), chartLegend, chartTooltip, chartCenterText], [chartLegend, chartTooltip, chartCenterText, plugins]);
90
83
  const intSummary = (0, useSummary_1.useSummary)(summary, chartData);
91
84
  const legendRight = isHorizontal;
92
- return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: (0, classNames_1.classNames)(["zen-chart", legendRight ? "zen-chart--legend-right" : "", className || ""]), children: [insight ? (0, jsx_runtime_1.jsx)(chartInsight_1.ChartInsight, Object.assign({}, insight)) : null, summary ? (0, jsx_runtime_1.jsx)(summary_1.Summary, Object.assign({}, intSummary)) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__chart", children: (0, jsx_runtime_1.jsx)(typedCharts_1.Pie, Object.assign({ options: chartOptions, data: chartData, plugins: chartPlugins }, rest, { "aria-hidden": true })) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__legend", id: legendId }), (0, jsx_runtime_1.jsx)(accessibleChart_1.AccessibleChart, { type: "pie", data: chartData })] }));
85
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-chart", legendRight ? "zen-chart--legend-right" : "", className || ""]), children: [insight ? (0, jsx_runtime_1.jsx)(chartInsight_1.ChartInsight, Object.assign({}, insight)) : null, summary ? (0, jsx_runtime_1.jsx)(summary_1.Summary, Object.assign({}, intSummary)) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__chart", children: (0, jsx_runtime_1.jsx)(typedCharts_1.Pie, Object.assign({ options: chartOptions, data: chartData, plugins: chartPlugins }, rest, { "aria-hidden": true })) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__legend", id: legendId }), (0, jsx_runtime_1.jsx)(accessibleChart_1.AccessibleChart, { type: "pie", data: chartData })] }));
93
86
  };
94
87
  exports.PieChart = PieChart;
@@ -1 +1,9 @@
1
+ /**
2
+ * Generates a random unique ID string.
3
+ *
4
+ * @remarks
5
+ * **Prefer `React.useId()`** inside React components. `useId` produces IDs that are
6
+ * stable across server and client renders, preventing SSR hydration mismatches.
7
+ * Use `generateId` only outside of a React component context where `useId` is not available.
8
+ */
1
9
  export declare function generateId(): string;
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateId = void 0;
4
+ /**
5
+ * Generates a random unique ID string.
6
+ *
7
+ * @remarks
8
+ * **Prefer `React.useId()`** inside React components. `useId` produces IDs that are
9
+ * stable across server and client renders, preventing SSR hydration mismatches.
10
+ * Use `generateId` only outside of a React component context where `useId` is not available.
11
+ */
4
12
  function generateId() {
5
13
  return "id" + Math.random().toString().substring(2) + Math.random().toString().substring(2);
6
14
  }
@@ -0,0 +1,14 @@
1
+ import { PropsWithChildren } from "react";
2
+ import { DeviceType } from "./deviceType";
3
+ interface ISSRContext {
4
+ isClientReady: boolean;
5
+ deviceType?: DeviceType;
6
+ }
7
+ export declare const SSRContext: import("react").Context<ISSRContext | null>;
8
+ export declare const SSRProvider: ({ deviceType, isClientReady, children }: PropsWithChildren<{
9
+ deviceType?: DeviceType;
10
+ isClientReady?: boolean;
11
+ }>) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const useSSRContext: () => ISSRContext | null;
13
+ export declare const useIsSSRProviderMounted: () => boolean;
14
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useIsSSRProviderMounted = exports.useSSRContext = exports.SSRProvider = exports.SSRContext = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ exports.SSRContext = (0, react_1.createContext)(null);
7
+ const SSRProvider = ({ deviceType, isClientReady = false, children }) => ((0, jsx_runtime_1.jsx)(exports.SSRContext.Provider, { value: { isClientReady, deviceType }, children: children }));
8
+ exports.SSRProvider = SSRProvider;
9
+ const useSSRContext = () => (0, react_1.useContext)(exports.SSRContext);
10
+ exports.useSSRContext = useSSRContext;
11
+ const useIsSSRProviderMounted = () => (0, react_1.useContext)(exports.SSRContext) !== null;
12
+ exports.useIsSSRProviderMounted = useIsSSRProviderMounted;
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useClientReady = void 0;
4
4
  const react_1 = require("react");
5
5
  const isDomEnv_1 = require("../isDomEnv");
6
+ const ssrProvider_1 = require("./ssrProvider");
6
7
  const useClientReady = () => {
7
- const [isClientReady, setIsClientReady] = (0, react_1.useState)(true);
8
+ const ctx = (0, react_1.useContext)(ssrProvider_1.SSRContext);
9
+ const [isClientReady, setIsClientReady] = (0, react_1.useState)(ctx !== null ? ctx.isClientReady : true);
8
10
  (0, react_1.useEffect)(() => {
9
11
  if ((0, isDomEnv_1.isDomEnv)()) {
10
12
  setIsClientReady(true);
@@ -7,6 +7,7 @@ const deviceType_1 = require("./deviceType");
7
7
  const topWindowContext_1 = require("../../utils/topWindow/topWindowContext");
8
8
  const getParentWindow_1 = require("../../utils/getParentWindow");
9
9
  const zen_1 = require("../../utils/zen");
10
+ const ssrProvider_1 = require("./ssrProvider");
10
11
  const MobileMaxWidth = 640;
11
12
  const getDeviceType = (width) => {
12
13
  if (width > MobileMaxWidth) {
@@ -16,9 +17,11 @@ const getDeviceType = (width) => {
16
17
  };
17
18
  exports.getDeviceType = getDeviceType;
18
19
  const useDeviceType = (callback) => {
20
+ const ctx = (0, react_1.useContext)(ssrProvider_1.SSRContext);
21
+ const ssrDeviceType = ctx === null || ctx === void 0 ? void 0 : ctx.deviceType;
19
22
  const { topWindow } = (0, react_1.useContext)(topWindowContext_1.topWindowContext);
20
23
  const win = (0, react_1.useMemo)(() => topWindow || (0, getParentWindow_1.getParentWindow)(zen_1.zen), [topWindow]);
21
- const [deviceType, setDeviceType] = (0, react_1.useState)((0, exports.getDeviceType)(win.innerWidth));
24
+ const [deviceType, setDeviceType] = (0, react_1.useState)(ssrDeviceType !== null && ssrDeviceType !== void 0 ? ssrDeviceType : (0, exports.getDeviceType)(win.innerWidth));
22
25
  (0, useResize_1.useResize)(() => {
23
26
  setDeviceType((0, exports.getDeviceType)(win.innerWidth));
24
27
  }, true);
@@ -5,13 +5,14 @@ const react_1 = require("react");
5
5
  const deviceType_1 = require("./deviceType");
6
6
  const useDeviceType_1 = require("./useDeviceType");
7
7
  const getParentWindow_1 = require("../../utils/getParentWindow");
8
- const deviceProvider_1 = require("./deviceProvider");
8
+ const ssrProvider_1 = require("./ssrProvider");
9
9
  const zen_1 = require("../../utils/zen");
10
10
  const initialParent = (0, getParentWindow_1.getParentWindow)(zen_1.zen);
11
11
  exports.initialValue = (0, useDeviceType_1.getDeviceType)(initialParent.innerWidth);
12
12
  const useMobile = () => {
13
- const deviceTypeFromProvider = (0, react_1.useContext)(deviceProvider_1.DeviceContext);
14
- const [deviceType, setDeviceType] = (0, react_1.useState)(deviceTypeFromProvider || exports.initialValue);
13
+ var _a;
14
+ const ctx = (0, react_1.useContext)(ssrProvider_1.SSRContext);
15
+ const [deviceType, setDeviceType] = (0, react_1.useState)((_a = ctx === null || ctx === void 0 ? void 0 : ctx.deviceType) !== null && _a !== void 0 ? _a : exports.initialValue);
15
16
  (0, useDeviceType_1.useDeviceType)(setDeviceType);
16
17
  const isMobile = (0, react_1.useMemo)(() => deviceType === deviceType_1.DeviceType.Mobile, [deviceType]);
17
18
  return isMobile;
@@ -4,13 +4,10 @@ exports.usePortal = void 0;
4
4
  const react_1 = require("react");
5
5
  const react_dom_1 = require("react-dom");
6
6
  const usePortal = (children, container, key) => {
7
- const [portalContainer, setPortalContainer] = (0, react_1.useState)(container);
7
+ const [portalContainer, setPortalContainer] = (0, react_1.useState)(undefined);
8
8
  (0, react_1.useEffect)(() => {
9
- if (portalContainer || !container) {
10
- return;
11
- }
12
9
  setPortalContainer(container);
13
- }, [portalContainer, container]);
10
+ }, [container]);
14
11
  return portalContainer ? (0, react_dom_1.createPortal)(children, portalContainer, key) : null;
15
12
  };
16
13
  exports.usePortal = usePortal;
@@ -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:
@@ -11,6 +11,12 @@ const utils_1 = require("./utils");
11
11
  * component. This can be particularly useful for assigning unique keys to elements
12
12
  * in a list, or for generating unique identifiers for form inputs, labels, etc.
13
13
  *
14
+ * @remarks
15
+ * **Prefer `React.useId()`** when possible. `useId` generates IDs that are stable
16
+ * across server and client renders, preventing SSR hydration mismatches.
17
+ * Use `useUniqueId` only when `useId` is not suitable — for example, when the ID
18
+ * must be truly random and is never rendered during SSR.
19
+ *
14
20
  * @returns {string} A unique identifier.
15
21
  *
16
22
  * Example usage:
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Generates a random unique ID string.
3
+ *
4
+ * @remarks
5
+ * **Prefer `React.useId()`** inside React components. `useId` produces IDs that are
6
+ * stable across server and client renders, preventing SSR hydration mismatches.
7
+ * Use `generateId` only outside of a React component context where `useId` is not available.
8
+ */
1
9
  export declare const generateId: () => string;
2
10
  export declare const echo: <T = unknown>(_: T) => T;
3
11
  export declare function flattenArrays<T>(arrayOfArrays: T[][]): T[];
@@ -2,6 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deepClone = exports.deepMerge = exports.flattenArrays = exports.echo = exports.generateId = void 0;
4
4
  const zen_1 = require("../utils/zen");
5
+ /**
6
+ * Generates a random unique ID string.
7
+ *
8
+ * @remarks
9
+ * **Prefer `React.useId()`** inside React components. `useId` produces IDs that are
10
+ * stable across server and client renders, preventing SSR hydration mismatches.
11
+ * Use `generateId` only outside of a React component context where `useId` is not available.
12
+ */
5
13
  const generateId = () => "id" + Math.random().toString().substring(2);
6
14
  exports.generateId = generateId;
7
15
  const echo = (_) => _;
@@ -1,7 +1,14 @@
1
+ // do not update the order of imports, as some of the files depend on variables defined in other files
2
+ // only variables that are used in multiple files should be defined here, and they should not depend on any other variables
1
3
  @import "fonts/roboto.less";
2
4
  @import "fonts/robotomono.less";
3
- @import "colors/colors.less";
5
+ @main-font-family: Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
6
+ @driver-font-family: "Roboto Mono", "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
7
+ @rem: 16rem;
8
+
4
9
  @import "typography/typography.less";
10
+
11
+ @import "colors/colors.less";
5
12
  @import "caption/caption.less";
6
13
  @import "ellipsis.less";
7
14
  @import "notSelectable.less";
@@ -13,6 +20,9 @@
13
20
  @import "zIndex.less";
14
21
  @import "rangeFieldMixin.less";
15
22
 
23
+ // do not set variables or styles here,
24
+ // as this file is imported in all other files and it may cause circular dependencies
25
+
16
26
  @border-width-default: 1px;
17
27
  @border-radius-default: 4px;
18
28
  @padding-top-bottom: 8px;
@@ -1,5 +1,4 @@
1
1
  @import "../common.less";
2
- @import "../typography/typography.less";
3
2
 
4
3
  @pill-min-width-default: 30px;
5
4
  @pill-max-width-default: 200px;
@@ -98,9 +97,9 @@
98
97
  }
99
98
  }
100
99
  &.zen-pill-new-content--drive {
101
- .body-04-mobile-drive();
100
+ .body-04-drive();
102
101
  }
103
102
  &.zen-pill-new-content--drive-tablet {
104
- .body-04-tablet-drive();
103
+ .body-04-drive();
105
104
  }
106
105
  }
@@ -1,5 +1,4 @@
1
- @import "../typography/typography.less";
2
- @import "../colors/colors.less";
1
+ @import "../common.less";
3
2
 
4
3
  .zen-pill-content {
5
4
  .body-04();
@@ -12,9 +12,9 @@
12
12
  height: 20px;
13
13
  }
14
14
  &.zen-pill-text-content--drive {
15
- .body-04-mobile-drive();
15
+ .body-04-drive();
16
16
  }
17
17
  &.zen-pill-text-content--drive-tablet {
18
- .body-04-tablet-drive();
18
+ .body-04-drive();
19
19
  }
20
20
  }