@iamfiro/design 0.1.0 → 0.3.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/AGENTS.md +1 -0
- package/agents/INDEX.md +1 -0
- package/agents/brand-icon/AGENTS.md +2 -2
- package/agents/social-login-button/AGENTS.md +156 -0
- package/lib/components/Accordion/Accordion2.js +135 -0
- package/lib/components/ActionBar/ActionBar2.js +65 -0
- package/lib/components/Alert/Alert2.js +131 -0
- package/lib/components/AppShell/AppShell2.js +94 -0
- package/lib/components/AreaChart/AreaChart.js +59 -0
- package/lib/components/BarChart/BarChart2.js +243 -0
- package/lib/components/BarList/BarList2.js +172 -0
- package/lib/components/Breadcrumb/Breadcrumb2.js +87 -0
- package/lib/components/Calendar/Calendar2.js +309 -0
- package/lib/components/Calendar/DatePicker2.js +229 -0
- package/lib/components/Calendar/date.js +121 -0
- package/lib/components/Card/Card2.js +104 -0
- package/lib/components/CardFrame/CardFrame2.js +72 -0
- package/lib/components/Chart/ChartParts.js +150 -0
- package/lib/components/Chart/chart2.js +96 -0
- package/lib/components/Chart/useChartInteraction.js +94 -0
- package/lib/components/ChatBubble/ChatBubble2.js +174 -0
- package/lib/components/ChatBubble/formatChatTime.js +53 -0
- package/lib/components/ChatComposer/ChatComposer2.js +153 -0
- package/lib/components/CodeBlock/CodeBlock2.js +93 -0
- package/lib/components/CodeBlock/highlight.js +114 -0
- package/lib/components/ColorPicker/ColorPicker2.js +610 -0
- package/lib/components/ColorPicker/color.js +180 -0
- package/lib/components/ColorPicker/presets.js +75 -0
- package/lib/components/Combobox/Combobox2.js +229 -0
- package/lib/components/CommandMenu/CommandMenu.js +267 -0
- package/lib/components/Comment/Comment2.js +134 -0
- package/lib/components/ContextMenu/ContextMenu2.js +168 -0
- package/lib/components/DataGrid/DataGrid2.js +1996 -0
- package/lib/components/DataGrid/GridPopover.js +154 -0
- package/lib/components/DataGrid/anchor.js +50 -0
- package/lib/components/DataGrid/model.js +558 -0
- package/lib/components/DataGrid/panels.js +703 -0
- package/lib/components/DataGrid/typeMeta.js +76 -0
- package/lib/components/DataGrid/types.js +54 -0
- package/lib/components/DescriptionList/DescriptionList2.js +180 -0
- package/lib/components/Dialog/AlertDialog.js +118 -0
- package/lib/components/Dialog/Dialog2.js +109 -0
- package/lib/components/Dialog/modal.js +92 -0
- package/lib/components/Drawer/Drawer2.js +244 -0
- package/lib/components/DropdownMenu/DropdownMenu2.js +394 -0
- package/lib/components/DropdownMenu/menuCore.js +63 -0
- package/lib/components/Dropzone/Dropzone2.js +144 -0
- package/lib/components/EmptyState/EmptyState2.js +72 -0
- package/lib/components/FileChip/FileChip2.js +118 -0
- package/lib/components/FileUpload/FileUpload.js +258 -0
- package/lib/components/FilterChips/FilterChips2.js +101 -0
- package/lib/components/FunnelChart/FunnelChart2.js +283 -0
- package/lib/components/FunnelChart/funnel.js +69 -0
- package/lib/components/Highlight/Highlight2.js +100 -0
- package/lib/components/HoverCard/HoverCard.js +134 -0
- package/lib/components/InlineDiff/InlineDiff2.js +215 -0
- package/lib/components/InlineDiff/diff.js +126 -0
- package/lib/components/InlineDiff/useDiffReview.js +109 -0
- package/lib/components/Kanban/Kanban2.js +691 -0
- package/lib/components/Kanban/KanbanCard.js +159 -0
- package/lib/components/Kanban/move.js +69 -0
- package/lib/components/LineChart/LineChart2.js +342 -0
- package/lib/components/List/List2.js +133 -0
- package/lib/components/Listbox/Listbox2.js +163 -0
- package/lib/components/Marker/Marker2.js +82 -0
- package/lib/components/Menubar/Menubar2.js +223 -0
- package/lib/components/MultiSelect/MultiSelect2.js +204 -0
- package/lib/components/NavigationMenu/NavigationMenu2.js +481 -0
- package/lib/components/NoticeStack/NoticeStack2.js +178 -0
- package/lib/components/NumberStepper/NumberStepper2.js +129 -0
- package/lib/components/OtpInput/OtpInput2.js +122 -0
- package/lib/components/Pagination/Pagination2.js +210 -0
- package/lib/components/Pagination/paginationRange.js +53 -0
- package/lib/components/PhoneInput/PhoneInput.js +175 -0
- package/lib/components/PieChart/PieChart2.js +246 -0
- package/lib/components/PieChart/arc.js +66 -0
- package/lib/components/PieChart/useArcTween.js +94 -0
- package/lib/components/Popover/Popover2.js +112 -0
- package/lib/components/ProgressTracker/ProgressTracker2.js +226 -0
- package/lib/components/Rating/Rating2.js +186 -0
- package/lib/components/Resizable/Resizable2.js +236 -0
- package/lib/components/Resizable/layout.js +115 -0
- package/lib/components/ScaledPreview/ScaledPreview2.js +100 -0
- package/lib/components/ScatterChart/ScatterChart2.js +356 -0
- package/lib/components/ScatterChart/scatter.js +83 -0
- package/lib/components/ScrollArea/ScrollArea2.js +218 -0
- package/lib/components/Select/Select2.js +153 -0
- package/lib/components/Sidebar/Sidebar2.js +127 -0
- package/lib/components/Skeleton/Skeleton2.js +91 -0
- package/lib/components/Slider/Slider2.js +142 -0
- package/lib/components/SocialLoginButton/SocialLoginButton.js +85 -0
- package/lib/components/SparkChart/SparkChart2.js +217 -0
- package/lib/components/SparkChart/spark.js +76 -0
- package/lib/components/Sparkbar/Sparkbar2.js +111 -0
- package/lib/components/SplitView/SplitView2.js +95 -0
- package/lib/components/Stat/Stat2.js +164 -0
- package/lib/components/StepList/StepList2.js +131 -0
- package/lib/components/Table/Table2.js +104 -0
- package/lib/components/Tabs/Tabs2.js +131 -0
- package/lib/components/TagInput/TagInput2.js +360 -0
- package/lib/components/TimePicker/TimePicker2.js +388 -0
- package/lib/components/TimePicker/time.js +83 -0
- package/lib/components/Timeline/Timeline2.js +369 -0
- package/lib/components/Timeline/scale.js +83 -0
- package/lib/components/Toast/Toaster.js +212 -0
- package/lib/components/Toast/store.js +129 -0
- package/lib/components/ToggleGroup/ToggleGroup2.js +125 -0
- package/lib/components/Toolbar/Toolbar2.js +281 -0
- package/lib/components/Tracker/Tracker2.js +172 -0
- package/lib/components/TreeDiagram/TreeDiagram2.js +223 -0
- package/lib/components/TreeView/TreeView2.js +284 -0
- package/lib/hooks/timing.js +55 -0
- package/lib/hooks/useControllableState.js +49 -0
- package/lib/hooks/useCountdown.js +80 -0
- package/lib/hooks/useDigitInput.js +105 -0
- package/lib/hooks/useDismiss.js +71 -0
- package/lib/hooks/useElapsed.js +83 -0
- package/lib/hooks/useFloating.js +70 -0
- package/lib/hooks/useFocusTrap.js +61 -0
- package/lib/hooks/usePresence.js +60 -0
- package/lib/hooks/usePressToOpen.js +69 -0
- package/lib/hooks/useScrollLock.js +70 -0
- package/lib/hooks/useSelection.js +68 -0
- package/lib/index.js +175 -17911
- package/lib/primitives/AspectRatio2.js +80 -0
- package/lib/primitives/BrandIcon.js +245 -0
- package/lib/primitives/ColorDot2.js +70 -0
- package/lib/primitives/CopyButton2.js +85 -0
- package/lib/primitives/CountBadge2.js +78 -0
- package/lib/primitives/Countdown2.js +65 -0
- package/lib/primitives/Delta2.js +67 -0
- package/lib/primitives/Elapsed.js +62 -0
- package/lib/primitives/FileIcon2.js +125 -0
- package/lib/primitives/Flag2.js +263 -0
- package/lib/primitives/IconStack2.js +85 -0
- package/lib/primitives/IconTile2.js +68 -0
- package/lib/primitives/Kbd2.js +88 -0
- package/lib/primitives/Layout2.js +118 -0
- package/lib/primitives/Link2.js +53 -0
- package/lib/primitives/MaskedText2.js +120 -0
- package/lib/primitives/Progress2.js +137 -0
- package/lib/primitives/RelativeTime.js +84 -0
- package/lib/primitives/SearchInput2.js +84 -0
- package/lib/primitives/SelectorButton2.js +97 -0
- package/lib/primitives/Spinner2.js +98 -0
- package/lib/primitives/StatusIcon2.js +126 -0
- package/lib/primitives/Swatch2.js +79 -0
- package/lib/primitives/Tooltip2.js +132 -0
- package/lib/primitives/Typography2.js +97 -0
- package/lib/primitives/formatCountdown.js +51 -0
- package/lib/primitives/formatElapsed.js +66 -0
- package/lib/primitives/formatRelativeTime.js +64 -0
- package/lib/primitives/hotkey.js +94 -0
- package/lib/primitives/index.js +352 -0
- package/lib/primitives/maskValue.js +65 -0
- package/lib/style.css +1 -1
- package/lib/types/components/SocialLoginButton/SocialLoginButton.d.ts +10 -0
- package/lib/types/components/index.d.ts +2 -0
- package/lib/types/primitives/BrandIcon.d.ts +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e = t;
|
|
3
|
+
(function(e, n) {
|
|
4
|
+
let r = t, i = e();
|
|
5
|
+
for (;;) try {
|
|
6
|
+
if (parseInt(r(537)) / 1 * (-parseInt(r(531)) / 2) + parseInt(r(572)) / 3 * (-parseInt(r(578)) / 4) + -parseInt(r(508)) / 5 * (parseInt(r(570)) / 6) + parseInt(r(506)) / 7 * (parseInt(r(523)) / 8) + -parseInt(r(551)) / 9 + -parseInt(r(519)) / 10 + parseInt(r(538)) / 11 == n) break;
|
|
7
|
+
i.push(i.shift());
|
|
8
|
+
} catch {
|
|
9
|
+
i.push(i.shift());
|
|
10
|
+
}
|
|
11
|
+
})(d, 398990);
|
|
12
|
+
function t(e, n) {
|
|
13
|
+
e -= 494;
|
|
14
|
+
let r = d(), i = r[e];
|
|
15
|
+
t.TlpGPz === void 0 && (t.OUUMCD = function(e) {
|
|
16
|
+
let t = "", n = "";
|
|
17
|
+
for (let n = 0, r, i, a = 0; i = e.charAt(a++); ~i && (r = n % 4 ? r * 64 + i : i, n++ % 4) && (t += String.fromCharCode(255 & r >> (-2 * n & 6)))) i = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);
|
|
18
|
+
for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
|
|
19
|
+
return decodeURIComponent(n);
|
|
20
|
+
}, t.sGsYht = {}, t.TlpGPz = !0);
|
|
21
|
+
let a = r[0];
|
|
22
|
+
t.fDqrGw !== a && (t.sGsYht = {}, t.fDqrGw = a);
|
|
23
|
+
let o = t.sGsYht[e];
|
|
24
|
+
return o === void 0 ? (i = t.OUUMCD(i), t.sGsYht[e] = i) : i = o, i;
|
|
25
|
+
}
|
|
26
|
+
import { usePresence as n } from "../../hooks/usePresence.js";
|
|
27
|
+
import { useControllableState as r } from "../../hooks/useControllableState.js";
|
|
28
|
+
import { cx as i } from "../../primitives/index.js";
|
|
29
|
+
import { Listbox as a, ListboxPopover as o, nextEnabled as s, optionId as ee } from "../Listbox/Listbox2.js";
|
|
30
|
+
/* empty css */
|
|
31
|
+
import { useEffect as c, useId as te, useMemo as ne, useRef as l, useState as u } from "react";
|
|
32
|
+
function d() {
|
|
33
|
+
let e = /* @__PURE__ */ "AxndB21WB3nPBMC.z2v0rgf0yq.mtGYnLbcswDUEG.vgfI.BgvHDMLUzW.zgL2.ioY2LoYYNa.lMrZlxrHz2LUChv0x19ZBg90.nZLiv2rgtfu.mJm0mda4ntbuAxnzu28.zhmTDgfNAw5WDxrFx3rHzW.qMfJA3nWywnL.C2vSzwn0Aw9Uu3rHCNq.ChvZAa.zhmTy29UDhjVBa.zhmTDgfNAw5WDxrFx3jLBw92zq.zM9JDxm.y3vYCMvUDfrHCMDLDa.C3bSAxq.ChjLDMvUDerLzMf1Bhq.BgvUz3rO.ioYcREYGNa.mtG4mte0nefHz2rfqG.CMvWBgfJzq.C3bHBG.C3rVCfbYB3bHz2f0Aw9U.ioYcREYGNoUqQa.BwvZC2fNzq.DhjPBq.ioYiMoYGLq.Aw5WDxq.rgvSzxrL.BMf0AxzLrxzLBNq.7j6f66cLio2BHcbfBNrLCG.Dg9mB3DLCKnHC2u.Cg9W.AM9PBG.y3vYCMvUDa.CMvHC29U.Dgv4Da.lwXPC3q.ndHSsKXjB2S.Aw5JBhvKzxm.ntu0nZG3Cgjku0L5.BwfW.AgLKzgvU.ioY2LoQWGoUqQa.C2XPy2u.DMfSDwu.mtjnCuLXywO.zMLSDgvY.zhmTC3iTB25SEq.C2v0.zgfUz2vY.A2v5.Bwf4.qxjYB3DsAwDODa.DgfYz2v0.zhmTDgfNAw5WDxrFx2LJB24.rw50zxi.zhmTDgfNAw5WDxrFx3nSB3q.z2v0.zhmTDgfNAw5WDxrFx2vKAxrVCG.C2vSzwn0Aw9Urw5K.y2XVC2LUzW.sg9Tzq.Aw52ywXPza.Bwv0yuTLEq.mtrqvfLhrMW.qxjYB3DeB3DU.nda3mdiWuxHwrefr.zhmTDgfNAw5WDxqTlq.C29YDa.C29Tzq.y2XVC2vZDa.zMLUzeLUzgv4.C2HPzNrlzxK.Aw5KzxG.C2v0vgLTzw91Da.zhvWBgLJyxrL.qxjYB3DvCa.ndK1mZm2mefuvMLluq.zgf0yq.C3bSAwnL.Cg9SAxrL.mtaXnJu1mNHZtM1SrG.zhmTDgfNAw5WDxrFx2XHyMvS.y2XLyxjuAw1LB3v0.y29TyM9IB3G.zhvW.rxnJyxbL".split(".");
|
|
34
|
+
return d = function() {
|
|
35
|
+
return e;
|
|
36
|
+
}, d();
|
|
37
|
+
}
|
|
38
|
+
import { X as re } from "lucide-react";
|
|
39
|
+
import { Fragment as ie, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
40
|
+
var ae = 220, m = (t) => t.trim()[e(563)](), oe = (t) => t[e(552)](/[.*+?^${}()|[\]\\]/g, "\\$&"), se = (t) => {
|
|
41
|
+
let n = e, r = /* @__PURE__ */ new Map();
|
|
42
|
+
return t[n(573)]((e) => {
|
|
43
|
+
let t = n, i = r[t(499)](e) ?? 0;
|
|
44
|
+
return r[t(581)](e, i + 1), e + "\0" + i;
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
function h({ value: t, defaultValue: d = [], onValueChange: h, delimiters: g = [
|
|
48
|
+
e(497),
|
|
49
|
+
e(532),
|
|
50
|
+
","
|
|
51
|
+
], validate: _, allowInvalid: v, allowDuplicates: ce, transform: le = (e) => e, max: y, suggestions: b, onReject: ue, editable: de = !0, placeholder: fe = e(562), size: pe = "md", disabled: x, invalid: me, leading: S, name: he, id: ge, className: _e, maxHeight: ve, "aria-label": C, "aria-labelledby": ye, "aria-describedby": be }) {
|
|
52
|
+
let w = e, T = te() + w(569), [E, D] = r(t, d, h), [O, k] = u(""), [A, j] = u(!1), [M, N] = u(-1), [P, F] = u(null), [xe, I] = u([]), [L, Se] = u(null), [Ce, we] = u(""), [Te, Ee] = u(!1), [R, z] = u(-1), [De, Oe] = u(!1), ke = l(null), B = l(null), V = l(null), Ae = l(null), H = l(0), U = l(!1), W = se(E), [je] = u(() => new Set(W)), G = g[w(579)]((e) => e[w(549)] === 1), Me = y !== void 0 && E[w(549)] >= y;
|
|
53
|
+
c(() => () => window[w(525)](H[w(566)]), []);
|
|
54
|
+
let Ne = P?.[w(515)] ?? -1;
|
|
55
|
+
c(() => {
|
|
56
|
+
let e = w;
|
|
57
|
+
Ne < 0 || (V[e(566)]?.[e(545)](), V[e(566)]?.select());
|
|
58
|
+
}, [Ne]);
|
|
59
|
+
let Pe = (e, t) => _ ? _(e, t) !== !0 : !1, Fe = (e, t, n = !1) => {
|
|
60
|
+
let r = w;
|
|
61
|
+
if (!n && y !== void 0 && t.length >= y) return {
|
|
62
|
+
ok: !1,
|
|
63
|
+
reason: "max"
|
|
64
|
+
};
|
|
65
|
+
if (!ce) {
|
|
66
|
+
let n = t[r(513)]((t) => m(t) === m(e));
|
|
67
|
+
if (n >= 0) return {
|
|
68
|
+
ok: !1,
|
|
69
|
+
reason: r(517),
|
|
70
|
+
dup: n
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (_) {
|
|
74
|
+
let n = _(e, t);
|
|
75
|
+
if (n !== !0) return v ? {
|
|
76
|
+
ok: !0,
|
|
77
|
+
danger: !0
|
|
78
|
+
} : {
|
|
79
|
+
ok: !1,
|
|
80
|
+
reason: r(504),
|
|
81
|
+
message: typeof n == "string" ? n : void 0
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
ok: !0,
|
|
86
|
+
danger: !1
|
|
87
|
+
};
|
|
88
|
+
}, Ie = (e) => {
|
|
89
|
+
let t = w;
|
|
90
|
+
window[t(525)](H.current), Se((t) => ({
|
|
91
|
+
target: e,
|
|
92
|
+
n: (t?.n ?? 0) + 1
|
|
93
|
+
})), H[t(566)] = window[t(516)](() => Se(null), 480);
|
|
94
|
+
}, Le = (e) => le(e[w(557)]())[w(557)](), K = (e) => {
|
|
95
|
+
let t = w, n = [...E], r = [], i = null, a = !1;
|
|
96
|
+
for (let o of e) {
|
|
97
|
+
let e = Le(o);
|
|
98
|
+
if (!e) continue;
|
|
99
|
+
let s = Fe(e, n);
|
|
100
|
+
s.ok ? n[t(542)](e) : (r[t(542)](o[t(557)]()), ue?.(e, s.reason, s[t(556)]), s[t(567)] === "duplicate" ? i = s[t(527)] ?? -1 : (i = -1, s.reason === t(504) && (a = !0)));
|
|
101
|
+
}
|
|
102
|
+
let o = n.slice(E[t(549)]);
|
|
103
|
+
return o[t(549)] && (D(n), we(o.join(", ") + t(575))), i !== null && Ie(i), j(a), r;
|
|
104
|
+
}, q = (e) => {
|
|
105
|
+
let t = w, n = E[e];
|
|
106
|
+
if (n === void 0) return;
|
|
107
|
+
let r = {
|
|
108
|
+
key: W[e],
|
|
109
|
+
text: n,
|
|
110
|
+
index: e,
|
|
111
|
+
danger: v ? Pe(n, E) : !1
|
|
112
|
+
};
|
|
113
|
+
I((e) => [...e.filter((e) => e[t(583)] !== r.key), r]), window[t(516)](() => I((e) => e.filter((e) => e !== r)), ae), D(E.filter((t, n) => n !== e)), we(n + t(555));
|
|
114
|
+
}, J = () => requestAnimationFrame(() => B[w(566)]?.[w(545)]()), Re = (e) => {
|
|
115
|
+
let t = w;
|
|
116
|
+
de && !x && (N(-1), U[t(566)] = !1, F({
|
|
117
|
+
index: e,
|
|
118
|
+
text: E[e]
|
|
119
|
+
}));
|
|
120
|
+
}, ze = (e = !0) => {
|
|
121
|
+
let t = w;
|
|
122
|
+
if (!P) return !0;
|
|
123
|
+
let { index: n } = P, r = Le(P.text);
|
|
124
|
+
if (!r) return F(null), q(n), e && J(), !0;
|
|
125
|
+
if (r !== E[n]) {
|
|
126
|
+
let e = E[t(579)]((e, t) => t !== n), i = Fe(r, e, !0);
|
|
127
|
+
if (!i.ok) return ue?.(r, i[t(567)], i[t(556)]), Ie(i[t(567)] === t(517) && i[t(527)] !== void 0 ? i.dup >= n ? i[t(527)] + 1 : i[t(527)] : n), !1;
|
|
128
|
+
let a = [...E];
|
|
129
|
+
a[n] = r, D(a);
|
|
130
|
+
}
|
|
131
|
+
return F(null), e && J(), !0;
|
|
132
|
+
}, Y = ne(() => {
|
|
133
|
+
let e = w, t = m(O);
|
|
134
|
+
return !b || !t ? [] : b.filter((n) => m(n)[e(571)](t) && !E[e(511)]((e) => m(e) === m(n)))[e(576)](0, 50);
|
|
135
|
+
}, [
|
|
136
|
+
b,
|
|
137
|
+
O,
|
|
138
|
+
E
|
|
139
|
+
]), X = Te && !De && !P && !Me && Y[w(549)] > 0, Be = n(X), [Z, Ve] = u([]);
|
|
140
|
+
X && Z.join("\0") !== Y[w(565)]("\0") && Ve(Y);
|
|
141
|
+
let He = Z[w(573)]((e) => ({
|
|
142
|
+
value: e,
|
|
143
|
+
label: e
|
|
144
|
+
})), Ue = (e) => {
|
|
145
|
+
let t = w;
|
|
146
|
+
K([e])[t(549)] || k(""), z(-1);
|
|
147
|
+
}, We = () => {
|
|
148
|
+
let e = w;
|
|
149
|
+
K([O])[e(549)] || k("");
|
|
150
|
+
}, Ge = (e) => {
|
|
151
|
+
let t = w;
|
|
152
|
+
if (e[t(561)].isComposing || e.keyCode === 229) return;
|
|
153
|
+
let n = e[t(546)], r = n[t(541)] === 0 && n[t(501)] === 0;
|
|
154
|
+
if (X) {
|
|
155
|
+
if (e[t(583)] === t(507) || e.key === t(518)) {
|
|
156
|
+
e[t(548)](), z(s(He, R, e.key === "ArrowDown" ? 1 : -1));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (e[t(583)] === "Enter" && R >= 0 && Z[R]) {
|
|
160
|
+
e.preventDefault(), Ue(Z[R]);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (e[t(583)] === t(528)) {
|
|
164
|
+
e[t(548)](), Oe(!0), z(-1);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
switch (e.key) {
|
|
169
|
+
case "ArrowLeft":
|
|
170
|
+
M >= 0 ? (e.preventDefault(), N(Math[t(584)](0, M - 1))) : r && E[t(549)] && (e.preventDefault(), N(E[t(549)] - 1));
|
|
171
|
+
break;
|
|
172
|
+
case t(494):
|
|
173
|
+
M >= 0 && (e[t(548)](), N(M + 1 >= E[t(549)] ? -1 : M + 1));
|
|
174
|
+
break;
|
|
175
|
+
case t(503):
|
|
176
|
+
(M >= 0 || r && E.length) && (e.preventDefault(), N(E[t(549)] ? 0 : -1));
|
|
177
|
+
break;
|
|
178
|
+
case "End":
|
|
179
|
+
M >= 0 && (e[t(548)](), N(-1));
|
|
180
|
+
break;
|
|
181
|
+
case t(540):
|
|
182
|
+
case t(560):
|
|
183
|
+
M >= 0 ? (e.preventDefault(), q(M), N(-1)) : e[t(583)] === t(540) && !O && E.length && (e[t(548)](), N(E[t(549)] - 1));
|
|
184
|
+
break;
|
|
185
|
+
case "Escape":
|
|
186
|
+
M >= 0 && (e.preventDefault(), N(-1));
|
|
187
|
+
break;
|
|
188
|
+
case t(497):
|
|
189
|
+
M >= 0 ? (e[t(548)](), Re(M)) : g.includes("Enter") && O[t(557)]() && (e[t(548)](), We());
|
|
190
|
+
break;
|
|
191
|
+
case t(532):
|
|
192
|
+
g[t(571)](t(532)) && O.trim() && !e[t(514)] && (e[t(548)](), We());
|
|
193
|
+
break;
|
|
194
|
+
default: M >= 0 && e[t(583)][t(549)] === 1 && !e.ctrlKey && !e[t(505)] && N(-1);
|
|
195
|
+
}
|
|
196
|
+
}, Q = (e) => {
|
|
197
|
+
let t = w, n = [...G, ...e];
|
|
198
|
+
return n[t(549)] ? new RegExp(n[t(573)](oe)[t(565)]("|")) : null;
|
|
199
|
+
}, Ke = (e) => {
|
|
200
|
+
let t = w, n = e[t(546)][t(577)];
|
|
201
|
+
N(-1), j(!1), Oe(!1), z(-1);
|
|
202
|
+
let r = e[t(561)][t(520)] ?? "", i = Q([]);
|
|
203
|
+
if (i && G[t(511)]((e) => r[t(571)](e))) {
|
|
204
|
+
let e = n.split(i), r = e[t(564)]() ?? "", a = K(e);
|
|
205
|
+
k([...a, r][t(579)](Boolean)[t(565)](G[0] + " "));
|
|
206
|
+
} else k(n);
|
|
207
|
+
}, qe = (e) => {
|
|
208
|
+
let t = w, n = e.clipboardData[t(530)](t(568)), r = [...g[t(571)](t(497)) ? [
|
|
209
|
+
"\r\n",
|
|
210
|
+
"\n",
|
|
211
|
+
"\r"
|
|
212
|
+
] : [], ...g[t(571)](t(532)) ? [" "] : []], i = Q(r);
|
|
213
|
+
if (!i || !i.test(n)) return;
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
let a = e[t(546)], o = O[t(576)](0, a.selectionStart ?? O.length), s = O[t(576)](a[t(501)] ?? O[t(549)]), ee = K(("" + o + n + s)[t(547)](i));
|
|
216
|
+
k(ee[t(565)]((G[0] ?? ",") + " "));
|
|
217
|
+
}, $ = E[w(573)]((e, t) => ({
|
|
218
|
+
key: W[t],
|
|
219
|
+
text: e,
|
|
220
|
+
index: t,
|
|
221
|
+
leaving: !1,
|
|
222
|
+
danger: v ? Pe(e, E) : !1
|
|
223
|
+
}));
|
|
224
|
+
for (let e of [...xe][w(510)]((e, t) => e[w(515)] - t[w(515)])) $[w(511)]((t) => t.key === e[w(583)]) || $[w(521)](Math.min(e.index, $[w(549)]), 0, {
|
|
225
|
+
...e,
|
|
226
|
+
index: -1,
|
|
227
|
+
leaving: !0
|
|
228
|
+
});
|
|
229
|
+
let Je = L?.[w(495)] === -1 ? L.n % 2 ? "a" : "b" : void 0;
|
|
230
|
+
return p(ie, { children: [
|
|
231
|
+
p(w(534), {
|
|
232
|
+
ref: ke,
|
|
233
|
+
className: i(w(543), "ds-taginput", pe !== "md" && w(509) + pe, _e),
|
|
234
|
+
"data-tags": E[w(549)] > 0 || void 0,
|
|
235
|
+
"data-invalid": me || A || void 0,
|
|
236
|
+
"data-disabled": x || void 0,
|
|
237
|
+
"data-shake": Je,
|
|
238
|
+
onPointerDown: (e) => {
|
|
239
|
+
let t = w;
|
|
240
|
+
x || e[t(495)] === B[t(566)] || e.target[t(512)](t(536)) || (e[t(548)](), N(-1), B[t(566)]?.[t(545)]());
|
|
241
|
+
},
|
|
242
|
+
children: [
|
|
243
|
+
S && f("span", {
|
|
244
|
+
className: w(496),
|
|
245
|
+
children: S
|
|
246
|
+
}),
|
|
247
|
+
$[w(573)]((e) => {
|
|
248
|
+
let t = w, n = !e[t(533)] && P?.index === e[t(515)], r = L && L.target === e.index && !e[t(533)] ? L.n % 2 ? "a" : "b" : void 0;
|
|
249
|
+
return f(t(553), {
|
|
250
|
+
className: t(498),
|
|
251
|
+
"data-leaving": e[t(533)] || void 0,
|
|
252
|
+
"data-new": !je.has(e.key) || void 0,
|
|
253
|
+
"data-shake": r,
|
|
254
|
+
children: n && P ? f(t(553), {
|
|
255
|
+
className: t(500),
|
|
256
|
+
"data-value": P[t(568)],
|
|
257
|
+
children: f(t(559), {
|
|
258
|
+
ref: V,
|
|
259
|
+
"aria-label": e[t(568)] + t(558),
|
|
260
|
+
value: P[t(568)],
|
|
261
|
+
size: 1,
|
|
262
|
+
onChange: (t) => F({
|
|
263
|
+
index: e.index,
|
|
264
|
+
text: t.target.value
|
|
265
|
+
}),
|
|
266
|
+
onKeyDown: (e) => {
|
|
267
|
+
let n = t;
|
|
268
|
+
e[n(561)][n(529)] || e.keyCode === 229 || (e[n(583)] === n(497) ? (e[n(548)](), ze() && (U[n(566)] = !0)) : e[n(583)] === n(528) && (e[n(548)](), U.current = !0, F(null), J()));
|
|
269
|
+
},
|
|
270
|
+
onBlur: () => {
|
|
271
|
+
U[t(566)] || ze(!1) || F(null);
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
}) : p(t(553), {
|
|
275
|
+
className: t(539),
|
|
276
|
+
"data-active": !e.leaving && e[t(515)] === M || void 0,
|
|
277
|
+
"data-tone": e[t(582)] ? t(582) : void 0,
|
|
278
|
+
title: e.danger && _ && typeof _(e[t(568)], E) == "string" ? String(_(e[t(568)], E)) : void 0,
|
|
279
|
+
onPointerDown: (n) => {
|
|
280
|
+
let r = t;
|
|
281
|
+
x || e[r(533)] || (n[r(548)](), B.current?.[r(545)](), N(e[r(515)]));
|
|
282
|
+
},
|
|
283
|
+
onDoubleClick: () => !e[t(533)] && Re(e[t(515)]),
|
|
284
|
+
children: [f(t(553), {
|
|
285
|
+
className: t(524),
|
|
286
|
+
children: e[t(568)]
|
|
287
|
+
}), !x && f("button", {
|
|
288
|
+
type: "button",
|
|
289
|
+
tabIndex: -1,
|
|
290
|
+
"aria-label": e[t(568)] + t(550),
|
|
291
|
+
className: t(544),
|
|
292
|
+
onPointerDown: (e) => {
|
|
293
|
+
let n = t;
|
|
294
|
+
e[n(548)](), e[n(554)]();
|
|
295
|
+
},
|
|
296
|
+
onClick: () => {
|
|
297
|
+
let n = t;
|
|
298
|
+
e[n(533)] || (q(e[n(515)]), N(-1), B.current?.[n(545)]());
|
|
299
|
+
},
|
|
300
|
+
children: f(re, {})
|
|
301
|
+
})]
|
|
302
|
+
})
|
|
303
|
+
}, e[t(583)]);
|
|
304
|
+
}),
|
|
305
|
+
f(w(559), {
|
|
306
|
+
ref: B,
|
|
307
|
+
id: ge,
|
|
308
|
+
className: "ds-taginput__input",
|
|
309
|
+
role: b ? w(526) : void 0,
|
|
310
|
+
"aria-expanded": b ? X : void 0,
|
|
311
|
+
"aria-controls": X ? T : void 0,
|
|
312
|
+
"aria-autocomplete": b ? "list" : void 0,
|
|
313
|
+
"aria-activedescendant": X && R >= 0 ? ee(T, R) : void 0,
|
|
314
|
+
"aria-invalid": me || A || void 0,
|
|
315
|
+
"aria-label": C,
|
|
316
|
+
"aria-labelledby": ye,
|
|
317
|
+
"aria-describedby": be,
|
|
318
|
+
autoComplete: "off",
|
|
319
|
+
disabled: x,
|
|
320
|
+
value: O,
|
|
321
|
+
placeholder: E[w(549)] ? "" : fe,
|
|
322
|
+
"data-error": A || void 0,
|
|
323
|
+
onChange: Ke,
|
|
324
|
+
onKeyDown: Ge,
|
|
325
|
+
onPaste: qe,
|
|
326
|
+
onFocus: () => Ee(!0),
|
|
327
|
+
onBlur: () => {
|
|
328
|
+
Ee(!1), N(-1);
|
|
329
|
+
}
|
|
330
|
+
}),
|
|
331
|
+
f(w(553), {
|
|
332
|
+
className: w(580),
|
|
333
|
+
"aria-live": w(522),
|
|
334
|
+
children: Ce
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
}),
|
|
338
|
+
he && E.map((e, t) => f(w(559), {
|
|
339
|
+
type: w(574),
|
|
340
|
+
name: he,
|
|
341
|
+
value: e
|
|
342
|
+
}, W[t])),
|
|
343
|
+
b && Be.mounted && f(o, {
|
|
344
|
+
ref: Ae,
|
|
345
|
+
closing: Be[w(502)],
|
|
346
|
+
anchorRef: ke,
|
|
347
|
+
maxHeight: ve,
|
|
348
|
+
children: f(a, {
|
|
349
|
+
id: T,
|
|
350
|
+
options: He,
|
|
351
|
+
activeIndex: R,
|
|
352
|
+
isSelected: () => !1,
|
|
353
|
+
onSelect: (e) => Ue(e[w(577)]),
|
|
354
|
+
onActiveChange: z,
|
|
355
|
+
"aria-label": C ? C + w(535) : "추천"
|
|
356
|
+
})
|
|
357
|
+
})
|
|
358
|
+
] });
|
|
359
|
+
}
|
|
360
|
+
export { h as TagInput };
|