@solibo/solibo-ui 2.2.13 → 2.2.14

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 (180) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index10.css +1 -1
  3. package/dist/assets/index11.css +1 -1
  4. package/dist/assets/index12.css +1 -1
  5. package/dist/assets/index13.css +1 -1
  6. package/dist/assets/index14.css +1 -1
  7. package/dist/assets/index15.css +1 -1
  8. package/dist/assets/index16.css +1 -1
  9. package/dist/assets/index17.css +1 -1
  10. package/dist/assets/index18.css +1 -1
  11. package/dist/assets/index19.css +1 -1
  12. package/dist/assets/index20.css +1 -1
  13. package/dist/assets/index21.css +1 -1
  14. package/dist/assets/index22.css +1 -1
  15. package/dist/assets/index23.css +1 -1
  16. package/dist/assets/index24.css +1 -1
  17. package/dist/assets/index25.css +1 -1
  18. package/dist/assets/index26.css +1 -1
  19. package/dist/assets/index27.css +1 -1
  20. package/dist/assets/index28.css +1 -1
  21. package/dist/assets/index29.css +1 -1
  22. package/dist/assets/index3.css +1 -1
  23. package/dist/assets/index30.css +1 -1
  24. package/dist/assets/index31.css +1 -1
  25. package/dist/assets/index32.css +1 -1
  26. package/dist/assets/index33.css +1 -1
  27. package/dist/assets/index34.css +1 -1
  28. package/dist/assets/index35.css +1 -1
  29. package/dist/assets/index36.css +1 -1
  30. package/dist/assets/index37.css +1 -1
  31. package/dist/assets/index38.css +1 -1
  32. package/dist/assets/index39.css +1 -1
  33. package/dist/assets/index40.css +1 -1
  34. package/dist/assets/index41.css +1 -1
  35. package/dist/assets/index42.css +1 -1
  36. package/dist/assets/index43.css +1 -1
  37. package/dist/assets/index44.css +1 -1
  38. package/dist/assets/index45.css +1 -1
  39. package/dist/assets/index46.css +1 -1
  40. package/dist/assets/index47.css +1 -1
  41. package/dist/assets/index48.css +1 -1
  42. package/dist/assets/index49.css +1 -1
  43. package/dist/assets/index50.css +1 -1
  44. package/dist/assets/index51.css +1 -1
  45. package/dist/assets/index52.css +1 -1
  46. package/dist/assets/index53.css +1 -1
  47. package/dist/assets/index54.css +1 -1
  48. package/dist/assets/index55.css +1 -1
  49. package/dist/assets/index56.css +1 -1
  50. package/dist/assets/index57.css +1 -1
  51. package/dist/assets/index58.css +1 -1
  52. package/dist/assets/index59.css +1 -0
  53. package/dist/assets/index6.css +1 -1
  54. package/dist/assets/index60.css +1 -0
  55. package/dist/components/app-link/index.cjs +1 -1
  56. package/dist/components/app-link/index.js +9 -9
  57. package/dist/components/app-shell/index.cjs +1 -1
  58. package/dist/components/app-shell/index.js +1 -1
  59. package/dist/components/aside/index.cjs +1 -1
  60. package/dist/components/aside/index.js +1 -1
  61. package/dist/components/avatar/index.cjs +1 -1
  62. package/dist/components/avatar/index.js +38 -39
  63. package/dist/components/badge/index.cjs +1 -1
  64. package/dist/components/badge/index.js +1 -1
  65. package/dist/components/banner/index.cjs +1 -1
  66. package/dist/components/banner/index.js +1 -1
  67. package/dist/components/branding/index.cjs +1 -1
  68. package/dist/components/branding/index.js +1 -1
  69. package/dist/components/button/index.cjs +1 -1
  70. package/dist/components/button/index.js +1 -1
  71. package/dist/components/card/index.cjs +1 -1
  72. package/dist/components/card/index.js +49 -49
  73. package/dist/components/checkbox/index.cjs +1 -1
  74. package/dist/components/checkbox/index.js +23 -17
  75. package/dist/components/chip/index.cjs +1 -1
  76. package/dist/components/chip/index.js +1 -1
  77. package/dist/components/clipboard/index.cjs +1 -1
  78. package/dist/components/clipboard/index.js +1 -1
  79. package/dist/components/collapsible/index.cjs +1 -1
  80. package/dist/components/collapsible/index.js +1 -1
  81. package/dist/components/comment/index.cjs +1 -1
  82. package/dist/components/comment/index.js +1 -1
  83. package/dist/components/comments/index.cjs +1 -1
  84. package/dist/components/comments/index.js +2 -2
  85. package/dist/components/controls/index.cjs +1 -1
  86. package/dist/components/controls/index.js +1 -1
  87. package/dist/components/croppable/index.cjs +1 -1
  88. package/dist/components/croppable/index.js +152 -152
  89. package/dist/components/dialog/index.cjs +1 -1
  90. package/dist/components/dialog/index.js +1 -1
  91. package/dist/components/divider/index.cjs +1 -1
  92. package/dist/components/divider/index.js +1 -1
  93. package/dist/components/dropdown/index.cjs +1 -1
  94. package/dist/components/dropdown/index.js +3 -3
  95. package/dist/components/dropzone/index.cjs +1 -1
  96. package/dist/components/dropzone/index.js +1 -1
  97. package/dist/components/editor/index.cjs +1 -1
  98. package/dist/components/editor/index.js +237 -234
  99. package/dist/components/empty-state/index.cjs +1 -1
  100. package/dist/components/empty-state/index.js +1 -1
  101. package/dist/components/fieldset/index.cjs +1 -1
  102. package/dist/components/fieldset/index.js +1 -1
  103. package/dist/components/figure/index.cjs +1 -1
  104. package/dist/components/figure/index.js +1 -1
  105. package/dist/components/file/index.cjs +1 -1
  106. package/dist/components/file/index.js +1 -1
  107. package/dist/components/footer/index.cjs +1 -1
  108. package/dist/components/footer/index.js +1 -1
  109. package/dist/components/form/index.cjs +1 -1
  110. package/dist/components/form/index.js +21 -12
  111. package/dist/components/graph/index.cjs +1 -1
  112. package/dist/components/graph/index.js +1 -1
  113. package/dist/components/group/index.cjs +1 -1
  114. package/dist/components/group/index.js +1 -1
  115. package/dist/components/header/index.cjs +1 -1
  116. package/dist/components/header/index.js +1 -1
  117. package/dist/components/icon/index.cjs +1 -1
  118. package/dist/components/icon/index.js +1 -1
  119. package/dist/components/iframe/index.cjs +1 -1
  120. package/dist/components/iframe/index.js +2 -2
  121. package/dist/components/image/index.cjs +1 -1
  122. package/dist/components/image/index.js +1 -1
  123. package/dist/components/input/index.cjs +1 -1
  124. package/dist/components/input/index.js +4 -2
  125. package/dist/components/label/index.cjs +1 -0
  126. package/dist/components/label/index.js +18 -0
  127. package/dist/components/link/index.cjs +1 -1
  128. package/dist/components/link/index.js +1 -1
  129. package/dist/components/list/index.cjs +1 -1
  130. package/dist/components/list/index.js +1 -1
  131. package/dist/components/loading/index.cjs +1 -1
  132. package/dist/components/loading/index.js +1 -1
  133. package/dist/components/message/index.cjs +1 -1
  134. package/dist/components/message/index.js +2 -2
  135. package/dist/components/messages/index.cjs +1 -1
  136. package/dist/components/messages/index.js +2 -2
  137. package/dist/components/nav/index.cjs +1 -1
  138. package/dist/components/nav/index.js +1 -1
  139. package/dist/components/object/index.cjs +1 -1
  140. package/dist/components/object/index.js +1 -1
  141. package/dist/components/page-layout/index.cjs +1 -1
  142. package/dist/components/page-layout/index.js +1 -1
  143. package/dist/components/panel/index.cjs +1 -1
  144. package/dist/components/panel/index.js +1 -1
  145. package/dist/components/popover/index.cjs +1 -1
  146. package/dist/components/popover/index.js +1 -1
  147. package/dist/components/portal/index.cjs +1 -1
  148. package/dist/components/portal/index.js +1 -1
  149. package/dist/components/radio/index.cjs +1 -0
  150. package/dist/components/radio/index.js +35 -0
  151. package/dist/components/search/index.cjs +1 -1
  152. package/dist/components/search/index.js +2 -2
  153. package/dist/components/select/index.cjs +1 -1
  154. package/dist/components/select/index.js +3 -2
  155. package/dist/components/textarea/index.cjs +1 -1
  156. package/dist/components/textarea/index.js +30 -29
  157. package/dist/components/toggle/index.cjs +1 -1
  158. package/dist/components/toggle/index.js +16 -16
  159. package/dist/components/toolbar/index.cjs +1 -1
  160. package/dist/components/toolbar/index.js +8 -9
  161. package/dist/components/tooltip/index.cjs +1 -1
  162. package/dist/components/tooltip/index.js +1 -1
  163. package/dist/{index-DqZSdMHT.cjs → index-B4dFheLl.cjs} +1 -1
  164. package/dist/{index-KGoXYG8u.js → index-BJiUk1q2.js} +2 -2
  165. package/dist/index-BQoXmNo3.cjs +1 -0
  166. package/dist/index-Bre56YYa.js +90 -0
  167. package/dist/{index-Bl5EEYDv.cjs → index-BwfsmdF6.cjs} +1 -1
  168. package/dist/index-CHJNMNDr.cjs +1 -0
  169. package/dist/index-GPsHvb4d.js +74 -0
  170. package/dist/{index-DQuc_Zkg.js → index-acMNM3VJ.js} +1 -1
  171. package/dist/index.cjs +1 -1
  172. package/dist/index.d.ts +30 -7
  173. package/dist/index.js +74 -70
  174. package/dist/tokens.css +79 -38
  175. package/dist/tokens.json +627 -257
  176. package/package.json +1 -1
  177. package/dist/index-FSKjg3Z8.js +0 -82
  178. package/dist/index-HVXauXrX.js +0 -73
  179. package/dist/index-S1XsOUKE.cjs +0 -1
  180. package/dist/index-riaH5c_S.cjs +0 -1
@@ -1,29 +1,29 @@
1
1
  import { jsxs as q, jsx as p } from "react/jsx-runtime";
2
2
  import xt from "classix";
3
- import { useRef as _, useState as O, useEffect as I } from "react";
3
+ import { useRef as _, useState as I, useEffect as L } from "react";
4
4
  import { Toolbar as rr } from "../toolbar/index.js";
5
5
  import { Button as it } from "../button/index.js";
6
- import { Figure as nr } from "../figure/index.js";
7
- import { Icon as er } from "../icon/index.js";
8
- import '../../assets/index39.css';const j = 10, F = 0.1, or = 0.92, y = (c, l, z) => Math.min(z, Math.max(l, c)), cr = (c) => new Promise((l, z) => {
9
- const u = URL.createObjectURL(c), d = new globalThis.Image();
6
+ import { Figure as er } from "../figure/index.js";
7
+ import { Icon as nr } from "../icon/index.js";
8
+ import '../../assets/index38.css';const v = 10, F = 0.1, or = 0.92, y = (c, u, z) => Math.min(z, Math.max(u, c)), cr = (c) => new Promise((u, z) => {
9
+ const l = URL.createObjectURL(c), d = new globalThis.Image();
10
10
  d.onload = () => {
11
- URL.revokeObjectURL(u), l(d);
11
+ URL.revokeObjectURL(l), u(d);
12
12
  }, d.onerror = () => {
13
- URL.revokeObjectURL(u), z(new Error("croppable-image-load-failed"));
14
- }, d.src = u;
13
+ URL.revokeObjectURL(l), z(new Error("croppable-image-load-failed"));
14
+ }, d.src = l;
15
15
  }), sr = async ({
16
16
  file: c,
17
- fill: l,
17
+ fill: u,
18
18
  transform: z,
19
- viewport: u
19
+ viewport: l
20
20
  }) => {
21
- const d = await cr(c), M = u.width / d.naturalWidth, tt = u.height / d.naturalHeight, D = Math.max(M, tt), G = d.naturalWidth * D, Z = d.naturalHeight * D, R = l === "width" ? Math.max(F, M / D) : l === "height" ? Math.max(F, tt / D) : F, L = y(z.zoom, R, j), v = D * L, E = G * L, J = Z * L, at = (u.width - E) / 2 + z.offset.x, T = (u.height - J) / 2 + z.offset.y, K = y(-at / v, 0, d.naturalWidth), P = y(-T / v, 0, d.naturalHeight), x = y(u.width / v, 1, Math.max(1, d.naturalWidth - K)), b = y(u.height / v, 1, Math.max(1, d.naturalHeight - P)), U = document.createElement("canvas"), A = U.getContext("2d");
22
- if (!A)
21
+ const d = await cr(c), M = l.width / d.naturalWidth, tt = l.height / d.naturalHeight, D = Math.max(M, tt), G = d.naturalWidth * D, Z = d.naturalHeight * D, R = u === "width" ? Math.max(F, M / D) : u === "height" ? Math.max(F, tt / D) : F, E = y(z.zoom, R, v), T = D * E, A = G * E, J = Z * E, at = (l.width - A) / 2 + z.offset.x, P = (l.height - J) / 2 + z.offset.y, K = y(-at / T, 0, d.naturalWidth), U = y(-P / T, 0, d.naturalHeight), x = y(l.width / T, 1, Math.max(1, d.naturalWidth - K)), b = y(l.height / T, 1, Math.max(1, d.naturalHeight - U)), O = document.createElement("canvas"), N = O.getContext("2d");
22
+ if (!N)
23
23
  throw new Error("croppable-image-context-missing");
24
- U.width = Math.max(1, Math.round(x)), U.height = Math.max(1, Math.round(b)), A.drawImage(d, K, P, x, b, 0, 0, U.width, U.height);
24
+ O.width = Math.max(1, Math.round(x)), O.height = Math.max(1, Math.round(b)), N.drawImage(d, K, U, x, b, 0, 0, O.width, O.height);
25
25
  const f = c.type.startsWith("image/") ? c.type : "image/jpeg", g = await new Promise((S) => {
26
- U.toBlob(S, f, or);
26
+ O.toBlob(S, f, or);
27
27
  });
28
28
  if (!g)
29
29
  throw new Error("croppable-image-export-failed");
@@ -31,29 +31,29 @@ import '../../assets/index39.css';const j = 10, F = 0.1, or = 0.92, y = (c, l, z
31
31
  lastModified: Date.now(),
32
32
  type: g.type || f
33
33
  });
34
- }, ir = "_croppable_1tvcl_1", ar = "_empty_1tvcl_15", lr = "_action_1tvcl_28", ur = "_caption_1tvcl_36", dr = "_media_1tvcl_43", pr = "_viewport_1tvcl_54", hr = "_draggable_1tvcl_66", mr = "_dragging_1tvcl_70", fr = "_inner_1tvcl_74", gr = "_standalone_1tvcl_90", a = {
34
+ }, ir = "_croppable_i05ue_1", ar = "_empty_i05ue_15", ur = "_action_i05ue_28", lr = "_caption_i05ue_35", dr = "_media_i05ue_42", pr = "_viewport_i05ue_53", hr = "_draggable_i05ue_65", mr = "_dragging_i05ue_69", fr = "_inner_i05ue_73", gr = "_standalone_i05ue_89", a = {
35
35
  croppable: ir,
36
36
  empty: ar,
37
- "drop-target": "_drop-target_1tvcl_23",
38
- action: lr,
39
- caption: ur,
37
+ "drop-target": "_drop-target_i05ue_23",
38
+ action: ur,
39
+ caption: lr,
40
40
  media: dr,
41
41
  viewport: pr,
42
42
  draggable: hr,
43
43
  dragging: mr,
44
44
  inner: fr,
45
45
  standalone: gr
46
- }, wr = 192, W = {
46
+ }, wr = 192, X = {
47
47
  offset: {
48
48
  x: 0,
49
49
  y: 0
50
50
  },
51
51
  zoom: 1
52
- }, Wt = (c, l) => (c == null ? void 0 : c.file) === l.file && (c == null ? void 0 : c.source) === l.source && (c == null ? void 0 : c.settings) === l.settings, vr = ({
52
+ }, Xt = (c, u) => (c == null ? void 0 : c.file) === u.file && (c == null ? void 0 : c.source) === u.source && (c == null ? void 0 : c.settings) === u.settings, Tr = ({
53
53
  cancelLabel: c,
54
- children: l,
54
+ children: u,
55
55
  deleteLabel: z,
56
- fill: u = "none",
56
+ fill: l = "none",
57
57
  height: d,
58
58
  image: M,
59
59
  isDeleting: tt,
@@ -61,18 +61,18 @@ import '../../assets/index39.css';const j = 10, F = 0.1, or = 0.92, y = (c, l, z
61
61
  onCroppableChange: G,
62
62
  onDelete: Z,
63
63
  onFileChange: R,
64
- onImageChange: L,
65
- onSave: v,
66
- onTransformChange: E,
64
+ onImageChange: E,
65
+ onSave: T,
66
+ onTransformChange: A,
67
67
  saveLabel: J,
68
68
  standalone: at,
69
- transform: T,
69
+ transform: P,
70
70
  uploadLabel: K
71
71
  }) => {
72
- const P = _(null), x = _(null), b = _(null), U = _(null), A = _(0), f = _(L), g = _(null), S = _(null), B = _(null), Q = _(/* @__PURE__ */ new Map()), i = _(W), lt = _(null), [w, rt] = O(null), [ut, dt] = O(null), [bt, nt] = O(!1), [Xt, pt] = O(!1), [kt, ht] = O(W), [X, mt] = O(null), [m, Yt] = O({
72
+ const U = _(null), x = _(null), b = _(null), O = _(null), N = _(0), f = _(E), g = _(null), S = _(null), B = _(null), Q = _(/* @__PURE__ */ new Map()), i = _(X), ut = _(null), [w, rt] = I(null), [lt, dt] = I(null), [bt, et] = I(!1), [kt, pt] = I(!1), [Yt, ht] = I(X), [k, mt] = I(null), [m, Ht] = I({
73
73
  width: 0,
74
74
  height: 0
75
- }), [_t, ft] = O(null), [V, et] = O(null), C = (() => {
75
+ }), [_t, ft] = I(null), [V, nt] = I(null), C = (() => {
76
76
  const t = m.width, r = m.height;
77
77
  if (!t || !r) return {
78
78
  width: 0,
@@ -84,125 +84,125 @@ import '../../assets/index39.css';const j = 10, F = 0.1, or = 0.92, y = (c, l, z
84
84
  height: r,
85
85
  minZoom: F
86
86
  };
87
- const e = t / w.width, n = r / w.height, o = Math.max(e, n), s = u === "width" ? e / o : u === "height" ? n / o : 0;
87
+ const n = t / w.width, e = r / w.height, o = Math.max(n, e), s = l === "width" ? n / o : l === "height" ? e / o : 0;
88
88
  return {
89
89
  width: w.width * o,
90
90
  height: w.height * o,
91
91
  minZoom: Math.max(F, s)
92
92
  };
93
- })(), $ = C.minZoom, k = T ?? kt, Y = y(k.zoom, $, j), ot = ut ?? M ?? null, zt = !l && !!M && !ut && !X, ct = !zt, Mt = l ?? (ot ? /* @__PURE__ */ p("img", { alt: "", draggable: !1, onLoad: (t) => {
93
+ })(), $ = C.minZoom, Y = P ?? Yt, H = y(Y.zoom, $, v), ot = lt ?? M ?? null, zt = !u && !!M && !lt && !k, ct = !zt, Mt = u ?? (ot ? /* @__PURE__ */ p("img", { alt: "", draggable: !1, onLoad: (t) => {
94
94
  const r = t.currentTarget;
95
95
  r.naturalWidth && r.naturalHeight && rt({
96
96
  width: r.naturalWidth,
97
97
  height: r.naturalHeight
98
98
  });
99
- }, src: ot }) : null), N = Mt == null, gt = {
100
- file: X,
101
- source: ut,
102
- settings: JSON.stringify([u, Y, k.offset.x, k.offset.y, m.width, m.height])
99
+ }, src: ot }) : null), W = Mt == null, gt = {
100
+ file: k,
101
+ source: lt,
102
+ settings: JSON.stringify([l, H, Y.offset.x, Y.offset.y, m.width, m.height])
103
103
  };
104
- I(() => {
105
- !V || !M || M === V.image && M !== V.crop.source || (ft(V.crop), et(null));
104
+ L(() => {
105
+ !V || !M || M === V.image && M !== V.crop.source || (ft(V.crop), nt(null));
106
106
  }, [M, V]);
107
107
  const wt = (t, r) => {
108
108
  const {
109
- maxX: e,
110
- maxY: n
109
+ maxX: n,
110
+ maxY: e
111
111
  } = Dt(r);
112
112
  return {
113
- x: y(t.x, -e, e),
114
- y: y(t.y, -n, n)
113
+ x: y(t.x, -n, n),
114
+ y: y(t.y, -e, e)
115
115
  };
116
116
  }, Rt = (t, r) => {
117
- const e = lt.current;
118
- if (!e) return null;
119
- const n = e.getBoundingClientRect(), o = t - n.left - n.width / 2, s = r - n.top - n.height / 2;
117
+ const n = ut.current;
118
+ if (!n) return null;
119
+ const e = n.getBoundingClientRect(), o = t - e.left - e.width / 2, s = r - e.top - e.height / 2;
120
120
  return {
121
121
  x: o,
122
122
  y: s
123
123
  };
124
- }, Ht = (t, r, e, n) => {
125
- const o = y(r, $, j), s = y(e, $, j);
124
+ }, jt = (t, r, n, e) => {
125
+ const o = y(r, $, v), s = y(n, $, v);
126
126
  if (o === 0) return t;
127
127
  const h = s / o;
128
128
  return {
129
- x: (1 - h) * n.x + h * t.x,
130
- y: (1 - h) * n.y + h * t.y
129
+ x: (1 - h) * e.x + h * t.x,
130
+ y: (1 - h) * e.y + h * t.y
131
131
  };
132
- }, jt = (t, r, e) => {
133
- const n = i.current.zoom, o = y(t, $, j), s = i.current.offset, h = e ? Ht(s, n, o, e) : r, H = wt(h, o);
132
+ }, vt = (t, r, n) => {
133
+ const e = i.current.zoom, o = y(t, $, v), s = i.current.offset, h = n ? jt(s, e, o, n) : r, j = wt(h, o);
134
134
  i.current = {
135
135
  zoom: o,
136
- offset: H
137
- }, T || ht({
136
+ offset: j
137
+ }, P || ht({
138
138
  zoom: o,
139
- offset: H
140
- }), E == null || E({
139
+ offset: j
140
+ }), A == null || A({
141
141
  zoom: o,
142
- offset: H
142
+ offset: j
143
143
  });
144
- }, st = (t, r, e) => {
144
+ }, st = (t, r, n) => {
145
145
  S.current = {
146
146
  zoom: t,
147
147
  offset: r,
148
- anchor: e ?? null
148
+ anchor: n ?? null
149
149
  }, x.current == null && (x.current = window.requestAnimationFrame(() => {
150
150
  x.current = null;
151
- const n = S.current;
151
+ const e = S.current;
152
152
  S.current = null;
153
- const o = (n == null ? void 0 : n.zoom) ?? i.current.zoom, s = (n == null ? void 0 : n.offset) ?? i.current.offset, h = (n == null ? void 0 : n.anchor) ?? null;
154
- jt(o, s, h);
153
+ const o = (e == null ? void 0 : e.zoom) ?? i.current.zoom, s = (e == null ? void 0 : e.offset) ?? i.current.offset, h = (e == null ? void 0 : e.anchor) ?? null;
154
+ vt(o, s, h);
155
155
  }));
156
156
  }, Zt = (t) => {
157
- if (N || !ct) return;
158
- const r = t.ctrlKey ? 1e-3 : 25e-5, e = i.current.zoom * Math.exp(-t.deltaY * r), n = Rt(t.clientX, t.clientY);
159
- st(e, i.current.offset, n);
157
+ if (W || !ct) return;
158
+ const r = t.ctrlKey ? 1e-3 : 25e-5, n = i.current.zoom * Math.exp(-t.deltaY * r), e = Rt(t.clientX, t.clientY);
159
+ st(n, i.current.offset, e);
160
160
  }, Dt = (t) => {
161
- const r = m.width, e = m.height;
162
- if (!r || !e) return {
161
+ const r = m.width, n = m.height;
162
+ if (!r || !n) return {
163
163
  maxX: 0,
164
164
  maxY: 0
165
165
  };
166
- const n = y(t, $, j), o = C.width * n, s = C.height * n, h = Math.max(0, (o - r) / 2), H = Math.max(0, (s - e) / 2);
166
+ const e = y(t, $, v), o = C.width * e, s = C.height * e, h = Math.max(0, (o - r) / 2), j = Math.max(0, (s - n) / 2);
167
167
  return {
168
168
  maxX: h,
169
- maxY: H
169
+ maxY: j
170
170
  };
171
- }, vt = (t) => {
172
- if (et(null), ft(null), g.current && (URL.revokeObjectURL(g.current), g.current = null), !t) {
171
+ }, Tt = (t) => {
172
+ if (nt(null), ft(null), g.current && (URL.revokeObjectURL(g.current), g.current = null), !t) {
173
173
  dt(null), mt(null), R == null || R(null);
174
174
  return;
175
175
  }
176
176
  const r = URL.createObjectURL(t);
177
- g.current = r, dt(r), rt(null), mt(t), st(W.zoom, W.offset), i.current = W, R == null || R(t);
177
+ g.current = r, dt(r), rt(null), mt(t), st(X.zoom, X.offset), i.current = X, R == null || R(t);
178
178
  }, St = (t) => {
179
179
  var r;
180
- vt(((r = t.target.files) == null ? void 0 : r[0]) ?? null), t.target.value = "";
181
- }, Tt = (t) => !D && (Array.from(t.items ?? []).some((r) => r.kind === "file" && r.type.startsWith("image/")) || Array.from(t.files ?? []).some((r) => r.type.startsWith("image/"))), Bt = (t) => {
182
- if (t.preventDefault(), t.stopPropagation(), A.current = 0, pt(!1), D) return;
183
- const r = Array.from(t.dataTransfer.files).find((e) => e.type.startsWith("image/"));
184
- r && vt(r);
185
- }, Pt = () => {
186
- et(null), ft(null), x.current != null && (window.cancelAnimationFrame(x.current), x.current = null), S.current = null, P.current = null, b.current = null, B.current = null, Q.current.clear(), nt(!1), g.current && (URL.revokeObjectURL(g.current), g.current = null), dt(null), rt(null), mt(null), i.current = W, ht(W), E == null || E(W), R == null || R(null);
180
+ Tt(((r = t.target.files) == null ? void 0 : r[0]) ?? null), t.target.value = "";
181
+ }, Pt = (t) => !D && (Array.from(t.items ?? []).some((r) => r.kind === "file" && r.type.startsWith("image/")) || Array.from(t.files ?? []).some((r) => r.type.startsWith("image/"))), Bt = (t) => {
182
+ if (t.preventDefault(), t.stopPropagation(), N.current = 0, pt(!1), D) return;
183
+ const r = Array.from(t.dataTransfer.files).find((n) => n.type.startsWith("image/"));
184
+ r && Tt(r);
185
+ }, Ut = () => {
186
+ nt(null), ft(null), x.current != null && (window.cancelAnimationFrame(x.current), x.current = null), S.current = null, U.current = null, b.current = null, B.current = null, Q.current.clear(), et(!1), g.current && (URL.revokeObjectURL(g.current), g.current = null), dt(null), rt(null), mt(null), i.current = X, ht(X), A == null || A(X), R == null || R(null);
187
187
  }, $t = (t) => {
188
- t.stopPropagation(), Pt();
188
+ t.stopPropagation(), Ut();
189
189
  }, qt = (t) => {
190
- t.stopPropagation(), Pt(), Z == null || Z();
190
+ t.stopPropagation(), Ut(), Z == null || Z();
191
191
  }, Ft = (t) => {
192
- if (!(N || !ct || t.pointerType === "mouse" && t.button !== 0)) {
192
+ if (!(W || !ct || t.pointerType === "mouse" && t.button !== 0)) {
193
193
  if (t.currentTarget.setPointerCapture(t.pointerId), t.pointerType === "touch") {
194
194
  const r = Q.current;
195
195
  if (r.set(t.pointerId, {
196
196
  x: t.clientX,
197
197
  y: t.clientY
198
198
  }), r.size === 2) {
199
- b.current = null, P.current = null, nt(!1);
200
- const [e, n] = Array.from(r.values());
201
- B.current = Math.hypot(e.x - n.x, e.y - n.y);
199
+ b.current = null, U.current = null, et(!1);
200
+ const [n, e] = Array.from(r.values());
201
+ B.current = Math.hypot(n.x - e.x, n.y - e.y);
202
202
  return;
203
203
  }
204
204
  }
205
- P.current = t.pointerId, b.current = {
205
+ U.current = t.pointerId, b.current = {
206
206
  x: t.clientX,
207
207
  y: t.clientY,
208
208
  originX: i.current.offset.x,
@@ -210,7 +210,7 @@ import '../../assets/index39.css';const j = 10, F = 0.1, or = 0.92, y = (c, l, z
210
210
  };
211
211
  }
212
212
  }, Gt = (t) => {
213
- if (N || !ct) return;
213
+ if (W || !ct) return;
214
214
  if (t.pointerType === "touch") {
215
215
  const o = Q.current;
216
216
  if (!o.has(t.pointerId)) return;
@@ -218,154 +218,154 @@ import '../../assets/index39.css';const j = 10, F = 0.1, or = 0.92, y = (c, l, z
218
218
  x: t.clientX,
219
219
  y: t.clientY
220
220
  }), o.size === 2) {
221
- const [s, h] = Array.from(o.values()), H = s.x - h.x, Qt = s.y - h.y, At = Math.hypot(H, Qt), Nt = {
221
+ const [s, h] = Array.from(o.values()), j = s.x - h.x, Qt = s.y - h.y, Nt = Math.hypot(j, Qt), Wt = {
222
222
  x: (s.x + h.x) / 2,
223
223
  y: (s.y + h.y) / 2
224
224
  };
225
225
  if (B.current) {
226
- const Vt = At / B.current, Ct = i.current.zoom * Vt, tr = Rt(Nt.x, Nt.y);
226
+ const Vt = Nt / B.current, Ct = i.current.zoom * Vt, tr = Rt(Wt.x, Wt.y);
227
227
  st(Ct, i.current.offset, tr);
228
228
  }
229
- B.current = At;
229
+ B.current = Nt;
230
230
  return;
231
231
  }
232
232
  }
233
- if (P.current !== t.pointerId || !b.current || !yt) return;
234
- const r = t.clientX - b.current.x, e = t.clientY - b.current.y, n = Math.abs(r) + Math.abs(e);
235
- !bt && n > 2 && nt(!0), !(n <= 1) && st(i.current.zoom, {
233
+ if (U.current !== t.pointerId || !b.current || !yt) return;
234
+ const r = t.clientX - b.current.x, n = t.clientY - b.current.y, e = Math.abs(r) + Math.abs(n);
235
+ !bt && e > 2 && et(!0), !(e <= 1) && st(i.current.zoom, {
236
236
  x: b.current.originX + r,
237
- y: b.current.originY + e
237
+ y: b.current.originY + n
238
238
  });
239
- }, Ut = (t) => {
240
- t.pointerType === "touch" && (Q.current.delete(t.pointerId), Q.current.size < 2 && (B.current = null)), P.current === t.pointerId && (P.current = null, b.current = null, nt(!1));
239
+ }, Ot = (t) => {
240
+ t.pointerType === "touch" && (Q.current.delete(t.pointerId), Q.current.size < 2 && (B.current = null)), U.current === t.pointerId && (U.current = null, b.current = null, et(!1));
241
241
  };
242
- I(() => {
243
- if (!T) return;
244
- const t = y(T.zoom, $, j);
242
+ L(() => {
243
+ if (!P) return;
244
+ const t = y(P.zoom, $, v);
245
245
  i.current = {
246
246
  zoom: t,
247
- offset: wt(T.offset, t)
247
+ offset: wt(P.offset, t)
248
248
  };
249
- }, [T, m.width, m.height, w == null ? void 0 : w.width, w == null ? void 0 : w.height]), I(() => () => {
249
+ }, [P, m.width, m.height, w == null ? void 0 : w.width, w == null ? void 0 : w.height]), L(() => () => {
250
250
  g.current && URL.revokeObjectURL(g.current);
251
- }, []), I(() => {
252
- const t = lt.current;
251
+ }, []), L(() => {
252
+ const t = ut.current;
253
253
  if (!t) return;
254
254
  const r = () => {
255
255
  const o = t.getBoundingClientRect();
256
- Yt((s) => s.width === o.width && s.height === o.height ? s : {
256
+ Ht((s) => s.width === o.width && s.height === o.height ? s : {
257
257
  width: o.width,
258
258
  height: o.height
259
259
  }), G && G(o);
260
260
  };
261
261
  r();
262
- const e = () => r();
263
- if (window.addEventListener("scroll", e, !0), typeof ResizeObserver > "u") {
262
+ const n = () => r();
263
+ if (window.addEventListener("scroll", n, !0), typeof ResizeObserver > "u") {
264
264
  const o = () => r();
265
265
  return window.addEventListener("resize", o), () => {
266
- window.removeEventListener("resize", o), window.removeEventListener("scroll", e, !0);
266
+ window.removeEventListener("resize", o), window.removeEventListener("scroll", n, !0);
267
267
  };
268
268
  }
269
- const n = new ResizeObserver(() => r());
270
- return n.observe(t), () => {
271
- n.disconnect(), window.removeEventListener("scroll", e, !0);
269
+ const e = new ResizeObserver(() => r());
270
+ return e.observe(t), () => {
271
+ e.disconnect(), window.removeEventListener("scroll", n, !0);
272
272
  };
273
- }, [G]), I(() => {
274
- if (T) return;
275
- const t = i.current.offset, r = wt(t, Y);
273
+ }, [G]), L(() => {
274
+ if (P) return;
275
+ const t = i.current.offset, r = wt(t, H);
276
276
  t.x === r.x && t.y === r.y || (i.current = {
277
277
  zoom: i.current.zoom,
278
278
  offset: r
279
- }, ht((e) => ({
280
- ...e,
279
+ }, ht((n) => ({
280
+ ...n,
281
281
  offset: r
282
282
  })));
283
- }, [Y, w, m.width, m.height]), I(() => {
283
+ }, [H, w, m.width, m.height]), L(() => {
284
284
  ot || rt(null);
285
- }, [ot]), I(() => {
286
- f.current = L;
287
- }, [L]), I(() => {
288
- var e;
289
- if (!L) return;
290
- if (!X || !m.width || !m.height || l) {
291
- (e = f.current) == null || e.call(f, null);
285
+ }, [ot]), L(() => {
286
+ f.current = E;
287
+ }, [E]), L(() => {
288
+ var n;
289
+ if (!E) return;
290
+ if (!k || !m.width || !m.height || u) {
291
+ (n = f.current) == null || n.call(f, null);
292
292
  return;
293
293
  }
294
294
  let t = !0;
295
295
  const r = window.setTimeout(() => {
296
296
  sr({
297
- file: X,
298
- fill: u,
297
+ file: k,
298
+ fill: l,
299
299
  transform: {
300
- zoom: Y,
301
- offset: k.offset
300
+ zoom: H,
301
+ offset: Y.offset
302
302
  },
303
303
  viewport: m
304
- }).then((n) => {
304
+ }).then((e) => {
305
305
  var o;
306
- t && ((o = f.current) == null || o.call(f, n));
306
+ t && ((o = f.current) == null || o.call(f, e));
307
307
  }).catch(() => {
308
- var n;
309
- t && ((n = f.current) == null || n.call(f, null));
308
+ var e;
309
+ t && ((e = f.current) == null || e.call(f, null));
310
310
  });
311
311
  }, 75);
312
312
  return () => {
313
313
  t = !1, window.clearTimeout(r);
314
314
  };
315
- }, [l, Y, k.offset, u, X, m]), I(() => () => {
315
+ }, [u, H, Y.offset, l, k, m]), L(() => () => {
316
316
  x.current != null && (window.cancelAnimationFrame(x.current), x.current = null);
317
317
  }, []);
318
- const Ot = Dt(Y), yt = !N && ct && (Ot.maxX > 0 || Ot.maxY > 0), It = !N && !zt && !!v && !Wt(_t, gt), Lt = !!M && !l && !!X && !Wt(_t, gt), Jt = !Lt && !N && !!(X || Z), Et = () => {
318
+ const It = Dt(H), yt = !W && ct && (It.maxX > 0 || It.maxY > 0), Lt = !W && !zt && !!T && !Xt(_t, gt), Et = !!M && !u && !!k && !Xt(_t, gt), Jt = !Et && !W && !!(k || Z), At = () => {
319
319
  var t;
320
- return (t = U.current) == null ? void 0 : t.click();
320
+ return (t = O.current) == null ? void 0 : t.click();
321
321
  }, Kt = (t) => {
322
- t.preventDefault(), t.stopPropagation(), Et();
322
+ t.preventDefault(), t.stopPropagation(), At();
323
323
  };
324
- return /* @__PURE__ */ q("div", { className: xt(a.croppable, at && a.standalone, Xt && a["drop-target"]), onDragEnter: (t) => {
325
- t.preventDefault(), t.stopPropagation(), A.current += 1, pt(Tt(t.dataTransfer));
324
+ return /* @__PURE__ */ q("div", { className: xt(a.croppable, at && a.standalone, kt && a["drop-target"]), onDragEnter: (t) => {
325
+ t.preventDefault(), t.stopPropagation(), N.current += 1, pt(Pt(t.dataTransfer));
326
326
  }, onDragOver: (t) => {
327
- t.preventDefault(), t.stopPropagation(), t.dataTransfer.dropEffect = Tt(t.dataTransfer) ? "copy" : "none";
327
+ t.preventDefault(), t.stopPropagation(), t.dataTransfer.dropEffect = Pt(t.dataTransfer) ? "copy" : "none";
328
328
  }, onDragLeave: (t) => {
329
- t.preventDefault(), t.stopPropagation(), A.current = Math.max(0, A.current - 1), A.current || pt(!1);
329
+ t.preventDefault(), t.stopPropagation(), N.current = Math.max(0, N.current - 1), N.current || pt(!1);
330
330
  }, onDrop: Bt, onClick: () => {
331
- N && Et();
331
+ W && At();
332
332
  }, "data-component": "croppable", children: [
333
- /* @__PURE__ */ p("input", { accept: "image/*", onChange: St, ref: U, type: "file" }),
334
- /* @__PURE__ */ p("div", { className: a.viewport, ref: lt, onDragStart: (t) => t.preventDefault(), onPointerDown: Ft, onPointerMove: Gt, onPointerUp: Ut, onPointerCancel: Ut, onWheel: Zt, style: {
333
+ /* @__PURE__ */ p("input", { accept: "image/*", onChange: St, ref: O, type: "file" }),
334
+ /* @__PURE__ */ p("div", { className: a.viewport, ref: ut, onDragStart: (t) => t.preventDefault(), onPointerDown: Ft, onPointerMove: Gt, onPointerUp: Ot, onPointerCancel: Ot, onWheel: Zt, style: {
335
335
  "--croppable-height": `${d ?? wr}px`,
336
- "--croppable-zoom": Y,
337
- "--croppable-x": `${k.offset.x}px`,
338
- "--croppable-y": `${k.offset.y}px`,
336
+ "--croppable-zoom": H,
337
+ "--croppable-x": `${Y.offset.x}px`,
338
+ "--croppable-y": `${Y.offset.y}px`,
339
339
  ...w ? {
340
340
  "--croppable-image-width": `${C.width}px`,
341
341
  "--croppable-image-height": `${C.height}px`
342
342
  } : null
343
- }, children: N ? /* @__PURE__ */ p("div", { className: a.empty, children: /* @__PURE__ */ p(nr, { children: /* @__PURE__ */ p(er, { name: "Image", size: "large" }) }) }) : /* @__PURE__ */ p("div", { className: xt(a.media, yt && a.draggable, yt && bt && a.dragging), children: /* @__PURE__ */ p("div", { className: xt(a.inner), children: Mt }) }) }),
343
+ }, children: W ? /* @__PURE__ */ p("div", { className: a.empty, children: /* @__PURE__ */ p(er, { children: /* @__PURE__ */ p(nr, { name: "Image", size: "large" }) }) }) : /* @__PURE__ */ p("div", { className: xt(a.media, yt && a.draggable, yt && bt && a.dragging), children: /* @__PURE__ */ p("div", { className: xt(a.inner), children: Mt }) }) }),
344
344
  /* @__PURE__ */ q(rr, { children: [
345
- It && /* @__PURE__ */ q("span", { className: a.action, children: [
345
+ Lt && /* @__PURE__ */ q("span", { className: a.action, children: [
346
346
  /* @__PURE__ */ p(it, { isLoading: D, "aria-label": J ?? "Save image", icon: "FloppyDisk", onClick: () => {
347
- et({
347
+ nt({
348
348
  image: M,
349
349
  crop: gt
350
- }), v == null || v();
350
+ }), T == null || T();
351
351
  }, variant: "primary" }),
352
352
  J && /* @__PURE__ */ p("span", { className: a.caption, children: J })
353
353
  ] }),
354
- !It && /* @__PURE__ */ q("span", { className: a.action, children: [
355
- /* @__PURE__ */ p(it, { "aria-label": K, icon: "UploadSimple", onClick: Kt, variant: "secondary" }),
354
+ !Lt && /* @__PURE__ */ q("span", { className: a.action, children: [
355
+ /* @__PURE__ */ p(it, { "aria-label": K, icon: "UploadSimple", onClick: Kt, variant: "tertiary" }),
356
356
  /* @__PURE__ */ p("span", { className: a.caption, children: K })
357
357
  ] }),
358
- Lt && /* @__PURE__ */ q("span", { className: a.action, children: [
359
- /* @__PURE__ */ p(it, { "aria-label": c ?? "Cancel changes", icon: "X", onClick: $t, variant: "secondary" }),
358
+ Et && /* @__PURE__ */ q("span", { className: a.action, children: [
359
+ /* @__PURE__ */ p(it, { "aria-label": c ?? "Cancel changes", icon: "X", onClick: $t, variant: "tertiary" }),
360
360
  c && /* @__PURE__ */ p("span", { className: a.caption, children: c })
361
361
  ] }),
362
362
  Jt && /* @__PURE__ */ q("span", { className: a.action, children: [
363
- /* @__PURE__ */ p(it, { "aria-label": z ?? "Delete image", icon: "Trash", intent: "danger", isLoading: tt, onClick: qt, variant: "secondary" }),
363
+ /* @__PURE__ */ p(it, { "aria-label": z ?? "Delete image", icon: "Trash", intent: "danger", isLoading: tt, onClick: qt, variant: "tertiary" }),
364
364
  z && /* @__PURE__ */ p("span", { className: a.caption, children: z })
365
365
  ] })
366
366
  ] })
367
367
  ] });
368
368
  };
369
369
  export {
370
- vr as Croppable
370
+ Tr as Croppable
371
371
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const e=require("react/jsx-runtime"),p=require("classix"),a=require("react"),j=require("../button/index.cjs"),P=require("../icon/index.cjs"),T="_dialog_cz5d0_3",X="_close_cz5d0_34",E="_fullscreen_cz5d0_45",F="_structured_cz5d0_87",M="_content_cz5d0_87",S="_header_cz5d0_96",Y="_controls_cz5d0_101",r={dialog:T,close:X,fullscreen:E,structured:F,content:M,header:S,controls:Y},z=l=>a.Children.toArray(l).some(s=>a.isValidElement(s)?s.type===j.Button&&s.props.intent==="danger"?!0:z(s.props.children):!1),w=({children:l,className:s,controls:n,fullscreen:f=!1,header:_,onCancel:i,onClick:d,onClose:u,open:o=!1,setOpen:c,...B})=>{const g=a.useRef(null),m=z(n),h=f||_!=null||n!=null;a.useEffect(()=>{const t=g.current;t&&(o&&!t.open?t.showModal():!o&&t.open&&t.close())},[o]);const b=t=>{i==null||i(t),!(t.defaultPrevented||!c)&&(t.preventDefault(),c(!1))},q=t=>{if(d==null||d(t),m||t.defaultPrevented||t.target!==t.currentTarget||!c)return;const{bottom:N,left:R,right:D,top:k}=t.currentTarget.getBoundingClientRect();(t.clientX<R||t.clientX>D||t.clientY<k||t.clientY>N)&&c(!1)},y=t=>{u==null||u(t),o&&(c==null||c(!1))},x=c&&!m?e.jsx(j.Button,{"aria-label":"Close dialog",className:r.close,onClick:()=>c(!1),variant:"simple",children:e.jsx(P.Icon,{name:"X"})}):null;return e.jsx("dialog",{className:p(r.dialog,h&&r.structured,f&&r.fullscreen,s),onCancel:b,onClick:q,onClose:y,ref:g,...B,"data-component":"dialog",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:r.header,children:[_,x]}),e.jsx("div",{className:r.content,children:l}),n!=null&&e.jsx("div",{className:r.controls,children:n})]}):e.jsxs(e.Fragment,{children:[x,l]})})};exports.Dialog=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const e=require("react/jsx-runtime"),p=require("classix"),a=require("react"),j=require("../button/index.cjs"),P=require("../icon/index.cjs"),T="_dialog_cz5d0_3",X="_close_cz5d0_34",E="_fullscreen_cz5d0_45",F="_structured_cz5d0_87",M="_content_cz5d0_87",S="_header_cz5d0_96",Y="_controls_cz5d0_101",r={dialog:T,close:X,fullscreen:E,structured:F,content:M,header:S,controls:Y},z=l=>a.Children.toArray(l).some(s=>a.isValidElement(s)?s.type===j.Button&&s.props.intent==="danger"?!0:z(s.props.children):!1),w=({children:l,className:s,controls:n,fullscreen:f=!1,header:_,onCancel:i,onClick:d,onClose:u,open:o=!1,setOpen:c,...B})=>{const g=a.useRef(null),m=z(n),h=f||_!=null||n!=null;a.useEffect(()=>{const t=g.current;t&&(o&&!t.open?t.showModal():!o&&t.open&&t.close())},[o]);const b=t=>{i==null||i(t),!(t.defaultPrevented||!c)&&(t.preventDefault(),c(!1))},q=t=>{if(d==null||d(t),m||t.defaultPrevented||t.target!==t.currentTarget||!c)return;const{bottom:N,left:R,right:D,top:k}=t.currentTarget.getBoundingClientRect();(t.clientX<R||t.clientX>D||t.clientY<k||t.clientY>N)&&c(!1)},y=t=>{u==null||u(t),o&&(c==null||c(!1))},x=c&&!m?e.jsx(j.Button,{"aria-label":"Close dialog",className:r.close,onClick:()=>c(!1),variant:"simple",children:e.jsx(P.Icon,{name:"X"})}):null;return e.jsx("dialog",{className:p(r.dialog,h&&r.structured,f&&r.fullscreen,s),onCancel:b,onClick:q,onClose:y,ref:g,...B,"data-component":"dialog",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:r.header,children:[_,x]}),e.jsx("div",{className:r.content,children:l}),n!=null&&e.jsx("div",{className:r.controls,children:n})]}):e.jsxs(e.Fragment,{children:[x,l]})})};exports.Dialog=w;
@@ -3,7 +3,7 @@ import P from "classix";
3
3
  import B, { useRef as T, useEffect as Y } from "react";
4
4
  import { Button as N } from "../button/index.js";
5
5
  import { Icon as w } from "../icon/index.js";
6
- import '../../assets/index40.css';const A = "_dialog_cz5d0_3", F = "_close_cz5d0_34", I = "_fullscreen_cz5d0_45", M = "_structured_cz5d0_87", V = "_content_cz5d0_87", q = "_header_cz5d0_96", G = "_controls_cz5d0_101", c = {
6
+ import '../../assets/index39.css';const A = "_dialog_cz5d0_3", F = "_close_cz5d0_34", I = "_fullscreen_cz5d0_45", M = "_structured_cz5d0_87", V = "_content_cz5d0_87", q = "_header_cz5d0_96", G = "_controls_cz5d0_101", c = {
7
7
  dialog: A,
8
8
  close: F,
9
9
  fullscreen: I,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const r=require("react/jsx-runtime"),d=require("classix"),t="_divider_1oie5_1",s={divider:t},o=({className:e,...i})=>r.jsx("hr",{className:d(s.divider,e),...i,"data-component":"divider"});exports.Divider=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const r=require("react/jsx-runtime"),d=require("classix"),t="_divider_1oie5_1",s={divider:t},o=({className:e,...i})=>r.jsx("hr",{className:d(s.divider,e),...i,"data-component":"divider"});exports.Divider=o;
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import e from "classix";
3
- import '../../assets/index41.css';const o = "_divider_1oie5_1", t = {
3
+ import '../../assets/index40.css';const o = "_divider_1oie5_1", t = {
4
4
  divider: o
5
5
  }, m = ({
6
6
  className: i,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index42.css');const s=require("react/jsx-runtime"),C=require("classix"),r=require("react"),V=require("../button/index.cjs"),$e=require("../../icons-BIdcCH-v.cjs"),fe=require("../../index-S1XsOUKE.cjs"),De=require("../list/index.cjs"),Fe=require("../loading/index.cjs"),F=require("../../index-riaH5c_S.cjs");function L(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(L).join(" "):r.isValidElement(t)?L(t.props.children):""}function Le(t){return r.isValidElement(t)&&t.type==="option"}function Me(t){return r.isValidElement(t)&&t.type==="optgroup"}function Qe(t){return r.isValidElement(t)&&t.type===r.Fragment}function We(t){return r.isValidElement(t)&&t.type===F.Select}function Z(t,c,i=!1){const o=[];return r.Children.forEach(t,n=>{if(Qe(n))o.push(...Z(n.props.children,c,i));else if(Le(n)){const a=L(n.props.children).trim(),h=n.props.value!=null?String(n.props.value):a;o.push({disabled:i||!!n.props.disabled,groupLabel:c,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&h===""),label:n.props.children,selected:!!n.props.selected,text:a,value:h})}else Me(n)&&o.push(...Z(n.props.children,n.props.label,i||!!n.props.disabled))}),o}function ze(t){const c=t.trim();if(!c)return null;const o=[.../[*?]/.test(c)?c:`*${c}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${o}$`,"i")}function Ge(t,c){const i=ze(c),o=t.filter(n=>!n.hidden&&!n.isPlaceholder);return i?o.filter(n=>i.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):o}function Pe(t,c){return t.find(i=>i.value===c)??t.find(i=>i.isPlaceholder)??t[0]}function Te(t,c,i){var o,n;return c!=null?String(c):i!=null?String(i):((o=t.find(a=>a.selected))==null?void 0:o.value)??((n=t[0])==null?void 0:n.value)??""}function Ae(t){if(We(t)){const{children:c,placeholder:i,...o}=t.props;return{children:s.jsxs(s.Fragment,{children:[i&&s.jsx("option",{hidden:!0,value:"",children:i}),c]}),props:o}}return{children:t.props.children,props:t.props}}const Ke="_combobox_5r227_3",Oe="_dropdown_5r227_20",He="_empty_5r227_25",Je="_group_5r227_26",Ue="_placeholder_5r227_27",Xe="_filter_5r227_35",Ye="_native_5r227_45",Ze="_option_5r227_55",et="_options_5r227_76",tt="_panel_5r227_83",nt="_selected_5r227_108",st="_text_5r227_112",rt="_trigger_5r227_120",lt="_minimal_5r227_157",it="_inline_5r227_217",ot="_label_5r227_249",l={combobox:Ke,"combobox-input":"_combobox-input_5r227_12",dropdown:Oe,empty:He,group:Je,placeholder:Ue,filter:Xe,native:Ye,option:Ze,options:et,panel:tt,selected:nt,text:st,trigger:rt,minimal:lt,inline:it,label:ot,"inline-field":"_inline-field_5r227_255"};function pe(t,c){return{"--icon-svg":$e.iconSVG(t,c)}}const ct=({children:t,className:c,combobox:i=!1,createOption:o,emptyLabel:n="No matches found",errorLabel:a,onRetry:h,retryLabel:me="Retry",label:b,filterOptions:_e=!0,hasNextPage:v=!1,loading:m=!1,loadMoreLabel:be="Load more",onLoadMore:g,onOpenChange:I,onSearchChange:B,searchValue:M,renderOption:Q,searchPlaceholder:W="Filter",selectedItems:ve,variant:j="default",...xe})=>{const z=Ae(t),{defaultValue:ye,onChange:G,value:P,...he}=z.props,u=F.sanitizeSelectProps(he),{className:ge,...je}=u,ee=r.useRef(null),te=r.useRef(null),k=r.useId(),ne=r.useRef(null),x=r.useRef(null),se=r.useRef(null),re=r.useRef(null),T=r.useRef(!1),A=r.useRef(!1),K=r.useRef(g),le=!!g,w=Z(z.children),E=P!=null,O=Te(w,P,ye),[H,J]=r.useState(()=>O),[d,we]=r.useState(!1),[Ee,Re]=r.useState(""),R=M??Ee,N=r.useCallback(e=>{M===void 0&&Re(e),B==null||B(e)},[B,M]),p=r.useCallback(e=>{T.current===e||e&&u.disabled||(T.current=e,we(e),I==null||I(e),e||N(""))},[I,u.disabled,N]),q=E?String(P):H,ie={default:F.resolveColor("--colors-semantic-content-secondary"),white:F.resolveColor("--color-white","white")},oe=j==="minimal"?ie.white:ie.default,$=Pe(w,q),Ne=pe("CaretDown",oe),Se=pe("MagnifyingGlass",oe),U=Ge(w,_e?R:""),y=R.trim(),D=!!(i&&o&&y&&o.isValid(y)),Ce=b&&j==="inline"?fe.formatInlineLabel(b):b,ce=e=>e?(Q==null?void 0:Q({groupLabel:e.groupLabel,isSelected:e.value===q,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";r.useEffect(()=>{!E&&!w.some(e=>e.value===H)&&J(O)},[O,H,E,w]),r.useEffect(()=>{var e;d&&((e=x.current)==null||e.focus())},[d]),r.useEffect(()=>{if(!d)return;const e=f=>{var _;(_=te.current)!=null&&_.contains(f.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[p,d]),r.useEffect(()=>{K.current=g},[g]),r.useEffect(()=>{u.disabled&&p(!1)},[p,u.disabled]);const X=r.useCallback(()=>{!T.current||u.disabled||m||a||!v||!K.current||A.current||(A.current=!0,K.current())},[a,v,m,u.disabled]);r.useEffect(()=>{if(A.current=!1,!d||u.disabled||m||a||!v||!le)return;const e=re.current,f=se.current;if(!e||!f||typeof IntersectionObserver>"u")return;let _=!0;const S=new IntersectionObserver(ke=>{_&&ke.some(qe=>qe.isIntersecting)&&X()},{root:f});return S.observe(e),()=>{_=!1,S.disconnect()}},[d,m,a,v,le,X,U.length,R,u.disabled]);const Ve=e=>{E||J(e.target.value),G==null||G(e)},Y=()=>{var e;p(!1),i||(e=ee.current)==null||e.focus()},ae=()=>{var e;N(""),p(!0),(e=x.current)==null||e.focus()},ue=()=>{!o||!D||(o.onCreate(y),ae())},Ie=e=>{var S;E||J(e);const f=ne.current;if(!f){Y();return}const _=(S=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:S.set;_==null||_.call(f,e),f.dispatchEvent(new Event("change",{bubbles:!0})),i?ae():Y()},Be=e=>{e.key==="Escape"&&Y(),e.key==="Enter"&&e.target===x.current&&D&&(e.preventDefault(),ue())},de=s.jsxs("div",{className:C(l.dropdown,j==="inline"&&l.inline,j==="minimal"&&l.minimal,c),onKeyDown:Be,ref:te,...xe,"data-component":"dropdown",children:[s.jsx("select",{...je,"aria-hidden":"true",className:C(l.native,ge),onChange:Ve,ref:ne,tabIndex:-1,value:q,children:z.children}),i?s.jsxs("div",{className:l.combobox,onClick:()=>{var e;return(e=x.current)==null?void 0:e.focus()},children:[ve,s.jsx("input",{"aria-autocomplete":"list","aria-expanded":d,"aria-label":u["aria-label"]??b??W,className:l["combobox-input"],disabled:u.disabled,onChange:e=>{N(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:W||void 0,ref:x,role:"combobox",type:"text",value:R})]}):s.jsx(V.Button,{"aria-expanded":d,"aria-haspopup":"dialog","aria-labelledby":b?`${k} ${k}-value`:void 0,className:C(l.trigger,($==null?void 0:$.isPlaceholder)&&l.placeholder),"data-open":d?"true":void 0,disabled:u.disabled,onClick:()=>p(!d),ref:ee,style:Ne,variant:"simple",children:s.jsx("span",{className:l.text,id:`${k}-value`,children:ce($)})}),d&&s.jsxs("div",{className:l.panel,children:[!i&&s.jsx(fe.Input,{"aria-label":"Filter",className:l.filter,icon:"MagnifyingGlass",onChange:e=>N(e.target.value),placeholder:W,ref:x,style:Se,type:"search",value:R}),s.jsxs(De.List,{"aria-label":"Dropdown","aria-busy":m||void 0,className:l.options,ref:se,children:[U.map(e=>{const f=e.value===q;return s.jsx("li",{"data-component":"dropdown",children:s.jsxs(V.Button,{"aria-label":f?`${e.text}, selected`:e.text,className:C(l.option,f&&l.selected),disabled:e.disabled,onClick:()=>Ie(e.value),variant:"tertiary",children:[s.jsx("span",{className:l.text,children:ce(e)}),e.groupLabel&&s.jsx("small",{className:l.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),D&&o&&s.jsx("li",{children:s.jsx(V.Button,{"aria-label":L(o.render(y))||y,className:l.option,onClick:ue,variant:"tertiary",children:s.jsx("span",{className:l.text,children:o.render(y)})})}),U.length===0&&!D&&!m&&!a&&!v&&s.jsx("li",{className:l.empty,children:n}),a&&s.jsxs("li",{className:l.empty,children:[s.jsx("span",{role:"alert",children:a}),h&&s.jsx(V.Button,{disabled:m,onClick:h,variant:"tertiary",children:me})]}),m&&s.jsx("li",{"aria-label":"Loading",className:l.empty,role:"status",children:s.jsx(Fe.Loading,{size:"small"})}),v&&g&&!a&&s.jsx("li",{ref:re,children:s.jsx(V.Button,{className:l.option,disabled:m,onClick:X,variant:"tertiary",children:be})})]})]})]});return b?s.jsxs("div",{className:C(l.label,j==="inline"&&l["inline-field"]),"data-component":"dropdown",children:[s.jsx("span",{id:k,children:Ce}),de]}):de};exports.Dropdown=ct;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const s=require("react/jsx-runtime"),C=require("classix"),r=require("react"),V=require("../button/index.cjs"),$e=require("../../icons-BIdcCH-v.cjs"),fe=require("../../index-CHJNMNDr.cjs"),De=require("../list/index.cjs"),Fe=require("../loading/index.cjs"),F=require("../../index-BQoXmNo3.cjs");function L(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(L).join(" "):r.isValidElement(t)?L(t.props.children):""}function Le(t){return r.isValidElement(t)&&t.type==="option"}function Me(t){return r.isValidElement(t)&&t.type==="optgroup"}function Qe(t){return r.isValidElement(t)&&t.type===r.Fragment}function We(t){return r.isValidElement(t)&&t.type===F.Select}function Z(t,c,i=!1){const o=[];return r.Children.forEach(t,n=>{if(Qe(n))o.push(...Z(n.props.children,c,i));else if(Le(n)){const a=L(n.props.children).trim(),h=n.props.value!=null?String(n.props.value):a;o.push({disabled:i||!!n.props.disabled,groupLabel:c,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&h===""),label:n.props.children,selected:!!n.props.selected,text:a,value:h})}else Me(n)&&o.push(...Z(n.props.children,n.props.label,i||!!n.props.disabled))}),o}function ze(t){const c=t.trim();if(!c)return null;const o=[.../[*?]/.test(c)?c:`*${c}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${o}$`,"i")}function Ge(t,c){const i=ze(c),o=t.filter(n=>!n.hidden&&!n.isPlaceholder);return i?o.filter(n=>i.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):o}function Pe(t,c){return t.find(i=>i.value===c)??t.find(i=>i.isPlaceholder)??t[0]}function Te(t,c,i){var o,n;return c!=null?String(c):i!=null?String(i):((o=t.find(a=>a.selected))==null?void 0:o.value)??((n=t[0])==null?void 0:n.value)??""}function Ae(t){if(We(t)){const{children:c,placeholder:i,...o}=t.props;return{children:s.jsxs(s.Fragment,{children:[i&&s.jsx("option",{hidden:!0,value:"",children:i}),c]}),props:o}}return{children:t.props.children,props:t.props}}const Ke="_combobox_5r227_3",Oe="_dropdown_5r227_20",He="_empty_5r227_25",Je="_group_5r227_26",Ue="_placeholder_5r227_27",Xe="_filter_5r227_35",Ye="_native_5r227_45",Ze="_option_5r227_55",et="_options_5r227_76",tt="_panel_5r227_83",nt="_selected_5r227_108",st="_text_5r227_112",rt="_trigger_5r227_120",lt="_minimal_5r227_157",it="_inline_5r227_217",ot="_label_5r227_249",l={combobox:Ke,"combobox-input":"_combobox-input_5r227_12",dropdown:Oe,empty:He,group:Je,placeholder:Ue,filter:Xe,native:Ye,option:Ze,options:et,panel:tt,selected:nt,text:st,trigger:rt,minimal:lt,inline:it,label:ot,"inline-field":"_inline-field_5r227_255"};function pe(t,c){return{"--icon-svg":$e.iconSVG(t,c)}}const ct=({children:t,className:c,combobox:i=!1,createOption:o,emptyLabel:n="No matches found",errorLabel:a,onRetry:h,retryLabel:me="Retry",label:b,filterOptions:_e=!0,hasNextPage:v=!1,loading:m=!1,loadMoreLabel:be="Load more",onLoadMore:g,onOpenChange:I,onSearchChange:B,searchValue:M,renderOption:Q,searchPlaceholder:W="Filter",selectedItems:ve,variant:j="default",...xe})=>{const z=Ae(t),{defaultValue:ye,onChange:G,value:P,...he}=z.props,u=F.sanitizeSelectProps(he),{className:ge,...je}=u,ee=r.useRef(null),te=r.useRef(null),k=r.useId(),ne=r.useRef(null),x=r.useRef(null),se=r.useRef(null),re=r.useRef(null),T=r.useRef(!1),A=r.useRef(!1),K=r.useRef(g),le=!!g,w=Z(z.children),E=P!=null,O=Te(w,P,ye),[H,J]=r.useState(()=>O),[d,we]=r.useState(!1),[Ee,Re]=r.useState(""),R=M??Ee,N=r.useCallback(e=>{M===void 0&&Re(e),B==null||B(e)},[B,M]),p=r.useCallback(e=>{T.current===e||e&&u.disabled||(T.current=e,we(e),I==null||I(e),e||N(""))},[I,u.disabled,N]),q=E?String(P):H,ie={default:F.resolveColor("--colors-semantic-content-secondary"),white:F.resolveColor("--color-white","white")},oe=j==="minimal"?ie.white:ie.default,$=Pe(w,q),Ne=pe("CaretDown",oe),Se=pe("MagnifyingGlass",oe),U=Ge(w,_e?R:""),y=R.trim(),D=!!(i&&o&&y&&o.isValid(y)),Ce=b&&j==="inline"?fe.formatInlineLabel(b):b,ce=e=>e?(Q==null?void 0:Q({groupLabel:e.groupLabel,isSelected:e.value===q,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";r.useEffect(()=>{!E&&!w.some(e=>e.value===H)&&J(O)},[O,H,E,w]),r.useEffect(()=>{var e;d&&((e=x.current)==null||e.focus())},[d]),r.useEffect(()=>{if(!d)return;const e=f=>{var _;(_=te.current)!=null&&_.contains(f.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[p,d]),r.useEffect(()=>{K.current=g},[g]),r.useEffect(()=>{u.disabled&&p(!1)},[p,u.disabled]);const X=r.useCallback(()=>{!T.current||u.disabled||m||a||!v||!K.current||A.current||(A.current=!0,K.current())},[a,v,m,u.disabled]);r.useEffect(()=>{if(A.current=!1,!d||u.disabled||m||a||!v||!le)return;const e=re.current,f=se.current;if(!e||!f||typeof IntersectionObserver>"u")return;let _=!0;const S=new IntersectionObserver(ke=>{_&&ke.some(qe=>qe.isIntersecting)&&X()},{root:f});return S.observe(e),()=>{_=!1,S.disconnect()}},[d,m,a,v,le,X,U.length,R,u.disabled]);const Ve=e=>{E||J(e.target.value),G==null||G(e)},Y=()=>{var e;p(!1),i||(e=ee.current)==null||e.focus()},ae=()=>{var e;N(""),p(!0),(e=x.current)==null||e.focus()},ue=()=>{!o||!D||(o.onCreate(y),ae())},Ie=e=>{var S;E||J(e);const f=ne.current;if(!f){Y();return}const _=(S=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:S.set;_==null||_.call(f,e),f.dispatchEvent(new Event("change",{bubbles:!0})),i?ae():Y()},Be=e=>{e.key==="Escape"&&Y(),e.key==="Enter"&&e.target===x.current&&D&&(e.preventDefault(),ue())},de=s.jsxs("div",{className:C(l.dropdown,j==="inline"&&l.inline,j==="minimal"&&l.minimal,c),onKeyDown:Be,ref:te,...xe,"data-component":"dropdown",children:[s.jsx("select",{...je,"aria-hidden":"true",className:C(l.native,ge),onChange:Ve,ref:ne,tabIndex:-1,value:q,children:z.children}),i?s.jsxs("div",{className:l.combobox,onClick:()=>{var e;return(e=x.current)==null?void 0:e.focus()},children:[ve,s.jsx("input",{"aria-autocomplete":"list","aria-expanded":d,"aria-label":u["aria-label"]??b??W,className:l["combobox-input"],disabled:u.disabled,onChange:e=>{N(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:W||void 0,ref:x,role:"combobox",type:"text",value:R})]}):s.jsx(V.Button,{"aria-expanded":d,"aria-haspopup":"dialog","aria-labelledby":b?`${k} ${k}-value`:void 0,className:C(l.trigger,($==null?void 0:$.isPlaceholder)&&l.placeholder),"data-open":d?"true":void 0,disabled:u.disabled,onClick:()=>p(!d),ref:ee,style:Ne,variant:"simple",children:s.jsx("span",{className:l.text,id:`${k}-value`,children:ce($)})}),d&&s.jsxs("div",{className:l.panel,children:[!i&&s.jsx(fe.Input,{"aria-label":"Filter",className:l.filter,icon:"MagnifyingGlass",onChange:e=>N(e.target.value),placeholder:W,ref:x,style:Se,type:"search",value:R}),s.jsxs(De.List,{"aria-label":"Dropdown","aria-busy":m||void 0,className:l.options,ref:se,children:[U.map(e=>{const f=e.value===q;return s.jsx("li",{"data-component":"dropdown",children:s.jsxs(V.Button,{"aria-label":f?`${e.text}, selected`:e.text,className:C(l.option,f&&l.selected),disabled:e.disabled,onClick:()=>Ie(e.value),variant:"tertiary",children:[s.jsx("span",{className:l.text,children:ce(e)}),e.groupLabel&&s.jsx("small",{className:l.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),D&&o&&s.jsx("li",{children:s.jsx(V.Button,{"aria-label":L(o.render(y))||y,className:l.option,onClick:ue,variant:"tertiary",children:s.jsx("span",{className:l.text,children:o.render(y)})})}),U.length===0&&!D&&!m&&!a&&!v&&s.jsx("li",{className:l.empty,children:n}),a&&s.jsxs("li",{className:l.empty,children:[s.jsx("span",{role:"alert",children:a}),h&&s.jsx(V.Button,{disabled:m,onClick:h,variant:"tertiary",children:me})]}),m&&s.jsx("li",{"aria-label":"Loading",className:l.empty,role:"status",children:s.jsx(Fe.Loading,{size:"small"})}),v&&g&&!a&&s.jsx("li",{ref:re,children:s.jsx(V.Button,{className:l.option,disabled:m,onClick:X,variant:"tertiary",children:be})})]})]})]});return b?s.jsxs("div",{className:C(l.label,j==="inline"&&l["inline-field"]),"data-component":"dropdown",children:[s.jsx("span",{id:k,children:Ce}),de]}):de};exports.Dropdown=ct;
@@ -3,11 +3,11 @@ import $ from "classix";
3
3
  import ze, { Children as Ge, isValidElement as B, useRef as b, useId as Me, useState as te, useCallback as ne, useEffect as w } from "react";
4
4
  import { Button as k } from "../button/index.js";
5
5
  import { i as Pe } from "../../icons-DVeBguFb.js";
6
- import { f as qe, I as Ae } from "../../index-FSKjg3Z8.js";
6
+ import { f as qe, I as Ae } from "../../index-Bre56YYa.js";
7
7
  import { List as Ke } from "../list/index.js";
8
8
  import { Loading as Te } from "../loading/index.js";
9
- import { S as He, s as Oe, r as _e } from "../../index-HVXauXrX.js";
10
- import '../../assets/index42.css';function z(t) {
9
+ import { S as He, s as Oe, r as _e } from "../../index-GPsHvb4d.js";
10
+ import '../../assets/index41.css';function z(t) {
11
11
  return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(z).join(" ") : B(t) ? z(t.props.children) : "";
12
12
  }
13
13
  function Je(t) {