docthub-core-components 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/overrides/ui/auto-complete.js +466 -0
- package/dist/components/overrides/ui/autocomplete-checkbox.js +480 -0
- package/dist/components/overrides/ui/chips/doct-chip.js +157 -0
- package/dist/components/overrides/ui/circular-progress.js +32 -0
- package/dist/components/overrides/ui/composed/address-form-section.js +67 -0
- package/dist/components/overrides/ui/composed/contact-form-section.js +56 -0
- package/dist/components/overrides/ui/composed/search-filter-section.js +132 -0
- package/dist/components/overrides/ui/composed/user-registration-section.js +77 -0
- package/dist/components/overrides/ui/currencyInput/currency-input.js +69 -0
- package/dist/components/overrides/ui/doct-animation-loader.js +13 -0
- package/dist/components/overrides/ui/expandable-card.js +115 -0
- package/dist/components/overrides/ui/footer/doct-footer.js +35 -0
- package/dist/components/overrides/ui/footer/footer-desktop.js +92 -0
- package/dist/components/overrides/ui/footer/footer-mobile.js +123 -0
- package/dist/components/overrides/ui/footer/footer-routes.js +87 -0
- package/dist/components/overrides/ui/footer/footer-shared.js +137 -0
- package/dist/components/overrides/ui/footer/presets.js +269 -0
- package/dist/components/overrides/ui/inputs/labeled-input.js +92 -0
- package/dist/components/overrides/ui/inputs/otp-input.js +101 -0
- package/dist/components/overrides/ui/inputs/password-input.js +77 -0
- package/dist/components/overrides/ui/inputs/phone-input.js +336 -0
- package/dist/components/overrides/ui/navigation-menu/doct-navigation-menu.js +22 -0
- package/dist/components/overrides/ui/navigation-menu/individual-nav-routes.js +46 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu-desktop.js +109 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu-mobile.js +231 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu.js +44 -0
- package/dist/components/overrides/ui/navigation-menu/nav-env.js +64 -0
- package/dist/components/overrides/ui/navigation-menu/navigation-menu-adapter.js +55 -0
- package/dist/components/overrides/ui/navigation-menu/navigation-menu-internal.js +36 -0
- package/dist/components/overrides/ui/navigation-menu/organization-nav-routes.js +34 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu-desktop.js +109 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu-mobile.js +231 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu.js +44 -0
- package/dist/components/overrides/ui/navigation-menu/presets.js +238 -0
- package/dist/components/overrides/ui/navigation-menu/types.js +6 -0
- package/dist/components/overrides/ui/pickers/date-picker-field.js +361 -0
- package/dist/components/overrides/ui/pickers/date-range-picker-field.js +288 -0
- package/dist/components/overrides/ui/pickers/day-picker-bounds.js +38 -0
- package/dist/components/overrides/ui/pickers/select-field.js +158 -0
- package/dist/components/overrides/ui/search/auto-complete.js +64 -0
- package/dist/components/overrides/ui/search/search-input.js +65 -0
- package/dist/components/overrides/ui/showcase/component-section.js +45 -0
- package/dist/components/ui/alert.js +94 -0
- package/dist/components/ui/avatar.js +69 -0
- package/dist/components/ui/badge.js +37 -0
- package/dist/components/ui/breadcrumb.js +117 -0
- package/dist/components/ui/button.js +223 -0
- package/dist/components/ui/calendar.js +100 -0
- package/dist/components/ui/checkbox.js +57 -0
- package/dist/components/ui/collapsible.js +25 -0
- package/dist/components/ui/command.js +132 -0
- package/dist/components/ui/dialog.js +230 -0
- package/dist/components/ui/drawer.js +119 -0
- package/dist/components/ui/dropdown-menu.js +216 -0
- package/dist/components/ui/input.js +48 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/popover.js +181 -0
- package/dist/components/ui/progress.js +91 -0
- package/dist/components/ui/radio-group.js +49 -0
- package/dist/components/ui/select.js +169 -0
- package/dist/components/ui/skeleton.js +91 -0
- package/dist/components/ui/spinner.js +32 -0
- package/dist/components/ui/tabs.js +68 -0
- package/dist/components/ui/textarea.js +73 -0
- package/dist/components/ui/timeline.js +177 -0
- package/dist/components/ui/toast.js +82 -0
- package/dist/components/ui/tooltip.js +91 -0
- package/dist/components/ui/typography.js +213 -0
- package/dist/hooks/use-exclusive-dropdown.js +53 -0
- package/dist/hooks/use-mobile.js +19 -0
- package/dist/hooks/useAutocompleteCheckbox.js +204 -0
- package/dist/index.js +187 -0
- package/dist/lib/dropdown-manager.js +17 -0
- package/dist/lib/get-floating-dropdown-position.js +32 -0
- package/dist/lib/get-scroll-parents.js +20 -0
- package/dist/lib/slot.js +40 -0
- package/dist/lib/utils.js +9 -0
- package/dist/util/getInputClasses.js +19 -0
- package/package.json +4 -4
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l, jsxs as O } from "react/jsx-runtime";
|
|
3
|
+
import { c as Ut } from "react-compiler-runtime";
|
|
4
|
+
import { ChevronDown as Jt, X as oo } from "lucide-react";
|
|
5
|
+
import { useId as to, useState as ro, useEffect as xt, useRef as Qt } from "react";
|
|
6
|
+
import { createPortal as co } from "react-dom";
|
|
7
|
+
import { Chip as uo } from "./chips/doct-chip.js";
|
|
8
|
+
import { SearchInput as fo } from "./search/search-input.js";
|
|
9
|
+
import { DoctButton as mo } from "../../ui/button.js";
|
|
10
|
+
import { Checkbox as po } from "../../ui/checkbox.js";
|
|
11
|
+
import { Input as ho } from "../../ui/input.js";
|
|
12
|
+
import { TooltipProvider as bo, Tooltip as go, TooltipTrigger as xo, TooltipContent as vo } from "../../ui/tooltip.js";
|
|
13
|
+
import { useAutocompleteCheckbox as wo } from "../../../hooks/useAutocompleteCheckbox.js";
|
|
14
|
+
import { cn as y } from "../../../lib/utils.js";
|
|
15
|
+
const yo = {
|
|
16
|
+
small: "h-8 text-xs px-2",
|
|
17
|
+
medium: "h-10 text-sm px-3",
|
|
18
|
+
large: "h-12 text-base px-4"
|
|
19
|
+
}, ko = {
|
|
20
|
+
outlined: "border border-input bg-background",
|
|
21
|
+
filled: "border-0 bg-accent",
|
|
22
|
+
standard: "border-0 border-b border-input rounded-none bg-transparent"
|
|
23
|
+
}, Co = (Xe) => {
|
|
24
|
+
const e = Ut(66), {
|
|
25
|
+
option: r,
|
|
26
|
+
index: b,
|
|
27
|
+
isSelected: d,
|
|
28
|
+
isHighlighted: P,
|
|
29
|
+
onSelect: m,
|
|
30
|
+
getOptionLabel: i,
|
|
31
|
+
renderOption: x,
|
|
32
|
+
freeSolo: g,
|
|
33
|
+
originalOptions: k,
|
|
34
|
+
checkboxPosition: C,
|
|
35
|
+
showChip: N,
|
|
36
|
+
checkboxProps: B,
|
|
37
|
+
chipProps: I,
|
|
38
|
+
checkboxColor: Qe
|
|
39
|
+
} = Xe, Ne = g === void 0 ? !1 : g;
|
|
40
|
+
let ne;
|
|
41
|
+
e[0] !== k ? (ne = k === void 0 ? [] : k, e[0] = k, e[1] = ne) : ne = e[1];
|
|
42
|
+
const Se = ne, $ = Qt(null), [Te, Ue] = ro(!1);
|
|
43
|
+
let le;
|
|
44
|
+
e[2] !== m || e[3] !== r ? (le = () => {
|
|
45
|
+
m(r);
|
|
46
|
+
}, e[2] = m, e[3] = r, e[4] = le) : le = e[4];
|
|
47
|
+
const Ze = le;
|
|
48
|
+
let v;
|
|
49
|
+
e[5] !== m || e[6] !== r ? (v = (p) => {
|
|
50
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), m(r));
|
|
51
|
+
}, e[5] = m, e[6] = r, e[7] = v) : v = e[7];
|
|
52
|
+
const Oe = v;
|
|
53
|
+
let ie;
|
|
54
|
+
e[8] !== Ne || e[9] !== i || e[10] !== r || e[11] !== Se ? (ie = Ne && typeof r == "string" && !Se.some((p) => i(p).toLowerCase() === r.toLowerCase()), e[8] = Ne, e[9] = i, e[10] = r, e[11] = Se, e[12] = ie) : ie = e[12];
|
|
55
|
+
const se = ie;
|
|
56
|
+
let X;
|
|
57
|
+
e[13] !== i || e[14] !== se || e[15] !== r ? (X = se ? `Add "${i(r)}"` : i(r), e[13] = i, e[14] = se, e[15] = r, e[16] = X) : X = e[16];
|
|
58
|
+
const S = X;
|
|
59
|
+
let ae, ce;
|
|
60
|
+
e[17] === Symbol.for("react.memo_cache_sentinel") ? (ae = () => {
|
|
61
|
+
const p = () => {
|
|
62
|
+
if ($.current) {
|
|
63
|
+
const Ie = $.current.scrollWidth > $.current.clientWidth;
|
|
64
|
+
Ue(Ie);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
p();
|
|
68
|
+
const Ye = new ResizeObserver(() => {
|
|
69
|
+
p();
|
|
70
|
+
});
|
|
71
|
+
$.current && Ye.observe($.current);
|
|
72
|
+
const f = setTimeout(p, 0);
|
|
73
|
+
return () => {
|
|
74
|
+
Ye.disconnect(), clearTimeout(f);
|
|
75
|
+
};
|
|
76
|
+
}, ce = [], e[17] = ae, e[18] = ce) : (ae = e[17], ce = e[18]), xt(ae, ce);
|
|
77
|
+
let L;
|
|
78
|
+
e[19] !== B ? (L = B ?? {}, e[19] = B, e[20] = L) : L = e[20];
|
|
79
|
+
let q, F, Z, Pe;
|
|
80
|
+
e[21] !== L ? ({
|
|
81
|
+
className: q,
|
|
82
|
+
tabIndex: Pe,
|
|
83
|
+
color: F,
|
|
84
|
+
...Z
|
|
85
|
+
} = L, e[21] = L, e[22] = q, e[23] = F, e[24] = Z, e[25] = Pe) : (q = e[22], F = e[23], Z = e[24], Pe = e[25]);
|
|
86
|
+
const de = F ?? Qe, ue = Pe ?? -1, Ge = !d && "opacity-20";
|
|
87
|
+
let W;
|
|
88
|
+
e[26] !== q || e[27] !== Ge ? (W = y("pointer-events-none border-2 opacity-100 flex items-center justify-center !rounded-sm", Ge, q), e[26] = q, e[27] = Ge, e[28] = W) : W = e[28];
|
|
89
|
+
let fe;
|
|
90
|
+
e[29] !== Z || e[30] !== d || e[31] !== de || e[32] !== ue || e[33] !== W ? (fe = /* @__PURE__ */ l(po, { checked: d, tabIndex: ue, className: W, color: de, ...Z }), e[29] = Z, e[30] = d, e[31] = de, e[32] = ue, e[33] = W, e[34] = fe) : fe = e[34];
|
|
91
|
+
const me = fe, pe = I == null ? void 0 : I.className;
|
|
92
|
+
let a;
|
|
93
|
+
e[35] !== pe ? (a = y("flex-shrink-0", pe), e[35] = pe, e[36] = a) : a = e[36];
|
|
94
|
+
let G;
|
|
95
|
+
e[37] !== I || e[38] !== a ? (G = {
|
|
96
|
+
size: "small",
|
|
97
|
+
variant: "soft",
|
|
98
|
+
...I,
|
|
99
|
+
className: a
|
|
100
|
+
}, e[37] = I, e[38] = a, e[39] = G) : G = e[39];
|
|
101
|
+
const he = G, J = C === "left";
|
|
102
|
+
let K;
|
|
103
|
+
e[40] !== S ? (K = /* @__PURE__ */ l("span", { ref: $, className: "flex-1 truncate", children: S }), e[40] = S, e[41] = K) : K = e[41];
|
|
104
|
+
const u = K;
|
|
105
|
+
let Q;
|
|
106
|
+
e[42] !== Te || e[43] !== S || e[44] !== u ? (Q = Te ? /* @__PURE__ */ O(go, { children: [
|
|
107
|
+
/* @__PURE__ */ l(xo, { asChild: !0, children: u }),
|
|
108
|
+
/* @__PURE__ */ l(vo, { children: /* @__PURE__ */ l("p", { children: S }) })
|
|
109
|
+
] }) : u, e[42] = Te, e[43] = S, e[44] = u, e[45] = Q) : Q = e[45];
|
|
110
|
+
const U = Q, be = P ? "bg-accent text-accent-foreground" : "", Y = se && "italic";
|
|
111
|
+
let z;
|
|
112
|
+
e[46] !== be || e[47] !== Y ? (z = y("px-3 py-2 cursor-pointer flex items-center", "text-sm transition-colors mx-2.5 rounded-md my-0.5 hover:bg-[#F5F5F5]", be, Y), e[46] = be, e[47] = Y, e[48] = z) : z = e[48];
|
|
113
|
+
let A;
|
|
114
|
+
e[49] !== me || e[50] !== he || e[51] !== b || e[52] !== J || e[53] !== r || e[54] !== S || e[55] !== x || e[56] !== N || e[57] !== U ? (A = x ? x(r, b) : /* @__PURE__ */ O("div", { className: "flex items-center gap-2 w-full", children: [
|
|
115
|
+
J && me,
|
|
116
|
+
U,
|
|
117
|
+
N && /* @__PURE__ */ l(uo, { label: S, ...he }),
|
|
118
|
+
!J && me
|
|
119
|
+
] }), e[49] = me, e[50] = he, e[51] = b, e[52] = J, e[53] = r, e[54] = S, e[55] = x, e[56] = N, e[57] = U, e[58] = A) : A = e[58];
|
|
120
|
+
let t;
|
|
121
|
+
return e[59] !== Ze || e[60] !== Oe || e[61] !== b || e[62] !== d || e[63] !== z || e[64] !== A ? (t = /* @__PURE__ */ l("div", { role: "option", "aria-selected": d, tabIndex: 0, onClick: Ze, onKeyDown: Oe, "data-option-index": b, className: z, children: A }), e[59] = Ze, e[60] = Oe, e[61] = b, e[62] = d, e[63] = z, e[64] = A, e[65] = t) : t = e[65], t;
|
|
122
|
+
}, No = (Xe) => {
|
|
123
|
+
const e = Ut(17), {
|
|
124
|
+
tag: r,
|
|
125
|
+
index: b,
|
|
126
|
+
getOptionLabel: d,
|
|
127
|
+
onRemove: P
|
|
128
|
+
} = Xe;
|
|
129
|
+
let m;
|
|
130
|
+
e[0] !== P || e[1] !== r ? (m = (I) => {
|
|
131
|
+
I.stopPropagation(), P(r);
|
|
132
|
+
}, e[0] = P, e[1] = r, e[2] = m) : m = e[2];
|
|
133
|
+
const i = m;
|
|
134
|
+
let x;
|
|
135
|
+
e[3] !== d || e[4] !== r ? (x = d(r), e[3] = d, e[4] = r, e[5] = x) : x = e[5];
|
|
136
|
+
let g;
|
|
137
|
+
e[6] !== d || e[7] !== r ? (g = d(r), e[6] = d, e[7] = r, e[8] = g) : g = e[8];
|
|
138
|
+
const k = `Remove ${g}`;
|
|
139
|
+
let C;
|
|
140
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ l(oo, { className: "h-3 w-3" }), e[9] = C) : C = e[9];
|
|
141
|
+
let N;
|
|
142
|
+
e[10] !== i || e[11] !== k ? (N = /* @__PURE__ */ l("button", { type: "button", onClick: i, className: "ml-1 hover:bg-secondary-foreground/20 rounded-full p-0.5", "aria-label": k, children: C }), e[10] = i, e[11] = k, e[12] = N) : N = e[12];
|
|
143
|
+
let B;
|
|
144
|
+
return e[13] !== b || e[14] !== x || e[15] !== N ? (B = /* @__PURE__ */ O("div", { className: "inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium bg-secondary text-secondary-foreground rounded-full", children: [
|
|
145
|
+
x,
|
|
146
|
+
N
|
|
147
|
+
] }, b), e[13] = b, e[14] = x, e[15] = N, e[16] = B) : B = e[16], B;
|
|
148
|
+
};
|
|
149
|
+
function Eo(Xe) {
|
|
150
|
+
const e = Ut(190), {
|
|
151
|
+
options: r,
|
|
152
|
+
dataSource: b,
|
|
153
|
+
value: d,
|
|
154
|
+
onChange: P,
|
|
155
|
+
change: m,
|
|
156
|
+
onInputChange: i,
|
|
157
|
+
placeholder: x,
|
|
158
|
+
label: g,
|
|
159
|
+
helperText: k,
|
|
160
|
+
error: C,
|
|
161
|
+
noOptionsText: N,
|
|
162
|
+
emptyMessage: B,
|
|
163
|
+
disabled: I,
|
|
164
|
+
loading: Qe,
|
|
165
|
+
required: Ne,
|
|
166
|
+
clearable: ne,
|
|
167
|
+
disableCloseOnSelect: Se,
|
|
168
|
+
freeSolo: $,
|
|
169
|
+
size: Te,
|
|
170
|
+
variant: Ue,
|
|
171
|
+
fullWidth: le,
|
|
172
|
+
className: Ze,
|
|
173
|
+
inputClassName: v,
|
|
174
|
+
checkboxPosition: Oe,
|
|
175
|
+
showChip: ie,
|
|
176
|
+
showTags: se,
|
|
177
|
+
checkboxProps: X,
|
|
178
|
+
chipProps: S,
|
|
179
|
+
checkboxColor: ae,
|
|
180
|
+
showSearch: ce,
|
|
181
|
+
searchPlaceholder: L,
|
|
182
|
+
triggerType: q,
|
|
183
|
+
triggerButtonLabel: F,
|
|
184
|
+
triggerButtonVariant: Z,
|
|
185
|
+
triggerButtonSize: Pe,
|
|
186
|
+
triggerButtonProps: de,
|
|
187
|
+
triggerButtonIcon: ue,
|
|
188
|
+
triggerButtonIconPosition: Ge,
|
|
189
|
+
portalContainer: W,
|
|
190
|
+
disablePortal: fe,
|
|
191
|
+
dropdownWidth: me,
|
|
192
|
+
getOptionLabel: pe,
|
|
193
|
+
getOptionValue: a,
|
|
194
|
+
isOptionEqualToValue: G,
|
|
195
|
+
filterOptions: he,
|
|
196
|
+
renderOption: J,
|
|
197
|
+
renderTags: K,
|
|
198
|
+
limitTags: u,
|
|
199
|
+
fields: Q
|
|
200
|
+
} = Xe;
|
|
201
|
+
let U;
|
|
202
|
+
e[0] !== r ? (U = r === void 0 ? [] : r, e[0] = r, e[1] = U) : U = e[1];
|
|
203
|
+
const be = U;
|
|
204
|
+
let Y;
|
|
205
|
+
e[2] !== b ? (Y = b === void 0 ? [] : b, e[2] = b, e[3] = Y) : Y = e[3];
|
|
206
|
+
const z = Y;
|
|
207
|
+
let A;
|
|
208
|
+
e[4] !== d ? (A = d === void 0 ? [] : d, e[4] = d, e[5] = A) : A = e[5];
|
|
209
|
+
const t = A, p = x === void 0 ? "Search..." : x, Ye = N === void 0 ? "No options" : N, f = I === void 0 ? !1 : I, Ie = Qe === void 0 ? !1 : Qe, vt = Ne === void 0 ? !1 : Ne, no = ne === void 0 ? !0 : ne, wt = Se === void 0 ? !0 : Se, Fe = $ === void 0 ? !1 : $, lo = Te === void 0 ? "medium" : Te, io = Ue === void 0 ? "outlined" : Ue, Yt = le === void 0 ? !0 : le, yt = Oe === void 0 ? "right" : Oe, kt = ie === void 0 ? !1 : ie, so = se === void 0 ? !0 : se, Ct = ae === void 0 ? "#000000" : ae, h = ce === void 0 ? !1 : ce, Nt = q === void 0 ? "input" : q, St = fe === void 0 ? !1 : fe, Ae = me === void 0 ? "220px" : me, ge = to(), [xe, Tt] = ro(!1);
|
|
210
|
+
let _e;
|
|
211
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (_e = () => {
|
|
212
|
+
Tt(!1);
|
|
213
|
+
}, e[6] = _e) : _e = e[6];
|
|
214
|
+
let et;
|
|
215
|
+
e[7] !== t ? (et = [t], e[7] = t, e[8] = et) : et = e[8], xt(_e, et);
|
|
216
|
+
let tt;
|
|
217
|
+
e[9] !== z ? (tt = z ?? [], e[9] = z, e[10] = tt) : tt = e[10];
|
|
218
|
+
const _t = tt;
|
|
219
|
+
let ot;
|
|
220
|
+
e[11] !== be ? (ot = be ?? [], e[11] = be, e[12] = ot) : ot = e[12];
|
|
221
|
+
const ao = ot, De = _t.length > 0 ? _t : ao;
|
|
222
|
+
let Re;
|
|
223
|
+
e[13] !== m || e[14] !== P ? (Re = (o, n) => {
|
|
224
|
+
P == null || P(o, n), m == null || m({
|
|
225
|
+
itemData: n
|
|
226
|
+
});
|
|
227
|
+
}, e[13] = m, e[14] = P, e[15] = Re) : Re = e[15];
|
|
228
|
+
let rt;
|
|
229
|
+
e[16] !== wt || e[17] !== f || e[18] !== De || e[19] !== Q || e[20] !== he || e[21] !== Fe || e[22] !== pe || e[23] !== a || e[24] !== G || e[25] !== i || e[26] !== Re || e[27] !== t ? (rt = {
|
|
230
|
+
options: De,
|
|
231
|
+
value: t,
|
|
232
|
+
onChange: Re,
|
|
233
|
+
onInputChange: i,
|
|
234
|
+
disabled: f,
|
|
235
|
+
disableCloseOnSelect: wt,
|
|
236
|
+
freeSolo: Fe,
|
|
237
|
+
getOptionLabel: pe,
|
|
238
|
+
getOptionValue: a,
|
|
239
|
+
isOptionEqualToValue: G,
|
|
240
|
+
filterOptions: he,
|
|
241
|
+
fields: Q
|
|
242
|
+
}, e[16] = wt, e[17] = f, e[18] = De, e[19] = Q, e[20] = he, e[21] = Fe, e[22] = pe, e[23] = a, e[24] = G, e[25] = i, e[26] = Re, e[27] = t, e[28] = rt) : rt = e[28];
|
|
243
|
+
const {
|
|
244
|
+
open: s,
|
|
245
|
+
inputValue: _,
|
|
246
|
+
highlightedIndex: H,
|
|
247
|
+
filteredOptions: j,
|
|
248
|
+
dropdownPosition: V,
|
|
249
|
+
inputRef: T,
|
|
250
|
+
listRef: M,
|
|
251
|
+
containerRef: Ot,
|
|
252
|
+
triggerRef: nt,
|
|
253
|
+
setOpen: ve,
|
|
254
|
+
setInputValue: we,
|
|
255
|
+
handleInputChange: ye,
|
|
256
|
+
handleOptionSelect: Pt,
|
|
257
|
+
handleTagRemove: ee,
|
|
258
|
+
handleClear: It,
|
|
259
|
+
handleKeyDown: ke,
|
|
260
|
+
handleToggle: lt,
|
|
261
|
+
handleFocus: it,
|
|
262
|
+
isOptionSelected: Ft,
|
|
263
|
+
getOptionLabelSafe: D
|
|
264
|
+
} = wo(rt), At = no && !f && _ !== "" && !h && Nt !== "button";
|
|
265
|
+
let Je;
|
|
266
|
+
e: {
|
|
267
|
+
if (!so || Nt === "button") {
|
|
268
|
+
Je = null;
|
|
269
|
+
break e;
|
|
270
|
+
}
|
|
271
|
+
if (!Array.isArray(t) || t.length === 0) {
|
|
272
|
+
Je = null;
|
|
273
|
+
break e;
|
|
274
|
+
}
|
|
275
|
+
if (K) {
|
|
276
|
+
let c;
|
|
277
|
+
e[29] !== ee || e[30] !== K || e[31] !== t ? (c = K(t, ee), e[29] = ee, e[30] = K, e[31] = t, e[32] = c) : c = e[32], Je = c;
|
|
278
|
+
break e;
|
|
279
|
+
}
|
|
280
|
+
let o = t;
|
|
281
|
+
if (u && t.length > u && !xe) {
|
|
282
|
+
let c;
|
|
283
|
+
e[33] !== u || e[34] !== t ? (c = t.slice(0, u), e[33] = u, e[34] = t, e[35] = c) : c = e[35], o = c;
|
|
284
|
+
}
|
|
285
|
+
let n;
|
|
286
|
+
e[36] !== T || e[37] !== i || e[38] !== we || e[39] !== ve ? (n = () => {
|
|
287
|
+
var c;
|
|
288
|
+
ve(!1), we(""), i == null || i({
|
|
289
|
+
target: {
|
|
290
|
+
value: ""
|
|
291
|
+
}
|
|
292
|
+
}, ""), (c = T.current) == null || c.focus();
|
|
293
|
+
}, e[36] = T, e[37] = i, e[38] = we, e[39] = ve, e[40] = n) : n = e[40];
|
|
294
|
+
let R;
|
|
295
|
+
if (e[41] !== D || e[42] !== a || e[43] !== ee || e[44] !== o) {
|
|
296
|
+
let c;
|
|
297
|
+
e[46] !== D || e[47] !== a || e[48] !== ee ? (c = (gt, eo) => /* @__PURE__ */ l(No, { tag: gt, index: eo, getOptionLabel: D, onRemove: ee }, typeof gt == "string" ? gt : String((a == null ? void 0 : a(gt)) ?? eo)), e[46] = D, e[47] = a, e[48] = ee, e[49] = c) : c = e[49], R = o.map(c), e[41] = D, e[42] = a, e[43] = ee, e[44] = o, e[45] = R;
|
|
298
|
+
} else
|
|
299
|
+
R = e[45];
|
|
300
|
+
let w;
|
|
301
|
+
e[50] !== u || e[51] !== xe || e[52] !== t ? (w = u && t.length > u && !xe && /* @__PURE__ */ O("button", { type: "button", onClick: (c) => {
|
|
302
|
+
c.stopPropagation(), Tt(!0);
|
|
303
|
+
}, className: "inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded-full hover:bg-muted/80 transition-colors cursor-pointer", children: [
|
|
304
|
+
"+",
|
|
305
|
+
t.length - u,
|
|
306
|
+
" more"
|
|
307
|
+
] }), e[50] = u, e[51] = xe, e[52] = t, e[53] = w) : w = e[53];
|
|
308
|
+
let E;
|
|
309
|
+
e[54] !== u || e[55] !== xe || e[56] !== t ? (E = u && t.length > u && xe && /* @__PURE__ */ l("button", { type: "button", onClick: (c) => {
|
|
310
|
+
c.stopPropagation(), Tt(!1);
|
|
311
|
+
}, className: "inline-flex items-center px-2.5 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded-full hover:bg-muted/80 transition-colors cursor-pointer", children: "Show less" }), e[54] = u, e[55] = xe, e[56] = t, e[57] = E) : E = e[57];
|
|
312
|
+
let Me;
|
|
313
|
+
e[58] !== n || e[59] !== R || e[60] !== w || e[61] !== E ? (Me = /* @__PURE__ */ O("div", { className: "flex flex-wrap gap-1 mb-1", onClick: n, children: [
|
|
314
|
+
R,
|
|
315
|
+
w,
|
|
316
|
+
E
|
|
317
|
+
] }), e[58] = n, e[59] = R, e[60] = w, e[61] = E, e[62] = Me) : Me = e[62], Je = Me;
|
|
318
|
+
}
|
|
319
|
+
const Dt = Je, te = Nt === "button", Rt = C ? "border border-destructive" : ko[io], Bt = yo[lo], Lt = f ? "opacity-50 cursor-not-allowed" : "cursor-text";
|
|
320
|
+
let st;
|
|
321
|
+
e[63] !== v || e[64] !== Rt || e[65] !== Bt || e[66] !== Lt ? (st = y("relative flex items-center rounded-md", Rt, Bt, Lt, "transition-colors", v), e[63] = v, e[64] = Rt, e[65] = Bt, e[66] = Lt, e[67] = st) : st = e[67];
|
|
322
|
+
const Wt = st, zt = f ? "opacity-50 cursor-not-allowed" : "cursor-pointer";
|
|
323
|
+
let at;
|
|
324
|
+
e[68] !== v || e[69] !== zt ? (at = y("relative inline-flex items-center gap-2", zt, v), e[68] = v, e[69] = zt, e[70] = at) : at = e[70];
|
|
325
|
+
const Et = at, $t = B ?? Ye, Ce = to(), qt = Qt(null), oe = Qt(null);
|
|
326
|
+
let ct, dt;
|
|
327
|
+
e[71] !== s || e[72] !== h ? (ct = () => {
|
|
328
|
+
var o;
|
|
329
|
+
s && h && ((o = qt.current) == null || o.focus());
|
|
330
|
+
}, dt = [s, h], e[71] = s, e[72] = h, e[73] = ct, e[74] = dt) : (ct = e[73], dt = e[74]), xt(ct, dt);
|
|
331
|
+
let ut;
|
|
332
|
+
e[75] !== Pt || e[76] !== s || e[77] !== h ? (ut = (o) => {
|
|
333
|
+
Pt(o), h && s && setTimeout(() => {
|
|
334
|
+
var n;
|
|
335
|
+
(n = qt.current) == null || n.focus();
|
|
336
|
+
}, 10);
|
|
337
|
+
}, e[75] = Pt, e[76] = s, e[77] = h, e[78] = ut) : ut = e[78];
|
|
338
|
+
const Kt = ut;
|
|
339
|
+
let ft, mt;
|
|
340
|
+
e[79] !== j.length || e[80] !== H || e[81] !== M || e[82] !== s ? (ft = () => {
|
|
341
|
+
if (!(!s || H < 0 || !M.current) && j.length !== 0 && !(H >= j.length))
|
|
342
|
+
return oe.current !== null && (cancelAnimationFrame(oe.current), oe.current = null), oe.current = requestAnimationFrame(() => {
|
|
343
|
+
if (!M.current)
|
|
344
|
+
return;
|
|
345
|
+
const o = M.current.querySelector('div.max-h-60, div[class*="max-h-60"]');
|
|
346
|
+
if (!o)
|
|
347
|
+
return;
|
|
348
|
+
const n = o.querySelector(`[data-option-index="${H}"]`);
|
|
349
|
+
n && n.scrollIntoView({
|
|
350
|
+
behavior: "auto",
|
|
351
|
+
block: "nearest",
|
|
352
|
+
inline: "nearest"
|
|
353
|
+
}), oe.current = null;
|
|
354
|
+
}), () => {
|
|
355
|
+
oe.current !== null && (cancelAnimationFrame(oe.current), oe.current = null);
|
|
356
|
+
};
|
|
357
|
+
}, mt = [H, s, j.length, M], e[79] = j.length, e[80] = H, e[81] = M, e[82] = s, e[83] = ft, e[84] = mt) : (ft = e[83], mt = e[84]), xt(ft, mt);
|
|
358
|
+
let Be;
|
|
359
|
+
e: {
|
|
360
|
+
if (typeof F == "function") {
|
|
361
|
+
let o;
|
|
362
|
+
e[85] !== t ? (o = t ?? [], e[85] = t, e[86] = o) : o = e[86];
|
|
363
|
+
let n;
|
|
364
|
+
e[87] !== o || e[88] !== F ? (n = F(o), e[87] = o, e[88] = F, e[89] = n) : n = e[89], Be = n;
|
|
365
|
+
break e;
|
|
366
|
+
}
|
|
367
|
+
if (F !== void 0) {
|
|
368
|
+
Be = F;
|
|
369
|
+
break e;
|
|
370
|
+
}
|
|
371
|
+
if (Array.isArray(t) && t.length > 0) {
|
|
372
|
+
if (t.length === 1) {
|
|
373
|
+
let o;
|
|
374
|
+
e[90] !== D || e[91] !== t[0] ? (o = D(t[0]), e[90] = D, e[91] = t[0], e[92] = o) : o = e[92], Be = o;
|
|
375
|
+
break e;
|
|
376
|
+
}
|
|
377
|
+
Be = `${t.length} selected`;
|
|
378
|
+
break e;
|
|
379
|
+
}
|
|
380
|
+
Be = p;
|
|
381
|
+
}
|
|
382
|
+
const Ht = Be;
|
|
383
|
+
let Le;
|
|
384
|
+
e[93] !== de ? (Le = de ?? {}, e[93] = de, e[94] = Le) : Le = e[94];
|
|
385
|
+
let We, ze, pt, re;
|
|
386
|
+
e[95] !== Le ? ({
|
|
387
|
+
onClick: re,
|
|
388
|
+
fullWidth: pt,
|
|
389
|
+
className: ze,
|
|
390
|
+
...We
|
|
391
|
+
} = Le, e[95] = Le, e[96] = We, e[97] = ze, e[98] = pt, e[99] = re) : (We = e[96], ze = e[97], pt = e[98], re = e[99]);
|
|
392
|
+
const jt = Z ?? "outline", Vt = Pe ?? "small", Mt = pt ?? Yt ?? !1, Ee = Ge ?? "right";
|
|
393
|
+
let ht;
|
|
394
|
+
e[100] !== s || e[101] !== Ee || e[102] !== ue ? (ht = ue ?? (Ee === "left" ? /* @__PURE__ */ l(Jt, { className: y("h-4 w-4 transition-transform", s ? "-rotate-180" : "") }) : /* @__PURE__ */ l(Jt, { className: y("h-4 w-4 transition-transform", s ? "rotate-180" : "") })), e[100] = s, e[101] = Ee, e[102] = ue, e[103] = ht) : ht = e[103];
|
|
395
|
+
const Xt = ht, Zt = "w-auto", Gt = te ? "" : Ze;
|
|
396
|
+
let $e;
|
|
397
|
+
e[104] !== Zt || e[105] !== Gt ? ($e = y("relative", Zt, Gt), e[104] = Zt, e[105] = Gt, e[106] = $e) : $e = e[106];
|
|
398
|
+
let qe;
|
|
399
|
+
e[107] !== ge || e[108] !== T || e[109] !== g || e[110] !== i || e[111] !== vt || e[112] !== we || e[113] !== ve ? (qe = g && /* @__PURE__ */ O("label", { htmlFor: ge, className: "block text-sm font-medium mb-1", onClick: (o) => {
|
|
400
|
+
var n;
|
|
401
|
+
o.preventDefault(), ve(!1), we(""), i == null || i({
|
|
402
|
+
target: {
|
|
403
|
+
value: ""
|
|
404
|
+
}
|
|
405
|
+
}, ""), (n = T.current) == null || n.focus();
|
|
406
|
+
}, onKeyDown: (o) => {
|
|
407
|
+
var n;
|
|
408
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), ve(!1), we(""), i == null || i({
|
|
409
|
+
target: {
|
|
410
|
+
value: ""
|
|
411
|
+
}
|
|
412
|
+
}, ""), (n = T.current) == null || n.focus());
|
|
413
|
+
}, children: [
|
|
414
|
+
g,
|
|
415
|
+
vt && /* @__PURE__ */ l("span", { className: "text-destructive ml-1", children: "*" })
|
|
416
|
+
] }), e[107] = ge, e[108] = T, e[109] = g, e[110] = i, e[111] = vt, e[112] = we, e[113] = ve, e[114] = qe) : qe = e[114];
|
|
417
|
+
let Ke;
|
|
418
|
+
e[115] !== Et || e[116] !== Ht || e[117] !== Wt || e[118] !== f || e[119] !== It || e[120] !== it || e[121] !== ye || e[122] !== ke || e[123] !== lt || e[124] !== ge || e[125] !== T || e[126] !== _ || e[127] !== te || e[128] !== Ce || e[129] !== Ie || e[130] !== s || e[131] !== p || e[132] !== Mt || e[133] !== Xt || e[134] !== Ee || e[135] !== Vt || e[136] !== jt || e[137] !== We || e[138] !== At || e[139] !== h || e[140] !== ze || e[141] !== re || e[142] !== nt ? (Ke = te ? /* @__PURE__ */ O("div", { ref: nt, className: Et, children: [
|
|
419
|
+
/* @__PURE__ */ l("input", { id: ge, ref: T, value: _, onChange: ye, onKeyDown: ke, onFocus: it, "aria-hidden": "true", tabIndex: -1, readOnly: !0, className: "sr-only" }),
|
|
420
|
+
/* @__PURE__ */ l(mo, { variant: jt, size: Vt, icon: Xt, iconPosition: Ee, fullWidth: Mt, disabled: f, type: "button", "aria-haspopup": "listbox", "aria-expanded": s, "aria-controls": Ce, className: y("hover:bg-transparent active:bg-transparent focus-visible:bg-transparent focus-visible:ring-0", ze), ...We, onClick: (o) => {
|
|
421
|
+
if (re == null || re(o), f)
|
|
422
|
+
return;
|
|
423
|
+
const n = !s;
|
|
424
|
+
lt(), n && setTimeout(() => {
|
|
425
|
+
var R;
|
|
426
|
+
(R = T.current) == null || R.focus();
|
|
427
|
+
}, 0);
|
|
428
|
+
}, children: Ht }),
|
|
429
|
+
Ie && /* @__PURE__ */ l("div", { className: "ml-2 animate-spin rounded-full h-4 w-4 border-2 border-muted-foreground border-t-transparent" })
|
|
430
|
+
] }) : /* @__PURE__ */ O("div", { ref: nt, className: Wt, children: [
|
|
431
|
+
/* @__PURE__ */ l(ho, { id: ge, ref: T, value: h ? "" : _, onChange: h ? void 0 : ye, onKeyDown: ke, onFocus: it, placeholder: p, disabled: f, readOnly: h, className: "px-0 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent rounded-md", role: "combobox", "aria-expanded": s, "aria-controls": Ce, "aria-autocomplete": "list" }),
|
|
432
|
+
/* @__PURE__ */ O("div", { className: "flex items-center gap-1 ml-auto", children: [
|
|
433
|
+
Ie && /* @__PURE__ */ l("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-muted-foreground border-t-transparent" }),
|
|
434
|
+
At && /* @__PURE__ */ l("button", { type: "button", onClick: It, className: "p-1 hover:bg-accent rounded-sm transition-colors", tabIndex: -1, children: /* @__PURE__ */ l(oo, { className: "h-4 w-4 text-muted-foreground" }) }),
|
|
435
|
+
/* @__PURE__ */ l("button", { type: "button", disabled: f, onClick: lt, className: y("p-1 hover:bg-accent rounded-sm transition-colors", f ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), tabIndex: -1, "aria-label": s ? "Close options" : "Open options", children: /* @__PURE__ */ l(Jt, { className: y("h-4 w-4 text-muted-foreground transition-transform", s ? "rotate-180" : "") }) })
|
|
436
|
+
] })
|
|
437
|
+
] }), e[115] = Et, e[116] = Ht, e[117] = Wt, e[118] = f, e[119] = It, e[120] = it, e[121] = ye, e[122] = ke, e[123] = lt, e[124] = ge, e[125] = T, e[126] = _, e[127] = te, e[128] = Ce, e[129] = Ie, e[130] = s, e[131] = p, e[132] = Mt, e[133] = Xt, e[134] = Ee, e[135] = Vt, e[136] = jt, e[137] = We, e[138] = At, e[139] = h, e[140] = ze, e[141] = re, e[142] = nt, e[143] = Ke) : Ke = e[143];
|
|
438
|
+
let He;
|
|
439
|
+
e[144] !== Ct || e[145] !== yt || e[146] !== X || e[147] !== S || e[148] !== St || e[149] !== f || e[150] !== V || e[151] !== Ae || e[152] !== De || e[153] !== j || e[154] !== Fe || e[155] !== D || e[156] !== a || e[157] !== ye || e[158] !== ke || e[159] !== Kt || e[160] !== H || e[161] !== v || e[162] !== _ || e[163] !== te || e[164] !== Ft || e[165] !== g || e[166] !== M || e[167] !== Ce || e[168] !== $t || e[169] !== s || e[170] !== p || e[171] !== W || e[172] !== J || e[173] !== L || e[174] !== kt || e[175] !== h ? (He = s && (() => {
|
|
440
|
+
const o = V.width > 0 && V.maxHeight > 0, n = /* @__PURE__ */ l(bo, { delayDuration: 0, children: /* @__PURE__ */ O("div", { id: Ce, role: "listbox", "aria-label": g || "Options", "data-dialog-interactive-layer": "true", className: y("fixed z-[99999] pointer-events-auto bg-popover border border-border rounded-md shadow-lg", "flex flex-col overflow-hidden", !o && "invisible", v), style: (() => {
|
|
441
|
+
const w = () => te ? typeof Ae == "number" ? `${Ae}px` : typeof Ae == "string" ? Ae : "220px" : V.width;
|
|
442
|
+
return {
|
|
443
|
+
top: V.top,
|
|
444
|
+
left: V.left,
|
|
445
|
+
minWidth: te ? void 0 : V.width,
|
|
446
|
+
width: w(),
|
|
447
|
+
maxHeight: V.maxHeight,
|
|
448
|
+
zIndex: 99999,
|
|
449
|
+
pointerEvents: "auto"
|
|
450
|
+
};
|
|
451
|
+
})(), ref: M, children: [
|
|
452
|
+
h && /* @__PURE__ */ l("div", { className: "p-2 bg-popover", children: /* @__PURE__ */ l(fo, { ref: qt, query: _, onChange: ye, onKeyDown: ke, placeholder: L ?? p, className: "w-full", "aria-label": "Search options", disabled: f, size: "small" }) }),
|
|
453
|
+
/* @__PURE__ */ l("div", { className: y("min-h-0 flex-1 overflow-auto", "[scrollbar-gutter:stable]", "[&::-webkit-scrollbar]:w-2", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:bg-gray-300", "[&::-webkit-scrollbar-thumb]:rounded-full", "[&::-webkit-scrollbar-thumb]:border-0", "[&::-webkit-scrollb#F5F5F5ar-thumb]:min-h-[30px]", "scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent"), children: j.length === 0 ? /* @__PURE__ */ l("div", { className: "p-3 text-sm text-muted-foreground text-center", children: $t }) : j.map((w, E) => {
|
|
454
|
+
const Me = Ft(w);
|
|
455
|
+
return /* @__PURE__ */ l(Co, { option: w, index: E, isSelected: Me, isHighlighted: E === H, onSelect: Kt, getOptionLabel: D, renderOption: J, freeSolo: Fe, originalOptions: De, checkboxPosition: yt, showChip: kt, checkboxProps: X, chipProps: S, checkboxColor: Ct }, typeof w == "string" ? w : String((a == null ? void 0 : a(w)) ?? E));
|
|
456
|
+
}) })
|
|
457
|
+
] }) });
|
|
458
|
+
if (St)
|
|
459
|
+
return n;
|
|
460
|
+
const R = W ?? document.body;
|
|
461
|
+
return co(n, R);
|
|
462
|
+
})(), e[144] = Ct, e[145] = yt, e[146] = X, e[147] = S, e[148] = St, e[149] = f, e[150] = V, e[151] = Ae, e[152] = De, e[153] = j, e[154] = Fe, e[155] = D, e[156] = a, e[157] = ye, e[158] = ke, e[159] = Kt, e[160] = H, e[161] = v, e[162] = _, e[163] = te, e[164] = Ft, e[165] = g, e[166] = M, e[167] = Ce, e[168] = $t, e[169] = s, e[170] = p, e[171] = W, e[172] = J, e[173] = L, e[174] = kt, e[175] = h, e[176] = He) : He = e[176];
|
|
463
|
+
let je;
|
|
464
|
+
e[177] !== Dt || e[178] !== Ke || e[179] !== He ? (je = /* @__PURE__ */ O("div", { className: "relative overflow-visible", children: [
|
|
465
|
+
Dt,
|
|
466
|
+
Ke,
|
|
467
|
+
He
|
|
468
|
+
] }), e[177] = Dt, e[178] = Ke, e[179] = He, e[180] = je) : je = e[180];
|
|
469
|
+
let Ve;
|
|
470
|
+
e[181] !== C || e[182] !== k ? (Ve = (k || C) && /* @__PURE__ */ l("p", { className: y("mt-1 text-xs", C ? "text-destructive" : "text-muted-foreground"), children: C || k }), e[181] = C, e[182] = k, e[183] = Ve) : Ve = e[183];
|
|
471
|
+
let bt;
|
|
472
|
+
return e[184] !== Ot || e[185] !== $e || e[186] !== qe || e[187] !== je || e[188] !== Ve ? (bt = /* @__PURE__ */ O("div", { className: $e, ref: Ot, children: [
|
|
473
|
+
qe,
|
|
474
|
+
je,
|
|
475
|
+
Ve
|
|
476
|
+
] }), e[184] = Ot, e[185] = $e, e[186] = qe, e[187] = je, e[188] = Ve, e[189] = bt) : bt = e[189], bt;
|
|
477
|
+
}
|
|
478
|
+
export {
|
|
479
|
+
Eo as AutocompleteCheckbox
|
|
480
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as d, jsxs as te } from "react/jsx-runtime";
|
|
3
|
+
import { c as ne } from "react-compiler-runtime";
|
|
4
|
+
import { X as ae } from "lucide-react";
|
|
5
|
+
import le, { useRef as de, useState as ce, useEffect as fe } from "react";
|
|
6
|
+
import { TooltipProvider as ue, Tooltip as be, TooltipTrigger as pe, TooltipContent as ge } from "../../../ui/tooltip.js";
|
|
7
|
+
import { cn as _ } from "../../../../lib/utils.js";
|
|
8
|
+
const Ce = (q) => {
|
|
9
|
+
const e = ne(82);
|
|
10
|
+
let c, s, f, u, n, o, r, i, b, C, D, k, N, z, B, T;
|
|
11
|
+
e[0] !== q ? ({
|
|
12
|
+
label: o,
|
|
13
|
+
variant: C,
|
|
14
|
+
color: D,
|
|
15
|
+
size: k,
|
|
16
|
+
shape: N,
|
|
17
|
+
deletable: z,
|
|
18
|
+
onDelete: i,
|
|
19
|
+
onClick: r,
|
|
20
|
+
icon: n,
|
|
21
|
+
avatar: s,
|
|
22
|
+
disabled: B,
|
|
23
|
+
className: T,
|
|
24
|
+
"aria-label": c,
|
|
25
|
+
deleteAriaLabel: u,
|
|
26
|
+
closeButtonClassName: f,
|
|
27
|
+
...b
|
|
28
|
+
} = q, e[0] = q, e[1] = c, e[2] = s, e[3] = f, e[4] = u, e[5] = n, e[6] = o, e[7] = r, e[8] = i, e[9] = b, e[10] = C, e[11] = D, e[12] = k, e[13] = N, e[14] = z, e[15] = B, e[16] = T) : (c = e[1], s = e[2], f = e[3], u = e[4], n = e[5], o = e[6], r = e[7], i = e[8], b = e[9], C = e[10], D = e[11], k = e[12], N = e[13], z = e[14], B = e[15], T = e[16]);
|
|
29
|
+
const H = C === void 0 ? "filled" : C, V = D === void 0 ? "default" : D, a = k === void 0 ? "medium" : k, X = N === void 0 ? "pill" : N, F = z === void 0 ? !1 : z, t = B === void 0 ? !1 : B, G = T === void 0 ? "" : T;
|
|
30
|
+
let K;
|
|
31
|
+
if (e[17] !== G || e[18] !== V || e[19] !== t || e[20] !== r || e[21] !== X || e[22] !== a || e[23] !== H) {
|
|
32
|
+
const l = {
|
|
33
|
+
small: "px-2 py-0.5 text-xs",
|
|
34
|
+
medium: "px-3 py-1 text-sm",
|
|
35
|
+
large: "px-4 py-1.5 text-base"
|
|
36
|
+
}, E = {
|
|
37
|
+
pill: "rounded-full",
|
|
38
|
+
square: "rounded-md"
|
|
39
|
+
}, re = {
|
|
40
|
+
default: {
|
|
41
|
+
filled: "bg-gray-200 text-gray-800",
|
|
42
|
+
outlined: "border border-gray-300 text-gray-700",
|
|
43
|
+
soft: "bg-gray-100 text-gray-800"
|
|
44
|
+
},
|
|
45
|
+
primary: {
|
|
46
|
+
filled: "bg-blue-500 text-white",
|
|
47
|
+
outlined: "border border-blue-500 text-blue-600",
|
|
48
|
+
soft: "bg-blue-50 text-blue-700"
|
|
49
|
+
},
|
|
50
|
+
secondary: {
|
|
51
|
+
filled: "bg-purple-500 text-white",
|
|
52
|
+
outlined: "border border-purple-500 text-purple-600",
|
|
53
|
+
soft: "bg-purple-50 text-purple-700"
|
|
54
|
+
},
|
|
55
|
+
success: {
|
|
56
|
+
filled: "bg-green-500 text-white",
|
|
57
|
+
outlined: "border border-green-500 text-green-600",
|
|
58
|
+
soft: "bg-green-50 text-green-700"
|
|
59
|
+
},
|
|
60
|
+
warning: {
|
|
61
|
+
filled: "bg-yellow-500 text-white",
|
|
62
|
+
outlined: "border border-yellow-500 text-yellow-600",
|
|
63
|
+
soft: "bg-yellow-50 text-yellow-700"
|
|
64
|
+
},
|
|
65
|
+
error: {
|
|
66
|
+
filled: "bg-red-500 text-white",
|
|
67
|
+
outlined: "border border-destructive text-red-600",
|
|
68
|
+
soft: "bg-red-50 text-red-700"
|
|
69
|
+
},
|
|
70
|
+
gray: {
|
|
71
|
+
filled: "bg-gray-400 text-white",
|
|
72
|
+
outlined: "border border-gray-400 text-gray-400",
|
|
73
|
+
soft: "bg-gray-400/20 text-gray-600"
|
|
74
|
+
},
|
|
75
|
+
branding: {
|
|
76
|
+
filled: "bg-brandBlue text-white",
|
|
77
|
+
outlined: "border border-brandBlue text-brandBlue",
|
|
78
|
+
soft: "bg-brandBlue/10 text-brandBlue"
|
|
79
|
+
}
|
|
80
|
+
}, se = t ? "opacity-50 cursor-not-allowed" : "", ie = r && !t ? "cursor-pointer" : "";
|
|
81
|
+
K = _("inline-flex items-center gap-1 font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2", l[a], E[X], re[V][H], se, ie, r && !t && "focus:ring-2 focus:ring-offset-2", G), e[17] = G, e[18] = V, e[19] = t, e[20] = r, e[21] = X, e[22] = a, e[23] = H, e[24] = K;
|
|
82
|
+
} else
|
|
83
|
+
K = e[24];
|
|
84
|
+
const J = K;
|
|
85
|
+
let L;
|
|
86
|
+
e[25] !== t || e[26] !== r ? (L = (l) => {
|
|
87
|
+
!t && r && r(l);
|
|
88
|
+
}, e[25] = t, e[26] = r, e[27] = L) : L = e[27];
|
|
89
|
+
const p = L;
|
|
90
|
+
let R;
|
|
91
|
+
e[28] !== t || e[29] !== p || e[30] !== r ? (R = (l) => {
|
|
92
|
+
!t && r && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), p(l));
|
|
93
|
+
}, e[28] = t, e[29] = p, e[30] = r, e[31] = R) : R = e[31];
|
|
94
|
+
const O = R;
|
|
95
|
+
let $;
|
|
96
|
+
e[32] !== t || e[33] !== i ? ($ = (l) => {
|
|
97
|
+
l.stopPropagation(), !t && i && i(l);
|
|
98
|
+
}, e[32] = t, e[33] = i, e[34] = $) : $ = e[34];
|
|
99
|
+
const g = $;
|
|
100
|
+
let j;
|
|
101
|
+
e[35] !== t || e[36] !== g ? (j = (l) => {
|
|
102
|
+
t || (l.preventDefault(), g(l));
|
|
103
|
+
}, e[35] = t, e[36] = g, e[37] = j) : j = e[37];
|
|
104
|
+
const Q = j;
|
|
105
|
+
let I;
|
|
106
|
+
e[38] !== t || e[39] !== g || e[40] !== i ? (I = (l) => {
|
|
107
|
+
!t && i && (l.key === "Delete" || l.key === "Backspace") && (l.preventDefault(), g(l));
|
|
108
|
+
}, e[38] = t, e[39] = g, e[40] = i, e[41] = I) : I = e[41];
|
|
109
|
+
const U = I, m = a === "small" ? 12 : a === "large" ? 18 : 14, ee = de(null), [Y, oe] = ce(!1);
|
|
110
|
+
let S, A;
|
|
111
|
+
e[42] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
|
|
112
|
+
const l = ee.current;
|
|
113
|
+
if (!l)
|
|
114
|
+
return;
|
|
115
|
+
const E = () => {
|
|
116
|
+
l && oe(l.scrollWidth > l.clientWidth);
|
|
117
|
+
};
|
|
118
|
+
return E(), window.addEventListener("resize", E), () => {
|
|
119
|
+
window.removeEventListener("resize", E);
|
|
120
|
+
};
|
|
121
|
+
}, A = [], e[42] = S, e[43] = A) : (S = e[42], A = e[43]), fe(S, A);
|
|
122
|
+
let M;
|
|
123
|
+
e[44] !== o ? (M = /* @__PURE__ */ d("span", { ref: ee, className: "max-w-72 truncate", children: o }), e[44] = o, e[45] = M) : M = e[45];
|
|
124
|
+
const P = M, Z = !!r;
|
|
125
|
+
let h;
|
|
126
|
+
e[46] !== c || e[47] !== t || e[48] !== p || e[49] !== O || e[50] !== Z || e[51] !== o ? (h = Z ? {
|
|
127
|
+
onClick: p,
|
|
128
|
+
onKeyDown: O,
|
|
129
|
+
role: "button",
|
|
130
|
+
tabIndex: t ? void 0 : 0,
|
|
131
|
+
"aria-label": c || `${o} chip`,
|
|
132
|
+
"aria-disabled": t
|
|
133
|
+
} : {}, e[46] = c, e[47] = t, e[48] = p, e[49] = O, e[50] = Z, e[51] = o, e[52] = h) : h = e[52];
|
|
134
|
+
let x;
|
|
135
|
+
e[53] !== s || e[54] !== o || e[55] !== a ? (x = s && /* @__PURE__ */ d("div", { className: _("rounded-full overflow-hidden", a === "small" ? "w-4 h-4" : a === "large" ? "w-6 h-6" : "w-5 h-5"), children: typeof s == "string" ? /* @__PURE__ */ d("img", { src: s, alt: `Avatar for ${o}`, className: "w-full h-full object-cover" }) : s }), e[53] = s, e[54] = o, e[55] = a, e[56] = x) : x = e[56];
|
|
136
|
+
let y;
|
|
137
|
+
e[57] !== s || e[58] !== n || e[59] !== m ? (y = n && !s && /* @__PURE__ */ d("div", { className: "flex items-center", "aria-hidden": "true", children: le.isValidElement(n) ? le.cloneElement(n, {
|
|
138
|
+
size: m
|
|
139
|
+
}) : n }), e[57] = s, e[58] = n, e[59] = m, e[60] = y) : y = e[60];
|
|
140
|
+
let w;
|
|
141
|
+
e[61] !== Y || e[62] !== o || e[63] !== P ? (w = Y ? /* @__PURE__ */ d(ue, { delayDuration: 0, children: /* @__PURE__ */ te(be, { children: [
|
|
142
|
+
/* @__PURE__ */ d(pe, { asChild: !0, children: P }),
|
|
143
|
+
/* @__PURE__ */ d(ge, { children: o })
|
|
144
|
+
] }) }) : P, e[61] = Y, e[62] = o, e[63] = P, e[64] = w) : w = e[64];
|
|
145
|
+
let v;
|
|
146
|
+
e[65] !== f || e[66] !== F || e[67] !== u || e[68] !== t || e[69] !== U || e[70] !== Q || e[71] !== m || e[72] !== o ? (v = F && /* @__PURE__ */ d("button", { type: "button", onMouseDown: Q, onKeyDown: U, className: _("ml-1 rounded-full p-0.5 transition-colors focus:outline-none focus:ring-1 focus:ring-offset-1", f, t ? "cursor-not-allowed" : ""), disabled: t, "aria-label": u || `Remove ${o}`, tabIndex: t ? -1 : 0, children: /* @__PURE__ */ d(ae, { size: m }) }), e[65] = f, e[66] = F, e[67] = u, e[68] = t, e[69] = U, e[70] = Q, e[71] = m, e[72] = o, e[73] = v) : v = e[73];
|
|
147
|
+
let W;
|
|
148
|
+
return e[74] !== J || e[75] !== b || e[76] !== h || e[77] !== x || e[78] !== y || e[79] !== w || e[80] !== v ? (W = /* @__PURE__ */ te("div", { ...b, className: J, ...h, children: [
|
|
149
|
+
x,
|
|
150
|
+
y,
|
|
151
|
+
w,
|
|
152
|
+
v
|
|
153
|
+
] }), e[74] = J, e[75] = b, e[76] = h, e[77] = x, e[78] = y, e[79] = w, e[80] = v, e[81] = W) : W = e[81], W;
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
Ce as Chip
|
|
157
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
3
|
+
import { c as C } from "react-compiler-runtime";
|
|
4
|
+
import * as b from "react";
|
|
5
|
+
import { Spinner as v } from "../../ui/spinner.js";
|
|
6
|
+
import { cn as x } from "../../../lib/utils.js";
|
|
7
|
+
const P = b.forwardRef((d, p) => {
|
|
8
|
+
const e = C(19);
|
|
9
|
+
let t, a, r, l, i;
|
|
10
|
+
e[0] !== d ? ({
|
|
11
|
+
size: r,
|
|
12
|
+
strokeWidth: l,
|
|
13
|
+
className: t,
|
|
14
|
+
colorClassName: i,
|
|
15
|
+
...a
|
|
16
|
+
} = d, e[0] = d, e[1] = t, e[2] = a, e[3] = r, e[4] = l, e[5] = i) : (t = e[1], a = e[2], r = e[3], l = e[4], i = e[5]);
|
|
17
|
+
const c = r === void 0 ? 32 : r, f = l === void 0 ? 2 : l, u = i === void 0 ? "" : i, g = a;
|
|
18
|
+
let m, o;
|
|
19
|
+
e[6] !== g ? ({
|
|
20
|
+
"aria-label": m,
|
|
21
|
+
...o
|
|
22
|
+
} = g, e[6] = g, e[7] = m, e[8] = o) : (m = e[7], o = e[8]);
|
|
23
|
+
const h = m ?? "Loading";
|
|
24
|
+
let s;
|
|
25
|
+
e[9] !== t || e[10] !== u ? (s = x("text-muted-foreground", u, t), e[9] = t, e[10] = u, e[11] = s) : s = e[11];
|
|
26
|
+
let n;
|
|
27
|
+
return e[12] !== p || e[13] !== o || e[14] !== c || e[15] !== f || e[16] !== h || e[17] !== s ? (n = /* @__PURE__ */ N(v, { ref: p, role: "status", "aria-label": h, className: s, width: c, height: c, strokeWidth: f, ...o }), e[12] = p, e[13] = o, e[14] = c, e[15] = f, e[16] = h, e[17] = s, e[18] = n) : n = e[18], n;
|
|
28
|
+
});
|
|
29
|
+
P.displayName = "CircularProgress";
|
|
30
|
+
export {
|
|
31
|
+
P as CircularProgress
|
|
32
|
+
};
|