@graphty/compact-mantine 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 Ae, CloseButton as Be, ActionIcon as L, Button as tt, RangeSlider as ot, Radio as nt, Slider as ce, Switch as rt, Checkbox as Ee, SegmentedControl as Fe, Kbd as st, Indicator as at, ThemeIcon as it, Avatar as lt, Pill as ct, Badge as dt, Text as H, RingProgress as pt, Progress as ut, Loader as ft, InputClearButton as mt, JsonInput as gt, FileInput as xt, PillsInput as ht, TagsInput as vt, MultiSelect as bt, Autocomplete as Pt, PasswordInput as zt, Textarea as yt, Select as Ve, NumberInput as pe, TextInput as Oe, Tabs as St, Stepper as wt, Pagination as Ct, NavLink as It, Burger as Tt, Anchor as kt, HoverCard as At, Popover as Bt, Tooltip as Et, Menu as Ft, mergeMantineTheme as Vt, createTheme as Ot, Box as R, Group as E, Paper as Dt, ColorSwatch as Lt, ColorPicker as Rt, Stack as Z, Divider as De, Collapse as Mt, useComputedColorScheme as _t, rem as ee } from "@mantine/core";
2
+ import { jsx as r, jsxs as S, Fragment as Le } from "react/jsx-runtime";
3
+ import { useUncontrolled as q, useDisclosure as Re } from "@mantine/hooks";
4
+ import { X as ue, ChevronDown as fe, ChevronRight as Me, Plus as Ht, Minus as Nt } from "lucide-react";
5
+ import { useRef as $, isValidElement as _e, cloneElement as He, createContext as me, useContext as re, useEffect as U, useState as _, useCallback as w, useMemo as Ne, useId as $e, 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
+ ...Ae.colors,
30
+ dark: Gt
31
+ }, Xt = {
32
+ "--button-height": "24px",
33
+ "--button-fz": "11px",
34
+ "--button-padding-x": "8px"
35
+ }, Wt = {
36
+ "--ai-size": "24px"
37
+ }, Kt = {
38
+ "--cb-size": "16px",
39
+ "--cb-icon-size": "12px"
40
+ }, Zt = {
41
+ Button: tt.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: L.extend({
50
+ defaultProps: {
51
+ size: "sm",
52
+ variant: "subtle"
53
+ },
54
+ vars: () => ({
55
+ root: Wt
56
+ })
46
57
  }),
47
- CloseButton: Ge.extend({
58
+ CloseButton: Be.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: Kt
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
+ }, Se = {
78
+ "--slider-size": "4px",
79
+ "--slider-thumb-size": "12px"
80
+ }, Qt = {
81
+ "--sc-font-size": "10px",
82
+ "--sc-padding": "4px 8px"
83
+ }, eo = {
84
+ backgroundColor: "transparent"
85
+ }, to = {
86
+ backgroundColor: "var(--mantine-color-dark-6)"
87
+ }, ae = {
88
+ fontSize: 11
89
+ }, we = {
90
+ fontSize: 10,
91
+ marginTop: 2
92
+ }, oo = {
93
+ SegmentedControl: Fe.extend({
94
+ defaultProps: {
95
+ size: "sm",
96
+ withItemsBorders: !1
97
+ },
98
+ vars: () => ({
99
+ root: Qt
100
+ }),
101
+ styles: {
102
+ root: eo,
103
+ indicator: to
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: Ee.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: rt.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: Se
134
+ }),
135
+ styles: {
136
+ markLabel: we
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: nt.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: Se
156
+ }),
157
+ styles: {
158
+ markLabel: we
159
+ }
135
160
  })
136
- }, Mt = {
161
+ }, no = {
162
+ "--badge-height": "14px",
163
+ "--badge-fz": "9px",
164
+ "--badge-padding-x": "4px"
165
+ }, ro = {
166
+ "--avatar-size": "24px"
167
+ }, so = {
168
+ "--ti-size": "24px"
169
+ }, ao = {
170
+ "--indicator-size": "8px"
171
+ }, io = {
172
+ "--kbd-fz": "10px",
173
+ "--kbd-padding": "2px 4px"
174
+ }, lo = {
175
+ "--pill-height": "16px",
176
+ "--pill-fz": "10px"
177
+ }, co = {
137
178
  Text: H.extend({
138
- vars: (t, e) => e.size === "compact" ? {
139
- root: {
140
- "--text-fz": "11px",
141
- "--text-lh": "1.2"
142
- }
143
- } : { root: {} }
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: dt.extend({
184
+ defaultProps: {
185
+ size: "sm"
186
+ },
187
+ vars: () => ({
188
+ root: no
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: ct.extend({
192
+ defaultProps: {
193
+ size: "sm"
194
+ },
195
+ vars: () => ({
196
+ root: lo
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: lt.extend({
200
+ defaultProps: {
201
+ size: "sm"
202
+ },
203
+ vars: () => ({
204
+ root: ro
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: it.extend({
208
+ defaultProps: {
209
+ size: "sm"
210
+ },
211
+ vars: () => ({
212
+ root: so
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: at.extend({
216
+ defaultProps: {
217
+ size: "sm"
218
+ },
219
+ vars: () => ({
220
+ root: ao
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: st.extend({
224
+ defaultProps: {
225
+ size: "sm"
226
+ },
227
+ vars: () => ({
228
+ root: io
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
+ }, po = {
232
+ "--loader-size": "18px"
233
+ }, uo = {
234
+ "--progress-size": "4px"
235
+ }, fo = {
236
+ label: {
237
+ fontSize: 9
238
+ }
239
+ }, mo = {
240
+ Loader: ft.extend({
241
+ defaultProps: {
242
+ size: "sm"
243
+ },
244
+ vars: () => ({
245
+ root: po
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: ut.extend({
249
+ defaultProps: {
250
+ size: "sm"
251
+ },
252
+ vars: () => ({
253
+ root: uo
254
+ }),
255
+ styles: fo
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: pt.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
+ }, Ce = 1e3, j = 1100, go = 8, ln = 4, K = {
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
+ }, ge = {
281
+ paddingLeft: 8,
282
+ paddingRight: 8,
283
+ border: "none",
284
+ backgroundColor: "var(--mantine-color-default)"
285
+ }, Y = {
286
+ label: J,
287
+ input: ge
288
+ }, Ie = {
289
+ label: J,
290
+ input: ge
291
+ }, oe = {
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
+ }, xo = {
332
+ TextInput: Oe.extend({
333
+ defaultProps: {
334
+ size: "sm",
335
+ variant: "filled"
336
+ },
337
+ vars: () => ({
338
+ root: {},
339
+ wrapper: K
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
+ ...K,
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: ge,
279
361
  control: {
280
362
  borderColor: "transparent"
281
363
  }
282
- } : {}
364
+ }
283
365
  }),
284
- Select: we.extend({
366
+ Select: Ve.extend({
285
367
  defaultProps: {
286
- comboboxProps: { zIndex: V }
368
+ size: "sm",
369
+ variant: "filled",
370
+ comboboxProps: { zIndex: j }
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: K
375
+ }),
376
+ styles: {
377
+ ...Y,
378
+ ...oe
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: K
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: Pt.extend({
328
410
  defaultProps: {
329
- popoverProps: { zIndex: V }
411
+ size: "sm",
412
+ variant: "filled",
413
+ comboboxProps: { zIndex: j }
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: K
418
+ }),
419
+ styles: {
420
+ ...Y,
421
+ ...oe
422
+ }
340
423
  }),
341
- MultiSelect: ut.extend({
424
+ MultiSelect: bt.extend({
342
425
  defaultProps: {
343
- comboboxProps: { zIndex: V }
426
+ size: "sm",
427
+ variant: "filled",
428
+ comboboxProps: { zIndex: j }
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
+ ...K,
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
+ ...oe,
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: vt.extend({
383
448
  defaultProps: {
384
- comboboxProps: { zIndex: V }
449
+ size: "sm",
450
+ variant: "filled",
451
+ comboboxProps: { zIndex: j }
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
+ ...oe,
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: ht.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: K
489
+ }),
490
+ styles: Y
459
491
  }),
460
- JsonInput: at.extend({
461
- vars: (t, e) => e.size === "compact" ? {
492
+ JsonInput: gt.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: {} }
481
- })
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
- } : {}
512
+ })
539
513
  })
540
- }, jt = {
541
- Menu: wt.extend({
514
+ }, ho = {
515
+ "--pagination-control-size": "24px",
516
+ "--pagination-control-fz": "11px"
517
+ }, vo = {
518
+ "--stepper-icon-size": "24px",
519
+ "--stepper-fz": "11px",
520
+ "--stepper-spacing": "8px"
521
+ }, bo = {
522
+ "--burger-size": "18px",
523
+ "--burger-line-size": "2px"
524
+ }, Po = {
525
+ root: {
526
+ fontSize: 11
527
+ }
528
+ }, zo = {
529
+ root: {
530
+ fontSize: 11,
531
+ minHeight: 28
532
+ },
533
+ label: {
534
+ fontSize: 11
535
+ }
536
+ }, yo = {
537
+ tab: {
538
+ fontSize: 11,
539
+ padding: "6px 10px"
540
+ }
541
+ }, So = {
542
+ Anchor: kt.extend({
542
543
  defaultProps: {
543
- zIndex: V
544
- }
544
+ size: "sm"
545
+ },
546
+ styles: Po
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: bo
554
+ })
555
+ }),
556
+ NavLink: It.extend({
557
+ // NavLink does not have a size prop, only styles for compact appearance
558
+ styles: zo
550
559
  }),
551
- Popover: oe.extend({
560
+ Pagination: Ct.extend({
552
561
  defaultProps: {
553
- zIndex: V
554
- }
562
+ size: "sm"
563
+ },
564
+ vars: () => ({
565
+ root: ho
566
+ })
555
567
  }),
556
- HoverCard: vt.extend({
568
+ Stepper: wt.extend({
557
569
  defaultProps: {
558
- zIndex: V
559
- }
570
+ size: "sm"
571
+ },
572
+ vars: () => ({
573
+ root: vo
574
+ })
575
+ }),
576
+ Tabs: St.extend({
577
+ // Tabs does not have a size prop, only styles for compact appearance
578
+ styles: yo
560
579
  })
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
580
+ }, wo = {
581
+ "--menu-item-fz": "11px"
582
+ }, Co = {
583
+ tooltip: {
584
+ fontSize: 11,
585
+ padding: "4px 8px"
573
586
  }
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
- ] });
587
+ }, Io = {
588
+ dropdown: {
589
+ padding: 8
590
+ }
591
+ }, To = {
592
+ dropdown: {
593
+ padding: 8
594
+ }
595
+ }, ko = {
596
+ Menu: Ft.extend({
597
+ defaultProps: {
598
+ zIndex: j
599
+ },
600
+ vars: () => ({
601
+ dropdown: wo
602
+ })
603
+ }),
604
+ Tooltip: Et.extend({
605
+ defaultProps: {
606
+ zIndex: j
607
+ },
608
+ styles: Co
609
+ }),
610
+ Popover: Bt.extend({
611
+ defaultProps: {
612
+ zIndex: j
613
+ },
614
+ styles: Io
615
+ }),
616
+ HoverCard: At.extend({
617
+ defaultProps: {
618
+ zIndex: j
619
+ },
620
+ styles: To
621
+ })
622
+ }, Ao = {
623
+ xs: "10px",
624
+ sm: "11px",
625
+ // Our compact default
626
+ md: "13px",
627
+ lg: "14px",
628
+ xl: "16px"
629
+ }, Bo = {
630
+ xs: "4px",
631
+ sm: "6px",
632
+ md: "8px",
633
+ lg: "12px",
634
+ xl: "16px"
635
+ }, Eo = {
636
+ xs: "2px",
637
+ sm: "4px",
638
+ md: "6px",
639
+ lg: "8px",
640
+ xl: "12px"
641
+ }, Fo = Ot({
642
+ colors: jt,
643
+ fontSizes: Ao,
644
+ spacing: Bo,
645
+ radius: Eo,
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
+ ...xo,
653
+ ...Zt,
654
+ ...oo,
655
+ ...co,
656
+ ...mo,
657
+ ...So,
658
+ ...ko
659
+ }
660
+ }), cn = Vt(Ae, Fo), dn = ["#5B8FF9", "#FF6B6B", "#61D095", "#F7B731", "#9B59B6"], Vo = [
661
+ "#5B8FF9FF",
662
+ "#FF6B6BFF",
663
+ "#61D095FF",
664
+ "#F7B731FF",
665
+ "#9B59B6FF",
666
+ "#5B8FF980",
667
+ "#FF6B6B80",
668
+ "#61D09580",
669
+ "#F7B73180",
670
+ "#9B59B680"
671
+ ], le = "#888888", Ue = 255, Ge = 100;
672
+ function je(e) {
673
+ return Math.round(parseInt(e, 16) / Ue * Ge);
674
+ }
675
+ function Xe(e) {
676
+ return Math.round(e / Ge * Ue).toString(16).padStart(2, "0");
677
+ }
678
+ function pn(e) {
679
+ let t = e.replace("#", "");
680
+ t.length === 3 ? t = `${t.split("").map((o) => o + o).join("")}ff` : t.length === 4 ? t = t.split("").map((o) => o + o).join("") : t.length === 6 && (t = `${t}ff`);
681
+ const s = `#${t.slice(0, 6)}`, n = t.slice(6, 8), a = je(n);
682
+ return { hex: s, opacity: a };
683
+ }
684
+ function un(e, t) {
685
+ const s = e.replace("#", ""), n = Xe(t);
686
+ return `#${s}${n}`;
1001
687
  }
1002
- function Yt({ children: t }) {
1003
- return /* @__PURE__ */ o(A, { p: "sm", children: t });
688
+ function fn(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);
1004
690
  }
1005
- const qt = [
691
+ const We = me(null);
692
+ function Oo() {
693
+ return re(We);
694
+ }
695
+ function Do({ children: e }) {
696
+ const t = $(null);
697
+ if (!_e(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__ */ r(We.Provider, { value: { anchorRef: t }, children: n });
703
+ }
704
+ function Lo({ children: e }) {
705
+ return /* @__PURE__ */ r(R, { p: "sm", children: e });
706
+ }
707
+ const Ro = [
1006
708
  // Mantine portal containers
1007
709
  "[data-portal]",
1008
710
  // Combobox/Select dropdowns
@@ -1020,52 +722,52 @@ const qt = [
1020
722
  // Modal (just in case)
1021
723
  "[data-modal]"
1022
724
  ].join(", ");
1023
- function Jt(t, e = !0) {
725
+ function Mo(e, t = !0) {
1024
726
  U(() => {
1025
- if (!e)
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 s = (n) => {
730
+ const a = n.target;
731
+ a.closest('[role="dialog"]') || a.closest("[data-popout-trigger]") || a.closest("[data-popout-portal-container]") || a.closest(Ro) || e();
1030
732
  };
1031
- return document.addEventListener("mousedown", n), () => {
1032
- document.removeEventListener("mousedown", n);
733
+ return document.addEventListener("mousedown", s), () => {
734
+ document.removeEventListener("mousedown", s);
1033
735
  };
1034
- }, [t, e]);
736
+ }, [e, t]);
1035
737
  }
1036
- function Qt(t, e = !0) {
738
+ function _o(e, t = !0) {
1037
739
  U(() => {
1038
- if (!e)
740
+ if (!t)
1039
741
  return;
1040
- const n = (i) => {
1041
- i.key === "Escape" && (i.preventDefault(), t());
742
+ const s = (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", s), () => {
746
+ document.removeEventListener("keydown", s);
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 xe = me(null), Ke = me(null);
751
+ function he() {
752
+ const e = re(xe);
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 Ho() {
758
+ return re(xe);
1057
759
  }
1058
- function tr() {
1059
- const t = ue(Oe);
1060
- if (!t)
760
+ function No() {
761
+ const e = re(Ke);
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 $o({ children: e, parentId: t = null }) {
767
+ const s = $e(), [n, a] = _(!1), o = $(null), i = Ne(
1066
768
  () => ({
1067
- id: n,
1068
- isOpen: i,
769
+ id: s,
770
+ isOpen: n,
1069
771
  open: () => {
1070
772
  a(!0);
1071
773
  },
@@ -1075,173 +777,173 @@ function rr({ children: t, parentId: e = null }) {
1075
777
  toggle: () => {
1076
778
  a((c) => !c);
1077
779
  },
1078
- triggerRef: r,
1079
- parentId: e
780
+ triggerRef: o,
781
+ parentId: t
1080
782
  }),
1081
- [n, i, e]
783
+ [s, n, t]
1082
784
  );
1083
- return /* @__PURE__ */ o(pe.Provider, { value: s, children: t });
785
+ return /* @__PURE__ */ r(xe.Provider, { value: i, 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);
787
+ function Uo({ children: e }) {
788
+ const [t, s] = _(null), n = $([]), a = $(/* @__PURE__ */ new Map()), o = $(/* @__PURE__ */ new Map()), [i, c] = _(0), u = w((p, m, P) => {
789
+ var y, N;
790
+ if (!n.current.includes(p)) {
791
+ const z = n.current, V = [];
792
+ for (const B of z)
793
+ o.current.get(B) === (P ?? null) && V.push(B);
794
+ for (const B of V.reverse()) {
795
+ const M = [];
796
+ for (const O of z) {
797
+ let D = O;
798
+ for (; D; ) {
799
+ const I = o.current.get(D);
800
+ if (I === B) {
801
+ M.push(O);
1100
802
  break;
1101
803
  }
1102
- y = Y ?? null;
804
+ D = I ?? null;
1103
805
  }
1104
806
  }
1105
- for (const k of E.reverse())
1106
- (w = a.current.get(k)) == null || w();
1107
- (M = a.current.get(d)) == null || M();
807
+ for (const O of M.reverse())
808
+ (y = a.current.get(O)) == null || y();
809
+ (N = a.current.get(B)) == null || N();
1108
810
  }
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)
811
+ n.current = [...n.current.filter((B) => !V.includes(B) && !V.some((M) => {
812
+ let O = B;
813
+ for (; O; ) {
814
+ const D = o.current.get(O);
815
+ if (D === M)
1114
816
  return !0;
1115
- k = y ?? null;
817
+ O = D ?? null;
1116
818
  }
1117
819
  return !1;
1118
- })), p], a.current.set(p, m), r.current.set(p, P ?? null), c((d) => d + 1);
820
+ })), p], a.current.set(p, m), o.current.set(p, P ?? null), c((B) => B + 1);
1119
821
  }
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),
822
+ }, []), x = w((p) => {
823
+ n.current = n.current.filter((m) => m !== p), a.current.delete(p), o.current.delete(p), c((m) => m + 1);
824
+ }, []), v = w((p) => {
825
+ const m = n.current.indexOf(p);
826
+ return m >= 0 ? Ce + m : Ce;
827
+ }, []), f = w((p) => {
828
+ const m = n.current, P = m.indexOf(p);
829
+ P === -1 || P === m.length - 1 || (n.current = [
830
+ ...m.filter((y) => y !== p),
1129
831
  p
1130
- ], c((w) => w + 1));
1131
- }, []), u = T((p) => r.current.get(p) ?? null, []), f = T((p, m) => {
832
+ ], c((y) => y + 1));
833
+ }, []), d = w((p) => o.current.get(p) ?? null, []), h = w((p, m) => {
1132
834
  let P = m;
1133
835
  for (; P; ) {
1134
- const w = r.current.get(P);
1135
- if (w === p)
836
+ const y = o.current.get(P);
837
+ if (y === p)
1136
838
  return !0;
1137
- P = w ?? null;
839
+ P = y ?? null;
1138
840
  }
1139
841
  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);
842
+ }, []), F = w((p) => {
843
+ const m = [], P = n.current;
844
+ for (const y of P)
845
+ h(p, y) && m.push(y);
1144
846
  return m;
1145
- }, [f]), l = T((p) => {
847
+ }, [h]), l = w((p) => {
1146
848
  const m = F(p);
1147
849
  for (const P of [...m].reverse()) {
1148
- const w = a.current.get(P);
1149
- w == null || w();
850
+ const y = a.current.get(P);
851
+ y == null || y();
1150
852
  }
1151
- }, [F]), x = T((p) => {
853
+ }, [F]), g = w((p) => {
1152
854
  l(p);
1153
855
  const m = a.current.get(p);
1154
856
  m == null || m();
1155
- }, [l]), v = T((p, m) => {
1156
- const P = i.current;
1157
- for (const w of P) {
1158
- if (w === p)
857
+ }, [l]), b = w((p, m) => {
858
+ const P = n.current;
859
+ for (const y of P) {
860
+ if (y === p)
1159
861
  continue;
1160
- r.current.get(w) === m && x(w);
862
+ o.current.get(y) === m && g(y);
1161
863
  }
1162
- }, [x]), _ = T(() => {
1163
- const p = i.current;
864
+ }, [g]), C = w(() => {
865
+ const p = n.current;
1164
866
  if (p.length === 0)
1165
867
  return;
1166
868
  const m = p[p.length - 1], P = a.current.get(m);
1167
869
  P == null || P();
1168
- }, []), O = T(() => {
1169
- const p = [...i.current];
870
+ }, []), A = w(() => {
871
+ const p = [...n.current];
1170
872
  for (const m of p) {
1171
873
  const P = a.current.get(m);
1172
874
  P == null || P();
1173
875
  }
1174
- }, []), I = T(() => i.current.length > 0, []), [$, j] = L(!1);
876
+ }, []), T = w(() => n.current.length > 0, []), [X, G] = _(!1);
1175
877
  U(() => {
1176
- j(i.current.length > 0);
1177
- }, [s]), Qt(_, $), Jt(O, $);
1178
- const q = _e(
878
+ G(n.current.length > 0);
879
+ }, [i]), _o(C, X), Mo(A, X);
880
+ const Q = Ne(
1179
881
  () => ({
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,
882
+ register: u,
883
+ unregister: x,
884
+ getZIndex: v,
885
+ bringToFront: f,
886
+ portalContainer: t,
887
+ zIndexVersion: i,
888
+ closeFocused: C,
889
+ closeAll: A,
890
+ hasOpenPopouts: T,
891
+ closeWithDescendants: g,
1190
892
  closeDescendants: l,
1191
- closeSiblings: v,
1192
- getParentId: u,
1193
- isAncestor: f
893
+ closeSiblings: b,
894
+ getParentId: d,
895
+ isAncestor: h
1194
896
  }),
1195
- [g, b, z, h, e, s, _, O, I, x, l, v, u, f]
897
+ [u, x, v, f, t, i, C, A, T, g, l, b, d, h]
1196
898
  );
1197
- return /* @__PURE__ */ S(Oe.Provider, { value: q, children: [
1198
- t,
1199
- /* @__PURE__ */ o("div", { ref: n, "data-popout-portal-container": !0 })
899
+ return /* @__PURE__ */ S(Ke.Provider, { value: Q, children: [
900
+ e,
901
+ /* @__PURE__ */ r("div", { ref: s, "data-popout-portal-container": !0 })
1200
902
  ] });
1201
903
  }
1202
- function nr(t) {
1203
- const { isOpen: e, onDragStart: n } = t, [i, a] = L({ left: 0, top: 0 }), r = G(!1), s = G({
904
+ function Go(e) {
905
+ const { isOpen: t, onDragStart: s } = e, [n, a] = _({ left: 0, top: 0 }), o = $(!1), i = $({
1204
906
  x: 0,
1205
907
  y: 0,
1206
908
  offsetLeft: 0,
1207
909
  offsetTop: 0
1208
- }), c = T(() => {
910
+ }), c = w(() => {
1209
911
  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));
912
+ }, []), u = w(
913
+ (f) => {
914
+ const d = f.target;
915
+ d.tagName === "INPUT" || d.tagName === "TEXTAREA" || d.tagName === "BUTTON" || d.tagName === "SELECT" || d.closest("button") || d.closest("input") || d.closest("textarea") || d.closest("select") || (o.current = !0, i.current = {
916
+ x: f.clientX,
917
+ y: f.clientY,
918
+ offsetLeft: n.left,
919
+ offsetTop: n.top
920
+ }, s == null || s(), f.target.setPointerCapture(f.pointerId));
1219
921
  },
1220
- [i.left, i.top, n]
1221
- ), b = T((h) => {
1222
- if (!r.current)
922
+ [n.left, n.top, s]
923
+ ), x = w((f) => {
924
+ if (!o.current)
1223
925
  return;
1224
- const u = h.clientX - s.current.x, f = h.clientY - s.current.y;
926
+ const d = f.clientX - i.current.x, h = f.clientY - i.current.y;
1225
927
  a({
1226
- left: s.current.offsetLeft + u,
1227
- top: s.current.offsetTop + f
928
+ left: i.current.offsetLeft + d,
929
+ top: i.current.offsetTop + h
1228
930
  });
1229
- }, []), z = T((h) => {
1230
- r.current && (r.current = !1, h.target.releasePointerCapture(h.pointerId));
931
+ }, []), v = w((f) => {
932
+ o.current && (o.current = !1, f.target.releasePointerCapture(f.pointerId));
1231
933
  }, []);
1232
- return e ? {
934
+ return t ? {
1233
935
  dragTriggerProps: {
1234
936
  "data-drag-trigger": !0,
1235
- onPointerDown: g,
1236
- onPointerMove: b,
1237
- onPointerUp: z,
937
+ onPointerDown: u,
938
+ onPointerMove: x,
939
+ onPointerUp: v,
1238
940
  style: {
1239
941
  cursor: "grab",
1240
942
  userSelect: "none",
1241
943
  touchAction: "none"
1242
944
  }
1243
945
  },
1244
- dragOffset: i,
946
+ dragOffset: n,
1245
947
  resetDragOffset: c
1246
948
  } : {
1247
949
  dragTriggerProps: {},
@@ -1249,263 +951,194 @@ function nr(t) {
1249
951
  resetDragOffset: c
1250
952
  };
1251
953
  }
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 = [],
954
+ function jo({
955
+ config: e,
956
+ onClose: t,
957
+ dragTriggerProps: s = {},
958
+ actions: n = [],
1279
959
  activeTab: a,
1280
- onTabChange: r,
1281
- titleId: s
960
+ onTabChange: o,
961
+ titleId: i
1282
962
  }) {
1283
- var u;
1284
- const { style: c, ...g } = n, z = t.variant === "tabs" ? t : null, h = (f) => {
1285
- r && r(f);
1286
- };
963
+ var d;
964
+ const { style: c, ...u } = s, v = e.variant === "tabs" ? e : null, f = (v == null ? void 0 : v.tabs.map((h) => ({
965
+ value: h.id,
966
+ label: h.label
967
+ }))) ?? [];
1287
968
  return /* @__PURE__ */ S(
1288
- R,
969
+ E,
1289
970
  {
1290
971
  justify: "space-between",
1291
972
  px: "sm",
1292
973
  py: "xs",
1293
- ...g,
974
+ ...u,
1294
975
  style: {
1295
976
  ...c
1296
977
  },
1297
978
  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,
979
+ e.variant === "title" ? /* @__PURE__ */ r(H, { id: i, size: "sm", fw: 500, children: e.title }) : /* @__PURE__ */ S(Le, { children: [
980
+ /* @__PURE__ */ r("span", { id: i, style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0, 0, 0, 0)" }, children: ((d = v == null ? void 0 : v.tabs[0]) == null ? void 0 : d.label) ?? "Settings" }),
981
+ /* @__PURE__ */ r(
982
+ Fe,
1302
983
  {
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
- ))
984
+ data: f,
985
+ value: a,
986
+ onChange: (h) => o == null ? void 0 : o(h),
987
+ size: "xs"
988
+ }
989
+ )
1312
990
  ] }),
1313
- /* @__PURE__ */ S(R, { gap: 4, children: [
1314
- i.map((f) => /* @__PURE__ */ o(
1315
- D,
991
+ /* @__PURE__ */ S(E, { gap: 4, children: [
992
+ n.map((h) => /* @__PURE__ */ r(
993
+ L,
1316
994
  {
1317
995
  variant: "subtle",
1318
- size: "compact",
1319
- onClick: f.onClick,
1320
- "aria-label": f.label,
1321
- children: f.icon
996
+ onClick: h.onClick,
997
+ "aria-label": h.label,
998
+ children: h.icon
1322
999
  },
1323
- f.id
1000
+ h.id
1324
1001
  )),
1325
- /* @__PURE__ */ o(D, { variant: "subtle", size: "compact", onClick: e, "aria-label": "Close panel", children: /* @__PURE__ */ o(ne, { size: 14 }) })
1002
+ /* @__PURE__ */ r(Be, { size: "sm", onClick: t, "aria-label": "Close panel" })
1326
1003
  ] })
1327
1004
  ]
1328
1005
  }
1329
1006
  );
1330
1007
  }
1331
- function sr(t, e, n = Vt, i = {}) {
1332
- const { placement: a = "left", alignment: r = "start", panelHeight: s = 0 } = i;
1333
- let c, g;
1008
+ function Xo(e, t, s = go, n = {}) {
1009
+ const { placement: a = "left", alignment: o = "start", panelHeight: i = 0 } = n;
1010
+ let c, u;
1334
1011
  switch (a) {
1335
1012
  case "left":
1336
- c = t.left - e - n, g = be(t, r, s);
1013
+ c = e.left - t - s, u = Te(e, o, i);
1337
1014
  break;
1338
1015
  case "right":
1339
- c = t.right + n, g = be(t, r, s);
1016
+ c = e.right + s, u = Te(e, o, i);
1340
1017
  break;
1341
1018
  case "top":
1342
- c = ze(t, r, e), g = t.top - s - n;
1019
+ c = ke(e, o, t), u = e.top - i - s;
1343
1020
  break;
1344
1021
  case "bottom":
1345
- c = ze(t, r, e), g = t.bottom + n;
1022
+ c = ke(e, o, t), u = e.bottom + s;
1346
1023
  break;
1347
1024
  default: {
1348
- const b = a;
1349
- throw new Error(`Unknown placement: ${String(b)}`);
1025
+ const x = a;
1026
+ throw new Error(`Unknown placement: ${String(x)}`);
1350
1027
  }
1351
1028
  }
1352
- return { left: c, top: g };
1029
+ return { left: c, top: u };
1353
1030
  }
1354
- function be(t, e, n) {
1355
- switch (e) {
1031
+ function Te(e, t, s) {
1032
+ switch (t) {
1356
1033
  case "start":
1357
- return t.top;
1034
+ return e.top;
1358
1035
  case "center":
1359
- return t.top + t.height / 2 - n / 2;
1036
+ return e.top + e.height / 2 - s / 2;
1360
1037
  case "end":
1361
- return t.bottom - n;
1038
+ return e.bottom - s;
1362
1039
  default: {
1363
- const i = e;
1364
- throw new Error(`Unknown alignment: ${String(i)}`);
1040
+ const n = t;
1041
+ throw new Error(`Unknown alignment: ${String(n)}`);
1365
1042
  }
1366
1043
  }
1367
1044
  }
1368
- function ze(t, e, n) {
1369
- switch (e) {
1045
+ function ke(e, t, s) {
1046
+ switch (t) {
1370
1047
  case "start":
1371
- return t.left;
1048
+ return e.left;
1372
1049
  case "center":
1373
- return t.left + t.width / 2 - n / 2;
1050
+ return e.left + e.width / 2 - s / 2;
1374
1051
  case "end":
1375
- return t.right - n;
1052
+ return e.right - s;
1376
1053
  default: {
1377
- const i = e;
1378
- throw new Error(`Unknown alignment: ${String(i)}`);
1054
+ const n = t;
1055
+ throw new Error(`Unknown alignment: ${String(n)}`);
1379
1056
  }
1380
1057
  }
1381
1058
  }
1382
- function lr({
1383
- width: t,
1384
- height: e,
1385
- header: n,
1386
- children: i,
1059
+ function Wo({
1060
+ width: e,
1061
+ height: t,
1062
+ header: s,
1063
+ children: n,
1387
1064
  anchorRef: a,
1388
- placement: r = "left",
1389
- alignment: s = "start",
1065
+ placement: o = "left",
1066
+ alignment: i = "start",
1390
1067
  gap: c = 0,
1391
- actions: g
1068
+ actions: u
1392
1069
  }) {
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);
1070
+ var ze, ye;
1071
+ const { isOpen: x, close: v, triggerRef: f, id: d, parentId: h } = he(), { getZIndex: F, portalContainer: l, register: g, unregister: b, bringToFront: C, zIndexVersion: A, closeWithDescendants: T, closeDescendants: X } = No(), G = Oo(), Q = $e(), p = `popout-panel-${d}`, m = `popout-title-${Q}`, [P, y] = _(null), N = $(!1), z = $(null), V = w(() => {
1072
+ C(d);
1073
+ }, [C, d]), { dragTriggerProps: B, dragOffset: M, resetDragOffset: O } = Go({
1074
+ isOpen: x,
1075
+ onDragStart: V
1076
+ }), D = s.variant === "tabs", I = D ? s : null, se = (I == null ? void 0 : I.defaultTab) ?? ((ze = I == null ? void 0 : I.tabs[0]) == null ? void 0 : ze.id), [ve, be] = _(se), Ze = w(
1077
+ (k) => {
1078
+ var W;
1079
+ be(k), (W = I == null ? void 0 : I.onTabChange) == null || W.call(I, k);
1403
1080
  },
1404
- [y]
1405
- ), De = T(
1406
- (C) => {
1407
- C.stopPropagation(), $(u), _(u);
1081
+ [I]
1082
+ ), qe = w(
1083
+ (k) => {
1084
+ k.stopPropagation(), X(d), C(d);
1408
1085
  },
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
1086
+ [X, C, d]
1087
+ ), Ye = w(() => {
1088
+ T(d);
1089
+ }, [T, d]);
1090
+ if (U(() => (x ? g(d, v, h) : b(d), () => {
1091
+ b(d);
1092
+ }), [x, d, g, b, v, h]), U(() => {
1093
+ if (x) {
1094
+ let k = (a == null ? void 0 : a.current) ?? null;
1095
+ if (!k && (G != null && G.anchorRef.current) && (k = G.anchorRef.current), !k && h && (k = document.querySelector(`[data-popout-id="${h}"]`)), k || (k = f.current), k) {
1096
+ const W = k.getBoundingClientRect(), et = Xo(W, e, c, {
1097
+ placement: o,
1098
+ alignment: i,
1099
+ panelHeight: t
1423
1100
  });
1424
- P(Ue), w.current || (E(), k && fe(Y));
1101
+ y(et), N.current || (O(), D && be(se));
1425
1102
  }
1426
1103
  }
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();
1104
+ N.current = x;
1105
+ }, [x, e, t, c, f, a, o, i, O, D, se, h]), U(() => {
1106
+ if (x && z.current) {
1107
+ const k = setTimeout(() => {
1108
+ var W;
1109
+ (W = z.current) == null || W.focus();
1433
1110
  }, 0);
1434
1111
  return () => {
1435
- clearTimeout(C);
1112
+ clearTimeout(k);
1436
1113
  };
1437
- } else !b && h.current && h.current.focus();
1438
- }, [b, h]), !b || !l || !m)
1114
+ } else !x && f.current && f.current.focus();
1115
+ }, [x, f]), !x || !l || !P)
1439
1116
  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,
1117
+ const Je = F(d), Pe = {
1118
+ left: P.left + M.left,
1119
+ top: P.top + M.top
1120
+ }, Qe = /* @__PURE__ */ S(
1121
+ Dt,
1486
1122
  {
1487
- ref: M,
1488
- id: q,
1123
+ ref: z,
1124
+ id: p,
1489
1125
  role: "dialog",
1490
1126
  "aria-modal": "false",
1491
- "aria-labelledby": p,
1127
+ "aria-labelledby": m,
1492
1128
  tabIndex: -1,
1493
- radius: ie ? 0 : 8,
1494
- onClick: De,
1495
- "data-popout-id": u,
1496
- ...f && { "data-parent-id": f },
1129
+ radius: 8,
1130
+ onClick: qe,
1131
+ "data-popout-id": d,
1132
+ ...h && { "data-parent-id": h },
1497
1133
  style: {
1498
1134
  position: "fixed",
1499
- left: me.left,
1500
- top: me.top,
1501
- width: t,
1502
- ...e !== void 0 && { height: e },
1503
- zIndex: He,
1135
+ left: Pe.left,
1136
+ top: Pe.top,
1137
+ minWidth: e,
1138
+ ...t !== void 0 && { minHeight: t },
1139
+ zIndex: Je,
1504
1140
  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(),
1141
+ border: "1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",
1509
1142
  // Figma-style shadows: tight, hard near edges, softer further out
1510
1143
  boxShadow: [
1511
1144
  "0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))",
@@ -1519,120 +1152,505 @@ function lr({
1519
1152
  outline: "none"
1520
1153
  },
1521
1154
  children: [
1522
- /* @__PURE__ */ o(
1523
- ar,
1155
+ /* @__PURE__ */ r(
1156
+ jo,
1524
1157
  {
1525
- config: n,
1526
- onClose: $e,
1527
- dragTriggerProps: N,
1528
- activeTab: de,
1529
- onTabChange: Le,
1530
- actions: g,
1531
- titleId: p
1158
+ config: s,
1159
+ onClose: Ye,
1160
+ dragTriggerProps: B,
1161
+ activeTab: ve,
1162
+ onTabChange: Ze,
1163
+ actions: u,
1164
+ titleId: m
1532
1165
  }
1533
1166
  ),
1534
- /* @__PURE__ */ o(A, { children: k ? (he = y == null ? void 0 : y.tabs.find((C) => C.id === de)) == null ? void 0 : he.content : i })
1167
+ /* @__PURE__ */ r(R, { children: D ? (ye = I == null ? void 0 : I.tabs.find((k) => k.id === ve)) == null ? void 0 : ye.content : n })
1535
1168
  ]
1536
1169
  }
1537
1170
  );
1538
- return At(Ve, l);
1171
+ return Ut(Qe, l);
1539
1172
  }
1540
- function cr({ children: t }) {
1541
- const { toggle: e, triggerRef: n, isOpen: i, id: a } = Ae(), r = T(
1542
- (g) => {
1543
- g.stopPropagation(), e();
1173
+ function Ko({ children: e }) {
1174
+ const { toggle: t, triggerRef: s, isOpen: n, id: a } = he(), o = w(
1175
+ (u) => {
1176
+ u.stopPropagation(), t();
1544
1177
  },
1545
- [e]
1178
+ [t]
1546
1179
  );
1547
- if (!Et(t))
1180
+ if (!_e(e))
1548
1181
  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);
1182
+ const i = `popout-panel-${a}`, c = e;
1183
+ return He(c, {
1184
+ onClick: (u) => {
1185
+ var x, v;
1186
+ (v = (x = c.props).onClick) == null || v.call(x, u), o(u);
1554
1187
  },
1555
- ref: n,
1188
+ ref: s,
1556
1189
  // Mark this element as a popout trigger for click-outside detection
1557
1190
  "data-popout-trigger": !0,
1558
1191
  // ARIA attributes for accessibility
1559
- "aria-expanded": i,
1560
- "aria-controls": s,
1192
+ "aria-expanded": n,
1193
+ "aria-controls": i,
1561
1194
  "aria-haspopup": "dialog"
1562
1195
  });
1563
1196
  }
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 });
1197
+ function Zo({ children: e }) {
1198
+ const t = Ho(), s = (t == null ? void 0 : t.id) ?? null;
1199
+ return /* @__PURE__ */ r($o, { parentId: s, children: e });
1200
+ }
1201
+ const ne = Object.assign(Zo, {
1202
+ Trigger: Ko,
1203
+ Panel: Wo,
1204
+ Content: Lo,
1205
+ Anchor: Do
1206
+ }), mn = $t(
1207
+ function({ icon: t, size: s = "xs", ...n }, a) {
1208
+ const { isOpen: o } = he();
1209
+ return /* @__PURE__ */ r(
1210
+ L,
1211
+ {
1212
+ ref: a,
1213
+ variant: o ? "light" : "subtle",
1214
+ size: s,
1215
+ c: o ? void 0 : "dimmed",
1216
+ ...n,
1217
+ children: t
1218
+ }
1219
+ );
1220
+ }
1221
+ );
1222
+ function gn({ children: e }) {
1223
+ return /* @__PURE__ */ r(Uo, { children: e });
1224
+ }
1225
+ function qo({
1226
+ color: e,
1227
+ defaultColor: t,
1228
+ opacity: s,
1229
+ defaultOpacity: n = 100,
1230
+ onColorChange: a,
1231
+ onOpacityChange: o,
1232
+ label: i,
1233
+ showOpacity: c = !0
1234
+ }) {
1235
+ const [u, x] = q({
1236
+ value: e,
1237
+ defaultValue: void 0,
1238
+ finalValue: void 0,
1239
+ onChange: a
1240
+ }), [v, f] = q({
1241
+ value: s,
1242
+ defaultValue: void 0,
1243
+ finalValue: void 0,
1244
+ onChange: o
1245
+ }), d = u === void 0, h = v === void 0, F = d && (!c || h), l = u ?? t, g = v ?? n, [b, C] = _(l.replace("#", "").toUpperCase()), [A, T] = _(g);
1246
+ U(() => {
1247
+ C(l.replace("#", "").toUpperCase());
1248
+ }, [l]), U(() => {
1249
+ T(g);
1250
+ }, [g]);
1251
+ const X = (z) => {
1252
+ if (z.length === 9) {
1253
+ const V = z.slice(0, 7).toUpperCase(), B = z.slice(7, 9), M = je(B);
1254
+ x(V), c && f(M);
1255
+ } else
1256
+ x(z.toUpperCase());
1257
+ }, G = () => {
1258
+ const z = Xe(g);
1259
+ return `${l}${z}`.toUpperCase();
1260
+ }, Q = (z) => {
1261
+ C(z.currentTarget.value.toUpperCase());
1262
+ }, p = () => {
1263
+ let z = b.toUpperCase();
1264
+ z && !z.startsWith("#") && (z = `#${z}`), /^#[0-9A-F]{6}$/i.test(z) && z !== l ? x(z) : C(l.replace("#", "").toUpperCase());
1265
+ }, m = (z) => {
1266
+ T(z);
1267
+ }, P = () => {
1268
+ const z = typeof A == "string" ? parseFloat(A) : A;
1269
+ if (isNaN(z))
1270
+ T(g);
1271
+ else {
1272
+ const V = Math.min(100, Math.max(0, z));
1273
+ V !== g && f(V);
1274
+ }
1275
+ }, y = () => {
1276
+ x(void 0), c && f(void 0);
1277
+ }, N = /* @__PURE__ */ S(E, { gap: 4, wrap: "nowrap", children: [
1278
+ /* @__PURE__ */ S(E, { gap: 0, children: [
1279
+ /* @__PURE__ */ S(ne, { children: [
1280
+ /* @__PURE__ */ r(ne.Trigger, { children: /* @__PURE__ */ r(
1281
+ L,
1282
+ {
1283
+ variant: "filled",
1284
+ size: 24,
1285
+ radius: 0,
1286
+ style: {
1287
+ backgroundColor: "var(--mantine-color-default)",
1288
+ borderRadius: "4px 0 0 4px"
1289
+ },
1290
+ "aria-label": "Color swatch",
1291
+ children: /* @__PURE__ */ r(
1292
+ Lt,
1293
+ {
1294
+ color: l,
1295
+ size: 14,
1296
+ radius: 2,
1297
+ style: {
1298
+ border: "1px solid var(--mantine-color-default-border)"
1299
+ }
1300
+ }
1301
+ )
1302
+ }
1303
+ ) }),
1304
+ /* @__PURE__ */ r(
1305
+ ne.Panel,
1306
+ {
1307
+ width: 220,
1308
+ header: { variant: "title", title: i ?? "Color" },
1309
+ placement: "bottom",
1310
+ alignment: "start",
1311
+ gap: 4,
1312
+ children: /* @__PURE__ */ r(ne.Content, { children: /* @__PURE__ */ r(
1313
+ Rt,
1314
+ {
1315
+ format: "hexa",
1316
+ value: G(),
1317
+ onChange: X,
1318
+ swatches: [...Vo]
1319
+ }
1320
+ ) })
1321
+ }
1322
+ )
1323
+ ] }),
1324
+ /* @__PURE__ */ r(
1325
+ Oe,
1326
+ {
1327
+ value: b,
1328
+ onChange: Q,
1329
+ onBlur: p,
1330
+ "aria-label": "Color hex value",
1331
+ "data-is-default": d ? "true" : "false",
1332
+ w: 72,
1333
+ styles: {
1334
+ input: {
1335
+ borderRadius: c ? 0 : "0 4px 4px 0",
1336
+ fontFamily: "monospace",
1337
+ textTransform: "uppercase",
1338
+ ...d ? {
1339
+ fontStyle: "italic",
1340
+ color: "var(--mantine-color-dimmed)"
1341
+ } : {}
1342
+ }
1343
+ }
1344
+ }
1345
+ ),
1346
+ c && /* @__PURE__ */ S(Le, { children: [
1347
+ /* @__PURE__ */ r(
1348
+ R,
1349
+ {
1350
+ style: {
1351
+ width: 1,
1352
+ height: 24,
1353
+ backgroundColor: "var(--mantine-color-default-border)"
1354
+ }
1355
+ }
1356
+ ),
1357
+ /* @__PURE__ */ r(
1358
+ pe,
1359
+ {
1360
+ value: A,
1361
+ onChange: m,
1362
+ onBlur: P,
1363
+ min: 0,
1364
+ max: 100,
1365
+ hideControls: !0,
1366
+ suffix: "%",
1367
+ "aria-label": "Opacity",
1368
+ "data-is-default": h ? "true" : "false",
1369
+ w: 54,
1370
+ styles: {
1371
+ input: {
1372
+ borderRadius: "0 4px 4px 0",
1373
+ textAlign: "right",
1374
+ ...h ? {
1375
+ fontStyle: "italic",
1376
+ color: "var(--mantine-color-dimmed)"
1377
+ } : {}
1378
+ }
1379
+ }
1380
+ }
1381
+ )
1382
+ ] })
1383
+ ] }),
1384
+ !F && /* @__PURE__ */ r(
1385
+ L,
1386
+ {
1387
+ variant: "subtle",
1388
+ size: "xs",
1389
+ c: "dimmed",
1390
+ "aria-label": `Reset ${i ?? "color"} to default`,
1391
+ onClick: y,
1392
+ children: /* @__PURE__ */ r(ue, { size: 12 })
1393
+ }
1394
+ )
1395
+ ] });
1396
+ return i ? /* @__PURE__ */ S(Z, { gap: 0, children: [
1397
+ /* @__PURE__ */ r(H, { size: "xs", c: "dimmed", mb: 1, lh: 1.2, children: i }),
1398
+ N
1399
+ ] }) : N;
1400
+ }
1401
+ function xn({ label: e, actions: t, children: s, bleed: n }) {
1402
+ return /* @__PURE__ */ S(R, { children: [
1403
+ /* @__PURE__ */ r(De, { color: "gray.7", mt: 8, mb: 0, mx: n ? "calc(-1 * var(--mantine-spacing-sm) - 1px)" : void 0 }),
1404
+ /* @__PURE__ */ S(E, { justify: "space-between", py: 8, px: 8, children: [
1405
+ /* @__PURE__ */ r(H, { size: "xs", fw: 500, lh: 1.2, children: e }),
1406
+ t && /* @__PURE__ */ r(E, { gap: 4, children: t })
1407
+ ] }),
1408
+ /* @__PURE__ */ r(Z, { gap: 0, px: 8, children: s })
1409
+ ] });
1410
+ }
1411
+ function hn({
1412
+ label: e,
1413
+ defaultOpen: t = !0,
1414
+ children: s,
1415
+ hasConfiguredValues: n = !1
1416
+ }) {
1417
+ const [a, { toggle: o }] = Re(t);
1418
+ return /* @__PURE__ */ S(R, { children: [
1419
+ /* @__PURE__ */ r(De, { color: "gray.7", mt: 8, mb: 0, mx: 8 }),
1420
+ /* @__PURE__ */ r(E, { justify: "space-between", py: 8, px: 8, style: { cursor: "pointer" }, onClick: o, children: /* @__PURE__ */ S(E, { gap: 4, children: [
1421
+ /* @__PURE__ */ r(
1422
+ L,
1423
+ {
1424
+ variant: "subtle",
1425
+ size: "xs",
1426
+ c: "dimmed",
1427
+ "aria-label": a ? `Collapse ${e}` : `Expand ${e}`,
1428
+ children: a ? /* @__PURE__ */ r(fe, { size: 12 }) : /* @__PURE__ */ r(Me, { size: 12 })
1429
+ }
1430
+ ),
1431
+ /* @__PURE__ */ r(H, { size: "xs", fw: 500, lh: 1.2, children: e }),
1432
+ n && /* @__PURE__ */ r(
1433
+ R,
1434
+ {
1435
+ "aria-label": `${e} has configured values`,
1436
+ style: {
1437
+ width: 6,
1438
+ height: 6,
1439
+ borderRadius: "50%",
1440
+ backgroundColor: "var(--mantine-color-blue-5)",
1441
+ marginLeft: 4
1442
+ }
1443
+ }
1444
+ )
1445
+ ] }) }),
1446
+ /* @__PURE__ */ r(Mt, { in: a, children: /* @__PURE__ */ r(Z, { gap: 0, children: s }) })
1447
+ ] });
1448
+ }
1449
+ function vn({ label: e, defaultOpen: t = !1, children: s }) {
1450
+ const [n, { toggle: a }] = Re(t);
1451
+ return /* @__PURE__ */ S(R, { children: [
1452
+ /* @__PURE__ */ S(E, { gap: 4, py: 4, style: { cursor: "pointer" }, onClick: a, children: [
1453
+ /* @__PURE__ */ r(
1454
+ L,
1455
+ {
1456
+ variant: "subtle",
1457
+ size: "xs",
1458
+ c: "dimmed",
1459
+ "aria-label": n ? `Collapse ${e}` : `Expand ${e}`,
1460
+ children: n ? /* @__PURE__ */ r(fe, { size: 10 }) : /* @__PURE__ */ r(Me, { size: 10 })
1461
+ }
1462
+ ),
1463
+ /* @__PURE__ */ r(H, { size: "xs", c: "dimmed", lh: 1.2, children: e })
1464
+ ] }),
1465
+ n && /* @__PURE__ */ r(R, { pl: "md", children: /* @__PURE__ */ r(Z, { gap: 4, children: s }) })
1466
+ ] });
1467
+ }
1468
+ function Yo() {
1469
+ return crypto.randomUUID().slice(0, 8);
1470
+ }
1471
+ function de(e, t) {
1472
+ return {
1473
+ id: Yo(),
1474
+ offset: e,
1475
+ color: t
1476
+ };
1477
+ }
1478
+ function Jo() {
1479
+ return [de(0, "#6366F1"), de(1, "#06B6D4")];
1567
1480
  }
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 });
1481
+ function bn({
1482
+ stops: e,
1483
+ defaultStops: t,
1484
+ direction: s,
1485
+ defaultDirection: n = 0,
1486
+ showDirection: a = !0,
1487
+ onChange: o
1488
+ }) {
1489
+ const [i, c] = q({
1490
+ value: e,
1491
+ defaultValue: t,
1492
+ finalValue: Jo(),
1493
+ onChange: (l) => o == null ? void 0 : o(l, u)
1494
+ }), [u, x] = q({
1495
+ value: s,
1496
+ defaultValue: n,
1497
+ finalValue: 0,
1498
+ onChange: (l) => o == null ? void 0 : o(i, l)
1499
+ }), v = (l, g) => {
1500
+ const b = [...i];
1501
+ b[l] = { ...b[l], color: g }, c(b), o == null || o(b, u);
1502
+ }, f = (l, g) => {
1503
+ const b = [...i];
1504
+ b[l] = { ...b[l], offset: g / 100 }, c(b), o == null || o(b, u);
1505
+ }, d = (l) => {
1506
+ x(l), o == null || o(i, l);
1507
+ }, h = () => {
1508
+ if (i.length >= 5)
1509
+ return;
1510
+ const l = i.length > 0 ? (i[i.length - 1].offset + 1) / 2 : 0.5, g = [...i, de(l, le)];
1511
+ g.sort((b, C) => b.offset - C.offset), c(g), o == null || o(g, u);
1512
+ }, F = (l) => {
1513
+ if (i.length <= 2)
1514
+ return;
1515
+ const g = i.filter((b, C) => C !== l);
1516
+ c(g), o == null || o(g, u);
1517
+ };
1518
+ return /* @__PURE__ */ S(Z, { gap: "xs", children: [
1519
+ /* @__PURE__ */ S(E, { justify: "space-between", align: "center", children: [
1520
+ /* @__PURE__ */ r(H, { size: "xs", c: "dimmed", children: "Color Stops" }),
1521
+ /* @__PURE__ */ r(
1522
+ L,
1523
+ {
1524
+ variant: "subtle",
1525
+ color: "gray",
1526
+ onClick: h,
1527
+ disabled: i.length >= 5,
1528
+ "aria-label": "Add color stop",
1529
+ children: /* @__PURE__ */ r(Ht, { size: 12 })
1530
+ }
1531
+ )
1532
+ ] }),
1533
+ i.map((l, g) => /* @__PURE__ */ S(E, { gap: "xs", align: "flex-end", children: [
1534
+ /* @__PURE__ */ r(
1535
+ qo,
1536
+ {
1537
+ color: l.color,
1538
+ defaultColor: le,
1539
+ onColorChange: (b) => {
1540
+ v(g, b ?? le);
1541
+ },
1542
+ showOpacity: !1
1543
+ }
1544
+ ),
1545
+ /* @__PURE__ */ r(R, { style: { width: "80px" }, children: /* @__PURE__ */ r(
1546
+ ce,
1547
+ {
1548
+ min: 0,
1549
+ max: 100,
1550
+ value: l.offset * 100,
1551
+ onChange: (b) => {
1552
+ f(g, b);
1553
+ },
1554
+ label: (b) => `${Math.round(b)}%`,
1555
+ "aria-label": `Stop ${g + 1} position`
1556
+ }
1557
+ ) }),
1558
+ /* @__PURE__ */ r(
1559
+ L,
1560
+ {
1561
+ variant: "subtle",
1562
+ color: "gray",
1563
+ onClick: () => {
1564
+ F(g);
1565
+ },
1566
+ disabled: i.length <= 2,
1567
+ "aria-label": `Remove color stop ${g + 1}`,
1568
+ children: /* @__PURE__ */ r(Nt, { size: 12 })
1569
+ }
1570
+ )
1571
+ ] }, l.id)),
1572
+ a && /* @__PURE__ */ S(R, { pb: "md", children: [
1573
+ /* @__PURE__ */ r(H, { size: "xs", c: "dimmed", mb: 4, children: "Direction" }),
1574
+ /* @__PURE__ */ r(
1575
+ ce,
1576
+ {
1577
+ min: 0,
1578
+ max: 360,
1579
+ value: u,
1580
+ onChange: d,
1581
+ label: (l) => `${l}°`,
1582
+ "aria-label": "Gradient direction",
1583
+ marks: [
1584
+ { value: 0, label: "0°" },
1585
+ { value: 90, label: "90°" },
1586
+ { value: 180, label: "180°" },
1587
+ { value: 270, label: "270°" },
1588
+ { value: 360, label: "360°" }
1589
+ ]
1590
+ }
1591
+ )
1592
+ ] })
1593
+ ] });
1575
1594
  }
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) })
1595
+ function Pn({ label: e, value: t }) {
1596
+ return /* @__PURE__ */ S(E, { justify: "space-between", py: 4, children: [
1597
+ /* @__PURE__ */ r(H, { size: "sm", c: "dimmed", children: e }),
1598
+ /* @__PURE__ */ r(H, { size: "sm", c: "var(--mantine-color-text)", fw: 500, children: String(t) })
1580
1599
  ] });
1581
1600
  }
1582
- function Er({
1583
- label: t,
1584
- value: e,
1585
- defaultValue: n,
1586
- onChange: i,
1601
+ function zn({
1602
+ label: e,
1603
+ value: t,
1604
+ defaultValue: s,
1605
+ onChange: n,
1587
1606
  min: a,
1588
- max: r,
1589
- step: s,
1607
+ max: o,
1608
+ step: i,
1590
1609
  decimalScale: c,
1591
- suffix: g,
1592
- hideControls: b = !0
1610
+ suffix: u,
1611
+ hideControls: x = !0
1593
1612
  }) {
1594
- const [z, h] = Z({
1595
- value: e,
1613
+ const [v, f] = q({
1614
+ value: t,
1596
1615
  defaultValue: void 0,
1597
1616
  // Start with undefined (using default)
1598
1617
  finalValue: void 0,
1599
- onChange: i
1600
- }), u = z === void 0, f = z ?? n, [F, l] = L(f);
1618
+ onChange: n
1619
+ }), d = v === void 0, h = v ?? s, [F, l] = _(h);
1601
1620
  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);
1621
+ l(v ?? s);
1622
+ }, [v, s]);
1623
+ const g = (A) => {
1624
+ l(A);
1625
+ }, b = () => {
1626
+ const A = typeof F == "string" ? parseFloat(F) : F;
1627
+ if (isNaN(A))
1628
+ l(v ?? s);
1610
1629
  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);
1630
+ let T = A;
1631
+ a !== void 0 && T < a && (T = a), o !== void 0 && T > o && (T = o), T !== v && f(T), l(T);
1613
1632
  }
1614
- }, _ = () => {
1615
- h(void 0);
1633
+ }, C = () => {
1634
+ f(void 0);
1616
1635
  };
1617
- return /* @__PURE__ */ S(R, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1618
- /* @__PURE__ */ o(
1619
- le,
1636
+ return /* @__PURE__ */ S(E, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1637
+ /* @__PURE__ */ r(
1638
+ pe,
1620
1639
  {
1621
- label: t,
1622
- "aria-label": t,
1640
+ label: e,
1641
+ "aria-label": e,
1623
1642
  value: F,
1624
- onChange: x,
1625
- onBlur: v,
1643
+ onChange: g,
1644
+ onBlur: b,
1626
1645
  min: a,
1627
- max: r,
1628
- step: s,
1646
+ max: o,
1647
+ step: i,
1629
1648
  decimalScale: c,
1630
- suffix: g,
1631
- hideControls: b,
1632
- size: "compact",
1633
- "data-is-default": u ? "true" : "false",
1649
+ suffix: u,
1650
+ hideControls: x,
1651
+ "data-is-default": d ? "true" : "false",
1634
1652
  styles: {
1635
- input: u ? {
1653
+ input: d ? {
1636
1654
  fontStyle: "italic",
1637
1655
  color: "var(--mantine-color-dimmed)"
1638
1656
  } : void 0
@@ -1640,43 +1658,42 @@ function Er({
1640
1658
  style: { flex: 1 }
1641
1659
  }
1642
1660
  ),
1643
- !u && /* @__PURE__ */ o(
1644
- D,
1661
+ !d && /* @__PURE__ */ r(
1662
+ L,
1645
1663
  {
1646
1664
  variant: "subtle",
1647
1665
  size: "xs",
1648
1666
  c: "dimmed",
1649
- "aria-label": `Reset ${t} to default`,
1650
- onClick: _,
1667
+ "aria-label": `Reset ${e} to default`,
1668
+ onClick: C,
1651
1669
  style: { marginBottom: 2 },
1652
- children: /* @__PURE__ */ o(ne, { size: 12 })
1670
+ children: /* @__PURE__ */ r(ue, { size: 12 })
1653
1671
  }
1654
1672
  )
1655
1673
  ] });
1656
1674
  }
1657
- function Or({ label: t, value: e, defaultValue: n, options: i, onChange: a }) {
1658
- const [r, s] = Z({
1659
- value: e,
1675
+ function yn({ label: e, value: t, defaultValue: s, options: n, onChange: a }) {
1676
+ const [o, i] = q({
1677
+ value: t,
1660
1678
  defaultValue: void 0,
1661
1679
  // Start with undefined (using default)
1662
1680
  finalValue: void 0,
1663
1681
  onChange: a
1664
- }), c = r === void 0, g = r ?? n, b = (h) => {
1665
- h !== null && s(h);
1666
- }, z = () => {
1667
- s(void 0);
1682
+ }), c = o === void 0, u = o ?? s, x = (f) => {
1683
+ f !== null && i(f);
1684
+ }, v = () => {
1685
+ i(void 0);
1668
1686
  };
1669
- return /* @__PURE__ */ S(R, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1670
- /* @__PURE__ */ o(
1671
- we,
1687
+ return /* @__PURE__ */ S(E, { gap: 4, wrap: "nowrap", align: "flex-end", children: [
1688
+ /* @__PURE__ */ r(
1689
+ Ve,
1672
1690
  {
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 }),
1691
+ label: e,
1692
+ "aria-label": e,
1693
+ value: u,
1694
+ onChange: x,
1695
+ data: n,
1696
+ rightSection: /* @__PURE__ */ r(fe, { size: 14 }),
1680
1697
  rightSectionPointerEvents: "none",
1681
1698
  "data-is-default": c ? "true" : "false",
1682
1699
  allowDeselect: !1,
@@ -1689,61 +1706,90 @@ function Or({ label: t, value: e, defaultValue: n, options: i, onChange: a }) {
1689
1706
  style: { flex: 1 }
1690
1707
  }
1691
1708
  ),
1692
- !c && /* @__PURE__ */ o(
1693
- D,
1709
+ !c && /* @__PURE__ */ r(
1710
+ L,
1694
1711
  {
1695
1712
  variant: "subtle",
1696
1713
  size: "xs",
1697
1714
  c: "dimmed",
1698
- "aria-label": `Reset ${t} to default`,
1699
- onClick: z,
1715
+ "aria-label": `Reset ${e} to default`,
1716
+ onClick: v,
1700
1717
  style: { marginBottom: 2 },
1701
- children: /* @__PURE__ */ o(ne, { size: 12 })
1718
+ children: /* @__PURE__ */ r(ue, { size: 12 })
1702
1719
  }
1703
1720
  )
1704
1721
  ] });
1705
1722
  }
1706
- function Ar() {
1707
- return kt("dark");
1723
+ function Sn({
1724
+ label: e,
1725
+ checked: t,
1726
+ defaultChecked: s,
1727
+ onChange: n,
1728
+ children: a
1729
+ }) {
1730
+ const [o, i] = q({
1731
+ value: t,
1732
+ defaultValue: s,
1733
+ finalValue: !1,
1734
+ onChange: n
1735
+ });
1736
+ return /* @__PURE__ */ S(Z, { gap: 4, children: [
1737
+ /* @__PURE__ */ r(
1738
+ Ee,
1739
+ {
1740
+ label: e,
1741
+ checked: o,
1742
+ onChange: (c) => {
1743
+ i(c.currentTarget.checked);
1744
+ }
1745
+ }
1746
+ ),
1747
+ o && /* @__PURE__ */ r(R, { "data-testid": "toggle-with-content-children", pl: "md", children: /* @__PURE__ */ r(Z, { gap: 4, children: a }) })
1748
+ ] });
1749
+ }
1750
+ function wn() {
1751
+ return _t("dark");
1708
1752
  }
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";
1753
+ const Cn = {
1754
+ xs: ee(4),
1755
+ sm: ee(8),
1756
+ md: ee(16),
1757
+ lg: ee(24),
1758
+ xl: ee(32)
1759
+ }, In = "0.1.0";
1716
1760
  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
1761
+ qo as CompactColorInput,
1762
+ xn as ControlGroup,
1763
+ hn as ControlSection,
1764
+ vn as ControlSubGroup,
1765
+ le as DEFAULT_GRADIENT_STOP_COLOR,
1766
+ bn as GradientEditor,
1767
+ Cn as MANTINE_SPACING,
1768
+ Ue as MAX_ALPHA_HEX,
1769
+ Ge as MAX_OPACITY_PERCENT,
1770
+ go as POPOUT_GAP,
1771
+ ln as POPOUT_NESTED_GAP,
1772
+ Ce as POPOUT_Z_INDEX_BASE,
1773
+ ne as Popout,
1774
+ mn as PopoutButton,
1775
+ gn as PopoutManager,
1776
+ dn as SWATCH_COLORS,
1777
+ Vo as SWATCH_COLORS_HEXA,
1778
+ Pn as StatRow,
1779
+ zn as StyleNumberInput,
1780
+ yn as StyleSelect,
1781
+ Sn as ToggleWithContent,
1782
+ In as VERSION,
1783
+ jt as compactColors,
1784
+ Gt as compactDarkColors,
1785
+ cn as compactTheme,
1786
+ Fo as compactThemeOverride,
1787
+ de as createColorStop,
1788
+ Jo as createDefaultGradientStops,
1789
+ fn as isValidHex,
1790
+ Xe as opacityToAlphaHex,
1791
+ je as parseAlphaFromHexa,
1792
+ pn as parseHexaColor,
1793
+ un as toHexaColor,
1794
+ wn as useActualColorScheme
1749
1795
  };