doodleui-react 0.3.0 → 0.4.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.cjs CHANGED
@@ -16,6 +16,12 @@ var ToastPrimitive = require('@radix-ui/react-toast');
16
16
  var AccordionPrimitive = require('@radix-ui/react-accordion');
17
17
  var AvatarPrimitive = require('@radix-ui/react-avatar');
18
18
  var SliderPrimitive = require('@radix-ui/react-slider');
19
+ var LabelPrimitive = require('@radix-ui/react-label');
20
+ var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
21
+ var PopoverPrimitive = require('@radix-ui/react-popover');
22
+ var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
23
+ var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
24
+ var cmdk = require('cmdk');
19
25
 
20
26
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
21
27
 
@@ -49,6 +55,11 @@ var ToastPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToastPrimitive);
49
55
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
50
56
  var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
51
57
  var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
58
+ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
59
+ var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
60
+ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
61
+ var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
62
+ var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
52
63
 
53
64
  // src/types.ts
54
65
  function toRoughOptions(props) {
@@ -3732,12 +3743,1495 @@ var Stepper = react.forwardRef(
3732
3743
  );
3733
3744
  }
3734
3745
  );
3746
+ var Label2 = react.forwardRef(function Label3({
3747
+ className,
3748
+ style,
3749
+ children,
3750
+ required,
3751
+ roughness,
3752
+ seed,
3753
+ sketchColor,
3754
+ bowing,
3755
+ strokeWidth,
3756
+ animate,
3757
+ ...rest
3758
+ }, ref) {
3759
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
3760
+ const resolvedSeed = useResolvedSeed(seed);
3761
+ const shouldAnimate = useAnimate(animate);
3762
+ const markRef = react.useRef(null);
3763
+ useDrawIn(markRef, DRAW_IN_MARK_MS, shouldAnimate);
3764
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3765
+ LabelPrimitive__namespace.Root,
3766
+ {
3767
+ ref,
3768
+ className: cn(className),
3769
+ style: {
3770
+ display: "inline-flex",
3771
+ alignItems: "center",
3772
+ gap: 4,
3773
+ fontFamily: doodleUiFontFamily,
3774
+ fontSize: 13,
3775
+ fontWeight: doodleUiFontWeight(600),
3776
+ color: ink,
3777
+ cursor: "default",
3778
+ ...style
3779
+ },
3780
+ ...rest,
3781
+ children: [
3782
+ children,
3783
+ required ? /* @__PURE__ */ jsxRuntime.jsx(
3784
+ "span",
3785
+ {
3786
+ ref: markRef,
3787
+ "aria-hidden": "true",
3788
+ style: { position: "relative", width: 10, height: 10, flexShrink: 0 },
3789
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3790
+ RoughSvg,
3791
+ {
3792
+ shape: "ellipse",
3793
+ roughness: (roughness ?? 1.5) * 0.9,
3794
+ seed: resolvedSeed,
3795
+ sketchColor: SKETCH_COLORS.accent,
3796
+ bowing,
3797
+ fillStyle: "solid",
3798
+ fill: SKETCH_COLORS.accent,
3799
+ strokeWidth: strokeWidth ?? 1.2,
3800
+ inset: 1
3801
+ }
3802
+ )
3803
+ }
3804
+ ) : null
3805
+ ]
3806
+ }
3807
+ );
3808
+ });
3809
+ var CHEVRON_PATH4 = "M 6 4 L 12 10 L 6 16";
3810
+ var CollapsibleSketchContext = react.createContext(null);
3811
+ function useCollapsibleSketch() {
3812
+ const ctx = react.useContext(CollapsibleSketchContext);
3813
+ if (!ctx) {
3814
+ throw new Error(
3815
+ "Collapsible parts must be used inside <Collapsible>."
3816
+ );
3817
+ }
3818
+ return ctx;
3819
+ }
3820
+ var Collapsible = react.forwardRef(
3821
+ function Collapsible2({
3822
+ className,
3823
+ style,
3824
+ children,
3825
+ open,
3826
+ defaultOpen,
3827
+ onOpenChange,
3828
+ disabled,
3829
+ roughness,
3830
+ seed,
3831
+ sketchColor,
3832
+ bowing,
3833
+ fillStyle,
3834
+ strokeWidth,
3835
+ ...rest
3836
+ }, ref) {
3837
+ const resolvedSeed = useResolvedSeed(seed);
3838
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
3839
+ const [uncontrolled, setUncontrolled] = react.useState(defaultOpen ?? false);
3840
+ const isOpen = open ?? uncontrolled;
3841
+ return /* @__PURE__ */ jsxRuntime.jsx(
3842
+ CollapsibleSketchContext.Provider,
3843
+ {
3844
+ value: {
3845
+ roughness,
3846
+ seed: resolvedSeed,
3847
+ sketchColor,
3848
+ bowing,
3849
+ fillStyle,
3850
+ strokeWidth,
3851
+ resolvedSeed,
3852
+ ink,
3853
+ open: isOpen
3854
+ },
3855
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3856
+ CollapsiblePrimitive__namespace.Root,
3857
+ {
3858
+ ref,
3859
+ open: isOpen,
3860
+ disabled,
3861
+ className: cn(className),
3862
+ style,
3863
+ onOpenChange: (next) => {
3864
+ setUncontrolled(next);
3865
+ onOpenChange?.(next);
3866
+ },
3867
+ ...rest,
3868
+ children
3869
+ }
3870
+ )
3871
+ }
3872
+ );
3873
+ }
3874
+ );
3875
+ var CollapsibleTrigger = react.forwardRef(function CollapsibleTrigger2({ className, style, children, ...rest }, ref) {
3876
+ const sketch = useCollapsibleSketch();
3877
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3878
+ CollapsiblePrimitive__namespace.Trigger,
3879
+ {
3880
+ ref,
3881
+ className: cn(className),
3882
+ style: {
3883
+ display: "flex",
3884
+ width: "100%",
3885
+ alignItems: "center",
3886
+ justifyContent: "space-between",
3887
+ gap: 12,
3888
+ padding: "10px 4px",
3889
+ border: "none",
3890
+ background: "transparent",
3891
+ cursor: "pointer",
3892
+ fontFamily: doodleUiFontFamily,
3893
+ fontSize: 15,
3894
+ fontWeight: doodleUiFontWeight(600),
3895
+ color: sketch.ink,
3896
+ textAlign: "left",
3897
+ outline: "none",
3898
+ ...style
3899
+ },
3900
+ ...rest,
3901
+ children: [
3902
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
3903
+ /* @__PURE__ */ jsxRuntime.jsx(
3904
+ "span",
3905
+ {
3906
+ style: {
3907
+ position: "relative",
3908
+ width: 18,
3909
+ height: 18,
3910
+ flexShrink: 0,
3911
+ transform: sketch.open ? "rotate(90deg)" : "rotate(0deg)",
3912
+ transition: "transform 180ms ease"
3913
+ },
3914
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3915
+ RoughSvg,
3916
+ {
3917
+ shape: "path",
3918
+ path: CHEVRON_PATH4,
3919
+ roughness: (sketch.roughness ?? 1.5) * 0.7,
3920
+ seed: sketch.resolvedSeed,
3921
+ sketchColor: sketch.ink,
3922
+ bowing: sketch.bowing,
3923
+ strokeWidth: (sketch.strokeWidth ?? 1.6) + 0.2,
3924
+ inset: 0
3925
+ }
3926
+ )
3927
+ }
3928
+ )
3929
+ ]
3930
+ }
3931
+ );
3932
+ });
3933
+ var CollapsibleContent = react.forwardRef(function CollapsibleContent2({ className, style, children, ...rest }, ref) {
3934
+ const sketch = useCollapsibleSketch();
3935
+ return /* @__PURE__ */ jsxRuntime.jsx(
3936
+ CollapsiblePrimitive__namespace.Content,
3937
+ {
3938
+ ref,
3939
+ className: cn(className),
3940
+ style: {
3941
+ padding: "0 4px 12px",
3942
+ fontFamily: doodleUiFontFamily,
3943
+ fontSize: 14,
3944
+ lineHeight: 1.5,
3945
+ color: sketch.ink,
3946
+ ...style
3947
+ },
3948
+ ...rest,
3949
+ children
3950
+ }
3951
+ );
3952
+ });
3953
+ var PopoverSketchContext = react.createContext(
3954
+ null
3955
+ );
3956
+ function usePopoverSketch() {
3957
+ const ctx = react.useContext(PopoverSketchContext);
3958
+ if (!ctx) {
3959
+ throw new Error("Popover parts must be used inside <Popover>.");
3960
+ }
3961
+ return ctx;
3962
+ }
3963
+ function Popover({
3964
+ children,
3965
+ roughness,
3966
+ seed,
3967
+ sketchColor,
3968
+ bowing,
3969
+ fillStyle,
3970
+ strokeWidth,
3971
+ animate,
3972
+ ...rest
3973
+ }) {
3974
+ const resolvedSeed = useResolvedSeed(seed);
3975
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
3976
+ return /* @__PURE__ */ jsxRuntime.jsx(
3977
+ PopoverSketchContext.Provider,
3978
+ {
3979
+ value: {
3980
+ roughness,
3981
+ seed: resolvedSeed,
3982
+ sketchColor,
3983
+ bowing,
3984
+ fillStyle,
3985
+ strokeWidth,
3986
+ resolvedSeed,
3987
+ ink,
3988
+ animate
3989
+ },
3990
+ children: /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Root, { ...rest, children })
3991
+ }
3992
+ );
3993
+ }
3994
+ var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
3995
+ var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
3996
+ var PopoverClose = PopoverPrimitive__namespace.Close;
3997
+ var PopoverContent = react.forwardRef(
3998
+ function PopoverContent2({ className, style, children, sideOffset = 8, ...rest }, ref) {
3999
+ const sketch = usePopoverSketch();
4000
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
4001
+ PopoverPrimitive__namespace.Content,
4002
+ {
4003
+ ref,
4004
+ sideOffset,
4005
+ className: cn(className),
4006
+ style: { zIndex: 80, outline: "none", ...style },
4007
+ ...rest,
4008
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4009
+ SketchBox,
4010
+ {
4011
+ roughness: sketch.roughness,
4012
+ seed: sketch.resolvedSeed,
4013
+ sketchColor: sketch.ink,
4014
+ bowing: sketch.bowing,
4015
+ fillStyle: sketch.fillStyle ?? "solid",
4016
+ fill: "#f7f6f2",
4017
+ strokeWidth: sketch.strokeWidth ?? 1.5,
4018
+ shadow: true,
4019
+ animate: sketch.animate,
4020
+ contentStyle: { padding: "14px 16px", minWidth: 200 },
4021
+ children
4022
+ }
4023
+ )
4024
+ }
4025
+ ) });
4026
+ }
4027
+ );
4028
+ var PopoverArrow = react.forwardRef(
4029
+ function PopoverArrow2(props, ref) {
4030
+ const sketch = usePopoverSketch();
4031
+ return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Arrow, { ref, fill: sketch.ink, ...props });
4032
+ }
4033
+ );
4034
+ var DropdownMenuSketchContext = react.createContext(null);
4035
+ function useDropdownMenuSketch() {
4036
+ const ctx = react.useContext(DropdownMenuSketchContext);
4037
+ if (!ctx) {
4038
+ throw new Error(
4039
+ "DropdownMenu parts must be used inside <DropdownMenu>."
4040
+ );
4041
+ }
4042
+ return ctx;
4043
+ }
4044
+ function DropdownMenu({
4045
+ children,
4046
+ roughness,
4047
+ seed,
4048
+ sketchColor,
4049
+ bowing,
4050
+ fillStyle,
4051
+ strokeWidth,
4052
+ animate,
4053
+ ...rest
4054
+ }) {
4055
+ const resolvedSeed = useResolvedSeed(seed);
4056
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4057
+ return /* @__PURE__ */ jsxRuntime.jsx(
4058
+ DropdownMenuSketchContext.Provider,
4059
+ {
4060
+ value: {
4061
+ roughness,
4062
+ seed: resolvedSeed,
4063
+ sketchColor,
4064
+ bowing,
4065
+ fillStyle,
4066
+ strokeWidth,
4067
+ resolvedSeed,
4068
+ ink,
4069
+ animate
4070
+ },
4071
+ children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Root, { ...rest, children })
4072
+ }
4073
+ );
4074
+ }
4075
+ var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
4076
+ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
4077
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
4078
+ var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
4079
+ var DropdownMenuContent = react.forwardRef(function DropdownMenuContent2({ className, style, children, sideOffset = 6, align = "start", ...rest }, ref) {
4080
+ const sketch = useDropdownMenuSketch();
4081
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
4082
+ DropdownMenuPrimitive__namespace.Content,
4083
+ {
4084
+ ref,
4085
+ sideOffset,
4086
+ align,
4087
+ className: cn(className),
4088
+ style: { zIndex: 80, outline: "none", minWidth: 180, ...style },
4089
+ ...rest,
4090
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4091
+ SketchBox,
4092
+ {
4093
+ roughness: sketch.roughness,
4094
+ seed: sketch.resolvedSeed,
4095
+ sketchColor: sketch.ink,
4096
+ bowing: sketch.bowing,
4097
+ fillStyle: sketch.fillStyle ?? "solid",
4098
+ fill: "#f7f6f2",
4099
+ strokeWidth: sketch.strokeWidth ?? 1.5,
4100
+ shadow: true,
4101
+ animate: sketch.animate,
4102
+ contentStyle: { padding: "6px 4px" },
4103
+ children
4104
+ }
4105
+ )
4106
+ }
4107
+ ) });
4108
+ });
4109
+ function useMark(highlighted) {
4110
+ const sketch = useDropdownMenuSketch();
4111
+ return { sketch, mark: highlighted };
4112
+ }
4113
+ var DropdownMenuItem = react.forwardRef(function DropdownMenuItem2({ className, style, children, inset, ...rest }, ref) {
4114
+ const [highlighted, setHighlighted] = react.useState(false);
4115
+ const { sketch, mark } = useMark(highlighted);
4116
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4117
+ DropdownMenuPrimitive__namespace.Item,
4118
+ {
4119
+ ref,
4120
+ className: cn(className),
4121
+ onPointerMove: () => setHighlighted(true),
4122
+ onPointerLeave: () => setHighlighted(false),
4123
+ onFocus: () => setHighlighted(true),
4124
+ onBlur: () => setHighlighted(false),
4125
+ style: {
4126
+ position: "relative",
4127
+ display: "flex",
4128
+ alignItems: "center",
4129
+ gap: 8,
4130
+ padding: inset ? "7px 12px 7px 26px" : "7px 12px",
4131
+ fontFamily: doodleUiFontFamily,
4132
+ fontSize: 14,
4133
+ color: sketch.ink,
4134
+ outline: "none",
4135
+ cursor: "pointer",
4136
+ userSelect: "none",
4137
+ ...style
4138
+ },
4139
+ ...rest,
4140
+ children: [
4141
+ mark ? /* @__PURE__ */ jsxRuntime.jsx(
4142
+ RoughSvg,
4143
+ {
4144
+ shape: "line",
4145
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4146
+ seed: sketch.resolvedSeed,
4147
+ sketchColor: sketch.ink,
4148
+ bowing: sketch.bowing ?? 1.6,
4149
+ strokeWidth: 1.3,
4150
+ inset: 4,
4151
+ style: { opacity: 0.4 }
4152
+ }
4153
+ ) : null,
4154
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { position: "relative", zIndex: 1 }, children })
4155
+ ]
4156
+ }
4157
+ );
4158
+ });
4159
+ var CHECK_PATH2 = "M 2 6 L 5 9 L 10 3";
4160
+ var DropdownMenuCheckboxItem = react.forwardRef(function DropdownMenuCheckboxItem2({ className, style, children, checked, ...rest }, ref) {
4161
+ const [highlighted, setHighlighted] = react.useState(false);
4162
+ const { sketch, mark } = useMark(highlighted);
4163
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4164
+ DropdownMenuPrimitive__namespace.CheckboxItem,
4165
+ {
4166
+ ref,
4167
+ checked,
4168
+ className: cn(className),
4169
+ onPointerMove: () => setHighlighted(true),
4170
+ onPointerLeave: () => setHighlighted(false),
4171
+ style: {
4172
+ position: "relative",
4173
+ display: "flex",
4174
+ alignItems: "center",
4175
+ gap: 8,
4176
+ padding: "7px 12px 7px 26px",
4177
+ fontFamily: doodleUiFontFamily,
4178
+ fontSize: 14,
4179
+ color: sketch.ink,
4180
+ outline: "none",
4181
+ cursor: "pointer",
4182
+ userSelect: "none",
4183
+ ...style
4184
+ },
4185
+ ...rest,
4186
+ children: [
4187
+ mark ? /* @__PURE__ */ jsxRuntime.jsx(
4188
+ RoughSvg,
4189
+ {
4190
+ shape: "line",
4191
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4192
+ seed: sketch.resolvedSeed,
4193
+ sketchColor: sketch.ink,
4194
+ bowing: sketch.bowing ?? 1.6,
4195
+ strokeWidth: 1.3,
4196
+ inset: 4,
4197
+ style: { opacity: 0.4 }
4198
+ }
4199
+ ) : null,
4200
+ /* @__PURE__ */ jsxRuntime.jsx(
4201
+ "span",
4202
+ {
4203
+ style: {
4204
+ position: "relative",
4205
+ width: 12,
4206
+ height: 12,
4207
+ flexShrink: 0,
4208
+ marginLeft: -18
4209
+ },
4210
+ children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
4211
+ RoughSvg,
4212
+ {
4213
+ shape: "path",
4214
+ path: CHECK_PATH2,
4215
+ roughness: (sketch.roughness ?? 1.5) * 0.7,
4216
+ seed: deriveSeed(sketch.resolvedSeed, "checkbox-mark"),
4217
+ sketchColor: SKETCH_COLORS.accent,
4218
+ bowing: sketch.bowing,
4219
+ strokeWidth: 1.6,
4220
+ inset: 0
4221
+ }
4222
+ ) })
4223
+ }
4224
+ ),
4225
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { position: "relative", zIndex: 1 }, children })
4226
+ ]
4227
+ }
4228
+ );
4229
+ });
4230
+ var DropdownMenuRadioItem = react.forwardRef(function DropdownMenuRadioItem2({ className, style, children, ...rest }, ref) {
4231
+ const [highlighted, setHighlighted] = react.useState(false);
4232
+ const { sketch, mark } = useMark(highlighted);
4233
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4234
+ DropdownMenuPrimitive__namespace.RadioItem,
4235
+ {
4236
+ ref,
4237
+ className: cn(className),
4238
+ onPointerMove: () => setHighlighted(true),
4239
+ onPointerLeave: () => setHighlighted(false),
4240
+ style: {
4241
+ position: "relative",
4242
+ display: "flex",
4243
+ alignItems: "center",
4244
+ gap: 8,
4245
+ padding: "7px 12px 7px 26px",
4246
+ fontFamily: doodleUiFontFamily,
4247
+ fontSize: 14,
4248
+ color: sketch.ink,
4249
+ outline: "none",
4250
+ cursor: "pointer",
4251
+ userSelect: "none",
4252
+ ...style
4253
+ },
4254
+ ...rest,
4255
+ children: [
4256
+ mark ? /* @__PURE__ */ jsxRuntime.jsx(
4257
+ RoughSvg,
4258
+ {
4259
+ shape: "line",
4260
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4261
+ seed: sketch.resolvedSeed,
4262
+ sketchColor: sketch.ink,
4263
+ bowing: sketch.bowing ?? 1.6,
4264
+ strokeWidth: 1.3,
4265
+ inset: 4,
4266
+ style: { opacity: 0.4 }
4267
+ }
4268
+ ) : null,
4269
+ /* @__PURE__ */ jsxRuntime.jsx(
4270
+ "span",
4271
+ {
4272
+ style: {
4273
+ position: "relative",
4274
+ width: 8,
4275
+ height: 8,
4276
+ flexShrink: 0,
4277
+ marginLeft: -18
4278
+ },
4279
+ children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
4280
+ RoughSvg,
4281
+ {
4282
+ shape: "ellipse",
4283
+ roughness: (sketch.roughness ?? 1.5) * 0.8,
4284
+ seed: deriveSeed(sketch.resolvedSeed, "radio-mark"),
4285
+ sketchColor: SKETCH_COLORS.accent,
4286
+ bowing: sketch.bowing,
4287
+ fillStyle: "solid",
4288
+ fill: SKETCH_COLORS.accent,
4289
+ strokeWidth: 1.2,
4290
+ inset: 0
4291
+ }
4292
+ ) })
4293
+ }
4294
+ ),
4295
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { position: "relative", zIndex: 1 }, children })
4296
+ ]
4297
+ }
4298
+ );
4299
+ });
4300
+ var DropdownMenuLabel = react.forwardRef(function DropdownMenuLabel2({ className, style, children, ...rest }, ref) {
4301
+ const sketch = useDropdownMenuSketch();
4302
+ return /* @__PURE__ */ jsxRuntime.jsx(
4303
+ DropdownMenuPrimitive__namespace.Label,
4304
+ {
4305
+ ref,
4306
+ className: cn(className),
4307
+ style: {
4308
+ padding: "6px 12px",
4309
+ fontFamily: doodleUiFontFamily,
4310
+ fontSize: 12,
4311
+ fontWeight: 700,
4312
+ color: sketch.ink,
4313
+ opacity: 0.6,
4314
+ textTransform: "uppercase",
4315
+ letterSpacing: 0.4,
4316
+ ...style
4317
+ },
4318
+ ...rest,
4319
+ children
4320
+ }
4321
+ );
4322
+ });
4323
+ var DropdownMenuSeparator = react.forwardRef(function DropdownMenuSeparator2({ className, style, ...rest }, ref) {
4324
+ const sketch = useDropdownMenuSketch();
4325
+ return /* @__PURE__ */ jsxRuntime.jsx(
4326
+ DropdownMenuPrimitive__namespace.Separator,
4327
+ {
4328
+ ref,
4329
+ className: cn(className),
4330
+ style: { position: "relative", height: 10, margin: "2px 0", ...style },
4331
+ ...rest,
4332
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4333
+ RoughSvg,
4334
+ {
4335
+ shape: "line",
4336
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
4337
+ seed: deriveSeed(sketch.resolvedSeed, "separator"),
4338
+ sketchColor: sketch.ink,
4339
+ bowing: sketch.bowing ?? 1.8,
4340
+ strokeWidth: 1.2,
4341
+ inset: 6,
4342
+ style: { opacity: 0.5 }
4343
+ }
4344
+ )
4345
+ }
4346
+ );
4347
+ });
4348
+ var DialogSketchContext = react.createContext(
4349
+ null
4350
+ );
4351
+ function useDialogSketch() {
4352
+ const ctx = react.useContext(DialogSketchContext);
4353
+ if (!ctx) {
4354
+ throw new Error("Dialog parts must be used inside <Dialog>.");
4355
+ }
4356
+ return ctx;
4357
+ }
4358
+ function Dialog2({
4359
+ children,
4360
+ open,
4361
+ defaultOpen,
4362
+ onOpenChange,
4363
+ roughness,
4364
+ seed,
4365
+ sketchColor,
4366
+ bowing,
4367
+ fillStyle,
4368
+ strokeWidth,
4369
+ animate,
4370
+ ...rest
4371
+ }) {
4372
+ const resolvedSeed = useResolvedSeed(seed);
4373
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4374
+ const [uncontrolled, setUncontrolled] = react.useState(defaultOpen === true);
4375
+ const isOpen = open ?? uncontrolled;
4376
+ return /* @__PURE__ */ jsxRuntime.jsx(
4377
+ DialogSketchContext.Provider,
4378
+ {
4379
+ value: {
4380
+ roughness,
4381
+ seed: resolvedSeed,
4382
+ sketchColor,
4383
+ bowing,
4384
+ fillStyle,
4385
+ strokeWidth,
4386
+ resolvedSeed,
4387
+ ink,
4388
+ animate,
4389
+ open: isOpen
4390
+ },
4391
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4392
+ Dialog__namespace.Root,
4393
+ {
4394
+ open: isOpen,
4395
+ onOpenChange: (next) => {
4396
+ setUncontrolled(next);
4397
+ onOpenChange?.(next);
4398
+ },
4399
+ ...rest,
4400
+ children
4401
+ }
4402
+ )
4403
+ }
4404
+ );
4405
+ }
4406
+ var DialogTrigger = Dialog__namespace.Trigger;
4407
+ var DialogPortal = Dialog__namespace.Portal;
4408
+ var DialogClose = Dialog__namespace.Close;
4409
+ var DialogOverlay = react.forwardRef(
4410
+ function DialogOverlay2({ style, ...rest }, ref) {
4411
+ const sketch = useDialogSketch();
4412
+ const shouldAnimate = useAnimate(sketch.animate);
4413
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Overlay, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
4414
+ framerMotion.motion.div,
4415
+ {
4416
+ initial: shouldAnimate ? { opacity: 0 } : false,
4417
+ animate: { opacity: 1 },
4418
+ exit: shouldAnimate ? { opacity: 0 } : void 0,
4419
+ transition: shouldAnimate ? { duration: 0.2, ease: "easeOut" } : { duration: 0 },
4420
+ style: {
4421
+ position: "fixed",
4422
+ inset: 0,
4423
+ background: "rgba(31, 29, 26, 0.38)",
4424
+ zIndex: 70,
4425
+ ...style
4426
+ }
4427
+ }
4428
+ ) });
4429
+ }
4430
+ );
4431
+ var DialogContent = react.forwardRef(
4432
+ function DialogContent2({ className, style, contentStyle, children, ...rest }, ref) {
4433
+ const sketch = useDialogSketch();
4434
+ const shouldAnimate = useAnimate(sketch.animate);
4435
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { forceMount: true, children: [
4436
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
4437
+ /* @__PURE__ */ jsxRuntime.jsx(
4438
+ "div",
4439
+ {
4440
+ style: {
4441
+ position: "fixed",
4442
+ inset: 0,
4443
+ zIndex: 80,
4444
+ display: "flex",
4445
+ alignItems: "center",
4446
+ justifyContent: "center",
4447
+ pointerEvents: "none",
4448
+ padding: 16
4449
+ },
4450
+ children: /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Content, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
4451
+ framerMotion.motion.div,
4452
+ {
4453
+ className: cn(className),
4454
+ initial: shouldAnimate ? { opacity: 0, scale: 0.96, y: 10 } : false,
4455
+ animate: { opacity: 1, scale: 1, y: 0 },
4456
+ exit: shouldAnimate ? { opacity: 0, scale: 0.96, y: 8 } : void 0,
4457
+ transition: shouldAnimate ? { duration: 0.22, ease: "easeOut" } : { duration: 0 },
4458
+ style: {
4459
+ width: "min(420px, calc(100vw - 32px))",
4460
+ outline: "none",
4461
+ pointerEvents: "auto",
4462
+ ...style
4463
+ },
4464
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4465
+ SketchBox,
4466
+ {
4467
+ roughness: sketch.roughness,
4468
+ seed: sketch.resolvedSeed,
4469
+ sketchColor: sketch.ink,
4470
+ bowing: sketch.bowing,
4471
+ fillStyle: sketch.fillStyle ?? "solid",
4472
+ fill: "#f7f6f2",
4473
+ strokeWidth: sketch.strokeWidth ?? 2,
4474
+ animate: sketch.animate,
4475
+ contentStyle: { padding: 20, ...contentStyle },
4476
+ children
4477
+ }
4478
+ )
4479
+ }
4480
+ ) })
4481
+ }
4482
+ )
4483
+ ] }) : null });
4484
+ }
4485
+ );
4486
+ function DialogHeader({ children, className, style }) {
4487
+ return /* @__PURE__ */ jsxRuntime.jsx(
4488
+ "div",
4489
+ {
4490
+ className: cn(className),
4491
+ style: {
4492
+ display: "flex",
4493
+ flexDirection: "column",
4494
+ gap: 6,
4495
+ marginBottom: 12,
4496
+ ...style
4497
+ },
4498
+ children
4499
+ }
4500
+ );
4501
+ }
4502
+ function DialogFooter({ children, className, style }) {
4503
+ return /* @__PURE__ */ jsxRuntime.jsx(
4504
+ "div",
4505
+ {
4506
+ className: cn(className),
4507
+ style: {
4508
+ display: "flex",
4509
+ justifyContent: "flex-end",
4510
+ gap: 8,
4511
+ marginTop: 16,
4512
+ ...style
4513
+ },
4514
+ children
4515
+ }
4516
+ );
4517
+ }
4518
+ var DialogTitle = react.forwardRef(
4519
+ function DialogTitle2({ style, ...rest }, ref) {
4520
+ const sketch = useDialogSketch();
4521
+ return /* @__PURE__ */ jsxRuntime.jsx(
4522
+ Dialog__namespace.Title,
4523
+ {
4524
+ ref,
4525
+ style: {
4526
+ margin: 0,
4527
+ fontSize: 18,
4528
+ fontWeight: doodleUiFontWeight(700),
4529
+ fontFamily: doodleUiFontFamily,
4530
+ color: sketch.ink,
4531
+ ...style
4532
+ },
4533
+ ...rest
4534
+ }
4535
+ );
4536
+ }
4537
+ );
4538
+ var DialogDescription = react.forwardRef(function DialogDescription2({ style, ...rest }, ref) {
4539
+ const sketch = useDialogSketch();
4540
+ return /* @__PURE__ */ jsxRuntime.jsx(
4541
+ Dialog__namespace.Description,
4542
+ {
4543
+ ref,
4544
+ style: {
4545
+ margin: 0,
4546
+ fontSize: 14,
4547
+ lineHeight: 1.5,
4548
+ fontFamily: doodleUiFontFamily,
4549
+ color: sketch.ink,
4550
+ opacity: 0.8,
4551
+ ...style
4552
+ },
4553
+ ...rest
4554
+ }
4555
+ );
4556
+ });
4557
+ var AlertDialogSketchContext = react.createContext(null);
4558
+ function useAlertDialogSketch() {
4559
+ const ctx = react.useContext(AlertDialogSketchContext);
4560
+ if (!ctx) {
4561
+ throw new Error(
4562
+ "AlertDialog parts must be used inside <AlertDialog>."
4563
+ );
4564
+ }
4565
+ return ctx;
4566
+ }
4567
+ function AlertDialog({
4568
+ children,
4569
+ open,
4570
+ defaultOpen,
4571
+ onOpenChange,
4572
+ roughness,
4573
+ seed,
4574
+ sketchColor,
4575
+ bowing,
4576
+ fillStyle,
4577
+ strokeWidth,
4578
+ animate,
4579
+ ...rest
4580
+ }) {
4581
+ const resolvedSeed = useResolvedSeed(seed);
4582
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4583
+ const [uncontrolled, setUncontrolled] = react.useState(defaultOpen === true);
4584
+ const isOpen = open ?? uncontrolled;
4585
+ return /* @__PURE__ */ jsxRuntime.jsx(
4586
+ AlertDialogSketchContext.Provider,
4587
+ {
4588
+ value: {
4589
+ roughness,
4590
+ seed: resolvedSeed,
4591
+ sketchColor,
4592
+ bowing,
4593
+ fillStyle,
4594
+ strokeWidth,
4595
+ resolvedSeed,
4596
+ ink,
4597
+ animate,
4598
+ open: isOpen
4599
+ },
4600
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4601
+ AlertDialogPrimitive__namespace.Root,
4602
+ {
4603
+ open: isOpen,
4604
+ onOpenChange: (next) => {
4605
+ setUncontrolled(next);
4606
+ onOpenChange?.(next);
4607
+ },
4608
+ ...rest,
4609
+ children
4610
+ }
4611
+ )
4612
+ }
4613
+ );
4614
+ }
4615
+ var AlertDialogTrigger = AlertDialogPrimitive__namespace.Trigger;
4616
+ var AlertDialogPortal = AlertDialogPrimitive__namespace.Portal;
4617
+ var AlertDialogOverlay = react.forwardRef(function AlertDialogOverlay2({ style, ...rest }, ref) {
4618
+ const sketch = useAlertDialogSketch();
4619
+ const shouldAnimate = useAnimate(sketch.animate);
4620
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Overlay, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
4621
+ framerMotion.motion.div,
4622
+ {
4623
+ initial: shouldAnimate ? { opacity: 0 } : false,
4624
+ animate: { opacity: 1 },
4625
+ exit: shouldAnimate ? { opacity: 0 } : void 0,
4626
+ transition: shouldAnimate ? { duration: 0.2, ease: "easeOut" } : { duration: 0 },
4627
+ style: {
4628
+ position: "fixed",
4629
+ inset: 0,
4630
+ background: "rgba(31, 29, 26, 0.38)",
4631
+ zIndex: 70,
4632
+ ...style
4633
+ }
4634
+ }
4635
+ ) });
4636
+ });
4637
+ var AlertDialogContent = react.forwardRef(function AlertDialogContent2({ className, style, contentStyle, children, ...rest }, ref) {
4638
+ const sketch = useAlertDialogSketch();
4639
+ const shouldAnimate = useAnimate(sketch.animate);
4640
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: sketch.open ? /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPrimitive__namespace.Portal, { forceMount: true, children: [
4641
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
4642
+ /* @__PURE__ */ jsxRuntime.jsx(
4643
+ "div",
4644
+ {
4645
+ style: {
4646
+ position: "fixed",
4647
+ inset: 0,
4648
+ zIndex: 80,
4649
+ display: "flex",
4650
+ alignItems: "center",
4651
+ justifyContent: "center",
4652
+ pointerEvents: "none",
4653
+ padding: 16
4654
+ },
4655
+ children: /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Content, { ref, asChild: true, forceMount: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
4656
+ framerMotion.motion.div,
4657
+ {
4658
+ className: cn(className),
4659
+ initial: shouldAnimate ? { opacity: 0, scale: 0.96, y: 10 } : false,
4660
+ animate: { opacity: 1, scale: 1, y: 0 },
4661
+ exit: shouldAnimate ? { opacity: 0, scale: 0.96, y: 8 } : void 0,
4662
+ transition: shouldAnimate ? { duration: 0.22, ease: "easeOut" } : { duration: 0 },
4663
+ style: {
4664
+ width: "min(420px, calc(100vw - 32px))",
4665
+ outline: "none",
4666
+ pointerEvents: "auto",
4667
+ ...style
4668
+ },
4669
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4670
+ SketchBox,
4671
+ {
4672
+ roughness: sketch.roughness,
4673
+ seed: sketch.resolvedSeed,
4674
+ sketchColor: sketch.ink,
4675
+ bowing: sketch.bowing,
4676
+ fillStyle: sketch.fillStyle ?? "solid",
4677
+ fill: "#f7f6f2",
4678
+ strokeWidth: sketch.strokeWidth ?? 2,
4679
+ animate: sketch.animate,
4680
+ contentStyle: { padding: 20, ...contentStyle },
4681
+ children
4682
+ }
4683
+ )
4684
+ }
4685
+ ) })
4686
+ }
4687
+ )
4688
+ ] }) : null });
4689
+ });
4690
+ function AlertDialogHeader({
4691
+ children,
4692
+ className,
4693
+ style
4694
+ }) {
4695
+ return /* @__PURE__ */ jsxRuntime.jsx(
4696
+ "div",
4697
+ {
4698
+ className: cn(className),
4699
+ style: {
4700
+ display: "flex",
4701
+ flexDirection: "column",
4702
+ gap: 6,
4703
+ marginBottom: 12,
4704
+ ...style
4705
+ },
4706
+ children
4707
+ }
4708
+ );
4709
+ }
4710
+ function AlertDialogFooter({
4711
+ children,
4712
+ className,
4713
+ style
4714
+ }) {
4715
+ return /* @__PURE__ */ jsxRuntime.jsx(
4716
+ "div",
4717
+ {
4718
+ className: cn(className),
4719
+ style: {
4720
+ display: "flex",
4721
+ justifyContent: "flex-end",
4722
+ gap: 8,
4723
+ marginTop: 16,
4724
+ ...style
4725
+ },
4726
+ children
4727
+ }
4728
+ );
4729
+ }
4730
+ var AlertDialogTitle = react.forwardRef(function AlertDialogTitle2({ style, ...rest }, ref) {
4731
+ const sketch = useAlertDialogSketch();
4732
+ return /* @__PURE__ */ jsxRuntime.jsx(
4733
+ AlertDialogPrimitive__namespace.Title,
4734
+ {
4735
+ ref,
4736
+ style: {
4737
+ margin: 0,
4738
+ fontSize: 18,
4739
+ fontWeight: doodleUiFontWeight(700),
4740
+ fontFamily: doodleUiFontFamily,
4741
+ color: sketch.ink,
4742
+ ...style
4743
+ },
4744
+ ...rest
4745
+ }
4746
+ );
4747
+ });
4748
+ var AlertDialogDescription = react.forwardRef(function AlertDialogDescription2({ style, ...rest }, ref) {
4749
+ const sketch = useAlertDialogSketch();
4750
+ return /* @__PURE__ */ jsxRuntime.jsx(
4751
+ AlertDialogPrimitive__namespace.Description,
4752
+ {
4753
+ ref,
4754
+ style: {
4755
+ margin: 0,
4756
+ fontSize: 14,
4757
+ lineHeight: 1.5,
4758
+ fontFamily: doodleUiFontFamily,
4759
+ color: sketch.ink,
4760
+ opacity: 0.8,
4761
+ ...style
4762
+ },
4763
+ ...rest
4764
+ }
4765
+ );
4766
+ });
4767
+ var AlertDialogAction = react.forwardRef(function AlertDialogAction2({ children, ...rest }, ref) {
4768
+ const sketch = useAlertDialogSketch();
4769
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Action, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4770
+ Button,
4771
+ {
4772
+ ref,
4773
+ variant: "primary",
4774
+ sketchColor: sketch.sketchColor,
4775
+ roughness: sketch.roughness,
4776
+ seed: sketch.resolvedSeed,
4777
+ bowing: sketch.bowing,
4778
+ animate: sketch.animate,
4779
+ ...rest,
4780
+ children
4781
+ }
4782
+ ) });
4783
+ });
4784
+ var AlertDialogCancel = react.forwardRef(function AlertDialogCancel2({ children, ...rest }, ref) {
4785
+ const sketch = useAlertDialogSketch();
4786
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Cancel, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4787
+ Button,
4788
+ {
4789
+ ref,
4790
+ variant: "outline",
4791
+ sketchColor: sketch.sketchColor,
4792
+ roughness: sketch.roughness,
4793
+ seed: sketch.resolvedSeed,
4794
+ bowing: sketch.bowing,
4795
+ animate: sketch.animate,
4796
+ ...rest,
4797
+ children
4798
+ }
4799
+ ) });
4800
+ });
4801
+ var CommandSketchContext = react.createContext(
4802
+ null
4803
+ );
4804
+ function useCommandSketch() {
4805
+ const ctx = react.useContext(CommandSketchContext);
4806
+ if (!ctx) {
4807
+ throw new Error("Command parts must be used inside <Command>.");
4808
+ }
4809
+ return ctx;
4810
+ }
4811
+ var Command = react.forwardRef(
4812
+ function Command2({
4813
+ className,
4814
+ style,
4815
+ children,
4816
+ roughness,
4817
+ seed,
4818
+ sketchColor,
4819
+ bowing,
4820
+ fillStyle,
4821
+ strokeWidth,
4822
+ animate,
4823
+ ...rest
4824
+ }, ref) {
4825
+ const resolvedSeed = useResolvedSeed(seed);
4826
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
4827
+ return /* @__PURE__ */ jsxRuntime.jsx(
4828
+ CommandSketchContext.Provider,
4829
+ {
4830
+ value: {
4831
+ roughness,
4832
+ seed: resolvedSeed,
4833
+ sketchColor,
4834
+ bowing,
4835
+ fillStyle,
4836
+ strokeWidth,
4837
+ resolvedSeed,
4838
+ ink,
4839
+ animate
4840
+ },
4841
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4842
+ SketchBox,
4843
+ {
4844
+ className: cn(className),
4845
+ style,
4846
+ roughness,
4847
+ seed: resolvedSeed,
4848
+ sketchColor: ink,
4849
+ bowing,
4850
+ fillStyle: fillStyle ?? "solid",
4851
+ fill: "#f7f6f2",
4852
+ strokeWidth: strokeWidth ?? 1.5,
4853
+ animate,
4854
+ contentStyle: { padding: 0, display: "flex", flexDirection: "column" },
4855
+ children: /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command, { ref, ...rest, children })
4856
+ }
4857
+ )
4858
+ }
4859
+ );
4860
+ }
4861
+ );
4862
+ var CommandInput = react.forwardRef(
4863
+ function CommandInput2({ className, style, ...rest }, ref) {
4864
+ const sketch = useCommandSketch();
4865
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", padding: "10px 12px 12px" }, children: [
4866
+ /* @__PURE__ */ jsxRuntime.jsx(
4867
+ cmdk.CommandInput,
4868
+ {
4869
+ ref,
4870
+ className: cn(className),
4871
+ style: {
4872
+ width: "100%",
4873
+ boxSizing: "border-box",
4874
+ border: "none",
4875
+ outline: "none",
4876
+ background: "transparent",
4877
+ color: sketch.ink,
4878
+ fontFamily: doodleUiFontFamily,
4879
+ fontSize: 15,
4880
+ padding: "2px 2px 8px",
4881
+ ...style
4882
+ },
4883
+ ...rest
4884
+ }
4885
+ ),
4886
+ /* @__PURE__ */ jsxRuntime.jsx(
4887
+ RoughSvg,
4888
+ {
4889
+ shape: "line",
4890
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
4891
+ seed: deriveSeed(sketch.resolvedSeed, "command-divider"),
4892
+ sketchColor: sketch.ink,
4893
+ bowing: sketch.bowing ?? 1.6,
4894
+ strokeWidth: 1.2,
4895
+ inset: 4,
4896
+ style: { position: "absolute", bottom: 0, left: 0, right: 0, height: 8, opacity: 0.4 }
4897
+ }
4898
+ )
4899
+ ] });
4900
+ }
4901
+ );
4902
+ var CommandList = react.forwardRef(
4903
+ function CommandList2({ className, style, ...rest }, ref) {
4904
+ return /* @__PURE__ */ jsxRuntime.jsx(
4905
+ cmdk.CommandList,
4906
+ {
4907
+ ref,
4908
+ className: cn(className),
4909
+ style: {
4910
+ maxHeight: 280,
4911
+ overflowY: "auto",
4912
+ padding: "4px 4px 8px",
4913
+ ...style
4914
+ },
4915
+ ...rest
4916
+ }
4917
+ );
4918
+ }
4919
+ );
4920
+ var CommandEmpty = react.forwardRef(
4921
+ function CommandEmpty2({ className, style, ...rest }, ref) {
4922
+ const sketch = useCommandSketch();
4923
+ return /* @__PURE__ */ jsxRuntime.jsx(
4924
+ cmdk.CommandEmpty,
4925
+ {
4926
+ ref,
4927
+ className: cn(className),
4928
+ style: {
4929
+ padding: "16px 12px",
4930
+ textAlign: "center",
4931
+ fontFamily: doodleUiFontFamily,
4932
+ fontSize: 14,
4933
+ color: sketch.ink,
4934
+ opacity: 0.6,
4935
+ ...style
4936
+ },
4937
+ ...rest
4938
+ }
4939
+ );
4940
+ }
4941
+ );
4942
+ var CommandGroup = react.forwardRef(
4943
+ function CommandGroup2({ className, style, ...rest }, ref) {
4944
+ const sketch = useCommandSketch();
4945
+ return /* @__PURE__ */ jsxRuntime.jsx(
4946
+ cmdk.CommandGroup,
4947
+ {
4948
+ ref,
4949
+ className: cn(className),
4950
+ style: { padding: "4px 2px", color: sketch.ink, ...style },
4951
+ ...rest
4952
+ }
4953
+ );
4954
+ }
4955
+ );
4956
+ var CommandItem = react.forwardRef(
4957
+ function CommandItem2({ className, style, children, onMouseEnter, onMouseLeave, ...rest }, ref) {
4958
+ const sketch = useCommandSketch();
4959
+ const [highlighted, setHighlighted] = react.useState(false);
4960
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4961
+ cmdk.CommandItem,
4962
+ {
4963
+ ref,
4964
+ className: cn(className),
4965
+ onMouseEnter: (event) => {
4966
+ setHighlighted(true);
4967
+ onMouseEnter?.(event);
4968
+ },
4969
+ onMouseLeave: (event) => {
4970
+ setHighlighted(false);
4971
+ onMouseLeave?.(event);
4972
+ },
4973
+ style: {
4974
+ position: "relative",
4975
+ display: "flex",
4976
+ alignItems: "center",
4977
+ gap: 8,
4978
+ padding: "7px 10px",
4979
+ borderRadius: 4,
4980
+ fontFamily: doodleUiFontFamily,
4981
+ fontSize: 14,
4982
+ color: sketch.ink,
4983
+ cursor: "pointer",
4984
+ userSelect: "none",
4985
+ outline: "none",
4986
+ ...style
4987
+ },
4988
+ ...rest,
4989
+ children: [
4990
+ highlighted ? /* @__PURE__ */ jsxRuntime.jsx(
4991
+ RoughSvg,
4992
+ {
4993
+ shape: "line",
4994
+ roughness: (sketch.roughness ?? 1.5) + 0.4,
4995
+ seed: sketch.resolvedSeed,
4996
+ sketchColor: sketch.ink,
4997
+ bowing: sketch.bowing ?? 1.6,
4998
+ strokeWidth: 1.3,
4999
+ inset: 3,
5000
+ style: { opacity: 0.4 }
5001
+ }
5002
+ ) : null,
5003
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { position: "relative", zIndex: 1, flex: 1 }, children })
5004
+ ]
5005
+ }
5006
+ );
5007
+ }
5008
+ );
5009
+ var CommandSeparator = react.forwardRef(function CommandSeparator2({ className, style, ...rest }, ref) {
5010
+ const sketch = useCommandSketch();
5011
+ return /* @__PURE__ */ jsxRuntime.jsx(
5012
+ cmdk.CommandSeparator,
5013
+ {
5014
+ ref,
5015
+ className: cn(className),
5016
+ style: { position: "relative", height: 10, margin: "2px 4px", ...style },
5017
+ ...rest,
5018
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5019
+ RoughSvg,
5020
+ {
5021
+ shape: "line",
5022
+ roughness: (sketch.roughness ?? 1.5) + 0.2,
5023
+ seed: deriveSeed(sketch.resolvedSeed, "command-separator"),
5024
+ sketchColor: sketch.ink,
5025
+ bowing: sketch.bowing ?? 1.8,
5026
+ strokeWidth: 1.2,
5027
+ inset: 4,
5028
+ style: { opacity: 0.4 }
5029
+ }
5030
+ )
5031
+ }
5032
+ );
5033
+ });
5034
+ function CommandShortcut({
5035
+ children,
5036
+ className,
5037
+ style
5038
+ }) {
5039
+ const sketch = useCommandSketch();
5040
+ return /* @__PURE__ */ jsxRuntime.jsx(
5041
+ "span",
5042
+ {
5043
+ className: cn(className),
5044
+ style: {
5045
+ marginLeft: "auto",
5046
+ fontFamily: doodleUiFontFamily,
5047
+ fontSize: 12,
5048
+ color: sketch.ink,
5049
+ opacity: 0.5,
5050
+ letterSpacing: 0.4,
5051
+ ...style
5052
+ },
5053
+ children
5054
+ }
5055
+ );
5056
+ }
5057
+ var CHEVRON_PATH5 = "M 4 6 L 10 12 L 16 6";
5058
+ function Combobox({
5059
+ options,
5060
+ placeholder = "Select\u2026",
5061
+ searchPlaceholder = "Search\u2026",
5062
+ emptyMessage = "No results.",
5063
+ value,
5064
+ defaultValue,
5065
+ onValueChange,
5066
+ disabled,
5067
+ className,
5068
+ style,
5069
+ roughness,
5070
+ seed,
5071
+ sketchColor,
5072
+ bowing,
5073
+ fillStyle,
5074
+ strokeWidth,
5075
+ animate,
5076
+ "aria-label": ariaLabel
5077
+ }) {
5078
+ const [open, setOpen] = react.useState(false);
5079
+ const [uncontrolled, setUncontrolled] = react.useState(defaultValue);
5080
+ const selectedValue = value ?? uncontrolled;
5081
+ const selectedOption = options.find(
5082
+ (option) => option.value === selectedValue
5083
+ );
5084
+ const ink = sketchColor ?? SKETCH_COLORS.ink;
5085
+ const resolvedSeed = useResolvedSeed(seed);
5086
+ const shouldAnimate = useAnimate(animate);
5087
+ const triggerRef = react.useRef(null);
5088
+ useDrawIn(triggerRef, DRAW_IN_DURATION_MS, shouldAnimate);
5089
+ function handleSelect(nextValue) {
5090
+ setUncontrolled(nextValue);
5091
+ onValueChange?.(nextValue);
5092
+ setOpen(false);
5093
+ }
5094
+ return /* @__PURE__ */ jsxRuntime.jsxs(PopoverPrimitive__namespace.Root, { open, onOpenChange: setOpen, children: [
5095
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
5096
+ "button",
5097
+ {
5098
+ ref: (node) => assignRef(triggerRef, node),
5099
+ type: "button",
5100
+ role: "combobox",
5101
+ "aria-expanded": open,
5102
+ "aria-label": ariaLabel,
5103
+ disabled,
5104
+ className: cn(className),
5105
+ style: {
5106
+ position: "relative",
5107
+ display: "inline-flex",
5108
+ alignItems: "center",
5109
+ justifyContent: "space-between",
5110
+ gap: 12,
5111
+ width: "100%",
5112
+ minWidth: 200,
5113
+ minHeight: 38,
5114
+ padding: "8px 12px",
5115
+ border: "none",
5116
+ background: "transparent",
5117
+ cursor: disabled ? "not-allowed" : "pointer",
5118
+ opacity: disabled ? 0.5 : 1,
5119
+ color: ink,
5120
+ fontFamily: doodleUiFontFamily,
5121
+ fontSize: 15,
5122
+ lineHeight: 1.2,
5123
+ outline: "none",
5124
+ textAlign: "left",
5125
+ ...style
5126
+ },
5127
+ children: [
5128
+ /* @__PURE__ */ jsxRuntime.jsx(
5129
+ RoughSvg,
5130
+ {
5131
+ shape: "rectangle",
5132
+ roughness,
5133
+ seed: resolvedSeed,
5134
+ sketchColor: open ? SKETCH_COLORS.accent : ink,
5135
+ bowing,
5136
+ fillStyle,
5137
+ strokeWidth: open ? (strokeWidth ?? 1.75) + 0.35 : strokeWidth
5138
+ }
5139
+ ),
5140
+ /* @__PURE__ */ jsxRuntime.jsx(
5141
+ "span",
5142
+ {
5143
+ style: {
5144
+ position: "relative",
5145
+ zIndex: 1,
5146
+ flex: 1,
5147
+ overflow: "hidden",
5148
+ textOverflow: "ellipsis",
5149
+ whiteSpace: "nowrap"
5150
+ },
5151
+ children: selectedOption?.label ?? placeholder
5152
+ }
5153
+ ),
5154
+ /* @__PURE__ */ jsxRuntime.jsx(
5155
+ "span",
5156
+ {
5157
+ style: { position: "relative", zIndex: 1, width: 18, height: 18, flexShrink: 0 },
5158
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5159
+ RoughSvg,
5160
+ {
5161
+ shape: "path",
5162
+ path: CHEVRON_PATH5,
5163
+ roughness: roughness ? roughness * 0.7 : 1.05,
5164
+ seed: resolvedSeed,
5165
+ sketchColor: ink,
5166
+ bowing,
5167
+ strokeWidth: (strokeWidth ?? 1.6) + 0.2,
5168
+ inset: 0
5169
+ }
5170
+ )
5171
+ }
5172
+ )
5173
+ ]
5174
+ }
5175
+ ) }),
5176
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
5177
+ PopoverPrimitive__namespace.Content,
5178
+ {
5179
+ align: "start",
5180
+ sideOffset: 8,
5181
+ style: {
5182
+ zIndex: 80,
5183
+ outline: "none",
5184
+ width: "var(--radix-popover-trigger-width)"
5185
+ },
5186
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
5187
+ Command,
5188
+ {
5189
+ roughness,
5190
+ seed: resolvedSeed,
5191
+ sketchColor: ink,
5192
+ bowing,
5193
+ fillStyle,
5194
+ strokeWidth,
5195
+ animate,
5196
+ children: [
5197
+ /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: searchPlaceholder }),
5198
+ /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
5199
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: emptyMessage }),
5200
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
5201
+ CommandItem,
5202
+ {
5203
+ value: option.value,
5204
+ disabled: option.disabled,
5205
+ onSelect: handleSelect,
5206
+ children: option.label
5207
+ },
5208
+ option.value
5209
+ )) })
5210
+ ] })
5211
+ ]
5212
+ }
5213
+ )
5214
+ }
5215
+ ) })
5216
+ ] });
5217
+ }
3735
5218
 
3736
5219
  exports.Accordion = Accordion;
3737
5220
  exports.AccordionContent = AccordionContent;
3738
5221
  exports.AccordionItem = AccordionItem;
3739
5222
  exports.AccordionTrigger = AccordionTrigger;
3740
5223
  exports.Alert = Alert;
5224
+ exports.AlertDialog = AlertDialog;
5225
+ exports.AlertDialogAction = AlertDialogAction;
5226
+ exports.AlertDialogCancel = AlertDialogCancel;
5227
+ exports.AlertDialogContent = AlertDialogContent;
5228
+ exports.AlertDialogDescription = AlertDialogDescription;
5229
+ exports.AlertDialogFooter = AlertDialogFooter;
5230
+ exports.AlertDialogHeader = AlertDialogHeader;
5231
+ exports.AlertDialogOverlay = AlertDialogOverlay;
5232
+ exports.AlertDialogPortal = AlertDialogPortal;
5233
+ exports.AlertDialogTitle = AlertDialogTitle;
5234
+ exports.AlertDialogTrigger = AlertDialogTrigger;
3741
5235
  exports.Avatar = Avatar;
3742
5236
  exports.Badge = Badge;
3743
5237
  exports.Breadcrumb = Breadcrumb;
@@ -3745,6 +5239,18 @@ exports.BreadcrumbItem = BreadcrumbItem;
3745
5239
  exports.Button = Button;
3746
5240
  exports.Card = Card;
3747
5241
  exports.Checkbox = Checkbox;
5242
+ exports.Collapsible = Collapsible;
5243
+ exports.CollapsibleContent = CollapsibleContent;
5244
+ exports.CollapsibleTrigger = CollapsibleTrigger;
5245
+ exports.Combobox = Combobox;
5246
+ exports.Command = Command;
5247
+ exports.CommandEmpty = CommandEmpty;
5248
+ exports.CommandGroup = CommandGroup;
5249
+ exports.CommandInput = CommandInput;
5250
+ exports.CommandItem = CommandItem;
5251
+ exports.CommandList = CommandList;
5252
+ exports.CommandSeparator = CommandSeparator;
5253
+ exports.CommandShortcut = CommandShortcut;
3748
5254
  exports.DEFAULT_BOWING = DEFAULT_BOWING;
3749
5255
  exports.DEFAULT_INK = DEFAULT_INK;
3750
5256
  exports.DEFAULT_ROUGHNESS = DEFAULT_ROUGHNESS;
@@ -3753,9 +5259,31 @@ exports.DRAW_IN_ALERT_MS = DRAW_IN_ALERT_MS;
3753
5259
  exports.DRAW_IN_DURATION_MS = DRAW_IN_DURATION_MS;
3754
5260
  exports.DRAW_IN_MARK_MS = DRAW_IN_MARK_MS;
3755
5261
  exports.DRAW_IN_TOOLTIP_MS = DRAW_IN_TOOLTIP_MS;
5262
+ exports.Dialog = Dialog2;
5263
+ exports.DialogClose = DialogClose;
5264
+ exports.DialogContent = DialogContent;
5265
+ exports.DialogDescription = DialogDescription;
5266
+ exports.DialogFooter = DialogFooter;
5267
+ exports.DialogHeader = DialogHeader;
5268
+ exports.DialogOverlay = DialogOverlay;
5269
+ exports.DialogPortal = DialogPortal;
5270
+ exports.DialogTitle = DialogTitle;
5271
+ exports.DialogTrigger = DialogTrigger;
3756
5272
  exports.Divider = Divider;
3757
5273
  exports.DoodleUIProvider = DoodleUIProvider;
5274
+ exports.DropdownMenu = DropdownMenu;
5275
+ exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
5276
+ exports.DropdownMenuContent = DropdownMenuContent;
5277
+ exports.DropdownMenuGroup = DropdownMenuGroup;
5278
+ exports.DropdownMenuItem = DropdownMenuItem;
5279
+ exports.DropdownMenuLabel = DropdownMenuLabel;
5280
+ exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
5281
+ exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
5282
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
5283
+ exports.DropdownMenuSub = DropdownMenuSub;
5284
+ exports.DropdownMenuTrigger = DropdownMenuTrigger;
3758
5285
  exports.Input = Input;
5286
+ exports.Label = Label2;
3759
5287
  exports.Modal = Modal;
3760
5288
  exports.ModalClose = ModalClose;
3761
5289
  exports.ModalDescription = ModalDescription;
@@ -3763,6 +5291,12 @@ exports.ModalRoot = ModalRoot;
3763
5291
  exports.ModalTitle = ModalTitle;
3764
5292
  exports.ModalTrigger = ModalTrigger;
3765
5293
  exports.Pagination = Pagination;
5294
+ exports.Popover = Popover;
5295
+ exports.PopoverAnchor = PopoverAnchor;
5296
+ exports.PopoverArrow = PopoverArrow;
5297
+ exports.PopoverClose = PopoverClose;
5298
+ exports.PopoverContent = PopoverContent;
5299
+ exports.PopoverTrigger = PopoverTrigger;
3766
5300
  exports.Progress = Progress;
3767
5301
  exports.Radio = Radio;
3768
5302
  exports.RadioGroup = RadioGroup;