@kuina-ui/vue 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/components/alert/Alert.vue.d.ts +2 -0
  2. package/dist/components/date-picker/DateCalendar.vue.d.ts +40 -0
  3. package/dist/components/date-picker/DateCalendarMonth.vue.d.ts +27 -0
  4. package/dist/components/date-picker/DatePicker.vue.d.ts +44 -0
  5. package/dist/components/date-picker/DatePickerPanel.vue.d.ts +33 -0
  6. package/dist/components/date-picker/DateRangePicker.vue.d.ts +54 -0
  7. package/dist/components/date-picker/date-calendar.theme.d.ts +69 -0
  8. package/dist/components/date-picker/date-picker.theme.d.ts +19 -0
  9. package/dist/components/date-picker/datePickerProps.d.ts +39 -0
  10. package/dist/components/date-picker/index.d.ts +4 -0
  11. package/dist/components/date-picker/useDatePickerPopover.d.ts +21 -0
  12. package/dist/components/menu/Menu.vue.d.ts +2 -2
  13. package/dist/components/select/Select.vue.d.ts +81 -0
  14. package/dist/components/select/SelectField.vue.d.ts +70 -0
  15. package/dist/components/select/SelectOptionRow.vue.d.ts +33 -0
  16. package/dist/components/select/SelectPanel.vue.d.ts +67 -0
  17. package/dist/components/select/index.d.ts +6 -0
  18. package/dist/components/select/select-field.theme.d.ts +250 -0
  19. package/dist/components/select/select-panel.theme.d.ts +55 -0
  20. package/dist/components/select/selectOptions.d.ts +43 -0
  21. package/dist/components/select/useSelectControl.d.ts +77 -0
  22. package/dist/components/select/useSelectListbox.d.ts +48 -0
  23. package/dist/components/text-field/TextField.vue.d.ts +3 -0
  24. package/dist/components/text-field/text-field.theme.d.ts +6 -1
  25. package/dist/components/textarea/Textarea.vue.d.ts +3 -0
  26. package/dist/components/textarea/textarea.theme.d.ts +6 -1
  27. package/dist/elements/select-control/SelectControl.vue.d.ts +56 -0
  28. package/dist/elements/select-control/index.d.ts +3 -0
  29. package/dist/elements/select-control/select-control.theme.d.ts +87 -0
  30. package/dist/elements/text-link/TextLink.vue.d.ts +1 -1
  31. package/dist/index.d.ts +5 -0
  32. package/dist/index.js +1 -1
  33. package/dist/nuxt.js +1 -1
  34. package/dist/shared/composables/useCalendarLabels.d.ts +19 -0
  35. package/dist/shared/types/calendar.d.ts +14 -0
  36. package/dist/shared/utils/calendarMonth.d.ts +5 -0
  37. package/dist/shared/utils/createDateFormatters.d.ts +9 -0
  38. package/dist/shared/utils/floatingPanelTransition.d.ts +9 -0
  39. package/dist/shared/utils/isoDate.d.ts +18 -0
  40. package/dist/src-Cl5gtlze.js +6369 -0
  41. package/package.json +1 -1
  42. package/dist/src-Cn6KXW0m.js +0 -3486
@@ -0,0 +1,87 @@
1
+ import { type VariantProps } from '../../shared/utils/tv';
2
+ export declare const selectControlTheme: import("tailwind-variants").TVReturnType<{
3
+ size: Record<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
4
+ base: string[];
5
+ leadingIcon: string;
6
+ trailingIcon: string;
7
+ loadingIndicator: string;
8
+ clearButton: string;
9
+ clearIcon: string;
10
+ }>;
11
+ variant: {
12
+ outline: string;
13
+ soft: string;
14
+ ghost: string;
15
+ };
16
+ pill: {
17
+ true: string;
18
+ false: string;
19
+ };
20
+ block: {
21
+ true: {
22
+ root: string;
23
+ };
24
+ false: {
25
+ root: string;
26
+ };
27
+ };
28
+ open: {
29
+ true: {
30
+ trailingIcon: string;
31
+ };
32
+ false: {
33
+ trailingIcon: string;
34
+ };
35
+ };
36
+ invalid: {
37
+ true: string;
38
+ false: string;
39
+ };
40
+ interactive: {
41
+ true: string;
42
+ false: string;
43
+ };
44
+ disabled: {
45
+ true: {
46
+ base: string;
47
+ };
48
+ false: {
49
+ base: string;
50
+ };
51
+ };
52
+ hasSelection: {
53
+ true: string;
54
+ false: string;
55
+ };
56
+ searchesInTrigger: {
57
+ true: {
58
+ base: string;
59
+ };
60
+ false: {
61
+ base: string;
62
+ };
63
+ };
64
+ hasTrailingIcon: {
65
+ true: {
66
+ clearButton: string;
67
+ };
68
+ false: {
69
+ clearButton: string;
70
+ };
71
+ };
72
+ }, {
73
+ root: string;
74
+ base: string;
75
+ leadingIcon: string;
76
+ leadingAvatar: string;
77
+ value: string;
78
+ input: string;
79
+ selectionForScreenReaders: string;
80
+ trailing: string;
81
+ clearButton: string;
82
+ clearIcon: string;
83
+ loadingIndicator: string;
84
+ trailingIcon: string;
85
+ }, undefined, undefined, undefined, undefined>;
86
+ export type SelectControlThemeVariants = VariantProps<typeof selectControlTheme>;
87
+ export type SelectControlSlotName = keyof ReturnType<typeof selectControlTheme>;
@@ -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: "inherit" | "medium" | "semibold";
21
+ weight: "medium" | "inherit" | "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,12 @@ export { KAlert } from './components/alert';
2
2
  export type { AlertProps } from './components/alert';
3
3
  export { KAvatarGroup } from './components/avatar-group';
4
4
  export type { AvatarGroupMember, AvatarGroupProps } from './components/avatar-group';
5
+ export { KDatePicker, KDateRangePicker } from './components/date-picker';
6
+ export type { DatePickerProps, DatePickerSlots, DateRange, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut, } from './components/date-picker';
5
7
  export { extractMenuShortcuts, KMenu } from './components/menu';
6
8
  export type { MenuEntry, MenuGroup, MenuHeader, MenuItem, MenuItemAction, MenuProps, MenuSeparator, MenuTriggerProps, } from './components/menu';
9
+ export { KSelect, KSelectField } from './components/select';
10
+ export type { SelectAction, SelectFieldProps, SelectModelValue, SelectOption, SelectOptionAvatar, SelectOptionEntry, SelectOptionGroup, SelectOptionValue, SelectProps, SelectSlots, } from './components/select';
7
11
  export { KTextField } from './components/text-field';
8
12
  export type { TextFieldProps } from './components/text-field';
9
13
  export { KTextarea } from './components/textarea';
@@ -31,3 +35,4 @@ export type { TextLinkProps } from './elements/text-link';
31
35
  export { useShortcuts } from './shared/composables/useShortcuts';
32
36
  export type { ShortcutListenerOptions } from './shared/composables/useShortcuts';
33
37
  export type { KeyCombination, ShortcutBinding, ShortcutContext, ShortcutDefinition, ShortcutDefinitions, ShortcutGuard, ShortcutHandler, ShortcutModifierName, ShortcutOptions, } from './shared/types/shortcut';
38
+ export type { DateOrDateRange, Weekday } from './shared/types/calendar';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { _ as KAlert, g as KAvatar, h as KAvatarGroup, u as KBadge, v as KButton, l as KCheckbox, c as KCircularProgress, s as KLoadingDots, o as KLoadingIndicator, p as KMenu, a as KRadioGroup, i as KSwitch, f as KTextField, r as KTextLink, d as KTextarea, m as extractMenuShortcuts, n as useShortcuts } from "./src-Cn6KXW0m.js";
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";
package/dist/nuxt.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./src-Cn6KXW0m.js";
1
+ import { t as e } from "./src-Cl5gtlze.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,19 @@
1
+ import type { Weekday } from '../types/calendar';
2
+ export interface CalendarLabelOptions {
3
+ locale: string;
4
+ weekdayLabel?: (weekday: Weekday) => string;
5
+ monthLabel?: (isoMonth: string) => string;
6
+ dayLabel?: (isoDate: string) => string;
7
+ }
8
+ /** Take each calendar text from its function prop when there is one, and from the locale otherwise. */
9
+ export declare function useCalendarLabels(labelOptions: CalendarLabelOptions): {
10
+ dateFormatters: import("vue").ComputedRef<{
11
+ formatShortDate: (isoDate: string) => string;
12
+ formatFullDate: (isoDate: string) => string;
13
+ formatMonth: (isoMonth: string) => string;
14
+ formatWeekday: (weekday: Weekday) => string;
15
+ }>;
16
+ resolvedWeekdayLabel: import("vue").ComputedRef<(weekday: Weekday) => string>;
17
+ resolvedMonthLabel: import("vue").ComputedRef<(isoMonth: string) => string>;
18
+ resolvedDayLabel: import("vue").ComputedRef<(isoDate: string) => string>;
19
+ };
@@ -0,0 +1,14 @@
1
+ export type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
2
+ export type DateRange = [start: string, end: string];
3
+ export type DateOrDateRange = string | DateRange;
4
+ export interface CalendarDay {
5
+ isoDate: string;
6
+ dayNumber: number;
7
+ weekday: Weekday;
8
+ }
9
+ export interface CalendarMonth {
10
+ isoMonth: string;
11
+ firstIsoDate: string;
12
+ lastIsoDate: string;
13
+ weeks: (CalendarDay | null)[][];
14
+ }
@@ -0,0 +1,5 @@
1
+ import type { CalendarMonth, Weekday } from '../types/calendar';
2
+ /** List the seven weekdays in the order a calendar shows them, from the day its weeks start on. */
3
+ export declare function orderWeekdays(weekStartsOn: Weekday): Weekday[];
4
+ /** Lay out the days of a month in weeks starting on the given weekday, with empty cells before the first day. */
5
+ export declare function createCalendarMonth(isoMonth: string, weekStartsOn: Weekday): CalendarMonth;
@@ -0,0 +1,9 @@
1
+ import type { Weekday } from '../types/calendar';
2
+ /** Build the texts of a calendar in a language, from the dates themselves, with Intl. */
3
+ export declare function createDateFormatters(locale: string): {
4
+ formatShortDate: (isoDate: string) => string;
5
+ formatFullDate: (isoDate: string) => string;
6
+ formatMonth: (isoMonth: string) => string;
7
+ formatWeekday: (weekday: Weekday) => string;
8
+ };
9
+ export type DateFormatters = ReturnType<typeof createDateFormatters>;
@@ -0,0 +1,9 @@
1
+ import type { FloatingPlacement } from '../types/floating-position';
2
+ export declare const floatingPanelTransitionClasses: {
3
+ enterFromClass: string;
4
+ enterActiveClass: string;
5
+ leaveActiveClass: string;
6
+ leaveToClass: string;
7
+ };
8
+ /** Find the point a floating panel zooms from: the edge facing its anchor, on the side it is aligned with. */
9
+ export declare function findFloatingTransformOrigin(placement: Pick<FloatingPlacement, 'side' | 'align'>): string;
@@ -0,0 +1,18 @@
1
+ import type { DateOrDateRange, Weekday } from '../types/calendar';
2
+ /** Turn a `YYYY-MM-DD` date into a Date at midnight UTC, so that no time zone can move it to another day. */
3
+ export declare function isoDateToUtcDate(isoDate: string): Date;
4
+ export declare function utcDateToIsoDate(utcDate: Date): string;
5
+ export declare function extractIsoMonth(isoDate: string): string;
6
+ export declare function countDaysInIsoMonth(isoMonth: string): number;
7
+ export declare function findIsoDateWeekday(isoDate: string): Weekday;
8
+ export declare function addDaysToIsoDate(isoDate: string, dayCount: number): string;
9
+ export declare function addMonthsToIsoMonth(isoMonth: string, monthCount: number): string;
10
+ /** Move a date by whole months, keeping its day number, or the last day when the target month is shorter. */
11
+ export declare function addMonthsToIsoDate(isoDate: string, monthCount: number): string;
12
+ export declare function countMonthsBetweenIsoMonths(fromIsoMonth: string, toIsoMonth: string): number;
13
+ export declare function countDaysBetweenIsoDates(fromIsoDate: string, toIsoDate: string): number;
14
+ /** Tell whether a date is one of the listed dates, or falls inside one of the listed ranges, both ends included. */
15
+ export declare function isIsoDateInDateList(isoDate: string, dateList: DateOrDateRange[]): boolean;
16
+ export declare function clampIsoDate(isoDate: string, minIsoDate?: string, maxIsoDate?: string): string;
17
+ /** Read today's date in the time zone of the device, which is the day its user sees on the calendar. */
18
+ export declare function findLocalTodayIsoDate(): string;