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