@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.
Files changed (160) hide show
  1. package/AGENTS.md +1 -0
  2. package/agents/INDEX.md +1 -0
  3. package/agents/brand-icon/AGENTS.md +2 -2
  4. package/agents/social-login-button/AGENTS.md +156 -0
  5. package/lib/components/Accordion/Accordion2.js +135 -0
  6. package/lib/components/ActionBar/ActionBar2.js +65 -0
  7. package/lib/components/Alert/Alert2.js +131 -0
  8. package/lib/components/AppShell/AppShell2.js +94 -0
  9. package/lib/components/AreaChart/AreaChart.js +59 -0
  10. package/lib/components/BarChart/BarChart2.js +243 -0
  11. package/lib/components/BarList/BarList2.js +172 -0
  12. package/lib/components/Breadcrumb/Breadcrumb2.js +87 -0
  13. package/lib/components/Calendar/Calendar2.js +309 -0
  14. package/lib/components/Calendar/DatePicker2.js +229 -0
  15. package/lib/components/Calendar/date.js +121 -0
  16. package/lib/components/Card/Card2.js +104 -0
  17. package/lib/components/CardFrame/CardFrame2.js +72 -0
  18. package/lib/components/Chart/ChartParts.js +150 -0
  19. package/lib/components/Chart/chart2.js +96 -0
  20. package/lib/components/Chart/useChartInteraction.js +94 -0
  21. package/lib/components/ChatBubble/ChatBubble2.js +174 -0
  22. package/lib/components/ChatBubble/formatChatTime.js +53 -0
  23. package/lib/components/ChatComposer/ChatComposer2.js +153 -0
  24. package/lib/components/CodeBlock/CodeBlock2.js +93 -0
  25. package/lib/components/CodeBlock/highlight.js +114 -0
  26. package/lib/components/ColorPicker/ColorPicker2.js +610 -0
  27. package/lib/components/ColorPicker/color.js +180 -0
  28. package/lib/components/ColorPicker/presets.js +75 -0
  29. package/lib/components/Combobox/Combobox2.js +229 -0
  30. package/lib/components/CommandMenu/CommandMenu.js +267 -0
  31. package/lib/components/Comment/Comment2.js +134 -0
  32. package/lib/components/ContextMenu/ContextMenu2.js +168 -0
  33. package/lib/components/DataGrid/DataGrid2.js +1996 -0
  34. package/lib/components/DataGrid/GridPopover.js +154 -0
  35. package/lib/components/DataGrid/anchor.js +50 -0
  36. package/lib/components/DataGrid/model.js +558 -0
  37. package/lib/components/DataGrid/panels.js +703 -0
  38. package/lib/components/DataGrid/typeMeta.js +76 -0
  39. package/lib/components/DataGrid/types.js +54 -0
  40. package/lib/components/DescriptionList/DescriptionList2.js +180 -0
  41. package/lib/components/Dialog/AlertDialog.js +118 -0
  42. package/lib/components/Dialog/Dialog2.js +109 -0
  43. package/lib/components/Dialog/modal.js +92 -0
  44. package/lib/components/Drawer/Drawer2.js +244 -0
  45. package/lib/components/DropdownMenu/DropdownMenu2.js +394 -0
  46. package/lib/components/DropdownMenu/menuCore.js +63 -0
  47. package/lib/components/Dropzone/Dropzone2.js +144 -0
  48. package/lib/components/EmptyState/EmptyState2.js +72 -0
  49. package/lib/components/FileChip/FileChip2.js +118 -0
  50. package/lib/components/FileUpload/FileUpload.js +258 -0
  51. package/lib/components/FilterChips/FilterChips2.js +101 -0
  52. package/lib/components/FunnelChart/FunnelChart2.js +283 -0
  53. package/lib/components/FunnelChart/funnel.js +69 -0
  54. package/lib/components/Highlight/Highlight2.js +100 -0
  55. package/lib/components/HoverCard/HoverCard.js +134 -0
  56. package/lib/components/InlineDiff/InlineDiff2.js +215 -0
  57. package/lib/components/InlineDiff/diff.js +126 -0
  58. package/lib/components/InlineDiff/useDiffReview.js +109 -0
  59. package/lib/components/Kanban/Kanban2.js +691 -0
  60. package/lib/components/Kanban/KanbanCard.js +159 -0
  61. package/lib/components/Kanban/move.js +69 -0
  62. package/lib/components/LineChart/LineChart2.js +342 -0
  63. package/lib/components/List/List2.js +133 -0
  64. package/lib/components/Listbox/Listbox2.js +163 -0
  65. package/lib/components/Marker/Marker2.js +82 -0
  66. package/lib/components/Menubar/Menubar2.js +223 -0
  67. package/lib/components/MultiSelect/MultiSelect2.js +204 -0
  68. package/lib/components/NavigationMenu/NavigationMenu2.js +481 -0
  69. package/lib/components/NoticeStack/NoticeStack2.js +178 -0
  70. package/lib/components/NumberStepper/NumberStepper2.js +129 -0
  71. package/lib/components/OtpInput/OtpInput2.js +122 -0
  72. package/lib/components/Pagination/Pagination2.js +210 -0
  73. package/lib/components/Pagination/paginationRange.js +53 -0
  74. package/lib/components/PhoneInput/PhoneInput.js +175 -0
  75. package/lib/components/PieChart/PieChart2.js +246 -0
  76. package/lib/components/PieChart/arc.js +66 -0
  77. package/lib/components/PieChart/useArcTween.js +94 -0
  78. package/lib/components/Popover/Popover2.js +112 -0
  79. package/lib/components/ProgressTracker/ProgressTracker2.js +226 -0
  80. package/lib/components/Rating/Rating2.js +186 -0
  81. package/lib/components/Resizable/Resizable2.js +236 -0
  82. package/lib/components/Resizable/layout.js +115 -0
  83. package/lib/components/ScaledPreview/ScaledPreview2.js +100 -0
  84. package/lib/components/ScatterChart/ScatterChart2.js +356 -0
  85. package/lib/components/ScatterChart/scatter.js +83 -0
  86. package/lib/components/ScrollArea/ScrollArea2.js +218 -0
  87. package/lib/components/Select/Select2.js +153 -0
  88. package/lib/components/Sidebar/Sidebar2.js +127 -0
  89. package/lib/components/Skeleton/Skeleton2.js +91 -0
  90. package/lib/components/Slider/Slider2.js +142 -0
  91. package/lib/components/SocialLoginButton/SocialLoginButton.js +85 -0
  92. package/lib/components/SparkChart/SparkChart2.js +217 -0
  93. package/lib/components/SparkChart/spark.js +76 -0
  94. package/lib/components/Sparkbar/Sparkbar2.js +111 -0
  95. package/lib/components/SplitView/SplitView2.js +95 -0
  96. package/lib/components/Stat/Stat2.js +164 -0
  97. package/lib/components/StepList/StepList2.js +131 -0
  98. package/lib/components/Table/Table2.js +104 -0
  99. package/lib/components/Tabs/Tabs2.js +131 -0
  100. package/lib/components/TagInput/TagInput2.js +360 -0
  101. package/lib/components/TimePicker/TimePicker2.js +388 -0
  102. package/lib/components/TimePicker/time.js +83 -0
  103. package/lib/components/Timeline/Timeline2.js +369 -0
  104. package/lib/components/Timeline/scale.js +83 -0
  105. package/lib/components/Toast/Toaster.js +212 -0
  106. package/lib/components/Toast/store.js +129 -0
  107. package/lib/components/ToggleGroup/ToggleGroup2.js +125 -0
  108. package/lib/components/Toolbar/Toolbar2.js +281 -0
  109. package/lib/components/Tracker/Tracker2.js +172 -0
  110. package/lib/components/TreeDiagram/TreeDiagram2.js +223 -0
  111. package/lib/components/TreeView/TreeView2.js +284 -0
  112. package/lib/hooks/timing.js +55 -0
  113. package/lib/hooks/useControllableState.js +49 -0
  114. package/lib/hooks/useCountdown.js +80 -0
  115. package/lib/hooks/useDigitInput.js +105 -0
  116. package/lib/hooks/useDismiss.js +71 -0
  117. package/lib/hooks/useElapsed.js +83 -0
  118. package/lib/hooks/useFloating.js +70 -0
  119. package/lib/hooks/useFocusTrap.js +61 -0
  120. package/lib/hooks/usePresence.js +60 -0
  121. package/lib/hooks/usePressToOpen.js +69 -0
  122. package/lib/hooks/useScrollLock.js +70 -0
  123. package/lib/hooks/useSelection.js +68 -0
  124. package/lib/index.js +175 -17911
  125. package/lib/primitives/AspectRatio2.js +80 -0
  126. package/lib/primitives/BrandIcon.js +245 -0
  127. package/lib/primitives/ColorDot2.js +70 -0
  128. package/lib/primitives/CopyButton2.js +85 -0
  129. package/lib/primitives/CountBadge2.js +78 -0
  130. package/lib/primitives/Countdown2.js +65 -0
  131. package/lib/primitives/Delta2.js +67 -0
  132. package/lib/primitives/Elapsed.js +62 -0
  133. package/lib/primitives/FileIcon2.js +125 -0
  134. package/lib/primitives/Flag2.js +263 -0
  135. package/lib/primitives/IconStack2.js +85 -0
  136. package/lib/primitives/IconTile2.js +68 -0
  137. package/lib/primitives/Kbd2.js +88 -0
  138. package/lib/primitives/Layout2.js +118 -0
  139. package/lib/primitives/Link2.js +53 -0
  140. package/lib/primitives/MaskedText2.js +120 -0
  141. package/lib/primitives/Progress2.js +137 -0
  142. package/lib/primitives/RelativeTime.js +84 -0
  143. package/lib/primitives/SearchInput2.js +84 -0
  144. package/lib/primitives/SelectorButton2.js +97 -0
  145. package/lib/primitives/Spinner2.js +98 -0
  146. package/lib/primitives/StatusIcon2.js +126 -0
  147. package/lib/primitives/Swatch2.js +79 -0
  148. package/lib/primitives/Tooltip2.js +132 -0
  149. package/lib/primitives/Typography2.js +97 -0
  150. package/lib/primitives/formatCountdown.js +51 -0
  151. package/lib/primitives/formatElapsed.js +66 -0
  152. package/lib/primitives/formatRelativeTime.js +64 -0
  153. package/lib/primitives/hotkey.js +94 -0
  154. package/lib/primitives/index.js +352 -0
  155. package/lib/primitives/maskValue.js +65 -0
  156. package/lib/style.css +1 -1
  157. package/lib/types/components/SocialLoginButton/SocialLoginButton.d.ts +10 -0
  158. package/lib/types/components/index.d.ts +2 -0
  159. package/lib/types/primitives/BrandIcon.d.ts +1 -1
  160. package/package.json +2 -1
@@ -0,0 +1,610 @@
1
+ "use client";
2
+ const e = x;
3
+ (function(e, t) {
4
+ let n = x, r = e();
5
+ for (;;) try {
6
+ if (parseInt(n(504)) / 1 * (-parseInt(n(506)) / 2) + parseInt(n(483)) / 3 * (-parseInt(n(516)) / 4) + -parseInt(n(480)) / 5 + -parseInt(n(513)) / 6 + -parseInt(n(491)) / 7 * (-parseInt(n(533)) / 8) + parseInt(n(496)) / 9 * (-parseInt(n(550)) / 10) + parseInt(n(508)) / 11 * (parseInt(n(541)) / 12) == t) break;
7
+ r.push(r.shift());
8
+ } catch {
9
+ r.push(r.shift());
10
+ }
11
+ })(N, 122873);
12
+ import { Tooltip as t } from "../../primitives/Tooltip2.js";
13
+ import { Text as n } from "../../primitives/Typography2.js";
14
+ import { CopyButton as r } from "../../primitives/CopyButton2.js";
15
+ import { Grid as i, Inline as a, Stack as o } from "../../primitives/Layout2.js";
16
+ import { useControllableState as s } from "../../hooks/useControllableState.js";
17
+ import { Button as c, Input as l, SegmentedControl as u, cx as d } from "../../primitives/index.js";
18
+ import { Popover as ee } from "../Popover/Popover2.js";
19
+ import { clamp as f, formatColor as p, formatHex as m, hslToRgb as h, hsvToRgb as g, isLight as _, parseColor as v, parseHex as te, rgbToHsl as y, rgbToHsv as b } from "./color.js";
20
+ function x(e, t) {
21
+ e -= 453;
22
+ let n = N(), r = n[e];
23
+ x.vJhbET === void 0 && (x.PSJQHS = function(e) {
24
+ let t = "", n = "";
25
+ 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);
26
+ for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
27
+ return decodeURIComponent(n);
28
+ }, x.hujSHp = {}, x.vJhbET = !0);
29
+ let i = n[0];
30
+ x.MszUeX !== i && (x.hujSHp = {}, x.MszUeX = i);
31
+ let a = x.hujSHp[e];
32
+ return a === void 0 ? (r = x.PSJQHS(r), x.hujSHp[e] = r) : r = a, r;
33
+ }
34
+ /* empty css */
35
+ import { CHART_COLOR_PRESETS as S } from "./presets.js";
36
+ import { useLayoutEffect as C, useRef as w, useState as T } from "react";
37
+ import { Check as E, ChevronDown as ne, Pipette as D } from "lucide-react";
38
+ import { Fragment as re, jsx as O, jsxs as k } from "react/jsx-runtime";
39
+ var ie = "#3b82f6", A = (e) => {
40
+ let t = v(e);
41
+ return t ? b(t) : null;
42
+ }, j = (e, t) => ({
43
+ ...e,
44
+ h: e.s === 0 || e.v === 0 ? t.h : e.h,
45
+ s: e.v === 0 ? t.s : e.s
46
+ }), M = (e) => Math.round(e * 100);
47
+ function N() {
48
+ let e = /* @__PURE__ */ "y29SB3i.Dg9vChbLCKnHC2u.C2v0ug9PBNrLCKnHChr1CMu.AgfUzgXLCNm.z2v0uhjVCgvYDhLwywX1zq.y2XPzw50wa.zhjHz2DPBMC.zgLHBg9N.7lge64+ekcuP.zhmTy29SB3iTCgLJA2vYx19ZD2f0y2G.AhnSka.nZGXmdGWs1HVqMrh.7ioj7iobia.C3bSAxq.otnUzeHWq0S.zhmTy29SB3iTCgLJA2vYx190AhvTyIbKCY1JB2XVCI1WAwnRzxjFx3rODw1Ils10CMfJAW.7zMu66M07jEq7isCioYdIsdQS6dRPBtQUla.uKDc.yNv0Dg9U.zw5K.C3bHBG.7lsi66gDkddIGjmYntuP.mJy4mtiXExHRrKjP.CMDI.zMLSDgvY.BwfW.AhnS.mJDXENHfy3e.CMvSyxrLzfrHCMDLDa.6RIW67o4ioYdIq.AxndB21WB3nPBMC.67Ai7yIS66Qf64+ekcuP.zhmTy29SB3iTzMLLBgrFx2nOzxzYB24.rw5K.BgvUz3rO.mJGZzuDKy1jO.zhmTy29SB3iTCgLJA2vYx19MAwvSza.nZK0yMTjuwvr.jsWG67cD6RIWia.mtG3DLHQvKPy.Dw5KzwzPBMvK.zg9JDw1LBNrfBgvTzw50.y3vYCMvUDa.DMfSDwu.mte3mZu4mM9fseTLDq.zhmTy29SB3iTCgLJA2vYx19YywLS.zhmTy29SB3iTCgLJA2vY.mtaWzKjHCg9z.C3rYAw5N.CM91BMq.zhmTy29SB3iTzMLLBgrFx2nOAxa.zgL2.rxLLrhjVChbLCG.7iojioYeOo2dNq.Dg9mB3DLCKnHC2u.y29UDgfPBNm.BgvMDa.7yYm656rkddIGjmYntuP.7lwC6RE8ioYcRoYAQq.66Qf64+ekcuP.Dg9W.B3bLBG.C2vSzwn0.Cg9PBNrLCKLK.mtzkuhrywge.7lge64+e7jMaioUWNEQ4Sa.Agv4.BgfIzwWTEhm.ioYeOo2dNq.rxnJyxbL.mUYWQoYBKcdSIQZRNBZSNBtRJzq.67Ai7yIS66Qf64+eia.ndaWnZG4sMHdywzr.DMfYka.zhmTy29SB3iTzMLLBgq.7lge64+eia.yMv0D2vLBG.sevy.A2v5.sevyioQWKG.AM9PBG.mtG4ntKWy3HoD1jM.y2XPzw50wq.C3rHCNrZv2L0Aa.zhmTy29SB3iTCgLJA2vYx190CMfJAYbKCY1JB2XVCI1WAwnRzxjFx3rYywnRls1ODwu.DgfYz2v0.C2HPzNrlzxK.DgvZDa.ChjLDMvUDerLzMf1Bhq.y3vYCMvUDfrHCMDLDa.y2fUy2vS.C2XPy2u.CMvWBgfJzq.Ag9YAxPVBNrHBa.7ioj7iobkddIGjmZnJaP.BwLUBwf4kdaSidfMCIKGnJrWEa.zhmTy29SB3iTCgLJA2vYx190CMfJAYbKCY1JB2XVCI1WAwnRzxjFx3rYywnRls1HBhbOyq.C2XPzgvY.C2vJB25Kyxj5.DhjPBq.Aw5WDxq.z2HVC3q.zhmTy29SB3iTCgLJA2vYx19WCMv2Awv3.AgvPz2H0.C3rHCNq.z3jVDxa.DgvYDgLHCNK".split(".");
49
+ return N = function() {
50
+ return e;
51
+ }, N();
52
+ }
53
+ function P({ ref: e, thumbRef: t, disabled: n, onMove: r, onStart: i, onEnd: a, onCancel: o }) {
54
+ let s = w(!1), [c, l] = T(!1), u = (e) => {
55
+ let t = x;
56
+ s[t(511)] = e, l(e);
57
+ }, d = (t) => {
58
+ let n = x, i = e.current.getBoundingClientRect();
59
+ r(f((t[n(474)] - i[n(525)]) / i.width, 0, 1), f((t[n(551)] - i[n(529)]) / i[n(465)], 0, 1));
60
+ };
61
+ return {
62
+ dragging: c,
63
+ handlers: {
64
+ onPointerDown: (e) => {
65
+ let r = x;
66
+ n || e[r(487)] !== 0 || (e[r(557)](), e[r(558)][r(471)](e[r(532)]), u(!0), i(), d(e), t.current?.focus({ preventScroll: !0 }));
67
+ },
68
+ onPointerMove: (e) => {
69
+ s[x(511)] && d(e);
70
+ },
71
+ onPointerUp: () => {
72
+ s[x(511)] && (u(!1), a());
73
+ },
74
+ onPointerCancel: () => {
75
+ s[x(511)] && (u(!1), a());
76
+ }
77
+ },
78
+ cancel: () => s[x(511)] ? (u(!1), o(), !0) : !1
79
+ };
80
+ }
81
+ function F({ display: e, parse: t, onPreview: r, onSettle: i, onRevert: a, onBegin: s, label: c, caption: u, leading: d, disabled: ee, maxLength: f }) {
82
+ let p = x, [m, h] = T(null), g = m !== null && t(m) === null, _ = () => {
83
+ h(null), i();
84
+ }, v = O(l, {
85
+ size: "sm",
86
+ value: m ?? e,
87
+ "aria-label": c,
88
+ invalid: g,
89
+ disabled: ee,
90
+ leading: d,
91
+ maxLength: f,
92
+ spellCheck: !1,
93
+ autoComplete: "off",
94
+ wrapperClassName: p(505),
95
+ onFocus: (e) => {
96
+ let t = p;
97
+ s(), e[t(558)][t(531)]();
98
+ },
99
+ onChange: (e) => {
100
+ let n = p, i = e[n(554)][n(512)];
101
+ h(i);
102
+ let a = t(i);
103
+ a && r(a);
104
+ },
105
+ onBlur: _,
106
+ onKeyDown: (e) => {
107
+ let t = p;
108
+ e.nativeEvent[t(499)] || (e.key === "Enter" ? (e[t(557)](), _()) : e[t(547)] === t(538) && m !== null && (e[t(557)](), h(null), a()));
109
+ }
110
+ });
111
+ return u ? k(o, {
112
+ gap: 1,
113
+ align: "center",
114
+ children: [v, O(n, {
115
+ variant: "caption",
116
+ tone: p(468),
117
+ children: u
118
+ })]
119
+ }) : v;
120
+ }
121
+ function I({ css: e, rgb: n, label: r, selected: i, disabled: a, onPick: o }) {
122
+ let s = x;
123
+ return O(t, {
124
+ content: r,
125
+ children: O(s(487), {
126
+ type: s(487),
127
+ className: s(478),
128
+ style: { "--_c": e },
129
+ "aria-label": r,
130
+ "aria-pressed": i,
131
+ disabled: a,
132
+ "data-light": n && _(n) || void 0,
133
+ onClick: o,
134
+ children: O(E, { className: "ds-color-picker__check" })
135
+ })
136
+ });
137
+ }
138
+ var ae = () => typeof window !== e(509) && e(521) in window ? window[e(521)] : null, oe = [
139
+ {
140
+ value: "hex",
141
+ label: e(546)
142
+ },
143
+ {
144
+ value: "rgb",
145
+ label: e(486)
146
+ },
147
+ {
148
+ value: e(495),
149
+ label: "HSL"
150
+ }
151
+ ];
152
+ function se({ value: l, defaultValue: ee = ie, onValueChange: _, onValueCommit: S, alpha: E = !1, format: ne, defaultFormat: re = "hex", onFormatChange: N, presets: se, presetsLabel: L = e(498), recentColors: le, defaultRecentColors: ue = [], onRecentColorsChange: de, showRecent: fe = !0, maxRecent: pe = 8, eyeDropper: me = !0, copyable: he = !0, disabled: R, className: ge, style: _e, "aria-label": ve = e(522) }) {
153
+ let z = e, [B, ye] = s(l, ee, _), [V, be] = s(ne, re, N), [xe, Se] = s(le, ue, de), [H, Ce] = T(() => A(B) ?? A(ie)), [we, Te] = T(B);
154
+ if (B !== we) {
155
+ Te(B);
156
+ let e = A(B);
157
+ e && Ce(j(e, H));
158
+ }
159
+ let U = w(H);
160
+ C(() => {
161
+ let e = x;
162
+ U[e(511)] = H;
163
+ });
164
+ let W = (e) => m(g(e), E), G = (e) => {
165
+ let t = E ? e : {
166
+ ...e,
167
+ a: 1
168
+ };
169
+ U.current = t, Ce(t);
170
+ let n = W(t);
171
+ Te(n), n !== B && ye(n);
172
+ }, K = () => S?.(W(U[z(511)])), q = w(H), J = () => {
173
+ let e = z;
174
+ q[e(511)] = U[e(511)];
175
+ }, Ee = () => {
176
+ let e = z;
177
+ W(q[e(511)]) !== W(U[e(511)]) && K(), q[e(511)] = U[e(511)];
178
+ }, Y = () => G(q[z(511)]), X = g(H), De = m({
179
+ ...X,
180
+ a: 1
181
+ }, !1), Oe = z(479) + H.h + " 100% 50%)", ke = w(null), Ae = w(null), je = w(null), Me = w(null), Ne = w(null), Pe = w(null), Fe = P({
182
+ ref: ke,
183
+ thumbRef: Ae,
184
+ disabled: R,
185
+ onStart: J,
186
+ onMove: (e, t) => G({
187
+ ...U[z(511)],
188
+ s: e,
189
+ v: 1 - t
190
+ }),
191
+ onEnd: K,
192
+ onCancel: Y
193
+ }), Ie = P({
194
+ ref: je,
195
+ thumbRef: Me,
196
+ disabled: R,
197
+ onStart: J,
198
+ onMove: (e) => G({
199
+ ...U[z(511)],
200
+ h: e * 360
201
+ }),
202
+ onEnd: K,
203
+ onCancel: Y
204
+ }), Le = P({
205
+ ref: Ne,
206
+ thumbRef: Pe,
207
+ disabled: R,
208
+ onStart: J,
209
+ onMove: (e) => G({
210
+ ...U.current,
211
+ a: Math[z(518)](e * 100) / 100
212
+ }),
213
+ onEnd: K,
214
+ onCancel: Y
215
+ }), Re = (e, t) => (n) => {
216
+ let r = z;
217
+ if (n[r(547)] === "Escape") {
218
+ e[r(559)]() && n[r(557)]();
219
+ return;
220
+ }
221
+ if (e[r(475)] || R) return;
222
+ let i = n[r(555)] ? 10 : 1, a = {
223
+ ArrowRight: [i, 0],
224
+ ArrowLeft: [-i, 0],
225
+ ArrowUp: [0, i],
226
+ ArrowDown: [0, -i],
227
+ PageUp: [0, 10],
228
+ PageDown: [0, -10]
229
+ }, o;
230
+ if (n.key in a) o = t(U[r(511)], ...a[n[r(547)]]);
231
+ else if (n.key === "Home" || n[r(547)] === r(502)) o = t(U[r(511)], 0, 0, n.key === "Home" ? r(466) : r(488));
232
+ else return;
233
+ n.preventDefault(), G(o), K();
234
+ }, ze = Re(Fe, (e, t, n, r) => r ? {
235
+ ...e,
236
+ s: r === z(466) ? 0 : 1
237
+ } : {
238
+ ...e,
239
+ s: f(e.s + t / 100, 0, 1),
240
+ v: f(e.v + n / 100, 0, 1)
241
+ }), Be = Re(Ie, (e, t, n, r) => ({
242
+ ...e,
243
+ h: r ? r === z(466) ? 0 : 360 : f(Math[z(518)](e.h) + t + n, 0, 360)
244
+ })), Ve = Re(Le, (e, t, n, r) => ({
245
+ ...e,
246
+ a: r ? r === z(466) ? 0 : 1 : f(Math.round(e.a * 100 + t + n) / 100, 0, 1)
247
+ })), He = y(X), Z = (e) => j(b(e), U[z(511)]), Ue = (e) => (t) => {
248
+ let n = z, r = t.trim()[n(454)](/%$/, "");
249
+ if (!/^\d+(\.\d+)?$/[n(556)](r)) return null;
250
+ let i = Number(r);
251
+ return i >= 0 && i <= e ? i : null;
252
+ }, We = (e, t, n) => {
253
+ let r = Ue(255);
254
+ return O(F, {
255
+ display: String(Math.round(X[e])),
256
+ parse: (t) => {
257
+ let n = x, i = r(t);
258
+ return i === null ? null : Z({
259
+ ...g(U[n(511)]),
260
+ [e]: i
261
+ });
262
+ },
263
+ ...Q,
264
+ label: n,
265
+ caption: t,
266
+ maxLength: 3
267
+ }, e);
268
+ }, Ge = (e, t, n) => {
269
+ let r = z, i = Ue(e === "h" ? 360 : 100), a = e === "h" ? Math[r(518)](H.h) % 360 : Math.round(He[e] * 100);
270
+ return O(F, {
271
+ display: String(a),
272
+ parse: (t) => {
273
+ let n = r, a = i(t);
274
+ if (a === null) return null;
275
+ let o = y(g(U.current)), s = e === "h" ? {
276
+ ...o,
277
+ h: a
278
+ } : {
279
+ ...o,
280
+ [e]: a / 100
281
+ }, c = b(h(s));
282
+ return e === "h" ? {
283
+ ...c,
284
+ h: a % 360
285
+ } : j(c, U[n(511)]);
286
+ },
287
+ ...Q,
288
+ label: n,
289
+ caption: t,
290
+ maxLength: 3
291
+ }, e);
292
+ }, Q = {
293
+ onPreview: G,
294
+ onSettle: Ee,
295
+ onRevert: Y,
296
+ onBegin: J,
297
+ disabled: R
298
+ }, Ke = O(F, {
299
+ display: De[z(453)](1)[z(470)](),
300
+ parse: (e) => {
301
+ let t = z, n = te(e);
302
+ if (!n) return null;
303
+ let r = e[t(461)]()[t(454)]("#", "")[t(503)], i = r === 4 || r === 8;
304
+ return {
305
+ ...Z(n),
306
+ a: E && i ? n.a : U[t(511)].a
307
+ };
308
+ },
309
+ ...Q,
310
+ label: z(548),
311
+ caption: V === z(535) && E ? z(546) : void 0,
312
+ leading: O(z(489), {
313
+ className: "ds-color-picker__hash",
314
+ children: "#"
315
+ }),
316
+ maxLength: 9
317
+ }), qe = E && O(F, {
318
+ display: M(H.a) + "%",
319
+ parse: (e) => {
320
+ let t = z, n = Ue(100)(e);
321
+ return n === null ? null : {
322
+ ...U[t(511)],
323
+ a: n / 100
324
+ };
325
+ },
326
+ ...Q,
327
+ label: z(500),
328
+ caption: "A",
329
+ maxLength: 4
330
+ }), Je = w(null), Ye = (se ?? [])[z(494)]((e) => typeof e === z(517) ? { color: e } : e), Xe = ce(Je, Ye[z(494)]((e) => e[z(469)])), Ze = (e) => {
331
+ let t = v(e);
332
+ t && (J(), G({
333
+ ...Z(t),
334
+ a: E ? t.a : 1
335
+ }), K());
336
+ }, Qe = W(H), $ = w(null), $e = (e) => {
337
+ let t = z;
338
+ e[t(558)][t(524)](e.relatedTarget) || ($.current = W(U[t(511)]));
339
+ }, et = (e) => {
340
+ let t = z;
341
+ if (e.currentTarget[t(524)](e[t(497)])) return;
342
+ let n = W(U.current);
343
+ $[t(511)] !== null && $[t(511)] !== n && Se([n, ...xe[t(493)]((e) => e[t(523)]() !== n)][t(453)](0, pe)), $.current = null;
344
+ }, [tt] = T(() => ae() !== null), nt = async () => {
345
+ let e = z, t = ae();
346
+ if (t) try {
347
+ let { sRGBHex: n } = await new t()[e(530)](), r = v(n);
348
+ if (!r) return;
349
+ J(), G({
350
+ ...Z(r),
351
+ a: U[e(511)].a
352
+ }), K();
353
+ } catch {}
354
+ }, rt = p(X, V, E);
355
+ return k(o, {
356
+ ref: Je,
357
+ gap: 3,
358
+ role: z(467),
359
+ "aria-label": ve,
360
+ className: d(z(515), ge),
361
+ style: _e,
362
+ "data-disabled": R || void 0,
363
+ onFocus: $e,
364
+ onBlur: et,
365
+ children: [
366
+ O(z(520), {
367
+ ref: ke,
368
+ className: "ds-color-picker__area",
369
+ style: { "--_hue": Oe },
370
+ "data-dragging": Fe[z(475)] || void 0,
371
+ ...Fe[z(472)],
372
+ children: O(z(520), {
373
+ ref: Ae,
374
+ role: z(459),
375
+ tabIndex: R ? -1 : 0,
376
+ "aria-label": z(534),
377
+ "aria-roledescription": z(539),
378
+ "aria-valuemin": 0,
379
+ "aria-valuemax": 100,
380
+ "aria-valuenow": M(H.s),
381
+ "aria-valuetext": z(544) + M(H.s) + z(507) + M(H.v) + "%",
382
+ "aria-disabled": R || void 0,
383
+ className: "ds-color-picker__thumb",
384
+ style: {
385
+ left: H.s * 100 + "%",
386
+ top: (1 - H.v) * 100 + "%",
387
+ "--_c": De
388
+ },
389
+ onKeyDown: ze
390
+ })
391
+ }),
392
+ k(a, {
393
+ gap: 3,
394
+ wrap: !1,
395
+ children: [O(z(489), {
396
+ className: z(464),
397
+ style: { "--_c": Qe },
398
+ "aria-hidden": !0
399
+ }), k(o, {
400
+ gap: E ? 2 : 0,
401
+ style: {
402
+ flex: 1,
403
+ minWidth: 0
404
+ },
405
+ children: [O("div", {
406
+ className: z(553),
407
+ "data-dragging": Ie[z(475)] || void 0,
408
+ ...Ie.handlers,
409
+ children: O(z(520), {
410
+ ref: je,
411
+ className: z(514),
412
+ children: O(z(520), {
413
+ ref: Me,
414
+ role: "slider",
415
+ tabIndex: R ? -1 : 0,
416
+ "aria-label": "색상",
417
+ "aria-orientation": z(455),
418
+ "aria-valuemin": 0,
419
+ "aria-valuemax": 360,
420
+ "aria-valuenow": Math.round(H.h),
421
+ "aria-valuetext": z(481) + Math[z(518)](H.h) + "도",
422
+ "aria-disabled": R || void 0,
423
+ className: z(484),
424
+ style: {
425
+ left: H.h / 360 * 100 + "%",
426
+ "--_c": Oe
427
+ },
428
+ onKeyDown: Be
429
+ })
430
+ })
431
+ }), E && O(z(520), {
432
+ className: z(458),
433
+ style: { "--_c": De },
434
+ "data-dragging": Le[z(475)] || void 0,
435
+ ...Le.handlers,
436
+ children: O("div", {
437
+ ref: Ne,
438
+ className: z(514),
439
+ children: O("div", {
440
+ ref: Pe,
441
+ role: z(459),
442
+ tabIndex: R ? -1 : 0,
443
+ "aria-label": "불투명도",
444
+ "aria-orientation": "horizontal",
445
+ "aria-valuemin": 0,
446
+ "aria-valuemax": 100,
447
+ "aria-valuenow": M(H.a),
448
+ "aria-valuetext": z(540) + M(H.a) + "%",
449
+ "aria-disabled": R || void 0,
450
+ className: z(484),
451
+ style: {
452
+ left: H.a * 100 + "%",
453
+ "--_c": Qe
454
+ },
455
+ onKeyDown: Ve
456
+ })
457
+ })
458
+ })]
459
+ })]
460
+ }),
461
+ k(a, {
462
+ justify: z(545),
463
+ wrap: !1,
464
+ children: [O(u, {
465
+ options: oe,
466
+ value: V,
467
+ onChange: be,
468
+ ariaLabel: "값 형식"
469
+ }), k(a, {
470
+ gap: 1,
471
+ wrap: !1,
472
+ children: [me && tt && O(t, {
473
+ content: z(485),
474
+ children: O(c, {
475
+ variant: z(463),
476
+ size: "sm",
477
+ iconOnly: !0,
478
+ icon: O(D, {}),
479
+ "aria-label": "화면에서 색 고르기",
480
+ disabled: R,
481
+ onClick: nt
482
+ })
483
+ }), he && O(r, {
484
+ value: rt,
485
+ disabled: R
486
+ })]
487
+ })]
488
+ }),
489
+ V === z(535) ? E ? k(i, {
490
+ columns: z(457),
491
+ gap: 2,
492
+ align: z(466),
493
+ children: [Ke, qe]
494
+ }) : Ke : k(i, {
495
+ columns: E ? 4 : 3,
496
+ gap: 2,
497
+ align: z(466),
498
+ children: [V === z(492) ? [
499
+ We("r", "R", "빨강(0–255)"),
500
+ We("g", "G", z(490)),
501
+ We("b", "B", z(526))
502
+ ] : [
503
+ Ge("h", "H", z(456)),
504
+ Ge("s", "S", z(477)),
505
+ Ge("l", "L", z(528))
506
+ ], qe]
507
+ }),
508
+ Ye[z(503)] > 0 && k(o, {
509
+ gap: 2,
510
+ children: [O(n, {
511
+ variant: z(536),
512
+ tone: "secondary",
513
+ children: L
514
+ }), O(z(520), {
515
+ className: "ds-color-picker__swatches",
516
+ children: Ye[z(494)]((e, t) => {
517
+ let n = z, r = Xe[t] ? v(Xe[t]) : null;
518
+ return O(I, {
519
+ css: e[n(469)][n(552)]("--") ? n(542) + e[n(469)] + ")" : e.color,
520
+ rgb: r,
521
+ label: e.label ?? e[n(469)],
522
+ selected: r !== null && m(r, E) === Qe,
523
+ disabled: R,
524
+ onPick: () => Xe[t] && Ze(Xe[t])
525
+ }, e[n(469)]);
526
+ })
527
+ })]
528
+ }),
529
+ fe && xe[z(503)] > 0 && k(o, {
530
+ gap: 2,
531
+ children: [O(n, {
532
+ variant: z(536),
533
+ tone: z(460),
534
+ children: z(527)
535
+ }), O("div", {
536
+ className: "ds-color-picker__swatches",
537
+ children: xe.map((e) => {
538
+ let t = z, n = v(e);
539
+ return O(I, {
540
+ css: e,
541
+ rgb: n,
542
+ label: e[t(470)](),
543
+ selected: n !== null && m(n, E) === Qe,
544
+ disabled: R,
545
+ onPick: () => Ze(e)
546
+ }, e);
547
+ })
548
+ })]
549
+ })
550
+ ]
551
+ });
552
+ }
553
+ function ce(t, n) {
554
+ let r = e, i = n[r(549)]("|"), [a, o] = T(() => n[r(494)]((e) => e[r(552)]("--") ? "" : e));
555
+ return C(() => {
556
+ let e = r, n = t[e(511)] ?? document[e(510)], a = getComputedStyle(n), s = i ? i[e(482)]("|")[e(494)]((t) => t[e(552)]("--") ? a[e(473)](t)[e(461)]() : t) : [];
557
+ o((t) => t.join("|") === s[e(549)]("|") ? t : s);
558
+ }, [t, i]), a;
559
+ }
560
+ function L({ value: t, defaultValue: n = ie, onValueChange: r, format: i, defaultFormat: a = e(535), onFormatChange: o, recentColors: c, defaultRecentColors: l = [], onRecentColorsChange: u, open: f, defaultOpen: m = !1, onOpenChange: h, size: g = "md", invalid: _, popoverWidth: te = 264, name: y, id: b, className: x, disabled: S, alpha: C, "aria-label": w = "색", "aria-labelledby": T, ...E }) {
561
+ let D = e, [A, j] = s(t, n, r), [M, N] = s(i, a, o), [P, F] = s(c, l, u), [I, ae] = s(f, m, h), oe = v(A), ce = oe ? p(oe, M, C) : A, L = M === D(535) ? ce[D(470)]() : ce;
562
+ return k(re, { children: [O(ee, {
563
+ open: I,
564
+ onOpenChange: (e) => !S && ae(e),
565
+ width: te,
566
+ "aria-label": w + D(537),
567
+ trigger: k(D(487), {
568
+ id: b,
569
+ type: D(487),
570
+ "aria-haspopup": D(476),
571
+ "aria-expanded": I,
572
+ "aria-label": T ? void 0 : w + ": " + L,
573
+ "aria-labelledby": T,
574
+ "aria-invalid": _ || void 0,
575
+ disabled: S,
576
+ className: d("ds-control", D(543), g !== "md" && "ds-color-field--" + g, x),
577
+ "data-open": I || void 0,
578
+ "data-invalid": _ || void 0,
579
+ "data-disabled": S || void 0,
580
+ children: [
581
+ O("span", {
582
+ className: D(519),
583
+ style: { "--_c": A }
584
+ }),
585
+ O(D(489), {
586
+ className: "ds-color-field__value",
587
+ children: L
588
+ }),
589
+ O(ne, { className: D(501) })
590
+ ]
591
+ }),
592
+ children: O(se, {
593
+ ...E,
594
+ value: A,
595
+ onValueChange: j,
596
+ alpha: C,
597
+ format: M,
598
+ onFormatChange: N,
599
+ recentColors: P,
600
+ onRecentColorsChange: F,
601
+ disabled: S,
602
+ "aria-label": w + D(537)
603
+ })
604
+ }), y && O(D(462), {
605
+ type: "hidden",
606
+ name: y,
607
+ value: A
608
+ })] });
609
+ }
610
+ export { S as CHART_COLOR_PRESETS, L as ColorField, se as ColorPicker };