@clasing/ui 0.1.123 → 0.1.125
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/dist/badge-BnerQ2lF.js +85 -0
- package/dist/badge-Czof3oqL.cjs +1 -0
- package/dist/button-Cegl49Yi.cjs +1 -0
- package/dist/button-DddHyyHa.js +504 -0
- package/dist/calendar-BAQkzm4v.js +117 -0
- package/dist/calendar-DL8gqdRp.cjs +1 -0
- package/dist/card-BCgtou88.cjs +1 -0
- package/dist/card-BfBXE5Kq.js +90 -0
- package/dist/chip-A32aAc-8.cjs +1 -0
- package/dist/chip-ZZHZ8i1Q.js +127 -0
- package/dist/command-BGCSJ9vX.js +506 -0
- package/dist/command-D9M8dk1M.cjs +1 -0
- package/dist/components/accordion.cjs.js +1 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.es.js +70 -0
- package/dist/components/alert-dialog.cjs.js +1 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.es.js +146 -0
- package/dist/components/alert.cjs.js +1 -0
- package/dist/components/alert.d.ts +15 -0
- package/dist/components/alert.es.js +97 -0
- package/dist/components/avatar.cjs.js +1 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.es.js +53 -0
- package/dist/components/badge.cjs.js +1 -0
- package/dist/components/badge.d.ts +18 -0
- package/dist/components/badge.es.js +4 -0
- package/dist/components/blocks/date-picker.cjs.js +1 -0
- package/dist/components/blocks/date-picker.d.ts +30 -0
- package/dist/components/blocks/date-picker.es.js +181 -0
- package/dist/components/blocks/date-range-picker.cjs.js +1 -0
- package/dist/components/blocks/date-range-picker.d.ts +29 -0
- package/dist/components/blocks/date-range-picker.es.js +238 -0
- package/dist/components/blocks/interactive-card.cjs.js +1 -0
- package/dist/components/blocks/interactive-card.d.ts +26 -0
- package/dist/components/blocks/interactive-card.es.js +138 -0
- package/dist/components/blocks/selectable-chips.cjs.js +1 -0
- package/dist/components/blocks/selectable-chips.d.ts +16 -0
- package/dist/components/blocks/selectable-chips.es.js +57 -0
- package/dist/components/breadcrumb.cjs.js +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.es.js +106 -0
- package/dist/components/button.cjs.js +1 -0
- package/dist/components/button.d.ts +39 -0
- package/dist/components/button.es.js +7 -0
- package/dist/components/calendar.cjs.js +1 -0
- package/dist/components/calendar.d.ts +15 -0
- package/dist/components/calendar.es.js +4 -0
- package/dist/components/card.cjs.js +1 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.es.js +10 -0
- package/dist/components/chart.cjs.js +7 -0
- package/dist/components/chart.d.ts +43 -0
- package/dist/components/chart.es.js +213 -0
- package/dist/components/checkbox.cjs.js +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.es.js +31 -0
- package/dist/components/chip.cjs.js +1 -0
- package/dist/components/chip.d.ts +25 -0
- package/dist/components/chip.es.js +5 -0
- package/dist/components/collapsible.cjs.js +1 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.es.js +34 -0
- package/dist/components/command.cjs.js +1 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/command.es.js +12 -0
- package/dist/components/context-menu.cjs.js +1 -0
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.es.js +229 -0
- package/dist/components/dialog.cjs.js +1 -0
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.es.js +13 -0
- package/dist/components/divider.cjs.js +1 -0
- package/dist/components/divider.d.ts +6 -0
- package/dist/components/divider.es.js +21 -0
- package/dist/components/drawer.cjs.js +3 -0
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.es.js +1161 -0
- package/dist/components/dropdown-menu.cjs.js +1 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.es.js +237 -0
- package/dist/components/hover-card.cjs.js +1 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.es.js +38 -0
- package/dist/components/icon-component.cjs.js +1 -0
- package/dist/components/icon-component.d.ts +12 -0
- package/dist/components/icon-component.es.js +4 -0
- package/dist/components/input-otp.cjs.js +20 -0
- package/dist/components/input-otp.d.ts +11 -0
- package/dist/components/input-otp.es.js +253 -0
- package/dist/components/input.cjs.js +1 -0
- package/dist/components/input.d.ts +32 -0
- package/dist/components/input.es.js +4 -0
- package/dist/components/label.cjs.js +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.es.js +4 -0
- package/dist/components/menubar.cjs.js +1 -0
- package/dist/components/menubar.d.ts +26 -0
- package/dist/components/menubar.es.js +257 -0
- package/dist/components/multi-select.cjs.js +1 -0
- package/dist/components/multi-select.d.ts +32 -0
- package/dist/components/multi-select.es.js +233 -0
- package/dist/components/navigation-menu.cjs.js +1 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu.es.js +171 -0
- package/dist/components/phone-input.cjs.js +1 -0
- package/dist/components/phone-input.d.ts +14 -0
- package/dist/components/phone-input.es.js +253 -0
- package/dist/components/popover.cjs.js +1 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.es.js +7 -0
- package/dist/components/progress.cjs.js +1 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/progress.es.js +31 -0
- package/dist/components/resizable.cjs.js +1 -0
- package/dist/components/resizable.d.ts +8 -0
- package/dist/components/resizable.es.js +1551 -0
- package/dist/components/scroll-area.cjs.js +1 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.es.js +5 -0
- package/dist/components/select.cjs.js +1 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.es.js +179 -0
- package/dist/components/sheet.cjs.js +1 -0
- package/dist/components/sheet.d.ts +13 -0
- package/dist/components/sheet.es.js +126 -0
- package/dist/components/skeleton.cjs.js +1 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.es.js +15 -0
- package/dist/components/slider.cjs.js +1 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.es.js +63 -0
- package/dist/components/sonner.cjs.js +1 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/sonner.es.js +68 -0
- package/dist/components/switch.cjs.js +1 -0
- package/dist/components/switch.d.ts +11 -0
- package/dist/components/switch.es.js +82 -0
- package/dist/components/table.cjs.js +1 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.es.js +114 -0
- package/dist/components/toggle-group.cjs.js +1 -0
- package/dist/components/toggle-group.d.ts +7 -0
- package/dist/components/toggle-group.es.js +62 -0
- package/dist/components/toggle.cjs.js +1 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.es.js +5 -0
- package/dist/components/tooltip.cjs.js +1 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.es.js +7 -0
- package/dist/dialog-BKm2PZl2.cjs +1 -0
- package/dist/dialog-DZpF7OXg.js +136 -0
- package/dist/entries/accordion.d.ts +2 -0
- package/dist/entries/alert-dialog.d.ts +2 -0
- package/dist/entries/alert.d.ts +2 -0
- package/dist/entries/avatar.d.ts +2 -0
- package/dist/entries/badge.d.ts +2 -0
- package/dist/entries/blocks/date-picker.d.ts +2 -0
- package/dist/entries/blocks/date-range-picker.d.ts +2 -0
- package/dist/entries/blocks/interactive-card.d.ts +2 -0
- package/dist/entries/blocks/selectable-chips.d.ts +2 -0
- package/dist/entries/breadcrumb.d.ts +2 -0
- package/dist/entries/button.d.ts +2 -0
- package/dist/entries/calendar.d.ts +2 -0
- package/dist/entries/card.d.ts +2 -0
- package/dist/entries/chart.d.ts +2 -0
- package/dist/entries/checkbox.d.ts +2 -0
- package/dist/entries/chip.d.ts +2 -0
- package/dist/entries/collapsible.d.ts +2 -0
- package/dist/entries/command.d.ts +2 -0
- package/dist/entries/context-menu.d.ts +2 -0
- package/dist/entries/dialog.d.ts +2 -0
- package/dist/entries/divider.d.ts +2 -0
- package/dist/entries/drawer.d.ts +2 -0
- package/dist/entries/dropdown-menu.d.ts +2 -0
- package/dist/entries/hooks/useOutsideClick.d.ts +2 -0
- package/dist/entries/hover-card.d.ts +2 -0
- package/dist/entries/icon-component.d.ts +2 -0
- package/dist/entries/input-otp.d.ts +2 -0
- package/dist/entries/input.d.ts +2 -0
- package/dist/entries/label.d.ts +2 -0
- package/dist/entries/menubar.d.ts +2 -0
- package/dist/entries/multi-select.d.ts +2 -0
- package/dist/entries/navigation-menu.d.ts +2 -0
- package/dist/entries/phone-input.d.ts +2 -0
- package/dist/entries/popover.d.ts +2 -0
- package/dist/entries/progress.d.ts +2 -0
- package/dist/entries/resizable.d.ts +2 -0
- package/dist/entries/scroll-area.d.ts +2 -0
- package/dist/entries/select.d.ts +2 -0
- package/dist/entries/sheet.d.ts +2 -0
- package/dist/entries/skeleton.d.ts +2 -0
- package/dist/entries/slider.d.ts +2 -0
- package/dist/entries/sonner.d.ts +2 -0
- package/dist/entries/switch.d.ts +2 -0
- package/dist/entries/table.d.ts +2 -0
- package/dist/entries/toggle-group.d.ts +2 -0
- package/dist/entries/toggle.d.ts +2 -0
- package/dist/entries/tooltip.d.ts +2 -0
- package/dist/entries/utils/types.d.ts +2 -0
- package/dist/hooks/useOutsideClick.cjs.js +1 -0
- package/dist/hooks/useOutsideClick.d.ts +6 -0
- package/dist/hooks/useOutsideClick.es.js +14 -0
- package/dist/icon-component-BZ-4FDV6.js +49 -0
- package/dist/icon-component-LY_vGYHZ.cjs +1 -0
- package/dist/index-BqtVL8d-.js +34 -0
- package/dist/index-C8P6Mn4U.cjs +1 -0
- package/dist/index-CRiPKpXj.js +2743 -0
- package/dist/index-DoxiiusW.cjs +1 -0
- package/dist/input-DFPJ_mtM.cjs +1 -0
- package/dist/input-DwPDvbRE.js +174 -0
- package/dist/jsx-runtime-C5mzlN2N.js +284 -0
- package/dist/jsx-runtime-DUiatUiq.cjs +22 -0
- package/dist/label-BpDUqtrC.js +22 -0
- package/dist/label-CbzkBbPT.cjs +1 -0
- package/dist/popover-B8wp2cHF.cjs +1 -0
- package/dist/popover-BoDRCUh2.js +44 -0
- package/dist/scroll-area-CNsThIs_.js +60 -0
- package/dist/scroll-area-Dr-7opp_.cjs +1 -0
- package/dist/style-BNIXVvBA.js +1172 -0
- package/dist/style-CA5976Oh.cjs +1 -0
- package/dist/tests/setup.d.ts +1 -0
- package/dist/toggle-Dgd7L2Mq.cjs +1 -0
- package/dist/toggle-DjbiWYXD.js +44 -0
- package/dist/tooltip-Btr9ROSo.js +55 -0
- package/dist/tooltip-W9iE1O--.cjs +1 -0
- package/dist/ui.css +427 -16
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/types/index.d.ts +36 -0
- package/dist/utils/types.cjs.js +1 -0
- package/dist/utils/types.es.js +1 -0
- package/package.json +301 -38
- package/dist/index.d.ts +0 -566
- package/dist/index.es.js +0 -7538
- package/dist/index.umd.js +0 -22
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { j as I } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { c as K } from "../index-CRiPKpXj.js";
|
|
4
|
+
import { I as Te } from "../icon-component-BZ-4FDV6.js";
|
|
5
|
+
var Re = Object.defineProperty, Oe = Object.defineProperties, De = Object.getOwnPropertyDescriptors, Q = Object.getOwnPropertySymbols, ve = Object.prototype.hasOwnProperty, ge = Object.prototype.propertyIsEnumerable, fe = (n, a, l) => a in n ? Re(n, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[a] = l, Ie = (n, a) => {
|
|
6
|
+
for (var l in a || (a = {})) ve.call(a, l) && fe(n, l, a[l]);
|
|
7
|
+
if (Q) for (var l of Q(a)) ge.call(a, l) && fe(n, l, a[l]);
|
|
8
|
+
return n;
|
|
9
|
+
}, Ae = (n, a) => Oe(n, De(a)), We = (n, a) => {
|
|
10
|
+
var l = {};
|
|
11
|
+
for (var u in n) ve.call(n, u) && a.indexOf(u) < 0 && (l[u] = n[u]);
|
|
12
|
+
if (n != null && Q) for (var u of Q(n)) a.indexOf(u) < 0 && ge.call(n, u) && (l[u] = n[u]);
|
|
13
|
+
return l;
|
|
14
|
+
};
|
|
15
|
+
function Be(n) {
|
|
16
|
+
let a = setTimeout(n, 0), l = setTimeout(n, 10), u = setTimeout(n, 50);
|
|
17
|
+
return [a, l, u];
|
|
18
|
+
}
|
|
19
|
+
function _e(n) {
|
|
20
|
+
let a = t.useRef();
|
|
21
|
+
return t.useEffect(() => {
|
|
22
|
+
a.current = n;
|
|
23
|
+
}), a.current;
|
|
24
|
+
}
|
|
25
|
+
var Fe = 18, he = 40, Ne = `${he}px`, He = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
26
|
+
function Le({ containerRef: n, inputRef: a, pushPasswordManagerStrategy: l, isFocused: u }) {
|
|
27
|
+
let [x, d] = t.useState(!1), [M, k] = t.useState(!1), [A, N] = t.useState(!1), H = t.useMemo(() => l === "none" ? !1 : (l === "increase-width" || l === "experimental-no-flickering") && x && M, [x, M, l]), W = t.useCallback(() => {
|
|
28
|
+
let f = n.current, y = a.current;
|
|
29
|
+
if (!f || !y || A || l === "none") return;
|
|
30
|
+
let h = f, E = h.getBoundingClientRect().left + h.offsetWidth, B = h.getBoundingClientRect().top + h.offsetHeight / 2, i = E - Fe, L = B;
|
|
31
|
+
document.querySelectorAll(He).length === 0 && document.elementFromPoint(i, L) === f || (d(!0), N(!0));
|
|
32
|
+
}, [n, a, A, l]);
|
|
33
|
+
return t.useEffect(() => {
|
|
34
|
+
let f = n.current;
|
|
35
|
+
if (!f || l === "none") return;
|
|
36
|
+
function y() {
|
|
37
|
+
let E = window.innerWidth - f.getBoundingClientRect().right;
|
|
38
|
+
k(E >= he);
|
|
39
|
+
}
|
|
40
|
+
y();
|
|
41
|
+
let h = setInterval(y, 1e3);
|
|
42
|
+
return () => {
|
|
43
|
+
clearInterval(h);
|
|
44
|
+
};
|
|
45
|
+
}, [n, l]), t.useEffect(() => {
|
|
46
|
+
let f = u || document.activeElement === a.current;
|
|
47
|
+
if (l === "none" || !f) return;
|
|
48
|
+
let y = setTimeout(W, 0), h = setTimeout(W, 2e3), E = setTimeout(W, 5e3), B = setTimeout(() => {
|
|
49
|
+
N(!0);
|
|
50
|
+
}, 6e3);
|
|
51
|
+
return () => {
|
|
52
|
+
clearTimeout(y), clearTimeout(h), clearTimeout(E), clearTimeout(B);
|
|
53
|
+
};
|
|
54
|
+
}, [a, u, l, W]), { hasPWMBadge: x, willPushPWMBadge: H, PWM_BADGE_SPACE_WIDTH: Ne };
|
|
55
|
+
}
|
|
56
|
+
var be = t.createContext({}), we = t.forwardRef((n, a) => {
|
|
57
|
+
var l = n, { value: u, onChange: x, maxLength: d, textAlign: M = "left", pattern: k, placeholder: A, inputMode: N = "numeric", onComplete: H, pushPasswordManagerStrategy: W = "increase-width", pasteTransformer: f, containerClassName: y, noScriptCSSFallback: h = Ge, render: E, children: B } = l, i = We(l, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), L, ne, re, ae, le;
|
|
58
|
+
let [xe, Ee] = t.useState(typeof i.defaultValue == "string" ? i.defaultValue : ""), s = u ?? xe, j = _e(s), G = t.useCallback((e) => {
|
|
59
|
+
x?.(e), Ee(e);
|
|
60
|
+
}, [x]), w = t.useMemo(() => k ? typeof k == "string" ? new RegExp(k) : k : null, [k]), c = t.useRef(null), U = t.useRef(null), X = t.useRef({ value: s, onChange: G, isIOS: typeof window < "u" && ((ne = (L = window?.CSS) == null ? void 0 : L.supports) == null ? void 0 : ne.call(L, "-webkit-touch-callout", "none")) }), Z = t.useRef({ prev: [(re = c.current) == null ? void 0 : re.selectionStart, (ae = c.current) == null ? void 0 : ae.selectionEnd, (le = c.current) == null ? void 0 : le.selectionDirection] });
|
|
61
|
+
t.useImperativeHandle(a, () => c.current, []), t.useEffect(() => {
|
|
62
|
+
let e = c.current, r = U.current;
|
|
63
|
+
if (!e || !r) return;
|
|
64
|
+
X.current.value !== e.value && X.current.onChange(e.value), Z.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
|
|
65
|
+
function p() {
|
|
66
|
+
if (document.activeElement !== e) {
|
|
67
|
+
z(null), V(null);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
let o = e.selectionStart, m = e.selectionEnd, J = e.selectionDirection, b = e.maxLength, R = e.value, S = Z.current.prev, C = -1, P = -1, O;
|
|
71
|
+
if (R.length !== 0 && o !== null && m !== null) {
|
|
72
|
+
let Me = o === m, ke = o === R.length && R.length < b;
|
|
73
|
+
if (Me && !ke) {
|
|
74
|
+
let D = o;
|
|
75
|
+
if (D === 0) C = 0, P = 1, O = "forward";
|
|
76
|
+
else if (D === b) C = D - 1, P = D, O = "backward";
|
|
77
|
+
else if (b > 1 && R.length > 1) {
|
|
78
|
+
let te = 0;
|
|
79
|
+
if (S[0] !== null && S[1] !== null) {
|
|
80
|
+
O = D < S[1] ? "backward" : "forward";
|
|
81
|
+
let je = S[0] === S[1] && S[0] < b;
|
|
82
|
+
O === "backward" && !je && (te = -1);
|
|
83
|
+
}
|
|
84
|
+
C = te + D, P = te + D + 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
C !== -1 && P !== -1 && C !== P && c.current.setSelectionRange(C, P, O);
|
|
88
|
+
}
|
|
89
|
+
let pe = C !== -1 ? C : o, me = P !== -1 ? P : m, Pe = O ?? J;
|
|
90
|
+
z(pe), V(me), Z.current.prev = [pe, me, Pe];
|
|
91
|
+
}
|
|
92
|
+
if (document.addEventListener("selectionchange", p, { capture: !0 }), p(), document.activeElement === e && Y(!0), !document.getElementById("input-otp-style")) {
|
|
93
|
+
let o = document.createElement("style");
|
|
94
|
+
if (o.id = "input-otp-style", document.head.appendChild(o), o.sheet) {
|
|
95
|
+
let m = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
96
|
+
q(o.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), q(o.sheet, `[data-input-otp]:autofill { ${m} }`), q(o.sheet, `[data-input-otp]:-webkit-autofill { ${m} }`), q(o.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), q(o.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
let v = () => {
|
|
100
|
+
r && r.style.setProperty("--root-height", `${e.clientHeight}px`);
|
|
101
|
+
};
|
|
102
|
+
v();
|
|
103
|
+
let g = new ResizeObserver(v);
|
|
104
|
+
return g.observe(e), () => {
|
|
105
|
+
document.removeEventListener("selectionchange", p, { capture: !0 }), g.disconnect();
|
|
106
|
+
};
|
|
107
|
+
}, []);
|
|
108
|
+
let [oe, ie] = t.useState(!1), [$, Y] = t.useState(!1), [T, z] = t.useState(null), [_, V] = t.useState(null);
|
|
109
|
+
t.useEffect(() => {
|
|
110
|
+
Be(() => {
|
|
111
|
+
var e, r, p, v;
|
|
112
|
+
(e = c.current) == null || e.dispatchEvent(new Event("input"));
|
|
113
|
+
let g = (r = c.current) == null ? void 0 : r.selectionStart, o = (p = c.current) == null ? void 0 : p.selectionEnd, m = (v = c.current) == null ? void 0 : v.selectionDirection;
|
|
114
|
+
g !== null && o !== null && (z(g), V(o), Z.current.prev = [g, o, m]);
|
|
115
|
+
});
|
|
116
|
+
}, [s, $]), t.useEffect(() => {
|
|
117
|
+
j !== void 0 && s !== j && j.length < d && s.length === d && H?.(s);
|
|
118
|
+
}, [d, H, j, s]);
|
|
119
|
+
let F = Le({ containerRef: U, inputRef: c, pushPasswordManagerStrategy: W, isFocused: $ }), ue = t.useCallback((e) => {
|
|
120
|
+
let r = e.currentTarget.value.slice(0, d);
|
|
121
|
+
if (r.length > 0 && w && !w.test(r)) {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
typeof j == "string" && r.length < j.length && document.dispatchEvent(new Event("selectionchange")), G(r);
|
|
126
|
+
}, [d, G, j, w]), se = t.useCallback(() => {
|
|
127
|
+
var e;
|
|
128
|
+
if (c.current) {
|
|
129
|
+
let r = Math.min(c.current.value.length, d - 1), p = c.current.value.length;
|
|
130
|
+
(e = c.current) == null || e.setSelectionRange(r, p), z(r), V(p);
|
|
131
|
+
}
|
|
132
|
+
Y(!0);
|
|
133
|
+
}, [d]), ce = t.useCallback((e) => {
|
|
134
|
+
var r, p;
|
|
135
|
+
let v = c.current;
|
|
136
|
+
if (!f && (!X.current.isIOS || !e.clipboardData || !v)) return;
|
|
137
|
+
let g = e.clipboardData.getData("text/plain"), o = f ? f(g) : g;
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
let m = (r = c.current) == null ? void 0 : r.selectionStart, J = (p = c.current) == null ? void 0 : p.selectionEnd, b = (m !== J ? s.slice(0, m) + o + s.slice(J) : s.slice(0, m) + o + s.slice(m)).slice(0, d);
|
|
140
|
+
if (b.length > 0 && w && !w.test(b)) return;
|
|
141
|
+
v.value = b, G(b);
|
|
142
|
+
let R = Math.min(b.length, d - 1), S = b.length;
|
|
143
|
+
v.setSelectionRange(R, S), z(R), V(S);
|
|
144
|
+
}, [d, G, w, s]), Se = t.useMemo(() => ({ position: "relative", cursor: i.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [i.disabled]), de = t.useMemo(() => ({ position: "absolute", inset: 0, width: F.willPushPWMBadge ? `calc(100% + ${F.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: F.willPushPWMBadge ? `inset(0 ${F.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: M, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [F.PWM_BADGE_SPACE_WIDTH, F.willPushPWMBadge, M]), ye = t.useMemo(() => t.createElement("input", Ae(Ie({ autoComplete: i.autoComplete || "one-time-code" }, i), { "data-input-otp": !0, "data-input-otp-placeholder-shown": s.length === 0 || void 0, "data-input-otp-mss": T, "data-input-otp-mse": _, inputMode: N, pattern: w?.source, "aria-placeholder": A, style: de, maxLength: d, value: s, ref: c, onPaste: (e) => {
|
|
145
|
+
var r;
|
|
146
|
+
ce(e), (r = i.onPaste) == null || r.call(i, e);
|
|
147
|
+
}, onChange: ue, onMouseOver: (e) => {
|
|
148
|
+
var r;
|
|
149
|
+
ie(!0), (r = i.onMouseOver) == null || r.call(i, e);
|
|
150
|
+
}, onMouseLeave: (e) => {
|
|
151
|
+
var r;
|
|
152
|
+
ie(!1), (r = i.onMouseLeave) == null || r.call(i, e);
|
|
153
|
+
}, onFocus: (e) => {
|
|
154
|
+
var r;
|
|
155
|
+
se(), (r = i.onFocus) == null || r.call(i, e);
|
|
156
|
+
}, onBlur: (e) => {
|
|
157
|
+
var r;
|
|
158
|
+
Y(!1), (r = i.onBlur) == null || r.call(i, e);
|
|
159
|
+
} })), [ue, se, ce, N, de, d, _, T, i, w?.source, s]), ee = t.useMemo(() => ({ slots: Array.from({ length: d }).map((e, r) => {
|
|
160
|
+
var p;
|
|
161
|
+
let v = $ && T !== null && _ !== null && (T === _ && r === T || r >= T && r < _), g = s[r] !== void 0 ? s[r] : null, o = s[0] !== void 0 ? null : (p = A?.[r]) != null ? p : null;
|
|
162
|
+
return { char: g, placeholderChar: o, isActive: v, hasFakeCaret: v && g === null };
|
|
163
|
+
}), isFocused: $, isHovering: !i.disabled && oe }), [$, oe, d, _, T, i.disabled, s]), Ce = t.useMemo(() => E ? E(ee) : t.createElement(be.Provider, { value: ee }, B), [B, ee, E]);
|
|
164
|
+
return t.createElement(t.Fragment, null, h !== null && t.createElement("noscript", null, t.createElement("style", null, h)), t.createElement("div", { ref: U, "data-input-otp-container": !0, style: Se, className: y }, Ce, t.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, ye)));
|
|
165
|
+
});
|
|
166
|
+
we.displayName = "Input";
|
|
167
|
+
function q(n, a) {
|
|
168
|
+
try {
|
|
169
|
+
n.insertRule(a);
|
|
170
|
+
} catch {
|
|
171
|
+
console.error("input-otp could not insert CSS rule:", a);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
var Ge = `
|
|
175
|
+
[data-input-otp] {
|
|
176
|
+
--nojs-bg: white !important;
|
|
177
|
+
--nojs-fg: black !important;
|
|
178
|
+
|
|
179
|
+
background-color: var(--nojs-bg) !important;
|
|
180
|
+
color: var(--nojs-fg) !important;
|
|
181
|
+
caret-color: var(--nojs-fg) !important;
|
|
182
|
+
letter-spacing: .25em !important;
|
|
183
|
+
text-align: center !important;
|
|
184
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
185
|
+
border-radius: 4px !important;
|
|
186
|
+
width: 100% !important;
|
|
187
|
+
}
|
|
188
|
+
@media (prefers-color-scheme: dark) {
|
|
189
|
+
[data-input-otp] {
|
|
190
|
+
--nojs-bg: black !important;
|
|
191
|
+
--nojs-fg: white !important;
|
|
192
|
+
}
|
|
193
|
+
}`;
|
|
194
|
+
function qe({
|
|
195
|
+
className: n,
|
|
196
|
+
containerClassName: a,
|
|
197
|
+
...l
|
|
198
|
+
}) {
|
|
199
|
+
return /* @__PURE__ */ I.jsx(
|
|
200
|
+
we,
|
|
201
|
+
{
|
|
202
|
+
"data-slot": "input-otp",
|
|
203
|
+
containerClassName: K(
|
|
204
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
205
|
+
a
|
|
206
|
+
),
|
|
207
|
+
className: K("disabled:cursor-not-allowed", n),
|
|
208
|
+
...l
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
function Ze({ className: n, ...a }) {
|
|
213
|
+
return /* @__PURE__ */ I.jsx(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
"data-slot": "input-otp-group",
|
|
217
|
+
className: K("flex items-center", n),
|
|
218
|
+
...a
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
function Je({
|
|
223
|
+
index: n,
|
|
224
|
+
className: a,
|
|
225
|
+
...l
|
|
226
|
+
}) {
|
|
227
|
+
const u = t.useContext(be), { char: x, hasFakeCaret: d, isActive: M } = u?.slots[n] ?? {};
|
|
228
|
+
return /* @__PURE__ */ I.jsxs(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
"data-slot": "input-otp-slot",
|
|
232
|
+
"data-active": M,
|
|
233
|
+
className: K(
|
|
234
|
+
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
235
|
+
a
|
|
236
|
+
),
|
|
237
|
+
...l,
|
|
238
|
+
children: [
|
|
239
|
+
x,
|
|
240
|
+
d && /* @__PURE__ */ I.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ I.jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function Ke({ ...n }) {
|
|
246
|
+
return /* @__PURE__ */ I.jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...n, children: /* @__PURE__ */ I.jsx(Te, { iconName: "IconMinus" }) });
|
|
247
|
+
}
|
|
248
|
+
export {
|
|
249
|
+
qe as InputOTP,
|
|
250
|
+
Ze as InputOTPGroup,
|
|
251
|
+
Ke as InputOTPSeparator,
|
|
252
|
+
Je as InputOTPSlot
|
|
253
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../input-DFPJ_mtM.cjs");exports.Input=t.Input;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { TablerIconName } from './icon-component';
|
|
4
|
+
declare const inputStyles: (props?: ({
|
|
5
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
6
|
+
rounded?: "default" | "full" | null | undefined;
|
|
7
|
+
state?: "default" | "error" | "success" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface InputProps extends VariantProps<typeof inputStyles> {
|
|
10
|
+
/** Label text shown above the input */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Helper text shown below the input */
|
|
13
|
+
helperText?: string;
|
|
14
|
+
/** Error message shown below the input */
|
|
15
|
+
error?: string;
|
|
16
|
+
/** Whether the input has been touched/blurred */
|
|
17
|
+
touched?: boolean;
|
|
18
|
+
/** Icon to display on the left side of the input */
|
|
19
|
+
iconLeft?: TablerIconName | {
|
|
20
|
+
name: TablerIconName;
|
|
21
|
+
stroke?: string;
|
|
22
|
+
};
|
|
23
|
+
/** Icon to display on the right side of the input */
|
|
24
|
+
iconRight?: TablerIconName | {
|
|
25
|
+
name: TablerIconName;
|
|
26
|
+
stroke?: string;
|
|
27
|
+
};
|
|
28
|
+
/** Container className for the entire input component including label and helper text */
|
|
29
|
+
containerClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
declare function Input({ className, label, helperText, error, touched, iconLeft, iconRight, type, size, rounded, state, containerClassName, ...props }: Omit<React.ComponentProps<'input'>, 'size'> & InputProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export { Input, inputStyles };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../label-CbzkBbPT.cjs");exports.Label=e.Label;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../jsx-runtime-DUiatUiq.cjs"),c=require("@radix-ui/react-menubar"),o=require("../index-DoxiiusW.cjs"),i=require("../icon-component-LY_vGYHZ.cjs");function m(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=m(c);function l({className:e,...t}){return n.jsxRuntimeExports.jsx(a.Root,{"data-slot":"menubar",className:o.cn("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function x({...e}){return n.jsxRuntimeExports.jsx(a.Menu,{"data-slot":"menubar-menu",...e})}function b({...e}){return n.jsxRuntimeExports.jsx(a.Group,{"data-slot":"menubar-group",...e})}function u({...e}){return n.jsxRuntimeExports.jsx(a.Portal,{"data-slot":"menubar-portal",...e})}function p({...e}){return n.jsxRuntimeExports.jsx(a.RadioGroup,{"data-slot":"menubar-radio-group",...e})}function f({className:e,...t}){return n.jsxRuntimeExports.jsx(a.Trigger,{"data-slot":"menubar-trigger",className:o.cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",e),...t})}function g({className:e,align:t="start",alignOffset:r=-4,sideOffset:s=8,...d}){return n.jsxRuntimeExports.jsx(u,{children:n.jsxRuntimeExports.jsx(a.Content,{"data-slot":"menubar-content",align:t,alignOffset:r,sideOffset:s,className:o.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",e),...d})})}function j({className:e,inset:t,variant:r="default",...s}){return n.jsxRuntimeExports.jsx(a.Item,{"data-slot":"menubar-item","data-inset":t,"data-variant":r,className:o.cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s})}function v({className:e,children:t,checked:r,...s}){return n.jsxRuntimeExports.jsxs(a.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:o.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:r,...s,children:[n.jsxRuntimeExports.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(a.ItemIndicator,{children:n.jsxRuntimeExports.jsx(i.IconComponent,{iconName:"IconCheck",className:"size-4"})})}),t]})}function M({className:e,children:t,...r}){return n.jsxRuntimeExports.jsxs(a.RadioItem,{"data-slot":"menubar-radio-item",className:o.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n.jsxRuntimeExports.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(a.ItemIndicator,{children:n.jsxRuntimeExports.jsx(i.IconComponent,{iconName:"IconCircle",className:"size-2 fill-current"})})}),t]})}function h({className:e,inset:t,...r}){return n.jsxRuntimeExports.jsx(a.Label,{"data-slot":"menubar-label","data-inset":t,className:o.cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function R({className:e,...t}){return n.jsxRuntimeExports.jsx(a.Separator,{"data-slot":"menubar-separator",className:o.cn("bg-border -mx-1 my-1 h-px",e),...t})}function E({className:e,...t}){return n.jsxRuntimeExports.jsx("span",{"data-slot":"menubar-shortcut",className:o.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function N({...e}){return n.jsxRuntimeExports.jsx(a.Sub,{"data-slot":"menubar-sub",...e})}function I({className:e,inset:t,children:r,...s}){return n.jsxRuntimeExports.jsxs(a.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":t,className:o.cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",e),...s,children:[r,n.jsxRuntimeExports.jsx(i.IconComponent,{iconName:"IconChevronRight",className:"ml-auto h-4 w-4"})]})}function S({className:e,...t}){return n.jsxRuntimeExports.jsx(a.SubContent,{"data-slot":"menubar-sub-content",className:o.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}exports.Menubar=l;exports.MenubarCheckboxItem=v;exports.MenubarContent=g;exports.MenubarGroup=b;exports.MenubarItem=j;exports.MenubarLabel=h;exports.MenubarMenu=x;exports.MenubarPortal=u;exports.MenubarRadioGroup=p;exports.MenubarRadioItem=M;exports.MenubarSeparator=R;exports.MenubarShortcut=E;exports.MenubarSub=N;exports.MenubarSubContent=S;exports.MenubarSubTrigger=I;exports.MenubarTrigger=f;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function MenubarContent({ className, align, alignOffset, sideOffset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function MenubarItem({ className, inset, variant, ...props }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
variant?: 'default' | 'destructive';
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function MenubarCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function MenubarRadioItem({ className, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function MenubarShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function MenubarSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, };
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { j as t } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import * as n from "@radix-ui/react-menubar";
|
|
3
|
+
import { c as r } from "../index-CRiPKpXj.js";
|
|
4
|
+
import { I as d } from "../icon-component-BZ-4FDV6.js";
|
|
5
|
+
function f({
|
|
6
|
+
className: e,
|
|
7
|
+
...a
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ t.jsx(
|
|
10
|
+
n.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "menubar",
|
|
13
|
+
className: r(
|
|
14
|
+
"bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
|
|
15
|
+
e
|
|
16
|
+
),
|
|
17
|
+
...a
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function b({
|
|
22
|
+
...e
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ t.jsx(n.Menu, { "data-slot": "menubar-menu", ...e });
|
|
25
|
+
}
|
|
26
|
+
function p({
|
|
27
|
+
...e
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ t.jsx(n.Group, { "data-slot": "menubar-group", ...e });
|
|
30
|
+
}
|
|
31
|
+
function u({
|
|
32
|
+
...e
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ t.jsx(n.Portal, { "data-slot": "menubar-portal", ...e });
|
|
35
|
+
}
|
|
36
|
+
function x({
|
|
37
|
+
...e
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ t.jsx(n.RadioGroup, { "data-slot": "menubar-radio-group", ...e });
|
|
40
|
+
}
|
|
41
|
+
function g({
|
|
42
|
+
className: e,
|
|
43
|
+
...a
|
|
44
|
+
}) {
|
|
45
|
+
return /* @__PURE__ */ t.jsx(
|
|
46
|
+
n.Trigger,
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "menubar-trigger",
|
|
49
|
+
className: r(
|
|
50
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
|
|
51
|
+
e
|
|
52
|
+
),
|
|
53
|
+
...a
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
function v({
|
|
58
|
+
className: e,
|
|
59
|
+
align: a = "start",
|
|
60
|
+
alignOffset: o = -4,
|
|
61
|
+
sideOffset: s = 8,
|
|
62
|
+
...i
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ t.jsx(u, { children: /* @__PURE__ */ t.jsx(
|
|
65
|
+
n.Content,
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "menubar-content",
|
|
68
|
+
align: a,
|
|
69
|
+
alignOffset: o,
|
|
70
|
+
sideOffset: s,
|
|
71
|
+
className: r(
|
|
72
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
|
|
73
|
+
e
|
|
74
|
+
),
|
|
75
|
+
...i
|
|
76
|
+
}
|
|
77
|
+
) });
|
|
78
|
+
}
|
|
79
|
+
function h({
|
|
80
|
+
className: e,
|
|
81
|
+
inset: a,
|
|
82
|
+
variant: o = "default",
|
|
83
|
+
...s
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ t.jsx(
|
|
86
|
+
n.Item,
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "menubar-item",
|
|
89
|
+
"data-inset": a,
|
|
90
|
+
"data-variant": o,
|
|
91
|
+
className: r(
|
|
92
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
93
|
+
e
|
|
94
|
+
),
|
|
95
|
+
...s
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function j({
|
|
100
|
+
className: e,
|
|
101
|
+
children: a,
|
|
102
|
+
checked: o,
|
|
103
|
+
...s
|
|
104
|
+
}) {
|
|
105
|
+
return /* @__PURE__ */ t.jsxs(
|
|
106
|
+
n.CheckboxItem,
|
|
107
|
+
{
|
|
108
|
+
"data-slot": "menubar-checkbox-item",
|
|
109
|
+
className: r(
|
|
110
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
111
|
+
e
|
|
112
|
+
),
|
|
113
|
+
checked: o,
|
|
114
|
+
...s,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ t.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t.jsx(n.ItemIndicator, { children: /* @__PURE__ */ t.jsx(d, { iconName: "IconCheck", className: "size-4" }) }) }),
|
|
117
|
+
a
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function M({
|
|
123
|
+
className: e,
|
|
124
|
+
children: a,
|
|
125
|
+
...o
|
|
126
|
+
}) {
|
|
127
|
+
return /* @__PURE__ */ t.jsxs(
|
|
128
|
+
n.RadioItem,
|
|
129
|
+
{
|
|
130
|
+
"data-slot": "menubar-radio-item",
|
|
131
|
+
className: r(
|
|
132
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
133
|
+
e
|
|
134
|
+
),
|
|
135
|
+
...o,
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ t.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t.jsx(n.ItemIndicator, { children: /* @__PURE__ */ t.jsx(
|
|
138
|
+
d,
|
|
139
|
+
{
|
|
140
|
+
iconName: "IconCircle",
|
|
141
|
+
className: "size-2 fill-current"
|
|
142
|
+
}
|
|
143
|
+
) }) }),
|
|
144
|
+
a
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function N({
|
|
150
|
+
className: e,
|
|
151
|
+
inset: a,
|
|
152
|
+
...o
|
|
153
|
+
}) {
|
|
154
|
+
return /* @__PURE__ */ t.jsx(
|
|
155
|
+
n.Label,
|
|
156
|
+
{
|
|
157
|
+
"data-slot": "menubar-label",
|
|
158
|
+
"data-inset": a,
|
|
159
|
+
className: r(
|
|
160
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
161
|
+
e
|
|
162
|
+
),
|
|
163
|
+
...o
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
function z({
|
|
168
|
+
className: e,
|
|
169
|
+
...a
|
|
170
|
+
}) {
|
|
171
|
+
return /* @__PURE__ */ t.jsx(
|
|
172
|
+
n.Separator,
|
|
173
|
+
{
|
|
174
|
+
"data-slot": "menubar-separator",
|
|
175
|
+
className: r("bg-border -mx-1 my-1 h-px", e),
|
|
176
|
+
...a
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
function I({
|
|
181
|
+
className: e,
|
|
182
|
+
...a
|
|
183
|
+
}) {
|
|
184
|
+
return /* @__PURE__ */ t.jsx(
|
|
185
|
+
"span",
|
|
186
|
+
{
|
|
187
|
+
"data-slot": "menubar-shortcut",
|
|
188
|
+
className: r(
|
|
189
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
190
|
+
e
|
|
191
|
+
),
|
|
192
|
+
...a
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
function y({
|
|
197
|
+
...e
|
|
198
|
+
}) {
|
|
199
|
+
return /* @__PURE__ */ t.jsx(n.Sub, { "data-slot": "menubar-sub", ...e });
|
|
200
|
+
}
|
|
201
|
+
function k({
|
|
202
|
+
className: e,
|
|
203
|
+
inset: a,
|
|
204
|
+
children: o,
|
|
205
|
+
...s
|
|
206
|
+
}) {
|
|
207
|
+
return /* @__PURE__ */ t.jsxs(
|
|
208
|
+
n.SubTrigger,
|
|
209
|
+
{
|
|
210
|
+
"data-slot": "menubar-sub-trigger",
|
|
211
|
+
"data-inset": a,
|
|
212
|
+
className: r(
|
|
213
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",
|
|
214
|
+
e
|
|
215
|
+
),
|
|
216
|
+
...s,
|
|
217
|
+
children: [
|
|
218
|
+
o,
|
|
219
|
+
/* @__PURE__ */ t.jsx(d, { iconName: "IconChevronRight", className: "ml-auto h-4 w-4" })
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
function C({
|
|
225
|
+
className: e,
|
|
226
|
+
...a
|
|
227
|
+
}) {
|
|
228
|
+
return /* @__PURE__ */ t.jsx(
|
|
229
|
+
n.SubContent,
|
|
230
|
+
{
|
|
231
|
+
"data-slot": "menubar-sub-content",
|
|
232
|
+
className: r(
|
|
233
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
234
|
+
e
|
|
235
|
+
),
|
|
236
|
+
...a
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
export {
|
|
241
|
+
f as Menubar,
|
|
242
|
+
j as MenubarCheckboxItem,
|
|
243
|
+
v as MenubarContent,
|
|
244
|
+
p as MenubarGroup,
|
|
245
|
+
h as MenubarItem,
|
|
246
|
+
N as MenubarLabel,
|
|
247
|
+
b as MenubarMenu,
|
|
248
|
+
u as MenubarPortal,
|
|
249
|
+
x as MenubarRadioGroup,
|
|
250
|
+
M as MenubarRadioItem,
|
|
251
|
+
z as MenubarSeparator,
|
|
252
|
+
I as MenubarShortcut,
|
|
253
|
+
y as MenubarSub,
|
|
254
|
+
C as MenubarSubContent,
|
|
255
|
+
k as MenubarSubTrigger,
|
|
256
|
+
g as MenubarTrigger
|
|
257
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../jsx-runtime-DUiatUiq.cjs"),M=require("../badge-Czof3oqL.cjs"),x=require("../command-D9M8dk1M.cjs"),y=require("../popover-B8wp2cHF.cjs"),R=require("../index-DoxiiusW.cjs"),r=require("react"),v=require("../icon-component-LY_vGYHZ.cjs"),I=r.createContext(null);function k({children:e,values:n,defaultValues:i,onValuesChange:u}){const[g,m]=r.useState(!1),[h,p]=r.useState(new Set(n??i)),[E,f]=r.useState(new Map);function w(c){const s=l=>{const a=new Set(l);return a.has(c)?a.delete(c):a.add(c),a};p(s),u?.([...s(h)])}const j=r.useCallback((c,s)=>{f(l=>l.get(c)===s?l:new Map(l).set(c,s))},[]);return t.jsxRuntimeExports.jsx(I,{value:{open:g,setOpen:m,selectedValues:n?new Set(n):h,toggleValue:w,items:E,onItemAdded:j},children:t.jsxRuntimeExports.jsx(y.Popover,{open:g,onOpenChange:m,children:e})})}function V({className:e,children:n,...i}){const{open:u}=b();return t.jsxRuntimeExports.jsx(y.PopoverTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsxs("button",{...i,role:i.role??"combobox","aria-expanded":i["aria-expanded"]??u,className:R.cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex h-auto min-h-9 w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent px-3 py-1.5 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),children:[n,t.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconSelector",className:"size-4 shrink-0 opacity-50"})]})})}function z({placeholder:e,clickToRemove:n=!0,className:i,overflowBehavior:u="wrap-when-open",...g}){const{selectedValues:m,toggleValue:h,items:p,open:E}=b(),[f,w]=r.useState(0),j=r.useRef(null),c=r.useRef(null),s=r.useRef(new Set),l=u==="wrap"||u==="wrap-when-open"&&E;r.useEffect(()=>{l&&s.current.forEach(o=>o.style.removeProperty("display"))},[l]);const a=r.useCallback(()=>{if(j.current==null)return;const o=j.current,d=c.current;d!=null&&(d.style.display="none"),s.current.forEach(S=>S.style.removeProperty("display"));let C=0;for(let S=s.current.size-1;S>=0;S--){const N=[...s.current][S];if(o.scrollWidth<=o.clientWidth)break;C=s.current.size-S,N.style.display="none",d?.style.removeProperty("display")}w(C)},[]);return r.useEffect(()=>{if(j.current==null)return;const o=new ResizeObserver(a);return o.observe(j.current),()=>o.disconnect()},[a]),r.useLayoutEffect(()=>{a()},[m,a]),m.size===0&&e?t.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground font-normal",children:e}):t.jsxRuntimeExports.jsxs("div",{...g,ref:j,className:R.cn("flex w-full gap-1.5 overflow-hidden",l&&"h-full flex-wrap",i),children:[[...m].filter(o=>p.has(o)).map(o=>t.jsxRuntimeExports.jsxs(M.Badge,{ref:d=>{if(d!=null)return s.current.add(d),()=>{s.current.delete(d)}},variant:"outline",className:"group flex items-center gap-1",onClick:n?d=>{d.stopPropagation(),h(o)}:void 0,children:[p.get(o),n&&t.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconX",className:"text-muted-foreground group-hover:text-destructive size-2"})]},o)),t.jsxRuntimeExports.jsxs(M.Badge,{style:{display:f>0&&!l?"block":"none"},variant:"outline",ref:c,children:["+",f]})]})}function P({search:e=!0,children:n,...i}){const u=typeof e=="object"?!0:e;return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{display:"none"},children:t.jsxRuntimeExports.jsx(x.Command,{children:t.jsxRuntimeExports.jsx(x.CommandList,{children:n})})}),t.jsxRuntimeExports.jsx(y.PopoverContent,{className:"min-w-[var(--radix-popover-trigger-width)] p-0",children:t.jsxRuntimeExports.jsxs(x.Command,{...i,children:[u?t.jsxRuntimeExports.jsx(x.CommandInput,{placeholder:typeof e=="object"?e.placeholder:void 0}):t.jsxRuntimeExports.jsx("button",{autoFocus:!0,"aria-hidden":"true",className:"sr-only"}),t.jsxRuntimeExports.jsxs(x.CommandList,{children:[u&&t.jsxRuntimeExports.jsx(x.CommandEmpty,{children:typeof e=="object"?e.emptyMessage:void 0}),n]})]})})]})}function q({value:e,children:n,badgeLabel:i,onSelect:u,...g}){const{toggleValue:m,selectedValues:h,onItemAdded:p}=b(),E=h.has(e);return r.useEffect(()=>{p(e,i??n)},[e,n,p,i]),t.jsxRuntimeExports.jsxs(x.CommandItem,{...g,value:e,onSelect:f=>{m(f),u?.(f)},children:[t.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconCheck",className:R.cn("mr-2 size-4",E?"opacity-100":"opacity-0")}),n]})}function O(e){return t.jsxRuntimeExports.jsx(x.CommandGroup,{...e})}function A(e){return t.jsxRuntimeExports.jsx(x.CommandSeparator,{...e})}function b(){const e=r.useContext(I);if(e==null)throw new Error("useMultiSelectContext must be used within a MultiSelectContext");return e}exports.MultiSelect=k;exports.MultiSelectContent=P;exports.MultiSelectGroup=O;exports.MultiSelectItem=q;exports.MultiSelectSeparator=A;exports.MultiSelectTrigger=V;exports.MultiSelectValue=z;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button } from '@/components/button';
|
|
2
|
+
import { Command, CommandGroup, CommandItem, CommandSeparator } from '@/components/command';
|
|
3
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
4
|
+
declare function MultiSelect({ children, values, defaultValues, onValuesChange, }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
values?: string[];
|
|
7
|
+
defaultValues?: string[];
|
|
8
|
+
onValuesChange?: (values: string[]) => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function MultiSelectTrigger({ className, children, ...props }: {
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
} & ComponentPropsWithoutRef<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function MultiSelectValue({ placeholder, clickToRemove, className, overflowBehavior, ...props }: {
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
clickToRemove?: boolean;
|
|
17
|
+
overflowBehavior?: 'wrap' | 'wrap-when-open' | 'cutoff';
|
|
18
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function MultiSelectContent({ search, children, ...props }: {
|
|
20
|
+
search?: boolean | {
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
emptyMessage?: string;
|
|
23
|
+
};
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
} & Omit<ComponentPropsWithoutRef<typeof Command>, 'children'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function MultiSelectItem({ value, children, badgeLabel, onSelect, ...props }: {
|
|
27
|
+
badgeLabel?: ReactNode;
|
|
28
|
+
value: string;
|
|
29
|
+
} & Omit<ComponentPropsWithoutRef<typeof CommandItem>, 'value'>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function MultiSelectGroup(props: ComponentPropsWithoutRef<typeof CommandGroup>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function MultiSelectSeparator(props: ComponentPropsWithoutRef<typeof CommandSeparator>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export { MultiSelect, MultiSelectContent, MultiSelectGroup, MultiSelectItem, MultiSelectSeparator, MultiSelectTrigger, MultiSelectValue, };
|