@kuina-ui/vue 0.3.0 → 0.5.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 (39) hide show
  1. package/README.md +143 -143
  2. package/dist/components/date-picker/DateCalendar.vue.d.ts +2 -3
  3. package/dist/components/date-picker/DateCalendarPopover.vue.d.ts +61 -0
  4. package/dist/components/date-picker/DatePicker.vue.d.ts +3 -9
  5. package/dist/components/date-picker/DatePickerField.vue.d.ts +38 -0
  6. package/dist/components/date-picker/DateRangePicker.vue.d.ts +4 -18
  7. package/dist/components/date-picker/DateRangePickerField.vue.d.ts +40 -0
  8. package/dist/components/date-picker/datePickerProps.d.ts +42 -6
  9. package/dist/components/date-picker/index.d.ts +8 -2
  10. package/dist/components/date-picker/useDatePickerControl.d.ts +63 -0
  11. package/dist/components/date-picker/useDatePickerPopover.d.ts +2 -2
  12. package/dist/components/date-picker/useDateRangeSelection.d.ts +30 -0
  13. package/dist/components/date-picker/useDateRangeTyping.d.ts +45 -0
  14. package/dist/components/date-picker/useDateTypingFocus.d.ts +28 -0
  15. package/dist/components/date-picker/useSingleDateSelection.d.ts +15 -0
  16. package/dist/components/date-picker/useSingleDateTyping.d.ts +43 -0
  17. package/dist/components/date-picker/useTypedDateInput.d.ts +32 -0
  18. package/dist/components/select/SelectField.vue.d.ts +5 -5
  19. package/dist/components/text-field/TextField.vue.d.ts +7 -1
  20. package/dist/elements/segmented-control/SegmentedControl.vue.d.ts +35 -0
  21. package/dist/elements/segmented-control/index.d.ts +2 -0
  22. package/dist/elements/segmented-control/segmented-control.theme.d.ts +62 -0
  23. package/dist/elements/select-field-control/SelectFieldControl.vue.d.ts +61 -0
  24. package/dist/elements/select-field-control/index.d.ts +3 -0
  25. package/dist/elements/select-field-control/select-field-control.theme.d.ts +101 -0
  26. package/dist/elements/text-link/TextLink.vue.d.ts +1 -1
  27. package/dist/index.d.ts +7 -2
  28. package/dist/index.js +1 -1
  29. package/dist/nuxt.js +1 -1
  30. package/dist/shared/composables/useMask.d.ts +10 -0
  31. package/dist/shared/composables/useSlidingThumb.d.ts +12 -0
  32. package/dist/shared/types/mask.d.ts +17 -0
  33. package/dist/shared/utils/createDateInputMask.d.ts +19 -0
  34. package/dist/shared/utils/createMask.d.ts +10 -0
  35. package/dist/shared/utils/isoDate.d.ts +8 -0
  36. package/dist/shared/utils/resolvePressScale.d.ts +2 -0
  37. package/dist/{src-Cl5gtlze.js → src-Bnn36nLV.js} +3952 -2465
  38. package/package.json +75 -75
  39. package/dist/components/select/select-field.theme.d.ts +0 -250
@@ -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>;
@@ -0,0 +1,35 @@
1
+ import type { Component } from 'vue';
2
+ import type { ClassNameValue } from '../../shared/utils/tv';
3
+ import type { SegmentedControlSlotName, SegmentedControlThemeVariants } from './segmented-control.theme';
4
+ export interface SegmentedControlOption {
5
+ value: string;
6
+ label: string;
7
+ icon?: Component;
8
+ disabled?: boolean;
9
+ }
10
+ export interface SegmentedControlProps {
11
+ ariaLabel: string;
12
+ options: SegmentedControlOption[];
13
+ name?: string;
14
+ size?: SegmentedControlThemeVariants['size'];
15
+ pill?: boolean;
16
+ block?: boolean;
17
+ square?: boolean;
18
+ disabled?: boolean;
19
+ ui?: Partial<Record<SegmentedControlSlotName, ClassNameValue>>;
20
+ class?: ClassNameValue;
21
+ }
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ declare const __VLS_export: import("vue").DefineComponent<SegmentedControlProps & {
25
+ modelValue?: string;
26
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "update:modelValue": (value: string | undefined) => any;
28
+ }, string, import("vue").PublicProps, Readonly<SegmentedControlProps & {
29
+ modelValue?: string;
30
+ }> & Readonly<{
31
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
32
+ }>, {
33
+ pill: boolean;
34
+ size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,2 @@
1
+ export { default as KSegmentedControl } from './SegmentedControl.vue';
2
+ export type { SegmentedControlOption, SegmentedControlProps } from './SegmentedControl.vue';
@@ -0,0 +1,62 @@
1
+ import { type VariantProps } from '../../shared/utils/tv';
2
+ export declare const segmentedControlTheme: import("tailwind-variants").TVReturnType<{
3
+ size: Record<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
4
+ root: string[];
5
+ content: string;
6
+ icon: string;
7
+ }>;
8
+ pill: {
9
+ true: {
10
+ root: string;
11
+ thumb: string;
12
+ option: string;
13
+ };
14
+ };
15
+ block: {
16
+ true: {
17
+ root: string;
18
+ option: string;
19
+ };
20
+ false: {
21
+ root: string;
22
+ option: string;
23
+ };
24
+ };
25
+ square: {
26
+ true: string;
27
+ };
28
+ disabled: {
29
+ true: {
30
+ root: string;
31
+ };
32
+ };
33
+ optionDisabled: {
34
+ true: {
35
+ option: string;
36
+ };
37
+ false: {
38
+ option: string;
39
+ };
40
+ };
41
+ isThumbPlaced: {
42
+ true: string;
43
+ false: {
44
+ thumb: string;
45
+ option: string;
46
+ };
47
+ };
48
+ animatesThumb: {
49
+ true: {
50
+ thumb: string;
51
+ };
52
+ };
53
+ }, {
54
+ root: string;
55
+ thumb: string;
56
+ option: string;
57
+ input: string;
58
+ content: string;
59
+ icon: string;
60
+ }, undefined, undefined, undefined, undefined>;
61
+ export type SegmentedControlThemeVariants = VariantProps<typeof segmentedControlTheme>;
62
+ export type SegmentedControlSlotName = keyof ReturnType<typeof segmentedControlTheme>;
@@ -0,0 +1,61 @@
1
+ import type { Component } from 'vue';
2
+ import type { ClassNameValue } from '../../shared/utils/tv';
3
+ import type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from './select-field-control.theme';
4
+ export interface SelectFieldControlProps {
5
+ label: string;
6
+ labelId: string;
7
+ valueId?: string;
8
+ hintId: string;
9
+ errorMessageId: string;
10
+ placeholder?: string;
11
+ hint?: string;
12
+ errorMessage?: string;
13
+ size?: SelectFieldControlThemeVariants['size'];
14
+ variant?: SelectFieldControlThemeVariants['variant'];
15
+ pill?: boolean;
16
+ floatLabel?: SelectFieldControlThemeVariants['floatLabel'];
17
+ open?: boolean;
18
+ invalid?: boolean;
19
+ disabled?: boolean;
20
+ hasValue?: boolean;
21
+ leadingIcon?: Component | null;
22
+ trailingIcon?: Component | null;
23
+ showsClearButton?: boolean;
24
+ clearLabel?: string;
25
+ spokenValue?: string;
26
+ triggerAttributes?: Record<string, unknown>;
27
+ ui?: Partial<Record<SelectFieldControlSlotName, ClassNameValue>>;
28
+ class?: ClassNameValue;
29
+ }
30
+ export interface SelectFieldControlSlots {
31
+ default?: () => unknown;
32
+ leading?: () => unknown;
33
+ input?: (inputSlotProps: {
34
+ inputClass: string;
35
+ }) => unknown;
36
+ status?: (statusSlotProps: {
37
+ statusClass: string;
38
+ }) => unknown;
39
+ popup?: () => unknown;
40
+ }
41
+ declare const _default: typeof __VLS_export;
42
+ export default _default;
43
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SelectFieldControlProps, {
44
+ containerElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
45
+ triggerElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
46
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
+ clear: () => any;
48
+ }, string, import("vue").PublicProps, Readonly<SelectFieldControlProps> & Readonly<{
49
+ onClear?: (() => any) | undefined;
50
+ }>, {
51
+ pill: boolean;
52
+ size: "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
53
+ variant: "soft" | "outline";
54
+ clearLabel: string;
55
+ floatLabel: "auto" | "always";
56
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SelectFieldControlSlots>;
57
+ type __VLS_WithSlots<T, S> = T & {
58
+ new (): {
59
+ $slots: S;
60
+ };
61
+ };
@@ -0,0 +1,3 @@
1
+ export { default as KSelectFieldControl } from './SelectFieldControl.vue';
2
+ export type { SelectFieldControlProps, SelectFieldControlSlots } from './SelectFieldControl.vue';
3
+ export type { SelectFieldControlSlotName, SelectFieldControlThemeVariants } from './select-field-control.theme';
@@ -0,0 +1,101 @@
1
+ import { type VariantProps } from '../../shared/utils/tv';
2
+ export declare const selectFieldControlTheme: import("tailwind-variants").TVReturnType<{
3
+ size: Record<"md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
4
+ base: string[];
5
+ leadingIcon: string;
6
+ trailingIcon: string;
7
+ loadingIndicator: string;
8
+ clearButton: string;
9
+ clearIcon: string;
10
+ }>;
11
+ variant: {
12
+ outline: string;
13
+ soft: string;
14
+ };
15
+ pill: {
16
+ true: string;
17
+ false: string;
18
+ };
19
+ fieldState: {
20
+ invalid: {
21
+ base: string;
22
+ label: string;
23
+ };
24
+ disabled: {
25
+ label: string;
26
+ };
27
+ open: {
28
+ base: string;
29
+ label: string;
30
+ };
31
+ idle: {
32
+ label: string;
33
+ };
34
+ };
35
+ floatLabel: {
36
+ auto: string;
37
+ always: {
38
+ placeholder: string;
39
+ input: string;
40
+ };
41
+ };
42
+ labelFloating: {
43
+ true: {
44
+ label: string;
45
+ };
46
+ false: {
47
+ label: string;
48
+ };
49
+ };
50
+ hasLeadingIcon: {
51
+ true: string;
52
+ false: string;
53
+ };
54
+ disabled: {
55
+ true: {
56
+ container: string;
57
+ base: string;
58
+ };
59
+ false: {
60
+ base: string;
61
+ };
62
+ };
63
+ open: {
64
+ true: {
65
+ trailingIcon: string;
66
+ placeholder: string;
67
+ };
68
+ false: {
69
+ trailingIcon: string;
70
+ };
71
+ };
72
+ hasTrailingIcon: {
73
+ true: {
74
+ clearButton: string;
75
+ };
76
+ false: {
77
+ clearButton: string;
78
+ };
79
+ };
80
+ }, {
81
+ root: string;
82
+ container: string;
83
+ base: string;
84
+ leadingIcon: string;
85
+ leadingAvatar: string;
86
+ value: string;
87
+ input: string;
88
+ placeholder: string;
89
+ selectionForScreenReaders: string;
90
+ trailing: string;
91
+ clearButton: string;
92
+ clearIcon: string;
93
+ loadingIndicator: string;
94
+ trailingIcon: string;
95
+ label: string;
96
+ hint: string;
97
+ errorMessage: string;
98
+ errorIcon: string;
99
+ }, undefined, undefined, undefined, undefined>;
100
+ export type SelectFieldControlThemeVariants = VariantProps<typeof selectFieldControlTheme>;
101
+ export type SelectFieldControlSlotName = keyof ReturnType<typeof selectFieldControlTheme>;
@@ -18,7 +18,7 @@ export default _default;
18
18
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<TextLinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextLinkProps> & Readonly<{}>, {
19
19
  color: "primary" | "inherit" | "muted";
20
20
  href: string;
21
- weight: "medium" | "inherit" | "semibold";
21
+ weight: "inherit" | "medium" | "semibold";
22
22
  underline: boolean;
23
23
  external: boolean;
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { KAlert } from './components/alert';
2
2
  export type { AlertProps } from './components/alert';
3
3
  export { KAvatarGroup } from './components/avatar-group';
4
4
  export type { AvatarGroupMember, AvatarGroupProps } from './components/avatar-group';
5
- export { KDatePicker, KDateRangePicker } from './components/date-picker';
6
- export type { DatePickerProps, DatePickerSlots, DateRange, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut, } from './components/date-picker';
5
+ export { KDatePicker, KDatePickerField, KDateRangePicker, KDateRangePickerField } from './components/date-picker';
6
+ export type { DatePickerFieldProps, DatePickerProps, DatePickerSlots, DateRange, DateRangePickerFieldProps, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut, } from './components/date-picker';
7
7
  export { extractMenuShortcuts, KMenu } from './components/menu';
8
8
  export type { MenuEntry, MenuGroup, MenuHeader, MenuItem, MenuItemAction, MenuProps, MenuSeparator, MenuTriggerProps, } from './components/menu';
9
9
  export { KSelect, KSelectField } from './components/select';
@@ -28,11 +28,16 @@ export { KLoadingIndicator } from './elements/loading-indicator';
28
28
  export type { LoadingIndicatorProps } from './elements/loading-indicator';
29
29
  export { KRadioGroup } from './elements/radio-group';
30
30
  export type { RadioGroupOption, RadioGroupProps } from './elements/radio-group';
31
+ export { KSegmentedControl } from './elements/segmented-control';
32
+ export type { SegmentedControlOption, SegmentedControlProps } from './elements/segmented-control';
31
33
  export { KSwitch } from './elements/switch';
32
34
  export type { SwitchProps } from './elements/switch';
33
35
  export { KTextLink } from './elements/text-link';
34
36
  export type { TextLinkProps } from './elements/text-link';
37
+ export { useMask } from './shared/composables/useMask';
35
38
  export { useShortcuts } from './shared/composables/useShortcuts';
36
39
  export type { ShortcutListenerOptions } from './shared/composables/useShortcuts';
37
40
  export type { KeyCombination, ShortcutBinding, ShortcutContext, ShortcutDefinition, ShortcutDefinitions, ShortcutGuard, ShortcutHandler, ShortcutModifierName, ShortcutOptions, } from './shared/types/shortcut';
38
41
  export type { DateOrDateRange, Weekday } from './shared/types/calendar';
42
+ export type { MaskOptions, MaskResult, MaskSettings, MaskToken, MaskTokens } from './shared/types/mask';
43
+ export { createMask } from './shared/utils/createMask';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { x as KAlert, b as KAvatar, y as KAvatarGroup, l as KBadge, S as KButton, c as KCheckbox, s as KCircularProgress, v as KDatePicker, _ as KDateRangePicker, o as KLoadingDots, m as KLoadingIndicator, h as KMenu, a as KRadioGroup, p as KSelect, f as KSelectField, i as KSwitch, d as KTextField, r as KTextLink, u as KTextarea, g as extractMenuShortcuts, n as useShortcuts } from "./src-Cl5gtlze.js";
1
+ export { E as KAlert, T as KAvatar, w as KAvatarGroup, u as KBadge, D as KButton, l as KCheckbox, c as KCircularProgress, x as KDatePicker, b as KDatePickerField, y as KDateRangePicker, v as KDateRangePickerField, s as KLoadingDots, h as KLoadingIndicator, g as KMenu, o as KRadioGroup, a as KSegmentedControl, m as KSelect, p as KSelectField, i as KSwitch, f as KTextField, r as KTextLink, d as KTextarea, C as createMask, _ as extractMenuShortcuts, S as useMask, n as useShortcuts } from "./src-Bnn36nLV.js";
package/dist/nuxt.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./src-Cl5gtlze.js";
1
+ import { t as e } from "./src-Bnn36nLV.js";
2
2
  import { addComponent as t, addImports as n, addVitePlugin as r, defineNuxtModule as i } from "@nuxt/kit";
3
3
  import a from "@tailwindcss/vite";
4
4
  // src/nuxt.ts
@@ -0,0 +1,10 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ import type { MaskOptions } from '../types/mask';
3
+ /** Mask what is typed in an input: bind `maskedValue` as its value and `applyMaskOnInput` on its input event. */
4
+ export declare function useMask(maskOptions: MaybeRefOrGetter<MaskOptions>, initialText?: string): {
5
+ maskedValue: Readonly<import("vue").Ref<string, string>>;
6
+ unmaskedValue: import("vue").ComputedRef<string>;
7
+ isComplete: import("vue").ComputedRef<boolean>;
8
+ setMaskedValue: (text: string) => void;
9
+ applyMaskOnInput: (inputEvent: Event) => void;
10
+ };
@@ -0,0 +1,12 @@
1
+ import { type CSSProperties, type ShallowRef, type WatchSource } from 'vue';
2
+ export interface SlidingThumbOptions {
3
+ trackElement: Readonly<ShallowRef<HTMLElement | null>>;
4
+ findSelectedElement: () => HTMLElement | null | undefined;
5
+ placementSources: WatchSource[];
6
+ }
7
+ /** Slide a thumb under the selected element of a track, and jump without sliding when the track resizes. */
8
+ export declare function useSlidingThumb({ trackElement, findSelectedElement, placementSources }: SlidingThumbOptions): {
9
+ thumbStyle: import("vue").ComputedRef<CSSProperties | undefined>;
10
+ isThumbPlaced: import("vue").Ref<boolean, boolean>;
11
+ animatesThumb: import("vue").Ref<boolean, boolean>;
12
+ };
@@ -0,0 +1,17 @@
1
+ export interface MaskToken {
2
+ pattern: RegExp;
3
+ transform?: (character: string) => string;
4
+ }
5
+ export type MaskTokens = Record<string, MaskToken>;
6
+ export interface MaskSettings {
7
+ pattern: string | string[];
8
+ tokens?: MaskTokens;
9
+ eager?: boolean;
10
+ preprocess?: (text: string) => string;
11
+ }
12
+ export type MaskOptions = string | string[] | MaskSettings;
13
+ export interface MaskResult {
14
+ masked: string;
15
+ unmasked: string;
16
+ completed: boolean;
17
+ }