@overdoser/react-toolkit 0.1.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/AGENTS.md +26 -0
- package/CHANGELOG.md +151 -0
- package/README.md +43 -1
- package/components/Alert/Alert.d.ts +34 -0
- package/components/Alert/index.d.ts +2 -0
- package/components/Avatar/Avatar.d.ts +36 -0
- package/components/Avatar/index.d.ts +2 -0
- package/components/Badge/Badge.d.ts +25 -0
- package/components/Badge/index.d.ts +2 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +44 -0
- package/components/Breadcrumbs/index.d.ts +2 -0
- package/components/Divider/Divider.d.ts +28 -0
- package/components/Divider/index.d.ts +2 -0
- package/components/Draggable/Draggable.d.ts +50 -0
- package/components/Draggable/index.d.ts +2 -0
- package/components/Drawer/Drawer.d.ts +65 -0
- package/components/Drawer/index.d.ts +2 -0
- package/components/Dropzone/Dropzone.d.ts +50 -0
- package/components/Dropzone/index.d.ts +2 -0
- package/components/Pagination/Pagination.d.ts +48 -0
- package/components/Pagination/index.d.ts +4 -0
- package/components/Pagination/paginationRange.d.ts +8 -0
- package/components/Skeleton/Skeleton.d.ts +28 -0
- package/components/Skeleton/index.d.ts +2 -0
- package/components/Spinner/Spinner.d.ts +29 -0
- package/components/Spinner/index.d.ts +2 -0
- package/components/Tabs/Tabs.d.ts +66 -0
- package/components/Tabs/index.d.ts +2 -0
- package/components/Timer/Timer.d.ts +103 -0
- package/components/Timer/index.d.ts +2 -0
- package/components/Toast/Toast.d.ts +82 -0
- package/components/Toast/index.d.ts +2 -0
- package/components/Toast/toastStore.d.ts +28 -0
- package/components/Tooltip/Tooltip.d.ts +38 -0
- package/components/Tooltip/index.d.ts +2 -0
- package/components/inputs/Checkbox/Checkbox.d.ts +11 -1
- package/components/inputs/DatePicker/DatePicker.d.ts +58 -0
- package/components/inputs/DatePicker/dateUtils.d.ts +16 -0
- package/components/inputs/DatePicker/index.d.ts +2 -0
- package/components/inputs/NumberInput/NumberInput.d.ts +41 -0
- package/components/inputs/NumberInput/index.d.ts +2 -0
- package/components/inputs/Slider/Slider.d.ts +44 -0
- package/components/inputs/Slider/index.d.ts +2 -0
- package/index.css +1 -1
- package/index.d.ts +36 -0
- package/index.js +4956 -2805
- package/index.layered.css +1 -1
- package/llms.txt +275 -1
- package/manifest.json +548 -1
- package/package.json +1 -1
package/manifest.json
CHANGED
|
@@ -478,6 +478,547 @@
|
|
|
478
478
|
"childrenTyped": "never — pass via `content` prop"
|
|
479
479
|
}
|
|
480
480
|
},
|
|
481
|
+
"Draggable": {
|
|
482
|
+
"import": "import { Draggable } from '@overdoser/react-toolkit'",
|
|
483
|
+
"element": "div wrapping arbitrary children",
|
|
484
|
+
"forwardsRef": true,
|
|
485
|
+
"extendsNativeProps": "div (except onDrag)",
|
|
486
|
+
"compoundComponents": [
|
|
487
|
+
"Draggable.Handle"
|
|
488
|
+
],
|
|
489
|
+
"notes": "Free-move container. Position is a translate(x,y) offset from the element's natural layout position. Add Draggable.Handle to restrict the grab area; without one the whole surface drags. A focused handle is keyboard-movable (arrow keys).",
|
|
490
|
+
"props": {
|
|
491
|
+
"defaultPosition": {
|
|
492
|
+
"type": "{ x: number; y: number }",
|
|
493
|
+
"default": "{ x: 0, y: 0 }",
|
|
494
|
+
"notes": "Uncontrolled initial offset."
|
|
495
|
+
},
|
|
496
|
+
"position": {
|
|
497
|
+
"type": "{ x: number; y: number }",
|
|
498
|
+
"notes": "Controlled offset; pair with onDrag to update it."
|
|
499
|
+
},
|
|
500
|
+
"axis": {
|
|
501
|
+
"type": "'both' | 'x' | 'y'",
|
|
502
|
+
"default": "both"
|
|
503
|
+
},
|
|
504
|
+
"bounds": {
|
|
505
|
+
"type": "'viewport' | 'parent' | 'none'",
|
|
506
|
+
"default": "viewport",
|
|
507
|
+
"notes": "Clamp movement to the viewport / parent element, or leave unconstrained."
|
|
508
|
+
},
|
|
509
|
+
"keyboardStep": {
|
|
510
|
+
"type": "number",
|
|
511
|
+
"default": 10,
|
|
512
|
+
"notes": "Px per arrow-key press on a focused handle."
|
|
513
|
+
},
|
|
514
|
+
"disabled": {
|
|
515
|
+
"type": "boolean",
|
|
516
|
+
"default": false
|
|
517
|
+
},
|
|
518
|
+
"onDragStart": {
|
|
519
|
+
"type": "(position: { x: number; y: number }) => void"
|
|
520
|
+
},
|
|
521
|
+
"onDrag": {
|
|
522
|
+
"type": "(position: { x: number; y: number }) => void",
|
|
523
|
+
"notes": "Required to update a controlled position."
|
|
524
|
+
},
|
|
525
|
+
"onDragEnd": {
|
|
526
|
+
"type": "(position: { x: number; y: number }) => void"
|
|
527
|
+
},
|
|
528
|
+
"classes": {
|
|
529
|
+
"type": "Partial<DraggableClasses>",
|
|
530
|
+
"shape": [
|
|
531
|
+
"root",
|
|
532
|
+
"handle"
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"Toast": {
|
|
538
|
+
"import": "import { ToastProvider, toast, useToast } from '@overdoser/react-toolkit'",
|
|
539
|
+
"element": "portal viewport at document.body",
|
|
540
|
+
"notes": "Imperative notification system backed by a global store. Mount ToastProvider once (it is the renderer; do NOT render toast elements yourself). Trigger via the standalone toast(options) (no hook/context needed; also toast.dismiss(id) / toast.dismissAll()) OR via useToast() which returns the same { toast, dismiss, dismissAll }. useToast does not require the provider and never throws. toast() with no provider mounted warns (dev) and renders nothing. danger/warning use role=alert (assertive); others role=status (polite). Auto-dismiss pauses on hover.",
|
|
541
|
+
"standaloneTrigger": {
|
|
542
|
+
"name": "toast",
|
|
543
|
+
"signature": "toast(options: ToastOptions): string",
|
|
544
|
+
"methods": [
|
|
545
|
+
"toast.dismiss(id: string): void",
|
|
546
|
+
"toast.dismissAll(): void"
|
|
547
|
+
],
|
|
548
|
+
"notes": "Importable; callable anywhere without a hook or context."
|
|
549
|
+
},
|
|
550
|
+
"provider": {
|
|
551
|
+
"name": "ToastProvider",
|
|
552
|
+
"props": {
|
|
553
|
+
"children": {
|
|
554
|
+
"type": "ReactNode",
|
|
555
|
+
"required": true
|
|
556
|
+
},
|
|
557
|
+
"position": {
|
|
558
|
+
"type": "'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'",
|
|
559
|
+
"default": "top-right"
|
|
560
|
+
},
|
|
561
|
+
"duration": {
|
|
562
|
+
"type": "number",
|
|
563
|
+
"default": 5000,
|
|
564
|
+
"notes": "Default auto-dismiss ms."
|
|
565
|
+
},
|
|
566
|
+
"max": {
|
|
567
|
+
"type": "number",
|
|
568
|
+
"default": 5
|
|
569
|
+
},
|
|
570
|
+
"classes": {
|
|
571
|
+
"type": "Partial<ToastClasses>",
|
|
572
|
+
"shape": [
|
|
573
|
+
"viewport",
|
|
574
|
+
"toast",
|
|
575
|
+
"icon",
|
|
576
|
+
"content",
|
|
577
|
+
"title",
|
|
578
|
+
"description",
|
|
579
|
+
"close"
|
|
580
|
+
]
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
"hook": {
|
|
585
|
+
"name": "useToast",
|
|
586
|
+
"returns": "ToastApi = { toast(options): string; dismiss(id): void; dismissAll(): void }",
|
|
587
|
+
"throwsWithoutProvider": false,
|
|
588
|
+
"toastOptions": {
|
|
589
|
+
"title": {
|
|
590
|
+
"type": "ReactNode"
|
|
591
|
+
},
|
|
592
|
+
"description": {
|
|
593
|
+
"type": "ReactNode"
|
|
594
|
+
},
|
|
595
|
+
"variant": {
|
|
596
|
+
"type": "'neutral' | 'info' | 'success' | 'warning' | 'danger'",
|
|
597
|
+
"default": "neutral"
|
|
598
|
+
},
|
|
599
|
+
"duration": {
|
|
600
|
+
"type": "number",
|
|
601
|
+
"notes": "Overrides provider default; 0 or Infinity persists until dismissed."
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
"Tabs": {
|
|
607
|
+
"import": "import { Tabs } from '@overdoser/react-toolkit'",
|
|
608
|
+
"element": "div wrapping role=tablist + panels",
|
|
609
|
+
"forwardsRef": true,
|
|
610
|
+
"compoundComponents": [
|
|
611
|
+
"Tabs.List",
|
|
612
|
+
"Tabs.Tab",
|
|
613
|
+
"Tabs.Panel"
|
|
614
|
+
],
|
|
615
|
+
"notes": "A Tab and its Panel are linked by matching value. Keyboard: arrow keys (orientation-aware) + Home/End move and activate; roving tabindex; automatic activation on focus.",
|
|
616
|
+
"props": {
|
|
617
|
+
"value": {
|
|
618
|
+
"type": "string",
|
|
619
|
+
"notes": "Controlled active tab."
|
|
620
|
+
},
|
|
621
|
+
"defaultValue": {
|
|
622
|
+
"type": "string",
|
|
623
|
+
"notes": "Uncontrolled initial active tab."
|
|
624
|
+
},
|
|
625
|
+
"onValueChange": {
|
|
626
|
+
"type": "(value: string) => void"
|
|
627
|
+
},
|
|
628
|
+
"orientation": {
|
|
629
|
+
"type": "'horizontal' | 'vertical'",
|
|
630
|
+
"default": "horizontal"
|
|
631
|
+
},
|
|
632
|
+
"variant": {
|
|
633
|
+
"type": "'line' | 'solid' | 'pill'",
|
|
634
|
+
"default": "line"
|
|
635
|
+
},
|
|
636
|
+
"size": {
|
|
637
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
638
|
+
"default": "md"
|
|
639
|
+
},
|
|
640
|
+
"classes": {
|
|
641
|
+
"type": "Partial<TabsClasses>",
|
|
642
|
+
"shape": [
|
|
643
|
+
"root",
|
|
644
|
+
"list",
|
|
645
|
+
"tab",
|
|
646
|
+
"panel"
|
|
647
|
+
]
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
"subComponentProps": {
|
|
651
|
+
"Tabs.Tab": {
|
|
652
|
+
"value": {
|
|
653
|
+
"type": "string",
|
|
654
|
+
"required": true
|
|
655
|
+
},
|
|
656
|
+
"disabled": {
|
|
657
|
+
"type": "boolean",
|
|
658
|
+
"default": false
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
"Tabs.Panel": {
|
|
662
|
+
"value": {
|
|
663
|
+
"type": "string",
|
|
664
|
+
"required": true
|
|
665
|
+
},
|
|
666
|
+
"keepMounted": {
|
|
667
|
+
"type": "boolean",
|
|
668
|
+
"default": false,
|
|
669
|
+
"notes": "Keep inactive panels mounted but hidden."
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
"Alert": {
|
|
675
|
+
"import": "import { Alert } from '@overdoser/react-toolkit'",
|
|
676
|
+
"element": "div[role=alert]",
|
|
677
|
+
"forwardsRef": true,
|
|
678
|
+
"extendsNativeProps": "div (without title)",
|
|
679
|
+
"notes": "Inline, persistent status message. For transient feedback prefer Toast.",
|
|
680
|
+
"props": {
|
|
681
|
+
"variant": {
|
|
682
|
+
"type": "'info' | 'success' | 'warning' | 'danger'",
|
|
683
|
+
"default": "info"
|
|
684
|
+
},
|
|
685
|
+
"title": {
|
|
686
|
+
"type": "ReactNode"
|
|
687
|
+
},
|
|
688
|
+
"icon": {
|
|
689
|
+
"type": "ReactNode | boolean",
|
|
690
|
+
"default": true,
|
|
691
|
+
"notes": "true = variant icon; node = override; false = hide."
|
|
692
|
+
},
|
|
693
|
+
"onClose": {
|
|
694
|
+
"type": "() => void",
|
|
695
|
+
"notes": "When set, renders a dismiss button."
|
|
696
|
+
},
|
|
697
|
+
"closeLabel": {
|
|
698
|
+
"type": "string",
|
|
699
|
+
"default": "Dismiss"
|
|
700
|
+
},
|
|
701
|
+
"classes": {
|
|
702
|
+
"type": "Partial<AlertClasses>",
|
|
703
|
+
"shape": [
|
|
704
|
+
"root",
|
|
705
|
+
"icon",
|
|
706
|
+
"content",
|
|
707
|
+
"title",
|
|
708
|
+
"message",
|
|
709
|
+
"close"
|
|
710
|
+
]
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
"Badge": {
|
|
715
|
+
"import": "import { Badge } from '@overdoser/react-toolkit'",
|
|
716
|
+
"element": "span",
|
|
717
|
+
"forwardsRef": true,
|
|
718
|
+
"extendsNativeProps": "span",
|
|
719
|
+
"props": {
|
|
720
|
+
"variant": {
|
|
721
|
+
"type": "'neutral' | 'primary' | 'success' | 'warning' | 'danger'",
|
|
722
|
+
"default": "neutral"
|
|
723
|
+
},
|
|
724
|
+
"appearance": {
|
|
725
|
+
"type": "'soft' | 'solid' | 'outline'",
|
|
726
|
+
"default": "soft"
|
|
727
|
+
},
|
|
728
|
+
"size": {
|
|
729
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
730
|
+
"default": "md"
|
|
731
|
+
},
|
|
732
|
+
"dot": {
|
|
733
|
+
"type": "boolean",
|
|
734
|
+
"default": false,
|
|
735
|
+
"notes": "Leading status dot."
|
|
736
|
+
},
|
|
737
|
+
"classes": {
|
|
738
|
+
"type": "Partial<BadgeClasses>",
|
|
739
|
+
"shape": [
|
|
740
|
+
"root",
|
|
741
|
+
"dot"
|
|
742
|
+
]
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
"Spinner": {
|
|
747
|
+
"import": "import { Spinner } from '@overdoser/react-toolkit'",
|
|
748
|
+
"element": "span[role=status]",
|
|
749
|
+
"forwardsRef": true,
|
|
750
|
+
"extendsNativeProps": "span",
|
|
751
|
+
"notes": "Indeterminate loading spinner; inherits currentColor.",
|
|
752
|
+
"props": {
|
|
753
|
+
"size": {
|
|
754
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
755
|
+
"default": "md"
|
|
756
|
+
},
|
|
757
|
+
"color": {
|
|
758
|
+
"type": "string",
|
|
759
|
+
"notes": "Overrides currentColor."
|
|
760
|
+
},
|
|
761
|
+
"label": {
|
|
762
|
+
"type": "string",
|
|
763
|
+
"default": "Loading",
|
|
764
|
+
"notes": "Visually-hidden a11y label; pass '' to omit."
|
|
765
|
+
},
|
|
766
|
+
"classes": {
|
|
767
|
+
"type": "Partial<SpinnerClasses>",
|
|
768
|
+
"shape": [
|
|
769
|
+
"root",
|
|
770
|
+
"circle",
|
|
771
|
+
"label"
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
"Skeleton": {
|
|
777
|
+
"import": "import { Skeleton } from '@overdoser/react-toolkit'",
|
|
778
|
+
"element": "div[aria-hidden]",
|
|
779
|
+
"forwardsRef": true,
|
|
780
|
+
"extendsNativeProps": "div (without children)",
|
|
781
|
+
"notes": "Decorative loading placeholder.",
|
|
782
|
+
"props": {
|
|
783
|
+
"variant": {
|
|
784
|
+
"type": "'text' | 'circle' | 'rect'",
|
|
785
|
+
"default": "text"
|
|
786
|
+
},
|
|
787
|
+
"width": {
|
|
788
|
+
"type": "number | string",
|
|
789
|
+
"notes": "number → px; defaults to 100%."
|
|
790
|
+
},
|
|
791
|
+
"height": {
|
|
792
|
+
"type": "number | string",
|
|
793
|
+
"notes": "number → px; defaults per variant."
|
|
794
|
+
},
|
|
795
|
+
"animation": {
|
|
796
|
+
"type": "'pulse' | 'wave' | 'none'",
|
|
797
|
+
"default": "pulse"
|
|
798
|
+
},
|
|
799
|
+
"lines": {
|
|
800
|
+
"type": "number",
|
|
801
|
+
"default": 1,
|
|
802
|
+
"notes": "For variant=text, render N stacked bars (last shorter)."
|
|
803
|
+
},
|
|
804
|
+
"classes": {
|
|
805
|
+
"type": "Partial<SkeletonClasses>",
|
|
806
|
+
"shape": [
|
|
807
|
+
"root",
|
|
808
|
+
"line"
|
|
809
|
+
]
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
"Drawer": {
|
|
814
|
+
"import": "import { Drawer } from '@overdoser/react-toolkit'",
|
|
815
|
+
"element": "div (portal at document.body)",
|
|
816
|
+
"forwardsRef": true,
|
|
817
|
+
"compoundComponents": ["Drawer.Header", "Drawer.Body", "Drawer.Footer"],
|
|
818
|
+
"notes": "Off-canvas panel sliding from a screen edge (left/right = full-height strip, top/bottom = full-width strip). Animates in/out and stays mounted through the close transition.",
|
|
819
|
+
"props": {
|
|
820
|
+
"open": { "type": "boolean", "required": true },
|
|
821
|
+
"onClose": { "type": "() => void", "required": true },
|
|
822
|
+
"side": { "type": "'left' | 'right' | 'top' | 'bottom'", "default": "right" },
|
|
823
|
+
"size": { "type": "'sm' | 'md' | 'lg' | 'full'", "default": "md" },
|
|
824
|
+
"variant": { "type": "'temporary' | 'persistent'", "default": "temporary", "notes": "temporary = scrim + modal (scrim/Escape close); persistent = no scrim, page stays interactive." },
|
|
825
|
+
"closeOnBackdrop": { "type": "boolean", "default": true, "notes": "Temporary only." },
|
|
826
|
+
"closeOnEscape": { "type": "boolean", "default": true },
|
|
827
|
+
"classes": { "type": "Partial<DrawerClasses>", "shape": ["backdrop", "drawer", "header", "closeButton", "body", "footer"] }
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
"Tooltip": {
|
|
831
|
+
"import": "import { Tooltip } from '@overdoser/react-toolkit'",
|
|
832
|
+
"element": "inline span wrapper + portaled bubble (role=tooltip)",
|
|
833
|
+
"notes": "Lightweight hover/focus label with delay. Use Popover for interactive/click content.",
|
|
834
|
+
"props": {
|
|
835
|
+
"content": { "type": "ReactNode", "required": true, "notes": "Nullish/empty → never shows." },
|
|
836
|
+
"children": { "type": "ReactNode", "required": true, "notes": "The trigger." },
|
|
837
|
+
"placement": { "type": "'top' | 'bottom' | 'left' | 'right'", "default": "top", "notes": "Flips on overflow." },
|
|
838
|
+
"delay": { "type": "number", "default": 300, "notes": "Open delay ms." },
|
|
839
|
+
"closeDelay": { "type": "number", "default": 0 },
|
|
840
|
+
"disabled": { "type": "boolean", "default": false },
|
|
841
|
+
"hideArrow": { "type": "boolean", "default": false },
|
|
842
|
+
"classes": { "type": "Partial<TooltipClasses>", "shape": ["wrapper", "tooltip", "arrow"] }
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
"Avatar": {
|
|
846
|
+
"import": "import { Avatar } from '@overdoser/react-toolkit'",
|
|
847
|
+
"element": "span",
|
|
848
|
+
"forwardsRef": true,
|
|
849
|
+
"extendsNativeProps": "span",
|
|
850
|
+
"notes": "Falls back to initials (from name) or a user icon if the image is missing or errors.",
|
|
851
|
+
"props": {
|
|
852
|
+
"src": { "type": "string" },
|
|
853
|
+
"alt": { "type": "string" },
|
|
854
|
+
"name": { "type": "string", "notes": "Used to derive initials." },
|
|
855
|
+
"fallback": { "type": "ReactNode" },
|
|
856
|
+
"size": { "type": "'xs' | 'sm' | 'md' | 'lg' | 'xl'", "default": "md" },
|
|
857
|
+
"shape": { "type": "'circle' | 'square'", "default": "circle" },
|
|
858
|
+
"status": { "type": "'online' | 'offline' | 'away' | 'busy'" },
|
|
859
|
+
"classes": { "type": "Partial<AvatarClasses>", "shape": ["root", "image", "fallback", "status"] }
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
"Divider": {
|
|
863
|
+
"import": "import { Divider } from '@overdoser/react-toolkit'",
|
|
864
|
+
"element": "div[role=separator]",
|
|
865
|
+
"forwardsRef": true,
|
|
866
|
+
"extendsNativeProps": "div (without children)",
|
|
867
|
+
"props": {
|
|
868
|
+
"orientation": { "type": "'horizontal' | 'vertical'", "default": "horizontal" },
|
|
869
|
+
"variant": { "type": "'solid' | 'dashed' | 'dotted'", "default": "solid" },
|
|
870
|
+
"label": { "type": "ReactNode", "notes": "Horizontal only." },
|
|
871
|
+
"labelPosition": { "type": "'start' | 'center' | 'end'", "default": "center" },
|
|
872
|
+
"classes": { "type": "Partial<DividerClasses>", "shape": ["root", "line", "label"] }
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
"Breadcrumbs": {
|
|
876
|
+
"import": "import { Breadcrumbs } from '@overdoser/react-toolkit'",
|
|
877
|
+
"element": "nav > ol",
|
|
878
|
+
"forwardsRef": true,
|
|
879
|
+
"compoundComponents": ["Breadcrumbs.Item"],
|
|
880
|
+
"notes": "Separators auto-inserted; the last item defaults to current (aria-current=page, no link).",
|
|
881
|
+
"props": {
|
|
882
|
+
"separator": { "type": "ReactNode", "default": "/" },
|
|
883
|
+
"label": { "type": "string", "default": "Breadcrumb" },
|
|
884
|
+
"classes": { "type": "Partial<BreadcrumbsClasses>", "shape": ["root", "list", "item", "link", "current", "separator"] }
|
|
885
|
+
},
|
|
886
|
+
"subComponentProps": {
|
|
887
|
+
"Breadcrumbs.Item": {
|
|
888
|
+
"href": { "type": "string", "notes": "Omit for a plain (non-link) crumb." },
|
|
889
|
+
"current": { "type": "boolean", "notes": "Renders as text with aria-current=page." }
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
"Pagination": {
|
|
894
|
+
"import": "import { Pagination } from '@overdoser/react-toolkit'",
|
|
895
|
+
"element": "nav > ul",
|
|
896
|
+
"forwardsRef": true,
|
|
897
|
+
"notes": "Windowed page list with ellipses, e.g. 1 … 6 7 8 9 10 … 99. Also exports paginationRange(page, count, boundaryCount?, siblingCount?). Table has its own pagination — use this for non-table lists.",
|
|
898
|
+
"props": {
|
|
899
|
+
"count": { "type": "number", "notes": "Total pages. Or use total + pageSize." },
|
|
900
|
+
"total": { "type": "number", "notes": "With pageSize, derives count." },
|
|
901
|
+
"pageSize": { "type": "number", "default": 10 },
|
|
902
|
+
"page": { "type": "number", "notes": "Controlled, 1-based." },
|
|
903
|
+
"defaultPage": { "type": "number", "default": 1 },
|
|
904
|
+
"onChange": { "type": "(page: number) => void" },
|
|
905
|
+
"boundaryCount": { "type": "number", "default": 1 },
|
|
906
|
+
"siblingCount": { "type": "number", "default": 2, "notes": "Defaults give at most 9 chips." },
|
|
907
|
+
"showPrevNext": { "type": "boolean", "default": true },
|
|
908
|
+
"showFirstLast": { "type": "boolean", "default": false },
|
|
909
|
+
"size": { "type": "'sm' | 'md' | 'lg'", "default": "md" },
|
|
910
|
+
"disabled": { "type": "boolean", "default": false },
|
|
911
|
+
"classes": { "type": "Partial<PaginationClasses>", "shape": ["root", "list", "item", "active", "ellipsis", "control"] }
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
"Slider": {
|
|
915
|
+
"import": "import { Slider } from '@overdoser/react-toolkit'",
|
|
916
|
+
"element": "div containing role=slider thumb(s)",
|
|
917
|
+
"forwardsRef": true,
|
|
918
|
+
"notes": "A tuple value makes it a range (two thumbs). Pointer drag + keyboard (arrows, Home/End, PageUp/Down).",
|
|
919
|
+
"props": {
|
|
920
|
+
"value": { "type": "number | [number, number]", "notes": "Tuple → range slider." },
|
|
921
|
+
"defaultValue": { "type": "number | [number, number]" },
|
|
922
|
+
"onChange": { "type": "(value: number | [number, number]) => void" },
|
|
923
|
+
"onChangeEnd": { "type": "(value: number | [number, number]) => void" },
|
|
924
|
+
"min": { "type": "number", "default": 0 },
|
|
925
|
+
"max": { "type": "number", "default": 100 },
|
|
926
|
+
"step": { "type": "number", "default": 1 },
|
|
927
|
+
"disabled": { "type": "boolean", "default": false },
|
|
928
|
+
"formatValue": { "type": "(value: number) => string", "notes": "For aria-valuetext." },
|
|
929
|
+
"classes": { "type": "Partial<SliderClasses>", "shape": ["root", "track", "range", "thumb"] }
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"NumberInput": {
|
|
933
|
+
"import": "import { NumberInput } from '@overdoser/react-toolkit'",
|
|
934
|
+
"element": "div wrapping input + stepper buttons",
|
|
935
|
+
"forwardsRef": true,
|
|
936
|
+
"notes": "Emits onChange(value: number | null), so it binds directly inside FormField. Arrow keys step; clamps on blur.",
|
|
937
|
+
"props": {
|
|
938
|
+
"value": { "type": "number | null", "notes": "Controlled." },
|
|
939
|
+
"defaultValue": { "type": "number | null" },
|
|
940
|
+
"onChange": { "type": "(value: number | null) => void" },
|
|
941
|
+
"min": { "type": "number" },
|
|
942
|
+
"max": { "type": "number" },
|
|
943
|
+
"step": { "type": "number", "default": 1 },
|
|
944
|
+
"precision": { "type": "number", "notes": "Decimal places to round to." },
|
|
945
|
+
"inputSize": { "type": "'sm' | 'md' | 'lg'", "default": "md" },
|
|
946
|
+
"error": { "type": "boolean", "default": false },
|
|
947
|
+
"hideControls": { "type": "boolean", "default": false },
|
|
948
|
+
"classes": { "type": "Partial<NumberInputClasses>", "shape": ["root", "input", "controls", "increment", "decrement"] }
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"DatePicker": {
|
|
952
|
+
"import": "import { DatePicker } from '@overdoser/react-toolkit'",
|
|
953
|
+
"element": "div wrapping a read-only input + calendar popover",
|
|
954
|
+
"forwardsRef": true,
|
|
955
|
+
"notes": "Single date with a pop-up calendar. Binds in FormField (value: Date | null). Keyboard: arrows move days, PageUp/Down change month, Home/End week ends, Enter selects, Esc closes.",
|
|
956
|
+
"props": {
|
|
957
|
+
"value": { "type": "Date | null", "notes": "Controlled." },
|
|
958
|
+
"defaultValue": { "type": "Date | null" },
|
|
959
|
+
"onChange": { "type": "(date: Date | null) => void" },
|
|
960
|
+
"min": { "type": "Date" },
|
|
961
|
+
"max": { "type": "Date" },
|
|
962
|
+
"disabledDate": { "type": "(date: Date) => boolean" },
|
|
963
|
+
"weekStartsOn": { "type": "number", "default": 0, "notes": "0 = Sunday." },
|
|
964
|
+
"locale": { "type": "string", "notes": "BCP-47 for month/weekday names." },
|
|
965
|
+
"format": { "type": "(date: Date) => string" },
|
|
966
|
+
"placeholder": { "type": "string", "default": "Select date" },
|
|
967
|
+
"inputSize": { "type": "'sm' | 'md' | 'lg'", "default": "md" },
|
|
968
|
+
"error": { "type": "boolean", "default": false },
|
|
969
|
+
"disabled": { "type": "boolean", "default": false },
|
|
970
|
+
"portal": { "type": "boolean", "default": true },
|
|
971
|
+
"classes": { "type": "Partial<DatePickerClasses>", "shape": ["root", "input", "icon", "popover", "header", "nav", "grid", "day", "daySelected", "dayToday", "dayOutside"] }
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
"Dropzone": {
|
|
975
|
+
"import": "import { Dropzone } from '@overdoser/react-toolkit'",
|
|
976
|
+
"element": "div[role=button] + hidden file input",
|
|
977
|
+
"forwardsRef": true,
|
|
978
|
+
"notes": "Drag-drop or click to browse. Emits accepted/rejected files; file-list UI is left to the consumer.",
|
|
979
|
+
"props": {
|
|
980
|
+
"onFiles": { "type": "(files: File[]) => void" },
|
|
981
|
+
"onReject": { "type": "(rejections: { file: File; reason: 'type' | 'size' | 'multiple' }[]) => void" },
|
|
982
|
+
"accept": { "type": "string", "notes": "Comma list of extensions and/or MIME patterns (e.g. '.png,image/*')." },
|
|
983
|
+
"multiple": { "type": "boolean", "default": false },
|
|
984
|
+
"maxSize": { "type": "number", "notes": "Max bytes per file." },
|
|
985
|
+
"disabled": { "type": "boolean", "default": false },
|
|
986
|
+
"label": { "type": "ReactNode" },
|
|
987
|
+
"hint": { "type": "ReactNode" },
|
|
988
|
+
"children": { "type": "ReactNode | ((state: { isDragging: boolean }) => ReactNode)", "notes": "Custom content; replaces the default UI." },
|
|
989
|
+
"classes": { "type": "Partial<DropzoneClasses>", "shape": ["root", "input", "content", "icon", "label", "hint"] }
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
"Timer": {
|
|
993
|
+
"import": "import { Timer } from '@overdoser/react-toolkit'",
|
|
994
|
+
"element": "div[role=timer]",
|
|
995
|
+
"forwardsRef": true,
|
|
996
|
+
"refHandle": "TimerHandle = { start(); pause(); reset(); restart(); getTime(): number; isRunning }",
|
|
997
|
+
"notes": "Countdown or stopwatch; digital, ring, or segments (one boxed cell per unit with the label below). Uncontrolled with autoStart + imperative ref, or display-only via value. Time values are in seconds; interval is ms.",
|
|
998
|
+
"props": {
|
|
999
|
+
"mode": { "type": "'countdown' | 'stopwatch'", "default": "countdown" },
|
|
1000
|
+
"duration": { "type": "number", "notes": "Seconds; countdown length / stopwatch cap; drives ring progress." },
|
|
1001
|
+
"to": { "type": "Date | number", "notes": "Absolute countdown target (overrides duration/pause)." },
|
|
1002
|
+
"value": { "type": "number", "notes": "Controlled seconds → display-only (no internal clock)." },
|
|
1003
|
+
"autoStart": { "type": "boolean", "default": true },
|
|
1004
|
+
"running": { "type": "boolean", "notes": "Controlled run state." },
|
|
1005
|
+
"interval": { "type": "number", "default": 1000, "notes": "Tick ms." },
|
|
1006
|
+
"variant": { "type": "'digital' | 'ring' | 'segments'", "default": "digital" },
|
|
1007
|
+
"size": { "type": "'sm' | 'md' | 'lg'", "default": "md" },
|
|
1008
|
+
"format": { "type": "(seconds: number) => ReactNode", "notes": "digital/ring only." },
|
|
1009
|
+
"units": { "type": "('days' | 'hours' | 'minutes' | 'seconds')[]", "notes": "segments variant; default = smallest set that fits the duration; leading unit absorbs overflow." },
|
|
1010
|
+
"unitFormat": { "type": "'long' | 'short'", "default": "short", "notes": "short → d/h/m/s; long → days/hours/minutes/seconds (fixed, no singular/plural)." },
|
|
1011
|
+
"unitLabels": { "type": "Partial<Record<TimerUnit, ReactNode | ((value: number) => ReactNode)>>", "notes": "Override unit labels." },
|
|
1012
|
+
"segmentVariant": { "type": "'boxed' | 'plain'", "default": "boxed", "notes": "boxed = square with number, unit below." },
|
|
1013
|
+
"renderSegment": { "type": "(segment: TimerSegment, index: number) => ReactNode", "notes": "Custom per-cell rendering; TimerSegment = { unit, value, text, label }." },
|
|
1014
|
+
"segmentSeparator": { "type": "ReactNode", "notes": "Content between cells, e.g. ':'." },
|
|
1015
|
+
"label": { "type": "ReactNode" },
|
|
1016
|
+
"labelPlacement": { "type": "'top' | 'bottom' | 'left' | 'right'", "default": "bottom" },
|
|
1017
|
+
"onComplete": { "type": "() => void", "notes": "Countdown reaches zero." },
|
|
1018
|
+
"onTick": { "type": "(seconds: number) => void" },
|
|
1019
|
+
"classes": { "type": "Partial<TimerClasses>", "shape": ["root", "display", "label", "ringTrack", "ringProgress", "segments", "segment", "segmentValue", "segmentLabel"] }
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
481
1022
|
"Modal": {
|
|
482
1023
|
"import": "import { Modal } from '@overdoser/react-toolkit'",
|
|
483
1024
|
"element": "div (portal at document.body)",
|
|
@@ -816,9 +1357,15 @@
|
|
|
816
1357
|
"label": {
|
|
817
1358
|
"type": "ReactNode"
|
|
818
1359
|
},
|
|
1360
|
+
"variant": {
|
|
1361
|
+
"type": "'checkbox' | 'switch'",
|
|
1362
|
+
"default": "checkbox",
|
|
1363
|
+
"notes": "switch renders a sliding toggle; the underlying input[type=checkbox] is identical."
|
|
1364
|
+
},
|
|
819
1365
|
"indeterminate": {
|
|
820
1366
|
"type": "boolean",
|
|
821
|
-
"default": false
|
|
1367
|
+
"default": false,
|
|
1368
|
+
"notes": "Ignored when variant=switch."
|
|
822
1369
|
},
|
|
823
1370
|
"classes": {
|
|
824
1371
|
"type": "Partial<CheckboxClasses>",
|