doodleui-react 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14,6 +14,21 @@ import * as ToastPrimitive from '@radix-ui/react-toast';
14
14
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
15
15
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
16
16
  import * as SliderPrimitive from '@radix-ui/react-slider';
17
+ import * as LabelPrimitive from '@radix-ui/react-label';
18
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
19
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
20
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
21
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
22
+ import { Command as Command$1, CommandInput as CommandInput$1, CommandList as CommandList$1, CommandEmpty as CommandEmpty$1, CommandGroup as CommandGroup$1, CommandItem as CommandItem$1, CommandSeparator as CommandSeparator$1 } from 'cmdk';
23
+ import * as TogglePrimitive from '@radix-ui/react-toggle';
24
+ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
25
+ import { OTPInput, OTPInputContext } from 'input-otp';
26
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
27
+ import * as ResizablePrimitive from 'react-resizable-panels';
28
+ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
29
+ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
30
+ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
31
+ import * as MenubarPrimitive from '@radix-ui/react-menubar';
17
32
 
18
33
  // src/types.ts
19
34
  function toRoughOptions(props) {
@@ -3697,7 +3712,3478 @@ var Stepper = forwardRef(
3697
3712
  );
3698
3713
  }
3699
3714
  );
3715
+ var Label2 = forwardRef(function Label3({
3716
+ className,
3717
+ style,
3718
+ children,
3719
+ required,
3720
+ roughness,
3721
+ seed,
3722
+ sketchColor,
3723
+ bowing,
3724
+ strokeWidth,
3725
+ animate,
3726
+ ...rest
3727
+ }, ref) {
3728
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
3729
+ const resolvedSeed = useResolvedSeed(seed);
3730
+ const shouldAnimate = useAnimate(animate);
3731
+ const markRef = useRef(null);
3732
+ useDrawIn(markRef, DRAW_IN_MARK_MS, shouldAnimate);
3733
+ return /* @__PURE__ */ jsxs(
3734
+ LabelPrimitive.Root,
3735
+ {
3736
+ ref,
3737
+ className: cn(className),
3738
+ style: {
3739
+ display: "inline-flex",
3740
+ alignItems: "center",
3741
+ gap: 4,
3742
+ fontFamily: doodleUiFontFamily,
3743
+ fontSize: 13,
3744
+ fontWeight: doodleUiFontWeight(600),
3745
+ color: ink,
3746
+ cursor: "default",
3747
+ ...style
3748
+ },
3749
+ ...rest,
3750
+ children: [
3751
+ children,
3752
+ required ? /* @__PURE__ */ jsx(
3753
+ "span",
3754
+ {
3755
+ ref: markRef,
3756
+ "aria-hidden": "true",
3757
+ style: { position: "relative", width: 10, height: 10, flexShrink: 0 },
3758
+ children: /* @__PURE__ */ jsx(
3759
+ RoughSvg,
3760
+ {
3761
+ shape: "ellipse",
3762
+ roughness: (roughness ?? 1.5) * 0.9,
3763
+ seed: resolvedSeed,
3764
+ sketchColor: SKETCH_COLORS.accent,
3765
+ bowing,
3766
+ fillStyle: "solid",
3767
+ fill: SKETCH_COLORS.accent,
3768
+ strokeWidth: strokeWidth ?? 1.2,
3769
+ inset: 1
3770
+ }
3771
+ )
3772
+ }
3773
+ ) : null
3774
+ ]
3775
+ }
3776
+ );
3777
+ });
3778
+ var CHEVRON_PATH4 = "M 6 4 L 12 10 L 6 16";
3779
+ var CollapsibleSketchContext = createContext(null);
3780
+ function useCollapsibleSketch() {
3781
+ const ctx = useContext(CollapsibleSketchContext);
3782
+ if (!ctx) {
3783
+ throw new Error(
3784
+ "Collapsible parts must be used inside <Collapsible>."
3785
+ );
3786
+ }
3787
+ return ctx;
3788
+ }
3789
+ var Collapsible = forwardRef(
3790
+ function Collapsible2({
3791
+ className,
3792
+ style,
3793
+ children,
3794
+ open,
3795
+ defaultOpen,
3796
+ onOpenChange,
3797
+ disabled,
3798
+ roughness,
3799
+ seed,
3800
+ sketchColor,
3801
+ bowing,
3802
+ fillStyle,
3803
+ strokeWidth,
3804
+ ...rest
3805
+ }, ref) {
3806
+ const resolvedSeed = useResolvedSeed(seed);
3807
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
3808
+ const [uncontrolled, setUncontrolled] = useState(defaultOpen ?? false);
3809
+ const isOpen = open ?? uncontrolled;
3810
+ return /* @__PURE__ */ jsx(
3811
+ CollapsibleSketchContext.Provider,
3812
+ {
3813
+ value: {
3814
+ roughness,
3815
+ seed: resolvedSeed,
3816
+ sketchColor,
3817
+ bowing,
3818
+ fillStyle,
3819
+ strokeWidth,
3820
+ resolvedSeed,
3821
+ ink,
3822
+ open: isOpen
3823
+ },
3824
+ children: /* @__PURE__ */ jsx(
3825
+ CollapsiblePrimitive.Root,
3826
+ {
3827
+ ref,
3828
+ open: isOpen,
3829
+ disabled,
3830
+ className: cn(className),
3831
+ style,
3832
+ onOpenChange: (next) => {
3833
+ setUncontrolled(next);
3834
+ onOpenChange?.(next);
3835
+ },
3836
+ ...rest,
3837
+ children
3838
+ }
3839
+ )
3840
+ }
3841
+ );
3842
+ }
3843
+ );
3844
+ var CollapsibleTrigger = forwardRef(function CollapsibleTrigger2({ className, style, children, ...rest }, ref) {
3845
+ const sketch = useCollapsibleSketch();
3846
+ return /* @__PURE__ */ jsxs(
3847
+ CollapsiblePrimitive.Trigger,
3848
+ {
3849
+ ref,
3850
+ className: cn(className),
3851
+ style: {
3852
+ display: "flex",
3853
+ width: "100%",
3854
+ alignItems: "center",
3855
+ justifyContent: "space-between",
3856
+ gap: 12,
3857
+ padding: "10px 4px",
3858
+ border: "none",
3859
+ background: "transparent",
3860
+ cursor: "pointer",
3861
+ fontFamily: doodleUiFontFamily,
3862
+ fontSize: 15,
3863
+ fontWeight: doodleUiFontWeight(600),
3864
+ color: sketch.ink,
3865
+ textAlign: "left",
3866
+ outline: "none",
3867
+ ...style
3868
+ },
3869
+ ...rest,
3870
+ children: [
3871
+ /* @__PURE__ */ jsx("span", { children }),
3872
+ /* @__PURE__ */ jsx(
3873
+ "span",
3874
+ {
3875
+ style: {
3876
+ position: "relative",
3877
+ width: 18,
3878
+ height: 18,
3879
+ flexShrink: 0,
3880
+ transform: sketch.open ? "rotate(90deg)" : "rotate(0deg)",
3881
+ transition: "transform 180ms ease"
3882
+ },
3883
+ children: /* @__PURE__ */ jsx(
3884
+ RoughSvg,
3885
+ {
3886
+ shape: "path",
3887
+ path: CHEVRON_PATH4,
3888
+ roughness: (sketch.roughness ?? 1.5) * 0.7,
3889
+ seed: sketch.resolvedSeed,
3890
+ sketchColor: sketch.ink,
3891
+ bowing: sketch.bowing,
3892
+ strokeWidth: (sketch.strokeWidth ?? 1.6) + 0.2,
3893
+ inset: 0
3894
+ }
3895
+ )
3896
+ }
3897
+ )
3898
+ ]
3899
+ }
3900
+ );
3901
+ });
3902
+ var CollapsibleContent = forwardRef(function CollapsibleContent2({ className, style, children, ...rest }, ref) {
3903
+ const sketch = useCollapsibleSketch();
3904
+ return /* @__PURE__ */ jsx(
3905
+ CollapsiblePrimitive.Content,
3906
+ {
3907
+ ref,
3908
+ className: cn(className),
3909
+ style: {
3910
+ padding: "0 4px 12px",
3911
+ fontFamily: doodleUiFontFamily,
3912
+ fontSize: 14,
3913
+ lineHeight: 1.5,
3914
+ color: sketch.ink,
3915
+ ...style
3916
+ },
3917
+ ...rest,
3918
+ children
3919
+ }
3920
+ );
3921
+ });
3922
+ var PopoverSketchContext = createContext(
3923
+ null
3924
+ );
3925
+ function usePopoverSketch() {
3926
+ const ctx = useContext(PopoverSketchContext);
3927
+ if (!ctx) {
3928
+ throw new Error("Popover parts must be used inside <Popover>.");
3929
+ }
3930
+ return ctx;
3931
+ }
3932
+ function Popover({
3933
+ children,
3934
+ roughness,
3935
+ seed,
3936
+ sketchColor,
3937
+ bowing,
3938
+ fillStyle,
3939
+ strokeWidth,
3940
+ animate,
3941
+ ...rest
3942
+ }) {
3943
+ const resolvedSeed = useResolvedSeed(seed);
3944
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
3945
+ return /* @__PURE__ */ jsx(
3946
+ PopoverSketchContext.Provider,
3947
+ {
3948
+ value: {
3949
+ roughness,
3950
+ seed: resolvedSeed,
3951
+ sketchColor,
3952
+ bowing,
3953
+ fillStyle,
3954
+ strokeWidth,
3955
+ resolvedSeed,
3956
+ ink,
3957
+ animate
3958
+ },
3959
+ children: /* @__PURE__ */ jsx(PopoverPrimitive.Root, { ...rest, children })
3960
+ }
3961
+ );
3962
+ }
3963
+ var PopoverTrigger = PopoverPrimitive.Trigger;
3964
+ var PopoverAnchor = PopoverPrimitive.Anchor;
3965
+ var PopoverClose = PopoverPrimitive.Close;
3966
+ var PopoverContent = forwardRef(
3967
+ function PopoverContent2({ className, style, children, sideOffset = 8, ...rest }, ref) {
3968
+ const sketch = usePopoverSketch();
3969
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
3970
+ PopoverPrimitive.Content,
3971
+ {
3972
+ ref,
3973
+ sideOffset,
3974
+ className: cn(className),
3975
+ style: { zIndex: 80, outline: "none", ...style },
3976
+ ...rest,
3977
+ children: /* @__PURE__ */ jsx(
3978
+ SketchBox,
3979
+ {
3980
+ roughness: sketch.roughness,
3981
+ seed: sketch.resolvedSeed,
3982
+ sketchColor: sketch.ink,
3983
+ bowing: sketch.bowing,
3984
+ fillStyle: sketch.fillStyle ?? "solid",
3985
+ fill: "#f7f6f2",
3986
+ strokeWidth: sketch.strokeWidth ?? 1.5,
3987
+ shadow: true,
3988
+ animate: sketch.animate,
3989
+ contentStyle: { padding: "14px 16px", minWidth: 200 },
3990
+ children
3991
+ }
3992
+ )
3993
+ }
3994
+ ) });
3995
+ }
3996
+ );
3997
+ var PopoverArrow = forwardRef(
3998
+ function PopoverArrow2(props, ref) {
3999
+ const sketch = usePopoverSketch();
4000
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Arrow, { ref, fill: sketch.ink, ...props });
4001
+ }
4002
+ );
4003
+ var DropdownMenuSketchContext = createContext(null);
4004
+ function useDropdownMenuSketch() {
4005
+ const ctx = useContext(DropdownMenuSketchContext);
4006
+ if (!ctx) {
4007
+ throw new Error(
4008
+ "DropdownMenu parts must be used inside <DropdownMenu>."
4009
+ );
4010
+ }
4011
+ return ctx;
4012
+ }
4013
+ function DropdownMenu({
4014
+ children,
4015
+ roughness,
4016
+ seed,
4017
+ sketchColor,
4018
+ bowing,
4019
+ fillStyle,
4020
+ strokeWidth,
4021
+ animate,
4022
+ ...rest
4023
+ }) {
4024
+ const resolvedSeed = useResolvedSeed(seed);
4025
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4026
+ return /* @__PURE__ */ jsx(
4027
+ DropdownMenuSketchContext.Provider,
4028
+ {
4029
+ value: {
4030
+ roughness,
4031
+ seed: resolvedSeed,
4032
+ sketchColor,
4033
+ bowing,
4034
+ fillStyle,
4035
+ strokeWidth,
4036
+ resolvedSeed,
4037
+ ink,
4038
+ animate
4039
+ },
4040
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { ...rest, children })
4041
+ }
4042
+ );
4043
+ }
4044
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
4045
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
4046
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
4047
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
4048
+ var DropdownMenuContent = forwardRef(function DropdownMenuContent2({ className, style, children, sideOffset = 6, align = "start", ...rest }, ref) {
4049
+ const sketch = useDropdownMenuSketch();
4050
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
4051
+ DropdownMenuPrimitive.Content,
4052
+ {
4053
+ ref,
4054
+ sideOffset,
4055
+ align,
4056
+ className: cn(className),
4057
+ style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
4058
+ ...rest,
4059
+ children: /* @__PURE__ */ jsx(
4060
+ SketchBox,
4061
+ {
4062
+ roughness: sketch.roughness,
4063
+ seed: sketch.resolvedSeed,
4064
+ sketchColor: sketch.ink,
4065
+ bowing: sketch.bowing,
4066
+ fillStyle: sketch.fillStyle ?? "solid",
4067
+ fill: "#f7f6f2",
4068
+ strokeWidth: sketch.strokeWidth ?? 1.5,
4069
+ shadow: true,
4070
+ animate: sketch.animate,
4071
+ contentStyle: { padding: "6px 4px" },
4072
+ children
4073
+ }
4074
+ )
4075
+ }
4076
+ ) });
4077
+ });
4078
+ function useMark(highlighted) {
4079
+ const sketch = useDropdownMenuSketch();
4080
+ return { sketch, mark: highlighted };
4081
+ }
4082
+ var DropdownMenuItem = forwardRef(function DropdownMenuItem2({ className, style, children, inset, ...rest }, ref) {
4083
+ const [highlighted, setHighlighted] = useState(false);
4084
+ const { sketch, mark } = useMark(highlighted);
4085
+ return /* @__PURE__ */ jsxs(
4086
+ DropdownMenuPrimitive.Item,
4087
+ {
4088
+ ref,
4089
+ className: cn(className),
4090
+ onPointerMove: () => setHighlighted(true),
4091
+ onPointerLeave: () => setHighlighted(false),
4092
+ onFocus: () => setHighlighted(true),
4093
+ onBlur: () => setHighlighted(false),
4094
+ style: {
4095
+ position: "relative",
4096
+ display: "flex",
4097
+ alignItems: "center",
4098
+ gap: 8,
4099
+ padding: inset ? "7px 12px 7px 26px" : "7px 12px",
4100
+ fontFamily: doodleUiFontFamily,
4101
+ fontSize: 14,
4102
+ color: sketch.ink,
4103
+ outline: "none",
4104
+ cursor: "pointer",
4105
+ userSelect: "none",
4106
+ ...style
4107
+ },
4108
+ ...rest,
4109
+ children: [
4110
+ mark ? /* @__PURE__ */ jsx(
4111
+ RoughSvg,
4112
+ {
4113
+ shape: "line",
4114
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4115
+ seed: sketch.resolvedSeed,
4116
+ sketchColor: sketch.ink,
4117
+ bowing: sketch.bowing ?? 1.6,
4118
+ strokeWidth: 1.3,
4119
+ inset: 4,
4120
+ style: { opacity: 0.4 }
4121
+ }
4122
+ ) : null,
4123
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
4124
+ ]
4125
+ }
4126
+ );
4127
+ });
4128
+ var CHECK_PATH2 = "M 2 6 L 5 9 L 10 3";
4129
+ var DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({ className, style, children, checked, ...rest }, ref) {
4130
+ const [highlighted, setHighlighted] = useState(false);
4131
+ const { sketch, mark } = useMark(highlighted);
4132
+ return /* @__PURE__ */ jsxs(
4133
+ DropdownMenuPrimitive.CheckboxItem,
4134
+ {
4135
+ ref,
4136
+ checked,
4137
+ className: cn(className),
4138
+ onPointerMove: () => setHighlighted(true),
4139
+ onPointerLeave: () => setHighlighted(false),
4140
+ style: {
4141
+ position: "relative",
4142
+ display: "flex",
4143
+ alignItems: "center",
4144
+ gap: 8,
4145
+ padding: "7px 12px 7px 26px",
4146
+ fontFamily: doodleUiFontFamily,
4147
+ fontSize: 14,
4148
+ color: sketch.ink,
4149
+ outline: "none",
4150
+ cursor: "pointer",
4151
+ userSelect: "none",
4152
+ ...style
4153
+ },
4154
+ ...rest,
4155
+ children: [
4156
+ mark ? /* @__PURE__ */ jsx(
4157
+ RoughSvg,
4158
+ {
4159
+ shape: "line",
4160
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4161
+ seed: sketch.resolvedSeed,
4162
+ sketchColor: sketch.ink,
4163
+ bowing: sketch.bowing ?? 1.6,
4164
+ strokeWidth: 1.3,
4165
+ inset: 4,
4166
+ style: { opacity: 0.4 }
4167
+ }
4168
+ ) : null,
4169
+ /* @__PURE__ */ jsx(
4170
+ "span",
4171
+ {
4172
+ style: {
4173
+ position: "relative",
4174
+ width: 12,
4175
+ height: 12,
4176
+ flexShrink: 0,
4177
+ marginLeft: -18
4178
+ },
4179
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
4180
+ RoughSvg,
4181
+ {
4182
+ shape: "path",
4183
+ path: CHECK_PATH2,
4184
+ roughness: (sketch.roughness ?? 1.5) * 0.7,
4185
+ seed: deriveSeed(sketch.resolvedSeed, "checkbox-mark"),
4186
+ sketchColor: SKETCH_COLORS.accent,
4187
+ bowing: sketch.bowing,
4188
+ strokeWidth: 1.6,
4189
+ inset: 0
4190
+ }
4191
+ ) })
4192
+ }
4193
+ ),
4194
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
4195
+ ]
4196
+ }
4197
+ );
4198
+ });
4199
+ var DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({ className, style, children, ...rest }, ref) {
4200
+ const [highlighted, setHighlighted] = useState(false);
4201
+ const { sketch, mark } = useMark(highlighted);
4202
+ return /* @__PURE__ */ jsxs(
4203
+ DropdownMenuPrimitive.RadioItem,
4204
+ {
4205
+ ref,
4206
+ className: cn(className),
4207
+ onPointerMove: () => setHighlighted(true),
4208
+ onPointerLeave: () => setHighlighted(false),
4209
+ style: {
4210
+ position: "relative",
4211
+ display: "flex",
4212
+ alignItems: "center",
4213
+ gap: 8,
4214
+ padding: "7px 12px 7px 26px",
4215
+ fontFamily: doodleUiFontFamily,
4216
+ fontSize: 14,
4217
+ color: sketch.ink,
4218
+ outline: "none",
4219
+ cursor: "pointer",
4220
+ userSelect: "none",
4221
+ ...style
4222
+ },
4223
+ ...rest,
4224
+ children: [
4225
+ mark ? /* @__PURE__ */ jsx(
4226
+ RoughSvg,
4227
+ {
4228
+ shape: "line",
4229
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4230
+ seed: sketch.resolvedSeed,
4231
+ sketchColor: sketch.ink,
4232
+ bowing: sketch.bowing ?? 1.6,
4233
+ strokeWidth: 1.3,
4234
+ inset: 4,
4235
+ style: { opacity: 0.4 }
4236
+ }
4237
+ ) : null,
4238
+ /* @__PURE__ */ jsx(
4239
+ "span",
4240
+ {
4241
+ style: {
4242
+ position: "relative",
4243
+ width: 8,
4244
+ height: 8,
4245
+ flexShrink: 0,
4246
+ marginLeft: -18
4247
+ },
4248
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
4249
+ RoughSvg,
4250
+ {
4251
+ shape: "ellipse",
4252
+ roughness: (sketch.roughness ?? 1.5) * 0.8,
4253
+ seed: deriveSeed(sketch.resolvedSeed, "radio-mark"),
4254
+ sketchColor: SKETCH_COLORS.accent,
4255
+ bowing: sketch.bowing,
4256
+ fillStyle: "solid",
4257
+ fill: SKETCH_COLORS.accent,
4258
+ strokeWidth: 1.2,
4259
+ inset: 0
4260
+ }
4261
+ ) })
4262
+ }
4263
+ ),
4264
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
4265
+ ]
4266
+ }
4267
+ );
4268
+ });
4269
+ var DropdownMenuLabel = forwardRef(function DropdownMenuLabel2({ className, style, children, ...rest }, ref) {
4270
+ const sketch = useDropdownMenuSketch();
4271
+ return /* @__PURE__ */ jsx(
4272
+ DropdownMenuPrimitive.Label,
4273
+ {
4274
+ ref,
4275
+ className: cn(className),
4276
+ style: {
4277
+ padding: "6px 12px",
4278
+ fontFamily: doodleUiFontFamily,
4279
+ fontSize: 12,
4280
+ fontWeight: 700,
4281
+ color: sketch.ink,
4282
+ opacity: 0.6,
4283
+ textTransform: "uppercase",
4284
+ letterSpacing: 0.4,
4285
+ ...style
4286
+ },
4287
+ ...rest,
4288
+ children
4289
+ }
4290
+ );
4291
+ });
4292
+ var DropdownMenuSeparator = forwardRef(function DropdownMenuSeparator2({ className, style, ...rest }, ref) {
4293
+ const sketch = useDropdownMenuSketch();
4294
+ return /* @__PURE__ */ jsx(
4295
+ DropdownMenuPrimitive.Separator,
4296
+ {
4297
+ ref,
4298
+ className: cn(className),
4299
+ style: { position: "relative", height: 10, margin: "2px 0", ...style },
4300
+ ...rest,
4301
+ children: /* @__PURE__ */ jsx(
4302
+ RoughSvg,
4303
+ {
4304
+ shape: "line",
4305
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
4306
+ seed: deriveSeed(sketch.resolvedSeed, "separator"),
4307
+ sketchColor: sketch.ink,
4308
+ bowing: sketch.bowing ?? 1.8,
4309
+ strokeWidth: 1.2,
4310
+ inset: 6,
4311
+ style: { opacity: 0.5 }
4312
+ }
4313
+ )
4314
+ }
4315
+ );
4316
+ });
4317
+ var DialogSketchContext = createContext(
4318
+ null
4319
+ );
4320
+ function useDialogSketch() {
4321
+ const ctx = useContext(DialogSketchContext);
4322
+ if (!ctx) {
4323
+ throw new Error("Dialog parts must be used inside <Dialog>.");
4324
+ }
4325
+ return ctx;
4326
+ }
4327
+ function Dialog2({
4328
+ children,
4329
+ open,
4330
+ defaultOpen,
4331
+ onOpenChange,
4332
+ roughness,
4333
+ seed,
4334
+ sketchColor,
4335
+ bowing,
4336
+ fillStyle,
4337
+ strokeWidth,
4338
+ animate,
4339
+ ...rest
4340
+ }) {
4341
+ const resolvedSeed = useResolvedSeed(seed);
4342
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4343
+ const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
4344
+ const isOpen = open ?? uncontrolled;
4345
+ return /* @__PURE__ */ jsx(
4346
+ DialogSketchContext.Provider,
4347
+ {
4348
+ value: {
4349
+ roughness,
4350
+ seed: resolvedSeed,
4351
+ sketchColor,
4352
+ bowing,
4353
+ fillStyle,
4354
+ strokeWidth,
4355
+ resolvedSeed,
4356
+ ink,
4357
+ animate,
4358
+ open: isOpen
4359
+ },
4360
+ children: /* @__PURE__ */ jsx(
4361
+ Dialog.Root,
4362
+ {
4363
+ open: isOpen,
4364
+ onOpenChange: (next) => {
4365
+ setUncontrolled(next);
4366
+ onOpenChange?.(next);
4367
+ },
4368
+ ...rest,
4369
+ children
4370
+ }
4371
+ )
4372
+ }
4373
+ );
4374
+ }
4375
+ var DialogTrigger = Dialog.Trigger;
4376
+ var DialogPortal = Dialog.Portal;
4377
+ var DialogClose = Dialog.Close;
4378
+ var DialogOverlay = forwardRef(
4379
+ function DialogOverlay2({ style, ...rest }, ref) {
4380
+ const sketch = useDialogSketch();
4381
+ const shouldAnimate = useAnimate(sketch.animate);
4382
+ return /* @__PURE__ */ jsx(Dialog.Overlay, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsx(
4383
+ motion.div,
4384
+ {
4385
+ initial: shouldAnimate ? { opacity: 0 } : false,
4386
+ animate: { opacity: 1 },
4387
+ exit: shouldAnimate ? { opacity: 0 } : void 0,
4388
+ transition: shouldAnimate ? { duration: 0.2, ease: "easeOut" } : { duration: 0 },
4389
+ style: {
4390
+ position: "fixed",
4391
+ inset: 0,
4392
+ background: "rgba(31, 29, 26, 0.38)",
4393
+ zIndex: 70,
4394
+ ...style
4395
+ }
4396
+ }
4397
+ ) });
4398
+ }
4399
+ );
4400
+ var DialogContent = forwardRef(
4401
+ function DialogContent2({ className, style, contentStyle, children, ...rest }, ref) {
4402
+ const sketch = useDialogSketch();
4403
+ const shouldAnimate = useAnimate(sketch.animate);
4404
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
4405
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
4406
+ /* @__PURE__ */ jsx(
4407
+ "div",
4408
+ {
4409
+ style: {
4410
+ position: "fixed",
4411
+ inset: 0,
4412
+ zIndex: 80,
4413
+ display: "flex",
4414
+ alignItems: "center",
4415
+ justifyContent: "center",
4416
+ pointerEvents: "none",
4417
+ padding: 16
4418
+ },
4419
+ children: /* @__PURE__ */ jsx(Dialog.Content, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsx(
4420
+ motion.div,
4421
+ {
4422
+ className: cn(className),
4423
+ initial: shouldAnimate ? { opacity: 0, scale: 0.96, y: 10 } : false,
4424
+ animate: { opacity: 1, scale: 1, y: 0 },
4425
+ exit: shouldAnimate ? { opacity: 0, scale: 0.96, y: 8 } : void 0,
4426
+ transition: shouldAnimate ? { duration: 0.22, ease: "easeOut" } : { duration: 0 },
4427
+ style: {
4428
+ width: "min(420px, calc(100vw - 32px))",
4429
+ outline: "none",
4430
+ pointerEvents: "auto",
4431
+ ...style
4432
+ },
4433
+ children: /* @__PURE__ */ jsx(
4434
+ SketchBox,
4435
+ {
4436
+ roughness: sketch.roughness,
4437
+ seed: sketch.resolvedSeed,
4438
+ sketchColor: sketch.ink,
4439
+ bowing: sketch.bowing,
4440
+ fillStyle: sketch.fillStyle ?? "solid",
4441
+ fill: "#f7f6f2",
4442
+ strokeWidth: sketch.strokeWidth ?? 2,
4443
+ animate: sketch.animate,
4444
+ contentStyle: { padding: 20, ...contentStyle },
4445
+ children
4446
+ }
4447
+ )
4448
+ }
4449
+ ) })
4450
+ }
4451
+ )
4452
+ ] }) : null });
4453
+ }
4454
+ );
4455
+ function DialogHeader({ children, className, style }) {
4456
+ return /* @__PURE__ */ jsx(
4457
+ "div",
4458
+ {
4459
+ className: cn(className),
4460
+ style: {
4461
+ display: "flex",
4462
+ flexDirection: "column",
4463
+ gap: 6,
4464
+ marginBottom: 12,
4465
+ ...style
4466
+ },
4467
+ children
4468
+ }
4469
+ );
4470
+ }
4471
+ function DialogFooter({ children, className, style }) {
4472
+ return /* @__PURE__ */ jsx(
4473
+ "div",
4474
+ {
4475
+ className: cn(className),
4476
+ style: {
4477
+ display: "flex",
4478
+ justifyContent: "flex-end",
4479
+ gap: 8,
4480
+ marginTop: 16,
4481
+ ...style
4482
+ },
4483
+ children
4484
+ }
4485
+ );
4486
+ }
4487
+ var DialogTitle = forwardRef(
4488
+ function DialogTitle2({ style, ...rest }, ref) {
4489
+ const sketch = useDialogSketch();
4490
+ return /* @__PURE__ */ jsx(
4491
+ Dialog.Title,
4492
+ {
4493
+ ref,
4494
+ style: {
4495
+ margin: 0,
4496
+ fontSize: 18,
4497
+ fontWeight: doodleUiFontWeight(700),
4498
+ fontFamily: doodleUiFontFamily,
4499
+ color: sketch.ink,
4500
+ ...style
4501
+ },
4502
+ ...rest
4503
+ }
4504
+ );
4505
+ }
4506
+ );
4507
+ var DialogDescription = forwardRef(function DialogDescription2({ style, ...rest }, ref) {
4508
+ const sketch = useDialogSketch();
4509
+ return /* @__PURE__ */ jsx(
4510
+ Dialog.Description,
4511
+ {
4512
+ ref,
4513
+ style: {
4514
+ margin: 0,
4515
+ fontSize: 14,
4516
+ lineHeight: 1.5,
4517
+ fontFamily: doodleUiFontFamily,
4518
+ color: sketch.ink,
4519
+ opacity: 0.8,
4520
+ ...style
4521
+ },
4522
+ ...rest
4523
+ }
4524
+ );
4525
+ });
4526
+ var AlertDialogSketchContext = createContext(null);
4527
+ function useAlertDialogSketch() {
4528
+ const ctx = useContext(AlertDialogSketchContext);
4529
+ if (!ctx) {
4530
+ throw new Error(
4531
+ "AlertDialog parts must be used inside <AlertDialog>."
4532
+ );
4533
+ }
4534
+ return ctx;
4535
+ }
4536
+ function AlertDialog({
4537
+ children,
4538
+ open,
4539
+ defaultOpen,
4540
+ onOpenChange,
4541
+ roughness,
4542
+ seed,
4543
+ sketchColor,
4544
+ bowing,
4545
+ fillStyle,
4546
+ strokeWidth,
4547
+ animate,
4548
+ ...rest
4549
+ }) {
4550
+ const resolvedSeed = useResolvedSeed(seed);
4551
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4552
+ const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
4553
+ const isOpen = open ?? uncontrolled;
4554
+ return /* @__PURE__ */ jsx(
4555
+ AlertDialogSketchContext.Provider,
4556
+ {
4557
+ value: {
4558
+ roughness,
4559
+ seed: resolvedSeed,
4560
+ sketchColor,
4561
+ bowing,
4562
+ fillStyle,
4563
+ strokeWidth,
4564
+ resolvedSeed,
4565
+ ink,
4566
+ animate,
4567
+ open: isOpen
4568
+ },
4569
+ children: /* @__PURE__ */ jsx(
4570
+ AlertDialogPrimitive.Root,
4571
+ {
4572
+ open: isOpen,
4573
+ onOpenChange: (next) => {
4574
+ setUncontrolled(next);
4575
+ onOpenChange?.(next);
4576
+ },
4577
+ ...rest,
4578
+ children
4579
+ }
4580
+ )
4581
+ }
4582
+ );
4583
+ }
4584
+ var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
4585
+ var AlertDialogPortal = AlertDialogPrimitive.Portal;
4586
+ var AlertDialogOverlay = forwardRef(function AlertDialogOverlay2({ style, ...rest }, ref) {
4587
+ const sketch = useAlertDialogSketch();
4588
+ const shouldAnimate = useAnimate(sketch.animate);
4589
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsx(
4590
+ motion.div,
4591
+ {
4592
+ initial: shouldAnimate ? { opacity: 0 } : false,
4593
+ animate: { opacity: 1 },
4594
+ exit: shouldAnimate ? { opacity: 0 } : void 0,
4595
+ transition: shouldAnimate ? { duration: 0.2, ease: "easeOut" } : { duration: 0 },
4596
+ style: {
4597
+ position: "fixed",
4598
+ inset: 0,
4599
+ background: "rgba(31, 29, 26, 0.38)",
4600
+ zIndex: 70,
4601
+ ...style
4602
+ }
4603
+ }
4604
+ ) });
4605
+ });
4606
+ var AlertDialogContent = forwardRef(function AlertDialogContent2({ className, style, contentStyle, children, ...rest }, ref) {
4607
+ const sketch = useAlertDialogSketch();
4608
+ const shouldAnimate = useAnimate(sketch.animate);
4609
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { forceMount: true, children: [
4610
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
4611
+ /* @__PURE__ */ jsx(
4612
+ "div",
4613
+ {
4614
+ style: {
4615
+ position: "fixed",
4616
+ inset: 0,
4617
+ zIndex: 80,
4618
+ display: "flex",
4619
+ alignItems: "center",
4620
+ justifyContent: "center",
4621
+ pointerEvents: "none",
4622
+ padding: 16
4623
+ },
4624
+ children: /* @__PURE__ */ jsx(AlertDialogPrimitive.Content, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsx(
4625
+ motion.div,
4626
+ {
4627
+ className: cn(className),
4628
+ initial: shouldAnimate ? { opacity: 0, scale: 0.96, y: 10 } : false,
4629
+ animate: { opacity: 1, scale: 1, y: 0 },
4630
+ exit: shouldAnimate ? { opacity: 0, scale: 0.96, y: 8 } : void 0,
4631
+ transition: shouldAnimate ? { duration: 0.22, ease: "easeOut" } : { duration: 0 },
4632
+ style: {
4633
+ width: "min(420px, calc(100vw - 32px))",
4634
+ outline: "none",
4635
+ pointerEvents: "auto",
4636
+ ...style
4637
+ },
4638
+ children: /* @__PURE__ */ jsx(
4639
+ SketchBox,
4640
+ {
4641
+ roughness: sketch.roughness,
4642
+ seed: sketch.resolvedSeed,
4643
+ sketchColor: sketch.ink,
4644
+ bowing: sketch.bowing,
4645
+ fillStyle: sketch.fillStyle ?? "solid",
4646
+ fill: "#f7f6f2",
4647
+ strokeWidth: sketch.strokeWidth ?? 2,
4648
+ animate: sketch.animate,
4649
+ contentStyle: { padding: 20, ...contentStyle },
4650
+ children
4651
+ }
4652
+ )
4653
+ }
4654
+ ) })
4655
+ }
4656
+ )
4657
+ ] }) : null });
4658
+ });
4659
+ function AlertDialogHeader({
4660
+ children,
4661
+ className,
4662
+ style
4663
+ }) {
4664
+ return /* @__PURE__ */ jsx(
4665
+ "div",
4666
+ {
4667
+ className: cn(className),
4668
+ style: {
4669
+ display: "flex",
4670
+ flexDirection: "column",
4671
+ gap: 6,
4672
+ marginBottom: 12,
4673
+ ...style
4674
+ },
4675
+ children
4676
+ }
4677
+ );
4678
+ }
4679
+ function AlertDialogFooter({
4680
+ children,
4681
+ className,
4682
+ style
4683
+ }) {
4684
+ return /* @__PURE__ */ jsx(
4685
+ "div",
4686
+ {
4687
+ className: cn(className),
4688
+ style: {
4689
+ display: "flex",
4690
+ justifyContent: "flex-end",
4691
+ gap: 8,
4692
+ marginTop: 16,
4693
+ ...style
4694
+ },
4695
+ children
4696
+ }
4697
+ );
4698
+ }
4699
+ var AlertDialogTitle = forwardRef(function AlertDialogTitle2({ style, ...rest }, ref) {
4700
+ const sketch = useAlertDialogSketch();
4701
+ return /* @__PURE__ */ jsx(
4702
+ AlertDialogPrimitive.Title,
4703
+ {
4704
+ ref,
4705
+ style: {
4706
+ margin: 0,
4707
+ fontSize: 18,
4708
+ fontWeight: doodleUiFontWeight(700),
4709
+ fontFamily: doodleUiFontFamily,
4710
+ color: sketch.ink,
4711
+ ...style
4712
+ },
4713
+ ...rest
4714
+ }
4715
+ );
4716
+ });
4717
+ var AlertDialogDescription = forwardRef(function AlertDialogDescription2({ style, ...rest }, ref) {
4718
+ const sketch = useAlertDialogSketch();
4719
+ return /* @__PURE__ */ jsx(
4720
+ AlertDialogPrimitive.Description,
4721
+ {
4722
+ ref,
4723
+ style: {
4724
+ margin: 0,
4725
+ fontSize: 14,
4726
+ lineHeight: 1.5,
4727
+ fontFamily: doodleUiFontFamily,
4728
+ color: sketch.ink,
4729
+ opacity: 0.8,
4730
+ ...style
4731
+ },
4732
+ ...rest
4733
+ }
4734
+ );
4735
+ });
4736
+ var AlertDialogAction = forwardRef(function AlertDialogAction2({ children, ...rest }, ref) {
4737
+ const sketch = useAlertDialogSketch();
4738
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, { asChild: true, children: /* @__PURE__ */ jsx(
4739
+ Button,
4740
+ {
4741
+ ref,
4742
+ variant: "primary",
4743
+ sketchColor: sketch.sketchColor,
4744
+ roughness: sketch.roughness,
4745
+ seed: sketch.resolvedSeed,
4746
+ bowing: sketch.bowing,
4747
+ animate: sketch.animate,
4748
+ ...rest,
4749
+ children
4750
+ }
4751
+ ) });
4752
+ });
4753
+ var AlertDialogCancel = forwardRef(function AlertDialogCancel2({ children, ...rest }, ref) {
4754
+ const sketch = useAlertDialogSketch();
4755
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Cancel, { asChild: true, children: /* @__PURE__ */ jsx(
4756
+ Button,
4757
+ {
4758
+ ref,
4759
+ variant: "outline",
4760
+ sketchColor: sketch.sketchColor,
4761
+ roughness: sketch.roughness,
4762
+ seed: sketch.resolvedSeed,
4763
+ bowing: sketch.bowing,
4764
+ animate: sketch.animate,
4765
+ ...rest,
4766
+ children
4767
+ }
4768
+ ) });
4769
+ });
4770
+ var CommandSketchContext = createContext(
4771
+ null
4772
+ );
4773
+ function useCommandSketch() {
4774
+ const ctx = useContext(CommandSketchContext);
4775
+ if (!ctx) {
4776
+ throw new Error("Command parts must be used inside <Command>.");
4777
+ }
4778
+ return ctx;
4779
+ }
4780
+ var Command = forwardRef(
4781
+ function Command2({
4782
+ className,
4783
+ style,
4784
+ children,
4785
+ roughness,
4786
+ seed,
4787
+ sketchColor,
4788
+ bowing,
4789
+ fillStyle,
4790
+ strokeWidth,
4791
+ animate,
4792
+ ...rest
4793
+ }, ref) {
4794
+ const resolvedSeed = useResolvedSeed(seed);
4795
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4796
+ return /* @__PURE__ */ jsx(
4797
+ CommandSketchContext.Provider,
4798
+ {
4799
+ value: {
4800
+ roughness,
4801
+ seed: resolvedSeed,
4802
+ sketchColor,
4803
+ bowing,
4804
+ fillStyle,
4805
+ strokeWidth,
4806
+ resolvedSeed,
4807
+ ink,
4808
+ animate
4809
+ },
4810
+ children: /* @__PURE__ */ jsx(
4811
+ SketchBox,
4812
+ {
4813
+ className: cn(className),
4814
+ style,
4815
+ roughness,
4816
+ seed: resolvedSeed,
4817
+ sketchColor: ink,
4818
+ bowing,
4819
+ fillStyle: fillStyle ?? "solid",
4820
+ fill: "#f7f6f2",
4821
+ strokeWidth: strokeWidth ?? 1.5,
4822
+ animate,
4823
+ contentStyle: { padding: 0, display: "flex", flexDirection: "column" },
4824
+ children: /* @__PURE__ */ jsx(Command$1, { ref, ...rest, children })
4825
+ }
4826
+ )
4827
+ }
4828
+ );
4829
+ }
4830
+ );
4831
+ var CommandInput = forwardRef(
4832
+ function CommandInput2({ className, style, ...rest }, ref) {
4833
+ const sketch = useCommandSketch();
4834
+ return /* @__PURE__ */ jsxs("div", { style: { position: "relative", padding: "10px 12px 12px" }, children: [
4835
+ /* @__PURE__ */ jsx(
4836
+ CommandInput$1,
4837
+ {
4838
+ ref,
4839
+ className: cn(className),
4840
+ style: {
4841
+ width: "100%",
4842
+ boxSizing: "border-box",
4843
+ border: "none",
4844
+ outline: "none",
4845
+ background: "transparent",
4846
+ color: sketch.ink,
4847
+ fontFamily: doodleUiFontFamily,
4848
+ fontSize: 15,
4849
+ padding: "2px 2px 8px",
4850
+ ...style
4851
+ },
4852
+ ...rest
4853
+ }
4854
+ ),
4855
+ /* @__PURE__ */ jsx(
4856
+ RoughSvg,
4857
+ {
4858
+ shape: "line",
4859
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
4860
+ seed: deriveSeed(sketch.resolvedSeed, "command-divider"),
4861
+ sketchColor: sketch.ink,
4862
+ bowing: sketch.bowing ?? 1.6,
4863
+ strokeWidth: 1.2,
4864
+ inset: 4,
4865
+ style: { position: "absolute", bottom: 0, left: 0, right: 0, height: 8, opacity: 0.4 }
4866
+ }
4867
+ )
4868
+ ] });
4869
+ }
4870
+ );
4871
+ var CommandList = forwardRef(
4872
+ function CommandList2({ className, style, ...rest }, ref) {
4873
+ return /* @__PURE__ */ jsx(
4874
+ CommandList$1,
4875
+ {
4876
+ ref,
4877
+ className: cn(className),
4878
+ style: {
4879
+ maxHeight: 280,
4880
+ overflowY: "auto",
4881
+ padding: "4px 4px 8px",
4882
+ ...style
4883
+ },
4884
+ ...rest
4885
+ }
4886
+ );
4887
+ }
4888
+ );
4889
+ var CommandEmpty = forwardRef(
4890
+ function CommandEmpty2({ className, style, ...rest }, ref) {
4891
+ const sketch = useCommandSketch();
4892
+ return /* @__PURE__ */ jsx(
4893
+ CommandEmpty$1,
4894
+ {
4895
+ ref,
4896
+ className: cn(className),
4897
+ style: {
4898
+ padding: "16px 12px",
4899
+ textAlign: "center",
4900
+ fontFamily: doodleUiFontFamily,
4901
+ fontSize: 14,
4902
+ color: sketch.ink,
4903
+ opacity: 0.6,
4904
+ ...style
4905
+ },
4906
+ ...rest
4907
+ }
4908
+ );
4909
+ }
4910
+ );
4911
+ var CommandGroup = forwardRef(
4912
+ function CommandGroup2({ className, style, ...rest }, ref) {
4913
+ const sketch = useCommandSketch();
4914
+ return /* @__PURE__ */ jsx(
4915
+ CommandGroup$1,
4916
+ {
4917
+ ref,
4918
+ className: cn(className),
4919
+ style: { padding: "4px 2px", color: sketch.ink, ...style },
4920
+ ...rest
4921
+ }
4922
+ );
4923
+ }
4924
+ );
4925
+ var CommandItem = forwardRef(
4926
+ function CommandItem2({ className, style, children, onMouseEnter, onMouseLeave, ...rest }, ref) {
4927
+ const sketch = useCommandSketch();
4928
+ const [highlighted, setHighlighted] = useState(false);
4929
+ return /* @__PURE__ */ jsxs(
4930
+ CommandItem$1,
4931
+ {
4932
+ ref,
4933
+ className: cn(className),
4934
+ onMouseEnter: (event) => {
4935
+ setHighlighted(true);
4936
+ onMouseEnter?.(event);
4937
+ },
4938
+ onMouseLeave: (event) => {
4939
+ setHighlighted(false);
4940
+ onMouseLeave?.(event);
4941
+ },
4942
+ style: {
4943
+ position: "relative",
4944
+ display: "flex",
4945
+ alignItems: "center",
4946
+ gap: 8,
4947
+ padding: "7px 10px",
4948
+ borderRadius: 4,
4949
+ fontFamily: doodleUiFontFamily,
4950
+ fontSize: 14,
4951
+ color: sketch.ink,
4952
+ cursor: "pointer",
4953
+ userSelect: "none",
4954
+ outline: "none",
4955
+ ...style
4956
+ },
4957
+ ...rest,
4958
+ children: [
4959
+ highlighted ? /* @__PURE__ */ jsx(
4960
+ RoughSvg,
4961
+ {
4962
+ shape: "line",
4963
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4964
+ seed: sketch.resolvedSeed,
4965
+ sketchColor: sketch.ink,
4966
+ bowing: sketch.bowing ?? 1.6,
4967
+ strokeWidth: 1.3,
4968
+ inset: 3,
4969
+ style: { opacity: 0.4 }
4970
+ }
4971
+ ) : null,
4972
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1, flex: 1 }, children })
4973
+ ]
4974
+ }
4975
+ );
4976
+ }
4977
+ );
4978
+ var CommandSeparator = forwardRef(function CommandSeparator2({ className, style, ...rest }, ref) {
4979
+ const sketch = useCommandSketch();
4980
+ return /* @__PURE__ */ jsx(
4981
+ CommandSeparator$1,
4982
+ {
4983
+ ref,
4984
+ className: cn(className),
4985
+ style: { position: "relative", height: 10, margin: "2px 4px", ...style },
4986
+ ...rest,
4987
+ children: /* @__PURE__ */ jsx(
4988
+ RoughSvg,
4989
+ {
4990
+ shape: "line",
4991
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
4992
+ seed: deriveSeed(sketch.resolvedSeed, "command-separator"),
4993
+ sketchColor: sketch.ink,
4994
+ bowing: sketch.bowing ?? 1.8,
4995
+ strokeWidth: 1.2,
4996
+ inset: 4,
4997
+ style: { opacity: 0.4 }
4998
+ }
4999
+ )
5000
+ }
5001
+ );
5002
+ });
5003
+ function CommandShortcut({
5004
+ children,
5005
+ className,
5006
+ style
5007
+ }) {
5008
+ const sketch = useCommandSketch();
5009
+ return /* @__PURE__ */ jsx(
5010
+ "span",
5011
+ {
5012
+ className: cn(className),
5013
+ style: {
5014
+ marginLeft: "auto",
5015
+ fontFamily: doodleUiFontFamily,
5016
+ fontSize: 12,
5017
+ color: sketch.ink,
5018
+ opacity: 0.5,
5019
+ letterSpacing: 0.4,
5020
+ ...style
5021
+ },
5022
+ children
5023
+ }
5024
+ );
5025
+ }
5026
+ var CHEVRON_PATH5 = "M 4 6 L 10 12 L 16 6";
5027
+ function Combobox({
5028
+ options,
5029
+ placeholder = "Select\u2026",
5030
+ searchPlaceholder = "Search\u2026",
5031
+ emptyMessage = "No results.",
5032
+ value,
5033
+ defaultValue,
5034
+ onValueChange,
5035
+ disabled,
5036
+ className,
5037
+ style,
5038
+ roughness,
5039
+ seed,
5040
+ sketchColor,
5041
+ bowing,
5042
+ fillStyle,
5043
+ strokeWidth,
5044
+ animate,
5045
+ "aria-label": ariaLabel
5046
+ }) {
5047
+ const [open, setOpen] = useState(false);
5048
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
5049
+ const selectedValue = value ?? uncontrolled;
5050
+ const selectedOption = options.find(
5051
+ (option) => option.value === selectedValue
5052
+ );
5053
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5054
+ const resolvedSeed = useResolvedSeed(seed);
5055
+ const shouldAnimate = useAnimate(animate);
5056
+ const triggerRef = useRef(null);
5057
+ useDrawIn(triggerRef, DRAW_IN_DURATION_MS, shouldAnimate);
5058
+ function handleSelect(nextValue) {
5059
+ setUncontrolled(nextValue);
5060
+ onValueChange?.(nextValue);
5061
+ setOpen(false);
5062
+ }
5063
+ return /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
5064
+ /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
5065
+ "button",
5066
+ {
5067
+ ref: (node) => assignRef(triggerRef, node),
5068
+ type: "button",
5069
+ role: "combobox",
5070
+ "aria-expanded": open,
5071
+ "aria-label": ariaLabel,
5072
+ disabled,
5073
+ className: cn(className),
5074
+ style: {
5075
+ position: "relative",
5076
+ display: "inline-flex",
5077
+ alignItems: "center",
5078
+ justifyContent: "space-between",
5079
+ gap: 12,
5080
+ width: "100%",
5081
+ minWidth: 200,
5082
+ minHeight: 38,
5083
+ padding: "8px 12px",
5084
+ border: "none",
5085
+ background: "transparent",
5086
+ cursor: disabled ? "not-allowed" : "pointer",
5087
+ opacity: disabled ? 0.5 : 1,
5088
+ color: ink,
5089
+ fontFamily: doodleUiFontFamily,
5090
+ fontSize: 15,
5091
+ lineHeight: 1.2,
5092
+ outline: "none",
5093
+ textAlign: "left",
5094
+ ...style
5095
+ },
5096
+ children: [
5097
+ /* @__PURE__ */ jsx(
5098
+ RoughSvg,
5099
+ {
5100
+ shape: "rectangle",
5101
+ roughness,
5102
+ seed: resolvedSeed,
5103
+ sketchColor: open ? SKETCH_COLORS.accent : ink,
5104
+ bowing,
5105
+ fillStyle,
5106
+ strokeWidth: open ? (strokeWidth ?? 1.75) + 0.35 : strokeWidth
5107
+ }
5108
+ ),
5109
+ /* @__PURE__ */ jsx(
5110
+ "span",
5111
+ {
5112
+ style: {
5113
+ position: "relative",
5114
+ zIndex: 1,
5115
+ flex: 1,
5116
+ overflow: "hidden",
5117
+ textOverflow: "ellipsis",
5118
+ whiteSpace: "nowrap"
5119
+ },
5120
+ children: selectedOption?.label ?? placeholder
5121
+ }
5122
+ ),
5123
+ /* @__PURE__ */ jsx(
5124
+ "span",
5125
+ {
5126
+ style: { position: "relative", zIndex: 1, width: 18, height: 18, flexShrink: 0 },
5127
+ children: /* @__PURE__ */ jsx(
5128
+ RoughSvg,
5129
+ {
5130
+ shape: "path",
5131
+ path: CHEVRON_PATH5,
5132
+ roughness: roughness ? roughness * 0.7 : 1.05,
5133
+ seed: resolvedSeed,
5134
+ sketchColor: ink,
5135
+ bowing,
5136
+ strokeWidth: (strokeWidth ?? 1.6) + 0.2,
5137
+ inset: 0
5138
+ }
5139
+ )
5140
+ }
5141
+ )
5142
+ ]
5143
+ }
5144
+ ) }),
5145
+ /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
5146
+ PopoverPrimitive.Content,
5147
+ {
5148
+ align: "start",
5149
+ sideOffset: 8,
5150
+ style: {
5151
+ zIndex: 80,
5152
+ outline: "none",
5153
+ width: "var(--radix-popover-trigger-width)"
5154
+ },
5155
+ children: /* @__PURE__ */ jsxs(
5156
+ Command,
5157
+ {
5158
+ roughness,
5159
+ seed: resolvedSeed,
5160
+ sketchColor: ink,
5161
+ bowing,
5162
+ fillStyle,
5163
+ strokeWidth,
5164
+ animate,
5165
+ children: [
5166
+ /* @__PURE__ */ jsx(CommandInput, { placeholder: searchPlaceholder }),
5167
+ /* @__PURE__ */ jsxs(CommandList, { children: [
5168
+ /* @__PURE__ */ jsx(CommandEmpty, { children: emptyMessage }),
5169
+ /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsx(
5170
+ CommandItem,
5171
+ {
5172
+ value: option.value,
5173
+ disabled: option.disabled,
5174
+ onSelect: handleSelect,
5175
+ children: option.label
5176
+ },
5177
+ option.value
5178
+ )) })
5179
+ ] })
5180
+ ]
5181
+ }
5182
+ )
5183
+ }
5184
+ ) })
5185
+ ] });
5186
+ }
5187
+ var Kbd = forwardRef(function Kbd2({
5188
+ children,
5189
+ className,
5190
+ style,
5191
+ roughness,
5192
+ seed,
5193
+ sketchColor,
5194
+ bowing,
5195
+ fillStyle,
5196
+ strokeWidth,
5197
+ animate,
5198
+ ...rest
5199
+ }, ref) {
5200
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5201
+ return /* @__PURE__ */ jsx(
5202
+ SketchBox,
5203
+ {
5204
+ className: cn(className),
5205
+ style: {
5206
+ display: "inline-flex",
5207
+ verticalAlign: "middle",
5208
+ ...style
5209
+ },
5210
+ contentStyle: {
5211
+ padding: "2px 7px",
5212
+ fontSize: 11,
5213
+ fontFamily: doodleUiFontFamily,
5214
+ lineHeight: 1.35,
5215
+ letterSpacing: "0.04em"
5216
+ },
5217
+ fill: SKETCH_COLORS.secondaryFill,
5218
+ fillStyle: fillStyle ?? "hachure",
5219
+ roughness,
5220
+ seed,
5221
+ sketchColor: ink,
5222
+ bowing,
5223
+ strokeWidth: strokeWidth ?? 1.3,
5224
+ animate,
5225
+ ...rest,
5226
+ children: /* @__PURE__ */ jsx(
5227
+ "kbd",
5228
+ {
5229
+ ref,
5230
+ style: {
5231
+ border: "none",
5232
+ background: "transparent",
5233
+ padding: 0,
5234
+ font: "inherit",
5235
+ color: "inherit"
5236
+ },
5237
+ children
5238
+ }
5239
+ )
5240
+ }
5241
+ );
5242
+ });
5243
+ var SPINNER_ARC = "M 12 3 A 9 9 0 1 1 11.5 3";
5244
+ var SIZE_PX = {
5245
+ sm: 18,
5246
+ md: 24,
5247
+ lg: 32
5248
+ };
5249
+ var Spinner = forwardRef(
5250
+ function Spinner2({
5251
+ className,
5252
+ style,
5253
+ size = "md",
5254
+ roughness,
5255
+ seed,
5256
+ sketchColor,
5257
+ bowing,
5258
+ fillStyle,
5259
+ strokeWidth,
5260
+ animate,
5261
+ ...rest
5262
+ }, ref) {
5263
+ const px = SIZE_PX[size];
5264
+ const resolvedSeed = useResolvedSeed(seed);
5265
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5266
+ const shouldSpin = useAnimate(animate);
5267
+ const boxStyle = {
5268
+ position: "relative",
5269
+ width: px,
5270
+ height: px,
5271
+ flexShrink: 0,
5272
+ display: "inline-block",
5273
+ ...style
5274
+ };
5275
+ const arc = /* @__PURE__ */ jsx(
5276
+ RoughSvg,
5277
+ {
5278
+ shape: "path",
5279
+ path: SPINNER_ARC,
5280
+ width: px,
5281
+ height: px,
5282
+ roughness: roughness ?? 1.6,
5283
+ seed: resolvedSeed,
5284
+ sketchColor: ink,
5285
+ bowing: bowing ?? 1.2,
5286
+ fillStyle,
5287
+ strokeWidth: strokeWidth ?? 2,
5288
+ inset: 2
5289
+ }
5290
+ );
5291
+ return /* @__PURE__ */ jsx(
5292
+ "div",
5293
+ {
5294
+ ref,
5295
+ role: "status",
5296
+ "aria-label": "Loading",
5297
+ className: cn(className),
5298
+ style: boxStyle,
5299
+ ...rest,
5300
+ children: shouldSpin ? /* @__PURE__ */ jsx(
5301
+ motion.div,
5302
+ {
5303
+ style: { position: "absolute", inset: 0 },
5304
+ animate: { rotate: 360 },
5305
+ transition: {
5306
+ duration: 0.9,
5307
+ ease: "linear",
5308
+ repeat: Infinity
5309
+ },
5310
+ children: arc
5311
+ }
5312
+ ) : arc
5313
+ }
5314
+ );
5315
+ }
5316
+ );
5317
+ var SIZE_STYLES2 = {
5318
+ sm: { fontSize: 13, padding: "4px 10px", minHeight: 30 },
5319
+ md: { fontSize: 15, padding: "7px 14px", minHeight: 38 },
5320
+ lg: { fontSize: 17, padding: "10px 18px", minHeight: 46 }
5321
+ };
5322
+ var Toggle = forwardRef(
5323
+ function Toggle2({
5324
+ className,
5325
+ style,
5326
+ size = "md",
5327
+ roughness,
5328
+ seed,
5329
+ sketchColor,
5330
+ bowing,
5331
+ fillStyle,
5332
+ strokeWidth,
5333
+ pressed,
5334
+ defaultPressed,
5335
+ onPressedChange,
5336
+ disabled,
5337
+ animate,
5338
+ children,
5339
+ ...rest
5340
+ }, ref) {
5341
+ const rootRef = useRef(null);
5342
+ const [uncontrolled, setUncontrolled] = useState(defaultPressed === true);
5343
+ const isPressed = pressed ?? uncontrolled;
5344
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5345
+ const resolvedSeed = useResolvedSeed(seed);
5346
+ const shouldAnimate = useAnimate(animate);
5347
+ const pressSeed = deriveSeed(resolvedSeed, isPressed ? "on" : "off");
5348
+ const sketchSeed = shouldAnimate ? pressSeed : resolvedSeed;
5349
+ useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
5350
+ return /* @__PURE__ */ jsxs(
5351
+ TogglePrimitive.Root,
5352
+ {
5353
+ ref: (node) => {
5354
+ rootRef.current = node;
5355
+ assignRef(ref, node);
5356
+ },
5357
+ pressed,
5358
+ defaultPressed,
5359
+ onPressedChange: (next) => {
5360
+ setUncontrolled(next);
5361
+ onPressedChange?.(next);
5362
+ },
5363
+ disabled,
5364
+ className: cn(className),
5365
+ style: {
5366
+ position: "relative",
5367
+ display: "inline-flex",
5368
+ alignItems: "center",
5369
+ justifyContent: "center",
5370
+ border: "none",
5371
+ background: "transparent",
5372
+ cursor: disabled ? "not-allowed" : "pointer",
5373
+ color: ink,
5374
+ fontFamily: doodleUiFontFamily,
5375
+ fontWeight: doodleUiFontWeight(600),
5376
+ opacity: disabled ? 0.45 : 1,
5377
+ outline: "none",
5378
+ ...SIZE_STYLES2[size],
5379
+ ...style
5380
+ },
5381
+ ...rest,
5382
+ children: [
5383
+ /* @__PURE__ */ jsx(
5384
+ RoughSvg,
5385
+ {
5386
+ shape: "rectangle",
5387
+ roughness,
5388
+ seed: sketchSeed,
5389
+ sketchColor: isPressed ? SKETCH_COLORS.accent : ink,
5390
+ bowing,
5391
+ fillStyle: fillStyle ?? "hachure",
5392
+ fill: isPressed ? SKETCH_COLORS.accentFill : void 0,
5393
+ strokeWidth: strokeWidth ?? 1.6
5394
+ }
5395
+ ),
5396
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
5397
+ ]
5398
+ }
5399
+ );
5400
+ }
5401
+ );
5402
+ var ToggleGroupSketchContext = createContext(null);
5403
+ function useToggleGroupSketch() {
5404
+ const ctx = useContext(ToggleGroupSketchContext);
5405
+ if (!ctx) {
5406
+ throw new Error("ToggleGroupItem must be used inside <ToggleGroup>.");
5407
+ }
5408
+ return ctx;
5409
+ }
5410
+ function ToggleGroup(props) {
5411
+ const {
5412
+ children,
5413
+ roughness,
5414
+ seed,
5415
+ sketchColor,
5416
+ bowing,
5417
+ fillStyle,
5418
+ strokeWidth,
5419
+ size = "md",
5420
+ animate,
5421
+ type = "single",
5422
+ ...rest
5423
+ } = props;
5424
+ const resolvedSeed = useResolvedSeed(seed);
5425
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5426
+ const rootStyle = { display: "inline-flex", gap: 6, flexWrap: "wrap" };
5427
+ return /* @__PURE__ */ jsx(
5428
+ ToggleGroupSketchContext.Provider,
5429
+ {
5430
+ value: {
5431
+ roughness,
5432
+ seed: resolvedSeed,
5433
+ sketchColor,
5434
+ bowing,
5435
+ fillStyle,
5436
+ strokeWidth,
5437
+ resolvedSeed,
5438
+ ink,
5439
+ animate,
5440
+ size
5441
+ },
5442
+ children: type === "multiple" ? /* @__PURE__ */ jsx(
5443
+ ToggleGroupPrimitive.Root,
5444
+ {
5445
+ type: "multiple",
5446
+ style: rootStyle,
5447
+ ...rest,
5448
+ children
5449
+ }
5450
+ ) : /* @__PURE__ */ jsx(
5451
+ ToggleGroupPrimitive.Root,
5452
+ {
5453
+ type: "single",
5454
+ style: rootStyle,
5455
+ ...rest,
5456
+ children
5457
+ }
5458
+ )
5459
+ }
5460
+ );
5461
+ }
5462
+ var ITEM_SIZE = {
5463
+ sm: { fontSize: 13, padding: "4px 10px", minHeight: 30 },
5464
+ md: { fontSize: 15, padding: "7px 14px", minHeight: 38 },
5465
+ lg: { fontSize: 17, padding: "10px 18px", minHeight: 46 }
5466
+ };
5467
+ var ToggleGroupItem = forwardRef(function ToggleGroupItem2({ className, style, children, value, disabled, ...rest }, ref) {
5468
+ const sketch = useToggleGroupSketch();
5469
+ const rootRef = useRef(null);
5470
+ const [pressed, setPressed] = useState(false);
5471
+ const shouldAnimate = useAnimate(sketch.animate);
5472
+ const pressSeed = deriveSeed(
5473
+ sketch.resolvedSeed,
5474
+ `${value}-${pressed ? "on" : "off"}`
5475
+ );
5476
+ const sketchSeed = shouldAnimate ? pressSeed : sketch.resolvedSeed;
5477
+ useLayoutEffect(() => {
5478
+ const el = rootRef.current;
5479
+ if (!el) return;
5480
+ const sync = () => setPressed(el.getAttribute("data-state") === "on");
5481
+ sync();
5482
+ const obs = new MutationObserver(sync);
5483
+ obs.observe(el, { attributes: true, attributeFilter: ["data-state"] });
5484
+ return () => obs.disconnect();
5485
+ }, [value]);
5486
+ useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
5487
+ return /* @__PURE__ */ jsxs(
5488
+ ToggleGroupPrimitive.Item,
5489
+ {
5490
+ ref: (node) => {
5491
+ rootRef.current = node;
5492
+ assignRef(ref, node);
5493
+ },
5494
+ value,
5495
+ disabled,
5496
+ className: cn(className),
5497
+ style: {
5498
+ position: "relative",
5499
+ display: "inline-flex",
5500
+ alignItems: "center",
5501
+ justifyContent: "center",
5502
+ border: "none",
5503
+ background: "transparent",
5504
+ cursor: disabled ? "not-allowed" : "pointer",
5505
+ color: sketch.ink,
5506
+ fontFamily: doodleUiFontFamily,
5507
+ fontWeight: doodleUiFontWeight(600),
5508
+ opacity: disabled ? 0.45 : 1,
5509
+ outline: "none",
5510
+ ...ITEM_SIZE[sketch.size],
5511
+ ...style
5512
+ },
5513
+ ...rest,
5514
+ children: [
5515
+ /* @__PURE__ */ jsx(
5516
+ RoughSvg,
5517
+ {
5518
+ shape: "rectangle",
5519
+ roughness: sketch.roughness,
5520
+ seed: sketchSeed,
5521
+ sketchColor: pressed ? SKETCH_COLORS.accent : sketch.ink,
5522
+ bowing: sketch.bowing,
5523
+ fillStyle: sketch.fillStyle ?? "hachure",
5524
+ fill: pressed ? SKETCH_COLORS.accentFill : void 0,
5525
+ strokeWidth: sketch.strokeWidth ?? 1.6
5526
+ }
5527
+ ),
5528
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
5529
+ ]
5530
+ }
5531
+ );
5532
+ });
5533
+ var InputGroupSketchContext = createContext(null);
5534
+ function useInputGroupSketch() {
5535
+ const ctx = useContext(InputGroupSketchContext);
5536
+ if (!ctx) {
5537
+ throw new Error("InputGroup parts must be used inside <InputGroup>.");
5538
+ }
5539
+ return ctx;
5540
+ }
5541
+ function InputGroup({
5542
+ children,
5543
+ className,
5544
+ style,
5545
+ roughness,
5546
+ seed,
5547
+ sketchColor,
5548
+ bowing,
5549
+ fillStyle,
5550
+ strokeWidth,
5551
+ animate,
5552
+ onFocus,
5553
+ onBlur,
5554
+ ...rest
5555
+ }) {
5556
+ const resolvedSeed = useResolvedSeed(seed);
5557
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5558
+ const [focused, setFocused] = useState(false);
5559
+ const shouldAnimate = useAnimate(animate);
5560
+ const focusSeed = deriveSeed(resolvedSeed, "focus");
5561
+ const sketchSeed = shouldAnimate && focused ? focusSeed : resolvedSeed;
5562
+ return /* @__PURE__ */ jsx(
5563
+ InputGroupSketchContext.Provider,
5564
+ {
5565
+ value: {
5566
+ roughness,
5567
+ seed: resolvedSeed,
5568
+ sketchColor,
5569
+ bowing,
5570
+ fillStyle,
5571
+ strokeWidth,
5572
+ resolvedSeed,
5573
+ ink,
5574
+ animate,
5575
+ focused,
5576
+ setFocused
5577
+ },
5578
+ children: /* @__PURE__ */ jsx(
5579
+ "div",
5580
+ {
5581
+ className: cn(className),
5582
+ style: { position: "relative", width: "100%", ...style },
5583
+ onFocus: (event) => {
5584
+ setFocused(true);
5585
+ onFocus?.(event);
5586
+ },
5587
+ onBlur: (event) => {
5588
+ if (!event.currentTarget.contains(event.relatedTarget)) {
5589
+ setFocused(false);
5590
+ }
5591
+ onBlur?.(event);
5592
+ },
5593
+ ...rest,
5594
+ children: /* @__PURE__ */ jsx(
5595
+ SketchBox,
5596
+ {
5597
+ roughness,
5598
+ seed: sketchSeed,
5599
+ sketchColor: focused ? SKETCH_COLORS.accent : ink,
5600
+ bowing,
5601
+ fillStyle,
5602
+ strokeWidth: focused && !shouldAnimate ? (strokeWidth ?? 1.75) + 0.35 : strokeWidth,
5603
+ animate,
5604
+ drawInKey: sketchSeed,
5605
+ contentStyle: {
5606
+ display: "flex",
5607
+ alignItems: "stretch",
5608
+ minHeight: 38
5609
+ },
5610
+ children
5611
+ }
5612
+ )
5613
+ }
5614
+ )
5615
+ }
5616
+ );
5617
+ }
5618
+ var InputGroupAddon = forwardRef(
5619
+ function InputGroupAddon2({ className, style, align = "inline-start", children, ...rest }, ref) {
5620
+ const sketch = useInputGroupSketch();
5621
+ return /* @__PURE__ */ jsx(
5622
+ "span",
5623
+ {
5624
+ ref,
5625
+ className: cn(className),
5626
+ style: {
5627
+ display: "inline-flex",
5628
+ alignItems: "center",
5629
+ padding: align === "inline-start" ? "0 0 0 10px" : "0 10px 0 0",
5630
+ fontFamily: doodleUiFontFamily,
5631
+ fontSize: 14,
5632
+ color: sketch.ink,
5633
+ flexShrink: 0,
5634
+ ...style
5635
+ },
5636
+ ...rest,
5637
+ children
5638
+ }
5639
+ );
5640
+ }
5641
+ );
5642
+ var InputGroupInput = forwardRef(function InputGroupInput2({ className, style, ...rest }, ref) {
5643
+ const sketch = useInputGroupSketch();
5644
+ return /* @__PURE__ */ jsx(
5645
+ "input",
5646
+ {
5647
+ ref,
5648
+ className: cn(className),
5649
+ style: {
5650
+ flex: 1,
5651
+ minWidth: 0,
5652
+ border: "none",
5653
+ outline: "none",
5654
+ background: "transparent",
5655
+ color: sketch.ink,
5656
+ fontFamily: doodleUiFontFamily,
5657
+ fontSize: 15,
5658
+ padding: "8px 10px",
5659
+ ...style
5660
+ },
5661
+ ...rest
5662
+ }
5663
+ );
5664
+ });
5665
+ var InputGroupButton = forwardRef(function InputGroupButton2({ className, style, children, ...rest }, ref) {
5666
+ return /* @__PURE__ */ jsx(
5667
+ "span",
5668
+ {
5669
+ ref,
5670
+ className: cn(className),
5671
+ style: {
5672
+ display: "inline-flex",
5673
+ alignItems: "center",
5674
+ padding: "0 6px 0 0",
5675
+ ...style
5676
+ },
5677
+ ...rest,
5678
+ children
5679
+ }
5680
+ );
5681
+ });
5682
+ var InputOTPSketchContext = createContext(
5683
+ null
5684
+ );
5685
+ function useInputOTPSketch() {
5686
+ const ctx = useContext(InputOTPSketchContext);
5687
+ if (!ctx) {
5688
+ throw new Error("InputOTP parts must be used inside <InputOTP>.");
5689
+ }
5690
+ return ctx;
5691
+ }
5692
+ var InputOTP = forwardRef(
5693
+ function InputOTP2({
5694
+ className,
5695
+ containerClassName,
5696
+ roughness,
5697
+ seed,
5698
+ sketchColor,
5699
+ bowing,
5700
+ fillStyle,
5701
+ strokeWidth,
5702
+ animate,
5703
+ children,
5704
+ ...rest
5705
+ }, ref) {
5706
+ const resolvedSeed = useResolvedSeed(seed);
5707
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5708
+ return /* @__PURE__ */ jsx(
5709
+ InputOTPSketchContext.Provider,
5710
+ {
5711
+ value: {
5712
+ roughness,
5713
+ seed: resolvedSeed,
5714
+ sketchColor,
5715
+ bowing,
5716
+ fillStyle,
5717
+ strokeWidth,
5718
+ resolvedSeed,
5719
+ ink,
5720
+ animate
5721
+ },
5722
+ children: /* @__PURE__ */ jsx(
5723
+ OTPInput,
5724
+ {
5725
+ ref,
5726
+ containerClassName: cn(className, containerClassName),
5727
+ ...rest,
5728
+ children
5729
+ }
5730
+ )
5731
+ }
5732
+ );
5733
+ }
5734
+ );
5735
+ var InputOTPGroup = forwardRef(
5736
+ function InputOTPGroup2({ className, style, children, ...rest }, ref) {
5737
+ return /* @__PURE__ */ jsx(
5738
+ "div",
5739
+ {
5740
+ ref,
5741
+ className: cn(className),
5742
+ style: { display: "flex", alignItems: "center", gap: 8, ...style },
5743
+ ...rest,
5744
+ children
5745
+ }
5746
+ );
5747
+ }
5748
+ );
5749
+ var InputOTPSlot = forwardRef(
5750
+ function InputOTPSlot2({ index, className, style, ...rest }, ref) {
5751
+ const inputContext = useContext(OTPInputContext);
5752
+ const sketch = useInputOTPSketch();
5753
+ const slotRef = useRef(null);
5754
+ const shouldAnimate = useAnimate(sketch.animate);
5755
+ const { char, isActive, hasFakeCaret } = inputContext?.slots[index] ?? {
5756
+ char: null,
5757
+ isActive: false,
5758
+ hasFakeCaret: false
5759
+ };
5760
+ const slotSeed = deriveSeed(
5761
+ sketch.resolvedSeed,
5762
+ `slot-${index}-${isActive ? "active" : "idle"}`
5763
+ );
5764
+ useDrawIn(slotRef, DRAW_IN_DURATION_MS, shouldAnimate, slotSeed);
5765
+ if (!inputContext) {
5766
+ throw new Error("InputOTPSlot must be used inside <InputOTP>.");
5767
+ }
5768
+ return /* @__PURE__ */ jsxs(
5769
+ "div",
5770
+ {
5771
+ ref: (node) => {
5772
+ slotRef.current = node;
5773
+ assignRef(ref, node);
5774
+ },
5775
+ className: cn(className),
5776
+ style: {
5777
+ position: "relative",
5778
+ width: 40,
5779
+ height: 44,
5780
+ display: "flex",
5781
+ alignItems: "center",
5782
+ justifyContent: "center",
5783
+ fontFamily: doodleUiFontFamily,
5784
+ fontSize: 18,
5785
+ color: sketch.ink,
5786
+ ...style
5787
+ },
5788
+ ...rest,
5789
+ children: [
5790
+ /* @__PURE__ */ jsx(
5791
+ RoughSvg,
5792
+ {
5793
+ shape: "rectangle",
5794
+ roughness: sketch.roughness,
5795
+ seed: slotSeed,
5796
+ sketchColor: isActive ? SKETCH_COLORS.accent : sketch.ink,
5797
+ bowing: sketch.bowing,
5798
+ fillStyle: sketch.fillStyle,
5799
+ strokeWidth: isActive ? (sketch.strokeWidth ?? 1.75) + 0.15 : sketch.strokeWidth
5800
+ }
5801
+ ),
5802
+ /* @__PURE__ */ jsxs("span", { style: { position: "relative", zIndex: 1 }, children: [
5803
+ char,
5804
+ hasFakeCaret ? /* @__PURE__ */ jsx(
5805
+ motion.span,
5806
+ {
5807
+ "aria-hidden": true,
5808
+ style: {
5809
+ display: "inline-block",
5810
+ width: 2,
5811
+ height: "0.85em",
5812
+ marginLeft: 2,
5813
+ background: sketch.ink,
5814
+ verticalAlign: "middle"
5815
+ },
5816
+ animate: shouldAnimate ? { opacity: [1, 0, 1] } : { opacity: 1 },
5817
+ transition: shouldAnimate ? { duration: 1, repeat: Infinity, ease: "linear" } : void 0
5818
+ }
5819
+ ) : null
5820
+ ] })
5821
+ ]
5822
+ }
5823
+ );
5824
+ }
5825
+ );
5826
+ var InputOTPSeparator = forwardRef(function InputOTPSeparator2({ children = "\u2013", className, style, ...rest }, ref) {
5827
+ const sketch = useInputOTPSketch();
5828
+ return /* @__PURE__ */ jsx(
5829
+ "span",
5830
+ {
5831
+ ref,
5832
+ role: "separator",
5833
+ className: cn(className),
5834
+ style: {
5835
+ fontFamily: doodleUiFontFamily,
5836
+ color: sketch.ink,
5837
+ opacity: 0.5,
5838
+ userSelect: "none",
5839
+ ...style
5840
+ },
5841
+ ...rest,
5842
+ children
5843
+ }
5844
+ );
5845
+ });
5846
+ var ScrollAreaSketchContext = createContext(null);
5847
+ function useScrollAreaSketch() {
5848
+ const ctx = useContext(ScrollAreaSketchContext);
5849
+ if (!ctx) {
5850
+ throw new Error("ScrollArea parts must be used inside <ScrollArea>.");
5851
+ }
5852
+ return ctx;
5853
+ }
5854
+ var ScrollArea = forwardRef(function ScrollArea2({
5855
+ className,
5856
+ style,
5857
+ children,
5858
+ roughness,
5859
+ seed,
5860
+ sketchColor,
5861
+ bowing,
5862
+ fillStyle,
5863
+ strokeWidth,
5864
+ animate,
5865
+ ...rest
5866
+ }, ref) {
5867
+ const resolvedSeed = useResolvedSeed(seed);
5868
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5869
+ return /* @__PURE__ */ jsx(
5870
+ ScrollAreaSketchContext.Provider,
5871
+ {
5872
+ value: {
5873
+ roughness,
5874
+ seed: resolvedSeed,
5875
+ sketchColor,
5876
+ bowing,
5877
+ fillStyle,
5878
+ strokeWidth,
5879
+ resolvedSeed,
5880
+ ink,
5881
+ animate
5882
+ },
5883
+ children: /* @__PURE__ */ jsx(
5884
+ ScrollAreaPrimitive.Root,
5885
+ {
5886
+ ref,
5887
+ className: cn(className),
5888
+ style: { position: "relative", overflow: "hidden", ...style },
5889
+ ...rest,
5890
+ children: /* @__PURE__ */ jsx(
5891
+ SketchBox,
5892
+ {
5893
+ roughness,
5894
+ seed: resolvedSeed,
5895
+ sketchColor: ink,
5896
+ bowing,
5897
+ fillStyle: fillStyle ?? "solid",
5898
+ fill: "#f7f6f2",
5899
+ strokeWidth: strokeWidth ?? 1.5,
5900
+ animate,
5901
+ contentStyle: { padding: 0, height: "100%" },
5902
+ style: { height: "100%" },
5903
+ children
5904
+ }
5905
+ )
5906
+ }
5907
+ )
5908
+ }
5909
+ );
5910
+ });
5911
+ var ScrollAreaViewport = forwardRef(function ScrollAreaViewport2({ className, style, children, ...rest }, ref) {
5912
+ return /* @__PURE__ */ jsx(
5913
+ ScrollAreaPrimitive.Viewport,
5914
+ {
5915
+ ref,
5916
+ className: cn(className),
5917
+ style: {
5918
+ width: "100%",
5919
+ height: "100%",
5920
+ borderRadius: 0,
5921
+ ...style
5922
+ },
5923
+ ...rest,
5924
+ children
5925
+ }
5926
+ );
5927
+ });
5928
+ var ScrollBar = forwardRef(
5929
+ function ScrollBar2({ className, style, orientation = "vertical", ...rest }, ref) {
5930
+ const sketch = useScrollAreaSketch();
5931
+ return /* @__PURE__ */ jsx(
5932
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
5933
+ {
5934
+ ref,
5935
+ orientation,
5936
+ className: cn(className),
5937
+ style: {
5938
+ display: "flex",
5939
+ touchAction: "none",
5940
+ userSelect: "none",
5941
+ padding: 2,
5942
+ ...orientation === "vertical" ? { width: 12, flexDirection: "column" } : { height: 12, flexDirection: "row" },
5943
+ ...style
5944
+ },
5945
+ ...rest,
5946
+ children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { asChild: true, children: /* @__PURE__ */ jsx("div", { style: { position: "relative", flex: 1 }, children: /* @__PURE__ */ jsx(
5947
+ RoughSvg,
5948
+ {
5949
+ shape: orientation === "vertical" ? "line-vertical" : "line",
5950
+ roughness: (sketch.roughness ?? 1.5) + 0.3,
5951
+ seed: sketch.resolvedSeed,
5952
+ sketchColor: sketch.ink,
5953
+ bowing: sketch.bowing,
5954
+ strokeWidth: sketch.strokeWidth ?? 2.2,
5955
+ inset: 1
5956
+ }
5957
+ ) }) })
5958
+ }
5959
+ );
5960
+ }
5961
+ );
5962
+ var ScrollAreaCorner = ScrollAreaPrimitive.Corner;
5963
+ function ResizablePanelGroup({
5964
+ className,
5965
+ style,
5966
+ ...rest
5967
+ }) {
5968
+ return /* @__PURE__ */ jsx(
5969
+ ResizablePrimitive.PanelGroup,
5970
+ {
5971
+ className: cn(className),
5972
+ style: { display: "flex", width: "100%", height: "100%", ...style },
5973
+ ...rest
5974
+ }
5975
+ );
5976
+ }
5977
+ var ResizablePanel = ResizablePrimitive.Panel;
5978
+ function ResizableHandle({
5979
+ className,
5980
+ style,
5981
+ withHandle = true,
5982
+ roughness,
5983
+ seed,
5984
+ sketchColor,
5985
+ bowing,
5986
+ strokeWidth,
5987
+ ...rest
5988
+ }) {
5989
+ const resolvedSeed = useResolvedSeed(seed);
5990
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5991
+ const handleSeed = deriveSeed(resolvedSeed, "handle");
5992
+ const base = {
5993
+ position: "relative",
5994
+ flexShrink: 0,
5995
+ display: "flex",
5996
+ alignItems: "center",
5997
+ justifyContent: "center",
5998
+ background: "transparent",
5999
+ touchAction: "none",
6000
+ ...style
6001
+ };
6002
+ return /* @__PURE__ */ jsx(
6003
+ ResizablePrimitive.PanelResizeHandle,
6004
+ {
6005
+ className: cn(className),
6006
+ style: base,
6007
+ ...rest,
6008
+ children: withHandle ? /* @__PURE__ */ jsxs(
6009
+ "div",
6010
+ {
6011
+ style: {
6012
+ position: "relative",
6013
+ width: 14,
6014
+ height: 28,
6015
+ zIndex: 1
6016
+ },
6017
+ children: [
6018
+ /* @__PURE__ */ jsx(
6019
+ RoughSvg,
6020
+ {
6021
+ shape: "line-vertical",
6022
+ roughness: roughness ?? 1.8,
6023
+ seed: handleSeed,
6024
+ sketchColor: ink,
6025
+ bowing: bowing ?? 1.5,
6026
+ strokeWidth: strokeWidth ?? 2.4,
6027
+ width: 14,
6028
+ height: 28,
6029
+ inset: 2
6030
+ }
6031
+ ),
6032
+ /* @__PURE__ */ jsx(
6033
+ RoughSvg,
6034
+ {
6035
+ shape: "ellipse",
6036
+ roughness: (roughness ?? 1.5) + 0.2,
6037
+ seed: deriveSeed(handleSeed, "dot-a"),
6038
+ sketchColor: ink,
6039
+ width: 14,
6040
+ height: 28,
6041
+ strokeWidth: 1.2,
6042
+ inset: 5,
6043
+ style: { opacity: 0.55 }
6044
+ }
6045
+ )
6046
+ ]
6047
+ }
6048
+ ) : null
6049
+ }
6050
+ );
6051
+ }
6052
+ var HoverCardSketchContext = createContext(
6053
+ null
6054
+ );
6055
+ function useHoverCardSketch() {
6056
+ const ctx = useContext(HoverCardSketchContext);
6057
+ if (!ctx) {
6058
+ throw new Error("HoverCard parts must be used inside <HoverCard>.");
6059
+ }
6060
+ return ctx;
6061
+ }
6062
+ function HoverCard({
6063
+ children,
6064
+ roughness,
6065
+ seed,
6066
+ sketchColor,
6067
+ bowing,
6068
+ fillStyle,
6069
+ strokeWidth,
6070
+ animate,
6071
+ ...rest
6072
+ }) {
6073
+ const resolvedSeed = useResolvedSeed(seed);
6074
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
6075
+ return /* @__PURE__ */ jsx(
6076
+ HoverCardSketchContext.Provider,
6077
+ {
6078
+ value: {
6079
+ roughness,
6080
+ seed: resolvedSeed,
6081
+ sketchColor,
6082
+ bowing,
6083
+ fillStyle,
6084
+ strokeWidth,
6085
+ resolvedSeed,
6086
+ ink,
6087
+ animate
6088
+ },
6089
+ children: /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { ...rest, children })
6090
+ }
6091
+ );
6092
+ }
6093
+ var HoverCardTrigger = HoverCardPrimitive.Trigger;
6094
+ var HoverCardContent = forwardRef(function HoverCardContent2({ className, style, children, sideOffset = 6, align = "center", ...rest }, ref) {
6095
+ const sketch = useHoverCardSketch();
6096
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsx(
6097
+ HoverCardPrimitive.Content,
6098
+ {
6099
+ ref,
6100
+ sideOffset,
6101
+ align,
6102
+ className: cn(className),
6103
+ style: { zIndex: 75, outline: "none", ...style },
6104
+ ...rest,
6105
+ children: /* @__PURE__ */ jsx(
6106
+ SketchBox,
6107
+ {
6108
+ roughness: sketch.roughness,
6109
+ seed: sketch.resolvedSeed,
6110
+ sketchColor: sketch.ink,
6111
+ bowing: sketch.bowing,
6112
+ fillStyle: sketch.fillStyle ?? "solid",
6113
+ fill: "#f7f6f2",
6114
+ strokeWidth: sketch.strokeWidth ?? 1.5,
6115
+ shadow: true,
6116
+ animate: sketch.animate,
6117
+ contentStyle: { padding: 14, maxWidth: 320, fontSize: 14 },
6118
+ children
6119
+ }
6120
+ )
6121
+ }
6122
+ ) });
6123
+ });
6124
+ var HoverCardArrow = HoverCardPrimitive.Arrow;
6125
+ var ContextMenuSketchContext = createContext(null);
6126
+ function useContextMenuSketch() {
6127
+ const ctx = useContext(ContextMenuSketchContext);
6128
+ if (!ctx) {
6129
+ throw new Error(
6130
+ "ContextMenu parts must be used inside <ContextMenu>."
6131
+ );
6132
+ }
6133
+ return ctx;
6134
+ }
6135
+ function ContextMenu({
6136
+ children,
6137
+ roughness,
6138
+ seed,
6139
+ sketchColor,
6140
+ bowing,
6141
+ fillStyle,
6142
+ strokeWidth,
6143
+ animate,
6144
+ ...rest
6145
+ }) {
6146
+ const resolvedSeed = useResolvedSeed(seed);
6147
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
6148
+ return /* @__PURE__ */ jsx(
6149
+ ContextMenuSketchContext.Provider,
6150
+ {
6151
+ value: {
6152
+ roughness,
6153
+ seed: resolvedSeed,
6154
+ sketchColor,
6155
+ bowing,
6156
+ fillStyle,
6157
+ strokeWidth,
6158
+ resolvedSeed,
6159
+ ink,
6160
+ animate
6161
+ },
6162
+ children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, { ...rest, children })
6163
+ }
6164
+ );
6165
+ }
6166
+ var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
6167
+ var ContextMenuGroup = ContextMenuPrimitive.Group;
6168
+ var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
6169
+ var ContextMenuSub = ContextMenuPrimitive.Sub;
6170
+ var ContextMenuContent = forwardRef(function ContextMenuContent2({ className, style, children, ...rest }, ref) {
6171
+ const sketch = useContextMenuSketch();
6172
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
6173
+ ContextMenuPrimitive.Content,
6174
+ {
6175
+ ref,
6176
+ className: cn(className),
6177
+ style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
6178
+ ...rest,
6179
+ children: /* @__PURE__ */ jsx(
6180
+ SketchBox,
6181
+ {
6182
+ roughness: sketch.roughness,
6183
+ seed: sketch.resolvedSeed,
6184
+ sketchColor: sketch.ink,
6185
+ bowing: sketch.bowing,
6186
+ fillStyle: sketch.fillStyle ?? "solid",
6187
+ fill: "#f7f6f2",
6188
+ strokeWidth: sketch.strokeWidth ?? 1.5,
6189
+ shadow: true,
6190
+ animate: sketch.animate,
6191
+ contentStyle: { padding: "6px 4px" },
6192
+ children
6193
+ }
6194
+ )
6195
+ }
6196
+ ) });
6197
+ });
6198
+ function useMark2(highlighted) {
6199
+ const sketch = useContextMenuSketch();
6200
+ return { sketch, mark: highlighted };
6201
+ }
6202
+ var ContextMenuItem = forwardRef(function ContextMenuItem2({ className, style, children, inset, ...rest }, ref) {
6203
+ const [highlighted, setHighlighted] = useState(false);
6204
+ const { sketch, mark } = useMark2(highlighted);
6205
+ return /* @__PURE__ */ jsxs(
6206
+ ContextMenuPrimitive.Item,
6207
+ {
6208
+ ref,
6209
+ className: cn(className),
6210
+ onPointerMove: () => setHighlighted(true),
6211
+ onPointerLeave: () => setHighlighted(false),
6212
+ onFocus: () => setHighlighted(true),
6213
+ onBlur: () => setHighlighted(false),
6214
+ style: {
6215
+ position: "relative",
6216
+ display: "flex",
6217
+ alignItems: "center",
6218
+ gap: 8,
6219
+ padding: inset ? "7px 12px 7px 26px" : "7px 12px",
6220
+ fontFamily: doodleUiFontFamily,
6221
+ fontSize: 14,
6222
+ color: sketch.ink,
6223
+ outline: "none",
6224
+ cursor: "pointer",
6225
+ userSelect: "none",
6226
+ ...style
6227
+ },
6228
+ ...rest,
6229
+ children: [
6230
+ mark ? /* @__PURE__ */ jsx(
6231
+ RoughSvg,
6232
+ {
6233
+ shape: "line",
6234
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
6235
+ seed: sketch.resolvedSeed,
6236
+ sketchColor: sketch.ink,
6237
+ bowing: sketch.bowing ?? 1.6,
6238
+ strokeWidth: 1.3,
6239
+ inset: 4,
6240
+ style: { opacity: 0.4 }
6241
+ }
6242
+ ) : null,
6243
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
6244
+ ]
6245
+ }
6246
+ );
6247
+ });
6248
+ var CHECK_PATH3 = "M 2 6 L 5 9 L 10 3";
6249
+ var ContextMenuCheckboxItem = forwardRef(function ContextMenuCheckboxItem2({ className, style, children, checked, ...rest }, ref) {
6250
+ const [highlighted, setHighlighted] = useState(false);
6251
+ const { sketch, mark } = useMark2(highlighted);
6252
+ return /* @__PURE__ */ jsxs(
6253
+ ContextMenuPrimitive.CheckboxItem,
6254
+ {
6255
+ ref,
6256
+ checked,
6257
+ className: cn(className),
6258
+ onPointerMove: () => setHighlighted(true),
6259
+ onPointerLeave: () => setHighlighted(false),
6260
+ style: {
6261
+ position: "relative",
6262
+ display: "flex",
6263
+ alignItems: "center",
6264
+ gap: 8,
6265
+ padding: "7px 12px 7px 26px",
6266
+ fontFamily: doodleUiFontFamily,
6267
+ fontSize: 14,
6268
+ color: sketch.ink,
6269
+ outline: "none",
6270
+ cursor: "pointer",
6271
+ userSelect: "none",
6272
+ ...style
6273
+ },
6274
+ ...rest,
6275
+ children: [
6276
+ mark ? /* @__PURE__ */ jsx(
6277
+ RoughSvg,
6278
+ {
6279
+ shape: "line",
6280
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
6281
+ seed: sketch.resolvedSeed,
6282
+ sketchColor: sketch.ink,
6283
+ bowing: sketch.bowing ?? 1.6,
6284
+ strokeWidth: 1.3,
6285
+ inset: 4,
6286
+ style: { opacity: 0.4 }
6287
+ }
6288
+ ) : null,
6289
+ /* @__PURE__ */ jsx(
6290
+ "span",
6291
+ {
6292
+ style: {
6293
+ position: "relative",
6294
+ width: 12,
6295
+ height: 12,
6296
+ flexShrink: 0,
6297
+ marginLeft: -18
6298
+ },
6299
+ children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
6300
+ RoughSvg,
6301
+ {
6302
+ shape: "path",
6303
+ path: CHECK_PATH3,
6304
+ roughness: (sketch.roughness ?? 1.5) * 0.7,
6305
+ seed: deriveSeed(sketch.resolvedSeed, "checkbox-mark"),
6306
+ sketchColor: SKETCH_COLORS.accent,
6307
+ bowing: sketch.bowing,
6308
+ strokeWidth: 1.6,
6309
+ inset: 0
6310
+ }
6311
+ ) })
6312
+ }
6313
+ ),
6314
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
6315
+ ]
6316
+ }
6317
+ );
6318
+ });
6319
+ var ContextMenuRadioItem = forwardRef(function ContextMenuRadioItem2({ className, style, children, ...rest }, ref) {
6320
+ const [highlighted, setHighlighted] = useState(false);
6321
+ const { sketch, mark } = useMark2(highlighted);
6322
+ return /* @__PURE__ */ jsxs(
6323
+ ContextMenuPrimitive.RadioItem,
6324
+ {
6325
+ ref,
6326
+ className: cn(className),
6327
+ onPointerMove: () => setHighlighted(true),
6328
+ onPointerLeave: () => setHighlighted(false),
6329
+ style: {
6330
+ position: "relative",
6331
+ display: "flex",
6332
+ alignItems: "center",
6333
+ gap: 8,
6334
+ padding: "7px 12px 7px 26px",
6335
+ fontFamily: doodleUiFontFamily,
6336
+ fontSize: 14,
6337
+ color: sketch.ink,
6338
+ outline: "none",
6339
+ cursor: "pointer",
6340
+ userSelect: "none",
6341
+ ...style
6342
+ },
6343
+ ...rest,
6344
+ children: [
6345
+ mark ? /* @__PURE__ */ jsx(
6346
+ RoughSvg,
6347
+ {
6348
+ shape: "line",
6349
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
6350
+ seed: sketch.resolvedSeed,
6351
+ sketchColor: sketch.ink,
6352
+ bowing: sketch.bowing ?? 1.6,
6353
+ strokeWidth: 1.3,
6354
+ inset: 4,
6355
+ style: { opacity: 0.4 }
6356
+ }
6357
+ ) : null,
6358
+ /* @__PURE__ */ jsx(
6359
+ "span",
6360
+ {
6361
+ style: {
6362
+ position: "relative",
6363
+ width: 8,
6364
+ height: 8,
6365
+ flexShrink: 0,
6366
+ marginLeft: -18
6367
+ },
6368
+ children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
6369
+ RoughSvg,
6370
+ {
6371
+ shape: "ellipse",
6372
+ roughness: (sketch.roughness ?? 1.5) * 0.8,
6373
+ seed: deriveSeed(sketch.resolvedSeed, "radio-mark"),
6374
+ sketchColor: SKETCH_COLORS.accent,
6375
+ bowing: sketch.bowing,
6376
+ fillStyle: "solid",
6377
+ fill: SKETCH_COLORS.accent,
6378
+ strokeWidth: 1.2,
6379
+ inset: 0
6380
+ }
6381
+ ) })
6382
+ }
6383
+ ),
6384
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
6385
+ ]
6386
+ }
6387
+ );
6388
+ });
6389
+ var ContextMenuLabel = forwardRef(function ContextMenuLabel2({ className, style, children, ...rest }, ref) {
6390
+ const sketch = useContextMenuSketch();
6391
+ return /* @__PURE__ */ jsx(
6392
+ ContextMenuPrimitive.Label,
6393
+ {
6394
+ ref,
6395
+ className: cn(className),
6396
+ style: {
6397
+ padding: "6px 12px",
6398
+ fontFamily: doodleUiFontFamily,
6399
+ fontSize: 12,
6400
+ fontWeight: 700,
6401
+ color: sketch.ink,
6402
+ opacity: 0.6,
6403
+ textTransform: "uppercase",
6404
+ letterSpacing: 0.4,
6405
+ ...style
6406
+ },
6407
+ ...rest,
6408
+ children
6409
+ }
6410
+ );
6411
+ });
6412
+ var ContextMenuSeparator = forwardRef(function ContextMenuSeparator2({ className, style, ...rest }, ref) {
6413
+ const sketch = useContextMenuSketch();
6414
+ return /* @__PURE__ */ jsx(
6415
+ ContextMenuPrimitive.Separator,
6416
+ {
6417
+ ref,
6418
+ className: cn(className),
6419
+ style: { position: "relative", height: 10, margin: "2px 0", ...style },
6420
+ ...rest,
6421
+ children: /* @__PURE__ */ jsx(
6422
+ RoughSvg,
6423
+ {
6424
+ shape: "line",
6425
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
6426
+ seed: deriveSeed(sketch.resolvedSeed, "separator"),
6427
+ sketchColor: sketch.ink,
6428
+ bowing: sketch.bowing ?? 1.8,
6429
+ strokeWidth: 1.2,
6430
+ inset: 6,
6431
+ style: { opacity: 0.5 }
6432
+ }
6433
+ )
6434
+ }
6435
+ );
6436
+ });
6437
+ var NavigationMenuSketchContext = createContext(null);
6438
+ function useNavigationMenuSketch() {
6439
+ const ctx = useContext(NavigationMenuSketchContext);
6440
+ if (!ctx) {
6441
+ throw new Error("NavigationMenu parts must be used inside <NavigationMenu>.");
6442
+ }
6443
+ return ctx;
6444
+ }
6445
+ function NavigationMenu({
6446
+ children,
6447
+ roughness,
6448
+ seed,
6449
+ sketchColor,
6450
+ bowing,
6451
+ fillStyle,
6452
+ strokeWidth,
6453
+ animate,
6454
+ ...rest
6455
+ }) {
6456
+ const resolvedSeed = useResolvedSeed(seed);
6457
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
6458
+ return /* @__PURE__ */ jsx(
6459
+ NavigationMenuSketchContext.Provider,
6460
+ {
6461
+ value: {
6462
+ roughness,
6463
+ seed: resolvedSeed,
6464
+ sketchColor,
6465
+ bowing,
6466
+ fillStyle,
6467
+ strokeWidth,
6468
+ resolvedSeed,
6469
+ ink,
6470
+ animate
6471
+ },
6472
+ children: /* @__PURE__ */ jsxs(NavigationMenuPrimitive.Root, { ...rest, children: [
6473
+ children,
6474
+ /* @__PURE__ */ jsx(NavigationMenuViewport, {})
6475
+ ] })
6476
+ }
6477
+ );
6478
+ }
6479
+ var NavigationMenuList = forwardRef(function NavigationMenuList2({ className, style, ...rest }, ref) {
6480
+ return /* @__PURE__ */ jsx(
6481
+ NavigationMenuPrimitive.List,
6482
+ {
6483
+ ref,
6484
+ className: cn(className),
6485
+ style: {
6486
+ display: "flex",
6487
+ alignItems: "center",
6488
+ gap: 4,
6489
+ listStyle: "none",
6490
+ margin: 0,
6491
+ padding: 0,
6492
+ ...style
6493
+ },
6494
+ ...rest
6495
+ }
6496
+ );
6497
+ });
6498
+ var NavigationMenuItem = NavigationMenuPrimitive.Item;
6499
+ var NavigationMenuTrigger = forwardRef(function NavigationMenuTrigger2({ className, style, children, ...rest }, ref) {
6500
+ const sketch = useNavigationMenuSketch();
6501
+ return /* @__PURE__ */ jsx(
6502
+ NavigationMenuPrimitive.Trigger,
6503
+ {
6504
+ ref,
6505
+ className: cn(className),
6506
+ style: {
6507
+ position: "relative",
6508
+ border: "none",
6509
+ background: "transparent",
6510
+ fontFamily: doodleUiFontFamily,
6511
+ fontWeight: doodleUiFontWeight(600),
6512
+ fontSize: 14,
6513
+ color: sketch.ink,
6514
+ padding: "8px 12px",
6515
+ cursor: "pointer",
6516
+ outline: "none",
6517
+ ...style
6518
+ },
6519
+ ...rest,
6520
+ children
6521
+ }
6522
+ );
6523
+ });
6524
+ var NavigationMenuContent = forwardRef(function NavigationMenuContent2({ className, style, children, ...rest }, ref) {
6525
+ const sketch = useNavigationMenuSketch();
6526
+ return /* @__PURE__ */ jsx(
6527
+ NavigationMenuPrimitive.Content,
6528
+ {
6529
+ ref,
6530
+ className: cn(className),
6531
+ style: { outline: "none", ...style },
6532
+ ...rest,
6533
+ children: /* @__PURE__ */ jsx(
6534
+ SketchBox,
6535
+ {
6536
+ roughness: sketch.roughness,
6537
+ seed: sketch.resolvedSeed,
6538
+ sketchColor: sketch.ink,
6539
+ bowing: sketch.bowing,
6540
+ fillStyle: sketch.fillStyle ?? "solid",
6541
+ fill: "#f7f6f2",
6542
+ strokeWidth: sketch.strokeWidth ?? 1.5,
6543
+ shadow: true,
6544
+ animate: sketch.animate,
6545
+ contentStyle: { padding: 12, minWidth: 200 },
6546
+ children
6547
+ }
6548
+ )
6549
+ }
6550
+ );
6551
+ });
6552
+ var NavigationMenuLink = NavigationMenuPrimitive.Link;
6553
+ var NavigationMenuViewport = forwardRef(function NavigationMenuViewport2({ className, style, ...rest }, ref) {
6554
+ return /* @__PURE__ */ jsx("div", { style: { position: "absolute", top: "100%", left: 0, perspective: 2e3 }, children: /* @__PURE__ */ jsx(
6555
+ NavigationMenuPrimitive.Viewport,
6556
+ {
6557
+ ref,
6558
+ className: cn(className),
6559
+ style: {
6560
+ position: "relative",
6561
+ marginTop: 6,
6562
+ overflow: "hidden",
6563
+ ...style
6564
+ },
6565
+ ...rest
6566
+ }
6567
+ ) });
6568
+ });
6569
+ var NavigationMenuIndicator = forwardRef(function NavigationMenuIndicator2({ className, style, ...rest }, ref) {
6570
+ const sketch = useNavigationMenuSketch();
6571
+ return /* @__PURE__ */ jsx(
6572
+ NavigationMenuPrimitive.Indicator,
6573
+ {
6574
+ ref,
6575
+ className: cn(className),
6576
+ style: { position: "relative", height: 6, ...style },
6577
+ ...rest,
6578
+ children: /* @__PURE__ */ jsx(
6579
+ RoughSvg,
6580
+ {
6581
+ shape: "line",
6582
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
6583
+ seed: deriveSeed(sketch.resolvedSeed, "nav-indicator"),
6584
+ sketchColor: sketch.ink,
6585
+ strokeWidth: 2,
6586
+ inset: 2
6587
+ }
6588
+ )
6589
+ }
6590
+ );
6591
+ });
6592
+ var NavigationMenuItemLink = forwardRef(function NavigationMenuItemLink2({ className, style, active, children, ...rest }, ref) {
6593
+ const sketch = useNavigationMenuSketch();
6594
+ const [hovered, setHovered] = useState(false);
6595
+ const showMark = active || hovered;
6596
+ return /* @__PURE__ */ jsxs(
6597
+ NavigationMenuPrimitive.Link,
6598
+ {
6599
+ ref,
6600
+ className: cn(className),
6601
+ onPointerEnter: () => setHovered(true),
6602
+ onPointerLeave: () => setHovered(false),
6603
+ style: {
6604
+ position: "relative",
6605
+ display: "inline-flex",
6606
+ padding: "8px 12px",
6607
+ fontFamily: doodleUiFontFamily,
6608
+ fontSize: 14,
6609
+ color: sketch.ink,
6610
+ textDecoration: "none",
6611
+ outline: "none",
6612
+ ...style
6613
+ },
6614
+ ...rest,
6615
+ children: [
6616
+ showMark ? /* @__PURE__ */ jsx(
6617
+ RoughSvg,
6618
+ {
6619
+ shape: "line",
6620
+ roughness: (sketch.roughness ?? 1.5) + 0.3,
6621
+ seed: deriveSeed(sketch.resolvedSeed, "nav-link"),
6622
+ sketchColor: sketch.ink,
6623
+ strokeWidth: 1.4,
6624
+ inset: 4,
6625
+ style: { opacity: 0.35 }
6626
+ }
6627
+ ) : null,
6628
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
6629
+ ]
6630
+ }
6631
+ );
6632
+ });
6633
+ var MenubarSketchContext = createContext(
6634
+ null
6635
+ );
6636
+ function useMenubarSketch() {
6637
+ const ctx = useContext(MenubarSketchContext);
6638
+ if (!ctx) {
6639
+ throw new Error("Menubar parts must be used inside <Menubar>.");
6640
+ }
6641
+ return ctx;
6642
+ }
6643
+ function Menubar({
6644
+ children,
6645
+ className,
6646
+ style,
6647
+ roughness,
6648
+ seed,
6649
+ sketchColor,
6650
+ bowing,
6651
+ fillStyle,
6652
+ strokeWidth,
6653
+ animate,
6654
+ ...rest
6655
+ }) {
6656
+ const resolvedSeed = useResolvedSeed(seed);
6657
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
6658
+ return /* @__PURE__ */ jsx(
6659
+ MenubarSketchContext.Provider,
6660
+ {
6661
+ value: {
6662
+ roughness,
6663
+ seed: resolvedSeed,
6664
+ sketchColor,
6665
+ bowing,
6666
+ fillStyle,
6667
+ strokeWidth,
6668
+ resolvedSeed,
6669
+ ink,
6670
+ animate
6671
+ },
6672
+ children: /* @__PURE__ */ jsx(
6673
+ MenubarPrimitive.Root,
6674
+ {
6675
+ className: cn(className),
6676
+ style: {
6677
+ display: "inline-flex",
6678
+ alignItems: "center",
6679
+ gap: 4,
6680
+ padding: 4,
6681
+ ...style
6682
+ },
6683
+ ...rest,
6684
+ children
6685
+ }
6686
+ )
6687
+ }
6688
+ );
6689
+ }
6690
+ var MenubarMenu = MenubarPrimitive.Menu;
6691
+ var MenubarTrigger = forwardRef(function MenubarTrigger2({ className, style, children, ...rest }, ref) {
6692
+ const sketch = useMenubarSketch();
6693
+ return /* @__PURE__ */ jsx(
6694
+ MenubarPrimitive.Trigger,
6695
+ {
6696
+ ref,
6697
+ className: cn(className),
6698
+ style: {
6699
+ border: "none",
6700
+ background: "transparent",
6701
+ fontFamily: doodleUiFontFamily,
6702
+ fontSize: 14,
6703
+ padding: "6px 10px",
6704
+ cursor: "pointer",
6705
+ color: sketch.ink,
6706
+ outline: "none",
6707
+ ...style
6708
+ },
6709
+ ...rest,
6710
+ children
6711
+ }
6712
+ );
6713
+ });
6714
+ var MenubarContent = forwardRef(function MenubarContent2({ className, style, children, align = "start", sideOffset = 6, ...rest }, ref) {
6715
+ const sketch = useMenubarSketch();
6716
+ return /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(
6717
+ MenubarPrimitive.Content,
6718
+ {
6719
+ ref,
6720
+ align,
6721
+ sideOffset,
6722
+ className: cn(className),
6723
+ style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
6724
+ ...rest,
6725
+ children: /* @__PURE__ */ jsx(
6726
+ SketchBox,
6727
+ {
6728
+ roughness: sketch.roughness,
6729
+ seed: sketch.resolvedSeed,
6730
+ sketchColor: sketch.ink,
6731
+ bowing: sketch.bowing,
6732
+ fillStyle: sketch.fillStyle ?? "solid",
6733
+ fill: "#f7f6f2",
6734
+ strokeWidth: sketch.strokeWidth ?? 1.5,
6735
+ shadow: true,
6736
+ animate: sketch.animate,
6737
+ contentStyle: { padding: "6px 4px" },
6738
+ children
6739
+ }
6740
+ )
6741
+ }
6742
+ ) });
6743
+ });
6744
+ function useMark3(highlighted) {
6745
+ const sketch = useMenubarSketch();
6746
+ return { sketch, mark: highlighted };
6747
+ }
6748
+ var MenubarItem = forwardRef(function MenubarItem2({ className, style, children, ...rest }, ref) {
6749
+ const [highlighted, setHighlighted] = useState(false);
6750
+ const { sketch, mark } = useMark3(highlighted);
6751
+ return /* @__PURE__ */ jsxs(
6752
+ MenubarPrimitive.Item,
6753
+ {
6754
+ ref,
6755
+ className: cn(className),
6756
+ onPointerMove: () => setHighlighted(true),
6757
+ onPointerLeave: () => setHighlighted(false),
6758
+ style: {
6759
+ position: "relative",
6760
+ display: "flex",
6761
+ alignItems: "center",
6762
+ gap: 8,
6763
+ padding: "7px 12px",
6764
+ fontFamily: doodleUiFontFamily,
6765
+ fontSize: 14,
6766
+ color: sketch.ink,
6767
+ outline: "none",
6768
+ cursor: "pointer",
6769
+ userSelect: "none",
6770
+ ...style
6771
+ },
6772
+ ...rest,
6773
+ children: [
6774
+ mark ? /* @__PURE__ */ jsx(
6775
+ RoughSvg,
6776
+ {
6777
+ shape: "line",
6778
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
6779
+ seed: sketch.resolvedSeed,
6780
+ sketchColor: sketch.ink,
6781
+ bowing: sketch.bowing ?? 1.6,
6782
+ strokeWidth: 1.3,
6783
+ inset: 4,
6784
+ style: { opacity: 0.4 }
6785
+ }
6786
+ ) : null,
6787
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
6788
+ ]
6789
+ }
6790
+ );
6791
+ });
6792
+ var MenubarSeparator = forwardRef(function MenubarSeparator2({ className, style, ...rest }, ref) {
6793
+ const sketch = useMenubarSketch();
6794
+ return /* @__PURE__ */ jsx(
6795
+ MenubarPrimitive.Separator,
6796
+ {
6797
+ ref,
6798
+ className: cn(className),
6799
+ style: { position: "relative", height: 10, margin: "2px 0", ...style },
6800
+ ...rest,
6801
+ children: /* @__PURE__ */ jsx(
6802
+ RoughSvg,
6803
+ {
6804
+ shape: "line",
6805
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
6806
+ seed: deriveSeed(sketch.resolvedSeed, "separator"),
6807
+ sketchColor: sketch.ink,
6808
+ bowing: sketch.bowing ?? 1.8,
6809
+ strokeWidth: 1.2,
6810
+ inset: 6,
6811
+ style: { opacity: 0.5 }
6812
+ }
6813
+ )
6814
+ }
6815
+ );
6816
+ });
6817
+ var MenubarLabel = forwardRef(function MenubarLabel2({ className, style, children, ...rest }, ref) {
6818
+ const sketch = useMenubarSketch();
6819
+ return /* @__PURE__ */ jsx(
6820
+ MenubarPrimitive.Label,
6821
+ {
6822
+ ref,
6823
+ className: cn(className),
6824
+ style: {
6825
+ padding: "6px 12px",
6826
+ fontFamily: doodleUiFontFamily,
6827
+ fontSize: 12,
6828
+ fontWeight: 700,
6829
+ color: sketch.ink,
6830
+ opacity: 0.6,
6831
+ ...style
6832
+ },
6833
+ ...rest,
6834
+ children
6835
+ }
6836
+ );
6837
+ });
6838
+ var MenubarShortcut = forwardRef(function MenubarShortcut2({ className, style, children, ...rest }, ref) {
6839
+ return /* @__PURE__ */ jsx(
6840
+ "span",
6841
+ {
6842
+ ref,
6843
+ className: cn(className),
6844
+ style: {
6845
+ marginLeft: "auto",
6846
+ fontSize: 12,
6847
+ opacity: 0.55,
6848
+ letterSpacing: 0.04,
6849
+ ...style
6850
+ },
6851
+ ...rest,
6852
+ children
6853
+ }
6854
+ );
6855
+ });
6856
+ var MenubarSub = MenubarPrimitive.Sub;
6857
+ var MenubarSubTrigger = MenubarPrimitive.SubTrigger;
6858
+ var MenubarSubContent = MenubarPrimitive.SubContent;
6859
+ var MenubarCheckboxItem = MenubarPrimitive.CheckboxItem;
6860
+ var MenubarRadioGroup = MenubarPrimitive.RadioGroup;
6861
+ var MenubarRadioItem = MenubarPrimitive.RadioItem;
6862
+ var SlidingPanelSketchContext = createContext(null);
6863
+ function useSlidingPanelSketch() {
6864
+ const ctx = useContext(SlidingPanelSketchContext);
6865
+ if (!ctx) {
6866
+ throw new Error("Sliding panel parts must be used inside the panel root.");
6867
+ }
6868
+ return ctx;
6869
+ }
6870
+ function SlidingPanelRoot({
6871
+ children,
6872
+ open,
6873
+ defaultOpen,
6874
+ onOpenChange,
6875
+ side = "right",
6876
+ roughness,
6877
+ seed,
6878
+ sketchColor,
6879
+ bowing,
6880
+ fillStyle,
6881
+ strokeWidth,
6882
+ animate,
6883
+ ...rest
6884
+ }) {
6885
+ const resolvedSeed = useResolvedSeed(seed);
6886
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
6887
+ const [uncontrolled, setUncontrolled] = useState(defaultOpen === true);
6888
+ const isOpen = open ?? uncontrolled;
6889
+ return /* @__PURE__ */ jsx(
6890
+ SlidingPanelSketchContext.Provider,
6891
+ {
6892
+ value: {
6893
+ roughness,
6894
+ seed: resolvedSeed,
6895
+ sketchColor,
6896
+ bowing,
6897
+ fillStyle,
6898
+ strokeWidth,
6899
+ resolvedSeed,
6900
+ ink,
6901
+ animate,
6902
+ open: isOpen,
6903
+ side
6904
+ },
6905
+ children: /* @__PURE__ */ jsx(
6906
+ Dialog.Root,
6907
+ {
6908
+ open: isOpen,
6909
+ onOpenChange: (next) => {
6910
+ setUncontrolled(next);
6911
+ onOpenChange?.(next);
6912
+ },
6913
+ ...rest,
6914
+ children
6915
+ }
6916
+ )
6917
+ }
6918
+ );
6919
+ }
6920
+ var SlidingPanelTrigger = Dialog.Trigger;
6921
+ var SlidingPanelClose = Dialog.Close;
6922
+ function slideVariants(side, shouldAnimate) {
6923
+ if (!shouldAnimate) {
6924
+ return { hidden: {}, visible: {} };
6925
+ }
6926
+ const offset = 420;
6927
+ const hidden = side === "left" ? { x: -offset } : side === "right" ? { x: offset } : side === "top" ? { y: -offset } : { y: offset };
6928
+ return {
6929
+ hidden: { ...hidden, opacity: 0.85 },
6930
+ visible: { x: 0, y: 0, opacity: 1 }
6931
+ };
6932
+ }
6933
+ function panelPosition(side) {
6934
+ switch (side) {
6935
+ case "left":
6936
+ return {
6937
+ top: 0,
6938
+ bottom: 0,
6939
+ left: 0,
6940
+ width: "min(420px, 100vw)"
6941
+ };
6942
+ case "right":
6943
+ return {
6944
+ top: 0,
6945
+ bottom: 0,
6946
+ right: 0,
6947
+ width: "min(420px, 100vw)"
6948
+ };
6949
+ case "top":
6950
+ return {
6951
+ top: 0,
6952
+ left: 0,
6953
+ right: 0,
6954
+ height: "min(420px, 90vh)"
6955
+ };
6956
+ default:
6957
+ return {
6958
+ bottom: 0,
6959
+ left: 0,
6960
+ right: 0,
6961
+ height: "min(420px, 90vh)"
6962
+ };
6963
+ }
6964
+ }
6965
+ var SlidingPanelOverlay = forwardRef(function SlidingPanelOverlay2({ style, ...rest }, ref) {
6966
+ const sketch = useSlidingPanelSketch();
6967
+ const shouldAnimate = useAnimate(sketch.animate);
6968
+ return /* @__PURE__ */ jsx(Dialog.Overlay, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsx(
6969
+ motion.div,
6970
+ {
6971
+ initial: shouldAnimate ? { opacity: 0 } : false,
6972
+ animate: { opacity: 1 },
6973
+ exit: shouldAnimate ? { opacity: 0 } : void 0,
6974
+ transition: shouldAnimate ? { duration: 0.22, ease: "easeOut" } : { duration: 0 },
6975
+ style: {
6976
+ position: "fixed",
6977
+ inset: 0,
6978
+ background: "rgba(31, 29, 26, 0.38)",
6979
+ zIndex: 70,
6980
+ ...style
6981
+ }
6982
+ }
6983
+ ) });
6984
+ });
6985
+ var SlidingPanelContent = forwardRef(function SlidingPanelContent2({ className, style, contentStyle, children, chrome, ...rest }, ref) {
6986
+ const sketch = useSlidingPanelSketch();
6987
+ const shouldAnimate = useAnimate(sketch.animate);
6988
+ const variants = slideVariants(sketch.side, shouldAnimate);
6989
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
6990
+ /* @__PURE__ */ jsx(SlidingPanelOverlay, {}),
6991
+ /* @__PURE__ */ jsx(Dialog.Content, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsx(
6992
+ motion.div,
6993
+ {
6994
+ className: cn(className),
6995
+ initial: shouldAnimate ? "hidden" : false,
6996
+ animate: "visible",
6997
+ exit: shouldAnimate ? "hidden" : void 0,
6998
+ variants,
6999
+ transition: shouldAnimate ? { duration: 0.28, ease: "easeOut" } : { duration: 0 },
7000
+ style: {
7001
+ position: "fixed",
7002
+ zIndex: 80,
7003
+ outline: "none",
7004
+ pointerEvents: "auto",
7005
+ ...panelPosition(sketch.side),
7006
+ ...style
7007
+ },
7008
+ children: /* @__PURE__ */ jsxs(
7009
+ SketchBox,
7010
+ {
7011
+ roughness: sketch.roughness,
7012
+ seed: sketch.resolvedSeed,
7013
+ sketchColor: sketch.ink,
7014
+ bowing: sketch.bowing,
7015
+ fillStyle: sketch.fillStyle ?? "solid",
7016
+ fill: "#f7f6f2",
7017
+ strokeWidth: sketch.strokeWidth ?? 2,
7018
+ animate: sketch.animate,
7019
+ contentStyle: {
7020
+ padding: 20,
7021
+ height: "100%",
7022
+ boxSizing: "border-box",
7023
+ display: "flex",
7024
+ flexDirection: "column",
7025
+ ...contentStyle
7026
+ },
7027
+ style: { height: "100%" },
7028
+ children: [
7029
+ chrome,
7030
+ children
7031
+ ]
7032
+ }
7033
+ )
7034
+ }
7035
+ ) })
7036
+ ] }) : null });
7037
+ });
7038
+ function SlidingPanelHeader({
7039
+ children,
7040
+ className,
7041
+ style
7042
+ }) {
7043
+ return /* @__PURE__ */ jsx(
7044
+ "div",
7045
+ {
7046
+ className: cn(className),
7047
+ style: {
7048
+ display: "flex",
7049
+ flexDirection: "column",
7050
+ gap: 6,
7051
+ marginBottom: 12,
7052
+ ...style
7053
+ },
7054
+ children
7055
+ }
7056
+ );
7057
+ }
7058
+ function SlidingPanelFooter({
7059
+ children,
7060
+ className,
7061
+ style
7062
+ }) {
7063
+ return /* @__PURE__ */ jsx(
7064
+ "div",
7065
+ {
7066
+ className: cn(className),
7067
+ style: {
7068
+ display: "flex",
7069
+ gap: 8,
7070
+ marginTop: "auto",
7071
+ paddingTop: 12,
7072
+ ...style
7073
+ },
7074
+ children
7075
+ }
7076
+ );
7077
+ }
7078
+ var SlidingPanelTitle = forwardRef(function SlidingPanelTitle2({ className, style, ...rest }, ref) {
7079
+ const sketch = useSlidingPanelSketch();
7080
+ return /* @__PURE__ */ jsx(
7081
+ Dialog.Title,
7082
+ {
7083
+ ref,
7084
+ className: cn(className),
7085
+ style: {
7086
+ margin: 0,
7087
+ fontFamily: doodleUiFontFamily,
7088
+ fontWeight: doodleUiFontWeight(700),
7089
+ fontSize: 20,
7090
+ color: sketch.ink,
7091
+ ...style
7092
+ },
7093
+ ...rest
7094
+ }
7095
+ );
7096
+ });
7097
+ var SlidingPanelDescription = forwardRef(function SlidingPanelDescription2({ className, style, ...rest }, ref) {
7098
+ const sketch = useSlidingPanelSketch();
7099
+ return /* @__PURE__ */ jsx(
7100
+ Dialog.Description,
7101
+ {
7102
+ ref,
7103
+ className: cn(className),
7104
+ style: {
7105
+ margin: 0,
7106
+ fontFamily: doodleUiFontFamily,
7107
+ fontSize: 14,
7108
+ color: sketch.ink,
7109
+ opacity: 0.75,
7110
+ ...style
7111
+ },
7112
+ ...rest
7113
+ }
7114
+ );
7115
+ });
7116
+ function Sheet({ side = "right", ...rest }) {
7117
+ return /* @__PURE__ */ jsx(SlidingPanelRoot, { side, ...rest });
7118
+ }
7119
+ var SheetTrigger = SlidingPanelTrigger;
7120
+ var SheetClose = SlidingPanelClose;
7121
+ var SheetContent = forwardRef(
7122
+ function SheetContent2(props, ref) {
7123
+ return /* @__PURE__ */ jsx(SlidingPanelContent, { ref, ...props });
7124
+ }
7125
+ );
7126
+ var SheetHeader = SlidingPanelHeader;
7127
+ var SheetFooter = SlidingPanelFooter;
7128
+ var SheetTitle = SlidingPanelTitle;
7129
+ var SheetDescription = SlidingPanelDescription;
7130
+ function Drawer(props) {
7131
+ return /* @__PURE__ */ jsx(SlidingPanelRoot, { side: "bottom", ...props });
7132
+ }
7133
+ var DrawerTrigger = SlidingPanelTrigger;
7134
+ var DrawerClose = SlidingPanelClose;
7135
+ var DrawerHandle = forwardRef(
7136
+ function DrawerHandle2({ className }, ref) {
7137
+ const sketch = useSlidingPanelSketch();
7138
+ return /* @__PURE__ */ jsx(
7139
+ "div",
7140
+ {
7141
+ ref,
7142
+ className,
7143
+ style: {
7144
+ position: "relative",
7145
+ width: 48,
7146
+ height: 10,
7147
+ margin: "0 auto 12px"
7148
+ },
7149
+ "aria-hidden": true,
7150
+ children: /* @__PURE__ */ jsx(
7151
+ RoughSvg,
7152
+ {
7153
+ shape: "line",
7154
+ roughness: (sketch.roughness ?? 1.5) + 0.3,
7155
+ seed: deriveSeed(sketch.resolvedSeed, "drawer-handle"),
7156
+ sketchColor: sketch.sketchColor ?? SKETCH_COLORS.ink,
7157
+ bowing: sketch.bowing ?? 1.6,
7158
+ strokeWidth: 2.4,
7159
+ width: 48,
7160
+ height: 10,
7161
+ inset: 2
7162
+ }
7163
+ )
7164
+ }
7165
+ );
7166
+ }
7167
+ );
7168
+ var DrawerContent = forwardRef(
7169
+ function DrawerContent2({ children, ...rest }, ref) {
7170
+ return /* @__PURE__ */ jsx(
7171
+ SlidingPanelContent,
7172
+ {
7173
+ ref,
7174
+ chrome: /* @__PURE__ */ jsx(DrawerHandle, {}),
7175
+ contentStyle: { paddingTop: 8 },
7176
+ ...rest,
7177
+ children
7178
+ }
7179
+ );
7180
+ }
7181
+ );
7182
+ var DrawerHeader = SlidingPanelHeader;
7183
+ var DrawerFooter = SlidingPanelFooter;
7184
+ var DrawerTitle = SlidingPanelTitle;
7185
+ var DrawerDescription = SlidingPanelDescription;
3700
7186
 
3701
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, Avatar, Badge, Breadcrumb, BreadcrumbItem, Button, Card, Checkbox, 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, Divider, DoodleUIProvider, Input, Modal, ModalClose, ModalDescription, ModalRoot, ModalTitle, ModalTrigger, Pagination, Progress, Radio, RadioGroup, RoughSvg, SKETCH_COLORS, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Skeleton, SketchBox, SketchSeedProvider, Slider, Stepper, Switch, TABLE_STAGGER_MS, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Tooltip, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useDoodleUI, useDrawIn, useResolvedSeed, useSketchSeed };
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 };
3702
7188
  //# sourceMappingURL=index.js.map
3703
7189
  //# sourceMappingURL=index.js.map