@geotab/zenith 3.9.0-beta.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.
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/dist/chart/pieChart/centerTextPlugin.js +2 -1
- package/dist/chart/pieChart.js +3 -10
- package/dist/commonHelpers/generateId.d.ts +8 -0
- package/dist/commonHelpers/generateId.js +8 -0
- package/dist/commonHelpers/hooks/ssrProvider.d.ts +14 -0
- package/dist/commonHelpers/hooks/ssrProvider.js +12 -0
- package/dist/commonHelpers/hooks/useClientReady.js +3 -1
- package/dist/commonHelpers/hooks/useDeviceType.js +4 -1
- package/dist/commonHelpers/hooks/useMobile.js +4 -3
- package/dist/commonHelpers/hooks/usePortal.js +2 -5
- package/dist/commonHelpers/useUniqueId.d.ts +6 -0
- package/dist/commonHelpers/useUniqueId.js +6 -0
- package/dist/commonHelpers/utils.d.ts +8 -0
- package/dist/commonHelpers/utils.js +8 -0
- package/dist/commonStyles/common.less +11 -1
- package/dist/commonStyles/pillStyles/pillContent.less +2 -3
- package/dist/commonStyles/pillStyles/pillStyles.less +1 -2
- package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
- package/dist/commonStyles/typography/typography.less +436 -305
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
- package/dist/feedbackContainer/feedbackContainer.js +4 -4
- package/dist/filters/components/filtersSidePanel.d.ts +1 -1
- package/dist/filters/components/filtersSidePanel.js +123 -116
- package/dist/filters/filters.js +1 -2
- package/dist/filtersBar/filtersBar.js +3 -1
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
- package/dist/index.css +2383 -2193
- package/dist/index.d.ts +6 -3
- package/dist/index.js +30 -23
- package/dist/nav/navAddMenu/navAddMenu.js +1 -2
- package/dist/nav/navItem/navItem.js +1 -2
- package/dist/sidePanel/sidePanel.js +9 -8
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/flexible/useFlexibleColumns.js +39 -1
- package/dist/table/nested/useNestedRows.d.ts +1 -0
- package/dist/table/nested/useNestedRows.js +3 -3
- package/dist/table/selectable/useSelectableRows.d.ts +9 -0
- package/dist/table/selectable/useSelectableRows.js +18 -11
- package/dist/table/table.js +1 -7
- package/dist/{card/components → title}/title.d.ts +1 -1
- package/dist/title/title.js +27 -0
- package/dist/tooltip/tooltip.js +11 -3
- package/dist/utils/localization/directionContext.d.ts +3 -0
- package/dist/utils/localization/directionContext.js +5 -0
- package/dist/utils/localization/getTextDirection.d.ts +2 -0
- package/dist/utils/localization/getTextDirection.js +6 -0
- package/dist/utils/localization/languageProvider.js +12 -1
- package/dist/utils/localization/useDirection.d.ts +2 -0
- package/dist/utils/localization/useDirection.js +7 -0
- package/esm/card/card.d.ts +1 -1
- package/esm/card/card.js +1 -1
- package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/esm/chart/pieChart/centerTextPlugin.js +2 -1
- package/esm/chart/pieChart.js +4 -11
- package/esm/commonHelpers/generateId.d.ts +8 -0
- package/esm/commonHelpers/generateId.js +8 -0
- package/esm/commonHelpers/hooks/ssrProvider.d.ts +14 -0
- package/esm/commonHelpers/hooks/ssrProvider.js +6 -0
- package/esm/commonHelpers/hooks/useClientReady.js +4 -2
- package/esm/commonHelpers/hooks/useDeviceType.js +4 -1
- package/esm/commonHelpers/hooks/useMobile.js +4 -3
- package/esm/commonHelpers/hooks/usePortal.js +2 -5
- package/esm/commonHelpers/useUniqueId.d.ts +6 -0
- package/esm/commonHelpers/useUniqueId.js +6 -0
- package/esm/commonHelpers/utils.d.ts +8 -0
- package/esm/commonHelpers/utils.js +8 -0
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
- package/esm/feedbackContainer/feedbackContainer.js +4 -4
- package/esm/filters/components/filtersSidePanel.d.ts +1 -1
- package/esm/filters/components/filtersSidePanel.js +123 -116
- package/esm/filters/filters.js +2 -3
- package/esm/filtersBar/filtersBar.js +3 -1
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
- package/esm/index.d.ts +6 -3
- package/esm/index.js +6 -3
- package/esm/nav/navAddMenu/navAddMenu.js +2 -3
- package/esm/nav/navItem/navItem.js +2 -3
- package/esm/sidePanel/sidePanel.js +9 -8
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/flexible/useFlexibleColumns.js +39 -1
- package/esm/table/nested/useNestedRows.d.ts +1 -0
- package/esm/table/nested/useNestedRows.js +1 -1
- package/esm/table/selectable/useSelectableRows.d.ts +9 -0
- package/esm/table/selectable/useSelectableRows.js +15 -8
- package/esm/table/table.js +1 -7
- package/esm/{card/components → title}/title.d.ts +1 -1
- package/esm/title/title.js +23 -0
- package/esm/tooltip/tooltip.js +11 -3
- package/esm/utils/localization/directionContext.d.ts +3 -0
- package/esm/utils/localization/directionContext.js +2 -0
- package/esm/utils/localization/getTextDirection.d.ts +2 -0
- package/esm/utils/localization/getTextDirection.js +2 -0
- package/esm/utils/localization/languageProvider.js +12 -1
- package/esm/utils/localization/useDirection.d.ts +2 -0
- package/esm/utils/localization/useDirection.js +3 -0
- package/package.json +2 -2
- package/dist/card/components/title.js +0 -26
- package/dist/commonHelpers/hooks/deviceProvider.d.ts +0 -7
- package/dist/commonHelpers/hooks/deviceProvider.js +0 -11
- package/esm/card/components/title.js +0 -22
- package/esm/commonHelpers/hooks/deviceProvider.d.ts +0 -7
- package/esm/commonHelpers/hooks/deviceProvider.js +0 -4
package/dist/card/card.d.ts
CHANGED
|
@@ -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 "
|
|
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("
|
|
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");
|
|
@@ -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 =
|
|
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";
|
package/dist/chart/pieChart.js
CHANGED
|
@@ -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:
|
|
48
|
+
family: "Roboto",
|
|
56
49
|
size: fontSize
|
|
57
50
|
};
|
|
58
|
-
auto_1.Chart.defaults.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", {
|
|
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
|
|
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
|
|
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
|
-
|
|
14
|
-
const
|
|
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)(
|
|
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
|
-
}, [
|
|
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
|
-
@
|
|
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-
|
|
100
|
+
.body-04-drive();
|
|
102
101
|
}
|
|
103
102
|
&.zen-pill-new-content--drive-tablet {
|
|
104
|
-
.body-04-
|
|
103
|
+
.body-04-drive();
|
|
105
104
|
}
|
|
106
105
|
}
|