@kuina-ui/vue 0.1.1 → 0.2.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 +12 -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/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/text-field/TextField.vue.d.ts +1 -1
- package/dist/components/textarea/Textarea.vue.d.ts +1 -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/switch/Switch.vue.d.ts +2 -2
- package/dist/index.d.ts +7 -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/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/floating-position.d.ts +28 -0
- package/dist/shared/types/shortcut.d.ts +28 -0
- package/dist/shared/utils/computeFloatingPosition.d.ts +5 -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/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/parseShortcut.d.ts +3 -0
- package/dist/{src-CcuBQU4y.js → src-Cn6KXW0m.js} +2798 -1683
- package/package.json +4 -1
- /package/dist/{elements → components}/alert/index.d.ts +0 -0
|
@@ -9,14 +9,23 @@ export interface AlertProps {
|
|
|
9
9
|
icon?: Component;
|
|
10
10
|
showIcon?: boolean;
|
|
11
11
|
actionsPlacement?: AlertThemeVariants['actionsPlacement'];
|
|
12
|
+
closable?: boolean;
|
|
12
13
|
ui?: Partial<Record<AlertSlotName, ClassNameValue>>;
|
|
13
14
|
class?: ClassNameValue;
|
|
14
15
|
}
|
|
15
16
|
declare const _default: typeof __VLS_export;
|
|
16
17
|
export default _default;
|
|
17
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertProps
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertProps & {
|
|
19
|
+
open?: boolean;
|
|
20
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:open": (value: boolean) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<AlertProps & {
|
|
23
|
+
open?: boolean;
|
|
24
|
+
}> & Readonly<{
|
|
25
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
variant: "solid" | "soft" | "outline";
|
|
28
|
+
color: "primary" | "danger" | "success" | "warning" | "caution" | "info" | "discovery";
|
|
20
29
|
actionsPlacement: "end" | "bottom";
|
|
21
30
|
showIcon: boolean;
|
|
22
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
@@ -38,6 +38,7 @@ export declare const alertTheme: import("tailwind-variants").TVReturnType<{
|
|
|
38
38
|
title: string;
|
|
39
39
|
description: string;
|
|
40
40
|
actions: string;
|
|
41
|
+
closeButton: string;
|
|
41
42
|
}, undefined, undefined, undefined, undefined>;
|
|
42
43
|
export type AlertThemeVariants = VariantProps<typeof alertTheme>;
|
|
43
44
|
export type AlertSlotName = keyof ReturnType<typeof alertTheme>;
|
|
@@ -17,6 +17,6 @@ export default _default;
|
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {
|
|
18
18
|
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
19
19
|
overflowCount: number;
|
|
20
|
-
stack: "
|
|
20
|
+
stack: "end" | "start";
|
|
21
21
|
surface: "canvas" | "widget";
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ButtonProps } from '../../elements/button';
|
|
3
|
+
import type { FloatingStrategy } from '../../shared/types/floating-position';
|
|
4
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
5
|
+
import type { MenuSlotName, MenuThemeVariants } from './menu.theme';
|
|
6
|
+
export interface MenuItemAction {
|
|
7
|
+
label: string;
|
|
8
|
+
icon: Component;
|
|
9
|
+
onSelect?: (selectEvent: Event) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface MenuItem {
|
|
12
|
+
label: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
icon?: Component;
|
|
15
|
+
shortcut?: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
color?: MenuThemeVariants['color'];
|
|
18
|
+
type?: MenuThemeVariants['type'];
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
actions?: MenuItemAction[];
|
|
22
|
+
submenu?: MenuEntry[];
|
|
23
|
+
onSelect?: (selectEvent: Event) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface MenuSeparator {
|
|
26
|
+
separator: true;
|
|
27
|
+
}
|
|
28
|
+
export interface MenuGroup {
|
|
29
|
+
label: string;
|
|
30
|
+
items: MenuItem[];
|
|
31
|
+
}
|
|
32
|
+
export interface MenuHeader {
|
|
33
|
+
label: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
readOnly: true;
|
|
36
|
+
}
|
|
37
|
+
export type MenuEntry = MenuItem | MenuSeparator | MenuGroup | MenuHeader;
|
|
38
|
+
export type MenuTriggerProps = Pick<ButtonProps, 'variant' | 'color' | 'size' | 'leadingIcon' | 'trailingIcon' | 'pill' | 'square' | 'disabled'>;
|
|
39
|
+
export interface MenuProps {
|
|
40
|
+
label: string;
|
|
41
|
+
items: MenuEntry[];
|
|
42
|
+
trigger?: MenuTriggerProps;
|
|
43
|
+
side?: MenuThemeVariants['side'];
|
|
44
|
+
align?: MenuThemeVariants['align'];
|
|
45
|
+
width?: MenuThemeVariants['width'];
|
|
46
|
+
indicatorPosition?: MenuThemeVariants['indicatorPosition'];
|
|
47
|
+
indicatorVariant?: MenuThemeVariants['indicatorVariant'];
|
|
48
|
+
strategy?: FloatingStrategy;
|
|
49
|
+
flip?: boolean;
|
|
50
|
+
ui?: Partial<Record<MenuSlotName, ClassNameValue>>;
|
|
51
|
+
class?: ClassNameValue;
|
|
52
|
+
}
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
export default _default;
|
|
55
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MenuProps & {
|
|
56
|
+
open?: boolean;
|
|
57
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
58
|
+
"update:open": (value: boolean) => any;
|
|
59
|
+
}, string, import("vue").PublicProps, Readonly<MenuProps & {
|
|
60
|
+
open?: boolean;
|
|
61
|
+
}> & Readonly<{
|
|
62
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
63
|
+
}>, {
|
|
64
|
+
width: "sm" | "md" | "lg" | "xl" | "auto" | "trigger";
|
|
65
|
+
side: "bottom" | "top" | "left" | "right";
|
|
66
|
+
align: "end" | "start" | "center";
|
|
67
|
+
indicatorPosition: "end" | "start";
|
|
68
|
+
indicatorVariant: "solid" | "ghost";
|
|
69
|
+
strategy: FloatingStrategy;
|
|
70
|
+
flip: boolean;
|
|
71
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
72
|
+
trigger?: (props: {
|
|
73
|
+
open: boolean;
|
|
74
|
+
triggerAttributes: {
|
|
75
|
+
'aria-haspopup': "menu";
|
|
76
|
+
'aria-expanded': boolean;
|
|
77
|
+
'aria-controls': string | undefined;
|
|
78
|
+
onClick: (clickEvent: MouseEvent) => void;
|
|
79
|
+
onKeydown: (keydownEvent: Event) => void;
|
|
80
|
+
};
|
|
81
|
+
}) => any;
|
|
82
|
+
}>;
|
|
83
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
84
|
+
new (): {
|
|
85
|
+
$slots: S;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MenuItem, MenuItemAction } from './Menu.vue';
|
|
2
|
+
import type { menuTheme } from './menu.theme';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
menuItem: MenuItem;
|
|
5
|
+
menuThemeSlots: ReturnType<typeof menuTheme>;
|
|
6
|
+
submenuKey?: string;
|
|
7
|
+
submenuId?: string;
|
|
8
|
+
isSubmenuOpen?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
select: (selectEvent: MouseEvent) => any;
|
|
12
|
+
selectAction: (menuItemAction: MenuItemAction, selectEvent: MouseEvent) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onSelect?: ((selectEvent: MouseEvent) => any) | undefined;
|
|
15
|
+
onSelectAction?: ((menuItemAction: MenuItemAction, selectEvent: MouseEvent) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MenuEntry, MenuProps } from './Menu.vue';
|
|
2
|
+
import { type MenuFocusRequest } from './menuContext';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
panelId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
entries: MenuEntry[];
|
|
7
|
+
anchorElement: HTMLElement | null | undefined;
|
|
8
|
+
side: NonNullable<MenuProps['side']>;
|
|
9
|
+
align: NonNullable<MenuProps['align']>;
|
|
10
|
+
width: NonNullable<MenuProps['width']>;
|
|
11
|
+
sideOffset: number;
|
|
12
|
+
alignOffset: number;
|
|
13
|
+
focusRequest?: MenuFocusRequest;
|
|
14
|
+
isSubmenu?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
requestClose: () => any;
|
|
18
|
+
pointerEntered: () => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onRequestClose?: (() => any) | undefined;
|
|
21
|
+
onPointerEntered?: (() => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const menuTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
side: {
|
|
4
|
+
top: string;
|
|
5
|
+
bottom: string;
|
|
6
|
+
left: string;
|
|
7
|
+
right: string;
|
|
8
|
+
};
|
|
9
|
+
align: {
|
|
10
|
+
start: string;
|
|
11
|
+
center: string;
|
|
12
|
+
end: string;
|
|
13
|
+
};
|
|
14
|
+
width: {
|
|
15
|
+
trigger: {
|
|
16
|
+
panel: string;
|
|
17
|
+
};
|
|
18
|
+
auto: {
|
|
19
|
+
panel: string;
|
|
20
|
+
};
|
|
21
|
+
sm: {
|
|
22
|
+
panel: string;
|
|
23
|
+
};
|
|
24
|
+
md: {
|
|
25
|
+
panel: string;
|
|
26
|
+
};
|
|
27
|
+
lg: {
|
|
28
|
+
panel: string;
|
|
29
|
+
};
|
|
30
|
+
xl: {
|
|
31
|
+
panel: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
indicatorPosition: {
|
|
35
|
+
start: string;
|
|
36
|
+
end: {
|
|
37
|
+
indicatorWrapper: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
indicatorVariant: {
|
|
41
|
+
solid: {
|
|
42
|
+
indicator: string;
|
|
43
|
+
indicatorCheckIcon: string;
|
|
44
|
+
};
|
|
45
|
+
ghost: {
|
|
46
|
+
indicatorCheckIcon: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
color: {
|
|
50
|
+
danger: {
|
|
51
|
+
item: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
type: {
|
|
55
|
+
checkbox: string;
|
|
56
|
+
radio: {
|
|
57
|
+
indicator: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
checked: {
|
|
61
|
+
true: string;
|
|
62
|
+
false: string;
|
|
63
|
+
};
|
|
64
|
+
disabled: {
|
|
65
|
+
true: {
|
|
66
|
+
item: string;
|
|
67
|
+
};
|
|
68
|
+
false: {
|
|
69
|
+
item: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
hasIndicator: {
|
|
73
|
+
true: {
|
|
74
|
+
itemContent: string;
|
|
75
|
+
};
|
|
76
|
+
false: {
|
|
77
|
+
itemContent: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
hasActions: {
|
|
81
|
+
true: {
|
|
82
|
+
item: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
root: string;
|
|
87
|
+
panel: string;
|
|
88
|
+
separator: string;
|
|
89
|
+
groupLabel: string;
|
|
90
|
+
header: string;
|
|
91
|
+
headerLabel: string;
|
|
92
|
+
headerDescription: string;
|
|
93
|
+
item: string;
|
|
94
|
+
itemContent: string;
|
|
95
|
+
itemIcon: string;
|
|
96
|
+
itemText: string;
|
|
97
|
+
itemLabel: string;
|
|
98
|
+
itemDescription: string;
|
|
99
|
+
itemShortcut: string;
|
|
100
|
+
itemActions: string;
|
|
101
|
+
submenuIcon: string;
|
|
102
|
+
indicatorWrapper: string;
|
|
103
|
+
indicator: string;
|
|
104
|
+
indicatorCheckIcon: string;
|
|
105
|
+
radioDot: string;
|
|
106
|
+
newTabHint: string;
|
|
107
|
+
}, undefined, undefined, undefined, undefined>;
|
|
108
|
+
export type MenuThemeVariants = VariantProps<typeof menuTheme>;
|
|
109
|
+
export type MenuSlotName = keyof ReturnType<typeof menuTheme>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type InjectionKey, type Ref } from 'vue';
|
|
2
|
+
import type { FloatingStrategy } from '../../shared/types/floating-position';
|
|
3
|
+
import type { MenuItem, MenuItemAction, MenuProps } from './Menu.vue';
|
|
4
|
+
export type MenuFocusTarget = 'panel' | 'firstItem' | 'lastItem';
|
|
5
|
+
export interface MenuFocusRequest {
|
|
6
|
+
focusTarget: MenuFocusTarget;
|
|
7
|
+
}
|
|
8
|
+
export interface MenuSettings {
|
|
9
|
+
ui: MenuProps['ui'];
|
|
10
|
+
indicatorPosition: NonNullable<MenuProps['indicatorPosition']>;
|
|
11
|
+
indicatorVariant: NonNullable<MenuProps['indicatorVariant']>;
|
|
12
|
+
strategy: FloatingStrategy;
|
|
13
|
+
flip: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MenuContext {
|
|
16
|
+
menuSettings: Readonly<Ref<MenuSettings>>;
|
|
17
|
+
menuLayer: Readonly<Ref<HTMLElement | null>>;
|
|
18
|
+
usesApplePlatform: Readonly<Ref<boolean>>;
|
|
19
|
+
closeMenu: (closeOptions: {
|
|
20
|
+
restoreFocus: boolean;
|
|
21
|
+
}) => void;
|
|
22
|
+
selectMenuItem: (menuItem: MenuItem, selectEvent: Event) => void;
|
|
23
|
+
selectMenuItemAction: (menuItemAction: MenuItemAction, selectEvent: Event) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const menuContextKey: InjectionKey<MenuContext>;
|
|
26
|
+
/** Read what a menu shares with its panels and submenus. */
|
|
27
|
+
export declare function useMenuContext(): MenuContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ShortcutDefinitions } from '../../shared/types/shortcut';
|
|
2
|
+
import type { MenuEntry, MenuGroup, MenuHeader, MenuItem, MenuSeparator } from './Menu.vue';
|
|
3
|
+
export declare function isMenuSeparator(menuEntry: MenuEntry): menuEntry is MenuSeparator;
|
|
4
|
+
export declare function isMenuGroup(menuEntry: MenuEntry): menuEntry is MenuGroup;
|
|
5
|
+
export declare function isMenuHeader(menuEntry: MenuEntry): menuEntry is MenuHeader;
|
|
6
|
+
export declare function isMenuItem(menuEntry: MenuEntry): menuEntry is MenuItem;
|
|
7
|
+
/** List every selectable item of a menu, including the ones in groups and submenus. */
|
|
8
|
+
export declare function collectMenuItems(menuEntries: MenuEntry[]): MenuItem[];
|
|
9
|
+
/** Turn the shortcuts shown in menu items into shortcuts for useShortcuts, so pressing one selects its item. */
|
|
10
|
+
export declare function extractMenuShortcuts(menuEntries: MenuEntry[]): ShortcutDefinitions;
|
|
@@ -35,8 +35,8 @@ declare const __VLS_export: import("vue").DefineComponent<TextFieldProps & {
|
|
|
35
35
|
onTrailingIconClick?: ((event: MouseEvent) => any) | undefined;
|
|
36
36
|
onTrailingActionClick?: ((event: MouseEvent) => any) | undefined;
|
|
37
37
|
}>, {
|
|
38
|
+
pill: boolean;
|
|
38
39
|
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
39
40
|
variant: "soft" | "outline";
|
|
40
|
-
pill: boolean;
|
|
41
41
|
type: "number" | "search" | "text" | "email" | "password" | "tel" | "url";
|
|
42
42
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -28,9 +28,9 @@ declare const __VLS_export: import("vue").DefineComponent<TextareaProps & {
|
|
|
28
28
|
}> & Readonly<{
|
|
29
29
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
|
+
pill: boolean;
|
|
31
32
|
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
32
33
|
variant: "soft" | "outline";
|
|
33
|
-
pill: boolean;
|
|
34
34
|
rows: number;
|
|
35
35
|
maxRows: number;
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -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>;
|
|
@@ -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>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
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 { extractMenuShortcuts, KMenu } from './components/menu';
|
|
6
|
+
export type { MenuEntry, MenuGroup, MenuHeader, MenuItem, MenuItemAction, MenuProps, MenuSeparator, MenuTriggerProps, } from './components/menu';
|
|
3
7
|
export { KTextField } from './components/text-field';
|
|
4
8
|
export type { TextFieldProps } from './components/text-field';
|
|
5
9
|
export { KTextarea } from './components/textarea';
|
|
6
10
|
export type { TextareaProps } from './components/textarea';
|
|
7
|
-
export { KAlert } from './elements/alert';
|
|
8
|
-
export type { AlertProps } from './elements/alert';
|
|
9
11
|
export { KAvatar } from './elements/avatar';
|
|
10
12
|
export type { AvatarProps } from './elements/avatar';
|
|
11
13
|
export { KBadge } from './elements/badge';
|
|
@@ -26,3 +28,6 @@ export { KSwitch } from './elements/switch';
|
|
|
26
28
|
export type { SwitchProps } from './elements/switch';
|
|
27
29
|
export { KTextLink } from './elements/text-link';
|
|
28
30
|
export type { TextLinkProps } from './elements/text-link';
|
|
31
|
+
export { useShortcuts } from './shared/composables/useShortcuts';
|
|
32
|
+
export type { ShortcutListenerOptions } from './shared/composables/useShortcuts';
|
|
33
|
+
export type { KeyCombination, ShortcutBinding, ShortcutContext, ShortcutDefinition, ShortcutDefinitions, ShortcutGuard, ShortcutHandler, ShortcutModifierName, ShortcutOptions, } from './shared/types/shortcut';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { _ as KAlert, g as KAvatar, h as KAvatarGroup, u as KBadge, v as KButton, l as KCheckbox, c as KCircularProgress, s as KLoadingDots, o as KLoadingIndicator, p as KMenu, a as KRadioGroup, i as KSwitch, f as KTextField, r as KTextLink, d as KTextarea, m as extractMenuShortcuts, n as useShortcuts } from "./src-Cn6KXW0m.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-Cn6KXW0m.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,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,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;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type ShortcutModifierName = 'ctrl' | 'meta' | 'alt' | 'shift' | 'mod';
|
|
2
|
+
export interface KeyCombination {
|
|
3
|
+
key: string;
|
|
4
|
+
modifiers: ReadonlySet<ShortcutModifierName>;
|
|
5
|
+
}
|
|
6
|
+
export interface ShortcutContext {
|
|
7
|
+
shortcut: string;
|
|
8
|
+
}
|
|
9
|
+
export type ShortcutHandler = (keyboardEvent: KeyboardEvent, shortcutContext: ShortcutContext) => void;
|
|
10
|
+
export interface ShortcutOptions {
|
|
11
|
+
handler: ShortcutHandler;
|
|
12
|
+
preventDefault?: boolean;
|
|
13
|
+
allowInEditable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type ShortcutDefinition = ShortcutHandler | ShortcutOptions;
|
|
16
|
+
export type ShortcutDefinitions = Record<string, ShortcutDefinition>;
|
|
17
|
+
export interface ShortcutBinding {
|
|
18
|
+
shortcut: string;
|
|
19
|
+
keySequence: KeyCombination[];
|
|
20
|
+
handler: ShortcutHandler;
|
|
21
|
+
preventDefault: boolean;
|
|
22
|
+
allowInEditable: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type ShortcutGuard = (keyboardEvent: KeyboardEvent, shortcutBinding: ShortcutBinding) => boolean;
|
|
25
|
+
export interface ShortcutHandlerOptions {
|
|
26
|
+
guards?: ShortcutGuard[];
|
|
27
|
+
sequenceTimeout?: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FloatingPlacement, FloatingPosition, FloatingPositionContext, FloatingPositionModifier } from '../types/floating-position';
|
|
2
|
+
/** Place the floating element against its anchor, in viewport coordinates. */
|
|
3
|
+
export declare function placeFloatingAgainstAnchor(positionContext: FloatingPositionContext, placement: FloatingPlacement): FloatingPosition;
|
|
4
|
+
/** Place the floating element against its anchor, then let each modifier adjust the position. */
|
|
5
|
+
export declare function computeFloatingPosition(positionContext: FloatingPositionContext, placement: FloatingPlacement, positionModifiers?: FloatingPositionModifier[]): FloatingPosition;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ShortcutDefinitions, ShortcutHandlerOptions } from '../types/shortcut';
|
|
2
|
+
/** Build a keydown listener that runs the handler of each shortcut pressed, including sequences like "g d". */
|
|
3
|
+
export declare function createShortcutHandler(shortcutDefinitions: ShortcutDefinitions, handlerOptions?: ShortcutHandlerOptions): (keydownEvent: Event) => void;
|