@soave/ui 0.1.0
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/dist/build.config.d.ts +2 -0
- package/dist/build.config.mjs +14 -0
- package/dist/components/ui/Alert.vue +39 -0
- package/dist/components/ui/AlertDescription.vue +12 -0
- package/dist/components/ui/AlertTitle.vue +12 -0
- package/dist/components/ui/Button.vue +59 -0
- package/dist/components/ui/Card.vue +15 -0
- package/dist/components/ui/CardContent.vue +12 -0
- package/dist/components/ui/CardDescription.vue +12 -0
- package/dist/components/ui/CardFooter.vue +12 -0
- package/dist/components/ui/CardHeader.vue +12 -0
- package/dist/components/ui/CardTitle.vue +12 -0
- package/dist/components/ui/Checkbox.vue +73 -0
- package/dist/components/ui/Dialog.vue +93 -0
- package/dist/components/ui/DialogDescription.vue +12 -0
- package/dist/components/ui/DialogFooter.vue +12 -0
- package/dist/components/ui/DialogHeader.vue +12 -0
- package/dist/components/ui/DialogTitle.vue +12 -0
- package/dist/components/ui/DropdownMenu.vue +33 -0
- package/dist/components/ui/DropdownMenuContent.vue +66 -0
- package/dist/components/ui/DropdownMenuItem.vue +77 -0
- package/dist/components/ui/DropdownMenuLabel.vue +20 -0
- package/dist/components/ui/DropdownMenuSeparator.vue +16 -0
- package/dist/components/ui/DropdownMenuTrigger.vue +38 -0
- package/dist/components/ui/FileInput.vue +153 -0
- package/dist/components/ui/FormError.vue +20 -0
- package/dist/components/ui/FormField.vue +12 -0
- package/dist/components/ui/FormInput.vue +46 -0
- package/dist/components/ui/FormLabel.vue +19 -0
- package/dist/components/ui/FormTextarea.vue +39 -0
- package/dist/components/ui/Input.vue +49 -0
- package/dist/components/ui/Popover.vue +36 -0
- package/dist/components/ui/PopoverContent.vue +62 -0
- package/dist/components/ui/PopoverTrigger.vue +36 -0
- package/dist/components/ui/RadioGroup.vue +42 -0
- package/dist/components/ui/RadioItem.vue +41 -0
- package/dist/components/ui/Select.vue +55 -0
- package/dist/components/ui/SelectContent.vue +29 -0
- package/dist/components/ui/SelectItem.vue +51 -0
- package/dist/components/ui/SelectTrigger.vue +38 -0
- package/dist/components/ui/SelectValue.vue +16 -0
- package/dist/components/ui/Sheet.vue +140 -0
- package/dist/components/ui/SheetDescription.vue +15 -0
- package/dist/components/ui/SheetFooter.vue +15 -0
- package/dist/components/ui/SheetHeader.vue +15 -0
- package/dist/components/ui/SheetTitle.vue +15 -0
- package/dist/components/ui/Switch.vue +43 -0
- package/dist/components/ui/Textarea.vue +50 -0
- package/dist/components/ui/Toast.vue +107 -0
- package/dist/components/ui/Toaster.vue +80 -0
- package/dist/components/ui/Tooltip.vue +42 -0
- package/dist/components/ui/TooltipContent.vue +68 -0
- package/dist/components/ui/TooltipTrigger.vue +39 -0
- package/dist/components/ui/UIProvider.vue +19 -0
- package/dist/components/ui/index.d.ts +52 -0
- package/dist/components/ui/index.mjs +52 -0
- package/dist/composables/index.d.ts +17 -0
- package/dist/composables/index.mjs +17 -0
- package/dist/composables/useButton.d.ts +8 -0
- package/dist/composables/useButton.mjs +49 -0
- package/dist/composables/useCard.d.ts +8 -0
- package/dist/composables/useCard.mjs +24 -0
- package/dist/composables/useCheckbox.d.ts +7 -0
- package/dist/composables/useCheckbox.mjs +51 -0
- package/dist/composables/useDialog.d.ts +6 -0
- package/dist/composables/useDialog.mjs +19 -0
- package/dist/composables/useDropdown.d.ts +24 -0
- package/dist/composables/useDropdown.mjs +170 -0
- package/dist/composables/useFileInput.d.ts +6 -0
- package/dist/composables/useFileInput.mjs +152 -0
- package/dist/composables/useForm.d.ts +7 -0
- package/dist/composables/useForm.mjs +159 -0
- package/dist/composables/useInput.d.ts +8 -0
- package/dist/composables/useInput.mjs +52 -0
- package/dist/composables/usePopover.d.ts +20 -0
- package/dist/composables/usePopover.mjs +113 -0
- package/dist/composables/useRadio.d.ts +7 -0
- package/dist/composables/useRadio.mjs +55 -0
- package/dist/composables/useSelect.d.ts +17 -0
- package/dist/composables/useSelect.mjs +71 -0
- package/dist/composables/useSwitch.d.ts +7 -0
- package/dist/composables/useSwitch.mjs +50 -0
- package/dist/composables/useTextarea.d.ts +7 -0
- package/dist/composables/useTextarea.mjs +50 -0
- package/dist/composables/useTheme.d.ts +15 -0
- package/dist/composables/useTheme.mjs +89 -0
- package/dist/composables/useToast.d.ts +11 -0
- package/dist/composables/useToast.mjs +64 -0
- package/dist/composables/useTooltip.d.ts +23 -0
- package/dist/composables/useTooltip.mjs +125 -0
- package/dist/composables/useUIConfig.d.ts +28 -0
- package/dist/composables/useUIConfig.mjs +36 -0
- package/dist/constants/errors.d.ts +22 -0
- package/dist/constants/errors.mjs +18 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.mjs +2 -0
- package/dist/constants/logs.d.ts +17 -0
- package/dist/constants/logs.mjs +17 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +5 -0
- package/dist/types/alert.d.ts +15 -0
- package/dist/types/alert.mjs +0 -0
- package/dist/types/button.d.ts +20 -0
- package/dist/types/button.mjs +0 -0
- package/dist/types/card.d.ts +23 -0
- package/dist/types/card.mjs +0 -0
- package/dist/types/checkbox.d.ts +19 -0
- package/dist/types/checkbox.mjs +0 -0
- package/dist/types/config.d.ts +30 -0
- package/dist/types/config.mjs +15 -0
- package/dist/types/dialog.d.ts +29 -0
- package/dist/types/dialog.mjs +0 -0
- package/dist/types/dropdown.d.ts +27 -0
- package/dist/types/dropdown.mjs +0 -0
- package/dist/types/file-input.d.ts +35 -0
- package/dist/types/file-input.mjs +0 -0
- package/dist/types/form.d.ts +70 -0
- package/dist/types/form.mjs +0 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.mjs +20 -0
- package/dist/types/input.d.ts +27 -0
- package/dist/types/input.mjs +0 -0
- package/dist/types/popover.d.ts +15 -0
- package/dist/types/popover.mjs +0 -0
- package/dist/types/radio.d.ts +29 -0
- package/dist/types/radio.mjs +1 -0
- package/dist/types/select.d.ts +36 -0
- package/dist/types/select.mjs +1 -0
- package/dist/types/sheet.d.ts +11 -0
- package/dist/types/sheet.mjs +0 -0
- package/dist/types/switch.d.ts +17 -0
- package/dist/types/switch.mjs +0 -0
- package/dist/types/textarea.d.ts +25 -0
- package/dist/types/textarea.mjs +0 -0
- package/dist/types/theme.d.ts +43 -0
- package/dist/types/theme.mjs +42 -0
- package/dist/types/toast.d.ts +38 -0
- package/dist/types/toast.mjs +0 -0
- package/dist/types/tooltip.d.ts +25 -0
- package/dist/types/tooltip.mjs +0 -0
- package/dist/types/utils.d.ts +12 -0
- package/dist/types/utils.mjs +0 -0
- package/dist/utils/cn.d.ts +6 -0
- package/dist/utils/cn.mjs +5 -0
- package/dist/utils/deepMerge.d.ts +6 -0
- package/dist/utils/deepMerge.mjs +18 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.mjs +2 -0
- package/package.json +53 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComputedRef } from "vue";
|
|
2
|
+
export type CardPadding = "sm" | "md" | "lg" | "none";
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
padding?: CardPadding;
|
|
5
|
+
}
|
|
6
|
+
export interface CardReturn {
|
|
7
|
+
base_classes: ComputedRef<string>;
|
|
8
|
+
}
|
|
9
|
+
export interface CardHeaderProps {
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CardTitleProps {
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CardDescriptionProps {
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CardContentProps {
|
|
19
|
+
class?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CardFooterProps {
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComputedRef } from "vue";
|
|
2
|
+
export type CheckboxSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
size?: CheckboxSize;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckboxAriaAttributes {
|
|
9
|
+
role: "checkbox";
|
|
10
|
+
"aria-checked": boolean | "mixed";
|
|
11
|
+
"aria-disabled"?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface CheckboxReturn {
|
|
14
|
+
base_classes: ComputedRef<string>;
|
|
15
|
+
indicator_classes: ComputedRef<string>;
|
|
16
|
+
is_disabled: ComputedRef<boolean>;
|
|
17
|
+
is_indeterminate: ComputedRef<boolean>;
|
|
18
|
+
aria_attributes: ComputedRef<CheckboxAriaAttributes>;
|
|
19
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ButtonVariant, ButtonSize } from "./button";
|
|
2
|
+
import type { InputSize } from "./input";
|
|
3
|
+
import type { CardPadding } from "./card";
|
|
4
|
+
import type { AlertVariant } from "./alert";
|
|
5
|
+
/**
|
|
6
|
+
* UIコンポーネントのグローバル設定
|
|
7
|
+
*/
|
|
8
|
+
export interface UIConfig {
|
|
9
|
+
button: ButtonConfig;
|
|
10
|
+
input: InputConfig;
|
|
11
|
+
card: CardConfig;
|
|
12
|
+
alert: AlertConfig;
|
|
13
|
+
}
|
|
14
|
+
export interface ButtonConfig {
|
|
15
|
+
default_variant: ButtonVariant;
|
|
16
|
+
default_size: ButtonSize;
|
|
17
|
+
}
|
|
18
|
+
export interface InputConfig {
|
|
19
|
+
default_size: InputSize;
|
|
20
|
+
}
|
|
21
|
+
export interface CardConfig {
|
|
22
|
+
default_padding: CardPadding;
|
|
23
|
+
}
|
|
24
|
+
export interface AlertConfig {
|
|
25
|
+
default_variant: AlertVariant;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* デフォルト設定
|
|
29
|
+
*/
|
|
30
|
+
export declare const DEFAULT_UI_CONFIG: UIConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Ref, DeepReadonly } from "vue";
|
|
2
|
+
export interface DialogProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
modal?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface DialogReturn {
|
|
7
|
+
is_open: DeepReadonly<Ref<boolean>>;
|
|
8
|
+
open: () => void;
|
|
9
|
+
close: () => void;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface DialogContentProps {
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface DialogHeaderProps {
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DialogTitleProps {
|
|
19
|
+
class?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DialogDescriptionProps {
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DialogFooterProps {
|
|
25
|
+
class?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface DialogTriggerProps {
|
|
28
|
+
as_child?: boolean;
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type DropdownSide = "top" | "right" | "bottom" | "left";
|
|
2
|
+
export type DropdownAlign = "start" | "center" | "end";
|
|
3
|
+
export interface DropdownProps {
|
|
4
|
+
side?: DropdownSide;
|
|
5
|
+
align?: DropdownAlign;
|
|
6
|
+
}
|
|
7
|
+
export interface DropdownItemProps {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
destructive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface DropdownContext {
|
|
12
|
+
is_open: boolean;
|
|
13
|
+
dropdown_id: string;
|
|
14
|
+
active_item_index: number;
|
|
15
|
+
items_count: number;
|
|
16
|
+
trigger_ref: HTMLElement | null;
|
|
17
|
+
open: () => void;
|
|
18
|
+
close: () => void;
|
|
19
|
+
toggle: () => void;
|
|
20
|
+
registerItem: () => number;
|
|
21
|
+
setActiveItem: (index: number) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface DropdownItemContext {
|
|
24
|
+
index: number;
|
|
25
|
+
is_active: boolean;
|
|
26
|
+
is_disabled: boolean;
|
|
27
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
export interface FileInputProps {
|
|
3
|
+
accept?: string;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
max_size?: number;
|
|
7
|
+
max_files?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface FileInfo {
|
|
10
|
+
file: File;
|
|
11
|
+
name: string;
|
|
12
|
+
size: number;
|
|
13
|
+
type: string;
|
|
14
|
+
preview_url: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface FileInputAriaAttributes {
|
|
17
|
+
"aria-disabled"?: boolean;
|
|
18
|
+
"aria-invalid"?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface FileInputReturn {
|
|
21
|
+
base_classes: ComputedRef<string>;
|
|
22
|
+
dropzone_classes: ComputedRef<string>;
|
|
23
|
+
is_disabled: ComputedRef<boolean>;
|
|
24
|
+
is_dragging: Ref<boolean>;
|
|
25
|
+
files: Ref<FileInfo[]>;
|
|
26
|
+
error: Ref<string | null>;
|
|
27
|
+
aria_attributes: ComputedRef<FileInputAriaAttributes>;
|
|
28
|
+
handleFiles: (file_list: FileList | null) => void;
|
|
29
|
+
handleDragEnter: (event: DragEvent) => void;
|
|
30
|
+
handleDragLeave: (event: DragEvent) => void;
|
|
31
|
+
handleDrop: (event: DragEvent) => void;
|
|
32
|
+
removeFile: (index: number) => void;
|
|
33
|
+
clearFiles: () => void;
|
|
34
|
+
openFilePicker: () => void;
|
|
35
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ComputedRef, DeepReadonly } from "vue";
|
|
2
|
+
export interface FormState<T> {
|
|
3
|
+
values: T;
|
|
4
|
+
errors: Partial<Record<keyof T, string>>;
|
|
5
|
+
touched: Partial<Record<keyof T, boolean>>;
|
|
6
|
+
is_submitting: boolean;
|
|
7
|
+
is_dirty: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 配列フィールド操作のためのヘルパー型
|
|
11
|
+
*/
|
|
12
|
+
export interface FieldArrayHelpers<TItem> {
|
|
13
|
+
fields: TItem[];
|
|
14
|
+
append: (value: TItem) => void;
|
|
15
|
+
prepend: (value: TItem) => void;
|
|
16
|
+
insert: (index: number, value: TItem) => void;
|
|
17
|
+
remove: (index: number) => void;
|
|
18
|
+
move: (from_index: number, to_index: number) => void;
|
|
19
|
+
swap: (index_a: number, index_b: number) => void;
|
|
20
|
+
replace: (index: number, value: TItem) => void;
|
|
21
|
+
clear: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ファイルアップロード用の型
|
|
25
|
+
*/
|
|
26
|
+
export interface FileFieldValue {
|
|
27
|
+
file: File | null;
|
|
28
|
+
preview_url: string | null;
|
|
29
|
+
is_uploading: boolean;
|
|
30
|
+
progress: number;
|
|
31
|
+
error: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface FileFieldOptions {
|
|
34
|
+
accept?: string;
|
|
35
|
+
max_size?: number;
|
|
36
|
+
on_upload?: (file: File) => Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
export interface FormReturn<T> {
|
|
39
|
+
values: T;
|
|
40
|
+
errors: DeepReadonly<Partial<Record<keyof T, string>>>;
|
|
41
|
+
touched: DeepReadonly<Partial<Record<keyof T, boolean>>>;
|
|
42
|
+
is_valid: ComputedRef<boolean>;
|
|
43
|
+
is_submitting: DeepReadonly<ComputedRef<boolean>>;
|
|
44
|
+
is_dirty: DeepReadonly<ComputedRef<boolean>>;
|
|
45
|
+
validateField: (field: keyof T) => void;
|
|
46
|
+
validateAll: () => boolean;
|
|
47
|
+
reset: () => void;
|
|
48
|
+
setValues: (values: Partial<T>) => void;
|
|
49
|
+
setFieldValue: (field: keyof T, value: T[keyof T]) => void;
|
|
50
|
+
submit: (on_submit: (data: T) => Promise<void>) => Promise<void>;
|
|
51
|
+
getFieldArray: <K extends keyof T>(field: K) => T[K] extends Array<infer U> ? FieldArrayHelpers<U> : never;
|
|
52
|
+
}
|
|
53
|
+
export interface FormFieldProps {
|
|
54
|
+
name?: string;
|
|
55
|
+
class?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface FormLabelProps {
|
|
58
|
+
for?: string;
|
|
59
|
+
class?: string;
|
|
60
|
+
required?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface FormInputProps {
|
|
63
|
+
id?: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
error?: string;
|
|
66
|
+
class?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface FormErrorProps {
|
|
69
|
+
class?: string;
|
|
70
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./utils";
|
|
2
|
+
export * from "./button";
|
|
3
|
+
export * from "./input";
|
|
4
|
+
export * from "./card";
|
|
5
|
+
export * from "./dialog";
|
|
6
|
+
export * from "./form";
|
|
7
|
+
export * from "./alert";
|
|
8
|
+
export * from "./config";
|
|
9
|
+
export * from "./checkbox";
|
|
10
|
+
export * from "./radio";
|
|
11
|
+
export * from "./switch";
|
|
12
|
+
export * from "./textarea";
|
|
13
|
+
export * from "./select";
|
|
14
|
+
export * from "./file-input";
|
|
15
|
+
export * from "./toast";
|
|
16
|
+
export * from "./tooltip";
|
|
17
|
+
export * from "./popover";
|
|
18
|
+
export * from "./dropdown";
|
|
19
|
+
export * from "./sheet";
|
|
20
|
+
export * from "./theme";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./utils.mjs";
|
|
2
|
+
export * from "./button.mjs";
|
|
3
|
+
export * from "./input.mjs";
|
|
4
|
+
export * from "./card.mjs";
|
|
5
|
+
export * from "./dialog.mjs";
|
|
6
|
+
export * from "./form.mjs";
|
|
7
|
+
export * from "./alert.mjs";
|
|
8
|
+
export * from "./config.mjs";
|
|
9
|
+
export * from "./checkbox.mjs";
|
|
10
|
+
export * from "./radio.mjs";
|
|
11
|
+
export * from "./switch.mjs";
|
|
12
|
+
export * from "./textarea.mjs";
|
|
13
|
+
export * from "./select.mjs";
|
|
14
|
+
export * from "./file-input.mjs";
|
|
15
|
+
export * from "./toast.mjs";
|
|
16
|
+
export * from "./tooltip.mjs";
|
|
17
|
+
export * from "./popover.mjs";
|
|
18
|
+
export * from "./dropdown.mjs";
|
|
19
|
+
export * from "./sheet.mjs";
|
|
20
|
+
export * from "./theme.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
export type InputSize = "sm" | "md" | "lg";
|
|
3
|
+
export type InputType = "text" | "email" | "password" | "number" | "tel" | "url" | "search";
|
|
4
|
+
export interface InputProps {
|
|
5
|
+
type?: InputType;
|
|
6
|
+
size?: InputSize;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
error_id?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface InputAriaAttributes {
|
|
14
|
+
"aria-invalid"?: boolean;
|
|
15
|
+
"aria-describedby"?: string;
|
|
16
|
+
"aria-readonly"?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface InputReturn {
|
|
19
|
+
base_classes: ComputedRef<string>;
|
|
20
|
+
is_focused: Ref<boolean>;
|
|
21
|
+
has_error: ComputedRef<boolean>;
|
|
22
|
+
is_disabled: ComputedRef<boolean>;
|
|
23
|
+
is_readonly: ComputedRef<boolean>;
|
|
24
|
+
aria_attributes: ComputedRef<InputAriaAttributes>;
|
|
25
|
+
handleFocus: () => void;
|
|
26
|
+
handleBlur: () => void;
|
|
27
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type PopoverSide = "top" | "right" | "bottom" | "left";
|
|
2
|
+
export type PopoverAlign = "start" | "center" | "end";
|
|
3
|
+
export interface PopoverProps {
|
|
4
|
+
side?: PopoverSide;
|
|
5
|
+
align?: PopoverAlign;
|
|
6
|
+
modal?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PopoverContext {
|
|
9
|
+
is_open: boolean;
|
|
10
|
+
popover_id: string;
|
|
11
|
+
trigger_ref: HTMLElement | null;
|
|
12
|
+
open: () => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
toggle: () => void;
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey, Ref } from "vue";
|
|
2
|
+
export type RadioSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface RadioGroupProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
}
|
|
7
|
+
export interface RadioItemProps {
|
|
8
|
+
value: string;
|
|
9
|
+
size?: RadioSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface RadioGroupContext {
|
|
13
|
+
model_value: Ref<string>;
|
|
14
|
+
disabled: Ref<boolean>;
|
|
15
|
+
updateValue: (value: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const RADIO_GROUP_KEY: InjectionKey<RadioGroupContext>;
|
|
18
|
+
export interface RadioAriaAttributes {
|
|
19
|
+
role: "radio";
|
|
20
|
+
"aria-checked": boolean;
|
|
21
|
+
"aria-disabled"?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface RadioItemReturn {
|
|
24
|
+
base_classes: ComputedRef<string>;
|
|
25
|
+
indicator_classes: ComputedRef<string>;
|
|
26
|
+
is_checked: ComputedRef<boolean>;
|
|
27
|
+
is_disabled: ComputedRef<boolean>;
|
|
28
|
+
aria_attributes: ComputedRef<RadioAriaAttributes>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const RADIO_GROUP_KEY = Symbol("radio-group");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey, Ref } from "vue";
|
|
2
|
+
export type SelectSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface SelectProps {
|
|
4
|
+
size?: SelectSize;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectOption {
|
|
9
|
+
value: string;
|
|
10
|
+
label: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SelectContext {
|
|
14
|
+
model_value: Ref<string>;
|
|
15
|
+
is_open: Ref<boolean>;
|
|
16
|
+
disabled: Ref<boolean>;
|
|
17
|
+
size: Ref<SelectSize>;
|
|
18
|
+
placeholder: Ref<string>;
|
|
19
|
+
updateValue: (value: string) => void;
|
|
20
|
+
open: () => void;
|
|
21
|
+
close: () => void;
|
|
22
|
+
toggle: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const SELECT_KEY: InjectionKey<SelectContext>;
|
|
25
|
+
export interface SelectTriggerReturn {
|
|
26
|
+
base_classes: ComputedRef<string>;
|
|
27
|
+
is_disabled: ComputedRef<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export interface SelectContentReturn {
|
|
30
|
+
base_classes: ComputedRef<string>;
|
|
31
|
+
}
|
|
32
|
+
export interface SelectItemReturn {
|
|
33
|
+
base_classes: ComputedRef<string>;
|
|
34
|
+
is_selected: ComputedRef<boolean>;
|
|
35
|
+
is_disabled: ComputedRef<boolean>;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SELECT_KEY = Symbol("select");
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComputedRef } from "vue";
|
|
2
|
+
export type SwitchSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface SwitchProps {
|
|
4
|
+
size?: SwitchSize;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SwitchAriaAttributes {
|
|
8
|
+
role: "switch";
|
|
9
|
+
"aria-checked": boolean;
|
|
10
|
+
"aria-disabled"?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SwitchReturn {
|
|
13
|
+
track_classes: ComputedRef<string>;
|
|
14
|
+
thumb_classes: ComputedRef<string>;
|
|
15
|
+
is_disabled: ComputedRef<boolean>;
|
|
16
|
+
aria_attributes: ComputedRef<SwitchAriaAttributes>;
|
|
17
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
export interface TextareaProps {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
readonly?: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
error_id?: string;
|
|
8
|
+
rows?: number;
|
|
9
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
10
|
+
}
|
|
11
|
+
export interface TextareaAriaAttributes {
|
|
12
|
+
"aria-invalid"?: boolean;
|
|
13
|
+
"aria-describedby"?: string;
|
|
14
|
+
"aria-readonly"?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface TextareaReturn {
|
|
17
|
+
base_classes: ComputedRef<string>;
|
|
18
|
+
is_focused: Ref<boolean>;
|
|
19
|
+
has_error: ComputedRef<boolean>;
|
|
20
|
+
is_disabled: ComputedRef<boolean>;
|
|
21
|
+
is_readonly: ComputedRef<boolean>;
|
|
22
|
+
aria_attributes: ComputedRef<TextareaAriaAttributes>;
|
|
23
|
+
handleFocus: () => void;
|
|
24
|
+
handleBlur: () => void;
|
|
25
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ThemeMode = "light" | "dark" | "system";
|
|
2
|
+
export interface ThemeColors {
|
|
3
|
+
background: string;
|
|
4
|
+
foreground: string;
|
|
5
|
+
card: string;
|
|
6
|
+
card_foreground: string;
|
|
7
|
+
popover: string;
|
|
8
|
+
popover_foreground: string;
|
|
9
|
+
primary: string;
|
|
10
|
+
primary_foreground: string;
|
|
11
|
+
secondary: string;
|
|
12
|
+
secondary_foreground: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
muted_foreground: string;
|
|
15
|
+
accent: string;
|
|
16
|
+
accent_foreground: string;
|
|
17
|
+
destructive: string;
|
|
18
|
+
destructive_foreground: string;
|
|
19
|
+
border: string;
|
|
20
|
+
input: string;
|
|
21
|
+
ring: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Theme {
|
|
24
|
+
name: string;
|
|
25
|
+
colors: {
|
|
26
|
+
light: ThemeColors;
|
|
27
|
+
dark: ThemeColors;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface ThemeConfig {
|
|
31
|
+
default_mode: ThemeMode;
|
|
32
|
+
storage_key: string;
|
|
33
|
+
attribute: string;
|
|
34
|
+
themes: Theme[];
|
|
35
|
+
}
|
|
36
|
+
export interface ThemeReturn {
|
|
37
|
+
mode: ThemeMode;
|
|
38
|
+
resolved_mode: "light" | "dark";
|
|
39
|
+
setMode: (mode: ThemeMode) => void;
|
|
40
|
+
toggleMode: () => void;
|
|
41
|
+
}
|
|
42
|
+
export declare const DEFAULT_LIGHT_COLORS: ThemeColors;
|
|
43
|
+
export declare const DEFAULT_DARK_COLORS: ThemeColors;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const DEFAULT_LIGHT_COLORS = {
|
|
2
|
+
background: "0 0% 100%",
|
|
3
|
+
foreground: "222.2 84% 4.9%",
|
|
4
|
+
card: "0 0% 100%",
|
|
5
|
+
card_foreground: "222.2 84% 4.9%",
|
|
6
|
+
popover: "0 0% 100%",
|
|
7
|
+
popover_foreground: "222.2 84% 4.9%",
|
|
8
|
+
primary: "222.2 47.4% 11.2%",
|
|
9
|
+
primary_foreground: "210 40% 98%",
|
|
10
|
+
secondary: "210 40% 96.1%",
|
|
11
|
+
secondary_foreground: "222.2 47.4% 11.2%",
|
|
12
|
+
muted: "210 40% 96.1%",
|
|
13
|
+
muted_foreground: "215.4 16.3% 46.9%",
|
|
14
|
+
accent: "210 40% 96.1%",
|
|
15
|
+
accent_foreground: "222.2 47.4% 11.2%",
|
|
16
|
+
destructive: "0 84.2% 60.2%",
|
|
17
|
+
destructive_foreground: "210 40% 98%",
|
|
18
|
+
border: "214.3 31.8% 91.4%",
|
|
19
|
+
input: "214.3 31.8% 91.4%",
|
|
20
|
+
ring: "222.2 84% 4.9%"
|
|
21
|
+
};
|
|
22
|
+
export const DEFAULT_DARK_COLORS = {
|
|
23
|
+
background: "222.2 84% 4.9%",
|
|
24
|
+
foreground: "210 40% 98%",
|
|
25
|
+
card: "222.2 84% 4.9%",
|
|
26
|
+
card_foreground: "210 40% 98%",
|
|
27
|
+
popover: "222.2 84% 4.9%",
|
|
28
|
+
popover_foreground: "210 40% 98%",
|
|
29
|
+
primary: "210 40% 98%",
|
|
30
|
+
primary_foreground: "222.2 47.4% 11.2%",
|
|
31
|
+
secondary: "217.2 32.6% 17.5%",
|
|
32
|
+
secondary_foreground: "210 40% 98%",
|
|
33
|
+
muted: "217.2 32.6% 17.5%",
|
|
34
|
+
muted_foreground: "215 20.2% 65.1%",
|
|
35
|
+
accent: "217.2 32.6% 17.5%",
|
|
36
|
+
accent_foreground: "210 40% 98%",
|
|
37
|
+
destructive: "0 62.8% 30.6%",
|
|
38
|
+
destructive_foreground: "210 40% 98%",
|
|
39
|
+
border: "217.2 32.6% 17.5%",
|
|
40
|
+
input: "217.2 32.6% 17.5%",
|
|
41
|
+
ring: "212.7 26.8% 83.9%"
|
|
42
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type ToastVariant = "default" | "success" | "error" | "warning" | "info";
|
|
2
|
+
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
3
|
+
export interface ToastProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
variant?: ToastVariant;
|
|
8
|
+
duration?: number;
|
|
9
|
+
dismissible?: boolean;
|
|
10
|
+
action?: ToastAction;
|
|
11
|
+
}
|
|
12
|
+
export interface ToastAction {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface Toast extends Required<Pick<ToastProps, "id" | "variant" | "duration" | "dismissible">> {
|
|
17
|
+
title?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
action?: ToastAction;
|
|
20
|
+
created_at: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ToasterProps {
|
|
23
|
+
position?: ToastPosition;
|
|
24
|
+
max_toasts?: number;
|
|
25
|
+
gap?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ToastReturn {
|
|
28
|
+
toasts: Toast[];
|
|
29
|
+
add: (props: ToastProps) => string;
|
|
30
|
+
dismiss: (id: string) => void;
|
|
31
|
+
dismissAll: () => void;
|
|
32
|
+
update: (id: string, props: Partial<ToastProps>) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface ToastAriaAttributes {
|
|
35
|
+
role: "alert" | "status";
|
|
36
|
+
"aria-live": "assertive" | "polite";
|
|
37
|
+
"aria-atomic": "true";
|
|
38
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
2
|
+
export type TooltipAlign = "start" | "center" | "end";
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
content: string;
|
|
5
|
+
side?: TooltipSide;
|
|
6
|
+
align?: TooltipAlign;
|
|
7
|
+
delay_duration?: number;
|
|
8
|
+
skip_delay_duration?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface TooltipReturn {
|
|
12
|
+
is_open: boolean;
|
|
13
|
+
trigger_ref: HTMLElement | null;
|
|
14
|
+
content_styles: Record<string, string>;
|
|
15
|
+
show: () => void;
|
|
16
|
+
hide: () => void;
|
|
17
|
+
toggle: () => void;
|
|
18
|
+
}
|
|
19
|
+
export interface TooltipAriaAttributes {
|
|
20
|
+
role: "tooltip";
|
|
21
|
+
id: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TooltipTriggerAriaAttributes {
|
|
24
|
+
"aria-describedby": string;
|
|
25
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type DeepPartial<T> = {
|
|
2
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
3
|
+
};
|
|
4
|
+
export type RequiredKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
5
|
+
export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
6
|
+
export type Prettify<T> = {
|
|
7
|
+
[K in keyof T]: T[K];
|
|
8
|
+
} & {};
|
|
9
|
+
export type MaybeRef<T> = T | {
|
|
10
|
+
value: T;
|
|
11
|
+
};
|
|
12
|
+
export type Arrayable<T> = T | T[];
|
|
File without changes
|