@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
|
@@ -9,16 +9,27 @@ export interface AlertProps {
|
|
|
9
9
|
icon?: Component;
|
|
10
10
|
showIcon?: boolean;
|
|
11
11
|
actionsPlacement?: AlertThemeVariants['actionsPlacement'];
|
|
12
|
+
closable?: boolean;
|
|
13
|
+
closeLabel?: string;
|
|
12
14
|
ui?: Partial<Record<AlertSlotName, ClassNameValue>>;
|
|
13
15
|
class?: ClassNameValue;
|
|
14
16
|
}
|
|
15
17
|
declare const _default: typeof __VLS_export;
|
|
16
18
|
export default _default;
|
|
17
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertProps
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertProps & {
|
|
20
|
+
open?: boolean;
|
|
21
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"update:open": (value: boolean) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<AlertProps & {
|
|
24
|
+
open?: boolean;
|
|
25
|
+
}> & Readonly<{
|
|
26
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
variant: "solid" | "soft" | "outline";
|
|
29
|
+
color: "primary" | "danger" | "success" | "warning" | "caution" | "info" | "discovery";
|
|
20
30
|
actionsPlacement: "end" | "bottom";
|
|
21
31
|
showIcon: boolean;
|
|
32
|
+
closeLabel: string;
|
|
22
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
23
34
|
title?: (props: {}) => any;
|
|
24
35
|
} & {
|
|
@@ -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,40 @@
|
|
|
1
|
+
import type { DateOrDateRange, Weekday } from '../../shared/types/calendar';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import { type DateCalendarSlotName } from './date-calendar.theme';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
initialMonth: string;
|
|
6
|
+
initialFocusedDate: string;
|
|
7
|
+
monthCount?: number;
|
|
8
|
+
selectedStart?: string;
|
|
9
|
+
selectedEnd?: string;
|
|
10
|
+
min?: string;
|
|
11
|
+
max?: string;
|
|
12
|
+
disabledDates?: DateOrDateRange[];
|
|
13
|
+
isDateDisabled?: (isoDate: string) => boolean;
|
|
14
|
+
weekStartsOn: Weekday;
|
|
15
|
+
weekdayLabel: (weekday: Weekday) => string;
|
|
16
|
+
monthLabel: (isoMonth: string) => string;
|
|
17
|
+
dayLabel: (isoDate: string) => string;
|
|
18
|
+
previousMonthLabel: string;
|
|
19
|
+
nextMonthLabel: string;
|
|
20
|
+
ui?: Partial<Record<DateCalendarSlotName, ClassNameValue>>;
|
|
21
|
+
};
|
|
22
|
+
/** Bring a date into view: slide one month when it is next to the visible ones, else jump to it without sliding. */
|
|
23
|
+
declare function revealDate(isoDate: string): void;
|
|
24
|
+
declare function focusTabbableDay(): void;
|
|
25
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
26
|
+
focusTabbableDay: typeof focusTabbableDay;
|
|
27
|
+
revealDate: typeof revealDate;
|
|
28
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
selectDate: (isoDate: string) => any;
|
|
30
|
+
hoverDate: (isoDate: string) => any;
|
|
31
|
+
leaveDates: () => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
+
onSelectDate?: ((isoDate: string) => any) | undefined;
|
|
34
|
+
onHoverDate?: ((isoDate: string) => any) | undefined;
|
|
35
|
+
onLeaveDates?: (() => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
monthCount: number;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CalendarMonth, Weekday } from '../../shared/types/calendar';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import { type DateCalendarSlotName } from './date-calendar.theme';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
calendarMonth: CalendarMonth;
|
|
6
|
+
weekdays: Weekday[];
|
|
7
|
+
selectedStart?: string;
|
|
8
|
+
selectedEnd?: string;
|
|
9
|
+
tabbableDate: string;
|
|
10
|
+
today: string;
|
|
11
|
+
isDateUnavailable: (isoDate: string) => boolean;
|
|
12
|
+
weekdayLabel: (weekday: Weekday) => string;
|
|
13
|
+
monthLabel: (isoMonth: string) => string;
|
|
14
|
+
dayLabel: (isoDate: string) => string;
|
|
15
|
+
ui?: Partial<Record<DateCalendarSlotName, ClassNameValue>>;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
selectDate: (isoDate: string) => any;
|
|
19
|
+
hoverDate: (isoDate: string) => any;
|
|
20
|
+
keydownDate: (keyboardEvent: KeyboardEvent, isoDate: string) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onSelectDate?: ((isoDate: string) => any) | undefined;
|
|
23
|
+
onHoverDate?: ((isoDate: string) => any) | undefined;
|
|
24
|
+
onKeydownDate?: ((keyboardEvent: KeyboardEvent, isoDate: string) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DatePickerBaseProps } from './datePickerProps';
|
|
2
|
+
export interface DatePickerProps extends DatePickerBaseProps {
|
|
3
|
+
selectionLabel?: (selectedDate: string) => string;
|
|
4
|
+
}
|
|
5
|
+
export interface DatePickerSlots {
|
|
6
|
+
selection?: (selectionSlotProps: {
|
|
7
|
+
selectedDate: string;
|
|
8
|
+
}) => unknown;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DatePickerProps & {
|
|
13
|
+
modelValue?: string;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:open": (value: boolean) => any;
|
|
17
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<DatePickerProps & {
|
|
19
|
+
modelValue?: string;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
}> & Readonly<{
|
|
22
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
pill: boolean;
|
|
26
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
27
|
+
variant: "soft" | "outline" | "ghost";
|
|
28
|
+
block: boolean;
|
|
29
|
+
clearLabel: string;
|
|
30
|
+
placeholder: string;
|
|
31
|
+
side: import("../../shared/types/floating-position.ts").FloatingSide;
|
|
32
|
+
align: import("../../shared/types/floating-position.ts").FloatingAlign;
|
|
33
|
+
weekStartsOn: import("../../index.ts").Weekday;
|
|
34
|
+
previousMonthLabel: string;
|
|
35
|
+
nextMonthLabel: string;
|
|
36
|
+
flip: boolean;
|
|
37
|
+
strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
|
|
38
|
+
locale: string;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DatePickerSlots>;
|
|
40
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
anchorElement: HTMLElement | null | undefined;
|
|
7
|
+
side: FloatingSide;
|
|
8
|
+
align: FloatingAlign;
|
|
9
|
+
flip: boolean;
|
|
10
|
+
strategy: FloatingStrategy;
|
|
11
|
+
panelClass?: ClassNameValue;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_template: () => {
|
|
14
|
+
__VLS_Slots: {
|
|
15
|
+
default?: (props: {}) => any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
20
|
+
panelElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
|
|
21
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
positioned: () => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
onPositioned?: (() => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DateRange } from '../../shared/types/calendar';
|
|
2
|
+
import type { DatePickerBaseProps } from './datePickerProps';
|
|
3
|
+
export type { DateRange };
|
|
4
|
+
export interface DateRangeShortcut {
|
|
5
|
+
label: string;
|
|
6
|
+
value: DateRange;
|
|
7
|
+
}
|
|
8
|
+
export interface DateRangePickerProps extends DatePickerBaseProps {
|
|
9
|
+
shortcuts?: DateRangeShortcut[];
|
|
10
|
+
maxRangeDays?: number;
|
|
11
|
+
selectionLabel?: (selectedRange: DateRange, activeShortcut?: DateRangeShortcut) => string;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRangePickerSlots {
|
|
14
|
+
selection?: (selectionSlotProps: {
|
|
15
|
+
selectedRange: DateRange;
|
|
16
|
+
activeShortcut?: DateRangeShortcut;
|
|
17
|
+
}) => unknown;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DateRangePickerProps & {
|
|
22
|
+
modelValue?: DateRange;
|
|
23
|
+
open?: boolean;
|
|
24
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:open": (value: boolean) => any;
|
|
26
|
+
"update:modelValue": (value: DateRange | undefined) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<DateRangePickerProps & {
|
|
28
|
+
modelValue?: DateRange;
|
|
29
|
+
open?: boolean;
|
|
30
|
+
}> & Readonly<{
|
|
31
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
32
|
+
"onUpdate:modelValue"?: ((value: DateRange | undefined) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
pill: boolean;
|
|
35
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
36
|
+
variant: "soft" | "outline" | "ghost";
|
|
37
|
+
block: boolean;
|
|
38
|
+
clearLabel: string;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
side: import("../../shared/types/floating-position.ts").FloatingSide;
|
|
41
|
+
align: import("../../shared/types/floating-position.ts").FloatingAlign;
|
|
42
|
+
weekStartsOn: import("../../index.ts").Weekday;
|
|
43
|
+
previousMonthLabel: string;
|
|
44
|
+
nextMonthLabel: string;
|
|
45
|
+
shortcuts: DateRangeShortcut[];
|
|
46
|
+
flip: boolean;
|
|
47
|
+
strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
|
|
48
|
+
locale: string;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DateRangePickerSlots>;
|
|
50
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const dateCalendarTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
showsTwoMonths: {
|
|
4
|
+
true: {
|
|
5
|
+
viewport: string;
|
|
6
|
+
};
|
|
7
|
+
false: {
|
|
8
|
+
viewport: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
animatesHeight: {
|
|
12
|
+
true: {
|
|
13
|
+
viewport: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
calendar: string;
|
|
18
|
+
viewport: string;
|
|
19
|
+
previousMonth: string;
|
|
20
|
+
nextMonth: string;
|
|
21
|
+
monthTrack: string[];
|
|
22
|
+
month: string;
|
|
23
|
+
monthLabel: string;
|
|
24
|
+
weeks: string;
|
|
25
|
+
weekdays: string;
|
|
26
|
+
weekday: string;
|
|
27
|
+
week: string;
|
|
28
|
+
emptyDay: string;
|
|
29
|
+
}, undefined, undefined, undefined, undefined>;
|
|
30
|
+
export declare const dateCalendarDayTheme: import("tailwind-variants").TVReturnType<{
|
|
31
|
+
selected: {
|
|
32
|
+
true: {
|
|
33
|
+
day: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
inRange: {
|
|
37
|
+
true: {
|
|
38
|
+
dayCell: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
rangeStartEdge: {
|
|
42
|
+
round: {
|
|
43
|
+
dayCell: string;
|
|
44
|
+
};
|
|
45
|
+
fade: {
|
|
46
|
+
dayCell: string;
|
|
47
|
+
};
|
|
48
|
+
square: {
|
|
49
|
+
dayCell: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
rangeEndEdge: {
|
|
53
|
+
round: {
|
|
54
|
+
dayCell: string;
|
|
55
|
+
};
|
|
56
|
+
fade: {
|
|
57
|
+
dayCell: string;
|
|
58
|
+
};
|
|
59
|
+
square: {
|
|
60
|
+
dayCell: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
dayCell: string;
|
|
65
|
+
day: string;
|
|
66
|
+
todayIndicator: string;
|
|
67
|
+
}, undefined, undefined, undefined, undefined>;
|
|
68
|
+
export type DateCalendarDayThemeVariants = VariantProps<typeof dateCalendarDayTheme>;
|
|
69
|
+
export type DateCalendarSlotName = keyof ReturnType<typeof dateCalendarTheme> | keyof ReturnType<typeof dateCalendarDayTheme>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
tabularSelection: {
|
|
3
|
+
true: {
|
|
4
|
+
selectionText: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
activeShortcut: {
|
|
8
|
+
true: {
|
|
9
|
+
shortcutLabel: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
panel: string;
|
|
14
|
+
selectionText: string;
|
|
15
|
+
shortcuts: string;
|
|
16
|
+
shortcutLabel: string;
|
|
17
|
+
shortcutCheckIcon: string;
|
|
18
|
+
}, undefined, undefined, undefined, undefined>;
|
|
19
|
+
export type DatePickerSlotName = keyof ReturnType<typeof datePickerTheme>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { SelectControlSlotName, SelectControlThemeVariants } from '../../elements/select-control';
|
|
3
|
+
import type { DateOrDateRange, Weekday } from '../../shared/types/calendar';
|
|
4
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
5
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
6
|
+
import type { DateCalendarSlotName } from './date-calendar.theme';
|
|
7
|
+
import type { DatePickerSlotName } from './date-picker.theme';
|
|
8
|
+
export interface DatePickerBaseProps {
|
|
9
|
+
label: string;
|
|
10
|
+
min?: string;
|
|
11
|
+
max?: string;
|
|
12
|
+
disabledDates?: DateOrDateRange[];
|
|
13
|
+
isDateDisabled?: (isoDate: string) => boolean;
|
|
14
|
+
locale?: string;
|
|
15
|
+
weekStartsOn?: Weekday;
|
|
16
|
+
weekdayLabel?: (weekday: Weekday) => string;
|
|
17
|
+
monthLabel?: (isoMonth: string) => string;
|
|
18
|
+
dayLabel?: (isoDate: string) => string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
clearLabel?: string;
|
|
22
|
+
previousMonthLabel?: string;
|
|
23
|
+
nextMonthLabel?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
invalid?: boolean;
|
|
27
|
+
size?: SelectControlThemeVariants['size'];
|
|
28
|
+
variant?: SelectControlThemeVariants['variant'];
|
|
29
|
+
pill?: boolean;
|
|
30
|
+
block?: boolean;
|
|
31
|
+
leadingIcon?: Component | null;
|
|
32
|
+
trailingIcon?: Component | null;
|
|
33
|
+
side?: FloatingSide;
|
|
34
|
+
align?: FloatingAlign;
|
|
35
|
+
flip?: boolean;
|
|
36
|
+
strategy?: FloatingStrategy;
|
|
37
|
+
ui?: Partial<Record<SelectControlSlotName | DatePickerSlotName | DateCalendarSlotName, ClassNameValue>>;
|
|
38
|
+
class?: ClassNameValue;
|
|
39
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as KDatePicker } from './DatePicker.vue';
|
|
2
|
+
export { default as KDateRangePicker } from './DateRangePicker.vue';
|
|
3
|
+
export type { DatePickerProps, DatePickerSlots } from './DatePicker.vue';
|
|
4
|
+
export type { DateRange, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut } from './DateRangePicker.vue';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
interface DatePickerPopoverOptions {
|
|
3
|
+
isOpen: Ref<boolean>;
|
|
4
|
+
isOpenable: () => boolean;
|
|
5
|
+
rootElement: Readonly<Ref<HTMLElement | null>>;
|
|
6
|
+
triggerElement: Readonly<Ref<HTMLElement | null>>;
|
|
7
|
+
panelElement: Readonly<Ref<HTMLElement | null>>;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
}
|
|
10
|
+
/** Open and close the calendar of a date picker from its trigger, the keyboard, focus and outside clicks. */
|
|
11
|
+
export declare function useDatePickerPopover(popoverOptions: DatePickerPopoverOptions): {
|
|
12
|
+
openCalendar: () => void;
|
|
13
|
+
closeCalendar: ({ restoreFocus }: {
|
|
14
|
+
restoreFocus: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
toggleCalendar: () => void;
|
|
17
|
+
openCalendarFromTriggerKeys: (keyboardEvent: KeyboardEvent) => void;
|
|
18
|
+
closeCalendarOnEscape: (keyboardEvent: KeyboardEvent) => void;
|
|
19
|
+
closeCalendarWhenFocusLeaves: (focusEvent: FocusEvent) => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -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
|
+
flip: boolean;
|
|
68
|
+
strategy: FloatingStrategy;
|
|
69
|
+
indicatorPosition: "end" | "start";
|
|
70
|
+
indicatorVariant: "solid" | "ghost";
|
|
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>;
|