doodleui-react 0.5.0 → 0.6.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/CHANGELOG.md +10 -0
- package/README.md +3 -3
- package/dist/index.cjs +2247 -220
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +270 -23
- package/dist/index.d.ts +270 -23
- package/dist/index.js +2205 -221
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -29,6 +29,8 @@ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
|
29
29
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
30
30
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
31
31
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
32
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
33
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
32
34
|
|
|
33
35
|
// src/types.ts
|
|
34
36
|
function toRoughOptions(props) {
|
|
@@ -43,6 +45,9 @@ function toRoughOptions(props) {
|
|
|
43
45
|
if (props.fill) {
|
|
44
46
|
options.fill = props.fill;
|
|
45
47
|
options.fillStyle = props.fillStyle ?? "hachure";
|
|
48
|
+
if (props.hachureGap !== void 0) options.hachureGap = props.hachureGap;
|
|
49
|
+
if (props.hachureAngle !== void 0) options.hachureAngle = props.hachureAngle;
|
|
50
|
+
if (props.fillWeight !== void 0) options.fillWeight = props.fillWeight;
|
|
46
51
|
}
|
|
47
52
|
return options;
|
|
48
53
|
}
|
|
@@ -50,6 +55,10 @@ var DEFAULT_ROUGHNESS = 1.5;
|
|
|
50
55
|
var DEFAULT_BOWING = 1;
|
|
51
56
|
var DEFAULT_STROKE_WIDTH = 1.75;
|
|
52
57
|
var DEFAULT_INK = "#1f1d1a";
|
|
58
|
+
var DEFAULT_DARK_INK = "#f3f4f6";
|
|
59
|
+
var DEFAULT_PAPER = "#f7f6f2";
|
|
60
|
+
var DEFAULT_DARK_PAPER = "#131923";
|
|
61
|
+
var DEFAULT_DARK_CARD_BG = "#131923";
|
|
53
62
|
var DEFAULT_INSET = 3;
|
|
54
63
|
var SKETCH_COLORS = {
|
|
55
64
|
ink: DEFAULT_INK,
|
|
@@ -62,6 +71,19 @@ var SKETCH_COLORS = {
|
|
|
62
71
|
error: "#c0392b",
|
|
63
72
|
success: "#2d6a4f"
|
|
64
73
|
};
|
|
74
|
+
var DARK_SKETCH_COLORS = {
|
|
75
|
+
ink: DEFAULT_DARK_INK,
|
|
76
|
+
accent: "#f87171",
|
|
77
|
+
accentFill: "rgba(248, 113, 113, 0.22)",
|
|
78
|
+
secondaryFill: "rgba(255, 255, 255, 0.08)",
|
|
79
|
+
paper: DEFAULT_DARK_PAPER,
|
|
80
|
+
cardBg: DEFAULT_DARK_CARD_BG,
|
|
81
|
+
shadow: "#000000",
|
|
82
|
+
info: "#60a5fa",
|
|
83
|
+
warning: "#fbbf24",
|
|
84
|
+
error: "#f87171",
|
|
85
|
+
success: "#34d399"
|
|
86
|
+
};
|
|
65
87
|
|
|
66
88
|
// src/utils.ts
|
|
67
89
|
function assignRef(ref, value) {
|
|
@@ -177,6 +199,9 @@ function RoughSvg({
|
|
|
177
199
|
fillStyle,
|
|
178
200
|
strokeWidth,
|
|
179
201
|
fill,
|
|
202
|
+
hachureGap,
|
|
203
|
+
hachureAngle,
|
|
204
|
+
fillWeight,
|
|
180
205
|
inset = DEFAULT_INSET,
|
|
181
206
|
path,
|
|
182
207
|
className,
|
|
@@ -200,7 +225,10 @@ function RoughSvg({
|
|
|
200
225
|
bowing,
|
|
201
226
|
fillStyle,
|
|
202
227
|
strokeWidth,
|
|
203
|
-
fill
|
|
228
|
+
fill,
|
|
229
|
+
hachureGap,
|
|
230
|
+
hachureAngle,
|
|
231
|
+
fillWeight
|
|
204
232
|
});
|
|
205
233
|
const x = inset;
|
|
206
234
|
const y = inset;
|
|
@@ -236,6 +264,9 @@ function RoughSvg({
|
|
|
236
264
|
fillStyle,
|
|
237
265
|
strokeWidth,
|
|
238
266
|
fill,
|
|
267
|
+
hachureGap,
|
|
268
|
+
hachureAngle,
|
|
269
|
+
fillWeight,
|
|
239
270
|
inset,
|
|
240
271
|
path
|
|
241
272
|
]);
|
|
@@ -273,16 +304,17 @@ var DoodleUIContext = createContext(null);
|
|
|
273
304
|
function DoodleUIProvider({
|
|
274
305
|
children,
|
|
275
306
|
animate = true,
|
|
276
|
-
forceAnimate = false
|
|
307
|
+
forceAnimate = false,
|
|
308
|
+
theme = "system"
|
|
277
309
|
}) {
|
|
278
310
|
const value = useMemo(
|
|
279
|
-
() => ({ animate, forceAnimate }),
|
|
280
|
-
[animate, forceAnimate]
|
|
311
|
+
() => ({ animate, forceAnimate, theme }),
|
|
312
|
+
[animate, forceAnimate, theme]
|
|
281
313
|
);
|
|
282
314
|
return /* @__PURE__ */ jsx(DoodleUIContext.Provider, { value, children });
|
|
283
315
|
}
|
|
284
316
|
function useDoodleUI() {
|
|
285
|
-
return useContext(DoodleUIContext) ?? { animate: true, forceAnimate: false };
|
|
317
|
+
return useContext(DoodleUIContext) ?? { animate: true, forceAnimate: false, theme: "system" };
|
|
286
318
|
}
|
|
287
319
|
|
|
288
320
|
// src/animations/resolveAnimate.ts
|
|
@@ -440,6 +472,93 @@ function useDrawIn(pathRef, duration = DRAW_IN_DURATION_MS, enabled = true, repl
|
|
|
440
472
|
};
|
|
441
473
|
}, [pathRef, duration, enabled, replayKey, delay]);
|
|
442
474
|
}
|
|
475
|
+
function checkIsDark() {
|
|
476
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
const root = document.documentElement;
|
|
480
|
+
if (root.classList.contains("dark")) return true;
|
|
481
|
+
const dataTheme = root.getAttribute("data-theme");
|
|
482
|
+
if (dataTheme === "dark") return true;
|
|
483
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
return false;
|
|
487
|
+
}
|
|
488
|
+
function useSketchTheme(sketchColorOverride) {
|
|
489
|
+
const doodleContext = useDoodleUI();
|
|
490
|
+
const contextTheme = doodleContext?.theme;
|
|
491
|
+
const [isClientDark, setIsClientDark] = useState(() => {
|
|
492
|
+
if (contextTheme === "dark") return true;
|
|
493
|
+
if (contextTheme === "light") return false;
|
|
494
|
+
return checkIsDark();
|
|
495
|
+
});
|
|
496
|
+
useEffect(() => {
|
|
497
|
+
if (contextTheme === "dark") {
|
|
498
|
+
setIsClientDark(true);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (contextTheme === "light") {
|
|
502
|
+
setIsClientDark(false);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const update = () => {
|
|
506
|
+
setIsClientDark(checkIsDark());
|
|
507
|
+
};
|
|
508
|
+
update();
|
|
509
|
+
const mediaQuery = window.matchMedia?.("(prefers-color-scheme: dark)");
|
|
510
|
+
mediaQuery?.addEventListener?.("change", update);
|
|
511
|
+
const observer = new MutationObserver((mutations) => {
|
|
512
|
+
for (const m of mutations) {
|
|
513
|
+
if (m.attributeName === "class" || m.attributeName === "data-theme") {
|
|
514
|
+
update();
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
observer.observe(document.documentElement, {
|
|
520
|
+
attributes: true,
|
|
521
|
+
attributeFilter: ["class", "data-theme"]
|
|
522
|
+
});
|
|
523
|
+
return () => {
|
|
524
|
+
mediaQuery?.removeEventListener?.("change", update);
|
|
525
|
+
observer.disconnect();
|
|
526
|
+
};
|
|
527
|
+
}, [contextTheme]);
|
|
528
|
+
const isDark = contextTheme === "dark" ? true : contextTheme === "light" ? false : isClientDark;
|
|
529
|
+
const baseInk = isDark ? DEFAULT_DARK_INK : DEFAULT_INK;
|
|
530
|
+
const ink = sketchColorOverride ?? baseInk;
|
|
531
|
+
if (isDark) {
|
|
532
|
+
return {
|
|
533
|
+
isDark: true,
|
|
534
|
+
ink,
|
|
535
|
+
paper: DEFAULT_DARK_PAPER,
|
|
536
|
+
cardBg: DEFAULT_DARK_CARD_BG,
|
|
537
|
+
shadow: "rgba(0, 0, 0, 0.45)",
|
|
538
|
+
accent: DARK_SKETCH_COLORS.accent,
|
|
539
|
+
accentFill: DARK_SKETCH_COLORS.accentFill,
|
|
540
|
+
secondaryFill: DARK_SKETCH_COLORS.secondaryFill,
|
|
541
|
+
info: DARK_SKETCH_COLORS.info,
|
|
542
|
+
warning: DARK_SKETCH_COLORS.warning,
|
|
543
|
+
error: DARK_SKETCH_COLORS.error,
|
|
544
|
+
success: DARK_SKETCH_COLORS.success
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
return {
|
|
548
|
+
isDark: false,
|
|
549
|
+
ink,
|
|
550
|
+
paper: DEFAULT_PAPER,
|
|
551
|
+
cardBg: DEFAULT_PAPER,
|
|
552
|
+
shadow: sketchColorOverride ?? DEFAULT_INK,
|
|
553
|
+
accent: SKETCH_COLORS.accent,
|
|
554
|
+
accentFill: SKETCH_COLORS.accentFill,
|
|
555
|
+
secondaryFill: SKETCH_COLORS.secondaryFill,
|
|
556
|
+
info: SKETCH_COLORS.info,
|
|
557
|
+
warning: SKETCH_COLORS.warning,
|
|
558
|
+
error: SKETCH_COLORS.error,
|
|
559
|
+
success: SKETCH_COLORS.success
|
|
560
|
+
};
|
|
561
|
+
}
|
|
443
562
|
var SketchBox = forwardRef(
|
|
444
563
|
function SketchBox2({
|
|
445
564
|
children,
|
|
@@ -456,6 +575,9 @@ var SketchBox = forwardRef(
|
|
|
456
575
|
sketchColor,
|
|
457
576
|
bowing,
|
|
458
577
|
strokeWidth,
|
|
578
|
+
hachureGap,
|
|
579
|
+
hachureAngle,
|
|
580
|
+
fillWeight,
|
|
459
581
|
inset,
|
|
460
582
|
path,
|
|
461
583
|
animate,
|
|
@@ -464,8 +586,14 @@ var SketchBox = forwardRef(
|
|
|
464
586
|
...rest
|
|
465
587
|
}, ref) {
|
|
466
588
|
const rootRef = useRef(null);
|
|
589
|
+
const theme = useSketchTheme(sketchColor);
|
|
590
|
+
const resolvedInk = sketchColor ?? theme.ink;
|
|
467
591
|
const shouldAnimate = useAnimate(animate);
|
|
468
592
|
useDrawIn(rootRef, drawInDuration, shouldAnimate, drawInKey);
|
|
593
|
+
const hasExplicitFill = fill !== void 0;
|
|
594
|
+
const resolvedFill = hasExplicitFill ? fill : shadow ? theme.cardBg : void 0;
|
|
595
|
+
const resolvedFillStyle = fillStyle ?? (resolvedFill ? "solid" : "solid");
|
|
596
|
+
const isPatternedFill = Boolean(resolvedFill && resolvedFillStyle !== "solid");
|
|
469
597
|
return /* @__PURE__ */ jsxs(
|
|
470
598
|
"div",
|
|
471
599
|
{
|
|
@@ -483,13 +611,31 @@ var SketchBox = forwardRef(
|
|
|
483
611
|
shape,
|
|
484
612
|
roughness: (roughness ?? 1.5) + 0.35,
|
|
485
613
|
seed,
|
|
486
|
-
sketchColor,
|
|
614
|
+
sketchColor: theme.isDark ? "rgba(0, 0, 0, 0.45)" : resolvedInk,
|
|
487
615
|
bowing,
|
|
488
616
|
fillStyle: "hachure",
|
|
489
|
-
fill:
|
|
617
|
+
fill: theme.isDark ? theme.shadow : resolvedInk ?? theme.ink,
|
|
490
618
|
strokeWidth: 1,
|
|
619
|
+
hachureGap: 8,
|
|
491
620
|
inset,
|
|
492
|
-
style: {
|
|
621
|
+
style: {
|
|
622
|
+
transform: "translate(5px, 6px)",
|
|
623
|
+
opacity: theme.isDark ? 0.35 : 0.16
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
) : null,
|
|
627
|
+
isPatternedFill ? /* @__PURE__ */ jsx(
|
|
628
|
+
RoughSvg,
|
|
629
|
+
{
|
|
630
|
+
shape,
|
|
631
|
+
roughness,
|
|
632
|
+
seed,
|
|
633
|
+
sketchColor: "transparent",
|
|
634
|
+
bowing,
|
|
635
|
+
fillStyle: "solid",
|
|
636
|
+
fill: theme.cardBg,
|
|
637
|
+
strokeWidth: 0,
|
|
638
|
+
inset
|
|
493
639
|
}
|
|
494
640
|
) : null,
|
|
495
641
|
/* @__PURE__ */ jsx(
|
|
@@ -498,11 +644,14 @@ var SketchBox = forwardRef(
|
|
|
498
644
|
shape,
|
|
499
645
|
roughness,
|
|
500
646
|
seed,
|
|
501
|
-
sketchColor,
|
|
647
|
+
sketchColor: resolvedInk,
|
|
502
648
|
bowing,
|
|
503
|
-
fillStyle:
|
|
504
|
-
fill:
|
|
649
|
+
fillStyle: resolvedFill ? resolvedFillStyle : void 0,
|
|
650
|
+
fill: resolvedFill,
|
|
505
651
|
strokeWidth,
|
|
652
|
+
hachureGap: hachureGap ?? (isPatternedFill ? 10 : void 0),
|
|
653
|
+
hachureAngle,
|
|
654
|
+
fillWeight: fillWeight ?? (isPatternedFill ? 0.9 : void 0),
|
|
506
655
|
inset,
|
|
507
656
|
path
|
|
508
657
|
}
|
|
@@ -515,6 +664,7 @@ var SketchBox = forwardRef(
|
|
|
515
664
|
position: "relative",
|
|
516
665
|
zIndex: 1,
|
|
517
666
|
fontFamily: doodleUiFontFamily,
|
|
667
|
+
color: resolvedInk,
|
|
518
668
|
...contentStyle
|
|
519
669
|
},
|
|
520
670
|
children
|
|
@@ -547,6 +697,9 @@ var Button = forwardRef(
|
|
|
547
697
|
bowing,
|
|
548
698
|
fillStyle,
|
|
549
699
|
strokeWidth,
|
|
700
|
+
hachureGap,
|
|
701
|
+
hachureAngle,
|
|
702
|
+
fillWeight,
|
|
550
703
|
disabled,
|
|
551
704
|
animate,
|
|
552
705
|
onMouseEnter,
|
|
@@ -555,13 +708,15 @@ var Button = forwardRef(
|
|
|
555
708
|
}, ref) {
|
|
556
709
|
const rootRef = useRef(null);
|
|
557
710
|
const [hovered, setHovered] = useState(false);
|
|
711
|
+
const theme = useSketchTheme(sketchColor);
|
|
558
712
|
const shouldAnimate = useAnimate(animate);
|
|
559
713
|
const resolvedSeed = useResolvedSeed(seed);
|
|
560
714
|
const hoverSeed = deriveSeed(resolvedSeed, "hover");
|
|
561
715
|
const sketchSeed = shouldAnimate && hovered && !disabled ? hoverSeed : resolvedSeed;
|
|
562
|
-
const ink = sketchColor ??
|
|
563
|
-
const fill = variant === "primary" ?
|
|
564
|
-
const stroke = variant === "ghost" && !hovered ? "transparent" : variant === "primary" ? sketchColor ??
|
|
716
|
+
const ink = sketchColor ?? theme.ink;
|
|
717
|
+
const fill = variant === "primary" ? theme.isDark ? sketchColor ? `${sketchColor}28` : theme.accentFill : theme.accentFill : variant === "secondary" ? theme.secondaryFill : hovered && variant === "ghost" ? theme.isDark ? "rgba(255,255,255,0.06)" : "rgba(31,29,26,0.05)" : void 0;
|
|
718
|
+
const stroke = variant === "ghost" && !hovered ? "transparent" : variant === "primary" ? sketchColor ?? theme.accent : ink;
|
|
719
|
+
const textColor = variant === "primary" ? sketchColor ?? (theme.isDark ? "#ffffff" : ink) : ink;
|
|
565
720
|
useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
|
|
566
721
|
return /* @__PURE__ */ jsxs(
|
|
567
722
|
"button",
|
|
@@ -590,7 +745,7 @@ var Button = forwardRef(
|
|
|
590
745
|
border: "none",
|
|
591
746
|
background: "transparent",
|
|
592
747
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
593
|
-
color:
|
|
748
|
+
color: textColor,
|
|
594
749
|
fontFamily: doodleUiFontFamily,
|
|
595
750
|
fontWeight: doodleUiFontWeight(600),
|
|
596
751
|
lineHeight: 1.2,
|
|
@@ -608,8 +763,11 @@ var Button = forwardRef(
|
|
|
608
763
|
seed: sketchSeed,
|
|
609
764
|
sketchColor: stroke,
|
|
610
765
|
bowing,
|
|
611
|
-
fillStyle: fillStyle ?? "hachure",
|
|
766
|
+
fillStyle: fillStyle ?? (fill ? "hachure" : void 0),
|
|
612
767
|
fill,
|
|
768
|
+
hachureGap: hachureGap ?? 7,
|
|
769
|
+
hachureAngle,
|
|
770
|
+
fillWeight: fillWeight ?? 1,
|
|
613
771
|
strokeWidth: !shouldAnimate && hovered ? (strokeWidth ?? 1.75) + 0.4 : strokeWidth
|
|
614
772
|
}
|
|
615
773
|
),
|
|
@@ -629,6 +787,9 @@ var Input = forwardRef(function Input2({
|
|
|
629
787
|
bowing,
|
|
630
788
|
fillStyle,
|
|
631
789
|
strokeWidth,
|
|
790
|
+
hachureGap,
|
|
791
|
+
hachureAngle,
|
|
792
|
+
fillWeight,
|
|
632
793
|
id,
|
|
633
794
|
onFocus,
|
|
634
795
|
onBlur,
|
|
@@ -637,11 +798,12 @@ var Input = forwardRef(function Input2({
|
|
|
637
798
|
}, ref) {
|
|
638
799
|
const [focused, setFocused] = useState(false);
|
|
639
800
|
const fieldRef = useRef(null);
|
|
801
|
+
const theme = useSketchTheme(sketchColor);
|
|
640
802
|
const shouldAnimate = useAnimate(animate);
|
|
641
803
|
const resolvedSeed = useResolvedSeed(seed);
|
|
642
804
|
const focusSeed = deriveSeed(resolvedSeed, "focus");
|
|
643
805
|
const sketchSeed = shouldAnimate && focused ? focusSeed : resolvedSeed;
|
|
644
|
-
const ink = sketchColor ??
|
|
806
|
+
const ink = sketchColor ?? theme.ink;
|
|
645
807
|
const inputId = id;
|
|
646
808
|
useDrawIn(fieldRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
|
|
647
809
|
return /* @__PURE__ */ jsxs(
|
|
@@ -674,9 +836,12 @@ var Input = forwardRef(function Input2({
|
|
|
674
836
|
shape: "rectangle",
|
|
675
837
|
roughness,
|
|
676
838
|
seed: sketchSeed,
|
|
677
|
-
sketchColor: focused ?
|
|
839
|
+
sketchColor: focused ? sketchColor ?? theme.accent : ink,
|
|
678
840
|
bowing,
|
|
679
841
|
fillStyle,
|
|
842
|
+
hachureGap,
|
|
843
|
+
hachureAngle,
|
|
844
|
+
fillWeight,
|
|
680
845
|
strokeWidth: focused && !shouldAnimate ? (strokeWidth ?? 1.75) + 0.35 : focused ? (strokeWidth ?? 1.75) + 0.2 : strokeWidth
|
|
681
846
|
}
|
|
682
847
|
),
|
|
@@ -727,6 +892,9 @@ var Textarea = forwardRef(
|
|
|
727
892
|
bowing,
|
|
728
893
|
fillStyle,
|
|
729
894
|
strokeWidth,
|
|
895
|
+
hachureGap,
|
|
896
|
+
hachureAngle,
|
|
897
|
+
fillWeight,
|
|
730
898
|
id,
|
|
731
899
|
rows = 4,
|
|
732
900
|
onFocus,
|
|
@@ -736,11 +904,12 @@ var Textarea = forwardRef(
|
|
|
736
904
|
}, ref) {
|
|
737
905
|
const [focused, setFocused] = useState(false);
|
|
738
906
|
const fieldRef = useRef(null);
|
|
907
|
+
const theme = useSketchTheme(sketchColor);
|
|
739
908
|
const shouldAnimate = useAnimate(animate);
|
|
740
909
|
const resolvedSeed = useResolvedSeed(seed);
|
|
741
910
|
const focusSeed = deriveSeed(resolvedSeed, "focus");
|
|
742
911
|
const sketchSeed = shouldAnimate && focused ? focusSeed : resolvedSeed;
|
|
743
|
-
const ink = sketchColor ??
|
|
912
|
+
const ink = sketchColor ?? theme.ink;
|
|
744
913
|
useDrawIn(fieldRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
|
|
745
914
|
return /* @__PURE__ */ jsxs(
|
|
746
915
|
"label",
|
|
@@ -772,9 +941,12 @@ var Textarea = forwardRef(
|
|
|
772
941
|
shape: "rectangle",
|
|
773
942
|
roughness,
|
|
774
943
|
seed: sketchSeed,
|
|
775
|
-
sketchColor: focused ?
|
|
944
|
+
sketchColor: focused ? sketchColor ?? theme.accent : ink,
|
|
776
945
|
bowing,
|
|
777
946
|
fillStyle,
|
|
947
|
+
hachureGap,
|
|
948
|
+
hachureAngle,
|
|
949
|
+
fillWeight,
|
|
778
950
|
strokeWidth: focused && !shouldAnimate ? (strokeWidth ?? 1.75) + 0.35 : focused ? (strokeWidth ?? 1.75) + 0.2 : strokeWidth
|
|
779
951
|
}
|
|
780
952
|
),
|
|
@@ -804,8 +976,7 @@ var Textarea = forwardRef(
|
|
|
804
976
|
color: ink,
|
|
805
977
|
fontFamily: doodleUiFontFamily,
|
|
806
978
|
fontSize: 15,
|
|
807
|
-
|
|
808
|
-
padding: "10px 12px",
|
|
979
|
+
padding: "8px 12px",
|
|
809
980
|
resize: "vertical",
|
|
810
981
|
...style
|
|
811
982
|
},
|
|
@@ -823,6 +994,7 @@ var CHECK_PATH = "M 4.5 10.5 L 8.5 14.5 L 15.5 5.5";
|
|
|
823
994
|
function CheckMark({
|
|
824
995
|
roughness,
|
|
825
996
|
seed,
|
|
997
|
+
sketchColor,
|
|
826
998
|
bowing,
|
|
827
999
|
strokeWidth,
|
|
828
1000
|
shouldAnimate
|
|
@@ -841,7 +1013,7 @@ function CheckMark({
|
|
|
841
1013
|
path: CHECK_PATH,
|
|
842
1014
|
roughness: (roughness ?? 1.5) * 0.7,
|
|
843
1015
|
seed,
|
|
844
|
-
sketchColor
|
|
1016
|
+
sketchColor,
|
|
845
1017
|
bowing,
|
|
846
1018
|
strokeWidth: (strokeWidth ?? 1.6) + 0.4,
|
|
847
1019
|
inset: 0
|
|
@@ -855,12 +1027,16 @@ var Checkbox = forwardRef(
|
|
|
855
1027
|
className,
|
|
856
1028
|
style,
|
|
857
1029
|
label,
|
|
1030
|
+
fill,
|
|
858
1031
|
roughness,
|
|
859
1032
|
seed,
|
|
860
1033
|
sketchColor,
|
|
861
1034
|
bowing,
|
|
862
1035
|
fillStyle,
|
|
863
1036
|
strokeWidth,
|
|
1037
|
+
hachureGap,
|
|
1038
|
+
hachureAngle,
|
|
1039
|
+
fillWeight,
|
|
864
1040
|
checked,
|
|
865
1041
|
defaultChecked,
|
|
866
1042
|
onCheckedChange,
|
|
@@ -868,7 +1044,9 @@ var Checkbox = forwardRef(
|
|
|
868
1044
|
animate,
|
|
869
1045
|
...rest
|
|
870
1046
|
}, ref) {
|
|
871
|
-
const
|
|
1047
|
+
const theme = useSketchTheme(sketchColor);
|
|
1048
|
+
const ink = sketchColor ?? theme.ink;
|
|
1049
|
+
const accent = sketchColor ?? theme.accent;
|
|
872
1050
|
const generatedId = useId();
|
|
873
1051
|
const inputId = id ?? generatedId;
|
|
874
1052
|
const boxRef = useRef(null);
|
|
@@ -884,6 +1062,7 @@ var Checkbox = forwardRef(
|
|
|
884
1062
|
gap: 8,
|
|
885
1063
|
cursor: "pointer",
|
|
886
1064
|
userSelect: "none",
|
|
1065
|
+
color: ink,
|
|
887
1066
|
...style
|
|
888
1067
|
},
|
|
889
1068
|
children: [
|
|
@@ -920,8 +1099,12 @@ var Checkbox = forwardRef(
|
|
|
920
1099
|
seed,
|
|
921
1100
|
sketchColor: ink,
|
|
922
1101
|
bowing,
|
|
923
|
-
fillStyle,
|
|
1102
|
+
fillStyle: fillStyle ?? (fill ? "solid" : void 0),
|
|
1103
|
+
fill,
|
|
924
1104
|
strokeWidth: strokeWidth ?? 1.6,
|
|
1105
|
+
hachureGap,
|
|
1106
|
+
hachureAngle,
|
|
1107
|
+
fillWeight,
|
|
925
1108
|
inset: 1.5
|
|
926
1109
|
}
|
|
927
1110
|
)
|
|
@@ -940,6 +1123,7 @@ var Checkbox = forwardRef(
|
|
|
940
1123
|
{
|
|
941
1124
|
roughness,
|
|
942
1125
|
seed,
|
|
1126
|
+
sketchColor: accent,
|
|
943
1127
|
bowing,
|
|
944
1128
|
strokeWidth,
|
|
945
1129
|
shouldAnimate
|
|
@@ -954,7 +1138,7 @@ var Checkbox = forwardRef(
|
|
|
954
1138
|
"label",
|
|
955
1139
|
{
|
|
956
1140
|
htmlFor: inputId,
|
|
957
|
-
style: { fontSize: 15, cursor: "pointer", fontFamily: doodleUiFontFamily },
|
|
1141
|
+
style: { fontSize: 15, cursor: "pointer", fontFamily: doodleUiFontFamily, color: ink },
|
|
958
1142
|
children: label
|
|
959
1143
|
}
|
|
960
1144
|
) : null
|
|
@@ -986,6 +1170,7 @@ var SIZE = 20;
|
|
|
986
1170
|
function RadioDot({
|
|
987
1171
|
roughness,
|
|
988
1172
|
seed,
|
|
1173
|
+
sketchColor,
|
|
989
1174
|
bowing,
|
|
990
1175
|
shouldAnimate
|
|
991
1176
|
}) {
|
|
@@ -1019,8 +1204,8 @@ function RadioDot({
|
|
|
1019
1204
|
shape: "ellipse",
|
|
1020
1205
|
roughness: (roughness ?? 1.5) + 0.2,
|
|
1021
1206
|
seed,
|
|
1022
|
-
sketchColor
|
|
1023
|
-
fill:
|
|
1207
|
+
sketchColor,
|
|
1208
|
+
fill: sketchColor,
|
|
1024
1209
|
fillStyle: "solid",
|
|
1025
1210
|
bowing,
|
|
1026
1211
|
strokeWidth: 1,
|
|
@@ -1034,17 +1219,23 @@ var Radio = forwardRef(function Radio2({
|
|
|
1034
1219
|
className,
|
|
1035
1220
|
style,
|
|
1036
1221
|
label,
|
|
1222
|
+
fill,
|
|
1037
1223
|
roughness,
|
|
1038
1224
|
seed,
|
|
1039
1225
|
sketchColor,
|
|
1040
1226
|
bowing,
|
|
1041
1227
|
fillStyle,
|
|
1042
1228
|
strokeWidth,
|
|
1229
|
+
hachureGap,
|
|
1230
|
+
hachureAngle,
|
|
1231
|
+
fillWeight,
|
|
1043
1232
|
id,
|
|
1044
1233
|
animate,
|
|
1045
1234
|
...rest
|
|
1046
1235
|
}, ref) {
|
|
1047
|
-
const
|
|
1236
|
+
const theme = useSketchTheme(sketchColor);
|
|
1237
|
+
const ink = sketchColor ?? theme.ink;
|
|
1238
|
+
const accent = sketchColor ?? theme.accent;
|
|
1048
1239
|
const generatedId = useId();
|
|
1049
1240
|
const inputId = id ?? generatedId;
|
|
1050
1241
|
const ringRef = useRef(null);
|
|
@@ -1060,6 +1251,7 @@ var Radio = forwardRef(function Radio2({
|
|
|
1060
1251
|
gap: 8,
|
|
1061
1252
|
cursor: "pointer",
|
|
1062
1253
|
userSelect: "none",
|
|
1254
|
+
color: ink,
|
|
1063
1255
|
...style
|
|
1064
1256
|
},
|
|
1065
1257
|
children: [
|
|
@@ -1094,8 +1286,12 @@ var Radio = forwardRef(function Radio2({
|
|
|
1094
1286
|
seed,
|
|
1095
1287
|
sketchColor: ink,
|
|
1096
1288
|
bowing,
|
|
1097
|
-
fillStyle,
|
|
1289
|
+
fillStyle: fillStyle ?? (fill ? "solid" : void 0),
|
|
1290
|
+
fill,
|
|
1098
1291
|
strokeWidth: strokeWidth ?? 1.6,
|
|
1292
|
+
hachureGap,
|
|
1293
|
+
hachureAngle,
|
|
1294
|
+
fillWeight,
|
|
1099
1295
|
inset: 1.5
|
|
1100
1296
|
}
|
|
1101
1297
|
)
|
|
@@ -1114,6 +1310,7 @@ var Radio = forwardRef(function Radio2({
|
|
|
1114
1310
|
{
|
|
1115
1311
|
roughness,
|
|
1116
1312
|
seed,
|
|
1313
|
+
sketchColor: accent,
|
|
1117
1314
|
bowing,
|
|
1118
1315
|
shouldAnimate
|
|
1119
1316
|
}
|
|
@@ -1127,7 +1324,7 @@ var Radio = forwardRef(function Radio2({
|
|
|
1127
1324
|
"label",
|
|
1128
1325
|
{
|
|
1129
1326
|
htmlFor: inputId,
|
|
1130
|
-
style: { fontSize: 15, cursor: "pointer", fontFamily: doodleUiFontFamily },
|
|
1327
|
+
style: { fontSize: 15, cursor: "pointer", fontFamily: doodleUiFontFamily, color: ink },
|
|
1131
1328
|
children: label
|
|
1132
1329
|
}
|
|
1133
1330
|
) : null
|
|
@@ -1149,18 +1346,26 @@ var Card = forwardRef(function Card2({
|
|
|
1149
1346
|
bowing,
|
|
1150
1347
|
fillStyle,
|
|
1151
1348
|
strokeWidth,
|
|
1349
|
+
hachureGap,
|
|
1350
|
+
hachureAngle,
|
|
1351
|
+
fillWeight,
|
|
1152
1352
|
animate,
|
|
1153
1353
|
...rest
|
|
1154
1354
|
}, ref) {
|
|
1355
|
+
const theme = useSketchTheme(sketchColor);
|
|
1356
|
+
const ink = sketchColor ?? theme.ink;
|
|
1155
1357
|
const boxProps = {
|
|
1156
1358
|
shadow,
|
|
1157
1359
|
fill,
|
|
1158
1360
|
roughness,
|
|
1159
1361
|
seed,
|
|
1160
|
-
sketchColor:
|
|
1362
|
+
sketchColor: ink,
|
|
1161
1363
|
bowing,
|
|
1162
1364
|
fillStyle,
|
|
1163
1365
|
strokeWidth,
|
|
1366
|
+
hachureGap,
|
|
1367
|
+
hachureAngle,
|
|
1368
|
+
fillWeight,
|
|
1164
1369
|
animate
|
|
1165
1370
|
};
|
|
1166
1371
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1168,7 +1373,10 @@ var Card = forwardRef(function Card2({
|
|
|
1168
1373
|
{
|
|
1169
1374
|
ref,
|
|
1170
1375
|
className: cn(className),
|
|
1171
|
-
style
|
|
1376
|
+
style: {
|
|
1377
|
+
color: ink,
|
|
1378
|
+
...style
|
|
1379
|
+
},
|
|
1172
1380
|
contentStyle: { padding: "16px 18px" },
|
|
1173
1381
|
...boxProps,
|
|
1174
1382
|
...rest,
|
|
@@ -1179,13 +1387,14 @@ var Card = forwardRef(function Card2({
|
|
|
1179
1387
|
style: {
|
|
1180
1388
|
fontWeight: doodleUiFontWeight(700),
|
|
1181
1389
|
fontSize: 16,
|
|
1182
|
-
marginBottom: 10
|
|
1390
|
+
marginBottom: 10,
|
|
1391
|
+
color: ink
|
|
1183
1392
|
},
|
|
1184
1393
|
children: title
|
|
1185
1394
|
}
|
|
1186
1395
|
) : null,
|
|
1187
1396
|
children,
|
|
1188
|
-
footer ? /* @__PURE__ */ jsx("div", { style: { marginTop: 14, fontSize: 13, opacity: 0.8 }, children: footer }) : null
|
|
1397
|
+
footer ? /* @__PURE__ */ jsx("div", { style: { marginTop: 14, fontSize: 13, opacity: 0.8, color: ink }, children: footer }) : null
|
|
1189
1398
|
]
|
|
1190
1399
|
}
|
|
1191
1400
|
);
|
|
@@ -1201,11 +1410,15 @@ var Badge = forwardRef(function Badge2({
|
|
|
1201
1410
|
bowing,
|
|
1202
1411
|
fillStyle,
|
|
1203
1412
|
strokeWidth,
|
|
1413
|
+
hachureGap,
|
|
1414
|
+
hachureAngle,
|
|
1415
|
+
fillWeight,
|
|
1204
1416
|
animate,
|
|
1205
1417
|
...rest
|
|
1206
1418
|
}, ref) {
|
|
1207
|
-
const
|
|
1208
|
-
const
|
|
1419
|
+
const theme = useSketchTheme(sketchColor);
|
|
1420
|
+
const ink = variant === "accent" ? sketchColor ?? theme.accent : sketchColor ?? theme.ink;
|
|
1421
|
+
const fill = variant === "accent" ? theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill : variant === "outline" ? void 0 : theme.secondaryFill;
|
|
1209
1422
|
return /* @__PURE__ */ jsx(
|
|
1210
1423
|
SketchBox,
|
|
1211
1424
|
{
|
|
@@ -1220,10 +1433,14 @@ var Badge = forwardRef(function Badge2({
|
|
|
1220
1433
|
fontSize: 12,
|
|
1221
1434
|
fontWeight: doodleUiFontWeight(650),
|
|
1222
1435
|
lineHeight: 1.4,
|
|
1223
|
-
letterSpacing: "0.01em"
|
|
1436
|
+
letterSpacing: "0.01em",
|
|
1437
|
+
color: ink
|
|
1224
1438
|
},
|
|
1225
1439
|
fill,
|
|
1226
|
-
fillStyle: fillStyle ?? "hachure",
|
|
1440
|
+
fillStyle: fillStyle ?? (fill ? "hachure" : void 0),
|
|
1441
|
+
hachureGap: hachureGap ?? 6,
|
|
1442
|
+
hachureAngle,
|
|
1443
|
+
fillWeight: fillWeight ?? 0.9,
|
|
1227
1444
|
roughness,
|
|
1228
1445
|
seed,
|
|
1229
1446
|
sketchColor: ink,
|
|
@@ -1235,35 +1452,42 @@ var Badge = forwardRef(function Badge2({
|
|
|
1235
1452
|
}
|
|
1236
1453
|
);
|
|
1237
1454
|
});
|
|
1238
|
-
var
|
|
1239
|
-
info: SKETCH_COLORS.info,
|
|
1240
|
-
warning: SKETCH_COLORS.warning,
|
|
1241
|
-
error: SKETCH_COLORS.error,
|
|
1242
|
-
success: SKETCH_COLORS.success
|
|
1243
|
-
};
|
|
1244
|
-
var VARIANT_FILL = {
|
|
1455
|
+
var LIGHT_VARIANT_FILL = {
|
|
1245
1456
|
info: "#d2deec",
|
|
1246
1457
|
warning: "#f3e2c0",
|
|
1247
1458
|
error: "#f3d0cc",
|
|
1248
1459
|
success: "#d3e8dc"
|
|
1249
1460
|
};
|
|
1461
|
+
var DARK_VARIANT_FILL = {
|
|
1462
|
+
info: "rgba(96, 165, 250, 0.16)",
|
|
1463
|
+
warning: "rgba(251, 191, 36, 0.16)",
|
|
1464
|
+
error: "rgba(248, 113, 113, 0.16)",
|
|
1465
|
+
success: "rgba(52, 211, 153, 0.16)"
|
|
1466
|
+
};
|
|
1250
1467
|
var Alert = forwardRef(function Alert2({
|
|
1251
1468
|
children,
|
|
1252
1469
|
className,
|
|
1253
1470
|
style,
|
|
1254
1471
|
variant = "info",
|
|
1255
1472
|
title,
|
|
1473
|
+
fill,
|
|
1256
1474
|
roughness,
|
|
1257
1475
|
seed,
|
|
1258
1476
|
sketchColor,
|
|
1259
1477
|
bowing,
|
|
1260
1478
|
fillStyle,
|
|
1261
1479
|
strokeWidth,
|
|
1480
|
+
hachureGap,
|
|
1481
|
+
hachureAngle,
|
|
1482
|
+
fillWeight,
|
|
1262
1483
|
role = "status",
|
|
1263
1484
|
animate,
|
|
1264
1485
|
...rest
|
|
1265
1486
|
}, ref) {
|
|
1266
|
-
const
|
|
1487
|
+
const theme = useSketchTheme(sketchColor);
|
|
1488
|
+
const color = sketchColor ?? theme[variant];
|
|
1489
|
+
const defaultFill = theme.isDark ? DARK_VARIANT_FILL[variant] : LIGHT_VARIANT_FILL[variant];
|
|
1490
|
+
const resolvedFill = fill ?? defaultFill;
|
|
1267
1491
|
return /* @__PURE__ */ jsxs(
|
|
1268
1492
|
SketchBox,
|
|
1269
1493
|
{
|
|
@@ -1271,14 +1495,17 @@ var Alert = forwardRef(function Alert2({
|
|
|
1271
1495
|
role,
|
|
1272
1496
|
className: cn(className),
|
|
1273
1497
|
style: { color, ...style },
|
|
1274
|
-
contentStyle: { padding: "12px 16px" },
|
|
1498
|
+
contentStyle: { padding: "12px 16px", color: theme.ink },
|
|
1275
1499
|
roughness,
|
|
1276
1500
|
seed,
|
|
1277
1501
|
sketchColor: color,
|
|
1278
1502
|
bowing,
|
|
1279
1503
|
fillStyle: fillStyle ?? "hachure",
|
|
1280
|
-
fill:
|
|
1504
|
+
fill: resolvedFill,
|
|
1281
1505
|
strokeWidth,
|
|
1506
|
+
hachureGap: hachureGap ?? 9,
|
|
1507
|
+
hachureAngle,
|
|
1508
|
+
fillWeight: fillWeight ?? 0.85,
|
|
1282
1509
|
animate,
|
|
1283
1510
|
drawInDuration: DRAW_IN_ALERT_MS,
|
|
1284
1511
|
...rest,
|
|
@@ -1289,12 +1516,13 @@ var Alert = forwardRef(function Alert2({
|
|
|
1289
1516
|
style: {
|
|
1290
1517
|
fontWeight: doodleUiFontWeight(700),
|
|
1291
1518
|
marginBottom: 4,
|
|
1292
|
-
fontSize: 15
|
|
1519
|
+
fontSize: 15,
|
|
1520
|
+
color
|
|
1293
1521
|
},
|
|
1294
1522
|
children: title
|
|
1295
1523
|
}
|
|
1296
1524
|
) : null,
|
|
1297
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 14, lineHeight: 1.5, color:
|
|
1525
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 14, lineHeight: 1.5, color: theme.ink }, children })
|
|
1298
1526
|
]
|
|
1299
1527
|
}
|
|
1300
1528
|
);
|
|
@@ -1308,15 +1536,20 @@ function Modal({
|
|
|
1308
1536
|
description,
|
|
1309
1537
|
children,
|
|
1310
1538
|
className,
|
|
1539
|
+
fill,
|
|
1311
1540
|
roughness,
|
|
1312
1541
|
seed,
|
|
1313
1542
|
sketchColor,
|
|
1314
1543
|
bowing,
|
|
1315
1544
|
fillStyle,
|
|
1316
1545
|
strokeWidth,
|
|
1546
|
+
hachureGap,
|
|
1547
|
+
hachureAngle,
|
|
1548
|
+
fillWeight,
|
|
1317
1549
|
animate
|
|
1318
1550
|
}) {
|
|
1319
|
-
const
|
|
1551
|
+
const theme = useSketchTheme(sketchColor);
|
|
1552
|
+
const ink = sketchColor ?? theme.ink;
|
|
1320
1553
|
const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
|
|
1321
1554
|
const isOpen = open ?? uncontrolled;
|
|
1322
1555
|
const shouldAnimate = useAnimate(animate);
|
|
@@ -1337,7 +1570,7 @@ function Modal({
|
|
|
1337
1570
|
style: {
|
|
1338
1571
|
position: "fixed",
|
|
1339
1572
|
inset: 0,
|
|
1340
|
-
background: "rgba(31, 29, 26, 0.38)",
|
|
1573
|
+
background: theme.isDark ? "rgba(0, 0, 0, 0.65)" : "rgba(31, 29, 26, 0.38)",
|
|
1341
1574
|
zIndex: 70
|
|
1342
1575
|
}
|
|
1343
1576
|
}
|
|
@@ -1366,7 +1599,8 @@ function Modal({
|
|
|
1366
1599
|
style: {
|
|
1367
1600
|
width: "min(480px, calc(100vw - 32px))",
|
|
1368
1601
|
outline: "none",
|
|
1369
|
-
pointerEvents: "auto"
|
|
1602
|
+
pointerEvents: "auto",
|
|
1603
|
+
color: ink
|
|
1370
1604
|
},
|
|
1371
1605
|
children: /* @__PURE__ */ jsxs(
|
|
1372
1606
|
SketchBox,
|
|
@@ -1376,11 +1610,14 @@ function Modal({
|
|
|
1376
1610
|
sketchColor: ink,
|
|
1377
1611
|
bowing,
|
|
1378
1612
|
fillStyle: fillStyle ?? "solid",
|
|
1379
|
-
fill:
|
|
1613
|
+
fill: fill ?? theme.paper,
|
|
1380
1614
|
strokeWidth: strokeWidth ?? 2,
|
|
1615
|
+
hachureGap,
|
|
1616
|
+
hachureAngle,
|
|
1617
|
+
fillWeight,
|
|
1381
1618
|
shadow: true,
|
|
1382
1619
|
animate,
|
|
1383
|
-
contentStyle: { padding: "20px 22px 18px" },
|
|
1620
|
+
contentStyle: { padding: "20px 22px 18px", color: ink },
|
|
1384
1621
|
children: [
|
|
1385
1622
|
/* @__PURE__ */ jsxs(
|
|
1386
1623
|
"div",
|
|
@@ -1423,12 +1660,10 @@ function Modal({
|
|
|
1423
1660
|
{
|
|
1424
1661
|
variant: "ghost",
|
|
1425
1662
|
size: "sm",
|
|
1426
|
-
roughness,
|
|
1427
|
-
seed,
|
|
1428
1663
|
sketchColor: ink,
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
children: "
|
|
1664
|
+
"aria-label": "Close dialog",
|
|
1665
|
+
style: { padding: "2px 8px", minHeight: 26 },
|
|
1666
|
+
children: "\u2715"
|
|
1432
1667
|
}
|
|
1433
1668
|
) })
|
|
1434
1669
|
]
|
|
@@ -1438,11 +1673,13 @@ function Modal({
|
|
|
1438
1673
|
Dialog.Description,
|
|
1439
1674
|
{
|
|
1440
1675
|
style: {
|
|
1441
|
-
margin:
|
|
1676
|
+
margin: 0,
|
|
1677
|
+
marginBottom: 14,
|
|
1442
1678
|
fontSize: 14,
|
|
1443
|
-
lineHeight: 1.
|
|
1444
|
-
|
|
1445
|
-
|
|
1679
|
+
lineHeight: 1.4,
|
|
1680
|
+
opacity: 0.78,
|
|
1681
|
+
fontFamily: doodleUiFontFamily,
|
|
1682
|
+
color: ink
|
|
1446
1683
|
},
|
|
1447
1684
|
children: description
|
|
1448
1685
|
}
|
|
@@ -1473,10 +1710,15 @@ var Divider = forwardRef(
|
|
|
1473
1710
|
sketchColor,
|
|
1474
1711
|
bowing,
|
|
1475
1712
|
strokeWidth,
|
|
1713
|
+
hachureGap,
|
|
1714
|
+
hachureAngle,
|
|
1715
|
+
fillWeight,
|
|
1476
1716
|
animate,
|
|
1477
1717
|
...rest
|
|
1478
1718
|
}, ref) {
|
|
1479
1719
|
const rootRef = useRef(null);
|
|
1720
|
+
const theme = useSketchTheme(sketchColor);
|
|
1721
|
+
const ink = sketchColor ?? theme.ink;
|
|
1480
1722
|
const shouldAnimate = useAnimate(animate);
|
|
1481
1723
|
const horizontal = orientation === "horizontal";
|
|
1482
1724
|
useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate);
|
|
@@ -1504,9 +1746,12 @@ var Divider = forwardRef(
|
|
|
1504
1746
|
shape: horizontal ? "line" : "line-vertical",
|
|
1505
1747
|
roughness: roughness ?? 1.8,
|
|
1506
1748
|
seed,
|
|
1507
|
-
sketchColor:
|
|
1749
|
+
sketchColor: ink,
|
|
1508
1750
|
bowing: bowing ?? 2,
|
|
1509
1751
|
strokeWidth: strokeWidth ?? 1.5,
|
|
1752
|
+
hachureGap,
|
|
1753
|
+
hachureAngle,
|
|
1754
|
+
fillWeight,
|
|
1510
1755
|
inset: 4
|
|
1511
1756
|
}
|
|
1512
1757
|
)
|
|
@@ -1526,12 +1771,16 @@ var Progress = forwardRef(
|
|
|
1526
1771
|
bowing,
|
|
1527
1772
|
fillStyle,
|
|
1528
1773
|
strokeWidth,
|
|
1774
|
+
hachureGap,
|
|
1775
|
+
fillWeight,
|
|
1529
1776
|
animate,
|
|
1530
1777
|
...rest
|
|
1531
1778
|
}, ref) {
|
|
1532
1779
|
const rootRef = useRef(null);
|
|
1533
1780
|
const trackRef = useRef(null);
|
|
1534
|
-
const
|
|
1781
|
+
const theme = useSketchTheme(sketchColor);
|
|
1782
|
+
const ink = sketchColor ?? theme.accent;
|
|
1783
|
+
const trackInk = sketchColor ?? (theme.isDark ? "rgba(243, 244, 246, 0.45)" : theme.ink);
|
|
1535
1784
|
const clamped = Math.min(max, Math.max(0, value));
|
|
1536
1785
|
const percent = max === 0 ? 0 : clamped / max * 100;
|
|
1537
1786
|
const shouldAnimate = useAnimate(animate);
|
|
@@ -1571,7 +1820,7 @@ var Progress = forwardRef(
|
|
|
1571
1820
|
shape: "rectangle",
|
|
1572
1821
|
roughness,
|
|
1573
1822
|
seed: resolvedSeed,
|
|
1574
|
-
sketchColor:
|
|
1823
|
+
sketchColor: trackInk,
|
|
1575
1824
|
bowing,
|
|
1576
1825
|
strokeWidth: strokeWidth ?? 1.5,
|
|
1577
1826
|
inset: 2
|
|
@@ -1602,6 +1851,8 @@ var Progress = forwardRef(
|
|
|
1602
1851
|
fillStyle: fillStyle ?? "hachure",
|
|
1603
1852
|
bowing,
|
|
1604
1853
|
strokeWidth: 1.1,
|
|
1854
|
+
hachureGap: hachureGap ?? 5,
|
|
1855
|
+
fillWeight: fillWeight ?? 1.2,
|
|
1605
1856
|
inset: 1
|
|
1606
1857
|
}
|
|
1607
1858
|
)
|
|
@@ -1619,15 +1870,20 @@ function Tooltip({
|
|
|
1619
1870
|
side = "top",
|
|
1620
1871
|
delayDuration = 200,
|
|
1621
1872
|
className,
|
|
1873
|
+
fill,
|
|
1622
1874
|
roughness,
|
|
1623
1875
|
seed,
|
|
1624
1876
|
sketchColor,
|
|
1625
1877
|
bowing,
|
|
1626
1878
|
fillStyle,
|
|
1627
1879
|
strokeWidth,
|
|
1880
|
+
hachureGap,
|
|
1881
|
+
hachureAngle,
|
|
1882
|
+
fillWeight,
|
|
1628
1883
|
animate
|
|
1629
1884
|
}) {
|
|
1630
|
-
const
|
|
1885
|
+
const theme = useSketchTheme(sketchColor);
|
|
1886
|
+
const ink = sketchColor ?? theme.ink;
|
|
1631
1887
|
return /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { delayDuration, children: [
|
|
1632
1888
|
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
1633
1889
|
/* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
@@ -1645,8 +1901,11 @@ function Tooltip({
|
|
|
1645
1901
|
sketchColor: ink,
|
|
1646
1902
|
bowing,
|
|
1647
1903
|
fillStyle: fillStyle ?? "solid",
|
|
1648
|
-
fill:
|
|
1904
|
+
fill: fill ?? theme.paper,
|
|
1649
1905
|
strokeWidth: strokeWidth ?? 1.4,
|
|
1906
|
+
hachureGap,
|
|
1907
|
+
hachureAngle,
|
|
1908
|
+
fillWeight,
|
|
1650
1909
|
animate,
|
|
1651
1910
|
drawInDuration: DRAW_IN_TOOLTIP_MS,
|
|
1652
1911
|
contentStyle: {
|
|
@@ -1681,12 +1940,16 @@ function Select({
|
|
|
1681
1940
|
placeholder = "Select\u2026",
|
|
1682
1941
|
className,
|
|
1683
1942
|
style,
|
|
1943
|
+
fill,
|
|
1684
1944
|
roughness,
|
|
1685
1945
|
seed,
|
|
1686
1946
|
sketchColor,
|
|
1687
1947
|
bowing,
|
|
1688
1948
|
fillStyle,
|
|
1689
1949
|
strokeWidth,
|
|
1950
|
+
hachureGap,
|
|
1951
|
+
hachureAngle,
|
|
1952
|
+
fillWeight,
|
|
1690
1953
|
value,
|
|
1691
1954
|
defaultValue,
|
|
1692
1955
|
onValueChange,
|
|
@@ -1698,7 +1961,8 @@ function Select({
|
|
|
1698
1961
|
const selectedValue = value ?? uncontrolled;
|
|
1699
1962
|
const selectedLabel = options.find((option) => option.value === selectedValue)?.label;
|
|
1700
1963
|
const resolvedSeed = useResolvedSeed(seed);
|
|
1701
|
-
const
|
|
1964
|
+
const theme = useSketchTheme(sketchColor);
|
|
1965
|
+
const ink = sketchColor ?? theme.ink;
|
|
1702
1966
|
return /* @__PURE__ */ jsx(
|
|
1703
1967
|
SelectSketchContext.Provider,
|
|
1704
1968
|
{
|
|
@@ -1709,8 +1973,13 @@ function Select({
|
|
|
1709
1973
|
bowing,
|
|
1710
1974
|
fillStyle,
|
|
1711
1975
|
strokeWidth,
|
|
1976
|
+
hachureGap,
|
|
1977
|
+
hachureAngle,
|
|
1978
|
+
fillWeight,
|
|
1712
1979
|
resolvedSeed,
|
|
1713
1980
|
ink,
|
|
1981
|
+
paper: fill ?? theme.paper,
|
|
1982
|
+
accent: theme.accent,
|
|
1714
1983
|
selectedValue,
|
|
1715
1984
|
selectedLabel,
|
|
1716
1985
|
placeholder,
|
|
@@ -1796,7 +2065,7 @@ var SelectTrigger = forwardRef(
|
|
|
1796
2065
|
shape: "rectangle",
|
|
1797
2066
|
roughness: sketch.roughness,
|
|
1798
2067
|
seed: sketch.resolvedSeed,
|
|
1799
|
-
sketchColor: openish ?
|
|
2068
|
+
sketchColor: openish ? sketch.accent : sketch.ink,
|
|
1800
2069
|
bowing: sketch.bowing,
|
|
1801
2070
|
fillStyle: sketch.fillStyle,
|
|
1802
2071
|
strokeWidth: openish ? (sketch.strokeWidth ?? 1.75) + 0.35 : sketch.strokeWidth
|
|
@@ -1847,7 +2116,7 @@ var SelectTrigger = forwardRef(
|
|
|
1847
2116
|
}
|
|
1848
2117
|
);
|
|
1849
2118
|
var SelectContent = forwardRef(
|
|
1850
|
-
function SelectContent2({ className, style, children, ...rest }, ref) {
|
|
2119
|
+
function SelectContent2({ className, style, children, fill, ...rest }, ref) {
|
|
1851
2120
|
const sketch = useSelectSketch();
|
|
1852
2121
|
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1853
2122
|
SelectPrimitive.Content,
|
|
@@ -1860,6 +2129,7 @@ var SelectContent = forwardRef(
|
|
|
1860
2129
|
zIndex: 80,
|
|
1861
2130
|
outline: "none",
|
|
1862
2131
|
minWidth: "var(--radix-select-trigger-width)",
|
|
2132
|
+
color: sketch.ink,
|
|
1863
2133
|
...style
|
|
1864
2134
|
},
|
|
1865
2135
|
...rest,
|
|
@@ -1871,10 +2141,13 @@ var SelectContent = forwardRef(
|
|
|
1871
2141
|
sketchColor: sketch.ink,
|
|
1872
2142
|
bowing: sketch.bowing,
|
|
1873
2143
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
1874
|
-
fill:
|
|
2144
|
+
fill: fill ?? sketch.paper,
|
|
1875
2145
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
2146
|
+
hachureGap: sketch.hachureGap,
|
|
2147
|
+
hachureAngle: sketch.hachureAngle,
|
|
2148
|
+
fillWeight: sketch.fillWeight,
|
|
1876
2149
|
animate: sketch.animate,
|
|
1877
|
-
contentStyle: { padding: "6px 4px" },
|
|
2150
|
+
contentStyle: { padding: "6px 4px", color: sketch.ink },
|
|
1878
2151
|
children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { children })
|
|
1879
2152
|
}
|
|
1880
2153
|
)
|
|
@@ -1920,7 +2193,7 @@ var SelectItem = forwardRef(
|
|
|
1920
2193
|
shape: "line",
|
|
1921
2194
|
roughness: (sketch.roughness ?? 1.5) + 0.4,
|
|
1922
2195
|
seed: sketch.resolvedSeed,
|
|
1923
|
-
sketchColor: selected ?
|
|
2196
|
+
sketchColor: selected ? sketch.accent : sketch.ink,
|
|
1924
2197
|
bowing: sketch.bowing ?? 1.6,
|
|
1925
2198
|
strokeWidth: selected ? 1.8 : 1.3,
|
|
1926
2199
|
inset: UNDERLINE_INSET,
|
|
@@ -1969,7 +2242,10 @@ var Switch = forwardRef(
|
|
|
1969
2242
|
}, ref) {
|
|
1970
2243
|
const [uncontrolled, setUncontrolled] = useState(defaultChecked === true);
|
|
1971
2244
|
const isOn = checked ?? uncontrolled;
|
|
1972
|
-
const
|
|
2245
|
+
const theme = useSketchTheme(sketchColor);
|
|
2246
|
+
const ink = sketchColor ?? theme.ink;
|
|
2247
|
+
const activeColor = sketchColor ?? theme.accent;
|
|
2248
|
+
const activeFill = theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill;
|
|
1973
2249
|
const resolvedSeed = useResolvedSeed(seed);
|
|
1974
2250
|
const shouldAnimate = useAnimate(animate);
|
|
1975
2251
|
const trackRef = useRef(null);
|
|
@@ -1985,6 +2261,7 @@ var Switch = forwardRef(
|
|
|
1985
2261
|
gap: 8,
|
|
1986
2262
|
cursor: "pointer",
|
|
1987
2263
|
userSelect: "none",
|
|
2264
|
+
color: ink,
|
|
1988
2265
|
...style
|
|
1989
2266
|
},
|
|
1990
2267
|
children: [
|
|
@@ -2023,10 +2300,10 @@ var Switch = forwardRef(
|
|
|
2023
2300
|
shape: "rectangle",
|
|
2024
2301
|
roughness,
|
|
2025
2302
|
seed: trackSeed,
|
|
2026
|
-
sketchColor: isOn ?
|
|
2303
|
+
sketchColor: isOn ? activeColor : ink,
|
|
2027
2304
|
bowing: bowing ?? 1.4,
|
|
2028
2305
|
fillStyle: fillStyle ?? (isOn ? "hachure" : void 0),
|
|
2029
|
-
fill: isOn ?
|
|
2306
|
+
fill: isOn ? activeFill : void 0,
|
|
2030
2307
|
strokeWidth: strokeWidth ?? 1.6,
|
|
2031
2308
|
inset: 1.5
|
|
2032
2309
|
}
|
|
@@ -2054,8 +2331,8 @@ var Switch = forwardRef(
|
|
|
2054
2331
|
shape: "ellipse",
|
|
2055
2332
|
roughness: (roughness ?? 1.5) * 0.85,
|
|
2056
2333
|
seed: deriveSeed(resolvedSeed, "thumb"),
|
|
2057
|
-
sketchColor: isOn ?
|
|
2058
|
-
fill:
|
|
2334
|
+
sketchColor: isOn ? activeColor : ink,
|
|
2335
|
+
fill: theme.paper,
|
|
2059
2336
|
fillStyle: "solid",
|
|
2060
2337
|
bowing,
|
|
2061
2338
|
strokeWidth: (strokeWidth ?? 1.5) + 0.2,
|
|
@@ -2074,7 +2351,8 @@ var Switch = forwardRef(
|
|
|
2074
2351
|
style: {
|
|
2075
2352
|
fontSize: 15,
|
|
2076
2353
|
cursor: "pointer",
|
|
2077
|
-
fontFamily: doodleUiFontFamily
|
|
2354
|
+
fontFamily: doodleUiFontFamily,
|
|
2355
|
+
color: ink
|
|
2078
2356
|
},
|
|
2079
2357
|
children: label
|
|
2080
2358
|
}
|
|
@@ -2111,7 +2389,9 @@ var Tabs = forwardRef(function Tabs2({
|
|
|
2111
2389
|
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
2112
2390
|
const current = value ?? uncontrolled;
|
|
2113
2391
|
const resolvedSeed = useResolvedSeed(seed);
|
|
2114
|
-
const
|
|
2392
|
+
const theme = useSketchTheme(sketchColor);
|
|
2393
|
+
const ink = sketchColor ?? theme.ink;
|
|
2394
|
+
const accent = sketchColor ?? theme.accent;
|
|
2115
2395
|
const shouldAnimate = useAnimate(animate);
|
|
2116
2396
|
return /* @__PURE__ */ jsx(
|
|
2117
2397
|
TabsSketchContext.Provider,
|
|
@@ -2125,6 +2405,7 @@ var Tabs = forwardRef(function Tabs2({
|
|
|
2125
2405
|
strokeWidth,
|
|
2126
2406
|
resolvedSeed,
|
|
2127
2407
|
ink,
|
|
2408
|
+
accent,
|
|
2128
2409
|
current,
|
|
2129
2410
|
shouldAnimate
|
|
2130
2411
|
},
|
|
@@ -2174,7 +2455,7 @@ function TabUnderline({
|
|
|
2174
2455
|
shape: "line",
|
|
2175
2456
|
roughness: (sketch.roughness ?? 1.5) + 0.35,
|
|
2176
2457
|
seed,
|
|
2177
|
-
sketchColor:
|
|
2458
|
+
sketchColor: sketch.accent,
|
|
2178
2459
|
bowing: sketch.bowing ?? 1.8,
|
|
2179
2460
|
strokeWidth: (sketch.strokeWidth ?? 1.75) + 0.4,
|
|
2180
2461
|
inset: 2
|
|
@@ -2257,7 +2538,7 @@ var Tab = forwardRef(function Tab2({ className, style, children, value, ...rest
|
|
|
2257
2538
|
fontFamily: doodleUiFontFamily,
|
|
2258
2539
|
fontSize: 15,
|
|
2259
2540
|
fontWeight: active ? doodleUiFontWeight(650) : doodleUiFontWeight(400),
|
|
2260
|
-
color: sketch.ink,
|
|
2541
|
+
color: active ? sketch.accent : sketch.ink,
|
|
2261
2542
|
outline: "none",
|
|
2262
2543
|
...style
|
|
2263
2544
|
},
|
|
@@ -2355,7 +2636,8 @@ var Table = forwardRef(function Table2({
|
|
|
2355
2636
|
const tableRef = useRef(null);
|
|
2356
2637
|
const [lines, setLines] = useState([]);
|
|
2357
2638
|
const resolvedSeed = useResolvedSeed(seed);
|
|
2358
|
-
const
|
|
2639
|
+
const theme = useSketchTheme(sketchColor);
|
|
2640
|
+
const ink = sketchColor ?? theme.ink;
|
|
2359
2641
|
const shouldAnimate = useAnimate(animate);
|
|
2360
2642
|
useLayoutEffect(() => {
|
|
2361
2643
|
const wrapper = wrapperRef.current;
|
|
@@ -2528,18 +2810,18 @@ var TableCell = forwardRef(
|
|
|
2528
2810
|
);
|
|
2529
2811
|
}
|
|
2530
2812
|
);
|
|
2531
|
-
var
|
|
2532
|
-
info: SKETCH_COLORS.info,
|
|
2533
|
-
warning: SKETCH_COLORS.warning,
|
|
2534
|
-
error: SKETCH_COLORS.error,
|
|
2535
|
-
success: SKETCH_COLORS.success
|
|
2536
|
-
};
|
|
2537
|
-
var VARIANT_FILL2 = {
|
|
2813
|
+
var LIGHT_VARIANT_FILL2 = {
|
|
2538
2814
|
info: "#d2deec",
|
|
2539
2815
|
warning: "#f3e2c0",
|
|
2540
2816
|
error: "#f3d0cc",
|
|
2541
2817
|
success: "#d3e8dc"
|
|
2542
2818
|
};
|
|
2819
|
+
var DARK_VARIANT_FILL2 = {
|
|
2820
|
+
info: "rgba(96, 165, 250, 0.16)",
|
|
2821
|
+
warning: "rgba(251, 191, 36, 0.16)",
|
|
2822
|
+
error: "rgba(248, 113, 113, 0.16)",
|
|
2823
|
+
success: "rgba(52, 211, 153, 0.16)"
|
|
2824
|
+
};
|
|
2543
2825
|
var POSITION_STYLE = {
|
|
2544
2826
|
"top-left": { top: 16, left: 16 },
|
|
2545
2827
|
"top-right": { top: 16, right: 16 },
|
|
@@ -2591,6 +2873,7 @@ function Toast({
|
|
|
2591
2873
|
title,
|
|
2592
2874
|
children,
|
|
2593
2875
|
variant = "info",
|
|
2876
|
+
fill,
|
|
2594
2877
|
duration,
|
|
2595
2878
|
className,
|
|
2596
2879
|
style,
|
|
@@ -2600,6 +2883,9 @@ function Toast({
|
|
|
2600
2883
|
bowing,
|
|
2601
2884
|
fillStyle,
|
|
2602
2885
|
strokeWidth,
|
|
2886
|
+
hachureGap,
|
|
2887
|
+
hachureAngle,
|
|
2888
|
+
fillWeight,
|
|
2603
2889
|
animate
|
|
2604
2890
|
}) {
|
|
2605
2891
|
const position = useContext(ToastPositionContext);
|
|
@@ -2607,7 +2893,10 @@ function Toast({
|
|
|
2607
2893
|
const [uncontrolled, setUncontrolled] = useState(defaultOpen ?? false);
|
|
2608
2894
|
const isOpen = open ?? uncontrolled;
|
|
2609
2895
|
const shouldAnimate = useAnimate(animate);
|
|
2610
|
-
const
|
|
2896
|
+
const theme = useSketchTheme(sketchColor);
|
|
2897
|
+
const color = sketchColor ?? theme[variant];
|
|
2898
|
+
const defaultFill = theme.isDark ? DARK_VARIANT_FILL2[variant] : LIGHT_VARIANT_FILL2[variant];
|
|
2899
|
+
const resolvedFill = fill ?? defaultFill;
|
|
2611
2900
|
const offset = fromTop ? -14 : 14;
|
|
2612
2901
|
function handleOpenChange(next) {
|
|
2613
2902
|
setUncontrolled(next);
|
|
@@ -2642,11 +2931,14 @@ function Toast({
|
|
|
2642
2931
|
sketchColor: color,
|
|
2643
2932
|
bowing,
|
|
2644
2933
|
fillStyle: fillStyle ?? "hachure",
|
|
2645
|
-
fill:
|
|
2934
|
+
fill: resolvedFill,
|
|
2646
2935
|
strokeWidth: strokeWidth ?? 1.7,
|
|
2936
|
+
hachureGap: hachureGap ?? 9,
|
|
2937
|
+
hachureAngle,
|
|
2938
|
+
fillWeight: fillWeight ?? 0.85,
|
|
2647
2939
|
shadow: true,
|
|
2648
2940
|
animate,
|
|
2649
|
-
contentStyle: { padding: "12px 16px" },
|
|
2941
|
+
contentStyle: { padding: "12px 16px", color: theme.ink },
|
|
2650
2942
|
children: [
|
|
2651
2943
|
title ? /* @__PURE__ */ jsx(
|
|
2652
2944
|
ToastPrimitive.Title,
|
|
@@ -2670,7 +2962,7 @@ function Toast({
|
|
|
2670
2962
|
fontSize: 14,
|
|
2671
2963
|
lineHeight: 1.5,
|
|
2672
2964
|
fontFamily: doodleUiFontFamily,
|
|
2673
|
-
color:
|
|
2965
|
+
color: theme.ink
|
|
2674
2966
|
},
|
|
2675
2967
|
children
|
|
2676
2968
|
}
|
|
@@ -2715,19 +3007,26 @@ var Accordion = forwardRef(
|
|
|
2715
3007
|
sketchColor,
|
|
2716
3008
|
bowing,
|
|
2717
3009
|
fillStyle,
|
|
2718
|
-
strokeWidth
|
|
3010
|
+
strokeWidth,
|
|
3011
|
+
hachureGap,
|
|
3012
|
+
hachureAngle,
|
|
3013
|
+
fillWeight
|
|
2719
3014
|
}, ref) {
|
|
2720
3015
|
const resolvedSeed = useResolvedSeed(seed);
|
|
2721
|
-
const
|
|
3016
|
+
const theme = useSketchTheme(sketchColor);
|
|
3017
|
+
const ink = sketchColor ?? theme.ink;
|
|
2722
3018
|
const [uncontrolled, setUncontrolled] = useState(defaultValue ?? (type === "multiple" ? [] : void 0));
|
|
2723
3019
|
const openValue = value ?? uncontrolled;
|
|
2724
3020
|
const sketchValue = {
|
|
2725
3021
|
roughness,
|
|
2726
3022
|
seed: resolvedSeed,
|
|
2727
|
-
sketchColor,
|
|
3023
|
+
sketchColor: ink,
|
|
2728
3024
|
bowing,
|
|
2729
3025
|
fillStyle,
|
|
2730
3026
|
strokeWidth,
|
|
3027
|
+
hachureGap,
|
|
3028
|
+
hachureAngle,
|
|
3029
|
+
fillWeight,
|
|
2731
3030
|
resolvedSeed,
|
|
2732
3031
|
ink,
|
|
2733
3032
|
openValue
|
|
@@ -2890,11 +3189,6 @@ var AccordionContent = forwardRef(function AccordionContent2({ className, style,
|
|
|
2890
3189
|
}
|
|
2891
3190
|
);
|
|
2892
3191
|
});
|
|
2893
|
-
var STATUS_COLOR = {
|
|
2894
|
-
online: SKETCH_COLORS.success,
|
|
2895
|
-
offline: "#8a8680",
|
|
2896
|
-
busy: SKETCH_COLORS.accent
|
|
2897
|
-
};
|
|
2898
3192
|
var Avatar = forwardRef(
|
|
2899
3193
|
function Avatar2({
|
|
2900
3194
|
className,
|
|
@@ -2905,18 +3199,28 @@ var Avatar = forwardRef(
|
|
|
2905
3199
|
size = 40,
|
|
2906
3200
|
shape = "circle",
|
|
2907
3201
|
status,
|
|
3202
|
+
fill,
|
|
2908
3203
|
roughness,
|
|
2909
3204
|
seed,
|
|
2910
3205
|
sketchColor,
|
|
2911
3206
|
bowing,
|
|
2912
3207
|
fillStyle,
|
|
2913
3208
|
strokeWidth,
|
|
3209
|
+
hachureGap,
|
|
3210
|
+
hachureAngle,
|
|
3211
|
+
fillWeight,
|
|
2914
3212
|
...rest
|
|
2915
3213
|
}, ref) {
|
|
2916
|
-
const
|
|
3214
|
+
const theme = useSketchTheme(sketchColor);
|
|
3215
|
+
const ink = sketchColor ?? theme.ink;
|
|
2917
3216
|
const resolvedSeed = useResolvedSeed(seed);
|
|
2918
3217
|
const roughShape = shape === "circle" ? "ellipse" : "rectangle";
|
|
2919
3218
|
const badge = 12;
|
|
3219
|
+
const statusColors = {
|
|
3220
|
+
online: theme.success,
|
|
3221
|
+
offline: theme.isDark ? "#9ca3af" : "#8a8680",
|
|
3222
|
+
busy: theme.accent
|
|
3223
|
+
};
|
|
2920
3224
|
const rootStyle = {
|
|
2921
3225
|
position: "relative",
|
|
2922
3226
|
display: "inline-flex",
|
|
@@ -2943,8 +3247,11 @@ var Avatar = forwardRef(
|
|
|
2943
3247
|
sketchColor: ink,
|
|
2944
3248
|
bowing,
|
|
2945
3249
|
fillStyle: fillStyle ?? "solid",
|
|
2946
|
-
fill:
|
|
3250
|
+
fill: fill ?? theme.paper,
|
|
2947
3251
|
strokeWidth: strokeWidth ?? 1.6,
|
|
3252
|
+
hachureGap,
|
|
3253
|
+
hachureAngle,
|
|
3254
|
+
fillWeight,
|
|
2948
3255
|
inset: 1.5
|
|
2949
3256
|
}
|
|
2950
3257
|
),
|
|
@@ -2988,7 +3295,7 @@ var Avatar = forwardRef(
|
|
|
2988
3295
|
fontWeight: doodleUiFontWeight(650),
|
|
2989
3296
|
fontSize: Math.max(12, size * 0.36),
|
|
2990
3297
|
color: ink,
|
|
2991
|
-
background:
|
|
3298
|
+
background: theme.secondaryFill
|
|
2992
3299
|
},
|
|
2993
3300
|
children: fallback
|
|
2994
3301
|
}
|
|
@@ -3013,8 +3320,8 @@ var Avatar = forwardRef(
|
|
|
3013
3320
|
shape: "ellipse",
|
|
3014
3321
|
roughness: (roughness ?? 1.5) * 0.8,
|
|
3015
3322
|
seed: deriveSeed(resolvedSeed, "status"),
|
|
3016
|
-
sketchColor:
|
|
3017
|
-
fill:
|
|
3323
|
+
sketchColor: statusColors[status],
|
|
3324
|
+
fill: statusColors[status],
|
|
3018
3325
|
fillStyle: "solid",
|
|
3019
3326
|
bowing,
|
|
3020
3327
|
strokeWidth: 1,
|
|
@@ -3031,16 +3338,23 @@ var Avatar = forwardRef(
|
|
|
3031
3338
|
var Slider = forwardRef(function Slider2({
|
|
3032
3339
|
className,
|
|
3033
3340
|
style,
|
|
3341
|
+
fill,
|
|
3034
3342
|
roughness,
|
|
3035
3343
|
seed,
|
|
3036
3344
|
sketchColor,
|
|
3037
3345
|
bowing,
|
|
3038
3346
|
fillStyle,
|
|
3039
3347
|
strokeWidth,
|
|
3348
|
+
hachureGap,
|
|
3349
|
+
hachureAngle,
|
|
3350
|
+
fillWeight,
|
|
3040
3351
|
thumbShape = "circle",
|
|
3041
3352
|
...rest
|
|
3042
3353
|
}, ref) {
|
|
3043
|
-
const
|
|
3354
|
+
const theme = useSketchTheme(sketchColor);
|
|
3355
|
+
const ink = sketchColor ?? theme.ink;
|
|
3356
|
+
const accent = sketchColor ?? theme.accent;
|
|
3357
|
+
const trackInk = sketchColor ?? (theme.isDark ? "rgba(243, 244, 246, 0.4)" : theme.ink);
|
|
3044
3358
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3045
3359
|
return /* @__PURE__ */ jsxs(
|
|
3046
3360
|
SliderPrimitive.Root,
|
|
@@ -3055,6 +3369,7 @@ var Slider = forwardRef(function Slider2({
|
|
|
3055
3369
|
height: 28,
|
|
3056
3370
|
userSelect: "none",
|
|
3057
3371
|
touchAction: "none",
|
|
3372
|
+
color: ink,
|
|
3058
3373
|
...style
|
|
3059
3374
|
},
|
|
3060
3375
|
...rest,
|
|
@@ -3074,7 +3389,7 @@ var Slider = forwardRef(function Slider2({
|
|
|
3074
3389
|
shape: "line",
|
|
3075
3390
|
roughness: roughness ?? 1.8,
|
|
3076
3391
|
seed: resolvedSeed,
|
|
3077
|
-
sketchColor:
|
|
3392
|
+
sketchColor: trackInk,
|
|
3078
3393
|
bowing: bowing ?? 2,
|
|
3079
3394
|
strokeWidth: strokeWidth ?? 1.6,
|
|
3080
3395
|
inset: 4
|
|
@@ -3094,7 +3409,7 @@ var Slider = forwardRef(function Slider2({
|
|
|
3094
3409
|
shape: "line",
|
|
3095
3410
|
roughness: (roughness ?? 1.5) + 0.4,
|
|
3096
3411
|
seed: deriveSeed(resolvedSeed, "range"),
|
|
3097
|
-
sketchColor:
|
|
3412
|
+
sketchColor: accent,
|
|
3098
3413
|
bowing: bowing ?? 1.6,
|
|
3099
3414
|
strokeWidth: (strokeWidth ?? 1.6) + 0.6,
|
|
3100
3415
|
inset: 4
|
|
@@ -3122,11 +3437,14 @@ var Slider = forwardRef(function Slider2({
|
|
|
3122
3437
|
shape: thumbShape === "square" ? "rectangle" : "ellipse",
|
|
3123
3438
|
roughness: (roughness ?? 1.5) * 0.85,
|
|
3124
3439
|
seed: deriveSeed(resolvedSeed, "thumb"),
|
|
3125
|
-
sketchColor:
|
|
3126
|
-
fill:
|
|
3440
|
+
sketchColor: accent,
|
|
3441
|
+
fill: fill ?? theme.paper,
|
|
3127
3442
|
fillStyle: fillStyle ?? "solid",
|
|
3128
3443
|
bowing,
|
|
3129
3444
|
strokeWidth: (strokeWidth ?? 1.5) + 0.3,
|
|
3445
|
+
hachureGap,
|
|
3446
|
+
hachureAngle,
|
|
3447
|
+
fillWeight,
|
|
3130
3448
|
inset: 1
|
|
3131
3449
|
}
|
|
3132
3450
|
)
|
|
@@ -3165,7 +3483,10 @@ var Pagination = forwardRef(
|
|
|
3165
3483
|
strokeWidth,
|
|
3166
3484
|
...rest
|
|
3167
3485
|
}, ref) {
|
|
3168
|
-
const
|
|
3486
|
+
const theme = useSketchTheme(sketchColor);
|
|
3487
|
+
const ink = sketchColor ?? theme.ink;
|
|
3488
|
+
const accent = sketchColor ?? theme.accent;
|
|
3489
|
+
const accentFill = theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill;
|
|
3169
3490
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3170
3491
|
const items = pageItems(page, count);
|
|
3171
3492
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3178,6 +3499,7 @@ var Pagination = forwardRef(
|
|
|
3178
3499
|
display: "inline-flex",
|
|
3179
3500
|
alignItems: "center",
|
|
3180
3501
|
gap: 4,
|
|
3502
|
+
color: ink,
|
|
3181
3503
|
...style
|
|
3182
3504
|
},
|
|
3183
3505
|
...rest,
|
|
@@ -3191,6 +3513,9 @@ var Pagination = forwardRef(
|
|
|
3191
3513
|
roughness,
|
|
3192
3514
|
seed: deriveSeed(resolvedSeed, "prev"),
|
|
3193
3515
|
ink,
|
|
3516
|
+
accent,
|
|
3517
|
+
accentFill,
|
|
3518
|
+
isDark: theme.isDark,
|
|
3194
3519
|
bowing,
|
|
3195
3520
|
strokeWidth,
|
|
3196
3521
|
children: /* @__PURE__ */ jsx("span", { style: { position: "relative", width: 16, height: 16, display: "block" }, children: /* @__PURE__ */ jsx(
|
|
@@ -3230,6 +3555,9 @@ var Pagination = forwardRef(
|
|
|
3230
3555
|
roughness,
|
|
3231
3556
|
seed: deriveSeed(resolvedSeed, `page-${item}`),
|
|
3232
3557
|
ink,
|
|
3558
|
+
accent,
|
|
3559
|
+
accentFill,
|
|
3560
|
+
isDark: theme.isDark,
|
|
3233
3561
|
bowing,
|
|
3234
3562
|
strokeWidth,
|
|
3235
3563
|
children: item
|
|
@@ -3246,6 +3574,9 @@ var Pagination = forwardRef(
|
|
|
3246
3574
|
roughness,
|
|
3247
3575
|
seed: deriveSeed(resolvedSeed, "next"),
|
|
3248
3576
|
ink,
|
|
3577
|
+
accent,
|
|
3578
|
+
accentFill,
|
|
3579
|
+
isDark: theme.isDark,
|
|
3249
3580
|
bowing,
|
|
3250
3581
|
strokeWidth,
|
|
3251
3582
|
children: /* @__PURE__ */ jsx("span", { style: { position: "relative", width: 16, height: 16, display: "block" }, children: /* @__PURE__ */ jsx(
|
|
@@ -3276,10 +3607,15 @@ function PageButton({
|
|
|
3276
3607
|
roughness,
|
|
3277
3608
|
seed,
|
|
3278
3609
|
ink,
|
|
3610
|
+
accent,
|
|
3611
|
+
accentFill,
|
|
3612
|
+
isDark,
|
|
3279
3613
|
bowing,
|
|
3280
3614
|
strokeWidth,
|
|
3281
3615
|
...rest
|
|
3282
3616
|
}) {
|
|
3617
|
+
const activeColor = accent ?? ink;
|
|
3618
|
+
const textColor = active ? isDark ? "#ffffff" : activeColor : ink;
|
|
3283
3619
|
return /* @__PURE__ */ jsxs(
|
|
3284
3620
|
"button",
|
|
3285
3621
|
{
|
|
@@ -3294,7 +3630,7 @@ function PageButton({
|
|
|
3294
3630
|
border: "none",
|
|
3295
3631
|
background: "transparent",
|
|
3296
3632
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
3297
|
-
color:
|
|
3633
|
+
color: textColor,
|
|
3298
3634
|
fontFamily: doodleUiFontFamily,
|
|
3299
3635
|
fontWeight: active ? doodleUiFontWeight(700) : doodleUiFontWeight(400),
|
|
3300
3636
|
fontSize: 14,
|
|
@@ -3310,9 +3646,9 @@ function PageButton({
|
|
|
3310
3646
|
shape: "ellipse",
|
|
3311
3647
|
roughness,
|
|
3312
3648
|
seed,
|
|
3313
|
-
sketchColor: active ?
|
|
3649
|
+
sketchColor: active ? activeColor : ink,
|
|
3314
3650
|
bowing,
|
|
3315
|
-
fill: active ?
|
|
3651
|
+
fill: active ? accentFill : void 0,
|
|
3316
3652
|
fillStyle: active ? "hachure" : void 0,
|
|
3317
3653
|
strokeWidth: active ? (strokeWidth ?? 1.6) + 0.3 : strokeWidth ?? 1.4,
|
|
3318
3654
|
inset: 1.5
|
|
@@ -3324,7 +3660,7 @@ function PageButton({
|
|
|
3324
3660
|
shape: "ellipse",
|
|
3325
3661
|
roughness: (roughness ?? 1.5) + 0.45,
|
|
3326
3662
|
seed,
|
|
3327
|
-
sketchColor:
|
|
3663
|
+
sketchColor: activeColor,
|
|
3328
3664
|
bowing: bowing ?? 1.6,
|
|
3329
3665
|
strokeWidth: 1.1,
|
|
3330
3666
|
inset: -1.5,
|
|
@@ -3357,9 +3693,13 @@ var Breadcrumb = forwardRef(
|
|
|
3357
3693
|
sketchColor,
|
|
3358
3694
|
bowing,
|
|
3359
3695
|
strokeWidth,
|
|
3696
|
+
hachureGap,
|
|
3697
|
+
hachureAngle,
|
|
3698
|
+
fillWeight,
|
|
3360
3699
|
...rest
|
|
3361
3700
|
}, ref) {
|
|
3362
|
-
const
|
|
3701
|
+
const theme = useSketchTheme(sketchColor);
|
|
3702
|
+
const ink = sketchColor ?? theme.ink;
|
|
3363
3703
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3364
3704
|
const items = Children.toArray(children).filter(isValidElement);
|
|
3365
3705
|
return /* @__PURE__ */ jsx(
|
|
@@ -3368,9 +3708,12 @@ var Breadcrumb = forwardRef(
|
|
|
3368
3708
|
value: {
|
|
3369
3709
|
roughness,
|
|
3370
3710
|
seed: resolvedSeed,
|
|
3371
|
-
sketchColor,
|
|
3711
|
+
sketchColor: ink,
|
|
3372
3712
|
bowing,
|
|
3373
3713
|
strokeWidth,
|
|
3714
|
+
hachureGap,
|
|
3715
|
+
hachureAngle,
|
|
3716
|
+
fillWeight,
|
|
3374
3717
|
resolvedSeed,
|
|
3375
3718
|
ink,
|
|
3376
3719
|
separator
|
|
@@ -3509,11 +3852,15 @@ var Skeleton = forwardRef(
|
|
|
3509
3852
|
bowing,
|
|
3510
3853
|
fillStyle,
|
|
3511
3854
|
strokeWidth,
|
|
3855
|
+
hachureGap,
|
|
3856
|
+
hachureAngle,
|
|
3857
|
+
fillWeight,
|
|
3512
3858
|
...rest
|
|
3513
3859
|
}, ref) {
|
|
3514
3860
|
const base = useResolvedSeed(seed);
|
|
3515
3861
|
const [tick, setTick] = useState(0);
|
|
3516
|
-
const
|
|
3862
|
+
const theme = useSketchTheme(sketchColor);
|
|
3863
|
+
const ink = sketchColor ?? theme.ink;
|
|
3517
3864
|
useEffect(() => {
|
|
3518
3865
|
if (!pulse) return;
|
|
3519
3866
|
const id = window.setInterval(() => {
|
|
@@ -3550,6 +3897,9 @@ var Skeleton = forwardRef(
|
|
|
3550
3897
|
fillStyle: fillStyle ?? "hachure",
|
|
3551
3898
|
bowing: bowing ?? 1.6,
|
|
3552
3899
|
strokeWidth: strokeWidth ?? 1.1,
|
|
3900
|
+
hachureGap,
|
|
3901
|
+
hachureAngle,
|
|
3902
|
+
fillWeight,
|
|
3553
3903
|
inset: 2,
|
|
3554
3904
|
style: { opacity: 0.28 }
|
|
3555
3905
|
}
|
|
@@ -3570,15 +3920,21 @@ var Stepper = forwardRef(
|
|
|
3570
3920
|
steps,
|
|
3571
3921
|
current = 0,
|
|
3572
3922
|
orientation = "horizontal",
|
|
3923
|
+
fill,
|
|
3573
3924
|
roughness,
|
|
3574
3925
|
seed,
|
|
3575
3926
|
sketchColor,
|
|
3576
3927
|
bowing,
|
|
3577
3928
|
fillStyle,
|
|
3578
3929
|
strokeWidth,
|
|
3930
|
+
hachureGap,
|
|
3931
|
+
hachureAngle,
|
|
3932
|
+
fillWeight,
|
|
3579
3933
|
...rest
|
|
3580
3934
|
}, ref) {
|
|
3581
|
-
const
|
|
3935
|
+
const theme = useSketchTheme(sketchColor);
|
|
3936
|
+
const ink = sketchColor ?? theme.ink;
|
|
3937
|
+
const accent = sketchColor ?? theme.accent;
|
|
3582
3938
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3583
3939
|
const items = normalizeSteps(steps);
|
|
3584
3940
|
const horizontal = orientation === "horizontal";
|
|
@@ -3592,13 +3948,15 @@ var Stepper = forwardRef(
|
|
|
3592
3948
|
display: "flex",
|
|
3593
3949
|
flexDirection: horizontal ? "row" : "column",
|
|
3594
3950
|
alignItems: horizontal ? "flex-start" : "stretch",
|
|
3951
|
+
color: ink,
|
|
3595
3952
|
...style
|
|
3596
3953
|
},
|
|
3597
3954
|
...rest,
|
|
3598
3955
|
children: items.map((step, index) => {
|
|
3599
3956
|
const complete = index < current;
|
|
3600
3957
|
const active = index === current;
|
|
3601
|
-
const markerColor = complete || active ?
|
|
3958
|
+
const markerColor = complete || active ? accent : ink;
|
|
3959
|
+
const completeFill = theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill;
|
|
3602
3960
|
return /* @__PURE__ */ jsxs(
|
|
3603
3961
|
"div",
|
|
3604
3962
|
{
|
|
@@ -3646,10 +4004,13 @@ var Stepper = forwardRef(
|
|
|
3646
4004
|
roughness,
|
|
3647
4005
|
seed: deriveSeed(resolvedSeed, `step-${index}`),
|
|
3648
4006
|
sketchColor: markerColor,
|
|
3649
|
-
fill: complete ?
|
|
4007
|
+
fill: complete ? completeFill : active ? fill ?? theme.paper : void 0,
|
|
3650
4008
|
fillStyle: complete || active ? fillStyle ?? "hachure" : void 0,
|
|
3651
4009
|
bowing,
|
|
3652
4010
|
strokeWidth: active ? (strokeWidth ?? 1.6) + 0.4 : strokeWidth ?? 1.5,
|
|
4011
|
+
hachureGap,
|
|
4012
|
+
hachureAngle,
|
|
4013
|
+
fillWeight,
|
|
3653
4014
|
inset: 1.5
|
|
3654
4015
|
}
|
|
3655
4016
|
),
|
|
@@ -3674,7 +4035,7 @@ var Stepper = forwardRef(
|
|
|
3674
4035
|
shape: horizontal ? "line" : "line-vertical",
|
|
3675
4036
|
roughness: (roughness ?? 1.5) + 0.3,
|
|
3676
4037
|
seed: deriveSeed(resolvedSeed, `connector-${index}`),
|
|
3677
|
-
sketchColor: complete ?
|
|
4038
|
+
sketchColor: complete ? accent : theme.isDark ? "rgba(243, 244, 246, 0.35)" : ink,
|
|
3678
4039
|
bowing: bowing ?? 2,
|
|
3679
4040
|
strokeWidth: strokeWidth ?? 1.4,
|
|
3680
4041
|
inset: 2
|
|
@@ -3722,10 +4083,14 @@ var Label2 = forwardRef(function Label3({
|
|
|
3722
4083
|
sketchColor,
|
|
3723
4084
|
bowing,
|
|
3724
4085
|
strokeWidth,
|
|
4086
|
+
hachureGap,
|
|
4087
|
+
hachureAngle,
|
|
4088
|
+
fillWeight,
|
|
3725
4089
|
animate,
|
|
3726
4090
|
...rest
|
|
3727
4091
|
}, ref) {
|
|
3728
|
-
const
|
|
4092
|
+
const theme = useSketchTheme(sketchColor);
|
|
4093
|
+
const ink = sketchColor ?? theme.ink;
|
|
3729
4094
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3730
4095
|
const shouldAnimate = useAnimate(animate);
|
|
3731
4096
|
const markRef = useRef(null);
|
|
@@ -3761,11 +4126,14 @@ var Label2 = forwardRef(function Label3({
|
|
|
3761
4126
|
shape: "ellipse",
|
|
3762
4127
|
roughness: (roughness ?? 1.5) * 0.9,
|
|
3763
4128
|
seed: resolvedSeed,
|
|
3764
|
-
sketchColor:
|
|
4129
|
+
sketchColor: theme.accent,
|
|
3765
4130
|
bowing,
|
|
3766
4131
|
fillStyle: "solid",
|
|
3767
|
-
fill:
|
|
4132
|
+
fill: theme.accent,
|
|
3768
4133
|
strokeWidth: strokeWidth ?? 1.2,
|
|
4134
|
+
hachureGap,
|
|
4135
|
+
hachureAngle,
|
|
4136
|
+
fillWeight,
|
|
3769
4137
|
inset: 1
|
|
3770
4138
|
}
|
|
3771
4139
|
)
|
|
@@ -3801,10 +4169,14 @@ var Collapsible = forwardRef(
|
|
|
3801
4169
|
bowing,
|
|
3802
4170
|
fillStyle,
|
|
3803
4171
|
strokeWidth,
|
|
4172
|
+
hachureGap,
|
|
4173
|
+
hachureAngle,
|
|
4174
|
+
fillWeight,
|
|
3804
4175
|
...rest
|
|
3805
4176
|
}, ref) {
|
|
3806
4177
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3807
|
-
const
|
|
4178
|
+
const theme = useSketchTheme(sketchColor);
|
|
4179
|
+
const ink = sketchColor ?? theme.ink;
|
|
3808
4180
|
const [uncontrolled, setUncontrolled] = useState(defaultOpen ?? false);
|
|
3809
4181
|
const isOpen = open ?? uncontrolled;
|
|
3810
4182
|
return /* @__PURE__ */ jsx(
|
|
@@ -3813,10 +4185,13 @@ var Collapsible = forwardRef(
|
|
|
3813
4185
|
value: {
|
|
3814
4186
|
roughness,
|
|
3815
4187
|
seed: resolvedSeed,
|
|
3816
|
-
sketchColor,
|
|
4188
|
+
sketchColor: ink,
|
|
3817
4189
|
bowing,
|
|
3818
4190
|
fillStyle,
|
|
3819
4191
|
strokeWidth,
|
|
4192
|
+
hachureGap,
|
|
4193
|
+
hachureAngle,
|
|
4194
|
+
fillWeight,
|
|
3820
4195
|
resolvedSeed,
|
|
3821
4196
|
ink,
|
|
3822
4197
|
open: isOpen
|
|
@@ -3931,17 +4306,22 @@ function usePopoverSketch() {
|
|
|
3931
4306
|
}
|
|
3932
4307
|
function Popover({
|
|
3933
4308
|
children,
|
|
4309
|
+
fill,
|
|
3934
4310
|
roughness,
|
|
3935
4311
|
seed,
|
|
3936
4312
|
sketchColor,
|
|
3937
4313
|
bowing,
|
|
3938
4314
|
fillStyle,
|
|
3939
4315
|
strokeWidth,
|
|
4316
|
+
hachureGap,
|
|
4317
|
+
hachureAngle,
|
|
4318
|
+
fillWeight,
|
|
3940
4319
|
animate,
|
|
3941
4320
|
...rest
|
|
3942
4321
|
}) {
|
|
3943
4322
|
const resolvedSeed = useResolvedSeed(seed);
|
|
3944
|
-
const
|
|
4323
|
+
const theme = useSketchTheme(sketchColor);
|
|
4324
|
+
const ink = sketchColor ?? theme.ink;
|
|
3945
4325
|
return /* @__PURE__ */ jsx(
|
|
3946
4326
|
PopoverSketchContext.Provider,
|
|
3947
4327
|
{
|
|
@@ -3952,8 +4332,12 @@ function Popover({
|
|
|
3952
4332
|
bowing,
|
|
3953
4333
|
fillStyle,
|
|
3954
4334
|
strokeWidth,
|
|
4335
|
+
hachureGap,
|
|
4336
|
+
hachureAngle,
|
|
4337
|
+
fillWeight,
|
|
3955
4338
|
resolvedSeed,
|
|
3956
4339
|
ink,
|
|
4340
|
+
paper: fill ?? theme.paper,
|
|
3957
4341
|
animate
|
|
3958
4342
|
},
|
|
3959
4343
|
children: /* @__PURE__ */ jsx(PopoverPrimitive.Root, { ...rest, children })
|
|
@@ -3964,7 +4348,7 @@ var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
|
3964
4348
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
3965
4349
|
var PopoverClose = PopoverPrimitive.Close;
|
|
3966
4350
|
var PopoverContent = forwardRef(
|
|
3967
|
-
function PopoverContent2({ className, style, children, sideOffset = 8, ...rest }, ref) {
|
|
4351
|
+
function PopoverContent2({ className, style, children, fill, sideOffset = 8, ...rest }, ref) {
|
|
3968
4352
|
const sketch = usePopoverSketch();
|
|
3969
4353
|
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3970
4354
|
PopoverPrimitive.Content,
|
|
@@ -3972,7 +4356,7 @@ var PopoverContent = forwardRef(
|
|
|
3972
4356
|
ref,
|
|
3973
4357
|
sideOffset,
|
|
3974
4358
|
className: cn(className),
|
|
3975
|
-
style: { zIndex: 80, outline: "none", ...style },
|
|
4359
|
+
style: { zIndex: 80, outline: "none", color: sketch.ink, ...style },
|
|
3976
4360
|
...rest,
|
|
3977
4361
|
children: /* @__PURE__ */ jsx(
|
|
3978
4362
|
SketchBox,
|
|
@@ -3982,11 +4366,14 @@ var PopoverContent = forwardRef(
|
|
|
3982
4366
|
sketchColor: sketch.ink,
|
|
3983
4367
|
bowing: sketch.bowing,
|
|
3984
4368
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
3985
|
-
fill:
|
|
4369
|
+
fill: fill ?? sketch.paper,
|
|
3986
4370
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
4371
|
+
hachureGap: sketch.hachureGap,
|
|
4372
|
+
hachureAngle: sketch.hachureAngle,
|
|
4373
|
+
fillWeight: sketch.fillWeight,
|
|
3987
4374
|
shadow: true,
|
|
3988
4375
|
animate: sketch.animate,
|
|
3989
|
-
contentStyle: { padding: "14px 16px", minWidth: 200 },
|
|
4376
|
+
contentStyle: { padding: "14px 16px", minWidth: 200, color: sketch.ink },
|
|
3990
4377
|
children
|
|
3991
4378
|
}
|
|
3992
4379
|
)
|
|
@@ -3994,12 +4381,9 @@ var PopoverContent = forwardRef(
|
|
|
3994
4381
|
) });
|
|
3995
4382
|
}
|
|
3996
4383
|
);
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Arrow, { ref, fill: sketch.ink, ...props });
|
|
4001
|
-
}
|
|
4002
|
-
);
|
|
4384
|
+
function PopoverArrow(props) {
|
|
4385
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Arrow, { ...props });
|
|
4386
|
+
}
|
|
4003
4387
|
var DropdownMenuSketchContext = createContext(null);
|
|
4004
4388
|
function useDropdownMenuSketch() {
|
|
4005
4389
|
const ctx = useContext(DropdownMenuSketchContext);
|
|
@@ -4012,17 +4396,22 @@ function useDropdownMenuSketch() {
|
|
|
4012
4396
|
}
|
|
4013
4397
|
function DropdownMenu({
|
|
4014
4398
|
children,
|
|
4399
|
+
fill,
|
|
4015
4400
|
roughness,
|
|
4016
4401
|
seed,
|
|
4017
4402
|
sketchColor,
|
|
4018
4403
|
bowing,
|
|
4019
4404
|
fillStyle,
|
|
4020
4405
|
strokeWidth,
|
|
4406
|
+
hachureGap,
|
|
4407
|
+
hachureAngle,
|
|
4408
|
+
fillWeight,
|
|
4021
4409
|
animate,
|
|
4022
4410
|
...rest
|
|
4023
4411
|
}) {
|
|
4024
4412
|
const resolvedSeed = useResolvedSeed(seed);
|
|
4025
|
-
const
|
|
4413
|
+
const theme = useSketchTheme(sketchColor);
|
|
4414
|
+
const ink = sketchColor ?? theme.ink;
|
|
4026
4415
|
return /* @__PURE__ */ jsx(
|
|
4027
4416
|
DropdownMenuSketchContext.Provider,
|
|
4028
4417
|
{
|
|
@@ -4033,8 +4422,13 @@ function DropdownMenu({
|
|
|
4033
4422
|
bowing,
|
|
4034
4423
|
fillStyle,
|
|
4035
4424
|
strokeWidth,
|
|
4425
|
+
hachureGap,
|
|
4426
|
+
hachureAngle,
|
|
4427
|
+
fillWeight,
|
|
4036
4428
|
resolvedSeed,
|
|
4037
4429
|
ink,
|
|
4430
|
+
paper: fill ?? theme.paper,
|
|
4431
|
+
accent: theme.accent,
|
|
4038
4432
|
animate
|
|
4039
4433
|
},
|
|
4040
4434
|
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { ...rest, children })
|
|
@@ -4045,7 +4439,7 @@ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
|
4045
4439
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
4046
4440
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
4047
4441
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
4048
|
-
var DropdownMenuContent = forwardRef(function DropdownMenuContent2({ className, style, children, sideOffset = 6, align = "start", ...rest }, ref) {
|
|
4442
|
+
var DropdownMenuContent = forwardRef(function DropdownMenuContent2({ className, style, children, fill, sideOffset = 6, align = "start", ...rest }, ref) {
|
|
4049
4443
|
const sketch = useDropdownMenuSketch();
|
|
4050
4444
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
4051
4445
|
DropdownMenuPrimitive.Content,
|
|
@@ -4054,7 +4448,7 @@ var DropdownMenuContent = forwardRef(function DropdownMenuContent2({ className,
|
|
|
4054
4448
|
sideOffset,
|
|
4055
4449
|
align,
|
|
4056
4450
|
className: cn(className),
|
|
4057
|
-
style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
|
|
4451
|
+
style: { zIndex: 80, outline: "none", minWidth: 180, color: sketch.ink, ...style },
|
|
4058
4452
|
...rest,
|
|
4059
4453
|
children: /* @__PURE__ */ jsx(
|
|
4060
4454
|
SketchBox,
|
|
@@ -4064,11 +4458,14 @@ var DropdownMenuContent = forwardRef(function DropdownMenuContent2({ className,
|
|
|
4064
4458
|
sketchColor: sketch.ink,
|
|
4065
4459
|
bowing: sketch.bowing,
|
|
4066
4460
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
4067
|
-
fill:
|
|
4461
|
+
fill: fill ?? sketch.paper,
|
|
4068
4462
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
4463
|
+
hachureGap: sketch.hachureGap,
|
|
4464
|
+
hachureAngle: sketch.hachureAngle,
|
|
4465
|
+
fillWeight: sketch.fillWeight,
|
|
4069
4466
|
shadow: true,
|
|
4070
4467
|
animate: sketch.animate,
|
|
4071
|
-
contentStyle: { padding: "6px 4px" },
|
|
4468
|
+
contentStyle: { padding: "6px 4px", color: sketch.ink },
|
|
4072
4469
|
children
|
|
4073
4470
|
}
|
|
4074
4471
|
)
|
|
@@ -4183,7 +4580,7 @@ var DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({ c
|
|
|
4183
4580
|
path: CHECK_PATH2,
|
|
4184
4581
|
roughness: (sketch.roughness ?? 1.5) * 0.7,
|
|
4185
4582
|
seed: deriveSeed(sketch.resolvedSeed, "checkbox-mark"),
|
|
4186
|
-
sketchColor:
|
|
4583
|
+
sketchColor: sketch.accent,
|
|
4187
4584
|
bowing: sketch.bowing,
|
|
4188
4585
|
strokeWidth: 1.6,
|
|
4189
4586
|
inset: 0
|
|
@@ -4251,10 +4648,10 @@ var DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({ classNa
|
|
|
4251
4648
|
shape: "ellipse",
|
|
4252
4649
|
roughness: (sketch.roughness ?? 1.5) * 0.8,
|
|
4253
4650
|
seed: deriveSeed(sketch.resolvedSeed, "radio-mark"),
|
|
4254
|
-
sketchColor:
|
|
4651
|
+
sketchColor: sketch.accent,
|
|
4255
4652
|
bowing: sketch.bowing,
|
|
4256
4653
|
fillStyle: "solid",
|
|
4257
|
-
fill:
|
|
4654
|
+
fill: sketch.accent,
|
|
4258
4655
|
strokeWidth: 1.2,
|
|
4259
4656
|
inset: 0
|
|
4260
4657
|
}
|
|
@@ -4329,17 +4726,22 @@ function Dialog2({
|
|
|
4329
4726
|
open,
|
|
4330
4727
|
defaultOpen,
|
|
4331
4728
|
onOpenChange,
|
|
4729
|
+
fill,
|
|
4332
4730
|
roughness,
|
|
4333
4731
|
seed,
|
|
4334
4732
|
sketchColor,
|
|
4335
4733
|
bowing,
|
|
4336
4734
|
fillStyle,
|
|
4337
4735
|
strokeWidth,
|
|
4736
|
+
hachureGap,
|
|
4737
|
+
hachureAngle,
|
|
4738
|
+
fillWeight,
|
|
4338
4739
|
animate,
|
|
4339
4740
|
...rest
|
|
4340
4741
|
}) {
|
|
4341
4742
|
const resolvedSeed = useResolvedSeed(seed);
|
|
4342
|
-
const
|
|
4743
|
+
const theme = useSketchTheme(sketchColor);
|
|
4744
|
+
const ink = sketchColor ?? theme.ink;
|
|
4343
4745
|
const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
|
|
4344
4746
|
const isOpen = open ?? uncontrolled;
|
|
4345
4747
|
return /* @__PURE__ */ jsx(
|
|
@@ -4352,8 +4754,13 @@ function Dialog2({
|
|
|
4352
4754
|
bowing,
|
|
4353
4755
|
fillStyle,
|
|
4354
4756
|
strokeWidth,
|
|
4757
|
+
hachureGap,
|
|
4758
|
+
hachureAngle,
|
|
4759
|
+
fillWeight,
|
|
4355
4760
|
resolvedSeed,
|
|
4356
4761
|
ink,
|
|
4762
|
+
paper: fill ?? theme.paper,
|
|
4763
|
+
isDark: theme.isDark,
|
|
4357
4764
|
animate,
|
|
4358
4765
|
open: isOpen
|
|
4359
4766
|
},
|
|
@@ -4389,7 +4796,7 @@ var DialogOverlay = forwardRef(
|
|
|
4389
4796
|
style: {
|
|
4390
4797
|
position: "fixed",
|
|
4391
4798
|
inset: 0,
|
|
4392
|
-
background: "rgba(31, 29, 26, 0.38)",
|
|
4799
|
+
background: sketch.isDark ? "rgba(0, 0, 0, 0.65)" : "rgba(31, 29, 26, 0.38)",
|
|
4393
4800
|
zIndex: 70,
|
|
4394
4801
|
...style
|
|
4395
4802
|
}
|
|
@@ -4398,7 +4805,7 @@ var DialogOverlay = forwardRef(
|
|
|
4398
4805
|
}
|
|
4399
4806
|
);
|
|
4400
4807
|
var DialogContent = forwardRef(
|
|
4401
|
-
function DialogContent2({ className, style, contentStyle, children, ...rest }, ref) {
|
|
4808
|
+
function DialogContent2({ className, style, contentStyle, fill, children, ...rest }, ref) {
|
|
4402
4809
|
const sketch = useDialogSketch();
|
|
4403
4810
|
const shouldAnimate = useAnimate(sketch.animate);
|
|
4404
4811
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
|
|
@@ -4428,6 +4835,7 @@ var DialogContent = forwardRef(
|
|
|
4428
4835
|
width: "min(420px, calc(100vw - 32px))",
|
|
4429
4836
|
outline: "none",
|
|
4430
4837
|
pointerEvents: "auto",
|
|
4838
|
+
color: sketch.ink,
|
|
4431
4839
|
...style
|
|
4432
4840
|
},
|
|
4433
4841
|
children: /* @__PURE__ */ jsx(
|
|
@@ -4438,10 +4846,13 @@ var DialogContent = forwardRef(
|
|
|
4438
4846
|
sketchColor: sketch.ink,
|
|
4439
4847
|
bowing: sketch.bowing,
|
|
4440
4848
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
4441
|
-
fill:
|
|
4849
|
+
fill: fill ?? sketch.paper,
|
|
4442
4850
|
strokeWidth: sketch.strokeWidth ?? 2,
|
|
4851
|
+
hachureGap: sketch.hachureGap,
|
|
4852
|
+
hachureAngle: sketch.hachureAngle,
|
|
4853
|
+
fillWeight: sketch.fillWeight,
|
|
4443
4854
|
animate: sketch.animate,
|
|
4444
|
-
contentStyle: { padding: 20, ...contentStyle },
|
|
4855
|
+
contentStyle: { padding: 20, color: sketch.ink, ...contentStyle },
|
|
4445
4856
|
children
|
|
4446
4857
|
}
|
|
4447
4858
|
)
|
|
@@ -4538,17 +4949,22 @@ function AlertDialog({
|
|
|
4538
4949
|
open,
|
|
4539
4950
|
defaultOpen,
|
|
4540
4951
|
onOpenChange,
|
|
4952
|
+
fill,
|
|
4541
4953
|
roughness,
|
|
4542
4954
|
seed,
|
|
4543
4955
|
sketchColor,
|
|
4544
4956
|
bowing,
|
|
4545
4957
|
fillStyle,
|
|
4546
4958
|
strokeWidth,
|
|
4959
|
+
hachureGap,
|
|
4960
|
+
hachureAngle,
|
|
4961
|
+
fillWeight,
|
|
4547
4962
|
animate,
|
|
4548
4963
|
...rest
|
|
4549
4964
|
}) {
|
|
4550
4965
|
const resolvedSeed = useResolvedSeed(seed);
|
|
4551
|
-
const
|
|
4966
|
+
const theme = useSketchTheme(sketchColor);
|
|
4967
|
+
const ink = sketchColor ?? theme.ink;
|
|
4552
4968
|
const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
|
|
4553
4969
|
const isOpen = open ?? uncontrolled;
|
|
4554
4970
|
return /* @__PURE__ */ jsx(
|
|
@@ -4561,8 +4977,13 @@ function AlertDialog({
|
|
|
4561
4977
|
bowing,
|
|
4562
4978
|
fillStyle,
|
|
4563
4979
|
strokeWidth,
|
|
4980
|
+
hachureGap,
|
|
4981
|
+
hachureAngle,
|
|
4982
|
+
fillWeight,
|
|
4564
4983
|
resolvedSeed,
|
|
4565
4984
|
ink,
|
|
4985
|
+
paper: fill ?? theme.paper,
|
|
4986
|
+
isDark: theme.isDark,
|
|
4566
4987
|
animate,
|
|
4567
4988
|
open: isOpen
|
|
4568
4989
|
},
|
|
@@ -4596,14 +5017,14 @@ var AlertDialogOverlay = forwardRef(function AlertDialogOverlay2({ style, ...res
|
|
|
4596
5017
|
style: {
|
|
4597
5018
|
position: "fixed",
|
|
4598
5019
|
inset: 0,
|
|
4599
|
-
background: "rgba(31, 29, 26, 0.38)",
|
|
5020
|
+
background: sketch.isDark ? "rgba(0, 0, 0, 0.65)" : "rgba(31, 29, 26, 0.38)",
|
|
4600
5021
|
zIndex: 70,
|
|
4601
5022
|
...style
|
|
4602
5023
|
}
|
|
4603
5024
|
}
|
|
4604
5025
|
) });
|
|
4605
5026
|
});
|
|
4606
|
-
var AlertDialogContent = forwardRef(function AlertDialogContent2({ className, style, contentStyle, children, ...rest }, ref) {
|
|
5027
|
+
var AlertDialogContent = forwardRef(function AlertDialogContent2({ className, style, contentStyle, fill, children, ...rest }, ref) {
|
|
4607
5028
|
const sketch = useAlertDialogSketch();
|
|
4608
5029
|
const shouldAnimate = useAnimate(sketch.animate);
|
|
4609
5030
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { forceMount: true, children: [
|
|
@@ -4633,6 +5054,7 @@ var AlertDialogContent = forwardRef(function AlertDialogContent2({ className, st
|
|
|
4633
5054
|
width: "min(420px, calc(100vw - 32px))",
|
|
4634
5055
|
outline: "none",
|
|
4635
5056
|
pointerEvents: "auto",
|
|
5057
|
+
color: sketch.ink,
|
|
4636
5058
|
...style
|
|
4637
5059
|
},
|
|
4638
5060
|
children: /* @__PURE__ */ jsx(
|
|
@@ -4643,10 +5065,13 @@ var AlertDialogContent = forwardRef(function AlertDialogContent2({ className, st
|
|
|
4643
5065
|
sketchColor: sketch.ink,
|
|
4644
5066
|
bowing: sketch.bowing,
|
|
4645
5067
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
4646
|
-
fill:
|
|
5068
|
+
fill: fill ?? sketch.paper,
|
|
4647
5069
|
strokeWidth: sketch.strokeWidth ?? 2,
|
|
5070
|
+
hachureGap: sketch.hachureGap,
|
|
5071
|
+
hachureAngle: sketch.hachureAngle,
|
|
5072
|
+
fillWeight: sketch.fillWeight,
|
|
4648
5073
|
animate: sketch.animate,
|
|
4649
|
-
contentStyle: { padding: 20, ...contentStyle },
|
|
5074
|
+
contentStyle: { padding: 20, color: sketch.ink, ...contentStyle },
|
|
4650
5075
|
children
|
|
4651
5076
|
}
|
|
4652
5077
|
)
|
|
@@ -4788,11 +5213,15 @@ var Command = forwardRef(
|
|
|
4788
5213
|
bowing,
|
|
4789
5214
|
fillStyle,
|
|
4790
5215
|
strokeWidth,
|
|
5216
|
+
hachureGap,
|
|
5217
|
+
hachureAngle,
|
|
5218
|
+
fillWeight,
|
|
4791
5219
|
animate,
|
|
4792
5220
|
...rest
|
|
4793
5221
|
}, ref) {
|
|
4794
5222
|
const resolvedSeed = useResolvedSeed(seed);
|
|
4795
|
-
const
|
|
5223
|
+
const theme = useSketchTheme(sketchColor);
|
|
5224
|
+
const ink = sketchColor ?? theme.ink;
|
|
4796
5225
|
return /* @__PURE__ */ jsx(
|
|
4797
5226
|
CommandSketchContext.Provider,
|
|
4798
5227
|
{
|
|
@@ -4803,24 +5232,31 @@ var Command = forwardRef(
|
|
|
4803
5232
|
bowing,
|
|
4804
5233
|
fillStyle,
|
|
4805
5234
|
strokeWidth,
|
|
5235
|
+
hachureGap,
|
|
5236
|
+
hachureAngle,
|
|
5237
|
+
fillWeight,
|
|
4806
5238
|
resolvedSeed,
|
|
4807
5239
|
ink,
|
|
5240
|
+
paper: theme.paper,
|
|
4808
5241
|
animate
|
|
4809
5242
|
},
|
|
4810
5243
|
children: /* @__PURE__ */ jsx(
|
|
4811
5244
|
SketchBox,
|
|
4812
5245
|
{
|
|
4813
5246
|
className: cn(className),
|
|
4814
|
-
style,
|
|
5247
|
+
style: { color: ink, ...style },
|
|
4815
5248
|
roughness,
|
|
4816
5249
|
seed: resolvedSeed,
|
|
4817
5250
|
sketchColor: ink,
|
|
4818
5251
|
bowing,
|
|
4819
5252
|
fillStyle: fillStyle ?? "solid",
|
|
4820
|
-
fill:
|
|
5253
|
+
fill: theme.paper,
|
|
4821
5254
|
strokeWidth: strokeWidth ?? 1.5,
|
|
5255
|
+
hachureGap,
|
|
5256
|
+
hachureAngle,
|
|
5257
|
+
fillWeight,
|
|
4822
5258
|
animate,
|
|
4823
|
-
contentStyle: { padding: 0, display: "flex", flexDirection: "column" },
|
|
5259
|
+
contentStyle: { padding: 0, display: "flex", flexDirection: "column", color: ink },
|
|
4824
5260
|
children: /* @__PURE__ */ jsx(Command$1, { ref, ...rest, children })
|
|
4825
5261
|
}
|
|
4826
5262
|
)
|
|
@@ -5041,6 +5477,9 @@ function Combobox({
|
|
|
5041
5477
|
bowing,
|
|
5042
5478
|
fillStyle,
|
|
5043
5479
|
strokeWidth,
|
|
5480
|
+
hachureGap,
|
|
5481
|
+
hachureAngle,
|
|
5482
|
+
fillWeight,
|
|
5044
5483
|
animate,
|
|
5045
5484
|
"aria-label": ariaLabel
|
|
5046
5485
|
}) {
|
|
@@ -5050,7 +5489,8 @@ function Combobox({
|
|
|
5050
5489
|
const selectedOption = options.find(
|
|
5051
5490
|
(option) => option.value === selectedValue
|
|
5052
5491
|
);
|
|
5053
|
-
const
|
|
5492
|
+
const theme = useSketchTheme(sketchColor);
|
|
5493
|
+
const ink = sketchColor ?? theme.ink;
|
|
5054
5494
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5055
5495
|
const shouldAnimate = useAnimate(animate);
|
|
5056
5496
|
const triggerRef = useRef(null);
|
|
@@ -5100,9 +5540,12 @@ function Combobox({
|
|
|
5100
5540
|
shape: "rectangle",
|
|
5101
5541
|
roughness,
|
|
5102
5542
|
seed: resolvedSeed,
|
|
5103
|
-
sketchColor: open ?
|
|
5543
|
+
sketchColor: open ? theme.accent : ink,
|
|
5104
5544
|
bowing,
|
|
5105
5545
|
fillStyle,
|
|
5546
|
+
hachureGap,
|
|
5547
|
+
hachureAngle,
|
|
5548
|
+
fillWeight,
|
|
5106
5549
|
strokeWidth: open ? (strokeWidth ?? 1.75) + 0.35 : strokeWidth
|
|
5107
5550
|
}
|
|
5108
5551
|
),
|
|
@@ -5161,6 +5604,9 @@ function Combobox({
|
|
|
5161
5604
|
bowing,
|
|
5162
5605
|
fillStyle,
|
|
5163
5606
|
strokeWidth,
|
|
5607
|
+
hachureGap,
|
|
5608
|
+
hachureAngle,
|
|
5609
|
+
fillWeight,
|
|
5164
5610
|
animate,
|
|
5165
5611
|
children: [
|
|
5166
5612
|
/* @__PURE__ */ jsx(CommandInput, { placeholder: searchPlaceholder }),
|
|
@@ -5188,16 +5634,21 @@ var Kbd = forwardRef(function Kbd2({
|
|
|
5188
5634
|
children,
|
|
5189
5635
|
className,
|
|
5190
5636
|
style,
|
|
5637
|
+
fill,
|
|
5191
5638
|
roughness,
|
|
5192
5639
|
seed,
|
|
5193
5640
|
sketchColor,
|
|
5194
5641
|
bowing,
|
|
5195
5642
|
fillStyle,
|
|
5196
5643
|
strokeWidth,
|
|
5644
|
+
hachureGap,
|
|
5645
|
+
hachureAngle,
|
|
5646
|
+
fillWeight,
|
|
5197
5647
|
animate,
|
|
5198
5648
|
...rest
|
|
5199
5649
|
}, ref) {
|
|
5200
|
-
const
|
|
5650
|
+
const theme = useSketchTheme(sketchColor);
|
|
5651
|
+
const ink = sketchColor ?? theme.ink;
|
|
5201
5652
|
return /* @__PURE__ */ jsx(
|
|
5202
5653
|
SketchBox,
|
|
5203
5654
|
{
|
|
@@ -5205,6 +5656,7 @@ var Kbd = forwardRef(function Kbd2({
|
|
|
5205
5656
|
style: {
|
|
5206
5657
|
display: "inline-flex",
|
|
5207
5658
|
verticalAlign: "middle",
|
|
5659
|
+
color: ink,
|
|
5208
5660
|
...style
|
|
5209
5661
|
},
|
|
5210
5662
|
contentStyle: {
|
|
@@ -5212,10 +5664,14 @@ var Kbd = forwardRef(function Kbd2({
|
|
|
5212
5664
|
fontSize: 11,
|
|
5213
5665
|
fontFamily: doodleUiFontFamily,
|
|
5214
5666
|
lineHeight: 1.35,
|
|
5215
|
-
letterSpacing: "0.04em"
|
|
5667
|
+
letterSpacing: "0.04em",
|
|
5668
|
+
color: ink
|
|
5216
5669
|
},
|
|
5217
|
-
fill:
|
|
5670
|
+
fill: fill ?? theme.secondaryFill,
|
|
5218
5671
|
fillStyle: fillStyle ?? "hachure",
|
|
5672
|
+
hachureGap: hachureGap ?? 6,
|
|
5673
|
+
hachureAngle,
|
|
5674
|
+
fillWeight: fillWeight ?? 0.8,
|
|
5219
5675
|
roughness,
|
|
5220
5676
|
seed,
|
|
5221
5677
|
sketchColor: ink,
|
|
@@ -5262,7 +5718,8 @@ var Spinner = forwardRef(
|
|
|
5262
5718
|
}, ref) {
|
|
5263
5719
|
const px = SIZE_PX[size];
|
|
5264
5720
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5265
|
-
const
|
|
5721
|
+
const theme = useSketchTheme(sketchColor);
|
|
5722
|
+
const ink = sketchColor ?? theme.ink;
|
|
5266
5723
|
const shouldSpin = useAnimate(animate);
|
|
5267
5724
|
const boxStyle = {
|
|
5268
5725
|
position: "relative",
|
|
@@ -5330,6 +5787,9 @@ var Toggle = forwardRef(
|
|
|
5330
5787
|
bowing,
|
|
5331
5788
|
fillStyle,
|
|
5332
5789
|
strokeWidth,
|
|
5790
|
+
hachureGap,
|
|
5791
|
+
hachureAngle,
|
|
5792
|
+
fillWeight,
|
|
5333
5793
|
pressed,
|
|
5334
5794
|
defaultPressed,
|
|
5335
5795
|
onPressedChange,
|
|
@@ -5341,7 +5801,10 @@ var Toggle = forwardRef(
|
|
|
5341
5801
|
const rootRef = useRef(null);
|
|
5342
5802
|
const [uncontrolled, setUncontrolled] = useState(defaultPressed === true);
|
|
5343
5803
|
const isPressed = pressed ?? uncontrolled;
|
|
5344
|
-
const
|
|
5804
|
+
const theme = useSketchTheme(sketchColor);
|
|
5805
|
+
const ink = sketchColor ?? theme.ink;
|
|
5806
|
+
const accent = sketchColor ?? theme.accent;
|
|
5807
|
+
const accentFill = theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill;
|
|
5345
5808
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5346
5809
|
const shouldAnimate = useAnimate(animate);
|
|
5347
5810
|
const pressSeed = deriveSeed(resolvedSeed, isPressed ? "on" : "off");
|
|
@@ -5370,7 +5833,7 @@ var Toggle = forwardRef(
|
|
|
5370
5833
|
border: "none",
|
|
5371
5834
|
background: "transparent",
|
|
5372
5835
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
5373
|
-
color: ink,
|
|
5836
|
+
color: isPressed ? theme.isDark ? "#ffffff" : accent : ink,
|
|
5374
5837
|
fontFamily: doodleUiFontFamily,
|
|
5375
5838
|
fontWeight: doodleUiFontWeight(600),
|
|
5376
5839
|
opacity: disabled ? 0.45 : 1,
|
|
@@ -5386,11 +5849,14 @@ var Toggle = forwardRef(
|
|
|
5386
5849
|
shape: "rectangle",
|
|
5387
5850
|
roughness,
|
|
5388
5851
|
seed: sketchSeed,
|
|
5389
|
-
sketchColor: isPressed ?
|
|
5852
|
+
sketchColor: isPressed ? accent : ink,
|
|
5390
5853
|
bowing,
|
|
5391
5854
|
fillStyle: fillStyle ?? "hachure",
|
|
5392
|
-
fill: isPressed ?
|
|
5393
|
-
strokeWidth: strokeWidth ?? 1.6
|
|
5855
|
+
fill: isPressed ? accentFill : void 0,
|
|
5856
|
+
strokeWidth: strokeWidth ?? 1.6,
|
|
5857
|
+
hachureGap: hachureGap ?? 7,
|
|
5858
|
+
hachureAngle,
|
|
5859
|
+
fillWeight: fillWeight ?? 1
|
|
5394
5860
|
}
|
|
5395
5861
|
),
|
|
5396
5862
|
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
|
|
@@ -5416,13 +5882,19 @@ function ToggleGroup(props) {
|
|
|
5416
5882
|
bowing,
|
|
5417
5883
|
fillStyle,
|
|
5418
5884
|
strokeWidth,
|
|
5885
|
+
hachureGap,
|
|
5886
|
+
hachureAngle,
|
|
5887
|
+
fillWeight,
|
|
5419
5888
|
size = "md",
|
|
5420
5889
|
animate,
|
|
5421
5890
|
type = "single",
|
|
5422
5891
|
...rest
|
|
5423
5892
|
} = props;
|
|
5424
5893
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5425
|
-
const
|
|
5894
|
+
const theme = useSketchTheme(sketchColor);
|
|
5895
|
+
const ink = sketchColor ?? theme.ink;
|
|
5896
|
+
const accent = sketchColor ?? theme.accent;
|
|
5897
|
+
const accentFill = theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill;
|
|
5426
5898
|
const rootStyle = { display: "inline-flex", gap: 6, flexWrap: "wrap" };
|
|
5427
5899
|
return /* @__PURE__ */ jsx(
|
|
5428
5900
|
ToggleGroupSketchContext.Provider,
|
|
@@ -5434,8 +5906,14 @@ function ToggleGroup(props) {
|
|
|
5434
5906
|
bowing,
|
|
5435
5907
|
fillStyle,
|
|
5436
5908
|
strokeWidth,
|
|
5909
|
+
hachureGap,
|
|
5910
|
+
hachureAngle,
|
|
5911
|
+
fillWeight,
|
|
5437
5912
|
resolvedSeed,
|
|
5438
5913
|
ink,
|
|
5914
|
+
accent,
|
|
5915
|
+
accentFill,
|
|
5916
|
+
isDark: theme.isDark,
|
|
5439
5917
|
animate,
|
|
5440
5918
|
size
|
|
5441
5919
|
},
|
|
@@ -5484,6 +5962,7 @@ var ToggleGroupItem = forwardRef(function ToggleGroupItem2({ className, style, c
|
|
|
5484
5962
|
return () => obs.disconnect();
|
|
5485
5963
|
}, [value]);
|
|
5486
5964
|
useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
|
|
5965
|
+
const textColor = pressed ? sketch.isDark ? "#ffffff" : sketch.accent : sketch.ink;
|
|
5487
5966
|
return /* @__PURE__ */ jsxs(
|
|
5488
5967
|
ToggleGroupPrimitive.Item,
|
|
5489
5968
|
{
|
|
@@ -5502,7 +5981,7 @@ var ToggleGroupItem = forwardRef(function ToggleGroupItem2({ className, style, c
|
|
|
5502
5981
|
border: "none",
|
|
5503
5982
|
background: "transparent",
|
|
5504
5983
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
5505
|
-
color:
|
|
5984
|
+
color: textColor,
|
|
5506
5985
|
fontFamily: doodleUiFontFamily,
|
|
5507
5986
|
fontWeight: doodleUiFontWeight(600),
|
|
5508
5987
|
opacity: disabled ? 0.45 : 1,
|
|
@@ -5518,11 +5997,14 @@ var ToggleGroupItem = forwardRef(function ToggleGroupItem2({ className, style, c
|
|
|
5518
5997
|
shape: "rectangle",
|
|
5519
5998
|
roughness: sketch.roughness,
|
|
5520
5999
|
seed: sketchSeed,
|
|
5521
|
-
sketchColor: pressed ?
|
|
6000
|
+
sketchColor: pressed ? sketch.accent : sketch.ink,
|
|
5522
6001
|
bowing: sketch.bowing,
|
|
5523
6002
|
fillStyle: sketch.fillStyle ?? "hachure",
|
|
5524
|
-
fill: pressed ?
|
|
5525
|
-
strokeWidth: sketch.strokeWidth ?? 1.6
|
|
6003
|
+
fill: pressed ? sketch.accentFill : void 0,
|
|
6004
|
+
strokeWidth: sketch.strokeWidth ?? 1.6,
|
|
6005
|
+
hachureGap: sketch.hachureGap ?? 7,
|
|
6006
|
+
hachureAngle: sketch.hachureAngle,
|
|
6007
|
+
fillWeight: sketch.fillWeight ?? 1
|
|
5526
6008
|
}
|
|
5527
6009
|
),
|
|
5528
6010
|
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
|
|
@@ -5548,13 +6030,17 @@ function InputGroup({
|
|
|
5548
6030
|
bowing,
|
|
5549
6031
|
fillStyle,
|
|
5550
6032
|
strokeWidth,
|
|
6033
|
+
hachureGap,
|
|
6034
|
+
hachureAngle,
|
|
6035
|
+
fillWeight,
|
|
5551
6036
|
animate,
|
|
5552
6037
|
onFocus,
|
|
5553
6038
|
onBlur,
|
|
5554
6039
|
...rest
|
|
5555
6040
|
}) {
|
|
5556
6041
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5557
|
-
const
|
|
6042
|
+
const theme = useSketchTheme(sketchColor);
|
|
6043
|
+
const ink = sketchColor ?? theme.ink;
|
|
5558
6044
|
const [focused, setFocused] = useState(false);
|
|
5559
6045
|
const shouldAnimate = useAnimate(animate);
|
|
5560
6046
|
const focusSeed = deriveSeed(resolvedSeed, "focus");
|
|
@@ -5565,12 +6051,16 @@ function InputGroup({
|
|
|
5565
6051
|
value: {
|
|
5566
6052
|
roughness,
|
|
5567
6053
|
seed: resolvedSeed,
|
|
5568
|
-
sketchColor,
|
|
6054
|
+
sketchColor: ink,
|
|
5569
6055
|
bowing,
|
|
5570
6056
|
fillStyle,
|
|
5571
6057
|
strokeWidth,
|
|
6058
|
+
hachureGap,
|
|
6059
|
+
hachureAngle,
|
|
6060
|
+
fillWeight,
|
|
5572
6061
|
resolvedSeed,
|
|
5573
6062
|
ink,
|
|
6063
|
+
accent: theme.accent,
|
|
5574
6064
|
animate,
|
|
5575
6065
|
focused,
|
|
5576
6066
|
setFocused
|
|
@@ -5596,10 +6086,13 @@ function InputGroup({
|
|
|
5596
6086
|
{
|
|
5597
6087
|
roughness,
|
|
5598
6088
|
seed: sketchSeed,
|
|
5599
|
-
sketchColor: focused ?
|
|
6089
|
+
sketchColor: focused ? theme.accent : ink,
|
|
5600
6090
|
bowing,
|
|
5601
6091
|
fillStyle,
|
|
5602
6092
|
strokeWidth: focused && !shouldAnimate ? (strokeWidth ?? 1.75) + 0.35 : strokeWidth,
|
|
6093
|
+
hachureGap,
|
|
6094
|
+
hachureAngle,
|
|
6095
|
+
fillWeight,
|
|
5603
6096
|
animate,
|
|
5604
6097
|
drawInKey: sketchSeed,
|
|
5605
6098
|
contentStyle: {
|
|
@@ -5699,24 +6192,35 @@ var InputOTP = forwardRef(
|
|
|
5699
6192
|
bowing,
|
|
5700
6193
|
fillStyle,
|
|
5701
6194
|
strokeWidth,
|
|
6195
|
+
hachureGap,
|
|
6196
|
+
hachureAngle,
|
|
6197
|
+
fillWeight,
|
|
6198
|
+
fill,
|
|
5702
6199
|
animate,
|
|
5703
6200
|
children,
|
|
5704
6201
|
...rest
|
|
5705
6202
|
}, ref) {
|
|
5706
6203
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5707
|
-
const
|
|
6204
|
+
const theme = useSketchTheme(sketchColor);
|
|
6205
|
+
const ink = sketchColor ?? theme.ink;
|
|
5708
6206
|
return /* @__PURE__ */ jsx(
|
|
5709
6207
|
InputOTPSketchContext.Provider,
|
|
5710
6208
|
{
|
|
5711
6209
|
value: {
|
|
5712
6210
|
roughness,
|
|
5713
6211
|
seed: resolvedSeed,
|
|
5714
|
-
sketchColor,
|
|
6212
|
+
sketchColor: ink,
|
|
5715
6213
|
bowing,
|
|
5716
6214
|
fillStyle,
|
|
5717
6215
|
strokeWidth,
|
|
6216
|
+
hachureGap,
|
|
6217
|
+
hachureAngle,
|
|
6218
|
+
fillWeight,
|
|
6219
|
+
fill,
|
|
5718
6220
|
resolvedSeed,
|
|
5719
6221
|
ink,
|
|
6222
|
+
accent: theme.accent,
|
|
6223
|
+
paper: theme.paper,
|
|
5720
6224
|
animate
|
|
5721
6225
|
},
|
|
5722
6226
|
children: /* @__PURE__ */ jsx(
|
|
@@ -5793,9 +6297,13 @@ var InputOTPSlot = forwardRef(
|
|
|
5793
6297
|
shape: "rectangle",
|
|
5794
6298
|
roughness: sketch.roughness,
|
|
5795
6299
|
seed: slotSeed,
|
|
5796
|
-
sketchColor: isActive ?
|
|
6300
|
+
sketchColor: isActive ? sketch.accent : sketch.ink,
|
|
5797
6301
|
bowing: sketch.bowing,
|
|
5798
6302
|
fillStyle: sketch.fillStyle,
|
|
6303
|
+
fill: sketch.fill,
|
|
6304
|
+
hachureGap: sketch.hachureGap,
|
|
6305
|
+
hachureAngle: sketch.hachureAngle,
|
|
6306
|
+
fillWeight: sketch.fillWeight,
|
|
5799
6307
|
strokeWidth: isActive ? (sketch.strokeWidth ?? 1.75) + 0.15 : sketch.strokeWidth
|
|
5800
6308
|
}
|
|
5801
6309
|
),
|
|
@@ -5855,17 +6363,22 @@ var ScrollArea = forwardRef(function ScrollArea2({
|
|
|
5855
6363
|
className,
|
|
5856
6364
|
style,
|
|
5857
6365
|
children,
|
|
6366
|
+
fill,
|
|
5858
6367
|
roughness,
|
|
5859
6368
|
seed,
|
|
5860
6369
|
sketchColor,
|
|
5861
6370
|
bowing,
|
|
5862
6371
|
fillStyle,
|
|
5863
6372
|
strokeWidth,
|
|
6373
|
+
hachureGap,
|
|
6374
|
+
hachureAngle,
|
|
6375
|
+
fillWeight,
|
|
5864
6376
|
animate,
|
|
5865
6377
|
...rest
|
|
5866
6378
|
}, ref) {
|
|
5867
6379
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5868
|
-
const
|
|
6380
|
+
const theme = useSketchTheme(sketchColor);
|
|
6381
|
+
const ink = sketchColor ?? theme.ink;
|
|
5869
6382
|
return /* @__PURE__ */ jsx(
|
|
5870
6383
|
ScrollAreaSketchContext.Provider,
|
|
5871
6384
|
{
|
|
@@ -5876,8 +6389,12 @@ var ScrollArea = forwardRef(function ScrollArea2({
|
|
|
5876
6389
|
bowing,
|
|
5877
6390
|
fillStyle,
|
|
5878
6391
|
strokeWidth,
|
|
6392
|
+
hachureGap,
|
|
6393
|
+
hachureAngle,
|
|
6394
|
+
fillWeight,
|
|
5879
6395
|
resolvedSeed,
|
|
5880
6396
|
ink,
|
|
6397
|
+
paper: fill ?? theme.paper,
|
|
5881
6398
|
animate
|
|
5882
6399
|
},
|
|
5883
6400
|
children: /* @__PURE__ */ jsx(
|
|
@@ -5885,7 +6402,7 @@ var ScrollArea = forwardRef(function ScrollArea2({
|
|
|
5885
6402
|
{
|
|
5886
6403
|
ref,
|
|
5887
6404
|
className: cn(className),
|
|
5888
|
-
style: { position: "relative", overflow: "hidden", ...style },
|
|
6405
|
+
style: { position: "relative", overflow: "hidden", color: ink, ...style },
|
|
5889
6406
|
...rest,
|
|
5890
6407
|
children: /* @__PURE__ */ jsx(
|
|
5891
6408
|
SketchBox,
|
|
@@ -5895,10 +6412,13 @@ var ScrollArea = forwardRef(function ScrollArea2({
|
|
|
5895
6412
|
sketchColor: ink,
|
|
5896
6413
|
bowing,
|
|
5897
6414
|
fillStyle: fillStyle ?? "solid",
|
|
5898
|
-
fill:
|
|
6415
|
+
fill: fill ?? theme.paper,
|
|
5899
6416
|
strokeWidth: strokeWidth ?? 1.5,
|
|
6417
|
+
hachureGap,
|
|
6418
|
+
hachureAngle,
|
|
6419
|
+
fillWeight,
|
|
5900
6420
|
animate,
|
|
5901
|
-
contentStyle: { padding: 0, height: "100%" },
|
|
6421
|
+
contentStyle: { padding: 0, height: "100%", color: ink },
|
|
5902
6422
|
style: { height: "100%" },
|
|
5903
6423
|
children
|
|
5904
6424
|
}
|
|
@@ -5987,7 +6507,8 @@ function ResizableHandle({
|
|
|
5987
6507
|
...rest
|
|
5988
6508
|
}) {
|
|
5989
6509
|
const resolvedSeed = useResolvedSeed(seed);
|
|
5990
|
-
const
|
|
6510
|
+
const theme = useSketchTheme(sketchColor);
|
|
6511
|
+
const ink = sketchColor ?? theme.ink;
|
|
5991
6512
|
const handleSeed = deriveSeed(resolvedSeed, "handle");
|
|
5992
6513
|
const base = {
|
|
5993
6514
|
position: "relative",
|
|
@@ -6061,17 +6582,22 @@ function useHoverCardSketch() {
|
|
|
6061
6582
|
}
|
|
6062
6583
|
function HoverCard({
|
|
6063
6584
|
children,
|
|
6585
|
+
fill,
|
|
6064
6586
|
roughness,
|
|
6065
6587
|
seed,
|
|
6066
6588
|
sketchColor,
|
|
6067
6589
|
bowing,
|
|
6068
6590
|
fillStyle,
|
|
6069
6591
|
strokeWidth,
|
|
6592
|
+
hachureGap,
|
|
6593
|
+
hachureAngle,
|
|
6594
|
+
fillWeight,
|
|
6070
6595
|
animate,
|
|
6071
6596
|
...rest
|
|
6072
6597
|
}) {
|
|
6073
6598
|
const resolvedSeed = useResolvedSeed(seed);
|
|
6074
|
-
const
|
|
6599
|
+
const theme = useSketchTheme(sketchColor);
|
|
6600
|
+
const ink = sketchColor ?? theme.ink;
|
|
6075
6601
|
return /* @__PURE__ */ jsx(
|
|
6076
6602
|
HoverCardSketchContext.Provider,
|
|
6077
6603
|
{
|
|
@@ -6082,8 +6608,12 @@ function HoverCard({
|
|
|
6082
6608
|
bowing,
|
|
6083
6609
|
fillStyle,
|
|
6084
6610
|
strokeWidth,
|
|
6611
|
+
hachureGap,
|
|
6612
|
+
hachureAngle,
|
|
6613
|
+
fillWeight,
|
|
6085
6614
|
resolvedSeed,
|
|
6086
6615
|
ink,
|
|
6616
|
+
paper: fill ?? theme.paper,
|
|
6087
6617
|
animate
|
|
6088
6618
|
},
|
|
6089
6619
|
children: /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { ...rest, children })
|
|
@@ -6091,7 +6621,7 @@ function HoverCard({
|
|
|
6091
6621
|
);
|
|
6092
6622
|
}
|
|
6093
6623
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
6094
|
-
var HoverCardContent = forwardRef(function HoverCardContent2({ className, style, children, sideOffset = 6, align = "center", ...rest }, ref) {
|
|
6624
|
+
var HoverCardContent = forwardRef(function HoverCardContent2({ className, style, children, fill, sideOffset = 6, align = "center", ...rest }, ref) {
|
|
6095
6625
|
const sketch = useHoverCardSketch();
|
|
6096
6626
|
return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
6097
6627
|
HoverCardPrimitive.Content,
|
|
@@ -6100,7 +6630,7 @@ var HoverCardContent = forwardRef(function HoverCardContent2({ className, style,
|
|
|
6100
6630
|
sideOffset,
|
|
6101
6631
|
align,
|
|
6102
6632
|
className: cn(className),
|
|
6103
|
-
style: { zIndex: 75, outline: "none", ...style },
|
|
6633
|
+
style: { zIndex: 75, outline: "none", color: sketch.ink, ...style },
|
|
6104
6634
|
...rest,
|
|
6105
6635
|
children: /* @__PURE__ */ jsx(
|
|
6106
6636
|
SketchBox,
|
|
@@ -6110,11 +6640,14 @@ var HoverCardContent = forwardRef(function HoverCardContent2({ className, style,
|
|
|
6110
6640
|
sketchColor: sketch.ink,
|
|
6111
6641
|
bowing: sketch.bowing,
|
|
6112
6642
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
6113
|
-
fill:
|
|
6643
|
+
fill: fill ?? sketch.paper,
|
|
6114
6644
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
6645
|
+
hachureGap: sketch.hachureGap,
|
|
6646
|
+
hachureAngle: sketch.hachureAngle,
|
|
6647
|
+
fillWeight: sketch.fillWeight,
|
|
6115
6648
|
shadow: true,
|
|
6116
6649
|
animate: sketch.animate,
|
|
6117
|
-
contentStyle: { padding: 14, maxWidth: 320, fontSize: 14 },
|
|
6650
|
+
contentStyle: { padding: 14, maxWidth: 320, fontSize: 14, color: sketch.ink },
|
|
6118
6651
|
children
|
|
6119
6652
|
}
|
|
6120
6653
|
)
|
|
@@ -6134,17 +6667,22 @@ function useContextMenuSketch() {
|
|
|
6134
6667
|
}
|
|
6135
6668
|
function ContextMenu({
|
|
6136
6669
|
children,
|
|
6670
|
+
fill,
|
|
6137
6671
|
roughness,
|
|
6138
6672
|
seed,
|
|
6139
6673
|
sketchColor,
|
|
6140
6674
|
bowing,
|
|
6141
6675
|
fillStyle,
|
|
6142
6676
|
strokeWidth,
|
|
6677
|
+
hachureGap,
|
|
6678
|
+
hachureAngle,
|
|
6679
|
+
fillWeight,
|
|
6143
6680
|
animate,
|
|
6144
6681
|
...rest
|
|
6145
6682
|
}) {
|
|
6146
6683
|
const resolvedSeed = useResolvedSeed(seed);
|
|
6147
|
-
const
|
|
6684
|
+
const theme = useSketchTheme(sketchColor);
|
|
6685
|
+
const ink = sketchColor ?? theme.ink;
|
|
6148
6686
|
return /* @__PURE__ */ jsx(
|
|
6149
6687
|
ContextMenuSketchContext.Provider,
|
|
6150
6688
|
{
|
|
@@ -6155,8 +6693,13 @@ function ContextMenu({
|
|
|
6155
6693
|
bowing,
|
|
6156
6694
|
fillStyle,
|
|
6157
6695
|
strokeWidth,
|
|
6696
|
+
hachureGap,
|
|
6697
|
+
hachureAngle,
|
|
6698
|
+
fillWeight,
|
|
6158
6699
|
resolvedSeed,
|
|
6159
6700
|
ink,
|
|
6701
|
+
paper: fill ?? theme.paper,
|
|
6702
|
+
accent: theme.accent,
|
|
6160
6703
|
animate
|
|
6161
6704
|
},
|
|
6162
6705
|
children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, { ...rest, children })
|
|
@@ -6167,14 +6710,14 @@ var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
|
6167
6710
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
6168
6711
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
6169
6712
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
6170
|
-
var ContextMenuContent = forwardRef(function ContextMenuContent2({ className, style, children, ...rest }, ref) {
|
|
6713
|
+
var ContextMenuContent = forwardRef(function ContextMenuContent2({ className, style, children, fill, ...rest }, ref) {
|
|
6171
6714
|
const sketch = useContextMenuSketch();
|
|
6172
6715
|
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
6173
6716
|
ContextMenuPrimitive.Content,
|
|
6174
6717
|
{
|
|
6175
6718
|
ref,
|
|
6176
6719
|
className: cn(className),
|
|
6177
|
-
style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
|
|
6720
|
+
style: { zIndex: 80, outline: "none", minWidth: 180, color: sketch.ink, ...style },
|
|
6178
6721
|
...rest,
|
|
6179
6722
|
children: /* @__PURE__ */ jsx(
|
|
6180
6723
|
SketchBox,
|
|
@@ -6184,11 +6727,14 @@ var ContextMenuContent = forwardRef(function ContextMenuContent2({ className, st
|
|
|
6184
6727
|
sketchColor: sketch.ink,
|
|
6185
6728
|
bowing: sketch.bowing,
|
|
6186
6729
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
6187
|
-
fill:
|
|
6730
|
+
fill: fill ?? sketch.paper,
|
|
6188
6731
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
6732
|
+
hachureGap: sketch.hachureGap,
|
|
6733
|
+
hachureAngle: sketch.hachureAngle,
|
|
6734
|
+
fillWeight: sketch.fillWeight,
|
|
6189
6735
|
shadow: true,
|
|
6190
6736
|
animate: sketch.animate,
|
|
6191
|
-
contentStyle: { padding: "6px 4px" },
|
|
6737
|
+
contentStyle: { padding: "6px 4px", color: sketch.ink },
|
|
6192
6738
|
children
|
|
6193
6739
|
}
|
|
6194
6740
|
)
|
|
@@ -6303,7 +6849,7 @@ var ContextMenuCheckboxItem = forwardRef(function ContextMenuCheckboxItem2({ cla
|
|
|
6303
6849
|
path: CHECK_PATH3,
|
|
6304
6850
|
roughness: (sketch.roughness ?? 1.5) * 0.7,
|
|
6305
6851
|
seed: deriveSeed(sketch.resolvedSeed, "checkbox-mark"),
|
|
6306
|
-
sketchColor:
|
|
6852
|
+
sketchColor: sketch.accent,
|
|
6307
6853
|
bowing: sketch.bowing,
|
|
6308
6854
|
strokeWidth: 1.6,
|
|
6309
6855
|
inset: 0
|
|
@@ -6371,10 +6917,10 @@ var ContextMenuRadioItem = forwardRef(function ContextMenuRadioItem2({ className
|
|
|
6371
6917
|
shape: "ellipse",
|
|
6372
6918
|
roughness: (sketch.roughness ?? 1.5) * 0.8,
|
|
6373
6919
|
seed: deriveSeed(sketch.resolvedSeed, "radio-mark"),
|
|
6374
|
-
sketchColor:
|
|
6920
|
+
sketchColor: sketch.accent,
|
|
6375
6921
|
bowing: sketch.bowing,
|
|
6376
6922
|
fillStyle: "solid",
|
|
6377
|
-
fill:
|
|
6923
|
+
fill: sketch.accent,
|
|
6378
6924
|
strokeWidth: 1.2,
|
|
6379
6925
|
inset: 0
|
|
6380
6926
|
}
|
|
@@ -6444,17 +6990,22 @@ function useNavigationMenuSketch() {
|
|
|
6444
6990
|
}
|
|
6445
6991
|
function NavigationMenu({
|
|
6446
6992
|
children,
|
|
6993
|
+
fill,
|
|
6447
6994
|
roughness,
|
|
6448
6995
|
seed,
|
|
6449
6996
|
sketchColor,
|
|
6450
6997
|
bowing,
|
|
6451
6998
|
fillStyle,
|
|
6452
6999
|
strokeWidth,
|
|
7000
|
+
hachureGap,
|
|
7001
|
+
hachureAngle,
|
|
7002
|
+
fillWeight,
|
|
6453
7003
|
animate,
|
|
6454
7004
|
...rest
|
|
6455
7005
|
}) {
|
|
6456
7006
|
const resolvedSeed = useResolvedSeed(seed);
|
|
6457
|
-
const
|
|
7007
|
+
const theme = useSketchTheme(sketchColor);
|
|
7008
|
+
const ink = sketchColor ?? theme.ink;
|
|
6458
7009
|
return /* @__PURE__ */ jsx(
|
|
6459
7010
|
NavigationMenuSketchContext.Provider,
|
|
6460
7011
|
{
|
|
@@ -6465,8 +7016,12 @@ function NavigationMenu({
|
|
|
6465
7016
|
bowing,
|
|
6466
7017
|
fillStyle,
|
|
6467
7018
|
strokeWidth,
|
|
7019
|
+
hachureGap,
|
|
7020
|
+
hachureAngle,
|
|
7021
|
+
fillWeight,
|
|
6468
7022
|
resolvedSeed,
|
|
6469
7023
|
ink,
|
|
7024
|
+
paper: fill ?? theme.paper,
|
|
6470
7025
|
animate
|
|
6471
7026
|
},
|
|
6472
7027
|
children: /* @__PURE__ */ jsxs(NavigationMenuPrimitive.Root, { ...rest, children: [
|
|
@@ -6521,14 +7076,14 @@ var NavigationMenuTrigger = forwardRef(function NavigationMenuTrigger2({ classNa
|
|
|
6521
7076
|
}
|
|
6522
7077
|
);
|
|
6523
7078
|
});
|
|
6524
|
-
var NavigationMenuContent = forwardRef(function NavigationMenuContent2({ className, style, children, ...rest }, ref) {
|
|
7079
|
+
var NavigationMenuContent = forwardRef(function NavigationMenuContent2({ className, style, children, fill, ...rest }, ref) {
|
|
6525
7080
|
const sketch = useNavigationMenuSketch();
|
|
6526
7081
|
return /* @__PURE__ */ jsx(
|
|
6527
7082
|
NavigationMenuPrimitive.Content,
|
|
6528
7083
|
{
|
|
6529
7084
|
ref,
|
|
6530
7085
|
className: cn(className),
|
|
6531
|
-
style: { outline: "none", ...style },
|
|
7086
|
+
style: { outline: "none", color: sketch.ink, ...style },
|
|
6532
7087
|
...rest,
|
|
6533
7088
|
children: /* @__PURE__ */ jsx(
|
|
6534
7089
|
SketchBox,
|
|
@@ -6538,11 +7093,14 @@ var NavigationMenuContent = forwardRef(function NavigationMenuContent2({ classNa
|
|
|
6538
7093
|
sketchColor: sketch.ink,
|
|
6539
7094
|
bowing: sketch.bowing,
|
|
6540
7095
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
6541
|
-
fill:
|
|
7096
|
+
fill: fill ?? sketch.paper,
|
|
6542
7097
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
7098
|
+
hachureGap: sketch.hachureGap,
|
|
7099
|
+
hachureAngle: sketch.hachureAngle,
|
|
7100
|
+
fillWeight: sketch.fillWeight,
|
|
6543
7101
|
shadow: true,
|
|
6544
7102
|
animate: sketch.animate,
|
|
6545
|
-
contentStyle: { padding: 12, minWidth: 200 },
|
|
7103
|
+
contentStyle: { padding: 12, minWidth: 200, color: sketch.ink },
|
|
6546
7104
|
children
|
|
6547
7105
|
}
|
|
6548
7106
|
)
|
|
@@ -6644,17 +7202,22 @@ function Menubar({
|
|
|
6644
7202
|
children,
|
|
6645
7203
|
className,
|
|
6646
7204
|
style,
|
|
7205
|
+
fill,
|
|
6647
7206
|
roughness,
|
|
6648
7207
|
seed,
|
|
6649
7208
|
sketchColor,
|
|
6650
7209
|
bowing,
|
|
6651
7210
|
fillStyle,
|
|
6652
7211
|
strokeWidth,
|
|
7212
|
+
hachureGap,
|
|
7213
|
+
hachureAngle,
|
|
7214
|
+
fillWeight,
|
|
6653
7215
|
animate,
|
|
6654
7216
|
...rest
|
|
6655
7217
|
}) {
|
|
6656
7218
|
const resolvedSeed = useResolvedSeed(seed);
|
|
6657
|
-
const
|
|
7219
|
+
const theme = useSketchTheme(sketchColor);
|
|
7220
|
+
const ink = sketchColor ?? theme.ink;
|
|
6658
7221
|
return /* @__PURE__ */ jsx(
|
|
6659
7222
|
MenubarSketchContext.Provider,
|
|
6660
7223
|
{
|
|
@@ -6665,8 +7228,12 @@ function Menubar({
|
|
|
6665
7228
|
bowing,
|
|
6666
7229
|
fillStyle,
|
|
6667
7230
|
strokeWidth,
|
|
7231
|
+
hachureGap,
|
|
7232
|
+
hachureAngle,
|
|
7233
|
+
fillWeight,
|
|
6668
7234
|
resolvedSeed,
|
|
6669
7235
|
ink,
|
|
7236
|
+
paper: fill ?? theme.paper,
|
|
6670
7237
|
animate
|
|
6671
7238
|
},
|
|
6672
7239
|
children: /* @__PURE__ */ jsx(
|
|
@@ -6711,7 +7278,7 @@ var MenubarTrigger = forwardRef(function MenubarTrigger2({ className, style, chi
|
|
|
6711
7278
|
}
|
|
6712
7279
|
);
|
|
6713
7280
|
});
|
|
6714
|
-
var MenubarContent = forwardRef(function MenubarContent2({ className, style, children, align = "start", sideOffset = 6, ...rest }, ref) {
|
|
7281
|
+
var MenubarContent = forwardRef(function MenubarContent2({ className, style, children, fill, align = "start", sideOffset = 6, ...rest }, ref) {
|
|
6715
7282
|
const sketch = useMenubarSketch();
|
|
6716
7283
|
return /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
6717
7284
|
MenubarPrimitive.Content,
|
|
@@ -6720,7 +7287,7 @@ var MenubarContent = forwardRef(function MenubarContent2({ className, style, chi
|
|
|
6720
7287
|
align,
|
|
6721
7288
|
sideOffset,
|
|
6722
7289
|
className: cn(className),
|
|
6723
|
-
style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
|
|
7290
|
+
style: { zIndex: 80, outline: "none", minWidth: 180, color: sketch.ink, ...style },
|
|
6724
7291
|
...rest,
|
|
6725
7292
|
children: /* @__PURE__ */ jsx(
|
|
6726
7293
|
SketchBox,
|
|
@@ -6730,11 +7297,14 @@ var MenubarContent = forwardRef(function MenubarContent2({ className, style, chi
|
|
|
6730
7297
|
sketchColor: sketch.ink,
|
|
6731
7298
|
bowing: sketch.bowing,
|
|
6732
7299
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
6733
|
-
fill:
|
|
7300
|
+
fill: fill ?? sketch.paper,
|
|
6734
7301
|
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
7302
|
+
hachureGap: sketch.hachureGap,
|
|
7303
|
+
hachureAngle: sketch.hachureAngle,
|
|
7304
|
+
fillWeight: sketch.fillWeight,
|
|
6735
7305
|
shadow: true,
|
|
6736
7306
|
animate: sketch.animate,
|
|
6737
|
-
contentStyle: { padding: "6px 4px" },
|
|
7307
|
+
contentStyle: { padding: "6px 4px", color: sketch.ink },
|
|
6738
7308
|
children
|
|
6739
7309
|
}
|
|
6740
7310
|
)
|
|
@@ -6873,17 +7443,22 @@ function SlidingPanelRoot({
|
|
|
6873
7443
|
defaultOpen,
|
|
6874
7444
|
onOpenChange,
|
|
6875
7445
|
side = "right",
|
|
7446
|
+
fill,
|
|
6876
7447
|
roughness,
|
|
6877
7448
|
seed,
|
|
6878
7449
|
sketchColor,
|
|
6879
7450
|
bowing,
|
|
6880
7451
|
fillStyle,
|
|
6881
7452
|
strokeWidth,
|
|
7453
|
+
hachureGap,
|
|
7454
|
+
hachureAngle,
|
|
7455
|
+
fillWeight,
|
|
6882
7456
|
animate,
|
|
6883
7457
|
...rest
|
|
6884
7458
|
}) {
|
|
6885
7459
|
const resolvedSeed = useResolvedSeed(seed);
|
|
6886
|
-
const
|
|
7460
|
+
const theme = useSketchTheme(sketchColor);
|
|
7461
|
+
const ink = sketchColor ?? theme.ink;
|
|
6887
7462
|
const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
|
|
6888
7463
|
const isOpen = open ?? uncontrolled;
|
|
6889
7464
|
return /* @__PURE__ */ jsx(
|
|
@@ -6896,8 +7471,13 @@ function SlidingPanelRoot({
|
|
|
6896
7471
|
bowing,
|
|
6897
7472
|
fillStyle,
|
|
6898
7473
|
strokeWidth,
|
|
7474
|
+
hachureGap,
|
|
7475
|
+
hachureAngle,
|
|
7476
|
+
fillWeight,
|
|
6899
7477
|
resolvedSeed,
|
|
6900
7478
|
ink,
|
|
7479
|
+
paper: fill ?? theme.paper,
|
|
7480
|
+
isDark: theme.isDark,
|
|
6901
7481
|
animate,
|
|
6902
7482
|
open: isOpen,
|
|
6903
7483
|
side
|
|
@@ -6975,14 +7555,14 @@ var SlidingPanelOverlay = forwardRef(function SlidingPanelOverlay2({ style, ...r
|
|
|
6975
7555
|
style: {
|
|
6976
7556
|
position: "fixed",
|
|
6977
7557
|
inset: 0,
|
|
6978
|
-
background: "rgba(31, 29, 26, 0.38)",
|
|
7558
|
+
background: sketch.isDark ? "rgba(0, 0, 0, 0.65)" : "rgba(31, 29, 26, 0.38)",
|
|
6979
7559
|
zIndex: 70,
|
|
6980
7560
|
...style
|
|
6981
7561
|
}
|
|
6982
7562
|
}
|
|
6983
7563
|
) });
|
|
6984
7564
|
});
|
|
6985
|
-
var SlidingPanelContent = forwardRef(function SlidingPanelContent2({ className, style, contentStyle, children, chrome, ...rest }, ref) {
|
|
7565
|
+
var SlidingPanelContent = forwardRef(function SlidingPanelContent2({ className, style, contentStyle, fill, children, chrome, ...rest }, ref) {
|
|
6986
7566
|
const sketch = useSlidingPanelSketch();
|
|
6987
7567
|
const shouldAnimate = useAnimate(sketch.animate);
|
|
6988
7568
|
const variants = slideVariants(sketch.side, shouldAnimate);
|
|
@@ -7013,8 +7593,11 @@ var SlidingPanelContent = forwardRef(function SlidingPanelContent2({ className,
|
|
|
7013
7593
|
sketchColor: sketch.ink,
|
|
7014
7594
|
bowing: sketch.bowing,
|
|
7015
7595
|
fillStyle: sketch.fillStyle ?? "solid",
|
|
7016
|
-
fill:
|
|
7596
|
+
fill: fill ?? sketch.paper,
|
|
7017
7597
|
strokeWidth: sketch.strokeWidth ?? 2,
|
|
7598
|
+
hachureGap: sketch.hachureGap,
|
|
7599
|
+
hachureAngle: sketch.hachureAngle,
|
|
7600
|
+
fillWeight: sketch.fillWeight,
|
|
7018
7601
|
animate: sketch.animate,
|
|
7019
7602
|
contentStyle: {
|
|
7020
7603
|
padding: 20,
|
|
@@ -7022,6 +7605,7 @@ var SlidingPanelContent = forwardRef(function SlidingPanelContent2({ className,
|
|
|
7022
7605
|
boxSizing: "border-box",
|
|
7023
7606
|
display: "flex",
|
|
7024
7607
|
flexDirection: "column",
|
|
7608
|
+
color: sketch.ink,
|
|
7025
7609
|
...contentStyle
|
|
7026
7610
|
},
|
|
7027
7611
|
style: { height: "100%" },
|
|
@@ -7153,7 +7737,7 @@ var DrawerHandle = forwardRef(
|
|
|
7153
7737
|
shape: "line",
|
|
7154
7738
|
roughness: (sketch.roughness ?? 1.5) + 0.3,
|
|
7155
7739
|
seed: deriveSeed(sketch.resolvedSeed, "drawer-handle"),
|
|
7156
|
-
sketchColor: sketch.sketchColor ??
|
|
7740
|
+
sketchColor: sketch.sketchColor ?? sketch.ink,
|
|
7157
7741
|
bowing: sketch.bowing ?? 1.6,
|
|
7158
7742
|
strokeWidth: 2.4,
|
|
7159
7743
|
width: 48,
|
|
@@ -7183,7 +7767,1407 @@ var DrawerHeader = SlidingPanelHeader;
|
|
|
7183
7767
|
var DrawerFooter = SlidingPanelFooter;
|
|
7184
7768
|
var DrawerTitle = SlidingPanelTitle;
|
|
7185
7769
|
var DrawerDescription = SlidingPanelDescription;
|
|
7770
|
+
function AspectRatio({
|
|
7771
|
+
ratio = 16 / 9,
|
|
7772
|
+
bordered = false,
|
|
7773
|
+
className,
|
|
7774
|
+
style,
|
|
7775
|
+
children,
|
|
7776
|
+
fill,
|
|
7777
|
+
roughness,
|
|
7778
|
+
seed,
|
|
7779
|
+
sketchColor,
|
|
7780
|
+
bowing,
|
|
7781
|
+
fillStyle,
|
|
7782
|
+
strokeWidth,
|
|
7783
|
+
hachureGap,
|
|
7784
|
+
hachureAngle,
|
|
7785
|
+
fillWeight,
|
|
7786
|
+
animate
|
|
7787
|
+
}) {
|
|
7788
|
+
const theme = useSketchTheme(sketchColor);
|
|
7789
|
+
const ink = sketchColor ?? theme.ink;
|
|
7790
|
+
const inner = /* @__PURE__ */ jsx(
|
|
7791
|
+
AspectRatioPrimitive.Root,
|
|
7792
|
+
{
|
|
7793
|
+
ratio,
|
|
7794
|
+
className: cn(className),
|
|
7795
|
+
style: {
|
|
7796
|
+
width: "100%",
|
|
7797
|
+
overflow: "hidden",
|
|
7798
|
+
color: ink,
|
|
7799
|
+
...style
|
|
7800
|
+
},
|
|
7801
|
+
children: /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%" }, children })
|
|
7802
|
+
}
|
|
7803
|
+
);
|
|
7804
|
+
if (!bordered) {
|
|
7805
|
+
return inner;
|
|
7806
|
+
}
|
|
7807
|
+
return /* @__PURE__ */ jsx(
|
|
7808
|
+
SketchBox,
|
|
7809
|
+
{
|
|
7810
|
+
className: cn(className),
|
|
7811
|
+
style: { width: "100%", color: ink, ...style },
|
|
7812
|
+
contentStyle: { padding: 0, width: "100%", color: ink },
|
|
7813
|
+
fill: fill ?? theme.paper,
|
|
7814
|
+
fillStyle: fillStyle ?? "solid",
|
|
7815
|
+
hachureGap,
|
|
7816
|
+
hachureAngle,
|
|
7817
|
+
fillWeight,
|
|
7818
|
+
roughness,
|
|
7819
|
+
seed,
|
|
7820
|
+
sketchColor: ink,
|
|
7821
|
+
bowing,
|
|
7822
|
+
strokeWidth,
|
|
7823
|
+
animate,
|
|
7824
|
+
children: /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, { ratio, style: { width: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%" }, children }) })
|
|
7825
|
+
}
|
|
7826
|
+
);
|
|
7827
|
+
}
|
|
7828
|
+
var CHEVRON_PATH6 = "M 4 6 L 10 12 L 16 6";
|
|
7829
|
+
var NativeSelect = forwardRef(
|
|
7830
|
+
function NativeSelect2({
|
|
7831
|
+
className,
|
|
7832
|
+
style,
|
|
7833
|
+
options,
|
|
7834
|
+
children,
|
|
7835
|
+
fill,
|
|
7836
|
+
roughness,
|
|
7837
|
+
seed,
|
|
7838
|
+
sketchColor,
|
|
7839
|
+
bowing,
|
|
7840
|
+
fillStyle,
|
|
7841
|
+
strokeWidth,
|
|
7842
|
+
hachureGap,
|
|
7843
|
+
hachureAngle,
|
|
7844
|
+
fillWeight,
|
|
7845
|
+
animate,
|
|
7846
|
+
disabled,
|
|
7847
|
+
...rest
|
|
7848
|
+
}, ref) {
|
|
7849
|
+
const fieldRef = useRef(null);
|
|
7850
|
+
const shouldAnimate = useAnimate(animate);
|
|
7851
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
7852
|
+
const theme = useSketchTheme(sketchColor);
|
|
7853
|
+
const ink = sketchColor ?? theme.ink;
|
|
7854
|
+
useDrawIn(fieldRef, DRAW_IN_DURATION_MS, shouldAnimate);
|
|
7855
|
+
return /* @__PURE__ */ jsx(
|
|
7856
|
+
"span",
|
|
7857
|
+
{
|
|
7858
|
+
className: cn(className),
|
|
7859
|
+
style: {
|
|
7860
|
+
position: "relative",
|
|
7861
|
+
display: "block",
|
|
7862
|
+
width: "100%",
|
|
7863
|
+
opacity: disabled ? 0.6 : 1,
|
|
7864
|
+
color: ink,
|
|
7865
|
+
...style
|
|
7866
|
+
},
|
|
7867
|
+
children: /* @__PURE__ */ jsxs("span", { ref: fieldRef, style: { position: "relative", display: "block" }, children: [
|
|
7868
|
+
/* @__PURE__ */ jsx(
|
|
7869
|
+
RoughSvg,
|
|
7870
|
+
{
|
|
7871
|
+
shape: "rectangle",
|
|
7872
|
+
roughness,
|
|
7873
|
+
seed: resolvedSeed,
|
|
7874
|
+
sketchColor: ink,
|
|
7875
|
+
bowing,
|
|
7876
|
+
fillStyle: fillStyle ?? "solid",
|
|
7877
|
+
fill: fill ?? theme.paper,
|
|
7878
|
+
strokeWidth,
|
|
7879
|
+
hachureGap,
|
|
7880
|
+
hachureAngle,
|
|
7881
|
+
fillWeight
|
|
7882
|
+
}
|
|
7883
|
+
),
|
|
7884
|
+
/* @__PURE__ */ jsx(
|
|
7885
|
+
"select",
|
|
7886
|
+
{
|
|
7887
|
+
ref,
|
|
7888
|
+
disabled,
|
|
7889
|
+
style: {
|
|
7890
|
+
position: "relative",
|
|
7891
|
+
zIndex: 1,
|
|
7892
|
+
width: "100%",
|
|
7893
|
+
border: "none",
|
|
7894
|
+
background: "transparent",
|
|
7895
|
+
padding: "10px 36px 10px 12px",
|
|
7896
|
+
fontFamily: doodleUiFontFamily,
|
|
7897
|
+
fontSize: 14,
|
|
7898
|
+
fontWeight: doodleUiFontWeight(500),
|
|
7899
|
+
color: ink,
|
|
7900
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
7901
|
+
appearance: "none",
|
|
7902
|
+
WebkitAppearance: "none",
|
|
7903
|
+
MozAppearance: "none",
|
|
7904
|
+
outline: "none"
|
|
7905
|
+
},
|
|
7906
|
+
...rest,
|
|
7907
|
+
children: options ? options.map((opt) => /* @__PURE__ */ jsx(
|
|
7908
|
+
"option",
|
|
7909
|
+
{
|
|
7910
|
+
value: opt.value,
|
|
7911
|
+
disabled: opt.disabled,
|
|
7912
|
+
children: opt.label
|
|
7913
|
+
},
|
|
7914
|
+
opt.value
|
|
7915
|
+
)) : children
|
|
7916
|
+
}
|
|
7917
|
+
),
|
|
7918
|
+
/* @__PURE__ */ jsx(
|
|
7919
|
+
"span",
|
|
7920
|
+
{
|
|
7921
|
+
"aria-hidden": true,
|
|
7922
|
+
style: {
|
|
7923
|
+
position: "absolute",
|
|
7924
|
+
right: 10,
|
|
7925
|
+
top: "50%",
|
|
7926
|
+
transform: "translateY(-50%)",
|
|
7927
|
+
width: 20,
|
|
7928
|
+
height: 14,
|
|
7929
|
+
pointerEvents: "none",
|
|
7930
|
+
zIndex: 2
|
|
7931
|
+
},
|
|
7932
|
+
children: /* @__PURE__ */ jsx(
|
|
7933
|
+
RoughSvg,
|
|
7934
|
+
{
|
|
7935
|
+
shape: "path",
|
|
7936
|
+
path: CHEVRON_PATH6,
|
|
7937
|
+
roughness: (roughness ?? 1.5) * 0.85,
|
|
7938
|
+
seed: resolvedSeed,
|
|
7939
|
+
sketchColor: ink,
|
|
7940
|
+
bowing,
|
|
7941
|
+
strokeWidth: strokeWidth ?? 1.5
|
|
7942
|
+
}
|
|
7943
|
+
)
|
|
7944
|
+
}
|
|
7945
|
+
)
|
|
7946
|
+
] })
|
|
7947
|
+
}
|
|
7948
|
+
);
|
|
7949
|
+
}
|
|
7950
|
+
);
|
|
7951
|
+
var EmptyContext = createContext(null);
|
|
7952
|
+
function useEmptyInk() {
|
|
7953
|
+
const ctx = useContext(EmptyContext);
|
|
7954
|
+
const theme = useSketchTheme();
|
|
7955
|
+
return ctx?.ink ?? theme.ink;
|
|
7956
|
+
}
|
|
7957
|
+
var emptyContentStyle = {
|
|
7958
|
+
display: "flex",
|
|
7959
|
+
flexDirection: "column",
|
|
7960
|
+
alignItems: "center",
|
|
7961
|
+
justifyContent: "center",
|
|
7962
|
+
textAlign: "center",
|
|
7963
|
+
gap: 12,
|
|
7964
|
+
padding: "32px 24px",
|
|
7965
|
+
minHeight: 160,
|
|
7966
|
+
width: "100%"
|
|
7967
|
+
};
|
|
7968
|
+
var Empty = forwardRef(function Empty2({
|
|
7969
|
+
className,
|
|
7970
|
+
style,
|
|
7971
|
+
children,
|
|
7972
|
+
bordered = true,
|
|
7973
|
+
fill,
|
|
7974
|
+
roughness,
|
|
7975
|
+
seed,
|
|
7976
|
+
sketchColor,
|
|
7977
|
+
bowing,
|
|
7978
|
+
fillStyle,
|
|
7979
|
+
strokeWidth,
|
|
7980
|
+
hachureGap,
|
|
7981
|
+
hachureAngle,
|
|
7982
|
+
fillWeight,
|
|
7983
|
+
animate,
|
|
7984
|
+
...rest
|
|
7985
|
+
}, ref) {
|
|
7986
|
+
const theme = useSketchTheme(sketchColor);
|
|
7987
|
+
const ink = sketchColor ?? theme.ink;
|
|
7988
|
+
const inner = /* @__PURE__ */ jsx(EmptyContext.Provider, { value: { ink }, children: /* @__PURE__ */ jsx(
|
|
7989
|
+
"div",
|
|
7990
|
+
{
|
|
7991
|
+
ref: bordered ? void 0 : ref,
|
|
7992
|
+
className: cn(className),
|
|
7993
|
+
style: { ...emptyContentStyle, color: ink, ...style },
|
|
7994
|
+
...bordered ? {} : rest,
|
|
7995
|
+
children
|
|
7996
|
+
}
|
|
7997
|
+
) });
|
|
7998
|
+
if (!bordered) {
|
|
7999
|
+
return inner;
|
|
8000
|
+
}
|
|
8001
|
+
return /* @__PURE__ */ jsx(
|
|
8002
|
+
SketchBox,
|
|
8003
|
+
{
|
|
8004
|
+
ref,
|
|
8005
|
+
className: cn(className),
|
|
8006
|
+
style: { width: "100%", color: ink, ...style },
|
|
8007
|
+
contentStyle: { ...emptyContentStyle, color: ink },
|
|
8008
|
+
fill: fill ?? theme.secondaryFill,
|
|
8009
|
+
fillStyle: fillStyle ?? "hachure",
|
|
8010
|
+
hachureGap: hachureGap ?? 8,
|
|
8011
|
+
hachureAngle,
|
|
8012
|
+
fillWeight: fillWeight ?? 0.85,
|
|
8013
|
+
roughness,
|
|
8014
|
+
seed,
|
|
8015
|
+
sketchColor: ink,
|
|
8016
|
+
bowing,
|
|
8017
|
+
strokeWidth,
|
|
8018
|
+
animate,
|
|
8019
|
+
...rest,
|
|
8020
|
+
children: /* @__PURE__ */ jsx(EmptyContext.Provider, { value: { ink }, children })
|
|
8021
|
+
}
|
|
8022
|
+
);
|
|
8023
|
+
});
|
|
8024
|
+
function EmptyMedia({
|
|
8025
|
+
className,
|
|
8026
|
+
style,
|
|
8027
|
+
children
|
|
8028
|
+
}) {
|
|
8029
|
+
return /* @__PURE__ */ jsx(
|
|
8030
|
+
"div",
|
|
8031
|
+
{
|
|
8032
|
+
className: cn(className),
|
|
8033
|
+
style: {
|
|
8034
|
+
display: "flex",
|
|
8035
|
+
alignItems: "center",
|
|
8036
|
+
justifyContent: "center",
|
|
8037
|
+
marginBottom: 4,
|
|
8038
|
+
...style
|
|
8039
|
+
},
|
|
8040
|
+
children
|
|
8041
|
+
}
|
|
8042
|
+
);
|
|
8043
|
+
}
|
|
8044
|
+
function EmptyTitle({
|
|
8045
|
+
className,
|
|
8046
|
+
style,
|
|
8047
|
+
children
|
|
8048
|
+
}) {
|
|
8049
|
+
const ink = useEmptyInk();
|
|
8050
|
+
return /* @__PURE__ */ jsx(
|
|
8051
|
+
"h3",
|
|
8052
|
+
{
|
|
8053
|
+
className: cn(className),
|
|
8054
|
+
style: {
|
|
8055
|
+
margin: 0,
|
|
8056
|
+
fontFamily: doodleUiFontFamily,
|
|
8057
|
+
fontSize: 18,
|
|
8058
|
+
fontWeight: doodleUiFontWeight(700),
|
|
8059
|
+
color: ink,
|
|
8060
|
+
...style
|
|
8061
|
+
},
|
|
8062
|
+
children
|
|
8063
|
+
}
|
|
8064
|
+
);
|
|
8065
|
+
}
|
|
8066
|
+
function EmptyDescription({
|
|
8067
|
+
className,
|
|
8068
|
+
style,
|
|
8069
|
+
children
|
|
8070
|
+
}) {
|
|
8071
|
+
const ink = useEmptyInk();
|
|
8072
|
+
return /* @__PURE__ */ jsx(
|
|
8073
|
+
"p",
|
|
8074
|
+
{
|
|
8075
|
+
className: cn(className),
|
|
8076
|
+
style: {
|
|
8077
|
+
margin: 0,
|
|
8078
|
+
maxWidth: 360,
|
|
8079
|
+
fontFamily: doodleUiFontFamily,
|
|
8080
|
+
fontSize: 14,
|
|
8081
|
+
lineHeight: 1.5,
|
|
8082
|
+
color: ink,
|
|
8083
|
+
opacity: 0.85,
|
|
8084
|
+
...style
|
|
8085
|
+
},
|
|
8086
|
+
children
|
|
8087
|
+
}
|
|
8088
|
+
);
|
|
8089
|
+
}
|
|
8090
|
+
function EmptyAction({
|
|
8091
|
+
className,
|
|
8092
|
+
style,
|
|
8093
|
+
children
|
|
8094
|
+
}) {
|
|
8095
|
+
return /* @__PURE__ */ jsx(
|
|
8096
|
+
"div",
|
|
8097
|
+
{
|
|
8098
|
+
className: cn(className),
|
|
8099
|
+
style: {
|
|
8100
|
+
display: "flex",
|
|
8101
|
+
flexWrap: "wrap",
|
|
8102
|
+
gap: 8,
|
|
8103
|
+
justifyContent: "center",
|
|
8104
|
+
marginTop: 8,
|
|
8105
|
+
...style
|
|
8106
|
+
},
|
|
8107
|
+
children
|
|
8108
|
+
}
|
|
8109
|
+
);
|
|
8110
|
+
}
|
|
8111
|
+
var FieldContext = createContext(null);
|
|
8112
|
+
function useField() {
|
|
8113
|
+
const ctx = useContext(FieldContext);
|
|
8114
|
+
if (!ctx) {
|
|
8115
|
+
throw new Error("Field parts must be used inside <Field>.");
|
|
8116
|
+
}
|
|
8117
|
+
return ctx;
|
|
8118
|
+
}
|
|
8119
|
+
function Field({
|
|
8120
|
+
className,
|
|
8121
|
+
style,
|
|
8122
|
+
children,
|
|
8123
|
+
invalid = false,
|
|
8124
|
+
error,
|
|
8125
|
+
...rest
|
|
8126
|
+
}) {
|
|
8127
|
+
const id = useId();
|
|
8128
|
+
const descriptionId = `${id}-description`;
|
|
8129
|
+
const errorId = `${id}-error`;
|
|
8130
|
+
const value = useMemo(
|
|
8131
|
+
() => ({
|
|
8132
|
+
id,
|
|
8133
|
+
descriptionId,
|
|
8134
|
+
errorId,
|
|
8135
|
+
invalid: invalid || Boolean(error),
|
|
8136
|
+
error
|
|
8137
|
+
}),
|
|
8138
|
+
[id, descriptionId, errorId, invalid, error]
|
|
8139
|
+
);
|
|
8140
|
+
return /* @__PURE__ */ jsx(FieldContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
8141
|
+
"div",
|
|
8142
|
+
{
|
|
8143
|
+
className: cn(className),
|
|
8144
|
+
style: {
|
|
8145
|
+
display: "flex",
|
|
8146
|
+
flexDirection: "column",
|
|
8147
|
+
gap: 6,
|
|
8148
|
+
width: "100%",
|
|
8149
|
+
...style
|
|
8150
|
+
},
|
|
8151
|
+
...rest,
|
|
8152
|
+
children
|
|
8153
|
+
}
|
|
8154
|
+
) });
|
|
8155
|
+
}
|
|
8156
|
+
function FieldLabel({ className, style, ...rest }) {
|
|
8157
|
+
const { id } = useField();
|
|
8158
|
+
return /* @__PURE__ */ jsx(Label2, { htmlFor: id, className, style, ...rest });
|
|
8159
|
+
}
|
|
8160
|
+
function FieldDescription({
|
|
8161
|
+
className,
|
|
8162
|
+
style,
|
|
8163
|
+
children,
|
|
8164
|
+
...rest
|
|
8165
|
+
}) {
|
|
8166
|
+
const { descriptionId } = useField();
|
|
8167
|
+
const theme = useSketchTheme();
|
|
8168
|
+
return /* @__PURE__ */ jsx(
|
|
8169
|
+
"p",
|
|
8170
|
+
{
|
|
8171
|
+
id: descriptionId,
|
|
8172
|
+
className: cn(className),
|
|
8173
|
+
style: {
|
|
8174
|
+
margin: 0,
|
|
8175
|
+
fontFamily: doodleUiFontFamily,
|
|
8176
|
+
fontSize: 12,
|
|
8177
|
+
lineHeight: 1.45,
|
|
8178
|
+
color: theme.ink,
|
|
8179
|
+
opacity: 0.75,
|
|
8180
|
+
...style
|
|
8181
|
+
},
|
|
8182
|
+
...rest,
|
|
8183
|
+
children
|
|
8184
|
+
}
|
|
8185
|
+
);
|
|
8186
|
+
}
|
|
8187
|
+
function FieldError({
|
|
8188
|
+
className,
|
|
8189
|
+
style,
|
|
8190
|
+
children,
|
|
8191
|
+
...rest
|
|
8192
|
+
}) {
|
|
8193
|
+
const { error, errorId } = useField();
|
|
8194
|
+
const theme = useSketchTheme();
|
|
8195
|
+
const message = children ?? error;
|
|
8196
|
+
if (!message) return null;
|
|
8197
|
+
return /* @__PURE__ */ jsx(
|
|
8198
|
+
"p",
|
|
8199
|
+
{
|
|
8200
|
+
id: errorId,
|
|
8201
|
+
role: "alert",
|
|
8202
|
+
className: cn(className),
|
|
8203
|
+
style: {
|
|
8204
|
+
margin: 0,
|
|
8205
|
+
fontFamily: doodleUiFontFamily,
|
|
8206
|
+
fontSize: 12,
|
|
8207
|
+
lineHeight: 1.45,
|
|
8208
|
+
color: theme.error,
|
|
8209
|
+
...style
|
|
8210
|
+
},
|
|
8211
|
+
...rest,
|
|
8212
|
+
children: message
|
|
8213
|
+
}
|
|
8214
|
+
);
|
|
8215
|
+
}
|
|
8216
|
+
function FieldControl({ children }) {
|
|
8217
|
+
const { id, descriptionId, errorId, invalid } = useField();
|
|
8218
|
+
const child = Children.only(children);
|
|
8219
|
+
if (!isValidElement(child)) {
|
|
8220
|
+
throw new Error("FieldControl expects a single React element child.");
|
|
8221
|
+
}
|
|
8222
|
+
const describedBy = [descriptionId, invalid ? errorId : null].filter(Boolean).join(" ");
|
|
8223
|
+
const props = child.props;
|
|
8224
|
+
return cloneElement(child, {
|
|
8225
|
+
id: props.id ?? id,
|
|
8226
|
+
"aria-describedby": props["aria-describedby"] ?? (describedBy.length > 0 ? describedBy : void 0),
|
|
8227
|
+
"aria-invalid": invalid ? true : props["aria-invalid"]
|
|
8228
|
+
});
|
|
8229
|
+
}
|
|
8230
|
+
var HEADING_SIZES = {
|
|
8231
|
+
1: 32,
|
|
8232
|
+
2: 26,
|
|
8233
|
+
3: 22,
|
|
8234
|
+
4: 18,
|
|
8235
|
+
5: 16,
|
|
8236
|
+
6: 14
|
|
8237
|
+
};
|
|
8238
|
+
var Heading = forwardRef(
|
|
8239
|
+
function Heading2({
|
|
8240
|
+
level = 2,
|
|
8241
|
+
accent = "none",
|
|
8242
|
+
className,
|
|
8243
|
+
style,
|
|
8244
|
+
children,
|
|
8245
|
+
roughness,
|
|
8246
|
+
seed,
|
|
8247
|
+
sketchColor,
|
|
8248
|
+
bowing,
|
|
8249
|
+
strokeWidth,
|
|
8250
|
+
animate,
|
|
8251
|
+
...rest
|
|
8252
|
+
}, ref) {
|
|
8253
|
+
const Tag = `h${level}`;
|
|
8254
|
+
const theme = useSketchTheme(sketchColor);
|
|
8255
|
+
const ink = sketchColor ?? theme.ink;
|
|
8256
|
+
const accentColor = sketchColor ?? theme.accent;
|
|
8257
|
+
const accentFill = theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill;
|
|
8258
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
8259
|
+
const shouldAnimate = useAnimate(animate);
|
|
8260
|
+
const accentRef = useRef(null);
|
|
8261
|
+
useDrawIn(accentRef, DRAW_IN_MARK_MS, shouldAnimate && accent !== "none");
|
|
8262
|
+
const fontSize = HEADING_SIZES[level];
|
|
8263
|
+
return /* @__PURE__ */ jsxs(
|
|
8264
|
+
Tag,
|
|
8265
|
+
{
|
|
8266
|
+
ref,
|
|
8267
|
+
className: cn(className),
|
|
8268
|
+
style: {
|
|
8269
|
+
position: "relative",
|
|
8270
|
+
margin: 0,
|
|
8271
|
+
fontFamily: doodleUiFontFamily,
|
|
8272
|
+
fontSize,
|
|
8273
|
+
fontWeight: doodleUiFontWeight(700),
|
|
8274
|
+
color: ink,
|
|
8275
|
+
lineHeight: 1.2,
|
|
8276
|
+
...style
|
|
8277
|
+
},
|
|
8278
|
+
...rest,
|
|
8279
|
+
children: [
|
|
8280
|
+
accent === "highlight" ? /* @__PURE__ */ jsxs("span", { style: { position: "relative", display: "inline" }, children: [
|
|
8281
|
+
/* @__PURE__ */ jsx(
|
|
8282
|
+
"span",
|
|
8283
|
+
{
|
|
8284
|
+
ref: accentRef,
|
|
8285
|
+
"aria-hidden": true,
|
|
8286
|
+
style: {
|
|
8287
|
+
position: "absolute",
|
|
8288
|
+
left: -4,
|
|
8289
|
+
right: -4,
|
|
8290
|
+
bottom: 2,
|
|
8291
|
+
height: "0.45em",
|
|
8292
|
+
zIndex: 0
|
|
8293
|
+
},
|
|
8294
|
+
children: /* @__PURE__ */ jsx(
|
|
8295
|
+
RoughSvg,
|
|
8296
|
+
{
|
|
8297
|
+
shape: "rectangle",
|
|
8298
|
+
roughness,
|
|
8299
|
+
seed: resolvedSeed,
|
|
8300
|
+
sketchColor: accentColor,
|
|
8301
|
+
fill: accentFill,
|
|
8302
|
+
fillStyle: "solid",
|
|
8303
|
+
bowing,
|
|
8304
|
+
strokeWidth: strokeWidth ?? 1.2
|
|
8305
|
+
}
|
|
8306
|
+
)
|
|
8307
|
+
}
|
|
8308
|
+
),
|
|
8309
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
|
|
8310
|
+
] }) : children,
|
|
8311
|
+
accent === "underline" ? /* @__PURE__ */ jsx(
|
|
8312
|
+
"span",
|
|
8313
|
+
{
|
|
8314
|
+
ref: accentRef,
|
|
8315
|
+
"aria-hidden": true,
|
|
8316
|
+
style: {
|
|
8317
|
+
display: "block",
|
|
8318
|
+
position: "relative",
|
|
8319
|
+
height: 6,
|
|
8320
|
+
marginTop: 4,
|
|
8321
|
+
maxWidth: "100%"
|
|
8322
|
+
},
|
|
8323
|
+
children: /* @__PURE__ */ jsx(
|
|
8324
|
+
RoughSvg,
|
|
8325
|
+
{
|
|
8326
|
+
shape: "path",
|
|
8327
|
+
path: "M 2 4 Q 40 1 80 5 T 160 3",
|
|
8328
|
+
roughness,
|
|
8329
|
+
seed: resolvedSeed,
|
|
8330
|
+
sketchColor: accentColor,
|
|
8331
|
+
bowing,
|
|
8332
|
+
strokeWidth: strokeWidth ?? 1.5
|
|
8333
|
+
}
|
|
8334
|
+
)
|
|
8335
|
+
}
|
|
8336
|
+
) : null
|
|
8337
|
+
]
|
|
8338
|
+
}
|
|
8339
|
+
);
|
|
8340
|
+
}
|
|
8341
|
+
);
|
|
8342
|
+
var Text = forwardRef(function Text2({ variant = "body", className, style, children, ...rest }, ref) {
|
|
8343
|
+
const theme = useSketchTheme();
|
|
8344
|
+
const sizes = { body: 14, lead: 17, muted: 13 };
|
|
8345
|
+
const opacity = variant === "muted" ? 0.75 : 1;
|
|
8346
|
+
return /* @__PURE__ */ jsx(
|
|
8347
|
+
"p",
|
|
8348
|
+
{
|
|
8349
|
+
ref,
|
|
8350
|
+
className: cn(className),
|
|
8351
|
+
style: {
|
|
8352
|
+
margin: 0,
|
|
8353
|
+
fontFamily: doodleUiFontFamily,
|
|
8354
|
+
fontSize: sizes[variant],
|
|
8355
|
+
fontWeight: doodleUiFontWeight(variant === "lead" ? 500 : 400),
|
|
8356
|
+
lineHeight: 1.55,
|
|
8357
|
+
color: theme.ink,
|
|
8358
|
+
opacity,
|
|
8359
|
+
...style
|
|
8360
|
+
},
|
|
8361
|
+
...rest,
|
|
8362
|
+
children
|
|
8363
|
+
}
|
|
8364
|
+
);
|
|
8365
|
+
});
|
|
8366
|
+
var Paragraph = Text;
|
|
8367
|
+
var Blockquote = forwardRef(
|
|
8368
|
+
function Blockquote2({
|
|
8369
|
+
className,
|
|
8370
|
+
style,
|
|
8371
|
+
children,
|
|
8372
|
+
roughness,
|
|
8373
|
+
seed,
|
|
8374
|
+
sketchColor,
|
|
8375
|
+
bowing,
|
|
8376
|
+
strokeWidth,
|
|
8377
|
+
animate,
|
|
8378
|
+
...rest
|
|
8379
|
+
}, ref) {
|
|
8380
|
+
const theme = useSketchTheme(sketchColor);
|
|
8381
|
+
const ink = sketchColor ?? theme.ink;
|
|
8382
|
+
const accent = sketchColor ?? theme.accent;
|
|
8383
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
8384
|
+
const shouldAnimate = useAnimate(animate);
|
|
8385
|
+
const ruleRef = useRef(null);
|
|
8386
|
+
useDrawIn(ruleRef, DRAW_IN_MARK_MS, shouldAnimate);
|
|
8387
|
+
return /* @__PURE__ */ jsxs(
|
|
8388
|
+
"blockquote",
|
|
8389
|
+
{
|
|
8390
|
+
ref,
|
|
8391
|
+
className: cn(className),
|
|
8392
|
+
style: {
|
|
8393
|
+
display: "flex",
|
|
8394
|
+
gap: 12,
|
|
8395
|
+
margin: 0,
|
|
8396
|
+
padding: "8px 0 8px 4px",
|
|
8397
|
+
fontFamily: doodleUiFontFamily,
|
|
8398
|
+
fontSize: 15,
|
|
8399
|
+
fontStyle: "italic",
|
|
8400
|
+
lineHeight: 1.5,
|
|
8401
|
+
color: ink,
|
|
8402
|
+
...style
|
|
8403
|
+
},
|
|
8404
|
+
...rest,
|
|
8405
|
+
children: [
|
|
8406
|
+
/* @__PURE__ */ jsx(
|
|
8407
|
+
"span",
|
|
8408
|
+
{
|
|
8409
|
+
ref: ruleRef,
|
|
8410
|
+
"aria-hidden": true,
|
|
8411
|
+
style: { position: "relative", width: 6, flexShrink: 0, minHeight: 40 },
|
|
8412
|
+
children: /* @__PURE__ */ jsx(
|
|
8413
|
+
RoughSvg,
|
|
8414
|
+
{
|
|
8415
|
+
shape: "line-vertical",
|
|
8416
|
+
roughness,
|
|
8417
|
+
seed: resolvedSeed,
|
|
8418
|
+
sketchColor: accent,
|
|
8419
|
+
bowing,
|
|
8420
|
+
strokeWidth: strokeWidth ?? 2
|
|
8421
|
+
}
|
|
8422
|
+
)
|
|
8423
|
+
}
|
|
8424
|
+
),
|
|
8425
|
+
/* @__PURE__ */ jsx("span", { children })
|
|
8426
|
+
]
|
|
8427
|
+
}
|
|
8428
|
+
);
|
|
8429
|
+
}
|
|
8430
|
+
);
|
|
8431
|
+
var InlineCode = forwardRef(
|
|
8432
|
+
function InlineCode2({
|
|
8433
|
+
className,
|
|
8434
|
+
style,
|
|
8435
|
+
children,
|
|
8436
|
+
fill,
|
|
8437
|
+
roughness,
|
|
8438
|
+
seed,
|
|
8439
|
+
sketchColor,
|
|
8440
|
+
bowing,
|
|
8441
|
+
fillStyle,
|
|
8442
|
+
strokeWidth,
|
|
8443
|
+
hachureGap,
|
|
8444
|
+
hachureAngle,
|
|
8445
|
+
fillWeight,
|
|
8446
|
+
animate,
|
|
8447
|
+
...rest
|
|
8448
|
+
}, ref) {
|
|
8449
|
+
const theme = useSketchTheme(sketchColor);
|
|
8450
|
+
const ink = sketchColor ?? theme.ink;
|
|
8451
|
+
return /* @__PURE__ */ jsx(
|
|
8452
|
+
SketchBox,
|
|
8453
|
+
{
|
|
8454
|
+
className: cn(className),
|
|
8455
|
+
style: { display: "inline-flex", verticalAlign: "baseline", color: ink, ...style },
|
|
8456
|
+
contentStyle: {
|
|
8457
|
+
padding: "1px 6px",
|
|
8458
|
+
fontSize: "0.9em",
|
|
8459
|
+
fontFamily: "ui-monospace, monospace",
|
|
8460
|
+
color: ink
|
|
8461
|
+
},
|
|
8462
|
+
fill: fill ?? theme.paper,
|
|
8463
|
+
fillStyle: fillStyle ?? "solid",
|
|
8464
|
+
roughness,
|
|
8465
|
+
seed,
|
|
8466
|
+
sketchColor: ink,
|
|
8467
|
+
bowing,
|
|
8468
|
+
strokeWidth: strokeWidth ?? 1.2,
|
|
8469
|
+
hachureGap,
|
|
8470
|
+
hachureAngle,
|
|
8471
|
+
fillWeight,
|
|
8472
|
+
animate,
|
|
8473
|
+
...rest,
|
|
8474
|
+
children: /* @__PURE__ */ jsx(
|
|
8475
|
+
"code",
|
|
8476
|
+
{
|
|
8477
|
+
ref,
|
|
8478
|
+
style: {
|
|
8479
|
+
border: "none",
|
|
8480
|
+
background: "transparent",
|
|
8481
|
+
padding: 0,
|
|
8482
|
+
font: "inherit",
|
|
8483
|
+
color: ink
|
|
8484
|
+
},
|
|
8485
|
+
children
|
|
8486
|
+
}
|
|
8487
|
+
)
|
|
8488
|
+
}
|
|
8489
|
+
);
|
|
8490
|
+
}
|
|
8491
|
+
);
|
|
8492
|
+
var Highlight = forwardRef(
|
|
8493
|
+
function Highlight2({
|
|
8494
|
+
className,
|
|
8495
|
+
style,
|
|
8496
|
+
children,
|
|
8497
|
+
fill,
|
|
8498
|
+
roughness,
|
|
8499
|
+
seed,
|
|
8500
|
+
sketchColor,
|
|
8501
|
+
bowing,
|
|
8502
|
+
strokeWidth,
|
|
8503
|
+
animate,
|
|
8504
|
+
...rest
|
|
8505
|
+
}, ref) {
|
|
8506
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
8507
|
+
const theme = useSketchTheme(sketchColor);
|
|
8508
|
+
const accent = sketchColor ?? theme.accent;
|
|
8509
|
+
const accentFill = fill ?? (theme.isDark ? sketchColor ? `${sketchColor}25` : theme.accentFill : theme.accentFill);
|
|
8510
|
+
const shouldAnimate = useAnimate(animate);
|
|
8511
|
+
const markRef = useRef(null);
|
|
8512
|
+
useDrawIn(markRef, DRAW_IN_MARK_MS, shouldAnimate);
|
|
8513
|
+
return /* @__PURE__ */ jsxs(
|
|
8514
|
+
"span",
|
|
8515
|
+
{
|
|
8516
|
+
ref,
|
|
8517
|
+
className: cn(className),
|
|
8518
|
+
style: { position: "relative", display: "inline", ...style },
|
|
8519
|
+
...rest,
|
|
8520
|
+
children: [
|
|
8521
|
+
/* @__PURE__ */ jsx(
|
|
8522
|
+
"span",
|
|
8523
|
+
{
|
|
8524
|
+
ref: markRef,
|
|
8525
|
+
"aria-hidden": true,
|
|
8526
|
+
style: {
|
|
8527
|
+
position: "absolute",
|
|
8528
|
+
left: -2,
|
|
8529
|
+
right: -2,
|
|
8530
|
+
bottom: 0,
|
|
8531
|
+
top: "35%",
|
|
8532
|
+
zIndex: 0
|
|
8533
|
+
},
|
|
8534
|
+
children: /* @__PURE__ */ jsx(
|
|
8535
|
+
RoughSvg,
|
|
8536
|
+
{
|
|
8537
|
+
shape: "rectangle",
|
|
8538
|
+
roughness,
|
|
8539
|
+
seed: resolvedSeed,
|
|
8540
|
+
sketchColor: accent,
|
|
8541
|
+
fill: accentFill,
|
|
8542
|
+
fillStyle: "solid",
|
|
8543
|
+
bowing,
|
|
8544
|
+
strokeWidth: strokeWidth ?? 1
|
|
8545
|
+
}
|
|
8546
|
+
)
|
|
8547
|
+
}
|
|
8548
|
+
),
|
|
8549
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
|
|
8550
|
+
]
|
|
8551
|
+
}
|
|
8552
|
+
);
|
|
8553
|
+
}
|
|
8554
|
+
);
|
|
8555
|
+
var SIDEBAR_WIDTH = 240;
|
|
8556
|
+
var SIDEBAR_WIDTH_COLLAPSED = 56;
|
|
8557
|
+
var SidebarContext = createContext(null);
|
|
8558
|
+
function useSidebar() {
|
|
8559
|
+
const ctx = useContext(SidebarContext);
|
|
8560
|
+
if (!ctx) {
|
|
8561
|
+
throw new Error("Sidebar parts must be used inside <SidebarProvider>.");
|
|
8562
|
+
}
|
|
8563
|
+
return ctx;
|
|
8564
|
+
}
|
|
8565
|
+
function SidebarProvider({
|
|
8566
|
+
defaultOpen = true,
|
|
8567
|
+
open: openProp,
|
|
8568
|
+
onOpenChange,
|
|
8569
|
+
defaultCollapsed = false,
|
|
8570
|
+
children,
|
|
8571
|
+
roughness,
|
|
8572
|
+
seed,
|
|
8573
|
+
sketchColor,
|
|
8574
|
+
bowing,
|
|
8575
|
+
strokeWidth
|
|
8576
|
+
}) {
|
|
8577
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
8578
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
8579
|
+
const open = openProp ?? uncontrolledOpen;
|
|
8580
|
+
const setOpen = useCallback(
|
|
8581
|
+
(next) => {
|
|
8582
|
+
onOpenChange?.(next);
|
|
8583
|
+
if (openProp === void 0) {
|
|
8584
|
+
setUncontrolledOpen(next);
|
|
8585
|
+
}
|
|
8586
|
+
},
|
|
8587
|
+
[onOpenChange, openProp]
|
|
8588
|
+
);
|
|
8589
|
+
const toggleCollapsed = useCallback(() => {
|
|
8590
|
+
setCollapsed((c) => !c);
|
|
8591
|
+
}, []);
|
|
8592
|
+
const theme = useSketchTheme(sketchColor);
|
|
8593
|
+
const ink = sketchColor ?? theme.ink;
|
|
8594
|
+
const paper = theme.paper;
|
|
8595
|
+
const value = useMemo(
|
|
8596
|
+
() => ({
|
|
8597
|
+
open,
|
|
8598
|
+
setOpen,
|
|
8599
|
+
collapsed,
|
|
8600
|
+
toggleCollapsed,
|
|
8601
|
+
ink,
|
|
8602
|
+
paper,
|
|
8603
|
+
sketch: { roughness, seed, sketchColor: ink, bowing, strokeWidth }
|
|
8604
|
+
}),
|
|
8605
|
+
[
|
|
8606
|
+
open,
|
|
8607
|
+
setOpen,
|
|
8608
|
+
collapsed,
|
|
8609
|
+
toggleCollapsed,
|
|
8610
|
+
ink,
|
|
8611
|
+
paper,
|
|
8612
|
+
roughness,
|
|
8613
|
+
seed,
|
|
8614
|
+
bowing,
|
|
8615
|
+
strokeWidth
|
|
8616
|
+
]
|
|
8617
|
+
);
|
|
8618
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value, children });
|
|
8619
|
+
}
|
|
8620
|
+
var Sidebar = forwardRef(function Sidebar2({ className, style, children, fill, side = "left", ...rest }, ref) {
|
|
8621
|
+
const { open, collapsed, ink, paper, sketch } = useSidebar();
|
|
8622
|
+
const resolvedSeed = useResolvedSeed(sketch.seed);
|
|
8623
|
+
const width = collapsed ? SIDEBAR_WIDTH_COLLAPSED : SIDEBAR_WIDTH;
|
|
8624
|
+
if (!open) {
|
|
8625
|
+
return null;
|
|
8626
|
+
}
|
|
8627
|
+
return /* @__PURE__ */ jsxs(
|
|
8628
|
+
"aside",
|
|
8629
|
+
{
|
|
8630
|
+
ref,
|
|
8631
|
+
className: cn(className),
|
|
8632
|
+
style: {
|
|
8633
|
+
position: "relative",
|
|
8634
|
+
flexShrink: 0,
|
|
8635
|
+
width,
|
|
8636
|
+
minHeight: 200,
|
|
8637
|
+
transition: "width 200ms ease",
|
|
8638
|
+
display: "flex",
|
|
8639
|
+
flexDirection: "column",
|
|
8640
|
+
background: fill ?? paper,
|
|
8641
|
+
color: ink,
|
|
8642
|
+
...style
|
|
8643
|
+
},
|
|
8644
|
+
"data-side": side,
|
|
8645
|
+
...rest,
|
|
8646
|
+
children: [
|
|
8647
|
+
children,
|
|
8648
|
+
/* @__PURE__ */ jsx(
|
|
8649
|
+
"span",
|
|
8650
|
+
{
|
|
8651
|
+
"aria-hidden": true,
|
|
8652
|
+
style: {
|
|
8653
|
+
position: "absolute",
|
|
8654
|
+
top: 0,
|
|
8655
|
+
bottom: 0,
|
|
8656
|
+
width: 4,
|
|
8657
|
+
...side === "left" ? { right: 0 } : { left: 0 },
|
|
8658
|
+
pointerEvents: "none"
|
|
8659
|
+
},
|
|
8660
|
+
children: /* @__PURE__ */ jsx(
|
|
8661
|
+
RoughSvg,
|
|
8662
|
+
{
|
|
8663
|
+
shape: "line-vertical",
|
|
8664
|
+
roughness: sketch.roughness,
|
|
8665
|
+
seed: resolvedSeed,
|
|
8666
|
+
sketchColor: sketch.sketchColor ?? ink,
|
|
8667
|
+
bowing: sketch.bowing,
|
|
8668
|
+
strokeWidth: sketch.strokeWidth ?? 1.5
|
|
8669
|
+
}
|
|
8670
|
+
)
|
|
8671
|
+
}
|
|
8672
|
+
)
|
|
8673
|
+
]
|
|
8674
|
+
}
|
|
8675
|
+
);
|
|
8676
|
+
});
|
|
8677
|
+
function SidebarHeader({
|
|
8678
|
+
className,
|
|
8679
|
+
style,
|
|
8680
|
+
children,
|
|
8681
|
+
...rest
|
|
8682
|
+
}) {
|
|
8683
|
+
const { collapsed, ink } = useSidebar();
|
|
8684
|
+
return /* @__PURE__ */ jsx(
|
|
8685
|
+
"div",
|
|
8686
|
+
{
|
|
8687
|
+
className: cn(className),
|
|
8688
|
+
style: {
|
|
8689
|
+
padding: collapsed ? "12px 8px" : "16px 14px",
|
|
8690
|
+
borderBottom: `1px solid ${ink}22`,
|
|
8691
|
+
...style
|
|
8692
|
+
},
|
|
8693
|
+
...rest,
|
|
8694
|
+
children
|
|
8695
|
+
}
|
|
8696
|
+
);
|
|
8697
|
+
}
|
|
8698
|
+
function SidebarContent({
|
|
8699
|
+
className,
|
|
8700
|
+
style,
|
|
8701
|
+
children,
|
|
8702
|
+
...rest
|
|
8703
|
+
}) {
|
|
8704
|
+
return /* @__PURE__ */ jsx(
|
|
8705
|
+
"div",
|
|
8706
|
+
{
|
|
8707
|
+
className: cn(className),
|
|
8708
|
+
style: {
|
|
8709
|
+
flex: 1,
|
|
8710
|
+
overflow: "auto",
|
|
8711
|
+
padding: "8px 6px",
|
|
8712
|
+
...style
|
|
8713
|
+
},
|
|
8714
|
+
...rest,
|
|
8715
|
+
children
|
|
8716
|
+
}
|
|
8717
|
+
);
|
|
8718
|
+
}
|
|
8719
|
+
function SidebarFooter({
|
|
8720
|
+
className,
|
|
8721
|
+
style,
|
|
8722
|
+
children,
|
|
8723
|
+
...rest
|
|
8724
|
+
}) {
|
|
8725
|
+
const { ink } = useSidebar();
|
|
8726
|
+
return /* @__PURE__ */ jsx(
|
|
8727
|
+
"div",
|
|
8728
|
+
{
|
|
8729
|
+
className: cn(className),
|
|
8730
|
+
style: {
|
|
8731
|
+
padding: "12px 10px",
|
|
8732
|
+
borderTop: `1px solid ${ink}22`,
|
|
8733
|
+
...style
|
|
8734
|
+
},
|
|
8735
|
+
...rest,
|
|
8736
|
+
children
|
|
8737
|
+
}
|
|
8738
|
+
);
|
|
8739
|
+
}
|
|
8740
|
+
function SidebarGroup({
|
|
8741
|
+
className,
|
|
8742
|
+
style,
|
|
8743
|
+
children,
|
|
8744
|
+
title,
|
|
8745
|
+
...rest
|
|
8746
|
+
}) {
|
|
8747
|
+
const { collapsed, ink } = useSidebar();
|
|
8748
|
+
return /* @__PURE__ */ jsxs(
|
|
8749
|
+
"div",
|
|
8750
|
+
{
|
|
8751
|
+
className: cn(className),
|
|
8752
|
+
style: { marginBottom: 12, ...style },
|
|
8753
|
+
...rest,
|
|
8754
|
+
children: [
|
|
8755
|
+
title && !collapsed ? /* @__PURE__ */ jsx(
|
|
8756
|
+
"div",
|
|
8757
|
+
{
|
|
8758
|
+
style: {
|
|
8759
|
+
padding: "4px 10px 8px",
|
|
8760
|
+
fontSize: 11,
|
|
8761
|
+
fontWeight: doodleUiFontWeight(600),
|
|
8762
|
+
fontFamily: doodleUiFontFamily,
|
|
8763
|
+
color: ink,
|
|
8764
|
+
opacity: 0.65,
|
|
8765
|
+
textTransform: "uppercase",
|
|
8766
|
+
letterSpacing: "0.06em"
|
|
8767
|
+
},
|
|
8768
|
+
children: title
|
|
8769
|
+
}
|
|
8770
|
+
) : null,
|
|
8771
|
+
children
|
|
8772
|
+
]
|
|
8773
|
+
}
|
|
8774
|
+
);
|
|
8775
|
+
}
|
|
8776
|
+
var SidebarItem = forwardRef(
|
|
8777
|
+
function SidebarItem2({ className, style, children, active, ...rest }, ref) {
|
|
8778
|
+
const { collapsed, ink, sketch } = useSidebar();
|
|
8779
|
+
return /* @__PURE__ */ jsx(
|
|
8780
|
+
Button,
|
|
8781
|
+
{
|
|
8782
|
+
ref,
|
|
8783
|
+
type: "button",
|
|
8784
|
+
variant: active ? "secondary" : "ghost",
|
|
8785
|
+
className: cn(className),
|
|
8786
|
+
style: {
|
|
8787
|
+
width: "100%",
|
|
8788
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
8789
|
+
marginBottom: 4,
|
|
8790
|
+
...style
|
|
8791
|
+
},
|
|
8792
|
+
roughness: sketch.roughness,
|
|
8793
|
+
seed: sketch.seed,
|
|
8794
|
+
sketchColor: ink,
|
|
8795
|
+
bowing: sketch.bowing,
|
|
8796
|
+
strokeWidth: sketch.strokeWidth,
|
|
8797
|
+
...rest,
|
|
8798
|
+
children
|
|
8799
|
+
}
|
|
8800
|
+
);
|
|
8801
|
+
}
|
|
8802
|
+
);
|
|
8803
|
+
function SidebarTrigger({
|
|
8804
|
+
className,
|
|
8805
|
+
style,
|
|
8806
|
+
children,
|
|
8807
|
+
...rest
|
|
8808
|
+
}) {
|
|
8809
|
+
const { toggleCollapsed, sketch, ink } = useSidebar();
|
|
8810
|
+
return /* @__PURE__ */ jsx(
|
|
8811
|
+
Button,
|
|
8812
|
+
{
|
|
8813
|
+
type: "button",
|
|
8814
|
+
variant: "outline",
|
|
8815
|
+
size: "sm",
|
|
8816
|
+
className: cn(className),
|
|
8817
|
+
style,
|
|
8818
|
+
onClick: toggleCollapsed,
|
|
8819
|
+
roughness: sketch.roughness,
|
|
8820
|
+
seed: sketch.seed,
|
|
8821
|
+
sketchColor: ink,
|
|
8822
|
+
bowing: sketch.bowing,
|
|
8823
|
+
strokeWidth: sketch.strokeWidth,
|
|
8824
|
+
...rest,
|
|
8825
|
+
children: children ?? "Toggle"
|
|
8826
|
+
}
|
|
8827
|
+
);
|
|
8828
|
+
}
|
|
8829
|
+
function SidebarLayout({
|
|
8830
|
+
className,
|
|
8831
|
+
style,
|
|
8832
|
+
children,
|
|
8833
|
+
...rest
|
|
8834
|
+
}) {
|
|
8835
|
+
return /* @__PURE__ */ jsx(
|
|
8836
|
+
"div",
|
|
8837
|
+
{
|
|
8838
|
+
className: cn(className),
|
|
8839
|
+
style: {
|
|
8840
|
+
display: "flex",
|
|
8841
|
+
width: "100%",
|
|
8842
|
+
minHeight: 280,
|
|
8843
|
+
alignItems: "stretch",
|
|
8844
|
+
...style
|
|
8845
|
+
},
|
|
8846
|
+
...rest,
|
|
8847
|
+
children
|
|
8848
|
+
}
|
|
8849
|
+
);
|
|
8850
|
+
}
|
|
8851
|
+
function SidebarInset({
|
|
8852
|
+
className,
|
|
8853
|
+
style,
|
|
8854
|
+
children,
|
|
8855
|
+
...rest
|
|
8856
|
+
}) {
|
|
8857
|
+
return /* @__PURE__ */ jsx(
|
|
8858
|
+
"div",
|
|
8859
|
+
{
|
|
8860
|
+
className: cn(className),
|
|
8861
|
+
style: {
|
|
8862
|
+
flex: 1,
|
|
8863
|
+
padding: 16,
|
|
8864
|
+
minWidth: 0,
|
|
8865
|
+
...style
|
|
8866
|
+
},
|
|
8867
|
+
...rest,
|
|
8868
|
+
children
|
|
8869
|
+
}
|
|
8870
|
+
);
|
|
8871
|
+
}
|
|
8872
|
+
var CarouselContext = createContext(null);
|
|
8873
|
+
function useCarousel() {
|
|
8874
|
+
const ctx = useContext(CarouselContext);
|
|
8875
|
+
if (!ctx) {
|
|
8876
|
+
throw new Error("Carousel parts must be used inside <Carousel>.");
|
|
8877
|
+
}
|
|
8878
|
+
return ctx;
|
|
8879
|
+
}
|
|
8880
|
+
function Carousel({
|
|
8881
|
+
opts,
|
|
8882
|
+
plugins,
|
|
8883
|
+
orientation = "horizontal",
|
|
8884
|
+
bordered = false,
|
|
8885
|
+
className,
|
|
8886
|
+
style,
|
|
8887
|
+
children,
|
|
8888
|
+
setApi,
|
|
8889
|
+
fill,
|
|
8890
|
+
roughness,
|
|
8891
|
+
seed,
|
|
8892
|
+
sketchColor,
|
|
8893
|
+
bowing,
|
|
8894
|
+
strokeWidth,
|
|
8895
|
+
fillStyle,
|
|
8896
|
+
hachureGap,
|
|
8897
|
+
hachureAngle,
|
|
8898
|
+
fillWeight,
|
|
8899
|
+
animate
|
|
8900
|
+
}) {
|
|
8901
|
+
const [emblaRef, api] = useEmblaCarousel(
|
|
8902
|
+
{
|
|
8903
|
+
...opts,
|
|
8904
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
8905
|
+
},
|
|
8906
|
+
plugins
|
|
8907
|
+
);
|
|
8908
|
+
const [canScrollPrev, setCanScrollPrev] = useState(false);
|
|
8909
|
+
const [canScrollNext, setCanScrollNext] = useState(false);
|
|
8910
|
+
const theme = useSketchTheme(sketchColor);
|
|
8911
|
+
const ink = sketchColor ?? theme.ink;
|
|
8912
|
+
const paper = fill ?? theme.paper;
|
|
8913
|
+
const scrollPrev = useCallback(() => api?.scrollPrev(), [api]);
|
|
8914
|
+
const scrollNext = useCallback(() => api?.scrollNext(), [api]);
|
|
8915
|
+
const onSelect = useCallback(() => {
|
|
8916
|
+
if (!api) return;
|
|
8917
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
8918
|
+
setCanScrollNext(api.canScrollNext());
|
|
8919
|
+
}, [api]);
|
|
8920
|
+
useEffect(() => {
|
|
8921
|
+
if (!api) return;
|
|
8922
|
+
setApi?.(api);
|
|
8923
|
+
onSelect();
|
|
8924
|
+
api.on("reInit", onSelect);
|
|
8925
|
+
api.on("select", onSelect);
|
|
8926
|
+
return () => {
|
|
8927
|
+
api.off("reInit", onSelect);
|
|
8928
|
+
api.off("select", onSelect);
|
|
8929
|
+
};
|
|
8930
|
+
}, [api, onSelect, setApi]);
|
|
8931
|
+
const handleKeyDown = useCallback(
|
|
8932
|
+
(event) => {
|
|
8933
|
+
if (orientation === "horizontal") {
|
|
8934
|
+
if (event.key === "ArrowLeft") {
|
|
8935
|
+
event.preventDefault();
|
|
8936
|
+
scrollPrev();
|
|
8937
|
+
} else if (event.key === "ArrowRight") {
|
|
8938
|
+
event.preventDefault();
|
|
8939
|
+
scrollNext();
|
|
8940
|
+
}
|
|
8941
|
+
} else if (event.key === "ArrowUp") {
|
|
8942
|
+
event.preventDefault();
|
|
8943
|
+
scrollPrev();
|
|
8944
|
+
} else if (event.key === "ArrowDown") {
|
|
8945
|
+
event.preventDefault();
|
|
8946
|
+
scrollNext();
|
|
8947
|
+
}
|
|
8948
|
+
},
|
|
8949
|
+
[orientation, scrollPrev, scrollNext]
|
|
8950
|
+
);
|
|
8951
|
+
const value = {
|
|
8952
|
+
emblaRef,
|
|
8953
|
+
api,
|
|
8954
|
+
scrollPrev,
|
|
8955
|
+
scrollNext,
|
|
8956
|
+
canScrollPrev,
|
|
8957
|
+
canScrollNext,
|
|
8958
|
+
orientation,
|
|
8959
|
+
sketch: {
|
|
8960
|
+
roughness,
|
|
8961
|
+
seed,
|
|
8962
|
+
sketchColor: ink,
|
|
8963
|
+
bowing,
|
|
8964
|
+
strokeWidth,
|
|
8965
|
+
fillStyle,
|
|
8966
|
+
hachureGap,
|
|
8967
|
+
hachureAngle,
|
|
8968
|
+
fillWeight,
|
|
8969
|
+
animate,
|
|
8970
|
+
paper,
|
|
8971
|
+
ink
|
|
8972
|
+
},
|
|
8973
|
+
bordered
|
|
8974
|
+
};
|
|
8975
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
8976
|
+
"div",
|
|
8977
|
+
{
|
|
8978
|
+
className: cn(className),
|
|
8979
|
+
role: "region",
|
|
8980
|
+
"aria-roledescription": "carousel",
|
|
8981
|
+
tabIndex: 0,
|
|
8982
|
+
onKeyDown: handleKeyDown,
|
|
8983
|
+
style: {
|
|
8984
|
+
position: "relative",
|
|
8985
|
+
width: "100%",
|
|
8986
|
+
outline: "none",
|
|
8987
|
+
color: ink,
|
|
8988
|
+
...style
|
|
8989
|
+
},
|
|
8990
|
+
children
|
|
8991
|
+
}
|
|
8992
|
+
) });
|
|
8993
|
+
}
|
|
8994
|
+
var CarouselContent = forwardRef(
|
|
8995
|
+
function CarouselContent2({ className, style, children, ...rest }, ref) {
|
|
8996
|
+
const { emblaRef, orientation, bordered, sketch } = useCarousel();
|
|
8997
|
+
const viewport = /* @__PURE__ */ jsx("div", { ref: emblaRef, style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
8998
|
+
"div",
|
|
8999
|
+
{
|
|
9000
|
+
ref,
|
|
9001
|
+
className: cn(className),
|
|
9002
|
+
style: {
|
|
9003
|
+
display: "flex",
|
|
9004
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
9005
|
+
marginLeft: orientation === "horizontal" ? -16 : 0,
|
|
9006
|
+
marginTop: orientation === "vertical" ? -16 : 0,
|
|
9007
|
+
...style
|
|
9008
|
+
},
|
|
9009
|
+
...rest,
|
|
9010
|
+
children
|
|
9011
|
+
}
|
|
9012
|
+
) });
|
|
9013
|
+
if (!bordered) {
|
|
9014
|
+
return viewport;
|
|
9015
|
+
}
|
|
9016
|
+
return /* @__PURE__ */ jsx(
|
|
9017
|
+
SketchBox,
|
|
9018
|
+
{
|
|
9019
|
+
fill: sketch.paper,
|
|
9020
|
+
fillStyle: sketch.fillStyle ?? "solid",
|
|
9021
|
+
roughness: sketch.roughness,
|
|
9022
|
+
seed: sketch.seed,
|
|
9023
|
+
sketchColor: sketch.sketchColor,
|
|
9024
|
+
bowing: sketch.bowing,
|
|
9025
|
+
strokeWidth: sketch.strokeWidth,
|
|
9026
|
+
hachureGap: sketch.hachureGap,
|
|
9027
|
+
hachureAngle: sketch.hachureAngle,
|
|
9028
|
+
fillWeight: sketch.fillWeight,
|
|
9029
|
+
animate: sketch.animate,
|
|
9030
|
+
contentStyle: { padding: 8, color: sketch.ink },
|
|
9031
|
+
children: viewport
|
|
9032
|
+
}
|
|
9033
|
+
);
|
|
9034
|
+
}
|
|
9035
|
+
);
|
|
9036
|
+
var CarouselItem = forwardRef(
|
|
9037
|
+
function CarouselItem2({ className, style, children, ...rest }, ref) {
|
|
9038
|
+
const { orientation } = useCarousel();
|
|
9039
|
+
const gap = 16;
|
|
9040
|
+
return /* @__PURE__ */ jsx(
|
|
9041
|
+
"div",
|
|
9042
|
+
{
|
|
9043
|
+
ref,
|
|
9044
|
+
className: cn(className),
|
|
9045
|
+
role: "group",
|
|
9046
|
+
"aria-roledescription": "slide",
|
|
9047
|
+
style: {
|
|
9048
|
+
flex: "0 0 100%",
|
|
9049
|
+
minWidth: 0,
|
|
9050
|
+
paddingLeft: orientation === "horizontal" ? gap : 0,
|
|
9051
|
+
paddingTop: orientation === "vertical" ? gap : 0,
|
|
9052
|
+
...style
|
|
9053
|
+
},
|
|
9054
|
+
...rest,
|
|
9055
|
+
children
|
|
9056
|
+
}
|
|
9057
|
+
);
|
|
9058
|
+
}
|
|
9059
|
+
);
|
|
9060
|
+
var ARROW_PATH_PREV = "M 14 4 L 6 12 L 14 20";
|
|
9061
|
+
var ARROW_PATH_NEXT = "M 6 4 L 14 12 L 6 20";
|
|
9062
|
+
var ARROW_SIZE = 40;
|
|
9063
|
+
var CarouselArrow = forwardRef(function CarouselArrow2({ className, style, direction, ...rest }, ref) {
|
|
9064
|
+
const {
|
|
9065
|
+
scrollPrev,
|
|
9066
|
+
scrollNext,
|
|
9067
|
+
canScrollPrev,
|
|
9068
|
+
canScrollNext,
|
|
9069
|
+
sketch,
|
|
9070
|
+
orientation
|
|
9071
|
+
} = useCarousel();
|
|
9072
|
+
const resolvedSeed = useResolvedSeed(sketch.seed);
|
|
9073
|
+
const ink = sketch.sketchColor ?? sketch.ink;
|
|
9074
|
+
const isPrev = direction === "prev";
|
|
9075
|
+
const disabled = isPrev ? !canScrollPrev : !canScrollNext;
|
|
9076
|
+
const shouldAnimate = useAnimate(sketch.animate);
|
|
9077
|
+
const rootRef = useRef(null);
|
|
9078
|
+
const sketchSeed = deriveSeed(resolvedSeed, direction);
|
|
9079
|
+
useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
|
|
9080
|
+
const horizontal = orientation === "horizontal";
|
|
9081
|
+
return /* @__PURE__ */ jsxs(
|
|
9082
|
+
"button",
|
|
9083
|
+
{
|
|
9084
|
+
ref: (node) => {
|
|
9085
|
+
rootRef.current = node;
|
|
9086
|
+
assignRef(ref, node);
|
|
9087
|
+
},
|
|
9088
|
+
type: "button",
|
|
9089
|
+
disabled,
|
|
9090
|
+
className: cn(className),
|
|
9091
|
+
style: {
|
|
9092
|
+
position: "absolute",
|
|
9093
|
+
zIndex: 2,
|
|
9094
|
+
width: ARROW_SIZE,
|
|
9095
|
+
height: ARROW_SIZE,
|
|
9096
|
+
padding: 0,
|
|
9097
|
+
border: "none",
|
|
9098
|
+
background: "transparent",
|
|
9099
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
9100
|
+
opacity: disabled ? 0.5 : 1,
|
|
9101
|
+
...horizontal ? {
|
|
9102
|
+
top: "50%",
|
|
9103
|
+
transform: "translateY(-50%)",
|
|
9104
|
+
left: isPrev ? -52 : void 0,
|
|
9105
|
+
right: isPrev ? void 0 : -52
|
|
9106
|
+
} : {
|
|
9107
|
+
left: "50%",
|
|
9108
|
+
transform: "translateX(-50%) rotate(90deg)",
|
|
9109
|
+
top: isPrev ? -52 : void 0,
|
|
9110
|
+
bottom: isPrev ? void 0 : -52
|
|
9111
|
+
},
|
|
9112
|
+
...style
|
|
9113
|
+
},
|
|
9114
|
+
onClick: isPrev ? scrollPrev : scrollNext,
|
|
9115
|
+
"aria-label": isPrev ? "Previous slide" : "Next slide",
|
|
9116
|
+
...rest,
|
|
9117
|
+
children: [
|
|
9118
|
+
/* @__PURE__ */ jsx(
|
|
9119
|
+
RoughSvg,
|
|
9120
|
+
{
|
|
9121
|
+
shape: "ellipse",
|
|
9122
|
+
roughness: sketch.roughness,
|
|
9123
|
+
seed: sketchSeed,
|
|
9124
|
+
sketchColor: ink,
|
|
9125
|
+
bowing: sketch.bowing,
|
|
9126
|
+
fill: sketch.paper,
|
|
9127
|
+
fillStyle: "solid",
|
|
9128
|
+
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
9129
|
+
inset: 1.5
|
|
9130
|
+
}
|
|
9131
|
+
),
|
|
9132
|
+
/* @__PURE__ */ jsx(
|
|
9133
|
+
"span",
|
|
9134
|
+
{
|
|
9135
|
+
style: {
|
|
9136
|
+
position: "relative",
|
|
9137
|
+
zIndex: 1,
|
|
9138
|
+
width: 18,
|
|
9139
|
+
height: 22,
|
|
9140
|
+
display: "block",
|
|
9141
|
+
margin: "0 auto"
|
|
9142
|
+
},
|
|
9143
|
+
children: /* @__PURE__ */ jsx(
|
|
9144
|
+
RoughSvg,
|
|
9145
|
+
{
|
|
9146
|
+
shape: "path",
|
|
9147
|
+
path: isPrev ? ARROW_PATH_PREV : ARROW_PATH_NEXT,
|
|
9148
|
+
roughness: sketch.roughness,
|
|
9149
|
+
seed: deriveSeed(resolvedSeed, `${direction}-arrow`),
|
|
9150
|
+
sketchColor: ink,
|
|
9151
|
+
strokeWidth: sketch.strokeWidth ?? 1.6
|
|
9152
|
+
}
|
|
9153
|
+
)
|
|
9154
|
+
}
|
|
9155
|
+
)
|
|
9156
|
+
]
|
|
9157
|
+
}
|
|
9158
|
+
);
|
|
9159
|
+
});
|
|
9160
|
+
var CarouselPrevious = forwardRef(
|
|
9161
|
+
function CarouselPrevious2(props, ref) {
|
|
9162
|
+
return /* @__PURE__ */ jsx(CarouselArrow, { ref, direction: "prev", ...props });
|
|
9163
|
+
}
|
|
9164
|
+
);
|
|
9165
|
+
var CarouselNext = forwardRef(
|
|
9166
|
+
function CarouselNext2(props, ref) {
|
|
9167
|
+
return /* @__PURE__ */ jsx(CarouselArrow, { ref, direction: "next", ...props });
|
|
9168
|
+
}
|
|
9169
|
+
);
|
|
7186
9170
|
|
|
7187
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, Badge, Breadcrumb, BreadcrumbItem, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuTrigger, DEFAULT_BOWING, DEFAULT_INK, DEFAULT_ROUGHNESS, DEFAULT_STROKE_WIDTH, DRAW_IN_ALERT_MS, DRAW_IN_DURATION_MS, DRAW_IN_MARK_MS, DRAW_IN_TOOLTIP_MS, Dialog2 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DoodleUIProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuTrigger, HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, Label2 as Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, ModalClose, ModalDescription, ModalRoot, ModalTitle, ModalTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuItemLink, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, RoughSvg, SKETCH_COLORS, ScrollArea, ScrollAreaCorner, ScrollAreaViewport, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, SketchBox, SketchSeedProvider, Slider, Spinner, Stepper, Switch, TABLE_STAGGER_MS, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useDoodleUI, useDrawIn, useResolvedSeed, useSketchSeed };
|
|
9171
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AspectRatio, Avatar, Badge, Blockquote, Breadcrumb, BreadcrumbItem, Button, Card, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuTrigger, DARK_SKETCH_COLORS, DEFAULT_BOWING, DEFAULT_DARK_CARD_BG, DEFAULT_DARK_INK, DEFAULT_DARK_PAPER, DEFAULT_INK, DEFAULT_PAPER, DEFAULT_ROUGHNESS, DEFAULT_STROKE_WIDTH, DRAW_IN_ALERT_MS, DRAW_IN_DURATION_MS, DRAW_IN_MARK_MS, DRAW_IN_TOOLTIP_MS, Dialog2 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DoodleUIProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuTrigger, Empty, EmptyAction, EmptyDescription, EmptyMedia, EmptyTitle, Field, FieldControl, FieldDescription, FieldError, FieldLabel, Heading, Highlight, HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, Label2 as Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, ModalClose, ModalDescription, ModalRoot, ModalTitle, ModalTrigger, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuItemLink, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Paragraph, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, RoughSvg, SKETCH_COLORS, ScrollArea, ScrollAreaCorner, ScrollAreaViewport, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarInset, SidebarItem, SidebarLayout, SidebarProvider, SidebarTrigger, Skeleton, SketchBox, SketchSeedProvider, Slider, Spinner, Stepper, Switch, TABLE_STAGGER_MS, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Text, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useCarousel, useDoodleUI, useDrawIn, useResolvedSeed, useSidebar, useSketchSeed, useSketchTheme };
|
|
7188
9172
|
//# sourceMappingURL=index.js.map
|
|
7189
9173
|
//# sourceMappingURL=index.js.map
|