zaravand-ui 7.1.1 → 7.1.2

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 (39) hide show
  1. package/README.md +9 -0
  2. package/dist/components/Accordion/Accordion.variant.cjs +1 -1
  3. package/dist/components/Accordion/Accordion.variant.js +1 -1
  4. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  5. package/dist/components/DatePicker/DatePicker.js +1 -1
  6. package/dist/components/Dialog/DialogDragHandle.cjs +1 -1
  7. package/dist/components/Dialog/DialogDragHandle.js +1 -1
  8. package/dist/components/Input/Input.variant.cjs +1 -1
  9. package/dist/components/Input/Input.variant.js +1 -1
  10. package/dist/components/Pagination/Pagination.variant.cjs +1 -1
  11. package/dist/components/Pagination/Pagination.variant.js +1 -1
  12. package/dist/components/Select/Select.cjs +1 -1
  13. package/dist/components/Select/Select.js +1 -1
  14. package/dist/components/Select/Select.variant.cjs +1 -1
  15. package/dist/components/Select/Select.variant.d.cts +1 -1
  16. package/dist/components/Select/Select.variant.d.ts +1 -1
  17. package/dist/components/Select/Select.variant.js +1 -1
  18. package/dist/components/Table/Table.variant.cjs +1 -1
  19. package/dist/components/Table/Table.variant.js +2 -2
  20. package/dist/components/Tabs/Tabs.variant.cjs +1 -1
  21. package/dist/components/Tabs/Tabs.variant.js +4 -4
  22. package/dist/components/Textarea/Textarea.variant.cjs +1 -1
  23. package/dist/components/Textarea/Textarea.variant.js +1 -1
  24. package/dist/components/TimePicker/TimePicker.variant.cjs +1 -1
  25. package/dist/components/TimePicker/TimePicker.variant.js +2 -2
  26. package/dist/components/VerticalTabs/VerticalTabs.cjs +1 -1
  27. package/dist/components/VerticalTabs/VerticalTabs.js +1 -1
  28. package/dist/components/VerticalTabs/VerticalTabs.variant.cjs +1 -1
  29. package/dist/components/VerticalTabs/VerticalTabs.variant.js +5 -5
  30. package/dist/index.css +1 -1
  31. package/dist/shared/theme.cjs +1 -1
  32. package/dist/shared/theme.d.cts +1 -1
  33. package/dist/shared/theme.d.ts +1 -1
  34. package/dist/shared/theme.js +28 -26
  35. package/dist/shared/themeChannels.cjs +1 -0
  36. package/dist/shared/themeChannels.d.cts +3 -0
  37. package/dist/shared/themeChannels.d.ts +3 -0
  38. package/dist/shared/themeChannels.js +20 -0
  39. package/package.json +7 -3
@@ -1 +1 @@
1
- var e=require(`./theme.json.cjs`).default,t=[`theme-light`,`theme-dark`],n=[`zui-theme-light`,`zui-theme-dark`],r=a(),i=o();function a(t={}){let n={...e,...t};return{...n,tooltipSurface:n.tooltipSurface??n.mutedSurface}}function o(e={}){let t=a(e);return{"--zui-color-primary":t.primary,"--zui-color-secondary":t.secondary,"--zui-color-text":t.text,"--zui-color-success":t.success,"--zui-color-warning":t.warning,"--zui-color-danger":t.danger,"--zui-color-border":t.border,"--zui-color-surface":t.surface,"--zui-color-muted-surface":t.mutedSurface,"--zui-color-tooltip-surface":t.tooltipSurface,"--zui-color-on-solid":t.surface}}function s(e={},r={}){let i=o(e),a=r.target??(typeof document<`u`?document.documentElement:void 0);if(!a)return i;for(let[e,t]of Object.entries(i))a.style.setProperty(e,t);return r.mode&&(a.classList.remove(...t,...n),a.classList.add(r.mode===`dark`?`zui-theme-dark`:`zui-theme-light`),a.setAttribute(`data-zui-theme`,r.mode)),i}exports.applyTheme=s,exports.createThemeCssVariables=o,exports.resolveTheme=a,exports.theme=r,exports.themeCssVariables=i;
1
+ const e=require(`./theme.json.cjs`),t=require(`./themeChannels.cjs`);var n=e.default,r=[`theme-light`,`theme-dark`],i=[`zui-theme-light`,`zui-theme-dark`],a=s(),o=c();function s(e={}){let t={...n,...e};return{...t,tooltipSurface:t.tooltipSurface??t.mutedSurface}}function c(e={}){let n=s(e),r={"--zui-color-primary":n.primary,"--zui-color-secondary":n.secondary,"--zui-color-text":n.text,"--zui-color-success":n.success,"--zui-color-warning":n.warning,"--zui-color-danger":n.danger,"--zui-color-border":n.border,"--zui-color-surface":n.surface,"--zui-color-muted-surface":n.mutedSurface,"--zui-color-tooltip-surface":n.tooltipSurface,"--zui-color-on-solid":n.surface};for(let[e,n]of Object.entries(r))Object.assign(r,t.createColorChannels(e,n));return r}function l(e={},t={}){let n=c(e),a=t.target??(typeof document<`u`?document.documentElement:void 0);if(!a)return n;for(let[e,t]of Object.entries(n))a.style.setProperty(e,t);return t.mode&&(a.classList.remove(...r,...i),a.classList.add(t.mode===`dark`?`zui-theme-dark`:`zui-theme-light`),a.setAttribute(`data-zui-theme`,t.mode)),n}exports.applyTheme=l,exports.createThemeCssVariables=c,exports.resolveTheme=s,exports.theme=a,exports.themeCssVariables=o;
@@ -12,7 +12,7 @@ type ThemeTokenMap = {
12
12
  };
13
13
  type ThemeOverrides = Partial<ThemeTokenMap>;
14
14
  type ThemeMode = "light" | "dark";
15
- type ThemeCssVariables = Record<"--zui-color-primary" | "--zui-color-secondary" | "--zui-color-text" | "--zui-color-success" | "--zui-color-warning" | "--zui-color-danger" | "--zui-color-border" | "--zui-color-surface" | "--zui-color-muted-surface" | "--zui-color-tooltip-surface" | "--zui-color-on-solid", string>;
15
+ type ThemeCssVariables = Record<"--zui-color-primary" | "--zui-color-secondary" | "--zui-color-text" | "--zui-color-success" | "--zui-color-warning" | "--zui-color-danger" | "--zui-color-border" | "--zui-color-surface" | "--zui-color-muted-surface" | "--zui-color-tooltip-surface" | "--zui-color-on-solid" | `--zui-color-${string}-${"r" | "g" | "b" | "a"}`, string>;
16
16
  type ApplyThemeOptions = {
17
17
  mode?: ThemeMode;
18
18
  target?: HTMLElement;
@@ -12,7 +12,7 @@ type ThemeTokenMap = {
12
12
  };
13
13
  type ThemeOverrides = Partial<ThemeTokenMap>;
14
14
  type ThemeMode = "light" | "dark";
15
- type ThemeCssVariables = Record<"--zui-color-primary" | "--zui-color-secondary" | "--zui-color-text" | "--zui-color-success" | "--zui-color-warning" | "--zui-color-danger" | "--zui-color-border" | "--zui-color-surface" | "--zui-color-muted-surface" | "--zui-color-tooltip-surface" | "--zui-color-on-solid", string>;
15
+ type ThemeCssVariables = Record<"--zui-color-primary" | "--zui-color-secondary" | "--zui-color-text" | "--zui-color-success" | "--zui-color-warning" | "--zui-color-danger" | "--zui-color-border" | "--zui-color-surface" | "--zui-color-muted-surface" | "--zui-color-tooltip-surface" | "--zui-color-on-solid" | `--zui-color-${string}-${"r" | "g" | "b" | "a"}`, string>;
16
16
  type ApplyThemeOptions = {
17
17
  mode?: ThemeMode;
18
18
  target?: HTMLElement;
@@ -1,37 +1,39 @@
1
1
  import e from "./theme.json.js";
2
+ import { createColorChannels as t } from "./themeChannels.js";
2
3
  //#region src/shared/theme.ts
3
- var t = e, n = ["theme-light", "theme-dark"], r = ["zui-theme-light", "zui-theme-dark"], i = o(), a = s();
4
- function o(e = {}) {
5
- let n = {
6
- ...t,
4
+ var n = e, r = ["theme-light", "theme-dark"], i = ["zui-theme-light", "zui-theme-dark"], a = s(), o = c();
5
+ function s(e = {}) {
6
+ let t = {
7
+ ...n,
7
8
  ...e
8
9
  };
9
10
  return {
10
- ...n,
11
- tooltipSurface: n.tooltipSurface ?? n.mutedSurface
11
+ ...t,
12
+ tooltipSurface: t.tooltipSurface ?? t.mutedSurface
12
13
  };
13
14
  }
14
- function s(e = {}) {
15
- let t = o(e);
16
- return {
17
- "--zui-color-primary": t.primary,
18
- "--zui-color-secondary": t.secondary,
19
- "--zui-color-text": t.text,
20
- "--zui-color-success": t.success,
21
- "--zui-color-warning": t.warning,
22
- "--zui-color-danger": t.danger,
23
- "--zui-color-border": t.border,
24
- "--zui-color-surface": t.surface,
25
- "--zui-color-muted-surface": t.mutedSurface,
26
- "--zui-color-tooltip-surface": t.tooltipSurface,
27
- "--zui-color-on-solid": t.surface
15
+ function c(e = {}) {
16
+ let n = s(e), r = {
17
+ "--zui-color-primary": n.primary,
18
+ "--zui-color-secondary": n.secondary,
19
+ "--zui-color-text": n.text,
20
+ "--zui-color-success": n.success,
21
+ "--zui-color-warning": n.warning,
22
+ "--zui-color-danger": n.danger,
23
+ "--zui-color-border": n.border,
24
+ "--zui-color-surface": n.surface,
25
+ "--zui-color-muted-surface": n.mutedSurface,
26
+ "--zui-color-tooltip-surface": n.tooltipSurface,
27
+ "--zui-color-on-solid": n.surface
28
28
  };
29
+ for (let [e, n] of Object.entries(r)) Object.assign(r, t(e, n));
30
+ return r;
29
31
  }
30
- function c(e = {}, t = {}) {
31
- let i = s(e), a = t.target ?? (typeof document < "u" ? document.documentElement : void 0);
32
- if (!a) return i;
33
- for (let [e, t] of Object.entries(i)) a.style.setProperty(e, t);
34
- return t.mode && (a.classList.remove(...n, ...r), a.classList.add(t.mode === "dark" ? "zui-theme-dark" : "zui-theme-light"), a.setAttribute("data-zui-theme", t.mode)), i;
32
+ function l(e = {}, t = {}) {
33
+ let n = c(e), a = t.target ?? (typeof document < "u" ? document.documentElement : void 0);
34
+ if (!a) return n;
35
+ for (let [e, t] of Object.entries(n)) a.style.setProperty(e, t);
36
+ return t.mode && (a.classList.remove(...r, ...i), a.classList.add(t.mode === "dark" ? "zui-theme-dark" : "zui-theme-light"), a.setAttribute("data-zui-theme", t.mode)), n;
35
37
  }
36
38
  //#endregion
37
- export { c as applyTheme, s as createThemeCssVariables, o as resolveTheme, i as theme, a as themeCssVariables };
39
+ export { l as applyTheme, c as createThemeCssVariables, s as resolveTheme, a as theme, o as themeCssVariables };
@@ -0,0 +1 @@
1
+ const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`colord`),n=require(`colord/plugins/names`);n=e.__toESM(n,1),(0,t.extend)([n.default]);var r=[`r`,`g`,`b`,`a`];function i(e,n){let i=n.trim().match(/^var\(\s*(--[\w-]+)\s*\)$/);if(i)return Object.fromEntries(r.map(t=>[`${e}-${t}`,`var(${i[1]}-${t})`]));let a=(0,t.colord)(n);if(!a.isValid())throw TypeError(`Invalid theme color for ${e}: ${n}`);let o=a.rgba;return Object.fromEntries(r.map(t=>[`${e}-${t}`,String(o[t])]))}exports.createColorChannels=i;
@@ -0,0 +1,3 @@
1
+ /** RGB channels let CSS combine runtime palettes without color-mix() or relative colors. */
2
+ declare function createColorChannels(name: string, value: string): Record<string, string>;
3
+ export { createColorChannels };
@@ -0,0 +1,3 @@
1
+ /** RGB channels let CSS combine runtime palettes without color-mix() or relative colors. */
2
+ declare function createColorChannels(name: string, value: string): Record<string, string>;
3
+ export { createColorChannels };
@@ -0,0 +1,20 @@
1
+ import { colord as e, extend as t } from "colord";
2
+ import n from "colord/plugins/names";
3
+ //#region src/shared/themeChannels.ts
4
+ t([n]);
5
+ var r = [
6
+ "r",
7
+ "g",
8
+ "b",
9
+ "a"
10
+ ];
11
+ function i(t, n) {
12
+ let i = n.trim().match(/^var\(\s*(--[\w-]+)\s*\)$/);
13
+ if (i) return Object.fromEntries(r.map((e) => [`${t}-${e}`, `var(${i[1]}-${e})`]));
14
+ let a = e(n);
15
+ if (!a.isValid()) throw TypeError(`Invalid theme color for ${t}: ${n}`);
16
+ let o = a.rgba;
17
+ return Object.fromEntries(r.map((e) => [`${t}-${e}`, String(o[e])]));
18
+ }
19
+ //#endregion
20
+ export { i as createColorChannels };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zaravand-ui",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -30,9 +30,10 @@
30
30
  "dev": "vite",
31
31
  "dev:lib": "vite build --watch",
32
32
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
33
- "build": "npm run clean && npm run generate:theme && vite build && tsc -p tsconfig.build.json && node scripts/finalize-types.mjs",
34
- "build:demo": "vite build --config vite.demo.config.ts",
33
+ "build": "npm run clean && npm run generate:theme && vite build && tsc -p tsconfig.build.json && node scripts/finalize-types.mjs && npm run check:compat",
34
+ "build:demo": "npm run generate:theme && vite build --config vite.demo.config.ts && node scripts/check-browser-compatibility.mjs --demo",
35
35
  "check:package": "publint --strict && attw --pack . --exclude-entrypoints styles.css",
36
+ "check:compat": "node scripts/check-browser-compatibility.mjs",
36
37
  "prepublishOnly": "npm run build && npm run check:package",
37
38
  "lint": "eslint .",
38
39
  "test": "vitest run",
@@ -57,6 +58,7 @@
57
58
  "@tanstack/react-virtual": "^3.14.25",
58
59
  "class-variance-authority": "^0.7.1",
59
60
  "clsx": "^2.1.1",
61
+ "colord": "^2.14.0",
60
62
  "lucide-react": "^1.12.0",
61
63
  "react-day-picker": "^9.11.1",
62
64
  "tailwind-merge": "^3.7.0"
@@ -83,6 +85,8 @@
83
85
  "eslint-plugin-react-refresh": "^0.5.2",
84
86
  "globals": "^17.5.0",
85
87
  "jsdom": "^29.1.1",
88
+ "lightningcss": "1.32.0",
89
+ "postcss": "8.5.15",
86
90
  "prettier": "^3.9.9",
87
91
  "publint": "^0.3.24",
88
92
  "react": "^19.2.5",