@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
|
@@ -4,23 +4,22 @@
|
|
|
4
4
|
* Variant classes for the CommandPalette block.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
}
|
|
7
|
+
export const commandPaletteRootClasses =
|
|
8
|
+
"lex-command-palette flex flex-col gap-(--lex-space-2)"
|
|
10
9
|
|
|
11
|
-
export const
|
|
10
|
+
export const commandPaletteInputClasses = "w-full"
|
|
12
11
|
|
|
13
|
-
export const
|
|
14
|
-
"flex max-h-(--
|
|
12
|
+
export const commandPaletteListClasses =
|
|
13
|
+
"flex max-h-(--lex-size-command-palette-list-max-height,16rem) flex-col"
|
|
15
14
|
|
|
16
|
-
export const
|
|
17
|
-
"px-(--
|
|
15
|
+
export const commandPaletteGroupLabelClasses =
|
|
16
|
+
"px-(--lex-space-3) py-(--lex-space-1) text-(length:--lex-typography-label-xs-font-size) font-(--lex-typography-label-xs-font-weight) text-(--lex-color-text-secondary)"
|
|
18
17
|
|
|
19
|
-
export const
|
|
20
|
-
"flex w-full flex-col items-start gap-(--
|
|
18
|
+
export const commandPaletteItemClasses =
|
|
19
|
+
"flex w-full flex-col items-start gap-(--lex-space-1) rounded-(--lex-radius-control) px-(--lex-space-3) py-(--lex-space-2) text-left text-(--lex-color-text-primary) outline-none transition-colors hover:bg-(--lex-action-secondary-hover) focus-visible:bg-(--lex-action-secondary-hover)"
|
|
21
20
|
|
|
22
|
-
export const
|
|
23
|
-
"text-(length:--
|
|
21
|
+
export const commandPaletteItemDescriptionClasses =
|
|
22
|
+
"text-(length:--lex-typography-body-xs-font-size) text-(--lex-color-text-secondary)"
|
|
24
23
|
|
|
25
|
-
export const
|
|
26
|
-
"px-(--
|
|
24
|
+
export const commandPaletteEmptyClasses =
|
|
25
|
+
"px-(--lex-space-3) py-(--lex-space-4) text-(length:--lex-typography-body-sm-font-size) text-(--lex-color-text-secondary)"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty.tsx
|
|
3
|
+
*
|
|
4
|
+
* Reference Empty block implementation.
|
|
5
|
+
* Used for zero-data surfaces: no results, no items, unauthenticated views.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
import type {
|
|
10
|
+
EmptyContentProps,
|
|
11
|
+
EmptyDescriptionProps,
|
|
12
|
+
EmptyHeaderProps,
|
|
13
|
+
EmptyMediaProps,
|
|
14
|
+
EmptyProps,
|
|
15
|
+
EmptyTitleProps,
|
|
16
|
+
} from "./Empty.types"
|
|
17
|
+
import {
|
|
18
|
+
emptyClasses,
|
|
19
|
+
emptyContentClasses,
|
|
20
|
+
emptyDescriptionClasses,
|
|
21
|
+
emptyHeaderClasses,
|
|
22
|
+
emptyMediaClasses,
|
|
23
|
+
emptyTitleClasses,
|
|
24
|
+
} from "./Empty.variants"
|
|
25
|
+
|
|
26
|
+
const Empty = ({ ref, className, ...props }: EmptyProps) => {
|
|
27
|
+
return <div ref={ref} className={cn(emptyClasses(), className)} {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Empty.displayName = "Empty"
|
|
31
|
+
|
|
32
|
+
const EmptyHeader = ({ ref, className, ...props }: EmptyHeaderProps) => {
|
|
33
|
+
return (
|
|
34
|
+
<div ref={ref} className={cn(emptyHeaderClasses(), className)} {...props} />
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
EmptyHeader.displayName = "EmptyHeader"
|
|
39
|
+
|
|
40
|
+
const EmptyMedia = ({ ref, className, ...props }: EmptyMediaProps) => {
|
|
41
|
+
return (
|
|
42
|
+
<div ref={ref} className={cn(emptyMediaClasses(), className)} {...props} />
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
EmptyMedia.displayName = "EmptyMedia"
|
|
47
|
+
|
|
48
|
+
const EmptyTitle = ({ ref, className, ...props }: EmptyTitleProps) => {
|
|
49
|
+
return (
|
|
50
|
+
<h3 ref={ref} className={cn(emptyTitleClasses(), className)} {...props} />
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
EmptyTitle.displayName = "EmptyTitle"
|
|
55
|
+
|
|
56
|
+
const EmptyDescription = ({
|
|
57
|
+
ref,
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}: EmptyDescriptionProps) => {
|
|
61
|
+
return (
|
|
62
|
+
<p
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(emptyDescriptionClasses(), className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
EmptyDescription.displayName = "EmptyDescription"
|
|
71
|
+
|
|
72
|
+
const EmptyContent = ({ ref, className, ...props }: EmptyContentProps) => {
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={cn(emptyContentClasses(), className)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
EmptyContent.displayName = "EmptyContent"
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
Empty,
|
|
86
|
+
EmptyHeader,
|
|
87
|
+
EmptyMedia,
|
|
88
|
+
EmptyTitle,
|
|
89
|
+
EmptyDescription,
|
|
90
|
+
EmptyContent,
|
|
91
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react"
|
|
2
|
+
|
|
3
|
+
export type EmptyProps = ComponentPropsWithRef<"div">
|
|
4
|
+
export type EmptyHeaderProps = ComponentPropsWithRef<"div">
|
|
5
|
+
export type EmptyMediaProps = ComponentPropsWithRef<"div">
|
|
6
|
+
export type EmptyTitleProps = ComponentPropsWithRef<"h3">
|
|
7
|
+
export type EmptyDescriptionProps = ComponentPropsWithRef<"p">
|
|
8
|
+
export type EmptyContentProps = ComponentPropsWithRef<"div">
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty.variants.ts
|
|
3
|
+
*
|
|
4
|
+
* Variant classes for the Empty block.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const emptyClasses = (): string => {
|
|
8
|
+
return [
|
|
9
|
+
"lex-empty",
|
|
10
|
+
"flex w-full flex-col items-center justify-center text-center",
|
|
11
|
+
"gap-(--lex-empty-gap) p-(--lex-empty-padding)",
|
|
12
|
+
].join(" ")
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const emptyHeaderClasses = (): string => {
|
|
16
|
+
return [
|
|
17
|
+
"lex-empty__header",
|
|
18
|
+
"flex flex-col items-center",
|
|
19
|
+
"gap-(--lex-empty-header-gap)",
|
|
20
|
+
].join(" ")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const emptyMediaClasses = (): string => {
|
|
24
|
+
return [
|
|
25
|
+
"lex-empty__media",
|
|
26
|
+
"flex items-center justify-center",
|
|
27
|
+
"size-(--lex-empty-media-size) text-(--lex-empty-media-foreground)",
|
|
28
|
+
].join(" ")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const emptyTitleClasses = (): string => {
|
|
32
|
+
return [
|
|
33
|
+
"lex-empty__title",
|
|
34
|
+
"text-(length:--lex-empty-title-font-size) font-(--lex-empty-title-font-weight)",
|
|
35
|
+
"leading-(--lex-empty-title-font-line-height) text-(--lex-empty-title-foreground)",
|
|
36
|
+
"m-0",
|
|
37
|
+
].join(" ")
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const emptyDescriptionClasses = (): string => {
|
|
41
|
+
return [
|
|
42
|
+
"lex-empty__description",
|
|
43
|
+
"text-(length:--lex-empty-description-font-size)",
|
|
44
|
+
"leading-(--lex-empty-description-font-line-height) text-(--lex-empty-description-foreground)",
|
|
45
|
+
"m-0",
|
|
46
|
+
].join(" ")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const emptyContentClasses = (): string => {
|
|
50
|
+
return "lex-empty__content flex items-center justify-center gap-(--lex-empty-gap)"
|
|
51
|
+
}
|
|
@@ -20,16 +20,12 @@ import type {
|
|
|
20
20
|
FormFieldLabelProps,
|
|
21
21
|
FormFieldProps,
|
|
22
22
|
} from "./FormField.types"
|
|
23
|
-
import {
|
|
23
|
+
import { formFieldClasses } from "./FormField.variants"
|
|
24
24
|
import { cn } from "@/lib/utils"
|
|
25
25
|
|
|
26
26
|
const FormField = ({ ref, className, ...props }: FormFieldProps) => {
|
|
27
27
|
return (
|
|
28
|
-
<Field
|
|
29
|
-
ref={ref}
|
|
30
|
-
className={cn(formFieldVariants(), className)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
28
|
+
<Field ref={ref} className={cn(formFieldClasses(), className)} {...props} />
|
|
33
29
|
)
|
|
34
30
|
}
|
|
35
31
|
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Variant classes for the FormField block.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
return "
|
|
7
|
+
export const formFieldClasses = (): string => {
|
|
8
|
+
return "lex-form-field flex flex-col gap-[var(--lex-space-2)]"
|
|
9
9
|
}
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
SettingsPanelProps,
|
|
21
21
|
SettingsPanelTitleProps,
|
|
22
22
|
} from "./SettingsPanel.types"
|
|
23
|
-
import {
|
|
23
|
+
import { settingsPanelClasses } from "./SettingsPanel.variants"
|
|
24
24
|
import { cn } from "@/lib/utils"
|
|
25
25
|
|
|
26
26
|
const SettingsPanel = ({
|
|
@@ -34,7 +34,7 @@ const SettingsPanel = ({
|
|
|
34
34
|
<Card
|
|
35
35
|
ref={ref}
|
|
36
36
|
variant={variant}
|
|
37
|
-
className={cn(
|
|
37
|
+
className={cn(settingsPanelClasses(), className)}
|
|
38
38
|
{...cardProps}
|
|
39
39
|
>
|
|
40
40
|
{children}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Variant classes for the SettingsPanel block.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
return "
|
|
7
|
+
export const settingsPanelClasses = (): string => {
|
|
8
|
+
return "lex-settings-panel w-full text-(--lex-color-text-primary)"
|
|
9
9
|
}
|
|
@@ -33,59 +33,39 @@ import type {
|
|
|
33
33
|
SidebarItemButtonProps,
|
|
34
34
|
SidebarItemLinkProps,
|
|
35
35
|
SidebarItemProps,
|
|
36
|
-
SidebarItemSize,
|
|
37
|
-
SidebarItemVariant,
|
|
38
36
|
SidebarListProps,
|
|
39
37
|
SidebarMobileHeaderProps,
|
|
40
38
|
SidebarProps,
|
|
41
39
|
SidebarTriggerProps,
|
|
42
40
|
} from "./Sidebar.types"
|
|
43
41
|
import {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
sidebarRootVariants,
|
|
42
|
+
sidebarBrandClasses,
|
|
43
|
+
sidebarDesktopClasses,
|
|
44
|
+
sidebarDrawerFooterClasses,
|
|
45
|
+
sidebarFooterClasses,
|
|
46
|
+
sidebarGroupContentClasses,
|
|
47
|
+
sidebarGroupLabelClasses,
|
|
48
|
+
sidebarGroupClasses,
|
|
49
|
+
sidebarMainClasses,
|
|
50
|
+
sidebarMobileHeaderClasses,
|
|
51
|
+
sidebarNavItemClasses,
|
|
52
|
+
sidebarNavListClasses,
|
|
53
|
+
sidebarNavClasses,
|
|
54
|
+
sidebarRootClasses,
|
|
58
55
|
} from "./Sidebar.variants"
|
|
59
56
|
import { cn } from "@/lib/utils"
|
|
60
57
|
|
|
61
|
-
interface SidebarContextValue {
|
|
62
|
-
itemVariant: SidebarItemVariant
|
|
63
|
-
itemSize: SidebarItemSize
|
|
64
|
-
}
|
|
65
|
-
|
|
66
58
|
interface SidebarMobileContextValue {
|
|
67
59
|
closeOnSelect: boolean
|
|
68
60
|
}
|
|
69
61
|
|
|
70
|
-
const SidebarContext = createContext<SidebarContextValue>({
|
|
71
|
-
itemVariant: "ghost",
|
|
72
|
-
itemSize: "sm",
|
|
73
|
-
})
|
|
74
|
-
|
|
75
62
|
const SidebarMobileContext = createContext<SidebarMobileContextValue>({
|
|
76
63
|
closeOnSelect: false,
|
|
77
64
|
})
|
|
78
65
|
|
|
79
66
|
const useSidebarMobileContext = () => useContext(SidebarMobileContext)
|
|
80
67
|
|
|
81
|
-
const Sidebar = ({
|
|
82
|
-
ref,
|
|
83
|
-
className,
|
|
84
|
-
itemVariant = "ghost",
|
|
85
|
-
itemSize = "sm",
|
|
86
|
-
children,
|
|
87
|
-
...props
|
|
88
|
-
}: SidebarProps) => {
|
|
68
|
+
const Sidebar = ({ ref, className, children, ...props }: SidebarProps) => {
|
|
89
69
|
const sidebarBody = (
|
|
90
70
|
<SidebarMobileContext.Provider value={{ closeOnSelect: false }}>
|
|
91
71
|
{children}
|
|
@@ -95,7 +75,7 @@ const Sidebar = ({
|
|
|
95
75
|
const drawerBody = (
|
|
96
76
|
<SidebarMobileContext.Provider value={{ closeOnSelect: true }}>
|
|
97
77
|
{children}
|
|
98
|
-
<div className={
|
|
78
|
+
<div className={sidebarDrawerFooterClasses()}>
|
|
99
79
|
<DrawerClose render={<Button variant="secondary" size="sm" />}>
|
|
100
80
|
Close
|
|
101
81
|
</DrawerClose>
|
|
@@ -104,38 +84,26 @@ const Sidebar = ({
|
|
|
104
84
|
)
|
|
105
85
|
|
|
106
86
|
return (
|
|
107
|
-
<
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<DrawerDescription className="sr-only">
|
|
128
|
-
Application navigation links
|
|
129
|
-
</DrawerDescription>
|
|
130
|
-
{drawerBody}
|
|
131
|
-
</DrawerContent>
|
|
132
|
-
</DrawerPopup>
|
|
133
|
-
</DrawerViewport>
|
|
134
|
-
</DrawerPortal>
|
|
135
|
-
</Drawer>
|
|
136
|
-
</div>
|
|
137
|
-
</aside>
|
|
138
|
-
</SidebarContext.Provider>
|
|
87
|
+
<aside ref={ref} className={cn(sidebarRootClasses(), className)} {...props}>
|
|
88
|
+
<Drawer swipeDirection="left">
|
|
89
|
+
<div className={sidebarDesktopClasses()}>{sidebarBody}</div>
|
|
90
|
+
<DrawerPortal>
|
|
91
|
+
<DrawerBackdrop />
|
|
92
|
+
<DrawerViewport side="left">
|
|
93
|
+
<DrawerPopup side="left" size="sm">
|
|
94
|
+
<DrawerClose aria-label="Close navigation" />
|
|
95
|
+
<DrawerContent className={sidebarMainClasses()}>
|
|
96
|
+
<DrawerTitle className="sr-only">Navigation</DrawerTitle>
|
|
97
|
+
<DrawerDescription className="sr-only">
|
|
98
|
+
Application navigation links
|
|
99
|
+
</DrawerDescription>
|
|
100
|
+
{drawerBody}
|
|
101
|
+
</DrawerContent>
|
|
102
|
+
</DrawerPopup>
|
|
103
|
+
</DrawerViewport>
|
|
104
|
+
</DrawerPortal>
|
|
105
|
+
</Drawer>
|
|
106
|
+
</aside>
|
|
139
107
|
)
|
|
140
108
|
}
|
|
141
109
|
|
|
@@ -148,7 +116,7 @@ const SidebarHeader = ({
|
|
|
148
116
|
...props
|
|
149
117
|
}: SidebarHeaderProps) => {
|
|
150
118
|
return (
|
|
151
|
-
<div ref={ref} className={cn(
|
|
119
|
+
<div ref={ref} className={cn(sidebarBrandClasses(), className)} {...props}>
|
|
152
120
|
{children}
|
|
153
121
|
</div>
|
|
154
122
|
)
|
|
@@ -163,7 +131,7 @@ const SidebarContent = ({
|
|
|
163
131
|
...props
|
|
164
132
|
}: SidebarContentProps) => {
|
|
165
133
|
return (
|
|
166
|
-
<ScrollArea className={
|
|
134
|
+
<ScrollArea className={sidebarNavClasses()}>
|
|
167
135
|
<ScrollAreaViewport>
|
|
168
136
|
<ScrollAreaContent>
|
|
169
137
|
<nav
|
|
@@ -189,11 +157,7 @@ const SidebarFooter = ({
|
|
|
189
157
|
...props
|
|
190
158
|
}: SidebarFooterProps) => {
|
|
191
159
|
return (
|
|
192
|
-
<div
|
|
193
|
-
ref={ref}
|
|
194
|
-
className={cn(sidebarFooterVariants(), className)}
|
|
195
|
-
{...props}
|
|
196
|
-
>
|
|
160
|
+
<div ref={ref} className={cn(sidebarFooterClasses(), className)} {...props}>
|
|
197
161
|
{children}
|
|
198
162
|
</div>
|
|
199
163
|
)
|
|
@@ -237,7 +201,7 @@ const SidebarMobileHeader = ({
|
|
|
237
201
|
return (
|
|
238
202
|
<div
|
|
239
203
|
ref={ref}
|
|
240
|
-
className={cn(
|
|
204
|
+
className={cn(sidebarMobileHeaderClasses(), className)}
|
|
241
205
|
{...props}
|
|
242
206
|
>
|
|
243
207
|
{children}
|
|
@@ -254,7 +218,7 @@ const SidebarGroup = ({
|
|
|
254
218
|
...props
|
|
255
219
|
}: SidebarGroupProps) => {
|
|
256
220
|
return (
|
|
257
|
-
<div ref={ref} className={cn(
|
|
221
|
+
<div ref={ref} className={cn(sidebarGroupClasses(), className)} {...props}>
|
|
258
222
|
{children}
|
|
259
223
|
</div>
|
|
260
224
|
)
|
|
@@ -271,7 +235,7 @@ const SidebarGroupLabel = ({
|
|
|
271
235
|
return (
|
|
272
236
|
<div
|
|
273
237
|
ref={ref}
|
|
274
|
-
className={cn(
|
|
238
|
+
className={cn(sidebarGroupLabelClasses(), className)}
|
|
275
239
|
{...props}
|
|
276
240
|
>
|
|
277
241
|
{children}
|
|
@@ -290,7 +254,7 @@ const SidebarGroupContent = ({
|
|
|
290
254
|
return (
|
|
291
255
|
<div
|
|
292
256
|
ref={ref}
|
|
293
|
-
className={cn(
|
|
257
|
+
className={cn(sidebarGroupContentClasses(), className)}
|
|
294
258
|
{...props}
|
|
295
259
|
>
|
|
296
260
|
{children}
|
|
@@ -307,11 +271,7 @@ const SidebarList = ({
|
|
|
307
271
|
...props
|
|
308
272
|
}: SidebarListProps) => {
|
|
309
273
|
return (
|
|
310
|
-
<ul
|
|
311
|
-
ref={ref}
|
|
312
|
-
className={cn(sidebarNavListVariants(), className)}
|
|
313
|
-
{...props}
|
|
314
|
-
>
|
|
274
|
+
<ul ref={ref} className={cn(sidebarNavListClasses(), className)} {...props}>
|
|
315
275
|
{children}
|
|
316
276
|
</ul>
|
|
317
277
|
)
|
|
@@ -342,7 +302,7 @@ const SidebarItemLink = ({
|
|
|
342
302
|
...props
|
|
343
303
|
}: SidebarItemLinkProps) => {
|
|
344
304
|
const { closeOnSelect } = useSidebarMobileContext()
|
|
345
|
-
const linkClassName = cn(
|
|
305
|
+
const linkClassName = cn(sidebarNavItemClasses(active), className)
|
|
346
306
|
|
|
347
307
|
if (!closeOnSelect) {
|
|
348
308
|
return (
|
|
@@ -373,7 +333,7 @@ const SidebarItemButton = ({
|
|
|
373
333
|
...props
|
|
374
334
|
}: SidebarItemButtonProps) => {
|
|
375
335
|
const { closeOnSelect } = useSidebarMobileContext()
|
|
376
|
-
const buttonClassName = cn(
|
|
336
|
+
const buttonClassName = cn(sidebarNavItemClasses(active), className)
|
|
377
337
|
|
|
378
338
|
if (!closeOnSelect) {
|
|
379
339
|
return (
|
|
@@ -14,14 +14,9 @@ import type {
|
|
|
14
14
|
} from "react"
|
|
15
15
|
import type { ButtonProps } from "../../primitives/Button/Button.types"
|
|
16
16
|
|
|
17
|
-
export type SidebarItemVariant = ButtonProps["variant"]
|
|
18
|
-
export type SidebarItemSize = ButtonProps["size"]
|
|
19
|
-
|
|
20
17
|
export interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
21
18
|
ref?: Ref<HTMLElement>
|
|
22
19
|
className?: string
|
|
23
|
-
itemVariant?: SidebarItemVariant
|
|
24
|
-
itemSize?: SidebarItemSize
|
|
25
20
|
children?: ReactNode
|
|
26
21
|
}
|
|
27
22
|
|
|
@@ -31,8 +26,8 @@ export interface SidebarHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
31
26
|
children?: ReactNode
|
|
32
27
|
}
|
|
33
28
|
|
|
34
|
-
export interface SidebarContentProps extends HTMLAttributes<
|
|
35
|
-
ref?: Ref<
|
|
29
|
+
export interface SidebarContentProps extends HTMLAttributes<HTMLElement> {
|
|
30
|
+
ref?: Ref<HTMLElement>
|
|
36
31
|
className?: string
|
|
37
32
|
children?: ReactNode
|
|
38
33
|
}
|
|
@@ -4,81 +4,77 @@
|
|
|
4
4
|
* Variant classes for the Sidebar block.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
return "
|
|
7
|
+
export const sidebarRootClasses = (): string => {
|
|
8
|
+
return "lex-sidebar w-full shrink-0 md:h-full md:w-auto"
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const
|
|
12
|
-
return "
|
|
11
|
+
export const sidebarDesktopClasses = (): string => {
|
|
12
|
+
return "lex-sidebar__desktop hidden h-full w-[var(--lex-size-sidebar-width,16rem)] shrink-0 border-r border-[var(--lex-border-default)] bg-[var(--lex-color-background-subtle)] md:flex md:flex-col"
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const
|
|
16
|
-
return "
|
|
15
|
+
export const sidebarMobileHeaderClasses = (): string => {
|
|
16
|
+
return "lex-sidebar__mobile-header min-w-0 flex-1"
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export const
|
|
20
|
-
return "
|
|
19
|
+
export const sidebarBrandClasses = (): string => {
|
|
20
|
+
return "lex-sidebar__brand border-b border-[var(--lex-border-default)] px-[var(--lex-space-4)] py-[var(--lex-space-3)]"
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const
|
|
24
|
-
return "
|
|
23
|
+
export const sidebarNavClasses = (): string => {
|
|
24
|
+
return "lex-sidebar__nav min-h-0 flex-1 p-[var(--lex-space-2)]"
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export const
|
|
28
|
-
return "
|
|
27
|
+
export const sidebarNavListClasses = (): string => {
|
|
28
|
+
return "lex-sidebar__list m-0 flex list-none flex-col gap-[var(--lex-space-1)] p-0"
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export const
|
|
32
|
-
return "lsys-sidebar__list m-0 flex list-none flex-col gap-[var(--lsys-space-1)] p-0"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const sidebarNavItemVariants = (active?: boolean): string => {
|
|
31
|
+
export const sidebarNavItemClasses = (active?: boolean): string => {
|
|
36
32
|
const base = [
|
|
37
|
-
"
|
|
38
|
-
"flex w-full items-center rounded-(--
|
|
39
|
-
"px-(--
|
|
40
|
-
"text-(length:--
|
|
41
|
-
"leading-(--
|
|
33
|
+
"lex-sidebar__item",
|
|
34
|
+
"flex w-full items-center rounded-(--lex-menu-item-radius)",
|
|
35
|
+
"px-(--lex-menu-item-padding-x) py-(--lex-menu-item-padding-y)",
|
|
36
|
+
"text-(length:--lex-menu-item-font-size) font-(--lex-menu-item-font-weight)",
|
|
37
|
+
"leading-(--lex-menu-item-font-line-height) text-(--lex-menu-item-foreground)",
|
|
42
38
|
"no-underline outline-none transition-colors",
|
|
43
|
-
"focus-visible:ring-(length:--
|
|
44
|
-
"focus-visible:ring-offset-(length:--
|
|
39
|
+
"focus-visible:ring-(length:--lex-menu-item-focus-ring-width) focus-visible:ring-(--lex-menu-item-focus-ring-color)",
|
|
40
|
+
"focus-visible:ring-offset-(length:--lex-menu-item-focus-ring-offset) focus-visible:ring-offset-(--lex-menu-item-focus-ring-offset-color)",
|
|
45
41
|
].join(" ")
|
|
46
42
|
|
|
47
43
|
if (active) {
|
|
48
44
|
return [
|
|
49
45
|
base,
|
|
50
|
-
"
|
|
51
|
-
"bg-(--
|
|
52
|
-
"hover:bg-(--
|
|
46
|
+
"lex-sidebar__item--active",
|
|
47
|
+
"bg-(--lex-menu-item-checked-background) text-(--lex-menu-item-checked-foreground)",
|
|
48
|
+
"hover:bg-(--lex-action-primary-hover) hover:text-(--lex-menu-item-checked-foreground)",
|
|
53
49
|
].join(" ")
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
return [
|
|
57
53
|
base,
|
|
58
|
-
"hover:bg-(--
|
|
54
|
+
"hover:bg-(--lex-action-secondary-hover) hover:text-(--lex-color-text-primary)",
|
|
59
55
|
].join(" ")
|
|
60
56
|
}
|
|
61
57
|
|
|
62
|
-
export const
|
|
63
|
-
return "
|
|
58
|
+
export const sidebarMainClasses = (): string => {
|
|
59
|
+
return "lex-sidebar__drawer-content flex h-full min-h-0 flex-col"
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
export const
|
|
67
|
-
return "
|
|
62
|
+
export const sidebarDrawerFooterClasses = (): string => {
|
|
63
|
+
return "lex-sidebar__drawer-footer border-t border-[var(--lex-border-default)] p-[var(--lex-space-2)]"
|
|
68
64
|
}
|
|
69
65
|
|
|
70
|
-
export const
|
|
71
|
-
return "
|
|
66
|
+
export const sidebarFooterClasses = (): string => {
|
|
67
|
+
return "lex-sidebar__footer border-t border-[var(--lex-border-default)] p-[var(--lex-space-2)]"
|
|
72
68
|
}
|
|
73
69
|
|
|
74
|
-
export const
|
|
75
|
-
return "
|
|
70
|
+
export const sidebarGroupClasses = (): string => {
|
|
71
|
+
return "lex-sidebar__group flex flex-col gap-[var(--lex-space-1)]"
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
export const
|
|
79
|
-
return "
|
|
74
|
+
export const sidebarGroupLabelClasses = (): string => {
|
|
75
|
+
return "lex-sidebar__group-label px-[var(--lex-space-3)] py-[var(--lex-space-1)] text-(length:--lex-menu-group-label-font-size) font-(--lex-menu-group-label-font-weight) leading-(--lex-menu-group-label-font-line-height) text-(--lex-menu-group-label-foreground)"
|
|
80
76
|
}
|
|
81
77
|
|
|
82
|
-
export const
|
|
83
|
-
return "
|
|
78
|
+
export const sidebarGroupContentClasses = (): string => {
|
|
79
|
+
return "lex-sidebar__group-content flex flex-col gap-[var(--lex-space-1)]"
|
|
84
80
|
}
|