@graphty/compact-mantine 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { CloseButton as Ge, ActionIcon as D, Button as je, RangeSlider as Xe, Radio as We, Slider as ae, Switch as Ze, Checkbox as ve, SegmentedControl as Ke, Kbd as Ye, Indicator as qe, ThemeIcon as Je, Avatar as Qe, Pill as et, Badge as tt, Text as H, RingProgress as rt, Progress as ot, Loader as nt, InputClearButton as it, JsonInput as at, FileInput as st, PillsInput as lt, TagsInput as ct, MultiSelect as ut, ColorInput as Pe, Autocomplete as pt, PasswordInput as dt, Textarea as ft, Select as we, NumberInput as le, TextInput as ye, Tabs as mt, Stepper as gt, Pagination as ht, NavLink as xt, Burger as bt, Anchor as zt, HoverCard as vt, Popover as oe, Tooltip as Pt, Menu as wt, createTheme as yt, Group as R, ColorSwatch as Ct, ColorPicker as St, Box as A, Stack as W, Divider as Ce, Collapse as Tt, UnstyledButton as _t, Paper as It, useComputedColorScheme as kt, rem as Q } from "@mantine/core";
2
- import { jsxs as S, jsx as o, Fragment as Bt } from "react/jsx-runtime";
3
- import { useUncontrolled as Z, useDisclosure as Se } from "@mantine/hooks";
4
- import { X as ne, ChevronDown as ce, ChevronRight as Te, Plus as Rt, Minus as Ft } from "lucide-react";
5
- import { useState as L, useEffect as U, useRef as G, useCallback as T, useMemo as _e, createContext as Ie, useContext as ue, useId as ke, isValidElement as Et, cloneElement as Ot } from "react";
6
- import { createPortal as At } from "react-dom";
7
- const Lt = [
1
+ import { DEFAULT_THEME as Ee, CloseButton as Ae, ActionIcon as V, Button as nt, RangeSlider as ot, Radio as rt, Slider as ce, Switch as st, Checkbox as De, SegmentedControl as Oe, Kbd as at, Indicator as it, ThemeIcon as lt, Avatar as ct, Pill as dt, Badge as pt, Text as M, RingProgress as ut, Progress as ft, Loader as gt, InputClearButton as mt, JsonInput as ht, FileInput as xt, PillsInput as vt, TagsInput as bt, MultiSelect as Pt, Autocomplete as Ct, PasswordInput as zt, Textarea as yt, Select as Fe, NumberInput as pe, TextInput as Ve, Tabs as St, Stepper as wt, Pagination as It, NavLink as kt, Burger as Tt, Anchor as Et, HoverCard as At, Popover as Dt, Tooltip as Ot, Menu as Ft, mergeMantineTheme as Vt, createTheme as Bt, Box as B, Group as E, Paper as Rt, ColorSwatch as Lt, ColorPicker as Mt, Stack as K, Divider as Be, Collapse as Re, useComputedColorScheme as _t, rem as ee } from "@mantine/core";
2
+ import { jsx as o, jsxs as y, Fragment as Le } from "react/jsx-runtime";
3
+ import { useUncontrolled as W, useDisclosure as Me } from "@mantine/hooks";
4
+ import { X as ue, ChevronDown as fe, ChevronRight as _e, Plus as Nt, Minus as Ht } from "lucide-react";
5
+ import { useRef as R, isValidElement as Ne, cloneElement as He, createContext as ge, useContext as re, useEffect as _, useState as L, useCallback as z, useMemo as $e, useId as Ue, forwardRef as $t } from "react";
6
+ import { createPortal as Ut } from "react-dom";
7
+ const Gt = [
8
8
  "#d5d7da",
9
9
  // 0 - lightest (light mode text)
10
10
  "#a3a8b1",
@@ -25,215 +25,270 @@ const Lt = [
25
25
  // 8
26
26
  "#0d1117"
27
27
  // 9 - darkest (main background)
28
- ], Dt = {
29
- dark: Lt
30
- }, $t = {
31
- Button: je.extend({
32
- vars: (t, e) => e.size === "compact" ? {
33
- root: {
34
- "--button-height": "24px",
35
- "--button-fz": "11px",
36
- "--button-padding-x": "8px"
37
- }
38
- } : { root: {} }
28
+ ], jt = {
29
+ ...Ee.colors,
30
+ dark: Gt
31
+ }, Xt = {
32
+ "--button-height": "24px",
33
+ "--button-fz": "11px",
34
+ "--button-padding-x": "8px"
35
+ }, Kt = {
36
+ "--ai-size": "24px"
37
+ }, Wt = {
38
+ "--cb-size": "16px",
39
+ "--cb-icon-size": "12px"
40
+ }, Zt = {
41
+ Button: nt.extend({
42
+ defaultProps: {
43
+ size: "sm"
44
+ },
45
+ vars: () => ({
46
+ root: Xt
47
+ })
39
48
  }),
40
- ActionIcon: D.extend({
41
- vars: (t, e) => e.size === "compact" ? {
42
- root: {
43
- "--ai-size": "24px"
44
- }
45
- } : { root: {} }
49
+ ActionIcon: V.extend({
50
+ defaultProps: {
51
+ size: "sm",
52
+ variant: "subtle"
53
+ },
54
+ vars: () => ({
55
+ root: Kt
56
+ })
46
57
  }),
47
- CloseButton: Ge.extend({
58
+ CloseButton: Ae.extend({
48
59
  defaultProps: {
49
- size: "compact"
60
+ size: "xs"
50
61
  },
51
- vars: (t, e) => e.size === "compact" ? {
52
- root: {
53
- "--cb-size": "16px",
54
- "--cb-icon-size": "12px"
55
- }
56
- } : { root: {} }
62
+ vars: () => ({
63
+ root: Wt
64
+ })
57
65
  })
58
- }, Ht = {
59
- SegmentedControl: Ke.extend({
60
- vars: (t, e) => e.size === "compact" ? {
61
- root: {
62
- "--sc-font-size": "10px",
63
- "--sc-padding": "4px 8px"
64
- }
65
- } : { root: {} }
66
+ }, qt = {
67
+ "--switch-height": "16px",
68
+ "--switch-width": "28px",
69
+ "--switch-thumb-size": "12px",
70
+ "--switch-track-label-padding": "2px",
71
+ "--switch-label-font-size": "5px"
72
+ }, Yt = {
73
+ "--checkbox-size": "16px"
74
+ }, Jt = {
75
+ "--radio-size": "16px",
76
+ "--radio-icon-size": "6px"
77
+ }, ye = {
78
+ "--slider-size": "4px",
79
+ "--slider-thumb-size": "12px"
80
+ }, Qt = {
81
+ "--sc-font-size": "10px",
82
+ "--sc-padding": "4px 8px"
83
+ }, en = {
84
+ backgroundColor: "transparent"
85
+ }, tn = {
86
+ backgroundColor: "light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"
87
+ }, ae = {
88
+ fontSize: 11
89
+ }, Se = {
90
+ fontSize: 10,
91
+ marginTop: 2
92
+ }, nn = {
93
+ SegmentedControl: Oe.extend({
94
+ defaultProps: {
95
+ size: "sm",
96
+ withItemsBorders: !1
97
+ },
98
+ vars: () => ({
99
+ root: Qt
100
+ }),
101
+ styles: {
102
+ root: en,
103
+ indicator: tn
104
+ }
66
105
  }),
67
- Checkbox: ve.extend({
68
- vars: (t, e) => e.size === "compact" ? {
69
- root: {
70
- "--checkbox-size": "16px"
71
- }
72
- } : { root: {} },
73
- styles: (t, e) => e.size === "compact" ? {
74
- label: {
75
- fontSize: 11
76
- }
77
- } : {}
106
+ Checkbox: De.extend({
107
+ defaultProps: {
108
+ size: "sm"
109
+ },
110
+ vars: () => ({
111
+ root: Yt
112
+ }),
113
+ styles: {
114
+ label: ae
115
+ }
78
116
  }),
79
- Switch: Ze.extend({
80
- vars: (t, e) => e.size === "compact" ? {
81
- root: {
82
- "--switch-height": "16px",
83
- "--switch-width": "28px",
84
- "--switch-thumb-size": "12px",
85
- "--switch-track-label-padding": "2px",
86
- "--switch-label-font-size": "5px"
87
- }
88
- } : { root: {} },
89
- styles: (t, e) => e.size === "compact" ? {
90
- label: {
91
- fontSize: 11
92
- }
93
- } : {}
117
+ Switch: st.extend({
118
+ defaultProps: {
119
+ size: "sm"
120
+ },
121
+ vars: () => ({
122
+ root: qt
123
+ }),
124
+ styles: {
125
+ label: ae
126
+ }
94
127
  }),
95
- Slider: ae.extend({
96
- vars: (t, e) => e.size === "compact" ? {
97
- root: {
98
- "--slider-size": "4px",
99
- "--slider-thumb-size": "12px"
100
- }
101
- } : { root: {} },
102
- styles: (t, e) => e.size === "compact" ? {
103
- markLabel: {
104
- fontSize: 10,
105
- marginTop: 2
106
- }
107
- } : {}
128
+ Slider: ce.extend({
129
+ defaultProps: {
130
+ size: "sm"
131
+ },
132
+ vars: () => ({
133
+ root: ye
134
+ }),
135
+ styles: {
136
+ markLabel: Se
137
+ }
108
138
  }),
109
- Radio: We.extend({
110
- vars: (t, e) => e.size === "compact" ? {
111
- root: {
112
- "--radio-size": "16px",
113
- "--radio-icon-size": "6px"
114
- }
115
- } : { root: {} },
116
- styles: (t, e) => e.size === "compact" ? {
117
- label: {
118
- fontSize: 11
119
- }
120
- } : {}
139
+ Radio: rt.extend({
140
+ defaultProps: {
141
+ size: "sm"
142
+ },
143
+ vars: () => ({
144
+ root: Jt
145
+ }),
146
+ styles: {
147
+ label: ae
148
+ }
121
149
  }),
122
- RangeSlider: Xe.extend({
123
- vars: (t, e) => e.size === "compact" ? {
124
- root: {
125
- "--slider-size": "4px",
126
- "--slider-thumb-size": "12px"
127
- }
128
- } : { root: {} },
129
- styles: (t, e) => e.size === "compact" ? {
130
- markLabel: {
131
- fontSize: 10,
132
- marginTop: 2
133
- }
134
- } : {}
150
+ RangeSlider: ot.extend({
151
+ defaultProps: {
152
+ size: "sm"
153
+ },
154
+ vars: () => ({
155
+ root: ye
156
+ }),
157
+ styles: {
158
+ markLabel: Se
159
+ }
135
160
  })
136
- }, Mt = {
137
- Text: H.extend({
138
- vars: (t, e) => e.size === "compact" ? {
139
- root: {
140
- "--text-fz": "11px",
141
- "--text-lh": "1.2"
142
- }
143
- } : { root: {} }
161
+ }, on = {
162
+ "--badge-height": "14px",
163
+ "--badge-fz": "9px",
164
+ "--badge-padding-x": "4px"
165
+ }, rn = {
166
+ "--avatar-size": "24px"
167
+ }, sn = {
168
+ "--ti-size": "24px"
169
+ }, an = {
170
+ "--indicator-size": "8px"
171
+ }, ln = {
172
+ "--kbd-fz": "10px",
173
+ "--kbd-padding": "2px 4px"
174
+ }, cn = {
175
+ "--pill-height": "16px",
176
+ "--pill-fz": "10px"
177
+ }, dn = {
178
+ Text: M.extend({
179
+ // Text does NOT set a default size or vars - it uses the global fontSizes
180
+ // from the theme (compactFontSizes) which are already set correctly.
181
+ // This allows size="xs", "sm", "md", "lg", "xl" to work as expected.
144
182
  }),
145
- Badge: tt.extend({
146
- vars: (t, e) => e.size === "compact" ? {
147
- root: {
148
- "--badge-height": "14px",
149
- "--badge-fz": "9px",
150
- "--badge-padding-x": "4px"
151
- }
152
- } : { root: {} }
183
+ Badge: pt.extend({
184
+ defaultProps: {
185
+ size: "sm"
186
+ },
187
+ vars: () => ({
188
+ root: on
189
+ })
153
190
  }),
154
- Pill: et.extend({
155
- vars: (t, e) => e.size === "compact" ? {
156
- root: {
157
- "--pill-height": "16px",
158
- "--pill-fz": "10px"
159
- }
160
- } : { root: {} }
191
+ Pill: dt.extend({
192
+ defaultProps: {
193
+ size: "sm"
194
+ },
195
+ vars: () => ({
196
+ root: cn
197
+ })
161
198
  }),
162
- Avatar: Qe.extend({
163
- vars: (t, e) => e.size === "compact" ? {
164
- root: {
165
- "--avatar-size": "24px"
166
- }
167
- } : { root: {} }
199
+ Avatar: ct.extend({
200
+ defaultProps: {
201
+ size: "sm"
202
+ },
203
+ vars: () => ({
204
+ root: rn
205
+ })
168
206
  }),
169
- ThemeIcon: Je.extend({
170
- vars: (t, e) => e.size === "compact" ? {
171
- root: {
172
- "--ti-size": "24px"
173
- }
174
- } : { root: {} }
207
+ ThemeIcon: lt.extend({
208
+ defaultProps: {
209
+ size: "sm"
210
+ },
211
+ vars: () => ({
212
+ root: sn
213
+ })
175
214
  }),
176
- Indicator: qe.extend({
177
- vars: (t, e) => e.size === "compact" ? {
178
- root: {
179
- "--indicator-size": "8px"
180
- }
181
- } : { root: {} }
215
+ Indicator: it.extend({
216
+ defaultProps: {
217
+ size: "sm"
218
+ },
219
+ vars: () => ({
220
+ root: an
221
+ })
182
222
  }),
183
- Kbd: Ye.extend({
184
- vars: (t, e) => e.size === "compact" ? {
185
- root: {
186
- "--kbd-fz": "10px",
187
- "--kbd-padding": "2px 4px"
188
- }
189
- } : { root: {} }
223
+ Kbd: at.extend({
224
+ defaultProps: {
225
+ size: "sm"
226
+ },
227
+ vars: () => ({
228
+ root: ln
229
+ })
190
230
  })
191
- }, Nt = {
192
- Loader: nt.extend({
193
- vars: (t, e) => e.size === "compact" ? {
194
- root: {
195
- "--loader-size": "18px"
196
- }
197
- } : { root: {} }
231
+ }, pn = {
232
+ "--loader-size": "18px"
233
+ }, un = {
234
+ "--progress-size": "4px"
235
+ }, fn = {
236
+ label: {
237
+ fontSize: 9
238
+ }
239
+ }, gn = {
240
+ Loader: gt.extend({
241
+ defaultProps: {
242
+ size: "sm"
243
+ },
244
+ vars: () => ({
245
+ root: pn
246
+ })
198
247
  }),
199
- Progress: ot.extend({
200
- vars: (t, e) => e.size === "compact" ? {
201
- root: {
202
- "--progress-size": "4px"
203
- }
204
- } : { root: {} },
205
- styles: (t, e) => e.size === "compact" ? {
206
- label: {
207
- fontSize: 9
208
- }
209
- } : {}
248
+ Progress: ft.extend({
249
+ defaultProps: {
250
+ size: "sm"
251
+ },
252
+ vars: () => ({
253
+ root: un
254
+ }),
255
+ styles: fn
210
256
  }),
211
257
  // Note: RingProgress uses numeric size directly in SVG calculations,
212
- // so we can't use CSS variables. Use size={48} for compact-equivalent sizing.
213
- RingProgress: rt.extend({
214
- vars: () => ({ root: {} })
258
+ // so we can't use CSS variables or string size prop.
259
+ // Use size={48} in components for compact-equivalent sizing.
260
+ RingProgress: ut.extend({
261
+ // No defaultProps - RingProgress requires numeric size
262
+ // Use size={48} in your components for compact sizing
215
263
  })
216
- }, xe = 1e3, V = 1100, Vt = 8, br = 4, ee = {
217
- root: {},
218
- wrapper: {
219
- "--input-size": "24px",
220
- "--input-fz": "11px",
221
- "--input-bg": "var(--mantine-color-default)",
222
- "--input-bd": "none"
223
- }
224
- }, B = {
225
- label: {
226
- fontSize: 11,
227
- color: "var(--mantine-color-dimmed)",
228
- marginBottom: 1,
229
- lineHeight: 1.2
230
- },
231
- input: {
232
- paddingLeft: 8,
233
- paddingRight: 8,
234
- border: "none"
235
- }
236
- }, re = {
264
+ }, we = 1e3, N = 1100, mn = 8, io = 4, X = {
265
+ "--input-height": "24px",
266
+ "--input-size": "24px",
267
+ // For components that use this variable
268
+ "--input-fz": "11px",
269
+ "--input-bg": "var(--mantine-color-default)",
270
+ "--input-bd": "none"
271
+ }, te = {
272
+ "--input-fz": "11px",
273
+ "--input-bg": "var(--mantine-color-default)",
274
+ "--input-bd": "none"
275
+ }, J = {
276
+ fontSize: 11,
277
+ color: "var(--mantine-color-dimmed)",
278
+ marginBottom: 1,
279
+ lineHeight: 1.2
280
+ }, me = {
281
+ paddingLeft: 8,
282
+ paddingRight: 8,
283
+ border: "none",
284
+ backgroundColor: "var(--mantine-color-default)"
285
+ }, Y = {
286
+ label: J,
287
+ input: me
288
+ }, Ie = {
289
+ label: J,
290
+ input: me
291
+ }, ne = {
237
292
  dropdown: {
238
293
  padding: 4,
239
294
  border: "none",
@@ -255,754 +310,401 @@ const Lt = [
255
310
  fontSize: 11,
256
311
  padding: "8px"
257
312
  }
258
- }, Ut = {
259
- TextInput: ye.extend({
260
- vars: (t, e) => e.size === "compact" ? ee : { root: {}, wrapper: {} },
261
- styles: (t, e) => e.size === "compact" ? B : {}
313
+ }, ie = {
314
+ input: {
315
+ ...Y.input,
316
+ minHeight: 24,
317
+ height: "auto",
318
+ display: "flex",
319
+ alignItems: "center",
320
+ paddingTop: 4,
321
+ paddingBottom: 4
322
+ },
323
+ pillsList: {
324
+ columnGap: 4,
325
+ rowGap: 2
326
+ },
327
+ pill: {
328
+ // Only set margin, not padding. Pill component controls its own height/centering.
329
+ margin: 0
330
+ }
331
+ }, hn = {
332
+ TextInput: Ve.extend({
333
+ defaultProps: {
334
+ size: "sm",
335
+ variant: "filled"
336
+ },
337
+ vars: () => ({
338
+ root: {},
339
+ wrapper: X
340
+ }),
341
+ styles: Y
262
342
  }),
263
- NumberInput: le.extend({
264
- vars: (t, e) => e.size === "compact" ? {
343
+ NumberInput: pe.extend({
344
+ defaultProps: {
345
+ size: "sm",
346
+ variant: "filled"
347
+ },
348
+ vars: () => ({
265
349
  root: {},
266
350
  wrapper: {
267
- "--input-size": "24px",
268
- "--input-fz": "11px",
269
- "--input-bg": "var(--mantine-color-default)",
270
- "--input-bd": "none",
351
+ ...X,
271
352
  "--input-right-section-width": "24px"
272
353
  },
273
354
  controls: {
274
355
  "--ni-chevron-size": "10px"
275
356
  }
276
- } : { root: {}, wrapper: {}, controls: {} },
277
- styles: (t, e) => e.size === "compact" ? {
278
- ...B,
357
+ }),
358
+ styles: {
359
+ label: J,
360
+ input: me,
279
361
  control: {
280
362
  borderColor: "transparent"
281
363
  }
282
- } : {}
364
+ }
283
365
  }),
284
- Select: we.extend({
366
+ Select: Fe.extend({
285
367
  defaultProps: {
286
- comboboxProps: { zIndex: V }
368
+ size: "sm",
369
+ variant: "filled",
370
+ comboboxProps: { zIndex: N }
287
371
  },
288
- vars: (t, e) => e.size === "compact" ? ee : { root: {}, wrapper: {} },
289
- styles: (t, e) => e.size === "compact" ? {
290
- ...B,
291
- ...re
292
- } : {}
372
+ vars: () => ({
373
+ root: {},
374
+ wrapper: X
375
+ }),
376
+ styles: {
377
+ ...Y,
378
+ ...ne
379
+ }
293
380
  }),
294
- Textarea: ft.extend({
295
- vars: (t, e) => e.size === "compact" ? {
381
+ Textarea: yt.extend({
382
+ defaultProps: {
383
+ size: "sm",
384
+ variant: "filled"
385
+ },
386
+ vars: () => ({
296
387
  root: {},
297
- wrapper: {
298
- "--input-fz": "11px",
299
- "--input-bg": "var(--mantine-color-default)",
300
- "--input-bd": "none"
301
- }
302
- } : { root: {}, wrapper: {} },
303
- styles: (t, e) => e.size === "compact" ? B : {}
388
+ wrapper: te
389
+ }),
390
+ styles: Ie
304
391
  }),
305
- PasswordInput: dt.extend({
306
- vars: (t, e) => e.size === "compact" ? ee : { root: {}, wrapper: {} },
307
- styles: (t, e) => e.size === "compact" ? {
308
- ...B,
392
+ PasswordInput: zt.extend({
393
+ defaultProps: {
394
+ size: "sm",
395
+ variant: "filled"
396
+ },
397
+ vars: () => ({
398
+ root: {},
399
+ wrapper: X
400
+ }),
401
+ styles: {
402
+ ...Y,
309
403
  innerInput: {
310
404
  paddingLeft: 8,
311
405
  paddingRight: 8
312
406
  }
313
- } : {}
314
- }),
315
- Autocomplete: pt.extend({
316
- defaultProps: {
317
- comboboxProps: { zIndex: V }
318
- },
319
- vars: (t, e) => e.size === "compact" ? ee : { root: {}, wrapper: {} },
320
- styles: (t, e) => e.size === "compact" ? {
321
- ...B,
322
- ...re
323
- } : {}
407
+ }
324
408
  }),
325
- // ColorInput uses styles instead of vars due to complex type requirements
326
- // (ColorInput requires eyeDropperIcon, eyeDropperButton, colorPreview CSS vars)
327
- ColorInput: Pe.extend({
409
+ Autocomplete: Ct.extend({
328
410
  defaultProps: {
329
- popoverProps: { zIndex: V }
411
+ size: "sm",
412
+ variant: "filled",
413
+ comboboxProps: { zIndex: N }
330
414
  },
331
- styles: (t, e) => e.size === "compact" ? {
332
- ...B,
333
- wrapper: {
334
- "--input-size": "24px",
335
- "--input-fz": "11px",
336
- "--input-bg": "var(--mantine-color-default)",
337
- "--input-bd": "none"
338
- }
339
- } : {}
415
+ vars: () => ({
416
+ root: {},
417
+ wrapper: X
418
+ }),
419
+ styles: {
420
+ ...Y,
421
+ ...ne
422
+ }
340
423
  }),
341
- MultiSelect: ut.extend({
424
+ MultiSelect: Pt.extend({
342
425
  defaultProps: {
343
- comboboxProps: { zIndex: V }
426
+ size: "sm",
427
+ variant: "filled",
428
+ comboboxProps: { zIndex: N }
344
429
  },
345
- vars: (t, e) => e.size === "compact" ? {
430
+ vars: () => ({
346
431
  root: {},
347
432
  wrapper: {
348
- "--input-fz": "11px",
349
- "--input-bg": "var(--mantine-color-default)",
350
- "--input-bd": "none",
351
- "--input-size": "24px",
433
+ ...X,
352
434
  "--combobox-chevron-size": "12px"
353
435
  }
354
- } : { root: {}, wrapper: {} },
355
- styles: (t, e) => e.size === "compact" ? {
356
- ...B,
357
- ...re,
358
- input: {
359
- ...B.input,
360
- minHeight: 24,
361
- height: "auto",
362
- display: "flex",
363
- alignItems: "center",
364
- paddingTop: 4,
365
- paddingBottom: 4
366
- },
436
+ }),
437
+ styles: {
438
+ label: J,
439
+ ...ne,
440
+ ...ie,
367
441
  inputField: {
368
442
  minWidth: 60,
369
443
  flexBasis: 60
370
- },
371
- pillsList: {
372
- columnGap: 4,
373
- rowGap: 2
374
- },
375
- pill: {
376
- margin: 0,
377
- paddingTop: 2,
378
- paddingBottom: 2
379
444
  }
380
- } : {}
445
+ }
381
446
  }),
382
- TagsInput: ct.extend({
447
+ TagsInput: bt.extend({
383
448
  defaultProps: {
384
- comboboxProps: { zIndex: V }
449
+ size: "sm",
450
+ variant: "filled",
451
+ comboboxProps: { zIndex: N }
385
452
  },
386
- vars: (t, e) => e.size === "compact" ? {
453
+ vars: () => ({
387
454
  root: {},
388
- wrapper: {
389
- "--input-fz": "11px",
390
- "--input-bg": "var(--mantine-color-default)",
391
- "--input-bd": "none"
392
- }
393
- } : { root: {}, wrapper: {} },
394
- styles: (t, e) => e.size === "compact" ? {
395
- ...B,
396
- ...re,
397
- input: {
398
- ...B.input,
399
- minHeight: 24,
400
- height: "auto",
401
- display: "flex",
402
- alignItems: "center",
403
- paddingTop: 4,
404
- paddingBottom: 4
405
- },
455
+ wrapper: te
456
+ }),
457
+ styles: {
458
+ label: J,
459
+ ...ne,
460
+ ...ie,
406
461
  inputField: {
407
462
  minWidth: 30,
408
463
  flexBasis: 30
409
- },
410
- pillsList: {
411
- columnGap: 4,
412
- rowGap: 2
413
- },
414
- pill: {
415
- margin: 0,
416
- paddingTop: 2,
417
- paddingBottom: 2
418
464
  }
419
- } : {}
465
+ }
420
466
  }),
421
- PillsInput: lt.extend({
422
- vars: (t, e) => e.size === "compact" ? {
467
+ PillsInput: vt.extend({
468
+ defaultProps: {
469
+ size: "sm",
470
+ variant: "filled"
471
+ },
472
+ vars: () => ({
423
473
  root: {},
424
- wrapper: {
425
- "--input-fz": "11px",
426
- "--input-bg": "var(--mantine-color-default)",
427
- "--input-bd": "none"
428
- }
429
- } : { root: {}, wrapper: {} },
430
- styles: (t, e) => e.size === "compact" ? {
431
- ...B,
432
- input: {
433
- ...B.input,
434
- minHeight: 24,
435
- height: "auto",
436
- display: "flex",
437
- alignItems: "center",
438
- paddingTop: 4,
439
- paddingBottom: 4
440
- },
441
- inputField: {
442
- minWidth: 30,
443
- flexBasis: 30
444
- },
445
- pillsList: {
446
- columnGap: 4,
447
- rowGap: 2
448
- },
449
- pill: {
450
- margin: 0,
451
- paddingTop: 2,
452
- paddingBottom: 2
453
- }
454
- } : {}
474
+ wrapper: te
475
+ }),
476
+ styles: {
477
+ label: J,
478
+ ...ie
479
+ }
455
480
  }),
456
- FileInput: st.extend({
457
- vars: (t, e) => e.size === "compact" ? ee : { root: {}, wrapper: {} },
458
- styles: (t, e) => e.size === "compact" ? B : {}
481
+ FileInput: xt.extend({
482
+ defaultProps: {
483
+ size: "sm",
484
+ variant: "filled"
485
+ },
486
+ vars: () => ({
487
+ root: {},
488
+ wrapper: X
489
+ }),
490
+ styles: Y
459
491
  }),
460
- JsonInput: at.extend({
461
- vars: (t, e) => e.size === "compact" ? {
492
+ JsonInput: ht.extend({
493
+ defaultProps: {
494
+ size: "sm",
495
+ variant: "filled"
496
+ },
497
+ vars: () => ({
462
498
  root: {},
463
- wrapper: {
464
- "--input-fz": "11px",
465
- "--input-bg": "var(--mantine-color-default)",
466
- "--input-bd": "none"
467
- }
468
- } : { root: {}, wrapper: {} },
469
- styles: (t, e) => e.size === "compact" ? B : {}
499
+ wrapper: te
500
+ }),
501
+ styles: Ie
470
502
  }),
471
- InputClearButton: it.extend({
503
+ InputClearButton: mt.extend({
472
504
  defaultProps: {
473
- size: "compact"
505
+ size: "xs"
474
506
  },
475
- vars: (t, e) => e.size === "compact" ? {
507
+ vars: () => ({
476
508
  root: {
477
509
  "--cb-size": "16px",
478
510
  "--cb-icon-size": "12px"
479
511
  }
480
- } : { root: {} }
512
+ })
481
513
  })
482
- }, Gt = {
483
- // Anchor uses --text-fz since it inherits from Text component
484
- Anchor: zt.extend({
485
- styles: (t, e) => e.size === "compact" ? {
486
- root: {
487
- fontSize: 11
488
- }
489
- } : {}
490
- }),
491
- Burger: bt.extend({
492
- vars: (t, e) => e.size === "compact" ? {
493
- root: {
494
- "--burger-size": "18px",
495
- "--burger-line-size": "2px"
496
- }
497
- } : { root: {} }
498
- }),
499
- // NavLink uses styles since it doesn't have a size prop and requires
500
- // a 'children' CSS variable. Apply styles based on custom variant prop.
501
- NavLink: xt.extend({
502
- styles: (t, e) => e.variant === "compact" ? {
503
- root: {
504
- fontSize: 11,
505
- minHeight: 28
506
- },
507
- label: {
508
- fontSize: 11
509
- }
510
- } : {}
511
- }),
512
- Pagination: ht.extend({
513
- vars: (t, e) => e.size === "compact" ? {
514
- root: {
515
- "--pagination-control-size": "24px",
516
- "--pagination-control-fz": "11px"
517
- }
518
- } : { root: {} }
519
- }),
520
- Stepper: gt.extend({
521
- vars: (t, e) => e.size === "compact" ? {
522
- root: {
523
- "--stepper-icon-size": "24px",
524
- "--stepper-fz": "11px",
525
- "--stepper-spacing": "8px"
526
- }
527
- } : { root: {} }
528
- }),
529
- // Tabs uses styles since it doesn't have a size prop and the CSS vars
530
- // for tabs are limited to --tabs-color and --tabs-radius.
531
- // Apply styles based on custom variant prop.
532
- Tabs: mt.extend({
533
- styles: (t, e) => e.variant === "compact" ? {
534
- tab: {
535
- fontSize: 11,
536
- padding: "6px 10px"
537
- }
538
- } : {}
539
- })
540
- }, jt = {
541
- Menu: wt.extend({
514
+ }, xn = {
515
+ "--pagination-control-size": "24px",
516
+ "--pagination-control-fz": "11px"
517
+ }, vn = {
518
+ "--stepper-icon-size": "24px",
519
+ "--stepper-fz": "11px",
520
+ "--stepper-spacing": "8px"
521
+ }, bn = {
522
+ "--burger-size": "18px",
523
+ "--burger-line-size": "2px"
524
+ }, Pn = {
525
+ root: {
526
+ fontSize: 11
527
+ }
528
+ }, Cn = {
529
+ root: {
530
+ fontSize: 11,
531
+ minHeight: 28
532
+ },
533
+ label: {
534
+ fontSize: 11
535
+ }
536
+ }, zn = {
537
+ tab: {
538
+ fontSize: 11,
539
+ padding: "6px 10px"
540
+ }
541
+ }, yn = {
542
+ Anchor: Et.extend({
542
543
  defaultProps: {
543
- zIndex: V
544
- }
544
+ size: "sm"
545
+ },
546
+ styles: Pn
545
547
  }),
546
- Tooltip: Pt.extend({
548
+ Burger: Tt.extend({
547
549
  defaultProps: {
548
- zIndex: V
549
- }
550
+ size: "sm"
551
+ },
552
+ vars: () => ({
553
+ root: bn
554
+ })
550
555
  }),
551
- Popover: oe.extend({
556
+ NavLink: kt.extend({
557
+ // NavLink does not have a size prop, only styles for compact appearance
558
+ styles: Cn
559
+ }),
560
+ Pagination: It.extend({
552
561
  defaultProps: {
553
- zIndex: V
554
- }
562
+ size: "sm"
563
+ },
564
+ vars: () => ({
565
+ root: xn
566
+ })
555
567
  }),
556
- HoverCard: vt.extend({
568
+ Stepper: wt.extend({
557
569
  defaultProps: {
558
- zIndex: V
559
- }
560
- })
561
- }, zr = yt({
562
- colors: Dt,
563
- // Spread all component extensions into the theme
564
- // Each extension object provides compact size support for a category of components
565
- components: {
566
- ...Ut,
567
- ...$t,
568
- ...Ht,
569
- ...Mt,
570
- ...Nt,
571
- ...Gt,
572
- ...jt
573
- }
574
- }), vr = ["#5B8FF9", "#FF6B6B", "#61D095", "#F7B731", "#9B59B6"], Xt = [
575
- "#5B8FF9FF",
576
- "#FF6B6BFF",
577
- "#61D095FF",
578
- "#F7B731FF",
579
- "#9B59B6FF",
580
- "#5B8FF980",
581
- "#FF6B6B80",
582
- "#61D09580",
583
- "#F7B73180",
584
- "#9B59B680"
585
- ], Wt = "#888888", Be = 255, Re = 100;
586
- function Fe(t) {
587
- return Math.round(parseInt(t, 16) / Be * Re);
588
- }
589
- function Ee(t) {
590
- return Math.round(t / Re * Be).toString(16).padStart(2, "0");
591
- }
592
- function Pr(t) {
593
- let e = t.replace("#", "");
594
- e.length === 3 ? e = `${e.split("").map((r) => r + r).join("")}ff` : e.length === 4 ? e = e.split("").map((r) => r + r).join("") : e.length === 6 && (e = `${e}ff`);
595
- const n = `#${e.slice(0, 6)}`, i = e.slice(6, 8), a = Fe(i);
596
- return { hex: n, opacity: a };
597
- }
598
- function wr(t, e) {
599
- const n = t.replace("#", ""), i = Ee(e);
600
- return `#${n}${i}`;
601
- }
602
- function yr(t) {
603
- return /^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(t);
604
- }
605
- function Cr({
606
- color: t,
607
- defaultColor: e,
608
- opacity: n,
609
- defaultOpacity: i = 100,
610
- onColorChange: a,
611
- onOpacityChange: r,
612
- label: s,
613
- showOpacity: c = !0
614
- }) {
615
- const [g, b] = Z({
616
- value: t,
617
- defaultValue: void 0,
618
- finalValue: void 0,
619
- onChange: a
620
- }), [z, h] = Z({
621
- value: n,
622
- defaultValue: void 0,
623
- finalValue: void 0,
624
- onChange: r
625
- }), u = g === void 0, f = z === void 0, F = u && (!c || f), l = g ?? e, x = z ?? i, [v, _] = L(!1), [O, I] = L(l.replace("#", "").toUpperCase()), [$, j] = L(x);
626
- U(() => {
627
- I(l.replace("#", "").toUpperCase());
628
- }, [l]), U(() => {
629
- j(x);
630
- }, [x]);
631
- const q = (d) => {
632
- if (d.length === 9) {
633
- const E = d.slice(0, 7).toUpperCase(), k = d.slice(7, 9), y = Fe(k);
634
- b(E), c && h(y);
635
- } else
636
- b(d.toUpperCase());
637
- }, p = () => {
638
- const d = Ee(x);
639
- return `${l}${d}`.toUpperCase();
640
- }, m = (d) => {
641
- I(d.currentTarget.value.toUpperCase());
642
- }, P = () => {
643
- let d = O.toUpperCase();
644
- d && !d.startsWith("#") && (d = `#${d}`), /^#[0-9A-F]{6}$/i.test(d) && d !== l ? b(d) : I(l.replace("#", "").toUpperCase());
645
- }, w = (d) => {
646
- j(d);
647
- }, M = () => {
648
- const d = typeof $ == "string" ? parseFloat($) : $;
649
- if (isNaN(d))
650
- j(x);
651
- else {
652
- const E = Math.min(100, Math.max(0, d));
653
- E !== x && h(E);
654
- }
655
- }, K = () => {
656
- b(void 0), c && h(void 0);
657
- }, N = /* @__PURE__ */ S(R, { gap: 4, wrap: "nowrap", children: [
658
- /* @__PURE__ */ S(R, { gap: 0, children: [
659
- /* @__PURE__ */ S(oe, { opened: v, onChange: _, position: "bottom-start", shadow: "md", children: [
660
- /* @__PURE__ */ o(oe.Target, { children: /* @__PURE__ */ o(
661
- D,
662
- {
663
- variant: "filled",
664
- size: 24,
665
- radius: 0,
666
- style: {
667
- backgroundColor: "var(--mantine-color-default)",
668
- borderRadius: "4px 0 0 4px"
669
- },
670
- onClick: () => {
671
- _((d) => !d);
672
- },
673
- "aria-label": "Color swatch",
674
- children: /* @__PURE__ */ o(
675
- Ct,
676
- {
677
- color: l,
678
- size: 14,
679
- radius: 2,
680
- style: {
681
- border: "1px solid var(--mantine-color-default-border)"
682
- }
683
- }
684
- )
685
- }
686
- ) }),
687
- /* @__PURE__ */ o(oe.Dropdown, { p: "xs", children: /* @__PURE__ */ o(
688
- St,
689
- {
690
- format: "hexa",
691
- value: p(),
692
- onChange: q,
693
- swatches: [...Xt]
694
- }
695
- ) })
696
- ] }),
697
- /* @__PURE__ */ o(
698
- ye,
699
- {
700
- size: "compact",
701
- value: O,
702
- onChange: m,
703
- onBlur: P,
704
- "aria-label": "Color hex value",
705
- "data-is-default": u ? "true" : "false",
706
- w: 72,
707
- styles: {
708
- input: {
709
- borderRadius: c ? 0 : "0 4px 4px 0",
710
- fontFamily: "monospace",
711
- textTransform: "uppercase",
712
- ...u ? {
713
- fontStyle: "italic",
714
- color: "var(--mantine-color-dimmed)"
715
- } : {}
716
- }
717
- }
718
- }
719
- ),
720
- c && /* @__PURE__ */ S(Bt, { children: [
721
- /* @__PURE__ */ o(
722
- A,
723
- {
724
- style: {
725
- width: 1,
726
- height: 24,
727
- backgroundColor: "var(--mantine-color-default-border)"
728
- }
729
- }
730
- ),
731
- /* @__PURE__ */ o(
732
- le,
733
- {
734
- size: "compact",
735
- value: $,
736
- onChange: w,
737
- onBlur: M,
738
- min: 0,
739
- max: 100,
740
- hideControls: !0,
741
- suffix: "%",
742
- "aria-label": "Opacity",
743
- "data-is-default": f ? "true" : "false",
744
- w: 54,
745
- styles: {
746
- input: {
747
- borderRadius: "0 4px 4px 0",
748
- textAlign: "right",
749
- ...f ? {
750
- fontStyle: "italic",
751
- color: "var(--mantine-color-dimmed)"
752
- } : {}
753
- }
754
- }
755
- }
756
- )
757
- ] })
758
- ] }),
759
- !F && /* @__PURE__ */ o(
760
- D,
761
- {
762
- variant: "subtle",
763
- size: "xs",
764
- c: "dimmed",
765
- "aria-label": `Reset ${s ?? "color"} to default`,
766
- onClick: K,
767
- children: /* @__PURE__ */ o(ne, { size: 12 })
768
- }
769
- )
770
- ] });
771
- return s ? /* @__PURE__ */ S(W, { gap: 0, children: [
772
- /* @__PURE__ */ o(H, { size: "xs", c: "dimmed", mb: 1, lh: 1.2, children: s }),
773
- N
774
- ] }) : N;
775
- }
776
- function Sr({ label: t, actions: e, children: n }) {
777
- return /* @__PURE__ */ S(A, { children: [
778
- /* @__PURE__ */ o(Ce, { color: "gray.7", mt: 8, mb: 0 }),
779
- /* @__PURE__ */ S(R, { justify: "space-between", py: 8, children: [
780
- /* @__PURE__ */ o(H, { size: "xs", fw: 500, lh: 1.2, children: t }),
781
- e && /* @__PURE__ */ o(R, { gap: 4, children: e })
782
- ] }),
783
- /* @__PURE__ */ o(W, { gap: 0, children: n })
784
- ] });
785
- }
786
- function Tr({
787
- label: t,
788
- defaultOpen: e = !0,
789
- children: n,
790
- hasConfiguredValues: i = !1
791
- }) {
792
- const [a, { toggle: r }] = Se(e);
793
- return /* @__PURE__ */ S(A, { children: [
794
- /* @__PURE__ */ o(Ce, { color: "gray.7", mt: 8, mb: 0 }),
795
- /* @__PURE__ */ o(R, { justify: "space-between", py: 8, style: { cursor: "pointer" }, onClick: r, children: /* @__PURE__ */ S(R, { gap: 4, children: [
796
- /* @__PURE__ */ o(
797
- D,
798
- {
799
- variant: "subtle",
800
- size: "xs",
801
- c: "dimmed",
802
- "aria-label": a ? `Collapse ${t}` : `Expand ${t}`,
803
- children: a ? /* @__PURE__ */ o(ce, { size: 12 }) : /* @__PURE__ */ o(Te, { size: 12 })
804
- }
805
- ),
806
- /* @__PURE__ */ o(H, { size: "xs", fw: 500, lh: 1.2, children: t }),
807
- i && /* @__PURE__ */ o(
808
- A,
809
- {
810
- "aria-label": `${t} has configured values`,
811
- style: {
812
- width: 6,
813
- height: 6,
814
- borderRadius: "50%",
815
- backgroundColor: "var(--mantine-color-blue-5)",
816
- marginLeft: 4
817
- }
818
- }
819
- )
820
- ] }) }),
821
- /* @__PURE__ */ o(Tt, { in: a, children: /* @__PURE__ */ o(W, { gap: 0, children: n }) })
822
- ] });
823
- }
824
- function _r({ label: t, defaultOpen: e = !1, children: n }) {
825
- const [i, { toggle: a }] = Se(e);
826
- return /* @__PURE__ */ S(A, { children: [
827
- /* @__PURE__ */ S(R, { gap: 4, py: 4, style: { cursor: "pointer" }, onClick: a, children: [
828
- /* @__PURE__ */ o(
829
- D,
830
- {
831
- variant: "subtle",
832
- size: "xs",
833
- c: "dimmed",
834
- "aria-label": i ? `Collapse ${t}` : `Expand ${t}`,
835
- children: i ? /* @__PURE__ */ o(ce, { size: 10 }) : /* @__PURE__ */ o(Te, { size: 10 })
836
- }
837
- ),
838
- /* @__PURE__ */ o(H, { size: "xs", c: "dimmed", lh: 1.2, children: t })
839
- ] }),
840
- i && /* @__PURE__ */ o(A, { pl: "md", children: /* @__PURE__ */ o(W, { gap: 4, children: n }) })
841
- ] });
842
- }
843
- function Ir({
844
- label: t,
845
- checked: e,
846
- defaultChecked: n,
847
- onChange: i,
848
- children: a
849
- }) {
850
- const [r, s] = Z({
851
- value: e,
852
- defaultValue: n,
853
- finalValue: !1,
854
- onChange: i
855
- });
856
- return /* @__PURE__ */ S(W, { gap: 4, children: [
857
- /* @__PURE__ */ o(
858
- ve,
859
- {
860
- size: "compact",
861
- label: t,
862
- checked: r,
863
- onChange: (c) => {
864
- s(c.currentTarget.checked);
865
- }
866
- }
867
- ),
868
- r && /* @__PURE__ */ o(A, { "data-testid": "effect-toggle-children", pl: "md", children: /* @__PURE__ */ o(W, { gap: 4, children: a }) })
869
- ] });
870
- }
871
- function Zt() {
872
- return crypto.randomUUID().slice(0, 8);
873
- }
874
- function se(t, e) {
875
- return {
876
- id: Zt(),
877
- offset: t,
878
- color: e
879
- };
880
- }
881
- function Kt() {
882
- return [se(0, "#6366F1"), se(1, "#06B6D4")];
883
- }
884
- function kr({
885
- stops: t,
886
- defaultStops: e,
887
- direction: n,
888
- defaultDirection: i = 0,
889
- showDirection: a = !0,
890
- onChange: r
891
- }) {
892
- const [s, c] = Z({
893
- value: t,
894
- defaultValue: e,
895
- finalValue: Kt(),
896
- onChange: (l) => r == null ? void 0 : r(l, g)
897
- }), [g, b] = Z({
898
- value: n,
899
- defaultValue: i,
900
- finalValue: 0,
901
- onChange: (l) => r == null ? void 0 : r(s, l)
902
- }), z = (l, x) => {
903
- const v = [...s];
904
- v[l] = { ...v[l], color: x }, c(v), r == null || r(v, g);
905
- }, h = (l, x) => {
906
- const v = [...s];
907
- v[l] = { ...v[l], offset: x / 100 }, c(v), r == null || r(v, g);
908
- }, u = (l) => {
909
- b(l), r == null || r(s, l);
910
- }, f = () => {
911
- if (s.length >= 5)
912
- return;
913
- const l = s.length > 0 ? (s[s.length - 1].offset + 1) / 2 : 0.5, x = [...s, se(l, Wt)];
914
- x.sort((v, _) => v.offset - _.offset), c(x), r == null || r(x, g);
915
- }, F = (l) => {
916
- if (s.length <= 2)
917
- return;
918
- const x = s.filter((v, _) => _ !== l);
919
- c(x), r == null || r(x, g);
920
- };
921
- return /* @__PURE__ */ S(W, { gap: "xs", children: [
922
- /* @__PURE__ */ S(R, { justify: "space-between", align: "center", children: [
923
- /* @__PURE__ */ o(H, { size: "xs", c: "dimmed", children: "Color Stops" }),
924
- /* @__PURE__ */ o(
925
- D,
926
- {
927
- size: "compact",
928
- variant: "subtle",
929
- color: "gray",
930
- onClick: f,
931
- disabled: s.length >= 5,
932
- "aria-label": "Add color stop",
933
- children: /* @__PURE__ */ o(Rt, { size: 12 })
934
- }
935
- )
936
- ] }),
937
- s.map((l, x) => /* @__PURE__ */ S(R, { gap: "xs", align: "flex-end", children: [
938
- /* @__PURE__ */ o(A, { style: { flex: 1 }, children: /* @__PURE__ */ o(
939
- Pe,
940
- {
941
- size: "compact",
942
- value: l.color,
943
- onChange: (v) => {
944
- z(x, v);
945
- },
946
- "aria-label": `Color stop ${x + 1}`
947
- }
948
- ) }),
949
- /* @__PURE__ */ o(A, { style: { width: "80px" }, children: /* @__PURE__ */ o(
950
- ae,
951
- {
952
- size: "compact",
953
- min: 0,
954
- max: 100,
955
- value: l.offset * 100,
956
- onChange: (v) => {
957
- h(x, v);
958
- },
959
- label: (v) => `${Math.round(v)}%`,
960
- "aria-label": `Stop ${x + 1} position`
961
- }
962
- ) }),
963
- /* @__PURE__ */ o(
964
- D,
965
- {
966
- size: "compact",
967
- variant: "subtle",
968
- color: "gray",
969
- onClick: () => {
970
- F(x);
971
- },
972
- disabled: s.length <= 2,
973
- "aria-label": `Remove color stop ${x + 1}`,
974
- children: /* @__PURE__ */ o(Ft, { size: 12 })
975
- }
976
- )
977
- ] }, l.id)),
978
- a && /* @__PURE__ */ S(A, { children: [
979
- /* @__PURE__ */ o(H, { size: "xs", c: "dimmed", mb: 4, children: "Direction" }),
980
- /* @__PURE__ */ o(
981
- ae,
982
- {
983
- size: "compact",
984
- min: 0,
985
- max: 360,
986
- value: g,
987
- onChange: u,
988
- label: (l) => `${l}°`,
989
- "aria-label": "Gradient direction",
990
- marks: [
991
- { value: 0, label: "0°" },
992
- { value: 90, label: "90°" },
993
- { value: 180, label: "180°" },
994
- { value: 270, label: "270°" },
995
- { value: 360, label: "360°" }
996
- ]
997
- }
998
- )
999
- ] })
1000
- ] });
570
+ size: "sm"
571
+ },
572
+ vars: () => ({
573
+ root: vn
574
+ })
575
+ }),
576
+ Tabs: St.extend({
577
+ // Tabs does not have a size prop, only styles for compact appearance
578
+ styles: zn
579
+ })
580
+ }, Sn = {
581
+ "--menu-item-fz": "11px"
582
+ }, wn = {
583
+ tooltip: {
584
+ fontSize: 11,
585
+ padding: "4px 8px"
586
+ }
587
+ }, In = {
588
+ dropdown: {
589
+ padding: 8
590
+ }
591
+ }, kn = {
592
+ dropdown: {
593
+ padding: 8
594
+ }
595
+ }, Tn = {
596
+ Menu: Ft.extend({
597
+ defaultProps: {
598
+ zIndex: N
599
+ },
600
+ vars: () => ({
601
+ dropdown: Sn
602
+ })
603
+ }),
604
+ Tooltip: Ot.extend({
605
+ defaultProps: {
606
+ zIndex: N
607
+ },
608
+ styles: wn
609
+ }),
610
+ Popover: Dt.extend({
611
+ defaultProps: {
612
+ zIndex: N
613
+ },
614
+ styles: In
615
+ }),
616
+ HoverCard: At.extend({
617
+ defaultProps: {
618
+ zIndex: N
619
+ },
620
+ styles: kn
621
+ })
622
+ }, En = {
623
+ xs: "10px",
624
+ sm: "11px",
625
+ // Our compact default
626
+ md: "13px",
627
+ lg: "14px",
628
+ xl: "16px"
629
+ }, An = {
630
+ xs: "4px",
631
+ sm: "6px",
632
+ md: "8px",
633
+ lg: "12px",
634
+ xl: "16px"
635
+ }, Dn = {
636
+ xs: "2px",
637
+ sm: "4px",
638
+ md: "6px",
639
+ lg: "8px",
640
+ xl: "12px"
641
+ }, On = Bt({
642
+ colors: jt,
643
+ fontSizes: En,
644
+ spacing: An,
645
+ radius: Dn,
646
+ // Disable focus ring outlines globally for a cleaner UI
647
+ // This is appropriate for dense/professional interfaces like design tools
648
+ focusRing: "never",
649
+ // Spread all component extensions into the theme
650
+ // Each extension object provides compact size support for a category of components
651
+ components: {
652
+ ...hn,
653
+ ...Zt,
654
+ ...nn,
655
+ ...dn,
656
+ ...gn,
657
+ ...yn,
658
+ ...Tn
659
+ }
660
+ }), lo = Vt(Ee, On), Fn = [
661
+ "#5B8FF9FF",
662
+ "#FF6B6BFF",
663
+ "#61D095FF",
664
+ "#F7B731FF",
665
+ "#9B59B6FF",
666
+ "#5B8FF980",
667
+ "#FF6B6B80",
668
+ "#61D09580",
669
+ "#F7B73180",
670
+ "#9B59B680"
671
+ ], le = "#888888", Ge = 255, je = 100;
672
+ function Xe(e) {
673
+ return Math.round(parseInt(e, 16) / Ge * je);
674
+ }
675
+ function Ke(e) {
676
+ return Math.round(e / je * Ge).toString(16).padStart(2, "0");
677
+ }
678
+ function co(e) {
679
+ let t = e.replace("#", "");
680
+ t.length === 3 ? t = `${t.split("").map((s) => s + s).join("")}ff` : t.length === 4 ? t = t.split("").map((s) => s + s).join("") : t.length === 6 && (t = `${t}ff`);
681
+ const a = `#${t.slice(0, 6)}`, n = t.slice(6, 8), i = Xe(n);
682
+ return { hex: a, opacity: i };
683
+ }
684
+ function po(e, t) {
685
+ const a = e.replace("#", ""), n = Ke(t);
686
+ return `#${a}${n}`;
687
+ }
688
+ function uo(e) {
689
+ return /^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e);
1001
690
  }
1002
- function Yt({ children: t }) {
1003
- return /* @__PURE__ */ o(A, { p: "sm", children: t });
691
+ const We = ge(null);
692
+ function Vn() {
693
+ return re(We);
1004
694
  }
1005
- const qt = [
695
+ function Bn({ children: e }) {
696
+ const t = R(null);
697
+ if (!Ne(e))
698
+ throw new Error("PopoutAnchor requires a single valid React element as its child");
699
+ const n = He(e, {
700
+ ref: t
701
+ });
702
+ return /* @__PURE__ */ o(We.Provider, { value: { anchorRef: t }, children: n });
703
+ }
704
+ function Rn({ children: e }) {
705
+ return /* @__PURE__ */ o(B, { p: "sm", children: e });
706
+ }
707
+ const Ln = [
1006
708
  // Mantine portal containers
1007
709
  "[data-portal]",
1008
710
  // Combobox/Select dropdowns
@@ -1020,492 +722,431 @@ const qt = [
1020
722
  // Modal (just in case)
1021
723
  "[data-modal]"
1022
724
  ].join(", ");
1023
- function Jt(t, e = !0) {
1024
- U(() => {
1025
- if (!e)
725
+ function Mn(e, t = !0) {
726
+ _(() => {
727
+ if (!t)
1026
728
  return;
1027
- const n = (i) => {
1028
- const a = i.target;
1029
- a.closest('[role="dialog"]') || a.closest("[data-popout-trigger]") || a.closest("[data-popout-portal-container]") || a.closest(qt) || t();
729
+ const a = (n) => {
730
+ const i = n.target;
731
+ i.closest('[role="dialog"]') || i.closest("[data-popout-trigger]") || i.closest("[data-popout-portal-container]") || i.closest(Ln) || e();
1030
732
  };
1031
- return document.addEventListener("mousedown", n), () => {
1032
- document.removeEventListener("mousedown", n);
733
+ return document.addEventListener("mousedown", a), () => {
734
+ document.removeEventListener("mousedown", a);
1033
735
  };
1034
- }, [t, e]);
736
+ }, [e, t]);
1035
737
  }
1036
- function Qt(t, e = !0) {
1037
- U(() => {
1038
- if (!e)
738
+ function _n(e, t = !0) {
739
+ _(() => {
740
+ if (!t)
1039
741
  return;
1040
- const n = (i) => {
1041
- i.key === "Escape" && (i.preventDefault(), t());
742
+ const a = (n) => {
743
+ n.key === "Escape" && (n.preventDefault(), e());
1042
744
  };
1043
- return document.addEventListener("keydown", n), () => {
1044
- document.removeEventListener("keydown", n);
745
+ return document.addEventListener("keydown", a), () => {
746
+ document.removeEventListener("keydown", a);
1045
747
  };
1046
- }, [t, e]);
748
+ }, [e, t]);
1047
749
  }
1048
- const pe = Ie(null), Oe = Ie(null);
1049
- function Ae() {
1050
- const t = ue(pe);
1051
- if (!t)
750
+ const he = ge(null), Ze = ge(null);
751
+ function xe() {
752
+ const e = re(he);
753
+ if (!e)
1052
754
  throw new Error("usePopoutContext must be used within a Popout component");
1053
- return t;
755
+ return e;
1054
756
  }
1055
- function er() {
1056
- return ue(pe);
757
+ function Nn() {
758
+ return re(he);
1057
759
  }
1058
- function tr() {
1059
- const t = ue(Oe);
1060
- if (!t)
760
+ function Hn() {
761
+ const e = re(Ze);
762
+ if (!e)
1061
763
  throw new Error("usePopoutManagerContext must be used within a PopoutManager");
1062
- return t;
764
+ return e;
1063
765
  }
1064
- function rr({ children: t, parentId: e = null }) {
1065
- const n = ke(), [i, a] = L(!1), r = G(null), s = _e(
766
+ function $n({ children: e, parentId: t = null }) {
767
+ const a = Ue(), [n, i] = L(!1), s = R(null), l = $e(
1066
768
  () => ({
1067
- id: n,
1068
- isOpen: i,
769
+ id: a,
770
+ isOpen: n,
1069
771
  open: () => {
1070
- a(!0);
772
+ i(!0);
1071
773
  },
1072
774
  close: () => {
1073
- a(!1);
775
+ i(!1);
1074
776
  },
1075
777
  toggle: () => {
1076
- a((c) => !c);
778
+ i((d) => !d);
1077
779
  },
1078
- triggerRef: r,
1079
- parentId: e
780
+ triggerRef: s,
781
+ parentId: t
1080
782
  }),
1081
- [n, i, e]
783
+ [a, n, t]
1082
784
  );
1083
- return /* @__PURE__ */ o(pe.Provider, { value: s, children: t });
785
+ return /* @__PURE__ */ o(he.Provider, { value: l, children: e });
1084
786
  }
1085
- function or({ children: t }) {
1086
- const [e, n] = L(null), i = G([]), a = G(/* @__PURE__ */ new Map()), r = G(/* @__PURE__ */ new Map()), [s, c] = L(0), g = T((p, m, P) => {
1087
- var w, M;
1088
- if (!i.current.includes(p)) {
1089
- const K = i.current, N = [];
1090
- for (const d of K)
1091
- r.current.get(d) === (P ?? null) && N.push(d);
1092
- for (const d of N.reverse()) {
1093
- const E = [];
1094
- for (const k of K) {
1095
- let y = k;
1096
- for (; y; ) {
1097
- const Y = r.current.get(y);
1098
- if (Y === d) {
1099
- E.push(k);
1100
- break;
1101
- }
1102
- y = Y ?? null;
1103
- }
787
+ function Un({ children: e }) {
788
+ const [t, a] = L(null), n = R([]), i = R(/* @__PURE__ */ new Map()), s = R(/* @__PURE__ */ new Map()), [l, d] = L(0), b = z((c) => {
789
+ const r = [];
790
+ for (const p of n.current)
791
+ (s.current.get(p) ?? null) === c && r.push(p);
792
+ return r;
793
+ }, []), h = z((c) => {
794
+ const r = [];
795
+ for (const p of n.current) {
796
+ let g = p;
797
+ for (; g; ) {
798
+ const O = s.current.get(g) ?? null;
799
+ if (O === c) {
800
+ r.push(p);
801
+ break;
1104
802
  }
1105
- for (const k of E.reverse())
1106
- (w = a.current.get(k)) == null || w();
1107
- (M = a.current.get(d)) == null || M();
803
+ g = O;
1108
804
  }
1109
- i.current = [...i.current.filter((d) => !N.includes(d) && !N.some((E) => {
1110
- let k = d;
1111
- for (; k; ) {
1112
- const y = r.current.get(k);
1113
- if (y === E)
1114
- return !0;
1115
- k = y ?? null;
1116
- }
1117
- return !1;
1118
- })), p], a.current.set(p, m), r.current.set(p, P ?? null), c((d) => d + 1);
1119
805
  }
1120
- }, []), b = T((p) => {
1121
- i.current = i.current.filter((m) => m !== p), a.current.delete(p), r.current.delete(p), c((m) => m + 1);
1122
- }, []), z = T((p) => {
1123
- const m = i.current.indexOf(p);
1124
- return m >= 0 ? xe + m : xe;
1125
- }, []), h = T((p) => {
1126
- const m = i.current, P = m.indexOf(p);
1127
- P === -1 || P === m.length - 1 || (i.current = [
1128
- ...m.filter((w) => w !== p),
1129
- p
1130
- ], c((w) => w + 1));
1131
- }, []), u = T((p) => r.current.get(p) ?? null, []), f = T((p, m) => {
1132
- let P = m;
1133
- for (; P; ) {
1134
- const w = r.current.get(P);
1135
- if (w === p)
806
+ return r;
807
+ }, []), x = z((c) => {
808
+ let r = 0, p = c;
809
+ for (; p; ) {
810
+ const g = s.current.get(p) ?? null;
811
+ if (!g)
812
+ break;
813
+ r++, p = g;
814
+ }
815
+ return r;
816
+ }, []), m = z((c) => {
817
+ var p;
818
+ const r = [...c].sort((g, O) => x(O) - x(g));
819
+ for (const g of r)
820
+ (p = i.current.get(g)) == null || p();
821
+ }, [x]), u = z((c, r, p) => {
822
+ if (n.current.includes(c))
823
+ return;
824
+ const g = p ?? null, O = b(g), G = [];
825
+ for (const S of O)
826
+ G.push(S), G.push(...h(S));
827
+ m(G);
828
+ const q = new Set(G);
829
+ n.current = n.current.filter((S) => !q.has(S)), n.current.push(c), i.current.set(c, r), s.current.set(c, g), d((S) => S + 1);
830
+ }, [b, h, m]), P = z((c) => {
831
+ n.current = n.current.filter((r) => r !== c), i.current.delete(c), s.current.delete(c), d((r) => r + 1);
832
+ }, []), A = z((c) => {
833
+ const r = n.current.indexOf(c);
834
+ return r >= 0 ? we + r : we;
835
+ }, []), f = z((c) => {
836
+ const r = n.current, p = r.indexOf(c);
837
+ p === -1 || p === r.length - 1 || (n.current = [
838
+ ...r.filter((g) => g !== c),
839
+ c
840
+ ], d((g) => g + 1));
841
+ }, []), v = z((c) => s.current.get(c) ?? null, []), C = z((c, r) => {
842
+ let p = r;
843
+ for (; p; ) {
844
+ const g = s.current.get(p);
845
+ if (g === c)
1136
846
  return !0;
1137
- P = w ?? null;
847
+ p = g ?? null;
1138
848
  }
1139
849
  return !1;
1140
- }, []), F = T((p) => {
1141
- const m = [], P = i.current;
1142
- for (const w of P)
1143
- f(p, w) && m.push(w);
1144
- return m;
1145
- }, [f]), l = T((p) => {
1146
- const m = F(p);
1147
- for (const P of [...m].reverse()) {
1148
- const w = a.current.get(P);
1149
- w == null || w();
850
+ }, []), w = z((c) => {
851
+ const r = [], p = n.current;
852
+ for (const g of p)
853
+ C(c, g) && r.push(g);
854
+ return r;
855
+ }, [C]), D = z((c) => {
856
+ const r = w(c);
857
+ for (const p of [...r].reverse()) {
858
+ const g = i.current.get(p);
859
+ g == null || g();
1150
860
  }
1151
- }, [F]), x = T((p) => {
1152
- l(p);
1153
- const m = a.current.get(p);
1154
- m == null || m();
1155
- }, [l]), v = T((p, m) => {
1156
- const P = i.current;
1157
- for (const w of P) {
1158
- if (w === p)
861
+ }, [w]), k = z((c) => {
862
+ D(c);
863
+ const r = i.current.get(c);
864
+ r == null || r();
865
+ }, [D]), T = z((c, r) => {
866
+ const p = n.current;
867
+ for (const g of p) {
868
+ if (g === c)
1159
869
  continue;
1160
- r.current.get(w) === m && x(w);
870
+ s.current.get(g) === r && k(g);
1161
871
  }
1162
- }, [x]), _ = T(() => {
1163
- const p = i.current;
1164
- if (p.length === 0)
872
+ }, [k]), F = z(() => {
873
+ const c = n.current;
874
+ if (c.length === 0)
1165
875
  return;
1166
- const m = p[p.length - 1], P = a.current.get(m);
1167
- P == null || P();
1168
- }, []), O = T(() => {
1169
- const p = [...i.current];
1170
- for (const m of p) {
1171
- const P = a.current.get(m);
1172
- P == null || P();
876
+ const r = c[c.length - 1], p = i.current.get(r);
877
+ p == null || p();
878
+ }, []), H = z(() => {
879
+ const c = [...n.current];
880
+ for (const r of c) {
881
+ const p = i.current.get(r);
882
+ p == null || p();
1173
883
  }
1174
- }, []), I = T(() => i.current.length > 0, []), [$, j] = L(!1);
1175
- U(() => {
1176
- j(i.current.length > 0);
1177
- }, [s]), Qt(_, $), Jt(O, $);
1178
- const q = _e(
884
+ }, []), Z = z(() => n.current.length > 0, []), [$, U] = L(!1);
885
+ _(() => {
886
+ U(n.current.length > 0);
887
+ }, [l]), _n(F, $), Mn(H, $);
888
+ const Q = $e(
1179
889
  () => ({
1180
- register: g,
1181
- unregister: b,
1182
- getZIndex: z,
1183
- bringToFront: h,
1184
- portalContainer: e,
1185
- zIndexVersion: s,
1186
- closeFocused: _,
1187
- closeAll: O,
1188
- hasOpenPopouts: I,
1189
- closeWithDescendants: x,
1190
- closeDescendants: l,
1191
- closeSiblings: v,
1192
- getParentId: u,
1193
- isAncestor: f
890
+ register: u,
891
+ unregister: P,
892
+ getZIndex: A,
893
+ bringToFront: f,
894
+ portalContainer: t,
895
+ zIndexVersion: l,
896
+ closeFocused: F,
897
+ closeAll: H,
898
+ hasOpenPopouts: Z,
899
+ closeWithDescendants: k,
900
+ closeDescendants: D,
901
+ closeSiblings: T,
902
+ getParentId: v,
903
+ isAncestor: C
1194
904
  }),
1195
- [g, b, z, h, e, s, _, O, I, x, l, v, u, f]
905
+ [u, P, A, f, t, l, F, H, Z, k, D, T, v, C]
1196
906
  );
1197
- return /* @__PURE__ */ S(Oe.Provider, { value: q, children: [
1198
- t,
1199
- /* @__PURE__ */ o("div", { ref: n, "data-popout-portal-container": !0 })
907
+ return /* @__PURE__ */ y(Ze.Provider, { value: Q, children: [
908
+ e,
909
+ /* @__PURE__ */ o("div", { ref: a, "data-popout-portal-container": !0 })
1200
910
  ] });
1201
911
  }
1202
- function nr(t) {
1203
- const { isOpen: e, onDragStart: n } = t, [i, a] = L({ left: 0, top: 0 }), r = G(!1), s = G({
912
+ function Gn(e) {
913
+ const { isOpen: t, onDragStart: a } = e, [n, i] = L({ left: 0, top: 0 }), s = R(!1), l = R({
1204
914
  x: 0,
1205
915
  y: 0,
1206
916
  offsetLeft: 0,
1207
917
  offsetTop: 0
1208
- }), c = T(() => {
1209
- a({ left: 0, top: 0 });
1210
- }, []), g = T(
1211
- (h) => {
1212
- const u = h.target;
1213
- u.tagName === "INPUT" || u.tagName === "TEXTAREA" || u.tagName === "BUTTON" || u.tagName === "SELECT" || u.closest("button") || u.closest("input") || u.closest("textarea") || u.closest("select") || (r.current = !0, s.current = {
1214
- x: h.clientX,
1215
- y: h.clientY,
1216
- offsetLeft: i.left,
1217
- offsetTop: i.top
1218
- }, n == null || n(), h.target.setPointerCapture(h.pointerId));
918
+ }), d = z(() => {
919
+ i({ left: 0, top: 0 });
920
+ }, []), b = z(
921
+ (m) => {
922
+ const u = m.target;
923
+ u.tagName === "INPUT" || u.tagName === "TEXTAREA" || u.tagName === "BUTTON" || u.tagName === "SELECT" || u.closest("button") || u.closest("input") || u.closest("textarea") || u.closest("select") || (s.current = !0, l.current = {
924
+ x: m.clientX,
925
+ y: m.clientY,
926
+ offsetLeft: n.left,
927
+ offsetTop: n.top
928
+ }, a == null || a(), m.target.setPointerCapture(m.pointerId));
1219
929
  },
1220
- [i.left, i.top, n]
1221
- ), b = T((h) => {
1222
- if (!r.current)
930
+ [n.left, n.top, a]
931
+ ), h = z((m) => {
932
+ if (!s.current)
1223
933
  return;
1224
- const u = h.clientX - s.current.x, f = h.clientY - s.current.y;
1225
- a({
1226
- left: s.current.offsetLeft + u,
1227
- top: s.current.offsetTop + f
934
+ const u = m.clientX - l.current.x, P = m.clientY - l.current.y;
935
+ i({
936
+ left: l.current.offsetLeft + u,
937
+ top: l.current.offsetTop + P
1228
938
  });
1229
- }, []), z = T((h) => {
1230
- r.current && (r.current = !1, h.target.releasePointerCapture(h.pointerId));
939
+ }, []), x = z((m) => {
940
+ s.current && (s.current = !1, m.target.releasePointerCapture(m.pointerId));
1231
941
  }, []);
1232
- return e ? {
942
+ return t ? {
1233
943
  dragTriggerProps: {
1234
944
  "data-drag-trigger": !0,
1235
- onPointerDown: g,
1236
- onPointerMove: b,
1237
- onPointerUp: z,
945
+ onPointerDown: b,
946
+ onPointerMove: h,
947
+ onPointerUp: x,
1238
948
  style: {
1239
949
  cursor: "grab",
1240
950
  userSelect: "none",
1241
951
  touchAction: "none"
1242
952
  }
1243
953
  },
1244
- dragOffset: i,
1245
- resetDragOffset: c
954
+ dragOffset: n,
955
+ resetDragOffset: d
1246
956
  } : {
1247
957
  dragTriggerProps: {},
1248
958
  dragOffset: { left: 0, top: 0 },
1249
- resetDragOffset: c
959
+ resetDragOffset: d
1250
960
  };
1251
961
  }
1252
- function ir({ id: t, label: e, isActive: n, onClick: i }) {
1253
- return /* @__PURE__ */ o(
1254
- _t,
1255
- {
1256
- role: "tab",
1257
- id: `tab-${t}`,
1258
- "aria-selected": n,
1259
- "aria-controls": `tabpanel-${t}`,
1260
- onClick: i,
1261
- px: "xs",
1262
- py: 3,
1263
- style: {
1264
- fontSize: "11px",
1265
- fontWeight: n ? 500 : 400,
1266
- color: n ? "var(--mantine-color-text)" : "var(--mantine-color-dimmed)",
1267
- borderBottom: n ? "2px solid var(--mantine-color-blue-filled)" : "2px solid transparent",
1268
- cursor: "pointer"
1269
- },
1270
- children: e
1271
- }
1272
- );
1273
- }
1274
- function ar({
1275
- config: t,
1276
- onClose: e,
1277
- dragTriggerProps: n = {},
1278
- actions: i = [],
1279
- activeTab: a,
1280
- onTabChange: r,
1281
- titleId: s
962
+ function jn({
963
+ config: e,
964
+ onClose: t,
965
+ dragTriggerProps: a = {},
966
+ actions: n = [],
967
+ activeTab: i,
968
+ onTabChange: s,
969
+ titleId: l
1282
970
  }) {
1283
971
  var u;
1284
- const { style: c, ...g } = n, z = t.variant === "tabs" ? t : null, h = (f) => {
1285
- r && r(f);
1286
- };
1287
- return /* @__PURE__ */ S(
1288
- R,
972
+ const { style: d, ...b } = a, x = e.variant === "tabs" ? e : null, m = (x == null ? void 0 : x.tabs.map((P) => ({
973
+ value: P.id,
974
+ label: P.label
975
+ }))) ?? [];
976
+ return /* @__PURE__ */ y(
977
+ E,
1289
978
  {
1290
979
  justify: "space-between",
1291
980
  px: "sm",
1292
981
  py: "xs",
1293
- ...g,
982
+ ...b,
1294
983
  style: {
1295
- ...c
984
+ ...d
1296
985
  },
1297
986
  children: [
1298
- t.variant === "title" ? /* @__PURE__ */ o(H, { id: s, size: "compact", fw: 500, children: t.title }) : /* @__PURE__ */ S(R, { gap: 0, role: "tablist", "aria-label": "Panel tabs", children: [
1299
- /* @__PURE__ */ o("span", { id: s, style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0, 0, 0, 0)" }, children: ((u = z == null ? void 0 : z.tabs[0]) == null ? void 0 : u.label) ?? "Settings" }),
1300
- z == null ? void 0 : z.tabs.map((f) => /* @__PURE__ */ o(
1301
- ir,
987
+ e.variant === "title" ? /* @__PURE__ */ o(M, { id: l, size: "sm", fw: 500, children: e.title }) : /* @__PURE__ */ y(Le, { children: [
988
+ /* @__PURE__ */ o("span", { id: l, style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0, 0, 0, 0)" }, children: ((u = x == null ? void 0 : x.tabs[0]) == null ? void 0 : u.label) ?? "Settings" }),
989
+ /* @__PURE__ */ o(
990
+ Oe,
1302
991
  {
1303
- id: f.id,
1304
- label: f.label,
1305
- isActive: a === f.id,
1306
- onClick: () => {
1307
- h(f.id);
1308
- }
1309
- },
1310
- f.id
1311
- ))
992
+ data: m,
993
+ value: i,
994
+ onChange: (P) => s == null ? void 0 : s(P),
995
+ size: "xs"
996
+ }
997
+ )
1312
998
  ] }),
1313
- /* @__PURE__ */ S(R, { gap: 4, children: [
1314
- i.map((f) => /* @__PURE__ */ o(
1315
- D,
999
+ /* @__PURE__ */ y(E, { gap: 4, children: [
1000
+ n.map((P) => /* @__PURE__ */ o(
1001
+ V,
1316
1002
  {
1317
1003
  variant: "subtle",
1318
- size: "compact",
1319
- onClick: f.onClick,
1320
- "aria-label": f.label,
1321
- children: f.icon
1004
+ onClick: P.onClick,
1005
+ "aria-label": P.label,
1006
+ children: P.icon
1322
1007
  },
1323
- f.id
1008
+ P.id
1324
1009
  )),
1325
- /* @__PURE__ */ o(D, { variant: "subtle", size: "compact", onClick: e, "aria-label": "Close panel", children: /* @__PURE__ */ o(ne, { size: 14 }) })
1010
+ /* @__PURE__ */ o(Ae, { size: "sm", onClick: t, "aria-label": "Close panel" })
1326
1011
  ] })
1327
1012
  ]
1328
1013
  }
1329
1014
  );
1330
1015
  }
1331
- function sr(t, e, n = Vt, i = {}) {
1332
- const { placement: a = "left", alignment: r = "start", panelHeight: s = 0 } = i;
1333
- let c, g;
1334
- switch (a) {
1016
+ function Xn(e, t, a = mn, n = {}) {
1017
+ const { placement: i = "left", alignment: s = "start", panelHeight: l = 0 } = n;
1018
+ let d, b;
1019
+ switch (i) {
1335
1020
  case "left":
1336
- c = t.left - e - n, g = be(t, r, s);
1021
+ d = e.left - t - a, b = ke(e, s, l);
1337
1022
  break;
1338
1023
  case "right":
1339
- c = t.right + n, g = be(t, r, s);
1024
+ d = e.right + a, b = ke(e, s, l);
1340
1025
  break;
1341
1026
  case "top":
1342
- c = ze(t, r, e), g = t.top - s - n;
1027
+ d = Te(e, s, t), b = e.top - l - a;
1343
1028
  break;
1344
1029
  case "bottom":
1345
- c = ze(t, r, e), g = t.bottom + n;
1030
+ d = Te(e, s, t), b = e.bottom + a;
1346
1031
  break;
1347
1032
  default: {
1348
- const b = a;
1349
- throw new Error(`Unknown placement: ${String(b)}`);
1033
+ const h = i;
1034
+ throw new Error(`Unknown placement: ${String(h)}`);
1350
1035
  }
1351
1036
  }
1352
- return { left: c, top: g };
1037
+ return { left: d, top: b };
1353
1038
  }
1354
- function be(t, e, n) {
1355
- switch (e) {
1039
+ function ke(e, t, a) {
1040
+ switch (t) {
1356
1041
  case "start":
1357
- return t.top;
1042
+ return e.top;
1358
1043
  case "center":
1359
- return t.top + t.height / 2 - n / 2;
1044
+ return e.top + e.height / 2 - a / 2;
1360
1045
  case "end":
1361
- return t.bottom - n;
1046
+ return e.bottom - a;
1362
1047
  default: {
1363
- const i = e;
1364
- throw new Error(`Unknown alignment: ${String(i)}`);
1048
+ const n = t;
1049
+ throw new Error(`Unknown alignment: ${String(n)}`);
1365
1050
  }
1366
1051
  }
1367
1052
  }
1368
- function ze(t, e, n) {
1369
- switch (e) {
1053
+ function Te(e, t, a) {
1054
+ switch (t) {
1370
1055
  case "start":
1371
- return t.left;
1056
+ return e.left;
1372
1057
  case "center":
1373
- return t.left + t.width / 2 - n / 2;
1058
+ return e.left + e.width / 2 - a / 2;
1374
1059
  case "end":
1375
- return t.right - n;
1060
+ return e.right - a;
1376
1061
  default: {
1377
- const i = e;
1378
- throw new Error(`Unknown alignment: ${String(i)}`);
1062
+ const n = t;
1063
+ throw new Error(`Unknown alignment: ${String(n)}`);
1379
1064
  }
1380
1065
  }
1381
1066
  }
1382
- function lr({
1383
- width: t,
1384
- height: e,
1385
- header: n,
1386
- children: i,
1387
- anchorRef: a,
1388
- placement: r = "left",
1389
- alignment: s = "start",
1390
- gap: c = 0,
1391
- actions: g
1067
+ function Kn({
1068
+ width: e,
1069
+ height: t,
1070
+ header: a,
1071
+ children: n,
1072
+ anchorRef: i,
1073
+ placement: s = "left",
1074
+ alignment: l = "start",
1075
+ gap: d = 0,
1076
+ actions: b
1392
1077
  }) {
1393
- var ge, he;
1394
- const { isOpen: b, close: z, triggerRef: h, id: u, parentId: f } = Ae(), { getZIndex: F, portalContainer: l, register: x, unregister: v, bringToFront: _, zIndexVersion: O, closeWithDescendants: I, closeDescendants: $ } = tr(), j = ke(), q = `popout-panel-${u}`, p = `popout-title-${j}`, [m, P] = L(null), w = G(!1), M = G(null), K = T(() => {
1395
- _(u);
1396
- }, [_, u]), { dragTriggerProps: N, dragOffset: d, resetDragOffset: E } = nr({
1397
- isOpen: b,
1398
- onDragStart: K
1399
- }), k = n.variant === "tabs", y = k ? n : null, Y = (y == null ? void 0 : y.defaultTab) ?? ((ge = y == null ? void 0 : y.tabs[0]) == null ? void 0 : ge.id), [de, fe] = L(Y), Le = T(
1400
- (C) => {
1401
- var X;
1402
- fe(C), (X = y == null ? void 0 : y.onTabChange) == null || X.call(y, C);
1078
+ var Ce, ze;
1079
+ const { isOpen: h, close: x, triggerRef: m, id: u, parentId: P } = xe(), { getZIndex: A, portalContainer: f, register: v, unregister: C, bringToFront: w, zIndexVersion: D, closeWithDescendants: k, closeDescendants: T } = Hn(), F = Vn(), H = Ue(), Z = `popout-panel-${u}`, $ = `popout-title-${H}`, [U, Q] = L(null), c = R(!1), r = R(null), p = z(() => {
1080
+ w(u);
1081
+ }, [w, u]), { dragTriggerProps: g, dragOffset: O, resetDragOffset: G } = Gn({
1082
+ isOpen: h,
1083
+ onDragStart: p
1084
+ }), q = a.variant === "tabs", S = q ? a : null, se = (S == null ? void 0 : S.defaultTab) ?? ((Ce = S == null ? void 0 : S.tabs[0]) == null ? void 0 : Ce.id), [ve, be] = L(se), qe = z(
1085
+ (I) => {
1086
+ var j;
1087
+ be(I), (j = S == null ? void 0 : S.onTabChange) == null || j.call(S, I);
1403
1088
  },
1404
- [y]
1405
- ), De = T(
1406
- (C) => {
1407
- C.stopPropagation(), $(u), _(u);
1089
+ [S]
1090
+ ), Ye = z(
1091
+ (I) => {
1092
+ I.stopPropagation(), T(u), w(u);
1408
1093
  },
1409
- [$, _, u]
1410
- ), $e = T(() => {
1411
- I(u);
1412
- }, [I, u]);
1413
- if (U(() => (b ? x(u, z, f) : v(u), () => {
1414
- v(u);
1415
- }), [b, u, x, v, z, f]), U(() => {
1416
- if (b) {
1417
- let C = (a == null ? void 0 : a.current) ?? null;
1418
- if (!C && f && (C = document.querySelector(`[data-popout-id="${f}"]`)), C || (C = h.current), C) {
1419
- const X = C.getBoundingClientRect(), Ue = sr(X, t, c, {
1420
- placement: r,
1421
- alignment: s,
1422
- panelHeight: e
1094
+ [T, w, u]
1095
+ ), Je = z(() => {
1096
+ k(u);
1097
+ }, [k, u]);
1098
+ if (_(() => (h ? v(u, x, P) : C(u), () => {
1099
+ C(u);
1100
+ }), [h, u, v, C, x, P]), _(() => {
1101
+ if (h) {
1102
+ let I = (i == null ? void 0 : i.current) ?? null;
1103
+ if (!I && (F != null && F.anchorRef.current) && (I = F.anchorRef.current), !I && P && (I = document.querySelector(`[data-popout-id="${P}"]`)), I || (I = m.current), I) {
1104
+ const j = I.getBoundingClientRect(), tt = Xn(j, e, d, {
1105
+ placement: s,
1106
+ alignment: l,
1107
+ panelHeight: t
1423
1108
  });
1424
- P(Ue), w.current || (E(), k && fe(Y));
1109
+ Q(tt), c.current || (G(), q && be(se));
1425
1110
  }
1426
1111
  }
1427
- w.current = b;
1428
- }, [b, t, e, c, h, a, r, s, E, k, Y, f]), U(() => {
1429
- if (b && M.current) {
1430
- const C = setTimeout(() => {
1431
- var X;
1432
- (X = M.current) == null || X.focus();
1112
+ c.current = h;
1113
+ }, [h, e, t, d, m, i, s, l, G, q, se, P, F]), _(() => {
1114
+ if (h && r.current) {
1115
+ const I = setTimeout(() => {
1116
+ var j;
1117
+ (j = r.current) == null || j.focus();
1433
1118
  }, 0);
1434
1119
  return () => {
1435
- clearTimeout(C);
1120
+ clearTimeout(I);
1436
1121
  };
1437
- } else !b && h.current && h.current.focus();
1438
- }, [b, h]), !b || !l || !m)
1122
+ } else !h && m.current && m.current.focus();
1123
+ }, [h, m]), !h || !f || !U)
1439
1124
  return null;
1440
- const He = F(u), me = {
1441
- left: m.left + d.left,
1442
- top: m.top + d.top
1443
- }, J = "1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))", te = "none", ie = a !== void 0 || f !== void 0, Me = () => ie ? {
1444
- borderTop: r === "bottom" ? te : J,
1445
- borderRight: r === "left" ? te : J,
1446
- borderBottom: r === "top" ? te : J,
1447
- borderLeft: r === "right" ? te : J
1448
- } : { border: J }, Ne = () => {
1449
- if (!ie)
1450
- return {};
1451
- const C = 8;
1452
- switch (r) {
1453
- case "left":
1454
- return {
1455
- borderTopLeftRadius: C,
1456
- borderBottomLeftRadius: C,
1457
- borderTopRightRadius: 0,
1458
- borderBottomRightRadius: 0
1459
- };
1460
- case "right":
1461
- return {
1462
- borderTopLeftRadius: 0,
1463
- borderBottomLeftRadius: 0,
1464
- borderTopRightRadius: C,
1465
- borderBottomRightRadius: C
1466
- };
1467
- case "top":
1468
- return {
1469
- borderTopLeftRadius: C,
1470
- borderTopRightRadius: C,
1471
- borderBottomLeftRadius: 0,
1472
- borderBottomRightRadius: 0
1473
- };
1474
- case "bottom":
1475
- return {
1476
- borderTopLeftRadius: 0,
1477
- borderTopRightRadius: 0,
1478
- borderBottomLeftRadius: C,
1479
- borderBottomRightRadius: C
1480
- };
1481
- default:
1482
- return {};
1483
- }
1484
- }, Ve = /* @__PURE__ */ S(
1485
- It,
1125
+ const Qe = A(u), Pe = {
1126
+ left: U.left + O.left,
1127
+ top: U.top + O.top
1128
+ }, et = /* @__PURE__ */ y(
1129
+ Rt,
1486
1130
  {
1487
- ref: M,
1488
- id: q,
1131
+ ref: r,
1132
+ id: Z,
1489
1133
  role: "dialog",
1490
1134
  "aria-modal": "false",
1491
- "aria-labelledby": p,
1135
+ "aria-labelledby": $,
1492
1136
  tabIndex: -1,
1493
- radius: ie ? 0 : 8,
1494
- onClick: De,
1137
+ radius: 8,
1138
+ onClick: Ye,
1495
1139
  "data-popout-id": u,
1496
- ...f && { "data-parent-id": f },
1140
+ ...P && { "data-parent-id": P },
1497
1141
  style: {
1498
1142
  position: "fixed",
1499
- left: me.left,
1500
- top: me.top,
1501
- width: t,
1502
- ...e !== void 0 && { height: e },
1503
- zIndex: He,
1143
+ left: Pe.left,
1144
+ top: Pe.top,
1145
+ minWidth: e,
1146
+ ...t !== void 0 && { minHeight: t },
1147
+ zIndex: Qe,
1504
1148
  backgroundColor: "var(--mantine-color-body)",
1505
- // Conditional borders for pixel-perfect edge alignment with anchor
1506
- ...Me(),
1507
- // Conditional border radius - flatten corners on snapping side
1508
- ...Ne(),
1149
+ border: "1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",
1509
1150
  // Figma-style shadows: tight, hard near edges, softer further out
1510
1151
  boxShadow: [
1511
1152
  "0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))",
@@ -1520,116 +1161,536 @@ function lr({
1520
1161
  },
1521
1162
  children: [
1522
1163
  /* @__PURE__ */ o(
1523
- ar,
1164
+ jn,
1524
1165
  {
1525
- config: n,
1526
- onClose: $e,
1527
- dragTriggerProps: N,
1528
- activeTab: de,
1529
- onTabChange: Le,
1530
- actions: g,
1531
- titleId: p
1166
+ config: a,
1167
+ onClose: Je,
1168
+ dragTriggerProps: g,
1169
+ activeTab: ve,
1170
+ onTabChange: qe,
1171
+ actions: b,
1172
+ titleId: $
1532
1173
  }
1533
1174
  ),
1534
- /* @__PURE__ */ o(A, { children: k ? (he = y == null ? void 0 : y.tabs.find((C) => C.id === de)) == null ? void 0 : he.content : i })
1175
+ /* @__PURE__ */ o(B, { children: q ? (ze = S == null ? void 0 : S.tabs.find((I) => I.id === ve)) == null ? void 0 : ze.content : n })
1535
1176
  ]
1536
1177
  }
1537
1178
  );
1538
- return At(Ve, l);
1179
+ return Ut(et, f);
1539
1180
  }
1540
- function cr({ children: t }) {
1541
- const { toggle: e, triggerRef: n, isOpen: i, id: a } = Ae(), r = T(
1542
- (g) => {
1543
- g.stopPropagation(), e();
1181
+ function Wn({ children: e }) {
1182
+ const { toggle: t, triggerRef: a, isOpen: n, id: i } = xe(), s = z(
1183
+ (b) => {
1184
+ b.stopPropagation(), t();
1544
1185
  },
1545
- [e]
1186
+ [t]
1546
1187
  );
1547
- if (!Et(t))
1188
+ if (!Ne(e))
1548
1189
  throw new Error("PopoutTrigger requires a single valid React element as its child");
1549
- const s = `popout-panel-${a}`, c = t;
1550
- return Ot(c, {
1551
- onClick: (g) => {
1552
- var b, z;
1553
- (z = (b = c.props).onClick) == null || z.call(b, g), r(g);
1190
+ const l = `popout-panel-${i}`, d = e;
1191
+ return He(d, {
1192
+ onClick: (b) => {
1193
+ var h, x;
1194
+ (x = (h = d.props).onClick) == null || x.call(h, b), s(b);
1554
1195
  },
1555
- ref: n,
1196
+ ref: a,
1556
1197
  // Mark this element as a popout trigger for click-outside detection
1557
1198
  "data-popout-trigger": !0,
1558
1199
  // ARIA attributes for accessibility
1559
- "aria-expanded": i,
1560
- "aria-controls": s,
1200
+ "aria-expanded": n,
1201
+ "aria-controls": l,
1561
1202
  "aria-haspopup": "dialog"
1562
1203
  });
1563
1204
  }
1564
- function ur({ children: t }) {
1565
- const e = er(), n = (e == null ? void 0 : e.id) ?? null;
1566
- return /* @__PURE__ */ o(rr, { parentId: n, children: t });
1205
+ function Zn({ children: e }) {
1206
+ const t = Nn(), a = (t == null ? void 0 : t.id) ?? null;
1207
+ return /* @__PURE__ */ o($n, { parentId: a, children: e });
1208
+ }
1209
+ const oe = Object.assign(Zn, {
1210
+ Trigger: Wn,
1211
+ Panel: Kn,
1212
+ Content: Rn,
1213
+ Anchor: Bn
1214
+ }), fo = $t(
1215
+ function({ icon: t, size: a = "xs", ...n }, i) {
1216
+ const { isOpen: s } = xe();
1217
+ return /* @__PURE__ */ o(
1218
+ V,
1219
+ {
1220
+ ref: i,
1221
+ variant: s ? "light" : "subtle",
1222
+ size: a,
1223
+ c: s ? void 0 : "dimmed",
1224
+ ...n,
1225
+ children: t
1226
+ }
1227
+ );
1228
+ }
1229
+ );
1230
+ function go({ children: e }) {
1231
+ return /* @__PURE__ */ o(Un, { children: e });
1232
+ }
1233
+ function qn({
1234
+ color: e,
1235
+ defaultColor: t,
1236
+ opacity: a,
1237
+ defaultOpacity: n = 100,
1238
+ onColorChange: i,
1239
+ onOpacityChange: s,
1240
+ label: l,
1241
+ showOpacity: d = !0
1242
+ }) {
1243
+ const [b, h] = W({
1244
+ value: e,
1245
+ defaultValue: void 0,
1246
+ finalValue: void 0,
1247
+ onChange: i
1248
+ }), [x, m] = W({
1249
+ value: a,
1250
+ defaultValue: void 0,
1251
+ finalValue: void 0,
1252
+ onChange: s
1253
+ }), u = b === void 0, P = x === void 0, A = u && (!d || P), f = b ?? t, v = x ?? n, [C, w] = L(f.replace("#", "").toUpperCase()), [D, k] = L(v);
1254
+ _(() => {
1255
+ w(f.replace("#", "").toUpperCase());
1256
+ }, [f]), _(() => {
1257
+ k(v);
1258
+ }, [v]);
1259
+ const T = (r) => {
1260
+ if (r.length === 9) {
1261
+ const p = r.slice(0, 7).toUpperCase(), g = r.slice(7, 9), O = Xe(g);
1262
+ h(p), d && m(O);
1263
+ } else
1264
+ h(r.toUpperCase());
1265
+ }, F = () => {
1266
+ const r = Ke(v);
1267
+ return `${f}${r}`.toUpperCase();
1268
+ }, H = (r) => {
1269
+ w(r.currentTarget.value.toUpperCase());
1270
+ }, Z = () => {
1271
+ let r = C.toUpperCase();
1272
+ r && !r.startsWith("#") && (r = `#${r}`), /^#[0-9A-F]{6}$/i.test(r) && r !== f ? h(r) : w(f.replace("#", "").toUpperCase());
1273
+ }, $ = (r) => {
1274
+ k(r);
1275
+ }, U = () => {
1276
+ const r = typeof D == "string" ? parseFloat(D) : D;
1277
+ if (isNaN(r))
1278
+ k(v);
1279
+ else {
1280
+ const p = Math.min(100, Math.max(0, r));
1281
+ p !== v && m(p);
1282
+ }
1283
+ }, Q = () => {
1284
+ h(void 0), d && m(void 0);
1285
+ }, c = /* @__PURE__ */ y(E, { gap: 4, wrap: "nowrap", children: [
1286
+ /* @__PURE__ */ y(E, { gap: 0, children: [
1287
+ /* @__PURE__ */ y(oe, { children: [
1288
+ /* @__PURE__ */ o(oe.Trigger, { children: /* @__PURE__ */ o(
1289
+ V,
1290
+ {
1291
+ variant: "filled",
1292
+ size: 24,
1293
+ radius: 0,
1294
+ style: {
1295
+ backgroundColor: "var(--mantine-color-default)",
1296
+ borderRadius: "4px 0 0 4px"
1297
+ },
1298
+ "aria-label": "Color swatch",
1299
+ children: /* @__PURE__ */ o(
1300
+ Lt,
1301
+ {
1302
+ color: f,
1303
+ size: 14,
1304
+ radius: 2,
1305
+ style: {
1306
+ border: "1px solid var(--mantine-color-default-border)"
1307
+ }
1308
+ }
1309
+ )
1310
+ }
1311
+ ) }),
1312
+ /* @__PURE__ */ o(
1313
+ oe.Panel,
1314
+ {
1315
+ width: 220,
1316
+ header: { variant: "title", title: l ?? "Color" },
1317
+ placement: "bottom",
1318
+ alignment: "start",
1319
+ gap: 4,
1320
+ children: /* @__PURE__ */ o(oe.Content, { children: /* @__PURE__ */ o(
1321
+ Mt,
1322
+ {
1323
+ format: "hexa",
1324
+ value: F(),
1325
+ onChange: T,
1326
+ swatches: [...Fn]
1327
+ }
1328
+ ) })
1329
+ }
1330
+ )
1331
+ ] }),
1332
+ /* @__PURE__ */ o(
1333
+ Ve,
1334
+ {
1335
+ value: C,
1336
+ onChange: H,
1337
+ onBlur: Z,
1338
+ "aria-label": "Color hex value",
1339
+ "data-is-default": u ? "true" : "false",
1340
+ w: 72,
1341
+ styles: {
1342
+ input: {
1343
+ borderRadius: d ? 0 : "0 4px 4px 0",
1344
+ fontFamily: "monospace",
1345
+ textTransform: "uppercase",
1346
+ ...u ? {
1347
+ fontStyle: "italic",
1348
+ color: "var(--mantine-color-dimmed)"
1349
+ } : {}
1350
+ }
1351
+ }
1352
+ }
1353
+ ),
1354
+ d && /* @__PURE__ */ y(Le, { children: [
1355
+ /* @__PURE__ */ o(
1356
+ B,
1357
+ {
1358
+ style: {
1359
+ width: 1,
1360
+ height: 24,
1361
+ backgroundColor: "var(--mantine-color-default-border)"
1362
+ }
1363
+ }
1364
+ ),
1365
+ /* @__PURE__ */ o(
1366
+ pe,
1367
+ {
1368
+ value: D,
1369
+ onChange: $,
1370
+ onBlur: U,
1371
+ min: 0,
1372
+ max: 100,
1373
+ hideControls: !0,
1374
+ suffix: "%",
1375
+ "aria-label": "Opacity",
1376
+ "data-is-default": P ? "true" : "false",
1377
+ w: 54,
1378
+ styles: {
1379
+ input: {
1380
+ borderRadius: "0 4px 4px 0",
1381
+ textAlign: "right",
1382
+ ...P ? {
1383
+ fontStyle: "italic",
1384
+ color: "var(--mantine-color-dimmed)"
1385
+ } : {}
1386
+ }
1387
+ }
1388
+ }
1389
+ )
1390
+ ] })
1391
+ ] }),
1392
+ !A && /* @__PURE__ */ o(
1393
+ V,
1394
+ {
1395
+ variant: "subtle",
1396
+ size: "xs",
1397
+ c: "dimmed",
1398
+ "aria-label": `Reset ${l ?? "color"} to default`,
1399
+ onClick: Q,
1400
+ children: /* @__PURE__ */ o(ue, { size: 12 })
1401
+ }
1402
+ )
1403
+ ] });
1404
+ return l ? /* @__PURE__ */ y(K, { gap: 0, children: [
1405
+ /* @__PURE__ */ o(M, { size: "xs", c: "dimmed", mb: 1, lh: 1.2, children: l }),
1406
+ c
1407
+ ] }) : c;
1408
+ }
1409
+ function mo({ label: e, actions: t, children: a, bleed: n }) {
1410
+ return /* @__PURE__ */ y(B, { children: [
1411
+ /* @__PURE__ */ o(Be, { color: "var(--mantine-color-default-border)", mt: 8, mb: 0, mx: n ? "calc(-1 * var(--mantine-spacing-sm) - 1px)" : void 0 }),
1412
+ /* @__PURE__ */ y(E, { justify: "space-between", py: 8, px: 8, children: [
1413
+ /* @__PURE__ */ o(M, { size: "xs", fw: 500, lh: 1.2, children: e }),
1414
+ t && /* @__PURE__ */ o(E, { gap: 4, children: t })
1415
+ ] }),
1416
+ /* @__PURE__ */ o(K, { gap: 0, px: 8, children: a })
1417
+ ] });
1567
1418
  }
1568
- const Br = Object.assign(ur, {
1569
- Trigger: cr,
1570
- Panel: lr,
1571
- Content: Yt
1572
- });
1573
- function Rr({ children: t }) {
1574
- return /* @__PURE__ */ o(or, { children: t });
1419
+ function ho({
1420
+ label: e,
1421
+ defaultOpen: t = !0,
1422
+ children: a,
1423
+ hasConfiguredValues: n = !1
1424
+ }) {
1425
+ const [i, { toggle: s }] = Me(t), l = (d) => {
1426
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), s());
1427
+ };
1428
+ return /* @__PURE__ */ y(B, { children: [
1429
+ /* @__PURE__ */ o(Be, { color: "var(--mantine-color-default-border)", mt: 8, mb: 0, mx: 8 }),
1430
+ /* @__PURE__ */ o(
1431
+ E,
1432
+ {
1433
+ justify: "space-between",
1434
+ py: 8,
1435
+ px: 8,
1436
+ style: { cursor: "pointer" },
1437
+ onClick: s,
1438
+ role: "button",
1439
+ tabIndex: 0,
1440
+ "aria-expanded": i,
1441
+ "aria-label": i ? `Collapse ${e}` : `Expand ${e}`,
1442
+ onKeyDown: l,
1443
+ children: /* @__PURE__ */ y(E, { gap: 4, children: [
1444
+ /* @__PURE__ */ o(
1445
+ V,
1446
+ {
1447
+ variant: "subtle",
1448
+ size: "xs",
1449
+ c: "dimmed",
1450
+ tabIndex: -1,
1451
+ "aria-hidden": "true",
1452
+ children: i ? /* @__PURE__ */ o(fe, { size: 12 }) : /* @__PURE__ */ o(_e, { size: 12 })
1453
+ }
1454
+ ),
1455
+ /* @__PURE__ */ o(M, { size: "xs", fw: 500, lh: 1.2, children: e }),
1456
+ n && /* @__PURE__ */ o(
1457
+ B,
1458
+ {
1459
+ "aria-label": `${e} has configured values`,
1460
+ style: {
1461
+ width: 6,
1462
+ height: 6,
1463
+ borderRadius: "50%",
1464
+ backgroundColor: "var(--mantine-color-blue-5)",
1465
+ marginLeft: 4
1466
+ }
1467
+ }
1468
+ )
1469
+ ] })
1470
+ }
1471
+ ),
1472
+ /* @__PURE__ */ o(Re, { in: i, children: /* @__PURE__ */ o(K, { gap: 0, children: a }) })
1473
+ ] });
1575
1474
  }
1576
- function Fr({ label: t, value: e }) {
1577
- return /* @__PURE__ */ S(R, { justify: "space-between", py: 4, children: [
1578
- /* @__PURE__ */ o(H, { size: "compact", c: "dimmed", children: t }),
1579
- /* @__PURE__ */ o(H, { size: "compact", c: "var(--mantine-color-text)", fw: 500, children: String(e) })
1475
+ function xo({ label: e, defaultOpen: t = !1, children: a }) {
1476
+ const [n, { toggle: i }] = Me(t), s = (l) => {
1477
+ (l.key === "Enter" || l.key === " ") && (l.preventDefault(), i());
1478
+ };
1479
+ return /* @__PURE__ */ y(B, { children: [
1480
+ /* @__PURE__ */ y(
1481
+ E,
1482
+ {
1483
+ gap: 4,
1484
+ py: 4,
1485
+ style: { cursor: "pointer" },
1486
+ onClick: i,
1487
+ role: "button",
1488
+ tabIndex: 0,
1489
+ "aria-expanded": n,
1490
+ "aria-label": n ? `Collapse ${e}` : `Expand ${e}`,
1491
+ onKeyDown: s,
1492
+ children: [
1493
+ /* @__PURE__ */ o(
1494
+ V,
1495
+ {
1496
+ variant: "subtle",
1497
+ size: "xs",
1498
+ c: "dimmed",
1499
+ tabIndex: -1,
1500
+ "aria-hidden": "true",
1501
+ children: n ? /* @__PURE__ */ o(fe, { size: 10 }) : /* @__PURE__ */ o(_e, { size: 10 })
1502
+ }
1503
+ ),
1504
+ /* @__PURE__ */ o(M, { size: "xs", c: "dimmed", lh: 1.2, children: e })
1505
+ ]
1506
+ }
1507
+ ),
1508
+ /* @__PURE__ */ o(Re, { in: n, children: /* @__PURE__ */ o(B, { pl: "md", children: /* @__PURE__ */ o(K, { gap: 4, children: a }) }) })
1580
1509
  ] });
1581
1510
  }
1582
- function Er({
1583
- label: t,
1584
- value: e,
1585
- defaultValue: n,
1586
- onChange: i,
1587
- min: a,
1588
- max: r,
1589
- step: s,
1590
- decimalScale: c,
1591
- suffix: g,
1592
- hideControls: b = !0
1511
+ function Yn() {
1512
+ return crypto.randomUUID().slice(0, 8);
1513
+ }
1514
+ function de(e, t) {
1515
+ return {
1516
+ id: Yn(),
1517
+ offset: e,
1518
+ color: t
1519
+ };
1520
+ }
1521
+ function Jn() {
1522
+ return [de(0, "#6366F1"), de(1, "#06B6D4")];
1523
+ }
1524
+ function vo({
1525
+ stops: e,
1526
+ defaultStops: t,
1527
+ direction: a,
1528
+ defaultDirection: n = 0,
1529
+ showDirection: i = !0,
1530
+ onChange: s
1593
1531
  }) {
1594
- const [z, h] = Z({
1532
+ const [l, d] = W({
1595
1533
  value: e,
1534
+ defaultValue: t,
1535
+ finalValue: Jn(),
1536
+ onChange: (f) => s == null ? void 0 : s(f, b)
1537
+ }), [b, h] = W({
1538
+ value: a,
1539
+ defaultValue: n,
1540
+ finalValue: 0,
1541
+ onChange: (f) => s == null ? void 0 : s(l, f)
1542
+ }), x = (f, v) => {
1543
+ const C = [...l];
1544
+ C[f] = { ...C[f], color: v }, d(C);
1545
+ }, m = (f, v) => {
1546
+ const C = [...l];
1547
+ C[f] = { ...C[f], offset: v / 100 }, d(C);
1548
+ }, u = (f) => {
1549
+ h(f);
1550
+ }, P = () => {
1551
+ if (l.length >= 5)
1552
+ return;
1553
+ const f = l.length > 0 ? (l[l.length - 1].offset + 1) / 2 : 0.5, v = [...l, de(f, le)];
1554
+ v.sort((C, w) => C.offset - w.offset), d(v);
1555
+ }, A = (f) => {
1556
+ if (l.length <= 2)
1557
+ return;
1558
+ const v = l.filter((C, w) => w !== f);
1559
+ d(v);
1560
+ };
1561
+ return /* @__PURE__ */ y(K, { gap: "xs", children: [
1562
+ /* @__PURE__ */ y(E, { justify: "space-between", align: "center", children: [
1563
+ /* @__PURE__ */ o(M, { size: "xs", c: "dimmed", children: "Color Stops" }),
1564
+ /* @__PURE__ */ o(
1565
+ V,
1566
+ {
1567
+ variant: "subtle",
1568
+ color: "gray",
1569
+ onClick: P,
1570
+ disabled: l.length >= 5,
1571
+ "aria-label": "Add color stop",
1572
+ children: /* @__PURE__ */ o(Nt, { size: 12 })
1573
+ }
1574
+ )
1575
+ ] }),
1576
+ l.map((f, v) => /* @__PURE__ */ y(E, { gap: "xs", align: "flex-end", children: [
1577
+ /* @__PURE__ */ o(
1578
+ qn,
1579
+ {
1580
+ color: f.color,
1581
+ defaultColor: le,
1582
+ onColorChange: (C) => {
1583
+ x(v, C ?? le);
1584
+ },
1585
+ showOpacity: !1
1586
+ }
1587
+ ),
1588
+ /* @__PURE__ */ o(B, { style: { width: "80px" }, children: /* @__PURE__ */ o(
1589
+ ce,
1590
+ {
1591
+ min: 0,
1592
+ max: 100,
1593
+ value: f.offset * 100,
1594
+ onChange: (C) => {
1595
+ m(v, C);
1596
+ },
1597
+ label: (C) => `${Math.round(C)}%`,
1598
+ "aria-label": `Stop ${v + 1} position`
1599
+ }
1600
+ ) }),
1601
+ /* @__PURE__ */ o(
1602
+ V,
1603
+ {
1604
+ variant: "subtle",
1605
+ color: "gray",
1606
+ onClick: () => {
1607
+ A(v);
1608
+ },
1609
+ disabled: l.length <= 2,
1610
+ "aria-label": `Remove color stop ${v + 1}`,
1611
+ children: /* @__PURE__ */ o(Ht, { size: 12 })
1612
+ }
1613
+ )
1614
+ ] }, f.id)),
1615
+ i && /* @__PURE__ */ y(B, { pb: "md", children: [
1616
+ /* @__PURE__ */ o(M, { size: "xs", c: "dimmed", mb: 4, children: "Direction" }),
1617
+ /* @__PURE__ */ o(
1618
+ ce,
1619
+ {
1620
+ min: 0,
1621
+ max: 360,
1622
+ value: b,
1623
+ onChange: u,
1624
+ label: (f) => `${f}°`,
1625
+ "aria-label": "Gradient direction",
1626
+ marks: [
1627
+ { value: 0, label: "0°" },
1628
+ { value: 90, label: "90°" },
1629
+ { value: 180, label: "180°" },
1630
+ { value: 270, label: "270°" },
1631
+ { value: 360, label: "360°" }
1632
+ ]
1633
+ }
1634
+ )
1635
+ ] })
1636
+ ] });
1637
+ }
1638
+ function bo({ label: e, value: t }) {
1639
+ return /* @__PURE__ */ y(E, { justify: "space-between", py: 4, children: [
1640
+ /* @__PURE__ */ o(M, { size: "sm", c: "dimmed", children: e }),
1641
+ /* @__PURE__ */ o(M, { size: "sm", c: "var(--mantine-color-text)", fw: 500, children: String(t) })
1642
+ ] });
1643
+ }
1644
+ function Po({
1645
+ label: e,
1646
+ value: t,
1647
+ defaultValue: a,
1648
+ onChange: n,
1649
+ min: i,
1650
+ max: s,
1651
+ step: l,
1652
+ decimalScale: d,
1653
+ suffix: b,
1654
+ hideControls: h = !0
1655
+ }) {
1656
+ const [x, m] = W({
1657
+ value: t,
1596
1658
  defaultValue: void 0,
1597
1659
  // Start with undefined (using default)
1598
1660
  finalValue: void 0,
1599
- onChange: i
1600
- }), u = z === void 0, f = z ?? n, [F, l] = L(f);
1601
- U(() => {
1602
- l(z ?? n);
1603
- }, [z, n]);
1604
- const x = (O) => {
1605
- l(O);
1606
- }, v = () => {
1607
- const O = typeof F == "string" ? parseFloat(F) : F;
1608
- if (isNaN(O))
1609
- l(z ?? n);
1661
+ onChange: n
1662
+ }), u = x === void 0, P = x ?? a, A = R(!1), [f, v] = L(P);
1663
+ _(() => {
1664
+ A.current || v(x ?? a), A.current = !1;
1665
+ }, [x, a]);
1666
+ const C = (k) => {
1667
+ A.current = !0, v(k);
1668
+ }, w = () => {
1669
+ const k = typeof f == "string" ? parseFloat(f) : f;
1670
+ if (isNaN(k))
1671
+ v(x ?? a);
1610
1672
  else {
1611
- let I = O;
1612
- a !== void 0 && I < a && (I = a), r !== void 0 && I > r && (I = r), I !== z && h(I), l(I);
1673
+ let T = k;
1674
+ i !== void 0 && T < i && (T = i), s !== void 0 && T > s && (T = s), T !== x && m(T), v(T);
1613
1675
  }
1614
- }, _ = () => {
1615
- h(void 0);
1676
+ }, D = () => {
1677
+ m(void 0);
1616
1678
  };
1617
- return /* @__PURE__ */ S(R, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1679
+ return /* @__PURE__ */ y(E, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1618
1680
  /* @__PURE__ */ o(
1619
- le,
1681
+ pe,
1620
1682
  {
1621
- label: t,
1622
- "aria-label": t,
1623
- value: F,
1624
- onChange: x,
1625
- onBlur: v,
1626
- min: a,
1627
- max: r,
1628
- step: s,
1629
- decimalScale: c,
1630
- suffix: g,
1631
- hideControls: b,
1632
- size: "compact",
1683
+ label: e,
1684
+ "aria-label": e,
1685
+ value: f,
1686
+ onChange: C,
1687
+ onBlur: w,
1688
+ min: i,
1689
+ max: s,
1690
+ step: l,
1691
+ decimalScale: d,
1692
+ suffix: b,
1693
+ hideControls: h,
1633
1694
  "data-is-default": u ? "true" : "false",
1634
1695
  styles: {
1635
1696
  input: u ? {
@@ -1641,47 +1702,46 @@ function Er({
1641
1702
  }
1642
1703
  ),
1643
1704
  !u && /* @__PURE__ */ o(
1644
- D,
1705
+ V,
1645
1706
  {
1646
1707
  variant: "subtle",
1647
1708
  size: "xs",
1648
1709
  c: "dimmed",
1649
- "aria-label": `Reset ${t} to default`,
1650
- onClick: _,
1710
+ "aria-label": `Reset ${e} to default`,
1711
+ onClick: D,
1651
1712
  style: { marginBottom: 2 },
1652
- children: /* @__PURE__ */ o(ne, { size: 12 })
1713
+ children: /* @__PURE__ */ o(ue, { size: 12 })
1653
1714
  }
1654
1715
  )
1655
1716
  ] });
1656
1717
  }
1657
- function Or({ label: t, value: e, defaultValue: n, options: i, onChange: a }) {
1658
- const [r, s] = Z({
1659
- value: e,
1718
+ function Co({ label: e, value: t, defaultValue: a, options: n, onChange: i }) {
1719
+ const [s, l] = W({
1720
+ value: t,
1660
1721
  defaultValue: void 0,
1661
1722
  // Start with undefined (using default)
1662
1723
  finalValue: void 0,
1663
- onChange: a
1664
- }), c = r === void 0, g = r ?? n, b = (h) => {
1665
- h !== null && s(h);
1666
- }, z = () => {
1667
- s(void 0);
1724
+ onChange: i
1725
+ }), d = s === void 0, b = s ?? a, h = (m) => {
1726
+ m !== null && l(m);
1727
+ }, x = () => {
1728
+ l(void 0);
1668
1729
  };
1669
- return /* @__PURE__ */ S(R, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1730
+ return /* @__PURE__ */ y(E, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1670
1731
  /* @__PURE__ */ o(
1671
- we,
1732
+ Fe,
1672
1733
  {
1673
- label: t,
1674
- "aria-label": t,
1675
- value: g,
1676
- onChange: b,
1677
- data: i,
1678
- size: "compact",
1679
- rightSection: /* @__PURE__ */ o(ce, { size: 14 }),
1734
+ label: e,
1735
+ "aria-label": e,
1736
+ value: b,
1737
+ onChange: h,
1738
+ data: n,
1739
+ rightSection: /* @__PURE__ */ o(fe, { size: 14 }),
1680
1740
  rightSectionPointerEvents: "none",
1681
- "data-is-default": c ? "true" : "false",
1741
+ "data-is-default": d ? "true" : "false",
1682
1742
  allowDeselect: !1,
1683
1743
  styles: {
1684
- input: c ? {
1744
+ input: d ? {
1685
1745
  fontStyle: "italic",
1686
1746
  color: "var(--mantine-color-dimmed)"
1687
1747
  } : void 0
@@ -1689,61 +1749,99 @@ function Or({ label: t, value: e, defaultValue: n, options: i, onChange: a }) {
1689
1749
  style: { flex: 1 }
1690
1750
  }
1691
1751
  ),
1692
- !c && /* @__PURE__ */ o(
1693
- D,
1752
+ !d && /* @__PURE__ */ o(
1753
+ V,
1694
1754
  {
1695
1755
  variant: "subtle",
1696
1756
  size: "xs",
1697
1757
  c: "dimmed",
1698
- "aria-label": `Reset ${t} to default`,
1699
- onClick: z,
1758
+ "aria-label": `Reset ${e} to default`,
1759
+ onClick: x,
1700
1760
  style: { marginBottom: 2 },
1701
- children: /* @__PURE__ */ o(ne, { size: 12 })
1761
+ children: /* @__PURE__ */ o(ue, { size: 12 })
1702
1762
  }
1703
1763
  )
1704
1764
  ] });
1705
1765
  }
1706
- function Ar() {
1707
- return kt("dark");
1766
+ function zo({
1767
+ label: e,
1768
+ checked: t,
1769
+ defaultChecked: a,
1770
+ onChange: n,
1771
+ children: i
1772
+ }) {
1773
+ const [s, l] = W({
1774
+ value: t,
1775
+ defaultValue: a,
1776
+ finalValue: !1,
1777
+ onChange: n
1778
+ });
1779
+ return /* @__PURE__ */ y(K, { gap: 4, children: [
1780
+ /* @__PURE__ */ o(
1781
+ De,
1782
+ {
1783
+ label: e,
1784
+ checked: s,
1785
+ onChange: (d) => {
1786
+ l(d.currentTarget.checked);
1787
+ }
1788
+ }
1789
+ ),
1790
+ s && /* @__PURE__ */ o(B, { "data-testid": "toggle-with-content-children", pl: "md", children: /* @__PURE__ */ o(K, { gap: 4, children: i }) })
1791
+ ] });
1792
+ }
1793
+ function yo(e = "dark") {
1794
+ return _t(e);
1708
1795
  }
1709
- const Lr = {
1710
- xs: Q(4),
1711
- sm: Q(8),
1712
- md: Q(16),
1713
- lg: Q(24),
1714
- xl: Q(32)
1715
- }, Dr = "0.1.0";
1796
+ const So = {
1797
+ xs: ee(4),
1798
+ sm: ee(8),
1799
+ md: ee(16),
1800
+ lg: ee(24),
1801
+ xl: ee(32)
1802
+ }, wo = {
1803
+ /** Standard compact component height (inputs, buttons, icons) in pixels */
1804
+ HEIGHT: 24,
1805
+ /** Standard compact font size in pixels */
1806
+ FONT_SIZE: 11,
1807
+ /** Standard padding for control elements in pixels */
1808
+ CONTROL_PADDING: 8,
1809
+ /** Gap between items in sections/lists in pixels */
1810
+ SECTION_GAP: 4
1811
+ }, Io = "0.1.0";
1716
1812
  export {
1717
- Cr as CompactColorInput,
1718
- Sr as ControlGroup,
1719
- Tr as ControlSection,
1720
- _r as ControlSubGroup,
1721
- Wt as DEFAULT_GRADIENT_STOP_COLOR,
1722
- Ir as EffectToggle,
1723
- kr as GradientEditor,
1724
- Lr as MANTINE_SPACING,
1725
- Be as MAX_ALPHA_HEX,
1726
- Re as MAX_OPACITY_PERCENT,
1727
- Vt as POPOUT_GAP,
1728
- br as POPOUT_NESTED_GAP,
1729
- xe as POPOUT_Z_INDEX_BASE,
1730
- Br as Popout,
1731
- Rr as PopoutManager,
1732
- vr as SWATCH_COLORS,
1733
- Xt as SWATCH_COLORS_HEXA,
1734
- Fr as StatRow,
1735
- Er as StyleNumberInput,
1736
- Or as StyleSelect,
1737
- Dr as VERSION,
1738
- Dt as compactColors,
1739
- Lt as compactDarkColors,
1740
- zr as compactTheme,
1741
- se as createColorStop,
1742
- Kt as createDefaultGradientStops,
1743
- yr as isValidHex,
1744
- Ee as opacityToAlphaHex,
1745
- Fe as parseAlphaFromHexa,
1746
- Pr as parseHexaColor,
1747
- wr as toHexaColor,
1748
- Ar as useActualColorScheme
1813
+ wo as COMPACT_SIZING,
1814
+ qn as CompactColorInput,
1815
+ mo as ControlGroup,
1816
+ ho as ControlSection,
1817
+ xo as ControlSubGroup,
1818
+ le as DEFAULT_GRADIENT_STOP_COLOR,
1819
+ vo as GradientEditor,
1820
+ So as MANTINE_SPACING,
1821
+ Ge as MAX_ALPHA_HEX,
1822
+ je as MAX_OPACITY_PERCENT,
1823
+ mn as POPOUT_GAP,
1824
+ io as POPOUT_NESTED_GAP,
1825
+ we as POPOUT_Z_INDEX_BASE,
1826
+ oe as Popout,
1827
+ fo as PopoutButton,
1828
+ go as PopoutManager,
1829
+ Fn as SWATCH_COLORS_HEXA,
1830
+ bo as StatRow,
1831
+ Po as StyleNumberInput,
1832
+ Co as StyleSelect,
1833
+ zo as ToggleWithContent,
1834
+ Io as VERSION,
1835
+ jt as compactColors,
1836
+ Gt as compactDarkColors,
1837
+ lo as compactTheme,
1838
+ On as compactThemeOverride,
1839
+ de as createColorStop,
1840
+ Jn as createDefaultGradientStops,
1841
+ uo as isValidHex,
1842
+ Ke as opacityToAlphaHex,
1843
+ Xe as parseAlphaFromHexa,
1844
+ co as parseHexaColor,
1845
+ po as toHexaColor,
1846
+ yo as useActualColorScheme
1749
1847
  };