@arcanewizards/sigil 0.1.3 → 0.1.5
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/{chunk-WEKMHSZV.cjs → chunk-5CAFJT5T.cjs} +65 -49
- package/dist/{chunk-HF7IIHPE.js → chunk-LKKN6DFB.js} +35 -19
- package/dist/{chunk-5DRI7C4U.cjs → chunk-TZJ4UXR3.cjs} +1 -12
- package/dist/{chunk-H4U4Z4GM.js → chunk-WYUGJOEB.js} +0 -11
- package/dist/frontend/appearance.cjs +6 -6
- package/dist/frontend/appearance.js +2 -2
- package/dist/frontend/controls/index.cjs +5 -3
- package/dist/frontend/controls/index.d.cts +17 -13
- package/dist/frontend/controls/index.d.ts +17 -13
- package/dist/frontend/controls/index.js +4 -2
- package/dist/frontend/dialogs.cjs +3 -3
- package/dist/frontend/dialogs.js +2 -2
- package/dist/frontend/styling.cjs +2 -4
- package/dist/frontend/styling.d.cts +1 -5
- package/dist/frontend/styling.d.ts +1 -5
- package/dist/frontend/styling.hooks.cjs +18 -0
- package/dist/frontend/styling.hooks.d.cts +10 -0
- package/dist/frontend/styling.hooks.d.ts +10 -0
- package/dist/frontend/styling.hooks.js +18 -0
- package/dist/frontend/styling.js +3 -5
- package/dist/frontend.cjs +8 -8
- package/dist/frontend.js +2 -2
- package/package.json +9 -3
|
@@ -9,7 +9,7 @@ var _chunkRI33QVODcjs = require('./chunk-RI33QVOD.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkTZJ4UXR3cjs = require('./chunk-TZJ4UXR3.cjs');
|
|
13
13
|
|
|
14
14
|
// src/frontend/dialogs.tsx
|
|
15
15
|
|
|
@@ -75,7 +75,7 @@ var CONTROL_BUTTON_VAR_SUFFIX = {
|
|
|
75
75
|
borderActive: "border-active"
|
|
76
76
|
};
|
|
77
77
|
var controlButtonColorVariable = (property) => `--sigil-control-button-${CONTROL_BUTTON_VAR_SUFFIX[property]}`;
|
|
78
|
-
var controlButtonColorVariables = (usage) =>
|
|
78
|
+
var controlButtonColorVariables = (usage) => _chunkTZJ4UXR3cjs.cssVariables.call(void 0,
|
|
79
79
|
Object.fromEntries(
|
|
80
80
|
Object.keys(usage).map(
|
|
81
81
|
(key) => [controlButtonColorVariable(key), usage[key]]
|
|
@@ -91,16 +91,16 @@ var clsControlButton = ({
|
|
|
91
91
|
primary
|
|
92
92
|
}) => _util.cn.call(void 0,
|
|
93
93
|
`sigil-control-button`,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, variant === "border", `sigil-control-button-variant-border`),
|
|
95
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, variant === "large", `sigil-control-button-variant-large`),
|
|
96
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, variant === "properties", `sigil-control-button-variant-properties`),
|
|
97
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, variant === "table-row", `sigil-control-button-variant-table-row`),
|
|
98
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, variant === "toolbar", `sigil-control-button-variant-toolbar`),
|
|
99
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, variant === "titlebar", `sigil-control-button-variant-titlebar`),
|
|
100
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, touching, `sigil-control-button-touching`),
|
|
101
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, active, `sigil-control-button-active`),
|
|
102
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, touching && active, `sigil-control-button-active-touching`),
|
|
103
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, primary, `sigil-control-button-primary`),
|
|
104
104
|
clsControlPosition(position),
|
|
105
105
|
className
|
|
106
106
|
);
|
|
@@ -140,7 +140,7 @@ var ControlButtonFrame = _react.forwardRef.call(void 0,
|
|
|
140
140
|
_core.Icon,
|
|
141
141
|
{
|
|
142
142
|
icon,
|
|
143
|
-
className: _util.cn.call(void 0,
|
|
143
|
+
className: _util.cn.call(void 0, _chunkTZJ4UXR3cjs.cnd.call(void 0, children, "text-[120%]", "text-[150%]"))
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
146
|
children
|
|
@@ -217,14 +217,14 @@ var ControlParagraph = _react.forwardRef.call(void 0, ({ className, mode, positi
|
|
|
217
217
|
className: _util.cn.call(void 0,
|
|
218
218
|
"border border-transparent",
|
|
219
219
|
clsControlPosition(position),
|
|
220
|
-
|
|
220
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0,
|
|
221
221
|
mode === "success",
|
|
222
222
|
`
|
|
223
223
|
border-sigil-usage-green-dimmed-border
|
|
224
224
|
bg-sigil-usage-green-dimmed-background p-1 text-sigil-usage-green-text
|
|
225
225
|
`
|
|
226
226
|
),
|
|
227
|
-
|
|
227
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0,
|
|
228
228
|
mode === "warning",
|
|
229
229
|
`
|
|
230
230
|
border-sigil-usage-yellow-dimmed-border
|
|
@@ -232,7 +232,7 @@ var ControlParagraph = _react.forwardRef.call(void 0, ({ className, mode, positi
|
|
|
232
232
|
text-sigil-usage-yellow-text
|
|
233
233
|
`
|
|
234
234
|
),
|
|
235
|
-
|
|
235
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0,
|
|
236
236
|
mode === "error",
|
|
237
237
|
`
|
|
238
238
|
border-sigil-usage-red-dimmed-border
|
|
@@ -247,15 +247,15 @@ ControlParagraph.displayName = "ControlParagraph";
|
|
|
247
247
|
var ControlLabel = _react.forwardRef.call(void 0,
|
|
248
248
|
({ className, disabled, nonMicro, position = "label", subgrid, ...props }, ref) => {
|
|
249
249
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
-
"
|
|
250
|
+
"label",
|
|
251
251
|
{
|
|
252
252
|
...props,
|
|
253
253
|
ref,
|
|
254
254
|
className: _util.cn.call(void 0,
|
|
255
255
|
"flex items-center justify-end gap-0.6 p-0.6",
|
|
256
256
|
clsControlPosition(position),
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, nonMicro, "max-[550px]:hidden"),
|
|
258
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, disabled, "opacity-50"),
|
|
259
259
|
clsControlSubgridPosition(position, subgrid),
|
|
260
260
|
className
|
|
261
261
|
)
|
|
@@ -273,9 +273,9 @@ var ControlDetails = _react.forwardRef.call(void 0,
|
|
|
273
273
|
className: _util.cn.call(void 0,
|
|
274
274
|
"flex items-center px-0.3 text-sigil-foreground-muted",
|
|
275
275
|
clsControlPosition(position),
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, align === "start", "justify-start"),
|
|
277
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, align === "center", "justify-center"),
|
|
278
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, align === "end", "justify-end"),
|
|
279
279
|
className
|
|
280
280
|
)
|
|
281
281
|
}
|
|
@@ -318,7 +318,7 @@ var ControlDialog = ({
|
|
|
318
318
|
{
|
|
319
319
|
className: _util.cn.call(void 0,
|
|
320
320
|
"gap-1 bg-sigil-bg-dark select-none",
|
|
321
|
-
|
|
321
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, large, "control-grid-large", "control-grid")
|
|
322
322
|
),
|
|
323
323
|
children
|
|
324
324
|
}
|
|
@@ -413,7 +413,7 @@ var ControlInput = ({
|
|
|
413
413
|
`,
|
|
414
414
|
clsControlPosition(position),
|
|
415
415
|
clsControlSubgridPosition(position, subgrid),
|
|
416
|
-
|
|
416
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, nonMicro, "max-[550px]:hidden"),
|
|
417
417
|
className
|
|
418
418
|
)
|
|
419
419
|
}
|
|
@@ -507,19 +507,9 @@ var ControlSelect = ({
|
|
|
507
507
|
}
|
|
508
508
|
);
|
|
509
509
|
};
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
teal: { label: "Teal", value: "teal" },
|
|
514
|
-
green: { label: "Green", value: "green" },
|
|
515
|
-
yellow: { label: "Yellow", value: "yellow" },
|
|
516
|
-
purple: { label: "Purple", value: "purple" },
|
|
517
|
-
orange: { label: "Orange", value: "orange" },
|
|
518
|
-
brown: { label: "Brown", value: "brown" },
|
|
519
|
-
gray: { label: "Gray", value: "gray" }
|
|
520
|
-
};
|
|
521
|
-
var ControlColorSelect = ({
|
|
522
|
-
color,
|
|
510
|
+
var ControlColoredSelect = ({
|
|
511
|
+
options,
|
|
512
|
+
value,
|
|
523
513
|
onChange,
|
|
524
514
|
variant,
|
|
525
515
|
position,
|
|
@@ -527,13 +517,13 @@ var ControlColorSelect = ({
|
|
|
527
517
|
placeholder,
|
|
528
518
|
...props
|
|
529
519
|
}) => {
|
|
530
|
-
const
|
|
531
|
-
const selectedColor =
|
|
520
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
521
|
+
const selectedColor = _chunkTZJ4UXR3cjs.sigilColorUsage.call(void 0, _nullishCoalesce(_optionalChain([selectedOption, 'optionalAccess', _6 => _6.color]), () => ( "gray")));
|
|
532
522
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
533
523
|
ControlSelect,
|
|
534
524
|
{
|
|
535
525
|
options,
|
|
536
|
-
value
|
|
526
|
+
value,
|
|
537
527
|
onChange,
|
|
538
528
|
triggerButton: (option) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
539
529
|
_radixui.Select.Trigger,
|
|
@@ -542,7 +532,7 @@ var ControlColorSelect = ({
|
|
|
542
532
|
className: clsControlButton({
|
|
543
533
|
variant,
|
|
544
534
|
position,
|
|
545
|
-
active: _optionalChain([option, 'optionalAccess',
|
|
535
|
+
active: _optionalChain([option, 'optionalAccess', _7 => _7.active])
|
|
546
536
|
}),
|
|
547
537
|
style: controlButtonColorVariables({
|
|
548
538
|
bg: selectedColor.background,
|
|
@@ -569,7 +559,7 @@ var ControlColorSelect = ({
|
|
|
569
559
|
)
|
|
570
560
|
] }),
|
|
571
561
|
children: [
|
|
572
|
-
_nullishCoalesce(_optionalChain([option, 'optionalAccess',
|
|
562
|
+
_nullishCoalesce(_optionalChain([option, 'optionalAccess', _8 => _8.label]), () => ( placeholder)),
|
|
573
563
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
574
564
|
_core.Icon,
|
|
575
565
|
{
|
|
@@ -587,7 +577,7 @@ var ControlColorSelect = ({
|
|
|
587
577
|
{
|
|
588
578
|
className: "",
|
|
589
579
|
style: {
|
|
590
|
-
color: `var(--sigil-usage-${option.
|
|
580
|
+
color: `var(--sigil-usage-${option.color}-foreground)`
|
|
591
581
|
},
|
|
592
582
|
children: option.label
|
|
593
583
|
}
|
|
@@ -599,6 +589,31 @@ var ControlColorSelect = ({
|
|
|
599
589
|
}
|
|
600
590
|
);
|
|
601
591
|
};
|
|
592
|
+
var COLOR_OPTIONS = {
|
|
593
|
+
red: { label: "Red", value: "red", color: "red" },
|
|
594
|
+
blue: { label: "Blue", value: "blue", color: "blue" },
|
|
595
|
+
teal: { label: "Teal", value: "teal", color: "teal" },
|
|
596
|
+
green: { label: "Green", value: "green", color: "green" },
|
|
597
|
+
yellow: { label: "Yellow", value: "yellow", color: "yellow" },
|
|
598
|
+
purple: { label: "Purple", value: "purple", color: "purple" },
|
|
599
|
+
orange: { label: "Orange", value: "orange", color: "orange" },
|
|
600
|
+
brown: { label: "Brown", value: "brown", color: "brown" },
|
|
601
|
+
gray: { label: "Gray", value: "gray", color: "gray" }
|
|
602
|
+
};
|
|
603
|
+
var COLOR_OPTIONS_ARRAY = Object.values(COLOR_OPTIONS);
|
|
604
|
+
var ControlColorSelect = ({
|
|
605
|
+
color,
|
|
606
|
+
...props
|
|
607
|
+
}) => {
|
|
608
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
609
|
+
ControlColoredSelect,
|
|
610
|
+
{
|
|
611
|
+
options: COLOR_OPTIONS_ARRAY,
|
|
612
|
+
value: color,
|
|
613
|
+
...props
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
};
|
|
602
617
|
|
|
603
618
|
// src/frontend/dialogs.tsx
|
|
604
619
|
|
|
@@ -625,7 +640,7 @@ var DialogTitle = _react.forwardRef.call(void 0,
|
|
|
625
640
|
flex items-center justify-center gap-0.6 border-b border-sigil-border
|
|
626
641
|
p-arcane font-bold
|
|
627
642
|
`,
|
|
628
|
-
|
|
643
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, isDarkDialog(variant), "bg-sigil-bg-light", "bg-sigil-bg-dark"),
|
|
629
644
|
className
|
|
630
645
|
)
|
|
631
646
|
}
|
|
@@ -653,7 +668,7 @@ var Dialog = ({
|
|
|
653
668
|
if (!dialogRef) return;
|
|
654
669
|
dialogRef.showModal();
|
|
655
670
|
}, [dialogRef]);
|
|
656
|
-
const close = () => _optionalChain([dialogRef, 'optionalAccess',
|
|
671
|
+
const close = () => _optionalChain([dialogRef, 'optionalAccess', _9 => _9.close, 'call', _10 => _10()]);
|
|
657
672
|
const onClose = (event) => {
|
|
658
673
|
if (closable) {
|
|
659
674
|
dialogClosed();
|
|
@@ -678,7 +693,7 @@ var Dialog = ({
|
|
|
678
693
|
max-w-[80vw] min-w-[10vw] border-none p-0 text-sigil-dialog-foreground
|
|
679
694
|
outline-none backdrop-sigil-dialog
|
|
680
695
|
`,
|
|
681
|
-
|
|
696
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, isDarkDialog(variant), "bg-sigil-bg-dark", "bg-sigil-bg-light")
|
|
682
697
|
),
|
|
683
698
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border border-sigil-border", children: [
|
|
684
699
|
title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DialogTitle, { variant, children: title }),
|
|
@@ -687,11 +702,11 @@ var Dialog = ({
|
|
|
687
702
|
{
|
|
688
703
|
className: _util.cn.call(void 0,
|
|
689
704
|
"text-sigil-foreground",
|
|
690
|
-
|
|
705
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0,
|
|
691
706
|
variant === "light-compact" || variant === "dark-compact",
|
|
692
707
|
"p-0"
|
|
693
708
|
),
|
|
694
|
-
|
|
709
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0,
|
|
695
710
|
variant !== "light-compact" && variant !== "dark-compact",
|
|
696
711
|
"p-arcane"
|
|
697
712
|
)
|
|
@@ -768,4 +783,5 @@ var DialogProvider = ({ children }) => {
|
|
|
768
783
|
|
|
769
784
|
|
|
770
785
|
|
|
771
|
-
|
|
786
|
+
|
|
787
|
+
exports.clsControlPosition = clsControlPosition; exports.clsControlSubgridPosition = clsControlSubgridPosition; exports.controlPositionClass = controlPositionClass; exports.controlButtonColorVariable = controlButtonColorVariable; exports.controlButtonColorVariables = controlButtonColorVariables; exports.clsControlButton = clsControlButton; exports.ControlButton = ControlButton; exports.CheckboxControlButton = CheckboxControlButton; exports.LongPressableControlButton = LongPressableControlButton; exports.ControlButtonGroup = ControlButtonGroup; exports.ControlParagraph = ControlParagraph; exports.ControlLabel = ControlLabel; exports.ControlDetails = ControlDetails; exports.InputSpanningTitle = InputSpanningTitle; exports.DialogContext = DialogContext; exports.DialogTitle = DialogTitle; exports.DialogButtons = DialogButtons; exports.Dialog = Dialog; exports.DialogProvider = DialogProvider; exports.ControlDialogButtons = ControlDialogButtons; exports.ControlDialog = ControlDialog; exports.InputWithDelayedPropagation = InputWithDelayedPropagation; exports.ControlInput = ControlInput; exports.ControlPercent = ControlPercent; exports.ControlSelect = ControlSelect; exports.ControlColoredSelect = ControlColoredSelect; exports.ControlColorSelect = ControlColorSelect;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
cnd,
|
|
10
10
|
cssVariables,
|
|
11
11
|
sigilColorUsage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WYUGJOEB.js";
|
|
13
13
|
|
|
14
14
|
// src/frontend/dialogs.tsx
|
|
15
15
|
import {
|
|
@@ -247,7 +247,7 @@ ControlParagraph.displayName = "ControlParagraph";
|
|
|
247
247
|
var ControlLabel = forwardRef2(
|
|
248
248
|
({ className, disabled, nonMicro, position = "label", subgrid, ...props }, ref) => {
|
|
249
249
|
return /* @__PURE__ */ jsx2(
|
|
250
|
-
"
|
|
250
|
+
"label",
|
|
251
251
|
{
|
|
252
252
|
...props,
|
|
253
253
|
ref,
|
|
@@ -507,19 +507,9 @@ var ControlSelect = ({
|
|
|
507
507
|
}
|
|
508
508
|
);
|
|
509
509
|
};
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
teal: { label: "Teal", value: "teal" },
|
|
514
|
-
green: { label: "Green", value: "green" },
|
|
515
|
-
yellow: { label: "Yellow", value: "yellow" },
|
|
516
|
-
purple: { label: "Purple", value: "purple" },
|
|
517
|
-
orange: { label: "Orange", value: "orange" },
|
|
518
|
-
brown: { label: "Brown", value: "brown" },
|
|
519
|
-
gray: { label: "Gray", value: "gray" }
|
|
520
|
-
};
|
|
521
|
-
var ControlColorSelect = ({
|
|
522
|
-
color,
|
|
510
|
+
var ControlColoredSelect = ({
|
|
511
|
+
options,
|
|
512
|
+
value,
|
|
523
513
|
onChange,
|
|
524
514
|
variant,
|
|
525
515
|
position,
|
|
@@ -527,13 +517,13 @@ var ControlColorSelect = ({
|
|
|
527
517
|
placeholder,
|
|
528
518
|
...props
|
|
529
519
|
}) => {
|
|
530
|
-
const
|
|
531
|
-
const selectedColor = sigilColorUsage(color
|
|
520
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
521
|
+
const selectedColor = sigilColorUsage(selectedOption?.color ?? "gray");
|
|
532
522
|
return /* @__PURE__ */ jsx5(
|
|
533
523
|
ControlSelect,
|
|
534
524
|
{
|
|
535
525
|
options,
|
|
536
|
-
value
|
|
526
|
+
value,
|
|
537
527
|
onChange,
|
|
538
528
|
triggerButton: (option) => /* @__PURE__ */ jsx5(
|
|
539
529
|
Select.Trigger,
|
|
@@ -587,7 +577,7 @@ var ControlColorSelect = ({
|
|
|
587
577
|
{
|
|
588
578
|
className: "",
|
|
589
579
|
style: {
|
|
590
|
-
color: `var(--sigil-usage-${option.
|
|
580
|
+
color: `var(--sigil-usage-${option.color}-foreground)`
|
|
591
581
|
},
|
|
592
582
|
children: option.label
|
|
593
583
|
}
|
|
@@ -599,6 +589,31 @@ var ControlColorSelect = ({
|
|
|
599
589
|
}
|
|
600
590
|
);
|
|
601
591
|
};
|
|
592
|
+
var COLOR_OPTIONS = {
|
|
593
|
+
red: { label: "Red", value: "red", color: "red" },
|
|
594
|
+
blue: { label: "Blue", value: "blue", color: "blue" },
|
|
595
|
+
teal: { label: "Teal", value: "teal", color: "teal" },
|
|
596
|
+
green: { label: "Green", value: "green", color: "green" },
|
|
597
|
+
yellow: { label: "Yellow", value: "yellow", color: "yellow" },
|
|
598
|
+
purple: { label: "Purple", value: "purple", color: "purple" },
|
|
599
|
+
orange: { label: "Orange", value: "orange", color: "orange" },
|
|
600
|
+
brown: { label: "Brown", value: "brown", color: "brown" },
|
|
601
|
+
gray: { label: "Gray", value: "gray", color: "gray" }
|
|
602
|
+
};
|
|
603
|
+
var COLOR_OPTIONS_ARRAY = Object.values(COLOR_OPTIONS);
|
|
604
|
+
var ControlColorSelect = ({
|
|
605
|
+
color,
|
|
606
|
+
...props
|
|
607
|
+
}) => {
|
|
608
|
+
return /* @__PURE__ */ jsx5(
|
|
609
|
+
ControlColoredSelect,
|
|
610
|
+
{
|
|
611
|
+
options: COLOR_OPTIONS_ARRAY,
|
|
612
|
+
value: color,
|
|
613
|
+
...props
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
};
|
|
602
617
|
|
|
603
618
|
// src/frontend/dialogs.tsx
|
|
604
619
|
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -767,5 +782,6 @@ export {
|
|
|
767
782
|
ControlInput,
|
|
768
783
|
ControlPercent,
|
|
769
784
|
ControlSelect,
|
|
785
|
+
ControlColoredSelect,
|
|
770
786
|
ControlColorSelect
|
|
771
787
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/frontend/styling.ts
|
|
2
|
-
var _react = require('react');
|
|
3
2
|
var _zod = require('zod');
|
|
4
3
|
var SIGIL_COLOR = _zod.z.enum([
|
|
5
4
|
"purple",
|
|
@@ -41,15 +40,6 @@ var cssSigilColorUsageVariables = (prefix, usage) => cssVariables({
|
|
|
41
40
|
[`--${prefix}-gradient-dark`]: usage.gradientDark
|
|
42
41
|
});
|
|
43
42
|
var cssHintColorVariables = (color) => cssSigilColorUsageVariables(`sigil-usage-hint`, sigilColorUsage(color));
|
|
44
|
-
var useRootHintVariables = (color) => {
|
|
45
|
-
_react.useEffect.call(void 0, () => {
|
|
46
|
-
const root = document.querySelector(".arcane-theme-root");
|
|
47
|
-
if (!root) return;
|
|
48
|
-
Object.entries(cssHintColorVariables(color)).forEach(([key, value]) => {
|
|
49
|
-
root.style.setProperty(key, value);
|
|
50
|
-
});
|
|
51
|
-
}, [color]);
|
|
52
|
-
};
|
|
53
43
|
var cssVariables = (variables) => variables;
|
|
54
44
|
function cnd(condition, truthyClassName, falseyClassName) {
|
|
55
45
|
return condition ? truthyClassName : falseyClassName;
|
|
@@ -62,5 +52,4 @@ function cnd(condition, truthyClassName, falseyClassName) {
|
|
|
62
52
|
|
|
63
53
|
|
|
64
54
|
|
|
65
|
-
|
|
66
|
-
exports.SIGIL_COLOR = SIGIL_COLOR; exports.sigilColorUsage = sigilColorUsage; exports.cssSigilColorUsageVariables = cssSigilColorUsageVariables; exports.cssHintColorVariables = cssHintColorVariables; exports.useRootHintVariables = useRootHintVariables; exports.cssVariables = cssVariables; exports.cnd = cnd;
|
|
55
|
+
exports.SIGIL_COLOR = SIGIL_COLOR; exports.sigilColorUsage = sigilColorUsage; exports.cssSigilColorUsageVariables = cssSigilColorUsageVariables; exports.cssHintColorVariables = cssHintColorVariables; exports.cssVariables = cssVariables; exports.cnd = cnd;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/frontend/styling.ts
|
|
2
|
-
import { useEffect } from "react";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
var SIGIL_COLOR = z.enum([
|
|
5
4
|
"purple",
|
|
@@ -41,15 +40,6 @@ var cssSigilColorUsageVariables = (prefix, usage) => cssVariables({
|
|
|
41
40
|
[`--${prefix}-gradient-dark`]: usage.gradientDark
|
|
42
41
|
});
|
|
43
42
|
var cssHintColorVariables = (color) => cssSigilColorUsageVariables(`sigil-usage-hint`, sigilColorUsage(color));
|
|
44
|
-
var useRootHintVariables = (color) => {
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
const root = document.querySelector(".arcane-theme-root");
|
|
47
|
-
if (!root) return;
|
|
48
|
-
Object.entries(cssHintColorVariables(color)).forEach(([key, value]) => {
|
|
49
|
-
root.style.setProperty(key, value);
|
|
50
|
-
});
|
|
51
|
-
}, [color]);
|
|
52
|
-
};
|
|
53
43
|
var cssVariables = (variables) => variables;
|
|
54
44
|
function cnd(condition, truthyClassName, falseyClassName) {
|
|
55
45
|
return condition ? truthyClassName : falseyClassName;
|
|
@@ -60,7 +50,6 @@ export {
|
|
|
60
50
|
sigilColorUsage,
|
|
61
51
|
cssSigilColorUsageVariables,
|
|
62
52
|
cssHintColorVariables,
|
|
63
|
-
useRootHintVariables,
|
|
64
53
|
cssVariables,
|
|
65
54
|
cnd
|
|
66
55
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk5CAFJT5Tcjs = require('../chunk-5CAFJT5T.cjs');
|
|
5
5
|
require('../chunk-PEARNJ5G.cjs');
|
|
6
6
|
require('../chunk-RI33QVOD.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-TZJ4UXR3.cjs');
|
|
8
8
|
|
|
9
9
|
// src/frontend/appearance.tsx
|
|
10
10
|
var _core = require('@arcanejs/toolkit-frontend/components/core');
|
|
@@ -35,7 +35,7 @@ var AppearanceSwitcher = ({
|
|
|
35
35
|
);
|
|
36
36
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "control-grid-pos-all flex flex-wrap items-stretch gap-2", children: [
|
|
37
37
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
38
|
-
|
|
38
|
+
_chunk5CAFJT5Tcjs.ControlButton,
|
|
39
39
|
{
|
|
40
40
|
onClick: selectDarkMode,
|
|
41
41
|
active: colorSchemePreference === "dark",
|
|
@@ -48,7 +48,7 @@ var AppearanceSwitcher = ({
|
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
51
|
-
|
|
51
|
+
_chunk5CAFJT5Tcjs.ControlButton,
|
|
52
52
|
{
|
|
53
53
|
onClick: selectLightMode,
|
|
54
54
|
active: colorSchemePreference === "light",
|
|
@@ -61,7 +61,7 @@ var AppearanceSwitcher = ({
|
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
64
|
-
|
|
64
|
+
_chunk5CAFJT5Tcjs.ControlButton,
|
|
65
65
|
{
|
|
66
66
|
onClick: selectSystemMode,
|
|
67
67
|
active: colorSchemePreference === "auto",
|
|
@@ -74,7 +74,7 @@ var AppearanceSwitcher = ({
|
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
76
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
77
|
-
|
|
77
|
+
_chunk5CAFJT5Tcjs.ControlColorSelect,
|
|
78
78
|
{
|
|
79
79
|
color,
|
|
80
80
|
onChange: updateHintColor,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ControlButton,
|
|
3
3
|
ControlColorSelect
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LKKN6DFB.js";
|
|
5
5
|
import "../chunk-BIY5HAXP.js";
|
|
6
6
|
import "../chunk-4PMRDURG.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-WYUGJOEB.js";
|
|
8
8
|
|
|
9
9
|
// src/frontend/appearance.tsx
|
|
10
10
|
import { Icon } from "@arcanejs/toolkit-frontend/components/core";
|
|
@@ -20,10 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
var _chunk5CAFJT5Tcjs = require('../../chunk-5CAFJT5T.cjs');
|
|
24
25
|
require('../../chunk-PEARNJ5G.cjs');
|
|
25
26
|
require('../../chunk-RI33QVOD.cjs');
|
|
26
|
-
require('../../chunk-
|
|
27
|
+
require('../../chunk-TZJ4UXR3.cjs');
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
|
|
@@ -46,4 +48,4 @@ require('../../chunk-5DRI7C4U.cjs');
|
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
|
|
49
|
-
exports.CheckboxControlButton =
|
|
51
|
+
exports.CheckboxControlButton = _chunk5CAFJT5Tcjs.CheckboxControlButton; exports.ControlButton = _chunk5CAFJT5Tcjs.ControlButton; exports.ControlButtonGroup = _chunk5CAFJT5Tcjs.ControlButtonGroup; exports.ControlColorSelect = _chunk5CAFJT5Tcjs.ControlColorSelect; exports.ControlColoredSelect = _chunk5CAFJT5Tcjs.ControlColoredSelect; exports.ControlDetails = _chunk5CAFJT5Tcjs.ControlDetails; exports.ControlDialog = _chunk5CAFJT5Tcjs.ControlDialog; exports.ControlDialogButtons = _chunk5CAFJT5Tcjs.ControlDialogButtons; exports.ControlInput = _chunk5CAFJT5Tcjs.ControlInput; exports.ControlLabel = _chunk5CAFJT5Tcjs.ControlLabel; exports.ControlParagraph = _chunk5CAFJT5Tcjs.ControlParagraph; exports.ControlPercent = _chunk5CAFJT5Tcjs.ControlPercent; exports.ControlSelect = _chunk5CAFJT5Tcjs.ControlSelect; exports.InputSpanningTitle = _chunk5CAFJT5Tcjs.InputSpanningTitle; exports.InputWithDelayedPropagation = _chunk5CAFJT5Tcjs.InputWithDelayedPropagation; exports.LongPressableControlButton = _chunk5CAFJT5Tcjs.LongPressableControlButton; exports.clsControlButton = _chunk5CAFJT5Tcjs.clsControlButton; exports.clsControlPosition = _chunk5CAFJT5Tcjs.clsControlPosition; exports.clsControlSubgridPosition = _chunk5CAFJT5Tcjs.clsControlSubgridPosition; exports.controlButtonColorVariable = _chunk5CAFJT5Tcjs.controlButtonColorVariable; exports.controlButtonColorVariables = _chunk5CAFJT5Tcjs.controlButtonColorVariables; exports.controlPositionClass = _chunk5CAFJT5Tcjs.controlPositionClass;
|
|
@@ -86,18 +86,18 @@ declare const ControlParagraph: react.ForwardRefExoticComponent<Omit<react.Detai
|
|
|
86
86
|
position?: ControlPosition;
|
|
87
87
|
mode?: ControlParagraphMode;
|
|
88
88
|
} & react.RefAttributes<HTMLParagraphElement>>;
|
|
89
|
-
type ControlLabelProps = ComponentPropsWithoutRef<'
|
|
89
|
+
type ControlLabelProps = ComponentPropsWithoutRef<'label'> & {
|
|
90
90
|
subgrid?: boolean;
|
|
91
91
|
position?: ControlPosition;
|
|
92
92
|
disabled?: boolean;
|
|
93
93
|
nonMicro?: boolean;
|
|
94
94
|
};
|
|
95
|
-
declare const ControlLabel: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.
|
|
95
|
+
declare const ControlLabel: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
96
96
|
subgrid?: boolean;
|
|
97
97
|
position?: ControlPosition;
|
|
98
98
|
disabled?: boolean;
|
|
99
99
|
nonMicro?: boolean;
|
|
100
|
-
} & react.RefAttributes<
|
|
100
|
+
} & react.RefAttributes<HTMLLabelElement>>;
|
|
101
101
|
type ControlDetailsProps = ComponentPropsWithoutRef<'div'> & {
|
|
102
102
|
position?: ControlPosition;
|
|
103
103
|
align?: 'start' | 'center' | 'end';
|
|
@@ -146,13 +146,13 @@ type SelectOption<T> = {
|
|
|
146
146
|
*/
|
|
147
147
|
active?: boolean;
|
|
148
148
|
};
|
|
149
|
-
type SelectProps<T extends string | null
|
|
150
|
-
options:
|
|
149
|
+
type SelectProps<T extends string | null, O extends SelectOption<T>> = {
|
|
150
|
+
options: O[];
|
|
151
151
|
value: T | '';
|
|
152
152
|
onChange: (value: T) => void;
|
|
153
|
-
triggerText?: (option:
|
|
154
|
-
triggerButton?: (option: null |
|
|
155
|
-
option?: (option:
|
|
153
|
+
triggerText?: (option: O) => ReactNode;
|
|
154
|
+
triggerButton?: (option: null | O) => ReactNode;
|
|
155
|
+
option?: (option: O) => ReactNode;
|
|
156
156
|
variant: ControlButtonVariant;
|
|
157
157
|
position?: ControlPosition;
|
|
158
158
|
disabled?: boolean;
|
|
@@ -160,11 +160,15 @@ type SelectProps<T extends string | null> = {
|
|
|
160
160
|
placeholder?: ReactNode;
|
|
161
161
|
triggerClassName?: string;
|
|
162
162
|
};
|
|
163
|
-
declare const ControlSelect: <T extends string | null>({ options, value, onChange, triggerText, triggerButton, option, variant, position, disabled, tooltip, placeholder, triggerClassName: className, }: SelectProps<T>) => react_jsx_runtime.JSX.Element;
|
|
163
|
+
declare const ControlSelect: <T extends string | null, O extends SelectOption<T> = SelectOption<T>>({ options, value, onChange, triggerText, triggerButton, option, variant, position, disabled, tooltip, placeholder, triggerClassName: className, }: SelectProps<T, O>) => react_jsx_runtime.JSX.Element;
|
|
164
|
+
type SigilOptionWithColor<T> = SelectOption<T> & {
|
|
165
|
+
color: SigilColor;
|
|
166
|
+
};
|
|
167
|
+
type ControlColoredSelectProps<T extends string | null, O extends SigilOptionWithColor<T>> = SelectProps<T, O>;
|
|
168
|
+
declare const ControlColoredSelect: <T extends string | null, O extends SigilOptionWithColor<T> = SigilOptionWithColor<T>>({ options, value, onChange, variant, position, disabled, placeholder, ...props }: ControlColoredSelectProps<T, O>) => react_jsx_runtime.JSX.Element;
|
|
164
169
|
type ControlColorSelectProps = {
|
|
165
170
|
color: SigilColor | '';
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
declare const ControlColorSelect: ({ color, onChange, variant, position, disabled, placeholder, ...props }: ControlColorSelectProps) => react_jsx_runtime.JSX.Element;
|
|
171
|
+
} & Omit<ControlColoredSelectProps<SigilColor, SigilOptionWithColor<SigilColor>>, 'value' | 'options'>;
|
|
172
|
+
declare const ControlColorSelect: ({ color, ...props }: ControlColorSelectProps) => react_jsx_runtime.JSX.Element;
|
|
169
173
|
|
|
170
|
-
export { CheckboxControlButton, type CheckboxControlButtonProps, ControlButton, ControlButtonGroup, type ControlButtonGroupProps, type ControlButtonProps, type ControlButtonVariant, ControlColorSelect, ControlDetails, type ControlDetailsProps, ControlDialog, ControlDialogButtons, ControlInput, type ControlInputProps, ControlLabel, type ControlLabelProps, ControlParagraph, type ControlParagraphMode, type ControlParagraphProps, ControlPercent, type ControlPercentProps, type ControlPosition, ControlSelect, InputSpanningTitle, type InputSpanningTitleProps, InputWithDelayedPropagation, LongPressableControlButton, type LongPressableControlButtonProps, type SelectOption, clsControlButton, clsControlPosition, clsControlSubgridPosition, controlButtonColorVariable, controlButtonColorVariables, controlPositionClass };
|
|
174
|
+
export { CheckboxControlButton, type CheckboxControlButtonProps, ControlButton, ControlButtonGroup, type ControlButtonGroupProps, type ControlButtonProps, type ControlButtonVariant, ControlColorSelect, ControlColoredSelect, ControlDetails, type ControlDetailsProps, ControlDialog, ControlDialogButtons, ControlInput, type ControlInputProps, ControlLabel, type ControlLabelProps, ControlParagraph, type ControlParagraphMode, type ControlParagraphProps, ControlPercent, type ControlPercentProps, type ControlPosition, ControlSelect, InputSpanningTitle, type InputSpanningTitleProps, InputWithDelayedPropagation, LongPressableControlButton, type LongPressableControlButtonProps, type SelectOption, clsControlButton, clsControlPosition, clsControlSubgridPosition, controlButtonColorVariable, controlButtonColorVariables, controlPositionClass };
|
|
@@ -86,18 +86,18 @@ declare const ControlParagraph: react.ForwardRefExoticComponent<Omit<react.Detai
|
|
|
86
86
|
position?: ControlPosition;
|
|
87
87
|
mode?: ControlParagraphMode;
|
|
88
88
|
} & react.RefAttributes<HTMLParagraphElement>>;
|
|
89
|
-
type ControlLabelProps = ComponentPropsWithoutRef<'
|
|
89
|
+
type ControlLabelProps = ComponentPropsWithoutRef<'label'> & {
|
|
90
90
|
subgrid?: boolean;
|
|
91
91
|
position?: ControlPosition;
|
|
92
92
|
disabled?: boolean;
|
|
93
93
|
nonMicro?: boolean;
|
|
94
94
|
};
|
|
95
|
-
declare const ControlLabel: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.
|
|
95
|
+
declare const ControlLabel: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
96
96
|
subgrid?: boolean;
|
|
97
97
|
position?: ControlPosition;
|
|
98
98
|
disabled?: boolean;
|
|
99
99
|
nonMicro?: boolean;
|
|
100
|
-
} & react.RefAttributes<
|
|
100
|
+
} & react.RefAttributes<HTMLLabelElement>>;
|
|
101
101
|
type ControlDetailsProps = ComponentPropsWithoutRef<'div'> & {
|
|
102
102
|
position?: ControlPosition;
|
|
103
103
|
align?: 'start' | 'center' | 'end';
|
|
@@ -146,13 +146,13 @@ type SelectOption<T> = {
|
|
|
146
146
|
*/
|
|
147
147
|
active?: boolean;
|
|
148
148
|
};
|
|
149
|
-
type SelectProps<T extends string | null
|
|
150
|
-
options:
|
|
149
|
+
type SelectProps<T extends string | null, O extends SelectOption<T>> = {
|
|
150
|
+
options: O[];
|
|
151
151
|
value: T | '';
|
|
152
152
|
onChange: (value: T) => void;
|
|
153
|
-
triggerText?: (option:
|
|
154
|
-
triggerButton?: (option: null |
|
|
155
|
-
option?: (option:
|
|
153
|
+
triggerText?: (option: O) => ReactNode;
|
|
154
|
+
triggerButton?: (option: null | O) => ReactNode;
|
|
155
|
+
option?: (option: O) => ReactNode;
|
|
156
156
|
variant: ControlButtonVariant;
|
|
157
157
|
position?: ControlPosition;
|
|
158
158
|
disabled?: boolean;
|
|
@@ -160,11 +160,15 @@ type SelectProps<T extends string | null> = {
|
|
|
160
160
|
placeholder?: ReactNode;
|
|
161
161
|
triggerClassName?: string;
|
|
162
162
|
};
|
|
163
|
-
declare const ControlSelect: <T extends string | null>({ options, value, onChange, triggerText, triggerButton, option, variant, position, disabled, tooltip, placeholder, triggerClassName: className, }: SelectProps<T>) => react_jsx_runtime.JSX.Element;
|
|
163
|
+
declare const ControlSelect: <T extends string | null, O extends SelectOption<T> = SelectOption<T>>({ options, value, onChange, triggerText, triggerButton, option, variant, position, disabled, tooltip, placeholder, triggerClassName: className, }: SelectProps<T, O>) => react_jsx_runtime.JSX.Element;
|
|
164
|
+
type SigilOptionWithColor<T> = SelectOption<T> & {
|
|
165
|
+
color: SigilColor;
|
|
166
|
+
};
|
|
167
|
+
type ControlColoredSelectProps<T extends string | null, O extends SigilOptionWithColor<T>> = SelectProps<T, O>;
|
|
168
|
+
declare const ControlColoredSelect: <T extends string | null, O extends SigilOptionWithColor<T> = SigilOptionWithColor<T>>({ options, value, onChange, variant, position, disabled, placeholder, ...props }: ControlColoredSelectProps<T, O>) => react_jsx_runtime.JSX.Element;
|
|
164
169
|
type ControlColorSelectProps = {
|
|
165
170
|
color: SigilColor | '';
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
declare const ControlColorSelect: ({ color, onChange, variant, position, disabled, placeholder, ...props }: ControlColorSelectProps) => react_jsx_runtime.JSX.Element;
|
|
171
|
+
} & Omit<ControlColoredSelectProps<SigilColor, SigilOptionWithColor<SigilColor>>, 'value' | 'options'>;
|
|
172
|
+
declare const ControlColorSelect: ({ color, ...props }: ControlColorSelectProps) => react_jsx_runtime.JSX.Element;
|
|
169
173
|
|
|
170
|
-
export { CheckboxControlButton, type CheckboxControlButtonProps, ControlButton, ControlButtonGroup, type ControlButtonGroupProps, type ControlButtonProps, type ControlButtonVariant, ControlColorSelect, ControlDetails, type ControlDetailsProps, ControlDialog, ControlDialogButtons, ControlInput, type ControlInputProps, ControlLabel, type ControlLabelProps, ControlParagraph, type ControlParagraphMode, type ControlParagraphProps, ControlPercent, type ControlPercentProps, type ControlPosition, ControlSelect, InputSpanningTitle, type InputSpanningTitleProps, InputWithDelayedPropagation, LongPressableControlButton, type LongPressableControlButtonProps, type SelectOption, clsControlButton, clsControlPosition, clsControlSubgridPosition, controlButtonColorVariable, controlButtonColorVariables, controlPositionClass };
|
|
174
|
+
export { CheckboxControlButton, type CheckboxControlButtonProps, ControlButton, ControlButtonGroup, type ControlButtonGroupProps, type ControlButtonProps, type ControlButtonVariant, ControlColorSelect, ControlColoredSelect, ControlDetails, type ControlDetailsProps, ControlDialog, ControlDialogButtons, ControlInput, type ControlInputProps, ControlLabel, type ControlLabelProps, ControlParagraph, type ControlParagraphMode, type ControlParagraphProps, ControlPercent, type ControlPercentProps, type ControlPosition, ControlSelect, InputSpanningTitle, type InputSpanningTitleProps, InputWithDelayedPropagation, LongPressableControlButton, type LongPressableControlButtonProps, type SelectOption, clsControlButton, clsControlPosition, clsControlSubgridPosition, controlButtonColorVariable, controlButtonColorVariables, controlPositionClass };
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
ControlButton,
|
|
4
4
|
ControlButtonGroup,
|
|
5
5
|
ControlColorSelect,
|
|
6
|
+
ControlColoredSelect,
|
|
6
7
|
ControlDetails,
|
|
7
8
|
ControlDialog,
|
|
8
9
|
ControlDialogButtons,
|
|
@@ -20,15 +21,16 @@ import {
|
|
|
20
21
|
controlButtonColorVariable,
|
|
21
22
|
controlButtonColorVariables,
|
|
22
23
|
controlPositionClass
|
|
23
|
-
} from "../../chunk-
|
|
24
|
+
} from "../../chunk-LKKN6DFB.js";
|
|
24
25
|
import "../../chunk-BIY5HAXP.js";
|
|
25
26
|
import "../../chunk-4PMRDURG.js";
|
|
26
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-WYUGJOEB.js";
|
|
27
28
|
export {
|
|
28
29
|
CheckboxControlButton,
|
|
29
30
|
ControlButton,
|
|
30
31
|
ControlButtonGroup,
|
|
31
32
|
ControlColorSelect,
|
|
33
|
+
ControlColoredSelect,
|
|
32
34
|
ControlDetails,
|
|
33
35
|
ControlDialog,
|
|
34
36
|
ControlDialogButtons,
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk5CAFJT5Tcjs = require('../chunk-5CAFJT5T.cjs');
|
|
8
8
|
require('../chunk-PEARNJ5G.cjs');
|
|
9
9
|
require('../chunk-RI33QVOD.cjs');
|
|
10
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-TZJ4UXR3.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.Dialog =
|
|
17
|
+
exports.Dialog = _chunk5CAFJT5Tcjs.Dialog; exports.DialogButtons = _chunk5CAFJT5Tcjs.DialogButtons; exports.DialogContext = _chunk5CAFJT5Tcjs.DialogContext; exports.DialogProvider = _chunk5CAFJT5Tcjs.DialogProvider; exports.DialogTitle = _chunk5CAFJT5Tcjs.DialogTitle;
|
package/dist/frontend/dialogs.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
DialogContext,
|
|
5
5
|
DialogProvider,
|
|
6
6
|
DialogTitle
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-LKKN6DFB.js";
|
|
8
8
|
import "../chunk-BIY5HAXP.js";
|
|
9
9
|
import "../chunk-4PMRDURG.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-WYUGJOEB.js";
|
|
11
11
|
export {
|
|
12
12
|
Dialog,
|
|
13
13
|
DialogButtons,
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
var _chunkTZJ4UXR3cjs = require('../chunk-TZJ4UXR3.cjs');
|
|
8
9
|
|
|
9
|
-
var _chunk5DRI7C4Ucjs = require('../chunk-5DRI7C4U.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.SIGIL_COLOR = _chunk5DRI7C4Ucjs.SIGIL_COLOR; exports.cnd = _chunk5DRI7C4Ucjs.cnd; exports.cssHintColorVariables = _chunk5DRI7C4Ucjs.cssHintColorVariables; exports.cssSigilColorUsageVariables = _chunk5DRI7C4Ucjs.cssSigilColorUsageVariables; exports.cssVariables = _chunk5DRI7C4Ucjs.cssVariables; exports.sigilColorUsage = _chunk5DRI7C4Ucjs.sigilColorUsage; exports.useRootHintVariables = _chunk5DRI7C4Ucjs.useRootHintVariables;
|
|
16
|
+
exports.SIGIL_COLOR = _chunkTZJ4UXR3cjs.SIGIL_COLOR; exports.cnd = _chunkTZJ4UXR3cjs.cnd; exports.cssHintColorVariables = _chunkTZJ4UXR3cjs.cssHintColorVariables; exports.cssSigilColorUsageVariables = _chunkTZJ4UXR3cjs.cssSigilColorUsageVariables; exports.cssVariables = _chunkTZJ4UXR3cjs.cssVariables; exports.sigilColorUsage = _chunkTZJ4UXR3cjs.sigilColorUsage;
|
|
@@ -21,12 +21,8 @@ type SigilUsageColorUsage = {
|
|
|
21
21
|
declare const sigilColorUsage: (color: SigilUsageColor) => SigilUsageColorUsage;
|
|
22
22
|
declare const cssSigilColorUsageVariables: (prefix: string, usage: SigilUsageColorUsage) => CSSProperties;
|
|
23
23
|
declare const cssHintColorVariables: (color: SigilColor) => CSSProperties;
|
|
24
|
-
/**
|
|
25
|
-
* Hook that will adjust the root hint color based on the given color.
|
|
26
|
-
*/
|
|
27
|
-
declare const useRootHintVariables: (color: SigilColor) => void;
|
|
28
24
|
declare const cssVariables: (variables: Partial<Record<`--${string}`, string | number>>) => CSSProperties;
|
|
29
25
|
declare function cnd<T extends string>(condition: unknown, truthyClassName: T): T | undefined;
|
|
30
26
|
declare function cnd<T extends string, F extends string>(condition: unknown, truthyClassName: T, falseyClassName: F): T | F;
|
|
31
27
|
|
|
32
|
-
export { SIGIL_COLOR, type SigilColor, type SigilUsageColor, type SigilUsageColorUsage, cnd, cssHintColorVariables, cssSigilColorUsageVariables, cssVariables, sigilColorUsage
|
|
28
|
+
export { SIGIL_COLOR, type SigilColor, type SigilUsageColor, type SigilUsageColorUsage, cnd, cssHintColorVariables, cssSigilColorUsageVariables, cssVariables, sigilColorUsage };
|
|
@@ -21,12 +21,8 @@ type SigilUsageColorUsage = {
|
|
|
21
21
|
declare const sigilColorUsage: (color: SigilUsageColor) => SigilUsageColorUsage;
|
|
22
22
|
declare const cssSigilColorUsageVariables: (prefix: string, usage: SigilUsageColorUsage) => CSSProperties;
|
|
23
23
|
declare const cssHintColorVariables: (color: SigilColor) => CSSProperties;
|
|
24
|
-
/**
|
|
25
|
-
* Hook that will adjust the root hint color based on the given color.
|
|
26
|
-
*/
|
|
27
|
-
declare const useRootHintVariables: (color: SigilColor) => void;
|
|
28
24
|
declare const cssVariables: (variables: Partial<Record<`--${string}`, string | number>>) => CSSProperties;
|
|
29
25
|
declare function cnd<T extends string>(condition: unknown, truthyClassName: T): T | undefined;
|
|
30
26
|
declare function cnd<T extends string, F extends string>(condition: unknown, truthyClassName: T, falseyClassName: F): T | F;
|
|
31
27
|
|
|
32
|
-
export { SIGIL_COLOR, type SigilColor, type SigilUsageColor, type SigilUsageColorUsage, cnd, cssHintColorVariables, cssSigilColorUsageVariables, cssVariables, sigilColorUsage
|
|
28
|
+
export { SIGIL_COLOR, type SigilColor, type SigilUsageColor, type SigilUsageColorUsage, cnd, cssHintColorVariables, cssSigilColorUsageVariables, cssVariables, sigilColorUsage };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkTZJ4UXR3cjs = require('../chunk-TZJ4UXR3.cjs');
|
|
4
|
+
|
|
5
|
+
// src/frontend/styling.hooks.ts
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
var useRootHintVariables = (color) => {
|
|
8
|
+
_react.useEffect.call(void 0, () => {
|
|
9
|
+
const root = document.querySelector(".arcane-theme-root");
|
|
10
|
+
if (!root) return;
|
|
11
|
+
Object.entries(_chunkTZJ4UXR3cjs.cssHintColorVariables.call(void 0, color)).forEach(([key, value]) => {
|
|
12
|
+
root.style.setProperty(key, value);
|
|
13
|
+
});
|
|
14
|
+
}, [color]);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.useRootHintVariables = useRootHintVariables;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SigilColor } from './styling.cjs';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook that will adjust the root hint color based on the given color.
|
|
7
|
+
*/
|
|
8
|
+
declare const useRootHintVariables: (color: SigilColor) => void;
|
|
9
|
+
|
|
10
|
+
export { useRootHintVariables };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SigilColor } from './styling.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook that will adjust the root hint color based on the given color.
|
|
7
|
+
*/
|
|
8
|
+
declare const useRootHintVariables: (color: SigilColor) => void;
|
|
9
|
+
|
|
10
|
+
export { useRootHintVariables };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cssHintColorVariables
|
|
3
|
+
} from "../chunk-WYUGJOEB.js";
|
|
4
|
+
|
|
5
|
+
// src/frontend/styling.hooks.ts
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
var useRootHintVariables = (color) => {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const root = document.querySelector(".arcane-theme-root");
|
|
10
|
+
if (!root) return;
|
|
11
|
+
Object.entries(cssHintColorVariables(color)).forEach(([key, value]) => {
|
|
12
|
+
root.style.setProperty(key, value);
|
|
13
|
+
});
|
|
14
|
+
}, [color]);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
useRootHintVariables
|
|
18
|
+
};
|
package/dist/frontend/styling.js
CHANGED
|
@@ -4,15 +4,13 @@ import {
|
|
|
4
4
|
cssHintColorVariables,
|
|
5
5
|
cssSigilColorUsageVariables,
|
|
6
6
|
cssVariables,
|
|
7
|
-
sigilColorUsage
|
|
8
|
-
|
|
9
|
-
} from "../chunk-H4U4Z4GM.js";
|
|
7
|
+
sigilColorUsage
|
|
8
|
+
} from "../chunk-WYUGJOEB.js";
|
|
10
9
|
export {
|
|
11
10
|
SIGIL_COLOR,
|
|
12
11
|
cnd,
|
|
13
12
|
cssHintColorVariables,
|
|
14
13
|
cssSigilColorUsageVariables,
|
|
15
14
|
cssVariables,
|
|
16
|
-
sigilColorUsage
|
|
17
|
-
useRootHintVariables
|
|
15
|
+
sigilColorUsage
|
|
18
16
|
};
|
package/dist/frontend.cjs
CHANGED
|
@@ -16,12 +16,12 @@ var _chunkCAYKPJIXcjs = require('./chunk-CAYKPJIX.cjs');
|
|
|
16
16
|
var _chunkVZ4A6RRTcjs = require('./chunk-VZ4A6RRT.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk5CAFJT5Tcjs = require('./chunk-5CAFJT5T.cjs');
|
|
20
20
|
require('./chunk-PEARNJ5G.cjs');
|
|
21
21
|
require('./chunk-RI33QVOD.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkTZJ4UXR3cjs = require('./chunk-TZJ4UXR3.cjs');
|
|
25
25
|
|
|
26
26
|
// src/frontend/app-root.tsx
|
|
27
27
|
var _toolkitfrontend = require('@arcanejs/toolkit-frontend');
|
|
@@ -242,7 +242,7 @@ var Debugger = ({ title, className }) => {
|
|
|
242
242
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "grow px-1", children: title }),
|
|
243
243
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkA5LYYZERcjs.ToolbarDivider, {}),
|
|
244
244
|
openDevTools && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
245
|
-
|
|
245
|
+
_chunk5CAFJT5Tcjs.ControlButton,
|
|
246
246
|
{
|
|
247
247
|
onClick: openDevTools,
|
|
248
248
|
variant: "toolbar",
|
|
@@ -251,7 +251,7 @@ var Debugger = ({ title, className }) => {
|
|
|
251
251
|
}
|
|
252
252
|
),
|
|
253
253
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
254
|
-
|
|
254
|
+
_chunk5CAFJT5Tcjs.ControlButton,
|
|
255
255
|
{
|
|
256
256
|
onClick: handleRequestScrollToBottom,
|
|
257
257
|
variant: "toolbar",
|
|
@@ -259,7 +259,7 @@ var Debugger = ({ title, className }) => {
|
|
|
259
259
|
children: "Scroll to Bottom"
|
|
260
260
|
}
|
|
261
261
|
),
|
|
262
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
262
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5CAFJT5Tcjs.ControlButton, { onClick: exportLogs, variant: "toolbar", icon: "publish", children: "Export Logs" })
|
|
263
263
|
] }) }),
|
|
264
264
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
265
265
|
"pre",
|
|
@@ -286,12 +286,12 @@ Data Directory: ${system.dataDirectory}`
|
|
|
286
286
|
"span",
|
|
287
287
|
{
|
|
288
288
|
className: _util.cn.call(void 0,
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, log.level === "error", "text-sigil-usage-red-foreground"),
|
|
290
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0,
|
|
291
291
|
log.level === "warn",
|
|
292
292
|
"text-sigil-usage-yellow-foreground"
|
|
293
293
|
),
|
|
294
|
-
|
|
294
|
+
_chunkTZJ4UXR3cjs.cnd.call(void 0, log.level === "info", "text-sigil-usage-blue-foreground")
|
|
295
295
|
),
|
|
296
296
|
children: log.level
|
|
297
297
|
}
|
package/dist/frontend.js
CHANGED
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
} from "./chunk-EJNNLQ2S.js";
|
|
17
17
|
import {
|
|
18
18
|
ControlButton
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LKKN6DFB.js";
|
|
20
20
|
import "./chunk-BIY5HAXP.js";
|
|
21
21
|
import "./chunk-4PMRDURG.js";
|
|
22
22
|
import {
|
|
23
23
|
cnd
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WYUGJOEB.js";
|
|
25
25
|
|
|
26
26
|
// src/frontend/app-root.tsx
|
|
27
27
|
import { StageContext } from "@arcanejs/toolkit-frontend";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcanewizards/sigil",
|
|
3
3
|
"description": "Application framework for A/V applications, built on-top of arcanejs",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
"import": "./dist/frontend/styling.js",
|
|
66
66
|
"require": "./dist/frontend/styling.cjs"
|
|
67
67
|
},
|
|
68
|
+
"./frontend/styling.hooks": {
|
|
69
|
+
"@arcanewizards/source": "./src/frontend/styling.hooks.ts",
|
|
70
|
+
"types": "./dist/frontend/styling.hooks.d.ts",
|
|
71
|
+
"import": "./dist/frontend/styling.hooks.js",
|
|
72
|
+
"require": "./dist/frontend/styling.hooks.cjs"
|
|
73
|
+
},
|
|
68
74
|
"./frontend/toolbars": {
|
|
69
75
|
"@arcanewizards/source": "./src/frontend/toolbars.tsx",
|
|
70
76
|
"types": "./dist/frontend/toolbars.d.ts",
|
|
@@ -115,8 +121,8 @@
|
|
|
115
121
|
"tailwindcss": "^4.1.13",
|
|
116
122
|
"tsup": "^8.1.0",
|
|
117
123
|
"typescript": "^5.7.3",
|
|
118
|
-
"@arcanewizards/
|
|
119
|
-
"@arcanewizards/
|
|
124
|
+
"@arcanewizards/typescript-config": "^0.0.0",
|
|
125
|
+
"@arcanewizards/eslint-config": "^0.0.0"
|
|
120
126
|
},
|
|
121
127
|
"scripts": {
|
|
122
128
|
"build": "rm -rf dist && tsup && pnpm build:styles && check-export-map",
|