@dalexto/lexsys-registry 0.0.2 → 0.0.4
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/README.md +1 -0
- package/dist/index.js +53 -52
- package/dist/items/empty.d.ts +7 -0
- package/dist/items/index.d.ts +2 -0
- package/dist/items/table.d.ts +7 -0
- package/dist/registry.types.d.ts +0 -1
- package/package.json +1 -1
- package/templates/blocks/AuthForm/AuthForm.tsx +3 -3
- package/templates/blocks/AuthForm/AuthForm.variants.ts +3 -3
- package/templates/blocks/CommandPalette/CommandPalette.tsx +14 -14
- package/templates/blocks/CommandPalette/CommandPalette.types.ts +3 -9
- package/templates/blocks/CommandPalette/CommandPalette.variants.ts +13 -14
- package/templates/blocks/Empty/Empty.tsx +91 -0
- package/templates/blocks/Empty/Empty.types.ts +8 -0
- package/templates/blocks/Empty/Empty.variants.ts +51 -0
- package/templates/blocks/FormField/FormField.tsx +2 -6
- package/templates/blocks/FormField/FormField.variants.ts +2 -2
- package/templates/blocks/SettingsPanel/SettingsPanel.tsx +2 -2
- package/templates/blocks/SettingsPanel/SettingsPanel.variants.ts +2 -2
- package/templates/blocks/Sidebar/Sidebar.tsx +45 -85
- package/templates/blocks/Sidebar/Sidebar.types.ts +2 -7
- package/templates/blocks/Sidebar/Sidebar.variants.ts +36 -40
- package/templates/primitives/Accordion/Accordion.variants.ts +7 -7
- package/templates/primitives/Alert/Alert.variants.ts +7 -7
- package/templates/primitives/AlertDialog/AlertDialog.variants.ts +16 -16
- package/templates/primitives/Autocomplete/Autocomplete.variants.ts +49 -49
- package/templates/primitives/Avatar/Avatar.variants.ts +10 -10
- package/templates/primitives/Badge/Badge.variants.ts +14 -14
- package/templates/primitives/Button/Button.variants.ts +26 -26
- package/templates/primitives/Card/Card.tsx +19 -1
- package/templates/primitives/Card/Card.types.ts +1 -0
- package/templates/primitives/Card/Card.variants.ts +14 -11
- package/templates/primitives/Checkbox/Checkbox.variants.ts +11 -15
- package/templates/primitives/CheckboxGroup/CheckboxGroup.variants.ts +2 -2
- package/templates/primitives/Collapsible/Collapsible.variants.ts +10 -10
- package/templates/primitives/Combobox/Combobox.variants.ts +58 -58
- package/templates/primitives/ContextMenu/ContextMenu.variants.ts +1 -1
- package/templates/primitives/Dialog/Dialog.variants.ts +16 -16
- package/templates/primitives/Drawer/Drawer.types.ts +3 -1
- package/templates/primitives/Drawer/Drawer.variants.ts +37 -37
- package/templates/primitives/Field/Field.variants.ts +22 -22
- package/templates/primitives/Fieldset/Fieldset.variants.ts +8 -8
- package/templates/primitives/Form/Form.variants.ts +1 -1
- package/templates/primitives/Input/Input.variants.ts +11 -11
- package/templates/primitives/Menu/Menu.variants.ts +25 -25
- package/templates/primitives/Menubar/Menubar.variants.ts +1 -1
- package/templates/primitives/Meter/Meter.variants.ts +11 -11
- package/templates/primitives/NavigationMenu/NavigationMenu.variants.ts +2 -2
- package/templates/primitives/NumberField/NumberField.variants.ts +25 -25
- package/templates/primitives/OtpField/OtpField.variants.ts +12 -12
- package/templates/primitives/Popover/Popover.variants.ts +18 -20
- package/templates/primitives/PreviewCard/PreviewCard.variants.ts +1 -1
- package/templates/primitives/Progress/Progress.variants.ts +8 -8
- package/templates/primitives/RadioGroup/RadioGroup.variants.ts +14 -14
- package/templates/primitives/ScrollArea/ScrollArea.variants.ts +3 -3
- package/templates/primitives/Select/Select.tsx +29 -29
- package/templates/primitives/Select/Select.types.ts +4 -4
- package/templates/primitives/Select/Select.variants.ts +44 -59
- package/templates/primitives/Separator/Separator.variants.ts +3 -3
- package/templates/primitives/Slider/Slider.tsx +14 -14
- package/templates/primitives/Slider/Slider.variants.ts +17 -26
- package/templates/primitives/Switch/Switch.types.ts +2 -2
- package/templates/primitives/Switch/Switch.variants.ts +13 -13
- package/templates/primitives/Table/Table.tsx +121 -0
- package/templates/primitives/Table/Table.types.ts +68 -0
- package/templates/primitives/Table/Table.variants.ts +51 -0
- package/templates/primitives/Tabs/Tabs.variants.ts +8 -8
- package/templates/primitives/Textarea/Textarea.variants.ts +11 -11
- package/templates/primitives/Toast/Toast.variants.ts +20 -20
- package/templates/primitives/Toggle/Toggle.variants.ts +9 -9
- package/templates/primitives/ToggleGroup/ToggleGroup.variants.ts +5 -5
- package/templates/primitives/Toolbar/Toolbar.variants.ts +18 -18
- package/templates/primitives/Tooltip/Tooltip.variants.ts +5 -5
- package/templates/styles/theme.css +301 -299
- package/templates/styles/tokens.css +1495 -1441
- package/templates/templates/DashboardShell/DashboardShell.tsx +10 -10
- package/templates/templates/DashboardShell/DashboardShell.variants.ts +10 -10
|
@@ -6,26 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
import { cva } from "class-variance-authority"
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
"text-(length:--
|
|
11
|
-
)
|
|
9
|
+
export const selectLabelClasses =
|
|
10
|
+
"text-(length:--lex-select-label-font-size) font-(--lex-select-label-font-weight) leading-(--lex-select-label-font-line-height) text-(--lex-select-label-foreground)"
|
|
12
11
|
|
|
13
12
|
export const selectTriggerVariants = cva(
|
|
14
13
|
[
|
|
15
|
-
"inline-flex w-full min-w-0 items-center justify-between gap-(--
|
|
16
|
-
"border-(--
|
|
17
|
-
"font-(family-name:--
|
|
18
|
-
"transition-colors duration-(--
|
|
19
|
-
"outline-none data-[focused]:border-(--
|
|
20
|
-
"data-[invalid]:border-(--
|
|
21
|
-
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--
|
|
14
|
+
"inline-flex w-full min-w-0 items-center justify-between gap-(--lex-select-trigger-gap) rounded-(--lex-select-radius) border",
|
|
15
|
+
"border-(--lex-select-border-color) bg-(--lex-select-background) text-(--lex-select-foreground)",
|
|
16
|
+
"font-(family-name:--lex-select-font-family) font-(--lex-select-font-weight) leading-(--lex-select-font-line-height) tracking-(--lex-select-font-letter-spacing)",
|
|
17
|
+
"transition-colors duration-(--lex-select-transition-duration) ease-(--lex-select-transition-easing)",
|
|
18
|
+
"outline-none data-[focused]:border-(--lex-select-focus-border-color) data-[focused]:ring-(length:--lex-select-focus-ring-width) data-[focused]:ring-(--lex-select-focus-ring-color) data-[focused]:ring-offset-(length:--lex-select-focus-ring-offset) data-[focused]:ring-offset-(--lex-select-focus-ring-offset-color)",
|
|
19
|
+
"data-[invalid]:border-(--lex-select-invalid-border-color) data-[invalid]:ring-(length:--lex-select-invalid-ring-width) data-[invalid]:ring-(--lex-select-invalid-ring-color)",
|
|
20
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--lex-opacity-disabled)",
|
|
22
21
|
].join(" "),
|
|
23
22
|
{
|
|
24
23
|
variants: {
|
|
25
24
|
size: {
|
|
26
|
-
sm: "h-(--
|
|
27
|
-
md: "h-(--
|
|
28
|
-
lg: "h-(--
|
|
25
|
+
sm: "h-(--lex-select-height-sm) px-(--lex-select-padding-x-sm) text-(length:--lex-select-font-size-sm)",
|
|
26
|
+
md: "h-(--lex-select-height-md) px-(--lex-select-padding-x-md) text-(length:--lex-select-font-size-md)",
|
|
27
|
+
lg: "h-(--lex-select-height-lg) px-(--lex-select-padding-x-lg) text-(length:--lex-select-font-size-lg)",
|
|
29
28
|
},
|
|
30
29
|
},
|
|
31
30
|
defaultVariants: {
|
|
@@ -34,61 +33,47 @@ export const selectTriggerVariants = cva(
|
|
|
34
33
|
},
|
|
35
34
|
)
|
|
36
35
|
|
|
37
|
-
export const
|
|
38
|
-
"min-w-0 flex-1 truncate text-left data-[placeholder]:text-(--
|
|
39
|
-
)
|
|
36
|
+
export const selectValueClasses =
|
|
37
|
+
"min-w-0 flex-1 truncate text-left data-[placeholder]:text-(--lex-select-placeholder-color)"
|
|
40
38
|
|
|
41
|
-
export const
|
|
42
|
-
"inline-flex size-(--
|
|
43
|
-
)
|
|
39
|
+
export const selectIconClasses =
|
|
40
|
+
"inline-flex size-(--lex-select-icon-size) shrink-0 items-center justify-center text-(--lex-select-icon-foreground) transition-transform duration-(--lex-select-transition-duration) ease-(--lex-select-transition-easing) data-[open]:rotate-180"
|
|
44
41
|
|
|
45
|
-
export const
|
|
46
|
-
"fixed inset-0 z-(--
|
|
47
|
-
)
|
|
42
|
+
export const selectBackdropClasses =
|
|
43
|
+
"fixed inset-0 z-(--lex-select-backdrop-z-index) bg-(--lex-select-backdrop-background) opacity-(--lex-select-backdrop-opacity) data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"
|
|
48
44
|
|
|
49
|
-
export const
|
|
50
|
-
"z-(--lsys-select-positioner-z-index)",
|
|
51
|
-
)
|
|
45
|
+
export const selectPositionerClasses = "z-(--lex-select-positioner-z-index)"
|
|
52
46
|
|
|
53
|
-
export const
|
|
54
|
-
[
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
].join(" "),
|
|
60
|
-
)
|
|
47
|
+
export const selectPopupClasses = [
|
|
48
|
+
"min-w-[var(--anchor-width)] overflow-hidden rounded-(--lex-select-radius) border",
|
|
49
|
+
"border-(--lex-select-popup-border-color) bg-(--lex-select-popup-background) text-(--lex-select-popup-foreground) shadow-(--lex-select-popup-shadow)",
|
|
50
|
+
"data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
|
|
51
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-(--lex-select-transition-duration) ease-(--lex-select-transition-easing)",
|
|
52
|
+
].join(" ")
|
|
61
53
|
|
|
62
|
-
export const
|
|
63
|
-
"grid max-h-(--
|
|
64
|
-
)
|
|
54
|
+
export const selectListClasses =
|
|
55
|
+
"grid max-h-(--lex-select-popup-max-height) gap-(--lex-select-list-gap) overflow-y-auto p-(--lex-select-list-padding)"
|
|
65
56
|
|
|
66
|
-
export const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
].join(" "),
|
|
74
|
-
)
|
|
57
|
+
export const selectItemClasses = [
|
|
58
|
+
"relative flex min-w-0 cursor-default select-none items-center gap-(--lex-select-item-gap) rounded-(--lex-select-item-radius) px-(--lex-select-item-padding-x) py-(--lex-select-item-padding-y)",
|
|
59
|
+
"text-(length:--lex-select-item-font-size) font-(--lex-select-item-font-weight) leading-(--lex-select-item-font-line-height) text-(--lex-select-item-foreground) outline-none",
|
|
60
|
+
"data-[highlighted]:bg-(--lex-select-item-highlight-background) data-[highlighted]:text-(--lex-select-item-highlight-foreground)",
|
|
61
|
+
"data-[selected]:bg-(--lex-select-item-selected-background) data-[selected]:text-(--lex-select-item-selected-foreground)",
|
|
62
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-(--lex-opacity-disabled)",
|
|
63
|
+
].join(" ")
|
|
75
64
|
|
|
76
|
-
export const
|
|
77
|
-
"inline-flex size-(--
|
|
78
|
-
)
|
|
65
|
+
export const selectItemIndicatorClasses =
|
|
66
|
+
"inline-flex size-(--lex-select-item-indicator-size) shrink-0 items-center justify-center text-current"
|
|
79
67
|
|
|
80
|
-
export const
|
|
68
|
+
export const selectItemTextClasses = "min-w-0 flex-1 truncate"
|
|
81
69
|
|
|
82
|
-
export const
|
|
83
|
-
"size-(--
|
|
84
|
-
)
|
|
70
|
+
export const selectArrowClasses =
|
|
71
|
+
"size-(--lex-select-arrow-size) rotate-45 border border-(--lex-select-popup-border-color) bg-(--lex-select-popup-background)"
|
|
85
72
|
|
|
86
|
-
export const
|
|
87
|
-
"flex h-(--
|
|
88
|
-
)
|
|
73
|
+
export const selectScrollArrowClasses =
|
|
74
|
+
"flex h-(--lex-select-scroll-arrow-height) items-center justify-center text-(--lex-select-icon-foreground)"
|
|
89
75
|
|
|
90
|
-
export const
|
|
76
|
+
export const selectGroupClasses = "grid gap-(--lex-select-group-gap)"
|
|
91
77
|
|
|
92
|
-
export const
|
|
93
|
-
"px-(--
|
|
94
|
-
)
|
|
78
|
+
export const selectGroupLabelClasses =
|
|
79
|
+
"px-(--lex-select-item-padding-x) py-(--lex-select-group-label-padding-y) text-(length:--lex-select-group-label-font-size) font-(--lex-select-group-label-font-weight) leading-(--lex-select-group-label-font-line-height) text-(--lex-select-group-label-foreground)"
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import { cva } from "class-variance-authority"
|
|
8
8
|
|
|
9
|
-
export const separatorVariants = cva("shrink-0 bg-(--
|
|
9
|
+
export const separatorVariants = cva("shrink-0 bg-(--lex-separator-color)", {
|
|
10
10
|
variants: {
|
|
11
11
|
orientation: {
|
|
12
|
-
horizontal: "h-(--
|
|
13
|
-
vertical: "h-full w-(--
|
|
12
|
+
horizontal: "h-(--lex-separator-thickness) w-full",
|
|
13
|
+
vertical: "h-full w-(--lex-separator-thickness)",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
@@ -15,13 +15,13 @@ import type {
|
|
|
15
15
|
SliderValueProps,
|
|
16
16
|
} from "./Slider.types"
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
sliderClasses,
|
|
19
|
+
sliderControlClasses,
|
|
20
|
+
sliderIndicatorClasses,
|
|
21
|
+
sliderLabelClasses,
|
|
22
|
+
sliderThumbClasses,
|
|
23
|
+
sliderTrackClasses,
|
|
24
|
+
sliderValueClasses,
|
|
25
25
|
} from "./Slider.variants"
|
|
26
26
|
import { mergeClassName } from "@/lib/utils"
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ const Slider = ({ ref, className, children, ...props }: SliderProps) => {
|
|
|
29
29
|
return (
|
|
30
30
|
<BaseSlider.Root
|
|
31
31
|
ref={ref}
|
|
32
|
-
className={mergeClassName(
|
|
32
|
+
className={mergeClassName(sliderClasses, className)}
|
|
33
33
|
{...props}
|
|
34
34
|
>
|
|
35
35
|
{children}
|
|
@@ -46,7 +46,7 @@ const SliderControl = ({
|
|
|
46
46
|
}: SliderControlProps) => {
|
|
47
47
|
return (
|
|
48
48
|
<BaseSlider.Control
|
|
49
|
-
className={mergeClassName(
|
|
49
|
+
className={mergeClassName(sliderControlClasses, className)}
|
|
50
50
|
{...props}
|
|
51
51
|
>
|
|
52
52
|
{children}
|
|
@@ -59,7 +59,7 @@ SliderControl.displayName = "SliderControl"
|
|
|
59
59
|
const SliderTrack = ({ className, children, ...props }: SliderTrackProps) => {
|
|
60
60
|
return (
|
|
61
61
|
<BaseSlider.Track
|
|
62
|
-
className={mergeClassName(
|
|
62
|
+
className={mergeClassName(sliderTrackClasses, className)}
|
|
63
63
|
{...props}
|
|
64
64
|
>
|
|
65
65
|
{children}
|
|
@@ -72,7 +72,7 @@ SliderTrack.displayName = "SliderTrack"
|
|
|
72
72
|
const SliderIndicator = ({ className, ...props }: SliderIndicatorProps) => {
|
|
73
73
|
return (
|
|
74
74
|
<BaseSlider.Indicator
|
|
75
|
-
className={mergeClassName(
|
|
75
|
+
className={mergeClassName(sliderIndicatorClasses, className)}
|
|
76
76
|
{...props}
|
|
77
77
|
/>
|
|
78
78
|
)
|
|
@@ -83,7 +83,7 @@ SliderIndicator.displayName = "SliderIndicator"
|
|
|
83
83
|
const SliderThumb = ({ className, ...props }: SliderThumbProps) => {
|
|
84
84
|
return (
|
|
85
85
|
<BaseSlider.Thumb
|
|
86
|
-
className={mergeClassName(
|
|
86
|
+
className={mergeClassName(sliderThumbClasses, className)}
|
|
87
87
|
{...props}
|
|
88
88
|
/>
|
|
89
89
|
)
|
|
@@ -94,7 +94,7 @@ SliderThumb.displayName = "SliderThumb"
|
|
|
94
94
|
const SliderLabel = ({ className, ...props }: SliderLabelProps) => {
|
|
95
95
|
return (
|
|
96
96
|
<BaseSlider.Label
|
|
97
|
-
className={mergeClassName(
|
|
97
|
+
className={mergeClassName(sliderLabelClasses, className)}
|
|
98
98
|
{...props}
|
|
99
99
|
/>
|
|
100
100
|
)
|
|
@@ -105,7 +105,7 @@ SliderLabel.displayName = "SliderLabel"
|
|
|
105
105
|
const SliderValue = ({ className, ...props }: SliderValueProps) => {
|
|
106
106
|
return (
|
|
107
107
|
<BaseSlider.Value
|
|
108
|
-
className={mergeClassName(
|
|
108
|
+
className={mergeClassName(sliderValueClasses, className)}
|
|
109
109
|
{...props}
|
|
110
110
|
/>
|
|
111
111
|
)
|
|
@@ -4,35 +4,26 @@
|
|
|
4
4
|
* Defines visual variants using class composition.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
export const sliderClasses = "grid gap-(--lex-slider-gap)"
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const sliderControlClasses =
|
|
10
|
+
"relative flex touch-none items-center py-(--lex-slider-control-padding-y) data-[disabled]:opacity-(--lex-opacity-disabled)"
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
-
"relative
|
|
13
|
-
)
|
|
12
|
+
export const sliderTrackClasses =
|
|
13
|
+
"relative h-(--lex-slider-track-height) w-full overflow-hidden rounded-(--lex-slider-track-radius) bg-(--lex-slider-track-background)"
|
|
14
14
|
|
|
15
|
-
export const
|
|
16
|
-
"
|
|
17
|
-
)
|
|
15
|
+
export const sliderIndicatorClasses =
|
|
16
|
+
"h-full bg-(--lex-slider-indicator-background)"
|
|
18
17
|
|
|
19
|
-
export const
|
|
20
|
-
"
|
|
21
|
-
)
|
|
18
|
+
export const sliderThumbClasses = [
|
|
19
|
+
"block size-(--lex-slider-thumb-size) rounded-(--lex-slider-thumb-radius) border border-(--lex-slider-thumb-border-color) bg-(--lex-slider-thumb-background) shadow-sm",
|
|
20
|
+
"outline-none transition-colors duration-(--lex-slider-transition-duration) ease-(--lex-slider-transition-easing)",
|
|
21
|
+
"focus-visible:ring-(length:--lex-slider-focus-ring-width) focus-visible:ring-(--lex-slider-focus-ring-color) focus-visible:ring-offset-(length:--lex-slider-focus-ring-offset) focus-visible:ring-offset-(--lex-slider-focus-ring-offset-color)",
|
|
22
|
+
"data-[disabled]:cursor-not-allowed",
|
|
23
|
+
].join(" ")
|
|
22
24
|
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
"block size-(--lsys-slider-thumb-size) rounded-(--lsys-slider-thumb-radius) border border-(--lsys-slider-thumb-border-color) bg-(--lsys-slider-thumb-background) shadow-sm",
|
|
26
|
-
"outline-none transition-colors duration-(--lsys-slider-transition-duration) ease-(--lsys-slider-transition-easing)",
|
|
27
|
-
"focus-visible:ring-(length:--lsys-slider-focus-ring-width) focus-visible:ring-(--lsys-slider-focus-ring-color) focus-visible:ring-offset-(length:--lsys-slider-focus-ring-offset) focus-visible:ring-offset-(--lsys-slider-focus-ring-offset-color)",
|
|
28
|
-
"data-[disabled]:cursor-not-allowed",
|
|
29
|
-
].join(" "),
|
|
30
|
-
)
|
|
25
|
+
export const sliderLabelClasses =
|
|
26
|
+
"font-(--lex-meter-label-font-weight) text-(length:--lex-meter-label-font-size) leading-(--lex-meter-label-font-line-height) text-(--lex-meter-label-foreground)"
|
|
31
27
|
|
|
32
|
-
export const
|
|
33
|
-
"font-(--
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
export const sliderValueVariants = cva(
|
|
37
|
-
"font-(--lsys-meter-value-font-weight) text-(--lsys-meter-value-foreground)",
|
|
38
|
-
)
|
|
28
|
+
export const sliderValueClasses =
|
|
29
|
+
"font-(--lex-meter-value-font-weight) text-(--lex-meter-value-foreground)"
|
|
@@ -13,7 +13,7 @@ export interface SwitchProps extends Omit<
|
|
|
13
13
|
BaseSwitch.Root.Props,
|
|
14
14
|
"className" | "children"
|
|
15
15
|
> {
|
|
16
|
-
ref?: Ref<
|
|
16
|
+
ref?: Ref<HTMLButtonElement>
|
|
17
17
|
size?: SwitchSize
|
|
18
18
|
className?: BaseSwitch.Root.Props["className"]
|
|
19
19
|
children?: BaseSwitch.Root.Props["children"]
|
|
@@ -23,7 +23,7 @@ export interface SwitchThumbProps extends Omit<
|
|
|
23
23
|
BaseSwitch.Thumb.Props,
|
|
24
24
|
"className"
|
|
25
25
|
> {
|
|
26
|
-
ref?: Ref<
|
|
26
|
+
ref?: Ref<HTMLSpanElement>
|
|
27
27
|
size?: SwitchSize
|
|
28
28
|
className?: BaseSwitch.Thumb.Props["className"]
|
|
29
29
|
}
|
|
@@ -8,18 +8,18 @@ import { cva } from "class-variance-authority"
|
|
|
8
8
|
|
|
9
9
|
export const switchVariants = cva(
|
|
10
10
|
[
|
|
11
|
-
"inline-flex shrink-0 cursor-pointer items-center rounded-(--
|
|
12
|
-
"transition-colors duration-(--
|
|
13
|
-
"outline-none data-[checked]:bg-(--
|
|
14
|
-
"data-[focused]:ring-(length:--
|
|
15
|
-
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--
|
|
11
|
+
"inline-flex shrink-0 cursor-pointer items-center rounded-(--lex-switch-radius) border border-transparent bg-(--lex-switch-background) p-(--lex-switch-padding)",
|
|
12
|
+
"transition-colors duration-(--lex-switch-transition-duration) ease-(--lex-switch-transition-easing)",
|
|
13
|
+
"outline-none data-[checked]:bg-(--lex-switch-checked-background)",
|
|
14
|
+
"data-[focused]:ring-(length:--lex-switch-focus-ring-width) data-[focused]:ring-(--lex-switch-focus-ring-color) data-[focused]:ring-offset-(length:--lex-switch-focus-ring-offset) data-[focused]:ring-offset-(--lex-switch-focus-ring-offset-color)",
|
|
15
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--lex-opacity-disabled)",
|
|
16
16
|
].join(" "),
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
size: {
|
|
20
|
-
sm: "h-(--
|
|
21
|
-
md: "h-(--
|
|
22
|
-
lg: "h-(--
|
|
20
|
+
sm: "h-(--lex-switch-height-sm) w-(--lex-switch-width-sm)",
|
|
21
|
+
md: "h-(--lex-switch-height-md) w-(--lex-switch-width-md)",
|
|
22
|
+
lg: "h-(--lex-switch-height-lg) w-(--lex-switch-width-lg)",
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: {
|
|
@@ -30,15 +30,15 @@ export const switchVariants = cva(
|
|
|
30
30
|
|
|
31
31
|
export const switchThumbVariants = cva(
|
|
32
32
|
[
|
|
33
|
-
"block rounded-(--
|
|
34
|
-
"transition-transform duration-(--
|
|
33
|
+
"block rounded-(--lex-switch-thumb-radius) bg-(--lex-switch-thumb-background) shadow-sm ring-0",
|
|
34
|
+
"transition-transform duration-(--lex-switch-transition-duration) ease-(--lex-switch-transition-easing)",
|
|
35
35
|
].join(" "),
|
|
36
36
|
{
|
|
37
37
|
variants: {
|
|
38
38
|
size: {
|
|
39
|
-
sm: "size-(--
|
|
40
|
-
md: "size-(--
|
|
41
|
-
lg: "size-(--
|
|
39
|
+
sm: "size-(--lex-switch-thumb-size-sm) data-[checked]:translate-x-(--lex-switch-thumb-translate-sm)",
|
|
40
|
+
md: "size-(--lex-switch-thumb-size-md) data-[checked]:translate-x-(--lex-switch-thumb-translate-md)",
|
|
41
|
+
lg: "size-(--lex-switch-thumb-size-lg) data-[checked]:translate-x-(--lex-switch-thumb-translate-lg)",
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
defaultVariants: {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table.tsx
|
|
3
|
+
*
|
|
4
|
+
* Reference Table component implementation.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
TableBodyProps,
|
|
9
|
+
TableCaptionProps,
|
|
10
|
+
TableCellProps,
|
|
11
|
+
TableFooterProps,
|
|
12
|
+
TableHeadProps,
|
|
13
|
+
TableHeaderProps,
|
|
14
|
+
TableProps,
|
|
15
|
+
TableRowProps,
|
|
16
|
+
} from "./Table.types"
|
|
17
|
+
import {
|
|
18
|
+
tableBodyClassName,
|
|
19
|
+
tableCaptionClassName,
|
|
20
|
+
tableCellClassName,
|
|
21
|
+
tableFooterClassName,
|
|
22
|
+
tableHeadClassName,
|
|
23
|
+
tableHeaderClassName,
|
|
24
|
+
tableRowClassName,
|
|
25
|
+
tableVariants,
|
|
26
|
+
tableWrapperClassName,
|
|
27
|
+
} from "./Table.variants"
|
|
28
|
+
import { cn } from "@/lib/utils"
|
|
29
|
+
|
|
30
|
+
const Table = ({ ref, variant, className, ...props }: TableProps) => {
|
|
31
|
+
return (
|
|
32
|
+
<div className={tableWrapperClassName}>
|
|
33
|
+
<table
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn(tableVariants({ variant }), className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Table.displayName = "Table"
|
|
43
|
+
|
|
44
|
+
const TableHeader = ({ ref, className, ...props }: TableHeaderProps) => {
|
|
45
|
+
return (
|
|
46
|
+
<thead
|
|
47
|
+
ref={ref}
|
|
48
|
+
className={cn(tableHeaderClassName, className)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
TableHeader.displayName = "TableHeader"
|
|
55
|
+
|
|
56
|
+
const TableBody = ({ ref, className, ...props }: TableBodyProps) => {
|
|
57
|
+
return (
|
|
58
|
+
<tbody ref={ref} className={cn(tableBodyClassName, className)} {...props} />
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
TableBody.displayName = "TableBody"
|
|
63
|
+
|
|
64
|
+
const TableFooter = ({ ref, className, ...props }: TableFooterProps) => {
|
|
65
|
+
return (
|
|
66
|
+
<tfoot
|
|
67
|
+
ref={ref}
|
|
68
|
+
className={cn(tableFooterClassName, className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
TableFooter.displayName = "TableFooter"
|
|
75
|
+
|
|
76
|
+
const TableRow = ({ ref, className, ...props }: TableRowProps) => {
|
|
77
|
+
return (
|
|
78
|
+
<tr ref={ref} className={cn(tableRowClassName, className)} {...props} />
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
TableRow.displayName = "TableRow"
|
|
83
|
+
|
|
84
|
+
const TableHead = ({ ref, className, ...props }: TableHeadProps) => {
|
|
85
|
+
return (
|
|
86
|
+
<th ref={ref} className={cn(tableHeadClassName, className)} {...props} />
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
TableHead.displayName = "TableHead"
|
|
91
|
+
|
|
92
|
+
const TableCell = ({ ref, className, ...props }: TableCellProps) => {
|
|
93
|
+
return (
|
|
94
|
+
<td ref={ref} className={cn(tableCellClassName, className)} {...props} />
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
TableCell.displayName = "TableCell"
|
|
99
|
+
|
|
100
|
+
const TableCaption = ({ ref, className, ...props }: TableCaptionProps) => {
|
|
101
|
+
return (
|
|
102
|
+
<caption
|
|
103
|
+
ref={ref}
|
|
104
|
+
className={cn(tableCaptionClassName, className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
TableCaption.displayName = "TableCaption"
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
Table,
|
|
114
|
+
TableHeader,
|
|
115
|
+
TableBody,
|
|
116
|
+
TableFooter,
|
|
117
|
+
TableHead,
|
|
118
|
+
TableRow,
|
|
119
|
+
TableCell,
|
|
120
|
+
TableCaption,
|
|
121
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Ref } from "react"
|
|
2
|
+
/**
|
|
3
|
+
* Table.types.ts
|
|
4
|
+
*
|
|
5
|
+
* Public and internal types for Table component.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
HTMLAttributes,
|
|
10
|
+
TableHTMLAttributes,
|
|
11
|
+
TdHTMLAttributes,
|
|
12
|
+
ThHTMLAttributes,
|
|
13
|
+
} from "react"
|
|
14
|
+
|
|
15
|
+
export type TableVariant = "default" | "striped" | "bordered"
|
|
16
|
+
|
|
17
|
+
export interface TableProps extends Omit<
|
|
18
|
+
TableHTMLAttributes<HTMLTableElement>,
|
|
19
|
+
"className"
|
|
20
|
+
> {
|
|
21
|
+
ref?: Ref<HTMLTableElement>
|
|
22
|
+
variant?: TableVariant
|
|
23
|
+
className?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TableSectionProps extends Omit<
|
|
27
|
+
HTMLAttributes<HTMLTableSectionElement>,
|
|
28
|
+
"className"
|
|
29
|
+
> {
|
|
30
|
+
ref?: Ref<HTMLTableSectionElement>
|
|
31
|
+
className?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type TableHeaderProps = TableSectionProps
|
|
35
|
+
export type TableBodyProps = TableSectionProps
|
|
36
|
+
export type TableFooterProps = TableSectionProps
|
|
37
|
+
|
|
38
|
+
export interface TableRowProps extends Omit<
|
|
39
|
+
HTMLAttributes<HTMLTableRowElement>,
|
|
40
|
+
"className"
|
|
41
|
+
> {
|
|
42
|
+
ref?: Ref<HTMLTableRowElement>
|
|
43
|
+
className?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface TableHeadProps extends Omit<
|
|
47
|
+
ThHTMLAttributes<HTMLTableCellElement>,
|
|
48
|
+
"className"
|
|
49
|
+
> {
|
|
50
|
+
ref?: Ref<HTMLTableCellElement>
|
|
51
|
+
className?: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TableCellProps extends Omit<
|
|
55
|
+
TdHTMLAttributes<HTMLTableCellElement>,
|
|
56
|
+
"className"
|
|
57
|
+
> {
|
|
58
|
+
ref?: Ref<HTMLTableCellElement>
|
|
59
|
+
className?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TableCaptionProps extends Omit<
|
|
63
|
+
HTMLAttributes<HTMLTableCaptionElement>,
|
|
64
|
+
"className"
|
|
65
|
+
> {
|
|
66
|
+
ref?: Ref<HTMLTableCaptionElement>
|
|
67
|
+
className?: string
|
|
68
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table.variants.ts
|
|
3
|
+
*
|
|
4
|
+
* Defines Table visual slots using class composition.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { cva } from "class-variance-authority"
|
|
8
|
+
|
|
9
|
+
export const tableVariants = cva(
|
|
10
|
+
[
|
|
11
|
+
"w-full caption-bottom border-collapse text-(length:--lex-table-cell-font-size)",
|
|
12
|
+
"text-(--lex-table-foreground)",
|
|
13
|
+
].join(" "),
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "",
|
|
18
|
+
striped:
|
|
19
|
+
"[&_tbody_tr:nth-child(even)]:bg-(--lex-table-row-striped-background)",
|
|
20
|
+
bordered:
|
|
21
|
+
"border border-(--lex-table-border-color) [&_th]:border [&_td]:border [&_th]:border-(--lex-table-border-color) [&_td]:border-(--lex-table-border-color)",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export const tableWrapperClassName = "relative w-full overflow-x-auto"
|
|
31
|
+
|
|
32
|
+
export const tableCaptionClassName =
|
|
33
|
+
"mt-(--lex-table-cell-padding-y) text-(length:--lex-table-caption-font-size) leading-(--lex-table-caption-font-line-height) text-(--lex-table-caption-foreground)"
|
|
34
|
+
|
|
35
|
+
export const tableHeaderClassName =
|
|
36
|
+
"[&_tr]:border-b [&_tr]:border-(--lex-table-border-color)"
|
|
37
|
+
|
|
38
|
+
export const tableBodyClassName =
|
|
39
|
+
"[&_tr:last-child]:border-0 [&_tr]:border-b [&_tr]:border-(--lex-table-border-color)"
|
|
40
|
+
|
|
41
|
+
export const tableFooterClassName =
|
|
42
|
+
"border-t border-(--lex-table-border-color) bg-(--lex-table-footer-background) font-medium [&_tr]:last:border-b-0"
|
|
43
|
+
|
|
44
|
+
export const tableRowClassName =
|
|
45
|
+
"border-b border-(--lex-table-border-color) transition-colors hover:bg-(--lex-table-head-background)/50 data-[state=selected]:bg-(--lex-table-head-background)"
|
|
46
|
+
|
|
47
|
+
export const tableHeadClassName =
|
|
48
|
+
"h-10 px-(--lex-table-cell-padding-x) py-(--lex-table-cell-padding-y) text-left align-middle font-(--lex-table-head-font-weight) text-(length:--lex-table-head-font-size) leading-(--lex-table-head-font-line-height) text-(--lex-table-head-foreground) [&:has([role=checkbox])]:pr-0"
|
|
49
|
+
|
|
50
|
+
export const tableCellClassName =
|
|
51
|
+
"px-(--lex-table-cell-padding-x) py-(--lex-table-cell-padding-y) align-middle leading-(--lex-table-cell-font-line-height) [&:has([role=checkbox])]:pr-0"
|
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
import { cva } from "class-variance-authority"
|
|
8
8
|
import { disabledStateClasses } from "@/lib/utils"
|
|
9
9
|
|
|
10
|
-
export const tabsRootVariants = cva("grid gap-(--
|
|
10
|
+
export const tabsRootVariants = cva("grid gap-(--lex-tabs-gap)")
|
|
11
11
|
|
|
12
12
|
export const tabsListVariants = cva(
|
|
13
|
-
"inline-flex w-fit items-center rounded-(--
|
|
13
|
+
"inline-flex w-fit items-center rounded-(--lex-tabs-list-radius) bg-(--lex-tabs-list-background) p-(--lex-tabs-list-padding)",
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
export const tabsTabVariants = cva(
|
|
17
17
|
[
|
|
18
|
-
"inline-flex items-center justify-center rounded-(--
|
|
19
|
-
"text-(length:--
|
|
20
|
-
"transition-colors duration-(--
|
|
21
|
-
"outline-none data-[active]:bg-(--
|
|
22
|
-
"focus-visible:ring-(length:--
|
|
18
|
+
"inline-flex items-center justify-center rounded-(--lex-tabs-tab-radius) px-(--lex-tabs-tab-padding-x) py-(--lex-tabs-tab-padding-y)",
|
|
19
|
+
"text-(length:--lex-tabs-tab-font-size) font-(--lex-tabs-tab-font-weight) leading-(--lex-tabs-tab-font-line-height) text-(--lex-tabs-tab-foreground)",
|
|
20
|
+
"transition-colors duration-(--lex-tabs-transition-duration) ease-(--lex-tabs-transition-easing)",
|
|
21
|
+
"outline-none data-[active]:bg-(--lex-tabs-tab-active-background) data-[active]:text-(--lex-tabs-tab-active-foreground) data-[active]:shadow-sm",
|
|
22
|
+
"focus-visible:ring-(length:--lex-tabs-focus-ring-width) focus-visible:ring-(--lex-tabs-focus-ring-color)",
|
|
23
23
|
disabledStateClasses,
|
|
24
24
|
].join(" "),
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
export const tabsPanelVariants = cva(
|
|
28
|
-
"text-(length:--
|
|
28
|
+
"text-(length:--lex-tabs-panel-font-size) leading-(--lex-tabs-panel-font-line-height) text-(--lex-tabs-panel-foreground) outline-none focus-visible:ring-(length:--lex-tabs-focus-ring-width) focus-visible:ring-(--lex-tabs-focus-ring-color)",
|
|
29
29
|
)
|