@rinzai/zen 0.6.0 → 0.7.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/LICENSE +27 -0
- package/README.md +12 -4
- package/dist/alert/index.d.ts +21 -0
- package/dist/alert/index.d.ts.map +1 -0
- package/dist/alert/index.js +49 -0
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.js +43 -12
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +86 -85
- package/dist/chart/donut.d.ts +4 -1
- package/dist/chart/donut.d.ts.map +1 -1
- package/dist/chart/donut.js +81 -60
- package/dist/chart/index.d.ts +8 -2
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.js +151 -139
- package/dist/chart/palette.d.ts +11 -0
- package/dist/chart/palette.d.ts.map +1 -0
- package/dist/chart/palette.js +9 -0
- package/dist/chart/tooltip.d.ts +6 -2
- package/dist/chart/tooltip.d.ts.map +1 -1
- package/dist/chart/tooltip.js +6 -6
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +28 -44
- package/dist/chip/index.js +1 -1
- package/dist/code-block/index.js +1 -1
- package/dist/combobox/index.d.ts.map +1 -1
- package/dist/combobox/index.js +93 -91
- package/dist/date-picker/index.d.ts.map +1 -1
- package/dist/date-picker/index.js +24 -38
- package/dist/disclosure/index.js +1 -1
- package/dist/editable-cell/index.js +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +33 -32
- package/dist/header/index.d.ts +9 -1
- package/dist/header/index.d.ts.map +1 -1
- package/dist/header/index.js +17 -9
- package/dist/icons/arrow-left.d.ts +3 -0
- package/dist/icons/arrow-left.d.ts.map +1 -0
- package/dist/icons/arrow-right.d.ts +3 -0
- package/dist/icons/arrow-right.d.ts.map +1 -0
- package/dist/icons/bars.d.ts +3 -0
- package/dist/icons/bars.d.ts.map +1 -0
- package/dist/icons/calendar.d.ts +3 -0
- package/dist/icons/calendar.d.ts.map +1 -0
- package/dist/icons/chart-bar.d.ts +3 -0
- package/dist/icons/chart-bar.d.ts.map +1 -0
- package/dist/icons/chevron-down.d.ts.map +1 -1
- package/dist/icons/chevron-down.js +4 -2
- package/dist/icons/chevron-left.d.ts.map +1 -1
- package/dist/icons/chevron-left.js +4 -2
- package/dist/icons/chevron-right.d.ts.map +1 -1
- package/dist/icons/chevron-right.js +4 -2
- package/dist/icons/chevron-up.d.ts.map +1 -1
- package/dist/icons/chevron-up.js +4 -2
- package/dist/icons/ellipsis.d.ts +0 -1
- package/dist/icons/ellipsis.d.ts.map +1 -1
- package/dist/icons/flag.d.ts +3 -0
- package/dist/icons/flag.d.ts.map +1 -0
- package/dist/icons/list-bullet.d.ts +3 -0
- package/dist/icons/list-bullet.d.ts.map +1 -0
- package/dist/icons/lock.d.ts +3 -0
- package/dist/icons/lock.d.ts.map +1 -0
- package/dist/icons/logout.d.ts +3 -0
- package/dist/icons/logout.d.ts.map +1 -0
- package/dist/icons/micro/calendar.d.ts +3 -0
- package/dist/icons/micro/calendar.d.ts.map +1 -0
- package/dist/icons/micro/calendar.js +21 -0
- package/dist/icons/micro/check.d.ts +3 -0
- package/dist/icons/micro/check.d.ts.map +1 -0
- package/dist/icons/micro/check.js +21 -0
- package/dist/icons/micro/chevron-down.d.ts +3 -0
- package/dist/icons/micro/chevron-down.d.ts.map +1 -0
- package/dist/icons/micro/chevron-down.js +21 -0
- package/dist/icons/micro/chevron-right.d.ts +3 -0
- package/dist/icons/micro/chevron-right.d.ts.map +1 -0
- package/dist/icons/micro/chevron-right.js +21 -0
- package/dist/icons/micro/exclamation-triangle.d.ts +3 -0
- package/dist/icons/micro/exclamation-triangle.d.ts.map +1 -0
- package/dist/icons/micro/exclamation-triangle.js +21 -0
- package/dist/icons/micro/information-circle.d.ts +3 -0
- package/dist/icons/micro/information-circle.d.ts.map +1 -0
- package/dist/icons/micro/information-circle.js +21 -0
- package/dist/icons/micro/minus.d.ts +3 -0
- package/dist/icons/micro/minus.d.ts.map +1 -0
- package/dist/icons/micro/minus.js +17 -0
- package/dist/icons/micro/moon.d.ts +3 -0
- package/dist/icons/micro/moon.d.ts.map +1 -0
- package/dist/icons/micro/moon.js +17 -0
- package/dist/icons/micro/sun.d.ts +3 -0
- package/dist/icons/micro/sun.d.ts.map +1 -0
- package/dist/icons/micro/sun.js +17 -0
- package/dist/icons/micro/x-mark.d.ts +3 -0
- package/dist/icons/micro/x-mark.d.ts.map +1 -0
- package/dist/icons/micro/x-mark.js +17 -0
- package/dist/icons/search.d.ts.map +1 -1
- package/dist/icons/search.js +4 -2
- package/dist/icons/settings.d.ts +3 -0
- package/dist/icons/settings.d.ts.map +1 -0
- package/dist/icons/squares.d.ts +3 -0
- package/dist/icons/squares.d.ts.map +1 -0
- package/dist/icons/table.d.ts +3 -0
- package/dist/icons/table.d.ts.map +1 -0
- package/dist/icons/x-mark.d.ts.map +1 -1
- package/dist/icons/x-mark.js +4 -2
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/lib.js +56 -61
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +67 -60
- package/dist/meter/index.d.ts +4 -3
- package/dist/meter/index.d.ts.map +1 -1
- package/dist/meter/index.js +9 -8
- package/dist/money-input/index.d.ts +7 -8
- package/dist/money-input/index.d.ts.map +1 -1
- package/dist/money-input/index.js +37 -19
- package/dist/month-picker/index.d.ts.map +1 -1
- package/dist/month-picker/index.js +55 -55
- package/dist/pills/index.d.ts +1 -1
- package/dist/pills/index.d.ts.map +1 -1
- package/dist/pills/index.js +6 -2
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +15 -13
- package/dist/select/index.d.ts.map +1 -1
- package/dist/select/index.js +96 -102
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +1 -1
- package/dist/status-pill/index.d.ts +18 -0
- package/dist/status-pill/index.d.ts.map +1 -0
- package/dist/status-pill/index.js +25 -0
- package/dist/tab-bar/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +9 -5
- package/dist/theme-toggle/index.d.ts +2 -1
- package/dist/theme-toggle/index.d.ts.map +1 -1
- package/dist/theme-toggle/index.js +35 -32
- package/dist/theme.css +81 -19
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +119 -106
- package/dist/tooltip/index.d.ts.map +1 -1
- package/dist/tooltip/index.js +45 -43
- package/dist/tree/index.d.ts +22 -3
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +76 -56
- package/dist/utils/date.d.ts +6 -4
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +18 -16
- package/dist/utils/field-chevron.d.ts.map +1 -1
- package/dist/utils/field-chevron.js +5 -14
- package/dist/utils/status-icons.d.ts +1 -1
- package/dist/utils/status-icons.d.ts.map +1 -1
- package/dist/utils/status-icons.js +11 -41
- package/dist/utils/styles.d.ts +9 -3
- package/dist/utils/styles.d.ts.map +1 -1
- package/dist/utils/styles.js +2 -2
- package/dist/utils/theme-wave.d.ts +24 -0
- package/dist/utils/theme-wave.d.ts.map +1 -0
- package/dist/utils/theme-wave.js +219 -0
- package/dist/utils/typeahead.d.ts +12 -0
- package/dist/utils/typeahead.d.ts.map +1 -0
- package/dist/utils/typeahead.js +19 -0
- package/dist/utils/useAnchoredPopup.d.ts +23 -7
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
- package/dist/utils/useAnchoredPopup.js +86 -30
- package/dist/zen.css +1 -1
- package/package.json +2 -1
- package/dist/icons/ellipsis.js +0 -31
- package/dist/icons/index.d.ts +0 -9
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/status.d.ts +0 -2
- package/dist/icons/status.d.ts.map +0 -1
package/dist/tooltip/index.js
CHANGED
|
@@ -2,86 +2,87 @@
|
|
|
2
2
|
import { cx as e } from "../utils/cx.js";
|
|
3
3
|
import { useGraphicsMode as t } from "../utils/graphics.js";
|
|
4
4
|
import { Slot as n } from "../utils/slot.js";
|
|
5
|
-
import {
|
|
6
|
-
import { POPUP as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { jsx as
|
|
5
|
+
import { anchorFor as r, anchoredStyle as i, useAnchorFallback as a } from "../utils/useAnchoredPopup.js";
|
|
6
|
+
import { POPUP as o } from "../utils/styles.js";
|
|
7
|
+
import { createContext as s, useCallback as c, useContext as l, useEffect as u, useId as d, useMemo as f, useRef as p } from "react";
|
|
8
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
9
9
|
//#region packages/tooltip/index.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let t =
|
|
10
|
+
var h = s(null);
|
|
11
|
+
function g(e) {
|
|
12
|
+
let t = l(h);
|
|
13
13
|
if (!t) throw Error(`<${e}> must be inside <Tooltip>`);
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function _({ children: e }) {
|
|
17
17
|
t();
|
|
18
|
-
let n = `zen__tooltip-${
|
|
18
|
+
let n = `zen__tooltip-${d().replace(/[^\w-]/g, "")}`, r = p(null), i = p(0), o = c(() => {
|
|
19
19
|
clearTimeout(i.current);
|
|
20
20
|
try {
|
|
21
21
|
r.current?.showPopover?.();
|
|
22
22
|
} catch {}
|
|
23
|
-
}, []), s =
|
|
23
|
+
}, []), s = c(() => {
|
|
24
24
|
clearTimeout(i.current);
|
|
25
25
|
try {
|
|
26
26
|
r.current?.hidePopover?.();
|
|
27
27
|
} catch {}
|
|
28
|
-
}, []),
|
|
28
|
+
}, []), l = c(() => {
|
|
29
29
|
clearTimeout(i.current), i.current = window.setTimeout(s, 100);
|
|
30
30
|
}, [s]);
|
|
31
|
-
|
|
32
|
-
let
|
|
31
|
+
u(() => () => clearTimeout(i.current), []), a(r);
|
|
32
|
+
let g = f(() => ({
|
|
33
33
|
id: n,
|
|
34
34
|
ref: r,
|
|
35
|
-
show:
|
|
35
|
+
show: o,
|
|
36
36
|
hide: s,
|
|
37
|
-
hideSoon:
|
|
37
|
+
hideSoon: l
|
|
38
38
|
}), [
|
|
39
39
|
n,
|
|
40
|
-
|
|
40
|
+
o,
|
|
41
41
|
s,
|
|
42
|
-
|
|
42
|
+
l
|
|
43
43
|
]);
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
value:
|
|
44
|
+
return /* @__PURE__ */ m(h.Provider, {
|
|
45
|
+
value: g,
|
|
46
46
|
children: e
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let
|
|
51
|
-
"aria-describedby":
|
|
52
|
-
...
|
|
49
|
+
function v({ asChild: e, style: t, onPointerEnter: i, onPointerLeave: a, onFocus: o, onBlur: s, onKeyDown: c, children: l, ...u }) {
|
|
50
|
+
let d = g("TooltipTrigger"), f = {
|
|
51
|
+
"aria-describedby": d.id,
|
|
52
|
+
...u,
|
|
53
|
+
...r(d.id),
|
|
53
54
|
style: {
|
|
54
|
-
|
|
55
|
+
...r(d.id).style,
|
|
55
56
|
...t
|
|
56
57
|
},
|
|
57
58
|
onPointerEnter: (e) => {
|
|
58
|
-
|
|
59
|
+
i?.(e), e.pointerType === "mouse" && d.show();
|
|
59
60
|
},
|
|
60
61
|
onPointerLeave: (e) => {
|
|
61
|
-
|
|
62
|
+
a?.(e), d.hideSoon();
|
|
62
63
|
},
|
|
63
64
|
onFocus: (e) => {
|
|
64
|
-
|
|
65
|
+
o?.(e), e.currentTarget.matches(":focus-visible") && d.show();
|
|
65
66
|
},
|
|
66
67
|
onBlur: (e) => {
|
|
67
|
-
|
|
68
|
+
s?.(e), d.hide();
|
|
68
69
|
},
|
|
69
70
|
onKeyDown: (e) => {
|
|
70
|
-
|
|
71
|
+
c?.(e), e.key === "Escape" && d.hide();
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
return e ? /* @__PURE__ */
|
|
74
|
-
...
|
|
75
|
-
children:
|
|
76
|
-
}) : /* @__PURE__ */
|
|
74
|
+
return e ? /* @__PURE__ */ m(n, {
|
|
75
|
+
...f,
|
|
76
|
+
children: l
|
|
77
|
+
}) : /* @__PURE__ */ m("button", {
|
|
77
78
|
type: "button",
|
|
78
|
-
...
|
|
79
|
-
children:
|
|
79
|
+
...f,
|
|
80
|
+
children: l
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
let d =
|
|
84
|
-
return /* @__PURE__ */
|
|
83
|
+
function y({ align: t = "center", offset: n = 5, className: r, style: a, onPointerEnter: s, onPointerLeave: c, children: l, ...u }) {
|
|
84
|
+
let d = g("TooltipContent");
|
|
85
|
+
return /* @__PURE__ */ m("div", {
|
|
85
86
|
...u,
|
|
86
87
|
ref: d.ref,
|
|
87
88
|
id: d.id,
|
|
@@ -94,15 +95,16 @@ function _({ align: t = "center", offset: n = 5, className: a, style: o, onPoint
|
|
|
94
95
|
c?.(e), d.hideSoon();
|
|
95
96
|
},
|
|
96
97
|
style: {
|
|
97
|
-
...
|
|
98
|
+
...i(d.id, {
|
|
98
99
|
align: t,
|
|
99
|
-
offset: n
|
|
100
|
+
offset: n,
|
|
101
|
+
width: "at-least"
|
|
100
102
|
}),
|
|
101
|
-
...
|
|
103
|
+
...a
|
|
102
104
|
},
|
|
103
|
-
className: e("zen__popover fixed z-50
|
|
105
|
+
className: e("zen__popover fixed z-50 overflow-visible p-0", o, r),
|
|
104
106
|
children: l
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
109
|
//#endregion
|
|
108
|
-
export {
|
|
110
|
+
export { y as TooltipContent, v as TooltipTrigger, _ as default };
|
package/dist/tree/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableCellProps } from '../table';
|
|
2
|
-
import { ComponentProps, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ComponentProps, CSSProperties, FocusEvent, KeyboardEvent, ReactNode } from 'react';
|
|
3
3
|
/** One visible row of a tree. */
|
|
4
4
|
export interface TreeRowData<T> {
|
|
5
5
|
item: T;
|
|
@@ -9,11 +9,19 @@ export interface TreeRowData<T> {
|
|
|
9
9
|
parentKey: string | null;
|
|
10
10
|
hasChildren: boolean;
|
|
11
11
|
expanded: boolean;
|
|
12
|
+
/** Its place among its siblings (1-based), and how many siblings there are. */
|
|
13
|
+
position: number;
|
|
14
|
+
siblings: number;
|
|
12
15
|
}
|
|
13
16
|
/**
|
|
14
17
|
* Headless tree for tables and lists: turns nested items into the rows that
|
|
15
18
|
* are visible (children of collapsed rows are skipped), and expands/collapses
|
|
16
19
|
* them. With the Tree* parts, children grow in and shrink away smoothly.
|
|
20
|
+
*
|
|
21
|
+
* Put `tree.tableProps` on the Table: it's then a tree grid (WAI-ARIA), one tab
|
|
22
|
+
* stop whose rows the keyboard moves between. Up and Down go row to row, Home
|
|
23
|
+
* and End to the first and last, Right opens a row (or goes to its first
|
|
24
|
+
* child), Left closes it (or goes to its parent).
|
|
17
25
|
*/
|
|
18
26
|
export declare function useTree<T>({ items, getKey, getChildren, defaultExpanded, rowHeight }: UseTreeOptions<T>): {
|
|
19
27
|
rows: TreeRowData<T>[];
|
|
@@ -25,10 +33,20 @@ export declare function useTree<T>({ items, getKey, getChildren, defaultExpanded
|
|
|
25
33
|
expandAll: () => void;
|
|
26
34
|
/** Closes every row. */
|
|
27
35
|
collapseAll: () => void;
|
|
36
|
+
/** For the Table: a tree grid. */
|
|
37
|
+
tableProps: {
|
|
38
|
+
role: "treegrid";
|
|
39
|
+
};
|
|
28
40
|
rowProps: (row: TreeRowData<T>) => {
|
|
29
41
|
'aria-level': number;
|
|
30
42
|
'aria-expanded': boolean | undefined;
|
|
43
|
+
'aria-posinset': number;
|
|
44
|
+
'aria-setsize': number;
|
|
31
45
|
'data-depth': number;
|
|
46
|
+
'data-tree-key': string;
|
|
47
|
+
tabIndex: number;
|
|
48
|
+
onFocus: (e: FocusEvent<HTMLElement>) => void;
|
|
49
|
+
onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
32
50
|
className: string;
|
|
33
51
|
style: CSSProperties;
|
|
34
52
|
onAnimationEnd: (e: {
|
|
@@ -38,12 +56,13 @@ export declare function useTree<T>({ items, getKey, getChildren, defaultExpanded
|
|
|
38
56
|
toggleProps: (row: TreeRowData<T>) => {
|
|
39
57
|
expanded: boolean;
|
|
40
58
|
onToggle: () => void;
|
|
59
|
+
tabIndex: number;
|
|
41
60
|
};
|
|
42
61
|
rowHeight: number;
|
|
43
62
|
};
|
|
44
63
|
export type Tree<T> = ReturnType<typeof useTree<T>>;
|
|
45
|
-
/** A table row wired to useTree: tree semantics
|
|
46
|
-
export declare function TreeRow<T>({ row, tree, className, style, ...rest }: TreeRowProps<T>): import('react').JSX.Element;
|
|
64
|
+
/** A table row wired to useTree: tree semantics, the keyboard and the open/close animation. */
|
|
65
|
+
export declare function TreeRow<T>({ row, tree, className, style, onFocus, onKeyDown, ...rest }: TreeRowProps<T>): import('react').JSX.Element;
|
|
47
66
|
/** A cell in a TreeRow: its content sits in a box whose height animates as groups open and close. */
|
|
48
67
|
export declare function TreeCell({ numeric, className, children, ...rest }: TableCellProps): import('react').JSX.Element;
|
|
49
68
|
/** The first column's content: indented by depth, with the row's toggle (or a spacer, so labels line up). */
|
package/dist/tree/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tree/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tree/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,cAAc,EAAY,MAAM,YAAY,CAAC;AAEjE,OAAO,EACH,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,SAAS,EAKZ,MAAM,OAAO,CAAC;AAEf,iCAAiC;AACjC,MAAM,WAAW,WAAW,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,MAAM,CAA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|
import { TableCell as t, TableRow as n } from "../table/index.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import r from "../icons/micro/chevron-right.js";
|
|
5
|
+
import { useCallback as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
7
|
//#region packages/tree/index.tsx
|
|
7
|
-
function
|
|
8
|
-
let [u, d] =
|
|
9
|
-
let e = [],
|
|
10
|
-
|
|
11
|
-
let
|
|
8
|
+
function u({ items: t, getKey: n, getChildren: r, defaultExpanded: c = !0, rowHeight: l = 36 }) {
|
|
9
|
+
let [u, d] = s(() => /* @__PURE__ */ new Set()), [f, p] = s(null), [m, h] = s(null), g = o(null), _ = i((e) => u.has(e) !== c, [u, c]), v = a(() => {
|
|
10
|
+
let e = [], i = (t, a, o) => {
|
|
11
|
+
t.forEach((s, c) => {
|
|
12
|
+
let l = n(s), u = r(s), d = !!u?.length, f = d && _(l);
|
|
12
13
|
e.push({
|
|
13
|
-
item:
|
|
14
|
-
key:
|
|
15
|
-
depth:
|
|
16
|
-
parentKey:
|
|
17
|
-
hasChildren:
|
|
18
|
-
expanded:
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
item: s,
|
|
15
|
+
key: l,
|
|
16
|
+
depth: a,
|
|
17
|
+
parentKey: o,
|
|
18
|
+
hasChildren: d,
|
|
19
|
+
expanded: f,
|
|
20
|
+
position: c + 1,
|
|
21
|
+
siblings: t.length
|
|
22
|
+
}), f && i(u, a + 1, l);
|
|
23
|
+
});
|
|
21
24
|
};
|
|
22
|
-
return
|
|
25
|
+
return i(t, 0, null), e;
|
|
23
26
|
}, [
|
|
24
27
|
t,
|
|
25
28
|
n,
|
|
26
|
-
|
|
29
|
+
r,
|
|
27
30
|
_
|
|
28
31
|
]), y = () => {
|
|
29
|
-
let e = [],
|
|
30
|
-
for (let
|
|
31
|
-
let t =
|
|
32
|
-
t?.length && (e.push(n(
|
|
32
|
+
let e = [], i = (t) => {
|
|
33
|
+
for (let a of t) {
|
|
34
|
+
let t = r(a);
|
|
35
|
+
t?.length && (e.push(n(a)), i(t));
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
|
-
return
|
|
36
|
-
}, b =
|
|
38
|
+
return i(t), e;
|
|
39
|
+
}, b = i((e, t) => d((n) => {
|
|
37
40
|
let r = new Set(n);
|
|
38
41
|
return t === c ? r.delete(e) : r.add(e), r;
|
|
39
42
|
}), [c]), x = () => typeof window < "u" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || document.documentElement.classList.contains("reduce-motion")), S = (e) => {
|
|
@@ -54,6 +57,17 @@ function l({ items: t, getKey: n, getChildren: s, defaultExpanded: c = !0, rowHe
|
|
|
54
57
|
};
|
|
55
58
|
g.current = t, setTimeout(t, 500);
|
|
56
59
|
}
|
|
60
|
+
}, [C, w] = s(null), T = v.some((e) => e.key === C) ? C : v[0]?.key ?? null, E = (e) => e.expanded && m !== e.key, D = (e, t) => {
|
|
61
|
+
if (t.target !== t.currentTarget) return;
|
|
62
|
+
let n = v.indexOf(e), r;
|
|
63
|
+
if (t.key === "ArrowDown") r = v[n + 1];
|
|
64
|
+
else if (t.key === "ArrowUp") r = v[n - 1];
|
|
65
|
+
else if (t.key === "Home") r = v[0];
|
|
66
|
+
else if (t.key === "End") r = v.at(-1);
|
|
67
|
+
else if (t.key === "ArrowRight" && e.hasChildren) E(e) ? r = v[n + 1] : S(e.key);
|
|
68
|
+
else if (t.key === "ArrowLeft") E(e) ? S(e.key) : r = v.find((t) => t.key === e.parentKey);
|
|
69
|
+
else return;
|
|
70
|
+
t.preventDefault(), r && t.currentTarget.closest("[role=\"treegrid\"], table")?.querySelector(`[data-tree-key="${CSS.escape(r.key)}"]`)?.focus();
|
|
57
71
|
};
|
|
58
72
|
return {
|
|
59
73
|
rows: v,
|
|
@@ -63,73 +77,79 @@ function l({ items: t, getKey: n, getChildren: s, defaultExpanded: c = !0, rowHe
|
|
|
63
77
|
collapse: (e) => b(e, !1),
|
|
64
78
|
expandAll: () => d(c ? /* @__PURE__ */ new Set() : new Set(y())),
|
|
65
79
|
collapseAll: () => d(c ? new Set(y()) : /* @__PURE__ */ new Set()),
|
|
80
|
+
tableProps: { role: "treegrid" },
|
|
66
81
|
rowProps: (t) => ({
|
|
67
82
|
"aria-level": t.depth + 1,
|
|
68
|
-
"aria-expanded": t.hasChildren ? t
|
|
83
|
+
"aria-expanded": t.hasChildren ? E(t) : void 0,
|
|
84
|
+
"aria-posinset": t.position,
|
|
85
|
+
"aria-setsize": t.siblings,
|
|
69
86
|
"data-depth": t.depth,
|
|
70
|
-
|
|
87
|
+
"data-tree-key": t.key,
|
|
88
|
+
tabIndex: t.key === T ? 0 : -1,
|
|
89
|
+
onFocus: (e) => {
|
|
90
|
+
e.target === e.currentTarget && w(t.key);
|
|
91
|
+
},
|
|
92
|
+
onKeyDown: (e) => D(t, e),
|
|
93
|
+
className: e("outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring/60", f && t.parentKey === f.key && "zen__tree-row-enter", m && t.parentKey === m && "zen__tree-row-exit"),
|
|
71
94
|
style: { "--row-h": `${l - 1}px` },
|
|
72
95
|
onAnimationEnd: (e) => {
|
|
73
96
|
e.animationName === "zen-row-close" && m && t.parentKey === m && g.current?.();
|
|
74
97
|
}
|
|
75
98
|
}),
|
|
76
99
|
toggleProps: (e) => ({
|
|
77
|
-
expanded: e
|
|
78
|
-
onToggle: () => S(e.key)
|
|
100
|
+
expanded: E(e),
|
|
101
|
+
onToggle: () => S(e.key),
|
|
102
|
+
tabIndex: -1
|
|
79
103
|
}),
|
|
80
104
|
rowHeight: l
|
|
81
105
|
};
|
|
82
106
|
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
...
|
|
87
|
-
...
|
|
88
|
-
|
|
107
|
+
function d({ row: t, tree: r, className: i, style: a, onFocus: o, onKeyDown: s, ...l }) {
|
|
108
|
+
let u = r.rowProps(t);
|
|
109
|
+
return /* @__PURE__ */ c(n, {
|
|
110
|
+
...l,
|
|
111
|
+
...u,
|
|
112
|
+
onFocus: (e) => {
|
|
113
|
+
o?.(e), u.onFocus(e);
|
|
114
|
+
},
|
|
115
|
+
onKeyDown: (e) => {
|
|
116
|
+
s?.(e), e.defaultPrevented || u.onKeyDown(e);
|
|
117
|
+
},
|
|
118
|
+
className: e(u.className, i),
|
|
89
119
|
style: {
|
|
90
|
-
...
|
|
120
|
+
...u.style,
|
|
91
121
|
...a
|
|
92
122
|
}
|
|
93
123
|
});
|
|
94
124
|
}
|
|
95
|
-
function
|
|
96
|
-
return /* @__PURE__ */
|
|
125
|
+
function f({ numeric: n, className: r, children: i, ...a }) {
|
|
126
|
+
return /* @__PURE__ */ c(t, {
|
|
97
127
|
numeric: n,
|
|
98
128
|
className: e("py-0 whitespace-nowrap", r),
|
|
99
129
|
...a,
|
|
100
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ c("div", {
|
|
101
131
|
className: e("zen__tree-cell flex h-[var(--row-h)] items-center", n && "justify-end"),
|
|
102
132
|
children: i
|
|
103
133
|
})
|
|
104
134
|
});
|
|
105
135
|
}
|
|
106
|
-
function
|
|
107
|
-
return /* @__PURE__ */
|
|
136
|
+
function p({ row: t, tree: n, indent: r = 20, children: i, className: a }) {
|
|
137
|
+
return /* @__PURE__ */ l("div", {
|
|
108
138
|
className: e("flex min-w-0 flex-1 items-center gap-1", a),
|
|
109
139
|
style: { paddingLeft: t.depth * r },
|
|
110
|
-
children: [t.hasChildren ? /* @__PURE__ */
|
|
140
|
+
children: [t.hasChildren ? /* @__PURE__ */ c(m, { ...n.toggleProps(t) }) : /* @__PURE__ */ c("span", { className: "-ml-1 w-6 shrink-0" }), i]
|
|
111
141
|
});
|
|
112
142
|
}
|
|
113
|
-
function
|
|
114
|
-
return /* @__PURE__ */
|
|
143
|
+
function m({ expanded: t, onToggle: n, className: i, ...a }) {
|
|
144
|
+
return /* @__PURE__ */ c("button", {
|
|
115
145
|
type: "button",
|
|
116
146
|
onClick: n,
|
|
117
147
|
"aria-label": t ? "Collapse" : "Expand",
|
|
118
148
|
"aria-expanded": t,
|
|
119
|
-
className: e("text-muted-foreground hover:bg-tint/[0.08] hover:text-foreground focus-visible:ring-ring/50 -ml-1 grid size-6 shrink-0 place-items-center rounded-md outline-hidden transition-colors focus-visible:ring-2",
|
|
120
|
-
...
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
viewBox: "0 0 16 16",
|
|
123
|
-
fill: "none",
|
|
124
|
-
stroke: "currentColor",
|
|
125
|
-
strokeWidth: "2",
|
|
126
|
-
strokeLinecap: "round",
|
|
127
|
-
strokeLinejoin: "round",
|
|
128
|
-
"aria-hidden": !0,
|
|
129
|
-
className: e("size-4 transition-transform duration-200 ease-out", t && "rotate-90"),
|
|
130
|
-
children: /* @__PURE__ */ s("path", { d: "m6 3.5 4.5 4.5L6 12.5" })
|
|
131
|
-
})
|
|
149
|
+
className: e("text-muted-foreground hover:bg-tint/[0.08] hover:text-foreground focus-visible:ring-ring/50 -ml-1 grid size-6 shrink-0 cursor-pointer place-items-center rounded-md outline-hidden transition-colors focus-visible:ring-2", i),
|
|
150
|
+
...a,
|
|
151
|
+
children: /* @__PURE__ */ c(r, { className: e("size-4 transition-transform duration-200 ease-out", t && "rotate-90") })
|
|
132
152
|
});
|
|
133
153
|
}
|
|
134
154
|
//#endregion
|
|
135
|
-
export {
|
|
155
|
+
export { f as TreeCell, p as TreeLabel, d as TreeRow, m as TreeToggle, u as useTree };
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -23,15 +23,17 @@ export declare function dayOfWeek(date: DateString): number;
|
|
|
23
23
|
export declare function today(now?: Date): DateString;
|
|
24
24
|
/** Days from `from` to `to` (negative if `to` is earlier). */
|
|
25
25
|
export declare function daysBetween(from: DateString, to: DateString): number;
|
|
26
|
+
/** How much of a date to show; `day` is the day and month without the year ("Sep 3"), for dates within the year. */
|
|
27
|
+
export type DateStyle = 'day' | 'short' | 'medium' | 'long' | 'full';
|
|
26
28
|
/**
|
|
27
|
-
* "Sep 30, 2026" (or the locale's equivalent) by default; `
|
|
28
|
-
* "9/30/26", `long` "September 30, 2026", `full` adds the weekday.
|
|
29
|
+
* "Sep 30, 2026" (or the locale's equivalent) by default; `day` is "Sep 30",
|
|
30
|
+
* `short` "9/30/26", `long` "September 30, 2026", `full` adds the weekday.
|
|
29
31
|
*/
|
|
30
|
-
export declare function formatDate(date: DateString, locale: string, style?:
|
|
32
|
+
export declare function formatDate(date: DateString, locale: string, style?: DateStyle): string;
|
|
31
33
|
/** Short weekday names for a locale, Sunday first. */
|
|
32
34
|
export declare function weekdayNames(locale: string, style?: 'narrow' | 'short' | 'long'): string[];
|
|
33
35
|
/** The first day of the week for a locale: 0 for Sunday, 1 for Monday, 6 for Saturday. */
|
|
34
36
|
export declare function weekStart(locale: string): number;
|
|
35
37
|
/** "Sep 3 – 10, 2026" (or the locale's equivalent), sharing what the two dates have in common. */
|
|
36
|
-
export declare function formatDateRange(start: DateString, end: DateString, locale: string, style?:
|
|
38
|
+
export declare function formatDateRange(start: DateString, end: DateString, locale: string, style?: Exclude<DateStyle, 'full'>): string;
|
|
37
39
|
//# sourceMappingURL=date.d.ts.map
|
package/dist/utils/date.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../packages/utils/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,6EAA6E;AAC7E,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,GAAG,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1B;AAID,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAI1D;AAED,0EAA0E;A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
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
var u = (e, t) => new Intl.DateTimeFormat(e, t === "day" ? {
|
|
37
|
+
day: "numeric",
|
|
38
|
+
month: "short",
|
|
39
|
+
timeZone: "UTC"
|
|
40
|
+
} : {
|
|
41
|
+
dateStyle: t,
|
|
42
|
+
timeZone: "UTC"
|
|
43
|
+
});
|
|
44
|
+
function d(e, t, r = "medium") {
|
|
45
|
+
return _(u(t, r).format(n(e) * 864e5));
|
|
41
46
|
}
|
|
42
|
-
function
|
|
47
|
+
function f(e, t = "short") {
|
|
43
48
|
let n = new Intl.DateTimeFormat(e, {
|
|
44
49
|
weekday: t,
|
|
45
50
|
timeZone: "UTC"
|
|
46
51
|
});
|
|
47
52
|
return Array.from({ length: 7 }, (e, t) => n.format(Date.UTC(2023, 0, 1 + t)));
|
|
48
53
|
}
|
|
49
|
-
var
|
|
50
|
-
function
|
|
54
|
+
var p = new Set("AG AS BD BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW".split(" ")), m = new Set("AE AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY".split(" "));
|
|
55
|
+
function h(e) {
|
|
51
56
|
try {
|
|
52
57
|
let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
|
|
53
58
|
if (n) return n.firstDay % 7;
|
|
54
59
|
let r = t.maximize().region ?? "";
|
|
55
|
-
return
|
|
60
|
+
return p.has(r) ? 0 : m.has(r) ? 6 : 1;
|
|
56
61
|
} catch {
|
|
57
62
|
return 1;
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
62
|
-
dateStyle: i,
|
|
63
|
-
timeZone: "UTC"
|
|
64
|
-
}).formatRange(n(e) * 864e5, n(t) * 864e5));
|
|
65
|
+
function g(e, t, r, i = "medium") {
|
|
66
|
+
return _(u(r, i).formatRange(n(e) * 864e5, n(t) * 864e5));
|
|
65
67
|
}
|
|
66
|
-
var
|
|
68
|
+
var _ = (e) => e.replace(/[\u2009\u202f]/g, " ");
|
|
67
69
|
//#endregion
|
|
68
|
-
export { i as addDays, a as addMonthsToDate, n as dayIndex, s as dayOfWeek, l as daysBetween, o as daysInMonth,
|
|
70
|
+
export { i as addDays, a as addMonthsToDate, n as dayIndex, s as dayOfWeek, l as daysBetween, o as daysInMonth, d as formatDate, g as formatDateRange, r as fromDayIndex, t as isDate, c as today, h as weekStart, f as weekdayNames };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-chevron.d.ts","sourceRoot":"","sources":["../../packages/utils/field-chevron.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-chevron.d.ts","sourceRoot":"","sources":["../../packages/utils/field-chevron.tsx"],"names":[],"mappings":"AAIA,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAUvF"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx as e } from "./cx.js";
|
|
3
|
-
import
|
|
3
|
+
import t from "../icons/micro/chevron-down.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
5
|
//#region packages/utils/field-chevron.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */ t("
|
|
7
|
-
viewBox: "0 0 16 16",
|
|
8
|
-
fill: "none",
|
|
9
|
-
stroke: "currentColor",
|
|
10
|
-
strokeWidth: "1.6",
|
|
11
|
-
strokeLinecap: "round",
|
|
12
|
-
strokeLinejoin: "round",
|
|
13
|
-
"aria-hidden": !0,
|
|
14
|
-
className: e("text-muted-foreground size-4 shrink-0 transition-transform duration-300", n && "rotate-180", r),
|
|
15
|
-
children: /* @__PURE__ */ t("path", { d: "m4 6 4 4 4-4" })
|
|
16
|
-
});
|
|
6
|
+
function r({ open: r, className: i }) {
|
|
7
|
+
return /* @__PURE__ */ n(t, { className: e("text-muted-foreground size-4 shrink-0 transition-transform duration-300", r && "rotate-180", i) });
|
|
17
8
|
}
|
|
18
9
|
//#endregion
|
|
19
|
-
export {
|
|
10
|
+
export { r as FieldChevron };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Small
|
|
1
|
+
/** Small status icons in the current text colour (toasts, field errors): Heroicons' micro set. */
|
|
2
2
|
export declare function CheckIcon({ className }: {
|
|
3
3
|
className?: string;
|
|
4
4
|
}): import('react').JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-icons.d.ts","sourceRoot":"","sources":["../../packages/utils/status-icons.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status-icons.d.ts","sourceRoot":"","sources":["../../packages/utils/status-icons.tsx"],"names":[],"mappings":"AAMA,kGAAkG;AAClG,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAE9D;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAE9D;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAE7D"}
|
|
@@ -1,48 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx as e } from "./cx.js";
|
|
3
|
-
import
|
|
3
|
+
import t from "../icons/micro/check.js";
|
|
4
|
+
import n from "../icons/micro/exclamation-triangle.js";
|
|
5
|
+
import r from "../icons/micro/information-circle.js";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
7
|
//#region packages/utils/status-icons.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */ t("
|
|
7
|
-
viewBox: "0 0 16 16",
|
|
8
|
-
fill: "none",
|
|
9
|
-
stroke: "currentColor",
|
|
10
|
-
strokeWidth: "2",
|
|
11
|
-
strokeLinecap: "round",
|
|
12
|
-
strokeLinejoin: "round",
|
|
13
|
-
className: e("size-3.5", n),
|
|
14
|
-
"aria-hidden": !0,
|
|
15
|
-
children: /* @__PURE__ */ t("path", { d: "m3.5 8.5 3 3 6-7" })
|
|
16
|
-
});
|
|
8
|
+
function a({ className: n }) {
|
|
9
|
+
return /* @__PURE__ */ i(t, { className: e("size-3.5", n) });
|
|
17
10
|
}
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */ n("
|
|
20
|
-
viewBox: "0 0 16 16",
|
|
21
|
-
fill: "none",
|
|
22
|
-
stroke: "currentColor",
|
|
23
|
-
strokeWidth: "1.8",
|
|
24
|
-
strokeLinecap: "round",
|
|
25
|
-
strokeLinejoin: "round",
|
|
26
|
-
className: e("size-3.5", r),
|
|
27
|
-
"aria-hidden": !0,
|
|
28
|
-
children: [/* @__PURE__ */ t("path", { d: "M8 2.2 1.6 13.3h12.8L8 2.2Z" }), /* @__PURE__ */ t("path", { d: "M8 6.5v3M8 11.6v.1" })]
|
|
29
|
-
});
|
|
11
|
+
function o({ className: t }) {
|
|
12
|
+
return /* @__PURE__ */ i(n, { className: e("size-3.5", t) });
|
|
30
13
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
viewBox: "0 0 16 16",
|
|
34
|
-
fill: "none",
|
|
35
|
-
stroke: "currentColor",
|
|
36
|
-
strokeWidth: "1.8",
|
|
37
|
-
strokeLinecap: "round",
|
|
38
|
-
className: e("size-3.5", r),
|
|
39
|
-
"aria-hidden": !0,
|
|
40
|
-
children: [/* @__PURE__ */ t("circle", {
|
|
41
|
-
cx: "8",
|
|
42
|
-
cy: "8",
|
|
43
|
-
r: "6.3"
|
|
44
|
-
}), /* @__PURE__ */ t("path", { d: "M8 7.3v3.8M8 4.9v.1" })]
|
|
45
|
-
});
|
|
14
|
+
function s({ className: t }) {
|
|
15
|
+
return /* @__PURE__ */ i(r, { className: e("size-3.5", t) });
|
|
46
16
|
}
|
|
47
17
|
//#endregion
|
|
48
|
-
export {
|
|
18
|
+
export { o as AlertIcon, a as CheckIcon, s as InfoIcon };
|