ropav 0.5.0 → 0.7.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 (337) hide show
  1. package/README.md +32 -9
  2. package/dist/components/accordion/index.d.ts +2 -190
  3. package/dist/components/accordion/index.js +1 -12
  4. package/dist/components/alert/alert-indicator.js +1 -1
  5. package/dist/components/alert/index.d.ts +2 -131
  6. package/dist/components/alert/index.js +1 -10
  7. package/dist/components/alert-dialog/alert-dialog-close.js +1 -1
  8. package/dist/components/alert-dialog/alert-dialog-heading.js +2 -2
  9. package/dist/components/alert-dialog/alert-dialog.types.d.ts +1 -1
  10. package/dist/components/alert-dialog/index.d.ts +2 -296
  11. package/dist/components/alert-dialog/index.js +1 -17
  12. package/dist/components/autocomplete/autocomplete-popover.js +2 -2
  13. package/dist/components/autocomplete/autocomplete-root.js +1 -1
  14. package/dist/components/autocomplete/index.d.ts +2 -250
  15. package/dist/components/autocomplete/index.js +1 -12
  16. package/dist/components/avatar/avatar.context.d.ts +1 -1
  17. package/dist/components/avatar/index.d.ts +2 -101
  18. package/dist/components/avatar/index.js +1 -8
  19. package/dist/components/badge/badge-anchor.js +5 -4
  20. package/dist/components/badge/badge-auto-label.d.ts +4 -4
  21. package/dist/components/badge/badge-auto-label.js +2 -2
  22. package/dist/components/badge/badge-root.js +2 -2
  23. package/dist/components/badge/index.d.ts +2 -95
  24. package/dist/components/badge/index.js +1 -8
  25. package/dist/components/breadcrumbs/breadcrumbs-item.js +2 -2
  26. package/dist/components/breadcrumbs/breadcrumbs.types.d.ts +2 -2
  27. package/dist/components/breadcrumbs/index.d.ts +2 -90
  28. package/dist/components/breadcrumbs/index.js +1 -7
  29. package/dist/components/button/index.d.ts +2 -61
  30. package/dist/components/button/index.js +1 -4
  31. package/dist/components/button-group/index.d.ts +2 -72
  32. package/dist/components/button-group/index.js +1 -7
  33. package/dist/components/calendar/calendar-grid-body.js +2 -2
  34. package/dist/components/calendar/calendar-grid-header.js +1 -1
  35. package/dist/components/calendar/calendar-grid.js +2 -1
  36. package/dist/components/calendar/calendar-root.d.ts +1 -1
  37. package/dist/components/calendar/calendar-root.js +13 -13
  38. package/dist/components/calendar/calendar.context.js +1 -1
  39. package/dist/components/calendar/calendar.types.d.ts +3 -1
  40. package/dist/components/calendar/index.d.ts +2 -422
  41. package/dist/components/calendar/index.js +1 -27
  42. package/dist/components/calendar-year-picker/calendar-year-picker-cell.js +15 -11
  43. package/dist/components/calendar-year-picker/calendar-year-picker-grid-body.js +9 -10
  44. package/dist/components/calendar-year-picker/calendar-year-picker-grid.js +36 -32
  45. package/dist/components/calendar-year-picker/calendar-year-picker-trigger-heading.js +1 -1
  46. package/dist/components/calendar-year-picker/calendar-year-picker-trigger.js +1 -1
  47. package/dist/components/calendar-year-picker/calendar-year-picker.context.d.ts +26 -8
  48. package/dist/components/calendar-year-picker/calendar-year-picker.context.js +2 -2
  49. package/dist/components/calendar-year-picker/calendar-year-picker.types.d.ts +8 -1
  50. package/dist/components/calendar-year-picker/index.d.ts +0 -134
  51. package/dist/components/calendar-year-picker/index.js +1 -11
  52. package/dist/components/card/index.d.ts +2 -152
  53. package/dist/components/card/index.js +1 -11
  54. package/dist/components/checkbox/index.d.ts +2 -146
  55. package/dist/components/checkbox/index.js +1 -9
  56. package/dist/components/checkbox-group/index.d.ts +2 -77
  57. package/dist/components/checkbox-group/index.js +1 -4
  58. package/dist/components/chip/chip-auto-label.d.ts +4 -4
  59. package/dist/components/chip/chip-auto-label.js +2 -2
  60. package/dist/components/chip/chip-root.js +2 -2
  61. package/dist/components/chip/index.d.ts +2 -72
  62. package/dist/components/chip/index.js +1 -7
  63. package/dist/components/close-button/index.d.ts +2 -55
  64. package/dist/components/close-button/index.js +1 -4
  65. package/dist/components/color-area/index.d.ts +2 -100
  66. package/dist/components/color-area/index.js +1 -7
  67. package/dist/components/color-field/color-field-root.js +1 -1
  68. package/dist/components/color-field/index.d.ts +2 -175
  69. package/dist/components/color-field/index.js +1 -14
  70. package/dist/components/color-input-group/index.d.ts +2 -115
  71. package/dist/components/color-input-group/index.js +1 -9
  72. package/dist/components/color-picker/color-picker-popover.js +2 -2
  73. package/dist/components/color-picker/index.d.ts +2 -110
  74. package/dist/components/color-picker/index.js +1 -8
  75. package/dist/components/color-slider/index.d.ts +2 -138
  76. package/dist/components/color-slider/index.js +1 -9
  77. package/dist/components/color-swatch/index.d.ts +2 -59
  78. package/dist/components/color-swatch/index.js +1 -4
  79. package/dist/components/color-swatch-picker/color-swatch-picker-item.js +1 -1
  80. package/dist/components/color-swatch-picker/index.d.ts +2 -129
  81. package/dist/components/color-swatch-picker/index.js +1 -9
  82. package/dist/components/combo-box/combo-box-popover.js +2 -2
  83. package/dist/components/combo-box/combo-box.types.d.ts +1 -1
  84. package/dist/components/combo-box/index.d.ts +2 -229
  85. package/dist/components/combo-box/index.js +1 -10
  86. package/dist/components/date-field/date-field-root.js +2 -2
  87. package/dist/components/date-field/index.d.ts +2 -241
  88. package/dist/components/date-field/index.js +1 -12
  89. package/dist/components/date-input-group/use-date-segment.js +1 -1
  90. package/dist/components/date-picker/date-picker-popover.js +2 -2
  91. package/dist/components/date-picker/date-picker-root.js +6 -3
  92. package/dist/components/date-picker/index.d.ts +2 -186
  93. package/dist/components/date-picker/index.js +1 -9
  94. package/dist/components/date-range-picker/date-range-picker-popover.js +2 -2
  95. package/dist/components/date-range-picker/date-range-picker-root.js +6 -3
  96. package/dist/components/date-range-picker/index.d.ts +2 -209
  97. package/dist/components/date-range-picker/index.js +1 -10
  98. package/dist/components/description/index.d.ts +2 -45
  99. package/dist/components/description/index.js +1 -4
  100. package/dist/components/disclosure/disclosure-root.js +3 -3
  101. package/dist/components/disclosure/index.d.ts +2 -163
  102. package/dist/components/disclosure/index.js +1 -11
  103. package/dist/components/disclosure-group/index.d.ts +2 -57
  104. package/dist/components/disclosure-group/index.js +1 -4
  105. package/dist/components/drawer/drawer-close.js +1 -1
  106. package/dist/components/drawer/drawer-dialog.js +1 -1
  107. package/dist/components/drawer/drawer-heading.js +2 -2
  108. package/dist/components/drawer/drawer.types.d.ts +1 -1
  109. package/dist/components/drawer/index.d.ts +2 -291
  110. package/dist/components/drawer/index.js +1 -17
  111. package/dist/components/drop-zone/drop-zone-root.d.ts +23 -0
  112. package/dist/components/drop-zone/drop-zone-root.js +153 -0
  113. package/dist/components/drop-zone/drop-zone-trigger.d.ts +21 -0
  114. package/dist/components/drop-zone/drop-zone-trigger.js +20 -0
  115. package/dist/components/drop-zone/drop-zone.accept.d.ts +19 -0
  116. package/dist/components/drop-zone/drop-zone.accept.js +28 -0
  117. package/dist/components/drop-zone/drop-zone.context.d.ts +6 -0
  118. package/dist/components/drop-zone/drop-zone.context.js +5 -0
  119. package/dist/components/drop-zone/drop-zone.types.d.ts +30 -0
  120. package/dist/components/drop-zone/index.d.ts +8 -0
  121. package/dist/components/drop-zone/index.js +5 -0
  122. package/dist/components/dropdown/dropdown-popover.js +2 -2
  123. package/dist/components/dropdown/index.d.ts +2 -265
  124. package/dist/components/dropdown/index.js +1 -23
  125. package/dist/components/empty-state/index.d.ts +2 -45
  126. package/dist/components/empty-state/index.js +1 -4
  127. package/dist/components/error-message/index.d.ts +2 -45
  128. package/dist/components/error-message/index.js +1 -4
  129. package/dist/components/field-error/field-error-root.js +2 -2
  130. package/dist/components/field-error/index.d.ts +2 -66
  131. package/dist/components/field-error/index.js +1 -7
  132. package/dist/components/fieldset/index.d.ts +2 -110
  133. package/dist/components/fieldset/index.js +1 -9
  134. package/dist/components/form/index.d.ts +2 -49
  135. package/dist/components/form/index.js +1 -4
  136. package/dist/components/header/index.d.ts +2 -45
  137. package/dist/components/header/index.js +1 -4
  138. package/dist/components/i18n-provider/index.d.ts +2 -2
  139. package/dist/components/i18n-provider/index.js +1 -1
  140. package/dist/components/index.d.ts +1 -0
  141. package/dist/components/input/index.d.ts +2 -51
  142. package/dist/components/input/index.js +1 -4
  143. package/dist/components/input-group/index.d.ts +2 -141
  144. package/dist/components/input-group/index.js +1 -10
  145. package/dist/components/input-otp/index.d.ts +2 -151
  146. package/dist/components/input-otp/index.js +1 -9
  147. package/dist/components/kbd/index.d.ts +2 -86
  148. package/dist/components/kbd/index.js +1 -8
  149. package/dist/components/label/index.d.ts +2 -51
  150. package/dist/components/label/index.js +1 -4
  151. package/dist/components/link/index.d.ts +2 -94
  152. package/dist/components/link/index.js +1 -7
  153. package/dist/components/list-box/index.d.ts +2 -191
  154. package/dist/components/list-box/index.js +1 -14
  155. package/dist/components/list-box/list-box-drop-indicator.js +2 -2
  156. package/dist/components/list-box/list-box-root.js +4 -4
  157. package/dist/components/list-box-item/index.d.ts +2 -74
  158. package/dist/components/list-box-item/index.js +1 -7
  159. package/dist/components/list-box-item/list-box-item-root.js +2 -2
  160. package/dist/components/list-box-section/index.d.ts +2 -47
  161. package/dist/components/list-box-section/index.js +1 -4
  162. package/dist/components/menu/index.d.ts +2 -83
  163. package/dist/components/menu/index.js +1 -4
  164. package/dist/components/menu-item/index.d.ts +2 -96
  165. package/dist/components/menu-item/index.js +1 -8
  166. package/dist/components/menu-item/menu-item-root.js +2 -2
  167. package/dist/components/menu-section/index.d.ts +2 -63
  168. package/dist/components/menu-section/index.js +1 -4
  169. package/dist/components/meter/index.d.ts +2 -127
  170. package/dist/components/meter/index.js +1 -9
  171. package/dist/components/modal/index.d.ts +2 -296
  172. package/dist/components/modal/index.js +1 -17
  173. package/dist/components/modal/modal-close.js +1 -1
  174. package/dist/components/modal/modal-heading.js +2 -2
  175. package/dist/components/modal/modal.context.d.ts +2 -2
  176. package/dist/components/modal/modal.types.d.ts +1 -1
  177. package/dist/components/number-field/index.d.ts +2 -186
  178. package/dist/components/number-field/index.js +1 -10
  179. package/dist/components/number-field/number-field-decrement-button.js +1 -1
  180. package/dist/components/number-field/number-field-increment-button.js +1 -1
  181. package/dist/components/overlay/overlay-slots.d.ts +1 -1
  182. package/dist/components/pagination/index.d.ts +2 -244
  183. package/dist/components/pagination/index.js +1 -15
  184. package/dist/components/pagination/pagination-next.js +4 -1
  185. package/dist/components/pagination/pagination-previous.js +4 -1
  186. package/dist/components/popover/index.d.ts +2 -172
  187. package/dist/components/popover/index.js +1 -11
  188. package/dist/components/popover/popover-arrow.js +2 -2
  189. package/dist/components/popover/popover-content.js +2 -2
  190. package/dist/components/popover/popover-heading.js +2 -2
  191. package/dist/components/popover/popover.types.d.ts +1 -1
  192. package/dist/components/progress-bar/index.d.ts +2 -129
  193. package/dist/components/progress-bar/index.js +1 -9
  194. package/dist/components/progress-bar/progress-bar-root.js +4 -0
  195. package/dist/components/progress-bar/progress-bar.types.d.ts +7 -0
  196. package/dist/components/progress-circle/index.d.ts +2 -124
  197. package/dist/components/progress-circle/index.js +1 -9
  198. package/dist/components/radio/index.d.ts +2 -120
  199. package/dist/components/radio/index.js +1 -9
  200. package/dist/components/radio-group/index.d.ts +2 -79
  201. package/dist/components/radio-group/index.js +1 -4
  202. package/dist/components/range-calendar/index.d.ts +2 -424
  203. package/dist/components/range-calendar/index.js +1 -27
  204. package/dist/components/range-calendar/range-calendar-cell.js +4 -2
  205. package/dist/components/range-calendar/range-calendar-grid-body.js +2 -2
  206. package/dist/components/range-calendar/range-calendar-grid-header.js +1 -1
  207. package/dist/components/range-calendar/range-calendar-grid.js +2 -1
  208. package/dist/components/range-calendar/range-calendar-root.d.ts +3 -3
  209. package/dist/components/range-calendar/range-calendar-root.js +13 -13
  210. package/dist/components/range-calendar/range-calendar.context.d.ts +1 -1
  211. package/dist/components/range-calendar/range-calendar.context.js +1 -1
  212. package/dist/components/range-calendar/range-calendar.types.d.ts +3 -1
  213. package/dist/components/router-provider/index.d.ts +2 -2
  214. package/dist/components/router-provider/index.js +1 -1
  215. package/dist/components/scroll-shadow/index.d.ts +2 -69
  216. package/dist/components/scroll-shadow/index.js +1 -4
  217. package/dist/components/search-field/index.d.ts +2 -195
  218. package/dist/components/search-field/index.js +1 -10
  219. package/dist/components/search-field/search-field-clear-button.js +5 -5
  220. package/dist/components/segmented-control/index.d.ts +2 -126
  221. package/dist/components/segmented-control/index.js +1 -9
  222. package/dist/components/select/index.d.ts +2 -202
  223. package/dist/components/select/index.js +1 -10
  224. package/dist/components/select/select-popover.js +2 -2
  225. package/dist/components/select/select-value.js +1 -1
  226. package/dist/components/separator/index.d.ts +2 -41
  227. package/dist/components/separator/index.js +1 -4
  228. package/dist/components/sidebar/index.d.ts +2 -518
  229. package/dist/components/sidebar/index.js +1 -25
  230. package/dist/components/sidebar/sidebar-content.js +2 -2
  231. package/dist/components/sidebar/sidebar-item-tooltip.js +2 -2
  232. package/dist/components/sidebar/sidebar-panel.js +1 -0
  233. package/dist/components/sidebar/sidebar-rail.js +1 -0
  234. package/dist/components/sidebar/sidebar-root.js +26 -6
  235. package/dist/components/sidebar/sidebar.state.d.ts +3 -0
  236. package/dist/components/sidebar/sidebar.state.js +5 -0
  237. package/dist/components/sidebar/sidebar.types.d.ts +16 -2
  238. package/dist/components/skeleton/index.d.ts +2 -47
  239. package/dist/components/skeleton/index.js +1 -4
  240. package/dist/components/slider/index.d.ts +2 -180
  241. package/dist/components/slider/index.js +1 -11
  242. package/dist/components/spinner/index.d.ts +2 -41
  243. package/dist/components/spinner/index.js +1 -4
  244. package/dist/components/splitter/index.d.ts +2 -134
  245. package/dist/components/splitter/index.js +1 -8
  246. package/dist/components/surface/index.d.ts +2 -47
  247. package/dist/components/surface/index.js +1 -4
  248. package/dist/components/switch/index.d.ts +2 -165
  249. package/dist/components/switch/index.js +1 -10
  250. package/dist/components/switch-group/index.d.ts +2 -47
  251. package/dist/components/switch-group/index.js +1 -4
  252. package/dist/components/table/index.d.ts +2 -442
  253. package/dist/components/table/index.js +1 -23
  254. package/dist/components/table/table-body.js +9 -9
  255. package/dist/components/table/table-cell.js +3 -3
  256. package/dist/components/table/table-column.js +4 -4
  257. package/dist/components/table/table-content.js +3 -3
  258. package/dist/components/table/table-drag-handle.js +1 -1
  259. package/dist/components/table/table-drop-indicator.js +9 -7
  260. package/dist/components/table/table-header.js +4 -4
  261. package/dist/components/table/table-load-more.js +5 -5
  262. package/dist/components/table/table-row.js +4 -4
  263. package/dist/components/table/table.context.d.ts +2 -2
  264. package/dist/components/table/table.types.d.ts +3 -3
  265. package/dist/components/tabs/index.d.ts +2 -189
  266. package/dist/components/tabs/index.js +1 -12
  267. package/dist/components/tabs/tabs-list-container.js +2 -2
  268. package/dist/components/tag/index.d.ts +2 -76
  269. package/dist/components/tag/index.js +1 -7
  270. package/dist/components/tag/tag-remove-button.js +2 -2
  271. package/dist/components/tag-group/index.d.ts +2 -93
  272. package/dist/components/tag-group/index.js +1 -7
  273. package/dist/components/textarea/index.d.ts +2 -51
  274. package/dist/components/textarea/index.js +1 -4
  275. package/dist/components/textfield/index.d.ts +2 -109
  276. package/dist/components/textfield/index.js +1 -4
  277. package/dist/components/time-field/index.d.ts +2 -233
  278. package/dist/components/time-field/index.js +1 -12
  279. package/dist/components/toast/index.d.ts +2 -216
  280. package/dist/components/toast/index.js +1 -15
  281. package/dist/components/toast/toast-action-button.js +2 -2
  282. package/dist/components/toast/toast-default-content.js +1 -1
  283. package/dist/components/toast/toast-queue.d.ts +1 -1
  284. package/dist/components/toast/toast-queue.js +1 -1
  285. package/dist/components/toast/toast-root.js +1 -1
  286. package/dist/components/toast/toast.types.d.ts +3 -3
  287. package/dist/components/toggle-button/index.d.ts +2 -65
  288. package/dist/components/toggle-button/index.js +1 -4
  289. package/dist/components/toggle-button-group/index.d.ts +2 -82
  290. package/dist/components/toggle-button-group/index.js +1 -7
  291. package/dist/components/toolbar/index.d.ts +2 -49
  292. package/dist/components/toolbar/index.js +1 -4
  293. package/dist/components/tooltip/index.d.ts +2 -136
  294. package/dist/components/tooltip/index.js +1 -9
  295. package/dist/components/tooltip/tooltip-arrow.js +2 -2
  296. package/dist/components/tooltip/tooltip-root.js +1 -1
  297. package/dist/components/tooltip/tooltip.types.d.ts +1 -1
  298. package/dist/components/typography/code.js +2 -2
  299. package/dist/components/typography/heading.js +2 -2
  300. package/dist/components/typography/index.d.ts +2 -1269
  301. package/dist/components/typography/index.js +1 -10
  302. package/dist/components/typography/paragraph.js +2 -2
  303. package/dist/components/typography/typography-root.js +2 -2
  304. package/dist/composables/index.d.ts +1 -0
  305. package/dist/composables/use-calendar-grid.js +2 -1
  306. package/dist/composables/use-calendar-year-picker.js +12 -3
  307. package/dist/composables/use-color-slider.d.ts +1 -1
  308. package/dist/composables/use-color-slider.js +1 -1
  309. package/dist/composables/use-drag-and-drop.js +1 -1
  310. package/dist/composables/use-droppable-collection.js +1 -1
  311. package/dist/composables/use-droppable-item.js +1 -1
  312. package/dist/composables/use-press.d.ts +10 -0
  313. package/dist/composables/use-press.js +27 -2
  314. package/dist/composables/use-prevent-scroll.d.ts +11 -5
  315. package/dist/composables/use-prevent-scroll.js +11 -5
  316. package/dist/composables/use-range-calendar.js +2 -1
  317. package/dist/composables/use-text-field.js +1 -1
  318. package/dist/index.d.ts +1 -1
  319. package/dist/index.js +118 -114
  320. package/dist/styles-no-preflight.css +3 -0
  321. package/dist/styles-overrides.css +15 -0
  322. package/dist/styles.css +1 -16
  323. package/dist/utils/calendar-systems.d.ts +14 -0
  324. package/dist/utils/calendar-systems.js +2 -0
  325. package/dist/utils/calendar.d.ts +14 -5
  326. package/dist/utils/calendar.js +18 -21
  327. package/dist/utils/compose.d.ts +4 -6
  328. package/dist/utils/compose.js +4 -6
  329. package/dist/utils/dnd-list-drop-target-delegate.d.ts +19 -1
  330. package/dist/utils/dnd-list-drop-target-delegate.js +37 -6
  331. package/dist/utils/index.d.ts +1 -0
  332. package/dist/utils/virtualizer-list-layout.d.ts +8 -0
  333. package/dist/utils/virtualizer-list-layout.js +12 -2
  334. package/dist/utils/virtualizer-table-layout.d.ts +1 -0
  335. package/dist/utils/virtualizer-table-layout.js +3 -0
  336. package/dist/version.js +1 -1
  337. package/package.json +13 -6
@@ -0,0 +1,3 @@
1
+ /* `styles.css` without Tailwind's preflight, for an app that already resets. */
2
+ @import "@ropav/styles/no-preflight";
3
+ @import "./styles-overrides.css";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Rules layered on top of `@ropav/styles` rather than merged into it, so each one stays
3
+ * separately deletable once `packages/styles` folds it in.
4
+ */
5
+ @layer components {
6
+ /**
7
+ * A vertical group stacks along the block axis, so its cross axis is the one that decides
8
+ * button width. `.rp-button` is `w-fit`, which would leave each button as wide as its own
9
+ * label and centred against the widest one - a ragged left and right edge. `min-width`
10
+ * squares them up without overriding the fixed width an icon-only button relies on.
11
+ */
12
+ .rp-button-group--vertical .rp-button {
13
+ @apply min-w-full;
14
+ }
15
+ }
package/dist/styles.css CHANGED
@@ -1,17 +1,2 @@
1
1
  @import "@ropav/styles";
2
-
3
- /**
4
- * Rules layered on top of `@ropav/styles` rather than merged into it, so each one stays
5
- * separately deletable once `packages/styles` folds it in.
6
- */
7
- @layer components {
8
- /**
9
- * A vertical group stacks along the block axis, so its cross axis is the one that decides
10
- * button width. `.button` is `w-fit`, which would leave each button as wide as its own
11
- * label and centred against the widest one - a ragged left and right edge. `min-width`
12
- * squares them up without overriding the fixed width an icon-only button relies on.
13
- */
14
- .button-group--vertical .button {
15
- @apply min-w-full;
16
- }
17
- }
2
+ @import "./styles-overrides.css";
@@ -0,0 +1,14 @@
1
+ import { createCalendar } from "@internationalized/date";
2
+ /**
3
+ * The factory that can build any calendar system, for an app serving a locale that uses one.
4
+ *
5
+ * The calendars, fields and pickers default to Gregorian instead. A factory that answers for any
6
+ * identifier has to carry the arithmetic for every system behind it, none of which a Gregorian
7
+ * locale ever reads, and nothing about a static default can be dropped by a build. Passing this
8
+ * back opts into the lot:
9
+ *
10
+ * ```vue
11
+ * <DatePicker :create-calendar="createCalendar" />
12
+ * ```
13
+ */
14
+ export { createCalendar };
@@ -0,0 +1,2 @@
1
+ import { createCalendar } from "@internationalized/date";
2
+ export { createCalendar };
@@ -1,8 +1,11 @@
1
- import type { CalendarDate, DateDuration, DateValue } from "@internationalized/date";
1
+ import type { Calendar, DateDuration, DateValue } from "@internationalized/date";
2
+ import { CalendarDate } from "@internationalized/date";
2
3
  /** The day a week can be told to start on, spelled the way `@internationalized/date` spells it. */
3
4
  export type DayOfWeek = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
4
5
  /** How wide a weekday name is written. */
5
6
  export type WeekdayStyle = "narrow" | "short" | "long";
7
+ /** How wide a weekday name is written when nothing asks for a width. */
8
+ export declare const DEFAULT_WEEKDAY_STYLE: WeekdayStyle;
6
9
  /** Whether a date falls outside the allowed range. */
7
10
  export declare const isDateInvalid: (date: DateValue, minValue?: DateValue | null, maxValue?: DateValue | null) => boolean;
8
11
  /**
@@ -30,12 +33,18 @@ export declare const previousAvailableDate: (date: CalendarDate, minValue: DateV
30
33
  /** Whether two visible durations span the same thing. */
31
34
  export declare const isEqualDuration: (a: DateDuration, b: DateDuration) => boolean;
32
35
  /**
33
- * How far a calendar system's year numbering sits from the Gregorian one.
36
+ * Default bounds spanning 1900 to 2099, expressed in `calendar`'s own year numbering.
34
37
  *
35
- * Used to turn the default 1900–2099 Gregorian bounds into the same span of real time in whatever
36
- * calendar the locale resolves to, so the year picker offers years the user recognises.
38
+ * Both ends are built Gregorian and converted rather than assembled from a year number, because a
39
+ * `CalendarDate` counts its year from the start of an era: Japanese 1900 is the 1900th year of
40
+ * Reiwa, two millennia out. A fixed offset per system cannot stand in for the conversion either,
41
+ * since an era can turn over inside the span — 1900 is Meiji, 2026 is Reiwa — and a year is not
42
+ * the same length in every calendar.
37
43
  */
38
- export declare const getGregorianYearOffset: (identifier: string) => number;
44
+ export declare const getDefaultYearBounds: (calendar: Calendar) => {
45
+ maxValue: CalendarDate;
46
+ minValue: CalendarDate;
47
+ };
39
48
  /**
40
49
  * Every year start from `start` to `end` inclusive.
41
50
  *
@@ -1,5 +1,7 @@
1
- import { isSameDay, maxDate, minDate, startOfMonth, startOfWeek, startOfYear, toCalendarDate } from "@internationalized/date";
1
+ import { CalendarDate, isSameDay, maxDate, minDate, startOfMonth, startOfWeek, startOfYear, toCalendar, toCalendarDate } from "@internationalized/date";
2
2
  //#region src/utils/calendar.ts
3
+ /** How wide a weekday name is written when nothing asks for a width. */
4
+ var DEFAULT_WEEKDAY_STYLE = "short";
3
5
  /** Whether a date falls outside the allowed range. */
4
6
  var isDateInvalid = (date, minValue, maxValue) => minValue != null && date.compare(minValue) < 0 || maxValue != null && date.compare(maxValue) > 0;
5
7
  /**
@@ -74,27 +76,22 @@ var previousAvailableDate = (date, minValue, isDateUnavailable) => {
74
76
  };
75
77
  /** Whether two visible durations span the same thing. */
76
78
  var isEqualDuration = (a, b) => a === b || a.days === b.days && a.weeks === b.weeks && a.months === b.months && a.years === b.years;
79
+ /** The stretch of real time the default bounds cover, written as Gregorian years. */
80
+ var DEFAULT_MIN_YEAR = 1900;
81
+ var DEFAULT_MAX_YEAR = 2099;
77
82
  /**
78
- * How far a calendar system's year numbering sits from the Gregorian one.
83
+ * Default bounds spanning 1900 to 2099, expressed in `calendar`'s own year numbering.
79
84
  *
80
- * Used to turn the default 1900–2099 Gregorian bounds into the same span of real time in whatever
81
- * calendar the locale resolves to, so the year picker offers years the user recognises.
85
+ * Both ends are built Gregorian and converted rather than assembled from a year number, because a
86
+ * `CalendarDate` counts its year from the start of an era: Japanese 1900 is the 1900th year of
87
+ * Reiwa, two millennia out. A fixed offset per system cannot stand in for the conversion either,
88
+ * since an era can turn over inside the span — 1900 is Meiji, 2026 is Reiwa — and a year is not
89
+ * the same length in every calendar.
82
90
  */
83
- var getGregorianYearOffset = (identifier) => {
84
- switch (identifier) {
85
- case "buddhist": return 543;
86
- case "ethiopic":
87
- case "ethioaa": return -8;
88
- case "coptic": return -284;
89
- case "hebrew": return 3760;
90
- case "indian": return -78;
91
- case "islamic-civil":
92
- case "islamic-tbla":
93
- case "islamic-umalqura": return -579;
94
- case "persian": return -600;
95
- default: return 0;
96
- }
97
- };
91
+ var getDefaultYearBounds = (calendar) => ({
92
+ maxValue: toCalendar(new CalendarDate(DEFAULT_MAX_YEAR, 12, 31), calendar),
93
+ minValue: toCalendar(new CalendarDate(DEFAULT_MIN_YEAR, 1, 1), calendar)
94
+ });
98
95
  /**
99
96
  * Every year start from `start` to `end` inclusive.
100
97
  *
@@ -112,7 +109,7 @@ var getYearRange = (start, end) => {
112
109
  return years;
113
110
  };
114
111
  /** The weekday names above a day view, starting from the week `start` falls in. */
115
- var getDayViewWeekDayLabels = (start, locale, firstDayOfWeek, weekdayStyle = "short", timeZone = "UTC") => {
112
+ var getDayViewWeekDayLabels = (start, locale, firstDayOfWeek, weekdayStyle = DEFAULT_WEEKDAY_STYLE, timeZone = "UTC") => {
116
113
  const formatter = new Intl.DateTimeFormat(locale, {
117
114
  timeZone,
118
115
  weekday: weekdayStyle
@@ -162,4 +159,4 @@ var getDayViewGridRows = (start, end, locale, firstDayOfWeek) => {
162
159
  return rows;
163
160
  };
164
161
  //#endregion
165
- export { alignCenter, alignEnd, alignStart, constrainStart, constrainValue, getDayViewGridRows, getDayViewWeekDayLabels, getGregorianYearOffset, getYearRange, isDateInvalid, isEqualDuration, previousAvailableDate };
162
+ export { DEFAULT_WEEKDAY_STYLE, alignCenter, alignEnd, alignStart, constrainStart, constrainValue, getDayViewGridRows, getDayViewWeekDayLabels, getDefaultYearBounds, getYearRange, isDateInvalid, isEqualDuration, previousAvailableDate };
@@ -1,11 +1,9 @@
1
1
  /**
2
- * Resolve a `tv()` slot function into a class string, merging in a caller `class`.
2
+ * Resolve a `tv()` slot function into a class string, appending a caller `class`.
3
3
  *
4
- * Feeding the caller class through `tv()` is what lets it *override* conflicting
5
- * utilities, since `tailwind-variants` runs `tailwind-merge` over the result. Vue's
6
- * own attribute fallthrough would only concatenate, which does not override anything.
7
- *
8
- * `class` rather than `className`: `tv()` accepts either, and `class` is the Vue idiom.
4
+ * The slot function owns the slot's own classes, so a caller class goes through it rather
5
+ * than around it. Declaring `class` as a prop is what takes it out of Vue's attribute
6
+ * fallthrough in the first place, leaving each part to place it.
9
7
  *
10
8
  * @example
11
9
  * ```ts
@@ -1,12 +1,10 @@
1
1
  //#region src/utils/compose.ts
2
2
  /**
3
- * Resolve a `tv()` slot function into a class string, merging in a caller `class`.
3
+ * Resolve a `tv()` slot function into a class string, appending a caller `class`.
4
4
  *
5
- * Feeding the caller class through `tv()` is what lets it *override* conflicting
6
- * utilities, since `tailwind-variants` runs `tailwind-merge` over the result. Vue's
7
- * own attribute fallthrough would only concatenate, which does not override anything.
8
- *
9
- * `class` rather than `className`: `tv()` accepts either, and `class` is the Vue idiom.
5
+ * The slot function owns the slot's own classes, so a caller class goes through it rather
6
+ * than around it. Declaring `class` as a prop is what takes it out of Vue's attribute
7
+ * fallthrough in the first place, leaving each part to place it.
10
8
  *
11
9
  * @example
12
10
  * ```ts
@@ -27,6 +27,8 @@ export declare class ListDropTargetDelegate implements DropTargetDelegate {
27
27
  private layout;
28
28
  private orientation;
29
29
  protected direction: "ltr" | "rtl";
30
+ /** The element found for each key, kept between calls and rechecked as each one is read. */
31
+ private elements;
30
32
  constructor(collection: DragCollection, element: ShallowRef<HTMLElement | null>, options?: ListDropTargetDelegateOptions);
31
33
  private getPrimaryStart;
32
34
  private getPrimaryEnd;
@@ -44,11 +46,27 @@ export declare class ListDropTargetDelegate implements DropTargetDelegate {
44
46
  */
45
47
  private resolveWithinItem;
46
48
  /**
47
- * Map each item key to the element currently rendering it.
49
+ * Look up the element rendering a key, reusing what an earlier call found.
50
+ *
51
+ * The search above reads a handful of keys, but the map behind it is built from *every*
52
+ * element the container holds — for a table, every cell as well as every row. A drag asks for
53
+ * a target on each `dragover`, up to the display's refresh rate, so building that map per call
54
+ * costs more than the search it feeds.
55
+ *
56
+ * Keeping it means the DOM can move on without it, so every entry is rechecked as it is read,
57
+ * against the same conditions that put it there. A stale or missing one rebuilds the map —
58
+ * once per call, since a key the collection has and the DOM does not would otherwise rebuild
59
+ * it at every step of the search.
60
+ */
61
+ private createElementLookup;
62
+ /**
63
+ * Which elements carry a key.
48
64
  *
49
65
  * Scoped by `data-collection` when the container declares one, so a nested collection's rows
50
66
  * are not mistaken for this one's. Both attributes are already emitted by `ListBoxItem` and
51
67
  * `TableRow`.
52
68
  */
69
+ private getElementSelector;
70
+ /** Map each item key to the element currently rendering it. */
53
71
  private buildElementMap;
54
72
  }
@@ -18,6 +18,8 @@ var ListDropTargetDelegate = class {
18
18
  layout;
19
19
  orientation;
20
20
  direction;
21
+ /** The element found for each key, kept between calls and rechecked as each one is read. */
22
+ elements = /* @__PURE__ */ new Map();
21
23
  constructor(collection, element, options = {}) {
22
24
  this.collection = collection;
23
25
  this.element = element;
@@ -57,14 +59,14 @@ var ListDropTargetDelegate = class {
57
59
  const isPrimaryRTL = this.orientation === "horizontal" && this.direction === "rtl";
58
60
  const isSecondaryRTL = this.layout === "grid" && this.orientation === "vertical" && this.direction === "rtl";
59
61
  const isFlowRTL = this.layout === "stack" ? isPrimaryRTL : isSecondaryRTL;
60
- const elementMap = this.buildElementMap(container);
62
+ const findElement = this.createElementLookup(container);
61
63
  let low = 0;
62
64
  let high = items.length;
63
65
  while (low < high) {
64
66
  const mid = Math.floor((low + high) / 2);
65
67
  const key = items[mid];
66
68
  if (key == null) break;
67
- const element = elementMap.get(String(key));
69
+ const element = findElement(String(key));
68
70
  if (!element) break;
69
71
  const rect = element.getBoundingClientRect();
70
72
  const update = (isGreater) => {
@@ -79,7 +81,7 @@ var ListDropTargetDelegate = class {
79
81
  }
80
82
  const key = items[Math.min(low, items.length - 1)];
81
83
  if (key == null) return { type: "root" };
82
- const rect = elementMap.get(String(key))?.getBoundingClientRect();
84
+ const rect = findElement(String(key))?.getBoundingClientRect();
83
85
  return {
84
86
  dropPosition: (rect != null && (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))) === isFlowRTL ? "after" : "before",
85
87
  key,
@@ -136,15 +138,44 @@ var ListDropTargetDelegate = class {
136
138
  return target;
137
139
  }
138
140
  /**
139
- * Map each item key to the element currently rendering it.
141
+ * Look up the element rendering a key, reusing what an earlier call found.
142
+ *
143
+ * The search above reads a handful of keys, but the map behind it is built from *every*
144
+ * element the container holds — for a table, every cell as well as every row. A drag asks for
145
+ * a target on each `dragover`, up to the display's refresh rate, so building that map per call
146
+ * costs more than the search it feeds.
147
+ *
148
+ * Keeping it means the DOM can move on without it, so every entry is rechecked as it is read,
149
+ * against the same conditions that put it there. A stale or missing one rebuilds the map —
150
+ * once per call, since a key the collection has and the DOM does not would otherwise rebuild
151
+ * it at every step of the search.
152
+ */
153
+ createElementLookup(container) {
154
+ const selector = this.getElementSelector(container);
155
+ let isRebuilt = false;
156
+ return (key) => {
157
+ const element = this.elements.get(key);
158
+ if (element?.dataset["key"] === key && element.matches(selector) && container.contains(element)) return element;
159
+ if (!isRebuilt) {
160
+ isRebuilt = true;
161
+ this.elements = this.buildElementMap(container, selector);
162
+ }
163
+ return this.elements.get(key);
164
+ };
165
+ }
166
+ /**
167
+ * Which elements carry a key.
140
168
  *
141
169
  * Scoped by `data-collection` when the container declares one, so a nested collection's rows
142
170
  * are not mistaken for this one's. Both attributes are already emitted by `ListBoxItem` and
143
171
  * `TableRow`.
144
172
  */
145
- buildElementMap(container) {
173
+ getElementSelector(container) {
146
174
  const collectionId = container.dataset["collection"];
147
- const selector = collectionId ? `[data-collection="${CSS.escape(collectionId)}"]` : "[data-key]";
175
+ return collectionId ? `[data-collection="${CSS.escape(collectionId)}"]` : "[data-key]";
176
+ }
177
+ /** Map each item key to the element currently rendering it. */
178
+ buildElementMap(container, selector) {
148
179
  const map = /* @__PURE__ */ new Map();
149
180
  for (const element of container.querySelectorAll(selector)) if (element instanceof HTMLElement && element.dataset["key"] != null) map.set(element.dataset["key"], element);
150
181
  return map;
@@ -2,6 +2,7 @@ export * from "./aria-hide-outside.js";
2
2
  export * from "./assertion.js";
3
3
  export * from "./block.js";
4
4
  export * from "./calendar.js";
5
+ export * from "./calendar-systems.js";
5
6
  export * from "./color.js";
6
7
  export * from "./color-types.js";
7
8
  export * from "./compose.js";
@@ -67,6 +67,14 @@ export declare class ListLayout<Options extends ListLayoutOptions = ListLayoutOp
67
67
  protected snapVisibleRect(rect: Rect): Rect;
68
68
  /** Every layout info inside `rect`, snapped to whole rows, parents before children. */
69
69
  getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
70
+ /**
71
+ * The same, read off the rendered set as it stands rather than laying one out.
72
+ *
73
+ * Asking `getVisibleLayoutInfos` a question moves the window to whatever was asked about, so a
74
+ * caller with a rectangle narrower than the window — a drop resolving a point — would shrink
75
+ * the rendered set to the width of its own question and prune everything else away.
76
+ */
77
+ protected getRenderedLayoutInfos(rect: Rect): LayoutInfo[];
70
78
  update(context: InvalidationContext<Options>): void;
71
79
  shouldInvalidateLayoutOptions(newOptions: Options, oldOptions: Options): boolean;
72
80
  /**
@@ -92,10 +92,20 @@ var ListLayout = class extends Layout {
92
92
  getVisibleLayoutInfos(rect) {
93
93
  const searchRect = this.snapVisibleRect(rect);
94
94
  this.layoutFor(searchRect);
95
+ return this.getRenderedLayoutInfos(searchRect);
96
+ }
97
+ /**
98
+ * The same, read off the rendered set as it stands rather than laying one out.
99
+ *
100
+ * Asking `getVisibleLayoutInfos` a question moves the window to whatever was asked about, so a
101
+ * caller with a rectangle narrower than the window — a drop resolving a point — would shrink
102
+ * the rendered set to the width of its own question and prune everything else away.
103
+ */
104
+ getRenderedLayoutInfos(rect) {
95
105
  const result = [];
96
106
  const addNodes = (nodes) => {
97
107
  for (const node of nodes) {
98
- if (!this.isVisible(node, searchRect)) continue;
108
+ if (!this.isVisible(node, rect)) continue;
99
109
  result.push(node.layoutInfo);
100
110
  addNodes(node.children);
101
111
  }
@@ -393,7 +403,7 @@ var ListLayout = class extends Layout {
393
403
  const searchRect = new Rect(pointX, Math.max(0, pointY - this.gap), 1, Math.max(1, this.gap * 2));
394
404
  let key = null;
395
405
  let minDistance = Infinity;
396
- for (const candidate of this.getVisibleLayoutInfos(searchRect)) {
406
+ for (const candidate of this.getRenderedLayoutInfos(searchRect)) {
397
407
  if (!this.isDropCandidate(candidate) || !candidate.rect.intersects(searchRect)) continue;
398
408
  const distance = Math.min(Math.abs(candidate.rect.y - pointY), Math.abs(candidate.rect.maxY - pointY));
399
409
  if (distance < minDistance) {
@@ -29,6 +29,7 @@ export declare class TableLayout<Options extends TableLayoutOptions = TableLayou
29
29
  * and nothing to clamp against.
30
30
  */
31
31
  getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
32
+ protected getRenderedLayoutInfos(): LayoutInfo[];
32
33
  private addVisibleLayoutInfos;
33
34
  protected getEstimatedRowHeight(): number;
34
35
  protected buildCollection(): LayoutNode[];
@@ -62,6 +62,9 @@ var TableLayout = class extends ListLayout {
62
62
  */
63
63
  getVisibleLayoutInfos(rect) {
64
64
  this.layoutFor(this.snapVisibleRect(rect));
65
+ return this.getRenderedLayoutInfos();
66
+ }
67
+ getRenderedLayoutInfos() {
65
68
  const result = [];
66
69
  for (const node of this.rootNodes) {
67
70
  result.push(node.layoutInfo);
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/version.ts
2
- var ROPAV_VERSION = "0.5.0";
2
+ var ROPAV_VERSION = "0.6.0";
3
3
  //#endregion
4
4
  export { ROPAV_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropav",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "🚀 Beautiful and modern Vue UI library built with Vapor Mode and Tailwind CSS 4.0.",
5
5
  "keywords": [
6
6
  "components",
@@ -41,6 +41,10 @@
41
41
  "style": "./dist/styles.css",
42
42
  "default": "./dist/styles.css"
43
43
  },
44
+ "./styles/no-preflight": {
45
+ "style": "./dist/styles-no-preflight.css",
46
+ "default": "./dist/styles-no-preflight.css"
47
+ },
44
48
  "./accordion": {
45
49
  "import": "./dist/components/accordion/index.js",
46
50
  "types": "./dist/components/accordion/index.d.ts"
@@ -165,6 +169,10 @@
165
169
  "import": "./dist/components/drawer/index.js",
166
170
  "types": "./dist/components/drawer/index.d.ts"
167
171
  },
172
+ "./drop-zone": {
173
+ "import": "./dist/components/drop-zone/index.js",
174
+ "types": "./dist/components/drop-zone/index.d.ts"
175
+ },
168
176
  "./dropdown": {
169
177
  "import": "./dist/components/dropdown/index.js",
170
178
  "types": "./dist/components/dropdown/index.d.ts"
@@ -402,14 +410,13 @@
402
410
  "access": "public"
403
411
  },
404
412
  "dependencies": {
405
- "@internationalized/date": "3.12.3",
406
- "@internationalized/number": "3.6.7",
413
+ "@internationalized/date": "3.12.4",
414
+ "@internationalized/number": "3.6.8",
407
415
  "@internationalized/string": "3.2.10",
408
- "tailwind-variants": "3.3.1",
409
- "@ropav/styles": "0.5.0"
416
+ "@ropav/styles": "0.7.0"
410
417
  },
411
418
  "peerDependencies": {
412
419
  "tailwindcss": ">=4.0.0",
413
- "vue": "^3.6.0-rc.6"
420
+ "vue": "^3.6.0-rc.7"
414
421
  }
415
422
  }