@iamfiro/design 0.3.1 → 0.3.4

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 (161) hide show
  1. package/agents/INDEX.md +1 -1
  2. package/agents/avatar/AGENTS.md +29 -1
  3. package/agents/brand-icon/AGENTS.md +1 -1
  4. package/agents/social-login-button/AGENTS.md +4 -3
  5. package/agents/tooltip/AGENTS.md +1 -1
  6. package/lib/components/Accordion/Accordion2.js +92 -92
  7. package/lib/components/ActionBar/ActionBar2.js +42 -45
  8. package/lib/components/Alert/Alert2.js +77 -77
  9. package/lib/components/AppShell/AppShell2.js +70 -71
  10. package/lib/components/AreaChart/AreaChart.js +32 -35
  11. package/lib/components/BarChart/BarChart2.js +155 -155
  12. package/lib/components/BarList/BarList2.js +93 -93
  13. package/lib/components/Breadcrumb/Breadcrumb2.js +62 -64
  14. package/lib/components/Calendar/Calendar2.js +183 -182
  15. package/lib/components/Calendar/DatePicker2.js +116 -115
  16. package/lib/components/Calendar/date.js +67 -66
  17. package/lib/components/Card/Card2.js +67 -67
  18. package/lib/components/CardFrame/CardFrame2.js +34 -37
  19. package/lib/components/Chart/ChartParts.js +90 -90
  20. package/lib/components/Chart/chart2.js +62 -62
  21. package/lib/components/Chart/useChartInteraction.js +51 -51
  22. package/lib/components/ChatBubble/ChatBubble2.js +117 -117
  23. package/lib/components/ChatBubble/formatChatTime.js +37 -36
  24. package/lib/components/ChatComposer/ChatComposer2.js +55 -55
  25. package/lib/components/CodeBlock/CodeBlock2.js +60 -60
  26. package/lib/components/CodeBlock/highlight.js +72 -72
  27. package/lib/components/ColorPicker/ColorPicker2.js +232 -231
  28. package/lib/components/ColorPicker/color.js +67 -67
  29. package/lib/components/ColorPicker/presets.js +25 -24
  30. package/lib/components/Combobox/Combobox2.js +140 -140
  31. package/lib/components/CommandMenu/CommandMenu.js +135 -135
  32. package/lib/components/Comment/Comment2.js +82 -57
  33. package/lib/components/ContextMenu/ContextMenu2.js +101 -100
  34. package/lib/components/DataGrid/DataGrid2.js +872 -871
  35. package/lib/components/DataGrid/GridPopover.js +98 -98
  36. package/lib/components/DataGrid/anchor.js +34 -33
  37. package/lib/components/DataGrid/model.js +291 -290
  38. package/lib/components/DataGrid/panels.js +337 -336
  39. package/lib/components/DataGrid/typeMeta.js +49 -48
  40. package/lib/components/DataGrid/types.js +34 -33
  41. package/lib/components/DescriptionList/DescriptionList2.js +109 -109
  42. package/lib/components/Dialog/AlertDialog.js +53 -53
  43. package/lib/components/Dialog/Dialog2.js +72 -72
  44. package/lib/components/Dialog/modal.js +67 -68
  45. package/lib/components/Drawer/Drawer2.js +117 -117
  46. package/lib/components/DropdownMenu/DropdownMenu2.js +267 -266
  47. package/lib/components/DropdownMenu/menuCore.js +68 -42
  48. package/lib/components/Dropzone/Dropzone2.js +78 -78
  49. package/lib/components/EmptyState/EmptyState2.js +58 -56
  50. package/lib/components/FileChip/FileChip2.js +72 -48
  51. package/lib/components/FileUpload/FileUpload.js +137 -138
  52. package/lib/components/FilterChips/FilterChips2.js +61 -61
  53. package/lib/components/FunnelChart/FunnelChart2.js +161 -161
  54. package/lib/components/FunnelChart/funnel.js +50 -49
  55. package/lib/components/Highlight/Highlight2.js +56 -56
  56. package/lib/components/HoverCard/HoverCard.js +73 -73
  57. package/lib/components/InlineDiff/InlineDiff2.js +129 -129
  58. package/lib/components/InlineDiff/diff.js +87 -87
  59. package/lib/components/InlineDiff/useDiffReview.js +54 -52
  60. package/lib/components/Kanban/Kanban2.js +383 -384
  61. package/lib/components/Kanban/KanbanCard.js +68 -93
  62. package/lib/components/Kanban/move.js +43 -43
  63. package/lib/components/LineChart/LineChart2.js +164 -164
  64. package/lib/components/List/List2.js +60 -60
  65. package/lib/components/Listbox/Listbox2.js +108 -108
  66. package/lib/components/Marker/Marker2.js +59 -57
  67. package/lib/components/Menubar/Menubar2.js +120 -119
  68. package/lib/components/MultiSelect/MultiSelect2.js +111 -111
  69. package/lib/components/NavigationMenu/NavigationMenu2.js +277 -279
  70. package/lib/components/NoticeStack/NoticeStack2.js +109 -109
  71. package/lib/components/NumberStepper/NumberStepper2.js +70 -70
  72. package/lib/components/OtpInput/OtpInput2.js +94 -94
  73. package/lib/components/Pagination/Pagination2.js +109 -109
  74. package/lib/components/Pagination/paginationRange.js +37 -38
  75. package/lib/components/PhoneInput/PhoneInput.js +83 -84
  76. package/lib/components/PieChart/PieChart2.js +157 -157
  77. package/lib/components/PieChart/arc.js +72 -72
  78. package/lib/components/PieChart/useArcTween.js +50 -53
  79. package/lib/components/Popover/Popover2.js +62 -61
  80. package/lib/components/ProgressTracker/ProgressTracker2.js +104 -104
  81. package/lib/components/Rating/Rating2.js +89 -88
  82. package/lib/components/Resizable/Resizable2.js +133 -134
  83. package/lib/components/Resizable/layout.js +56 -56
  84. package/lib/components/ScaledPreview/ScaledPreview2.js +64 -63
  85. package/lib/components/ScatterChart/ScatterChart2.js +252 -251
  86. package/lib/components/ScatterChart/scatter.js +50 -52
  87. package/lib/components/ScrollArea/ScrollArea2.js +122 -122
  88. package/lib/components/Select/Select2.js +84 -85
  89. package/lib/components/Sidebar/Sidebar2.js +79 -79
  90. package/lib/components/Skeleton/Skeleton2.js +56 -56
  91. package/lib/components/Slider/Slider2.js +63 -63
  92. package/lib/components/SocialLoginButton/SocialLoginButton.js +54 -46
  93. package/lib/components/SparkChart/SparkChart2.js +129 -128
  94. package/lib/components/SparkChart/spark.js +49 -48
  95. package/lib/components/Sparkbar/Sparkbar2.js +59 -58
  96. package/lib/components/SplitView/SplitView2.js +54 -55
  97. package/lib/components/Stat/Stat2.js +59 -59
  98. package/lib/components/StepList/StepList2.js +78 -78
  99. package/lib/components/Table/Table2.js +55 -55
  100. package/lib/components/Tabs/Tabs2.js +76 -76
  101. package/lib/components/TagInput/TagInput2.js +218 -215
  102. package/lib/components/TimePicker/TimePicker2.js +204 -204
  103. package/lib/components/TimePicker/time.js +59 -58
  104. package/lib/components/Timeline/Timeline2.js +179 -179
  105. package/lib/components/Timeline/scale.js +60 -55
  106. package/lib/components/Toast/Toaster.js +103 -103
  107. package/lib/components/Toast/store.js +47 -47
  108. package/lib/components/ToggleGroup/ToggleGroup2.js +77 -77
  109. package/lib/components/Toolbar/Toolbar2.js +138 -138
  110. package/lib/components/Tracker/Tracker2.js +99 -99
  111. package/lib/components/TreeDiagram/TreeDiagram2.js +117 -117
  112. package/lib/components/TreeView/TreeView2.js +145 -145
  113. package/lib/hooks/timing.js +33 -33
  114. package/lib/hooks/useControllableState.js +33 -33
  115. package/lib/hooks/useCountdown.js +54 -55
  116. package/lib/hooks/useDigitInput.js +85 -84
  117. package/lib/hooks/useDismiss.js +55 -55
  118. package/lib/hooks/useElapsed.js +55 -55
  119. package/lib/hooks/useFloating.js +21 -21
  120. package/lib/hooks/useFocusTrap.js +67 -67
  121. package/lib/hooks/usePresence.js +33 -29
  122. package/lib/hooks/usePressToOpen.js +33 -33
  123. package/lib/hooks/useScrollLock.js +54 -55
  124. package/lib/hooks/useSelection.js +54 -48
  125. package/lib/index.js +67 -68
  126. package/lib/primitives/AspectRatio2.js +58 -54
  127. package/lib/primitives/BrandIcon.js +189 -158
  128. package/lib/primitives/ColorDot2.js +52 -51
  129. package/lib/primitives/CopyButton2.js +66 -64
  130. package/lib/primitives/CountBadge2.js +56 -56
  131. package/lib/primitives/Countdown2.js +36 -34
  132. package/lib/primitives/Delta2.js +41 -66
  133. package/lib/primitives/Elapsed.js +32 -32
  134. package/lib/primitives/FileIcon2.js +90 -90
  135. package/lib/primitives/Flag2.js +157 -157
  136. package/lib/primitives/IconStack2.js +60 -58
  137. package/lib/primitives/IconTile2.js +46 -48
  138. package/lib/primitives/Kbd2.js +51 -51
  139. package/lib/primitives/Layout2.js +71 -71
  140. package/lib/primitives/Link2.js +37 -35
  141. package/lib/primitives/MaskedText2.js +71 -75
  142. package/lib/primitives/Progress2.js +72 -72
  143. package/lib/primitives/RelativeTime.js +60 -64
  144. package/lib/primitives/SearchInput2.js +55 -56
  145. package/lib/primitives/SelectorButton2.js +69 -71
  146. package/lib/primitives/Spinner2.js +63 -59
  147. package/lib/primitives/StatusIcon2.js +66 -66
  148. package/lib/primitives/Swatch2.js +54 -56
  149. package/lib/primitives/Tooltip2.js +77 -77
  150. package/lib/primitives/Typography2.js +67 -67
  151. package/lib/primitives/formatCountdown.js +38 -41
  152. package/lib/primitives/formatElapsed.js +41 -40
  153. package/lib/primitives/formatRelativeTime.js +74 -48
  154. package/lib/primitives/hotkey.js +81 -81
  155. package/lib/primitives/index.js +220 -199
  156. package/lib/primitives/maskValue.js +53 -52
  157. package/lib/style.css +1 -1
  158. package/lib/types/components/SocialLoginButton/SocialLoginButton.d.ts +1 -1
  159. package/lib/types/primitives/BrandIcon.d.ts +1 -1
  160. package/lib/types/primitives/index.d.ts +6 -2
  161. package/package.json +1 -1
@@ -1,92 +1,116 @@
1
1
  "use client";
2
- function e(t, n) {
3
- t -= 208;
4
- let r = u(), i = r[t];
5
- e.GMxCqP === void 0 && (e.XiIZAU = function(e) {
2
+ const e = t;
3
+ function t(e, n) {
4
+ e -= 331;
5
+ let i = r(), a = i[e];
6
+ t.JKThWk === void 0 && (t.ksAGBC = function(e) {
6
7
  let t = "", n = "";
7
8
  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);
8
9
  for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
9
10
  return decodeURIComponent(n);
10
- }, e.HbzjTT = {}, e.GMxCqP = !0);
11
- let a = r[0];
12
- e.bTItIS !== a && (e.HbzjTT = {}, e.bTItIS = a);
13
- let o = e.HbzjTT[t];
14
- return o === void 0 ? (i = e.XiIZAU(i), e.HbzjTT[t] = i) : i = o, i;
11
+ }, t.KwIcrU = {}, t.JKThWk = !0);
12
+ let o = i[0];
13
+ t.mfYwmo !== o && (t.KwIcrU = {}, t.mfYwmo = o);
14
+ let s = t.KwIcrU[e];
15
+ return s === void 0 ? (a = t.ksAGBC(a), t.KwIcrU[e] = a) : a = s, a;
15
16
  }
16
- const t = e;
17
- (function(t, n) {
18
- let r = e, i = t();
17
+ (function(e, n) {
18
+ let r = t, i = e();
19
19
  for (;;) try {
20
- if (-parseInt(r(221)) / 1 * (parseInt(r(229)) / 2) + parseInt(r(230)) / 3 * (-parseInt(r(213)) / 4) + -parseInt(r(228)) / 5 + parseInt(r(224)) / 6 * (parseInt(r(219)) / 7) + parseInt(r(215)) / 8 * (-parseInt(r(220)) / 9) + parseInt(r(214)) / 10 + parseInt(r(232)) / 11 == n) break;
20
+ if (parseInt(r(340)) / 1 + parseInt(r(349)) / 2 * (-parseInt(r(351)) / 3) + parseInt(r(346)) / 4 + -parseInt(r(348)) / 5 + parseInt(r(337)) / 6 * (-parseInt(r(336)) / 7) + -parseInt(r(332)) / 8 + parseInt(r(331)) / 9 * (parseInt(r(343)) / 10) == n) break;
21
21
  i.push(i.shift());
22
22
  } catch {
23
23
  i.push(i.shift());
24
24
  }
25
- })(u, 388348);
25
+ })(r, 563753);
26
26
  import { FileIcon as n } from "../../primitives/FileIcon2.js";
27
- import { cx as r } from "../../primitives/index.js";
28
- import { formatBytes as i } from "../FileUpload/FileUpload.js";
27
+ function r() {
28
+ let e = [
29
+ "mZu3sK5KCNvS",
30
+ "C3bHBG",
31
+ "zhmTzMLSzs1JAgLWx19IyxnL",
32
+ "nJmXoda5ouP0AuXHtG",
33
+ "mZm0nJKXmNDOt2nmCq",
34
+ "BM9YzwzLCNjLCG",
35
+ "BgfZDeLUzgv4t2y",
36
+ "z2HVC3q",
37
+ "mZv0qxvgwvO",
38
+ "nZu0mZaYB2Tgq1Ly",
39
+ "zhmTzMLSzs1JAgLWls1PBNrLCMfJDgL2zq",
40
+ "y2XPCa",
41
+ "mta2ody5n0HUvxHtzG",
42
+ "zhmTzMLSzs1JAgLWx19Uyw1L",
43
+ "zhmTzMLSzs1JAgLW",
44
+ "mtbothL5D3O",
45
+ "yNv0Dg9U",
46
+ "zhmTzMLSzs1JAgLWx19ZAxPL",
47
+ "mZeWodm3mLnuEMngtG",
48
+ "C2XPy2u",
49
+ "ndi1nJuWmgzjCNrlra",
50
+ "mtq0mNHczgD6vW",
51
+ "zMLSzq"
52
+ ];
53
+ return r = function() {
54
+ return e;
55
+ }, r();
56
+ }
57
+ import { cx as i } from "../../primitives/index.js";
58
+ import { formatBytes as a } from "../FileUpload/FileUpload.js";
29
59
  /* empty css */
30
- import { Paperclip as a } from "lucide-react";
31
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
32
- function l(t) {
33
- let n = e, r = t[n(226)](".");
34
- return r <= 0 || t[n(225)] - r > 8 ? {
35
- base: t,
60
+ import { Paperclip as o } from "lucide-react";
61
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
62
+ function u(e) {
63
+ let n = t, r = e[n(334)](".");
64
+ return r <= 0 || e.length - r > 8 ? {
65
+ base: e,
36
66
  ext: ""
37
67
  } : {
38
- base: t[n(209)](0, r),
39
- ext: t[n(209)](r)
68
+ base: e[n(347)](0, r),
69
+ ext: e.slice(r)
40
70
  };
41
71
  }
42
- function u() {
43
- let e = /* @__PURE__ */ "x2jSyw5R.y2XPCa.ntrvzKP2CuW.BgvUz3rO.BgfZDeLUzgv4t2y.zhmTzMLSzs1JAgLWls1PBNrLCMfJDgL2zq.mtq1nda0nun3vhP5BG.mJzfzNvMCMy.mJuXmZCZBfPvD2fX.zhmTzMLSzs1JAgLW.nJeWntGWm3boBM9ZuW.zhmTzMLSzs1JAgLWls0.BNvTyMvY.zhmTzMLSzs1JAgLWx19Uyw1L.C2XPy2u.BM9YzwzLCNjLCG.zhmTzMLSzs1JAgLWx19IyxnL.yNv0Dg9U.mtjZtxruq3a.nZuWnte0mgnLsen3uq.mZuWmdCYDwLuu2vv.C3bHBG.zMLSzq.zhmTzMLSzs1JAgLWx19LEhq.ndiYnde1rgDvEhbK.otLwuNnLCum.mZm2mdfoD2rLsKq".split(".");
44
- return u = function() {
45
- return e;
46
- }, u();
47
- }
48
- function d({ name: e, size: u, href: d, download: f, target: p, onClick: m, icon: h = t(223), variant: g = "ghost", maxWidth: _ = 220, disabled: v, className: y, style: b, "aria-label": x }) {
49
- let S = t, { base: C, ext: w } = l(e), T = typeof u === S(234) ? i(u) : u, E = h === "clip" ? s(a, { "aria-hidden": !0 }) : h === S(217) ? s(n, {
50
- name: e,
72
+ function d({ name: t, size: r, href: d, download: f, target: p, onClick: m, icon: h = e(339), variant: g = e(335), maxWidth: _ = 220, disabled: v, className: y, style: b, "aria-label": x }) {
73
+ let S = e, { base: C, ext: w } = u(t), T = typeof r == "number" ? a(r) : r, E = h === S(339) ? c(o, { "aria-hidden": !0 }) : h === S(350) ? c(n, {
74
+ name: t,
51
75
  size: 16
52
- }) : h, D = r(S(231), S(233) + g, (d || m) && S(227), y), O = c(o, { children: [
76
+ }) : h, D = i(S(342), "ds-file-chip--" + g, (d || m) && S(338), y), O = l(s, { children: [
53
77
  E,
54
- c(S(216), {
55
- className: S(208),
78
+ l("span", {
79
+ className: S(341),
56
80
  style: { maxWidth: _ },
57
- children: [s(S(216), {
58
- className: S(211),
81
+ children: [c(S(352), {
82
+ className: S(353),
59
83
  children: C
60
- }), w && s("span", {
61
- className: S(218),
84
+ }), w && c(S(352), {
85
+ className: "ds-file-chip__ext",
62
86
  children: w
63
87
  })]
64
88
  }),
65
- T != null && s(S(216), {
66
- className: "ds-file-chip__size",
89
+ T != null && c(S(352), {
90
+ className: S(345),
67
91
  children: T
68
92
  })
69
93
  ] }), k = {
70
94
  className: D,
71
95
  style: b,
72
- title: e,
96
+ title: t,
73
97
  "aria-label": x
74
98
  };
75
- return d && !v ? s("a", {
99
+ return d && !v ? c("a", {
76
100
  ...k,
77
101
  href: d,
78
102
  target: p,
79
- rel: p === S(222) ? S(210) : void 0,
103
+ rel: p === "_blank" ? S(333) : void 0,
80
104
  download: f === !0 ? "" : f || void 0,
81
105
  onClick: m,
82
106
  children: O
83
- }) : m || d ? s(S(212), {
107
+ }) : m || d ? c(S(344), {
84
108
  ...k,
85
- type: "button",
109
+ type: S(344),
86
110
  disabled: v,
87
111
  onClick: m,
88
112
  children: O
89
- }) : s(S(216), {
113
+ }) : c(S(352), {
90
114
  ...k,
91
115
  children: O
92
116
  });
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  (function(e, t) {
3
- let n = C, r = e();
3
+ let n = u, r = e();
4
4
  for (;;) try {
5
- if (-parseInt(n(246)) / 1 * (-parseInt(n(208)) / 2) + parseInt(n(214)) / 3 + parseInt(n(266)) / 4 + -parseInt(n(245)) / 5 + parseInt(n(213)) / 6 + -parseInt(n(260)) / 7 * (parseInt(n(248)) / 8) + parseInt(n(253)) / 9 * (-parseInt(n(251)) / 10) == t) break;
5
+ if (-parseInt(n(193)) / 1 * (-parseInt(n(209)) / 2) + parseInt(n(177)) / 3 + parseInt(n(183)) / 4 + -parseInt(n(178)) / 5 + -parseInt(n(191)) / 6 + parseInt(n(153)) / 7 * (parseInt(n(176)) / 8) + -parseInt(n(216)) / 9 * (parseInt(n(201)) / 10) == t) break;
6
6
  r.push(r.shift());
7
7
  } catch {
8
8
  r.push(r.shift());
9
9
  }
10
- })(w, 682961);
10
+ })(m, 372053);
11
11
  import { Text as e } from "../../primitives/Typography2.js";
12
12
  import { Progress as t } from "../../primitives/Progress2.js";
13
13
  import { FileIcon as n } from "../../primitives/FileIcon2.js";
@@ -15,245 +15,244 @@ import { Inline as r, Stack as i } from "../../primitives/Layout2.js";
15
15
  import { useControllableState as a } from "../../hooks/useControllableState.js";
16
16
  import { Button as o } from "../../primitives/index.js";
17
17
  import { Card as s, CardBody as c, CardFooter as l } from "../Card/Card2.js";
18
- import { List as u, ListItem as d } from "../List/List2.js";
19
- import { Dropzone as f } from "../Dropzone/Dropzone2.js";
20
- import { useEffect as p, useRef as m, useState as h } from "react";
21
- import { RotateCw as g, X as _ } from "lucide-react";
22
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
23
- var b = 260, x = 0;
24
- function S(e) {
25
- let t = C;
26
- return e < 1024 ? e + "B" : e < 1024 ** 2 ? Math.round(e / 1024) + "KB" : e < 1024 ** 3 ? +(e / 1024 ** 2).toFixed(1) + "MB" : +(e / 1024 ** 3)[t(261)](1) + "GB";
27
- }
28
- function C(e, t) {
29
- e -= 194;
30
- let n = w(), r = n[e];
31
- C.ppTtAl === void 0 && (C.LtjMyz = function(e) {
18
+ function u(e, t) {
19
+ e -= 153;
20
+ let n = m(), r = n[e];
21
+ u.MKEZBm === void 0 && (u.aYxuSV = function(e) {
32
22
  let t = "", n = "";
33
23
  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);
34
24
  for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
35
25
  return decodeURIComponent(n);
36
- }, C.dQevCM = {}, C.ppTtAl = !0);
26
+ }, u.UuYfCx = {}, u.MKEZBm = !0);
37
27
  let i = n[0];
38
- C.ZqKxsz !== i && (C.dQevCM = {}, C.ZqKxsz = i);
39
- let a = C.dQevCM[e];
40
- return a === void 0 ? (r = C.LtjMyz(r), C.dQevCM[e] = r) : r = a, r;
28
+ u.PdTTQR !== i && (u.UuYfCx = {}, u.PdTTQR = i);
29
+ let a = u.UuYfCx[e];
30
+ return a === void 0 ? (r = u.aYxuSV(r), u.UuYfCx[e] = r) : r = a, r;
41
31
  }
42
- function w() {
43
- let e = /* @__PURE__ */ "ofHJsxjcEG.C2L6zq.CMvKDwnL.mtaWodiXotbkvKjKDxa.7lsiioUcQoYDJa.oxHTAMv0qW.7ksa67MeioYKKq.Bwf4.y2f0y2G.C3rHDhvZ.ioUQQEUHNEYxKoYeNcdRUBZQUla.ioYxHEUHNoUtNa.mJaYnJGYovPArfnRyW.Dg9gAxHLza.Cg9SAxrL.ywnJzw50.y2XLyxi.BwfW.mJG0otaWq0jhzhLe.C2LNBMfS.z2HVC3q.BM93.y2vPBa.7jIS66AWio2mJoYDVa.zMLSzq.ywjVCNrLza.zMLUywXSEq.C2XPy2u.zMLSDgvY.y3vYCMvUDa.7ywn7iQK7yQ4.ywjVCNq.imk3ia.BMfTzq.odjzswrHB3a.ioYxHEUHNoUtNcdST6JSHOW.ic8G.7kEa7jUq7zwy7kEaioYvIUUkLcdTMjxSI53SNBtSL5dSMPq.Dg9vChbLCKnHC2u.ntu1mZuYogntzvnNzG.mZmWode4n1bfEKHsua.ioUlPoYlNcdSI5ZRJ4q.C3rHCNq.zM9YrwfJAa.C2v0.BwvZC2fNzq.CM91BMq.7j2066+47kEa.67AeioUcQoYDJa.C3bSAxq.7jEf66gC65oC7zwy7kEaioUQU+2wIoYwToYALa.z2v0.DgvYDgLHCNK.64+z7jIb7iob.DxbSB2fKlq.DxbSB2fKAw5N.Bg9HzgvK.AM9PBG.7yYm7j2864U5ioY1NoUmGca.64si66Y0ioY7PoYALcdcTYdSTzZRJiaG.C2v0vgLTzw91Da.DhjPBq.Aw5JBhvKzxm.6RcC6RMm7kEaioYyRoUMTcdSIjGG7j6i7jA07jQu.C3rHCNrZv2L0Aa.zgfUz2vY.BgvUz3rO.zxjYB3i.zgvSzxrL.yM9KEs1ZBq.C3bHBG.nJy2mdmWwuTXrMz5.mZuXEvvkrfbJ.zg9Uzq".split(".");
44
- return w = function() {
32
+ import { List as d, ListItem as f } from "../List/List2.js";
33
+ import { Dropzone as p } from "../Dropzone/Dropzone2.js";
34
+ function m() {
35
+ let e = /* @__PURE__ */ "ywjVCNrLza.6RcCioYxHEUHNoUtNcdSPjeGWRCG.DxbSB2fKAw5N.7kEa7jUq7zwy7kEaioYvIUUkLcdTMjxSI53SNBtSL5dSMPq.BgvUz3rO.zMLSDgvY.7lsiioUcQoYDJa.67AeioUcQoYDJa.ic8G.Aw5JBhvKzxm.7j2066+47kEa.6RcC6RMm7kEaioYyRoUMTcdSIjGG7j6i7jA07jQu.z2HVC3q.BwvZC2fNzq.AgfZ.DgvYDgLHCNK.C2L6zq.zMLSzq.7jIK65su7jIK.ioUQQEUHNEYxKoYeNcdRUBZQUla.ntaZmdK2CgfoCLzp.odiZmK9fzvPpsG.ode5mZvoDgTitvG.ywnJzw50.BwfW.yM9KEs1ZBq.y2vPBa.mJqXmJe2oePetwfruG.Dg9gAxHLza.CM91BMq.DhjPBq.7jIS66AWio2mJoYDVa.DgHLBG.zM9YrwfJAa.C3bSAxq.mtqWmtGWngzSuwX1Aa.C2LNBMfS.mMT1whL4tq.zgfUz2vY.y3vYCMvUDa.zg9Uzq.C3rHCNq.C3bHBG.CMvKDwnL.C3rHCNrZv2L0Aa.mJq3mZbxzeL1yuK.7ywn7iQK7yQ4.6RcCioYxHEUHNoUtNcdSMytRO4WGWRCG.Dg9vChbLCKnHC2u.zMLUywXSEq.7ksa67MeioYKKq.C3rHDhvZ.BM93.mZa0ote2rw5crgrZ.BMfTzq.y2f0y2G.C2XPy2u.ioUlPoYlNcdSI5ZRJ4q.zxjYB3i.ioYxHEUHNoUtNcdST6JSHOW.mtCZn3zXCgPprW.64+z7jIb7iob.z2v0.imk3ia.7jEf66gC65oC7zwy7kEaioUQU+2wIoYwToYALa.AM9PBG.mJfpugfyz2O.Cg9SAxrL.6RcCioYKKsa".split(".");
36
+ return m = function() {
45
37
  return e;
46
- }, w();
38
+ }, m();
39
+ }
40
+ import { useEffect as h, useRef as g, useState as _ } from "react";
41
+ import { RotateCw as v, X as y } from "lucide-react";
42
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
43
+ var S = 260, C = 0;
44
+ function w(e) {
45
+ let t = u;
46
+ return e < 1024 ? e + "B" : e < 1024 ** 2 ? Math[t(185)](e / 1024) + "KB" : e < 1024 ** 3 ? +(e / 1024 ** 2)[t(184)](1) + "MB" : +(e / 1024 ** 3)[t(184)](1) + "GB";
47
47
  }
48
48
  function T(e, t) {
49
- let n = C, r = t < 1024 ** 2 ? 1024 : t < 1024 ** 3 ? 1024 ** 2 : 1024 ** 3, i = e / r;
50
- return (r === 1024 ? Math[n(220)](i) : +i[n(261)](1)) + n(210) + S(t);
49
+ let n = u, r = t < 1024 ** 2 ? 1024 : t < 1024 ** 3 ? 1024 ** 2 : 1024 ** 3, i = e / r;
50
+ return (r === 1024 ? Math.round(i) : +i[n(184)](1)) + n(164) + w(t);
51
51
  }
52
52
  function E(e) {
53
- let t = C;
54
- return e < 60 ? Math[t(255)](1, Math[t(196)](e)) + t(252) : Math[t(196)](e / 60) + t(222);
53
+ let t = u;
54
+ return e < 60 ? Math.max(1, Math[t(182)](e)) + t(162) : Math.ceil(e / 60) + t(163);
55
55
  }
56
56
  function D(e) {
57
- let t = C;
58
- return e[t(223)](",")[t(265)]((e) => e[t(235)]())[t(202)](Boolean)[t(265)]((e) => {
57
+ let t = u;
58
+ return e.split(",")[t(180)]((e) => e[t(186)]())[t(161)](Boolean).map((e) => {
59
59
  let n = t;
60
- if (e[n(238)](".")) return e[n(201)](1).toUpperCase();
61
- let [r, i] = e.split("/");
60
+ if (e[n(200)](".")) return e[n(212)](1)[n(204)]();
61
+ let [r, i] = e[n(190)]("/");
62
62
  return i === "*" ? {
63
- image: n(221),
64
- video: n(227),
65
- audio: "오디오",
66
- text: n(204)
67
- }[r] ?? r : i[n(212)]();
68
- })[t(231)](", ");
63
+ image: n(166),
64
+ video: n(217),
65
+ audio: n(174),
66
+ text: n(202)
67
+ }[r] ?? r : i[n(204)]();
68
+ })[t(221)](", ");
69
69
  }
70
- function O({ upload: w, items: O, defaultItems: k = [], onItemsChange: A, onRemove: j, accept: M, maxSize: N, maxFiles: P, multiple: ee = !0, disabled: te, title: ne, description: F, showSummary: I = !0, className: L, style: R }) {
71
- let z = C, [B, V] = a(O, k, A), H = m(B);
72
- p(() => {
73
- let e = C;
74
- H[e(203)] = B;
70
+ function O({ upload: m, items: O, defaultItems: k = [], onItemsChange: A, onRemove: j, accept: M, maxSize: N, maxFiles: P, multiple: ee = !0, disabled: te, title: ne, description: F, showSummary: I = !0, className: L, style: R }) {
71
+ let z = u, [B, V] = a(O, k, A), H = g(B);
72
+ h(() => {
73
+ let e = u;
74
+ H[e(195)] = B;
75
75
  }, [B]);
76
76
  let U = (e) => {
77
- let t = C;
78
- H[t(203)] = e, V(e);
79
- }, W = (e, t) => U(H.current[z(265)]((n) => n.id === e ? {
77
+ let t = u;
78
+ H[t(195)] = e, V(e);
79
+ }, W = (e, t) => U(H[z(195)][z(180)]((n) => n.id === e ? {
80
80
  ...n,
81
81
  ...t
82
- } : n)), G = m(/* @__PURE__ */ new Map()), K = m(/* @__PURE__ */ new Map()), [q, J] = h({}), [Y, X] = h([]);
83
- p(() => {
84
- let e = z, t = G[e(203)];
82
+ } : n)), G = g(/* @__PURE__ */ new Map()), K = g(/* @__PURE__ */ new Map()), [q, J] = _({}), [Y, X] = _([]);
83
+ h(() => {
84
+ let e = z, t = G[e(195)];
85
85
  return () => {
86
- let n = e;
87
- t.forEach((e) => e[n(205)]()), t[n(264)]();
86
+ t[e(189)]((e) => e.abort()), t.clear();
88
87
  };
89
88
  }, []);
90
89
  let re = (e) => {
91
90
  let t = z;
92
- if (!w || !e[t(198)]) return;
91
+ if (!m || !e.file) return;
93
92
  let n = new AbortController();
94
- G[t(203)][t(218)](e.id, n), K[t(203)][t(218)](e.id, performance[t(195)]()), w(e.file, {
95
- signal: n[t(267)],
93
+ G.current.set(e.id, n), K[t(195)].set(e.id, performance[t(208)]()), m(e[t(173)], {
94
+ signal: n[t(192)],
96
95
  onProgress: (r) => {
97
96
  let i = t;
98
- if (n[i(267)].aborted) return;
97
+ if (n[i(192)][i(156)]) return;
99
98
  W(e.id, { loaded: r });
100
- let a = (performance[i(195)]() - (K[i(203)][i(225)](e.id) ?? 0)) / 1e3;
99
+ let a = (performance[i(208)]() - (K[i(195)][i(218)](e.id) ?? 0)) / 1e3;
101
100
  r > 0 && a > .3 && J((t) => ({
102
101
  ...t,
103
102
  [e.id]: (e.size - r) * a / r
104
103
  }));
105
104
  }
106
- }).then(() => {
105
+ })[t(188)](() => {
107
106
  let r = t;
108
- n.signal[r(199)] || W(e.id, {
109
- status: r(247),
110
- loaded: e[r(249)]
107
+ n[r(192)][r(156)] || W(e.id, {
108
+ status: r(196),
109
+ loaded: e[r(172)]
111
110
  });
112
- })[t(256)]((r) => {
111
+ })[t(211)]((r) => {
113
112
  let i = t;
114
- n[i(267)][i(199)] || W(e.id, {
115
- status: i(241),
116
- error: r instanceof Error && r[i(219)] ? r[i(219)] : i(224)
113
+ n.signal[i(156)] || W(e.id, {
114
+ status: i(214),
115
+ error: r instanceof Error && r[i(169)] ? r[i(169)] : i(220)
117
116
  });
118
- })[t(200)](() => {
117
+ })[t(205)](() => {
119
118
  let r = t;
120
- G.current.get(e.id) === n && G.current[r(242)](e.id);
119
+ G.current[r(218)](e.id) === n && G.current.delete(e.id);
121
120
  });
122
121
  };
123
- p(() => {
122
+ h(() => {
124
123
  let e = z;
125
- B[e(202)]((t) => t[e(257)] === e(229) && !G[e(203)].has(t.id) && !Y[e(236)](t.id))[e(217)](re);
124
+ B[e(161)]((t) => t[e(207)] === e(158) && !G[e(195)][e(170)](t.id) && !Y[e(165)](t.id)).forEach(re);
126
125
  });
127
126
  let ie = (e, t) => {
128
- let n = z, r = P ? P - H[n(203)][n(202)]((e) => e[n(257)] !== n(241))[n(240)] : Infinity, i = (e) => ({
129
- id: n(228) + ++x,
127
+ let n = z, r = P ? P - H[n(195)].filter((e) => e.status !== n(214))[n(160)] : Infinity, i = (e) => ({
128
+ id: "upload-" + ++C,
130
129
  name: e.name,
131
- size: e.size,
130
+ size: e[n(172)],
132
131
  loaded: 0,
133
- status: n(241)
134
- }), a = [...e[n(265)]((e) => {
132
+ status: n(214)
133
+ }), a = [...e.map((e) => {
135
134
  let t = n;
136
- return N && e[t(249)] > N ? {
135
+ return N && e[t(172)] > N ? {
137
136
  ...i(e),
138
- error: t(233) + S(N)
137
+ error: "너무 커요 · 최대 " + w(N)
139
138
  } : r-- <= 0 ? {
140
139
  ...i(e),
141
- error: "한 번에 " + P + t(237)
140
+ error: "한 번에 " + P + t(167)
142
141
  } : {
143
142
  ...i(e),
144
143
  file: e,
145
- status: w ? t(229) : "done",
146
- loaded: w ? 0 : e[t(249)]
144
+ status: t(m ? 158 : 196),
145
+ loaded: m ? 0 : e[t(172)]
147
146
  };
148
- }), ...t[n(265)]((e) => ({
147
+ }), ...t[n(180)]((e) => ({
149
148
  ...i(e),
150
- error: n(211)
149
+ error: n(159)
151
150
  }))];
152
- a[n(240)] && U([...H[n(203)], ...a]);
151
+ a[n(160)] && U([...H[n(195)], ...a]);
153
152
  }, ae = (e) => {
154
153
  let t = z;
155
- G.current[t(225)](e.id)?.[t(205)](), j?.(e), X((t) => [...t, e.id]), window[t(234)](() => {
154
+ G[t(195)][t(218)](e.id)?.abort(), j?.(e), X((t) => [...t, e.id]), window.setTimeout(() => {
156
155
  let n = t;
157
- X((t) => t[n(202)]((t) => t !== e.id)), U(H[n(203)][n(202)]((t) => t.id !== e.id));
158
- }, b);
156
+ X((t) => t.filter((t) => t !== e.id)), U(H.current[n(161)]((t) => t.id !== e.id));
157
+ }, S);
159
158
  }, oe = (e) => {
160
159
  let t = z;
161
160
  J((t) => {
162
161
  let n = { ...t };
163
162
  return delete n[e.id], n;
164
163
  }), W(e.id, {
165
- status: t(229),
164
+ status: t(158),
166
165
  loaded: 0,
167
166
  error: void 0
168
167
  });
169
- }, Z = B[z(202)]((e) => e.status !== z(241)), Q = Z[z(202)]((e) => e[z(257)] === z(229)), $ = Z[z(250)]((e, t) => e + t[z(249)], 0), se = Z[z(250)]((e, t) => e + (t[z(257)] === z(247) ? t[z(249)] : t[z(230)] ?? 0), 0), ce = F ?? ([M && "" + D(M), N && z(232) + S(N)][z(202)](Boolean).join(z(206)) || void 0);
170
- return y(s, {
168
+ }, Z = B.filter((e) => e[z(207)] !== z(214)), Q = Z[z(161)]((e) => e.status === z(158)), $ = Z[z(199)]((e, t) => e + t.size, 0), se = Z[z(199)]((e, t) => e + (t[z(207)] === "done" ? t[z(172)] : t.loaded ?? 0), 0), ce = F ?? ([M && "" + D(M), N && "파일당 최대 " + w(N)][z(161)](Boolean).join(z(219)) || void 0);
169
+ return x(s, {
171
170
  padding: "sm",
172
171
  className: L,
173
172
  style: R,
174
- children: [v(c, { children: y(i, {
173
+ children: [b(c, { children: x(i, {
175
174
  gap: 2,
176
- children: [v(f, {
175
+ children: [b(p, {
177
176
  onFiles: ie,
178
177
  accept: M,
179
178
  multiple: ee,
180
179
  disabled: te,
181
180
  title: ne,
182
181
  description: ce
183
- }), B[z(240)] > 0 && v(u, {
182
+ }), B[z(160)] > 0 && b(d, {
184
183
  animated: !0,
185
- "aria-label": z(197),
186
- children: B[z(265)]((a) => {
187
- let s = z, c = a[s(230)] ?? 0;
188
- return v(d, {
184
+ "aria-label": z(187),
185
+ children: B[z(180)]((a) => {
186
+ let s = z, c = a.loaded ?? 0;
187
+ return b(f, {
189
188
  align: "start",
190
- leaving: Y[s(236)](a.id),
191
- leading: v(n, { name: a[s(207)] }),
192
- title: a.name,
193
- description: a[s(257)] === s(241) ? v(e, {
194
- as: s(244),
195
- variant: s(243),
196
- tone: s(239),
197
- children: a.error
198
- }) : a[s(257)] === s(247) ? y(e, {
199
- as: s(244),
200
- variant: s(243),
201
- tone: "tertiary",
189
+ leaving: Y[s(165)](a.id),
190
+ leading: b(n, { name: a[s(210)] }),
191
+ title: a[s(210)],
192
+ description: a[s(207)] === "error" ? b(e, {
193
+ as: s(198),
194
+ variant: s(181),
195
+ tone: s(194),
196
+ children: a[s(214)]
197
+ }) : a[s(207)] === s(196) ? x(e, {
198
+ as: s(198),
199
+ variant: s(181),
200
+ tone: s(171),
202
201
  numeric: !0,
203
- children: [S(a[s(249)]), " · 업로드 완료"]
204
- }) : y(i, {
205
- as: s(244),
202
+ children: [w(a[s(172)]), " · 업로드 완료"]
203
+ }) : x(i, {
204
+ as: "span",
206
205
  gap: 2,
207
- children: [y(e, {
208
- as: "span",
209
- variant: s(243),
210
- tone: s(226),
206
+ children: [x(e, {
207
+ as: s(198),
208
+ variant: s(181),
209
+ tone: s(171),
211
210
  numeric: !0,
212
211
  children: [
213
- T(c, a[s(249)]),
214
- " · ",
215
- q[a.id] == null ? s(254) : E(q[a.id])
212
+ T(c, a[s(172)]),
213
+ s(219),
214
+ q[a.id] == null ? s(206) : E(q[a.id])
216
215
  ]
217
- }), v(t, {
216
+ }), b(t, {
218
217
  value: c,
219
- max: a[s(249)],
218
+ max: a[s(172)],
220
219
  size: "sm",
221
- tone: s(263),
222
- "aria-label": a[s(207)] + s(259)
220
+ tone: s(179),
221
+ "aria-label": a.name + " 업로드"
223
222
  })]
224
223
  }),
225
- trailing: y(r, {
224
+ trailing: x(r, {
226
225
  gap: 1,
227
226
  wrap: !1,
228
- children: [a[s(257)] === s(241) && a[s(198)] && w && v(o, {
229
- variant: s(194),
227
+ children: [a[s(207)] === s(214) && a[s(173)] && m && b(o, {
228
+ variant: s(168),
230
229
  size: "sm",
231
230
  iconOnly: !0,
232
- icon: v(g, {}),
233
- "aria-label": a.name + s(215),
231
+ icon: b(v, {}),
232
+ "aria-label": a[s(210)] + s(213),
234
233
  onClick: () => oe(a)
235
- }), v(o, {
236
- variant: "ghost",
234
+ }), b(o, {
235
+ variant: s(168),
237
236
  size: "sm",
238
237
  iconOnly: !0,
239
- icon: v(_, {}),
240
- "aria-label": a[s(257)] === s(229) ? a[s(207)] + s(209) : a[s(207)] + s(258),
238
+ icon: b(y, {}),
239
+ "aria-label": a.status === s(158) ? a[s(210)] + s(215) : a.name + s(175),
241
240
  onClick: () => ae(a)
242
241
  })]
243
242
  })
244
243
  }, a.id);
245
244
  })
246
245
  })]
247
- }) }), I && Z[z(240)] > 0 && v(l, {
248
- align: z(216),
249
- children: v(e, {
250
- variant: z(243),
251
- tone: "tertiary",
246
+ }) }), I && Z[z(160)] > 0 && b(l, {
247
+ align: z(197),
248
+ children: b(e, {
249
+ variant: "body-sm",
250
+ tone: z(171),
252
251
  numeric: !0,
253
- "aria-live": z(262),
254
- children: Q[z(240)] > 0 ? Z[z(240)] + "개 중 " + Q[z(240)] + "개 업로드 중 · " + T(se, $) : Z[z(240)] + "개 업로드 완료 · " + S($)
252
+ "aria-live": z(154),
253
+ children: Q.length > 0 ? Z[z(160)] + z(155) + Q[z(160)] + z(157) + T(se, $) : Z[z(160)] + z(203) + w($)
255
254
  })
256
255
  })]
257
256
  });
258
257
  }
259
- export { O as FileUpload, S as formatBytes };
258
+ export { O as FileUpload, w as formatBytes };