@kuina-ui/vue 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/{elements → components}/alert/Alert.vue.d.ts +14 -3
  2. package/dist/{elements → components}/alert/alert.theme.d.ts +1 -0
  3. package/dist/components/avatar-group/AvatarGroup.vue.d.ts +1 -1
  4. package/dist/components/date-picker/DateCalendar.vue.d.ts +40 -0
  5. package/dist/components/date-picker/DateCalendarMonth.vue.d.ts +27 -0
  6. package/dist/components/date-picker/DatePicker.vue.d.ts +44 -0
  7. package/dist/components/date-picker/DatePickerPanel.vue.d.ts +33 -0
  8. package/dist/components/date-picker/DateRangePicker.vue.d.ts +54 -0
  9. package/dist/components/date-picker/date-calendar.theme.d.ts +69 -0
  10. package/dist/components/date-picker/date-picker.theme.d.ts +19 -0
  11. package/dist/components/date-picker/datePickerProps.d.ts +39 -0
  12. package/dist/components/date-picker/index.d.ts +4 -0
  13. package/dist/components/date-picker/useDatePickerPopover.d.ts +21 -0
  14. package/dist/components/menu/Menu.vue.d.ts +87 -0
  15. package/dist/components/menu/MenuItemRow.vue.d.ts +18 -0
  16. package/dist/components/menu/MenuPanel.vue.d.ts +24 -0
  17. package/dist/components/menu/index.d.ts +3 -0
  18. package/dist/components/menu/menu.theme.d.ts +109 -0
  19. package/dist/components/menu/menuContext.d.ts +27 -0
  20. package/dist/components/menu/menuEntries.d.ts +10 -0
  21. package/dist/components/select/Select.vue.d.ts +81 -0
  22. package/dist/components/select/SelectField.vue.d.ts +70 -0
  23. package/dist/components/select/SelectOptionRow.vue.d.ts +33 -0
  24. package/dist/components/select/SelectPanel.vue.d.ts +67 -0
  25. package/dist/components/select/index.d.ts +6 -0
  26. package/dist/components/select/select-field.theme.d.ts +250 -0
  27. package/dist/components/select/select-panel.theme.d.ts +55 -0
  28. package/dist/components/select/selectOptions.d.ts +43 -0
  29. package/dist/components/select/useSelectControl.d.ts +77 -0
  30. package/dist/components/select/useSelectListbox.d.ts +48 -0
  31. package/dist/components/text-field/TextField.vue.d.ts +4 -1
  32. package/dist/components/text-field/text-field.theme.d.ts +6 -1
  33. package/dist/components/textarea/Textarea.vue.d.ts +4 -1
  34. package/dist/components/textarea/textarea.theme.d.ts +6 -1
  35. package/dist/elements/avatar/Avatar.vue.d.ts +3 -3
  36. package/dist/elements/badge/Badge.vue.d.ts +2 -2
  37. package/dist/elements/button/Button.vue.d.ts +4 -4
  38. package/dist/elements/checkbox/Checkbox.vue.d.ts +2 -2
  39. package/dist/elements/radio-group/RadioGroup.vue.d.ts +1 -1
  40. package/dist/elements/select-control/SelectControl.vue.d.ts +56 -0
  41. package/dist/elements/select-control/index.d.ts +3 -0
  42. package/dist/elements/select-control/select-control.theme.d.ts +87 -0
  43. package/dist/elements/switch/Switch.vue.d.ts +2 -2
  44. package/dist/elements/text-link/TextLink.vue.d.ts +1 -1
  45. package/dist/index.d.ts +12 -2
  46. package/dist/index.js +1 -1
  47. package/dist/nuxt.js +13 -8
  48. package/dist/shared/composables/useApplePlatform.d.ts +2 -0
  49. package/dist/shared/composables/useCalendarLabels.d.ts +19 -0
  50. package/dist/shared/composables/useDismissOnOutsidePointerDown.d.ts +9 -0
  51. package/dist/shared/composables/useFloatingPosition.d.ts +20 -0
  52. package/dist/shared/composables/useShortcuts.d.ts +9 -0
  53. package/dist/shared/types/calendar.d.ts +14 -0
  54. package/dist/shared/types/floating-position.d.ts +28 -0
  55. package/dist/shared/types/shortcut.d.ts +28 -0
  56. package/dist/shared/utils/calendarMonth.d.ts +5 -0
  57. package/dist/shared/utils/computeFloatingPosition.d.ts +5 -0
  58. package/dist/shared/utils/createDateFormatters.d.ts +9 -0
  59. package/dist/shared/utils/createShortcutHandler.d.ts +3 -0
  60. package/dist/shared/utils/createTypeaheadSearch.d.ts +2 -0
  61. package/dist/shared/utils/editableFieldGuard.d.ts +3 -0
  62. package/dist/shared/utils/flipFloatingPosition.d.ts +3 -0
  63. package/dist/shared/utils/floatingPanelTransition.d.ts +9 -0
  64. package/dist/shared/utils/formatShortcut.d.ts +2 -0
  65. package/dist/shared/utils/isApplePlatform.d.ts +2 -0
  66. package/dist/shared/utils/isExternalUrl.d.ts +2 -0
  67. package/dist/shared/utils/isoDate.d.ts +18 -0
  68. package/dist/shared/utils/parseShortcut.d.ts +3 -0
  69. package/dist/src-Cl5gtlze.js +6369 -0
  70. package/package.json +4 -1
  71. package/dist/src-CcuBQU4y.js +0 -2371
  72. /package/dist/{elements → components}/alert/index.d.ts +0 -0
@@ -0,0 +1,28 @@
1
+ export type ShortcutModifierName = 'ctrl' | 'meta' | 'alt' | 'shift' | 'mod';
2
+ export interface KeyCombination {
3
+ key: string;
4
+ modifiers: ReadonlySet<ShortcutModifierName>;
5
+ }
6
+ export interface ShortcutContext {
7
+ shortcut: string;
8
+ }
9
+ export type ShortcutHandler = (keyboardEvent: KeyboardEvent, shortcutContext: ShortcutContext) => void;
10
+ export interface ShortcutOptions {
11
+ handler: ShortcutHandler;
12
+ preventDefault?: boolean;
13
+ allowInEditable?: boolean;
14
+ }
15
+ export type ShortcutDefinition = ShortcutHandler | ShortcutOptions;
16
+ export type ShortcutDefinitions = Record<string, ShortcutDefinition>;
17
+ export interface ShortcutBinding {
18
+ shortcut: string;
19
+ keySequence: KeyCombination[];
20
+ handler: ShortcutHandler;
21
+ preventDefault: boolean;
22
+ allowInEditable: boolean;
23
+ }
24
+ export type ShortcutGuard = (keyboardEvent: KeyboardEvent, shortcutBinding: ShortcutBinding) => boolean;
25
+ export interface ShortcutHandlerOptions {
26
+ guards?: ShortcutGuard[];
27
+ sequenceTimeout?: number;
28
+ }
@@ -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,5 @@
1
+ import type { FloatingPlacement, FloatingPosition, FloatingPositionContext, FloatingPositionModifier } from '../types/floating-position';
2
+ /** Place the floating element against its anchor, in viewport coordinates. */
3
+ export declare function placeFloatingAgainstAnchor(positionContext: FloatingPositionContext, placement: FloatingPlacement): FloatingPosition;
4
+ /** Place the floating element against its anchor, then let each modifier adjust the position. */
5
+ export declare function computeFloatingPosition(positionContext: FloatingPositionContext, placement: FloatingPlacement, positionModifiers?: FloatingPositionModifier[]): FloatingPosition;
@@ -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,3 @@
1
+ import type { ShortcutDefinitions, ShortcutHandlerOptions } from '../types/shortcut';
2
+ /** Build a keydown listener that runs the handler of each shortcut pressed, including sequences like "g d". */
3
+ export declare function createShortcutHandler(shortcutDefinitions: ShortcutDefinitions, handlerOptions?: ShortcutHandlerOptions): (keydownEvent: Event) => void;
@@ -0,0 +1,2 @@
1
+ /** Build a search that finds the next label starting with the letters typed in quick succession. */
2
+ export declare function createTypeaheadSearch(queryResetDelay?: number): (typedCharacter: string, candidateLabels: string[], currentIndex: number) => number;
@@ -0,0 +1,3 @@
1
+ import type { ShortcutGuard } from '../types/shortcut';
2
+ /** Keep shortcuts from firing while the user types in a field, unless the shortcut allows it. */
3
+ export declare const editableFieldGuard: ShortcutGuard;
@@ -0,0 +1,3 @@
1
+ import type { FloatingPositionModifier } from '../types/floating-position';
2
+ /** Move the floating element to the opposite side of its anchor when it has more room there. */
3
+ export declare function flipFloatingPosition(viewportPadding?: number): FloatingPositionModifier;
@@ -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,2 @@
1
+ /** Write a shortcut the way the user sees it on their keyboard, like ⇧⌘P on a Mac and Ctrl+Shift+P elsewhere. */
2
+ export declare function formatShortcut(shortcut: string, usesAppleModifiers: boolean): string;
@@ -0,0 +1,2 @@
1
+ /** Tell whether the user is on macOS or iOS, where shortcuts use Command instead of Ctrl. */
2
+ export declare function isApplePlatform(): boolean;
@@ -0,0 +1,2 @@
1
+ /** Tell whether a link points to another website, so it should open in a new tab. */
2
+ export declare function isExternalUrl(url: string): boolean;
@@ -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;
@@ -0,0 +1,3 @@
1
+ import type { KeyCombination } from '../types/shortcut';
2
+ /** Turn a shortcut like "mod+k" or "g d" into the key combinations to press in order. */
3
+ export declare function parseShortcut(shortcut: string): KeyCombination[];