@iamfiro/design 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +66 -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 +90 -0
- package/lib/components/Calendar/Calendar2.js +309 -0
- package/lib/components/Calendar/DatePicker2.js +228 -0
- package/lib/components/Calendar/date.js +118 -0
- package/lib/components/Card/Card2.js +103 -0
- package/lib/components/CardFrame/CardFrame2.js +67 -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 +48 -0
- package/lib/components/ChatComposer/ChatComposer2.js +153 -0
- package/lib/components/CodeBlock/CodeBlock2.js +93 -0
- package/lib/components/CodeBlock/highlight.js +111 -0
- package/lib/components/ColorPicker/ColorPicker2.js +609 -0
- package/lib/components/ColorPicker/color.js +180 -0
- package/lib/components/ColorPicker/presets.js +70 -0
- package/lib/components/Combobox/Combobox2.js +228 -0
- package/lib/components/CommandMenu/CommandMenu.js +267 -0
- package/lib/components/Comment/Comment2.js +110 -0
- package/lib/components/ContextMenu/ContextMenu2.js +168 -0
- package/lib/components/DataGrid/DataGrid2.js +1998 -0
- package/lib/components/DataGrid/GridPopover.js +154 -0
- package/lib/components/DataGrid/anchor.js +50 -0
- package/lib/components/DataGrid/model.js +557 -0
- package/lib/components/DataGrid/panels.js +701 -0
- package/lib/components/DataGrid/typeMeta.js +75 -0
- package/lib/components/DataGrid/types.js +53 -0
- package/lib/components/DescriptionList/DescriptionList2.js +180 -0
- package/lib/components/Dialog/AlertDialog.js +119 -0
- package/lib/components/Dialog/Dialog2.js +110 -0
- package/lib/components/Dialog/modal.js +92 -0
- package/lib/components/Drawer/Drawer2.js +244 -0
- package/lib/components/DropdownMenu/DropdownMenu2.js +393 -0
- package/lib/components/DropdownMenu/menuCore.js +63 -0
- package/lib/components/Dropzone/Dropzone2.js +145 -0
- package/lib/components/EmptyState/EmptyState2.js +70 -0
- package/lib/components/FileChip/FileChip2.js +94 -0
- package/lib/components/FileUpload/FileUpload.js +259 -0
- package/lib/components/FilterChips/FilterChips2.js +101 -0
- package/lib/components/FunnelChart/FunnelChart2.js +283 -0
- package/lib/components/FunnelChart/funnel.js +72 -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 +110 -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 +132 -0
- package/lib/components/Listbox/Listbox2.js +163 -0
- package/lib/components/Marker/Marker2.js +82 -0
- package/lib/components/Menubar/Menubar2.js +222 -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 +128 -0
- package/lib/components/OtpInput/OtpInput2.js +122 -0
- package/lib/components/Pagination/Pagination2.js +210 -0
- package/lib/components/Pagination/paginationRange.js +52 -0
- package/lib/components/PhoneInput/PhoneInput.js +175 -0
- package/lib/components/PieChart/PieChart2.js +246 -0
- package/lib/components/PieChart/arc.js +90 -0
- package/lib/components/PieChart/useArcTween.js +92 -0
- package/lib/components/Popover/Popover2.js +111 -0
- package/lib/components/ProgressTracker/ProgressTracker2.js +226 -0
- package/lib/components/Rating/Rating2.js +186 -0
- package/lib/components/Resizable/Resizable2.js +238 -0
- package/lib/components/Resizable/layout.js +115 -0
- package/lib/components/ScaledPreview/ScaledPreview2.js +99 -0
- package/lib/components/ScatterChart/ScatterChart2.js +355 -0
- package/lib/components/ScatterChart/scatter.js +85 -0
- package/lib/components/ScrollArea/ScrollArea2.js +217 -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 +84 -0
- package/lib/components/SparkChart/SparkChart2.js +217 -0
- package/lib/components/SparkChart/spark.js +71 -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 +357 -0
- package/lib/components/TimePicker/TimePicker2.js +388 -0
- package/lib/components/TimePicker/time.js +81 -0
- package/lib/components/Timeline/Timeline2.js +369 -0
- package/lib/components/Timeline/scale.js +81 -0
- package/lib/components/Toast/Toaster.js +213 -0
- package/lib/components/Toast/store.js +128 -0
- package/lib/components/ToggleGroup/ToggleGroup2.js +125 -0
- package/lib/components/Toolbar/Toolbar2.js +283 -0
- package/lib/components/Tracker/Tracker2.js +172 -0
- package/lib/components/TreeDiagram/TreeDiagram2.js +223 -0
- package/lib/components/TreeView/TreeView2.js +286 -0
- package/lib/hooks/timing.js +57 -0
- package/lib/hooks/useControllableState.js +49 -0
- package/lib/hooks/useCountdown.js +75 -0
- package/lib/hooks/useDigitInput.js +103 -0
- package/lib/hooks/useDismiss.js +69 -0
- package/lib/hooks/useElapsed.js +85 -0
- package/lib/hooks/useFloating.js +70 -0
- package/lib/hooks/useFocusTrap.js +85 -0
- package/lib/hooks/usePresence.js +58 -0
- package/lib/hooks/usePressToOpen.js +70 -0
- package/lib/hooks/useScrollLock.js +71 -0
- package/lib/hooks/useSelection.js +65 -0
- package/lib/index.js +176 -17911
- package/lib/primitives/AspectRatio2.js +76 -0
- package/lib/primitives/BrandIcon.js +245 -0
- package/lib/primitives/ColorDot2.js +71 -0
- package/lib/primitives/CopyButton2.js +86 -0
- package/lib/primitives/CountBadge2.js +80 -0
- package/lib/primitives/Countdown2.js +61 -0
- package/lib/primitives/Delta2.js +92 -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 +69 -0
- package/lib/primitives/Kbd2.js +88 -0
- package/lib/primitives/Layout2.js +118 -0
- package/lib/primitives/Link2.js +55 -0
- package/lib/primitives/MaskedText2.js +121 -0
- package/lib/primitives/Progress2.js +137 -0
- package/lib/primitives/RelativeTime.js +82 -0
- package/lib/primitives/SearchInput2.js +85 -0
- package/lib/primitives/SelectorButton2.js +96 -0
- package/lib/primitives/Spinner2.js +94 -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 +54 -0
- package/lib/primitives/formatElapsed.js +63 -0
- package/lib/primitives/formatRelativeTime.js +64 -0
- package/lib/primitives/hotkey.js +94 -0
- package/lib/primitives/index.js +351 -0
- package/lib/primitives/maskValue.js +69 -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,357 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e = r;
|
|
3
|
+
(function(e, t) {
|
|
4
|
+
let n = r, i = e();
|
|
5
|
+
for (;;) try {
|
|
6
|
+
if (parseInt(n(471)) / 1 * (-parseInt(n(493)) / 2) + -parseInt(n(486)) / 3 + -parseInt(n(420)) / 4 * (-parseInt(n(455)) / 5) + parseInt(n(469)) / 6 * (-parseInt(n(426)) / 7) + -parseInt(n(461)) / 8 + -parseInt(n(423)) / 9 * (parseInt(n(417)) / 10) + parseInt(n(477)) / 11 == t) break;
|
|
7
|
+
i.push(i.shift());
|
|
8
|
+
} catch {
|
|
9
|
+
i.push(i.shift());
|
|
10
|
+
}
|
|
11
|
+
})(h, 700971);
|
|
12
|
+
import { usePresence as t } from "../../hooks/usePresence.js";
|
|
13
|
+
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
14
|
+
function r(e, t) {
|
|
15
|
+
e -= 409;
|
|
16
|
+
let n = h(), i = n[e];
|
|
17
|
+
r.aSwKMj === void 0 && (r.UobRwK = function(e) {
|
|
18
|
+
let t = "", n = "";
|
|
19
|
+
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);
|
|
20
|
+
for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
|
|
21
|
+
return decodeURIComponent(n);
|
|
22
|
+
}, r.Njmdrq = {}, r.aSwKMj = !0);
|
|
23
|
+
let a = n[0];
|
|
24
|
+
r.OkyHDZ !== a && (r.Njmdrq = {}, r.OkyHDZ = a);
|
|
25
|
+
let o = r.Njmdrq[e];
|
|
26
|
+
return o === void 0 ? (i = r.UobRwK(i), r.Njmdrq[e] = i) : i = o, i;
|
|
27
|
+
}
|
|
28
|
+
import { cx as i } from "../../primitives/index.js";
|
|
29
|
+
import { Listbox as a, ListboxPopover as o, nextEnabled as s, optionId as c } from "../Listbox/Listbox2.js";
|
|
30
|
+
/* empty css */
|
|
31
|
+
import { useEffect as l, useId as ee, useMemo as te, useRef as u, useState as d } from "react";
|
|
32
|
+
import { X as ne } from "lucide-react";
|
|
33
|
+
import { Fragment as re, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
34
|
+
var ie = 220, m = (t) => t[e(494)]().toLowerCase(), ae = (t) => t[e(499)](/[.*+?^${}()|[\]\\]/g, e(427)), oe = (t) => {
|
|
35
|
+
let n = e, r = /* @__PURE__ */ new Map();
|
|
36
|
+
return t[n(492)]((e) => {
|
|
37
|
+
let t = n, i = r[t(421)](e) ?? 0;
|
|
38
|
+
return r[t(419)](e, i + 1), e + "\0" + i;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
function h() {
|
|
42
|
+
let e = /* @__PURE__ */ "mJGYmtm2nJLRAKDswLi.qxjYB3DeB3DU.zhvWBgLJyxrL.BwvZC2fNzq.Bwv0yuTLEq.Aw52ywXPza.C3rYAw5N.zM9JDxm.DgvZDa.mta5nde2m2rysKvkBq.zMLUzeLUzgv4.C29Tzq.y2XPCgjVyxjKrgf0yq.y3vYCMvUDfrHCMDLDa.AM9PBG.BwfW.mKjwtKTwCq.DhjPBq.Aw5WDxq.Bwf4.Aw5JBhvKzxm.vgfI.CMvWBgfJzq.zhmTDgfNAw5WDxrFx2vKAxrVCG.AgfZ.zhmTDgfNAw5WDxrFx3nSB3q.C3bSAwnL.ioY2LoQWGoUqQa.y3vYCMvUDa.CMvHC29U.zhvW.zgL2.rxnJyxbL.ioYcREYGNoUqQa.DMfSDwu.Dgv4Da.rw5K.nJbUwenSENu.qxjYB3DsAwDODa.C2v0.nev3tLnowq.z2v0.sg9Tzq.mtiXodmWm2HQC0nUAG.zhmTDgfNAw5WDxrFx2LJB24.BwLU.mZCYndD4EwrxyNm.xcqM.DgfYz2v0.C3bHBG.zgfUz2vY.zhmTy29UDhjVBa.zhmTDgfNAw5WDxq.A2v5q29Kzq.BgvHDMLUzW.y3rYBeTLEq.zhmTDgfNAw5WDxrFx2LUChv0.BMf0AxzLrxzLBNq.C2v0vgLTzw91Da.AxndB21WB3nPBMC.qxjYB3DvCa.zhmTC3iTB25SEq.zgf0yq.qxjYB3Dmzwz0.z2v0rgf0yq.C2vSzwn0Aw9Uu3rHCNq.rgvSzxrL.zMLSDgvY.qMfJA3nWywnL.ioY2LoYYNa.Cg9W.zhmTDgfNAw5WDxqTlq.ChjLDMvUDerLzMf1Bhq.C2HPzNrlzxK.Aw5KzxG.otu4nJK1u2Tht2nz.BgvUz3rO.ioYiMoYGLq.C2vSzwn0.y2XLyxjuAw1LB3v0.ChvZAa.ntq4mZiWqK1yDe9r.zhmTDgfNAw5WDxrFx3rHzW.lMrZlxrHz2LUChv0x19ZBg90.yNv0Dg9U.A2v5.C2vSzwn0Aw9Urw5K.7j6f66cLio2BHcbfBNrLCG.rw50zxi.odm0AgHethPL.AgLKzgvU.nZa1nJvmtg95AhG.C3bSAxq.Bw91BNrLza.y29TyM9IB3G.y2XVC2LUzW.C2XPy2u".split(".");
|
|
43
|
+
return h = function() {
|
|
44
|
+
return e;
|
|
45
|
+
}, h();
|
|
46
|
+
}
|
|
47
|
+
function g({ value: r, defaultValue: h = [], onValueChange: g, delimiters: _ = [
|
|
48
|
+
e(468),
|
|
49
|
+
e(498),
|
|
50
|
+
","
|
|
51
|
+
], validate: v, allowInvalid: y, allowDuplicates: se, transform: ce = (e) => e, max: b, suggestions: x, onReject: le, editable: ue = !0, placeholder: de = e(467), size: fe = "md", disabled: S, invalid: pe, leading: me, name: C, id: he, className: ge, maxHeight: _e, "aria-label": w, "aria-labelledby": ve, "aria-describedby": ye }) {
|
|
52
|
+
let T = e, E = ee() + "-list", [D, O] = n(r, h, g), [k, A] = d(""), [j, M] = d(!1), [N, P] = d(-1), [F, I] = d(null), [be, L] = d([]), [R, xe] = d(null), [Se, Ce] = d(""), [we, Te] = d(!1), [z, B] = d(-1), [Ee, De] = d(!1), Oe = u(null), V = u(null), H = u(null), ke = u(null), U = u(0), W = u(!1), G = oe(D), [Ae] = d(() => new Set(G)), K = _[T(447)]((e) => e[T(456)] === 1), je = b !== void 0 && D.length >= b;
|
|
53
|
+
l(() => () => window[T(459)](U[T(505)]), []);
|
|
54
|
+
let Me = F?.[T(454)] ?? -1;
|
|
55
|
+
l(() => {
|
|
56
|
+
let e = T;
|
|
57
|
+
Me < 0 || (H[e(505)]?.focus(), H[e(505)]?.[e(458)]());
|
|
58
|
+
}, [Me]);
|
|
59
|
+
let Ne = (e, t) => v ? v(e, t) !== !0 : !1, Pe = (e, t, n = !1) => {
|
|
60
|
+
let r = T;
|
|
61
|
+
if (!n && b !== void 0 && t[r(456)] >= b) return {
|
|
62
|
+
ok: !1,
|
|
63
|
+
reason: "max"
|
|
64
|
+
};
|
|
65
|
+
if (!se) {
|
|
66
|
+
let n = t[r(487)]((t) => m(t) === m(e));
|
|
67
|
+
if (n >= 0) return {
|
|
68
|
+
ok: !1,
|
|
69
|
+
reason: "duplicate",
|
|
70
|
+
dup: n
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (v) {
|
|
74
|
+
let n = v(e, t);
|
|
75
|
+
if (n !== !0) return y ? {
|
|
76
|
+
ok: !0,
|
|
77
|
+
danger: !0
|
|
78
|
+
} : {
|
|
79
|
+
ok: !1,
|
|
80
|
+
reason: r(482),
|
|
81
|
+
message: typeof n === r(483) ? n : void 0
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
ok: !0,
|
|
86
|
+
danger: !1
|
|
87
|
+
};
|
|
88
|
+
}, Fe = (e) => {
|
|
89
|
+
let t = T;
|
|
90
|
+
window[t(459)](U.current), xe((t) => ({
|
|
91
|
+
target: e,
|
|
92
|
+
n: (t?.n ?? 0) + 1
|
|
93
|
+
})), U[t(505)] = window[t(438)](() => xe(null), 480);
|
|
94
|
+
}, Ie = (e) => ce(e[T(494)]())[T(494)](), q = (e) => {
|
|
95
|
+
let t = T, n = [...D], r = [], i = null, a = !1;
|
|
96
|
+
for (let o of e) {
|
|
97
|
+
let e = Ie(o);
|
|
98
|
+
if (!e) continue;
|
|
99
|
+
let s = Pe(e, n);
|
|
100
|
+
s.ok ? n[t(460)](e) : (r[t(460)](o[t(494)]()), le?.(e, s[t(409)], s[t(480)]), s[t(409)] === t(479) ? i = s.dup ?? -1 : (i = -1, s[t(409)] === "invalid" && (a = !0)));
|
|
101
|
+
}
|
|
102
|
+
let o = n.slice(D.length);
|
|
103
|
+
return o[t(456)] && (O(n), Ce(o[t(491)](", ") + t(504))), i !== null && Fe(i), M(a), r;
|
|
104
|
+
}, J = (e) => {
|
|
105
|
+
let t = T, n = D[e];
|
|
106
|
+
if (n === void 0) return;
|
|
107
|
+
let r = {
|
|
108
|
+
key: G[e],
|
|
109
|
+
text: n,
|
|
110
|
+
index: e,
|
|
111
|
+
danger: y ? Ne(n, D) : !1
|
|
112
|
+
};
|
|
113
|
+
L((e) => [...e[t(447)]((e) => e[t(465)] !== r[t(465)]), r]), window[t(438)](() => L((e) => e[t(447)]((e) => e !== r)), ie), O(D[t(447)]((t, n) => n !== e)), Ce(n + t(413));
|
|
114
|
+
}, Y = () => requestAnimationFrame(() => V[T(505)]?.[T(484)]()), Le = (e) => {
|
|
115
|
+
ue && !S && (P(-1), W.current = !1, I({
|
|
116
|
+
index: e,
|
|
117
|
+
text: D[e]
|
|
118
|
+
}));
|
|
119
|
+
}, Re = (e = !0) => {
|
|
120
|
+
let t = T;
|
|
121
|
+
if (!F) return !0;
|
|
122
|
+
let { index: n } = F, r = Ie(F[t(415)]);
|
|
123
|
+
if (!r) return I(null), J(n), e && Y(), !0;
|
|
124
|
+
if (r !== D[n]) {
|
|
125
|
+
let e = D[t(447)]((e, t) => t !== n), i = Pe(r, e, !0);
|
|
126
|
+
if (!i.ok) return le?.(r, i.reason, i[t(480)]), Fe(i[t(409)] === t(479) && i[t(410)] !== void 0 ? i[t(410)] >= n ? i[t(410)] + 1 : i[t(410)] : n), !1;
|
|
127
|
+
let a = [...D];
|
|
128
|
+
a[n] = r, O(a);
|
|
129
|
+
}
|
|
130
|
+
return I(null), e && Y(), !0;
|
|
131
|
+
}, X = te(() => {
|
|
132
|
+
let e = T, t = m(k);
|
|
133
|
+
return !x || !t ? [] : x[e(447)]((n) => m(n).includes(t) && !D[e(488)]((e) => m(e) === m(n))).slice(0, 50);
|
|
134
|
+
}, [
|
|
135
|
+
x,
|
|
136
|
+
k,
|
|
137
|
+
D
|
|
138
|
+
]), Z = we && !Ee && !F && !je && X[T(456)] > 0, ze = t(Z), [Q, Be] = d([]);
|
|
139
|
+
Z && Q[T(491)]("\0") !== X.join("\0") && Be(X);
|
|
140
|
+
let Ve = Q.map((e) => ({
|
|
141
|
+
value: e,
|
|
142
|
+
label: e
|
|
143
|
+
})), He = (e) => {
|
|
144
|
+
let t = T;
|
|
145
|
+
q([e])[t(456)] || A(""), B(-1);
|
|
146
|
+
}, Ue = () => {
|
|
147
|
+
q([k]).length || A("");
|
|
148
|
+
}, We = (e) => {
|
|
149
|
+
let t = T;
|
|
150
|
+
if (e[t(437)][t(439)] || e[t(433)] === 229) return;
|
|
151
|
+
let n = e[t(490)], r = n[t(445)] === 0 && n[t(466)] === 0;
|
|
152
|
+
if (Z) {
|
|
153
|
+
if (e[t(465)] === t(478) || e[t(465)] === t(440)) {
|
|
154
|
+
e[t(452)](), B(s(Ve, z, e[t(465)] === t(478) ? 1 : -1));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (e[t(465)] === t(468) && z >= 0 && Q[z]) {
|
|
158
|
+
e.preventDefault(), He(Q[z]);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (e.key === t(412)) {
|
|
162
|
+
e.preventDefault(), De(!0), B(-1);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
switch (e[t(465)]) {
|
|
167
|
+
case t(443):
|
|
168
|
+
N >= 0 ? (e[t(452)](), P(Math[t(496)](0, N - 1))) : r && D.length && (e.preventDefault(), P(D[t(456)] - 1));
|
|
169
|
+
break;
|
|
170
|
+
case t(418):
|
|
171
|
+
N >= 0 && (e[t(452)](), P(N + 1 >= D[t(456)] ? -1 : N + 1));
|
|
172
|
+
break;
|
|
173
|
+
case t(422):
|
|
174
|
+
(N >= 0 || r && D.length) && (e[t(452)](), P(D[t(456)] ? 0 : -1));
|
|
175
|
+
break;
|
|
176
|
+
case t(416):
|
|
177
|
+
N >= 0 && (e[t(452)](), P(-1));
|
|
178
|
+
break;
|
|
179
|
+
case t(448):
|
|
180
|
+
case t(446):
|
|
181
|
+
N >= 0 ? (e[t(452)](), J(N), P(-1)) : e[t(465)] === t(448) && !k && D[t(456)] && (e[t(452)](), P(D[t(456)] - 1));
|
|
182
|
+
break;
|
|
183
|
+
case "Escape":
|
|
184
|
+
N >= 0 && (e[t(452)](), P(-1));
|
|
185
|
+
break;
|
|
186
|
+
case t(468):
|
|
187
|
+
N >= 0 ? (e[t(452)](), Le(N)) : _[t(497)](t(468)) && k[t(494)]() && (e[t(452)](), Ue());
|
|
188
|
+
break;
|
|
189
|
+
case t(498):
|
|
190
|
+
_.includes("Tab") && k[t(494)]() && !e[t(453)] && (e[t(452)](), Ue());
|
|
191
|
+
break;
|
|
192
|
+
default: N >= 0 && e[t(465)].length === 1 && !e[t(435)] && !e[t(481)] && P(-1);
|
|
193
|
+
}
|
|
194
|
+
}, Ge = (e) => {
|
|
195
|
+
let t = T, n = [...K, ...e];
|
|
196
|
+
return n.length ? new RegExp(n.map(ae)[t(491)]("|")) : null;
|
|
197
|
+
}, Ke = (e) => {
|
|
198
|
+
let t = T, n = e[t(490)].value;
|
|
199
|
+
P(-1), M(!1), De(!1), B(-1);
|
|
200
|
+
let r = e[t(437)][t(442)] ?? "", i = Ge([]);
|
|
201
|
+
if (i && K[t(488)]((e) => r[t(497)](e))) {
|
|
202
|
+
let e = n.split(i), r = e[t(450)]() ?? "", a = q(e);
|
|
203
|
+
A([...a, r][t(447)](Boolean)[t(491)](K[0] + " "));
|
|
204
|
+
} else A(n);
|
|
205
|
+
}, qe = (e) => {
|
|
206
|
+
let t = T, n = e[t(489)][t(444)](t(415)), r = [..._.includes(t(468)) ? [
|
|
207
|
+
"\r\n",
|
|
208
|
+
"\n",
|
|
209
|
+
"\r"
|
|
210
|
+
] : [], ..._.includes("Tab") ? [" "] : []], i = Ge(r);
|
|
211
|
+
if (!i || !i[t(485)](n)) return;
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
let a = e.currentTarget, o = k[t(476)](0, a[t(445)] ?? k.length), s = k[t(476)](a.selectionEnd ?? k[t(456)]), c = q(("" + o + n + s)[t(472)](i));
|
|
214
|
+
A(c.join((K[0] ?? ",") + " "));
|
|
215
|
+
}, $ = D[T(492)]((e, t) => ({
|
|
216
|
+
key: G[t],
|
|
217
|
+
text: e,
|
|
218
|
+
index: t,
|
|
219
|
+
leaving: !1,
|
|
220
|
+
danger: y ? Ne(e, D) : !1
|
|
221
|
+
}));
|
|
222
|
+
for (let e of [...be].sort((e, t) => e[T(454)] - t.index)) $.some((t) => t[T(465)] === e[T(465)]) || $[T(503)](Math[T(425)](e.index, $.length), 0, {
|
|
223
|
+
...e,
|
|
224
|
+
index: -1,
|
|
225
|
+
leaving: !0
|
|
226
|
+
});
|
|
227
|
+
let Je = R?.[T(428)] === -1 ? R.n % 2 ? "a" : "b" : void 0;
|
|
228
|
+
return p(re, { children: [
|
|
229
|
+
p(T(411), {
|
|
230
|
+
ref: Oe,
|
|
231
|
+
className: i(T(431), T(432), fe !== "md" && T(451) + fe, ge),
|
|
232
|
+
"data-tags": D[T(456)] > 0 || void 0,
|
|
233
|
+
"data-invalid": pe || j || void 0,
|
|
234
|
+
"data-disabled": S || void 0,
|
|
235
|
+
"data-shake": Je,
|
|
236
|
+
onPointerDown: (e) => {
|
|
237
|
+
let t = T;
|
|
238
|
+
S || e[t(428)] === V.current || e[t(428)].closest(t(463)) || (e[t(452)](), P(-1), V[t(505)]?.[t(484)]());
|
|
239
|
+
},
|
|
240
|
+
children: [
|
|
241
|
+
me && f(T(429), {
|
|
242
|
+
className: T(424),
|
|
243
|
+
children: me
|
|
244
|
+
}),
|
|
245
|
+
$[T(492)]((e) => {
|
|
246
|
+
let t = T, n = !e[t(434)] && F?.index === e.index, r = R && R[t(428)] === e[t(454)] && !e[t(434)] ? R.n % 2 ? "a" : "b" : void 0;
|
|
247
|
+
return f(t(429), {
|
|
248
|
+
className: t(502),
|
|
249
|
+
"data-leaving": e.leaving || void 0,
|
|
250
|
+
"data-new": !Ae[t(501)](e[t(465)]) || void 0,
|
|
251
|
+
"data-shake": r,
|
|
252
|
+
children: n && F ? f(t(429), {
|
|
253
|
+
className: t(500),
|
|
254
|
+
"data-value": F[t(415)],
|
|
255
|
+
children: f(t(495), {
|
|
256
|
+
ref: H,
|
|
257
|
+
"aria-label": e[t(415)] + t(457),
|
|
258
|
+
value: F.text,
|
|
259
|
+
size: 1,
|
|
260
|
+
onChange: (n) => I({
|
|
261
|
+
index: e.index,
|
|
262
|
+
text: n[t(428)][t(414)]
|
|
263
|
+
}),
|
|
264
|
+
onKeyDown: (e) => {
|
|
265
|
+
let n = t;
|
|
266
|
+
e[n(437)][n(439)] || e.keyCode === 229 || (e[n(465)] === "Enter" ? (e[n(452)](), Re() && (W.current = !0)) : e[n(465)] === "Escape" && (e.preventDefault(), W[n(505)] = !0, I(null), Y()));
|
|
267
|
+
},
|
|
268
|
+
onBlur: () => {
|
|
269
|
+
W[t(505)] || Re(!1) || I(null);
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
}) : p(t(429), {
|
|
273
|
+
className: t(462),
|
|
274
|
+
"data-active": !e[t(434)] && e[t(454)] === N || void 0,
|
|
275
|
+
"data-tone": e[t(430)] ? "danger" : void 0,
|
|
276
|
+
title: e[t(430)] && v && typeof v(e.text, D) === t(483) ? String(v(e[t(415)], D)) : void 0,
|
|
277
|
+
onPointerDown: (n) => {
|
|
278
|
+
let r = t;
|
|
279
|
+
S || e[r(434)] || (n[r(452)](), V[r(505)]?.[r(484)](), P(e[r(454)]));
|
|
280
|
+
},
|
|
281
|
+
onDoubleClick: () => !e.leaving && Le(e[t(454)]),
|
|
282
|
+
children: [f(t(429), {
|
|
283
|
+
className: "ds-taginput__label",
|
|
284
|
+
children: e.text
|
|
285
|
+
}), !S && f(t(464), {
|
|
286
|
+
type: t(464),
|
|
287
|
+
tabIndex: -1,
|
|
288
|
+
"aria-label": e[t(415)] + " 삭제",
|
|
289
|
+
className: "ds-taginput__remove",
|
|
290
|
+
onPointerDown: (e) => {
|
|
291
|
+
e[t(452)](), e.stopPropagation();
|
|
292
|
+
},
|
|
293
|
+
onClick: () => {
|
|
294
|
+
let n = t;
|
|
295
|
+
e[n(434)] || (J(e[n(454)]), P(-1), V[n(505)]?.focus());
|
|
296
|
+
},
|
|
297
|
+
children: f(ne, {})
|
|
298
|
+
})]
|
|
299
|
+
})
|
|
300
|
+
}, e[t(465)]);
|
|
301
|
+
}),
|
|
302
|
+
f(T(495), {
|
|
303
|
+
ref: V,
|
|
304
|
+
id: he,
|
|
305
|
+
className: T(436),
|
|
306
|
+
role: x ? T(474) : void 0,
|
|
307
|
+
"aria-expanded": x ? Z : void 0,
|
|
308
|
+
"aria-controls": Z ? E : void 0,
|
|
309
|
+
"aria-autocomplete": x ? "list" : void 0,
|
|
310
|
+
"aria-activedescendant": Z && z >= 0 ? c(E, z) : void 0,
|
|
311
|
+
"aria-invalid": pe || j || void 0,
|
|
312
|
+
"aria-label": w,
|
|
313
|
+
"aria-labelledby": ve,
|
|
314
|
+
"aria-describedby": ye,
|
|
315
|
+
autoComplete: "off",
|
|
316
|
+
disabled: S,
|
|
317
|
+
value: k,
|
|
318
|
+
placeholder: D.length ? "" : de,
|
|
319
|
+
"data-error": j || void 0,
|
|
320
|
+
onChange: Ke,
|
|
321
|
+
onKeyDown: We,
|
|
322
|
+
onPaste: qe,
|
|
323
|
+
onFocus: () => Te(!0),
|
|
324
|
+
onBlur: () => {
|
|
325
|
+
Te(!1), P(-1);
|
|
326
|
+
}
|
|
327
|
+
}),
|
|
328
|
+
f(T(429), {
|
|
329
|
+
className: T(441),
|
|
330
|
+
"aria-live": "polite",
|
|
331
|
+
children: Se
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
}),
|
|
335
|
+
C && D[T(492)]((e, t) => f(T(495), {
|
|
336
|
+
type: T(470),
|
|
337
|
+
name: C,
|
|
338
|
+
value: e
|
|
339
|
+
}, G[t])),
|
|
340
|
+
x && ze[T(473)] && f(o, {
|
|
341
|
+
ref: ke,
|
|
342
|
+
closing: ze[T(475)],
|
|
343
|
+
anchorRef: Oe,
|
|
344
|
+
maxHeight: _e,
|
|
345
|
+
children: f(a, {
|
|
346
|
+
id: E,
|
|
347
|
+
options: Ve,
|
|
348
|
+
activeIndex: z,
|
|
349
|
+
isSelected: () => !1,
|
|
350
|
+
onSelect: (e) => He(e[T(414)]),
|
|
351
|
+
onActiveChange: B,
|
|
352
|
+
"aria-label": w ? w + T(449) : "추천"
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
] });
|
|
356
|
+
}
|
|
357
|
+
export { g as TagInput };
|