@dalexto/lexsys-registry 0.0.2

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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/index.d.ts +25 -0
  4. package/dist/index.js +2164 -0
  5. package/dist/install-layer.d.ts +4 -0
  6. package/dist/items/accordion.d.ts +7 -0
  7. package/dist/items/alert-dialog.d.ts +7 -0
  8. package/dist/items/alert.d.ts +7 -0
  9. package/dist/items/auth-form.d.ts +7 -0
  10. package/dist/items/autocomplete.d.ts +7 -0
  11. package/dist/items/avatar.d.ts +7 -0
  12. package/dist/items/badge.d.ts +7 -0
  13. package/dist/items/button.d.ts +7 -0
  14. package/dist/items/card.d.ts +7 -0
  15. package/dist/items/checkbox-group.d.ts +7 -0
  16. package/dist/items/checkbox.d.ts +7 -0
  17. package/dist/items/collapsible.d.ts +7 -0
  18. package/dist/items/combobox.d.ts +7 -0
  19. package/dist/items/command-palette.d.ts +7 -0
  20. package/dist/items/context-menu.d.ts +7 -0
  21. package/dist/items/dashboard-shell.d.ts +7 -0
  22. package/dist/items/dialog.d.ts +7 -0
  23. package/dist/items/drawer.d.ts +7 -0
  24. package/dist/items/field.d.ts +7 -0
  25. package/dist/items/fieldset.d.ts +7 -0
  26. package/dist/items/form-field.d.ts +7 -0
  27. package/dist/items/form.d.ts +7 -0
  28. package/dist/items/index.d.ts +49 -0
  29. package/dist/items/input.d.ts +7 -0
  30. package/dist/items/menu.d.ts +7 -0
  31. package/dist/items/menubar.d.ts +7 -0
  32. package/dist/items/meter.d.ts +7 -0
  33. package/dist/items/navigation-menu.d.ts +7 -0
  34. package/dist/items/number-field.d.ts +7 -0
  35. package/dist/items/otp-field.d.ts +7 -0
  36. package/dist/items/popover.d.ts +7 -0
  37. package/dist/items/preview-card.d.ts +7 -0
  38. package/dist/items/progress.d.ts +7 -0
  39. package/dist/items/radio-group.d.ts +7 -0
  40. package/dist/items/scroll-area.d.ts +7 -0
  41. package/dist/items/select.d.ts +7 -0
  42. package/dist/items/separator.d.ts +7 -0
  43. package/dist/items/settings-panel.d.ts +7 -0
  44. package/dist/items/sidebar.d.ts +7 -0
  45. package/dist/items/slider.d.ts +7 -0
  46. package/dist/items/switch.d.ts +7 -0
  47. package/dist/items/tabs.d.ts +7 -0
  48. package/dist/items/textarea.d.ts +7 -0
  49. package/dist/items/toast.d.ts +7 -0
  50. package/dist/items/toggle-group.d.ts +7 -0
  51. package/dist/items/toggle.d.ts +7 -0
  52. package/dist/items/toolbar.d.ts +7 -0
  53. package/dist/items/tooltip.d.ts +7 -0
  54. package/dist/registry.types.d.ts +40 -0
  55. package/dist/styles/theme.d.ts +2 -0
  56. package/dist/utilities/cn.d.ts +2 -0
  57. package/dist/validate-registry-composition.d.ts +2 -0
  58. package/dist/validate-registry-item.d.ts +2 -0
  59. package/dist/validate-registry-template-imports.d.ts +4 -0
  60. package/dist/validate-registry.d.ts +9 -0
  61. package/package.json +52 -0
  62. package/templates/blocks/AuthForm/AuthForm.tsx +109 -0
  63. package/templates/blocks/AuthForm/AuthForm.types.ts +34 -0
  64. package/templates/blocks/AuthForm/AuthForm.variants.ts +11 -0
  65. package/templates/blocks/CommandPalette/CommandPalette.tsx +245 -0
  66. package/templates/blocks/CommandPalette/CommandPalette.types.ts +73 -0
  67. package/templates/blocks/CommandPalette/CommandPalette.variants.ts +26 -0
  68. package/templates/blocks/FormField/FormField.tsx +83 -0
  69. package/templates/blocks/FormField/FormField.types.ts +26 -0
  70. package/templates/blocks/FormField/FormField.variants.ts +9 -0
  71. package/templates/blocks/SettingsPanel/SettingsPanel.tsx +104 -0
  72. package/templates/blocks/SettingsPanel/SettingsPanel.types.ts +31 -0
  73. package/templates/blocks/SettingsPanel/SettingsPanel.variants.ts +9 -0
  74. package/templates/blocks/Sidebar/Sidebar.tsx +414 -0
  75. package/templates/blocks/Sidebar/Sidebar.types.ts +99 -0
  76. package/templates/blocks/Sidebar/Sidebar.variants.ts +84 -0
  77. package/templates/primitives/Accordion/Accordion.tsx +102 -0
  78. package/templates/primitives/Accordion/Accordion.types.ts +20 -0
  79. package/templates/primitives/Accordion/Accordion.variants.ts +32 -0
  80. package/templates/primitives/Alert/Alert.tsx +62 -0
  81. package/templates/primitives/Alert/Alert.types.ts +35 -0
  82. package/templates/primitives/Alert/Alert.variants.ts +41 -0
  83. package/templates/primitives/AlertDialog/AlertDialog.tsx +168 -0
  84. package/templates/primitives/AlertDialog/AlertDialog.types.ts +30 -0
  85. package/templates/primitives/AlertDialog/AlertDialog.variants.ts +57 -0
  86. package/templates/primitives/Autocomplete/Autocomplete.tsx +394 -0
  87. package/templates/primitives/Autocomplete/Autocomplete.types.ts +82 -0
  88. package/templates/primitives/Autocomplete/Autocomplete.variants.ts +154 -0
  89. package/templates/primitives/Avatar/Avatar.tsx +56 -0
  90. package/templates/primitives/Avatar/Avatar.types.ts +31 -0
  91. package/templates/primitives/Avatar/Avatar.variants.ts +40 -0
  92. package/templates/primitives/Badge/Badge.tsx +30 -0
  93. package/templates/primitives/Badge/Badge.types.ts +30 -0
  94. package/templates/primitives/Badge/Badge.variants.ts +81 -0
  95. package/templates/primitives/Button/Button.tsx +53 -0
  96. package/templates/primitives/Button/Button.types.ts +25 -0
  97. package/templates/primitives/Button/Button.variants.ts +69 -0
  98. package/templates/primitives/Card/Card.tsx +85 -0
  99. package/templates/primitives/Card/Card.types.ts +54 -0
  100. package/templates/primitives/Card/Card.variants.ts +46 -0
  101. package/templates/primitives/Checkbox/Checkbox.tsx +72 -0
  102. package/templates/primitives/Checkbox/Checkbox.types.ts +28 -0
  103. package/templates/primitives/Checkbox/Checkbox.variants.ts +39 -0
  104. package/templates/primitives/CheckboxGroup/CheckboxGroup.tsx +32 -0
  105. package/templates/primitives/CheckboxGroup/CheckboxGroup.types.ts +17 -0
  106. package/templates/primitives/CheckboxGroup/CheckboxGroup.variants.ts +25 -0
  107. package/templates/primitives/Collapsible/Collapsible.tsx +74 -0
  108. package/templates/primitives/Collapsible/Collapsible.types.ts +28 -0
  109. package/templates/primitives/Collapsible/Collapsible.variants.ts +44 -0
  110. package/templates/primitives/Combobox/Combobox.tsx +450 -0
  111. package/templates/primitives/Combobox/Combobox.types.ts +99 -0
  112. package/templates/primitives/Combobox/Combobox.variants.ts +180 -0
  113. package/templates/primitives/ContextMenu/ContextMenu.tsx +375 -0
  114. package/templates/primitives/ContextMenu/ContextMenu.types.ts +57 -0
  115. package/templates/primitives/ContextMenu/ContextMenu.variants.ts +39 -0
  116. package/templates/primitives/Dialog/Dialog.tsx +148 -0
  117. package/templates/primitives/Dialog/Dialog.types.ts +29 -0
  118. package/templates/primitives/Dialog/Dialog.variants.ts +56 -0
  119. package/templates/primitives/Drawer/Drawer.tsx +266 -0
  120. package/templates/primitives/Drawer/Drawer.types.ts +77 -0
  121. package/templates/primitives/Drawer/Drawer.variants.ts +175 -0
  122. package/templates/primitives/Field/Field.tsx +132 -0
  123. package/templates/primitives/Field/Field.types.ts +43 -0
  124. package/templates/primitives/Field/Field.variants.ts +77 -0
  125. package/templates/primitives/Fieldset/Fieldset.tsx +36 -0
  126. package/templates/primitives/Fieldset/Fieldset.types.ts +26 -0
  127. package/templates/primitives/Fieldset/Fieldset.variants.ts +37 -0
  128. package/templates/primitives/Form/Form.tsx +24 -0
  129. package/templates/primitives/Form/Form.types.ts +13 -0
  130. package/templates/primitives/Form/Form.variants.ts +11 -0
  131. package/templates/primitives/Input/Input.tsx +36 -0
  132. package/templates/primitives/Input/Input.types.ts +27 -0
  133. package/templates/primitives/Input/Input.variants.ts +41 -0
  134. package/templates/primitives/Menu/Menu.tsx +352 -0
  135. package/templates/primitives/Menu/Menu.types.ts +56 -0
  136. package/templates/primitives/Menu/Menu.variants.ts +73 -0
  137. package/templates/primitives/Menubar/Menubar.tsx +25 -0
  138. package/templates/primitives/Menubar/Menubar.types.ts +12 -0
  139. package/templates/primitives/Menubar/Menubar.variants.ts +22 -0
  140. package/templates/primitives/Meter/Meter.tsx +123 -0
  141. package/templates/primitives/Meter/Meter.types.ts +45 -0
  142. package/templates/primitives/Meter/Meter.variants.ts +47 -0
  143. package/templates/primitives/NavigationMenu/NavigationMenu.tsx +256 -0
  144. package/templates/primitives/NavigationMenu/NavigationMenu.types.ts +58 -0
  145. package/templates/primitives/NavigationMenu/NavigationMenu.variants.ts +40 -0
  146. package/templates/primitives/NumberField/NumberField.tsx +168 -0
  147. package/templates/primitives/NumberField/NumberField.types.ts +51 -0
  148. package/templates/primitives/NumberField/NumberField.variants.ts +92 -0
  149. package/templates/primitives/OtpField/OtpField.tsx +65 -0
  150. package/templates/primitives/OtpField/OtpField.types.ts +29 -0
  151. package/templates/primitives/OtpField/OtpField.variants.ts +45 -0
  152. package/templates/primitives/Popover/Popover.tsx +193 -0
  153. package/templates/primitives/Popover/Popover.types.ts +35 -0
  154. package/templates/primitives/Popover/Popover.variants.ts +68 -0
  155. package/templates/primitives/PreviewCard/PreviewCard.tsx +153 -0
  156. package/templates/primitives/PreviewCard/PreviewCard.types.ts +42 -0
  157. package/templates/primitives/PreviewCard/PreviewCard.variants.ts +24 -0
  158. package/templates/primitives/Progress/Progress.tsx +95 -0
  159. package/templates/primitives/Progress/Progress.types.ts +39 -0
  160. package/templates/primitives/Progress/Progress.variants.ts +39 -0
  161. package/templates/primitives/RadioGroup/RadioGroup.tsx +66 -0
  162. package/templates/primitives/RadioGroup/RadioGroup.types.ts +34 -0
  163. package/templates/primitives/RadioGroup/RadioGroup.variants.ts +59 -0
  164. package/templates/primitives/ScrollArea/ScrollArea.tsx +135 -0
  165. package/templates/primitives/ScrollArea/ScrollArea.types.ts +34 -0
  166. package/templates/primitives/ScrollArea/ScrollArea.variants.ts +38 -0
  167. package/templates/primitives/Select/Select.tsx +319 -0
  168. package/templates/primitives/Select/Select.types.ts +74 -0
  169. package/templates/primitives/Select/Select.variants.ts +94 -0
  170. package/templates/primitives/Separator/Separator.tsx +30 -0
  171. package/templates/primitives/Separator/Separator.types.ts +13 -0
  172. package/templates/primitives/Separator/Separator.variants.ts +19 -0
  173. package/templates/primitives/Slider/Slider.tsx +124 -0
  174. package/templates/primitives/Slider/Slider.types.ts +51 -0
  175. package/templates/primitives/Slider/Slider.variants.ts +38 -0
  176. package/templates/primitives/Switch/Switch.tsx +61 -0
  177. package/templates/primitives/Switch/Switch.types.ts +29 -0
  178. package/templates/primitives/Switch/Switch.variants.ts +48 -0
  179. package/templates/primitives/Tabs/Tabs.tsx +70 -0
  180. package/templates/primitives/Tabs/Tabs.types.ts +23 -0
  181. package/templates/primitives/Tabs/Tabs.variants.ts +29 -0
  182. package/templates/primitives/Textarea/Textarea.tsx +42 -0
  183. package/templates/primitives/Textarea/Textarea.types.ts +31 -0
  184. package/templates/primitives/Textarea/Textarea.variants.ts +46 -0
  185. package/templates/primitives/Toast/Toast.tsx +195 -0
  186. package/templates/primitives/Toast/Toast.types.ts +52 -0
  187. package/templates/primitives/Toast/Toast.variants.ts +88 -0
  188. package/templates/primitives/Toggle/Toggle.tsx +24 -0
  189. package/templates/primitives/Toggle/Toggle.types.ts +19 -0
  190. package/templates/primitives/Toggle/Toggle.variants.ts +32 -0
  191. package/templates/primitives/ToggleGroup/ToggleGroup.tsx +34 -0
  192. package/templates/primitives/ToggleGroup/ToggleGroup.types.ts +19 -0
  193. package/templates/primitives/ToggleGroup/ToggleGroup.variants.ts +32 -0
  194. package/templates/primitives/Toolbar/Toolbar.tsx +118 -0
  195. package/templates/primitives/Toolbar/Toolbar.types.ts +32 -0
  196. package/templates/primitives/Toolbar/Toolbar.variants.ts +84 -0
  197. package/templates/primitives/Tooltip/Tooltip.tsx +98 -0
  198. package/templates/primitives/Tooltip/Tooltip.types.ts +22 -0
  199. package/templates/primitives/Tooltip/Tooltip.variants.ts +24 -0
  200. package/templates/shared/utils/cn.ts +46 -0
  201. package/templates/styles/theme.css +311 -0
  202. package/templates/styles/tokens.css +1445 -0
  203. package/templates/templates/DashboardShell/DashboardShell.tsx +124 -0
  204. package/templates/templates/DashboardShell/DashboardShell.types.ts +37 -0
  205. package/templates/templates/DashboardShell/DashboardShell.variants.ts +25 -0
  206. package/templates/tsconfig.json +5 -0
@@ -0,0 +1,42 @@
1
+ import type { Ref } from "react"
2
+ /**
3
+ * PreviewCard.types.ts
4
+ *
5
+ * Public and internal types for PreviewCard component.
6
+ */
7
+
8
+ import type { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card"
9
+
10
+ export type PreviewCardProps<Payload = unknown> =
11
+ BasePreviewCard.Root.Props<Payload>
12
+
13
+ export type PreviewCardTriggerProps<Payload = unknown> =
14
+ BasePreviewCard.Trigger.Props<Payload> & {
15
+ ref?: Ref<HTMLElement>
16
+ }
17
+
18
+ export type PreviewCardPortalProps = BasePreviewCard.Portal.Props
19
+
20
+ export type PreviewCardPositionerProps = BasePreviewCard.Positioner.Props & {
21
+ ref?: Ref<HTMLDivElement>
22
+ }
23
+
24
+ export type PreviewCardPopupProps = BasePreviewCard.Popup.Props & {
25
+ ref?: Ref<HTMLDivElement>
26
+ }
27
+
28
+ export type PreviewCardArrowProps = BasePreviewCard.Arrow.Props & {
29
+ ref?: Ref<HTMLDivElement>
30
+ }
31
+
32
+ export type PreviewCardBackdropProps = BasePreviewCard.Backdrop.Props & {
33
+ ref?: Ref<HTMLDivElement>
34
+ }
35
+
36
+ export type PreviewCardViewportProps = BasePreviewCard.Viewport.Props & {
37
+ ref?: Ref<HTMLDivElement>
38
+ }
39
+
40
+ export type PreviewCardHandle<Payload = unknown> = ReturnType<
41
+ typeof BasePreviewCard.createHandle<Payload>
42
+ >
@@ -0,0 +1,24 @@
1
+ /**
2
+ * PreviewCard.variants.ts
3
+ *
4
+ * Reuses Popover token-backed classes for preview card surfaces.
5
+ */
6
+
7
+ import { cva } from "class-variance-authority"
8
+ import {
9
+ popoverArrowVariants,
10
+ popoverBackdropVariants,
11
+ popoverPopupVariants,
12
+ popoverPositionerVariants,
13
+ popoverViewportVariants,
14
+ } from "../Popover/Popover.variants"
15
+
16
+ export const previewCardBackdropVariants = popoverBackdropVariants
17
+ export const previewCardPositionerVariants = popoverPositionerVariants
18
+ export const previewCardPopupVariants = popoverPopupVariants
19
+ export const previewCardArrowVariants = popoverArrowVariants
20
+ export const previewCardViewportVariants = popoverViewportVariants
21
+
22
+ export const previewCardTriggerVariants = cva(
23
+ "inline-flex outline-none focus-visible:ring-(length:--lsys-popover-focus-ring-width) focus-visible:ring-(--lsys-popover-focus-ring-color)",
24
+ )
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Progress.tsx
3
+ *
4
+ * Reference Progress component implementation.
5
+ */
6
+
7
+ import { Progress as BaseProgress } from "@base-ui/react/progress"
8
+ import type {
9
+ ProgressIndicatorProps,
10
+ ProgressLabelProps,
11
+ ProgressProps,
12
+ ProgressTrackProps,
13
+ ProgressValueProps,
14
+ } from "./Progress.types"
15
+ import {
16
+ progressIndicatorVariants,
17
+ progressLabelVariants,
18
+ progressTrackVariants,
19
+ progressValueVariants,
20
+ progressVariants,
21
+ } from "./Progress.variants"
22
+ import { mergeClassName } from "@/lib/utils"
23
+
24
+ const Progress = ({ ref, className, children, ...props }: ProgressProps) => {
25
+ return (
26
+ <BaseProgress.Root
27
+ ref={ref}
28
+ className={mergeClassName(progressVariants(), className)}
29
+ {...props}
30
+ >
31
+ {children}
32
+ </BaseProgress.Root>
33
+ )
34
+ }
35
+
36
+ Progress.displayName = "Progress"
37
+
38
+ const ProgressLabel = ({ className, ...props }: ProgressLabelProps) => {
39
+ return (
40
+ <BaseProgress.Label
41
+ className={mergeClassName(progressLabelVariants(), className)}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ ProgressLabel.displayName = "ProgressLabel"
48
+
49
+ const ProgressTrack = ({
50
+ size = "md",
51
+ className,
52
+ children,
53
+ ...props
54
+ }: ProgressTrackProps) => {
55
+ return (
56
+ <BaseProgress.Track
57
+ className={mergeClassName(progressTrackVariants({ size }), className)}
58
+ {...props}
59
+ >
60
+ {children}
61
+ </BaseProgress.Track>
62
+ )
63
+ }
64
+
65
+ ProgressTrack.displayName = "ProgressTrack"
66
+
67
+ const ProgressIndicator = ({ className, ...props }: ProgressIndicatorProps) => {
68
+ return (
69
+ <BaseProgress.Indicator
70
+ className={mergeClassName(progressIndicatorVariants(), className)}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ ProgressIndicator.displayName = "ProgressIndicator"
77
+
78
+ const ProgressValue = ({ className, ...props }: ProgressValueProps) => {
79
+ return (
80
+ <BaseProgress.Value
81
+ className={mergeClassName(progressValueVariants(), className)}
82
+ {...props}
83
+ />
84
+ )
85
+ }
86
+
87
+ ProgressValue.displayName = "ProgressValue"
88
+
89
+ export {
90
+ Progress,
91
+ ProgressLabel,
92
+ ProgressTrack,
93
+ ProgressIndicator,
94
+ ProgressValue,
95
+ }
@@ -0,0 +1,39 @@
1
+ import type { Ref } from "react"
2
+ /**
3
+ * Progress.types.ts
4
+ *
5
+ * Public and internal types for Progress component.
6
+ */
7
+
8
+ import type { Progress as BaseProgress } from "@base-ui/react/progress"
9
+
10
+ export type ProgressSize = "sm" | "md" | "lg"
11
+
12
+ export interface ProgressProps extends Omit<
13
+ BaseProgress.Root.Props,
14
+ "className" | "children"
15
+ > {
16
+ ref?: Ref<HTMLDivElement>
17
+ className?: BaseProgress.Root.Props["className"]
18
+ children?: BaseProgress.Root.Props["children"]
19
+ }
20
+
21
+ export interface ProgressTrackProps extends Omit<
22
+ BaseProgress.Track.Props,
23
+ "className" | "children"
24
+ > {
25
+ size?: ProgressSize
26
+ className?: BaseProgress.Track.Props["className"]
27
+ children?: BaseProgress.Track.Props["children"]
28
+ }
29
+
30
+ export interface ProgressIndicatorProps extends Omit<
31
+ BaseProgress.Indicator.Props,
32
+ "className"
33
+ > {
34
+ className?: BaseProgress.Indicator.Props["className"]
35
+ }
36
+
37
+ export type ProgressLabelProps = BaseProgress.Label.Props
38
+
39
+ export type ProgressValueProps = BaseProgress.Value.Props
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Progress.variants.ts
3
+ *
4
+ * Defines visual variants using class composition.
5
+ */
6
+
7
+ import { cva } from "class-variance-authority"
8
+
9
+ export const progressVariants = cva(
10
+ "grid gap-(--lsys-progress-gap) text-(length:--lsys-progress-label-font-size) leading-(--lsys-progress-label-font-line-height) text-(--lsys-progress-label-foreground)",
11
+ )
12
+
13
+ export const progressTrackVariants = cva(
14
+ "overflow-hidden rounded-(--lsys-progress-track-radius) bg-(--lsys-progress-track-background)",
15
+ {
16
+ variants: {
17
+ size: {
18
+ sm: "h-(--lsys-progress-track-height-sm)",
19
+ md: "h-(--lsys-progress-track-height-md)",
20
+ lg: "h-(--lsys-progress-track-height-lg)",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ size: "md",
25
+ },
26
+ },
27
+ )
28
+
29
+ export const progressIndicatorVariants = cva(
30
+ "h-full bg-(--lsys-progress-indicator-background) transition-transform duration-(--lsys-progress-transition-duration) ease-(--lsys-progress-transition-easing) data-[indeterminate]:animate-pulse",
31
+ )
32
+
33
+ export const progressLabelVariants = cva(
34
+ "text-(--lsys-progress-label-foreground)",
35
+ )
36
+
37
+ export const progressValueVariants = cva(
38
+ "font-(--lsys-meter-value-font-weight) text-(--lsys-meter-value-foreground)",
39
+ )
@@ -0,0 +1,66 @@
1
+ /**
2
+ * RadioGroup.tsx
3
+ *
4
+ * Reference RadioGroup component implementation.
5
+ */
6
+
7
+ import { Radio } from "@base-ui/react/radio"
8
+ import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group"
9
+ import type { RadioGroupItemProps, RadioGroupProps } from "./RadioGroup.types"
10
+ import {
11
+ radioGroupItemVariants,
12
+ radioGroupIndicatorVariants,
13
+ radioGroupLabelVariants,
14
+ radioGroupVariants,
15
+ } from "./RadioGroup.variants"
16
+ import { cn } from "@/lib/utils"
17
+ import { mergeClassName } from "@/lib/utils"
18
+
19
+ const RadioGroup = ({
20
+ ref,
21
+ orientation = "vertical",
22
+ className,
23
+ ...props
24
+ }: RadioGroupProps) => {
25
+ return (
26
+ <BaseRadioGroup
27
+ ref={ref}
28
+ className={mergeClassName(radioGroupVariants({ orientation }), className)}
29
+ {...props}
30
+ />
31
+ )
32
+ }
33
+
34
+ RadioGroup.displayName = "RadioGroup"
35
+
36
+ const RadioGroupItem = ({
37
+ ref,
38
+ size,
39
+ className,
40
+ indicatorClassName,
41
+ labelClassName,
42
+ children,
43
+ ...props
44
+ }: RadioGroupItemProps) => {
45
+ return (
46
+ <label className={cn(radioGroupLabelVariants(), labelClassName)}>
47
+ <Radio.Root
48
+ ref={ref}
49
+ className={mergeClassName(radioGroupItemVariants({ size }), className)}
50
+ {...props}
51
+ >
52
+ <Radio.Indicator
53
+ className={mergeClassName(
54
+ radioGroupIndicatorVariants({ size }),
55
+ indicatorClassName,
56
+ )}
57
+ />
58
+ </Radio.Root>
59
+ {children === undefined ? null : <span>{children}</span>}
60
+ </label>
61
+ )
62
+ }
63
+
64
+ RadioGroupItem.displayName = "RadioGroupItem"
65
+
66
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,34 @@
1
+ import type { Ref } from "react"
2
+ /**
3
+ * RadioGroup.types.ts
4
+ *
5
+ * Public and internal types for RadioGroup component.
6
+ */
7
+
8
+ import type { ReactNode } from "react"
9
+ import type { Radio as BaseRadio } from "@base-ui/react/radio"
10
+ import type { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group"
11
+
12
+ export type RadioGroupOrientation = "horizontal" | "vertical"
13
+
14
+ export type RadioGroupItemSize = "sm" | "md" | "lg"
15
+
16
+ export interface RadioGroupProps<Value = string> extends Omit<
17
+ BaseRadioGroup.Props<Value>,
18
+ "className"
19
+ > {
20
+ ref?: Ref<HTMLDivElement>
21
+ orientation?: RadioGroupOrientation
22
+ className?: BaseRadioGroup.Props<Value>["className"]
23
+ }
24
+
25
+ export interface RadioGroupItemProps<Value = string> extends Omit<
26
+ BaseRadio.Root.Props<Value>,
27
+ "className" | "children"
28
+ > {
29
+ size?: RadioGroupItemSize
30
+ children?: ReactNode
31
+ className?: BaseRadio.Root.Props<Value>["className"]
32
+ indicatorClassName?: BaseRadio.Indicator.Props["className"]
33
+ labelClassName?: string
34
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * RadioGroup.variants.ts
3
+ *
4
+ * Defines visual variants using class composition.
5
+ */
6
+
7
+ import { cva } from "class-variance-authority"
8
+
9
+ export const radioGroupVariants = cva("grid gap-(--lsys-radio-group-gap)", {
10
+ variants: {
11
+ orientation: {
12
+ horizontal: "grid-flow-col justify-start",
13
+ vertical: "grid-flow-row",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ orientation: "vertical",
18
+ },
19
+ })
20
+
21
+ export const radioGroupItemVariants = cva(
22
+ [
23
+ "inline-flex shrink-0 items-center justify-center rounded-(--lsys-radio-group-item-radius) border",
24
+ "border-(--lsys-radio-group-item-border-color) bg-(--lsys-radio-group-item-background) text-(--lsys-radio-group-item-foreground)",
25
+ "transition-colors duration-(--lsys-radio-group-transition-duration) ease-(--lsys-radio-group-transition-easing)",
26
+ "outline-none data-[checked]:border-(--lsys-radio-group-item-checked-border-color)",
27
+ "data-[focused]:ring-(length:--lsys-radio-group-focus-ring-width) data-[focused]:ring-(--lsys-radio-group-focus-ring-color) data-[focused]:ring-offset-(length:--lsys-radio-group-focus-ring-offset) data-[focused]:ring-offset-(--lsys-radio-group-focus-ring-offset-color)",
28
+ "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--lsys-opacity-disabled)",
29
+ ].join(" "),
30
+ {
31
+ variants: {
32
+ size: {
33
+ sm: "size-(--lsys-radio-group-item-size-sm)",
34
+ md: "size-(--lsys-radio-group-item-size-md)",
35
+ lg: "size-(--lsys-radio-group-item-size-lg)",
36
+ },
37
+ },
38
+ defaultVariants: {
39
+ size: "md",
40
+ },
41
+ },
42
+ )
43
+
44
+ export const radioGroupLabelVariants = cva(
45
+ "inline-flex items-center gap-(--lsys-radio-group-label-gap) text-(length:--lsys-radio-group-label-font-size) font-(--lsys-radio-group-label-font-weight) leading-(--lsys-radio-group-label-font-line-height) text-(--lsys-radio-group-label-foreground)",
46
+ )
47
+
48
+ export const radioGroupIndicatorVariants = cva("rounded-full bg-current", {
49
+ variants: {
50
+ size: {
51
+ sm: "size-(--lsys-radio-group-indicator-size-sm)",
52
+ md: "size-(--lsys-radio-group-indicator-size-md)",
53
+ lg: "size-(--lsys-radio-group-indicator-size-lg)",
54
+ },
55
+ },
56
+ defaultVariants: {
57
+ size: "md",
58
+ },
59
+ })
@@ -0,0 +1,135 @@
1
+ /**
2
+ * ScrollArea.tsx
3
+ *
4
+ * Reference ScrollArea component implementation.
5
+ */
6
+
7
+ import { ScrollArea as BaseScrollArea } from "@base-ui/react/scroll-area"
8
+ import type {
9
+ ScrollAreaContentProps,
10
+ ScrollAreaCornerProps,
11
+ ScrollAreaProps,
12
+ ScrollAreaScrollbarProps,
13
+ ScrollAreaThumbProps,
14
+ ScrollAreaViewportProps,
15
+ } from "./ScrollArea.types"
16
+ import {
17
+ scrollAreaContentVariants,
18
+ scrollAreaCornerVariants,
19
+ scrollAreaRootVariants,
20
+ scrollAreaScrollbarVariants,
21
+ scrollAreaThumbVariants,
22
+ scrollAreaViewportVariants,
23
+ } from "./ScrollArea.variants"
24
+ import { mergeClassName } from "@/lib/utils"
25
+
26
+ const ScrollArea = ({ ref, className, ...props }: ScrollAreaProps) => {
27
+ return (
28
+ <BaseScrollArea.Root
29
+ ref={ref}
30
+ className={mergeClassName(scrollAreaRootVariants(), className)}
31
+ {...props}
32
+ />
33
+ )
34
+ }
35
+
36
+ ScrollArea.displayName = "ScrollArea"
37
+
38
+ const ScrollAreaViewport = ({
39
+ ref,
40
+ className,
41
+ ...props
42
+ }: ScrollAreaViewportProps) => {
43
+ return (
44
+ <BaseScrollArea.Viewport
45
+ ref={ref}
46
+ className={mergeClassName(scrollAreaViewportVariants(), className)}
47
+ {...props}
48
+ />
49
+ )
50
+ }
51
+
52
+ ScrollAreaViewport.displayName = "ScrollAreaViewport"
53
+
54
+ const ScrollAreaContent = ({
55
+ ref,
56
+ className,
57
+ ...props
58
+ }: ScrollAreaContentProps) => {
59
+ return (
60
+ <BaseScrollArea.Content
61
+ ref={ref}
62
+ className={mergeClassName(scrollAreaContentVariants(), className)}
63
+ {...props}
64
+ />
65
+ )
66
+ }
67
+
68
+ ScrollAreaContent.displayName = "ScrollAreaContent"
69
+
70
+ const ScrollAreaScrollbar = ({
71
+ ref,
72
+ className,
73
+ orientation = "vertical",
74
+ ...props
75
+ }: ScrollAreaScrollbarProps) => {
76
+ return (
77
+ <BaseScrollArea.Scrollbar
78
+ ref={ref}
79
+ orientation={orientation}
80
+ className={mergeClassName(
81
+ scrollAreaScrollbarVariants({ orientation }),
82
+ className,
83
+ )}
84
+ {...props}
85
+ />
86
+ )
87
+ }
88
+
89
+ ScrollAreaScrollbar.displayName = "ScrollAreaScrollbar"
90
+
91
+ const ScrollBar = ScrollAreaScrollbar
92
+
93
+ ScrollBar.displayName = "ScrollBar"
94
+
95
+ const ScrollAreaThumb = ({
96
+ ref,
97
+ className,
98
+ ...props
99
+ }: ScrollAreaThumbProps) => {
100
+ return (
101
+ <BaseScrollArea.Thumb
102
+ ref={ref}
103
+ className={mergeClassName(scrollAreaThumbVariants(), className)}
104
+ {...props}
105
+ />
106
+ )
107
+ }
108
+
109
+ ScrollAreaThumb.displayName = "ScrollAreaThumb"
110
+
111
+ const ScrollAreaCorner = ({
112
+ ref,
113
+ className,
114
+ ...props
115
+ }: ScrollAreaCornerProps) => {
116
+ return (
117
+ <BaseScrollArea.Corner
118
+ ref={ref}
119
+ className={mergeClassName(scrollAreaCornerVariants(), className)}
120
+ {...props}
121
+ />
122
+ )
123
+ }
124
+
125
+ ScrollAreaCorner.displayName = "ScrollAreaCorner"
126
+
127
+ export {
128
+ ScrollArea,
129
+ ScrollAreaViewport,
130
+ ScrollAreaContent,
131
+ ScrollAreaScrollbar,
132
+ ScrollBar,
133
+ ScrollAreaThumb,
134
+ ScrollAreaCorner,
135
+ }
@@ -0,0 +1,34 @@
1
+ import type { Ref } from "react"
2
+ /**
3
+ * ScrollArea.types.ts
4
+ *
5
+ * Public and internal types for ScrollArea component.
6
+ */
7
+
8
+ import type { ScrollArea as BaseScrollArea } from "@base-ui/react/scroll-area"
9
+
10
+ export type ScrollAreaProps = BaseScrollArea.Root.Props & {
11
+ ref?: Ref<HTMLDivElement>
12
+ }
13
+
14
+ export type ScrollAreaViewportProps = BaseScrollArea.Viewport.Props & {
15
+ ref?: Ref<HTMLDivElement>
16
+ }
17
+
18
+ export type ScrollAreaContentProps = BaseScrollArea.Content.Props & {
19
+ ref?: Ref<HTMLDivElement>
20
+ }
21
+
22
+ export type ScrollAreaScrollbarProps = BaseScrollArea.Scrollbar.Props & {
23
+ ref?: Ref<HTMLDivElement>
24
+ }
25
+
26
+ export type ScrollBarProps = ScrollAreaScrollbarProps
27
+
28
+ export type ScrollAreaThumbProps = BaseScrollArea.Thumb.Props & {
29
+ ref?: Ref<HTMLDivElement>
30
+ }
31
+
32
+ export type ScrollAreaCornerProps = BaseScrollArea.Corner.Props & {
33
+ ref?: Ref<HTMLDivElement>
34
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ScrollArea.variants.ts
3
+ *
4
+ * Defines visual variants using class composition.
5
+ */
6
+
7
+ import { cva } from "class-variance-authority"
8
+
9
+ export const scrollAreaRootVariants = cva("relative overflow-hidden")
10
+
11
+ export const scrollAreaViewportVariants = cva(
12
+ "size-full rounded-[inherit] outline-none",
13
+ )
14
+
15
+ export const scrollAreaContentVariants = cva("")
16
+
17
+ export const scrollAreaScrollbarVariants = cva(
18
+ "flex touch-none select-none transition-colors",
19
+ {
20
+ variants: {
21
+ orientation: {
22
+ vertical:
23
+ "h-full w-(--lsys-scroll-area-scrollbar-size) border-l border-l-transparent p-(--lsys-scroll-area-scrollbar-padding)",
24
+ horizontal:
25
+ "h-(--lsys-scroll-area-scrollbar-size) flex-col border-t border-t-transparent p-(--lsys-scroll-area-scrollbar-padding)",
26
+ },
27
+ },
28
+ defaultVariants: {
29
+ orientation: "vertical",
30
+ },
31
+ },
32
+ )
33
+
34
+ export const scrollAreaThumbVariants = cva(
35
+ "relative flex-1 rounded-(--lsys-scroll-area-thumb-radius) bg-(--lsys-scroll-area-thumb-background)",
36
+ )
37
+
38
+ export const scrollAreaCornerVariants = cva("bg-transparent")