@kuina-ui/vue 0.1.1 → 0.3.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/{elements → components}/alert/Alert.vue.d.ts +14 -3
- package/dist/{elements → components}/alert/alert.theme.d.ts +1 -0
- package/dist/components/avatar-group/AvatarGroup.vue.d.ts +1 -1
- package/dist/components/date-picker/DateCalendar.vue.d.ts +40 -0
- package/dist/components/date-picker/DateCalendarMonth.vue.d.ts +27 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +44 -0
- package/dist/components/date-picker/DatePickerPanel.vue.d.ts +33 -0
- package/dist/components/date-picker/DateRangePicker.vue.d.ts +54 -0
- package/dist/components/date-picker/date-calendar.theme.d.ts +69 -0
- package/dist/components/date-picker/date-picker.theme.d.ts +19 -0
- package/dist/components/date-picker/datePickerProps.d.ts +39 -0
- package/dist/components/date-picker/index.d.ts +4 -0
- package/dist/components/date-picker/useDatePickerPopover.d.ts +21 -0
- package/dist/components/menu/Menu.vue.d.ts +87 -0
- package/dist/components/menu/MenuItemRow.vue.d.ts +18 -0
- package/dist/components/menu/MenuPanel.vue.d.ts +24 -0
- package/dist/components/menu/index.d.ts +3 -0
- package/dist/components/menu/menu.theme.d.ts +109 -0
- package/dist/components/menu/menuContext.d.ts +27 -0
- package/dist/components/menu/menuEntries.d.ts +10 -0
- package/dist/components/select/Select.vue.d.ts +81 -0
- package/dist/components/select/SelectField.vue.d.ts +70 -0
- package/dist/components/select/SelectOptionRow.vue.d.ts +33 -0
- package/dist/components/select/SelectPanel.vue.d.ts +67 -0
- package/dist/components/select/index.d.ts +6 -0
- package/dist/components/select/select-field.theme.d.ts +250 -0
- package/dist/components/select/select-panel.theme.d.ts +55 -0
- package/dist/components/select/selectOptions.d.ts +43 -0
- package/dist/components/select/useSelectControl.d.ts +77 -0
- package/dist/components/select/useSelectListbox.d.ts +48 -0
- package/dist/components/text-field/TextField.vue.d.ts +4 -1
- package/dist/components/text-field/text-field.theme.d.ts +6 -1
- package/dist/components/textarea/Textarea.vue.d.ts +4 -1
- package/dist/components/textarea/textarea.theme.d.ts +6 -1
- package/dist/elements/avatar/Avatar.vue.d.ts +3 -3
- package/dist/elements/badge/Badge.vue.d.ts +2 -2
- package/dist/elements/button/Button.vue.d.ts +4 -4
- package/dist/elements/checkbox/Checkbox.vue.d.ts +2 -2
- package/dist/elements/radio-group/RadioGroup.vue.d.ts +1 -1
- package/dist/elements/select-control/SelectControl.vue.d.ts +56 -0
- package/dist/elements/select-control/index.d.ts +3 -0
- package/dist/elements/select-control/select-control.theme.d.ts +87 -0
- package/dist/elements/switch/Switch.vue.d.ts +2 -2
- package/dist/elements/text-link/TextLink.vue.d.ts +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js +1 -1
- package/dist/nuxt.js +13 -8
- package/dist/shared/composables/useApplePlatform.d.ts +2 -0
- package/dist/shared/composables/useCalendarLabels.d.ts +19 -0
- package/dist/shared/composables/useDismissOnOutsidePointerDown.d.ts +9 -0
- package/dist/shared/composables/useFloatingPosition.d.ts +20 -0
- package/dist/shared/composables/useShortcuts.d.ts +9 -0
- package/dist/shared/types/calendar.d.ts +14 -0
- package/dist/shared/types/floating-position.d.ts +28 -0
- package/dist/shared/types/shortcut.d.ts +28 -0
- package/dist/shared/utils/calendarMonth.d.ts +5 -0
- package/dist/shared/utils/computeFloatingPosition.d.ts +5 -0
- package/dist/shared/utils/createDateFormatters.d.ts +9 -0
- package/dist/shared/utils/createShortcutHandler.d.ts +3 -0
- package/dist/shared/utils/createTypeaheadSearch.d.ts +2 -0
- package/dist/shared/utils/editableFieldGuard.d.ts +3 -0
- package/dist/shared/utils/flipFloatingPosition.d.ts +3 -0
- package/dist/shared/utils/floatingPanelTransition.d.ts +9 -0
- package/dist/shared/utils/formatShortcut.d.ts +2 -0
- package/dist/shared/utils/isApplePlatform.d.ts +2 -0
- package/dist/shared/utils/isExternalUrl.d.ts +2 -0
- package/dist/shared/utils/isoDate.d.ts +18 -0
- package/dist/shared/utils/parseShortcut.d.ts +3 -0
- package/dist/src-Cl5gtlze.js +6369 -0
- package/package.json +4 -1
- package/dist/src-CcuBQU4y.js +0 -2371
- /package/dist/{elements → components}/alert/index.d.ts +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type Component, type Ref } from 'vue';
|
|
2
|
+
import type { SelectOptionEntry } from './selectOptions';
|
|
3
|
+
import { type SelectAction } from './useSelectListbox';
|
|
4
|
+
export interface SelectControlProps<SourceOption> {
|
|
5
|
+
options: SelectOptionEntry<SourceOption>[];
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
valueKey?: string;
|
|
8
|
+
labelKey: string;
|
|
9
|
+
descriptionKey: string;
|
|
10
|
+
avatarKey: string;
|
|
11
|
+
searchable?: boolean;
|
|
12
|
+
searchPlacement?: 'list' | 'field';
|
|
13
|
+
clearable?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
selectionLabel?: (selectedOptions: SourceOption[]) => string;
|
|
17
|
+
actions: SelectAction[];
|
|
18
|
+
trailingIcon?: Component | null;
|
|
19
|
+
}
|
|
20
|
+
interface SelectControlElements {
|
|
21
|
+
selectedValue: Ref<unknown>;
|
|
22
|
+
isOpen: Ref<boolean>;
|
|
23
|
+
rootElement: Readonly<Ref<HTMLElement | null>>;
|
|
24
|
+
triggerElement: Readonly<Ref<HTMLElement | null>>;
|
|
25
|
+
layerElement: Readonly<Ref<HTMLElement | null>>;
|
|
26
|
+
hasSelectionSlot: () => boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Share between the select and the select field what their trigger shows and does, on top of their listbox. */
|
|
29
|
+
export declare function useSelectControl<SourceOption>(controlProps: SelectControlProps<SourceOption>, controlElements: SelectControlElements): {
|
|
30
|
+
isOpenable: import("vue").ComputedRef<boolean>;
|
|
31
|
+
searchesInTrigger: import("vue").ComputedRef<boolean>;
|
|
32
|
+
navigatesFromTrigger: import("vue").ComputedRef<boolean>;
|
|
33
|
+
triggerSearchValue: import("vue").ComputedRef<string>;
|
|
34
|
+
openTriggerSearchFromClick: (clickEvent: MouseEvent, triggerSearchInput: HTMLInputElement | null) => void;
|
|
35
|
+
searchFromTriggerInput: (inputEvent: Event) => void;
|
|
36
|
+
hasSelection: import("vue").ComputedRef<boolean>;
|
|
37
|
+
selectedSourceOptions: import("vue").ComputedRef<SourceOption[]>;
|
|
38
|
+
selectedLabels: import("vue").ComputedRef<string>;
|
|
39
|
+
selectionText: import("vue").ComputedRef<string>;
|
|
40
|
+
announcesSelectedLabelsSeparately: import("vue").ComputedRef<boolean>;
|
|
41
|
+
selectedAvatar: import("vue").ComputedRef<{
|
|
42
|
+
initials: string;
|
|
43
|
+
pill?: boolean | undefined;
|
|
44
|
+
variant?: "solid" | "soft" | undefined;
|
|
45
|
+
color?: "primary" | "secondary" | "gray" | "danger" | "success" | "info" | "discovery" | undefined;
|
|
46
|
+
icon?: Component | undefined;
|
|
47
|
+
imageUrl?: string | undefined;
|
|
48
|
+
} | undefined>;
|
|
49
|
+
resolvedTrailingIcon: import("vue").ComputedRef<Component | import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}> | null>;
|
|
50
|
+
showsTrailingIcon: import("vue").ComputedRef<boolean>;
|
|
51
|
+
showsClearButton: import("vue").ComputedRef<boolean>;
|
|
52
|
+
clearSelectionFromButton: () => void;
|
|
53
|
+
listboxId: string;
|
|
54
|
+
searchQuery: import("vue").ShallowRef<string, string>;
|
|
55
|
+
hasStartedTriggerSearch: import("vue").ShallowRef<boolean, boolean>;
|
|
56
|
+
highlightedItemId: import("vue").ShallowRef<string | undefined, string | undefined>;
|
|
57
|
+
visibleEntries: import("vue").ComputedRef<import("./selectOptions").ResolvedSelectEntry<unknown>[]>;
|
|
58
|
+
visibleOptions: import("vue").ComputedRef<import("./selectOptions").ResolvedSelectOption<unknown>[]>;
|
|
59
|
+
selectedValues: import("vue").ComputedRef<unknown[]>;
|
|
60
|
+
selectedOptions: import("vue").ComputedRef<import("./selectOptions").ResolvedSelectOption<unknown>[]>;
|
|
61
|
+
isOptionSelected: (resolvedOption: import("./selectOptions").ResolvedSelectOption) => boolean;
|
|
62
|
+
highlightItem: (itemId: string | undefined) => void;
|
|
63
|
+
openListbox: (highlightTarget?: import("./useSelectListbox").SelectHighlightTarget) => void;
|
|
64
|
+
closeListbox: ({ restoreFocus }: {
|
|
65
|
+
restoreFocus: boolean;
|
|
66
|
+
}) => void;
|
|
67
|
+
toggleListbox: () => void;
|
|
68
|
+
selectOption: (resolvedOption: import("./selectOptions").ResolvedSelectOption) => void;
|
|
69
|
+
clearSelection: () => void;
|
|
70
|
+
runSelectAction: (selectAction: SelectAction, selectEvent: Event) => void;
|
|
71
|
+
handleTriggerKeydown: (keyboardEvent: KeyboardEvent) => void;
|
|
72
|
+
handleSearchKeydown: (keyboardEvent: KeyboardEvent) => void;
|
|
73
|
+
handleSearchTriggerKeydown: (keyboardEvent: KeyboardEvent) => void;
|
|
74
|
+
handleSearchTriggerPaste: (clipboardEvent: ClipboardEvent) => void;
|
|
75
|
+
searchFromTrigger: (typedQuery: string) => void;
|
|
76
|
+
};
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Component, type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
import { type ResolvedSelectOption, type SelectOptionEntry, type SelectOptionFieldKeys } from './selectOptions';
|
|
3
|
+
export interface SelectAction {
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: Component;
|
|
6
|
+
onSelect?: (selectEvent: Event) => void;
|
|
7
|
+
}
|
|
8
|
+
export type SelectHighlightTarget = 'selected' | 'first' | 'last';
|
|
9
|
+
interface SelectListboxOptions {
|
|
10
|
+
optionEntries: MaybeRefOrGetter<SelectOptionEntry<unknown>[]>;
|
|
11
|
+
fieldKeys: MaybeRefOrGetter<SelectOptionFieldKeys>;
|
|
12
|
+
actions: MaybeRefOrGetter<SelectAction[]>;
|
|
13
|
+
multiple: MaybeRefOrGetter<boolean>;
|
|
14
|
+
searchable: MaybeRefOrGetter<boolean>;
|
|
15
|
+
searchInTrigger: MaybeRefOrGetter<boolean>;
|
|
16
|
+
openable: MaybeRefOrGetter<boolean>;
|
|
17
|
+
selectedValue: Ref<unknown>;
|
|
18
|
+
isOpen: Ref<boolean>;
|
|
19
|
+
focusTrigger: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function createSelectActionId(listboxId: string, actionIndex: number): string;
|
|
22
|
+
/** Hold what a select shows and does: its options, selection, search, highlighted item and keyboard navigation. */
|
|
23
|
+
export declare function useSelectListbox(listboxOptions: SelectListboxOptions): {
|
|
24
|
+
listboxId: string;
|
|
25
|
+
searchQuery: import("vue").ShallowRef<string, string>;
|
|
26
|
+
hasStartedTriggerSearch: import("vue").ShallowRef<boolean, boolean>;
|
|
27
|
+
highlightedItemId: import("vue").ShallowRef<string | undefined, string | undefined>;
|
|
28
|
+
visibleEntries: import("vue").ComputedRef<import("./selectOptions").ResolvedSelectEntry<unknown>[]>;
|
|
29
|
+
visibleOptions: import("vue").ComputedRef<ResolvedSelectOption<unknown>[]>;
|
|
30
|
+
selectedValues: import("vue").ComputedRef<unknown[]>;
|
|
31
|
+
selectedOptions: import("vue").ComputedRef<ResolvedSelectOption<unknown>[]>;
|
|
32
|
+
isOptionSelected: (resolvedOption: ResolvedSelectOption) => boolean;
|
|
33
|
+
highlightItem: (itemId: string | undefined) => void;
|
|
34
|
+
openListbox: (highlightTarget?: SelectHighlightTarget) => void;
|
|
35
|
+
closeListbox: ({ restoreFocus }: {
|
|
36
|
+
restoreFocus: boolean;
|
|
37
|
+
}) => void;
|
|
38
|
+
toggleListbox: () => void;
|
|
39
|
+
selectOption: (resolvedOption: ResolvedSelectOption) => void;
|
|
40
|
+
clearSelection: () => void;
|
|
41
|
+
runSelectAction: (selectAction: SelectAction, selectEvent: Event) => void;
|
|
42
|
+
handleTriggerKeydown: (keyboardEvent: KeyboardEvent) => void;
|
|
43
|
+
handleSearchKeydown: (keyboardEvent: KeyboardEvent) => void;
|
|
44
|
+
handleSearchTriggerKeydown: (keyboardEvent: KeyboardEvent) => void;
|
|
45
|
+
handleSearchTriggerPaste: (clipboardEvent: ClipboardEvent) => void;
|
|
46
|
+
searchFromTrigger: (typedQuery: string) => void;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
@@ -5,9 +5,11 @@ export interface TextFieldProps {
|
|
|
5
5
|
label: string;
|
|
6
6
|
id?: string;
|
|
7
7
|
type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number';
|
|
8
|
+
placeholder?: string;
|
|
8
9
|
variant?: TextFieldThemeVariants['variant'];
|
|
9
10
|
size?: TextFieldThemeVariants['size'];
|
|
10
11
|
pill?: boolean;
|
|
12
|
+
floatLabel?: TextFieldThemeVariants['floatLabel'];
|
|
11
13
|
leadingIcon?: Component;
|
|
12
14
|
trailingIcon?: Component;
|
|
13
15
|
trailingIconLabel?: string;
|
|
@@ -35,8 +37,9 @@ declare const __VLS_export: import("vue").DefineComponent<TextFieldProps & {
|
|
|
35
37
|
onTrailingIconClick?: ((event: MouseEvent) => any) | undefined;
|
|
36
38
|
onTrailingActionClick?: ((event: MouseEvent) => any) | undefined;
|
|
37
39
|
}>, {
|
|
40
|
+
pill: boolean;
|
|
38
41
|
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
39
42
|
variant: "soft" | "outline";
|
|
40
|
-
pill: boolean;
|
|
41
43
|
type: "number" | "search" | "text" | "email" | "password" | "tel" | "url";
|
|
44
|
+
floatLabel: "auto" | "always";
|
|
42
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -6,7 +6,6 @@ export declare const textFieldTheme: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
};
|
|
7
7
|
size: Record<"md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
|
|
8
8
|
base: string[];
|
|
9
|
-
label: string;
|
|
10
9
|
leadingIcon: string;
|
|
11
10
|
trailingIcon: string;
|
|
12
11
|
trailingAction: string;
|
|
@@ -17,6 +16,12 @@ export declare const textFieldTheme: import("tailwind-variants").TVReturnType<{
|
|
|
17
16
|
hasLeadingIcon: {
|
|
18
17
|
true: string;
|
|
19
18
|
};
|
|
19
|
+
floatLabel: {
|
|
20
|
+
auto: {
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
always: string;
|
|
24
|
+
};
|
|
20
25
|
trailingContent: {
|
|
21
26
|
none: string;
|
|
22
27
|
icon: {
|
|
@@ -3,6 +3,7 @@ import type { TextareaSlotName, TextareaThemeVariants } from './textarea.theme';
|
|
|
3
3
|
export interface TextareaProps {
|
|
4
4
|
label: string;
|
|
5
5
|
id?: string;
|
|
6
|
+
placeholder?: string;
|
|
6
7
|
rows?: number;
|
|
7
8
|
autoResize?: boolean;
|
|
8
9
|
maxRows?: number;
|
|
@@ -10,6 +11,7 @@ export interface TextareaProps {
|
|
|
10
11
|
variant?: TextareaThemeVariants['variant'];
|
|
11
12
|
size?: TextareaThemeVariants['size'];
|
|
12
13
|
pill?: boolean;
|
|
14
|
+
floatLabel?: TextareaThemeVariants['floatLabel'];
|
|
13
15
|
hint?: string;
|
|
14
16
|
errorMessage?: string;
|
|
15
17
|
invalid?: boolean;
|
|
@@ -28,9 +30,10 @@ declare const __VLS_export: import("vue").DefineComponent<TextareaProps & {
|
|
|
28
30
|
}> & Readonly<{
|
|
29
31
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
30
32
|
}>, {
|
|
33
|
+
pill: boolean;
|
|
31
34
|
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
32
35
|
variant: "soft" | "outline";
|
|
33
|
-
|
|
36
|
+
floatLabel: "auto" | "always";
|
|
34
37
|
rows: number;
|
|
35
38
|
maxRows: number;
|
|
36
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -6,11 +6,16 @@ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
};
|
|
7
7
|
size: Record<"md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
|
|
8
8
|
base: string[];
|
|
9
|
-
label: string[];
|
|
10
9
|
}>;
|
|
11
10
|
pill: {
|
|
12
11
|
true: string;
|
|
13
12
|
};
|
|
13
|
+
floatLabel: {
|
|
14
|
+
auto: {
|
|
15
|
+
label: string;
|
|
16
|
+
};
|
|
17
|
+
always: string;
|
|
18
|
+
};
|
|
14
19
|
autoResize: {
|
|
15
20
|
true: {
|
|
16
21
|
base: string;
|
|
@@ -18,10 +18,10 @@ export interface AvatarProps {
|
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
19
19
|
export default _default;
|
|
20
20
|
declare const __VLS_export: import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
|
|
21
|
-
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
22
|
-
variant: "soft" | "solid";
|
|
23
|
-
color: "primary" | "secondary" | "gray" | "success" | "info" | "discovery" | "danger";
|
|
24
21
|
pill: boolean;
|
|
22
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
23
|
+
variant: "solid" | "soft";
|
|
24
|
+
color: "primary" | "secondary" | "gray" | "danger" | "success" | "info" | "discovery";
|
|
25
25
|
name: string;
|
|
26
26
|
overflowCount: number;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -17,8 +17,8 @@ declare const _default: typeof __VLS_export;
|
|
|
17
17
|
export default _default;
|
|
18
18
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<BadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
|
|
19
19
|
size: "sm" | "md" | "lg";
|
|
20
|
-
variant: "
|
|
21
|
-
color: "secondary" | "gray" | "
|
|
20
|
+
variant: "solid" | "soft" | "outline";
|
|
21
|
+
color: "secondary" | "gray" | "danger" | "success" | "warning" | "info" | "discovery";
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
23
23
|
default?: (props: {}) => any;
|
|
24
24
|
}>;
|
|
@@ -22,11 +22,11 @@ export interface ButtonProps {
|
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
24
24
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
25
|
-
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
26
|
-
variant: "soft" | "solid" | "outline" | "ghost";
|
|
27
|
-
color: "primary" | "secondary" | "gray" | "danger" | "neutral";
|
|
28
25
|
pill: boolean;
|
|
29
|
-
|
|
26
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
27
|
+
variant: "solid" | "soft" | "outline" | "ghost";
|
|
28
|
+
color: "primary" | "secondary" | "neutral" | "gray" | "danger";
|
|
29
|
+
type: "button" | "submit" | "reset";
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
31
31
|
default?: (props: {}) => any;
|
|
32
32
|
}>;
|
|
@@ -18,6 +18,6 @@ declare const __VLS_export: import("vue").DefineComponent<CheckboxProps & {
|
|
|
18
18
|
}> & Readonly<{
|
|
19
19
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
|
-
color: "primary" | "secondary" | (string & {})
|
|
22
|
-
labelPosition: "
|
|
21
|
+
color: "primary" | "secondary" | "neutral" | (string & {});
|
|
22
|
+
labelPosition: "end" | "start";
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -31,6 +31,6 @@ declare const __VLS_export: import("vue").DefineComponent<RadioGroupProps & {
|
|
|
31
31
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
33
|
variant: "default" | "card";
|
|
34
|
-
color: "primary" | "secondary" | (string & {})
|
|
34
|
+
color: "primary" | "secondary" | "neutral" | (string & {});
|
|
35
35
|
direction: "col" | "row";
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import type { SelectControlSlotName, SelectControlThemeVariants } from './select-control.theme';
|
|
4
|
+
export interface SelectControlProps {
|
|
5
|
+
size?: SelectControlThemeVariants['size'];
|
|
6
|
+
variant?: SelectControlThemeVariants['variant'];
|
|
7
|
+
pill?: boolean;
|
|
8
|
+
block?: boolean;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
interactive?: boolean;
|
|
13
|
+
hasValue?: boolean;
|
|
14
|
+
searchesInTrigger?: boolean;
|
|
15
|
+
leadingIcon?: Component | null;
|
|
16
|
+
trailingIcon?: Component | null;
|
|
17
|
+
showsClearButton?: boolean;
|
|
18
|
+
clearLabel?: string;
|
|
19
|
+
spokenValue?: string;
|
|
20
|
+
triggerAttributes?: Record<string, unknown>;
|
|
21
|
+
ui?: Partial<Record<SelectControlSlotName, ClassNameValue>>;
|
|
22
|
+
class?: ClassNameValue;
|
|
23
|
+
}
|
|
24
|
+
export interface SelectControlSlots {
|
|
25
|
+
default?: () => unknown;
|
|
26
|
+
leading?: () => unknown;
|
|
27
|
+
input?: (inputSlotProps: {
|
|
28
|
+
inputClass: string;
|
|
29
|
+
}) => unknown;
|
|
30
|
+
status?: (statusSlotProps: {
|
|
31
|
+
statusClass: string;
|
|
32
|
+
}) => unknown;
|
|
33
|
+
popup?: () => unknown;
|
|
34
|
+
}
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
37
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SelectControlProps, {
|
|
38
|
+
rootElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
|
|
39
|
+
triggerElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
|
|
40
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
clear: () => any;
|
|
42
|
+
}, string, import("vue").PublicProps, Readonly<SelectControlProps> & Readonly<{
|
|
43
|
+
onClear?: (() => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
pill: boolean;
|
|
46
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
47
|
+
variant: "soft" | "outline" | "ghost";
|
|
48
|
+
block: boolean;
|
|
49
|
+
interactive: boolean;
|
|
50
|
+
clearLabel: string;
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SelectControlSlots>;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const selectControlTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: Record<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
|
|
4
|
+
base: string[];
|
|
5
|
+
leadingIcon: string;
|
|
6
|
+
trailingIcon: string;
|
|
7
|
+
loadingIndicator: string;
|
|
8
|
+
clearButton: string;
|
|
9
|
+
clearIcon: string;
|
|
10
|
+
}>;
|
|
11
|
+
variant: {
|
|
12
|
+
outline: string;
|
|
13
|
+
soft: string;
|
|
14
|
+
ghost: string;
|
|
15
|
+
};
|
|
16
|
+
pill: {
|
|
17
|
+
true: string;
|
|
18
|
+
false: string;
|
|
19
|
+
};
|
|
20
|
+
block: {
|
|
21
|
+
true: {
|
|
22
|
+
root: string;
|
|
23
|
+
};
|
|
24
|
+
false: {
|
|
25
|
+
root: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
open: {
|
|
29
|
+
true: {
|
|
30
|
+
trailingIcon: string;
|
|
31
|
+
};
|
|
32
|
+
false: {
|
|
33
|
+
trailingIcon: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
invalid: {
|
|
37
|
+
true: string;
|
|
38
|
+
false: string;
|
|
39
|
+
};
|
|
40
|
+
interactive: {
|
|
41
|
+
true: string;
|
|
42
|
+
false: string;
|
|
43
|
+
};
|
|
44
|
+
disabled: {
|
|
45
|
+
true: {
|
|
46
|
+
base: string;
|
|
47
|
+
};
|
|
48
|
+
false: {
|
|
49
|
+
base: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
hasSelection: {
|
|
53
|
+
true: string;
|
|
54
|
+
false: string;
|
|
55
|
+
};
|
|
56
|
+
searchesInTrigger: {
|
|
57
|
+
true: {
|
|
58
|
+
base: string;
|
|
59
|
+
};
|
|
60
|
+
false: {
|
|
61
|
+
base: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
hasTrailingIcon: {
|
|
65
|
+
true: {
|
|
66
|
+
clearButton: string;
|
|
67
|
+
};
|
|
68
|
+
false: {
|
|
69
|
+
clearButton: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
root: string;
|
|
74
|
+
base: string;
|
|
75
|
+
leadingIcon: string;
|
|
76
|
+
leadingAvatar: string;
|
|
77
|
+
value: string;
|
|
78
|
+
input: string;
|
|
79
|
+
selectionForScreenReaders: string;
|
|
80
|
+
trailing: string;
|
|
81
|
+
clearButton: string;
|
|
82
|
+
clearIcon: string;
|
|
83
|
+
loadingIndicator: string;
|
|
84
|
+
trailingIcon: string;
|
|
85
|
+
}, undefined, undefined, undefined, undefined>;
|
|
86
|
+
export type SelectControlThemeVariants = VariantProps<typeof selectControlTheme>;
|
|
87
|
+
export type SelectControlSlotName = keyof ReturnType<typeof selectControlTheme>;
|
|
@@ -21,6 +21,6 @@ declare const __VLS_export: import("vue").DefineComponent<SwitchProps & {
|
|
|
21
21
|
}> & Readonly<{
|
|
22
22
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
color: "primary" | "secondary" | (string & {})
|
|
25
|
-
labelPosition: "
|
|
24
|
+
color: "primary" | "secondary" | "neutral" | (string & {});
|
|
25
|
+
labelPosition: "end" | "start";
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -18,7 +18,7 @@ export default _default;
|
|
|
18
18
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<TextLinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextLinkProps> & Readonly<{}>, {
|
|
19
19
|
color: "primary" | "inherit" | "muted";
|
|
20
20
|
href: string;
|
|
21
|
-
weight: "
|
|
21
|
+
weight: "medium" | "inherit" | "semibold";
|
|
22
22
|
underline: boolean;
|
|
23
23
|
external: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
export { KAlert } from './components/alert';
|
|
2
|
+
export type { AlertProps } from './components/alert';
|
|
1
3
|
export { KAvatarGroup } from './components/avatar-group';
|
|
2
4
|
export type { AvatarGroupMember, AvatarGroupProps } from './components/avatar-group';
|
|
5
|
+
export { KDatePicker, KDateRangePicker } from './components/date-picker';
|
|
6
|
+
export type { DatePickerProps, DatePickerSlots, DateRange, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut, } from './components/date-picker';
|
|
7
|
+
export { extractMenuShortcuts, KMenu } from './components/menu';
|
|
8
|
+
export type { MenuEntry, MenuGroup, MenuHeader, MenuItem, MenuItemAction, MenuProps, MenuSeparator, MenuTriggerProps, } from './components/menu';
|
|
9
|
+
export { KSelect, KSelectField } from './components/select';
|
|
10
|
+
export type { SelectAction, SelectFieldProps, SelectModelValue, SelectOption, SelectOptionAvatar, SelectOptionEntry, SelectOptionGroup, SelectOptionValue, SelectProps, SelectSlots, } from './components/select';
|
|
3
11
|
export { KTextField } from './components/text-field';
|
|
4
12
|
export type { TextFieldProps } from './components/text-field';
|
|
5
13
|
export { KTextarea } from './components/textarea';
|
|
6
14
|
export type { TextareaProps } from './components/textarea';
|
|
7
|
-
export { KAlert } from './elements/alert';
|
|
8
|
-
export type { AlertProps } from './elements/alert';
|
|
9
15
|
export { KAvatar } from './elements/avatar';
|
|
10
16
|
export type { AvatarProps } from './elements/avatar';
|
|
11
17
|
export { KBadge } from './elements/badge';
|
|
@@ -26,3 +32,7 @@ export { KSwitch } from './elements/switch';
|
|
|
26
32
|
export type { SwitchProps } from './elements/switch';
|
|
27
33
|
export { KTextLink } from './elements/text-link';
|
|
28
34
|
export type { TextLinkProps } from './elements/text-link';
|
|
35
|
+
export { useShortcuts } from './shared/composables/useShortcuts';
|
|
36
|
+
export type { ShortcutListenerOptions } from './shared/composables/useShortcuts';
|
|
37
|
+
export type { KeyCombination, ShortcutBinding, ShortcutContext, ShortcutDefinition, ShortcutDefinitions, ShortcutGuard, ShortcutHandler, ShortcutModifierName, ShortcutOptions, } from './shared/types/shortcut';
|
|
38
|
+
export type { DateOrDateRange, Weekday } from './shared/types/calendar';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { x as KAlert, b as KAvatar, y as KAvatarGroup, l as KBadge, S as KButton, c as KCheckbox, s as KCircularProgress, v as KDatePicker, _ as KDateRangePicker, o as KLoadingDots, m as KLoadingIndicator, h as KMenu, a as KRadioGroup, p as KSelect, f as KSelectField, i as KSwitch, d as KTextField, r as KTextLink, u as KTextarea, g as extractMenuShortcuts, n as useShortcuts } from "./src-Cl5gtlze.js";
|
package/dist/nuxt.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { t as e } from "./src-
|
|
2
|
-
import { addComponent as t,
|
|
3
|
-
import
|
|
1
|
+
import { t as e } from "./src-Cl5gtlze.js";
|
|
2
|
+
import { addComponent as t, addImports as n, addVitePlugin as r, defineNuxtModule as i } from "@nuxt/kit";
|
|
3
|
+
import a from "@tailwindcss/vite";
|
|
4
4
|
// src/nuxt.ts
|
|
5
|
-
var
|
|
5
|
+
var o = i({
|
|
6
6
|
meta: {
|
|
7
7
|
name: "@kuina-ui/vue",
|
|
8
8
|
configKey: "kuina",
|
|
9
9
|
compatibility: { nuxt: ">=4.0.0" }
|
|
10
10
|
},
|
|
11
11
|
setup() {
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
for (let e of
|
|
12
|
+
r(a());
|
|
13
|
+
let i = Object.keys(e).filter((e) => e.startsWith("K"));
|
|
14
|
+
for (let e of i) t({
|
|
15
15
|
name: e,
|
|
16
16
|
export: e,
|
|
17
17
|
filePath: "@kuina-ui/vue"
|
|
18
18
|
});
|
|
19
|
+
let o = Object.keys(e).filter((e) => e.startsWith("use"));
|
|
20
|
+
n(o.map((e) => ({
|
|
21
|
+
name: e,
|
|
22
|
+
from: "@kuina-ui/vue"
|
|
23
|
+
})));
|
|
19
24
|
}
|
|
20
25
|
});
|
|
21
|
-
export {
|
|
26
|
+
export { o as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Weekday } from '../types/calendar';
|
|
2
|
+
export interface CalendarLabelOptions {
|
|
3
|
+
locale: string;
|
|
4
|
+
weekdayLabel?: (weekday: Weekday) => string;
|
|
5
|
+
monthLabel?: (isoMonth: string) => string;
|
|
6
|
+
dayLabel?: (isoDate: string) => string;
|
|
7
|
+
}
|
|
8
|
+
/** Take each calendar text from its function prop when there is one, and from the locale otherwise. */
|
|
9
|
+
export declare function useCalendarLabels(labelOptions: CalendarLabelOptions): {
|
|
10
|
+
dateFormatters: import("vue").ComputedRef<{
|
|
11
|
+
formatShortDate: (isoDate: string) => string;
|
|
12
|
+
formatFullDate: (isoDate: string) => string;
|
|
13
|
+
formatMonth: (isoMonth: string) => string;
|
|
14
|
+
formatWeekday: (weekday: Weekday) => string;
|
|
15
|
+
}>;
|
|
16
|
+
resolvedWeekdayLabel: import("vue").ComputedRef<(weekday: Weekday) => string>;
|
|
17
|
+
resolvedMonthLabel: import("vue").ComputedRef<(isoMonth: string) => string>;
|
|
18
|
+
resolvedDayLabel: import("vue").ComputedRef<(isoDate: string) => string>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
type MaybeElement = HTMLElement | null | undefined;
|
|
3
|
+
interface OutsidePointerDownOptions {
|
|
4
|
+
active: MaybeRefOrGetter<boolean>;
|
|
5
|
+
onDismiss: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Call onDismiss when a pointer goes down outside the given elements, while active. */
|
|
8
|
+
export declare function useDismissOnOutsidePointerDown(insideElements: MaybeRefOrGetter<MaybeElement>[], options: OutsidePointerDownOptions): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CSSProperties, type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { FloatingAlign, FloatingPlacement, FloatingPositionModifier, FloatingSide, FloatingStrategy } from '../types/floating-position';
|
|
3
|
+
type MaybeElement = HTMLElement | null | undefined;
|
|
4
|
+
export interface FloatingPositionOptions {
|
|
5
|
+
open: MaybeRefOrGetter<boolean>;
|
|
6
|
+
side?: MaybeRefOrGetter<FloatingSide>;
|
|
7
|
+
align?: MaybeRefOrGetter<FloatingAlign>;
|
|
8
|
+
sideOffset?: MaybeRefOrGetter<number>;
|
|
9
|
+
alignOffset?: MaybeRefOrGetter<number>;
|
|
10
|
+
strategy?: MaybeRefOrGetter<FloatingStrategy>;
|
|
11
|
+
positionModifiers?: MaybeRefOrGetter<FloatingPositionModifier[]>;
|
|
12
|
+
}
|
|
13
|
+
/** Keep a floating element, such as a dropdown panel, placed against its anchor while it is open. */
|
|
14
|
+
export declare function useFloatingPosition(anchorElement: MaybeRefOrGetter<MaybeElement>, floatingElement: MaybeRefOrGetter<MaybeElement>, options: FloatingPositionOptions): {
|
|
15
|
+
floatingStyles: import("vue").ComputedRef<CSSProperties>;
|
|
16
|
+
floatingPlacement: import("vue").ComputedRef<FloatingPlacement>;
|
|
17
|
+
isPositioned: import("vue").ComputedRef<boolean>;
|
|
18
|
+
updatePosition: () => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { ShortcutDefinitions, ShortcutGuard } from '../types/shortcut';
|
|
3
|
+
export interface ShortcutListenerOptions {
|
|
4
|
+
target?: MaybeRefOrGetter<EventTarget | null | undefined>;
|
|
5
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
6
|
+
guards?: ShortcutGuard[];
|
|
7
|
+
}
|
|
8
|
+
/** Listen for keyboard shortcuts on the document, or on a target, while the component is mounted. */
|
|
9
|
+
export declare function useShortcuts(shortcutDefinitions: MaybeRefOrGetter<ShortcutDefinitions>, listenerOptions?: ShortcutListenerOptions): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
+
export type DateRange = [start: string, end: string];
|
|
3
|
+
export type DateOrDateRange = string | DateRange;
|
|
4
|
+
export interface CalendarDay {
|
|
5
|
+
isoDate: string;
|
|
6
|
+
dayNumber: number;
|
|
7
|
+
weekday: Weekday;
|
|
8
|
+
}
|
|
9
|
+
export interface CalendarMonth {
|
|
10
|
+
isoMonth: string;
|
|
11
|
+
firstIsoDate: string;
|
|
12
|
+
lastIsoDate: string;
|
|
13
|
+
weeks: (CalendarDay | null)[][];
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type FloatingSide = 'top' | 'bottom' | 'left' | 'right';
|
|
2
|
+
export type FloatingAlign = 'start' | 'center' | 'end';
|
|
3
|
+
export type FloatingStrategy = 'absolute' | 'fixed';
|
|
4
|
+
export interface FloatingPlacement {
|
|
5
|
+
side: FloatingSide;
|
|
6
|
+
align: FloatingAlign;
|
|
7
|
+
sideOffset: number;
|
|
8
|
+
alignOffset: number;
|
|
9
|
+
}
|
|
10
|
+
export interface BoxSize {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface BoxRect extends BoxSize {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
export interface FloatingPositionContext {
|
|
19
|
+
anchorRect: BoxRect;
|
|
20
|
+
floatingSize: BoxSize;
|
|
21
|
+
viewportSize: BoxSize;
|
|
22
|
+
}
|
|
23
|
+
export interface FloatingPosition {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
placement: FloatingPlacement;
|
|
27
|
+
}
|
|
28
|
+
export type FloatingPositionModifier = (floatingPosition: FloatingPosition, positionContext: FloatingPositionContext) => FloatingPosition;
|