@rotki/ui-library 3.1.7 → 3.2.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 (257) hide show
  1. package/dist/components/accordions/accordion/RuiAccordion.js.map +1 -1
  2. package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
  3. package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  4. package/dist/components/accordions/accordion/accordion-styles.d.ts +1 -0
  5. package/dist/components/accordions/accordion/accordion-styles.js +7 -0
  6. package/dist/components/accordions/accordion/accordion-styles.js.map +1 -0
  7. package/dist/components/alerts/RuiAlert.js.map +1 -1
  8. package/dist/components/alerts/RuiAlert.vue_vue_type_script_setup_true_lang.js +1 -65
  9. package/dist/components/alerts/RuiAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/components/alerts/alert-styles.d.ts +145 -0
  11. package/dist/components/alerts/alert-styles.js +70 -0
  12. package/dist/components/alerts/alert-styles.js.map +1 -0
  13. package/dist/components/avatars/RuiAvatar.js.map +1 -1
  14. package/dist/components/avatars/RuiAvatar.vue_vue_type_script_setup_true_lang.js +1 -38
  15. package/dist/components/avatars/RuiAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/components/avatars/RuiAvatarGroup.js.map +1 -1
  17. package/dist/components/avatars/RuiAvatarGroup.vue_vue_type_script_setup_true_lang.js +1 -13
  18. package/dist/components/avatars/RuiAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/avatars/avatar-group-styles.d.ts +49 -0
  20. package/dist/components/avatars/avatar-group-styles.js +18 -0
  21. package/dist/components/avatars/avatar-group-styles.js.map +1 -0
  22. package/dist/components/avatars/avatar-styles.d.ts +181 -0
  23. package/dist/components/avatars/avatar-styles.js +43 -0
  24. package/dist/components/avatars/avatar-styles.js.map +1 -0
  25. package/dist/components/buttons/button-group/RuiButtonGroup.js.map +1 -1
  26. package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js +2 -138
  27. package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/buttons/button-group/button-group-styles.d.ts +142 -0
  29. package/dist/components/buttons/button-group/button-group-styles.js +143 -0
  30. package/dist/components/buttons/button-group/button-group-styles.js.map +1 -0
  31. package/dist/components/calendar/RuiCalendar.js.map +1 -1
  32. package/dist/components/calendar/RuiCalendar.vue_vue_type_script_setup_true_lang.js +1 -8
  33. package/dist/components/calendar/RuiCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/calendar/RuiCalendarGrid.js.map +1 -1
  35. package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js +2 -22
  36. package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/components/calendar/RuiCalendarMenu.js.map +1 -1
  38. package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js +3 -14
  39. package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/calendar/calendar-grid-styles.d.ts +43 -0
  41. package/dist/components/calendar/calendar-grid-styles.js +26 -0
  42. package/dist/components/calendar/calendar-grid-styles.js.map +1 -0
  43. package/dist/components/calendar/calendar-menu-styles.d.ts +34 -0
  44. package/dist/components/calendar/calendar-menu-styles.js +17 -0
  45. package/dist/components/calendar/calendar-menu-styles.js.map +1 -0
  46. package/dist/components/calendar/calendar-styles.d.ts +16 -0
  47. package/dist/components/calendar/calendar-styles.js +13 -0
  48. package/dist/components/calendar/calendar-styles.js.map +1 -0
  49. package/dist/components/cards/RuiCard.js.map +1 -1
  50. package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js +3 -58
  51. package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  52. package/dist/components/cards/RuiCardHeader.js.map +1 -1
  53. package/dist/components/cards/RuiCardHeader.vue_vue_type_script_setup_true_lang.js +2 -20
  54. package/dist/components/cards/RuiCardHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/components/cards/card-header-styles.d.ts +46 -0
  56. package/dist/components/cards/card-header-styles.js +24 -0
  57. package/dist/components/cards/card-header-styles.js.map +1 -0
  58. package/dist/components/cards/card-styles.d.ts +175 -0
  59. package/dist/components/cards/card-styles.js +62 -0
  60. package/dist/components/cards/card-styles.js.map +1 -0
  61. package/dist/components/chips/RuiChip.js.map +1 -1
  62. package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js +2 -241
  63. package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  64. package/dist/components/chips/chip-styles.d.ts +223 -0
  65. package/dist/components/chips/chip-styles.js +246 -0
  66. package/dist/components/chips/chip-styles.js.map +1 -0
  67. package/dist/components/color-picker/RuiColorBoard.js.map +1 -1
  68. package/dist/components/color-picker/RuiColorBoard.vue_vue_type_script_setup_true_lang.js +3 -3
  69. package/dist/components/color-picker/RuiColorBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/components/color-picker/RuiColorHue.js.map +1 -1
  71. package/dist/components/color-picker/RuiColorHue.vue_vue_type_script_setup_true_lang.js +3 -3
  72. package/dist/components/color-picker/RuiColorHue.vue_vue_type_script_setup_true_lang.js.map +1 -1
  73. package/dist/components/color-picker/RuiColorPicker.js.map +1 -1
  74. package/dist/components/color-picker/RuiColorPicker.vue_vue_type_script_setup_true_lang.js +3 -3
  75. package/dist/components/color-picker/RuiColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/components/color-picker/color-board-styles.d.ts +1 -0
  77. package/dist/components/color-picker/color-board-styles.js +7 -0
  78. package/dist/components/color-picker/color-board-styles.js.map +1 -0
  79. package/dist/components/color-picker/color-hue-styles.d.ts +1 -0
  80. package/dist/components/color-picker/color-hue-styles.js +7 -0
  81. package/dist/components/color-picker/color-hue-styles.js.map +1 -0
  82. package/dist/components/color-picker/color-picker-styles.d.ts +1 -0
  83. package/dist/components/color-picker/color-picker-styles.js +7 -0
  84. package/dist/components/color-picker/color-picker-styles.js.map +1 -0
  85. package/dist/components/forms/field-label/RuiFieldLabel.js.map +1 -1
  86. package/dist/components/forms/field-label/RuiFieldLabel.vue_vue_type_script_setup_true_lang.js +1 -11
  87. package/dist/components/forms/field-label/RuiFieldLabel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/components/forms/field-label/field-label-styles.d.ts +43 -0
  89. package/dist/components/forms/field-label/field-label-styles.js +16 -0
  90. package/dist/components/forms/field-label/field-label-styles.js.map +1 -0
  91. package/dist/components/forms/select/RuiSimpleSelect.js.map +1 -1
  92. package/dist/components/forms/select/RuiSimpleSelect.vue_vue_type_script_setup_true_lang.js +2 -11
  93. package/dist/components/forms/select/RuiSimpleSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  94. package/dist/components/forms/select/simple-select-styles.d.ts +2 -0
  95. package/dist/components/forms/select/simple-select-styles.js +15 -0
  96. package/dist/components/forms/select/simple-select-styles.js.map +1 -0
  97. package/dist/components/forms/switch/RuiSwitch.js.map +1 -1
  98. package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js +1 -126
  99. package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/forms/switch/switch-styles.d.ts +151 -0
  101. package/dist/components/forms/switch/switch-styles.js +131 -0
  102. package/dist/components/forms/switch/switch-styles.js.map +1 -0
  103. package/dist/components/icons/RuiIcon.js.map +1 -1
  104. package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js +2 -28
  105. package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/components/icons/icon-styles.d.ts +44 -0
  107. package/dist/components/icons/icon-styles.js +33 -0
  108. package/dist/components/icons/icon-styles.js.map +1 -0
  109. package/dist/components/loaders/RuiSkeletonBase.js.map +1 -1
  110. package/dist/components/loaders/RuiSkeletonBase.vue_vue_type_script_setup_true_lang.js +2 -12
  111. package/dist/components/loaders/RuiSkeletonBase.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/components/loaders/RuiSkeletonLoader.js.map +1 -1
  113. package/dist/components/loaders/RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js +3 -13
  114. package/dist/components/loaders/RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/loaders/skeleton-base-styles.d.ts +25 -0
  116. package/dist/components/loaders/skeleton-base-styles.js +16 -0
  117. package/dist/components/loaders/skeleton-base-styles.js.map +1 -0
  118. package/dist/components/loaders/skeleton-loader-styles.d.ts +37 -0
  119. package/dist/components/loaders/skeleton-loader-styles.js +18 -0
  120. package/dist/components/loaders/skeleton-loader-styles.js.map +1 -0
  121. package/dist/components/overlays/badge/RuiBadge.js.map +1 -1
  122. package/dist/components/overlays/badge/RuiBadge.vue_vue_type_script_setup_true_lang.js +1 -83
  123. package/dist/components/overlays/badge/RuiBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  124. package/dist/components/overlays/badge/badge-styles.d.ts +193 -0
  125. package/dist/components/overlays/badge/badge-styles.js +88 -0
  126. package/dist/components/overlays/badge/badge-styles.js.map +1 -0
  127. package/dist/components/overlays/dialog/RuiDialog.js.map +1 -1
  128. package/dist/components/overlays/dialog/RuiDialog.vue_vue_type_script_setup_true_lang.js +3 -14
  129. package/dist/components/overlays/dialog/RuiDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  130. package/dist/components/overlays/dialog/dialog-styles.d.ts +40 -0
  131. package/dist/components/overlays/dialog/dialog-styles.js +18 -0
  132. package/dist/components/overlays/dialog/dialog-styles.js.map +1 -0
  133. package/dist/components/overlays/menu/RuiMenu.js.map +1 -1
  134. package/dist/components/overlays/menu/RuiMenu.vue.d.ts +9 -0
  135. package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js +113 -58
  136. package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/components/overlays/menu/menu-styles.d.ts +58 -0
  138. package/dist/components/overlays/menu/menu-styles.js +25 -0
  139. package/dist/components/overlays/menu/menu-styles.js.map +1 -0
  140. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.js.map +1 -1
  141. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js +4 -69
  142. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/overlays/navigation-drawer/navigation-drawer-styles.d.ts +76 -0
  144. package/dist/components/overlays/navigation-drawer/navigation-drawer-styles.js +72 -0
  145. package/dist/components/overlays/navigation-drawer/navigation-drawer-styles.js.map +1 -0
  146. package/dist/components/overlays/notification/RuiNotification.js.map +1 -1
  147. package/dist/components/overlays/notification/RuiNotification.vue_vue_type_script_setup_true_lang.js +3 -3
  148. package/dist/components/overlays/notification/RuiNotification.vue_vue_type_script_setup_true_lang.js.map +1 -1
  149. package/dist/components/overlays/notification/notification-styles.d.ts +1 -0
  150. package/dist/components/overlays/notification/notification-styles.js +7 -0
  151. package/dist/components/overlays/notification/notification-styles.js.map +1 -0
  152. package/dist/components/overlays/tooltip/RuiTooltip.js.map +1 -1
  153. package/dist/components/overlays/tooltip/RuiTooltip.vue.d.ts +4 -2
  154. package/dist/components/overlays/tooltip/RuiTooltip.vue_vue_type_script_setup_true_lang.js +42 -25
  155. package/dist/components/overlays/tooltip/RuiTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  156. package/dist/components/overlays/tooltip/tooltip-styles.d.ts +2 -0
  157. package/dist/components/overlays/tooltip/tooltip-styles.js +3 -1
  158. package/dist/components/overlays/tooltip/tooltip-styles.js.map +1 -1
  159. package/dist/components/progress/RuiProgress.js.map +1 -1
  160. package/dist/components/progress/RuiProgress.vue_vue_type_script_setup_true_lang.js +1 -133
  161. package/dist/components/progress/RuiProgress.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/progress/progress-styles.d.ts +181 -0
  163. package/dist/components/progress/progress-styles.js +139 -0
  164. package/dist/components/progress/progress-styles.js.map +1 -0
  165. package/dist/components/steppers/RuiFooterStepper.js.map +1 -1
  166. package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js +3 -13
  167. package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/components/steppers/RuiStepper.js.map +1 -1
  169. package/dist/components/steppers/RuiStepper.vue_vue_type_script_setup_true_lang.js +4 -94
  170. package/dist/components/steppers/RuiStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/steppers/RuiStepperIcon.js.map +1 -1
  172. package/dist/components/steppers/RuiStepperIcon.vue_vue_type_script_setup_true_lang.js +2 -34
  173. package/dist/components/steppers/RuiStepperIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/components/steppers/footer-stepper-styles.d.ts +28 -0
  175. package/dist/components/steppers/footer-stepper-styles.js +16 -0
  176. package/dist/components/steppers/footer-stepper-styles.js.map +1 -0
  177. package/dist/components/steppers/stepper-icon-styles.d.ts +60 -0
  178. package/dist/components/steppers/stepper-icon-styles.js +39 -0
  179. package/dist/components/steppers/stepper-icon-styles.js.map +1 -0
  180. package/dist/components/steppers/stepper-styles.d.ts +202 -0
  181. package/dist/components/steppers/stepper-styles.js +98 -0
  182. package/dist/components/steppers/stepper-styles.js.map +1 -0
  183. package/dist/components/tables/RuiTable.js.map +1 -1
  184. package/dist/components/tables/RuiTable.vue_vue_type_script_setup_true_lang.js +1 -32
  185. package/dist/components/tables/RuiTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  186. package/dist/components/tables/RuiTableEmptyState.js.map +1 -1
  187. package/dist/components/tables/RuiTableEmptyState.vue_vue_type_script_setup_true_lang.js +1 -15
  188. package/dist/components/tables/RuiTableEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/components/tables/RuiTableErrorState.js.map +1 -1
  190. package/dist/components/tables/RuiTableErrorState.vue_vue_type_script_setup_true_lang.js +2 -5
  191. package/dist/components/tables/RuiTableErrorState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  192. package/dist/components/tables/RuiTableHead.js.map +1 -1
  193. package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js +1 -34
  194. package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/components/tables/RuiTableLoadingState.js.map +1 -1
  196. package/dist/components/tables/RuiTableLoadingState.vue_vue_type_script_setup_true_lang.js +1 -8
  197. package/dist/components/tables/RuiTableLoadingState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/components/tables/RuiTablePagination.js.map +1 -1
  199. package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js +1 -30
  200. package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  201. package/dist/components/tables/table-empty-state-styles.d.ts +43 -0
  202. package/dist/components/tables/table-empty-state-styles.js +20 -0
  203. package/dist/components/tables/table-empty-state-styles.js.map +1 -0
  204. package/dist/components/tables/table-error-state-styles.d.ts +36 -0
  205. package/dist/components/tables/table-error-state-styles.js +15 -0
  206. package/dist/components/tables/table-error-state-styles.js.map +1 -0
  207. package/dist/components/tables/table-head-styles.d.ts +91 -0
  208. package/dist/components/tables/table-head-styles.js +39 -0
  209. package/dist/components/tables/table-head-styles.js.map +1 -0
  210. package/dist/components/tables/table-loading-state-styles.d.ts +34 -0
  211. package/dist/components/tables/table-loading-state-styles.js +13 -0
  212. package/dist/components/tables/table-loading-state-styles.js.map +1 -0
  213. package/dist/components/tables/table-pagination-styles.d.ts +82 -0
  214. package/dist/components/tables/table-pagination-styles.js +35 -0
  215. package/dist/components/tables/table-pagination-styles.js.map +1 -0
  216. package/dist/components/tables/table-styles.d.ts +62 -0
  217. package/dist/components/tables/table-styles.js +37 -0
  218. package/dist/components/tables/table-styles.js.map +1 -0
  219. package/dist/components/tabs/tab/RuiTab.js.map +1 -1
  220. package/dist/components/tabs/tab/RuiTab.vue_vue_type_script_setup_true_lang.js +3 -84
  221. package/dist/components/tabs/tab/RuiTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  222. package/dist/components/tabs/tab/tab-styles.d.ts +153 -0
  223. package/dist/components/tabs/tab/tab-styles.js +89 -0
  224. package/dist/components/tabs/tab/tab-styles.js.map +1 -0
  225. package/dist/components/tabs/tabs/RuiTabs.js.map +1 -1
  226. package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js +2 -137
  227. package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/tabs/tabs/tabs-styles.d.ts +168 -0
  229. package/dist/components/tabs/tabs/tabs-styles.js +142 -0
  230. package/dist/components/tabs/tabs/tabs-styles.js.map +1 -0
  231. package/dist/composables/floating.d.ts +3 -1
  232. package/dist/composables/floating.js +8 -9
  233. package/dist/composables/floating.js.map +1 -1
  234. package/dist/icons/icons_1.d.ts +1 -1
  235. package/dist/icons/icons_1.js +10 -9
  236. package/dist/icons/icons_1.js.map +1 -1
  237. package/dist/icons/icons_2.d.ts +1 -1
  238. package/dist/icons/icons_2.js +9 -11
  239. package/dist/icons/icons_2.js.map +1 -1
  240. package/dist/icons/icons_3.d.ts +1 -1
  241. package/dist/icons/icons_3.js +11 -5
  242. package/dist/icons/icons_3.js.map +1 -1
  243. package/dist/icons/icons_4.d.ts +1 -1
  244. package/dist/icons/icons_4.js +5 -10
  245. package/dist/icons/icons_4.js.map +1 -1
  246. package/dist/icons/icons_5.d.ts +1 -0
  247. package/dist/icons/icons_5.js +10 -1
  248. package/dist/icons/icons_5.js.map +1 -1
  249. package/dist/icons/index.d.ts +1 -1
  250. package/dist/icons/index.js +7 -6
  251. package/dist/icons/index.js.map +1 -1
  252. package/dist/index.js +6 -6
  253. package/dist/utils/form-text-detail.d.ts +2 -0
  254. package/dist/utils/form-text-detail.js +5 -1
  255. package/dist/utils/form-text-detail.js.map +1 -1
  256. package/dist/web-types.json +11 -1
  257. package/package.json +1 -1
@@ -0,0 +1,58 @@
1
+ export declare const menuStyles: import("tailwind-variants").TVReturnType<{
2
+ fullWidth: {
3
+ true: {
4
+ wrapper: string;
5
+ };
6
+ };
7
+ dense: {
8
+ true: {
9
+ details: string;
10
+ };
11
+ false: {
12
+ details: string;
13
+ };
14
+ };
15
+ }, {
16
+ wrapper: string;
17
+ popover: string;
18
+ content: string;
19
+ details: string;
20
+ }, undefined, {
21
+ fullWidth: {
22
+ true: {
23
+ wrapper: string;
24
+ };
25
+ };
26
+ dense: {
27
+ true: {
28
+ details: string;
29
+ };
30
+ false: {
31
+ details: string;
32
+ };
33
+ };
34
+ }, {
35
+ wrapper: string;
36
+ popover: string;
37
+ content: string;
38
+ details: string;
39
+ }, import("tailwind-variants").TVReturnTypeLike<{
40
+ fullWidth: {
41
+ true: {
42
+ wrapper: string;
43
+ };
44
+ };
45
+ dense: {
46
+ true: {
47
+ details: string;
48
+ };
49
+ false: {
50
+ details: string;
51
+ };
52
+ };
53
+ }, {
54
+ wrapper: string;
55
+ popover: string;
56
+ content: string;
57
+ details: string;
58
+ }>>;
@@ -0,0 +1,25 @@
1
+ import { tv } from "../../../utils/tv.js";
2
+ //#region src/components/overlays/menu/menu-styles.ts
3
+ var menuStyles = tv({
4
+ slots: {
5
+ wrapper: "relative inline-flex max-w-full",
6
+ popover: "w-max z-rui-menu",
7
+ content: "rounded-rui-panel overflow-hidden shadow-rui-menu bg-rui-menu border border-rui-divider text-rui-text focus:outline-hidden p-1",
8
+ details: ""
9
+ },
10
+ variants: {
11
+ fullWidth: { true: { wrapper: "w-full" } },
12
+ dense: {
13
+ true: { details: "px-2" },
14
+ false: { details: "px-4" }
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ fullWidth: false,
19
+ dense: false
20
+ }
21
+ });
22
+ //#endregion
23
+ export { menuStyles };
24
+
25
+ //# sourceMappingURL=menu-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-styles.js","names":[],"sources":["../../../../src/components/overlays/menu/menu-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const menuStyles = tv({\n slots: {\n wrapper: 'relative inline-flex max-w-full',\n popover: 'w-max z-rui-menu',\n // a hairline edge keeps the popup apart from a surface of nearly the same shade in dark mode\n content: 'rounded-rui-panel overflow-hidden shadow-rui-menu bg-rui-menu border border-rui-divider text-rui-text focus:outline-hidden p-1',\n details: '',\n },\n variants: {\n fullWidth: {\n true: { wrapper: 'w-full' },\n },\n dense: {\n true: { details: 'px-2' },\n false: { details: 'px-4' },\n },\n },\n defaultVariants: { fullWidth: false, dense: false },\n});\n"],"mappings":";;AAEA,IAAa,aAAa,GAAG;CAC3B,OAAO;EACL,SAAS;EACT,SAAS;EAET,SAAS;EACT,SAAS;CACX;CACA,UAAU;EACR,WAAW,EACT,MAAM,EAAE,SAAS,SAAS,EAC5B;EACA,OAAO;GACL,MAAM,EAAE,SAAS,OAAO;GACxB,OAAO,EAAE,SAAS,OAAO;EAC3B;CACF;CACA,iBAAiB;EAAE,WAAW;EAAO,OAAO;CAAM;AACpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiNavigationDrawer.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/navigation-drawer/RuiNavigationDrawer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClassValue } from 'vue';\nimport type { VueClassValue } from '@/types/class-value';\nimport type { MaybeElement } from '@/types/dom';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { getRootAttrs, transformPropsUnit } from '@/utils/helpers';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface RuiNavigationDrawerClassNames {\n root?: VueClassValue;\n content?: VueClassValue;\n}\n\nexport interface NavigationDrawerProps {\n temporary?: boolean;\n stateless?: boolean;\n width?: string | number;\n miniVariant?: boolean;\n overlay?: boolean;\n position?: 'left' | 'right';\n classNames?: RuiNavigationDrawerClassNames;\n ariaLabel?: string;\n /**\n * Starts the drawer, and its overlay, below the app bar (`--rui-app-bar-height`), so the app bar\n * stays uncovered and usable while the drawer is open. Without it the drawer runs the full height and\n * a modal one covers the app bar.\n */\n belowAppBar?: boolean;\n}\n\ndefineOptions({\n name: 'RuiNavigationDrawer',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst {\n temporary = false,\n stateless = false,\n width = 360,\n miniVariant = false,\n overlay = false,\n position = 'left',\n classNames,\n ariaLabel,\n belowAppBar = false,\n} = defineProps<NavigationDrawerProps>();\n\nconst emit = defineEmits<{\n closed: [];\n}>();\n\ndefineSlots<{\n activator?: (props: { open: boolean; attrs: { onClick: () => void } }) => any;\n default?: (props: { attrs: { onClick: () => void }; close: () => void }) => any;\n}>();\n\nconst transitioning = ref<boolean>(false);\nconst content = useTemplateRef<MaybeElement>('content');\nconst leaveTimeout = useTimeoutManager();\nconst clickOutsideTimeout = useTimeoutManager();\n\nconst alive = computed<boolean>(() => get(modelValue) || get(transitioning) || miniVariant);\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\nconst activatorAttrs: { onClick: () => void } = {\n onClick: toggle,\n};\n\nconst drawer = tv({\n base: 'transition-[transform,translate,width] duration-200 ease-in-out bottom-0 fixed text-rui-text',\n variants: {\n belowAppBar: {\n true: 'top-rui-app-bar',\n false: 'top-0',\n },\n // a temporary drawer floats on the overlay surface; a docked one is part of the page, edged by a hairline\n temporary: {\n true: 'bg-rui-overlay',\n false: 'bg-rui-surface',\n },\n position: {\n left: 'left-0',\n right: 'right-0',\n },\n visible: {\n true: 'translate-x-0',\n false: '',\n },\n mini: {\n true: 'translate-x-0',\n false: '',\n },\n // a modal drawer covers the app bar; a docked one sits level with it\n withOverlay: {\n true: 'z-rui-drawer',\n false: 'z-rui-app-bar',\n },\n },\n compoundVariants: [\n { position: 'left', visible: false, mini: false, class: '-translate-x-full' },\n { position: 'right', visible: false, mini: false, class: 'translate-x-full' },\n { mini: true, visible: false, class: 'w-14!' },\n { temporary: false, position: 'left', class: 'border-r border-rui-divider' },\n { temporary: false, position: 'right', class: 'border-l border-rui-divider' },\n ],\n defaultVariants: { position: 'left', visible: false, mini: false, withOverlay: false, temporary: false, belowAppBar: false },\n});\n\n/**\n * Where the drawer starts its slide in: it mounts open, so the closed position has to be put on it for\n * its first frame. Important, because the open position is already on the element.\n */\nconst enterFromClass = computed<string>(() => (position === 'left' ? '-translate-x-full!' : 'translate-x-full!'));\n\n// the overlay dims what the drawer covers: the whole view, or only the part below the app bar\nconst overlayClass = computed<string>(() => cn([\n 'fixed inset-x-0 bottom-0 backdrop-blur-sm bg-rui-neutral-950/40 dark:bg-black/60 z-rui-drawer',\n belowAppBar ? 'top-rui-app-bar' : 'top-0',\n]) ?? '');\n\n/**\n * Consumer classes go through `drawer()` rather than alongside it, so\n * tailwind-variants' twMerge resolves conflicts in the consumer's favour.\n * Passed as an argument instead of read off `$attrs` here, so the template\n * keeps using `$attrs` directly.\n */\nfunction rootClass(attrsClass: ClassValue): string {\n return drawer({\n position,\n visible: modelValue.value,\n mini: miniVariant,\n withOverlay: overlay,\n temporary,\n belowAppBar,\n class: cn([\n temporary && modelValue.value && 'shadow-rui-drawer',\n classNames?.content,\n classNames?.root,\n attrsClass,\n ]),\n });\n}\n\nfunction toggle(): void {\n set(modelValue, !get(modelValue));\n}\n\nfunction close(): void {\n set(modelValue, false);\n}\n\nfunction onLeaveComplete(): void {\n leaveTimeout.clear();\n if (get(transitioning)) {\n set(transitioning, false);\n emit('closed');\n }\n}\n\nwatch(modelValue, (value) => {\n if (!value) {\n set(transitioning, true);\n // Match CSS transition duration (200ms) + buffer\n leaveTimeout.create(onLeaveComplete, 250);\n }\n});\n\n// Debounced, so the activator's own click, which bubbles to the body, does not close it again\nonClickOutside(content, () => {\n if (get(modelValue) && temporary && !stateless) {\n clickOutsideTimeout.create(close, 50);\n }\n});\n</script>\n\n<template>\n <div>\n <slot\n name=\"activator\"\n v-bind=\"{ open: modelValue, attrs: activatorAttrs }\"\n />\n <Teleport to=\"body\">\n <Transition\n v-if=\"overlay\"\n enter-from-class=\"opacity-0\"\n enter-active-class=\"transition-opacity ease-out duration-200\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"transition-opacity ease-in duration-200\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n data-id=\"overlay\"\n :class=\"overlayClass\"\n @click.stop=\"close()\"\n />\n </Transition>\n <!-- leaves with no transition: it has already slid out, and its own would hold the removal for a transitionend that never comes -->\n <Transition\n :enter-from-class=\"enterFromClass\"\n leave-active-class=\"duration-0!\"\n >\n <aside\n v-if=\"alive\"\n ref=\"content\"\n data-id=\"drawer-content\"\n :style=\"style\"\n :data-visible=\"modelValue || undefined\"\n :data-position=\"position\"\n :data-mini=\"miniVariant || undefined\"\n :class=\"rootClass($attrs.class)\"\n :aria-label=\"ariaLabel\"\n v-bind=\"getRootAttrs($attrs, [])\"\n >\n <slot v-bind=\"{ attrs: activatorAttrs, close }\" />\n </aside>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiNavigationDrawer.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/navigation-drawer/RuiNavigationDrawer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClassValue } from 'vue';\nimport type { VueClassValue } from '@/types/class-value';\nimport type { MaybeElement } from '@/types/dom';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { getRootAttrs, transformPropsUnit } from '@/utils/helpers';\nimport { cn } from '@/utils/tv';\nimport { navigationDrawerStyles } from './navigation-drawer-styles';\n\nexport interface RuiNavigationDrawerClassNames {\n root?: VueClassValue;\n content?: VueClassValue;\n}\n\nexport interface NavigationDrawerProps {\n temporary?: boolean;\n stateless?: boolean;\n width?: string | number;\n miniVariant?: boolean;\n overlay?: boolean;\n position?: 'left' | 'right';\n classNames?: RuiNavigationDrawerClassNames;\n ariaLabel?: string;\n /**\n * Starts the drawer, and its overlay, below the app bar (`--rui-app-bar-height`), so the app bar\n * stays uncovered and usable while the drawer is open. Without it the drawer runs the full height and\n * a modal one covers the app bar.\n */\n belowAppBar?: boolean;\n}\n\ndefineOptions({\n name: 'RuiNavigationDrawer',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst {\n temporary = false,\n stateless = false,\n width = 360,\n miniVariant = false,\n overlay = false,\n position = 'left',\n classNames,\n ariaLabel,\n belowAppBar = false,\n} = defineProps<NavigationDrawerProps>();\n\nconst emit = defineEmits<{\n closed: [];\n}>();\n\ndefineSlots<{\n activator?: (props: { open: boolean; attrs: { onClick: () => void } }) => any;\n default?: (props: { attrs: { onClick: () => void }; close: () => void }) => any;\n}>();\n\nconst transitioning = ref<boolean>(false);\nconst content = useTemplateRef<MaybeElement>('content');\nconst leaveTimeout = useTimeoutManager();\nconst clickOutsideTimeout = useTimeoutManager();\n\nconst alive = computed<boolean>(() => get(modelValue) || get(transitioning) || miniVariant);\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\nconst activatorAttrs: { onClick: () => void } = {\n onClick: toggle,\n};\n\n/**\n * Where the drawer starts its slide in: it mounts open, so the closed position has to be put on it for\n * its first frame. Important, because the open position is already on the element.\n */\nconst enterFromClass = computed<string>(() => (position === 'left' ? '-translate-x-full!' : 'translate-x-full!'));\n\n// the overlay dims what the drawer covers: the whole view, or only the part below the app bar\nconst overlayClass = computed<string>(() => cn([\n 'fixed inset-x-0 bottom-0 backdrop-blur-sm bg-rui-neutral-950/40 dark:bg-black/60 z-rui-drawer',\n belowAppBar ? 'top-rui-app-bar' : 'top-0',\n]) ?? '');\n\n/**\n * Consumer classes go through `navigationDrawerStyles()` rather than alongside it, so\n * tailwind-variants' twMerge resolves conflicts in the consumer's favour.\n * Passed as an argument instead of read off `$attrs` here, so the template\n * keeps using `$attrs` directly.\n */\nfunction rootClass(attrsClass: ClassValue): string {\n return navigationDrawerStyles({\n position,\n visible: modelValue.value,\n mini: miniVariant,\n withOverlay: overlay,\n temporary,\n belowAppBar,\n class: cn([\n temporary && modelValue.value && 'shadow-rui-drawer',\n classNames?.content,\n classNames?.root,\n attrsClass,\n ]),\n });\n}\n\nfunction toggle(): void {\n set(modelValue, !get(modelValue));\n}\n\nfunction close(): void {\n set(modelValue, false);\n}\n\nfunction onLeaveComplete(): void {\n leaveTimeout.clear();\n if (get(transitioning)) {\n set(transitioning, false);\n emit('closed');\n }\n}\n\nwatch(modelValue, (value) => {\n if (!value) {\n set(transitioning, true);\n // Match CSS transition duration (200ms) + buffer\n leaveTimeout.create(onLeaveComplete, 250);\n }\n});\n\n// Debounced, so the activator's own click, which bubbles to the body, does not close it again\nonClickOutside(content, () => {\n if (get(modelValue) && temporary && !stateless) {\n clickOutsideTimeout.create(close, 50);\n }\n});\n</script>\n\n<template>\n <div>\n <slot\n name=\"activator\"\n v-bind=\"{ open: modelValue, attrs: activatorAttrs }\"\n />\n <Teleport to=\"body\">\n <Transition\n v-if=\"overlay\"\n enter-from-class=\"opacity-0\"\n enter-active-class=\"transition-opacity ease-out duration-200\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"transition-opacity ease-in duration-200\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n data-id=\"overlay\"\n :class=\"overlayClass\"\n @click.stop=\"close()\"\n />\n </Transition>\n <!-- leaves with no transition: it has already slid out, and its own would hold the removal for a transitionend that never comes -->\n <Transition\n :enter-from-class=\"enterFromClass\"\n leave-active-class=\"duration-0!\"\n >\n <aside\n v-if=\"alive\"\n ref=\"content\"\n data-id=\"drawer-content\"\n :style=\"style\"\n :data-visible=\"modelValue || undefined\"\n :data-position=\"position\"\n :data-mini=\"miniVariant || undefined\"\n :class=\"rootClass($attrs.class)\"\n :aria-label=\"ariaLabel\"\n v-bind=\"getRootAttrs($attrs, [])\"\n >\n <slot v-bind=\"{ attrs: activatorAttrs, close }\" />\n </aside>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
@@ -1,8 +1,9 @@
1
1
  import { get, set } from "../../../vendor/@vueuse/shared/dist/index.js";
2
2
  import { onClickOutside } from "../../../vendor/@vueuse/core/dist/index.js";
3
- import { cn, tv } from "../../../utils/tv.js";
3
+ import { cn } from "../../../utils/tv.js";
4
4
  import { useTimeoutManager } from "../../../composables/timeout-manager.js";
5
5
  import { getRootAttrs, transformPropsUnit } from "../../../utils/helpers.js";
6
+ import { navigationDrawerStyles } from "./navigation-drawer-styles.js";
6
7
  import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeClass, normalizeProps, openBlock, ref, renderSlot, unref, useModel, useTemplateRef, watch, withCtx, withModifiers } from "vue";
7
8
  //#region src/components/overlays/navigation-drawer/RuiNavigationDrawer.vue?vue&type=script&setup=true&lang.ts
8
9
  var _hoisted_1 = [
@@ -58,72 +59,6 @@ var RuiNavigationDrawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
58
59
  const alive = computed(() => get(modelValue) || get(transitioning) || __props.miniVariant);
59
60
  const style = computed(() => ({ width: transformPropsUnit(__props.width) }));
60
61
  const activatorAttrs = { onClick: toggle };
61
- const drawer = tv({
62
- base: "transition-[transform,translate,width] duration-200 ease-in-out bottom-0 fixed text-rui-text",
63
- variants: {
64
- belowAppBar: {
65
- true: "top-rui-app-bar",
66
- false: "top-0"
67
- },
68
- temporary: {
69
- true: "bg-rui-overlay",
70
- false: "bg-rui-surface"
71
- },
72
- position: {
73
- left: "left-0",
74
- right: "right-0"
75
- },
76
- visible: {
77
- true: "translate-x-0",
78
- false: ""
79
- },
80
- mini: {
81
- true: "translate-x-0",
82
- false: ""
83
- },
84
- withOverlay: {
85
- true: "z-rui-drawer",
86
- false: "z-rui-app-bar"
87
- }
88
- },
89
- compoundVariants: [
90
- {
91
- position: "left",
92
- visible: false,
93
- mini: false,
94
- class: "-translate-x-full"
95
- },
96
- {
97
- position: "right",
98
- visible: false,
99
- mini: false,
100
- class: "translate-x-full"
101
- },
102
- {
103
- mini: true,
104
- visible: false,
105
- class: "w-14!"
106
- },
107
- {
108
- temporary: false,
109
- position: "left",
110
- class: "border-r border-rui-divider"
111
- },
112
- {
113
- temporary: false,
114
- position: "right",
115
- class: "border-l border-rui-divider"
116
- }
117
- ],
118
- defaultVariants: {
119
- position: "left",
120
- visible: false,
121
- mini: false,
122
- withOverlay: false,
123
- temporary: false,
124
- belowAppBar: false
125
- }
126
- });
127
62
  /**
128
63
  * Where the drawer starts its slide in: it mounts open, so the closed position has to be put on it for
129
64
  * its first frame. Important, because the open position is already on the element.
@@ -131,13 +66,13 @@ var RuiNavigationDrawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
131
66
  const enterFromClass = computed(() => __props.position === "left" ? "-translate-x-full!" : "translate-x-full!");
132
67
  const overlayClass = computed(() => cn(["fixed inset-x-0 bottom-0 backdrop-blur-sm bg-rui-neutral-950/40 dark:bg-black/60 z-rui-drawer", __props.belowAppBar ? "top-rui-app-bar" : "top-0"]) ?? "");
133
68
  /**
134
- * Consumer classes go through `drawer()` rather than alongside it, so
69
+ * Consumer classes go through `navigationDrawerStyles()` rather than alongside it, so
135
70
  * tailwind-variants' twMerge resolves conflicts in the consumer's favour.
136
71
  * Passed as an argument instead of read off `$attrs` here, so the template
137
72
  * keeps using `$attrs` directly.
138
73
  */
139
74
  function rootClass(attrsClass) {
140
- return drawer({
75
+ return navigationDrawerStyles({
141
76
  position: __props.position,
142
77
  visible: modelValue.value,
143
78
  mini: __props.miniVariant,
@@ -1 +1 @@
1
- {"version":3,"file":"RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createBlock","_Teleport","_Transition","_withCtx","_normalizeClass","_unref","_withModifiers","_createCommentVNode","_createVNode","_mergeProps"],"sources":["../../../../src/components/overlays/navigation-drawer/RuiNavigationDrawer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClassValue } from 'vue';\nimport type { VueClassValue } from '@/types/class-value';\nimport type { MaybeElement } from '@/types/dom';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { getRootAttrs, transformPropsUnit } from '@/utils/helpers';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface RuiNavigationDrawerClassNames {\n root?: VueClassValue;\n content?: VueClassValue;\n}\n\nexport interface NavigationDrawerProps {\n temporary?: boolean;\n stateless?: boolean;\n width?: string | number;\n miniVariant?: boolean;\n overlay?: boolean;\n position?: 'left' | 'right';\n classNames?: RuiNavigationDrawerClassNames;\n ariaLabel?: string;\n /**\n * Starts the drawer, and its overlay, below the app bar (`--rui-app-bar-height`), so the app bar\n * stays uncovered and usable while the drawer is open. Without it the drawer runs the full height and\n * a modal one covers the app bar.\n */\n belowAppBar?: boolean;\n}\n\ndefineOptions({\n name: 'RuiNavigationDrawer',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst {\n temporary = false,\n stateless = false,\n width = 360,\n miniVariant = false,\n overlay = false,\n position = 'left',\n classNames,\n ariaLabel,\n belowAppBar = false,\n} = defineProps<NavigationDrawerProps>();\n\nconst emit = defineEmits<{\n closed: [];\n}>();\n\ndefineSlots<{\n activator?: (props: { open: boolean; attrs: { onClick: () => void } }) => any;\n default?: (props: { attrs: { onClick: () => void }; close: () => void }) => any;\n}>();\n\nconst transitioning = ref<boolean>(false);\nconst content = useTemplateRef<MaybeElement>('content');\nconst leaveTimeout = useTimeoutManager();\nconst clickOutsideTimeout = useTimeoutManager();\n\nconst alive = computed<boolean>(() => get(modelValue) || get(transitioning) || miniVariant);\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\nconst activatorAttrs: { onClick: () => void } = {\n onClick: toggle,\n};\n\nconst drawer = tv({\n base: 'transition-[transform,translate,width] duration-200 ease-in-out bottom-0 fixed text-rui-text',\n variants: {\n belowAppBar: {\n true: 'top-rui-app-bar',\n false: 'top-0',\n },\n // a temporary drawer floats on the overlay surface; a docked one is part of the page, edged by a hairline\n temporary: {\n true: 'bg-rui-overlay',\n false: 'bg-rui-surface',\n },\n position: {\n left: 'left-0',\n right: 'right-0',\n },\n visible: {\n true: 'translate-x-0',\n false: '',\n },\n mini: {\n true: 'translate-x-0',\n false: '',\n },\n // a modal drawer covers the app bar; a docked one sits level with it\n withOverlay: {\n true: 'z-rui-drawer',\n false: 'z-rui-app-bar',\n },\n },\n compoundVariants: [\n { position: 'left', visible: false, mini: false, class: '-translate-x-full' },\n { position: 'right', visible: false, mini: false, class: 'translate-x-full' },\n { mini: true, visible: false, class: 'w-14!' },\n { temporary: false, position: 'left', class: 'border-r border-rui-divider' },\n { temporary: false, position: 'right', class: 'border-l border-rui-divider' },\n ],\n defaultVariants: { position: 'left', visible: false, mini: false, withOverlay: false, temporary: false, belowAppBar: false },\n});\n\n/**\n * Where the drawer starts its slide in: it mounts open, so the closed position has to be put on it for\n * its first frame. Important, because the open position is already on the element.\n */\nconst enterFromClass = computed<string>(() => (position === 'left' ? '-translate-x-full!' : 'translate-x-full!'));\n\n// the overlay dims what the drawer covers: the whole view, or only the part below the app bar\nconst overlayClass = computed<string>(() => cn([\n 'fixed inset-x-0 bottom-0 backdrop-blur-sm bg-rui-neutral-950/40 dark:bg-black/60 z-rui-drawer',\n belowAppBar ? 'top-rui-app-bar' : 'top-0',\n]) ?? '');\n\n/**\n * Consumer classes go through `drawer()` rather than alongside it, so\n * tailwind-variants' twMerge resolves conflicts in the consumer's favour.\n * Passed as an argument instead of read off `$attrs` here, so the template\n * keeps using `$attrs` directly.\n */\nfunction rootClass(attrsClass: ClassValue): string {\n return drawer({\n position,\n visible: modelValue.value,\n mini: miniVariant,\n withOverlay: overlay,\n temporary,\n belowAppBar,\n class: cn([\n temporary && modelValue.value && 'shadow-rui-drawer',\n classNames?.content,\n classNames?.root,\n attrsClass,\n ]),\n });\n}\n\nfunction toggle(): void {\n set(modelValue, !get(modelValue));\n}\n\nfunction close(): void {\n set(modelValue, false);\n}\n\nfunction onLeaveComplete(): void {\n leaveTimeout.clear();\n if (get(transitioning)) {\n set(transitioning, false);\n emit('closed');\n }\n}\n\nwatch(modelValue, (value) => {\n if (!value) {\n set(transitioning, true);\n // Match CSS transition duration (200ms) + buffer\n leaveTimeout.create(onLeaveComplete, 250);\n }\n});\n\n// Debounced, so the activator's own click, which bubbles to the body, does not close it again\nonClickOutside(content, () => {\n if (get(modelValue) && temporary && !stateless) {\n clickOutsideTimeout.create(close, 50);\n }\n});\n</script>\n\n<template>\n <div>\n <slot\n name=\"activator\"\n v-bind=\"{ open: modelValue, attrs: activatorAttrs }\"\n />\n <Teleport to=\"body\">\n <Transition\n v-if=\"overlay\"\n enter-from-class=\"opacity-0\"\n enter-active-class=\"transition-opacity ease-out duration-200\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"transition-opacity ease-in duration-200\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n data-id=\"overlay\"\n :class=\"overlayClass\"\n @click.stop=\"close()\"\n />\n </Transition>\n <!-- leaves with no transition: it has already slid out, and its own would hold the removal for a transitionend that never comes -->\n <Transition\n :enter-from-class=\"enterFromClass\"\n leave-active-class=\"duration-0!\"\n >\n <aside\n v-if=\"alive\"\n ref=\"content\"\n data-id=\"drawer-content\"\n :style=\"style\"\n :data-visible=\"modelValue || undefined\"\n :data-position=\"position\"\n :data-mini=\"miniVariant || undefined\"\n :class=\"rootClass($attrs.class)\"\n :aria-label=\"ariaLabel\"\n v-bind=\"getRootAttrs($attrs, [])\"\n >\n <slot v-bind=\"{ attrs: activatorAttrs, close }\" />\n </aside>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":"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"}
1
+ {"version":3,"file":"RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createBlock","_Teleport","_Transition","_withCtx","_normalizeClass","_unref","_withModifiers","_createCommentVNode","_createVNode","_mergeProps"],"sources":["../../../../src/components/overlays/navigation-drawer/RuiNavigationDrawer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClassValue } from 'vue';\nimport type { VueClassValue } from '@/types/class-value';\nimport type { MaybeElement } from '@/types/dom';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { getRootAttrs, transformPropsUnit } from '@/utils/helpers';\nimport { cn } from '@/utils/tv';\nimport { navigationDrawerStyles } from './navigation-drawer-styles';\n\nexport interface RuiNavigationDrawerClassNames {\n root?: VueClassValue;\n content?: VueClassValue;\n}\n\nexport interface NavigationDrawerProps {\n temporary?: boolean;\n stateless?: boolean;\n width?: string | number;\n miniVariant?: boolean;\n overlay?: boolean;\n position?: 'left' | 'right';\n classNames?: RuiNavigationDrawerClassNames;\n ariaLabel?: string;\n /**\n * Starts the drawer, and its overlay, below the app bar (`--rui-app-bar-height`), so the app bar\n * stays uncovered and usable while the drawer is open. Without it the drawer runs the full height and\n * a modal one covers the app bar.\n */\n belowAppBar?: boolean;\n}\n\ndefineOptions({\n name: 'RuiNavigationDrawer',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst {\n temporary = false,\n stateless = false,\n width = 360,\n miniVariant = false,\n overlay = false,\n position = 'left',\n classNames,\n ariaLabel,\n belowAppBar = false,\n} = defineProps<NavigationDrawerProps>();\n\nconst emit = defineEmits<{\n closed: [];\n}>();\n\ndefineSlots<{\n activator?: (props: { open: boolean; attrs: { onClick: () => void } }) => any;\n default?: (props: { attrs: { onClick: () => void }; close: () => void }) => any;\n}>();\n\nconst transitioning = ref<boolean>(false);\nconst content = useTemplateRef<MaybeElement>('content');\nconst leaveTimeout = useTimeoutManager();\nconst clickOutsideTimeout = useTimeoutManager();\n\nconst alive = computed<boolean>(() => get(modelValue) || get(transitioning) || miniVariant);\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\nconst activatorAttrs: { onClick: () => void } = {\n onClick: toggle,\n};\n\n/**\n * Where the drawer starts its slide in: it mounts open, so the closed position has to be put on it for\n * its first frame. Important, because the open position is already on the element.\n */\nconst enterFromClass = computed<string>(() => (position === 'left' ? '-translate-x-full!' : 'translate-x-full!'));\n\n// the overlay dims what the drawer covers: the whole view, or only the part below the app bar\nconst overlayClass = computed<string>(() => cn([\n 'fixed inset-x-0 bottom-0 backdrop-blur-sm bg-rui-neutral-950/40 dark:bg-black/60 z-rui-drawer',\n belowAppBar ? 'top-rui-app-bar' : 'top-0',\n]) ?? '');\n\n/**\n * Consumer classes go through `navigationDrawerStyles()` rather than alongside it, so\n * tailwind-variants' twMerge resolves conflicts in the consumer's favour.\n * Passed as an argument instead of read off `$attrs` here, so the template\n * keeps using `$attrs` directly.\n */\nfunction rootClass(attrsClass: ClassValue): string {\n return navigationDrawerStyles({\n position,\n visible: modelValue.value,\n mini: miniVariant,\n withOverlay: overlay,\n temporary,\n belowAppBar,\n class: cn([\n temporary && modelValue.value && 'shadow-rui-drawer',\n classNames?.content,\n classNames?.root,\n attrsClass,\n ]),\n });\n}\n\nfunction toggle(): void {\n set(modelValue, !get(modelValue));\n}\n\nfunction close(): void {\n set(modelValue, false);\n}\n\nfunction onLeaveComplete(): void {\n leaveTimeout.clear();\n if (get(transitioning)) {\n set(transitioning, false);\n emit('closed');\n }\n}\n\nwatch(modelValue, (value) => {\n if (!value) {\n set(transitioning, true);\n // Match CSS transition duration (200ms) + buffer\n leaveTimeout.create(onLeaveComplete, 250);\n }\n});\n\n// Debounced, so the activator's own click, which bubbles to the body, does not close it again\nonClickOutside(content, () => {\n if (get(modelValue) && temporary && !stateless) {\n clickOutsideTimeout.create(close, 50);\n }\n});\n</script>\n\n<template>\n <div>\n <slot\n name=\"activator\"\n v-bind=\"{ open: modelValue, attrs: activatorAttrs }\"\n />\n <Teleport to=\"body\">\n <Transition\n v-if=\"overlay\"\n enter-from-class=\"opacity-0\"\n enter-active-class=\"transition-opacity ease-out duration-200\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"transition-opacity ease-in duration-200\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n data-id=\"overlay\"\n :class=\"overlayClass\"\n @click.stop=\"close()\"\n />\n </Transition>\n <!-- leaves with no transition: it has already slid out, and its own would hold the removal for a transitionend that never comes -->\n <Transition\n :enter-from-class=\"enterFromClass\"\n leave-active-class=\"duration-0!\"\n >\n <aside\n v-if=\"alive\"\n ref=\"content\"\n data-id=\"drawer-content\"\n :style=\"style\"\n :data-visible=\"modelValue || undefined\"\n :data-position=\"position\"\n :data-mini=\"miniVariant || undefined\"\n :class=\"rootClass($attrs.class)\"\n :aria-label=\"ariaLabel\"\n v-bind=\"getRootAttrs($attrs, [])\"\n >\n <slot v-bind=\"{ attrs: activatorAttrs, close }\" />\n </aside>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":"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"}
@@ -0,0 +1,76 @@
1
+ export declare const navigationDrawerStyles: import("tailwind-variants").TVReturnType<{
2
+ belowAppBar: {
3
+ true: "top-rui-app-bar";
4
+ false: "top-0";
5
+ };
6
+ temporary: {
7
+ true: "bg-rui-overlay";
8
+ false: "bg-rui-surface";
9
+ };
10
+ position: {
11
+ left: "left-0";
12
+ right: "right-0";
13
+ };
14
+ visible: {
15
+ true: "translate-x-0";
16
+ false: "";
17
+ };
18
+ mini: {
19
+ true: "translate-x-0";
20
+ false: "";
21
+ };
22
+ withOverlay: {
23
+ true: "z-rui-drawer";
24
+ false: "z-rui-app-bar";
25
+ };
26
+ }, undefined, "transition-[transform,translate,width] duration-200 ease-in-out bottom-0 fixed text-rui-text", {
27
+ belowAppBar: {
28
+ true: "top-rui-app-bar";
29
+ false: "top-0";
30
+ };
31
+ temporary: {
32
+ true: "bg-rui-overlay";
33
+ false: "bg-rui-surface";
34
+ };
35
+ position: {
36
+ left: "left-0";
37
+ right: "right-0";
38
+ };
39
+ visible: {
40
+ true: "translate-x-0";
41
+ false: "";
42
+ };
43
+ mini: {
44
+ true: "translate-x-0";
45
+ false: "";
46
+ };
47
+ withOverlay: {
48
+ true: "z-rui-drawer";
49
+ false: "z-rui-app-bar";
50
+ };
51
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
52
+ belowAppBar: {
53
+ true: "top-rui-app-bar";
54
+ false: "top-0";
55
+ };
56
+ temporary: {
57
+ true: "bg-rui-overlay";
58
+ false: "bg-rui-surface";
59
+ };
60
+ position: {
61
+ left: "left-0";
62
+ right: "right-0";
63
+ };
64
+ visible: {
65
+ true: "translate-x-0";
66
+ false: "";
67
+ };
68
+ mini: {
69
+ true: "translate-x-0";
70
+ false: "";
71
+ };
72
+ withOverlay: {
73
+ true: "z-rui-drawer";
74
+ false: "z-rui-app-bar";
75
+ };
76
+ }, undefined>>;
@@ -0,0 +1,72 @@
1
+ import { tv } from "../../../utils/tv.js";
2
+ //#region src/components/overlays/navigation-drawer/navigation-drawer-styles.ts
3
+ var navigationDrawerStyles = tv({
4
+ base: "transition-[transform,translate,width] duration-200 ease-in-out bottom-0 fixed text-rui-text",
5
+ variants: {
6
+ belowAppBar: {
7
+ true: "top-rui-app-bar",
8
+ false: "top-0"
9
+ },
10
+ temporary: {
11
+ true: "bg-rui-overlay",
12
+ false: "bg-rui-surface"
13
+ },
14
+ position: {
15
+ left: "left-0",
16
+ right: "right-0"
17
+ },
18
+ visible: {
19
+ true: "translate-x-0",
20
+ false: ""
21
+ },
22
+ mini: {
23
+ true: "translate-x-0",
24
+ false: ""
25
+ },
26
+ withOverlay: {
27
+ true: "z-rui-drawer",
28
+ false: "z-rui-app-bar"
29
+ }
30
+ },
31
+ compoundVariants: [
32
+ {
33
+ position: "left",
34
+ visible: false,
35
+ mini: false,
36
+ class: "-translate-x-full"
37
+ },
38
+ {
39
+ position: "right",
40
+ visible: false,
41
+ mini: false,
42
+ class: "translate-x-full"
43
+ },
44
+ {
45
+ mini: true,
46
+ visible: false,
47
+ class: "w-14!"
48
+ },
49
+ {
50
+ temporary: false,
51
+ position: "left",
52
+ class: "border-r border-rui-divider"
53
+ },
54
+ {
55
+ temporary: false,
56
+ position: "right",
57
+ class: "border-l border-rui-divider"
58
+ }
59
+ ],
60
+ defaultVariants: {
61
+ position: "left",
62
+ visible: false,
63
+ mini: false,
64
+ withOverlay: false,
65
+ temporary: false,
66
+ belowAppBar: false
67
+ }
68
+ });
69
+ //#endregion
70
+ export { navigationDrawerStyles };
71
+
72
+ //# sourceMappingURL=navigation-drawer-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-drawer-styles.js","names":[],"sources":["../../../../src/components/overlays/navigation-drawer/navigation-drawer-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const navigationDrawerStyles = tv({\n base: 'transition-[transform,translate,width] duration-200 ease-in-out bottom-0 fixed text-rui-text',\n variants: {\n belowAppBar: {\n true: 'top-rui-app-bar',\n false: 'top-0',\n },\n // a temporary drawer floats on the overlay surface; a docked one is part of the page, edged by a hairline\n temporary: {\n true: 'bg-rui-overlay',\n false: 'bg-rui-surface',\n },\n position: {\n left: 'left-0',\n right: 'right-0',\n },\n visible: {\n true: 'translate-x-0',\n false: '',\n },\n mini: {\n true: 'translate-x-0',\n false: '',\n },\n // a modal drawer covers the app bar; a docked one sits level with it\n withOverlay: {\n true: 'z-rui-drawer',\n false: 'z-rui-app-bar',\n },\n },\n compoundVariants: [\n { position: 'left', visible: false, mini: false, class: '-translate-x-full' },\n { position: 'right', visible: false, mini: false, class: 'translate-x-full' },\n { mini: true, visible: false, class: 'w-14!' },\n { temporary: false, position: 'left', class: 'border-r border-rui-divider' },\n { temporary: false, position: 'right', class: 'border-l border-rui-divider' },\n ],\n defaultVariants: { position: 'left', visible: false, mini: false, withOverlay: false, temporary: false, belowAppBar: false },\n});\n"],"mappings":";;AAEA,IAAa,yBAAyB,GAAG;CACvC,MAAM;CACN,UAAU;EACR,aAAa;GACX,MAAM;GACN,OAAO;EACT;EAEA,WAAW;GACT,MAAM;GACN,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;EACA,SAAS;GACP,MAAM;GACN,OAAO;EACT;EACA,MAAM;GACJ,MAAM;GACN,OAAO;EACT;EAEA,aAAa;GACX,MAAM;GACN,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GAAE,UAAU;GAAQ,SAAS;GAAO,MAAM;GAAO,OAAO;EAAoB;EAC5E;GAAE,UAAU;GAAS,SAAS;GAAO,MAAM;GAAO,OAAO;EAAmB;EAC5E;GAAE,MAAM;GAAM,SAAS;GAAO,OAAO;EAAQ;EAC7C;GAAE,WAAW;GAAO,UAAU;GAAQ,OAAO;EAA8B;EAC3E;GAAE,WAAW;GAAO,UAAU;GAAS,OAAO;EAA8B;CAC9E;CACA,iBAAiB;EAAE,UAAU;EAAQ,SAAS;EAAO,MAAM;EAAO,aAAa;EAAO,WAAW;EAAO,aAAa;CAAM;AAC7H,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiNotification.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/notification/RuiNotification.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useTimeoutFn } from '@vueuse/core';\nimport { transformPropsUnit } from '@/utils/helpers';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface NotificationProps {\n timeout: number;\n width?: number | string;\n theme?: 'light' | 'dark';\n}\n\ndefineOptions({\n name: 'RuiNotification',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ required: true });\n\nconst { timeout, width = 400, theme } = defineProps<NotificationProps>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\n// a popup like a menu: panel corners, a hairline edge for dark backgrounds, and never wider than the screen\nconst rootStyle = tv({ base: 'top-4 right-4 fixed z-rui-toast max-w-[calc(100vw-2rem)] overflow-hidden rounded-rui-panel border shadow-rui-menu' });\n\nconst { start, stop } = useTimeoutFn(() => {\n set(modelValue, false);\n}, timeout, { immediate: false });\n\nfunction dismiss(): void {\n if (timeout < 0)\n return;\n\n set(modelValue, false);\n}\n\nwatchImmediate(modelValue, (display) => {\n if (!display) {\n stop();\n return;\n }\n\n if (timeout > 0) {\n stop();\n start();\n }\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"ease-out duration-150\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n role=\"alert\"\n aria-live=\"polite\"\n :class=\"rootStyle({ class: cn([$attrs.class, {\n 'bg-rui-overlay border-rui-divider': !theme,\n 'bg-rui-light-overlay text-rui-light-text border-rui-light-divider': theme === 'light',\n 'bg-rui-dark-overlay text-rui-dark-text border-rui-dark-divider': theme === 'dark',\n }]) })\"\n :style=\"style\"\n v-bind=\"{ ...$attrs, class: undefined }\"\n @click=\"dismiss()\"\n >\n <slot />\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiNotification.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/notification/RuiNotification.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useTimeoutFn } from '@vueuse/core';\nimport { transformPropsUnit } from '@/utils/helpers';\nimport { cn } from '@/utils/tv';\nimport { notificationStyles } from './notification-styles';\n\nexport interface NotificationProps {\n timeout: number;\n width?: number | string;\n theme?: 'light' | 'dark';\n}\n\ndefineOptions({\n name: 'RuiNotification',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ required: true });\n\nconst { timeout, width = 400, theme } = defineProps<NotificationProps>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\nconst { start, stop } = useTimeoutFn(() => {\n set(modelValue, false);\n}, timeout, { immediate: false });\n\nfunction dismiss(): void {\n if (timeout < 0)\n return;\n\n set(modelValue, false);\n}\n\nwatchImmediate(modelValue, (display) => {\n if (!display) {\n stop();\n return;\n }\n\n if (timeout > 0) {\n stop();\n start();\n }\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"ease-out duration-150\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n role=\"alert\"\n aria-live=\"polite\"\n :class=\"notificationStyles({ class: cn([$attrs.class, {\n 'bg-rui-overlay border-rui-divider': !theme,\n 'bg-rui-light-overlay text-rui-light-text border-rui-light-divider': theme === 'light',\n 'bg-rui-dark-overlay text-rui-dark-text border-rui-dark-divider': theme === 'dark',\n }]) })\"\n :style=\"style\"\n v-bind=\"{ ...$attrs, class: undefined }\"\n @click=\"dismiss()\"\n >\n <slot />\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import { set, useTimeoutFn, watchImmediate } from "../../../vendor/@vueuse/shared/dist/index.js";
2
- import { cn, tv } from "../../../utils/tv.js";
2
+ import { cn } from "../../../utils/tv.js";
3
3
  import { transformPropsUnit } from "../../../utils/helpers.js";
4
+ import { notificationStyles } from "./notification-styles.js";
4
5
  import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, mergeProps, openBlock, renderSlot, unref, useModel, withCtx } from "vue";
5
6
  //#region src/components/overlays/notification/RuiNotification.vue?vue&type=script&setup=true&lang.ts
6
7
  var RuiNotification_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
@@ -22,7 +23,6 @@ var RuiNotification_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
22
23
  setup(__props) {
23
24
  const modelValue = useModel(__props, "modelValue");
24
25
  const style = computed(() => ({ width: transformPropsUnit(__props.width) }));
25
- const rootStyle = tv({ base: "top-4 right-4 fixed z-rui-toast max-w-[calc(100vw-2rem)] overflow-hidden rounded-rui-panel border shadow-rui-menu" });
26
26
  const { start, stop } = useTimeoutFn(() => {
27
27
  set(modelValue, false);
28
28
  }, __props.timeout, { immediate: false });
@@ -53,7 +53,7 @@ var RuiNotification_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
53
53
  key: 0,
54
54
  role: "alert",
55
55
  "aria-live": "polite",
56
- class: unref(rootStyle)({ class: unref(cn)([_ctx.$attrs.class, {
56
+ class: unref(notificationStyles)({ class: unref(cn)([_ctx.$attrs.class, {
57
57
  "bg-rui-overlay border-rui-divider": !__props.theme,
58
58
  "bg-rui-light-overlay text-rui-light-text border-rui-light-divider": __props.theme === "light",
59
59
  "bg-rui-dark-overlay text-rui-dark-text border-rui-dark-divider": __props.theme === "dark"
@@ -1 +1 @@
1
- {"version":3,"file":"RuiNotification.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_createElementBlock","_mergeProps","_unref","_renderSlot","_createCommentVNode"],"sources":["../../../../src/components/overlays/notification/RuiNotification.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useTimeoutFn } from '@vueuse/core';\nimport { transformPropsUnit } from '@/utils/helpers';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface NotificationProps {\n timeout: number;\n width?: number | string;\n theme?: 'light' | 'dark';\n}\n\ndefineOptions({\n name: 'RuiNotification',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ required: true });\n\nconst { timeout, width = 400, theme } = defineProps<NotificationProps>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\n// a popup like a menu: panel corners, a hairline edge for dark backgrounds, and never wider than the screen\nconst rootStyle = tv({ base: 'top-4 right-4 fixed z-rui-toast max-w-[calc(100vw-2rem)] overflow-hidden rounded-rui-panel border shadow-rui-menu' });\n\nconst { start, stop } = useTimeoutFn(() => {\n set(modelValue, false);\n}, timeout, { immediate: false });\n\nfunction dismiss(): void {\n if (timeout < 0)\n return;\n\n set(modelValue, false);\n}\n\nwatchImmediate(modelValue, (display) => {\n if (!display) {\n stop();\n return;\n }\n\n if (timeout > 0) {\n stop();\n start();\n }\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"ease-out duration-150\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n role=\"alert\"\n aria-live=\"polite\"\n :class=\"rootStyle({ class: cn([$attrs.class, {\n 'bg-rui-overlay border-rui-divider': !theme,\n 'bg-rui-light-overlay text-rui-light-text border-rui-light-divider': theme === 'light',\n 'bg-rui-dark-overlay text-rui-dark-text border-rui-dark-divider': theme === 'dark',\n }]) })\"\n :style=\"style\"\n v-bind=\"{ ...$attrs, class: undefined }\"\n @click=\"dismiss()\"\n >\n <slot />\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,aAAaC,SAAoB,SAAA,YAAmB;EAQ1D,MAAM,QAAQ,gBAA+C,EAC3D,OAAO,mBAAmB,QAAA,KAAK,EACjC,EAAE;EAGF,MAAM,YAAY,GAAG,EAAE,MAAM,oHAAoH,CAAC;EAElJ,MAAM,EAAE,OAAO,SAAS,mBAAmB;GACzC,IAAI,YAAY,KAAK;EACvB,GAAG,QAAA,SAAS,EAAE,WAAW,MAAM,CAAC;EAEhC,SAAS,UAAgB;GACvB,IAAI,QAAA,UAAU,GACZ;GAEF,IAAI,YAAY,KAAK;EACvB;EAEA,eAAe,aAAa,YAAY;GACtC,IAAI,CAAC,SAAS;IACZ,KAAK;IACL;GACF;GAEA,IAAI,QAAA,UAAU,GAAG;IACf,KAAK;IACL,MAAM;GACR;EACF,CAAC;;GAIC,OAAAC,UAAA,GAAAC,YAyBWC,UAAA,EAzBD,IAAG,OAAM,GAAA,CACjBC,YAuBaC,YAAA;IAtBX,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;IACf,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;;IAEf,SAAAC,cAcM,CAbE,WAAA,SADRL,UAAA,GAAAM,mBAcM,OAdNC,WAcM;;KAZJ,MAAK;KACL,aAAU;KACT,OAAOC,MAAA,SAAA,CAAS,CAAA,EAAA,OAAUA,MAAA,EAAA,CAAE,CAAA,CAAEV,KAAAA,OAAO,OAAK;MAAoD,qCAAA,CAAA,QAAA;MAAsF,qEAAA,QAAA,UAAK;MAA0F,kEAAA,QAAA,UAAK;;KAKxR,OAAOU,MAAA,KAAA;IACKV,GAAAA;KAAAA,GAAAA,KAAAA;KAAM,OAAS,KAAA;IAAS,GAAA,EACpC,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAO,GAAA,CAAA,GAAA,CAEfW,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"RuiNotification.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_createElementBlock","_mergeProps","_unref","_renderSlot","_createCommentVNode"],"sources":["../../../../src/components/overlays/notification/RuiNotification.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useTimeoutFn } from '@vueuse/core';\nimport { transformPropsUnit } from '@/utils/helpers';\nimport { cn } from '@/utils/tv';\nimport { notificationStyles } from './notification-styles';\n\nexport interface NotificationProps {\n timeout: number;\n width?: number | string;\n theme?: 'light' | 'dark';\n}\n\ndefineOptions({\n name: 'RuiNotification',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ required: true });\n\nconst { timeout, width = 400, theme } = defineProps<NotificationProps>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n\nconst style = computed<{ width: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n}));\n\nconst { start, stop } = useTimeoutFn(() => {\n set(modelValue, false);\n}, timeout, { immediate: false });\n\nfunction dismiss(): void {\n if (timeout < 0)\n return;\n\n set(modelValue, false);\n}\n\nwatchImmediate(modelValue, (display) => {\n if (!display) {\n stop();\n return;\n }\n\n if (timeout > 0) {\n stop();\n start();\n }\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"ease-out duration-150\"\n enter-to-class=\"opacity-100\"\n leave-from-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n role=\"alert\"\n aria-live=\"polite\"\n :class=\"notificationStyles({ class: cn([$attrs.class, {\n 'bg-rui-overlay border-rui-divider': !theme,\n 'bg-rui-light-overlay text-rui-light-text border-rui-light-divider': theme === 'light',\n 'bg-rui-dark-overlay text-rui-dark-text border-rui-dark-divider': theme === 'dark',\n }]) })\"\n :style=\"style\"\n v-bind=\"{ ...$attrs, class: undefined }\"\n @click=\"dismiss()\"\n >\n <slot />\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,aAAaC,SAAoB,SAAA,YAAmB;EAQ1D,MAAM,QAAQ,gBAA+C,EAC3D,OAAO,mBAAmB,QAAA,KAAK,EACjC,EAAE;EAEF,MAAM,EAAE,OAAO,SAAS,mBAAmB;GACzC,IAAI,YAAY,KAAK;EACvB,GAAG,QAAA,SAAS,EAAE,WAAW,MAAM,CAAC;EAEhC,SAAS,UAAgB;GACvB,IAAI,QAAA,UAAU,GACZ;GAEF,IAAI,YAAY,KAAK;EACvB;EAEA,eAAe,aAAa,YAAY;GACtC,IAAI,CAAC,SAAS;IACZ,KAAK;IACL;GACF;GAEA,IAAI,QAAA,UAAU,GAAG;IACf,KAAK;IACL,MAAM;GACR;EACF,CAAC;;GAIC,OAAAC,UAAA,GAAAC,YAyBWC,UAAA,EAzBD,IAAG,OAAM,GAAA,CACjBC,YAuBaC,YAAA;IAtBX,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;IACf,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;;IAEf,SAAAC,cAcM,CAbE,WAAA,SADRL,UAAA,GAAAM,mBAcM,OAdNC,WAcM;;KAZJ,MAAK;KACL,aAAU;KACT,OAAOC,MAAA,kBAAA,CAAkB,CAAA,EAAA,OAAUA,MAAA,EAAA,CAAE,CAAA,CAAEV,KAAAA,OAAO,OAAK;MAAoD,qCAAA,CAAA,QAAA;MAAsF,qEAAA,QAAA,UAAK;MAA0F,kEAAA,QAAA,UAAK;;KAKjS,OAAOU,MAAA,KAAA;IACKV,GAAAA;KAAAA,GAAAA,KAAAA;KAAM,OAAS,KAAA;IAAS,GAAA,EACpC,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAO,GAAA,CAAA,GAAA,CAEfW,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const notificationStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "top-4 right-4 fixed z-rui-toast max-w-[calc(100vw-2rem)] overflow-hidden rounded-rui-panel border shadow-rui-menu", {} | {}, undefined, import("tailwind-variants").TVReturnTypeLike<unknown, undefined>>;
@@ -0,0 +1,7 @@
1
+ import { tv } from "../../../utils/tv.js";
2
+ //#region src/components/overlays/notification/notification-styles.ts
3
+ var notificationStyles = tv({ base: "top-4 right-4 fixed z-rui-toast max-w-[calc(100vw-2rem)] overflow-hidden rounded-rui-panel border shadow-rui-menu" });
4
+ //#endregion
5
+ export { notificationStyles };
6
+
7
+ //# sourceMappingURL=notification-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-styles.js","names":[],"sources":["../../../../src/components/overlays/notification/notification-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\n// a popup like a menu: panel corners, a hairline edge for dark backgrounds, and never wider than the screen\nexport const notificationStyles = tv({ base: 'top-4 right-4 fixed z-rui-toast max-w-[calc(100vw-2rem)] overflow-hidden rounded-rui-panel border shadow-rui-menu' });\n"],"mappings":";;AAGA,IAAa,qBAAqB,GAAG,EAAE,MAAM,oHAAoH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTooltip.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/tooltip/RuiTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { VueClassValue } from '@/types/class-value';\nimport { ButtonGroupBoundary } from '@/components/buttons/button-group/button-group-context';\nimport { type FloatingOptions, useFloating } from '@/composables/floating';\nimport { cn, tv } from '@/utils/tv';\nimport { tooltipStyles } from './tooltip-styles';\n\nexport interface RuiTooltipClassNames {\n root?: VueClassValue;\n tooltip?: VueClassValue;\n}\n\nexport interface Props {\n text?: string | null;\n disabled?: boolean;\n hideArrow?: boolean;\n openDelay?: number;\n closeDelay?: number;\n persistOnTooltipHover?: boolean;\n options?: FloatingOptions;\n classNames?: RuiTooltipClassNames;\n}\n\ndefineOptions({\n name: 'RuiTooltip',\n inheritAttrs: false,\n});\n\nconst {\n text = null,\n disabled = false,\n hideArrow = false,\n openDelay = 0,\n closeDelay = 500,\n persistOnTooltipHover = false,\n options,\n classNames,\n} = defineProps<Props>();\n\ndefineSlots<{\n activator?: (props: { open: boolean; close: () => void }) => any;\n default?: () => any;\n}>();\n\nconst rootStyle = tv({ base: 'relative inline-flex' });\n\n// wraps at `--rui-tooltip-max-width`; a `max-w-*` in `classNames.tooltip` replaces it\nconst popoverStyle = tv({ base: 'w-max max-w-rui-tooltip z-rui-tooltip' });\n\nconst tooltipId = useId();\n\nconst {\n reference: activator,\n popover: tooltip,\n open,\n visible,\n currentPlacement,\n onOpen,\n onClose,\n onLeaveComplete,\n updatePosition,\n} = useFloating(\n () => options ?? {},\n () => disabled,\n () => openDelay,\n () => closeDelay,\n);\n\ntype PlacementSide = 'bottom' | 'left' | 'right' | 'top';\n\nconst placementSide = computed<PlacementSide>(() => {\n const placement = get(currentPlacement);\n if (placement.startsWith('top'))\n return 'top';\n if (placement.startsWith('left'))\n return 'left';\n if (placement.startsWith('right'))\n return 'right';\n return 'bottom';\n});\n\ndefineExpose({\n onOpen,\n onClose,\n});\n</script>\n\n<template>\n <div\n ref=\"activator\"\n v-bind=\"{ ...$attrs, class: undefined }\"\n :class=\"rootStyle({ class: cn($attrs.class) })\"\n :data-tooltip-disabled=\"disabled\"\n :aria-describedby=\"!disabled && open ? tooltipId : undefined\"\n @mouseover=\"onOpen()\"\n @mouseleave=\"onClose()\"\n @focusin=\"onOpen()\"\n @focusout=\"onClose()\"\n >\n <slot\n name=\"activator\"\n :open=\"open\"\n :close=\"onClose\"\n />\n\n <Teleport\n v-if=\"!disabled\"\n to=\"body\"\n >\n <div\n v-if=\"visible\"\n :id=\"tooltipId\"\n ref=\"tooltip\"\n :class=\"popoverStyle({ class: cn(classNames?.tooltip) })\"\n :role=\"open ? 'tooltip' : undefined\"\n :data-placement=\"currentPlacement\"\n >\n <TransitionGroup\n enter-active-class=\"transition ease-out duration-200\"\n enter-from-class=\"opacity-0 translate-y-1\"\n enter-to-class=\"opacity-100 translate-y-0\"\n leave-active-class=\"transition ease-in duration-150\"\n leave-from-class=\"opacity-100 translate-y-0\"\n leave-to-class=\"opacity-0 translate-y-1\"\n @before-enter=\"updatePosition()\"\n @after-leave=\"onLeaveComplete()\"\n >\n <div\n v-if=\"open\"\n key=\"tooltip\"\n class=\"px-2 py-1.5 text-xs font-normal wrap-break-word bg-rui-neutral-900 dark:bg-rui-neutral-700 text-white rounded-rui-control shadow-rui-tooltip\"\n data-id=\"content\"\n @mouseover=\"persistOnTooltipHover && onOpen()\"\n @mouseleave=\"persistOnTooltipHover && onClose()\"\n >\n <ButtonGroupBoundary>\n <slot>\n {{ text }}\n </slot>\n </ButtonGroupBoundary>\n </div>\n <span\n v-if=\"!hideArrow\"\n key=\"arrow\"\n :class=\"tooltipStyles({ open, side: placementSide }).arrow()\"\n data-id=\"arrow\"\n >\n <span :class=\"tooltipStyles({ open, side: placementSide }).diamond()\" />\n </span>\n </TransitionGroup>\n </div>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiTooltip.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/tooltip/RuiTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Reactive } from 'vue';\nimport type { VueClassValue } from '@/types/class-value';\nimport { ButtonGroupBoundary } from '@/components/buttons/button-group/button-group-context';\nimport { type FloatingOptions, useFloating, type UseFloatingReturn } from '@/composables/floating';\nimport { cn } from '@/utils/tv';\nimport { tooltipPopoverStyles, tooltipRootStyles, tooltipStyles } from './tooltip-styles';\n\nexport interface RuiTooltipClassNames {\n root?: VueClassValue;\n tooltip?: VueClassValue;\n}\n\nexport interface Props {\n text?: string | null;\n disabled?: boolean;\n hideArrow?: boolean;\n openDelay?: number;\n closeDelay?: number;\n persistOnTooltipHover?: boolean;\n options?: FloatingOptions;\n classNames?: RuiTooltipClassNames;\n}\n\ndefineOptions({\n name: 'RuiTooltip',\n inheritAttrs: false,\n});\n\nconst {\n text = null,\n disabled = false,\n hideArrow = false,\n openDelay = 0,\n closeDelay = 500,\n persistOnTooltipHover = false,\n options,\n classNames,\n} = defineProps<Props>();\n\ndefineSlots<{\n activator?: (props: { open: boolean; close: () => void }) => any;\n default?: () => any;\n}>();\n\nconst tooltipId = useId();\nconst activator = useTemplateRef<HTMLElement>('activator');\nconst tooltip = useTemplateRef<HTMLElement>('tooltip');\n// Owned by this component, so a setup run on first use still stops on unmount\nconst setupScope = effectScope();\nconst floating = shallowRef<Reactive<UseFloatingReturn>>();\n\nconst open = computed<boolean>(() => get(floating)?.open ?? false);\nconst visible = computed<boolean>(() => get(floating)?.visible ?? false);\n\ntype PlacementSide = 'bottom' | 'left' | 'right' | 'top';\n\n/**\n * Sets the floating state up on the first hover, focus or `onOpen`, so a\n * table with a tooltip on every row pays only for the tooltips it shows. An\n * event that reaches the activator after unmount gets nothing back.\n */\nfunction setUp(): Reactive<UseFloatingReturn> | undefined {\n if (setupScope.active && !disabled && !get(floating)) {\n set(floating, setupScope.run(() => reactive(useFloating(\n () => options ?? {},\n () => disabled,\n () => openDelay,\n () => closeDelay,\n () => get(activator) ?? undefined,\n tooltip,\n ))));\n }\n return setupScope.active ? get(floating) : undefined;\n}\n\nfunction onOpen(immediate?: boolean): void {\n setUp()?.onOpen(immediate);\n}\n\nfunction onClose(immediate?: boolean): void {\n if (setupScope.active)\n get(floating)?.onClose(immediate);\n}\n\nfunction placementSide(placement: string): PlacementSide {\n if (placement.startsWith('top'))\n return 'top';\n if (placement.startsWith('left'))\n return 'left';\n if (placement.startsWith('right'))\n return 'right';\n return 'bottom';\n}\n\ndefineExpose({\n onOpen,\n onClose,\n});\n</script>\n\n<template>\n <div\n ref=\"activator\"\n v-bind=\"{ ...$attrs, class: undefined }\"\n :class=\"tooltipRootStyles({ class: cn($attrs.class) })\"\n :data-tooltip-disabled=\"disabled\"\n :aria-describedby=\"!disabled && open ? tooltipId : undefined\"\n @mouseover=\"onOpen()\"\n @mouseleave=\"onClose()\"\n @focusin=\"onOpen()\"\n @focusout=\"onClose()\"\n >\n <slot\n name=\"activator\"\n :open=\"open\"\n :close=\"onClose\"\n />\n\n <Teleport\n v-if=\"!disabled && floating\"\n to=\"body\"\n >\n <div\n v-if=\"visible\"\n :id=\"tooltipId\"\n ref=\"tooltip\"\n :class=\"tooltipPopoverStyles({ class: cn(classNames?.tooltip) })\"\n :role=\"open ? 'tooltip' : undefined\"\n :data-placement=\"floating.currentPlacement\"\n >\n <TransitionGroup\n enter-active-class=\"transition ease-out duration-200\"\n enter-from-class=\"opacity-0 translate-y-1\"\n enter-to-class=\"opacity-100 translate-y-0\"\n leave-active-class=\"transition ease-in duration-150\"\n leave-from-class=\"opacity-100 translate-y-0\"\n leave-to-class=\"opacity-0 translate-y-1\"\n @before-enter=\"floating?.updatePosition()\"\n @after-leave=\"floating?.onLeaveComplete()\"\n >\n <div\n v-if=\"open\"\n key=\"tooltip\"\n class=\"px-2 py-1.5 text-xs font-normal wrap-break-word bg-rui-neutral-900 dark:bg-rui-neutral-700 text-white rounded-rui-control shadow-rui-tooltip\"\n data-id=\"content\"\n @mouseover=\"persistOnTooltipHover && onOpen()\"\n @mouseleave=\"persistOnTooltipHover && onClose()\"\n >\n <ButtonGroupBoundary>\n <slot>\n {{ text }}\n </slot>\n </ButtonGroupBoundary>\n </div>\n <span\n v-if=\"!hideArrow\"\n key=\"arrow\"\n :class=\"tooltipStyles({ open, side: placementSide(floating.currentPlacement) }).arrow()\"\n data-id=\"arrow\"\n >\n <span :class=\"tooltipStyles({ open, side: placementSide(floating.currentPlacement) }).diamond()\" />\n </span>\n </TransitionGroup>\n </div>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
@@ -21,9 +21,11 @@ type __VLS_Slots = {
21
21
  }) => any;
22
22
  default?: () => any;
23
23
  };
24
+ declare function onOpen(immediate?: boolean): void;
25
+ declare function onClose(immediate?: boolean): void;
24
26
  declare const __VLS_base: import("vue").DefineComponent<Props, {
25
- onOpen: (immediate?: boolean) => void;
26
- onClose: (immediate?: boolean) => void;
27
+ onOpen: typeof onOpen;
28
+ onClose: typeof onClose;
27
29
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
30
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
31
  declare const _default: typeof __VLS_export;