@rinzai/zen 0.5.0 → 0.6.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 +2 -2
- package/dist/animated-number/index.js +33 -0
- package/dist/avatar/index.js +38 -0
- package/dist/backdrop/index.d.ts +7 -3
- package/dist/backdrop/index.d.ts.map +1 -1
- package/dist/backdrop/index.js +98 -0
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.js +24 -0
- package/dist/button/index.d.ts +10 -3
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.js +54 -0
- package/dist/calendar/index.d.ts +44 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/calendar/index.js +161 -0
- package/dist/card/index.d.ts +15 -6
- package/dist/card/index.d.ts.map +1 -1
- package/dist/card/index.js +60 -0
- package/dist/chart/donut.d.ts +30 -0
- package/dist/chart/donut.d.ts.map +1 -0
- package/dist/chart/donut.js +96 -0
- package/dist/chart/index.d.ts +81 -0
- package/dist/chart/index.d.ts.map +1 -0
- package/dist/chart/index.js +362 -0
- package/dist/chart/tooltip.d.ts +25 -0
- package/dist/chart/tooltip.d.ts.map +1 -0
- package/dist/chart/tooltip.js +51 -0
- package/dist/checkbox/index.d.ts +20 -0
- package/dist/checkbox/index.d.ts.map +1 -0
- package/dist/checkbox/index.js +61 -0
- package/dist/chip/index.d.ts +12 -0
- package/dist/chip/index.d.ts.map +1 -0
- package/dist/chip/index.js +14 -0
- package/dist/code-block/index.js +36 -0
- package/dist/collapse/index.d.ts +17 -7
- package/dist/collapse/index.d.ts.map +1 -1
- package/dist/collapse/index.js +82 -0
- package/dist/combobox/index.d.ts +89 -0
- package/dist/combobox/index.d.ts.map +1 -0
- package/dist/combobox/index.js +262 -0
- package/dist/confirm-dialog/index.d.ts.map +1 -1
- package/dist/confirm-dialog/index.js +25 -0
- package/dist/date-picker/index.d.ts +48 -0
- package/dist/date-picker/index.d.ts.map +1 -0
- package/dist/date-picker/index.js +112 -0
- package/dist/dialog/index.d.ts +14 -2
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +77 -0
- package/dist/disclosure/index.d.ts +25 -0
- package/dist/disclosure/index.d.ts.map +1 -0
- package/dist/disclosure/index.js +66 -0
- package/dist/editable-cell/index.js +24 -0
- package/dist/field/index.d.ts +42 -3
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +66 -0
- package/dist/header/index.js +17 -0
- package/dist/icons/chevron-down.js +21 -0
- package/dist/icons/chevron-left.js +21 -0
- package/dist/icons/chevron-right.js +21 -0
- package/dist/icons/chevron-up.js +21 -0
- package/dist/icons/ellipsis.d.ts +4 -0
- package/dist/icons/ellipsis.d.ts.map +1 -0
- package/dist/icons/ellipsis.js +31 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/search.js +21 -0
- package/dist/icons/x-mark.js +21 -0
- package/dist/index.d.ts +22 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/input/index.d.ts.map +1 -1
- package/dist/input/index.js +16 -0
- package/dist/input-group/index.d.ts.map +1 -1
- package/dist/input-group/index.js +36 -0
- package/dist/inset/index.d.ts +16 -0
- package/dist/inset/index.d.ts.map +1 -0
- package/dist/inset/index.js +23 -0
- package/dist/lib.js +74 -0
- package/dist/menu/index.d.ts +55 -0
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/menu/index.js +118 -0
- package/dist/meter/index.js +41 -0
- package/dist/money-input/index.d.ts +77 -7
- package/dist/money-input/index.d.ts.map +1 -1
- package/dist/money-input/index.js +304 -0
- package/dist/month-picker/index.d.ts +4 -3
- package/dist/month-picker/index.d.ts.map +1 -1
- package/dist/month-picker/index.js +93 -0
- package/dist/page-header/index.js +26 -0
- package/dist/pills/index.d.ts +35 -0
- package/dist/pills/index.d.ts.map +1 -0
- package/dist/pills/index.js +50 -0
- package/dist/popover/index.d.ts +41 -22
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +75 -0
- package/dist/progress-ring/index.js +49 -0
- package/dist/radio-cards/index.d.ts +34 -0
- package/dist/radio-cards/index.d.ts.map +1 -0
- package/dist/radio-cards/index.js +48 -0
- package/dist/radio-group/index.d.ts +39 -0
- package/dist/radio-group/index.d.ts.map +1 -0
- package/dist/radio-group/index.js +63 -0
- package/dist/segmented/index.d.ts +16 -6
- package/dist/segmented/index.d.ts.map +1 -1
- package/dist/segmented/index.js +58 -0
- package/dist/select/index.d.ts +28 -14
- package/dist/select/index.d.ts.map +1 -1
- package/dist/select/index.js +187 -0
- package/dist/side-nav/index.js +37 -0
- package/dist/skeleton/index.js +12 -0
- package/dist/slider/index.js +34 -0
- package/dist/spinner/index.js +14 -0
- package/dist/tab-bar/index.d.ts +3 -0
- package/dist/tab-bar/index.d.ts.map +1 -1
- package/dist/tab-bar/index.js +34 -0
- package/dist/table/index.js +148 -0
- package/dist/table-of-contents/index.js +37 -0
- package/dist/tabs/index.d.ts +3 -2
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +114 -0
- package/dist/tailwind.css +1 -1
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/textarea/index.js +16 -0
- package/dist/theme-toggle/index.js +43 -0
- package/dist/theme.css +178 -13
- package/dist/toast/index.d.ts +6 -1
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +248 -0
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/toggle/index.js +26 -0
- package/dist/tooltip/index.d.ts +25 -0
- package/dist/tooltip/index.d.ts.map +1 -0
- package/dist/tooltip/index.js +108 -0
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +135 -0
- package/dist/utils/cva.js +25 -0
- package/dist/utils/cx.js +6 -0
- package/dist/utils/date.d.ts +37 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +68 -0
- package/dist/utils/field-chevron.js +19 -0
- package/dist/utils/fx.d.ts +30 -0
- package/dist/utils/fx.d.ts.map +1 -0
- package/dist/utils/fx.js +21 -0
- package/dist/utils/graphics.js +33 -0
- package/dist/utils/indicator.d.ts +24 -0
- package/dist/utils/indicator.d.ts.map +1 -0
- package/dist/utils/indicator.js +37 -0
- package/dist/utils/merge.js +305 -0
- package/dist/utils/money.js +73 -0
- package/dist/utils/month.js +46 -0
- package/dist/utils/slot.d.ts +9 -5
- package/dist/utils/slot.d.ts.map +1 -1
- package/dist/utils/slot.js +25 -0
- package/dist/utils/status-icons.js +48 -0
- package/dist/utils/styles.d.ts +6 -6
- package/dist/utils/styles.d.ts.map +1 -1
- package/dist/utils/styles.js +6 -0
- package/dist/utils/theme.js +200 -0
- package/dist/utils/useAnchoredPopup.d.ts +8 -2
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
- package/dist/utils/useAnchoredPopup.js +63 -0
- package/dist/utils/useHydrated.js +9 -0
- package/dist/utils/useVirtualList.js +45 -0
- package/dist/variables.css +22 -0
- package/dist/zen.css +1 -1
- package/package.json +9 -4
- package/dist/actions-menu/index.d.ts +0 -18
- package/dist/actions-menu/index.d.ts.map +0 -1
- package/dist/dropdown/index.d.ts +0 -28
- package/dist/dropdown/index.d.ts.map +0 -1
- package/dist/nav-pills/index.d.ts +0 -31
- package/dist/nav-pills/index.d.ts.map +0 -1
- package/dist/zen.js +0 -2970
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/utils/merge.ts
|
|
3
|
+
function e(e) {
|
|
4
|
+
let r = t.get(e);
|
|
5
|
+
if (r !== void 0) return r;
|
|
6
|
+
let i = e.split(/\s+/).filter(Boolean), a = /* @__PURE__ */ new Set(), o = [];
|
|
7
|
+
for (let e = i.length - 1; e >= 0; e--) {
|
|
8
|
+
let t = i[e], r = n(t);
|
|
9
|
+
if (!r) {
|
|
10
|
+
o.push(t);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
let s = r.scope;
|
|
14
|
+
if (!a.has(s + r.group)) {
|
|
15
|
+
a.add(s + r.group);
|
|
16
|
+
for (let e of _[r.group] ?? []) a.add(s + e);
|
|
17
|
+
o.push(t);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
let s = o.reverse().join(" ");
|
|
21
|
+
return t.size >= 1e3 && t.clear(), t.set(e, s), s;
|
|
22
|
+
}
|
|
23
|
+
var t = /* @__PURE__ */ new Map();
|
|
24
|
+
function n(e) {
|
|
25
|
+
let t = r(e), n = t.pop(), i = !1;
|
|
26
|
+
n.startsWith("!") ? [i, n] = [!0, n.slice(1)] : n.endsWith("!") && ([i, n] = [!0, n.slice(0, -1)]), n.startsWith("-") && (n = n.slice(1));
|
|
27
|
+
let a = g(n);
|
|
28
|
+
return a ? {
|
|
29
|
+
group: a,
|
|
30
|
+
scope: t.sort().join(":") + (i ? "!" : "") + "|"
|
|
31
|
+
} : null;
|
|
32
|
+
}
|
|
33
|
+
function r(e) {
|
|
34
|
+
let t = [], n = 0, r = 0;
|
|
35
|
+
for (let i = 0; i < e.length; i++) {
|
|
36
|
+
let a = e[i];
|
|
37
|
+
a === "[" || a === "(" ? n++ : a === "]" || a === ")" ? n-- : a === ":" && n === 0 && (t.push(e.slice(r, i)), r = i + 1);
|
|
38
|
+
}
|
|
39
|
+
return t.push(e.slice(r)), t;
|
|
40
|
+
}
|
|
41
|
+
var i = /^\d+(\.\d+)?$/, a = /^(\d?xs|sm|md|lg|\d?xl|base|none|full)$/, o = /^[[(](length:|size:|percentage:|number:)?(-?[\d.]+[a-z%]*|calc\(|min\(|max\(|clamp\(|var\(--[\w-]*(size|width|radius|spacing|length)[\w-]*\))/, s = (e) => e.replace(/\/[^/[\]()]*$/, ""), c = (e) => e === "" || i.test(e) || o.test(e), l = [
|
|
42
|
+
"x",
|
|
43
|
+
"y",
|
|
44
|
+
"t",
|
|
45
|
+
"r",
|
|
46
|
+
"b",
|
|
47
|
+
"l",
|
|
48
|
+
"s",
|
|
49
|
+
"e"
|
|
50
|
+
], u = [
|
|
51
|
+
"t",
|
|
52
|
+
"r",
|
|
53
|
+
"b",
|
|
54
|
+
"l",
|
|
55
|
+
"s",
|
|
56
|
+
"e",
|
|
57
|
+
"tl",
|
|
58
|
+
"tr",
|
|
59
|
+
"br",
|
|
60
|
+
"bl",
|
|
61
|
+
"ss",
|
|
62
|
+
"se",
|
|
63
|
+
"es",
|
|
64
|
+
"ee"
|
|
65
|
+
], d = {}, f = (e, t) => t.split(" ").forEach((t) => d[t] = e);
|
|
66
|
+
f("display", "block inline-block inline flex inline-flex grid inline-grid contents hidden flow-root list-item table inline-table table-row table-cell table-caption table-column table-row-group table-header-group table-footer-group"), f("position", "static fixed absolute relative sticky"), f("visibility", "visible invisible collapse"), f("isolation", "isolate isolation-auto"), f("text-overflow", "truncate text-ellipsis text-clip"), f("text-transform", "uppercase lowercase capitalize normal-case"), f("font-style", "italic not-italic"), f("text-decoration-line", "underline overline line-through no-underline"), f("font-smoothing", "antialiased subpixel-antialiased"), f("sr", "sr-only not-sr-only"), f("flex-direction", "flex-row flex-row-reverse flex-col flex-col-reverse"), f("flex-wrap", "flex-wrap flex-wrap-reverse flex-nowrap"), f("border-style", "border-solid border-dashed border-dotted border-double border-hidden border-none"), f("border-collapse", "border-collapse border-separate"), f("table-layout", "table-auto table-fixed"), f("box-sizing", "box-border box-content"), f("grow", "grow"), f("shrink", "shrink"), f("transition", "transition"), f("shadow", "shadow"), f("ring-w", "ring"), f("ring-inset", "ring-inset"), f("outline-w", "outline"), f("border-w", "border"), f("rounded", "rounded");
|
|
67
|
+
for (let e of l) f(`border-w-${e}`, `border-${e}`);
|
|
68
|
+
for (let e of u) f(`rounded-${e}`, `rounded-${e}`);
|
|
69
|
+
var p = {
|
|
70
|
+
inset: "inset",
|
|
71
|
+
"inset-x": "inset-x",
|
|
72
|
+
"inset-y": "inset-y",
|
|
73
|
+
top: "top",
|
|
74
|
+
right: "right",
|
|
75
|
+
bottom: "bottom",
|
|
76
|
+
left: "left",
|
|
77
|
+
start: "start",
|
|
78
|
+
end: "end",
|
|
79
|
+
z: "z",
|
|
80
|
+
order: "order",
|
|
81
|
+
basis: "basis",
|
|
82
|
+
grow: "grow",
|
|
83
|
+
shrink: "shrink",
|
|
84
|
+
flex: "flex",
|
|
85
|
+
"grid-cols": "grid-cols",
|
|
86
|
+
"grid-rows": "grid-rows",
|
|
87
|
+
"grid-flow": "grid-flow",
|
|
88
|
+
"auto-cols": "auto-cols",
|
|
89
|
+
"auto-rows": "auto-rows",
|
|
90
|
+
col: "col",
|
|
91
|
+
"col-span": "col-span",
|
|
92
|
+
"col-start": "col-start",
|
|
93
|
+
"col-end": "col-end",
|
|
94
|
+
row: "row",
|
|
95
|
+
"row-span": "row-span",
|
|
96
|
+
"row-start": "row-start",
|
|
97
|
+
"row-end": "row-end",
|
|
98
|
+
gap: "gap",
|
|
99
|
+
"gap-x": "gap-x",
|
|
100
|
+
"gap-y": "gap-y",
|
|
101
|
+
"space-x": "space-x",
|
|
102
|
+
"space-y": "space-y",
|
|
103
|
+
w: "w",
|
|
104
|
+
"min-w": "min-w",
|
|
105
|
+
"max-w": "max-w",
|
|
106
|
+
h: "h",
|
|
107
|
+
"min-h": "min-h",
|
|
108
|
+
"max-h": "max-h",
|
|
109
|
+
size: "size",
|
|
110
|
+
justify: "justify-content",
|
|
111
|
+
"justify-items": "justify-items",
|
|
112
|
+
"justify-self": "justify-self",
|
|
113
|
+
items: "align-items",
|
|
114
|
+
self: "align-self",
|
|
115
|
+
content: (e) => e === "none" || e.startsWith("[") || e.startsWith("(") ? "content" : "align-content",
|
|
116
|
+
"place-content": "place-content",
|
|
117
|
+
"place-items": "place-items",
|
|
118
|
+
"place-self": "place-self",
|
|
119
|
+
overflow: "overflow",
|
|
120
|
+
"overflow-x": "overflow-x",
|
|
121
|
+
"overflow-y": "overflow-y",
|
|
122
|
+
"border-spacing": "border-spacing",
|
|
123
|
+
"border-spacing-x": "border-spacing-x",
|
|
124
|
+
"border-spacing-y": "border-spacing-y",
|
|
125
|
+
bg: (e) => {
|
|
126
|
+
let t = s(e);
|
|
127
|
+
return [
|
|
128
|
+
"fixed",
|
|
129
|
+
"local",
|
|
130
|
+
"scroll"
|
|
131
|
+
].includes(t) ? "bg-attachment" : /^(clip|origin)-/.test(t) ? "bg-" + t.split("-")[0] : /^(repeat|no-repeat)/.test(t) ? "bg-repeat" : [
|
|
132
|
+
"auto",
|
|
133
|
+
"cover",
|
|
134
|
+
"contain"
|
|
135
|
+
].includes(t) ? "bg-size" : /^(top|bottom|left|right|center)/.test(t) ? "bg-position" : t === "none" || /^(linear|radial|conic|gradient)-/.test(t) || /^\[(url|image:|(repeating-)?(linear|radial|conic)-gradient)/.test(t) ? "bg-image" : "bg-color";
|
|
136
|
+
},
|
|
137
|
+
text: (e) => {
|
|
138
|
+
let t = s(e);
|
|
139
|
+
return [
|
|
140
|
+
"left",
|
|
141
|
+
"center",
|
|
142
|
+
"right",
|
|
143
|
+
"justify",
|
|
144
|
+
"start",
|
|
145
|
+
"end"
|
|
146
|
+
].includes(t) ? "text-align" : [
|
|
147
|
+
"wrap",
|
|
148
|
+
"nowrap",
|
|
149
|
+
"balance",
|
|
150
|
+
"pretty"
|
|
151
|
+
].includes(t) ? "text-wrap" : a.test(t) || o.test(t) ? "font-size" : "text-color";
|
|
152
|
+
},
|
|
153
|
+
font: (e) => /^(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/.test(e) || /^[[(](number:|\d)/.test(e) ? "font-weight" : "font-family",
|
|
154
|
+
leading: "leading",
|
|
155
|
+
tracking: "tracking",
|
|
156
|
+
whitespace: "whitespace",
|
|
157
|
+
break: (e) => [
|
|
158
|
+
"normal",
|
|
159
|
+
"words",
|
|
160
|
+
"all",
|
|
161
|
+
"keep"
|
|
162
|
+
].includes(e) ? "word-break" : null,
|
|
163
|
+
"line-clamp": "line-clamp",
|
|
164
|
+
align: "vertical-align",
|
|
165
|
+
opacity: "opacity",
|
|
166
|
+
shadow: (e) => e === "" || a.test(s(e)) || e === "inner" || /^\[(?!color:)/.test(e) ? "shadow" : "shadow-color",
|
|
167
|
+
ring: (e) => c(e) ? "ring-w" : "ring-color",
|
|
168
|
+
"ring-offset": (e) => c(e) ? "ring-offset-w" : "ring-offset-color",
|
|
169
|
+
outline: (e) => [
|
|
170
|
+
"none",
|
|
171
|
+
"hidden",
|
|
172
|
+
"solid",
|
|
173
|
+
"dashed",
|
|
174
|
+
"dotted",
|
|
175
|
+
"double"
|
|
176
|
+
].includes(e) ? "outline-style" : c(e) ? "outline-w" : "outline-color",
|
|
177
|
+
"outline-offset": "outline-offset",
|
|
178
|
+
cursor: "cursor",
|
|
179
|
+
"pointer-events": "pointer-events",
|
|
180
|
+
select: "user-select",
|
|
181
|
+
resize: "resize",
|
|
182
|
+
transition: "transition",
|
|
183
|
+
duration: "duration",
|
|
184
|
+
ease: "ease",
|
|
185
|
+
delay: "delay",
|
|
186
|
+
animate: "animate",
|
|
187
|
+
scale: "scale",
|
|
188
|
+
"scale-x": "scale-x",
|
|
189
|
+
"scale-y": "scale-y",
|
|
190
|
+
rotate: "rotate",
|
|
191
|
+
translate: "translate",
|
|
192
|
+
"translate-x": "translate-x",
|
|
193
|
+
"translate-y": "translate-y",
|
|
194
|
+
origin: "transform-origin",
|
|
195
|
+
fill: "fill",
|
|
196
|
+
stroke: (e) => i.test(e) ? "stroke-w" : "stroke-color",
|
|
197
|
+
aspect: "aspect",
|
|
198
|
+
object: (e) => [
|
|
199
|
+
"contain",
|
|
200
|
+
"cover",
|
|
201
|
+
"fill",
|
|
202
|
+
"none",
|
|
203
|
+
"scale-down"
|
|
204
|
+
].includes(e) ? "object-fit" : "object-position",
|
|
205
|
+
blur: "blur",
|
|
206
|
+
"backdrop-blur": "backdrop-blur",
|
|
207
|
+
"mix-blend": "mix-blend",
|
|
208
|
+
appearance: "appearance",
|
|
209
|
+
"will-change": "will-change",
|
|
210
|
+
"underline-offset": "underline-offset",
|
|
211
|
+
accent: "accent-color",
|
|
212
|
+
caret: "caret-color",
|
|
213
|
+
float: "float",
|
|
214
|
+
clear: "clear",
|
|
215
|
+
columns: "columns",
|
|
216
|
+
rounded: "rounded",
|
|
217
|
+
border: (e) => c(e) ? "border-w" : "border-color"
|
|
218
|
+
};
|
|
219
|
+
for (let e of ["p", "m"]) {
|
|
220
|
+
p[e] = e;
|
|
221
|
+
for (let t of l) p[e + t] = e + t;
|
|
222
|
+
}
|
|
223
|
+
for (let e of l) p[`border-${e}`] = (t) => c(t) ? `border-w-${e}` : `border-color-${e}`;
|
|
224
|
+
for (let e of u) p[`rounded-${e}`] = `rounded-${e}`;
|
|
225
|
+
var m = /* @__PURE__ */ new Set(["text-glow", "text-aurora"]), h = Object.keys(p).sort((e, t) => t.length - e.length);
|
|
226
|
+
function g(e) {
|
|
227
|
+
if (m.has(e)) return null;
|
|
228
|
+
if (d[e]) return d[e];
|
|
229
|
+
if (e.startsWith("[")) {
|
|
230
|
+
let t = e.indexOf(":");
|
|
231
|
+
return t > 1 ? "prop:" + e.slice(1, t) : null;
|
|
232
|
+
}
|
|
233
|
+
for (let t of h) {
|
|
234
|
+
if (!e.startsWith(t + "-")) continue;
|
|
235
|
+
let n = p[t];
|
|
236
|
+
return typeof n == "string" ? n : n(e.slice(t.length + 1));
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
var _ = {
|
|
241
|
+
p: l.map((e) => "p" + e),
|
|
242
|
+
m: l.map((e) => "m" + e),
|
|
243
|
+
px: [
|
|
244
|
+
"pl",
|
|
245
|
+
"pr",
|
|
246
|
+
"ps",
|
|
247
|
+
"pe"
|
|
248
|
+
],
|
|
249
|
+
py: ["pt", "pb"],
|
|
250
|
+
mx: [
|
|
251
|
+
"ml",
|
|
252
|
+
"mr",
|
|
253
|
+
"ms",
|
|
254
|
+
"me"
|
|
255
|
+
],
|
|
256
|
+
my: ["mt", "mb"],
|
|
257
|
+
inset: [
|
|
258
|
+
"inset-x",
|
|
259
|
+
"inset-y",
|
|
260
|
+
"top",
|
|
261
|
+
"right",
|
|
262
|
+
"bottom",
|
|
263
|
+
"left",
|
|
264
|
+
"start",
|
|
265
|
+
"end"
|
|
266
|
+
],
|
|
267
|
+
"inset-x": ["left", "right"],
|
|
268
|
+
"inset-y": ["top", "bottom"],
|
|
269
|
+
size: ["w", "h"],
|
|
270
|
+
gap: ["gap-x", "gap-y"],
|
|
271
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
272
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
273
|
+
"border-w": l.map((e) => "border-w-" + e),
|
|
274
|
+
"border-w-x": [
|
|
275
|
+
"border-w-l",
|
|
276
|
+
"border-w-r",
|
|
277
|
+
"border-w-s",
|
|
278
|
+
"border-w-e"
|
|
279
|
+
],
|
|
280
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
281
|
+
"border-color": l.map((e) => "border-color-" + e),
|
|
282
|
+
"border-color-x": [
|
|
283
|
+
"border-color-l",
|
|
284
|
+
"border-color-r",
|
|
285
|
+
"border-color-s",
|
|
286
|
+
"border-color-e"
|
|
287
|
+
],
|
|
288
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
289
|
+
rounded: u.map((e) => "rounded-" + e),
|
|
290
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
291
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
292
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
293
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
294
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
295
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
296
|
+
translate: ["translate-x", "translate-y"],
|
|
297
|
+
scale: ["scale-x", "scale-y"],
|
|
298
|
+
flex: [
|
|
299
|
+
"grow",
|
|
300
|
+
"shrink",
|
|
301
|
+
"basis"
|
|
302
|
+
]
|
|
303
|
+
};
|
|
304
|
+
//#endregion
|
|
305
|
+
export { e as mergeClasses };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/utils/money.ts
|
|
3
|
+
function e(e) {
|
|
4
|
+
return new Intl.NumberFormat("en", {
|
|
5
|
+
style: "currency",
|
|
6
|
+
currency: e
|
|
7
|
+
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
8
|
+
}
|
|
9
|
+
function t(t, n, r, { showDecimals: i = !0 } = {}) {
|
|
10
|
+
let a = e(n);
|
|
11
|
+
return new Intl.NumberFormat(r, {
|
|
12
|
+
style: "currency",
|
|
13
|
+
currency: n,
|
|
14
|
+
minimumFractionDigits: i ? a : 0,
|
|
15
|
+
maximumFractionDigits: i ? a : 0
|
|
16
|
+
}).format(t / 10 ** a);
|
|
17
|
+
}
|
|
18
|
+
function n(t, n, r) {
|
|
19
|
+
let i = e(n), a = t % 10 ** i != 0;
|
|
20
|
+
return new Intl.NumberFormat(r, {
|
|
21
|
+
minimumFractionDigits: a ? i : 0,
|
|
22
|
+
maximumFractionDigits: i
|
|
23
|
+
}).format(t / 10 ** i);
|
|
24
|
+
}
|
|
25
|
+
function r(e, t) {
|
|
26
|
+
return new Intl.NumberFormat(t, {
|
|
27
|
+
style: "currency",
|
|
28
|
+
currency: e
|
|
29
|
+
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? e;
|
|
30
|
+
}
|
|
31
|
+
var i = class extends Error {
|
|
32
|
+
constructor(e) {
|
|
33
|
+
super(`Not an amount: ${e}`), this.name = "MoneyParseError";
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function a(t, n) {
|
|
37
|
+
let r = e(n), a = t.trim().replace(/[\s,_]/g, "").replace(/^([+-]?)[^\d.+-]+/, "$1"), o = /^([+-]?)(\d*)(?:\.(\d*))?$/.exec(a);
|
|
38
|
+
if (!o || o[2] === "" && (o[3] ?? "") === "") throw new i(t);
|
|
39
|
+
let [, s, c, l = ""] = o;
|
|
40
|
+
if (l.length > r) throw new i(t);
|
|
41
|
+
let u = Number((c || "0") + l.padEnd(r, "0"));
|
|
42
|
+
if (!Number.isSafeInteger(u)) throw new i(t);
|
|
43
|
+
return s === "-" ? -u : u;
|
|
44
|
+
}
|
|
45
|
+
var o = {
|
|
46
|
+
k: 3,
|
|
47
|
+
thousand: 3,
|
|
48
|
+
l: 5,
|
|
49
|
+
lac: 5,
|
|
50
|
+
lakh: 5,
|
|
51
|
+
lakhs: 5,
|
|
52
|
+
cr: 7,
|
|
53
|
+
crore: 7,
|
|
54
|
+
crores: 7,
|
|
55
|
+
m: 6,
|
|
56
|
+
mn: 6,
|
|
57
|
+
million: 6
|
|
58
|
+
};
|
|
59
|
+
function s(t, n) {
|
|
60
|
+
let r = /^\s*(.*?)\s*([a-z]+)\s*$/i.exec(t), s = o[r ? r[2].toLowerCase() : ""];
|
|
61
|
+
if (!r || s === void 0) return a(t, n);
|
|
62
|
+
let c = e(n), l = /^([+-]?)[^\d.+-]*([\d,\s_]*)(?:\.(\d*))?$/.exec(r[1]);
|
|
63
|
+
if (!l) throw new i(t);
|
|
64
|
+
let u = l[2].replace(/[,\s_]/g, ""), d = l[3] ?? "";
|
|
65
|
+
if (u === "" && d === "") throw new i(t);
|
|
66
|
+
let f = s + c;
|
|
67
|
+
if (d.length > f) throw new i(t);
|
|
68
|
+
let p = Number((u || "0") + d.padEnd(f, "0"));
|
|
69
|
+
if (!Number.isSafeInteger(p)) throw new i(t);
|
|
70
|
+
return l[1] === "-" ? -p : p;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { i as MoneyParseError, r as currencySymbol, n as formatAmount, t as formatMoney, e as minorDigits, a as parseMoney, s as parseMoneyInput };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/utils/month.ts
|
|
3
|
+
var e = /^(\d{4})-(0[1-9]|1[0-2])$/;
|
|
4
|
+
function t(t) {
|
|
5
|
+
return typeof t == "string" && e.test(t);
|
|
6
|
+
}
|
|
7
|
+
function n(t) {
|
|
8
|
+
let n = e.exec(t);
|
|
9
|
+
if (!n) throw Error(`Invalid month: ${t}`);
|
|
10
|
+
return Number(n[1]) * 12 + Number(n[2]) - 1;
|
|
11
|
+
}
|
|
12
|
+
function r(e) {
|
|
13
|
+
let t = Math.floor(e / 12);
|
|
14
|
+
return `${String(t).padStart(4, "0")}-${String(e % 12 + 1).padStart(2, "0")}`;
|
|
15
|
+
}
|
|
16
|
+
function i(e, t) {
|
|
17
|
+
return r(n(e) + t);
|
|
18
|
+
}
|
|
19
|
+
function a(e, t) {
|
|
20
|
+
let i = [];
|
|
21
|
+
for (let a = n(e); a <= n(t); a++) i.push(r(a));
|
|
22
|
+
return i;
|
|
23
|
+
}
|
|
24
|
+
function o(e, t) {
|
|
25
|
+
return n(t) - n(e);
|
|
26
|
+
}
|
|
27
|
+
function s(e = /* @__PURE__ */ new Date()) {
|
|
28
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
|
|
29
|
+
}
|
|
30
|
+
function c(e, t, n = "short") {
|
|
31
|
+
let [r, i] = e.split("-").map(Number);
|
|
32
|
+
return new Intl.DateTimeFormat(t, {
|
|
33
|
+
month: n,
|
|
34
|
+
year: "numeric",
|
|
35
|
+
timeZone: "UTC"
|
|
36
|
+
}).format(Date.UTC(r, i - 1, 1));
|
|
37
|
+
}
|
|
38
|
+
function l(e) {
|
|
39
|
+
let t = new Intl.DateTimeFormat(e, {
|
|
40
|
+
month: "short",
|
|
41
|
+
timeZone: "UTC"
|
|
42
|
+
});
|
|
43
|
+
return Array.from({ length: 12 }, (e, n) => t.format(Date.UTC(2e3, n, 1)));
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { i as addMonths, s as currentMonth, c as formatMonth, r as fromMonthIndex, t as isMonth, n as monthIndex, l as monthNames, a as monthRange, o as monthsBetween };
|
package/dist/utils/slot.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement, ReactNode } from 'react';
|
|
2
|
+
type Props = Record<string, unknown>;
|
|
2
3
|
/**
|
|
3
|
-
* Renders its single child element with `props` merged in
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Renders its single child element with `props` merged in, for `asChild`
|
|
5
|
+
* props: a component's styles and attributes go onto the caller's own element,
|
|
6
|
+
* such as a router's Link. Classes are combined, styles merged (the child's
|
|
7
|
+
* win), event handlers both run (the child's first), and refs both receive the
|
|
8
|
+
* element; other props from the component win.
|
|
6
9
|
*/
|
|
7
|
-
export declare function Slot({ children,
|
|
10
|
+
export declare function Slot({ children, ...props }: ComponentProps<'a'> & {
|
|
8
11
|
children?: ReactNode;
|
|
9
|
-
}): ReactElement<
|
|
12
|
+
}): ReactElement<Props, string | import('react').JSXElementConstructor<any>> | null;
|
|
13
|
+
export {};
|
|
10
14
|
//# sourceMappingURL=slot.d.ts.map
|
package/dist/utils/slot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../packages/utils/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAkB,YAAY,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../packages/utils/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAkB,YAAY,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AAInG,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,mFAoB1F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "./cx.js";
|
|
3
|
+
import { cloneElement as t, isValidElement as n } from "react";
|
|
4
|
+
//#region packages/utils/slot.tsx
|
|
5
|
+
function r({ children: r, ...a }) {
|
|
6
|
+
if (!n(r)) return null;
|
|
7
|
+
let o = r, s = a, c = o.props, l = { ...s };
|
|
8
|
+
for (let e of Object.keys(s)) {
|
|
9
|
+
let t = s[e], n = c[e];
|
|
10
|
+
/^on[A-Z]/.test(e) && typeof t == "function" && typeof n == "function" && (l[e] = (...e) => {
|
|
11
|
+
n(...e), t(...e);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return l.className = e(s.className, c.className), (s.style || c.style) && (l.style = {
|
|
15
|
+
...s.style,
|
|
16
|
+
...c.style
|
|
17
|
+
}), s.ref && c.ref && (l.ref = i(s.ref, c.ref)), t(o, l);
|
|
18
|
+
}
|
|
19
|
+
function i(...e) {
|
|
20
|
+
return (t) => {
|
|
21
|
+
for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as Slot };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "./cx.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region packages/utils/status-icons.tsx
|
|
5
|
+
function r({ className: n }) {
|
|
6
|
+
return /* @__PURE__ */ t("svg", {
|
|
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
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function i({ className: r }) {
|
|
19
|
+
return /* @__PURE__ */ n("svg", {
|
|
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
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function a({ className: r }) {
|
|
32
|
+
return /* @__PURE__ */ n("svg", {
|
|
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
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { i as AlertIcon, r as CheckIcon, a as InfoIcon };
|
package/dist/utils/styles.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/** Shared field look: faint glass, hairline border, violet glow on focus. */
|
|
1
|
+
/** Shared field look: faint glass, hairline border lit by the pointer, violet glow on focus. */
|
|
2
2
|
export declare const FIELD: string;
|
|
3
3
|
/** Glow a trigger carries while its popup is open. */
|
|
4
|
-
export declare const TRIGGER_OPEN = "border-glow/60 shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]";
|
|
4
|
+
export declare const TRIGGER_OPEN = "border-glow/60 [--glow-border-color:transparent] shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]";
|
|
5
5
|
/** Trigger for popup fields (dropdown): a field that glows while open. */
|
|
6
6
|
export declare const TRIGGER: string;
|
|
7
7
|
/** Popup panel (popover, dropdown list): glass with a soft glow. */
|
|
8
8
|
export declare const POPUP = "glass glass-blur rounded-xl text-foreground shadow-[var(--popup-shadow),0_0_40px_-20px_oklch(var(--glow)/0.5)] outline-hidden";
|
|
9
|
-
/**
|
|
10
|
-
export declare const PILL_TRACK = "relative flex w-fit items-center gap-1 rounded-full border border-tint/5 bg-tint/[0.03] p-1";
|
|
9
|
+
/** Pills (and TabList variant="pills"): a glass track… */
|
|
10
|
+
export declare const PILL_TRACK = "glow-edge relative flex w-fit items-center gap-1 rounded-full border border-tint/5 bg-tint/[0.03] p-1";
|
|
11
11
|
/** …a glowing pill that slides to the active item… */
|
|
12
12
|
export declare const PILL_INDICATOR = "absolute top-1 bottom-1 left-0 rounded-full bg-primary/15 shadow-[inset_0_0_0_1px_oklch(var(--glow)/0.35),0_0_24px_-4px_oklch(var(--glow)/0.6)] transition-[translate,width] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]";
|
|
13
|
-
/** …and items that sit above it. */
|
|
14
|
-
export declare const
|
|
13
|
+
/** …and items that sit above it, lit when current (a link) or selected (a tab). */
|
|
14
|
+
export declare const PILL: string;
|
|
15
15
|
/**
|
|
16
16
|
* For a wrapper whose child input takes focus (InputGroup): FIELD, lit by
|
|
17
17
|
* focus-within. Written out in full rather than derived from FIELD, because
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../packages/utils/styles.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../packages/utils/styles.ts"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,eAAO,MAAM,KAAK,QAKmC,CAAC;AAEtD,sDAAsD;AACtD,eAAO,MAAM,YAAY,qIAC6G,CAAC;AAEvI,0EAA0E;AAC1E,eAAO,MAAM,OAAO,QAAgF,CAAC;AAErG,oEAAoE;AACpE,eAAO,MAAM,KAAK,kIACiH,CAAC;AAEpI,0DAA0D;AAC1D,eAAO,MAAM,UAAU,0GACoF,CAAC;AAE5G,sDAAsD;AACtD,eAAO,MAAM,cAAc,iOACuM,CAAC;AAEnO,mFAAmF;AACnF,eAAO,MAAM,IAAI,QAEkG,CAAC;AAEpH;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAK4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "./cx.js";
|
|
3
|
+
//#region packages/utils/styles.ts
|
|
4
|
+
var t = "glow-border h-10 rounded-lg border [--glow-border-color:oklch(var(--tint)/0.1)] bg-tint/[0.035] px-3 text-sm text-foreground shadow-[inset_0_1px_0_hsl(0_0%_100%/0.04)] transition-[border-color,background-color,box-shadow,--glow-border-color] duration-200 placeholder:text-muted-foreground hover:[--glow-border-color:oklch(var(--tint)/0.2)] focus-visible:border-glow/60 focus-visible:[--glow-border-color:transparent] focus-visible:bg-tint/[0.05] focus-visible:shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)] focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", n = "border-glow/60 [--glow-border-color:transparent] shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]", r = e(t, "inline-flex items-center justify-between gap-2 whitespace-nowrap"), i = "glass glass-blur rounded-xl text-foreground shadow-[var(--popup-shadow),0_0_40px_-20px_oklch(var(--glow)/0.5)] outline-hidden", a = "glow-edge relative flex w-fit items-center gap-1 rounded-full border border-tint/5 bg-tint/[0.03] p-1", o = "absolute top-1 bottom-1 left-0 rounded-full bg-primary/15 shadow-[inset_0_0_0_1px_oklch(var(--glow)/0.35),0_0_24px_-4px_oklch(var(--glow)/0.6)] transition-[translate,width] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]", s = "relative z-10 rounded-full px-3.5 py-1.5 text-sm whitespace-nowrap outline-hidden transition-colors duration-300 select-none focus-visible:ring-2 focus-visible:ring-ring/40 text-muted-foreground hover:text-foreground aria-[current=page]:text-foreground aria-selected:text-foreground", c = "glow-border flex w-full items-center gap-1.5 h-10 rounded-lg border [--glow-border-color:oklch(var(--tint)/0.1)] bg-tint/[0.035] px-3 text-sm text-foreground shadow-[inset_0_1px_0_hsl(0_0%_100%/0.04)] transition-[border-color,background-color,box-shadow,--glow-border-color] duration-200 placeholder:text-muted-foreground hover:[--glow-border-color:oklch(var(--tint)/0.2)] focus-within:border-glow/60 focus-within:[--glow-border-color:transparent] focus-within:bg-tint/[0.05] focus-within:shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)] focus-within:outline-hidden disabled:cursor-not-allowed disabled:opacity-50";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { t as FIELD, c as FIELD_WITHIN, s as PILL, o as PILL_INDICATOR, a as PILL_TRACK, i as POPUP, r as TRIGGER, n as TRIGGER_OPEN };
|