@geotab/zenith 3.9.0-beta.2 → 3.9.0-beta.4
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 -0
- package/dist/chart/pieChart/centerTextPlugin.js +1 -2
- package/dist/chart/pieChart.js +10 -3
- 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 +251 -613
- package/dist/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/dist/index.css +2738 -2499
- 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 +0 -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/chart/pieChart/centerTextPlugin.js +1 -2
- package/esm/chart/pieChart.js +11 -4
- package/esm/dateInputInner/dateInputInnerControlBlock.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 +0 -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 +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,35 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
47
47
|
|
|
48
48
|
## Change log
|
|
49
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
|
+
- `FiltersBar` now supports right-aligned components
|
|
57
|
+
- `Table` first column visual update
|
|
58
|
+
- Add nested subheader support to `Table`
|
|
59
|
+
- Fix `Select` component keyboard accessibility issue
|
|
60
|
+
- Fix `Tooltip` overlapping popup
|
|
61
|
+
- Fix `Tooltip` `onBlur` crash causing Sentry NotFoundError on removeChild
|
|
62
|
+
- `Calendar` accessibility improvements
|
|
63
|
+
- Fix year dropdown scrolling to earliest year instead of selected year in `DateRange`
|
|
64
|
+
- Add customizable legend values for `Chart`
|
|
65
|
+
- Fix month labels in `Chart`
|
|
66
|
+
- Fix last item obscured by action buttons in `GreatLakes Nav` edit mode
|
|
67
|
+
- RTL (right-to-left) orientation based on language
|
|
68
|
+
- Update font handling for Arabic language
|
|
69
|
+
- Fix `TextInput` error message cutoff
|
|
70
|
+
- Add `@rem` CSS variable as standard unit for rem-based spacing
|
|
71
|
+
- Convert button and interactive control styles from `px` to `rem`
|
|
72
|
+
- Edit file upload drag & drop behaviour
|
|
73
|
+
- Fix field error integration in `FormField`
|
|
74
|
+
|
|
75
|
+
### 3.8.1
|
|
76
|
+
|
|
77
|
+
- Fix horizontal pie chart center text scaling and legend toggle
|
|
78
|
+
|
|
50
79
|
### 3.8.0
|
|
51
80
|
|
|
52
81
|
- Create `FileUpload` component
|
|
@@ -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,7 +14,7 @@ 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
19
|
const meta = chart.getDatasetMeta(0);
|
|
21
20
|
const controllerRadius = meta.controller.innerRadius;
|
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,12 +44,18 @@ 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);
|
|
@@ -91,6 +98,6 @@ const PieChart = (_a) => {
|
|
|
91
98
|
const chartPlugins = (0, react_1.useMemo)(() => [...(plugins || []), chartLegend, chartTooltip, chartCenterText], [chartLegend, chartTooltip, chartCenterText, plugins]);
|
|
92
99
|
const intSummary = (0, useSummary_1.useSummary)(summary, chartData);
|
|
93
100
|
const legendRight = isHorizontal;
|
|
94
|
-
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 })] }));
|
|
95
102
|
};
|
|
96
103
|
exports.PieChart = PieChart;
|
|
@@ -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
|
}
|