@kuina-ui/vue 0.3.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 (33) hide show
  1. package/dist/components/date-picker/DateCalendar.vue.d.ts +2 -3
  2. package/dist/components/date-picker/DateCalendarPopover.vue.d.ts +61 -0
  3. package/dist/components/date-picker/DatePicker.vue.d.ts +3 -9
  4. package/dist/components/date-picker/DatePickerField.vue.d.ts +38 -0
  5. package/dist/components/date-picker/DateRangePicker.vue.d.ts +4 -18
  6. package/dist/components/date-picker/DateRangePickerField.vue.d.ts +40 -0
  7. package/dist/components/date-picker/datePickerProps.d.ts +42 -6
  8. package/dist/components/date-picker/index.d.ts +8 -2
  9. package/dist/components/date-picker/useDatePickerControl.d.ts +63 -0
  10. package/dist/components/date-picker/useDatePickerPopover.d.ts +2 -2
  11. package/dist/components/date-picker/useDateRangeSelection.d.ts +30 -0
  12. package/dist/components/date-picker/useDateRangeTyping.d.ts +45 -0
  13. package/dist/components/date-picker/useDateTypingFocus.d.ts +28 -0
  14. package/dist/components/date-picker/useSingleDateSelection.d.ts +15 -0
  15. package/dist/components/date-picker/useSingleDateTyping.d.ts +43 -0
  16. package/dist/components/date-picker/useTypedDateInput.d.ts +32 -0
  17. package/dist/components/select/SelectField.vue.d.ts +5 -5
  18. package/dist/components/text-field/TextField.vue.d.ts +7 -1
  19. package/dist/elements/select-field-control/SelectFieldControl.vue.d.ts +61 -0
  20. package/dist/elements/select-field-control/index.d.ts +3 -0
  21. package/dist/elements/select-field-control/select-field-control.theme.d.ts +101 -0
  22. package/dist/elements/text-link/TextLink.vue.d.ts +1 -1
  23. package/dist/index.d.ts +5 -2
  24. package/dist/index.js +1 -1
  25. package/dist/nuxt.js +1 -1
  26. package/dist/shared/composables/useMask.d.ts +10 -0
  27. package/dist/shared/types/mask.d.ts +17 -0
  28. package/dist/shared/utils/createDateInputMask.d.ts +19 -0
  29. package/dist/shared/utils/createMask.d.ts +10 -0
  30. package/dist/shared/utils/isoDate.d.ts +8 -0
  31. package/dist/{src-Cl5gtlze.js → src-ChY11Hfy.js} +3482 -2351
  32. package/package.json +1 -1
  33. package/dist/components/select/select-field.theme.d.ts +0 -250
@@ -19,12 +19,11 @@ type __VLS_Props = {
19
19
  nextMonthLabel: string;
20
20
  ui?: Partial<Record<DateCalendarSlotName, ClassNameValue>>;
21
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
22
  declare function focusTabbableDay(): void;
23
+ declare function showDate(isoDate: string): void;
25
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
26
25
  focusTabbableDay: typeof focusTabbableDay;
27
- revealDate: typeof revealDate;
26
+ showDate: typeof showDate;
28
27
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29
28
  selectDate: (isoDate: string) => any;
30
29
  hoverDate: (isoDate: string) => any;
@@ -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;
@@ -1,11 +1,6 @@
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;
1
+ import type { DatePickerSlots } from './datePickerProps';
2
+ import type { DatePickerBaseProps, SingleDateProps } from './datePickerProps';
3
+ export interface DatePickerProps extends DatePickerBaseProps, SingleDateProps {
9
4
  }
10
5
  declare const _default: typeof __VLS_export;
11
6
  export default _default;
@@ -27,7 +22,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DatePi
27
22
  variant: "soft" | "outline" | "ghost";
28
23
  block: boolean;
29
24
  clearLabel: string;
30
- placeholder: string;
31
25
  side: import("../../shared/types/floating-position.ts").FloatingSide;
32
26
  align: import("../../shared/types/floating-position.ts").FloatingAlign;
33
27
  weekStartsOn: import("../../index.ts").Weekday;
@@ -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
+ };
@@ -1,20 +1,7 @@
1
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;
2
+ import type { DateRangePickerSlots } from './datePickerProps';
3
+ import type { DatePickerBaseProps, DateRangeProps } from './datePickerProps';
4
+ export interface DateRangePickerProps extends DatePickerBaseProps, DateRangeProps {
18
5
  }
19
6
  declare const _default: typeof __VLS_export;
20
7
  export default _default;
@@ -36,13 +23,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DateRa
36
23
  variant: "soft" | "outline" | "ghost";
37
24
  block: boolean;
38
25
  clearLabel: string;
39
- placeholder: string;
40
26
  side: import("../../shared/types/floating-position.ts").FloatingSide;
41
27
  align: import("../../shared/types/floating-position.ts").FloatingAlign;
42
28
  weekStartsOn: import("../../index.ts").Weekday;
43
29
  previousMonthLabel: string;
44
30
  nextMonthLabel: string;
45
- shortcuts: DateRangeShortcut[];
31
+ shortcuts: import("./datePickerProps").DateRangeShortcut[];
46
32
  flip: boolean;
47
33
  strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
48
34
  locale: string;
@@ -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
+ };
@@ -1,12 +1,18 @@
1
1
  import type { Component } from 'vue';
2
2
  import type { SelectControlSlotName, SelectControlThemeVariants } from '../../elements/select-control';
3
- import type { DateOrDateRange, Weekday } from '../../shared/types/calendar';
3
+ import type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from '../../elements/select-field-control';
4
+ import type { DateOrDateRange, DateRange, Weekday } from '../../shared/types/calendar';
4
5
  import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
5
6
  import type { ClassNameValue } from '../../shared/utils/tv';
6
7
  import type { DateCalendarSlotName } from './date-calendar.theme';
7
8
  import type { DatePickerSlotName } from './date-picker.theme';
8
- export interface DatePickerBaseProps {
9
+ export interface DateRangeShortcut {
9
10
  label: string;
11
+ value: DateRange;
12
+ }
13
+ export interface DatePickerSharedProps {
14
+ label: string;
15
+ editable?: boolean;
10
16
  min?: string;
11
17
  max?: string;
12
18
  disabledDates?: DateOrDateRange[];
@@ -24,16 +30,46 @@ export interface DatePickerBaseProps {
24
30
  name?: string;
25
31
  disabled?: boolean;
26
32
  invalid?: boolean;
27
- size?: SelectControlThemeVariants['size'];
28
- variant?: SelectControlThemeVariants['variant'];
29
33
  pill?: boolean;
30
- block?: boolean;
31
34
  leadingIcon?: Component | null;
32
35
  trailingIcon?: Component | null;
33
36
  side?: FloatingSide;
34
37
  align?: FloatingAlign;
35
38
  flip?: boolean;
36
39
  strategy?: FloatingStrategy;
37
- ui?: Partial<Record<SelectControlSlotName | DatePickerSlotName | DateCalendarSlotName, ClassNameValue>>;
38
40
  class?: ClassNameValue;
39
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
+ }
@@ -1,4 +1,10 @@
1
1
  export { default as KDatePicker } from './DatePicker.vue';
2
+ export { default as KDatePickerField } from './DatePickerField.vue';
2
3
  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';
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 {};
@@ -14,8 +14,8 @@ export declare function useDatePickerPopover(popoverOptions: DatePickerPopoverOp
14
14
  restoreFocus: boolean;
15
15
  }) => void;
16
16
  toggleCalendar: () => void;
17
- openCalendarFromTriggerKeys: (keyboardEvent: KeyboardEvent) => void;
18
- closeCalendarOnEscape: (keyboardEvent: KeyboardEvent) => void;
17
+ openCalendarFromTriggerKeys: (keydownEvent: Event) => void;
18
+ closeCalendarOnEscape: (keydownEvent: Event) => void;
19
19
  closeCalendarWhenFocusLeaves: (focusEvent: FocusEvent) => void;
20
20
  };
21
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 {};
@@ -0,0 +1,45 @@
1
+ import { type Ref } from 'vue';
2
+ import type { DateRange } from '../../shared/types/calendar';
3
+ import { type IsoDateLimits } from '../../shared/utils/isoDate';
4
+ import { type DateTypingCalendarControls } from './useDateTypingFocus';
5
+ interface DateRangeTypingOptions {
6
+ selectedRange: Ref<DateRange | undefined>;
7
+ typingProps: IsoDateLimits & {
8
+ locale: string;
9
+ maxRangeDays?: number;
10
+ };
11
+ calendar: DateTypingCalendarControls;
12
+ containerElement: Readonly<Ref<HTMLElement | null>>;
13
+ rangeInput: Readonly<Ref<HTMLInputElement | null>>;
14
+ }
15
+ /** Let people type a range in one field, the dash coming by itself after the start, and update the range once both ends fit together. */
16
+ export declare function useDateRangeTyping(typingOptions: DateRangeTypingOptions): {
17
+ dateInputMask: import("vue").ComputedRef<{
18
+ pattern: string;
19
+ formatHint: string;
20
+ formatIsoDate: (isoDate: string) => string;
21
+ parseTypedDate: (typedText: string) => string | undefined;
22
+ normalizeTypedDate: (typedText: string) => string;
23
+ rangePattern: string;
24
+ rangeFormatHint: string;
25
+ formatIsoRange: ([rangeStart, rangeEnd]: [string, string]) => string;
26
+ parseTypedRange: (typedText: string) => {
27
+ hasCompleteStart: boolean;
28
+ hasCompleteEnd: boolean;
29
+ rangeStart: string | undefined;
30
+ rangeEnd: string | undefined;
31
+ };
32
+ normalizeTypedRange: (typedText: string) => string;
33
+ }>;
34
+ typedText: Readonly<Ref<string, string>>;
35
+ isTypedDateRejected: Ref<boolean, boolean>;
36
+ movesFocusIntoCalendar: Ref<boolean, boolean>;
37
+ openCalendarFromControlClick: (clickEvent: MouseEvent) => void;
38
+ resetCalendarFocusMode: () => void;
39
+ typedInputListeners: {
40
+ onInput: (inputEvent: Event) => void;
41
+ onKeydown: (keydownEvent: Event) => void;
42
+ onFocusout: (focusEvent: FocusEvent) => void;
43
+ };
44
+ };
45
+ export {};
@@ -0,0 +1,28 @@
1
+ import { type Ref } from 'vue';
2
+ type MaybeElement = Element | null | undefined;
3
+ export interface DateTypingCalendarControls {
4
+ isOpen: Ref<boolean>;
5
+ openCalendar: () => void;
6
+ closeCalendar: (closeOptions: {
7
+ restoreFocus: boolean;
8
+ }) => void;
9
+ closeCalendarWhenFocusLeaves: (focusEvent: FocusEvent) => void;
10
+ showDate: (isoDate: string) => void;
11
+ focusCalendar: () => void;
12
+ panelElement: () => MaybeElement;
13
+ }
14
+ interface DateTypingFocusOptions {
15
+ calendar: DateTypingCalendarControls;
16
+ typedInputs: () => (HTMLInputElement | null)[];
17
+ containerElement: Readonly<Ref<HTMLElement | null>>;
18
+ onFocusLeave: () => void;
19
+ }
20
+ /** Open the calendar from a typed date field without leaving it, move into the calendar on demand, and notice when the focus leaves. */
21
+ export declare function useDateTypingFocus(typingFocusOptions: DateTypingFocusOptions): {
22
+ movesFocusIntoCalendar: Ref<boolean, boolean>;
23
+ openCalendarFromControlClick: (clickEvent: MouseEvent) => void;
24
+ handleTypingKeys: (keydownEvent: Event) => void;
25
+ handleTypingFocusout: (focusEvent: FocusEvent) => void;
26
+ resetCalendarFocusMode: () => void;
27
+ };
28
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type Ref } from 'vue';
2
+ import type { DateFormatters } from '../../shared/utils/createDateFormatters';
3
+ import type { SingleDateProps } from './datePickerProps';
4
+ interface SingleDateSelectionProps extends SingleDateProps {
5
+ placeholder?: string;
6
+ min?: string;
7
+ max?: string;
8
+ }
9
+ /** Describe the date a date picker holds: the text its trigger shows and the day its calendar opens on. */
10
+ export declare function useSingleDateSelection(selectedDate: Ref<string | undefined>, selectionProps: SingleDateSelectionProps, dateFormatters: Ref<DateFormatters>, fallbackPlaceholder?: string): {
11
+ hasSelection: import("vue").ComputedRef<boolean>;
12
+ selectionText: import("vue").ComputedRef<string>;
13
+ initialFocusedDate: import("vue").ComputedRef<string>;
14
+ };
15
+ export {};
@@ -0,0 +1,43 @@
1
+ import type { Ref } from 'vue';
2
+ import { type IsoDateLimits } from '../../shared/utils/isoDate';
3
+ import { type DateTypingCalendarControls } from './useDateTypingFocus';
4
+ interface SingleDateTypingOptions {
5
+ selectedDate: Ref<string | undefined>;
6
+ typingProps: IsoDateLimits & {
7
+ locale: string;
8
+ };
9
+ calendar: DateTypingCalendarControls;
10
+ containerElement: Readonly<Ref<HTMLElement | null>>;
11
+ dateInput: Readonly<Ref<HTMLInputElement | null>>;
12
+ }
13
+ /** Let people type the date of a date picker: masked input, calendar following the typed date, and the last valid date back when the focus leaves. */
14
+ export declare function useSingleDateTyping(typingOptions: SingleDateTypingOptions): {
15
+ dateInputMask: import("vue").ComputedRef<{
16
+ pattern: string;
17
+ formatHint: string;
18
+ formatIsoDate: (isoDate: string) => string;
19
+ parseTypedDate: (typedText: string) => string | undefined;
20
+ normalizeTypedDate: (typedText: string) => string;
21
+ rangePattern: string;
22
+ rangeFormatHint: string;
23
+ formatIsoRange: ([rangeStart, rangeEnd]: [string, string]) => string;
24
+ parseTypedRange: (typedText: string) => {
25
+ hasCompleteStart: boolean;
26
+ hasCompleteEnd: boolean;
27
+ rangeStart: string | undefined;
28
+ rangeEnd: string | undefined;
29
+ };
30
+ normalizeTypedRange: (typedText: string) => string;
31
+ }>;
32
+ typedText: Readonly<Ref<string, string>>;
33
+ isTypedDateRejected: Ref<boolean, boolean>;
34
+ movesFocusIntoCalendar: Ref<boolean, boolean>;
35
+ openCalendarFromControlClick: (clickEvent: MouseEvent) => void;
36
+ resetCalendarFocusMode: () => void;
37
+ typedInputListeners: {
38
+ onInput: (inputEvent: Event) => void;
39
+ onKeydown: (keydownEvent: Event) => void;
40
+ onFocusout: (focusEvent: FocusEvent) => void;
41
+ };
42
+ };
43
+ export {};
@@ -0,0 +1,32 @@
1
+ import { type Ref } from 'vue';
2
+ interface TypedDateInputOptions {
3
+ selectedDate: Ref<string | undefined>;
4
+ locale: () => string;
5
+ isDateUnavailable: (isoDate: string) => boolean;
6
+ onDateTyped: (isoDate: string) => void;
7
+ }
8
+ /** Let people type a date through the mask of its language, keep it in sync with the selected date, and refuse dates that cannot be picked. */
9
+ export declare function useTypedDateInput(typedDateOptions: TypedDateInputOptions): {
10
+ dateInputMask: import("vue").ComputedRef<{
11
+ pattern: string;
12
+ formatHint: string;
13
+ formatIsoDate: (isoDate: string) => string;
14
+ parseTypedDate: (typedText: string) => string | undefined;
15
+ normalizeTypedDate: (typedText: string) => string;
16
+ rangePattern: string;
17
+ rangeFormatHint: string;
18
+ formatIsoRange: ([rangeStart, rangeEnd]: [string, string]) => string;
19
+ parseTypedRange: (typedText: string) => {
20
+ hasCompleteStart: boolean;
21
+ hasCompleteEnd: boolean;
22
+ rangeStart: string | undefined;
23
+ rangeEnd: string | undefined;
24
+ };
25
+ normalizeTypedRange: (typedText: string) => string;
26
+ }>;
27
+ typedText: Readonly<Ref<string, string>>;
28
+ isTypedDateRejected: Ref<boolean, boolean>;
29
+ updateTypedText: (inputEvent: Event) => void;
30
+ restoreTypedText: () => void;
31
+ };
32
+ export {};
@@ -2,7 +2,7 @@ import type { SelectModelValue, SelectSlots } from './Select.vue';
2
2
  import type { Component } from 'vue';
3
3
  import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
4
4
  import type { ClassNameValue } from '../../shared/utils/tv';
5
- import type { SelectFieldSlotName, SelectFieldThemeVariants } from './select-field.theme';
5
+ import type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from '../../elements/select-field-control';
6
6
  import type { SelectPanelSlotName } from './select-panel.theme';
7
7
  import type { SelectOption, SelectOptionEntry } from './selectOptions';
8
8
  import type { SelectAction } from './useSelectListbox';
@@ -31,17 +31,17 @@ export interface SelectFieldProps<SourceOption = SelectOption, ValueKey extends
31
31
  errorMessage?: string;
32
32
  invalid?: boolean;
33
33
  disabled?: boolean;
34
- size?: SelectFieldThemeVariants['size'];
35
- variant?: SelectFieldThemeVariants['variant'];
34
+ size?: SelectFieldControlThemeVariants['size'];
35
+ variant?: SelectFieldControlThemeVariants['variant'];
36
36
  pill?: boolean;
37
- floatLabel?: SelectFieldThemeVariants['floatLabel'];
37
+ floatLabel?: SelectFieldControlThemeVariants['floatLabel'];
38
38
  leadingIcon?: Component;
39
39
  trailingIcon?: Component | null;
40
40
  side?: FloatingSide;
41
41
  align?: FloatingAlign;
42
42
  flip?: boolean;
43
43
  strategy?: FloatingStrategy;
44
- ui?: Partial<Record<SelectFieldSlotName | SelectPanelSlotName, ClassNameValue>>;
44
+ ui?: Partial<Record<SelectFieldControlSlotName | SelectPanelSlotName, ClassNameValue>>;
45
45
  class?: ClassNameValue;
46
46
  }
47
47
  declare const _default: typeof __VLS_export;
@@ -1,4 +1,5 @@
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 {
@@ -6,6 +7,7 @@ export interface TextFieldProps {
6
7
  id?: string;
7
8
  type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number';
8
9
  placeholder?: string;
10
+ mask?: MaskOptions;
9
11
  variant?: TextFieldThemeVariants['variant'];
10
12
  size?: TextFieldThemeVariants['size'];
11
13
  pill?: boolean;
@@ -26,20 +28,24 @@ declare const _default: typeof __VLS_export;
26
28
  export default _default;
27
29
  declare const __VLS_export: import("vue").DefineComponent<TextFieldProps & {
28
30
  modelValue?: string;
31
+ unmasked?: string;
29
32
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
33
  "update:modelValue": (value: string | undefined) => any;
34
+ "update:unmasked": (value: string | undefined) => any;
31
35
  trailingIconClick: (event: MouseEvent) => any;
32
36
  trailingActionClick: (event: MouseEvent) => any;
33
37
  }, string, import("vue").PublicProps, Readonly<TextFieldProps & {
34
38
  modelValue?: string;
39
+ unmasked?: string;
35
40
  }> & Readonly<{
36
41
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
42
+ "onUpdate:unmasked"?: ((value: string | undefined) => any) | undefined;
37
43
  onTrailingIconClick?: ((event: MouseEvent) => any) | undefined;
38
44
  onTrailingActionClick?: ((event: MouseEvent) => any) | undefined;
39
45
  }>, {
40
46
  pill: boolean;
41
47
  size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
42
48
  variant: "soft" | "outline";
43
- type: "number" | "search" | "text" | "email" | "password" | "tel" | "url";
49
+ type: "number" | "search" | "text" | "email" | "tel" | "password" | "url";
44
50
  floatLabel: "auto" | "always";
45
51
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;