@kuina-ui/vue 0.2.0 → 0.4.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/components/alert/Alert.vue.d.ts +2 -0
- package/dist/components/date-picker/DateCalendar.vue.d.ts +39 -0
- package/dist/components/date-picker/DateCalendarMonth.vue.d.ts +27 -0
- package/dist/components/date-picker/DateCalendarPopover.vue.d.ts +61 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +38 -0
- package/dist/components/date-picker/DatePickerField.vue.d.ts +38 -0
- package/dist/components/date-picker/DatePickerPanel.vue.d.ts +33 -0
- package/dist/components/date-picker/DateRangePicker.vue.d.ts +40 -0
- package/dist/components/date-picker/DateRangePickerField.vue.d.ts +40 -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 +75 -0
- package/dist/components/date-picker/index.d.ts +10 -0
- package/dist/components/date-picker/useDatePickerControl.d.ts +63 -0
- package/dist/components/date-picker/useDatePickerPopover.d.ts +21 -0
- package/dist/components/date-picker/useDateRangeSelection.d.ts +30 -0
- package/dist/components/date-picker/useDateRangeTyping.d.ts +45 -0
- package/dist/components/date-picker/useDateTypingFocus.d.ts +28 -0
- package/dist/components/date-picker/useSingleDateSelection.d.ts +15 -0
- package/dist/components/date-picker/useSingleDateTyping.d.ts +43 -0
- package/dist/components/date-picker/useTypedDateInput.d.ts +32 -0
- package/dist/components/menu/Menu.vue.d.ts +2 -2
- 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-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 +10 -1
- package/dist/components/text-field/text-field.theme.d.ts +6 -1
- package/dist/components/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/textarea/textarea.theme.d.ts +6 -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/select-field-control/SelectFieldControl.vue.d.ts +61 -0
- package/dist/elements/select-field-control/index.d.ts +3 -0
- package/dist/elements/select-field-control/select-field-control.theme.d.ts +101 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/shared/composables/useCalendarLabels.d.ts +19 -0
- package/dist/shared/composables/useMask.d.ts +10 -0
- package/dist/shared/types/calendar.d.ts +14 -0
- package/dist/shared/types/mask.d.ts +17 -0
- package/dist/shared/utils/calendarMonth.d.ts +5 -0
- package/dist/shared/utils/createDateFormatters.d.ts +9 -0
- package/dist/shared/utils/createDateInputMask.d.ts +19 -0
- package/dist/shared/utils/createMask.d.ts +10 -0
- package/dist/shared/utils/floatingPanelTransition.d.ts +9 -0
- package/dist/shared/utils/isoDate.d.ts +26 -0
- package/dist/src-ChY11Hfy.js +7500 -0
- package/package.json +1 -1
- package/dist/src-Cn6KXW0m.js +0 -3486
|
@@ -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 {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
+
import type { MaskOptions } from '../../shared/types/mask';
|
|
2
3
|
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
4
|
import type { TextFieldSlotName, TextFieldThemeVariants } from './text-field.theme';
|
|
4
5
|
export interface TextFieldProps {
|
|
5
6
|
label: string;
|
|
6
7
|
id?: string;
|
|
7
8
|
type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number';
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
mask?: MaskOptions;
|
|
8
11
|
variant?: TextFieldThemeVariants['variant'];
|
|
9
12
|
size?: TextFieldThemeVariants['size'];
|
|
10
13
|
pill?: boolean;
|
|
14
|
+
floatLabel?: TextFieldThemeVariants['floatLabel'];
|
|
11
15
|
leadingIcon?: Component;
|
|
12
16
|
trailingIcon?: Component;
|
|
13
17
|
trailingIconLabel?: string;
|
|
@@ -24,19 +28,24 @@ declare const _default: typeof __VLS_export;
|
|
|
24
28
|
export default _default;
|
|
25
29
|
declare const __VLS_export: import("vue").DefineComponent<TextFieldProps & {
|
|
26
30
|
modelValue?: string;
|
|
31
|
+
unmasked?: string;
|
|
27
32
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
33
|
"update:modelValue": (value: string | undefined) => any;
|
|
34
|
+
"update:unmasked": (value: string | undefined) => any;
|
|
29
35
|
trailingIconClick: (event: MouseEvent) => any;
|
|
30
36
|
trailingActionClick: (event: MouseEvent) => any;
|
|
31
37
|
}, string, import("vue").PublicProps, Readonly<TextFieldProps & {
|
|
32
38
|
modelValue?: string;
|
|
39
|
+
unmasked?: string;
|
|
33
40
|
}> & Readonly<{
|
|
34
41
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
42
|
+
"onUpdate:unmasked"?: ((value: string | undefined) => any) | undefined;
|
|
35
43
|
onTrailingIconClick?: ((event: MouseEvent) => any) | undefined;
|
|
36
44
|
onTrailingActionClick?: ((event: MouseEvent) => any) | undefined;
|
|
37
45
|
}>, {
|
|
38
46
|
pill: boolean;
|
|
39
47
|
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
40
48
|
variant: "soft" | "outline";
|
|
41
|
-
type: "number" | "search" | "text" | "email" | "
|
|
49
|
+
type: "number" | "search" | "text" | "email" | "tel" | "password" | "url";
|
|
50
|
+
floatLabel: "auto" | "always";
|
|
42
51
|
}, {}, {}, {}, 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;
|
|
@@ -31,6 +33,7 @@ declare const __VLS_export: import("vue").DefineComponent<TextareaProps & {
|
|
|
31
33
|
pill: boolean;
|
|
32
34
|
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
33
35
|
variant: "soft" | "outline";
|
|
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;
|
|
@@ -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>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from './select-field-control.theme';
|
|
4
|
+
export interface SelectFieldControlProps {
|
|
5
|
+
label: string;
|
|
6
|
+
labelId: string;
|
|
7
|
+
valueId?: string;
|
|
8
|
+
hintId: string;
|
|
9
|
+
errorMessageId: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
size?: SelectFieldControlThemeVariants['size'];
|
|
14
|
+
variant?: SelectFieldControlThemeVariants['variant'];
|
|
15
|
+
pill?: boolean;
|
|
16
|
+
floatLabel?: SelectFieldControlThemeVariants['floatLabel'];
|
|
17
|
+
open?: boolean;
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
hasValue?: boolean;
|
|
21
|
+
leadingIcon?: Component | null;
|
|
22
|
+
trailingIcon?: Component | null;
|
|
23
|
+
showsClearButton?: boolean;
|
|
24
|
+
clearLabel?: string;
|
|
25
|
+
spokenValue?: string;
|
|
26
|
+
triggerAttributes?: Record<string, unknown>;
|
|
27
|
+
ui?: Partial<Record<SelectFieldControlSlotName, ClassNameValue>>;
|
|
28
|
+
class?: ClassNameValue;
|
|
29
|
+
}
|
|
30
|
+
export interface SelectFieldControlSlots {
|
|
31
|
+
default?: () => unknown;
|
|
32
|
+
leading?: () => unknown;
|
|
33
|
+
input?: (inputSlotProps: {
|
|
34
|
+
inputClass: string;
|
|
35
|
+
}) => unknown;
|
|
36
|
+
status?: (statusSlotProps: {
|
|
37
|
+
statusClass: string;
|
|
38
|
+
}) => unknown;
|
|
39
|
+
popup?: () => unknown;
|
|
40
|
+
}
|
|
41
|
+
declare const _default: typeof __VLS_export;
|
|
42
|
+
export default _default;
|
|
43
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SelectFieldControlProps, {
|
|
44
|
+
containerElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
|
|
45
|
+
triggerElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
|
|
46
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
clear: () => any;
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<SelectFieldControlProps> & Readonly<{
|
|
49
|
+
onClear?: (() => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
pill: boolean;
|
|
52
|
+
size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
53
|
+
variant: "soft" | "outline";
|
|
54
|
+
clearLabel: string;
|
|
55
|
+
floatLabel: "auto" | "always";
|
|
56
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SelectFieldControlSlots>;
|
|
57
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as KSelectFieldControl } from './SelectFieldControl.vue';
|
|
2
|
+
export type { SelectFieldControlProps, SelectFieldControlSlots } from './SelectFieldControl.vue';
|
|
3
|
+
export type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from './select-field-control.theme';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const selectFieldControlTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: Record<"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
|
+
};
|
|
15
|
+
pill: {
|
|
16
|
+
true: string;
|
|
17
|
+
false: string;
|
|
18
|
+
};
|
|
19
|
+
fieldState: {
|
|
20
|
+
invalid: {
|
|
21
|
+
base: string;
|
|
22
|
+
label: string;
|
|
23
|
+
};
|
|
24
|
+
disabled: {
|
|
25
|
+
label: string;
|
|
26
|
+
};
|
|
27
|
+
open: {
|
|
28
|
+
base: string;
|
|
29
|
+
label: string;
|
|
30
|
+
};
|
|
31
|
+
idle: {
|
|
32
|
+
label: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
floatLabel: {
|
|
36
|
+
auto: string;
|
|
37
|
+
always: {
|
|
38
|
+
placeholder: string;
|
|
39
|
+
input: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
labelFloating: {
|
|
43
|
+
true: {
|
|
44
|
+
label: string;
|
|
45
|
+
};
|
|
46
|
+
false: {
|
|
47
|
+
label: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
hasLeadingIcon: {
|
|
51
|
+
true: string;
|
|
52
|
+
false: string;
|
|
53
|
+
};
|
|
54
|
+
disabled: {
|
|
55
|
+
true: {
|
|
56
|
+
container: string;
|
|
57
|
+
base: string;
|
|
58
|
+
};
|
|
59
|
+
false: {
|
|
60
|
+
base: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
open: {
|
|
64
|
+
true: {
|
|
65
|
+
trailingIcon: string;
|
|
66
|
+
placeholder: string;
|
|
67
|
+
};
|
|
68
|
+
false: {
|
|
69
|
+
trailingIcon: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
hasTrailingIcon: {
|
|
73
|
+
true: {
|
|
74
|
+
clearButton: string;
|
|
75
|
+
};
|
|
76
|
+
false: {
|
|
77
|
+
clearButton: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}, {
|
|
81
|
+
root: string;
|
|
82
|
+
container: string;
|
|
83
|
+
base: string;
|
|
84
|
+
leadingIcon: string;
|
|
85
|
+
leadingAvatar: string;
|
|
86
|
+
value: string;
|
|
87
|
+
input: string;
|
|
88
|
+
placeholder: string;
|
|
89
|
+
selectionForScreenReaders: string;
|
|
90
|
+
trailing: string;
|
|
91
|
+
clearButton: string;
|
|
92
|
+
clearIcon: string;
|
|
93
|
+
loadingIndicator: string;
|
|
94
|
+
trailingIcon: string;
|
|
95
|
+
label: string;
|
|
96
|
+
hint: string;
|
|
97
|
+
errorMessage: string;
|
|
98
|
+
errorIcon: string;
|
|
99
|
+
}, undefined, undefined, undefined, undefined>;
|
|
100
|
+
export type SelectFieldControlThemeVariants = VariantProps<typeof selectFieldControlTheme>;
|
|
101
|
+
export type SelectFieldControlSlotName = keyof ReturnType<typeof selectFieldControlTheme>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,12 @@ export { KAlert } from './components/alert';
|
|
|
2
2
|
export type { AlertProps } from './components/alert';
|
|
3
3
|
export { KAvatarGroup } from './components/avatar-group';
|
|
4
4
|
export type { AvatarGroupMember, AvatarGroupProps } from './components/avatar-group';
|
|
5
|
+
export { KDatePicker, KDatePickerField, KDateRangePicker, KDateRangePickerField } from './components/date-picker';
|
|
6
|
+
export type { DatePickerFieldProps, DatePickerProps, DatePickerSlots, DateRange, DateRangePickerFieldProps, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut, } from './components/date-picker';
|
|
5
7
|
export { extractMenuShortcuts, KMenu } from './components/menu';
|
|
6
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';
|
|
7
11
|
export { KTextField } from './components/text-field';
|
|
8
12
|
export type { TextFieldProps } from './components/text-field';
|
|
9
13
|
export { KTextarea } from './components/textarea';
|
|
@@ -28,6 +32,10 @@ export { KSwitch } from './elements/switch';
|
|
|
28
32
|
export type { SwitchProps } from './elements/switch';
|
|
29
33
|
export { KTextLink } from './elements/text-link';
|
|
30
34
|
export type { TextLinkProps } from './elements/text-link';
|
|
35
|
+
export { useMask } from './shared/composables/useMask';
|
|
31
36
|
export { useShortcuts } from './shared/composables/useShortcuts';
|
|
32
37
|
export type { ShortcutListenerOptions } from './shared/composables/useShortcuts';
|
|
33
38
|
export type { KeyCombination, ShortcutBinding, ShortcutContext, ShortcutDefinition, ShortcutDefinitions, ShortcutGuard, ShortcutHandler, ShortcutModifierName, ShortcutOptions, } from './shared/types/shortcut';
|
|
39
|
+
export type { DateOrDateRange, Weekday } from './shared/types/calendar';
|
|
40
|
+
export type { MaskOptions, MaskResult, MaskSettings, MaskToken, MaskTokens } from './shared/types/mask';
|
|
41
|
+
export { createMask } from './shared/utils/createMask';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { T as KAlert, w as KAvatar, C as KAvatarGroup, l as KBadge, E as KButton, c as KCheckbox, s as KCircularProgress, b as KDatePicker, y as KDatePickerField, v as KDateRangePicker, _ as KDateRangePickerField, 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, S as createMask, g as extractMenuShortcuts, x as useMask, n as useShortcuts } from "./src-ChY11Hfy.js";
|
package/dist/nuxt.js
CHANGED
|
@@ -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,10 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { MaskOptions } from '../types/mask';
|
|
3
|
+
/** Mask what is typed in an input: bind `maskedValue` as its value and `applyMaskOnInput` on its input event. */
|
|
4
|
+
export declare function useMask(maskOptions: MaybeRefOrGetter<MaskOptions>, initialText?: string): {
|
|
5
|
+
maskedValue: Readonly<import("vue").Ref<string, string>>;
|
|
6
|
+
unmaskedValue: import("vue").ComputedRef<string>;
|
|
7
|
+
isComplete: import("vue").ComputedRef<boolean>;
|
|
8
|
+
setMaskedValue: (text: string) => void;
|
|
9
|
+
applyMaskOnInput: (inputEvent: Event) => void;
|
|
10
|
+
};
|
|
@@ -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,17 @@
|
|
|
1
|
+
export interface MaskToken {
|
|
2
|
+
pattern: RegExp;
|
|
3
|
+
transform?: (character: string) => string;
|
|
4
|
+
}
|
|
5
|
+
export type MaskTokens = Record<string, MaskToken>;
|
|
6
|
+
export interface MaskSettings {
|
|
7
|
+
pattern: string | string[];
|
|
8
|
+
tokens?: MaskTokens;
|
|
9
|
+
eager?: boolean;
|
|
10
|
+
preprocess?: (text: string) => string;
|
|
11
|
+
}
|
|
12
|
+
export type MaskOptions = string | string[] | MaskSettings;
|
|
13
|
+
export interface MaskResult {
|
|
14
|
+
masked: string;
|
|
15
|
+
unmasked: string;
|
|
16
|
+
completed: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CalendarMonth, Weekday } from '../types/calendar';
|
|
2
|
+
/** List the seven weekdays in the order a calendar shows them, from the day its weeks start on. */
|
|
3
|
+
export declare function orderWeekdays(weekStartsOn: Weekday): Weekday[];
|
|
4
|
+
/** Lay out the days of a month in weeks starting on the given weekday, with empty cells before the first day. */
|
|
5
|
+
export declare function createCalendarMonth(isoMonth: string, weekStartsOn: Weekday): CalendarMonth;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Weekday } from '../types/calendar';
|
|
2
|
+
/** Build the texts of a calendar in a language, from the dates themselves, with Intl. */
|
|
3
|
+
export declare function createDateFormatters(locale: string): {
|
|
4
|
+
formatShortDate: (isoDate: string) => string;
|
|
5
|
+
formatFullDate: (isoDate: string) => string;
|
|
6
|
+
formatMonth: (isoMonth: string) => string;
|
|
7
|
+
formatWeekday: (weekday: Weekday) => string;
|
|
8
|
+
};
|
|
9
|
+
export type DateFormatters = ReturnType<typeof createDateFormatters>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Describe how dates are typed in a language: the mask pattern, the format hint, and how typed text becomes a date. */
|
|
2
|
+
export declare function createDateInputMask(locale: string): {
|
|
3
|
+
pattern: string;
|
|
4
|
+
formatHint: string;
|
|
5
|
+
formatIsoDate: (isoDate: string) => string;
|
|
6
|
+
parseTypedDate: (typedText: string) => string | undefined;
|
|
7
|
+
normalizeTypedDate: (typedText: string) => string;
|
|
8
|
+
rangePattern: string;
|
|
9
|
+
rangeFormatHint: string;
|
|
10
|
+
formatIsoRange: ([rangeStart, rangeEnd]: [string, string]) => string;
|
|
11
|
+
parseTypedRange: (typedText: string) => {
|
|
12
|
+
hasCompleteStart: boolean;
|
|
13
|
+
hasCompleteEnd: boolean;
|
|
14
|
+
rangeStart: string | undefined;
|
|
15
|
+
rangeEnd: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
normalizeTypedRange: (typedText: string) => string;
|
|
18
|
+
};
|
|
19
|
+
export type DateInputMask = ReturnType<typeof createDateInputMask>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaskOptions, MaskResult, MaskTokens } from '../types/mask';
|
|
2
|
+
export declare const defaultMaskTokens: MaskTokens;
|
|
3
|
+
/** Build a mask from a pattern like `##/##/####`, where tokens accept characters and anything else is written as is. */
|
|
4
|
+
export declare function createMask(maskOptions: MaskOptions): {
|
|
5
|
+
apply: (text: string, applyOptions?: {
|
|
6
|
+
eager?: boolean;
|
|
7
|
+
}) => MaskResult;
|
|
8
|
+
findCaretPosition: (maskedText: string, acceptedCharacterCount: number) => number;
|
|
9
|
+
};
|
|
10
|
+
export type Mask = ReturnType<typeof createMask>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FloatingPlacement } from '../types/floating-position';
|
|
2
|
+
export declare const floatingPanelTransitionClasses: {
|
|
3
|
+
enterFromClass: string;
|
|
4
|
+
enterActiveClass: string;
|
|
5
|
+
leaveActiveClass: string;
|
|
6
|
+
leaveToClass: string;
|
|
7
|
+
};
|
|
8
|
+
/** Find the point a floating panel zooms from: the edge facing its anchor, on the side it is aligned with. */
|
|
9
|
+
export declare function findFloatingTransformOrigin(placement: Pick<FloatingPlacement, 'side' | 'align'>): string;
|