@geotab/zenith 3.9.0-beta.ssr.1 → 3.9.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.
- package/README.md +29 -8
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/{title → card/components}/title.d.ts +1 -1
- package/dist/card/components/title.js +26 -0
- package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/dist/chart/pieChart/centerTextPlugin.js +12 -6
- package/dist/chart/pieChart.js +20 -4
- package/dist/commonHelpers/hooks/useDeviceType.js +2 -1
- package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/dist/commonHelpers/isDomEnv.js +1 -2
- package/dist/commonHelpers/useUniqueId.js +2 -2
- package/dist/commonHelpers/utils.d.ts +0 -9
- package/dist/commonHelpers/utils.js +1 -11
- package/dist/commonStyles/common.less +2 -0
- package/dist/commonStyles/fonts/notosarabic/LICENSE.txt +93 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic.less +43 -0
- package/dist/commonStyles/pillStyles/pillContent.less +3 -2
- package/dist/commonStyles/pillStyles/pillStyles.less +2 -1
- package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
- package/dist/commonStyles/typography/typography.less +310 -435
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
- package/dist/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/dist/dateRangeRaw/dateRangeRaw.js +5 -1
- package/dist/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
- package/dist/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
- package/dist/index.css +3510 -1914
- package/dist/index.d.ts +5 -5
- package/dist/index.js +24 -26
- package/dist/menu/components/menuItem.js +4 -4
- package/dist/menu/controlledMenu.js +4 -4
- package/dist/nav/nav.js +10 -5
- package/dist/selectRaw/selectRaw.js +1 -1
- package/dist/shield/shield.js +5 -3
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/selectable/useSelectableRows.d.ts +0 -8
- package/dist/table/selectable/useSelectableRows.js +7 -14
- package/dist/table/table.js +7 -1
- package/dist/tooltip/tooltip.d.ts +2 -1
- package/dist/tooltip/tooltip.js +51 -55
- package/dist/utils/localization/languageProvider.js +5 -2
- package/dist/utils/localization/translations/ar.json +0 -1
- package/dist/utils/localization/translations/cs.json +0 -1
- package/dist/utils/localization/translations/da-DK.json +0 -1
- package/dist/utils/localization/translations/de.json +0 -1
- package/dist/utils/localization/translations/en.json +3 -1
- package/dist/utils/localization/translations/es.json +0 -1
- package/dist/utils/localization/translations/fi-FI.json +0 -1
- package/dist/utils/localization/translations/fr-FR.json +0 -1
- package/dist/utils/localization/translations/fr.json +0 -1
- package/dist/utils/localization/translations/hu-HU.json +0 -1
- package/dist/utils/localization/translations/id.json +0 -1
- package/dist/utils/localization/translations/it.json +0 -1
- package/dist/utils/localization/translations/ja.json +0 -1
- package/dist/utils/localization/translations/ko-KR.json +0 -1
- package/dist/utils/localization/translations/ms.json +0 -1
- package/dist/utils/localization/translations/nb-NO.json +0 -1
- package/dist/utils/localization/translations/nl.json +0 -1
- package/dist/utils/localization/translations/pl.json +0 -1
- package/dist/utils/localization/translations/pt-BR.json +0 -1
- package/dist/utils/localization/translations/pt-PT.json +0 -1
- package/dist/utils/localization/translations/ro-RO.json +0 -1
- package/dist/utils/localization/translations/sk-SK.json +0 -1
- package/dist/utils/localization/translations/sv.json +0 -1
- package/dist/utils/localization/translations/th.json +0 -1
- package/dist/utils/localization/translations/tr.json +0 -1
- package/dist/utils/localization/translations/zh-Hans.json +0 -1
- package/dist/utils/localization/translations/zh-TW.json +0 -1
- package/esm/card/card.d.ts +1 -1
- package/esm/card/card.js +1 -1
- package/esm/{title → card/components}/title.d.ts +1 -1
- package/esm/card/components/title.js +22 -0
- package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/esm/chart/pieChart/centerTextPlugin.js +12 -6
- package/esm/chart/pieChart.js +21 -5
- package/esm/commonHelpers/hooks/useDeviceType.js +3 -2
- package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.js +3 -0
- package/esm/commonHelpers/isDomEnv.js +1 -2
- package/esm/commonHelpers/useUniqueId.js +1 -1
- package/esm/commonHelpers/utils.d.ts +0 -9
- package/esm/commonHelpers/utils.js +0 -9
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
- package/esm/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/esm/dateRangeRaw/dateRangeRaw.js +5 -1
- package/esm/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
- package/esm/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
- package/esm/index.d.ts +5 -5
- package/esm/index.js +5 -5
- package/esm/menu/components/menuItem.js +1 -1
- package/esm/menu/controlledMenu.js +1 -1
- package/esm/nav/nav.js +10 -5
- package/esm/selectRaw/selectRaw.js +1 -1
- package/esm/shield/shield.js +5 -3
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/selectable/useSelectableRows.d.ts +0 -8
- package/esm/table/selectable/useSelectableRows.js +7 -14
- package/esm/table/table.js +7 -1
- package/esm/tooltip/tooltip.d.ts +2 -1
- package/esm/tooltip/tooltip.js +51 -55
- package/esm/utils/localization/languageProvider.js +5 -2
- package/esm/utils/localization/translations/ar.json +0 -1
- package/esm/utils/localization/translations/cs.json +0 -1
- package/esm/utils/localization/translations/da-DK.json +0 -1
- package/esm/utils/localization/translations/de.json +0 -1
- package/esm/utils/localization/translations/en.json +3 -1
- package/esm/utils/localization/translations/es.json +0 -1
- package/esm/utils/localization/translations/fi-FI.json +0 -1
- package/esm/utils/localization/translations/fr-FR.json +0 -1
- package/esm/utils/localization/translations/fr.json +0 -1
- package/esm/utils/localization/translations/hu-HU.json +0 -1
- package/esm/utils/localization/translations/id.json +0 -1
- package/esm/utils/localization/translations/it.json +0 -1
- package/esm/utils/localization/translations/ja.json +0 -1
- package/esm/utils/localization/translations/ko-KR.json +0 -1
- package/esm/utils/localization/translations/ms.json +0 -1
- package/esm/utils/localization/translations/nb-NO.json +0 -1
- package/esm/utils/localization/translations/nl.json +0 -1
- package/esm/utils/localization/translations/pl.json +0 -1
- package/esm/utils/localization/translations/pt-BR.json +0 -1
- package/esm/utils/localization/translations/pt-PT.json +0 -1
- package/esm/utils/localization/translations/ro-RO.json +0 -1
- package/esm/utils/localization/translations/sk-SK.json +0 -1
- package/esm/utils/localization/translations/sv.json +0 -1
- package/esm/utils/localization/translations/th.json +0 -1
- package/esm/utils/localization/translations/tr.json +0 -1
- package/esm/utils/localization/translations/zh-Hans.json +0 -1
- package/esm/utils/localization/translations/zh-TW.json +0 -1
- package/package.json +38 -35
- package/dist/title/title.js +0 -27
- package/esm/title/title.js +0 -23
package/README.md
CHANGED
|
@@ -45,15 +45,36 @@ Now components are ready for usage.
|
|
|
45
45
|
|
|
46
46
|
Zenith library provides components defined in Zenith Design System. It includes very basic blocks like colors, icons, font presets, atom components like buttons, checkboxes etc and high order components - header, table, filters bar etc. List of existing components can be found in [Storybook](https://developers.geotab.com/zenith-storybook/index.html).
|
|
47
47
|
|
|
48
|
-
## Documentation
|
|
49
|
-
|
|
50
|
-
- [Development Guide](docs/DEVELOPMENT.md) - Creating components, adding icons, testing, code style
|
|
51
|
-
- [Build Process](docs/BUILD.md) - How the build system works
|
|
52
|
-
- [Release Process](docs/RELEASE.md) - How to publish new versions of Zenith
|
|
53
|
-
- [Translations](docs/TRANSLATIONS.md) - How translations work and how to manage them
|
|
54
|
-
|
|
55
48
|
## Change log
|
|
56
49
|
|
|
50
|
+
### 3.9.0
|
|
51
|
+
|
|
52
|
+
- Added basic SSR (server-side rendering) support
|
|
53
|
+
- `Card` clickable title is now a `<button>` element for keyboard accessibility
|
|
54
|
+
- Add `data-analytics-id` support to `Card` interactive sub-components (button, toggle)
|
|
55
|
+
- `FiltersBar` active filters button now exposes `aria-label="Active filters: N"` for screen readers
|
|
56
|
+
- `Table` first column visual update
|
|
57
|
+
- Add nested subheader support to `Table`
|
|
58
|
+
- Fix `Select` component keyboard accessibility issue
|
|
59
|
+
- Fix `Tooltip` overlapping popup
|
|
60
|
+
- Fix `Tooltip` `onBlur` crash causing Sentry NotFoundError on removeChild
|
|
61
|
+
- `Calendar` accessibility improvements
|
|
62
|
+
- Fix year dropdown scrolling to earliest year instead of selected year in `DateRange`
|
|
63
|
+
- Add customizable legend values for `Chart`
|
|
64
|
+
- Fix month labels in `Chart`
|
|
65
|
+
- Fix last item obscured by action buttons in `Nav` edit mode
|
|
66
|
+
- RTL (right-to-left) orientation based on language
|
|
67
|
+
- Update font handling for Arabic language
|
|
68
|
+
- Fix `TextInput` error message cutoff
|
|
69
|
+
- Add `@rem` CSS variable as standard unit for rem-based spacing
|
|
70
|
+
- Convert button and interactive control styles from `px` to `rem`
|
|
71
|
+
- Edit file upload drag & drop behavior
|
|
72
|
+
- Fix field error integration in `FormField`
|
|
73
|
+
|
|
74
|
+
### 3.8.1
|
|
75
|
+
|
|
76
|
+
- Fix horizontal pie chart center text scaling and legend toggle
|
|
77
|
+
|
|
57
78
|
### 3.8.0
|
|
58
79
|
|
|
59
80
|
- Create `FileUpload` component
|
|
@@ -69,7 +90,7 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
69
90
|
- Updated translations
|
|
70
91
|
- Add multiline table header support (word wrap for long strings)
|
|
71
92
|
- `SidePanel` outside click improvements
|
|
72
|
-
-
|
|
93
|
+
- Implement Responsive Pie `Chart` Component with Dynamic Legend
|
|
73
94
|
|
|
74
95
|
### 3.7.0
|
|
75
96
|
|
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 "./components/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("./components/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,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
2
|
import "./title.less";
|
|
3
|
-
import { IIcon } from "
|
|
3
|
+
import { IIcon } from "../../icons/icon";
|
|
4
4
|
export type TIconType = "info" | "warning" | "error" | "success" | "default";
|
|
5
5
|
interface ITitle {
|
|
6
6
|
isMobile: boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Title = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
7
|
+
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
8
|
+
const useDrive_1 = require("../../utils/theme/useDrive");
|
|
9
|
+
const iconChevronRightSmall_1 = require("../../icons/iconChevronRightSmall");
|
|
10
|
+
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
|
|
11
|
+
const driveClassNames = (0, useDriveClassName_1.useDriveClassName)("zen-card-title");
|
|
12
|
+
const isDrive = (0, useDrive_1.useDrive)();
|
|
13
|
+
const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
|
|
14
|
+
const iconSize = (0, react_1.useMemo)(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
15
|
+
const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-card-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
16
|
+
const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-card-title__link-chevron", children: (0, jsx_runtime_1.jsx)(iconChevronRightSmall_1.IconChevronRightSmall, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [iconSize]);
|
|
17
|
+
const titleClasses = (0, classNames_1.classNames)(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
|
|
18
|
+
if (onClick) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: titleClasses, onClick: onClick, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: [title, chevron] })] }));
|
|
20
|
+
}
|
|
21
|
+
if (link) {
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: titleClasses, href: link, target: target, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-card-title__link-text"]), children: [title, chevron] })] }));
|
|
23
|
+
}
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: titleClasses, children: [iconElement, (0, jsx_runtime_1.jsx)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: title })] }));
|
|
25
|
+
};
|
|
26
|
+
exports.Title = Title;
|
|
@@ -6,7 +6,6 @@ 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;
|
|
10
9
|
if (!centerText || centerText.value === undefined) {
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
@@ -15,18 +14,25 @@ const centerTextPlugin = (centerText) => ({
|
|
|
15
14
|
const centerX = left + width / 2;
|
|
16
15
|
const centerY = top + height / 2;
|
|
17
16
|
const css = (name) => getCssVar(chart.canvas, name);
|
|
18
|
-
const fontFamily = (
|
|
17
|
+
const fontFamily = css("--main-font");
|
|
19
18
|
const hasLabel = !!centerText.label;
|
|
20
|
-
const
|
|
19
|
+
const meta = chart.getDatasetMeta(0);
|
|
20
|
+
const controllerRadius = meta.controller.innerRadius;
|
|
21
|
+
const innerRadius = typeof controllerRadius === "number" && controllerRadius > 0 ? controllerRadius : Math.min(width, height) * 0.325;
|
|
22
|
+
const maxValueFont = parseFloat(css("--pie-center-value-font-size")) || 28;
|
|
23
|
+
const maxLabelFont = parseFloat(css("--pie-center-label-font-size")) || 14;
|
|
24
|
+
const valueFontSize = Math.max(10, Math.min(maxValueFont, innerRadius * 0.45));
|
|
25
|
+
const labelFontSize = Math.max(8, Math.min(maxLabelFont, innerRadius * 0.22));
|
|
26
|
+
const valueY = hasLabel ? centerY - valueFontSize * 0.5 : centerY;
|
|
21
27
|
ctx.textAlign = "center";
|
|
22
28
|
ctx.textBaseline = "middle";
|
|
23
|
-
ctx.font = `${css("--pie-center-value-font-weight")} ${
|
|
29
|
+
ctx.font = `${css("--pie-center-value-font-weight")} ${valueFontSize}px ${fontFamily}`;
|
|
24
30
|
ctx.fillStyle = css("--text-primary");
|
|
25
31
|
ctx.fillText(String(centerText.value), centerX, valueY);
|
|
26
32
|
if (hasLabel) {
|
|
27
|
-
ctx.font = `${css("--pie-center-label-font-weight")} ${
|
|
33
|
+
ctx.font = `${css("--pie-center-label-font-weight")} ${labelFontSize}px ${fontFamily}`;
|
|
28
34
|
ctx.fillStyle = css("--text-secondary");
|
|
29
|
-
ctx.fillText(String(centerText.label), centerX, centerY +
|
|
35
|
+
ctx.fillText(String(centerText.label), centerX, centerY + labelFontSize * 1.1);
|
|
30
36
|
}
|
|
31
37
|
ctx.restore();
|
|
32
38
|
}
|
package/dist/chart/pieChart.js
CHANGED
|
@@ -18,6 +18,7 @@ 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");
|
|
21
22
|
const useDrive_1 = require("../utils/theme/useDrive");
|
|
22
23
|
const useMobile_1 = require("../commonHelpers/hooks/useMobile");
|
|
23
24
|
const themeContext_1 = require("../utils/theme/themeContext");
|
|
@@ -43,16 +44,31 @@ const PieChart = (_a) => {
|
|
|
43
44
|
const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
|
|
44
45
|
const legendId = (0, react_1.useId)();
|
|
45
46
|
const tooltipId = (0, react_1.useId)();
|
|
47
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
46
48
|
(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()) || "";
|
|
47
54
|
auto_1.Chart.defaults.font = {
|
|
48
|
-
family:
|
|
55
|
+
family: fontFamily,
|
|
49
56
|
size: fontSize
|
|
50
57
|
};
|
|
51
|
-
auto_1.Chart.defaults.color =
|
|
58
|
+
auto_1.Chart.defaults.color = color;
|
|
52
59
|
}, [fontSize, dark]);
|
|
53
60
|
const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(), []);
|
|
54
61
|
const chartOptions = (0, utils_1.deepMerge)(defOptions, options);
|
|
55
|
-
const { isHidden, toggleHidden } = (0, useHidden_1.useHidden)();
|
|
62
|
+
const { isHidden, toggleHidden: rawToggle } = (0, useHidden_1.useHidden)();
|
|
63
|
+
const pieData = data.datasets[0].data;
|
|
64
|
+
const toggleHidden = (0, react_1.useCallback)((index) => {
|
|
65
|
+
if (!isHidden(index)) {
|
|
66
|
+
const visibleCount = pieData.filter((_, i) => !isHidden(i)).length;
|
|
67
|
+
if (visibleCount <= 1)
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
rawToggle(index);
|
|
71
|
+
}, [isHidden, rawToggle, pieData]);
|
|
56
72
|
const chartData = (0, react_1.useMemo)(() => {
|
|
57
73
|
const chData = Object.assign({}, data);
|
|
58
74
|
chData.datasets = chData.datasets.map(ds => (0, getDefaultDatasetStyle_1.getDefaultDatasetStyle)(ds));
|
|
@@ -82,6 +98,6 @@ const PieChart = (_a) => {
|
|
|
82
98
|
const chartPlugins = (0, react_1.useMemo)(() => [...(plugins || []), chartLegend, chartTooltip, chartCenterText], [chartLegend, chartTooltip, chartCenterText, plugins]);
|
|
83
99
|
const intSummary = (0, useSummary_1.useSummary)(summary, chartData);
|
|
84
100
|
const legendRight = isHorizontal;
|
|
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 })] }));
|
|
101
|
+
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 })] }));
|
|
86
102
|
};
|
|
87
103
|
exports.PieChart = PieChart;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useDeviceType = exports.getDeviceType = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const useIsomorphicLayoutEffect_1 = require("./useIsomorphicLayoutEffect");
|
|
5
6
|
const useResize_1 = require("./useResize");
|
|
6
7
|
const deviceType_1 = require("./deviceType");
|
|
7
8
|
const topWindowContext_1 = require("../../utils/topWindow/topWindowContext");
|
|
@@ -25,7 +26,7 @@ const useDeviceType = (callback) => {
|
|
|
25
26
|
(0, useResize_1.useResize)(() => {
|
|
26
27
|
setDeviceType((0, exports.getDeviceType)(win.innerWidth));
|
|
27
28
|
}, true);
|
|
28
|
-
(0,
|
|
29
|
+
(0, useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect)(() => {
|
|
29
30
|
callback(deviceType);
|
|
30
31
|
}, [deviceType, callback]);
|
|
31
32
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsomorphicLayoutEffect = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const isDomEnv_1 = require("../isDomEnv");
|
|
6
|
+
exports.useIsomorphicLayoutEffect = (0, isDomEnv_1.isDomEnv)() ? react_1.useLayoutEffect : react_1.useEffect;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isDomEnv = void 0;
|
|
4
|
-
|
|
5
|
-
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"); };
|
|
4
|
+
const isDomEnv = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
6
5
|
exports.isDomEnv = isDomEnv;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useUniqueId = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const generateId_1 = require("./generateId");
|
|
6
6
|
/**
|
|
7
7
|
* `useUniqueId` is a custom React hook that generates and returns a unique identifier.
|
|
8
8
|
*
|
|
@@ -29,7 +29,7 @@ const utils_1 = require("./utils");
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
const useUniqueId = () => {
|
|
32
|
-
const [id] = (0, react_1.useState)(() => (0,
|
|
32
|
+
const [id] = (0, react_1.useState)(() => (0, generateId_1.generateId)());
|
|
33
33
|
return id;
|
|
34
34
|
};
|
|
35
35
|
exports.useUniqueId = useUniqueId;
|
|
@@ -1,12 +1,3 @@
|
|
|
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
|
-
*/
|
|
9
|
-
export declare const generateId: () => string;
|
|
10
1
|
export declare const echo: <T = unknown>(_: T) => T;
|
|
11
2
|
export declare function flattenArrays<T>(arrayOfArrays: T[][]): T[];
|
|
12
3
|
type TPlainObject = Record<string, unknown>;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deepClone = exports.deepMerge = exports.flattenArrays = exports.echo =
|
|
3
|
+
exports.deepClone = exports.deepMerge = exports.flattenArrays = exports.echo = 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
|
-
*/
|
|
13
|
-
const generateId = () => "id" + Math.random().toString().substring(2);
|
|
14
|
-
exports.generateId = generateId;
|
|
15
5
|
const echo = (_) => _;
|
|
16
6
|
exports.echo = echo;
|
|
17
7
|
function flattenArrays(arrayOfArrays) {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// only variables that are used in multiple files should be defined here, and they should not depend on any other variables
|
|
3
3
|
@import "fonts/roboto.less";
|
|
4
4
|
@import "fonts/robotomono.less";
|
|
5
|
+
@import "fonts/notosarabic.less";
|
|
5
6
|
@main-font-family: Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
7
|
+
@arabic-font-family: "Noto Sans Arabic", Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
6
8
|
@driver-font-family: "Roboto Mono", "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
7
9
|
@rem: 16rem;
|
|
8
10
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2022 The Noto Project Authors (https://github.com/notofonts/arabic)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://openfontlicense.org
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Noto Sans Arabic https://fonts.google.com/noto/specimen/Noto+Sans+Arabic
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@font-face {
|
|
6
|
+
font-family: "Noto Sans Arabic";
|
|
7
|
+
font-style: normal;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
font-display: fallback;
|
|
10
|
+
src:
|
|
11
|
+
url("./notosarabic/NotoSansArabic-Regular.woff2") format("woff2"),
|
|
12
|
+
url("./notosarabic/NotoSansArabic-Regular.woff") format("woff");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@font-face {
|
|
16
|
+
font-family: "Noto Sans Arabic";
|
|
17
|
+
font-style: normal;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
font-display: fallback;
|
|
20
|
+
src:
|
|
21
|
+
url("./notosarabic/NotoSansArabic-Medium.woff2") format("woff2"),
|
|
22
|
+
url("./notosarabic/NotoSansArabic-Medium.woff") format("woff");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: "Noto Sans Arabic";
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
font-display: fallback;
|
|
30
|
+
src:
|
|
31
|
+
url("./notosarabic/NotoSansArabic-SemiBold.woff2") format("woff2"),
|
|
32
|
+
url("./notosarabic/NotoSansArabic-SemiBold.woff") format("woff");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: "Noto Sans Arabic";
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
font-display: fallback;
|
|
40
|
+
src:
|
|
41
|
+
url("./notosarabic/NotoSansArabic-Bold.woff2") format("woff2"),
|
|
42
|
+
url("./notosarabic/NotoSansArabic-Bold.woff") format("woff");
|
|
43
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import "../common.less";
|
|
2
|
+
@import "../typography/typography.less";
|
|
2
3
|
|
|
3
4
|
@pill-min-width-default: 30px;
|
|
4
5
|
@pill-max-width-default: 200px;
|
|
@@ -97,9 +98,9 @@
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
&.zen-pill-new-content--drive {
|
|
100
|
-
.body-04-drive();
|
|
101
|
+
.body-04-mobile-drive();
|
|
101
102
|
}
|
|
102
103
|
&.zen-pill-new-content--drive-tablet {
|
|
103
|
-
.body-04-drive();
|
|
104
|
+
.body-04-tablet-drive();
|
|
104
105
|
}
|
|
105
106
|
}
|