@boyernick/standard-ui-react 0.1.1-canary.3 → 0.1.1-canary.34

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.
Files changed (89) hide show
  1. package/package.json +5 -3
  2. package/src/accordion.tsx +5 -2
  3. package/src/alert-dialog.tsx +1 -1
  4. package/src/attachment.tsx +5 -2
  5. package/src/autocomplete.tsx +12 -9
  6. package/src/badge.tsx +73 -9
  7. package/src/block-editor.tsx +1747 -0
  8. package/src/brand.tsx +2 -2
  9. package/src/breadcrumb.tsx +46 -21
  10. package/src/button.tsx +23 -12
  11. package/src/calendar.tsx +25 -11
  12. package/src/card.tsx +57 -14
  13. package/src/carousel.tsx +339 -15
  14. package/src/checkbox.tsx +36 -13
  15. package/src/code-block.tsx +66 -5
  16. package/src/collapsible.tsx +7 -3
  17. package/src/combobox.tsx +17 -15
  18. package/src/command.tsx +41 -14
  19. package/src/context-menu.tsx +6 -3
  20. package/src/date-picker.tsx +174 -0
  21. package/src/dialog.tsx +33 -10
  22. package/src/empty.tsx +4 -4
  23. package/src/field.tsx +4 -3
  24. package/src/filter-group.tsx +143 -0
  25. package/src/icons.tsx +55 -1
  26. package/src/illustrations.tsx +219 -141
  27. package/src/index.ts +263 -18
  28. package/src/input.tsx +8 -5
  29. package/src/kbd.tsx +49 -0
  30. package/src/lib/focus.ts +41 -0
  31. package/src/lib/motion.ts +16 -1
  32. package/src/lib/popup.ts +45 -0
  33. package/src/lifeline/company-icon.tsx +71 -0
  34. package/src/lifeline/index.ts +42 -0
  35. package/src/lifeline/lifeline-data.ts +97 -0
  36. package/src/lifeline/lifeline-desktop.tsx +204 -0
  37. package/src/lifeline/lifeline-event.tsx +108 -0
  38. package/src/lifeline/lifeline-fireworks.tsx +302 -0
  39. package/src/lifeline/lifeline-hover-image.tsx +269 -0
  40. package/src/lifeline/lifeline-icons.tsx +39 -0
  41. package/src/lifeline/lifeline-intro-timing.ts +105 -0
  42. package/src/lifeline/lifeline-labels.tsx +24 -0
  43. package/src/lifeline/lifeline-layout.ts +1 -0
  44. package/src/lifeline/lifeline-legend.tsx +31 -0
  45. package/src/lifeline/lifeline-lightbox.tsx +309 -0
  46. package/src/lifeline/lifeline-marker.tsx +183 -0
  47. package/src/lifeline/lifeline-people.tsx +99 -0
  48. package/src/lifeline/lifeline-photos.tsx +366 -0
  49. package/src/lifeline/lifeline-shell.tsx +135 -0
  50. package/src/lifeline/lifeline-utils.ts +83 -0
  51. package/src/lifeline/lifeline-vertical.tsx +482 -0
  52. package/src/lifeline/lifeline.tsx +69 -0
  53. package/src/lifeline/types.ts +112 -0
  54. package/src/lifeline/use-lifeline-intro.ts +130 -0
  55. package/src/lifeline/use-lifeline-scroll.ts +1011 -0
  56. package/src/lifeline/use-lifeline-vertical-scroll.ts +271 -0
  57. package/src/menu.tsx +7 -4
  58. package/src/menubar.tsx +9 -2
  59. package/src/minimap.tsx +296 -0
  60. package/src/modal.tsx +608 -0
  61. package/src/navigation-menu.tsx +340 -67
  62. package/src/number-field.tsx +336 -61
  63. package/src/otp-field.tsx +4 -3
  64. package/src/pagination.tsx +262 -42
  65. package/src/password-protection.tsx +345 -0
  66. package/src/popover.tsx +3 -1
  67. package/src/preview-card.tsx +3 -1
  68. package/src/progress.tsx +5 -0
  69. package/src/questionnaire.tsx +284 -0
  70. package/src/radio.tsx +4 -2
  71. package/src/scroll-area.tsx +4 -1
  72. package/src/select.tsx +12 -7
  73. package/src/sidebar.tsx +113 -28
  74. package/src/slider.tsx +66 -6
  75. package/src/sounds.tsx +6 -10
  76. package/src/spinner.tsx +105 -32
  77. package/src/switch.tsx +4 -1
  78. package/src/table.tsx +82 -15
  79. package/src/tabs.tsx +189 -38
  80. package/src/text-animate.tsx +71 -28
  81. package/src/textarea.tsx +6 -1
  82. package/src/timeline.tsx +378 -0
  83. package/src/toast.tsx +214 -35
  84. package/src/toggle.tsx +4 -2
  85. package/src/toolbar.tsx +12 -7
  86. package/src/tooltip.tsx +43 -3
  87. package/src/video-player.tsx +396 -127
  88. package/src/image-modal.tsx +0 -110
  89. package/src/markdown-editor.tsx +0 -302
package/src/index.ts CHANGED
@@ -1,5 +1,12 @@
1
1
  export { Button, buttonVariants, type ButtonProps } from "./button";
2
2
  export { Input, inputVariants, type InputProps } from "./input";
3
+ export {
4
+ Kbd,
5
+ KbdGroup,
6
+ kbdVariants,
7
+ type KbdGroupProps,
8
+ type KbdProps,
9
+ } from "./kbd";
3
10
  export { Badge, badgeVariants, type BadgeProps } from "./badge";
4
11
  export { Switch, type SwitchProps } from "./switch";
5
12
  export { Checkbox, type CheckboxProps } from "./checkbox";
@@ -92,17 +99,27 @@ export {
92
99
  type AvatarFallbackProps,
93
100
  } from "./avatar";
94
101
  export { Calendar, type CalendarProps } from "./calendar";
102
+ export {
103
+ DatePicker,
104
+ type DatePickerProps,
105
+ type DatePickerSingleProps,
106
+ type DatePickerRangeProps,
107
+ } from "./date-picker";
108
+ export type { DateRange } from "react-day-picker";
95
109
  export {
96
110
  Card,
97
111
  CardHeader,
98
112
  CardTitle,
99
113
  CardDescription,
114
+ CardAction,
100
115
  CardContent,
101
116
  CardFooter,
117
+ cardVariants,
102
118
  type CardProps,
103
119
  type CardHeaderProps,
104
120
  type CardTitleProps,
105
121
  type CardDescriptionProps,
122
+ type CardActionProps,
106
123
  type CardContentProps,
107
124
  type CardFooterProps,
108
125
  } from "./card";
@@ -155,6 +172,7 @@ export {
155
172
  CommandItem,
156
173
  CommandEmpty,
157
174
  CommandTitle,
175
+ CommandMeta,
158
176
  CommandDialogTitle,
159
177
  type CommandProps,
160
178
  type CommandTriggerProps,
@@ -174,6 +192,7 @@ export {
174
192
  type CommandItemProps,
175
193
  type CommandEmptyProps,
176
194
  type CommandTitleProps,
195
+ type CommandMetaProps,
177
196
  type CommandDialogTitleProps,
178
197
  } from "./command";
179
198
  export {
@@ -347,6 +366,18 @@ export {
347
366
  type FieldsetProps,
348
367
  type FieldsetLegendProps,
349
368
  } from "./fieldset";
369
+ export {
370
+ FilterGroup,
371
+ FilterItem,
372
+ FilterCount,
373
+ filterGroupVariants,
374
+ filterItemVariants,
375
+ type FilterGroupProps,
376
+ type FilterItemProps,
377
+ type FilterCountProps,
378
+ type FilterGroupVariant,
379
+ type FilterGroupSize,
380
+ } from "./filter-group";
350
381
  export { Form, type FormProps } from "./form";
351
382
  export {
352
383
  Meter,
@@ -403,19 +434,38 @@ export {
403
434
  type MenuViewportProps,
404
435
  } from "./menu";
405
436
  export { Menubar, type MenubarProps } from "./menubar";
437
+ export {
438
+ Minimap,
439
+ minimapVariants,
440
+ type MinimapProps,
441
+ type MinimapSection,
442
+ } from "./minimap";
406
443
  export {
407
444
  NumberField,
408
445
  NumberFieldGroup,
409
446
  NumberFieldInput,
410
447
  NumberFieldIncrement,
411
448
  NumberFieldDecrement,
449
+ NumberFieldStepper,
450
+ NumberFieldPrefix,
451
+ NumberFieldSuffix,
412
452
  NumberFieldScrubArea,
413
453
  NumberFieldScrubAreaCursor,
454
+ numberFieldAffixVariants,
455
+ numberFieldControlVariants,
456
+ numberFieldGroupVariants,
457
+ numberFieldInputVariants,
458
+ numberFieldStepperVariants,
459
+ type NumberFieldSize,
460
+ type NumberFieldAlign,
414
461
  type NumberFieldProps,
415
462
  type NumberFieldGroupProps,
416
463
  type NumberFieldInputProps,
417
464
  type NumberFieldIncrementProps,
418
465
  type NumberFieldDecrementProps,
466
+ type NumberFieldStepperProps,
467
+ type NumberFieldPrefixProps,
468
+ type NumberFieldSuffixProps,
419
469
  type NumberFieldScrubAreaProps,
420
470
  type NumberFieldScrubAreaCursorProps,
421
471
  } from "./number-field";
@@ -432,8 +482,18 @@ export {
432
482
  NavigationMenuPopup,
433
483
  NavigationMenuArrow,
434
484
  NavigationMenuLink,
485
+ NavigationMenuBarLink,
486
+ NavigationMenuLinkIcon,
487
+ NavigationMenuLinkTitle,
488
+ NavigationMenuLinkDescription,
435
489
  NavigationMenuIcon,
490
+ navigationMenuBarItemVariants,
491
+ navigationMenuLinkVariants,
492
+ navigationMenuListVariants,
493
+ navigationMenuRootVariants,
436
494
  navigationMenuTriggerClassName,
495
+ type NavigationMenuVariant,
496
+ type NavigationMenuSize,
437
497
  type NavigationMenuProps,
438
498
  type NavigationMenuListProps,
439
499
  type NavigationMenuItemProps,
@@ -446,6 +506,10 @@ export {
446
506
  type NavigationMenuPopupProps,
447
507
  type NavigationMenuArrowProps,
448
508
  type NavigationMenuLinkProps,
509
+ type NavigationMenuBarLinkProps,
510
+ type NavigationMenuLinkIconProps,
511
+ type NavigationMenuLinkTitleProps,
512
+ type NavigationMenuLinkDescriptionProps,
449
513
  type NavigationMenuIconProps,
450
514
  } from "./navigation-menu";
451
515
  export {
@@ -456,6 +520,13 @@ export {
456
520
  type OTPFieldInputProps,
457
521
  type OTPFieldSeparatorProps,
458
522
  } from "./otp-field";
523
+ export {
524
+ PasswordProtection,
525
+ PasswordProtectionDialog,
526
+ type PasswordProtectionProps,
527
+ type PasswordProtectionDialogProps,
528
+ type PasswordProtectionVerify,
529
+ } from "./password-protection";
459
530
  export {
460
531
  Popover,
461
532
  PopoverTrigger,
@@ -507,6 +578,47 @@ export {
507
578
  type ProgressTrackProps,
508
579
  type ProgressIndicatorProps,
509
580
  } from "./progress";
581
+ export {
582
+ Questionnaire,
583
+ QuestionnaireProgress,
584
+ QuestionnaireItem,
585
+ QuestionnaireTitle,
586
+ QuestionnaireDescription,
587
+ QuestionnaireChoices,
588
+ QuestionnaireChoice,
589
+ QuestionnaireChoiceInput,
590
+ QuestionnaireChoiceLabel,
591
+ QuestionnaireChoiceShortcut,
592
+ QuestionnaireInput,
593
+ QuestionnaireError,
594
+ QuestionnaireActions,
595
+ QuestionnairePrevious,
596
+ QuestionnaireSkip,
597
+ QuestionnaireNext,
598
+ QuestionnaireSubmit,
599
+ type QuestionnaireProps,
600
+ type QuestionnaireProgressProps,
601
+ type QuestionnaireItemProps,
602
+ type QuestionnaireTitleProps,
603
+ type QuestionnaireDescriptionProps,
604
+ type QuestionnaireChoicesProps,
605
+ type QuestionnaireChoiceProps,
606
+ type QuestionnaireChoiceInputProps,
607
+ type QuestionnaireChoiceLabelProps,
608
+ type QuestionnaireChoiceShortcutProps,
609
+ type QuestionnaireInputProps,
610
+ type QuestionnaireErrorProps,
611
+ type QuestionnaireActionsProps,
612
+ type QuestionnairePreviousProps,
613
+ type QuestionnaireSkipProps,
614
+ type QuestionnaireNextProps,
615
+ type QuestionnaireSubmitProps,
616
+ type QuestionnaireChoiceDefinition,
617
+ type QuestionnaireInputType,
618
+ type QuestionnaireItemDefinition,
619
+ type QuestionnaireItemStatus,
620
+ type QuestionnaireShortcutMode,
621
+ } from "./questionnaire";
510
622
  export {
511
623
  RadioGroup,
512
624
  Radio,
@@ -564,11 +676,14 @@ export {
564
676
  SliderTrack,
565
677
  SliderIndicator,
566
678
  SliderThumb,
679
+ SliderTicks,
680
+ sliderVariants,
567
681
  type SliderProps,
568
682
  type SliderControlProps,
569
683
  type SliderTrackProps,
570
684
  type SliderIndicatorProps,
571
685
  type SliderThumbProps,
686
+ type SliderTicksProps,
572
687
  } from "./slider";
573
688
  export {
574
689
  Tabs,
@@ -576,7 +691,12 @@ export {
576
691
  TabsTab,
577
692
  TabsIndicator,
578
693
  TabsPanel,
694
+ tabsListVariants,
695
+ tabsTabVariants,
696
+ tabsIndicatorVariants,
579
697
  type TabsProps,
698
+ type TabsVariant,
699
+ type TabsSize,
580
700
  type TabsListProps,
581
701
  type TabsTabProps,
582
702
  type TabsIndicatorProps,
@@ -589,6 +709,9 @@ export {
589
709
  ToastViewport,
590
710
  ToastRoot,
591
711
  ToastContent,
712
+ ToastIcon,
713
+ toastRootVariants,
714
+ toastViewportVariants,
592
715
  ToastTitle,
593
716
  ToastDescription,
594
717
  ToastAction,
@@ -602,6 +725,9 @@ export {
602
725
  type ToastViewportProps,
603
726
  type ToastRootProps,
604
727
  type ToastContentProps,
728
+ type ToastIconProps,
729
+ type ToastType,
730
+ type ToastPlacement,
605
731
  type ToastTitleProps,
606
732
  type ToastDescriptionProps,
607
733
  type ToastActionProps,
@@ -650,6 +776,7 @@ export {
650
776
  BreadcrumbLink,
651
777
  BreadcrumbPage,
652
778
  BreadcrumbSeparator,
779
+ breadcrumbSeparatorVariants,
653
780
  type BreadcrumbProps,
654
781
  type BreadcrumbListProps,
655
782
  type BreadcrumbItemProps,
@@ -677,14 +804,27 @@ export {
677
804
  PaginationLink,
678
805
  PaginationPrevious,
679
806
  PaginationNext,
807
+ PaginationFirst,
808
+ PaginationLast,
680
809
  PaginationEllipsis,
810
+ PaginationStatus,
811
+ PaginationRange,
812
+ paginationLinkVariants,
813
+ paginationDirectionVariants,
681
814
  type PaginationProps,
682
815
  type PaginationContentProps,
683
816
  type PaginationItemProps,
684
817
  type PaginationLinkProps,
818
+ type PaginationButtonProps,
819
+ type PaginationAnchorProps,
685
820
  type PaginationPreviousProps,
686
821
  type PaginationNextProps,
822
+ type PaginationFirstProps,
823
+ type PaginationLastProps,
687
824
  type PaginationEllipsisProps,
825
+ type PaginationStatusProps,
826
+ type PaginationRangeProps,
827
+ type PaginationSize,
688
828
  } from "./pagination";
689
829
  export {
690
830
  Sidebar,
@@ -693,14 +833,20 @@ export {
693
833
  SidebarFooter,
694
834
  SidebarNav,
695
835
  SidebarNavItem,
836
+ SidebarNavItemLabel,
837
+ SidebarNavBadge,
696
838
  SidebarGroup,
697
839
  SidebarGroupLabel,
840
+ sidebarVariants,
841
+ sidebarNavItemVariants,
698
842
  type SidebarProps,
699
843
  type SidebarHeaderProps,
700
844
  type SidebarContentProps,
701
845
  type SidebarFooterProps,
702
846
  type SidebarNavProps,
703
847
  type SidebarNavItemProps,
848
+ type SidebarNavItemLabelProps,
849
+ type SidebarNavBadgeProps,
704
850
  type SidebarGroupProps,
705
851
  type SidebarGroupLabelProps,
706
852
  } from "./sidebar";
@@ -712,6 +858,7 @@ export {
712
858
  CarouselItem,
713
859
  CarouselPrevious,
714
860
  CarouselNext,
861
+ CarouselDots,
715
862
  useCarousel,
716
863
  type CarouselApi,
717
864
  type CarouselProps,
@@ -719,6 +866,7 @@ export {
719
866
  type CarouselItemProps,
720
867
  type CarouselPreviousProps,
721
868
  type CarouselNextProps,
869
+ type CarouselDotsProps,
722
870
  } from "./carousel";
723
871
  export {
724
872
  SoundsProvider,
@@ -735,19 +883,50 @@ export {
735
883
  type VideoPlayerProps,
736
884
  } from "./video-player";
737
885
  export {
738
- ImageModal,
739
- ImageModalTrigger,
740
- ImageModalContent,
741
- type ImageModalProps,
742
- type ImageModalTriggerProps,
743
- type ImageModalContentProps,
744
- } from "./image-modal";
886
+ Modal,
887
+ ModalTrigger,
888
+ ModalContent,
889
+ Gallery,
890
+ GalleryTrigger,
891
+ modalContentVariants,
892
+ type ModalProps,
893
+ type ModalTriggerProps,
894
+ type ModalContentProps,
895
+ type GalleryProps,
896
+ type GalleryTriggerProps,
897
+ type GalleryItem,
898
+ } from "./modal";
745
899
  export {
746
900
  Ticker,
747
901
  TickerItem,
748
902
  type TickerProps,
749
903
  type TickerItemProps,
750
904
  } from "./ticker";
905
+ export {
906
+ Timeline,
907
+ TimelineTrack,
908
+ TimelineItem,
909
+ TimelineMarker,
910
+ TimelineTime,
911
+ TimelineContent,
912
+ TimelineTitle,
913
+ TimelineDescription,
914
+ TimelineMedia,
915
+ timelineVariants,
916
+ timelineTrackVariants,
917
+ timelineItemVariants,
918
+ timelineMarkerVariants,
919
+ timelineTimeVariants,
920
+ type TimelineProps,
921
+ type TimelineTrackProps,
922
+ type TimelineItemProps,
923
+ type TimelineMarkerProps,
924
+ type TimelineTimeProps,
925
+ type TimelineContentProps,
926
+ type TimelineTitleProps,
927
+ type TimelineDescriptionProps,
928
+ type TimelineMediaProps,
929
+ } from "./timeline";
751
930
  export {
752
931
  Table,
753
932
  TableHeader,
@@ -757,6 +936,8 @@ export {
757
936
  TableHead,
758
937
  TableCell,
759
938
  TableCaption,
939
+ tableHeaderVariants,
940
+ tableVariants,
760
941
  type TableProps,
761
942
  type TableHeaderProps,
762
943
  type TableBodyProps,
@@ -773,6 +954,7 @@ export {
773
954
  TooltipPortal,
774
955
  TooltipPositioner,
775
956
  TooltipPopup,
957
+ tooltipPopupVariants,
776
958
  type TooltipProviderProps,
777
959
  type TooltipProps,
778
960
  type TooltipTriggerProps,
@@ -784,46 +966,100 @@ export {
784
966
  CENTRAL_ICON_SIZE,
785
967
  withCentralIconDefaults,
786
968
  iconGallery,
969
+ IconArrowDown,
787
970
  IconBell,
971
+ IconCalendar1,
788
972
  IconChainLink1,
973
+ IconChainLink3,
789
974
  IconCheckmark1,
790
975
  IconChevronBottom,
791
976
  IconChevronDownSmall,
792
977
  IconChevronRightSmall,
978
+ IconCircleCheck,
979
+ IconCircleInfo,
793
980
  IconClipboard,
794
981
  IconCrossSmall,
982
+ IconDotGrid1x3Horizontal,
983
+ IconDotGrid2x3,
984
+ IconExclamationCircle,
985
+ IconExclamationTriangle,
986
+ IconFullScreen,
987
+ IconHighlight,
795
988
  IconHome,
796
989
  IconMagnifyingGlass,
797
990
  IconMinus,
798
991
  IconMoon,
992
+ IconPause,
799
993
  IconPeople,
994
+ IconPlay,
800
995
  IconPlus,
801
996
  IconSettingsGear1,
802
997
  IconSquareBehindSquare6,
998
+ IconStar,
999
+ IconStrikeThrough,
803
1000
  IconSun,
1001
+ IconVolumeFull,
1002
+ IconVolumeOff,
804
1003
  IconX,
805
1004
  type CentralIconProps,
806
1005
  type CentralIconComponent,
807
1006
  } from "./icons";
808
- export { CodeBlock, type CodeBlockProps } from "./code-block";
809
- export {
810
- MarkdownEditor,
811
- MarkdownEditorToolbar,
812
- MarkdownEditorInput,
813
- MarkdownEditorPreview,
814
- type MarkdownEditorProps,
815
- type MarkdownEditorToolbarProps,
816
- type MarkdownEditorInputProps,
817
- type MarkdownEditorPreviewProps,
818
- } from "./markdown-editor";
1007
+ export { CodeBlock, type CodeBlockProps, type CodeBlockHighlightLine } from "./code-block";
1008
+ export {
1009
+ BlockEditor,
1010
+ createBlockEditorBlock,
1011
+ defaultBlockEditorBlocks,
1012
+ type BlockEditorProps,
1013
+ type BlockEditorBlock,
1014
+ type BlockEditorBlockType,
1015
+ } from "./block-editor";
819
1016
  export {
820
1017
  IllustrationEmpty,
821
1018
  IllustrationError,
822
1019
  IllustrationSuccess,
823
1020
  IllustrationSearch,
1021
+ IllustrationUpload,
1022
+ IllustrationFile,
824
1023
  type IllustrationProps,
1024
+ type IllustrationFileProps,
1025
+ type FileIllustrationType,
825
1026
  } from "./illustrations"
826
1027
  export { BrandMark, BrandWordmark, type BrandMarkProps, type BrandWordmarkProps } from "./brand"
1028
+ export {
1029
+ Lifeline,
1030
+ LifelineMarkerColumn,
1031
+ LifelineLegend,
1032
+ LifelineShell,
1033
+ LifelineNav,
1034
+ LifelineStage,
1035
+ LifelineFooter,
1036
+ CompanyIcon,
1037
+ registerCompanyIcons,
1038
+ useLifelineScroll,
1039
+ defineLifeline,
1040
+ localizeLifelineMarkers,
1041
+ LIFELINE_CURRENT_YEAR,
1042
+ type CompanyIconEntry,
1043
+ type CompanyIconId,
1044
+ type LifelineBirthday,
1045
+ type LifelineMilestone,
1046
+ type LifelineMilestones,
1047
+ type LifelineRecord,
1048
+ type LifelineTextOverrides,
1049
+ type LifelineCompany,
1050
+ type LifelineEvent,
1051
+ type LifelineEventEffect,
1052
+ type LifelineEventImage,
1053
+ type LifelineEventObject,
1054
+ type LifelineEventSegment,
1055
+ type LifelineLegendItem,
1056
+ type LifelineMarker,
1057
+ type LifelineMetPerson,
1058
+ type LifelineMentor,
1059
+ type LifelineMode,
1060
+ type LifelinePhoto,
1061
+ type LifelineProps,
1062
+ } from "./lifeline"
827
1063
  export {
828
1064
  TextAnimate,
829
1065
  type TextAnimateProps,
@@ -831,3 +1067,12 @@ export {
831
1067
  } from "./text-animate"
832
1068
  export { cn } from "./lib/cn"
833
1069
  export { motion } from "./lib/motion"
1070
+ export {
1071
+ focusRing,
1072
+ focusRingWithin,
1073
+ focusRingDestructive,
1074
+ focusRingWithinDestructive,
1075
+ focusRingInvalid,
1076
+ focusRingInvalidWithin,
1077
+ focusRingBorder,
1078
+ } from "./lib/focus"
package/src/input.tsx CHANGED
@@ -3,14 +3,18 @@
3
3
  import { cva, type VariantProps } from "class-variance-authority"
4
4
  import { forwardRef, type InputHTMLAttributes } from "react"
5
5
  import { cn } from "./lib/cn"
6
+ import { focusRing, focusRingInvalid } from "./lib/focus"
6
7
 
7
8
  const inputVariants = cva(
8
- "text-sm flex w-full cursor-text rounded-md text-fg-primary transition-[color,box-shadow] duration-[var(--duration-sm)] ease-enter placeholder:text-fg-quaternary outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50",
9
+ cn(
10
+ "text-sm flex w-full cursor-text rounded-md text-fg-primary transition-[color,box-shadow] duration-[var(--duration-sm)] ease-enter placeholder:text-fg-quaternary aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50",
11
+ focusRing,
12
+ focusRingInvalid,
13
+ ),
9
14
  {
10
15
  variants: {
11
16
  variant: {
12
- default:
13
- "border bg-surface inset-shadow-outline-top focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-offset-1 focus-visible:ring-offset-background-primary focus-visible:ring-ring/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/20",
17
+ default: "border bg-surface inset-shadow-outline-top",
14
18
  ghost: "border border-transparent bg-transparent",
15
19
  },
16
20
  size: {
@@ -37,8 +41,7 @@ const inputVariants = cva(
37
41
  {
38
42
  variant: "ghost",
39
43
  invalid: true,
40
- class:
41
- "border-destructive focus-visible:border-destructive focus-visible:ring-[3px] focus-visible:ring-offset-1 focus-visible:ring-offset-background-primary focus-visible:ring-destructive/20",
44
+ class: "border-destructive",
42
45
  },
43
46
  ],
44
47
  defaultVariants: {
package/src/kbd.tsx ADDED
@@ -0,0 +1,49 @@
1
+ import { cva, type VariantProps } from "class-variance-authority"
2
+ import type { ComponentProps } from "react"
3
+ import { cn } from "./lib/cn"
4
+
5
+ const kbdVariants = cva(
6
+ // `text-xs` carries the size, line-height and tracking; the weight is set
7
+ // separately because 600 sits above the 400/500 the type scale defines, so
8
+ // there is no `-strong` utility to reach for.
9
+ // The border is bottom-only on purpose: it reads as the lip of a physical
10
+ // key without boxing the glyph in on all four sides, which at 12px turns a
11
+ // keycap into a cramped badge.
12
+ "inline-flex shrink-0 items-center justify-center border-b px-1 font-sans text-xs font-semibold whitespace-nowrap select-none",
13
+ {
14
+ variants: {
15
+ variant: {
16
+ default: "border-border-primary bg-background-tertiary text-fg-secondary",
17
+ // The default fill is a light grey that vanishes on a dark surface, so
18
+ // an inverted keycap tints with the inverted foreground instead. It has
19
+ // to be that token rather than a literal `white`: the grey ramp flips
20
+ // under `.dark`, so a hardcoded white wash would sit invisibly on the
21
+ // now-light inverted surface.
22
+ inverted: "border-fg-inverted/10 bg-fg-inverted/10 text-fg-inverted",
23
+ },
24
+ size: {
25
+ sm: "h-4 min-w-3.5 rounded-2xs",
26
+ md: "h-5 min-w-4 rounded-xs",
27
+ },
28
+ },
29
+ defaultVariants: { variant: "default", size: "md" },
30
+ },
31
+ )
32
+
33
+ export type KbdProps = ComponentProps<"kbd"> & VariantProps<typeof kbdVariants>
34
+ export type KbdGroupProps = ComponentProps<"span">
35
+
36
+ /** A single keycap. Presentational — map "cmd" to ⌘ before it gets here. */
37
+ export const Kbd = ({ className, variant, size, ...props }: KbdProps) => (
38
+ <kbd className={cn(kbdVariants({ variant, size }), className)} {...props} />
39
+ )
40
+
41
+ /** A full shortcut. Keeps the caps on one line at a consistent gap. */
42
+ export const KbdGroup = ({ className, ...props }: KbdGroupProps) => (
43
+ <span
44
+ className={cn("inline-flex items-center gap-1 align-middle", className)}
45
+ {...props}
46
+ />
47
+ )
48
+
49
+ export { kbdVariants }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Canonical keyboard focus for StandardUI controls.
3
+ *
4
+ * Two layers, always together:
5
+ * 1. Hard edge — `border-ring` turns the control's border to `--ring`.
6
+ * Borderless chrome must carry `border border-transparent` so the edge
7
+ * can light up on focus without shifting layout.
8
+ * 2. Soft wash — 3px `ring-ring/20` with a 1px page-colored gap.
9
+ *
10
+ * Use these strings everywhere. Do not invent a second focus recipe.
11
+ */
12
+
13
+ /** Default focus-visible ring for buttons, tabs, toggles, links, etc. */
14
+ export const focusRing =
15
+ "outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-offset-1 focus-visible:ring-offset-background-primary focus-visible:ring-ring/20"
16
+
17
+ /** Same recipe keyed to `:focus-within` for composite fields. */
18
+ export const focusRingWithin =
19
+ "outline-none focus-within:border-ring focus-within:ring-[3px] focus-within:ring-offset-1 focus-within:ring-offset-background-primary focus-within:ring-ring/20"
20
+
21
+ /** Destructive focus-visible ring — use instead of `focusRing` on error actions. */
22
+ export const focusRingDestructive =
23
+ "outline-none focus-visible:border-destructive focus-visible:ring-[3px] focus-visible:ring-offset-1 focus-visible:ring-offset-background-primary focus-visible:ring-destructive/20"
24
+
25
+ /** Destructive focus-within ring — use instead of `focusRingWithin` when invalid. */
26
+ export const focusRingWithinDestructive =
27
+ "outline-none focus-within:border-destructive focus-within:ring-[3px] focus-within:ring-offset-1 focus-within:ring-offset-background-primary focus-within:ring-destructive/20"
28
+
29
+ /**
30
+ * Invalid-state modifiers that pair with `focusRing` / `focusRingWithin`.
31
+ * Keeps the 3px + offset geometry; only the edge and wash go destructive.
32
+ */
33
+ export const focusRingInvalid =
34
+ "aria-invalid:border-destructive aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/20"
35
+
36
+ export const focusRingInvalidWithin =
37
+ "aria-invalid:border-destructive aria-invalid:focus-within:border-destructive aria-invalid:focus-within:ring-destructive/20"
38
+
39
+ /** Transparent border so borderless chrome can take `focusRing`'s hard edge. */
40
+ export const focusRingBorder =
41
+ "border border-transparent"
package/src/lib/motion.ts CHANGED
@@ -14,7 +14,8 @@
14
14
  *
15
15
  * Two kinds of token live here, and they behave differently:
16
16
  *
17
- * Mount tokens — backdrop, popupCenter, popupAnchor, accordionPanel.
17
+ * Mount tokens — backdrop, popupCenter, popupAnchor, accordionPanel,
18
+ * checkIndicator.
18
19
  * These carry separate enter and exit behaviour. Base UI flags the exit
19
20
  * with `data-ending-style`, and the `data-ending-style:` variants below
20
21
  * re-declare duration and easing for that direction. Exits always run at
@@ -91,6 +92,20 @@ export const motion = {
91
92
  "data-ending-style:ease-move",
92
93
  ].join(" "),
93
94
 
95
+ /** Check and minus glyphs mounting inside a small control. Snaps, because
96
+ * it answers a click directly, and scales from the centre so the mark
97
+ * reads as landing in the box rather than fading onto it. */
98
+ checkIndicator: [
99
+ "transition-[scale,opacity]",
100
+ DURATION.sm,
101
+ "ease-snap",
102
+ REDUCED,
103
+ "data-starting-style:scale-50 data-starting-style:opacity-0",
104
+ "data-ending-style:scale-50 data-ending-style:opacity-0",
105
+ EXIT_DURATION,
106
+ "data-ending-style:ease-move",
107
+ ].join(" "),
108
+
94
109
  /** Sliding tab underline or pill — follows a pointer, so it snaps. */
95
110
  tabsIndicator: [
96
111
  "transition-[translate,width]",