@rinzai/zen 0.5.0 → 0.6.1
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 +13 -5
- 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 +107 -0
- package/dist/chart/index.d.ts +81 -0
- package/dist/chart/index.d.ts.map +1 -0
- package/dist/chart/index.js +364 -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 +264 -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.d.ts +4 -3
- package/dist/meter/index.d.ts.map +1 -1
- package/dist/meter/index.js +42 -0
- package/dist/money-input/index.d.ts +84 -15
- package/dist/money-input/index.d.ts.map +1 -1
- package/dist/money-input/index.js +322 -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 +76 -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 +197 -31
- 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 +110 -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 +28 -6
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
- package/dist/utils/useAnchoredPopup.js +119 -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,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { FieldChevron as t } from "../utils/field-chevron.js";
|
|
4
|
+
import { createContext as n, useContext as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region packages/disclosure/index.tsx
|
|
7
|
+
var u = n(null);
|
|
8
|
+
function d(e) {
|
|
9
|
+
let t = r(u);
|
|
10
|
+
if (!t) throw Error(`<${e}> must be inside <Disclosure>`);
|
|
11
|
+
return t;
|
|
12
|
+
}
|
|
13
|
+
function f({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
14
|
+
let [i, o] = s(t), l = a(), d = e ?? i;
|
|
15
|
+
return /* @__PURE__ */ c(u.Provider, {
|
|
16
|
+
value: {
|
|
17
|
+
open: d,
|
|
18
|
+
setOpen: (t) => {
|
|
19
|
+
e === void 0 && o(t), n?.(t);
|
|
20
|
+
},
|
|
21
|
+
contentId: l
|
|
22
|
+
},
|
|
23
|
+
children: r
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function p({ className: n, onClick: r, children: i, ...a }) {
|
|
27
|
+
let { open: o, setOpen: s, contentId: u } = d("DisclosureTrigger");
|
|
28
|
+
return /* @__PURE__ */ l("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
"aria-expanded": o,
|
|
31
|
+
"aria-controls": o ? u : void 0,
|
|
32
|
+
onClick: (e) => {
|
|
33
|
+
r?.(e), e.defaultPrevented || s(!o);
|
|
34
|
+
},
|
|
35
|
+
className: e("zen__disclosure group text-muted-foreground flex w-fit items-center gap-1.5 rounded-md text-sm font-medium outline-hidden", "hover:text-foreground aria-expanded:text-foreground transition-colors duration-200", "focus-visible:outline-ring/50 focus-visible:outline-2 focus-visible:outline-offset-4", n),
|
|
36
|
+
...a,
|
|
37
|
+
children: [/* @__PURE__ */ c(t, { className: e("text-inherit duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]", !o && "-rotate-90") }), i]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function m({ className: t, children: n, ...r }) {
|
|
41
|
+
let { open: a, contentId: l } = d("DisclosureContent"), u = o(null), [f, p] = s(a), [m, h] = s(!1);
|
|
42
|
+
return a && !f && (p(!0), h(!0)), i(() => {
|
|
43
|
+
let e = u.current;
|
|
44
|
+
if (a || !f || !e) return;
|
|
45
|
+
let t = !0;
|
|
46
|
+
return Promise.all((e.getAnimations?.() ?? []).map((e) => e.finished)).then(() => t && p(!1), () => {}), () => {
|
|
47
|
+
t = !1;
|
|
48
|
+
};
|
|
49
|
+
}, [a, f]), f ? /* @__PURE__ */ c("div", {
|
|
50
|
+
ref: u,
|
|
51
|
+
id: l,
|
|
52
|
+
"data-open": a || void 0,
|
|
53
|
+
inert: !a,
|
|
54
|
+
className: e("zen__disclosure-content grid grid-rows-[0fr] transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)] data-open:grid-rows-[1fr]", m && "data-open:starting:grid-rows-[0fr]"),
|
|
55
|
+
children: /* @__PURE__ */ c("div", {
|
|
56
|
+
className: "min-h-0 overflow-hidden",
|
|
57
|
+
children: /* @__PURE__ */ c("div", {
|
|
58
|
+
className: e("-translate-y-1 pt-2 opacity-0 transition-[opacity,translate] duration-300 ease-out", "in-data-open:translate-y-0 in-data-open:opacity-100", m && "in-data-open:starting:-translate-y-1 in-data-open:starting:opacity-0", t),
|
|
59
|
+
...r,
|
|
60
|
+
children: n
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
}) : null;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { m as DisclosureContent, p as DisclosureTrigger, f as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { useState as t } from "react";
|
|
4
|
+
import { Fragment as n, jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region packages/editable-cell/index.tsx
|
|
6
|
+
function i({ children: i, editor: a, label: o, readOnly: s = !1, editing: c, onEditingChange: l, title: u, className: d }) {
|
|
7
|
+
let [f, p] = t(!1), m = c ?? f, h = (e) => {
|
|
8
|
+
c === void 0 && p(e), l?.(e);
|
|
9
|
+
};
|
|
10
|
+
return s ? /* @__PURE__ */ r("span", {
|
|
11
|
+
title: u,
|
|
12
|
+
className: e("zen__editable-cell block px-1 text-right tabular-nums", d),
|
|
13
|
+
children: i
|
|
14
|
+
}) : m ? /* @__PURE__ */ r(n, { children: a(() => h(!1)) }) : /* @__PURE__ */ r("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
title: u,
|
|
17
|
+
"aria-label": o ? `${o}. Edit` : void 0,
|
|
18
|
+
onClick: () => h(!0),
|
|
19
|
+
className: e("zen__editable-cell hover:bg-primary/10 focus-visible:ring-ring/50 w-full rounded-md px-1.5 py-0.5 text-right tabular-nums transition-colors focus-visible:ring-2 focus-visible:outline-hidden", d),
|
|
20
|
+
children: i
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as default };
|
package/dist/field/index.d.ts
CHANGED
|
@@ -1,18 +1,57 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/** What a Field tells the control inside it. */
|
|
3
|
+
export interface FieldControl {
|
|
4
|
+
/** For the control's id (the label's `for`). */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The label's id, for a control that isn't a native form element (aria-labelledby). */
|
|
7
|
+
labelId: string;
|
|
8
|
+
'aria-describedby'?: string;
|
|
9
|
+
'aria-invalid'?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The ids and state of the Field around a control (null outside one). Field
|
|
13
|
+
* also puts them on its direct child; this is for a control nested deeper,
|
|
14
|
+
* such as a ComboboxTrigger inside a Combobox, or your own.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useField(): FieldControl | null;
|
|
17
|
+
/**
|
|
18
|
+
* For Zen's own controls: the Field's hint, error and invalid state, when the
|
|
19
|
+
* control is the one its label points at (its `id` is the Field's). Merged with
|
|
20
|
+
* the control's own props, so a direct child (which Field already passes them
|
|
21
|
+
* to) and a control nested in other markup end up the same.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useFieldProps(props: {
|
|
24
|
+
id?: string;
|
|
25
|
+
'aria-describedby'?: string;
|
|
26
|
+
'aria-invalid'?: unknown;
|
|
27
|
+
}): {
|
|
28
|
+
'aria-describedby'?: undefined;
|
|
29
|
+
'aria-invalid'?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
'aria-describedby': string | undefined;
|
|
32
|
+
'aria-invalid': boolean | undefined;
|
|
33
|
+
};
|
|
2
34
|
/**
|
|
3
35
|
* A labelled form control with an optional hint and error. Links them for
|
|
4
36
|
* screen readers: the control gets an id (if it has none), aria-describedby
|
|
5
|
-
* for the hint
|
|
37
|
+
* for the hint or error, and aria-invalid while there's an error. The error
|
|
38
|
+
* shows in place of the hint until it's fixed.
|
|
39
|
+
*
|
|
40
|
+
* The direct child gets these as props. When the control sits inside other
|
|
41
|
+
* markup (e.g. an amount beside a unit select), give it an id and pass the
|
|
42
|
+
* same id as `htmlFor`: Zen's controls with that id pick them up themselves.
|
|
6
43
|
*/
|
|
7
|
-
export default function Field({ label, hint, error, children, className }: FieldProps): import('react').JSX.Element;
|
|
44
|
+
export default function Field({ label, hint, error, htmlFor, children, className }: FieldProps): import('react').JSX.Element;
|
|
8
45
|
/** A message for a form as a whole: an error in a tinted box, or a quiet note. */
|
|
9
46
|
export declare function FormMessage({ tone, children, className }: FormMessageProps): import('react').JSX.Element;
|
|
10
47
|
export interface FieldProps {
|
|
11
48
|
label: ReactNode;
|
|
12
49
|
/** Help text under the control. */
|
|
13
50
|
hint?: ReactNode;
|
|
14
|
-
/** Error under the control; marks it invalid. */
|
|
51
|
+
/** Error under the control, in place of the hint; marks it invalid. */
|
|
15
52
|
error?: ReactNode;
|
|
53
|
+
/** The control's id, when it isn't the direct child (it's inside other markup). */
|
|
54
|
+
htmlFor?: string;
|
|
16
55
|
/** One control (Input, Select, MoneyInput…), or anything else (then link it yourself). */
|
|
17
56
|
children: ReactNode;
|
|
18
57
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/field/index.tsx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
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { AlertIcon as t, CheckIcon as n, InfoIcon as r } from "../utils/status-icons.js";
|
|
4
|
+
import { cloneElement as i, createContext as a, isValidElement as o, useContext as s, useId as c } from "react";
|
|
5
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
//#region packages/field/index.tsx
|
|
7
|
+
var d = a(null);
|
|
8
|
+
function f() {
|
|
9
|
+
return s(d);
|
|
10
|
+
}
|
|
11
|
+
var p = (...e) => [...new Set(e.flatMap((e) => e?.split(/\s+/) ?? []).filter(Boolean))].join(" ") || void 0;
|
|
12
|
+
function m(e) {
|
|
13
|
+
let t = f();
|
|
14
|
+
return !t || e.id !== t.id ? {} : {
|
|
15
|
+
"aria-describedby": p(e["aria-describedby"], t["aria-describedby"]),
|
|
16
|
+
"aria-invalid": e["aria-invalid"] ?? t["aria-invalid"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function h({ label: n, hint: r, error: a, htmlFor: s, children: f, className: m }) {
|
|
20
|
+
let h = c(), g = !s && o(f) ? f : null, _ = s ?? g?.props.id ?? `${h}-control`, v = r && !a ? `${h}-hint` : void 0, y = a ? `${h}-error` : void 0, b = `${h}-label`, x = {
|
|
21
|
+
id: _,
|
|
22
|
+
labelId: b,
|
|
23
|
+
"aria-describedby": p(v, y),
|
|
24
|
+
"aria-invalid": a ? !0 : void 0
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ l(d.Provider, {
|
|
27
|
+
value: x,
|
|
28
|
+
children: /* @__PURE__ */ u("div", {
|
|
29
|
+
className: e("zen__field flex flex-col gap-2", m),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ l("label", {
|
|
32
|
+
id: b,
|
|
33
|
+
htmlFor: _,
|
|
34
|
+
className: "text-sm leading-none font-medium",
|
|
35
|
+
children: n
|
|
36
|
+
}),
|
|
37
|
+
g ? i(g, {
|
|
38
|
+
id: _,
|
|
39
|
+
"aria-describedby": p(g.props["aria-describedby"], x["aria-describedby"]),
|
|
40
|
+
"aria-invalid": a ? !0 : g.props["aria-invalid"]
|
|
41
|
+
}) : f,
|
|
42
|
+
v && /* @__PURE__ */ l("p", {
|
|
43
|
+
id: v,
|
|
44
|
+
className: "text-muted-foreground mt-0! text-xs",
|
|
45
|
+
children: r
|
|
46
|
+
}),
|
|
47
|
+
a && /* @__PURE__ */ u("p", {
|
|
48
|
+
id: y,
|
|
49
|
+
role: "alert",
|
|
50
|
+
className: "text-destructive mt-0! flex items-center gap-1.5 text-xs font-medium",
|
|
51
|
+
children: [/* @__PURE__ */ l(t, { className: "shrink-0" }), a]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function g({ tone: i = "info", children: a, className: o }) {
|
|
58
|
+
let s = i === "error" ? t : i === "success" ? n : r;
|
|
59
|
+
return /* @__PURE__ */ u("p", {
|
|
60
|
+
role: i === "error" ? "alert" : "status",
|
|
61
|
+
className: e("mt-0! flex items-start gap-2 text-sm", i === "error" && "border-destructive/35 bg-destructive/10 text-destructive rounded-lg border px-3 py-2", i === "success" && "border-primary/30 bg-primary/10 text-primary rounded-lg border px-3 py-2", i === "info" && "text-muted-foreground", o),
|
|
62
|
+
children: [/* @__PURE__ */ l(s, { className: "mt-0.5 shrink-0" }), /* @__PURE__ */ l("span", { children: a })]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { g as FormMessage, h as default, f as useField, m as useFieldProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { useGraphicsMode as t } from "../utils/graphics.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region packages/header/index.tsx
|
|
6
|
+
function r({ className: r, children: i, ...a }) {
|
|
7
|
+
return t(), /* @__PURE__ */ n("header", {
|
|
8
|
+
className: e("zen__header glow-edge border-tint/5 bg-background/60 sticky top-0 z-40 border-b pt-[env(safe-area-inset-top)] backdrop-blur-xl", "pointer-coarse:bg-background/95 pointer-coarse:backdrop-blur-none", r),
|
|
9
|
+
...a,
|
|
10
|
+
children: /* @__PURE__ */ n("div", {
|
|
11
|
+
className: "flex items-center justify-between gap-4 px-4 py-2.5 md:gap-6 md:px-6 md:py-3",
|
|
12
|
+
children: i
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/chevron-down.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
className: "h-6 w-6",
|
|
12
|
+
...t,
|
|
13
|
+
children: /* @__PURE__ */ e("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "m19.5 8.25-7.5 7.5-7.5-7.5"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/chevron-left.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
className: "h-6 w-6",
|
|
12
|
+
...t,
|
|
13
|
+
children: /* @__PURE__ */ e("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/chevron-right.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
className: "h-6 w-6",
|
|
12
|
+
...t,
|
|
13
|
+
children: /* @__PURE__ */ e("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "m8.25 4.5 7.5 7.5-7.5 7.5"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/chevron-up.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
className: "h-6 w-6",
|
|
12
|
+
...t,
|
|
13
|
+
children: /* @__PURE__ */ e("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "m4.5 15.75 7.5-7.5 7.5 7.5"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsis.d.ts","sourceRoot":"","sources":["../../packages/icons/ellipsis.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,0CAA0C;AAC1C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,SAAS,+BAQhD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/ellipsis.tsx
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t("svg", {
|
|
6
|
+
viewBox: "0 0 16 16",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
className: "size-4",
|
|
9
|
+
"aria-hidden": !0,
|
|
10
|
+
...n,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ e("circle", {
|
|
13
|
+
cx: "3",
|
|
14
|
+
cy: "8",
|
|
15
|
+
r: "1.4"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ e("circle", {
|
|
18
|
+
cx: "8",
|
|
19
|
+
cy: "8",
|
|
20
|
+
r: "1.4"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ e("circle", {
|
|
23
|
+
cx: "13",
|
|
24
|
+
cy: "8",
|
|
25
|
+
r: "1.4"
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { n as default };
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as ChevronDown } from './chevron-down';
|
|
|
2
2
|
export { default as ChevronLeft } from './chevron-left';
|
|
3
3
|
export { default as ChevronRight } from './chevron-right';
|
|
4
4
|
export { default as ChevronUp } from './chevron-up';
|
|
5
|
+
export { default as Ellipsis } from './ellipsis';
|
|
5
6
|
export { default as Search } from './search';
|
|
6
7
|
export { AlertTriangle, Check, InfoCircle } from './status';
|
|
7
8
|
export { default as XMark } from './x-mark';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/search.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
className: "h-6 w-6",
|
|
12
|
+
...t,
|
|
13
|
+
children: /* @__PURE__ */ e("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/icons/x-mark.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
className: "h-6 w-6",
|
|
12
|
+
...t,
|
|
13
|
+
children: /* @__PURE__ */ e("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "M6 18 18 6M6 6l12 12"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as Menu, MenuContent, type MenuContentProps, MenuHeader, MenuItem, type MenuItemProps, type MenuProps, MenuSeparator, MenuTrigger, type MenuTriggerProps, } from './menu';
|
|
2
2
|
export { default as AnimatedNumber, AnimatedMoney, type AnimatedNumberProps } from './animated-number';
|
|
3
3
|
export { default as Avatar, type AvatarProps, cropImageToSquare, ImageCropError } from './avatar';
|
|
4
4
|
export { default as Backdrop } from './backdrop';
|
|
5
5
|
export { default as Badge } from './badge';
|
|
6
6
|
export { default as Button, buttonVariants } from './button';
|
|
7
|
-
export { default as Card, Stat, StatRow } from './card';
|
|
7
|
+
export { default as Card, CardDescription, CardHeader, type CardProps, CardTitle, type CardTitleProps, Stat, StatRow, } from './card';
|
|
8
8
|
export { default as CodeBlock } from './code-block';
|
|
9
|
+
export { default as Chip, type ChipProps } from './chip';
|
|
9
10
|
export { default as Collapse } from './collapse';
|
|
11
|
+
export { default as Combobox, ComboboxCreate, ComboboxEmpty, ComboboxItem, ComboboxList, ComboboxPopup, type ComboboxProps, ComboboxSearch, ComboboxTrigger, } from './combobox';
|
|
10
12
|
export { default as ConfirmDialog } from './confirm-dialog';
|
|
11
|
-
export { default as Dialog } from './dialog';
|
|
13
|
+
export { default as Dialog, DialogClose, DialogFooter, type DialogProps } from './dialog';
|
|
12
14
|
export { default as EditableCell, type EditableCellProps } from './editable-cell';
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
+
export { default as Disclosure, DisclosureContent, type DisclosureProps, DisclosureTrigger } from './disclosure';
|
|
16
|
+
export { default as Field, type FieldControl, type FieldProps, FormMessage, type FormMessageProps, useField, useFieldProps, } from './field';
|
|
15
17
|
export { default as Header } from './header';
|
|
18
|
+
export { default as Inset, type InsetProps } from './inset';
|
|
16
19
|
export * from './icons';
|
|
17
20
|
export { default as Input } from './input';
|
|
18
21
|
export { default as InputGroup, InputGroupAddon, InputGroupInput } from './input-group';
|
|
19
22
|
export { default as Meter, type MeterProps } from './meter';
|
|
20
23
|
export { default as MonthPicker, type MonthPickerProps } from './month-picker';
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
24
|
+
export { default as Checkbox, type CheckboxProps } from './checkbox';
|
|
25
|
+
export { default as Chart, ChartArea, type ChartAreaProps, ChartBar, type ChartBarProps, ChartLine, type ChartLineProps, type ChartProps, ChartReference, type ChartReferenceProps, type ChartSeriesProps, ChartTooltipCard, type ChartTooltipCardProps, DonutChart, type DonutChartProps, niceTicks, } from './chart';
|
|
26
|
+
export { Radio, default as RadioGroup, type RadioGroupProps, type RadioProps } from './radio-group';
|
|
27
|
+
export { default as Calendar, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps } from './calendar';
|
|
28
|
+
export { default as DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps } from './date-picker';
|
|
29
|
+
export { type CurrencyConversion, default as MoneyInput, MoneyConversionHint, MoneyCurrencyMenu, type MoneyInputOptions, type MoneyInputProps, type MoneyInputState, useMoneyInput, } from './money-input';
|
|
30
|
+
export { RadioCard, type RadioCardProps, default as RadioCards, type RadioCardsProps } from './radio-cards';
|
|
31
|
+
export { default as Pills, Pill, PillIndicator } from './pills';
|
|
23
32
|
export { default as PageHeader } from './page-header';
|
|
24
|
-
export { default as Popover } from './popover';
|
|
33
|
+
export { default as Popover, PopoverClose, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, } from './popover';
|
|
25
34
|
export { default as ProgressRing } from './progress-ring';
|
|
26
|
-
export { default as Segmented } from './segmented';
|
|
27
|
-
export { default as Select, type
|
|
35
|
+
export { default as Segmented, SegmentedItem, type SegmentedItemProps, type SegmentedProps } from './segmented';
|
|
36
|
+
export { default as Select, SelectGroup, SelectItem, type SelectItemProps, type SelectProps, SelectSeparator, } from './select';
|
|
28
37
|
export { default as SideNav, SideNavGroup, SideNavLink } from './side-nav';
|
|
29
38
|
export { default as Skeleton } from './skeleton';
|
|
30
39
|
export { default as Slider, type SliderProps } from './slider';
|
|
@@ -37,6 +46,7 @@ export { type Tree, TreeCell, TreeLabel, TreeRow, type TreeRowData, TreeToggle,
|
|
|
37
46
|
export { default as TextArea } from './textarea';
|
|
38
47
|
export { default as ToastProvider, type ToastOptions, type ToastProviderProps, type ToastTone, useToast, useToastHost, } from './toast';
|
|
39
48
|
export { default as Toggle } from './toggle';
|
|
49
|
+
export { default as Tooltip, TooltipContent, type TooltipContentProps, TooltipTrigger, type TooltipTriggerProps, } from './tooltip';
|
|
40
50
|
export { FieldChevron } from './utils/field-chevron';
|
|
41
51
|
export { default as ThemeToggle, ThemeScript, themeScript } from './theme-toggle';
|
|
42
52
|
export { cva, type VariantProps } from './utils/cva';
|
|
@@ -44,10 +54,12 @@ export { cx } from './utils/cx';
|
|
|
44
54
|
export { type Appearance, applyPreset, applyTheme, contrastRatio, customize, DEFAULT_THEME, type Intensity, INTENSITIES, normalizeTheme, oklchToLinearRgb, type PresetId, PRESETS, resetTheme, type ThemeSettings, themeVars, } from './utils/theme';
|
|
45
55
|
export { useHydrated } from './utils/useHydrated';
|
|
46
56
|
export { addMonths, currentMonth, formatMonth, fromMonthIndex, isMonth, type Month, monthIndex, monthNames, monthRange, monthsBetween, } from './utils/month';
|
|
57
|
+
export { addDays, addMonthsToDate, type DateRange, type DateString, dayIndex, dayOfWeek, daysBetween, daysInMonth, formatDate, formatDateRange, fromDayIndex, isDate, today, weekdayNames, weekStart, } from './utils/date';
|
|
47
58
|
export { type AnchoredPopupOptions, useAnchoredPopup } from './utils/useAnchoredPopup';
|
|
48
59
|
export { useVirtualList, type VirtualItem, type VirtualListOptions } from './utils/useVirtualList';
|
|
49
60
|
export { applyGraphicsMode, detectGraphicsMode, type GraphicsMode } from './utils/graphics';
|
|
50
61
|
export { currencySymbol, formatAmount, formatMoney, type Money, MoneyParseError, minorDigits, parseMoney, parseMoneyInput, } from './utils/money';
|
|
62
|
+
export { convertMinor, type ForeignAmount, isRateTable, rateBetween, type RateTable, RateUnavailableError, } from './utils/fx';
|
|
51
63
|
declare module 'react' {
|
|
52
64
|
interface CSSProperties {
|
|
53
65
|
[key: `--${string}`]: string | number;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AACf,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AACf,OAAO,EACH,OAAO,IAAI,IAAI,EACf,WAAW,EACX,KAAK,gBAAgB,EACrB,UAAU,EACV,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,aAAa,EACb,WAAW,EACX,KAAK,gBAAgB,GACxB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAClG,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACH,OAAO,IAAI,IAAI,EACf,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,cAAc,E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AO,EACP,KAAK,KAAK,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,aAAa,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,OAAO,EACP,eAAe,EACf,KAAK,SAAS,EACd,KAAK,UAAU,EACf,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,YAAY,EACZ,MAAM,EACN,KAAK,EACL,YAAY,EACZ,SAAS,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EACH,cAAc,EACd,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,eAAe,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,YAAY,EACZ,KAAK,aAAa,EAClB,WAAW,EACX,WAAW,EACX,KAAK,SAAS,EACd,oBAAoB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,QAAQ,OAAO,CAAC;IACnB,UAAU,aAAa;QACnB,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC;KACzC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/input/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,UAAU,+BAkB9C;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { FIELD as t } from "../utils/styles.js";
|
|
4
|
+
import { useFieldProps as n } from "../field/index.js";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region packages/input/index.tsx
|
|
7
|
+
function i(i) {
|
|
8
|
+
let { className: a, ...o } = i, s = n(o);
|
|
9
|
+
return /* @__PURE__ */ r("input", {
|
|
10
|
+
className: e(t, "w-full", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", "file:text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium", "[[type=\"checkbox\"]]:accent-primary [[type=\"checkbox\"]]:h-4 [[type=\"checkbox\"]]:w-4 [[type=\"checkbox\"]]:rounded-sm", "[[type=\"radio\"]]:accent-primary [[type=\"radio\"]]:h-4 [[type=\"radio\"]]:w-4", a),
|
|
11
|
+
...o,
|
|
12
|
+
...s
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { i as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/input-group/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/input-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,+BA0B/F;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,+BAY9E;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,+BAU7E;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { FIELD_WITHIN as t } from "../utils/styles.js";
|
|
4
|
+
import { useFieldProps as n } from "../field/index.js";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region packages/input-group/index.tsx
|
|
7
|
+
function i({ invalid: n, className: i, onMouseDown: a, ...o }) {
|
|
8
|
+
return /* @__PURE__ */ r("div", {
|
|
9
|
+
"data-invalid": n || void 0,
|
|
10
|
+
className: e("zen__input-group cursor-text", t, "has-disabled:bg-muted has-disabled:text-muted-foreground has-disabled:cursor-not-allowed", "data-invalid:border-destructive data-invalid:focus-within:border-destructive data-invalid:focus-within:shadow-[0_0_0_3px_oklch(var(--destructive)/0.16)]", i),
|
|
11
|
+
onMouseDown: (e) => {
|
|
12
|
+
a?.(e);
|
|
13
|
+
let t = e.target;
|
|
14
|
+
if (e.defaultPrevented || t.closest("input, textarea, button, a, select, [tabindex]")) return;
|
|
15
|
+
let n = e.currentTarget.querySelector("input:not(:disabled)");
|
|
16
|
+
n && (e.preventDefault(), n.focus());
|
|
17
|
+
},
|
|
18
|
+
...o
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function a({ className: t, ...i }) {
|
|
22
|
+
let a = n(i);
|
|
23
|
+
return /* @__PURE__ */ r("input", {
|
|
24
|
+
className: e("placeholder:text-muted-foreground h-full w-full min-w-0 flex-1 bg-transparent text-sm outline-hidden disabled:cursor-not-allowed", t),
|
|
25
|
+
...i,
|
|
26
|
+
...a
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function o({ className: t, ...n }) {
|
|
30
|
+
return /* @__PURE__ */ r("span", {
|
|
31
|
+
className: e("text-muted-foreground flex shrink-0 items-center gap-1 text-sm select-none [&_svg]:size-4", t),
|
|
32
|
+
...n
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { o as InputGroupAddon, a as InputGroupInput, i as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A faint box set into a card or dialog: a small tile for one figure (e.g.
|
|
4
|
+
* "Next EMI"), or with `bordered`, a panel for a result or a note. `tone`
|
|
5
|
+
* tints it for good or bad news. With `asChild`, your own element (a <p>, a
|
|
6
|
+
* status region) gets its look.
|
|
7
|
+
*/
|
|
8
|
+
export default function Inset({ bordered, tone, asChild, className, ...rest }: InsetProps): import('react').JSX.Element;
|
|
9
|
+
export interface InsetProps extends ComponentProps<'div'> {
|
|
10
|
+
/** A bordered panel instead of a small tile. */
|
|
11
|
+
bordered?: boolean;
|
|
12
|
+
tone?: 'default' | 'positive' | 'negative';
|
|
13
|
+
/** Put the look on your single child element instead of a <div>. */
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/inset/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAavC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAgB,EAAE,IAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,+BAW5G;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,KAAK,CAAC;IACrD,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC3C,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
|