zaravand-ui 7.1.0 → 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.
- package/README.md +9 -0
- package/dist/components/Accordion/Accordion.variant.cjs +1 -1
- package/dist/components/Accordion/Accordion.variant.js +1 -1
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Dialog/DialogDragHandle.cjs +1 -1
- package/dist/components/Dialog/DialogDragHandle.js +1 -1
- package/dist/components/Input/Input.variant.cjs +1 -1
- package/dist/components/Input/Input.variant.js +1 -1
- package/dist/components/Pagination/Pagination.variant.cjs +1 -1
- package/dist/components/Pagination/Pagination.variant.js +1 -1
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.variant.cjs +1 -1
- package/dist/components/Select/Select.variant.d.cts +1 -1
- package/dist/components/Select/Select.variant.d.ts +1 -1
- package/dist/components/Select/Select.variant.js +1 -1
- package/dist/components/Table/Table.cjs +1 -1
- package/dist/components/Table/Table.interface.d.cts +41 -0
- package/dist/components/Table/Table.interface.d.ts +41 -0
- package/dist/components/Table/Table.js +335 -318
- package/dist/components/Table/Table.utils.cjs +1 -1
- package/dist/components/Table/Table.utils.d.cts +2 -0
- package/dist/components/Table/Table.utils.d.ts +2 -0
- package/dist/components/Table/Table.utils.js +20 -16
- package/dist/components/Table/Table.variant.cjs +1 -1
- package/dist/components/Table/Table.variant.js +2 -2
- package/dist/components/Table/TableActionsContext.cjs +1 -0
- package/dist/components/Table/TableActionsContext.d.cts +26 -0
- package/dist/components/Table/TableActionsContext.d.ts +26 -0
- package/dist/components/Table/TableActionsContext.js +5 -0
- package/dist/components/Table/TableParts.cjs +1 -1
- package/dist/components/Table/TableParts.js +56 -34
- package/dist/components/Table/TableRowActions.cjs +1 -0
- package/dist/components/Table/TableRowActions.d.cts +14 -0
- package/dist/components/Table/TableRowActions.d.ts +14 -0
- package/dist/components/Table/TableRowActions.js +110 -0
- package/dist/components/Tabs/Tabs.variant.cjs +1 -1
- package/dist/components/Tabs/Tabs.variant.js +4 -4
- package/dist/components/Textarea/Textarea.variant.cjs +1 -1
- package/dist/components/Textarea/Textarea.variant.js +1 -1
- package/dist/components/TimePicker/TimePicker.variant.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.variant.js +2 -2
- package/dist/components/VerticalTabs/VerticalTabs.cjs +1 -1
- package/dist/components/VerticalTabs/VerticalTabs.js +1 -1
- package/dist/components/VerticalTabs/VerticalTabs.variant.cjs +1 -1
- package/dist/components/VerticalTabs/VerticalTabs.variant.js +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -8
- package/dist/shared/theme.cjs +1 -1
- package/dist/shared/theme.d.cts +1 -1
- package/dist/shared/theme.d.ts +1 -1
- package/dist/shared/theme.js +28 -26
- package/dist/shared/themeChannels.cjs +1 -0
- package/dist/shared/themeChannels.d.cts +3 -0
- package/dist/shared/themeChannels.d.ts +3 -0
- package/dist/shared/themeChannels.js +20 -0
- package/package.json +7 -3
package/dist/index.d.cts
CHANGED
|
@@ -46,7 +46,8 @@ export { default as Switch } from "./components/Switch/Switch.cjs";
|
|
|
46
46
|
export type { SwitchProps } from "./components/Switch/Switch.interface.cjs";
|
|
47
47
|
export { default as Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./components/Table/Table.cjs";
|
|
48
48
|
export { default as TableColumnFilter } from "./components/Table/TableColumnFilter.cjs";
|
|
49
|
-
export
|
|
49
|
+
export { TableActionsHead, TableRowActions } from "./components/Table/TableRowActions.cjs";
|
|
50
|
+
export type { DynamicTableRow, TableAction, TableActionsHeadProps, TableActiveSort, TableAddRowHandler, TableBodyProps, TableCellProps, TableCellSelectChangeHandler, TableCellSelectChangeHandlerInput, TableColumnAlign, TableColumnFilterProps, TableColumnViewType, TableDefaultActionOptions, TableDeleteRowHandler, TableEditRowHandler, TableFieldType, TableFieldValue, TableFilterValue, TableFilterValues, TableFooterProps, TableHeaderProps, TableHeadProps, TableImportExcelHandler, TableMutationHookResult, TablePagingMode, TablePrintHandler, TablePrintHandlerInput, TableProps, TableRowActionInput, TableRowActionsProps, TableRowId, TableRowIdResolver, TableRowProps, TableRowState, TableSchema, TableSchemaColumn, TableSchemaFilter, TableSchemaPagination, TableSchemaSort, TableSelectOption, TableSelectOptionsSource, TableSortDirection, } from "./components/Table/Table.interface.cjs";
|
|
50
51
|
export { default as VerticalTabs } from "./components/VerticalTabs/VerticalTabs.cjs";
|
|
51
52
|
export type { VerticalTabsBadgeTone, VerticalTabsItem, VerticalTabsProps, VerticalTabsVariant, } from "./components/VerticalTabs/VerticalTabs.interface.cjs";
|
|
52
53
|
export { default as Tabs } from "./components/Tabs/Tabs.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,8 @@ export { default as Switch } from "./components/Switch/Switch.js";
|
|
|
46
46
|
export type { SwitchProps } from "./components/Switch/Switch.interface.js";
|
|
47
47
|
export { default as Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./components/Table/Table.js";
|
|
48
48
|
export { default as TableColumnFilter } from "./components/Table/TableColumnFilter.js";
|
|
49
|
-
export
|
|
49
|
+
export { TableActionsHead, TableRowActions } from "./components/Table/TableRowActions.js";
|
|
50
|
+
export type { DynamicTableRow, TableAction, TableActionsHeadProps, TableActiveSort, TableAddRowHandler, TableBodyProps, TableCellProps, TableCellSelectChangeHandler, TableCellSelectChangeHandlerInput, TableColumnAlign, TableColumnFilterProps, TableColumnViewType, TableDefaultActionOptions, TableDeleteRowHandler, TableEditRowHandler, TableFieldType, TableFieldValue, TableFilterValue, TableFilterValues, TableFooterProps, TableHeaderProps, TableHeadProps, TableImportExcelHandler, TableMutationHookResult, TablePagingMode, TablePrintHandler, TablePrintHandlerInput, TableProps, TableRowActionInput, TableRowActionsProps, TableRowId, TableRowIdResolver, TableRowProps, TableRowState, TableSchema, TableSchemaColumn, TableSchemaFilter, TableSchemaPagination, TableSchemaSort, TableSelectOption, TableSelectOptionsSource, TableSortDirection, } from "./components/Table/Table.interface.js";
|
|
50
51
|
export { default as VerticalTabs } from "./components/VerticalTabs/VerticalTabs.js";
|
|
51
52
|
export type { VerticalTabsBadgeTone, VerticalTabsItem, VerticalTabsProps, VerticalTabsVariant, } from "./components/VerticalTabs/VerticalTabs.interface.js";
|
|
52
53
|
export { default as Tabs } from "./components/Tabs/Tabs.js";
|
package/dist/index.js
CHANGED
|
@@ -27,11 +27,12 @@ import Z from "./components/Switch/Switch.js";
|
|
|
27
27
|
import Q from "./components/Table/TableColumnFilter.js";
|
|
28
28
|
import { TableBody as $, TableCell as ee, TableFooter as te, TableHead as ne, TableHeader as re, TableRow as ie } from "./components/Table/TableParts.js";
|
|
29
29
|
import ae from "./components/Table/Table.js";
|
|
30
|
-
import oe from "./components/
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import ge from "./components/Toast/
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
|
|
30
|
+
import { TableActionsHead as oe, TableRowActions as se } from "./components/Table/TableRowActions.js";
|
|
31
|
+
import ce from "./components/VerticalTabs/VerticalTabs.js";
|
|
32
|
+
import le from "./components/Textarea/Textarea.js";
|
|
33
|
+
import ue from "./components/TimePicker/TimePicker.js";
|
|
34
|
+
import de, { ToastAction as fe, ToastClose as pe, ToastDescription as me, ToastProvider as he, ToastTitle as ge, ToastViewport as _e } from "./components/Toast/Toast.js";
|
|
35
|
+
import ve from "./components/Toast/ToastHost.js";
|
|
36
|
+
import ye from "./components/Toggle/Toggle.js";
|
|
37
|
+
import be from "./components/Uploader/Uploader.js";
|
|
38
|
+
export { v as Accordion, y as AccordionContent, b as AccordionItem, x as AccordionTrigger, D as Avatar, O as AvatarGroup, p as Button, k as Checkbox, S as DEFAULT_TOAST_DURATION, M as DatePicker, m as Dialog, _ as Input, N as OtpInput, C as PERSISTENT_DURATION, P as Pagination, F as RadioGroup, I as RadioGroupItem, H as Select, U as SelectContent, W as SelectGroup, G as SelectItem, K as SelectLabel, q as SelectSeparator, J as SelectTrigger, Y as SelectValue, X as Sheet, L as Skeleton, f as Spinner, Z as Switch, ae as Table, oe as TableActionsHead, $ as TableBody, ee as TableCell, Q as TableColumnFilter, te as TableFooter, ne as TableHead, re as TableHeader, ie as TableRow, se as TableRowActions, R as Tabs, z as TabsContent, B as TabsList, V as TabsTrigger, le as Textarea, ue as TimePicker, de as Toast, fe as ToastAction, pe as ToastClose, me as ToastDescription, ve as ToastHost, he as ToastProvider, ge as ToastTitle, _e as ToastViewport, ye as Toggle, h as Tooltip, g as TooltipProvider, be as Uploader, ce as VerticalTabs, u as ZUI_SCALE_CSS_VARIABLE, s as ZuiConfigProvider, d as applyScale, e as applyTheme, t as createThemeCssVariables, a as enMessages, o as faMessages, A as formatPersianDate, j as formatPersianDateRangeLabel, w as hasToastListeners, l as localizeDigits, n as resolveTheme, T as showToast, E as subscribeToast, r as theme, i as themeCssVariables, c as useZuiConfig };
|
package/dist/shared/theme.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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;
|
package/dist/shared/theme.d.cts
CHANGED
|
@@ -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"
|
|
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;
|
package/dist/shared/theme.d.ts
CHANGED
|
@@ -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"
|
|
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;
|
package/dist/shared/theme.js
CHANGED
|
@@ -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
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
...
|
|
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
|
-
...
|
|
11
|
-
tooltipSurface:
|
|
11
|
+
...t,
|
|
12
|
+
tooltipSurface: t.tooltipSurface ?? t.mutedSurface
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
"--zui-color-
|
|
18
|
-
"--zui-color-
|
|
19
|
-
"--zui-color-
|
|
20
|
-
"--zui-color-
|
|
21
|
-
"--zui-color-
|
|
22
|
-
"--zui-color-
|
|
23
|
-
"--zui-color-
|
|
24
|
-
"--zui-color-surface":
|
|
25
|
-
"--zui-color-
|
|
26
|
-
"--zui-color-
|
|
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
|
|
31
|
-
let
|
|
32
|
-
if (!a) return
|
|
33
|
-
for (let [e, t] of Object.entries(
|
|
34
|
-
return t.mode && (a.classList.remove(...
|
|
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 {
|
|
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,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.
|
|
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",
|