ropav 0.1.6 → 0.1.7

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 (208) hide show
  1. package/README.md +6 -0
  2. package/dist/accordion.css +17 -17
  3. package/dist/accordion.js +123 -155
  4. package/dist/alert.css +18 -18
  5. package/dist/alert.js +10 -11
  6. package/dist/aria.js +14 -0
  7. package/dist/aspect-ratio.js +1 -1
  8. package/dist/attributes.js +9 -0
  9. package/dist/attributes2.js +29 -0
  10. package/dist/avatar.css +19 -19
  11. package/dist/avatar.js +9 -17
  12. package/dist/badge.css +16 -16
  13. package/dist/badge.js +5 -5
  14. package/dist/button-group.js +1 -1
  15. package/dist/button-link.js +4 -3
  16. package/dist/button.js +4 -3
  17. package/dist/button.scss_vue_type_style_index_0_src_true_lang.js +1 -1
  18. package/dist/card.js +1 -1
  19. package/dist/checkbox.css +32 -32
  20. package/dist/checkbox.js +22 -28
  21. package/dist/collapse.css +6 -6
  22. package/dist/collapse.js +7 -6
  23. package/dist/collectionNavigation.js +2 -99
  24. package/dist/color-input.css +19 -19
  25. package/dist/color-input.js +14 -13
  26. package/dist/color-picker.css +40 -40
  27. package/dist/color-picker.js +221 -200
  28. package/dist/color-picker2.js +1 -9
  29. package/dist/color-swatch.css +4 -4
  30. package/dist/color-swatch.js +6 -8
  31. package/dist/color.js +5 -10
  32. package/dist/componentColors.js +125 -84
  33. package/dist/componentRef.js +26 -0
  34. package/dist/components/accordion/accordionContext.d.ts +3 -0
  35. package/dist/components/accordion/accordionModel.d.ts +14 -0
  36. package/dist/components/accordion/index.d.ts +2 -1
  37. package/dist/components/accordion/index.js +1 -1
  38. package/dist/components/accordion/types.d.ts +1 -2
  39. package/dist/components/accordion/useAccordion.d.ts +2 -2
  40. package/dist/components/accordion/useAccordionItem.d.ts +2 -0
  41. package/dist/components/checkbox/useCheckbox.d.ts +1 -2
  42. package/dist/components/color-picker/index.js +2 -2
  43. package/dist/components/color-picker/types.d.ts +2 -2
  44. package/dist/components/color-picker/useColorPickerSaturation.d.ts +22 -0
  45. package/dist/components/color-picker/useColorPickerSlider.d.ts +20 -0
  46. package/dist/components/color-picker/useColorPickerValue.d.ts +1 -1
  47. package/dist/components/dialog/{dialog-core.d.ts → dialogContext.d.ts} +1 -5
  48. package/dist/components/dialog/useDialogContentInteractions.d.ts +18 -0
  49. package/dist/components/dialog/useDialogRootState.d.ts +19 -0
  50. package/dist/components/dropdown-menu/dropdown-menu-item-row.d.ts +1 -1
  51. package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +1 -1
  52. package/dist/components/dropdown-menu/dropdown-menu-model.d.ts +8 -0
  53. package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +2 -2
  54. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
  55. package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +1 -1
  56. package/dist/components/dropdown-menu/{dropdown-menu-primitive-core.d.ts → dropdownMenuContext.d.ts} +16 -18
  57. package/dist/components/dropdown-menu/dropdownMenuDataModel.d.ts +20 -0
  58. package/dist/components/dropdown-menu/dropdownMenuInteraction.d.ts +3 -0
  59. package/dist/components/dropdown-menu/dropdownMenuInteractionNavigation.d.ts +24 -0
  60. package/dist/components/dropdown-menu/dropdownMenuInteractionRegistry.d.ts +42 -0
  61. package/dist/components/dropdown-menu/dropdownMenuInteractionTypes.d.ts +85 -0
  62. package/dist/components/dropdown-menu/useDropdownMenu.d.ts +11 -11
  63. package/dist/components/dropdown-menu/useDropdownMenuContextTrigger.d.ts +9 -0
  64. package/dist/components/dropdown-menu/useDropdownMenuDataController.d.ts +34 -0
  65. package/dist/components/dropdown-menu/useDropdownMenuDataRegistration.d.ts +22 -0
  66. package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +6 -5
  67. package/dist/components/dropdown-menu/useDropdownMenuInteractionDismissal.d.ts +17 -0
  68. package/dist/components/dropdown-menu/useDropdownMenuInteractionKeyboard.d.ts +19 -0
  69. package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +0 -1
  70. package/dist/components/dropdown-menu/useDropdownMenuPresentation.d.ts +29 -0
  71. package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +2 -2
  72. package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +1 -1
  73. package/dist/components/dropdown-menu/useDropdownMenuTargetBindings.d.ts +19 -0
  74. package/dist/components/floating/hoverDisclosureInteractionModel.d.ts +42 -0
  75. package/dist/components/floating/index.js +1 -1
  76. package/dist/components/floating/useFloatingPosition.d.ts +0 -1
  77. package/dist/components/floating/useHoverDisclosureInteractions.d.ts +32 -0
  78. package/dist/components/floating/useHoverDisclosureOpenState.d.ts +25 -0
  79. package/dist/components/floating/useHoverDisclosureTargetBinding.d.ts +27 -0
  80. package/dist/components/number-input/numberInputModel.d.ts +15 -0
  81. package/dist/components/number-input/useNumberInput.d.ts +3 -17
  82. package/dist/components/pagination/index.d.ts +1 -1
  83. package/dist/components/pagination/index.js +1 -1
  84. package/dist/components/pagination/paginationModel.d.ts +4 -0
  85. package/dist/components/pagination/types.d.ts +15 -0
  86. package/dist/components/pagination/usePagination.d.ts +3 -19
  87. package/dist/components/popover/usePopoverBindings.d.ts +16 -0
  88. package/dist/components/progress/progressModel.d.ts +8 -0
  89. package/dist/components/progress/useProgress.d.ts +0 -6
  90. package/dist/components/radio/useRadio.d.ts +1 -2
  91. package/dist/components/scroll-area/scroll-area.d.ts +1 -1
  92. package/dist/components/scroll-area/scrollAreaModel.d.ts +64 -0
  93. package/dist/components/scroll-area/useScrollArea.d.ts +70 -53
  94. package/dist/components/scroll-area/{useScrollAreaPresentation.d.ts → useScrollAreaAttributes.d.ts} +37 -17
  95. package/dist/components/scroll-area/useScrollAreaDerivedState.d.ts +8 -0
  96. package/dist/components/scroll-area/useScrollAreaMeasurement.d.ts +35 -0
  97. package/dist/components/scroll-area/useScrollAreaPointer.d.ts +10 -8
  98. package/dist/components/scroll-area/useScrollAreaVisibility.d.ts +15 -20
  99. package/dist/components/slider/rangeSliderModel.d.ts +41 -0
  100. package/dist/components/slider/{sliderCore.d.ts → sliderModel.d.ts} +0 -1
  101. package/dist/components/slider/useRangeSlider.d.ts +8 -16
  102. package/dist/components/slider/useRangeSliderValueState.d.ts +40 -0
  103. package/dist/components/slider/useSlider.d.ts +7 -13
  104. package/dist/components/slider/useSliderPointerPreview.d.ts +22 -0
  105. package/dist/components/slider/useSliderTooltipState.d.ts +40 -0
  106. package/dist/components/slider/useSliderValueState.d.ts +33 -0
  107. package/dist/components/teleport-provider/index.js +1 -1
  108. package/dist/components/teleport-provider/useTeleportTarget.d.ts +1 -2
  109. package/dist/components/toast/useToastLifecycle.d.ts +19 -0
  110. package/dist/components/tooltip/useTooltip.d.ts +1 -2
  111. package/dist/css.js +12 -0
  112. package/dist/dialog.js +226 -218
  113. package/dist/dropdown-menu.js +1458 -1097
  114. package/dist/events.js +59 -0
  115. package/dist/field.css +8 -8
  116. package/dist/field.js +13 -25
  117. package/dist/floating.js +548 -319
  118. package/dist/floatingOffset.js +11 -0
  119. package/dist/focus-trap.js +7 -5
  120. package/dist/focusNavigation.js +37 -0
  121. package/dist/icon-button.css +8 -8
  122. package/dist/icon-button.js +7 -6
  123. package/dist/index.js +6 -6
  124. package/dist/input.css +24 -24
  125. package/dist/input.js +19 -31
  126. package/dist/interactive.js +18 -0
  127. package/dist/modal.js +1 -1
  128. package/dist/number-input.css +18 -18
  129. package/dist/number-input.js +14 -12
  130. package/dist/number.js +22 -0
  131. package/dist/overlay.js +3 -2
  132. package/dist/pagination.css +28 -28
  133. package/dist/pagination.js +65 -63
  134. package/dist/pointer.js +9 -0
  135. package/dist/popover.css +34 -34
  136. package/dist/popover.js +85 -86
  137. package/dist/progress.js +10 -13
  138. package/dist/query.js +40 -0
  139. package/dist/radio.css +18 -18
  140. package/dist/radio.js +30 -36
  141. package/dist/rafScheduler.js +34 -0
  142. package/dist/scroll-area.css +28 -28
  143. package/dist/scroll-area.js +512 -516
  144. package/dist/select.css +45 -45
  145. package/dist/select.js +36 -44
  146. package/dist/slider.css +191 -191
  147. package/dist/slider.js +691 -618
  148. package/dist/styles-api.d.ts +0 -1
  149. package/dist/styles-api.js +1 -4
  150. package/dist/switch.css +17 -17
  151. package/dist/switch.js +14 -15
  152. package/dist/tabs.css +43 -43
  153. package/dist/tabs.js +29 -56
  154. package/dist/text.js +17 -0
  155. package/dist/textarea.css +26 -26
  156. package/dist/textarea.js +21 -32
  157. package/dist/toast.css +26 -26
  158. package/dist/toast.js +141 -118
  159. package/dist/tooltip.css +12 -12
  160. package/dist/tooltip.js +36 -40
  161. package/dist/useCollapse.js +8 -11
  162. package/dist/useControlState.js +3 -6
  163. package/dist/useFloatingPosition.js +140 -10
  164. package/dist/useOverlayZIndex.js +1 -5
  165. package/dist/useTeleportTarget.js +3 -14
  166. package/dist/useTypeahead.js +94 -0
  167. package/dist/utils/aria.d.ts +3 -0
  168. package/dist/utils/attributes.d.ts +2 -0
  169. package/dist/utils/bem.d.ts +3 -0
  170. package/dist/utils/collectionNavigation.d.ts +2 -0
  171. package/dist/utils/color.d.ts +7 -0
  172. package/dist/{components/color-picker/color-picker-utils.d.ts → utils/colorPicker.d.ts} +5 -4
  173. package/dist/utils/componentColors.d.ts +7 -0
  174. package/dist/utils/css.d.ts +3 -0
  175. package/dist/utils/dom/ancestry.d.ts +7 -0
  176. package/dist/utils/dom/attributes.d.ts +16 -0
  177. package/dist/utils/dom/componentRef.d.ts +4 -0
  178. package/dist/utils/dom/events.d.ts +5 -0
  179. package/dist/utils/dom/focusNavigation.d.ts +7 -0
  180. package/dist/utils/dom/interactive.d.ts +2 -0
  181. package/dist/utils/dom/pointer.d.ts +2 -0
  182. package/dist/utils/dom/query.d.ts +4 -0
  183. package/dist/utils/dom/scroll.d.ts +23 -0
  184. package/dist/utils/floatingOffset.d.ts +10 -0
  185. package/dist/utils/geometry.d.ts +14 -0
  186. package/dist/utils/indexPath.d.ts +6 -0
  187. package/dist/utils/number.d.ts +4 -0
  188. package/dist/utils/rafScheduler.d.ts +4 -0
  189. package/dist/utils/text.d.ts +2 -0
  190. package/docs/code-architecture.md +118 -0
  191. package/docs/public-floating-api.md +6 -5
  192. package/package.json +13 -12
  193. package/dist/components/dropdown-menu/dropdown-menu-outside.d.ts +0 -3
  194. package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +0 -21
  195. package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +0 -36
  196. package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +0 -29
  197. package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +0 -52
  198. package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +0 -17
  199. package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +0 -18
  200. package/dist/components/scroll-area/scrollAreaCore.d.ts +0 -30
  201. package/dist/components/scroll-area/useScrollAreaControls.d.ts +0 -25
  202. package/dist/components/scroll-area/useScrollAreaMetrics.d.ts +0 -38
  203. /package/dist/components/alert/{useAlertColor.d.ts → alertColor.d.ts} +0 -0
  204. /package/dist/components/avatar/{useAvatarColor.d.ts → avatarColor.d.ts} +0 -0
  205. /package/dist/components/badge/{useBadgeColor.d.ts → badgeColor.d.ts} +0 -0
  206. /package/dist/components/button/{useButtonColor.d.ts → buttonColor.d.ts} +0 -0
  207. /package/dist/components/color-swatch/{useColorSwatchColor.d.ts → colorSwatchColor.d.ts} +0 -0
  208. /package/dist/components/toast/{useToastColor.d.ts → toastColor.d.ts} +0 -0
@@ -0,0 +1,118 @@
1
+ # Code architecture
2
+
3
+ This guide defines the source structure expected from contributors. The goal is a predictable
4
+ codebase where UI files describe rendering, behavior is testable through small interfaces, and
5
+ shared logic has one obvious home.
6
+
7
+ ## Module seams
8
+
9
+ A module should hide a meaningful amount of behavior behind a small interface. Extract code around
10
+ a responsibility, not merely to reduce a line count. A useful extraction makes callers simpler and
11
+ lets tests exercise the same interface that production code uses.
12
+
13
+ Use this dependency direction:
14
+
15
+ ```text
16
+ Vue components and component-local modules
17
+ -> internal composables
18
+ -> public composables
19
+ -> utilities
20
+ ```
21
+
22
+ A higher layer may also import a lower layer directly. Lower layers must not import higher layers:
23
+
24
+ - `src/utils/` does not import components or composables.
25
+ - `src/composables/` does not import components or internal modules.
26
+ - `src/internal/` does not import components.
27
+ - Components may compose other components when the dependency remains acyclic.
28
+
29
+ ## Where code belongs
30
+
31
+ | Location | Responsibility |
32
+ | ----------------------------------------- | --------------------------------------------------------------------- |
33
+ | `src/components/<name>/*.vue` | Template, bindings, slots, and lightweight view-derived state |
34
+ | `src/components/<name>/useX.ts` | Component-specific reactive state, lifecycle, and event orchestration |
35
+ | `src/components/<name>/<concern>Model.ts` | Pure behavior that encodes only that component's contract |
36
+ | `src/internal/composables/` | Shared reactive behavior that is not part of the package interface |
37
+ | `src/composables/` | Reusable public composables exported by the package |
38
+ | `src/utils/` | Reusable runtime helpers without component state or lifecycle |
39
+ | `src/utils/dom/` | Reusable helpers that operate on browser and DOM primitives |
40
+ | `tests/`, `tooling/`, `scripts/` | Test, build, and repository automation helpers |
41
+
42
+ Do not add catch-all `utils`, `helpers`, or `core` modules beside a component. Keep a pure helper
43
+ local when it expresses one component's contract, and give it a semantic name such as
44
+ `sliderModel`. Move it to `src/utils/` once more than one feature needs the behavior.
45
+
46
+ ## Component shape
47
+
48
+ Production SFCs use `<script setup lang="ts" vapor>` and remain zero-VDOM. Do not use `h`, `VNode`,
49
+ `defineComponent`, `createVNode`, or related VDOM block helpers in production source.
50
+
51
+ Keep SFC blocks in this order:
52
+
53
+ 1. `<template>`
54
+ 2. `<script setup lang="ts" vapor>`
55
+ 3. `<style>`
56
+
57
+ Within the script block, use this order:
58
+
59
+ 1. Imports
60
+ 2. `defineOptions`, props defaults, emits, and slots
61
+ 3. Composable state and template refs
62
+ 4. View-derived computed attributes
63
+ 5. Small event adapters and `defineExpose`
64
+
65
+ A short computed value used only to bind the template can stay in the SFC. Move state transitions,
66
+ timers, document listeners, multi-step event handling, and reusable calculations behind a
67
+ composable or pure model interface.
68
+
69
+ ## Function design
70
+
71
+ Oxlint enforces a conservative baseline of cyclomatic complexity 20, nesting depth 4, at most 5
72
+ parameters, and at most 250 non-blank, non-comment lines per function. These are upper bounds, not
73
+ targets.
74
+
75
+ - Give each function one reason to change.
76
+ - Prefer guard clauses over deeply nested branches.
77
+ - Use an options object when several parameters describe one concept.
78
+ - Split orchestration into named steps, while keeping the external interface small.
79
+ - Accept dependencies or callbacks at the module seam instead of constructing hard-to-test global
80
+ dependencies inside the implementation.
81
+ - Return observable results where practical; isolate side effects in lifecycle or event adapters.
82
+
83
+ Do not create shallow pass-through functions solely to satisfy a metric. A refactor should improve
84
+ the caller, the module interface, or the test surface.
85
+
86
+ ## Imports and package interfaces
87
+
88
+ - Import utilities directly from their module, for example `@/utils/number`; do not add a utils
89
+ barrel.
90
+ - Component `index.ts` files define package-facing exports. Internal code should not import from the
91
+ root package barrel.
92
+ - Keep imports acyclic. If two modules need each other, move the shared behavior to the lowest
93
+ layer that owns the concept.
94
+ - Use `import type` for type-only dependencies.
95
+
96
+ ## Testing
97
+
98
+ Test through the interface of the extracted module:
99
+
100
+ - Pure models and utilities use deterministic unit tests.
101
+ - Composables test returned state and commands, using the smallest host needed for lifecycle
102
+ behavior.
103
+ - Component tests cover DOM integration, events, accessibility, and public rendering contracts.
104
+ - Storybook tests cover visual and interaction scenarios that depend on real browser layout.
105
+
106
+ Tests should assert observable behavior rather than private implementation details. Refactoring a
107
+ module internally should not require rewriting its behavioral tests.
108
+
109
+ ## Contributor checklist
110
+
111
+ Before opening a pull request:
112
+
113
+ - The SFC primarily adapts props, slots, and composable results to the template.
114
+ - New reusable helpers live in `src/utils/`; feature-only pure logic has a semantic local name.
115
+ - Dependency direction remains downward and acyclic.
116
+ - Functions stay below the enforced complexity, depth, length, and parameter limits.
117
+ - New behavior is tested at the module interface.
118
+ - `pnpm run verify` passes.
@@ -42,7 +42,6 @@ const { actualPlacement, arrowStyle, floatingStyle } = useFloatingPosition({
42
42
  open,
43
43
  placement: 'bottom-start',
44
44
  offset: 8,
45
- restartKey: () => [teleport.value, teleportTo.value],
46
45
  });
47
46
  </script>
48
47
  ```
@@ -63,7 +62,7 @@ The composable accepts plain values, refs, computed refs or getters for reactive
63
62
  | `shift` | `true` | Keeps the floating element inside the collision boundary. |
64
63
  | `collisionPadding` | `8` | Padding between the floating element and viewport boundary. |
65
64
  | `autoUpdateOptions.animationFrame` | `false` | Tracks transform animations and detached nested floating contexts. |
66
- | `restartKey` | — | Rebinds auto-update observers when its reactive value changes. |
65
+ | `restartKey` | — | Forces a rebind for reactive changes unrelated to DOM ancestry. |
67
66
 
68
67
  Use `autoUpdateOptions.animationFrame` sparingly. It checks the reference position every animation
69
68
  frame and is intended for references moving with CSS transforms or nested floating elements outside
@@ -78,9 +77,11 @@ The return value contains readonly `actualPlacement`, `floatingStyle`, `arrowSty
78
77
  `isPositioned` refs, plus an async `update()` method for content-driven layout changes.
79
78
 
80
79
  `useTeleportTarget()` resolves the nearest `TeleportProvider` target and falls back to `body`. Pass
81
- a target value, ref or getter to override the provider for one floating element. Include the
82
- resolved target and the Teleport enabled state in `restartKey` whenever either can change while the
83
- floating element is open.
80
+ a target value, ref or getter to override the provider for one floating element. Positioning
81
+ automatically rebinds when the reference or floating element moves through the composed DOM,
82
+ including Teleport moves, temporary detachments and slot reassignment within an existing shadow
83
+ tree. Use `restartKey` when a reactive change outside observable DOM ancestry must recreate the
84
+ auto-update subscriptions, such as a host attaching a new shadow root after positioning starts.
84
85
 
85
86
  Positioning does not add interaction or accessibility behavior. Custom overlays remain responsible
86
87
  for keyboard handling, focus management, roles, labels, outside interaction and dismissal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropav",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.15.1",
@@ -192,8 +192,9 @@
192
192
  },
193
193
  "scripts": {
194
194
  "dev": "pnpm run storybook",
195
- "public-api:sync": "node scripts/sync-public-api.mjs --write",
196
- "public-api:check": "node scripts/sync-public-api.mjs --check",
195
+ "publication:sync": "node scripts/sync-package-publication.mjs --write",
196
+ "publication:check": "node scripts/sync-package-publication.mjs --check",
197
+ "publication:verify": "node scripts/verify-package-publication.mjs",
197
198
  "tokens:build": "style-dictionary build --config scripts/tokens.config.mjs --silent",
198
199
  "tokens:check": "node scripts/check-tokens.mjs",
199
200
  "typecheck": "vue-tsc -b tsconfig.app.json tsconfig.node.json tsconfig.test.json",
@@ -204,13 +205,13 @@
204
205
  "format:check": "oxfmt --check",
205
206
  "test": "vitest run --project=unit --project=tooling",
206
207
  "test:consumer-types:built": "tsc -p tests/fixtures/consumer-types/tsconfig.bundler.json && tsc -p tests/fixtures/consumer-types/tsconfig.nodenext.json",
207
- "test:exports:built": "node scripts/check-exports.mjs",
208
+ "test:bundle:built": "node scripts/check-package-bundle.mjs",
208
209
  "test:consumer-fixture:built": "node tests/fixtures/consumer-app/check.mjs && vue-tsc -p tests/fixtures/consumer-app/tsconfig.json --noEmit && vite build --config tests/fixtures/consumer-app/vite.config.ts && node tests/fixtures/consumer-app/assertions.mjs",
209
- "test:package": "pnpm run build && pnpm run test:exports:built && pnpm run test:consumer-types:built && pnpm run test:consumer-fixture:built",
210
+ "test:package": "pnpm run build && pnpm run publication:verify && pnpm run test:bundle:built && pnpm run test:consumer-types:built && pnpm run test:consumer-fixture:built",
210
211
  "test:watch": "vitest --project=unit --project=tooling",
211
212
  "test:typecheck": "vitest run --project=unit --project=tooling --typecheck",
212
213
  "test:storybook": "vitest run --project=storybook-light --project=storybook-dark",
213
- "build": "pnpm run public-api:check && pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck && vite build",
214
+ "build": "pnpm run publication:check && pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck && vite build",
214
215
  "verify": "pnpm run lint && pnpm run format:check && pnpm run typecheck:storybook && pnpm run test && pnpm run test:storybook && pnpm run test:package",
215
216
  "prepublishOnly": "pnpm run verify",
216
217
  "preview": "vite preview",
@@ -220,9 +221,9 @@
220
221
  "release": "pnpm run verify && bumpp --git-check --all --commit \"chore(release): v%s\" --tag \"v%s\" --execute \"pnpm run changelog\""
221
222
  },
222
223
  "peerDependencies": {
223
- "@vue/compiler-vapor": "3.6.0-rc.1",
224
+ "@vue/compiler-vapor": "3.6.0-rc.2",
224
225
  "unplugin-icons": "^23.0.1",
225
- "vue": "^3.6.0-rc.1"
226
+ "vue": "^3.6.0-rc.2"
226
227
  },
227
228
  "peerDependenciesMeta": {
228
229
  "@vue/compiler-vapor": {
@@ -245,13 +246,13 @@
245
246
  "@types/node": "^26.1.1",
246
247
  "@vitejs/plugin-vue": "^6.0.8",
247
248
  "@vitest/browser-playwright": "^4.1.10",
248
- "@vue/compiler-vapor": "3.6.0-rc.1",
249
+ "@vue/compiler-vapor": "3.6.0-rc.2",
249
250
  "@vue/tsconfig": "^0.9.1",
250
- "bumpp": "^11.1.0",
251
+ "bumpp": "^12.0.0",
251
252
  "conventional-changelog": "^8.1.0",
252
253
  "conventional-changelog-conventionalcommits": "^10.2.1",
253
254
  "jsdom": "^29.1.1",
254
- "oxfmt": "^0.59.0",
255
+ "oxfmt": "^0.60.0",
255
256
  "oxlint": "^1.75.0",
256
257
  "playwright": "^1.61.1",
257
258
  "sass-embedded": "^1.100.0",
@@ -263,7 +264,7 @@
263
264
  "vite": "^8.1.5",
264
265
  "vite-plugin-dts": "^5.0.3",
265
266
  "vitest": "^4.1.10",
266
- "vue": "3.6.0-rc.1",
267
+ "vue": "3.6.0-rc.2",
267
268
  "vue-tsc": "^3.3.7"
268
269
  },
269
270
  "repository": {
@@ -1,3 +0,0 @@
1
- import { DropdownMenuInteractOutsideTarget } from './types.js';
2
- export declare function isEventWithinElement(event: Event, element: Element): boolean;
3
- export declare function isEventWithinTargets(event: Event, targets: readonly DropdownMenuInteractOutsideTarget[]): boolean;
@@ -1,21 +0,0 @@
1
- import { DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuItemPath, DropdownMenuOpenOptions, DropdownMenuPlacement } from './types.js';
2
- export declare const DEFAULT_PLACEMENT: DropdownMenuPlacement;
3
- export declare const DEFAULT_FOCUS_TARGET: DropdownMenuFocusTarget;
4
- export type ItemPath = DropdownMenuItemPath;
5
- export type SubmenuFocusTarget = DropdownMenuFocusTarget | false;
6
- export type PointerPoint = {
7
- x: number;
8
- y: number;
9
- };
10
- export declare function getOpenFocusTarget(options: DropdownMenuOpenOptions | DropdownMenuFocusTarget | undefined): DropdownMenuFocusTarget;
11
- export declare function getItemClass(item: DropdownMenuItem, focused: boolean, disabled: boolean, hasSubmenu: boolean, submenuOpen: boolean): string[];
12
- export declare function hasItemSubmenu(item: DropdownMenuItem): boolean;
13
- export declare function hasNestedItems(items: DropdownMenuItem[]): boolean;
14
- export declare function getPathKey(path: ItemPath): string;
15
- export declare function getParentPath(path: ItemPath): number[];
16
- export declare function arePathsEqual(a: ItemPath, b: ItemPath): boolean;
17
- export declare function isPathPrefix(prefix: ItemPath, path: ItemPath): boolean;
18
- export declare function normalizePath(indexOrPath: number | ItemPath): ItemPath;
19
- export declare function getEventPoint(event: MouseEvent): PointerPoint;
20
- export declare function hasMeasuredRect(rect: DOMRect): boolean;
21
- export declare function isPointInRect(point: PointerPoint, rect: DOMRect, padding?: number): boolean;
@@ -1,36 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { OverlayLayerContext } from '../../internal/composables/useOverlayLayer.js';
3
- import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuInteractOutsideEvent, DropdownMenuItem, DropdownMenuOpenOptions, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
4
- import { ItemPath } from './dropdown-menu-utils.js';
5
- type BooleanSource = Readonly<Ref<boolean>>;
6
- type UseDropdownMenuDisclosureOptions = {
7
- props: Readonly<DropdownMenuProps>;
8
- emit: {
9
- select?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
10
- pointerDownOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
11
- focusOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
12
- interactOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
13
- };
14
- rootRef: Ref<HTMLElement | null>;
15
- menuRef: Ref<HTMLElement | null>;
16
- targetRef: Readonly<Ref<Element | null>>;
17
- setControllableOpen: (open: boolean) => void;
18
- isDisabled: BooleanSource;
19
- isOpen: BooleanSource;
20
- isVisible: BooleanSource;
21
- focusedPath: Ref<ItemPath>;
22
- resetFocus: () => void;
23
- resetSubmenus: () => void;
24
- resetHoverIntent: () => void;
25
- focusItem: (target: DropdownMenuFocusTarget, menuPath?: ItemPath) => boolean;
26
- focusMenu: () => void;
27
- focusTrigger: () => void;
28
- layer: OverlayLayerContext;
29
- };
30
- export declare function useDropdownMenuDisclosure({ props, emit, rootRef, menuRef, targetRef, setControllableOpen, isDisabled, isOpen, isVisible, focusedPath, resetFocus, resetSubmenus, resetHoverIntent, focusItem, focusMenu, focusTrigger, layer, }: UseDropdownMenuDisclosureOptions): {
31
- open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
32
- close: (options?: DropdownMenuCloseOptions) => void;
33
- toggle: () => void;
34
- resetMenuFocus: () => void;
35
- };
36
- export {};
@@ -1,29 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { DropdownMenuPlacement } from './types.js';
3
- import { ItemPath } from './dropdown-menu-utils.js';
4
- type StringSource = {
5
- readonly value: string;
6
- };
7
- type PlacementSource = {
8
- readonly value: DropdownMenuPlacement;
9
- };
10
- type UseDropdownMenuDomOptions = {
11
- menuId: StringSource;
12
- rootRef: Ref<HTMLElement | null>;
13
- menuRef: Ref<HTMLElement | null>;
14
- targetRef: Readonly<Ref<Element | null>>;
15
- placement: PlacementSource;
16
- focusedPath: Ref<ItemPath>;
17
- };
18
- export declare function useDropdownMenuDom({ menuId, rootRef, menuRef, targetRef, placement, focusedPath, }: UseDropdownMenuDomOptions): {
19
- activeDescendantId: import('vue').ComputedRef<string | undefined>;
20
- focusMenu: () => void;
21
- focusTrigger: () => void;
22
- getItemId: (indexOrPath: number | ItemPath) => string;
23
- getSubmenuId: (path: ItemPath) => string;
24
- getItemElement: (path: ItemPath) => HTMLElement | null;
25
- getSubmenuElement: (path: ItemPath) => HTMLElement | null;
26
- isSubmenuOpeningLeft: (path: ItemPath) => boolean;
27
- getMenuActiveDescendant: (menuPath: ItemPath) => string | undefined;
28
- };
29
- export {};
@@ -1,52 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuOpenOptions, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
3
- import { ItemPath, PointerPoint, SubmenuFocusTarget } from './dropdown-menu-utils.js';
4
- type BooleanSource = Readonly<Ref<boolean>>;
5
- type DisclosureControls = {
6
- open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
7
- close: (options?: DropdownMenuCloseOptions) => void;
8
- toggle: () => void;
9
- };
10
- type SubmenuControls = {
11
- closeSubmenusAfter: (menuPath: ItemPath) => void;
12
- openSubmenu: (path: ItemPath, focus?: SubmenuFocusTarget) => boolean;
13
- closeSubmenu: (path: ItemPath) => boolean;
14
- closeCurrentSubmenu: () => boolean;
15
- };
16
- type HoverIntentControls = {
17
- clearPendingHover: () => void;
18
- resetHoverIntent: () => void;
19
- trackSubmenuOpen: (path: ItemPath, point?: PointerPoint) => void;
20
- handleItemHover: (item: DropdownMenuItem, path: ItemPath, event: MouseEvent | undefined, commit: (item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) => void) => void;
21
- handleMenuMousemove: (event: MouseEvent, commit: (item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) => void) => void;
22
- };
23
- type UseDropdownMenuInteractionsOptions = {
24
- props: Readonly<DropdownMenuProps>;
25
- emit: {
26
- select?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
27
- };
28
- isDisabled: BooleanSource;
29
- focusedPath: Ref<ItemPath>;
30
- openSubmenuPath: Ref<ItemPath>;
31
- getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;
32
- focusItem: (target: DropdownMenuFocusTarget, menuPath?: ItemPath) => boolean;
33
- moveFocus: (direction: 1 | -1) => ItemPath | undefined;
34
- handleTypeahead: (event: KeyboardEvent) => boolean;
35
- submenus: SubmenuControls;
36
- hoverIntent: HoverIntentControls;
37
- disclosure: DisclosureControls;
38
- isSubmenuOpeningLeft: (path: ItemPath) => boolean;
39
- };
40
- export declare function useDropdownMenuInteractions({ props, emit, isDisabled, focusedPath, openSubmenuPath, getItemAtPath, focusItem, moveFocus, handleTypeahead, submenus, hoverIntent, disclosure, isSubmenuOpeningLeft, }: UseDropdownMenuInteractionsOptions): {
41
- activateItem: (item: DropdownMenuItem, path: ItemPath, event?: MouseEvent | KeyboardEvent) => void;
42
- selectItem: (item: DropdownMenuItem, originalEvent?: Event) => void;
43
- openSubmenu: (path: ItemPath, focus?: SubmenuFocusTarget, point?: PointerPoint) => boolean;
44
- closeSubmenu: (path: ItemPath) => boolean;
45
- focusHoveredItem: (item: DropdownMenuItem, indexOrPath: number | ItemPath, event?: MouseEvent) => void;
46
- onTriggerClick: () => void;
47
- onTriggerKeydown: (event: KeyboardEvent) => void;
48
- onMenuKeydown: (event: KeyboardEvent) => void;
49
- onMenuMousemove: (event: MouseEvent) => void;
50
- onMenuMouseleave: () => void;
51
- };
52
- export {};
@@ -1,17 +0,0 @@
1
- import { DropdownMenuFocusTarget, DropdownMenuItem } from './types.js';
2
- import { ItemPath } from './dropdown-menu-utils.js';
3
- type DropdownMenuItemsSource = {
4
- readonly value: DropdownMenuItem[];
5
- };
6
- export declare function useDropdownMenuNavigation(items: DropdownMenuItemsSource): {
7
- focusedPath: import('vue').Ref<number[], number[] | import('./types.js').DropdownMenuItemPath>;
8
- focusedIndex: import('vue').ComputedRef<number>;
9
- getItemsAtPath: (path: ItemPath) => DropdownMenuItem[];
10
- getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;
11
- focusItem: (target: DropdownMenuFocusTarget, menuPath?: ItemPath) => boolean;
12
- resetFocus: () => void;
13
- setFocusedIndex: (index: number, menuPath?: ItemPath) => boolean;
14
- isItemFocused: (indexOrPath: number | ItemPath) => boolean;
15
- moveFocus: (direction: 1 | -1) => number[] | undefined;
16
- };
17
- export {};
@@ -1,18 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { DropdownMenuItem } from './types.js';
3
- import { ItemPath, SubmenuFocusTarget } from './dropdown-menu-utils.js';
4
- type UseDropdownSubmenusOptions = {
5
- focusedPath: Ref<ItemPath>;
6
- getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;
7
- focusItem: (target: Exclude<SubmenuFocusTarget, false>, menuPath?: ItemPath) => boolean;
8
- };
9
- export declare function useDropdownSubmenus({ focusedPath, getItemAtPath, focusItem, }: UseDropdownSubmenusOptions): {
10
- openSubmenuPath: Ref<number[], number[] | import('./types.js').DropdownMenuItemPath>;
11
- resetSubmenus: () => void;
12
- isSubmenuOpen: (path: ItemPath) => boolean;
13
- closeSubmenusAfter: (menuPath: ItemPath) => void;
14
- openSubmenu: (path: ItemPath, focus?: SubmenuFocusTarget) => boolean;
15
- closeSubmenu: (path: ItemPath) => boolean;
16
- closeCurrentSubmenu: () => boolean;
17
- };
18
- export {};
@@ -1,30 +0,0 @@
1
- import { ScrollAreaScrollbars, ScrollAreaType } from './types.js';
2
- export type ScrollAxis = 'x' | 'y';
3
- export type ScrollDirection = 'ltr' | 'rtl';
4
- export interface ScrollAreaMetrics {
5
- direction: ScrollDirection;
6
- clientWidth: number;
7
- clientHeight: number;
8
- scrollWidth: number;
9
- scrollHeight: number;
10
- x: number;
11
- y: number;
12
- overflowX: boolean;
13
- overflowY: boolean;
14
- horizontalThumbSize: number;
15
- horizontalThumbOffset: number;
16
- verticalThumbSize: number;
17
- verticalThumbOffset: number;
18
- }
19
- export declare function clamp(value: number, min: number, max: number): number;
20
- export declare function getScrollDirection(viewport: HTMLElement): ScrollDirection;
21
- export declare function getLogicalHorizontalPosition(scrollLeft: number, maxPosition: number, direction: ScrollDirection): number;
22
- export declare function getRawHorizontalPosition(position: number, maxPosition: number, direction: ScrollDirection): number;
23
- export declare function isAxisEnabled(scrollbars: ScrollAreaScrollbars | false | undefined, axis: ScrollAxis): boolean;
24
- export declare function isScrollbarActive(type: ScrollAreaType, enabled: boolean, overflowing: boolean): boolean;
25
- export declare function getThumbGeometry(trackSize: number, viewportSize: number, scrollSize: number): {
26
- size: number;
27
- offsetRatio: number;
28
- };
29
- export declare function getThumbOffset(position: number, maxPosition: number, sizeRatio: number): number;
30
- export declare function getLengthValue(value: number | string | undefined): string;
@@ -1,25 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { ScrollAxis } from './scrollAreaCore.js';
3
- import { ScrollAreaMetricsController } from './useScrollAreaMetrics.js';
4
- import { ScrollAreaPosition } from './types.js';
5
- interface UseScrollAreaControlsOptions {
6
- viewportRef: Ref<HTMLElement | null>;
7
- metrics: ScrollAreaMetricsController;
8
- showDuringScroll: () => void;
9
- emitScroll: (event: Event) => void;
10
- emitPositionChange: (position: ScrollAreaPosition) => void;
11
- emitReachTop: (event: Event) => void;
12
- emitReachBottom: (event: Event) => void;
13
- emitReachLeft: (event: Event) => void;
14
- emitReachRight: (event: Event) => void;
15
- }
16
- export declare function useScrollAreaControls(options: UseScrollAreaControlsOptions): {
17
- onViewportScroll: (event: Event) => void;
18
- onScrollbarKeydown: (axis: ScrollAxis, event: KeyboardEvent) => void;
19
- onScrollbarWheel: (axis: ScrollAxis, event: WheelEvent) => void;
20
- writeAxisPosition: (axis: ScrollAxis, value: number) => void;
21
- scrollTo: (scrollOptions: ScrollToOptions) => void;
22
- scrollBy: (scrollOptions: ScrollToOptions) => void;
23
- };
24
- export type ScrollAreaControlsController = ReturnType<typeof useScrollAreaControls>;
25
- export {};
@@ -1,38 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { ScrollAxis } from './scrollAreaCore.js';
3
- import { ScrollAreaPosition } from './types.js';
4
- interface UseScrollAreaMetricsOptions {
5
- viewportRef: Ref<HTMLElement | null>;
6
- contentRef: Ref<HTMLElement | null>;
7
- horizontalScrollbarRef: Ref<HTMLElement | null>;
8
- verticalScrollbarRef: Ref<HTMLElement | null>;
9
- horizontalEnabled: Readonly<Ref<boolean>>;
10
- verticalEnabled: Readonly<Ref<boolean>>;
11
- }
12
- export declare function useScrollAreaMetrics(options: UseScrollAreaMetricsOptions): {
13
- metrics: {
14
- direction: import('./scrollAreaCore.js').ScrollDirection;
15
- clientWidth: number;
16
- clientHeight: number;
17
- scrollWidth: number;
18
- scrollHeight: number;
19
- x: number;
20
- y: number;
21
- overflowX: boolean;
22
- overflowY: boolean;
23
- horizontalThumbSize: number;
24
- horizontalThumbOffset: number;
25
- verticalThumbSize: number;
26
- verticalThumbOffset: number;
27
- };
28
- position: import('vue').ComputedRef<ScrollAreaPosition>;
29
- update: () => void;
30
- updatePosition: (viewport?: HTMLElement | null) => void;
31
- scheduleUpdate: () => void;
32
- schedulePositionUpdate: () => void;
33
- getPosition: (axis: ScrollAxis) => number;
34
- getMaxPosition: (axis: ScrollAxis) => number;
35
- getOverflow: (axis: ScrollAxis) => boolean;
36
- };
37
- export type ScrollAreaMetricsController = ReturnType<typeof useScrollAreaMetrics>;
38
- export {};