@synopackageland/ui 0.20.2 → 0.20.4

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 (148) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSES/ux-foundation.md +83 -0
  3. package/LICENSES/ux-grid-baserow.md +35 -0
  4. package/LICENSES/ux-grid-teable.md +48 -0
  5. package/README.md +3 -0
  6. package/dist/cli.js +0 -0
  7. package/dist/components/app/app-layout/AppLayout.vue.d.ts +31 -4
  8. package/dist/components/app/app-root/AppRoot.vue.d.ts +9 -0
  9. package/dist/components/app/aside-panel/AsidePanel.vue.d.ts +69 -0
  10. package/dist/components/app/aside-panel/asidePreference.d.ts +28 -0
  11. package/dist/components/composite/adaptive-panel/AdaptivePanel.vue.d.ts +61 -0
  12. package/dist/components/composite/connection-topology/ConnectionTopology.vue.d.ts +1 -1
  13. package/dist/components/composite/data-grid/DataGrid.vue.d.ts +3 -2
  14. package/dist/components/composite/data-grid/viewState.d.ts +2 -2
  15. package/dist/components/composite/file-picker/FilePicker.vue.d.ts +1 -1
  16. package/dist/components/composite/mention-list/MentionList.vue.d.ts +2 -2
  17. package/dist/components/composite/overflow-toolbar/OverflowToolbar.vue.d.ts +2 -2
  18. package/dist/components/composite/record-panel/RecordPanel.vue.d.ts +77 -0
  19. package/dist/components/composite/record-panel/recordPanelWidth.d.ts +54 -0
  20. package/dist/components/composite/summary-card/SummaryCard.vue.d.ts +1 -1
  21. package/dist/components/composite/tag-editor/TagEditor.vue.d.ts +2 -2
  22. package/dist/components/composite/tree-view/TreeView.vue.d.ts +1 -1
  23. package/dist/components/composite/wizard/Wizard.vue.d.ts +2 -2
  24. package/dist/components/composite/wizard/WizardDialog.vue.d.ts +2 -2
  25. package/dist/components/containers/card/Card.vue.d.ts +1 -1
  26. package/dist/components/containers/card/CardField.vue.d.ts +26 -0
  27. package/dist/components/containers/card-grid/CardCover.vue.d.ts +16 -0
  28. package/dist/components/containers/card-grid/CardGrid.vue.d.ts +1 -1
  29. package/dist/components/containers/card-grid/VirtualCardGrid.vue.d.ts +71 -0
  30. package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +1 -1
  31. package/dist/components/containers/fieldset/Fieldset.vue.d.ts +1 -1
  32. package/dist/components/containers/list-detail/ListDetail.vue.d.ts +1 -1
  33. package/dist/components/containers/split-pane/SplitPane.vue.d.ts +1 -1
  34. package/dist/components/feedback/notification/Notification.vue.d.ts +1 -1
  35. package/dist/components/feedback/notification/NotificationProvider.vue.d.ts +1 -1
  36. package/dist/components/primitives/breadcrumb/Breadcrumb.vue.d.ts +2 -2
  37. package/dist/components/primitives/context-menu/ContextMenu.vue.d.ts +3 -0
  38. package/dist/components/primitives/context-menu/ContextMenuItems.vue.d.ts +4 -5
  39. package/dist/components/primitives/dialog/Dialog.vue.d.ts +2 -2
  40. package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +4 -0
  41. package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +6 -3
  42. package/dist/components/primitives/popover/Popover.vue.d.ts +10 -2
  43. package/dist/components/primitives/popover/floating.d.ts +27 -0
  44. package/dist/components/primitives/popover/overlay.d.ts +36 -0
  45. package/dist/components/primitives/segment-control/SegmentControl.vue.d.ts +4 -1
  46. package/dist/components/primitives/segment-control/context.d.ts +3 -0
  47. package/dist/components/primitives/select/Select.vue.d.ts +4 -0
  48. package/dist/components/primitives/select/internal/ComboboxField.vue.d.ts +1 -0
  49. package/dist/components/primitives/select/internal/types.d.ts +2 -0
  50. package/dist/components/primitives/skeleton/SectionSkeleton.vue.d.ts +25 -4
  51. package/dist/components/primitives/skeleton/Skeleton.vue.d.ts +3 -0
  52. package/dist/components/primitives/tag/Tag.vue.d.ts +2 -2
  53. package/dist/components/primitives/toast/ToastProvider.vue.d.ts +0 -2
  54. package/dist/components/primitives/toast/toast.d.ts +21 -1
  55. package/dist/components/primitives/tooltip/Tooltip.vue.d.ts +8 -3
  56. package/dist/components/primitives/tooltip/tooltipStyle.d.ts +11 -1
  57. package/dist/composables/backDismiss.d.ts +19 -0
  58. package/dist/composables/phone.d.ts +8 -0
  59. package/dist/composables/softKeyboard.d.ts +26 -4
  60. package/dist/composables/visualViewport.d.ts +31 -0
  61. package/dist/dnd/autoScroll.d.ts +57 -0
  62. package/dist/dnd/dragKit.d.ts +111 -0
  63. package/dist/dnd/index.d.ts +4 -0
  64. package/dist/dnd/layout.d.ts +57 -0
  65. package/dist/dnd/vue.d.ts +16 -0
  66. package/dist/feedback/StatusSlot.vue.d.ts +24 -0
  67. package/dist/feedback/showAfter.d.ts +15 -0
  68. package/dist/feedback/stackMotion.d.ts +13 -0
  69. package/dist/feedback/timing.d.ts +23 -0
  70. package/dist/grid/cells/draw.d.ts +57 -0
  71. package/dist/grid/cells/images.d.ts +5 -0
  72. package/dist/grid/cells/index.d.ts +7 -0
  73. package/dist/grid/cells/number.d.ts +5 -0
  74. package/dist/grid/cells/registry.d.ts +56 -0
  75. package/dist/grid/cells/renderers.d.ts +8 -0
  76. package/dist/grid/cells/status.d.ts +6 -0
  77. package/dist/grid/cells/types.d.ts +200 -0
  78. package/dist/grid/cells/use.d.ts +7 -0
  79. package/dist/grid/clipboard/copy.d.ts +17 -0
  80. package/dist/grid/clipboard/index.d.ts +4 -0
  81. package/dist/grid/clipboard/proposal.d.ts +35 -0
  82. package/dist/grid/clipboard/tsv.d.ts +14 -0
  83. package/dist/grid/clipboard/write.d.ts +21 -0
  84. package/dist/grid/contracts.d.ts +200 -0
  85. package/dist/grid/edit/cell-status.d.ts +33 -0
  86. package/dist/grid/edit/edit-session.d.ts +97 -0
  87. package/dist/grid/edit/use-grid-edit.d.ts +48 -0
  88. package/dist/grid/focus/editor-style.d.ts +67 -0
  89. package/dist/grid/host/GridHost.vue.d.ts +137 -0
  90. package/dist/grid/host/controller.d.ts +219 -0
  91. package/dist/grid/host/dom.d.ts +10 -0
  92. package/dist/grid/index.d.ts +8 -0
  93. package/dist/grid/range/block.d.ts +30 -0
  94. package/dist/grid/range/fill.d.ts +27 -0
  95. package/dist/grid/range/index.d.ts +2 -0
  96. package/dist/grid/theme.d.ts +61 -0
  97. package/dist/grid-core/auto-scroll.d.ts +67 -0
  98. package/dist/grid-core/column-resize.d.ts +43 -0
  99. package/dist/grid-core/config.d.ts +39 -0
  100. package/dist/grid-core/coordinate.d.ts +64 -0
  101. package/dist/grid-core/drag.d.ts +46 -0
  102. package/dist/grid-core/freeze.d.ts +11 -0
  103. package/dist/grid-core/index.d.ts +17 -0
  104. package/dist/grid-core/keyboard.d.ts +34 -0
  105. package/dist/grid-core/keys.d.ts +38 -0
  106. package/dist/grid-core/lru.d.ts +10 -0
  107. package/dist/grid-core/range.d.ts +28 -0
  108. package/dist/grid-core/region.d.ts +73 -0
  109. package/dist/grid-core/renderer/base.d.ts +92 -0
  110. package/dist/grid-core/renderer/layout.d.ts +129 -0
  111. package/dist/grid-core/selection-controller.d.ts +62 -0
  112. package/dist/grid-core/selection.d.ts +35 -0
  113. package/dist/grid-core/theme.d.ts +81 -0
  114. package/dist/grid-core/types.d.ts +178 -0
  115. package/dist/grid.js +6173 -0
  116. package/dist/i18n/text.d.ts +6 -0
  117. package/dist/index.d.ts +32 -2
  118. package/dist/index.js +17662 -13637
  119. package/dist/interaction/editSession.d.ts +49 -0
  120. package/dist/interaction/focus.d.ts +28 -0
  121. package/dist/interaction/gesture.d.ts +49 -0
  122. package/dist/interaction/ime.d.ts +55 -0
  123. package/dist/interaction/index.d.ts +6 -0
  124. package/dist/interaction/outside.d.ts +40 -0
  125. package/dist/interaction/vue.d.ts +21 -0
  126. package/dist/json-ai-prompt.md +1 -1
  127. package/dist/json-preview/preview.js +8529 -7812
  128. package/dist/json.js +10 -10
  129. package/dist/lib/adaptiveLayout.d.ts +32 -2
  130. package/dist/lib/deviceViewport.d.ts +2 -1
  131. package/dist/lib/motion.d.ts +12 -0
  132. package/dist/reka-runtime.json +1 -1
  133. package/dist/theme.css +1 -1
  134. package/dist/themes/dsm7-embedded-theme.css +1 -1
  135. package/dist/themes/dsm7-embedded.css +1 -1
  136. package/dist/themes/dsm7.css +1 -1
  137. package/dist/virtual/cardHeight.d.ts +39 -0
  138. package/dist/virtual/galleryColumns.d.ts +11 -0
  139. package/dist/virtual/layoutMotion.d.ts +30 -0
  140. package/docs/adaptive-layout.md +137 -16
  141. package/docs/callout.md +22 -1
  142. package/docs/list-detail.md +54 -0
  143. package/docs/mobile-native.md +214 -0
  144. package/docs/release-checks.md +23 -0
  145. package/docs/theme-hooks.md +28 -7
  146. package/docs/ux-foundation.md +133 -0
  147. package/docs/ux-grid.md +217 -0
  148. package/package.json +94 -3
@@ -41,4 +41,6 @@ export type SelectFieldProps = {
41
41
  openLabel?: string;
42
42
  clearLabel?: string;
43
43
  removeTagLabel?: (label: string) => string;
44
+ /** `none` drops the list's open and close motion (a grid editor); inherits `provideOverlayMotion`. */
45
+ motion?: 'auto' | 'none';
44
46
  };
@@ -1,14 +1,35 @@
1
1
  type __VLS_Props = {
2
- variant?: 'lines' | 'figures' | 'rows';
2
+ variant?: 'lines' | 'figures' | 'rows' | 'grid' | 'cards' | 'fields';
3
3
  /** The number of lines (`lines`). */
4
4
  lines?: number;
5
- /** The number of figures or rows (`figures`, `rows`). */
5
+ /** The number of figures, rows, cards or fields. */
6
6
  count?: number;
7
+ /** A row's height (`rows`, `grid`); a grid defaults to `--ui-grid-row-height`. */
8
+ rowHeight?: string;
9
+ /** `grid`: the number of equal columns, or each column's CSS width (`auto` takes the rest). */
10
+ columns?: number | readonly string[];
11
+ /** `grid`: false leaves out the header row. */
12
+ header?: boolean;
13
+ /** `cards`: a card's height, as the real card computes it. */
14
+ cardHeight?: string;
15
+ /** `cards`: the CardGrid's `minItemWidth`, `gap` and `fit`. */
16
+ cardMinWidth?: string;
17
+ gap?: string;
18
+ fit?: 'stretch' | 'fill';
19
+ /** Milliseconds before the shapes show; the reserved box shows at once. */
20
+ delay?: number;
7
21
  };
8
22
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
- variant: "lines" | "figures" | "rows";
10
- lines: number;
23
+ header: boolean;
24
+ variant: "lines" | "figures" | "rows" | "grid" | "cards" | "fields";
25
+ delay: number;
11
26
  count: number;
27
+ gap: string;
28
+ fit: "stretch" | "fill";
29
+ lines: number;
30
+ columns: number | readonly string[];
31
+ cardHeight: string;
32
+ cardMinWidth: string;
12
33
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
34
  declare const _default: typeof __VLS_export;
14
35
  export default _default;
@@ -2,11 +2,14 @@ type __VLS_Props = {
2
2
  width?: string;
3
3
  height?: string;
4
4
  radius?: string;
5
+ /** False for a still shape, as a grid placeholder is. */
6
+ pulse?: boolean;
5
7
  };
6
8
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
9
  height: string;
8
10
  width: string;
9
11
  radius: string;
12
+ pulse: boolean;
10
13
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
14
  declare const _default: typeof __VLS_export;
12
15
  export default _default;
@@ -37,11 +37,11 @@ type __VLS_Slots = {} & {
37
37
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
38
38
  measure: typeof measure;
39
39
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
40
- remove: () => any;
41
40
  click: (event: MouseEvent | KeyboardEvent) => any;
41
+ remove: () => any;
42
42
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
43
- onRemove?: (() => any) | undefined;
44
43
  onClick?: ((event: MouseEvent | KeyboardEvent) => any) | undefined;
44
+ onRemove?: (() => any) | undefined;
45
45
  }>, {
46
46
  label: string;
47
47
  disabled: boolean;
@@ -4,7 +4,6 @@ type __VLS_Props = {
4
4
  announcementLabel?: string;
5
5
  viewportLabel?: string;
6
6
  closeLabel?: string;
7
- duration?: number;
8
7
  swipeDirection?: 'right' | 'left' | 'up' | 'down';
9
8
  };
10
9
  declare var __VLS_8: {};
@@ -12,7 +11,6 @@ type __VLS_Slots = {} & {
12
11
  default?: (props: typeof __VLS_8) => any;
13
12
  };
14
13
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, ToastController, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
- duration: number;
16
14
  swipeDirection: "right" | "left" | "up" | "down";
17
15
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,10 +1,22 @@
1
1
  import { InjectionKey } from 'vue';
2
- export type ToastTone = 'info' | 'success' | 'warning' | 'danger';
2
+ import { FeedbackTone } from '../../../feedback/timing';
3
+ export type ToastTone = FeedbackTone;
3
4
  export type ToastOptions = {
4
5
  title: string;
5
6
  description?: string;
6
7
  tone?: ToastTone;
8
+ /**
9
+ * Work in progress ("Deleting"): a spinner, no timer, and nothing shown
10
+ * unless it is still pending after 300 ms. Turn it into the result with
11
+ * `update` on the same id.
12
+ */
13
+ pending?: boolean;
14
+ /**
15
+ * Milliseconds it stays. By default success 3 s, info and warning 5 s, at
16
+ * least 5 s with an action, and danger until closed.
17
+ */
7
18
  duration?: number;
19
+ /** One action (Undo, Retry). A click runs `onAction` and closes the toast, unless `onAction` updated it. */
8
20
  actionLabel?: string;
9
21
  onAction?: () => void;
10
22
  };
@@ -14,12 +26,20 @@ export type ToastMessage = ToastOptions & {
14
26
  };
15
27
  export type ToastController = {
16
28
  show: (options: ToastOptions | string) => number;
29
+ /**
30
+ * Replaces what toast `id` says, in place: a pending toast becomes its
31
+ * result, an error becomes pending again on Retry. False when that toast
32
+ * has already closed.
33
+ */
34
+ update: (id: number, options: ToastOptions | string) => boolean;
17
35
  dismiss: (id: number) => void;
18
36
  clear: () => void;
19
37
  info: (title: string, description?: string) => number;
20
38
  success: (title: string, description?: string) => number;
21
39
  warning: (title: string, description?: string) => number;
22
40
  danger: (title: string, description?: string) => number;
41
+ /** A pending toast; see ToastOptions.pending. */
42
+ pending: (title: string, description?: string) => number;
23
43
  };
24
44
  export declare const toastControllerKey: InjectionKey<ToastController>;
25
45
  export declare function useToast(): ToastController;
@@ -1,15 +1,20 @@
1
1
  type __VLS_Props = {
2
2
  content: string;
3
3
  side?: 'top' | 'right' | 'bottom' | 'left';
4
+ /** The first tooltip's delay in ms; a neighbour opened right after another skips it. */
4
5
  delay?: number;
5
6
  /** Keeps the trigger from opening a tooltip at all. */
6
7
  disabled?: boolean;
7
- /** A tap on the trigger toggles the tooltip (touch has no hover). Off by default so an icon button's tap only acts. */
8
+ /**
9
+ * A touch or pen tap on the trigger toggles the tooltip, and a tap anywhere
10
+ * else closes it (touch has no hover). On by default on a coarse pointer;
11
+ * `false` keeps a tap to the trigger's own action.
12
+ */
8
13
  openOnTap?: boolean;
9
14
  };
10
- declare var __VLS_25: {};
15
+ declare var __VLS_27: {};
11
16
  type __VLS_Slots = {} & {
12
- default?: (props: typeof __VLS_25) => any;
17
+ default?: (props: typeof __VLS_27) => any;
13
18
  };
14
19
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
20
  disabled: boolean;
@@ -1 +1,11 @@
1
- export declare const TOOLTIP_CONTENT_CLASS = "z-[1450] max-w-72 rounded-[var(--ui-radius-sm)] bg-[var(--ui-tooltip-bg)] px-2.5 py-1.5 text-[12px] leading-4 text-[var(--ui-tooltip-fg)] whitespace-pre-line shadow-[var(--ui-shadow-menu)] [overflow-wrap:anywhere] animate-[ui-fade-in_var(--ui-motion-fast)_var(--ui-motion-ease)]";
1
+ export declare const TOOLTIP_CONTENT_CLASS = "z-[1450] max-w-[min(18rem,var(--reka-popper-available-width,18rem))] rounded-[var(--ui-radius-sm)] bg-[var(--ui-tooltip-bg)] px-3 py-1.5 text-[12px] leading-4 text-[var(--ui-tooltip-fg)] whitespace-pre-line shadow-[var(--ui-shadow-menu)] [overflow-wrap:anywhere] animate-[ui-fade-in_var(--ui-motion-fast)_var(--ui-motion-ease)]";
2
+ /** Gap between a tooltip and its trigger. */
3
+ export declare const TOOLTIP_OFFSET = 6;
4
+ /** The first tooltip waits this long (interaction-spec §1.1). */
5
+ export declare const TOOLTIP_DELAY = 350;
6
+ /** A tooltip that opens within this long of another closing skips the delay. */
7
+ export declare const TOOLTIP_SKIP_DELAY = 300;
8
+ /** True while a tooltip is open or closed less than TOOLTIP_SKIP_DELAY ago. */
9
+ export declare const tooltipWarm: import('vue').Ref<boolean, boolean>;
10
+ export declare function tooltipOpened(): void;
11
+ export declare function tooltipClosed(): void;
@@ -0,0 +1,19 @@
1
+ import { MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * The key this layer adds to `history.state`: how many dismissable surfaces
4
+ * were open when the entry was pushed. Other keys (a router's) are copied
5
+ * through unchanged, and the URL never changes.
6
+ */
7
+ export declare const BACK_DISMISS_STATE_KEY = "__uiBackDismiss";
8
+ export interface BackDismissOptions {
9
+ /** Off: the surface takes no history entry (a desktop popover, a DSM window). Default on. */
10
+ enabled?: MaybeRefOrGetter<boolean>;
11
+ }
12
+ /**
13
+ * Lets the browser's Back (the Android back button, the iOS edge swipe) close
14
+ * an open sheet, drawer or pushed page instead of leaving the page. While
15
+ * `open` is true the surface owns one `history.state` entry; Back calls
16
+ * `close`, and closing by code takes the entry back off. Nested surfaces
17
+ * stack: each Back closes the top one only. Call it in a component's setup.
18
+ */
19
+ export declare function useBackDismiss(open: MaybeRefOrGetter<boolean>, close: () => void, options?: BackDismissOptions): void;
@@ -0,0 +1,8 @@
1
+ import { ComputedRef } from 'vue';
2
+ /**
3
+ * True on a phone: the enclosing AppRoot is narrow (`presentation` mobile)
4
+ * and the pointer is coarse. It is the same signal as the phone tokens in
5
+ * adaptive.css (docs/mobile-native.md, Signals). Outside an AppRoot, or in a
6
+ * narrow window used with a mouse, it is false.
7
+ */
8
+ export declare function usePhone(): ComputedRef<boolean>;
@@ -1,6 +1,28 @@
1
- export declare function raisesKeyboard(element: Element | null): boolean;
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { raisesKeyboard } from './visualViewport';
3
+ export { raisesKeyboard };
2
4
  /**
3
- * True while a text field has focus on a touch device, where the on-screen
4
- * keyboard is then open. A mouse-and-keyboard device never reports one.
5
+ * True while the on-screen keyboard is open. A focused text field on a touch
6
+ * device is the fast first signal; the visual viewport then confirms it (or
7
+ * not, for a hardware keyboard). A mouse-and-keyboard device never reports one.
8
+ * Without `visualViewport` the focus signal stands alone.
5
9
  */
6
- export declare function useSoftKeyboard(): import('vue').Ref<boolean, boolean>;
10
+ export declare function useSoftKeyboard(): ComputedRef<boolean>;
11
+ /** Focuses an element without letting the browser scroll the page, then shows it inside its own scroller. */
12
+ export declare function focusWithoutScroll(element: HTMLElement | null | undefined): void;
13
+ /** The element's nearest scroll container below the document; the window itself never scrolls. */
14
+ export declare function scrollerOf(element: HTMLElement): HTMLElement | null;
15
+ /**
16
+ * Scrolls the element's own scroller (never the window) just enough to show it
17
+ * above the keyboard and any sticky footer, by the scroller's
18
+ * `scroll-padding-*` (block "nearest"). Returns the scroller it moved, if any.
19
+ */
20
+ export declare function revealInScroller(element: HTMLElement): HTMLElement | null;
21
+ /**
22
+ * While the keyboard is open, keeps the focused field inside `root` visible in
23
+ * its own scroller: on focus, when the keyboard opens and when it changes
24
+ * height. The scroller gets `data-ui-kb-room` (scroll padding, and on iOS room
25
+ * to scroll the last field above the keyboard) until the keyboard closes. A
26
+ * field inside `[data-ui-keyboard-reveal="off"]` is left to its container.
27
+ */
28
+ export declare function useFieldReveal(root: Ref<HTMLElement | null>): void;
@@ -0,0 +1,31 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * A viewport change smaller than this is browser chrome (the URL bar or a
4
+ * toolbar), not an on-screen keyboard. vaul and the reka Drawer use the same
5
+ * threshold.
6
+ */
7
+ export declare const KEYBOARD_THRESHOLD = 60;
8
+ export interface VisualViewportState {
9
+ /** The visual viewport's height in CSS px: what is on screen above the keyboard. */
10
+ height: number;
11
+ /** How far the visual viewport is panned down the layout viewport (iOS pans it to show a field). */
12
+ offsetTop: number;
13
+ /**
14
+ * How much of the layout viewport the keyboard covers from the bottom:
15
+ * `innerHeight − height − offsetTop` while a keyboard is open, else 0. It is
16
+ * the iOS keyboard height; on Android with `interactive-widget=resizes-content`
17
+ * the layout viewport itself shrinks, so it stays 0 and the layout is already right.
18
+ */
19
+ keyboardInset: number;
20
+ /** An on-screen keyboard is open: a text field has focus and the viewport lost ≥60 px to it. */
21
+ keyboard: boolean;
22
+ }
23
+ export declare function raisesKeyboard(element: Element | null): element is HTMLElement;
24
+ /**
25
+ * The visual viewport and the on-screen keyboard, read once per frame and
26
+ * shared by every caller (one set of listeners per page). Read-only. Without
27
+ * `window.visualViewport` the keyboard is never reported.
28
+ */
29
+ export declare function useVisualViewport(): Readonly<Ref<VisualViewportState>>;
30
+ /** True when the page can report the visual viewport (and so confirm a keyboard). */
31
+ export declare function hasVisualViewport(): boolean;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @license MIT
3
+ * The edge-zone percentage and the linear speed ramp (full speed at and beyond
4
+ * the edge) are ported from Baserow's `v-auto-scroll` directive
5
+ * (web-frontend/modules/core/directives/autoScroll.js:30-99 at 98f727dc2),
6
+ * rewritten as a requestAnimationFrame loop with a minimum zone and both axes.
7
+ *
8
+ * Copyright (c) 2019-present Baserow B.V.
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
11
+ * software and associated documentation files (the "Software"), to deal in the Software
12
+ * without restriction, including without limitation the rights to use, copy, modify,
13
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
14
+ * permit persons to whom the Software is furnished to do so, subject to the following
15
+ * conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in all copies
18
+ * or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
22
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
24
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
25
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+ /** Share of the scroll box, per edge, that scrolls (interaction-spec §5.2). */
28
+ export declare const AUTO_SCROLL_ZONE_PERCENT = 15;
29
+ /** The zone never gets narrower than this. */
30
+ export declare const AUTO_SCROLL_MIN_ZONE_PX = 56;
31
+ /** Pixels per frame at the edge and beyond it. */
32
+ export declare const AUTO_SCROLL_MAX_SPEED = 16;
33
+ export interface AutoScrollOptions {
34
+ axis: 'x' | 'y' | 'both';
35
+ /** Zone per edge as a percentage of the box (default 15). */
36
+ padding?: number;
37
+ minZone?: number;
38
+ maxSpeed?: number;
39
+ }
40
+ export interface AutoScroll {
41
+ /** Feed the latest pointer position; starts the loop when it is in a zone. */
42
+ update(x: number, y: number): void;
43
+ stop(): void;
44
+ readonly running: boolean;
45
+ }
46
+ /**
47
+ * Speed for a pointer `offset` px from the box start on an axis `size` long:
48
+ * negative toward the start, positive toward the end, 0 outside both zones.
49
+ * Linear from 0 at the inner zone border to `max` at the edge; a pointer past
50
+ * the edge keeps full speed (Baserow clamps the distance to 0).
51
+ */
52
+ export declare function edgeSpeed(offset: number, size: number, options?: Pick<AutoScrollOptions, 'padding' | 'minZone' | 'maxSpeed'>): number;
53
+ /**
54
+ * Scrolls `element` while the last pointer position sits in an edge zone. The
55
+ * box is read once per frame inside the loop, never in the pointer handler.
56
+ */
57
+ export declare function createAutoScroll(element: () => HTMLElement | null | undefined, options: AutoScrollOptions): AutoScroll;
@@ -0,0 +1,111 @@
1
+ import { AutoScrollOptions } from './autoScroll';
2
+ import { Axis, LaneLayout, Rect } from './layout';
3
+ export type DragKey = string | number;
4
+ /** Touch must stay down this long before it lifts (interaction-spec §5.2, §14). */
5
+ export declare const TOUCH_HOLD_MS = 250;
6
+ /** Movement before the hold ends that hands the touch back to native scrolling. */
7
+ export declare const TOUCH_HOLD_TOLERANCE_PX = 6;
8
+ /** After a sibling moves, the target holds still this long (Baserow 100 ms). */
9
+ export declare const SWAP_LOCK_MS = 100;
10
+ export declare const DND_LANE_ATTR = "data-dnd-lane";
11
+ export declare const DND_KEY_ATTR = "data-dnd-key";
12
+ export declare const DND_INDEX_ATTR = "data-dnd-index";
13
+ export declare const DND_STATE_ATTR = "data-dnd-state";
14
+ export declare const DND_GHOST_ATTR = "data-dnd-ghost";
15
+ export interface DragPosition {
16
+ lane: string;
17
+ index: number;
18
+ }
19
+ export interface DragDrop<K extends DragKey = DragKey> {
20
+ key: K;
21
+ from: DragPosition;
22
+ /** `index` is the item's index in the target lane after the move. */
23
+ to: DragPosition;
24
+ }
25
+ export type DragPhase = 'idle' | 'pending' | 'dragging' | 'settling' | 'returning';
26
+ export type DragMode = 'pointer' | 'keyboard';
27
+ export interface DragState<K extends DragKey = DragKey> {
28
+ readonly phase: DragPhase;
29
+ readonly mode: DragMode | null;
30
+ readonly key: K | null;
31
+ readonly from: DragPosition | null;
32
+ readonly to: DragPosition | null;
33
+ /** Bumps on every visible change (target, phase), never on pointer moves. */
34
+ readonly version: number;
35
+ }
36
+ export interface DragLaneOptions<K extends DragKey = DragKey> {
37
+ id: string;
38
+ /** The element item positions are measured from (holds the items, or is their scroll content). */
39
+ element: () => HTMLElement | null | undefined;
40
+ /** The box that scrolls this lane; defaults to `element`. */
41
+ scroller?: () => HTMLElement | null | undefined;
42
+ count: () => number;
43
+ /** Read at lift; default `{ kind: 'measured' }`. Virtual lanes must give a fixed layout. */
44
+ layout?: () => LaneLayout;
45
+ axis?: Axis;
46
+ /** Whether this lane takes the dragged item (a multi-value stack can refuse). */
47
+ accepts?: (key: K, from: DragPosition) => boolean;
48
+ /** Edge auto-scroll along the lane axis; false turns it off. */
49
+ autoScroll?: boolean | Partial<AutoScrollOptions>;
50
+ }
51
+ export interface DragKitOptions<K extends DragKey = DragKey> {
52
+ /** Mouse/pen distance before a press becomes a drag (default 5). */
53
+ threshold?: number;
54
+ holdMs?: number;
55
+ holdTolerance?: number;
56
+ swapLockMs?: number;
57
+ canDrag?: (key: K, from: DragPosition) => boolean;
58
+ /** Build the ghost from the pressed item; default clones it. */
59
+ ghost?: (source: HTMLElement) => HTMLElement;
60
+ /** Where the ghost is appended; default the app root (`[data-ui-app]`) or `body`. */
61
+ ghostParent?: (source: HTMLElement) => HTMLElement;
62
+ /** Outer scroll boxes (the board) that auto-scroll during a drag. */
63
+ scrollers?: ReadonlyArray<{
64
+ element: () => HTMLElement | null | undefined;
65
+ } & AutoScrollOptions>;
66
+ onStart?: (state: DragState<K>) => void;
67
+ /** Called in the release frame, before the settle animation. Apply the move to local data here. */
68
+ onDrop: (drop: DragDrop<K>) => void | PromiseLike<unknown>;
69
+ /** `onDrop`'s promise rejected: put the item back at `drop.from`. The kit animates it home. */
70
+ onRestore?: (drop: DragDrop<K>, error: unknown) => void;
71
+ onCancel?: (state: DragState<K>) => void;
72
+ onChange?: (state: DragState<K>) => void;
73
+ }
74
+ export interface DragItemBinding {
75
+ [DND_KEY_ATTR]: string;
76
+ [DND_INDEX_ATTR]: number;
77
+ [DND_STATE_ATTR]?: 'source' | 'settling';
78
+ style: Record<string, string>;
79
+ }
80
+ export interface DragPlaceholder {
81
+ /** Index in the target lane after the move. */
82
+ index: number;
83
+ /** Content coordinates, the same space the lane's items sit in. */
84
+ rect: Rect;
85
+ style: Record<string, string>;
86
+ }
87
+ export interface DragKit<K extends DragKey = DragKey> {
88
+ readonly state: DragState<K>;
89
+ /** Register a lane; returns its disposer. */
90
+ lane(options: DragLaneOptions<K>): () => void;
91
+ /** Bind on the item (or its handle) `pointerdown`. */
92
+ pointerDown(event: PointerEvent, lane: string, index: number, key: K): void;
93
+ /** Bind on the focusable item `keydown`. Space lifts, arrows move, Space/Enter drop. Returns true when handled. */
94
+ keyDown(event: KeyboardEvent, lane: string, index: number, key: K): boolean;
95
+ /** Attributes and style for item `index` of `lane`. */
96
+ item(lane: string, index: number, key: K): DragItemBinding;
97
+ /** Attributes for the lane element. */
98
+ laneAttrs(lane: string): Record<string, string>;
99
+ /** Where the placeholder of `lane` goes, or null when the drop is not over it. */
100
+ placeholder(lane: string): DragPlaceholder | null;
101
+ isDragging(key: K): boolean;
102
+ /** Fly the item home and end the drag. */
103
+ cancel(): void;
104
+ dispose(): void;
105
+ }
106
+ /**
107
+ * One drag at a time across any number of lanes. The pointer-following ghost
108
+ * is written straight to the DOM; only the target index and phase are state,
109
+ * so siblings re-render once per target change and animate by transform.
110
+ */
111
+ export declare function createDragKit<K extends DragKey = DragKey>(options: DragKitOptions<K>): DragKit<K>;
@@ -0,0 +1,4 @@
1
+ export { AUTO_SCROLL_MAX_SPEED, AUTO_SCROLL_MIN_ZONE_PX, AUTO_SCROLL_ZONE_PERCENT, createAutoScroll, edgeSpeed, type AutoScroll, type AutoScrollOptions, } from './autoScroll';
2
+ export { DND_GHOST_ATTR, DND_INDEX_ATTR, DND_KEY_ATTR, DND_LANE_ATTR, DND_STATE_ATTR, SWAP_LOCK_MS, TOUCH_HOLD_MS, TOUCH_HOLD_TOLERANCE_PX, createDragKit, type DragDrop, type DragItemBinding, type DragKey, type DragKit, type DragKitOptions, type DragLaneOptions, type DragMode, type DragPhase, type DragPlaceholder, type DragPosition, type DragState, } from './dragKit';
3
+ export { gridGeometry, listGeometry, measuredGeometry, type Arrangement, type Axis, type LaneGeometry, type LaneLayout, type Rect, } from './layout';
4
+ export { useDragKit, type UseDragKit } from './vue';
@@ -0,0 +1,57 @@
1
+ export type Axis = 'x' | 'y';
2
+ export interface Rect {
3
+ x: number;
4
+ y: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export type LaneLayout =
9
+ /** Equal items along the lane axis (virtual lists, grid rows, columns). */
10
+ {
11
+ kind: 'list';
12
+ size: number;
13
+ gap?: number;
14
+ start?: number;
15
+ }
16
+ /** Equal cards wrapped into `columns` (gallery). Reorder rule uses the x axis. */
17
+ | {
18
+ kind: 'grid';
19
+ width: number;
20
+ height: number;
21
+ columns: number;
22
+ gapX?: number;
23
+ gapY?: number;
24
+ startX?: number;
25
+ startY?: number;
26
+ }
27
+ /** Rendered items measured at lift (`data-dnd-index`); for lanes that render every item. */
28
+ | {
29
+ kind: 'measured';
30
+ };
31
+ export interface Arrangement {
32
+ readonly count: number;
33
+ rect(slot: number): Rect;
34
+ /** The visual slot under a content point, clamped to the slots; -1 when there are none. */
35
+ slotAt(x: number, y: number): number;
36
+ }
37
+ export interface LaneGeometry {
38
+ /** The axis the half-item rule reads. */
39
+ readonly axis: Axis;
40
+ readonly count: number;
41
+ /** Where original item `index` sits before anything moves. */
42
+ origin(index: number): Rect;
43
+ /**
44
+ * The visual slots after original item `skip` leaves the lane (-1: none
45
+ * leaves) and a placeholder the size of `drag` takes slot `insert` (-1: none).
46
+ */
47
+ arrange(skip: number, insert: number, drag: Rect): Arrangement;
48
+ }
49
+ export declare function listGeometry(axis: Axis, count: number, size: number, gap?: number, start?: number, cross?: number): LaneGeometry;
50
+ export declare function gridGeometry(count: number, layout: Extract<LaneLayout, {
51
+ kind: 'grid';
52
+ }>): LaneGeometry;
53
+ /**
54
+ * Items of varying size along one axis. `origins[i]` is item i's measured rect;
55
+ * `start` places the first slot of an empty lane (its padding).
56
+ */
57
+ export declare function measuredGeometry(axis: Axis, origins: readonly Rect[], start?: number): LaneGeometry;
@@ -0,0 +1,16 @@
1
+ import { Ref } from 'vue';
2
+ import { DragItemBinding, DragKey, DragKit, DragKitOptions, DragLaneOptions, DragPlaceholder } from './dragKit';
3
+ export interface UseDragKit<K extends DragKey> {
4
+ kit: DragKit<K>;
5
+ /** Bumps on every visible drag change; pointer moves never touch it. */
6
+ version: Readonly<Ref<number>>;
7
+ /** `kit.item`, tracked by `version` for templates. */
8
+ item(lane: string, index: number, key: K): DragItemBinding;
9
+ /** `kit.placeholder`, tracked by `version` for templates. */
10
+ placeholder(lane: string): DragPlaceholder | null;
11
+ isDragging(key: K): boolean;
12
+ /** Register a lane for as long as the calling scope lives. */
13
+ useLane(options: DragLaneOptions<K>): () => void;
14
+ }
15
+ /** `createDragKit` bound to the effect scope, with one shallowRef bump per change. */
16
+ export declare function useDragKit<K extends DragKey = DragKey>(options: DragKitOptions<K>): UseDragKit<K>;
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ state?: 'idle' | 'pending' | 'saved' | 'error';
3
+ /** What to say in the current state, from the caller's localized copy. */
4
+ message?: string;
5
+ width?: string;
6
+ height?: string;
7
+ /** Milliseconds before the pending state shows. */
8
+ delay?: number;
9
+ /** The error's action; empty hides it. */
10
+ retryLabel?: string;
11
+ };
12
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ retry: () => any;
14
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onRetry?: (() => any) | undefined;
16
+ }>, {
17
+ height: string;
18
+ width: string;
19
+ message: string;
20
+ delay: number;
21
+ state: "idle" | "pending" | "saved" | "error";
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ export type ShowAfterOptions = {
3
+ /** Milliseconds `active` must hold before the indicator shows. */
4
+ delay?: number;
5
+ /** Milliseconds a shown indicator stays, from when it appeared, so it does not blink. */
6
+ minVisible?: number;
7
+ };
8
+ /**
9
+ * Whether a pending indicator (skeleton shapes, a spinner, a saving mark)
10
+ * should show: only once `active` has held for `delay` (300 ms by default),
11
+ * and then for at least `minVisible`. Work that ends sooner shows nothing.
12
+ * The box the indicator sits in is reserved by the caller from the start;
13
+ * only its contents wait.
14
+ */
15
+ export declare function useShowAfter(active: () => boolean, options?: ShowAfterOptions): Readonly<Ref<boolean>>;
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * Moves the items of a stack (the toast viewport) to their new places over
4
+ * `--ui-motion-stack` when one arrives, leaves or changes its text, instead
5
+ * of jumping (FLIP).
6
+ *
7
+ * The places are read after each change and kept; a change is seen by a
8
+ * MutationObserver, which runs before the next paint, so each item first
9
+ * paints at its old place and then slides. Only the `translate` property is
10
+ * written, so the items' own enter and exit animations (on `transform`) keep
11
+ * running. With motion off the token reads 0 and nothing animates.
12
+ */
13
+ export declare function useStackMotion(container: Readonly<Ref<HTMLElement | null | undefined>>, itemSelector: string): void;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Feedback timing (interaction spec §11-12): how long a loading indicator
3
+ * waits before it shows, and how long each kind of toast stays.
4
+ */
5
+ /** No skeleton, spinner or pending mark for work shorter than this. */
6
+ export declare const PENDING_DELAY_MS = 300;
7
+ /** A toast's tone. */
8
+ export type FeedbackTone = 'info' | 'success' | 'warning' | 'danger';
9
+ /** How long a toast of each tone stays; a danger toast stays until closed. */
10
+ export declare const TOAST_DURATION_MS: Readonly<Record<FeedbackTone, number>>;
11
+ /** A toast with an action (Undo, Open) stays at least this long, so there is time to reach it. */
12
+ export declare const TOAST_ACTION_MIN_MS = 5000;
13
+ /**
14
+ * The time a toast stays open: its own `duration` when given; a pending
15
+ * toast stays until it is updated; otherwise its tone's time, at least
16
+ * TOAST_ACTION_MIN_MS when it has an action.
17
+ */
18
+ export declare function toastDuration(toast: {
19
+ tone?: FeedbackTone;
20
+ duration?: number;
21
+ pending?: boolean;
22
+ actionLabel?: string;
23
+ }): number;