@geotab/zenith 2.0.0-beta.1 → 2.0.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 +35 -1
- package/dist/cards/cardsRow.d.ts +1 -2
- package/dist/cards/cardsRow.js +2 -16
- package/esm/cards/cardsRow.d.ts +1 -2
- package/esm/cards/cardsRow.js +2 -16
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -42,7 +42,41 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
42
42
|
|
|
43
43
|
### 2.0.0
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
We're excited to announce that **Zenith now supports EcmaScript Modules** (ESM)! This major release brings modern JavaScript module support to help you build better, more efficient applications.
|
|
46
|
+
|
|
47
|
+
**Why ESM Support Matters**
|
|
48
|
+
|
|
49
|
+
ESM is the modern standard for JavaScript modules in frontend development, bringing significant advantages:
|
|
50
|
+
* Superior tree-shaking: ESM's static structure enables bundlers to analyze your imports at build time and eliminate unused code more effectively, resulting in smaller bundle sizes
|
|
51
|
+
* Future-proof: ESM is the JavaScript standard moving forward, ensuring long-term compatibility
|
|
52
|
+
|
|
53
|
+
#### Important migration notes
|
|
54
|
+
|
|
55
|
+
While this major release does not include any API changes, there's a critical configuration requirement:
|
|
56
|
+
|
|
57
|
+
**Avoid Mixing Module Systems**
|
|
58
|
+
|
|
59
|
+
Your bundler must import all JavaScript files from either dist (CommonJS) or esm (ESM) — never both. Mixing imports can cause issues with React context and other shared state. Problematic example:
|
|
60
|
+
```
|
|
61
|
+
import { Button } from '@geotab/zenith'; // May use ESM
|
|
62
|
+
import { Card } from '@geotab/zenith/dist/Card'; // Uses CommonJS
|
|
63
|
+
// ❌ This mixing can break React context!
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Good example:
|
|
67
|
+
```
|
|
68
|
+
import { Button } from '@geotab/zenith'; // May use ESM
|
|
69
|
+
import { Card } from '@geotab/zenith/esm/Card'; // Uses ESM as well
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### Recommended Approach
|
|
73
|
+
|
|
74
|
+
Since many modern bundlers prioritize ESM by default, we recommend one of these strategies:
|
|
75
|
+
|
|
76
|
+
* **Use ESM** (recommended): ensure your bundler configuration prioritizes the esm directory
|
|
77
|
+
* **Use CommonJS** (for compatibility): configure your bundler to prioritize CommonJS and ensure all imports use consistent paths
|
|
78
|
+
|
|
79
|
+
Upgrade today to take advantage of modern JavaScript module support and improved tree-shaking capabilities!
|
|
46
80
|
|
|
47
81
|
### 1.26.6
|
|
48
82
|
|
package/dist/cards/cardsRow.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
import { ICards } from "./cards";
|
|
3
2
|
export interface ICardsRow extends Omit<ICards, "direction"> {
|
|
4
3
|
}
|
|
5
|
-
export declare const CardsRow:
|
|
4
|
+
export declare const CardsRow: ({ children, wrap, gap, className, paddingX, paddingY, fullHeight }: Omit<ICards, "direction">) => import("react/jsx-runtime").JSX.Element;
|
package/dist/cards/cardsRow.js
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.CardsRow = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const
|
|
17
|
-
const CardsRow = (
|
|
18
|
-
var { children } = _a, args = __rest(_a, ["children"]);
|
|
19
|
-
return (0, jsx_runtime_1.jsx)(cards_1.Cards, Object.assign({}, args, { direction: "row", children: children }));
|
|
20
|
-
};
|
|
5
|
+
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
6
|
+
const CardsRow = ({ children, wrap = true, gap = 16, className = "", paddingX = 0, paddingY = 0, fullHeight = false }) => (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-cards", className, fullHeight ? "zen-cards--full-height" : ""]), style: { flexWrap: wrap ? "wrap" : "nowrap", flexDirection: "row", gap, padding: `${paddingY}px ${paddingX}px` }, children: children });
|
|
21
7
|
exports.CardsRow = CardsRow;
|
package/esm/cards/cardsRow.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
import { ICards } from "./cards";
|
|
3
2
|
export interface ICardsRow extends Omit<ICards, "direction"> {
|
|
4
3
|
}
|
|
5
|
-
export declare const CardsRow:
|
|
4
|
+
export declare const CardsRow: ({ children, wrap, gap, className, paddingX, paddingY, fullHeight }: Omit<ICards, "direction">) => import("react/jsx-runtime").JSX.Element;
|
package/esm/cards/cardsRow.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
14
|
-
export const CardsRow = (
|
|
15
|
-
var { children } = _a, args = __rest(_a, ["children"]);
|
|
16
|
-
return _jsx(Cards, Object.assign({}, args, { direction: "row", children: children }));
|
|
17
|
-
};
|
|
2
|
+
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
3
|
+
export const CardsRow = ({ children, wrap = true, gap = 16, className = "", paddingX = 0, paddingY = 0, fullHeight = false }) => _jsx("div", { className: classNames(["zen-cards", className, fullHeight ? "zen-cards--full-height" : ""]), style: { flexWrap: wrap ? "wrap" : "nowrap", flexDirection: "row", gap, padding: `${paddingY}px ${paddingX}px` }, children: children });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geotab/zenith",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Zenith components library on React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "esm/index.d.ts",
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
"**/react-chartjs/dateAdapter.ts",
|
|
12
12
|
"**/react-chartjs/dateAdapter.js"
|
|
13
13
|
],
|
|
14
|
-
"publishConfig": {
|
|
15
|
-
"access": "public"
|
|
16
|
-
},
|
|
17
14
|
"scripts": {
|
|
18
15
|
"test": "npm run clean && npm run test-build && jest",
|
|
19
16
|
"start": "npm run storybook --loglevel verbose",
|
|
@@ -45,6 +42,7 @@
|
|
|
45
42
|
"@babel/preset-env": "^7.24.3",
|
|
46
43
|
"@babel/preset-react": "^7.24.1",
|
|
47
44
|
"@babel/preset-typescript": "^7.24.1",
|
|
45
|
+
"@storybook/addon-docs": "^9.1.15",
|
|
48
46
|
"@storybook/addon-links": "^9.1.15",
|
|
49
47
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.6",
|
|
50
48
|
"@storybook/react-webpack5": "^9.1.15",
|
|
@@ -71,8 +69,7 @@
|
|
|
71
69
|
"style-loader": "^4.0.0",
|
|
72
70
|
"typescript": "^5.4.3",
|
|
73
71
|
"webpack": "^5.96.1",
|
|
74
|
-
"xml2js": "^0.6.0"
|
|
75
|
-
"@storybook/addon-docs": "^9.1.15"
|
|
72
|
+
"xml2js": "^0.6.0"
|
|
76
73
|
},
|
|
77
74
|
"dependencies": {
|
|
78
75
|
"chart.js": "^4.4.6",
|
|
@@ -99,5 +96,8 @@
|
|
|
99
96
|
"last 1 firefox version",
|
|
100
97
|
"last 1 safari version"
|
|
101
98
|
]
|
|
99
|
+
},
|
|
100
|
+
"publishConfig": {
|
|
101
|
+
"access": "public"
|
|
102
102
|
}
|
|
103
103
|
}
|