doodleui-react 0.2.0 → 0.3.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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { CSSProperties, HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ComponentPropsWithoutRef, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ import { CSSProperties, HTMLAttributes, ReactNode, RefObject, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ComponentPropsWithoutRef, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
3
3
  import { Options } from 'roughjs/bin/core';
4
4
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
5
5
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
@@ -75,6 +75,14 @@ interface SketchBoxProps extends SketchProps, Omit<HTMLAttributes<HTMLDivElement
75
75
  contentStyle?: CSSProperties;
76
76
  inset?: number;
77
77
  path?: string;
78
+ /**
79
+ * Sketch-in the border on mount. Defaults to the DoodleUIProvider value.
80
+ */
81
+ animate?: boolean;
82
+ /** Override the default 400ms draw-in duration. */
83
+ drawInDuration?: number;
84
+ /** Replay draw-in when this value changes. */
85
+ drawInKey?: unknown;
78
86
  }
79
87
  declare const SketchBox: react.ForwardRefExoticComponent<SketchBoxProps & react.RefAttributes<HTMLDivElement>>;
80
88
 
@@ -106,26 +114,96 @@ declare function useSketchSeed(): SketchSeedContextValue;
106
114
  */
107
115
  declare function useResolvedSeed(seed?: number): number;
108
116
 
117
+ interface DoodleUIContextValue {
118
+ /** Default for components that do not set their own `animate` prop. */
119
+ animate: boolean;
120
+ /** When true, skip the prefers-reduced-motion disable. */
121
+ forceAnimate: boolean;
122
+ }
123
+ interface DoodleUIProviderProps {
124
+ children: ReactNode;
125
+ /**
126
+ * Default animation setting for descendant doodle-ui components.
127
+ * Per-component `animate` still wins when it is set.
128
+ */
129
+ animate?: boolean;
130
+ /**
131
+ * Play animations even when the user prefers reduced motion.
132
+ * Off by default — only set this as an explicit escape hatch.
133
+ */
134
+ forceAnimate?: boolean;
135
+ }
136
+ declare function DoodleUIProvider({ children, animate, forceAnimate, }: DoodleUIProviderProps): react.JSX.Element;
137
+ declare function useDoodleUI(): DoodleUIContextValue;
138
+
139
+ /**
140
+ * Whether the calling component should play sketch animations.
141
+ * Per-component `animate` overrides the provider. Reduced motion
142
+ * disables animation unless the provider set `forceAnimate`.
143
+ */
144
+ declare function useAnimate(animate?: boolean): boolean;
145
+
146
+ /** Default sketch-in duration. Ease-out over ~400ms. */
147
+ declare const DRAW_IN_DURATION_MS = 400;
148
+ /** Alerts often appear dynamically — keep the sketch-in snappy. */
149
+ declare const DRAW_IN_ALERT_MS = 200;
150
+ /** Tooltips are transient — draw in quickly. */
151
+ declare const DRAW_IN_TOOLTIP_MS = 180;
152
+ /** Checkmarks, radio dots, and tab underlines. */
153
+ declare const DRAW_IN_MARK_MS = 240;
154
+ /** Delay between table row rules. */
155
+ declare const TABLE_STAGGER_MS = 40;
156
+ /**
157
+ * Sketch-in the rough.js stroke path on the first paint, and again when
158
+ * `replayKey` changes (e.g. a hover seed swap).
159
+ *
160
+ * `pathRef` may point at an SVG path, an `<svg>`, or any element that
161
+ * contains one — the hook finds the outline path either way.
162
+ */
163
+ declare function useDrawIn(pathRef: RefObject<Element | null>, duration?: number, enabled?: boolean, replayKey?: unknown, delay?: number): void;
164
+
109
165
  type ButtonVariant = "primary" | "secondary" | "outline" | "ghost";
110
166
  type ButtonSize = "sm" | "md" | "lg";
111
167
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color">, SketchProps {
112
168
  variant?: ButtonVariant;
113
169
  size?: ButtonSize;
170
+ /**
171
+ * Play sketch animations (draw-in on mount, seed morph on hover).
172
+ * Defaults to the DoodleUIProvider value (true). Explicit `false`
173
+ * renders a static sketch. `prefers-reduced-motion: reduce` disables
174
+ * animation unless the provider set `forceAnimate`.
175
+ */
176
+ animate?: boolean;
114
177
  }
115
178
  declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
116
179
 
117
180
  interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "color" | "size">, SketchProps {
118
181
  label?: ReactNode;
182
+ /**
183
+ * Draw-in the border on mount and seed-morph on focus.
184
+ * Defaults to the DoodleUIProvider value (true).
185
+ */
186
+ animate?: boolean;
119
187
  }
120
188
  declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
121
189
 
122
190
  interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "color">, SketchProps {
123
191
  label?: ReactNode;
192
+ /**
193
+ * Draw-in the border on mount and seed-morph on focus.
194
+ * Defaults to the DoodleUIProvider value (true).
195
+ */
196
+ animate?: boolean;
124
197
  }
125
198
  declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
126
199
 
127
200
  interface CheckboxProps extends Omit<CheckboxPrimitive.CheckboxProps, "asChild">, SketchProps {
128
201
  label?: ReactNode;
202
+ /**
203
+ * Draw-in the box on mount and the checkmark when checked.
204
+ * Defaults to the DoodleUIProvider value (true).
205
+ */
206
+ animate?: boolean;
129
207
  }
130
208
  declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
131
209
 
@@ -134,6 +212,11 @@ interface RadioGroupProps extends ComponentPropsWithoutRef<typeof RadioGroupPrim
134
212
  declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>>;
135
213
  interface RadioProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, "asChild">, SketchProps {
136
214
  label?: ReactNode;
215
+ /**
216
+ * Draw-in the ring on mount and scale/draw the dot on select.
217
+ * Defaults to the DoodleUIProvider value (true).
218
+ */
219
+ animate?: boolean;
137
220
  }
138
221
  declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLButtonElement>>;
139
222
 
@@ -142,12 +225,20 @@ interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "titl
142
225
  fill?: string;
143
226
  title?: ReactNode;
144
227
  footer?: ReactNode;
228
+ /**
229
+ * Draw-in the border on mount. Defaults to the DoodleUIProvider value (true).
230
+ */
231
+ animate?: boolean;
145
232
  }
146
233
  declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
147
234
 
148
235
  type BadgeVariant = "default" | "accent" | "outline";
149
236
  interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color">, SketchProps {
150
237
  variant?: BadgeVariant;
238
+ /**
239
+ * Draw-in the border on mount. Defaults to the DoodleUIProvider value (true).
240
+ */
241
+ animate?: boolean;
151
242
  }
152
243
  declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
153
244
 
@@ -155,6 +246,10 @@ type AlertVariant = "info" | "warning" | "error" | "success";
155
246
  interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "title">, SketchProps {
156
247
  variant?: AlertVariant;
157
248
  title?: ReactNode;
249
+ /**
250
+ * Draw-in the border on mount (~200ms). Defaults to the DoodleUIProvider value (true).
251
+ */
252
+ animate?: boolean;
158
253
  }
159
254
  declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
160
255
 
@@ -167,8 +262,13 @@ interface ModalProps extends SketchProps {
167
262
  description?: ReactNode;
168
263
  children?: ReactNode;
169
264
  className?: string;
265
+ /**
266
+ * Backdrop fade, panel enter/exit, and border draw-in on open.
267
+ * Defaults to the DoodleUIProvider value (true).
268
+ */
269
+ animate?: boolean;
170
270
  }
171
- declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, description, children, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, }: ModalProps): react.JSX.Element;
271
+ declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, description, children, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, animate, }: ModalProps): react.JSX.Element;
172
272
  declare const ModalRoot: react.FC<Dialog.DialogProps>;
173
273
  declare const ModalTrigger: react.ForwardRefExoticComponent<Dialog.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
174
274
  declare const ModalClose: react.ForwardRefExoticComponent<Dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
@@ -178,12 +278,22 @@ declare const ModalDescription: react.ForwardRefExoticComponent<Dialog.DialogDes
178
278
  type DividerOrientation = "horizontal" | "vertical";
179
279
  interface DividerProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, SketchProps {
180
280
  orientation?: DividerOrientation;
281
+ /**
282
+ * Draw-in so the line extends across its length. Defaults to the
283
+ * DoodleUIProvider value (true).
284
+ */
285
+ animate?: boolean;
181
286
  }
182
287
  declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
183
288
 
184
289
  interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, SketchProps {
185
290
  value?: number;
186
291
  max?: number;
292
+ /**
293
+ * Draw-in the track on mount and redraw the fill as value changes.
294
+ * Defaults to the DoodleUIProvider value (true).
295
+ */
296
+ animate?: boolean;
187
297
  }
188
298
  declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
189
299
 
@@ -194,8 +304,13 @@ interface TooltipProps extends SketchProps {
194
304
  side?: ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>["side"];
195
305
  delayDuration?: number;
196
306
  className?: string;
307
+ /**
308
+ * Quick draw-in when the bubble shows (~180ms). Defaults to the
309
+ * DoodleUIProvider value (true).
310
+ */
311
+ animate?: boolean;
197
312
  }
198
- declare function Tooltip({ content, children, side, delayDuration, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, }: TooltipProps): react.JSX.Element;
313
+ declare function Tooltip({ content, children, side, delayDuration, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, animate, }: TooltipProps): react.JSX.Element;
199
314
 
200
315
  /**
201
316
  * Offset a resolved sketch seed by a stable hash of `key`.
@@ -214,8 +329,13 @@ interface SelectProps extends Omit<SelectPrimitive.SelectProps, "children">, Ske
214
329
  className?: string;
215
330
  style?: CSSProperties;
216
331
  "aria-label"?: string;
332
+ /**
333
+ * Draw-in the trigger on mount and the popover border on open.
334
+ * Defaults to the DoodleUIProvider value (true).
335
+ */
336
+ animate?: boolean;
217
337
  }
218
- declare function Select({ options, placeholder, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, value, defaultValue, onValueChange, "aria-label": ariaLabel, ...rest }: SelectProps): react.JSX.Element;
338
+ declare function Select({ options, placeholder, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, value, defaultValue, onValueChange, animate, "aria-label": ariaLabel, ...rest }: SelectProps): react.JSX.Element;
219
339
  interface SelectTriggerProps extends Omit<SelectPrimitive.SelectTriggerProps, "asChild"> {
220
340
  placeholder?: string;
221
341
  }
@@ -236,10 +356,20 @@ declare const SelectSeparator: react.ForwardRefExoticComponent<SelectPrimitive.S
236
356
 
237
357
  interface SwitchProps extends Omit<SwitchPrimitive.SwitchProps, "asChild">, SketchProps {
238
358
  label?: ReactNode;
359
+ /**
360
+ * Slide the thumb and seed-morph the track on toggle.
361
+ * Defaults to the DoodleUIProvider value (true).
362
+ */
363
+ animate?: boolean;
239
364
  }
240
365
  declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
241
366
 
242
367
  interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "asChild">, SketchProps {
368
+ /**
369
+ * Draw-in the active underline and slide it on tab change.
370
+ * Defaults to the DoodleUIProvider value (true).
371
+ */
372
+ animate?: boolean;
243
373
  }
244
374
  declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
245
375
  interface TabListProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.List>, "asChild"> {
@@ -256,6 +386,11 @@ declare const TabPanel: react.ForwardRefExoticComponent<TabPanelProps & react.Re
256
386
  interface TableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, "color">, SketchProps {
257
387
  headerUnderline?: boolean;
258
388
  children?: ReactNode;
389
+ /**
390
+ * Draw-in row rules on mount, staggered slightly. Defaults to the
391
+ * DoodleUIProvider value (true).
392
+ */
393
+ animate?: boolean;
259
394
  }
260
395
  declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLTableElement>>;
261
396
  declare const TableHead: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
@@ -288,8 +423,13 @@ interface ToastProps extends SketchProps {
288
423
  duration?: number;
289
424
  className?: string;
290
425
  style?: CSSProperties;
426
+ /**
427
+ * Slide-in with a sketchy settle wobble, reversed on exit.
428
+ * Defaults to the DoodleUIProvider value (true).
429
+ */
430
+ animate?: boolean;
291
431
  }
292
- declare function Toast({ open, defaultOpen, onOpenChange, title, children, variant, duration, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, }: ToastProps): react.JSX.Element;
432
+ declare function Toast({ open, defaultOpen, onOpenChange, title, children, variant, duration, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, animate, }: ToastProps): react.JSX.Element;
293
433
  declare const ToastRoot: react.ForwardRefExoticComponent<ToastPrimitive.ToastProps & react.RefAttributes<HTMLLIElement>>;
294
434
  declare const ToastTitle: react.ForwardRefExoticComponent<ToastPrimitive.ToastTitleProps & react.RefAttributes<HTMLDivElement>>;
295
435
  declare const ToastDescription: react.ForwardRefExoticComponent<ToastPrimitive.ToastDescriptionProps & react.RefAttributes<HTMLDivElement>>;
@@ -380,4 +520,4 @@ interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, Sk
380
520
  }
381
521
  declare const Stepper: react.ForwardRefExoticComponent<StepperProps & react.RefAttributes<HTMLDivElement>>;
382
522
 
383
- export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarShape, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, type BreadcrumbSeparator, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, DEFAULT_BOWING, DEFAULT_INK, DEFAULT_ROUGHNESS, DEFAULT_STROKE_WIDTH, Divider, type DividerOrientation, type DividerProps, type FillStyle, Input, type InputProps, Modal, ModalClose, ModalDescription, type ModalProps, ModalRoot, ModalTitle, ModalTrigger, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RoughShape, RoughSvg, type RoughSvgProps, SKETCH_COLORS, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Skeleton, type SkeletonProps, type SkeletonVariant, SketchBox, type SketchBoxProps, type SketchProps, type SketchSeedContextValue, SketchSeedProvider, type SketchSeedProviderProps, Slider, type SliderProps, type SliderThumbShape, Stepper, type StepperOrientation, type StepperProps, type StepperStep, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, ToastRoot, ToastTitle, type ToastVariant, ToastViewport, Tooltip, type TooltipProps, TooltipProvider, deriveSeed, toRoughOptions, useResolvedSeed, useSketchSeed };
523
+ export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarShape, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, type BreadcrumbSeparator, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, 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, type DividerOrientation, type DividerProps, type DoodleUIContextValue, DoodleUIProvider, type DoodleUIProviderProps, type FillStyle, Input, type InputProps, Modal, ModalClose, ModalDescription, type ModalProps, ModalRoot, ModalTitle, ModalTrigger, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RoughShape, RoughSvg, type RoughSvgProps, SKETCH_COLORS, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Skeleton, type SkeletonProps, type SkeletonVariant, SketchBox, type SketchBoxProps, type SketchProps, type SketchSeedContextValue, SketchSeedProvider, type SketchSeedProviderProps, Slider, type SliderProps, type SliderThumbShape, Stepper, type StepperOrientation, type StepperProps, type StepperStep, Switch, type SwitchProps, TABLE_STAGGER_MS, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, ToastRoot, ToastTitle, type ToastVariant, ToastViewport, Tooltip, type TooltipProps, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useDoodleUI, useDrawIn, useResolvedSeed, useSketchSeed };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { CSSProperties, HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ComponentPropsWithoutRef, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ import { CSSProperties, HTMLAttributes, ReactNode, RefObject, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ComponentPropsWithoutRef, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
3
3
  import { Options } from 'roughjs/bin/core';
4
4
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
5
5
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
@@ -75,6 +75,14 @@ interface SketchBoxProps extends SketchProps, Omit<HTMLAttributes<HTMLDivElement
75
75
  contentStyle?: CSSProperties;
76
76
  inset?: number;
77
77
  path?: string;
78
+ /**
79
+ * Sketch-in the border on mount. Defaults to the DoodleUIProvider value.
80
+ */
81
+ animate?: boolean;
82
+ /** Override the default 400ms draw-in duration. */
83
+ drawInDuration?: number;
84
+ /** Replay draw-in when this value changes. */
85
+ drawInKey?: unknown;
78
86
  }
79
87
  declare const SketchBox: react.ForwardRefExoticComponent<SketchBoxProps & react.RefAttributes<HTMLDivElement>>;
80
88
 
@@ -106,26 +114,96 @@ declare function useSketchSeed(): SketchSeedContextValue;
106
114
  */
107
115
  declare function useResolvedSeed(seed?: number): number;
108
116
 
117
+ interface DoodleUIContextValue {
118
+ /** Default for components that do not set their own `animate` prop. */
119
+ animate: boolean;
120
+ /** When true, skip the prefers-reduced-motion disable. */
121
+ forceAnimate: boolean;
122
+ }
123
+ interface DoodleUIProviderProps {
124
+ children: ReactNode;
125
+ /**
126
+ * Default animation setting for descendant doodle-ui components.
127
+ * Per-component `animate` still wins when it is set.
128
+ */
129
+ animate?: boolean;
130
+ /**
131
+ * Play animations even when the user prefers reduced motion.
132
+ * Off by default — only set this as an explicit escape hatch.
133
+ */
134
+ forceAnimate?: boolean;
135
+ }
136
+ declare function DoodleUIProvider({ children, animate, forceAnimate, }: DoodleUIProviderProps): react.JSX.Element;
137
+ declare function useDoodleUI(): DoodleUIContextValue;
138
+
139
+ /**
140
+ * Whether the calling component should play sketch animations.
141
+ * Per-component `animate` overrides the provider. Reduced motion
142
+ * disables animation unless the provider set `forceAnimate`.
143
+ */
144
+ declare function useAnimate(animate?: boolean): boolean;
145
+
146
+ /** Default sketch-in duration. Ease-out over ~400ms. */
147
+ declare const DRAW_IN_DURATION_MS = 400;
148
+ /** Alerts often appear dynamically — keep the sketch-in snappy. */
149
+ declare const DRAW_IN_ALERT_MS = 200;
150
+ /** Tooltips are transient — draw in quickly. */
151
+ declare const DRAW_IN_TOOLTIP_MS = 180;
152
+ /** Checkmarks, radio dots, and tab underlines. */
153
+ declare const DRAW_IN_MARK_MS = 240;
154
+ /** Delay between table row rules. */
155
+ declare const TABLE_STAGGER_MS = 40;
156
+ /**
157
+ * Sketch-in the rough.js stroke path on the first paint, and again when
158
+ * `replayKey` changes (e.g. a hover seed swap).
159
+ *
160
+ * `pathRef` may point at an SVG path, an `<svg>`, or any element that
161
+ * contains one — the hook finds the outline path either way.
162
+ */
163
+ declare function useDrawIn(pathRef: RefObject<Element | null>, duration?: number, enabled?: boolean, replayKey?: unknown, delay?: number): void;
164
+
109
165
  type ButtonVariant = "primary" | "secondary" | "outline" | "ghost";
110
166
  type ButtonSize = "sm" | "md" | "lg";
111
167
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color">, SketchProps {
112
168
  variant?: ButtonVariant;
113
169
  size?: ButtonSize;
170
+ /**
171
+ * Play sketch animations (draw-in on mount, seed morph on hover).
172
+ * Defaults to the DoodleUIProvider value (true). Explicit `false`
173
+ * renders a static sketch. `prefers-reduced-motion: reduce` disables
174
+ * animation unless the provider set `forceAnimate`.
175
+ */
176
+ animate?: boolean;
114
177
  }
115
178
  declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
116
179
 
117
180
  interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "color" | "size">, SketchProps {
118
181
  label?: ReactNode;
182
+ /**
183
+ * Draw-in the border on mount and seed-morph on focus.
184
+ * Defaults to the DoodleUIProvider value (true).
185
+ */
186
+ animate?: boolean;
119
187
  }
120
188
  declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
121
189
 
122
190
  interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "color">, SketchProps {
123
191
  label?: ReactNode;
192
+ /**
193
+ * Draw-in the border on mount and seed-morph on focus.
194
+ * Defaults to the DoodleUIProvider value (true).
195
+ */
196
+ animate?: boolean;
124
197
  }
125
198
  declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
126
199
 
127
200
  interface CheckboxProps extends Omit<CheckboxPrimitive.CheckboxProps, "asChild">, SketchProps {
128
201
  label?: ReactNode;
202
+ /**
203
+ * Draw-in the box on mount and the checkmark when checked.
204
+ * Defaults to the DoodleUIProvider value (true).
205
+ */
206
+ animate?: boolean;
129
207
  }
130
208
  declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
131
209
 
@@ -134,6 +212,11 @@ interface RadioGroupProps extends ComponentPropsWithoutRef<typeof RadioGroupPrim
134
212
  declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>>;
135
213
  interface RadioProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, "asChild">, SketchProps {
136
214
  label?: ReactNode;
215
+ /**
216
+ * Draw-in the ring on mount and scale/draw the dot on select.
217
+ * Defaults to the DoodleUIProvider value (true).
218
+ */
219
+ animate?: boolean;
137
220
  }
138
221
  declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLButtonElement>>;
139
222
 
@@ -142,12 +225,20 @@ interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "titl
142
225
  fill?: string;
143
226
  title?: ReactNode;
144
227
  footer?: ReactNode;
228
+ /**
229
+ * Draw-in the border on mount. Defaults to the DoodleUIProvider value (true).
230
+ */
231
+ animate?: boolean;
145
232
  }
146
233
  declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
147
234
 
148
235
  type BadgeVariant = "default" | "accent" | "outline";
149
236
  interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color">, SketchProps {
150
237
  variant?: BadgeVariant;
238
+ /**
239
+ * Draw-in the border on mount. Defaults to the DoodleUIProvider value (true).
240
+ */
241
+ animate?: boolean;
151
242
  }
152
243
  declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
153
244
 
@@ -155,6 +246,10 @@ type AlertVariant = "info" | "warning" | "error" | "success";
155
246
  interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "title">, SketchProps {
156
247
  variant?: AlertVariant;
157
248
  title?: ReactNode;
249
+ /**
250
+ * Draw-in the border on mount (~200ms). Defaults to the DoodleUIProvider value (true).
251
+ */
252
+ animate?: boolean;
158
253
  }
159
254
  declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
160
255
 
@@ -167,8 +262,13 @@ interface ModalProps extends SketchProps {
167
262
  description?: ReactNode;
168
263
  children?: ReactNode;
169
264
  className?: string;
265
+ /**
266
+ * Backdrop fade, panel enter/exit, and border draw-in on open.
267
+ * Defaults to the DoodleUIProvider value (true).
268
+ */
269
+ animate?: boolean;
170
270
  }
171
- declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, description, children, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, }: ModalProps): react.JSX.Element;
271
+ declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, description, children, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, animate, }: ModalProps): react.JSX.Element;
172
272
  declare const ModalRoot: react.FC<Dialog.DialogProps>;
173
273
  declare const ModalTrigger: react.ForwardRefExoticComponent<Dialog.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
174
274
  declare const ModalClose: react.ForwardRefExoticComponent<Dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
@@ -178,12 +278,22 @@ declare const ModalDescription: react.ForwardRefExoticComponent<Dialog.DialogDes
178
278
  type DividerOrientation = "horizontal" | "vertical";
179
279
  interface DividerProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, SketchProps {
180
280
  orientation?: DividerOrientation;
281
+ /**
282
+ * Draw-in so the line extends across its length. Defaults to the
283
+ * DoodleUIProvider value (true).
284
+ */
285
+ animate?: boolean;
181
286
  }
182
287
  declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
183
288
 
184
289
  interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, SketchProps {
185
290
  value?: number;
186
291
  max?: number;
292
+ /**
293
+ * Draw-in the track on mount and redraw the fill as value changes.
294
+ * Defaults to the DoodleUIProvider value (true).
295
+ */
296
+ animate?: boolean;
187
297
  }
188
298
  declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
189
299
 
@@ -194,8 +304,13 @@ interface TooltipProps extends SketchProps {
194
304
  side?: ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>["side"];
195
305
  delayDuration?: number;
196
306
  className?: string;
307
+ /**
308
+ * Quick draw-in when the bubble shows (~180ms). Defaults to the
309
+ * DoodleUIProvider value (true).
310
+ */
311
+ animate?: boolean;
197
312
  }
198
- declare function Tooltip({ content, children, side, delayDuration, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, }: TooltipProps): react.JSX.Element;
313
+ declare function Tooltip({ content, children, side, delayDuration, className, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, animate, }: TooltipProps): react.JSX.Element;
199
314
 
200
315
  /**
201
316
  * Offset a resolved sketch seed by a stable hash of `key`.
@@ -214,8 +329,13 @@ interface SelectProps extends Omit<SelectPrimitive.SelectProps, "children">, Ske
214
329
  className?: string;
215
330
  style?: CSSProperties;
216
331
  "aria-label"?: string;
332
+ /**
333
+ * Draw-in the trigger on mount and the popover border on open.
334
+ * Defaults to the DoodleUIProvider value (true).
335
+ */
336
+ animate?: boolean;
217
337
  }
218
- declare function Select({ options, placeholder, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, value, defaultValue, onValueChange, "aria-label": ariaLabel, ...rest }: SelectProps): react.JSX.Element;
338
+ declare function Select({ options, placeholder, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, value, defaultValue, onValueChange, animate, "aria-label": ariaLabel, ...rest }: SelectProps): react.JSX.Element;
219
339
  interface SelectTriggerProps extends Omit<SelectPrimitive.SelectTriggerProps, "asChild"> {
220
340
  placeholder?: string;
221
341
  }
@@ -236,10 +356,20 @@ declare const SelectSeparator: react.ForwardRefExoticComponent<SelectPrimitive.S
236
356
 
237
357
  interface SwitchProps extends Omit<SwitchPrimitive.SwitchProps, "asChild">, SketchProps {
238
358
  label?: ReactNode;
359
+ /**
360
+ * Slide the thumb and seed-morph the track on toggle.
361
+ * Defaults to the DoodleUIProvider value (true).
362
+ */
363
+ animate?: boolean;
239
364
  }
240
365
  declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
241
366
 
242
367
  interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "asChild">, SketchProps {
368
+ /**
369
+ * Draw-in the active underline and slide it on tab change.
370
+ * Defaults to the DoodleUIProvider value (true).
371
+ */
372
+ animate?: boolean;
243
373
  }
244
374
  declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
245
375
  interface TabListProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.List>, "asChild"> {
@@ -256,6 +386,11 @@ declare const TabPanel: react.ForwardRefExoticComponent<TabPanelProps & react.Re
256
386
  interface TableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, "color">, SketchProps {
257
387
  headerUnderline?: boolean;
258
388
  children?: ReactNode;
389
+ /**
390
+ * Draw-in row rules on mount, staggered slightly. Defaults to the
391
+ * DoodleUIProvider value (true).
392
+ */
393
+ animate?: boolean;
259
394
  }
260
395
  declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLTableElement>>;
261
396
  declare const TableHead: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
@@ -288,8 +423,13 @@ interface ToastProps extends SketchProps {
288
423
  duration?: number;
289
424
  className?: string;
290
425
  style?: CSSProperties;
426
+ /**
427
+ * Slide-in with a sketchy settle wobble, reversed on exit.
428
+ * Defaults to the DoodleUIProvider value (true).
429
+ */
430
+ animate?: boolean;
291
431
  }
292
- declare function Toast({ open, defaultOpen, onOpenChange, title, children, variant, duration, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, }: ToastProps): react.JSX.Element;
432
+ declare function Toast({ open, defaultOpen, onOpenChange, title, children, variant, duration, className, style, roughness, seed, sketchColor, bowing, fillStyle, strokeWidth, animate, }: ToastProps): react.JSX.Element;
293
433
  declare const ToastRoot: react.ForwardRefExoticComponent<ToastPrimitive.ToastProps & react.RefAttributes<HTMLLIElement>>;
294
434
  declare const ToastTitle: react.ForwardRefExoticComponent<ToastPrimitive.ToastTitleProps & react.RefAttributes<HTMLDivElement>>;
295
435
  declare const ToastDescription: react.ForwardRefExoticComponent<ToastPrimitive.ToastDescriptionProps & react.RefAttributes<HTMLDivElement>>;
@@ -380,4 +520,4 @@ interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, Sk
380
520
  }
381
521
  declare const Stepper: react.ForwardRefExoticComponent<StepperProps & react.RefAttributes<HTMLDivElement>>;
382
522
 
383
- export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarShape, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, type BreadcrumbSeparator, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, DEFAULT_BOWING, DEFAULT_INK, DEFAULT_ROUGHNESS, DEFAULT_STROKE_WIDTH, Divider, type DividerOrientation, type DividerProps, type FillStyle, Input, type InputProps, Modal, ModalClose, ModalDescription, type ModalProps, ModalRoot, ModalTitle, ModalTrigger, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RoughShape, RoughSvg, type RoughSvgProps, SKETCH_COLORS, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Skeleton, type SkeletonProps, type SkeletonVariant, SketchBox, type SketchBoxProps, type SketchProps, type SketchSeedContextValue, SketchSeedProvider, type SketchSeedProviderProps, Slider, type SliderProps, type SliderThumbShape, Stepper, type StepperOrientation, type StepperProps, type StepperStep, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, ToastRoot, ToastTitle, type ToastVariant, ToastViewport, Tooltip, type TooltipProps, TooltipProvider, deriveSeed, toRoughOptions, useResolvedSeed, useSketchSeed };
523
+ export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarShape, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, type BreadcrumbSeparator, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Checkbox, type CheckboxProps, 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, type DividerOrientation, type DividerProps, type DoodleUIContextValue, DoodleUIProvider, type DoodleUIProviderProps, type FillStyle, Input, type InputProps, Modal, ModalClose, ModalDescription, type ModalProps, ModalRoot, ModalTitle, ModalTrigger, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RoughShape, RoughSvg, type RoughSvgProps, SKETCH_COLORS, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Skeleton, type SkeletonProps, type SkeletonVariant, SketchBox, type SketchBoxProps, type SketchProps, type SketchSeedContextValue, SketchSeedProvider, type SketchSeedProviderProps, Slider, type SliderProps, type SliderThumbShape, Stepper, type StepperOrientation, type StepperProps, type StepperStep, Switch, type SwitchProps, TABLE_STAGGER_MS, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, ToastRoot, ToastTitle, type ToastVariant, ToastViewport, Tooltip, type TooltipProps, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useDoodleUI, useDrawIn, useResolvedSeed, useSketchSeed };