reka-ui 2.7.0 → 2.8.2

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 (323) hide show
  1. package/dist/Avatar/AvatarImage.cjs +4 -2
  2. package/dist/Avatar/AvatarImage.cjs.map +1 -1
  3. package/dist/Avatar/AvatarImage.js +4 -2
  4. package/dist/Avatar/AvatarImage.js.map +1 -1
  5. package/dist/Calendar/CalendarCellTrigger.cjs +4 -1
  6. package/dist/Calendar/CalendarCellTrigger.cjs.map +1 -1
  7. package/dist/Calendar/CalendarCellTrigger.js +4 -1
  8. package/dist/Calendar/CalendarCellTrigger.js.map +1 -1
  9. package/dist/Calendar/CalendarRoot.cjs +12 -7
  10. package/dist/Calendar/CalendarRoot.cjs.map +1 -1
  11. package/dist/Calendar/CalendarRoot.js +13 -8
  12. package/dist/Calendar/CalendarRoot.js.map +1 -1
  13. package/dist/Calendar/useCalendar.cjs +32 -2
  14. package/dist/Calendar/useCalendar.cjs.map +1 -1
  15. package/dist/Calendar/useCalendar.js +33 -3
  16. package/dist/Calendar/useCalendar.js.map +1 -1
  17. package/dist/Collection/Collection.cjs +6 -2
  18. package/dist/Collection/Collection.cjs.map +1 -1
  19. package/dist/Collection/Collection.js +6 -2
  20. package/dist/Collection/Collection.js.map +1 -1
  21. package/dist/Combobox/ComboboxContent.cjs +4 -0
  22. package/dist/Combobox/ComboboxContent.cjs.map +1 -1
  23. package/dist/Combobox/ComboboxContent.js +4 -0
  24. package/dist/Combobox/ComboboxContent.js.map +1 -1
  25. package/dist/Combobox/ComboboxContentImpl.cjs +47 -33
  26. package/dist/Combobox/ComboboxContentImpl.cjs.map +1 -1
  27. package/dist/Combobox/ComboboxContentImpl.js +48 -34
  28. package/dist/Combobox/ComboboxContentImpl.js.map +1 -1
  29. package/dist/ContextMenu/ContextMenuContent.cjs +4 -0
  30. package/dist/ContextMenu/ContextMenuContent.cjs.map +1 -1
  31. package/dist/ContextMenu/ContextMenuContent.js +4 -0
  32. package/dist/ContextMenu/ContextMenuContent.js.map +1 -1
  33. package/dist/ContextMenu/ContextMenuRadioGroup.cjs +1 -1
  34. package/dist/ContextMenu/ContextMenuRadioGroup.js +1 -1
  35. package/dist/ContextMenu/ContextMenuRadioItem.cjs +1 -1
  36. package/dist/ContextMenu/ContextMenuRadioItem.js +1 -1
  37. package/dist/ContextMenu/ContextMenuSubContent.cjs +4 -0
  38. package/dist/ContextMenu/ContextMenuSubContent.cjs.map +1 -1
  39. package/dist/ContextMenu/ContextMenuSubContent.js +4 -0
  40. package/dist/ContextMenu/ContextMenuSubContent.js.map +1 -1
  41. package/dist/DatePicker/DatePickerContent.cjs +4 -0
  42. package/dist/DatePicker/DatePickerContent.cjs.map +1 -1
  43. package/dist/DatePicker/DatePickerContent.js +4 -0
  44. package/dist/DatePicker/DatePickerContent.js.map +1 -1
  45. package/dist/DatePicker/DatePickerRoot.cjs +10 -8
  46. package/dist/DatePicker/DatePickerRoot.cjs.map +1 -1
  47. package/dist/DatePicker/DatePickerRoot.js +10 -8
  48. package/dist/DatePicker/DatePickerRoot.js.map +1 -1
  49. package/dist/DateRangePicker/DateRangePickerContent.cjs +4 -0
  50. package/dist/DateRangePicker/DateRangePickerContent.cjs.map +1 -1
  51. package/dist/DateRangePicker/DateRangePickerContent.js +4 -0
  52. package/dist/DateRangePicker/DateRangePickerContent.js.map +1 -1
  53. package/dist/DateRangePicker/DateRangePickerRoot.cjs +10 -8
  54. package/dist/DateRangePicker/DateRangePickerRoot.cjs.map +1 -1
  55. package/dist/DateRangePicker/DateRangePickerRoot.js +11 -9
  56. package/dist/DateRangePicker/DateRangePickerRoot.js.map +1 -1
  57. package/dist/DropdownMenu/DropdownMenuContent.cjs +4 -0
  58. package/dist/DropdownMenu/DropdownMenuContent.cjs.map +1 -1
  59. package/dist/DropdownMenu/DropdownMenuContent.js +4 -0
  60. package/dist/DropdownMenu/DropdownMenuContent.js.map +1 -1
  61. package/dist/DropdownMenu/DropdownMenuRadioGroup.cjs +1 -1
  62. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +1 -1
  63. package/dist/DropdownMenu/DropdownMenuRadioItem.cjs +1 -1
  64. package/dist/DropdownMenu/DropdownMenuRadioItem.js +1 -1
  65. package/dist/DropdownMenu/DropdownMenuSubContent.cjs +4 -0
  66. package/dist/DropdownMenu/DropdownMenuSubContent.cjs.map +1 -1
  67. package/dist/DropdownMenu/DropdownMenuSubContent.js +4 -0
  68. package/dist/DropdownMenu/DropdownMenuSubContent.js.map +1 -1
  69. package/dist/Editable/EditableInput.cjs +1 -1
  70. package/dist/Editable/EditableInput.cjs.map +1 -1
  71. package/dist/Editable/EditableInput.js +1 -1
  72. package/dist/Editable/EditableInput.js.map +1 -1
  73. package/dist/FocusScope/FocusScope.cjs +1 -1
  74. package/dist/FocusScope/FocusScope.cjs.map +1 -1
  75. package/dist/FocusScope/FocusScope.js +2 -2
  76. package/dist/FocusScope/FocusScope.js.map +1 -1
  77. package/dist/FocusScope/stack.cjs +0 -9
  78. package/dist/FocusScope/stack.cjs.map +1 -1
  79. package/dist/FocusScope/stack.js +1 -4
  80. package/dist/FocusScope/stack.js.map +1 -1
  81. package/dist/HoverCard/HoverCardContent.cjs +4 -0
  82. package/dist/HoverCard/HoverCardContent.cjs.map +1 -1
  83. package/dist/HoverCard/HoverCardContent.js +4 -0
  84. package/dist/HoverCard/HoverCardContent.js.map +1 -1
  85. package/dist/HoverCard/HoverCardContentImpl.cjs +4 -0
  86. package/dist/HoverCard/HoverCardContentImpl.cjs.map +1 -1
  87. package/dist/HoverCard/HoverCardContentImpl.js +4 -0
  88. package/dist/HoverCard/HoverCardContentImpl.js.map +1 -1
  89. package/dist/Listbox/ListboxRoot.cjs.map +1 -1
  90. package/dist/Listbox/ListboxRoot.js.map +1 -1
  91. package/dist/Menu/MenuContent.cjs +4 -0
  92. package/dist/Menu/MenuContent.cjs.map +1 -1
  93. package/dist/Menu/MenuContent.js +4 -0
  94. package/dist/Menu/MenuContent.js.map +1 -1
  95. package/dist/Menu/MenuContentImpl.cjs +4 -0
  96. package/dist/Menu/MenuContentImpl.cjs.map +1 -1
  97. package/dist/Menu/MenuContentImpl.js +4 -0
  98. package/dist/Menu/MenuContentImpl.js.map +1 -1
  99. package/dist/Menu/MenuRadioGroup.cjs +1 -1
  100. package/dist/Menu/MenuRadioGroup.cjs.map +1 -1
  101. package/dist/Menu/MenuRadioGroup.js +1 -1
  102. package/dist/Menu/MenuRadioGroup.js.map +1 -1
  103. package/dist/Menu/MenuRadioItem.cjs +1 -1
  104. package/dist/Menu/MenuRadioItem.cjs.map +1 -1
  105. package/dist/Menu/MenuRadioItem.js +1 -1
  106. package/dist/Menu/MenuRadioItem.js.map +1 -1
  107. package/dist/Menu/MenuRootContentModal.cjs +4 -0
  108. package/dist/Menu/MenuRootContentModal.cjs.map +1 -1
  109. package/dist/Menu/MenuRootContentModal.js +4 -0
  110. package/dist/Menu/MenuRootContentModal.js.map +1 -1
  111. package/dist/Menu/MenuRootContentNonModal.cjs +4 -0
  112. package/dist/Menu/MenuRootContentNonModal.cjs.map +1 -1
  113. package/dist/Menu/MenuRootContentNonModal.js +4 -0
  114. package/dist/Menu/MenuRootContentNonModal.js.map +1 -1
  115. package/dist/Menu/MenuSubContent.cjs +4 -0
  116. package/dist/Menu/MenuSubContent.cjs.map +1 -1
  117. package/dist/Menu/MenuSubContent.js +4 -0
  118. package/dist/Menu/MenuSubContent.js.map +1 -1
  119. package/dist/Menubar/MenubarContent.cjs +4 -0
  120. package/dist/Menubar/MenubarContent.cjs.map +1 -1
  121. package/dist/Menubar/MenubarContent.js +4 -0
  122. package/dist/Menubar/MenubarContent.js.map +1 -1
  123. package/dist/Menubar/MenubarRadioGroup.cjs +1 -1
  124. package/dist/Menubar/MenubarRadioGroup.js +1 -1
  125. package/dist/Menubar/MenubarRadioItem.cjs +1 -1
  126. package/dist/Menubar/MenubarRadioItem.js +1 -1
  127. package/dist/Menubar/MenubarSubContent.cjs +4 -0
  128. package/dist/Menubar/MenubarSubContent.cjs.map +1 -1
  129. package/dist/Menubar/MenubarSubContent.js +4 -0
  130. package/dist/Menubar/MenubarSubContent.js.map +1 -1
  131. package/dist/NavigationMenu/NavigationMenuContent.cjs +1 -1
  132. package/dist/NavigationMenu/NavigationMenuContent.js +1 -1
  133. package/dist/NavigationMenu/NavigationMenuContentImpl.cjs +1 -1
  134. package/dist/NavigationMenu/NavigationMenuContentImpl.js +1 -1
  135. package/dist/NavigationMenu/NavigationMenuItem.cjs +1 -1
  136. package/dist/NavigationMenu/NavigationMenuItem.js +1 -1
  137. package/dist/NavigationMenu/NavigationMenuRoot.cjs +7 -5
  138. package/dist/NavigationMenu/NavigationMenuRoot.cjs.map +1 -1
  139. package/dist/NavigationMenu/NavigationMenuRoot.js +8 -6
  140. package/dist/NavigationMenu/NavigationMenuRoot.js.map +1 -1
  141. package/dist/NavigationMenu/NavigationMenuTrigger.cjs +1 -1
  142. package/dist/NavigationMenu/NavigationMenuTrigger.js +1 -1
  143. package/dist/NavigationMenu/NavigationMenuViewport.cjs +1 -1
  144. package/dist/NavigationMenu/NavigationMenuViewport.js +1 -1
  145. package/dist/NumberField/NumberFieldRoot.cjs +6 -1
  146. package/dist/NumberField/NumberFieldRoot.cjs.map +1 -1
  147. package/dist/NumberField/NumberFieldRoot.js +6 -1
  148. package/dist/NumberField/NumberFieldRoot.js.map +1 -1
  149. package/dist/PinInput/PinInputInput.cjs +15 -11
  150. package/dist/PinInput/PinInputInput.cjs.map +1 -1
  151. package/dist/PinInput/PinInputInput.js +15 -11
  152. package/dist/PinInput/PinInputInput.js.map +1 -1
  153. package/dist/Popover/PopoverContent.cjs +4 -0
  154. package/dist/Popover/PopoverContent.cjs.map +1 -1
  155. package/dist/Popover/PopoverContent.js +4 -0
  156. package/dist/Popover/PopoverContent.js.map +1 -1
  157. package/dist/Popover/PopoverContentImpl.cjs +4 -0
  158. package/dist/Popover/PopoverContentImpl.cjs.map +1 -1
  159. package/dist/Popover/PopoverContentImpl.js +4 -0
  160. package/dist/Popover/PopoverContentImpl.js.map +1 -1
  161. package/dist/Popover/PopoverContentModal.cjs +4 -0
  162. package/dist/Popover/PopoverContentModal.cjs.map +1 -1
  163. package/dist/Popover/PopoverContentModal.js +4 -0
  164. package/dist/Popover/PopoverContentModal.js.map +1 -1
  165. package/dist/Popover/PopoverContentNonModal.cjs +4 -0
  166. package/dist/Popover/PopoverContentNonModal.cjs.map +1 -1
  167. package/dist/Popover/PopoverContentNonModal.js +4 -0
  168. package/dist/Popover/PopoverContentNonModal.js.map +1 -1
  169. package/dist/Popper/PopperContent.cjs +10 -2
  170. package/dist/Popper/PopperContent.cjs.map +1 -1
  171. package/dist/Popper/PopperContent.js +10 -2
  172. package/dist/Popper/PopperContent.js.map +1 -1
  173. package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs +8 -2
  174. package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs.map +1 -1
  175. package/dist/RangeCalendar/RangeCalendarCellTrigger.js +8 -2
  176. package/dist/RangeCalendar/RangeCalendarCellTrigger.js.map +1 -1
  177. package/dist/RangeCalendar/RangeCalendarGrid.cjs +2 -1
  178. package/dist/RangeCalendar/RangeCalendarGrid.cjs.map +1 -1
  179. package/dist/RangeCalendar/RangeCalendarGrid.js +2 -1
  180. package/dist/RangeCalendar/RangeCalendarGrid.js.map +1 -1
  181. package/dist/RangeCalendar/RangeCalendarRoot.cjs +30 -16
  182. package/dist/RangeCalendar/RangeCalendarRoot.cjs.map +1 -1
  183. package/dist/RangeCalendar/RangeCalendarRoot.js +31 -17
  184. package/dist/RangeCalendar/RangeCalendarRoot.js.map +1 -1
  185. package/dist/RangeCalendar/useRangeCalendar.cjs +41 -8
  186. package/dist/RangeCalendar/useRangeCalendar.cjs.map +1 -1
  187. package/dist/RangeCalendar/useRangeCalendar.js +41 -8
  188. package/dist/RangeCalendar/useRangeCalendar.js.map +1 -1
  189. package/dist/ScrollArea/ScrollAreaRoot.cjs.map +1 -1
  190. package/dist/ScrollArea/ScrollAreaRoot.js.map +1 -1
  191. package/dist/ScrollArea/ScrollAreaScrollbar.cjs +9 -2
  192. package/dist/ScrollArea/ScrollAreaScrollbar.cjs.map +1 -1
  193. package/dist/ScrollArea/ScrollAreaScrollbar.js +9 -2
  194. package/dist/ScrollArea/ScrollAreaScrollbar.js.map +1 -1
  195. package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.cjs +132 -0
  196. package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.cjs.map +1 -0
  197. package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.js +126 -0
  198. package/dist/ScrollArea/ScrollAreaScrollbarGlimpse.js.map +1 -0
  199. package/dist/Select/SelectContent.cjs +4 -0
  200. package/dist/Select/SelectContent.cjs.map +1 -1
  201. package/dist/Select/SelectContent.js +4 -0
  202. package/dist/Select/SelectContent.js.map +1 -1
  203. package/dist/Select/SelectContentImpl.cjs +4 -0
  204. package/dist/Select/SelectContentImpl.cjs.map +1 -1
  205. package/dist/Select/SelectContentImpl.js +4 -0
  206. package/dist/Select/SelectContentImpl.js.map +1 -1
  207. package/dist/Select/SelectPopperPosition.cjs +4 -0
  208. package/dist/Select/SelectPopperPosition.cjs.map +1 -1
  209. package/dist/Select/SelectPopperPosition.js +4 -0
  210. package/dist/Select/SelectPopperPosition.js.map +1 -1
  211. package/dist/Tabs/TabsContent.cjs +4 -0
  212. package/dist/Tabs/TabsContent.cjs.map +1 -1
  213. package/dist/Tabs/TabsContent.js +5 -1
  214. package/dist/Tabs/TabsContent.js.map +1 -1
  215. package/dist/Tabs/TabsRoot.cjs +11 -1
  216. package/dist/Tabs/TabsRoot.cjs.map +1 -1
  217. package/dist/Tabs/TabsRoot.js +12 -2
  218. package/dist/Tabs/TabsRoot.js.map +1 -1
  219. package/dist/Tabs/TabsTrigger.cjs +1 -1
  220. package/dist/Tabs/TabsTrigger.cjs.map +1 -1
  221. package/dist/Tabs/TabsTrigger.js +1 -1
  222. package/dist/Tabs/TabsTrigger.js.map +1 -1
  223. package/dist/TimeField/TimeFieldInput.cjs +3 -1
  224. package/dist/TimeField/TimeFieldInput.cjs.map +1 -1
  225. package/dist/TimeField/TimeFieldInput.js +3 -1
  226. package/dist/TimeField/TimeFieldInput.js.map +1 -1
  227. package/dist/TimeField/TimeFieldRoot.cjs +24 -2
  228. package/dist/TimeField/TimeFieldRoot.cjs.map +1 -1
  229. package/dist/TimeField/TimeFieldRoot.js +24 -2
  230. package/dist/TimeField/TimeFieldRoot.js.map +1 -1
  231. package/dist/date/calendar.cjs +29 -9
  232. package/dist/date/calendar.cjs.map +1 -1
  233. package/dist/date/calendar.js +25 -11
  234. package/dist/date/calendar.js.map +1 -1
  235. package/dist/date/comparators.cjs +14 -2
  236. package/dist/date/comparators.cjs.map +1 -1
  237. package/dist/date/comparators.js +14 -2
  238. package/dist/date/comparators.js.map +1 -1
  239. package/dist/date/parser.cjs +1 -0
  240. package/dist/date/parser.cjs.map +1 -1
  241. package/dist/date/parser.js +1 -0
  242. package/dist/date/parser.js.map +1 -1
  243. package/dist/date/useDateField.cjs +41 -20
  244. package/dist/date/useDateField.cjs.map +1 -1
  245. package/dist/date/useDateField.js +41 -20
  246. package/dist/date/useDateField.js.map +1 -1
  247. package/dist/date.cjs +1 -0
  248. package/dist/date.d.cts +2 -2
  249. package/dist/date.d.ts +2 -2
  250. package/dist/date.js +2 -2
  251. package/dist/index.cjs +3 -1
  252. package/dist/index.d.cts +1148 -1106
  253. package/dist/index.d.cts.map +1 -1
  254. package/dist/index.d.ts +670 -628
  255. package/dist/index.d.ts.map +1 -1
  256. package/dist/index.js +3 -2
  257. package/dist/index2.d.cts +9 -2
  258. package/dist/index2.d.cts.map +1 -1
  259. package/dist/index2.d.ts +9 -2
  260. package/dist/index2.d.ts.map +1 -1
  261. package/dist/shared/useDateFormatter.cjs +1 -1
  262. package/dist/shared/useDateFormatter.cjs.map +1 -1
  263. package/dist/shared/useDateFormatter.js +1 -1
  264. package/dist/shared/useDateFormatter.js.map +1 -1
  265. package/dist/shared/useForwardExpose.cjs +1 -1
  266. package/dist/shared/useForwardExpose.cjs.map +1 -1
  267. package/dist/shared/useForwardExpose.js +1 -1
  268. package/dist/shared/useForwardExpose.js.map +1 -1
  269. package/dist/shared/useGraceArea.cjs +1 -1
  270. package/dist/shared/useGraceArea.cjs.map +1 -1
  271. package/dist/shared/useGraceArea.js +1 -1
  272. package/dist/shared/useGraceArea.js.map +1 -1
  273. package/package.json +20 -16
  274. package/src/Avatar/AvatarImage.vue +2 -1
  275. package/src/Calendar/CalendarCellTrigger.vue +8 -1
  276. package/src/Calendar/CalendarRoot.vue +19 -7
  277. package/src/Calendar/useCalendar.ts +43 -3
  278. package/src/Collection/Collection.ts +3 -2
  279. package/src/Combobox/ComboboxContentImpl.vue +40 -32
  280. package/src/Combobox/ComboboxRoot.vue +1 -1
  281. package/src/DatePicker/DatePickerRoot.vue +10 -10
  282. package/src/DatePicker/index.ts +4 -4
  283. package/src/DateRangePicker/DateRangePickerRoot.vue +11 -11
  284. package/src/DateRangePicker/index.ts +4 -4
  285. package/src/Editable/EditableInput.vue +1 -1
  286. package/src/FocusScope/FocusScope.vue +2 -2
  287. package/src/Listbox/ListboxFilter.vue +1 -1
  288. package/src/Listbox/ListboxRoot.vue +2 -1
  289. package/src/Menu/MenuRadioGroup.vue +5 -4
  290. package/src/Menu/MenuRadioItem.vue +2 -1
  291. package/src/NavigationMenu/NavigationMenuRoot.vue +10 -6
  292. package/src/NumberField/NumberFieldRoot.vue +6 -1
  293. package/src/PinInput/PinInputInput.vue +25 -18
  294. package/src/Popper/PopperContent.vue +15 -5
  295. package/src/RadioGroup/RadioGroupRoot.vue +1 -1
  296. package/src/RangeCalendar/RangeCalendarCellTrigger.vue +13 -3
  297. package/src/RangeCalendar/RangeCalendarGrid.vue +1 -0
  298. package/src/RangeCalendar/RangeCalendarRoot.vue +46 -30
  299. package/src/RangeCalendar/useRangeCalendar.ts +43 -15
  300. package/src/Rating/RatingItem.vue +52 -0
  301. package/src/Rating/RatingItemIndicator.vue +60 -0
  302. package/src/Rating/RatingRoot.vue +113 -0
  303. package/src/Rating/index.ts +3 -0
  304. package/src/ScrollArea/ScrollAreaRoot.vue +2 -1
  305. package/src/ScrollArea/ScrollAreaScrollbar.vue +9 -0
  306. package/src/ScrollArea/ScrollAreaScrollbarGlimpse.vue +145 -0
  307. package/src/ScrollArea/index.ts +4 -0
  308. package/src/ScrollArea/types.ts +1 -1
  309. package/src/Tabs/TabsContent.vue +6 -1
  310. package/src/Tabs/TabsRoot.vue +14 -1
  311. package/src/Tabs/TabsTrigger.vue +1 -1
  312. package/src/TimeField/TimeFieldInput.vue +6 -1
  313. package/src/TimeField/TimeFieldRoot.vue +25 -2
  314. package/src/Tree/TreeRoot.vue +2 -2
  315. package/src/date/calendar.ts +42 -18
  316. package/src/date/comparators.ts +15 -2
  317. package/src/index.ts +1 -0
  318. package/src/shared/date/parser.ts +10 -0
  319. package/src/shared/date/useDateField.ts +72 -21
  320. package/src/shared/index.ts +1 -1
  321. package/src/shared/useDateFormatter.ts +2 -2
  322. package/src/shared/useForwardExpose.ts +1 -1
  323. package/src/shared/useGraceArea.ts +1 -1
@@ -50,11 +50,18 @@ function handleInput(event: InputEvent) {
50
50
  nextEl.focus()
51
51
  }
52
52
 
53
- function resetPlaceholder() {
54
- const target = currentElement.value as HTMLInputElement
53
+ function updatePlaceholder() {
55
54
  nextTick(() => {
56
- if (target && !target.value)
55
+ const target = currentElement.value as HTMLInputElement
56
+ if (!target) {
57
+ return
58
+ }
59
+ if (!target.value && target === getActiveElement()) {
60
+ target.placeholder = ''
61
+ }
62
+ else {
57
63
  target.placeholder = context.placeholder.value
64
+ }
58
65
  })
59
66
  }
60
67
 
@@ -93,21 +100,25 @@ function handleDelete(event: KeyboardEvent) {
93
100
  }
94
101
 
95
102
  function handleFocus(event: FocusEvent) {
103
+ // In OTP mode, inputs should be filled one by one without skipping middle inputs
104
+ if (context.otp.value) {
105
+ const firstEmptyInputIdx = inputElements.value.findIndex((_, idx) =>
106
+ context.currentModelValue.value[idx] === ''
107
+ || context.currentModelValue.value[idx] === undefined,
108
+ )
109
+ if (firstEmptyInputIdx !== -1 && firstEmptyInputIdx < props.index) {
110
+ inputElements.value[firstEmptyInputIdx].focus()
111
+ return
112
+ }
113
+ }
114
+
96
115
  const target = event.target as HTMLInputElement
97
116
  target.setSelectionRange(1, 1)
98
-
99
- if (!target.value)
100
- target.placeholder = ''
101
-
102
- // #2266, check again after DOM flushes
103
- setTimeout(() => {
104
- if (!target.value)
105
- target.placeholder = ''
106
- })
117
+ updatePlaceholder()
107
118
  }
108
119
 
109
120
  function handleBlur(event: FocusEvent) {
110
- resetPlaceholder()
121
+ updatePlaceholder()
111
122
  }
112
123
 
113
124
  function handlePaste(event: ClipboardEvent) {
@@ -168,11 +179,7 @@ function updateModelValueAt(index: number, value: string) {
168
179
  context.modelValue.value = removeTrailingEmptyStrings(tempModelValue)
169
180
  }
170
181
 
171
- watch(currentValue, () => {
172
- if (!currentValue.value) {
173
- resetPlaceholder()
174
- }
175
- })
182
+ watch(currentValue, updatePlaceholder)
176
183
 
177
184
  onMounted(() => {
178
185
  context.onInputElementChange(currentElement.value as HTMLInputElement)
@@ -20,6 +20,7 @@ export const PopperContentPropsDefaultValue = {
20
20
  alignOffset: 0,
21
21
  alignFlip: true,
22
22
  arrowPadding: 0,
23
+ hideShiftedArrow: true,
23
24
  avoidCollisions: true,
24
25
  collisionBoundary: () => [],
25
26
  collisionPadding: 0,
@@ -36,7 +37,7 @@ export interface PopperContentProps extends PrimitiveProps {
36
37
  * Will be reversed when collisions occur and avoidCollisions
37
38
  * is enabled.
38
39
  *
39
- * @defaultValue "top"
40
+ * @defaultValue "bottom"
40
41
  */
41
42
  side?: Side
42
43
 
@@ -112,6 +113,14 @@ export interface PopperContentProps extends PrimitiveProps {
112
113
  */
113
114
  arrowPadding?: number
114
115
 
116
+ /**
117
+ * When `true`, hides the arrow when it cannot be centered
118
+ * to the reference element.
119
+ *
120
+ * @defaultValue true
121
+ */
122
+ hideShiftedArrow?: boolean
123
+
115
124
  /**
116
125
  * The sticky behavior on the align axis. `partial` will keep the
117
126
  * content in the boundary as long as the trigger is at least partially
@@ -346,9 +355,10 @@ watchPostEffect(() => {
346
355
  emits('placed')
347
356
  })
348
357
 
349
- const cannotCenterArrow = computed(
350
- () => middlewareData.value.arrow?.centerOffset !== 0,
351
- )
358
+ const shouldHideArrow = computed(() => {
359
+ const cannotCenterArrow = middlewareData.value.arrow?.centerOffset !== 0
360
+ return props.hideShiftedArrow && cannotCenterArrow
361
+ })
352
362
 
353
363
  const contentZIndex = ref('')
354
364
  watchEffect(() => {
@@ -364,7 +374,7 @@ providePopperContentContext({
364
374
  onArrowChange: element => arrow.value = element,
365
375
  arrowX,
366
376
  arrowY,
367
- shouldHideArrow: cannotCenterArrow,
377
+ shouldHideArrow,
368
378
  })
369
379
  </script>
370
380
 
@@ -24,7 +24,7 @@ export interface RadioGroupRootProps extends PrimitiveProps, FormFieldProps {
24
24
  }
25
25
  export type RadioGroupRootEmits = {
26
26
  /** Event handler called when the radio group value changes */
27
- 'update:modelValue': [payload: string]
27
+ 'update:modelValue': [payload: AcceptableValue]
28
28
  }
29
29
 
30
30
  interface RadioGroupRootContext {
@@ -94,7 +94,15 @@ const isDisabled = computed(() => rootContext.isDateDisabled(props.day) || (root
94
94
  const dayValue = computed(() => props.day.day.toLocaleString(rootContext.locale.value))
95
95
 
96
96
  const isFocusedDate = computed(() => {
97
- return !rootContext.disabled.value && isSameDay(props.day, rootContext.placeholder.value)
97
+ if (isOutsideView.value || isDisabled.value)
98
+ return false
99
+ if (!rootContext.disabled.value && rootContext.isPlaceholderFocusable.value && isSameDay(props.day, rootContext.placeholder.value))
100
+ return true
101
+ if (!rootContext.disabled.value && rootContext.selectedFocusableDate.value && !rootContext.isPlaceholderFocusable.value)
102
+ return isSameDay(props.day, rootContext.selectedFocusableDate.value)
103
+ if (!rootContext.disabled.value && (!rootContext.hasSelectedDate.value || rootContext.isSelectedDisabled.value) && !rootContext.isPlaceholderFocusable.value)
104
+ return rootContext.firstFocusableDate.value && isSameDay(props.day, rootContext.firstFocusableDate.value)
105
+ return false
98
106
  })
99
107
 
100
108
  function changeDate(e: MouseEvent | KeyboardEvent, date: DateValue) {
@@ -103,22 +111,24 @@ function changeDate(e: MouseEvent | KeyboardEvent, date: DateValue) {
103
111
  if (rootContext.isDateDisabled(date) || rootContext.isDateUnavailable?.(date))
104
112
  return
105
113
 
106
- rootContext.lastPressedDateValue.value = date.copy()
107
-
108
114
  if (rootContext.startValue.value && rootContext.highlightedRange.value === null) {
109
115
  if (isSameDay(date, rootContext.startValue.value) && !rootContext.preventDeselect.value && !rootContext.endValue.value) {
110
116
  rootContext.startValue.value = undefined
111
117
  rootContext.onPlaceholderChange(date)
118
+ rootContext.lastPressedDateValue.value = date.copy()
112
119
  return
113
120
  }
114
121
  else if (!rootContext.endValue.value) {
115
122
  e.preventDefault()
116
123
  if (rootContext.lastPressedDateValue.value && isSameDay(rootContext.lastPressedDateValue.value, date))
117
124
  rootContext.startValue.value = date.copy()
125
+ rootContext.lastPressedDateValue.value = date.copy()
118
126
  return
119
127
  }
120
128
  }
121
129
 
130
+ rootContext.lastPressedDateValue.value = date.copy()
131
+
122
132
  if (
123
133
  rootContext.startValue.value
124
134
  && rootContext.endValue.value
@@ -26,6 +26,7 @@ const readonly = computed(() => rootContext.readonly.value ? true : undefined)
26
26
  :aria-disabled="disabled"
27
27
  :data-readonly="readonly && ''"
28
28
  :data-disabled="disabled && ''"
29
+ @mouseleave="rootContext.focusedValue.value = undefined"
29
30
  >
30
31
  <slot />
31
32
  </Primitive>
@@ -1,14 +1,14 @@
1
1
  <script lang="ts">
2
2
  import type { DateValue } from '@internationalized/date'
3
3
  import type { Ref } from 'vue'
4
- import type { Grid, Matcher, WeekDayFormat } from '@/date'
4
+ import type { Grid, Matcher, WeekDayFormat, WeekStartsOn } from '@/date'
5
5
  import type { PrimitiveProps } from '@/Primitive'
6
6
  import type { Formatter } from '@/shared'
7
7
  import type { DateRange } from '@/shared/date'
8
8
  import type { Direction } from '@/shared/types'
9
9
  import { isEqualDay } from '@internationalized/date'
10
10
  import { useCalendar } from '@/Calendar/useCalendar'
11
- import { isBefore } from '@/date'
11
+ import { getWeekStartsOn, isBefore } from '@/date'
12
12
  import {
13
13
  createContext,
14
14
  useDirection,
@@ -28,7 +28,7 @@ type RangeCalendarRootContext = {
28
28
  preventDeselect: Ref<boolean>
29
29
  grid: Ref<Grid<DateValue>[]>
30
30
  weekDays: Ref<string[]>
31
- weekStartsOn: Ref<0 | 1 | 2 | 3 | 4 | 5 | 6>
31
+ weekStartsOn: Ref<WeekStartsOn>
32
32
  weekdayFormat: Ref<WeekDayFormat>
33
33
  fixedWeeks: Ref<boolean>
34
34
  numberOfMonths: Ref<number>
@@ -68,6 +68,11 @@ type RangeCalendarRootContext = {
68
68
  maximumDays: Ref<number | undefined>
69
69
  minValue: Ref<DateValue | undefined>
70
70
  maxValue: Ref<DateValue | undefined>
71
+ isPlaceholderFocusable: Ref<boolean>
72
+ firstFocusableDate: Ref<DateValue | undefined>
73
+ hasSelectedDate: Ref<boolean>
74
+ isSelectedDisabled: Ref<boolean>
75
+ selectedFocusableDate: Ref<DateValue | undefined>
71
76
  }
72
77
 
73
78
  export interface RangeCalendarRootProps extends PrimitiveProps {
@@ -88,7 +93,7 @@ export interface RangeCalendarRootProps extends PrimitiveProps {
88
93
  /** The maximum number of days that can be selected in a range */
89
94
  maximumDays?: number
90
95
  /** The day of the week to start the calendar on */
91
- weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
96
+ weekStartsOn?: WeekStartsOn
92
97
  /** The format to use for the weekday strings provided via the weekdays slot prop */
93
98
  weekdayFormat?: WeekDayFormat
94
99
  /** The accessible label for the calendar */
@@ -145,7 +150,7 @@ export const [injectRangeCalendarRootContext, provideRangeCalendarRootContext]
145
150
 
146
151
  <script setup lang="ts">
147
152
  import { useEventListener, useVModel } from '@vueuse/core'
148
- import { onMounted, ref, toRefs, watch } from 'vue'
153
+ import { computed, onMounted, ref, toRefs, watch } from 'vue'
149
154
  import { Primitive, usePrimitiveElement } from '@/Primitive'
150
155
 
151
156
  const props = withDefaults(defineProps<RangeCalendarRootProps>(), {
@@ -153,7 +158,6 @@ const props = withDefaults(defineProps<RangeCalendarRootProps>(), {
153
158
  as: 'div',
154
159
  pagedNavigation: false,
155
160
  preventDeselect: false,
156
- weekStartsOn: 0,
157
161
  weekdayFormat: 'narrow',
158
162
  fixedWeeks: false,
159
163
  numberOfMonths: 1,
@@ -167,6 +171,7 @@ const props = withDefaults(defineProps<RangeCalendarRootProps>(), {
167
171
  allowNonContiguousRanges: false,
168
172
  maximumDays: undefined,
169
173
  disableDaysOutsideCurrentView: false,
174
+
170
175
  })
171
176
  const emits = defineEmits<RangeCalendarRootEmits>()
172
177
 
@@ -179,7 +184,7 @@ defineSlots<{
179
184
  /** The days of the week */
180
185
  weekDays: string[]
181
186
  /** The start of the week */
182
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6
187
+ weekStartsOn: WeekStartsOn
183
188
  /** The calendar locale */
184
189
  locale: string
185
190
  /** Whether or not to always display 6 weeks in the calendar */
@@ -194,7 +199,6 @@ const {
194
199
  readonly,
195
200
  initialFocus,
196
201
  pagedNavigation,
197
- weekStartsOn,
198
202
  weekdayFormat,
199
203
  fixedWeeks,
200
204
  numberOfMonths,
@@ -219,6 +223,7 @@ const { primitiveElement, currentElement: parentElement }
219
223
  = usePrimitiveElement()
220
224
  const dir = useDirection(propDir)
221
225
  const locale = useLocale(propLocale)
226
+ const weekStartsOn = computed(() => props.weekStartsOn ?? getWeekStartsOn(locale.value))
222
227
 
223
228
  const lastPressedDateValue = ref() as Ref<DateValue | undefined>
224
229
  const focusedValue = ref() as Ref<DateValue | undefined>
@@ -227,9 +232,12 @@ const isEditing = ref(false)
227
232
  const modelValue = useVModel(props, 'modelValue', emits, {
228
233
  defaultValue: props.defaultValue ?? { start: undefined, end: undefined },
229
234
  passive: (props.modelValue === undefined) as false,
230
- }) as Ref<DateRange>
235
+ }) as Ref<DateRange | null>
236
+
237
+ const normalizeRange = (value?: DateRange | null): DateRange => value ?? { start: undefined, end: undefined }
238
+ const normalizedModelValue = computed(() => normalizeRange(modelValue.value))
231
239
 
232
- const validModelValue = ref(modelValue.value) as Ref<DateRange>
240
+ const validModelValue = ref(normalizeRange(modelValue.value)) as Ref<DateRange>
233
241
 
234
242
  watch(validModelValue, (value) => {
235
243
  emits('update:validModelValue', value)
@@ -237,14 +245,14 @@ watch(validModelValue, (value) => {
237
245
 
238
246
  const defaultDate = getDefaultDate({
239
247
  defaultPlaceholder: props.placeholder,
240
- defaultValue: modelValue.value.start,
248
+ defaultValue: normalizeRange(modelValue.value).start,
241
249
  locale: props.locale,
242
250
  })
243
251
 
244
- const startValue = ref(modelValue.value.start) as Ref<
252
+ const startValue = ref(normalizeRange(modelValue.value).start) as Ref<
245
253
  DateValue | undefined
246
254
  >
247
- const endValue = ref(modelValue.value.end) as Ref<DateValue | undefined>
255
+ const endValue = ref(normalizeRange(modelValue.value).end) as Ref<DateValue | undefined>
248
256
 
249
257
  const placeholder = useVModel(props, 'placeholder', emits, {
250
258
  defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),
@@ -268,6 +276,8 @@ const {
268
276
  nextPage,
269
277
  prevPage,
270
278
  formatter,
279
+ isPlaceholderFocusable,
280
+ firstFocusableDate,
271
281
  } = useCalendar({
272
282
  locale,
273
283
  placeholder,
@@ -296,6 +306,9 @@ const {
296
306
  isHighlightedStart,
297
307
  isHighlightedEnd,
298
308
  isDateDisabled: rangeIsDateDisabled,
309
+ hasSelectedDate,
310
+ isSelectedDisabled,
311
+ selectedFocusableDate,
299
312
  } = useRangeCalendarState({
300
313
  start: startValue,
301
314
  end: endValue,
@@ -308,23 +321,21 @@ const {
308
321
  maximumDays,
309
322
  })
310
323
 
311
- watch(modelValue, (_modelValue, _prevValue) => {
312
- if (
313
- (!_prevValue?.start && _modelValue?.start)
314
- || !_modelValue
315
- || !_modelValue.start
316
- || (startValue.value && !isEqualDay(_modelValue.start, startValue.value))
317
- ) {
318
- startValue.value = _modelValue?.start?.copy?.()
324
+ watch(modelValue, (_modelValue) => {
325
+ const next = normalizeRange(_modelValue)
326
+
327
+ const isStartSynced = (!next.start && !startValue.value)
328
+ || (!!next.start && !!startValue.value && isEqualDay(next.start, startValue.value))
329
+
330
+ if (!isStartSynced) {
331
+ startValue.value = next.start?.copy?.()
319
332
  }
320
333
 
321
- if (
322
- (!_prevValue?.end && _modelValue.end)
323
- || !_modelValue
324
- || !_modelValue.end
325
- || (endValue.value && !isEqualDay(_modelValue.end, endValue.value))
326
- ) {
327
- endValue.value = _modelValue?.end?.copy?.()
334
+ const isEndSynced = (!next.end && !endValue.value)
335
+ || (!!next.end && !!endValue.value && isEqualDay(next.end, endValue.value))
336
+
337
+ if (!isEndSynced) {
338
+ endValue.value = next.end?.copy?.()
328
339
  }
329
340
  })
330
341
 
@@ -382,7 +393,7 @@ provideRangeCalendarRootContext({
382
393
  startValue,
383
394
  endValue,
384
395
  formatter,
385
- modelValue,
396
+ modelValue: normalizedModelValue,
386
397
  placeholder,
387
398
  disabled,
388
399
  initialFocus,
@@ -422,6 +433,11 @@ provideRangeCalendarRootContext({
422
433
  maximumDays,
423
434
  minValue,
424
435
  maxValue,
436
+ isPlaceholderFocusable,
437
+ firstFocusableDate,
438
+ hasSelectedDate,
439
+ isSelectedDisabled,
440
+ selectedFocusableDate,
425
441
  })
426
442
 
427
443
  onMounted(() => {
@@ -470,7 +486,7 @@ onMounted(() => {
470
486
  :week-starts-on="weekStartsOn"
471
487
  :locale="locale"
472
488
  :fixed-weeks="fixedWeeks"
473
- :model-value="modelValue"
489
+ :model-value="normalizedModelValue"
474
490
  />
475
491
  </Primitive>
476
492
  </template>
@@ -41,7 +41,7 @@ export function useRangeCalendarState(props: UseRangeCalendarProps) {
41
41
  const isInvalid = computed(
42
42
  () => {
43
43
  if (isStartInvalid.value || isEndInvalid.value)
44
- return false
44
+ return true
45
45
  if (props.start.value && props.end.value && isBefore(props.end.value, props.start.value))
46
46
  return true
47
47
  return false
@@ -71,12 +71,10 @@ export function useRangeCalendarState(props: UseRangeCalendarProps) {
71
71
  return false
72
72
  }
73
73
 
74
- // Check if a date exceeds maximum days limit from the start date
75
74
  const rangeIsDateDisabled = (date: DateValue) => {
76
75
  if (props.isDateDisabled(date))
77
76
  return true
78
77
 
79
- // Check if exceeds maximum days limit
80
78
  if (props.maximumDays?.value) {
81
79
  if (props.start.value && props.end.value) {
82
80
  if (props.fixedDate.value) {
@@ -97,9 +95,6 @@ export function useRangeCalendarState(props: UseRangeCalendarProps) {
97
95
  }
98
96
  }
99
97
 
100
- if (!props.start.value || props.end.value || isSameDay(props.start.value, date))
101
- return false
102
-
103
98
  return false
104
99
  }
105
100
 
@@ -126,17 +121,17 @@ export function useRangeCalendarState(props: UseRangeCalendarProps) {
126
121
  }
127
122
  }
128
123
 
129
- // If maximum days is set and the range exceeds it, limit the highlight
130
- // We only apply this when we're in the middle of a selection (no end date yet)
131
124
  if (props.maximumDays?.value && !props.end.value) {
132
- // Determine the direction of selection and limit to maximum days
133
- const cappedEnd = isStartBeforeFocused
134
- ? start.add({ days: props.maximumDays.value - 1 })
135
- : start.subtract({ days: props.maximumDays.value })
125
+ const maximumDays = props.maximumDays.value
126
+ const anchor = props.start.value
136
127
 
137
- return {
138
- start,
139
- end: cappedEnd,
128
+ if (isStartBeforeFocused) {
129
+ const maxEnd = anchor.add({ days: maximumDays - 1 })
130
+ return { start: anchor, end: maxEnd }
131
+ }
132
+ else {
133
+ const minStart = anchor.subtract({ days: maximumDays - 1 })
134
+ return { start: minStart, end: anchor }
140
135
  }
141
136
  }
142
137
 
@@ -162,6 +157,36 @@ export function useRangeCalendarState(props: UseRangeCalendarProps) {
162
157
  return isSameDay(highlightedRange.value.end, date)
163
158
  }
164
159
 
160
+ const hasSelectedDate = computed(() => {
161
+ return !!(props.start.value || props.end.value)
162
+ })
163
+
164
+ const isStartDateDisabled = computed(() => {
165
+ return !!(props.start.value && props.isDateDisabled(props.start.value))
166
+ })
167
+
168
+ const isEndDateDisabled = computed(() => {
169
+ return !!(props.end.value && props.isDateDisabled(props.end.value))
170
+ })
171
+
172
+ const isSelectedDisabled = computed(() => {
173
+ const hasStart = !!props.start.value
174
+ const hasEnd = !!props.end.value
175
+ if (!hasStart && !hasEnd)
176
+ return false
177
+ if (hasStart && hasEnd)
178
+ return isStartDateDisabled.value && isEndDateDisabled.value
179
+ return (hasStart && isStartDateDisabled.value) || (hasEnd && isEndDateDisabled.value)
180
+ })
181
+
182
+ const selectedFocusableDate = computed(() => {
183
+ if (props.start.value && !isStartDateDisabled.value)
184
+ return props.start.value
185
+ if (props.end.value && !isEndDateDisabled.value)
186
+ return props.end.value
187
+ return undefined
188
+ })
189
+
165
190
  return {
166
191
  isInvalid,
167
192
  isSelected,
@@ -172,5 +197,8 @@ export function useRangeCalendarState(props: UseRangeCalendarProps) {
172
197
  isHighlightedStart,
173
198
  isHighlightedEnd,
174
199
  isDateDisabled: rangeIsDateDisabled,
200
+ hasSelectedDate,
201
+ isSelectedDisabled,
202
+ selectedFocusableDate,
175
203
  }
176
204
  }
@@ -0,0 +1,52 @@
1
+ <script lang="ts">
2
+ import type { ComputedRef } from 'vue'
3
+ import type { PrimitiveProps } from '@/Primitive'
4
+ import { computed } from 'vue'
5
+ import { Primitive } from '@/Primitive'
6
+ import { createContext } from '@/shared'
7
+ import { injectRatingRootContext } from './RatingRoot.vue'
8
+
9
+ interface RatingItemContext {
10
+ steps: ComputedRef<number[]>
11
+ }
12
+
13
+ export interface RatingItemProps extends PrimitiveProps {
14
+ item: number
15
+ }
16
+
17
+ export const [injectRatingItemContext, provideRatingItemContext]
18
+ = createContext<RatingItemContext>('RatingItem')
19
+ </script>
20
+
21
+ <script setup lang="ts">
22
+ const props = withDefaults(defineProps<RatingItemProps>(), { as: 'label' })
23
+ defineSlots<{
24
+ default?: (props: {
25
+ steps: number[]
26
+ }) => any
27
+ }>()
28
+
29
+ const rootContext = injectRatingRootContext()
30
+
31
+ const steps = computed(() => {
32
+ const groupStartValue = (props.item - 1)
33
+ const groupEndValue = props.item
34
+ const stepSize = rootContext.step.value
35
+
36
+ const numberOfSteps = Math.ceil((groupEndValue - groupStartValue) / stepSize)
37
+
38
+ return Array.from({ length: numberOfSteps }, (_, index) =>
39
+ Number((groupStartValue + (index + 1) * stepSize).toFixed(2)))
40
+ })
41
+
42
+ provideRatingItemContext({ steps })
43
+ </script>
44
+
45
+ <template>
46
+ <Primitive
47
+ :as="as"
48
+ :as-child="asChild"
49
+ >
50
+ <slot :steps="steps" />
51
+ </Primitive>
52
+ </template>
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ import type { PrimitiveProps } from '@/Primitive'
3
+ import { useActiveElement } from '@vueuse/core'
4
+ import { computed } from 'vue'
5
+ import { RadioGroupIndicator, RadioGroupItem } from '@/RadioGroup'
6
+ import { useForwardExpose } from '@/shared'
7
+ import { injectRatingItemContext } from './RatingItem.vue'
8
+ import { injectRatingRootContext } from './RatingRoot.vue'
9
+
10
+ export interface RatingItemProps extends PrimitiveProps {
11
+ step: number
12
+ }
13
+ </script>
14
+
15
+ <script setup lang="ts">
16
+ const props = defineProps<RatingItemProps>()
17
+
18
+ const rootContext = injectRatingRootContext()
19
+ const { currentElement, forwardRef } = useForwardExpose()
20
+ const activeElement = useActiveElement()
21
+ const itemContext = injectRatingItemContext()
22
+
23
+ const isActive = computed(() => {
24
+ return (rootContext.hoveredRating.value > 0 && props.step <= rootContext.hoveredRating.value) || (rootContext.hoveredRating.value === 0 && props.step <= rootContext.modelValue.value)
25
+ })
26
+
27
+ const isVisible = computed(() => {
28
+ return activeElement.value === currentElement.value || rootContext.step.value === 1 || props.step % 1 === 0 || props.step === rootContext.hoveredRating.value || props.step === rootContext.modelValue.value
29
+ })
30
+
31
+ function handleMouseEnter() {
32
+ rootContext.changeHoveredRating(props.step)
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <RadioGroupItem
38
+ :ref="forwardRef"
39
+ :as="as"
40
+ :as-child="asChild"
41
+ :style="{
42
+ ['--reka-rating-item-step-width']: `${((step % 1 || 1) * 100)}%`,
43
+ ['--reka-rating-item-step-opacity']: isVisible ? 1 : 0,
44
+ ['--reka-rating-item-step-z-index']: itemContext.steps.value.length - itemContext.steps.value.indexOf(step),
45
+
46
+ }"
47
+ :value="step"
48
+ :data-state="isActive ? 'active' : undefined"
49
+ :disabled="rootContext.disabled.value"
50
+ @select="rootContext.changeModelValue(step)"
51
+ @mouseenter="handleMouseEnter"
52
+ >
53
+ <RadioGroupIndicator
54
+ force-mount
55
+ as-child
56
+ >
57
+ <slot />
58
+ </RadioGroupIndicator>
59
+ </RadioGroupItem>
60
+ </template>