@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,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthForm.tsx
|
|
3
|
+
*
|
|
4
|
+
* Reference AuthForm block — compound Card form shell for auth screens.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { FormEvent } from "react"
|
|
8
|
+
import {
|
|
9
|
+
Card,
|
|
10
|
+
CardContent,
|
|
11
|
+
CardFooter,
|
|
12
|
+
CardHeader,
|
|
13
|
+
} from "../../primitives/Card/Card"
|
|
14
|
+
import { Button } from "../../primitives/Button/Button"
|
|
15
|
+
import type {
|
|
16
|
+
AuthFormContentProps,
|
|
17
|
+
AuthFormFooterProps,
|
|
18
|
+
AuthFormHeaderProps,
|
|
19
|
+
AuthFormProps,
|
|
20
|
+
AuthFormSubmitProps,
|
|
21
|
+
} from "./AuthForm.types"
|
|
22
|
+
import { authFormFieldsClassName, authFormVariants } from "./AuthForm.variants"
|
|
23
|
+
import { cn } from "@/lib/utils"
|
|
24
|
+
|
|
25
|
+
const AuthForm = ({
|
|
26
|
+
ref,
|
|
27
|
+
className,
|
|
28
|
+
onSubmit,
|
|
29
|
+
children,
|
|
30
|
+
...cardProps
|
|
31
|
+
}: AuthFormProps) => {
|
|
32
|
+
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
|
|
33
|
+
event.preventDefault()
|
|
34
|
+
onSubmit?.(event)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Card className={cn(authFormVariants(), className)} {...cardProps}>
|
|
39
|
+
<form ref={ref} onSubmit={handleSubmit}>
|
|
40
|
+
{children}
|
|
41
|
+
</form>
|
|
42
|
+
</Card>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
AuthForm.displayName = "AuthForm"
|
|
47
|
+
|
|
48
|
+
const AuthFormHeader = ({ ref, className, ...props }: AuthFormHeaderProps) => {
|
|
49
|
+
return <CardHeader ref={ref} className={className} {...props} />
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
AuthFormHeader.displayName = "AuthFormHeader"
|
|
53
|
+
|
|
54
|
+
const AuthFormContent = ({
|
|
55
|
+
ref,
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: AuthFormContentProps) => {
|
|
59
|
+
return (
|
|
60
|
+
<CardContent
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn(authFormFieldsClassName, className)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
AuthFormContent.displayName = "AuthFormContent"
|
|
69
|
+
|
|
70
|
+
const AuthFormFooter = ({ ref, className, ...props }: AuthFormFooterProps) => {
|
|
71
|
+
return (
|
|
72
|
+
<CardFooter
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn("flex-col gap-(--lsys-space-3)", className)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
AuthFormFooter.displayName = "AuthFormFooter"
|
|
81
|
+
|
|
82
|
+
const AuthFormSubmit = ({
|
|
83
|
+
isLoading = false,
|
|
84
|
+
disabled,
|
|
85
|
+
children = "Submit",
|
|
86
|
+
...props
|
|
87
|
+
}: AuthFormSubmitProps) => {
|
|
88
|
+
return (
|
|
89
|
+
<Button
|
|
90
|
+
type="submit"
|
|
91
|
+
className="w-full"
|
|
92
|
+
isLoading={isLoading}
|
|
93
|
+
disabled={disabled}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
{children}
|
|
97
|
+
</Button>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
AuthFormSubmit.displayName = "AuthFormSubmit"
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
AuthForm,
|
|
105
|
+
AuthFormHeader,
|
|
106
|
+
AuthFormContent,
|
|
107
|
+
AuthFormFooter,
|
|
108
|
+
AuthFormSubmit,
|
|
109
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthForm.types.ts
|
|
3
|
+
*
|
|
4
|
+
* Public types for the AuthForm block.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { FormEventHandler, ReactNode, Ref } from "react"
|
|
8
|
+
import type { CardProps } from "../../primitives/Card/Card.types"
|
|
9
|
+
import type { ButtonProps } from "../../primitives/Button/Button.types"
|
|
10
|
+
import type {
|
|
11
|
+
CardContentProps,
|
|
12
|
+
CardFooterProps,
|
|
13
|
+
CardHeaderProps,
|
|
14
|
+
} from "../../primitives/Card/Card.types"
|
|
15
|
+
|
|
16
|
+
export interface AuthFormProps extends Omit<
|
|
17
|
+
CardProps,
|
|
18
|
+
"children" | "ref" | "onSubmit"
|
|
19
|
+
> {
|
|
20
|
+
ref?: Ref<HTMLFormElement>
|
|
21
|
+
className?: CardProps["className"]
|
|
22
|
+
onSubmit?: FormEventHandler<HTMLFormElement>
|
|
23
|
+
children?: ReactNode
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type AuthFormHeaderProps = CardHeaderProps
|
|
27
|
+
|
|
28
|
+
export type AuthFormContentProps = CardContentProps
|
|
29
|
+
|
|
30
|
+
export type AuthFormFooterProps = CardFooterProps
|
|
31
|
+
|
|
32
|
+
export interface AuthFormSubmitProps extends Omit<ButtonProps, "type"> {
|
|
33
|
+
isLoading?: boolean
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthForm.variants.ts
|
|
3
|
+
*
|
|
4
|
+
* Variant classes for the AuthForm block.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const authFormVariants = (): string => {
|
|
8
|
+
return "lsys-auth-form w-full text-(--lsys-color-text-primary)"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const authFormFieldsClassName = "flex flex-col gap-(--lsys-space-4)"
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommandPalette.tsx
|
|
3
|
+
*
|
|
4
|
+
* Reference CommandPalette block — compound Dialog command surface.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogBackdrop,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogPopup,
|
|
12
|
+
DialogPortal,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
DialogViewport,
|
|
15
|
+
} from "../../primitives/Dialog/Dialog"
|
|
16
|
+
import { Input } from "../../primitives/Input/Input"
|
|
17
|
+
import { Separator } from "../../primitives/Separator/Separator"
|
|
18
|
+
import {
|
|
19
|
+
ScrollArea,
|
|
20
|
+
ScrollAreaContent,
|
|
21
|
+
ScrollAreaViewport,
|
|
22
|
+
} from "../../primitives/ScrollArea/ScrollArea"
|
|
23
|
+
import type {
|
|
24
|
+
CommandPaletteContentProps,
|
|
25
|
+
CommandPaletteDescriptionProps,
|
|
26
|
+
CommandPaletteEmptyProps,
|
|
27
|
+
CommandPaletteGroupLabelProps,
|
|
28
|
+
CommandPaletteGroupProps,
|
|
29
|
+
CommandPaletteInputProps,
|
|
30
|
+
CommandPaletteItemProps,
|
|
31
|
+
CommandPaletteListProps,
|
|
32
|
+
CommandPaletteProps,
|
|
33
|
+
CommandPaletteTitleProps,
|
|
34
|
+
} from "./CommandPalette.types"
|
|
35
|
+
import {
|
|
36
|
+
commandPaletteEmptyClassName,
|
|
37
|
+
commandPaletteGroupLabelClassName,
|
|
38
|
+
commandPaletteInputClassName,
|
|
39
|
+
commandPaletteItemClassName,
|
|
40
|
+
commandPaletteItemDescriptionClassName,
|
|
41
|
+
commandPaletteListClassName,
|
|
42
|
+
commandPaletteRootVariants,
|
|
43
|
+
} from "./CommandPalette.variants"
|
|
44
|
+
import { cn } from "@/lib/utils"
|
|
45
|
+
|
|
46
|
+
const CommandPalette = ({ children, ...props }: CommandPaletteProps) => {
|
|
47
|
+
return <Dialog {...props}>{children}</Dialog>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
CommandPalette.displayName = "CommandPalette"
|
|
51
|
+
|
|
52
|
+
const CommandPaletteContent = ({
|
|
53
|
+
ref,
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}: CommandPaletteContentProps) => {
|
|
58
|
+
return (
|
|
59
|
+
<DialogPortal>
|
|
60
|
+
<DialogBackdrop />
|
|
61
|
+
<DialogViewport>
|
|
62
|
+
<DialogPopup
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(commandPaletteRootVariants(), className)}
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
</DialogPopup>
|
|
69
|
+
</DialogViewport>
|
|
70
|
+
</DialogPortal>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
CommandPaletteContent.displayName = "CommandPaletteContent"
|
|
75
|
+
|
|
76
|
+
const CommandPaletteTitle = ({
|
|
77
|
+
ref,
|
|
78
|
+
className,
|
|
79
|
+
children,
|
|
80
|
+
...props
|
|
81
|
+
}: CommandPaletteTitleProps) => {
|
|
82
|
+
return (
|
|
83
|
+
<DialogTitle ref={ref} className={className} {...props}>
|
|
84
|
+
{children}
|
|
85
|
+
</DialogTitle>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
CommandPaletteTitle.displayName = "CommandPaletteTitle"
|
|
90
|
+
|
|
91
|
+
const CommandPaletteDescription = ({
|
|
92
|
+
ref,
|
|
93
|
+
className,
|
|
94
|
+
children,
|
|
95
|
+
...props
|
|
96
|
+
}: CommandPaletteDescriptionProps) => {
|
|
97
|
+
return (
|
|
98
|
+
<DialogDescription
|
|
99
|
+
ref={ref}
|
|
100
|
+
className={cn("sr-only", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
>
|
|
103
|
+
{children}
|
|
104
|
+
</DialogDescription>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
CommandPaletteDescription.displayName = "CommandPaletteDescription"
|
|
109
|
+
|
|
110
|
+
const CommandPaletteInput = ({
|
|
111
|
+
ref,
|
|
112
|
+
className,
|
|
113
|
+
...props
|
|
114
|
+
}: CommandPaletteInputProps) => {
|
|
115
|
+
return (
|
|
116
|
+
<Input
|
|
117
|
+
ref={ref}
|
|
118
|
+
autoFocus
|
|
119
|
+
className={cn(commandPaletteInputClassName, className)}
|
|
120
|
+
aria-label="Search commands"
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
CommandPaletteInput.displayName = "CommandPaletteInput"
|
|
127
|
+
|
|
128
|
+
const CommandPaletteSeparator = () => {
|
|
129
|
+
return <Separator />
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
CommandPaletteSeparator.displayName = "CommandPaletteSeparator"
|
|
133
|
+
|
|
134
|
+
const CommandPaletteList = ({
|
|
135
|
+
ref,
|
|
136
|
+
className,
|
|
137
|
+
children,
|
|
138
|
+
...props
|
|
139
|
+
}: CommandPaletteListProps) => {
|
|
140
|
+
return (
|
|
141
|
+
<ScrollArea className={cn(commandPaletteListClassName, className)}>
|
|
142
|
+
<ScrollAreaViewport>
|
|
143
|
+
<ScrollAreaContent ref={ref} {...props}>
|
|
144
|
+
{children}
|
|
145
|
+
</ScrollAreaContent>
|
|
146
|
+
</ScrollAreaViewport>
|
|
147
|
+
</ScrollArea>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
CommandPaletteList.displayName = "CommandPaletteList"
|
|
152
|
+
|
|
153
|
+
const CommandPaletteGroup = ({
|
|
154
|
+
ref,
|
|
155
|
+
className,
|
|
156
|
+
children,
|
|
157
|
+
...props
|
|
158
|
+
}: CommandPaletteGroupProps) => {
|
|
159
|
+
return (
|
|
160
|
+
<section ref={ref} className={className} {...props}>
|
|
161
|
+
{children}
|
|
162
|
+
</section>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
CommandPaletteGroup.displayName = "CommandPaletteGroup"
|
|
167
|
+
|
|
168
|
+
const CommandPaletteGroupLabel = ({
|
|
169
|
+
ref,
|
|
170
|
+
className,
|
|
171
|
+
children,
|
|
172
|
+
...props
|
|
173
|
+
}: CommandPaletteGroupLabelProps) => {
|
|
174
|
+
return (
|
|
175
|
+
<h3
|
|
176
|
+
ref={ref}
|
|
177
|
+
className={cn(commandPaletteGroupLabelClassName, className)}
|
|
178
|
+
{...props}
|
|
179
|
+
>
|
|
180
|
+
{children}
|
|
181
|
+
</h3>
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
CommandPaletteGroupLabel.displayName = "CommandPaletteGroupLabel"
|
|
186
|
+
|
|
187
|
+
const CommandPaletteItem = ({
|
|
188
|
+
ref,
|
|
189
|
+
description,
|
|
190
|
+
className,
|
|
191
|
+
children,
|
|
192
|
+
type = "button",
|
|
193
|
+
...props
|
|
194
|
+
}: CommandPaletteItemProps) => {
|
|
195
|
+
return (
|
|
196
|
+
<button
|
|
197
|
+
ref={ref}
|
|
198
|
+
type={type}
|
|
199
|
+
className={cn(commandPaletteItemClassName, className)}
|
|
200
|
+
{...props}
|
|
201
|
+
>
|
|
202
|
+
<span>{children}</span>
|
|
203
|
+
{description ? (
|
|
204
|
+
<span className={commandPaletteItemDescriptionClassName}>
|
|
205
|
+
{description}
|
|
206
|
+
</span>
|
|
207
|
+
) : null}
|
|
208
|
+
</button>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
CommandPaletteItem.displayName = "CommandPaletteItem"
|
|
213
|
+
|
|
214
|
+
const CommandPaletteEmpty = ({
|
|
215
|
+
ref,
|
|
216
|
+
className,
|
|
217
|
+
children = "No commands found.",
|
|
218
|
+
...props
|
|
219
|
+
}: CommandPaletteEmptyProps) => {
|
|
220
|
+
return (
|
|
221
|
+
<p
|
|
222
|
+
ref={ref}
|
|
223
|
+
className={cn(commandPaletteEmptyClassName, className)}
|
|
224
|
+
{...props}
|
|
225
|
+
>
|
|
226
|
+
{children}
|
|
227
|
+
</p>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
CommandPaletteEmpty.displayName = "CommandPaletteEmpty"
|
|
232
|
+
|
|
233
|
+
export {
|
|
234
|
+
CommandPalette,
|
|
235
|
+
CommandPaletteContent,
|
|
236
|
+
CommandPaletteTitle,
|
|
237
|
+
CommandPaletteDescription,
|
|
238
|
+
CommandPaletteInput,
|
|
239
|
+
CommandPaletteSeparator,
|
|
240
|
+
CommandPaletteList,
|
|
241
|
+
CommandPaletteGroup,
|
|
242
|
+
CommandPaletteGroupLabel,
|
|
243
|
+
CommandPaletteItem,
|
|
244
|
+
CommandPaletteEmpty,
|
|
245
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommandPalette.types.ts
|
|
3
|
+
*
|
|
4
|
+
* Public types for the CommandPalette block.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
ButtonHTMLAttributes,
|
|
9
|
+
HTMLAttributes,
|
|
10
|
+
ReactNode,
|
|
11
|
+
Ref,
|
|
12
|
+
} from "react"
|
|
13
|
+
import type { DialogProps } from "../../primitives/Dialog/Dialog.types"
|
|
14
|
+
import type { InputProps } from "../../primitives/Input/Input.types"
|
|
15
|
+
|
|
16
|
+
export interface CommandPaletteProps extends DialogProps {
|
|
17
|
+
children?: ReactNode
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CommandPaletteContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
ref?: Ref<HTMLDivElement>
|
|
22
|
+
className?: string
|
|
23
|
+
children?: ReactNode
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CommandPaletteInputProps extends InputProps {
|
|
27
|
+
ref?: Ref<HTMLInputElement>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type CommandPaletteSeparatorProps = Record<string, never>
|
|
31
|
+
|
|
32
|
+
export interface CommandPaletteListProps extends HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
ref?: Ref<HTMLDivElement>
|
|
34
|
+
className?: string
|
|
35
|
+
children?: ReactNode
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CommandPaletteGroupProps extends HTMLAttributes<HTMLElement> {
|
|
39
|
+
ref?: Ref<HTMLElement>
|
|
40
|
+
className?: string
|
|
41
|
+
children?: ReactNode
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface CommandPaletteGroupLabelProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
45
|
+
ref?: Ref<HTMLHeadingElement>
|
|
46
|
+
className?: string
|
|
47
|
+
children?: ReactNode
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CommandPaletteItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
51
|
+
ref?: Ref<HTMLButtonElement>
|
|
52
|
+
description?: ReactNode
|
|
53
|
+
className?: string
|
|
54
|
+
children?: ReactNode
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface CommandPaletteEmptyProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
58
|
+
ref?: Ref<HTMLParagraphElement>
|
|
59
|
+
className?: string
|
|
60
|
+
children?: ReactNode
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface CommandPaletteTitleProps {
|
|
64
|
+
ref?: Ref<HTMLHeadingElement>
|
|
65
|
+
className?: string
|
|
66
|
+
children?: ReactNode
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CommandPaletteDescriptionProps {
|
|
70
|
+
ref?: Ref<HTMLParagraphElement>
|
|
71
|
+
className?: string
|
|
72
|
+
children?: ReactNode
|
|
73
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommandPalette.variants.ts
|
|
3
|
+
*
|
|
4
|
+
* Variant classes for the CommandPalette block.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const commandPaletteRootVariants = (): string => {
|
|
8
|
+
return "lsys-command-palette flex flex-col gap-(--lsys-space-2)"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const commandPaletteInputClassName = "w-full"
|
|
12
|
+
|
|
13
|
+
export const commandPaletteListClassName =
|
|
14
|
+
"flex max-h-(--lsys-size-command-palette-list-max-height,16rem) flex-col"
|
|
15
|
+
|
|
16
|
+
export const commandPaletteGroupLabelClassName =
|
|
17
|
+
"px-(--lsys-space-3) py-(--lsys-space-1) text-(length:--lsys-typography-label-xs-font-size) font-(--lsys-typography-label-xs-font-weight) text-(--lsys-color-text-secondary)"
|
|
18
|
+
|
|
19
|
+
export const commandPaletteItemClassName =
|
|
20
|
+
"flex w-full flex-col items-start gap-(--lsys-space-1) rounded-(--lsys-radius-control) px-(--lsys-space-3) py-(--lsys-space-2) text-left text-(--lsys-color-text-primary) outline-none transition-colors hover:bg-(--lsys-action-secondary-hover) focus-visible:bg-(--lsys-action-secondary-hover)"
|
|
21
|
+
|
|
22
|
+
export const commandPaletteItemDescriptionClassName =
|
|
23
|
+
"text-(length:--lsys-typography-body-xs-font-size) text-(--lsys-color-text-secondary)"
|
|
24
|
+
|
|
25
|
+
export const commandPaletteEmptyClassName =
|
|
26
|
+
"px-(--lsys-space-3) py-(--lsys-space-4) text-(length:--lsys-typography-body-sm-font-size) text-(--lsys-color-text-secondary)"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormField.tsx
|
|
3
|
+
*
|
|
4
|
+
* Reference FormField block — compound re-export of Field primitives with block styling.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Field,
|
|
9
|
+
FieldControl,
|
|
10
|
+
FieldDescription,
|
|
11
|
+
FieldError,
|
|
12
|
+
FieldItem,
|
|
13
|
+
FieldLabel,
|
|
14
|
+
} from "../../primitives/Field/Field"
|
|
15
|
+
import type {
|
|
16
|
+
FormFieldControlProps,
|
|
17
|
+
FormFieldDescriptionProps,
|
|
18
|
+
FormFieldErrorProps,
|
|
19
|
+
FormFieldItemProps,
|
|
20
|
+
FormFieldLabelProps,
|
|
21
|
+
FormFieldProps,
|
|
22
|
+
} from "./FormField.types"
|
|
23
|
+
import { formFieldVariants } from "./FormField.variants"
|
|
24
|
+
import { cn } from "@/lib/utils"
|
|
25
|
+
|
|
26
|
+
const FormField = ({ ref, className, ...props }: FormFieldProps) => {
|
|
27
|
+
return (
|
|
28
|
+
<Field
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(formFieldVariants(), className)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
FormField.displayName = "FormField"
|
|
37
|
+
|
|
38
|
+
const FormFieldItem = ({ ref, className, ...props }: FormFieldItemProps) => {
|
|
39
|
+
return <FieldItem ref={ref} className={className} {...props} />
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
FormFieldItem.displayName = "FormFieldItem"
|
|
43
|
+
|
|
44
|
+
const FormFieldLabel = ({ ref, className, ...props }: FormFieldLabelProps) => {
|
|
45
|
+
return <FieldLabel ref={ref} className={className} {...props} />
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
FormFieldLabel.displayName = "FormFieldLabel"
|
|
49
|
+
|
|
50
|
+
const FormFieldControl = ({
|
|
51
|
+
ref,
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}: FormFieldControlProps) => {
|
|
55
|
+
return <FieldControl ref={ref} className={className} {...props} />
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
FormFieldControl.displayName = "FormFieldControl"
|
|
59
|
+
|
|
60
|
+
const FormFieldDescription = ({
|
|
61
|
+
ref,
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}: FormFieldDescriptionProps) => {
|
|
65
|
+
return <FieldDescription ref={ref} className={className} {...props} />
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
FormFieldDescription.displayName = "FormFieldDescription"
|
|
69
|
+
|
|
70
|
+
const FormFieldError = ({ ref, className, ...props }: FormFieldErrorProps) => {
|
|
71
|
+
return <FieldError ref={ref} className={className} {...props} />
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
FormFieldError.displayName = "FormFieldError"
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
FormField,
|
|
78
|
+
FormFieldItem,
|
|
79
|
+
FormFieldLabel,
|
|
80
|
+
FormFieldControl,
|
|
81
|
+
FormFieldDescription,
|
|
82
|
+
FormFieldError,
|
|
83
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormField.types.ts
|
|
3
|
+
*
|
|
4
|
+
* Public types for the FormField block.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
FieldControlProps,
|
|
9
|
+
FieldDescriptionProps,
|
|
10
|
+
FieldErrorProps,
|
|
11
|
+
FieldItemProps,
|
|
12
|
+
FieldLabelProps,
|
|
13
|
+
FieldProps,
|
|
14
|
+
} from "../../primitives/Field/Field.types"
|
|
15
|
+
|
|
16
|
+
export type FormFieldProps = FieldProps
|
|
17
|
+
|
|
18
|
+
export type FormFieldItemProps = FieldItemProps
|
|
19
|
+
|
|
20
|
+
export type FormFieldLabelProps = FieldLabelProps
|
|
21
|
+
|
|
22
|
+
export type FormFieldControlProps = FieldControlProps
|
|
23
|
+
|
|
24
|
+
export type FormFieldDescriptionProps = FieldDescriptionProps
|
|
25
|
+
|
|
26
|
+
export type FormFieldErrorProps = FieldErrorProps
|