@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.
Files changed (57) hide show
  1. package/dist/components/alert/Alert.vue.d.ts +2 -0
  2. package/dist/components/date-picker/DateCalendar.vue.d.ts +39 -0
  3. package/dist/components/date-picker/DateCalendarMonth.vue.d.ts +27 -0
  4. package/dist/components/date-picker/DateCalendarPopover.vue.d.ts +61 -0
  5. package/dist/components/date-picker/DatePicker.vue.d.ts +38 -0
  6. package/dist/components/date-picker/DatePickerField.vue.d.ts +38 -0
  7. package/dist/components/date-picker/DatePickerPanel.vue.d.ts +33 -0
  8. package/dist/components/date-picker/DateRangePicker.vue.d.ts +40 -0
  9. package/dist/components/date-picker/DateRangePickerField.vue.d.ts +40 -0
  10. package/dist/components/date-picker/date-calendar.theme.d.ts +69 -0
  11. package/dist/components/date-picker/date-picker.theme.d.ts +19 -0
  12. package/dist/components/date-picker/datePickerProps.d.ts +75 -0
  13. package/dist/components/date-picker/index.d.ts +10 -0
  14. package/dist/components/date-picker/useDatePickerControl.d.ts +63 -0
  15. package/dist/components/date-picker/useDatePickerPopover.d.ts +21 -0
  16. package/dist/components/date-picker/useDateRangeSelection.d.ts +30 -0
  17. package/dist/components/date-picker/useDateRangeTyping.d.ts +45 -0
  18. package/dist/components/date-picker/useDateTypingFocus.d.ts +28 -0
  19. package/dist/components/date-picker/useSingleDateSelection.d.ts +15 -0
  20. package/dist/components/date-picker/useSingleDateTyping.d.ts +43 -0
  21. package/dist/components/date-picker/useTypedDateInput.d.ts +32 -0
  22. package/dist/components/menu/Menu.vue.d.ts +2 -2
  23. package/dist/components/select/Select.vue.d.ts +81 -0
  24. package/dist/components/select/SelectField.vue.d.ts +70 -0
  25. package/dist/components/select/SelectOptionRow.vue.d.ts +33 -0
  26. package/dist/components/select/SelectPanel.vue.d.ts +67 -0
  27. package/dist/components/select/index.d.ts +6 -0
  28. package/dist/components/select/select-panel.theme.d.ts +55 -0
  29. package/dist/components/select/selectOptions.d.ts +43 -0
  30. package/dist/components/select/useSelectControl.d.ts +77 -0
  31. package/dist/components/select/useSelectListbox.d.ts +48 -0
  32. package/dist/components/text-field/TextField.vue.d.ts +10 -1
  33. package/dist/components/text-field/text-field.theme.d.ts +6 -1
  34. package/dist/components/textarea/Textarea.vue.d.ts +3 -0
  35. package/dist/components/textarea/textarea.theme.d.ts +6 -1
  36. package/dist/elements/select-control/SelectControl.vue.d.ts +56 -0
  37. package/dist/elements/select-control/index.d.ts +3 -0
  38. package/dist/elements/select-control/select-control.theme.d.ts +87 -0
  39. package/dist/elements/select-field-control/SelectFieldControl.vue.d.ts +61 -0
  40. package/dist/elements/select-field-control/index.d.ts +3 -0
  41. package/dist/elements/select-field-control/select-field-control.theme.d.ts +101 -0
  42. package/dist/index.d.ts +8 -0
  43. package/dist/index.js +1 -1
  44. package/dist/nuxt.js +1 -1
  45. package/dist/shared/composables/useCalendarLabels.d.ts +19 -0
  46. package/dist/shared/composables/useMask.d.ts +10 -0
  47. package/dist/shared/types/calendar.d.ts +14 -0
  48. package/dist/shared/types/mask.d.ts +17 -0
  49. package/dist/shared/utils/calendarMonth.d.ts +5 -0
  50. package/dist/shared/utils/createDateFormatters.d.ts +9 -0
  51. package/dist/shared/utils/createDateInputMask.d.ts +19 -0
  52. package/dist/shared/utils/createMask.d.ts +10 -0
  53. package/dist/shared/utils/floatingPanelTransition.d.ts +9 -0
  54. package/dist/shared/utils/isoDate.d.ts +26 -0
  55. package/dist/src-ChY11Hfy.js +7500 -0
  56. package/package.json +1 -1
  57. package/dist/src-Cn6KXW0m.js +0 -3486
@@ -10,6 +10,7 @@ export interface AlertProps {
10
10
  showIcon?: boolean;
11
11
  actionsPlacement?: AlertThemeVariants['actionsPlacement'];
12
12
  closable?: boolean;
13
+ closeLabel?: string;
13
14
  ui?: Partial<Record<AlertSlotName, ClassNameValue>>;
14
15
  class?: ClassNameValue;
15
16
  }
@@ -28,6 +29,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertP
28
29
  color: "primary" | "danger" | "success" | "warning" | "caution" | "info" | "discovery";
29
30
  actionsPlacement: "end" | "bottom";
30
31
  showIcon: boolean;
32
+ closeLabel: string;
31
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
32
34
  title?: (props: {}) => any;
33
35
  } & {
@@ -0,0 +1,39 @@
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
+ declare function focusTabbableDay(): void;
23
+ declare function showDate(isoDate: string): void;
24
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
25
+ focusTabbableDay: typeof focusTabbableDay;
26
+ showDate: typeof showDate;
27
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ selectDate: (isoDate: string) => any;
29
+ hoverDate: (isoDate: string) => any;
30
+ leaveDates: () => any;
31
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
32
+ onSelectDate?: ((isoDate: string) => any) | undefined;
33
+ onHoverDate?: ((isoDate: string) => any) | undefined;
34
+ onLeaveDates?: (() => any) | undefined;
35
+ }>, {
36
+ monthCount: number;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: typeof __VLS_export;
39
+ 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,61 @@
1
+ import type { DateOrDateRange, Weekday } from '../../shared/types/calendar';
2
+ import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
3
+ import type { ClassNameValue } from '../../shared/utils/tv';
4
+ import type { DateCalendarSlotName } from './date-calendar.theme';
5
+ import { type DatePickerSlotName } from './date-picker.theme';
6
+ import type { DateRangeShortcut } from './datePickerProps';
7
+ type __VLS_Props = {
8
+ open: boolean;
9
+ dialogId: string;
10
+ label: string;
11
+ anchorElement: HTMLElement | null | undefined;
12
+ side: FloatingSide;
13
+ align: FloatingAlign;
14
+ flip: boolean;
15
+ strategy: FloatingStrategy;
16
+ initialFocusedDate: string;
17
+ monthCount?: number;
18
+ selectedStart?: string;
19
+ selectedEnd?: string;
20
+ min?: string;
21
+ max?: string;
22
+ disabledDates?: DateOrDateRange[];
23
+ isDateDisabled?: (isoDate: string) => boolean;
24
+ weekStartsOn: Weekday;
25
+ weekdayLabel: (weekday: Weekday) => string;
26
+ monthLabel: (isoMonth: string) => string;
27
+ dayLabel: (isoDate: string) => string;
28
+ previousMonthLabel: string;
29
+ nextMonthLabel: string;
30
+ shortcuts?: DateRangeShortcut[];
31
+ activeShortcut?: DateRangeShortcut;
32
+ focusesCalendarOnOpen?: boolean;
33
+ ui?: Partial<Record<DatePickerSlotName | DateCalendarSlotName, ClassNameValue>>;
34
+ };
35
+ declare function showDate(isoDate: string): void;
36
+ declare function focusCalendar(): void;
37
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
38
+ panelElement: import("vue").ComputedRef<HTMLElement | null>;
39
+ showDate: typeof showDate;
40
+ focusCalendar: typeof focusCalendar;
41
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
42
+ selectDate: (isoDate: string) => any;
43
+ hoverDate: (isoDate: string) => any;
44
+ leaveDates: () => any;
45
+ selectShortcut: (shortcut: DateRangeShortcut) => any;
46
+ panelKeydown: (keyboardEvent: KeyboardEvent) => any;
47
+ panelFocusout: (focusEvent: FocusEvent) => any;
48
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
49
+ onSelectDate?: ((isoDate: string) => any) | undefined;
50
+ onHoverDate?: ((isoDate: string) => any) | undefined;
51
+ onLeaveDates?: (() => any) | undefined;
52
+ onSelectShortcut?: ((shortcut: DateRangeShortcut) => any) | undefined;
53
+ onPanelKeydown?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
54
+ onPanelFocusout?: ((focusEvent: FocusEvent) => any) | undefined;
55
+ }>, {
56
+ monthCount: number;
57
+ shortcuts: DateRangeShortcut[];
58
+ focusesCalendarOnOpen: boolean;
59
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
+ declare const _default: typeof __VLS_export;
61
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import type { DatePickerSlots } from './datePickerProps';
2
+ import type { DatePickerBaseProps, SingleDateProps } from './datePickerProps';
3
+ export interface DatePickerProps extends DatePickerBaseProps, SingleDateProps {
4
+ }
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DatePickerProps & {
8
+ modelValue?: string;
9
+ open?: boolean;
10
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:open": (value: boolean) => any;
12
+ "update:modelValue": (value: string | undefined) => any;
13
+ }, string, import("vue").PublicProps, Readonly<DatePickerProps & {
14
+ modelValue?: string;
15
+ open?: boolean;
16
+ }> & Readonly<{
17
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
18
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
19
+ }>, {
20
+ pill: boolean;
21
+ size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
22
+ variant: "soft" | "outline" | "ghost";
23
+ block: boolean;
24
+ clearLabel: string;
25
+ side: import("../../shared/types/floating-position.ts").FloatingSide;
26
+ align: import("../../shared/types/floating-position.ts").FloatingAlign;
27
+ weekStartsOn: import("../../index.ts").Weekday;
28
+ previousMonthLabel: string;
29
+ nextMonthLabel: string;
30
+ flip: boolean;
31
+ strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
32
+ locale: string;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DatePickerSlots>;
34
+ type __VLS_WithSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -0,0 +1,38 @@
1
+ import type { DatePickerSlots } from './datePickerProps';
2
+ import type { DatePickerFieldBaseProps, SingleDateProps } from './datePickerProps';
3
+ export interface DatePickerFieldProps extends DatePickerFieldBaseProps, SingleDateProps {
4
+ }
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DatePickerFieldProps & {
8
+ modelValue?: string;
9
+ open?: boolean;
10
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:open": (value: boolean) => any;
12
+ "update:modelValue": (value: string | undefined) => any;
13
+ }, string, import("vue").PublicProps, Readonly<DatePickerFieldProps & {
14
+ modelValue?: string;
15
+ open?: boolean;
16
+ }> & Readonly<{
17
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
18
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
19
+ }>, {
20
+ pill: boolean;
21
+ size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
22
+ variant: "soft" | "outline";
23
+ clearLabel: string;
24
+ side: import("../../shared/types/floating-position.ts").FloatingSide;
25
+ align: import("../../shared/types/floating-position.ts").FloatingAlign;
26
+ weekStartsOn: import("../../index.ts").Weekday;
27
+ previousMonthLabel: string;
28
+ nextMonthLabel: string;
29
+ flip: boolean;
30
+ strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
31
+ floatLabel: "auto" | "always";
32
+ locale: string;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DatePickerSlots>;
34
+ type __VLS_WithSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -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,40 @@
1
+ import type { DateRange } from '../../shared/types/calendar';
2
+ import type { DateRangePickerSlots } from './datePickerProps';
3
+ import type { DatePickerBaseProps, DateRangeProps } from './datePickerProps';
4
+ export interface DateRangePickerProps extends DatePickerBaseProps, DateRangeProps {
5
+ }
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
8
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DateRangePickerProps & {
9
+ modelValue?: DateRange;
10
+ open?: boolean;
11
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:open": (value: boolean) => any;
13
+ "update:modelValue": (value: DateRange | undefined) => any;
14
+ }, string, import("vue").PublicProps, Readonly<DateRangePickerProps & {
15
+ modelValue?: DateRange;
16
+ open?: boolean;
17
+ }> & Readonly<{
18
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: DateRange | undefined) => any) | undefined;
20
+ }>, {
21
+ pill: boolean;
22
+ size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
23
+ variant: "soft" | "outline" | "ghost";
24
+ block: boolean;
25
+ clearLabel: string;
26
+ side: import("../../shared/types/floating-position.ts").FloatingSide;
27
+ align: import("../../shared/types/floating-position.ts").FloatingAlign;
28
+ weekStartsOn: import("../../index.ts").Weekday;
29
+ previousMonthLabel: string;
30
+ nextMonthLabel: string;
31
+ shortcuts: import("./datePickerProps").DateRangeShortcut[];
32
+ flip: boolean;
33
+ strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
34
+ locale: string;
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DateRangePickerSlots>;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,40 @@
1
+ import type { DateRange } from '../../shared/types/calendar';
2
+ import type { DateRangePickerSlots } from './datePickerProps';
3
+ import type { DatePickerFieldBaseProps, DateRangeProps } from './datePickerProps';
4
+ export interface DateRangePickerFieldProps extends DatePickerFieldBaseProps, DateRangeProps {
5
+ }
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
8
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DateRangePickerFieldProps & {
9
+ modelValue?: DateRange;
10
+ open?: boolean;
11
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:open": (value: boolean) => any;
13
+ "update:modelValue": (value: DateRange | undefined) => any;
14
+ }, string, import("vue").PublicProps, Readonly<DateRangePickerFieldProps & {
15
+ modelValue?: DateRange;
16
+ open?: boolean;
17
+ }> & Readonly<{
18
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: DateRange | undefined) => any) | undefined;
20
+ }>, {
21
+ pill: boolean;
22
+ size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
23
+ variant: "soft" | "outline";
24
+ clearLabel: string;
25
+ side: import("../../shared/types/floating-position.ts").FloatingSide;
26
+ align: import("../../shared/types/floating-position.ts").FloatingAlign;
27
+ weekStartsOn: import("../../index.ts").Weekday;
28
+ previousMonthLabel: string;
29
+ nextMonthLabel: string;
30
+ shortcuts: import("./datePickerProps").DateRangeShortcut[];
31
+ flip: boolean;
32
+ strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
33
+ floatLabel: "auto" | "always";
34
+ locale: string;
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DateRangePickerSlots>;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -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,75 @@
1
+ import type { Component } from 'vue';
2
+ import type { SelectControlSlotName, SelectControlThemeVariants } from '../../elements/select-control';
3
+ import type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from '../../elements/select-field-control';
4
+ import type { DateOrDateRange, DateRange, Weekday } from '../../shared/types/calendar';
5
+ import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
6
+ import type { ClassNameValue } from '../../shared/utils/tv';
7
+ import type { DateCalendarSlotName } from './date-calendar.theme';
8
+ import type { DatePickerSlotName } from './date-picker.theme';
9
+ export interface DateRangeShortcut {
10
+ label: string;
11
+ value: DateRange;
12
+ }
13
+ export interface DatePickerSharedProps {
14
+ label: string;
15
+ editable?: boolean;
16
+ min?: string;
17
+ max?: string;
18
+ disabledDates?: DateOrDateRange[];
19
+ isDateDisabled?: (isoDate: string) => boolean;
20
+ locale?: string;
21
+ weekStartsOn?: Weekday;
22
+ weekdayLabel?: (weekday: Weekday) => string;
23
+ monthLabel?: (isoMonth: string) => string;
24
+ dayLabel?: (isoDate: string) => string;
25
+ placeholder?: string;
26
+ clearable?: boolean;
27
+ clearLabel?: string;
28
+ previousMonthLabel?: string;
29
+ nextMonthLabel?: string;
30
+ name?: string;
31
+ disabled?: boolean;
32
+ invalid?: boolean;
33
+ pill?: boolean;
34
+ leadingIcon?: Component | null;
35
+ trailingIcon?: Component | null;
36
+ side?: FloatingSide;
37
+ align?: FloatingAlign;
38
+ flip?: boolean;
39
+ strategy?: FloatingStrategy;
40
+ class?: ClassNameValue;
41
+ }
42
+ export interface DatePickerBaseProps extends DatePickerSharedProps {
43
+ size?: SelectControlThemeVariants['size'];
44
+ variant?: SelectControlThemeVariants['variant'];
45
+ block?: boolean;
46
+ ui?: Partial<Record<SelectControlSlotName | DatePickerSlotName | DateCalendarSlotName, ClassNameValue>>;
47
+ }
48
+ export interface DatePickerFieldBaseProps extends DatePickerSharedProps {
49
+ id?: string;
50
+ hint?: string;
51
+ errorMessage?: string;
52
+ floatLabel?: SelectFieldControlThemeVariants['floatLabel'];
53
+ size?: SelectFieldControlThemeVariants['size'];
54
+ variant?: SelectFieldControlThemeVariants['variant'];
55
+ ui?: Partial<Record<SelectFieldControlSlotName | DatePickerSlotName | DateCalendarSlotName, ClassNameValue>>;
56
+ }
57
+ export interface SingleDateProps {
58
+ selectionLabel?: (selectedDate: string) => string;
59
+ }
60
+ export interface DateRangeProps {
61
+ shortcuts?: DateRangeShortcut[];
62
+ maxRangeDays?: number;
63
+ selectionLabel?: (selectedRange: DateRange, activeShortcut?: DateRangeShortcut) => string;
64
+ }
65
+ export interface DatePickerSlots {
66
+ selection?: (selectionSlotProps: {
67
+ selectedDate: string;
68
+ }) => unknown;
69
+ }
70
+ export interface DateRangePickerSlots {
71
+ selection?: (selectionSlotProps: {
72
+ selectedRange: DateRange;
73
+ activeShortcut?: DateRangeShortcut;
74
+ }) => unknown;
75
+ }
@@ -0,0 +1,10 @@
1
+ export { default as KDatePicker } from './DatePicker.vue';
2
+ export { default as KDatePickerField } from './DatePickerField.vue';
3
+ export { default as KDateRangePicker } from './DateRangePicker.vue';
4
+ export { default as KDateRangePickerField } from './DateRangePickerField.vue';
5
+ export type { DatePickerProps } from './DatePicker.vue';
6
+ export type { DatePickerFieldProps } from './DatePickerField.vue';
7
+ export type { DateRangePickerProps } from './DateRangePicker.vue';
8
+ export type { DateRangePickerFieldProps } from './DateRangePickerField.vue';
9
+ export type { DatePickerSlots, DateRangePickerSlots, DateRangeShortcut } from './datePickerProps';
10
+ export type { DateRange } from '../../shared/types/calendar';
@@ -0,0 +1,63 @@
1
+ import { type Component, type Ref } from 'vue';
2
+ import { type CalendarLabelOptions } from '../../shared/composables/useCalendarLabels';
3
+ interface DatePickerControlProps extends CalendarLabelOptions {
4
+ disabled?: boolean;
5
+ leadingIcon?: Component | null;
6
+ trailingIcon?: Component | null;
7
+ }
8
+ interface DatePickerControlOptions {
9
+ isOpen: Ref<boolean>;
10
+ isInvalid: () => boolean;
11
+ rootElement: Readonly<Ref<HTMLElement | null>>;
12
+ triggerElement: Readonly<Ref<HTMLElement | null>>;
13
+ panelElement: Readonly<Ref<HTMLElement | null>>;
14
+ onClose?: () => void;
15
+ }
16
+ /** Share between the date pickers how their calendar opens, what their trigger says to assistive technology, and their texts and icons. */
17
+ export declare function useDatePickerControl(controlProps: DatePickerControlProps, controlOptions: DatePickerControlOptions): {
18
+ dialogTriggerAttributes: import("vue").ComputedRef<{
19
+ role: string;
20
+ tabindex: number;
21
+ 'aria-haspopup': "dialog";
22
+ 'aria-expanded': boolean;
23
+ 'aria-controls': string | undefined;
24
+ 'aria-disabled': true | undefined;
25
+ 'aria-invalid': true | undefined;
26
+ onClick: () => void;
27
+ onKeydown: (keydownEvent: Event) => void;
28
+ }>;
29
+ typedInputAttributes: import("vue").ComputedRef<{
30
+ type: string;
31
+ inputmode: "numeric";
32
+ autocomplete: string;
33
+ spellcheck: boolean;
34
+ role: string;
35
+ 'aria-haspopup': "dialog";
36
+ 'aria-expanded': boolean;
37
+ 'aria-controls': string | undefined;
38
+ 'aria-invalid': true | undefined;
39
+ disabled: boolean | undefined;
40
+ }>;
41
+ resolvedLeadingIcon: import("vue").ComputedRef<Component | import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}> | null>;
42
+ resolvedTrailingIcon: import("vue").ComputedRef<Component | import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}> | null>;
43
+ openCalendar: () => void;
44
+ closeCalendar: ({ restoreFocus }: {
45
+ restoreFocus: boolean;
46
+ }) => void;
47
+ toggleCalendar: () => void;
48
+ openCalendarFromTriggerKeys: (keydownEvent: Event) => void;
49
+ closeCalendarOnEscape: (keydownEvent: Event) => void;
50
+ closeCalendarWhenFocusLeaves: (focusEvent: FocusEvent) => void;
51
+ dateFormatters: import("vue").ComputedRef<{
52
+ formatShortDate: (isoDate: string) => string;
53
+ formatFullDate: (isoDate: string) => string;
54
+ formatMonth: (isoMonth: string) => string;
55
+ formatWeekday: (weekday: import("../..").Weekday) => string;
56
+ }>;
57
+ resolvedWeekdayLabel: import("vue").ComputedRef<(weekday: import("../..").Weekday) => string>;
58
+ resolvedMonthLabel: import("vue").ComputedRef<(isoMonth: string) => string>;
59
+ resolvedDayLabel: import("vue").ComputedRef<(isoDate: string) => string>;
60
+ calendarDialogId: string;
61
+ isOpenable: import("vue").ComputedRef<boolean>;
62
+ };
63
+ export {};
@@ -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: (keydownEvent: Event) => void;
18
+ closeCalendarOnEscape: (keydownEvent: Event) => void;
19
+ closeCalendarWhenFocusLeaves: (focusEvent: FocusEvent) => void;
20
+ };
21
+ export {};
@@ -0,0 +1,30 @@
1
+ import { type Ref } from 'vue';
2
+ import type { DateRange } from '../../shared/types/calendar';
3
+ import type { DateFormatters } from '../../shared/utils/createDateFormatters';
4
+ import type { DateRangeProps, DateRangeShortcut } from './datePickerProps';
5
+ interface DateRangeSelectionProps extends DateRangeProps {
6
+ placeholder?: string;
7
+ min?: string;
8
+ max?: string;
9
+ isDateDisabled?: (isoDate: string) => boolean;
10
+ }
11
+ interface DateRangeSelectionOptions {
12
+ dateFormatters: Ref<DateFormatters>;
13
+ fallbackPlaceholder?: string;
14
+ showDate: (isoDate: string) => void;
15
+ }
16
+ /** Pick a range in two clicks with a live preview, from shortcuts, and describe it in the trigger. */
17
+ export declare function useDateRangeSelection(selectedRange: Ref<DateRange | undefined>, selectionProps: DateRangeSelectionProps, selectionOptions: DateRangeSelectionOptions): {
18
+ hasSelection: import("vue").ComputedRef<boolean>;
19
+ activeShortcut: import("vue").ComputedRef<DateRangeShortcut | undefined>;
20
+ selectionText: import("vue").ComputedRef<string>;
21
+ displayedRange: import("vue").ComputedRef<DateRange | undefined>;
22
+ initialFocusedDate: import("vue").ComputedRef<string>;
23
+ isDateDisabledDuringSelection: (isoDate: string) => boolean;
24
+ forgetPendingRange: () => void;
25
+ selectRangeDate: (isoDate: string) => void;
26
+ previewRangeEnd: (isoDate: string) => void;
27
+ resetRangePreview: () => void;
28
+ selectShortcut: (shortcut: DateRangeShortcut) => void;
29
+ };
30
+ export {};