@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.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +2164 -0
- package/dist/install-layer.d.ts +4 -0
- package/dist/items/accordion.d.ts +7 -0
- package/dist/items/alert-dialog.d.ts +7 -0
- package/dist/items/alert.d.ts +7 -0
- package/dist/items/auth-form.d.ts +7 -0
- package/dist/items/autocomplete.d.ts +7 -0
- package/dist/items/avatar.d.ts +7 -0
- package/dist/items/badge.d.ts +7 -0
- package/dist/items/button.d.ts +7 -0
- package/dist/items/card.d.ts +7 -0
- package/dist/items/checkbox-group.d.ts +7 -0
- package/dist/items/checkbox.d.ts +7 -0
- package/dist/items/collapsible.d.ts +7 -0
- package/dist/items/combobox.d.ts +7 -0
- package/dist/items/command-palette.d.ts +7 -0
- package/dist/items/context-menu.d.ts +7 -0
- package/dist/items/dashboard-shell.d.ts +7 -0
- package/dist/items/dialog.d.ts +7 -0
- package/dist/items/drawer.d.ts +7 -0
- package/dist/items/field.d.ts +7 -0
- package/dist/items/fieldset.d.ts +7 -0
- package/dist/items/form-field.d.ts +7 -0
- package/dist/items/form.d.ts +7 -0
- package/dist/items/index.d.ts +49 -0
- package/dist/items/input.d.ts +7 -0
- package/dist/items/menu.d.ts +7 -0
- package/dist/items/menubar.d.ts +7 -0
- package/dist/items/meter.d.ts +7 -0
- package/dist/items/navigation-menu.d.ts +7 -0
- package/dist/items/number-field.d.ts +7 -0
- package/dist/items/otp-field.d.ts +7 -0
- package/dist/items/popover.d.ts +7 -0
- package/dist/items/preview-card.d.ts +7 -0
- package/dist/items/progress.d.ts +7 -0
- package/dist/items/radio-group.d.ts +7 -0
- package/dist/items/scroll-area.d.ts +7 -0
- package/dist/items/select.d.ts +7 -0
- package/dist/items/separator.d.ts +7 -0
- package/dist/items/settings-panel.d.ts +7 -0
- package/dist/items/sidebar.d.ts +7 -0
- package/dist/items/slider.d.ts +7 -0
- package/dist/items/switch.d.ts +7 -0
- package/dist/items/tabs.d.ts +7 -0
- package/dist/items/textarea.d.ts +7 -0
- package/dist/items/toast.d.ts +7 -0
- package/dist/items/toggle-group.d.ts +7 -0
- package/dist/items/toggle.d.ts +7 -0
- package/dist/items/toolbar.d.ts +7 -0
- package/dist/items/tooltip.d.ts +7 -0
- package/dist/registry.types.d.ts +40 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/utilities/cn.d.ts +2 -0
- package/dist/validate-registry-composition.d.ts +2 -0
- package/dist/validate-registry-item.d.ts +2 -0
- package/dist/validate-registry-template-imports.d.ts +4 -0
- package/dist/validate-registry.d.ts +9 -0
- package/package.json +52 -0
- package/templates/blocks/AuthForm/AuthForm.tsx +109 -0
- package/templates/blocks/AuthForm/AuthForm.types.ts +34 -0
- package/templates/blocks/AuthForm/AuthForm.variants.ts +11 -0
- package/templates/blocks/CommandPalette/CommandPalette.tsx +245 -0
- package/templates/blocks/CommandPalette/CommandPalette.types.ts +73 -0
- package/templates/blocks/CommandPalette/CommandPalette.variants.ts +26 -0
- package/templates/blocks/FormField/FormField.tsx +83 -0
- package/templates/blocks/FormField/FormField.types.ts +26 -0
- package/templates/blocks/FormField/FormField.variants.ts +9 -0
- package/templates/blocks/SettingsPanel/SettingsPanel.tsx +104 -0
- package/templates/blocks/SettingsPanel/SettingsPanel.types.ts +31 -0
- package/templates/blocks/SettingsPanel/SettingsPanel.variants.ts +9 -0
- package/templates/blocks/Sidebar/Sidebar.tsx +414 -0
- package/templates/blocks/Sidebar/Sidebar.types.ts +99 -0
- package/templates/blocks/Sidebar/Sidebar.variants.ts +84 -0
- package/templates/primitives/Accordion/Accordion.tsx +102 -0
- package/templates/primitives/Accordion/Accordion.types.ts +20 -0
- package/templates/primitives/Accordion/Accordion.variants.ts +32 -0
- package/templates/primitives/Alert/Alert.tsx +62 -0
- package/templates/primitives/Alert/Alert.types.ts +35 -0
- package/templates/primitives/Alert/Alert.variants.ts +41 -0
- package/templates/primitives/AlertDialog/AlertDialog.tsx +168 -0
- package/templates/primitives/AlertDialog/AlertDialog.types.ts +30 -0
- package/templates/primitives/AlertDialog/AlertDialog.variants.ts +57 -0
- package/templates/primitives/Autocomplete/Autocomplete.tsx +394 -0
- package/templates/primitives/Autocomplete/Autocomplete.types.ts +82 -0
- package/templates/primitives/Autocomplete/Autocomplete.variants.ts +154 -0
- package/templates/primitives/Avatar/Avatar.tsx +56 -0
- package/templates/primitives/Avatar/Avatar.types.ts +31 -0
- package/templates/primitives/Avatar/Avatar.variants.ts +40 -0
- package/templates/primitives/Badge/Badge.tsx +30 -0
- package/templates/primitives/Badge/Badge.types.ts +30 -0
- package/templates/primitives/Badge/Badge.variants.ts +81 -0
- package/templates/primitives/Button/Button.tsx +53 -0
- package/templates/primitives/Button/Button.types.ts +25 -0
- package/templates/primitives/Button/Button.variants.ts +69 -0
- package/templates/primitives/Card/Card.tsx +85 -0
- package/templates/primitives/Card/Card.types.ts +54 -0
- package/templates/primitives/Card/Card.variants.ts +46 -0
- package/templates/primitives/Checkbox/Checkbox.tsx +72 -0
- package/templates/primitives/Checkbox/Checkbox.types.ts +28 -0
- package/templates/primitives/Checkbox/Checkbox.variants.ts +39 -0
- package/templates/primitives/CheckboxGroup/CheckboxGroup.tsx +32 -0
- package/templates/primitives/CheckboxGroup/CheckboxGroup.types.ts +17 -0
- package/templates/primitives/CheckboxGroup/CheckboxGroup.variants.ts +25 -0
- package/templates/primitives/Collapsible/Collapsible.tsx +74 -0
- package/templates/primitives/Collapsible/Collapsible.types.ts +28 -0
- package/templates/primitives/Collapsible/Collapsible.variants.ts +44 -0
- package/templates/primitives/Combobox/Combobox.tsx +450 -0
- package/templates/primitives/Combobox/Combobox.types.ts +99 -0
- package/templates/primitives/Combobox/Combobox.variants.ts +180 -0
- package/templates/primitives/ContextMenu/ContextMenu.tsx +375 -0
- package/templates/primitives/ContextMenu/ContextMenu.types.ts +57 -0
- package/templates/primitives/ContextMenu/ContextMenu.variants.ts +39 -0
- package/templates/primitives/Dialog/Dialog.tsx +148 -0
- package/templates/primitives/Dialog/Dialog.types.ts +29 -0
- package/templates/primitives/Dialog/Dialog.variants.ts +56 -0
- package/templates/primitives/Drawer/Drawer.tsx +266 -0
- package/templates/primitives/Drawer/Drawer.types.ts +77 -0
- package/templates/primitives/Drawer/Drawer.variants.ts +175 -0
- package/templates/primitives/Field/Field.tsx +132 -0
- package/templates/primitives/Field/Field.types.ts +43 -0
- package/templates/primitives/Field/Field.variants.ts +77 -0
- package/templates/primitives/Fieldset/Fieldset.tsx +36 -0
- package/templates/primitives/Fieldset/Fieldset.types.ts +26 -0
- package/templates/primitives/Fieldset/Fieldset.variants.ts +37 -0
- package/templates/primitives/Form/Form.tsx +24 -0
- package/templates/primitives/Form/Form.types.ts +13 -0
- package/templates/primitives/Form/Form.variants.ts +11 -0
- package/templates/primitives/Input/Input.tsx +36 -0
- package/templates/primitives/Input/Input.types.ts +27 -0
- package/templates/primitives/Input/Input.variants.ts +41 -0
- package/templates/primitives/Menu/Menu.tsx +352 -0
- package/templates/primitives/Menu/Menu.types.ts +56 -0
- package/templates/primitives/Menu/Menu.variants.ts +73 -0
- package/templates/primitives/Menubar/Menubar.tsx +25 -0
- package/templates/primitives/Menubar/Menubar.types.ts +12 -0
- package/templates/primitives/Menubar/Menubar.variants.ts +22 -0
- package/templates/primitives/Meter/Meter.tsx +123 -0
- package/templates/primitives/Meter/Meter.types.ts +45 -0
- package/templates/primitives/Meter/Meter.variants.ts +47 -0
- package/templates/primitives/NavigationMenu/NavigationMenu.tsx +256 -0
- package/templates/primitives/NavigationMenu/NavigationMenu.types.ts +58 -0
- package/templates/primitives/NavigationMenu/NavigationMenu.variants.ts +40 -0
- package/templates/primitives/NumberField/NumberField.tsx +168 -0
- package/templates/primitives/NumberField/NumberField.types.ts +51 -0
- package/templates/primitives/NumberField/NumberField.variants.ts +92 -0
- package/templates/primitives/OtpField/OtpField.tsx +65 -0
- package/templates/primitives/OtpField/OtpField.types.ts +29 -0
- package/templates/primitives/OtpField/OtpField.variants.ts +45 -0
- package/templates/primitives/Popover/Popover.tsx +193 -0
- package/templates/primitives/Popover/Popover.types.ts +35 -0
- package/templates/primitives/Popover/Popover.variants.ts +68 -0
- package/templates/primitives/PreviewCard/PreviewCard.tsx +153 -0
- package/templates/primitives/PreviewCard/PreviewCard.types.ts +42 -0
- package/templates/primitives/PreviewCard/PreviewCard.variants.ts +24 -0
- package/templates/primitives/Progress/Progress.tsx +95 -0
- package/templates/primitives/Progress/Progress.types.ts +39 -0
- package/templates/primitives/Progress/Progress.variants.ts +39 -0
- package/templates/primitives/RadioGroup/RadioGroup.tsx +66 -0
- package/templates/primitives/RadioGroup/RadioGroup.types.ts +34 -0
- package/templates/primitives/RadioGroup/RadioGroup.variants.ts +59 -0
- package/templates/primitives/ScrollArea/ScrollArea.tsx +135 -0
- package/templates/primitives/ScrollArea/ScrollArea.types.ts +34 -0
- package/templates/primitives/ScrollArea/ScrollArea.variants.ts +38 -0
- package/templates/primitives/Select/Select.tsx +319 -0
- package/templates/primitives/Select/Select.types.ts +74 -0
- package/templates/primitives/Select/Select.variants.ts +94 -0
- package/templates/primitives/Separator/Separator.tsx +30 -0
- package/templates/primitives/Separator/Separator.types.ts +13 -0
- package/templates/primitives/Separator/Separator.variants.ts +19 -0
- package/templates/primitives/Slider/Slider.tsx +124 -0
- package/templates/primitives/Slider/Slider.types.ts +51 -0
- package/templates/primitives/Slider/Slider.variants.ts +38 -0
- package/templates/primitives/Switch/Switch.tsx +61 -0
- package/templates/primitives/Switch/Switch.types.ts +29 -0
- package/templates/primitives/Switch/Switch.variants.ts +48 -0
- package/templates/primitives/Tabs/Tabs.tsx +70 -0
- package/templates/primitives/Tabs/Tabs.types.ts +23 -0
- package/templates/primitives/Tabs/Tabs.variants.ts +29 -0
- package/templates/primitives/Textarea/Textarea.tsx +42 -0
- package/templates/primitives/Textarea/Textarea.types.ts +31 -0
- package/templates/primitives/Textarea/Textarea.variants.ts +46 -0
- package/templates/primitives/Toast/Toast.tsx +195 -0
- package/templates/primitives/Toast/Toast.types.ts +52 -0
- package/templates/primitives/Toast/Toast.variants.ts +88 -0
- package/templates/primitives/Toggle/Toggle.tsx +24 -0
- package/templates/primitives/Toggle/Toggle.types.ts +19 -0
- package/templates/primitives/Toggle/Toggle.variants.ts +32 -0
- package/templates/primitives/ToggleGroup/ToggleGroup.tsx +34 -0
- package/templates/primitives/ToggleGroup/ToggleGroup.types.ts +19 -0
- package/templates/primitives/ToggleGroup/ToggleGroup.variants.ts +32 -0
- package/templates/primitives/Toolbar/Toolbar.tsx +118 -0
- package/templates/primitives/Toolbar/Toolbar.types.ts +32 -0
- package/templates/primitives/Toolbar/Toolbar.variants.ts +84 -0
- package/templates/primitives/Tooltip/Tooltip.tsx +98 -0
- package/templates/primitives/Tooltip/Tooltip.types.ts +22 -0
- package/templates/primitives/Tooltip/Tooltip.variants.ts +24 -0
- package/templates/shared/utils/cn.ts +46 -0
- package/templates/styles/theme.css +311 -0
- package/templates/styles/tokens.css +1445 -0
- package/templates/templates/DashboardShell/DashboardShell.tsx +124 -0
- package/templates/templates/DashboardShell/DashboardShell.types.ts +37 -0
- package/templates/templates/DashboardShell/DashboardShell.variants.ts +25 -0
- 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")
|