@rotki/ui-library 3.2.0 → 3.3.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 (235) hide show
  1. package/dist/components/accordions/accordion/RuiAccordion.js.map +1 -1
  2. package/dist/components/accordions/accordion/RuiAccordion.vue.d.ts +4 -2
  3. package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  4. package/dist/components/accordions/accordions/RuiAccordions.js.map +1 -1
  5. package/dist/components/accordions/accordions/RuiAccordions.vue.d.ts +26 -9
  6. package/dist/components/accordions/accordions/RuiAccordions.vue_vue_type_script_setup_true_lang.js +11 -10
  7. package/dist/components/accordions/accordions/RuiAccordions.vue_vue_type_script_setup_true_lang.js.map +1 -1
  8. package/dist/components/alerts/RuiAlert.js.map +1 -1
  9. package/dist/components/alerts/RuiAlert.vue.d.ts +4 -2
  10. package/dist/components/alerts/RuiAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/components/avatars/RuiAvatar.js.map +1 -1
  12. package/dist/components/avatars/RuiAvatar.vue.d.ts +4 -2
  13. package/dist/components/avatars/RuiAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/components/avatars/RuiAvatarGroup.js.map +1 -1
  15. package/dist/components/avatars/RuiAvatarGroup.vue.d.ts +3 -2
  16. package/dist/components/avatars/RuiAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/buttons/button/RuiButton.js.map +1 -1
  18. package/dist/components/buttons/button/RuiButton.vue.d.ts +2 -1
  19. package/dist/components/buttons/button/RuiButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  20. package/dist/components/buttons/button-group/RuiButtonGroup.js.map +1 -1
  21. package/dist/components/buttons/button-group/RuiButtonGroup.vue.d.ts +10 -4
  22. package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js +7 -8
  23. package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/calendar/RuiCalendarGrid.js.map +1 -1
  25. package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js +3 -3
  26. package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/components/calendar/RuiCalendarHeader.js.map +1 -1
  28. package/dist/components/calendar/RuiCalendarHeader.vue_vue_type_script_setup_true_lang.js +3 -3
  29. package/dist/components/calendar/RuiCalendarHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/calendar/RuiCalendarMenu.js.map +1 -1
  31. package/dist/components/calendar/RuiCalendarMenu.vue.d.ts +3 -3
  32. package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js +7 -4
  33. package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/calendar/state.d.ts +8 -1
  35. package/dist/components/calendar/state.js +13 -1
  36. package/dist/components/calendar/state.js.map +1 -1
  37. package/dist/components/cards/RuiCard.js.map +1 -1
  38. package/dist/components/cards/RuiCard.vue.d.ts +3 -1
  39. package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/cards/RuiCardHeader.js.map +1 -1
  41. package/dist/components/cards/RuiCardHeader.vue.d.ts +3 -1
  42. package/dist/components/cards/RuiCardHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/chips/RuiChip.js.map +1 -1
  44. package/dist/components/chips/RuiChip.vue.d.ts +4 -2
  45. package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/color-picker/RuiColorPicker.js.map +1 -1
  47. package/dist/components/color-picker/RuiColorPicker.vue.d.ts +5 -2
  48. package/dist/components/color-picker/RuiColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/date-time-picker/RuiDateTimePicker.js.map +1 -1
  50. package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +39 -30
  51. package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js +8 -3
  52. package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/date-time-picker/RuiDateTimePickerMenu.js.map +1 -1
  54. package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue.d.ts +2 -1
  55. package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  56. package/dist/components/date-time-picker/RuiTimezoneSelect.js.map +1 -1
  57. package/dist/components/date-time-picker/RuiTimezoneSelect.vue.d.ts +2 -1
  58. package/dist/components/date-time-picker/RuiTimezoneSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/divider/RuiDivider.js.map +1 -1
  60. package/dist/components/divider/RuiDivider.vue.d.ts +3 -1
  61. package/dist/components/divider/RuiDivider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/components/forms/auto-complete/RuiAutoComplete.js.map +1 -1
  63. package/dist/components/forms/auto-complete/RuiAutoComplete.vue.d.ts +11 -5
  64. package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js +5 -0
  65. package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  66. package/dist/components/forms/auto-complete/RuiAutoCompleteOption.js.map +1 -1
  67. package/dist/components/forms/auto-complete/RuiAutoCompleteOption.vue.d.ts +2 -1
  68. package/dist/components/forms/auto-complete/RuiAutoCompleteOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/forms/auto-complete/RuiAutoCompleteOptionList.js.map +1 -1
  70. package/dist/components/forms/auto-complete/RuiAutoCompleteOptionList.vue.d.ts +2 -2
  71. package/dist/components/forms/auto-complete/RuiAutoCompleteOptionList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/forms/auto-complete/auto-complete-props.d.ts +0 -1
  73. package/dist/components/forms/category-picker/RuiCategoryPicker.js.map +1 -1
  74. package/dist/components/forms/category-picker/RuiCategoryPicker.vue.d.ts +2 -1
  75. package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/components/forms/checkbox/RuiCheckbox.js.map +1 -1
  77. package/dist/components/forms/checkbox/RuiCheckbox.vue.d.ts +2 -1
  78. package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js +4 -1
  79. package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.js.map +1 -1
  81. package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue.d.ts +2 -1
  82. package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  83. package/dist/components/forms/file-upload/RuiFileUpload.js.map +1 -1
  84. package/dist/components/forms/file-upload/RuiFileUpload.vue.d.ts +36 -29
  85. package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js +5 -0
  86. package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
  87. package/dist/components/forms/radio-button/radio/RuiRadio.js.map +1 -1
  88. package/dist/components/forms/radio-button/radio/RuiRadio.vue.d.ts +5 -3
  89. package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js +7 -8
  90. package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.js.map +1 -1
  92. package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue.d.ts +5 -3
  93. package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js +9 -10
  94. package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  95. package/dist/components/forms/revealable-text-field/RuiRevealableTextField.js.map +1 -1
  96. package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue.d.ts +9 -2
  97. package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  98. package/dist/components/forms/select/RuiMenuSelect.js.map +1 -1
  99. package/dist/components/forms/select/RuiMenuSelect.vue.d.ts +10 -4
  100. package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js +5 -0
  101. package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/forms/select/RuiSimpleSelect.js.map +1 -1
  103. package/dist/components/forms/select/RuiSimpleSelect.vue.d.ts +22 -11
  104. package/dist/components/forms/select/RuiSimpleSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/forms/slider/RuiSlider.js.map +1 -1
  106. package/dist/components/forms/slider/RuiSlider.vue.d.ts +2 -1
  107. package/dist/components/forms/slider/RuiSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/components/forms/switch/RuiSwitch.js.map +1 -1
  109. package/dist/components/forms/switch/RuiSwitch.vue.d.ts +2 -1
  110. package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  111. package/dist/components/forms/text-area/RuiTextArea.js.map +1 -1
  112. package/dist/components/forms/text-area/RuiTextArea.vue.d.ts +3 -1
  113. package/dist/components/forms/text-area/RuiTextArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/forms/text-field/RuiTextField.js.map +1 -1
  115. package/dist/components/forms/text-field/RuiTextField.vue.d.ts +3 -1
  116. package/dist/components/forms/text-field/RuiTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/components/icons/RuiIcon.js.map +1 -1
  118. package/dist/components/icons/RuiIcon.vue.d.ts +3 -1
  119. package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/index.d.ts +2 -2
  121. package/dist/components/loaders/RuiSkeletonLoader.js.map +1 -1
  122. package/dist/components/loaders/RuiSkeletonLoader.vue.d.ts +3 -1
  123. package/dist/components/loaders/RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  124. package/dist/components/logos/RuiLogo.js.map +1 -1
  125. package/dist/components/logos/RuiLogo.vue.d.ts +3 -1
  126. package/dist/components/logos/RuiLogo.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/components/overlays/badge/RuiBadge.js.map +1 -1
  128. package/dist/components/overlays/badge/RuiBadge.vue.d.ts +3 -1
  129. package/dist/components/overlays/badge/RuiBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  130. package/dist/components/overlays/bottom-sheet/RuiBottomSheet.js.map +1 -1
  131. package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue.d.ts +11 -5
  132. package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue_vue_type_script_setup_true_lang.js +6 -7
  133. package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue_vue_type_script_setup_true_lang.js.map +1 -1
  134. package/dist/components/overlays/dialog/RuiDialog.js.map +1 -1
  135. package/dist/components/overlays/dialog/RuiDialog.vue.d.ts +5 -3
  136. package/dist/components/overlays/dialog/RuiDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/components/overlays/menu/RuiMenu.js.map +1 -1
  138. package/dist/components/overlays/menu/RuiMenu.vue.d.ts +2 -1
  139. package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.js.map +1 -1
  141. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue.d.ts +2 -1
  142. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/overlays/notification/RuiNotification.js.map +1 -1
  144. package/dist/components/overlays/notification/RuiNotification.vue.d.ts +2 -1
  145. package/dist/components/overlays/notification/RuiNotification.vue_vue_type_script_setup_true_lang.js.map +1 -1
  146. package/dist/components/overlays/tooltip/RuiTooltip.js.map +1 -1
  147. package/dist/components/overlays/tooltip/RuiTooltip.vue.d.ts +4 -2
  148. package/dist/components/overlays/tooltip/RuiTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  149. package/dist/components/progress/RuiProgress.js.map +1 -1
  150. package/dist/components/progress/RuiProgress.vue.d.ts +3 -1
  151. package/dist/components/progress/RuiProgress.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/steppers/RuiFooterStepper.js.map +1 -1
  153. package/dist/components/steppers/RuiFooterStepper.vue.d.ts +2 -1
  154. package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/steppers/RuiStepper.js.map +1 -1
  156. package/dist/components/steppers/RuiStepper.vue.d.ts +3 -1
  157. package/dist/components/steppers/RuiStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  158. package/dist/components/tables/RuiDataTable.js.map +1 -1
  159. package/dist/components/tables/RuiDataTable.vue.d.ts +14 -19
  160. package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js +25 -29
  161. package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/tables/RuiExpandButton.js.map +1 -1
  163. package/dist/components/tables/RuiExpandButton.vue.d.ts +3 -1
  164. package/dist/components/tables/RuiExpandButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/tables/RuiTable.js.map +1 -1
  166. package/dist/components/tables/RuiTable.vue.d.ts +4 -2
  167. package/dist/components/tables/RuiTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/components/tables/RuiTableEmptyState.js.map +1 -1
  169. package/dist/components/tables/RuiTableEmptyState.vue.d.ts +3 -1
  170. package/dist/components/tables/RuiTableEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/tables/RuiTableErrorState.js.map +1 -1
  172. package/dist/components/tables/RuiTableErrorState.vue.d.ts +4 -2
  173. package/dist/components/tables/RuiTableErrorState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/components/tables/RuiTableHead.js.map +1 -1
  175. package/dist/components/tables/RuiTableHead.vue.d.ts +3 -2
  176. package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js +3 -3
  177. package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js.map +1 -1
  178. package/dist/components/tables/RuiTableLoadingState.js.map +1 -1
  179. package/dist/components/tables/RuiTableLoadingState.vue.d.ts +3 -1
  180. package/dist/components/tables/RuiTableLoadingState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/components/tables/RuiTablePagination.js.map +1 -1
  182. package/dist/components/tables/RuiTablePagination.vue.d.ts +2 -1
  183. package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/tables/data-table/RuiDataTableCell.js.map +1 -1
  185. package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js +2 -4
  186. package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  187. package/dist/components/tables/data-table/RuiDataTableMobileSort.js.map +1 -1
  188. package/dist/components/tables/data-table/RuiDataTableMobileSort.vue.d.ts +1 -1
  189. package/dist/components/tables/data-table/RuiDataTableMobileSort.vue_vue_type_script_setup_true_lang.js +2 -3
  190. package/dist/components/tables/data-table/RuiDataTableMobileSort.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/components/tables/data-table/context.d.ts +6 -6
  192. package/dist/components/tables/data-table/context.js +1 -1
  193. package/dist/components/tables/data-table/context.js.map +1 -1
  194. package/dist/components/tables/table-props.d.ts +9 -0
  195. package/dist/components/tables/table-props.js +13 -1
  196. package/dist/components/tables/table-props.js.map +1 -1
  197. package/dist/components/tabs/tab/RuiTab.js.map +1 -1
  198. package/dist/components/tabs/tab/RuiTab.vue.d.ts +4 -2
  199. package/dist/components/tabs/tab/RuiTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/components/tabs/tab-item/RuiTabItem.js.map +1 -1
  201. package/dist/components/tabs/tab-item/RuiTabItem.vue.d.ts +3 -1
  202. package/dist/components/tabs/tab-item/RuiTabItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/tabs/tab-items/RuiTabItems.js.map +1 -1
  204. package/dist/components/tabs/tab-items/RuiTabItems.vue.d.ts +5 -12
  205. package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js +8 -14
  206. package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/tabs/tabs/RuiTabs.js.map +1 -1
  208. package/dist/components/tabs/tabs/RuiTabs.vue.d.ts +26 -14
  209. package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js +11 -13
  210. package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  211. package/dist/components/time-picker/RuiTimePicker.js.map +1 -1
  212. package/dist/components/time-picker/RuiTimePicker.vue.d.ts +2 -1
  213. package/dist/components/time-picker/RuiTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/composables/dropdown-menu.js.map +1 -1
  215. package/dist/composables/forms/auto-complete/search.js.map +1 -1
  216. package/dist/composables/forms/auto-complete/value.d.ts +1 -1
  217. package/dist/composables/forms/auto-complete/value.js.map +1 -1
  218. package/dist/composables/prop-model.d.ts +21 -0
  219. package/dist/composables/prop-model.js +33 -0
  220. package/dist/composables/prop-model.js.map +1 -0
  221. package/dist/composables/tables/data-table/columns.d.ts +2 -1
  222. package/dist/composables/tables/data-table/columns.js.map +1 -1
  223. package/dist/composables/tables/data-table/types.d.ts +35 -0
  224. package/dist/composables/tables/data-table/types.js.map +1 -1
  225. package/dist/composables/use-rui-i18n.d.ts +6 -3
  226. package/dist/composables/use-rui-i18n.js +1 -1
  227. package/dist/composables/use-rui-i18n.js.map +1 -1
  228. package/dist/index.d.ts +7 -1
  229. package/dist/index.js +14 -6
  230. package/dist/index.js.map +1 -1
  231. package/dist/types/attributes.d.ts +9 -0
  232. package/dist/utils/blockie.js +10 -9
  233. package/dist/utils/blockie.js.map +1 -1
  234. package/dist/web-types.json +280 -110
  235. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import type { ContextColorsType } from '../../../consts/colors.js';
2
2
  import type { RuiIcons } from '../../../icons/index.js';
3
+ import type { InputAttributes } from '../../../types/attributes.js';
3
4
  import { type LabelPlacement } from '../../../composables/defaults/field.js';
4
5
  import { type FormDetails } from '../../../utils/form-text-detail.js';
5
6
  export interface TextFieldProps {
@@ -24,7 +25,7 @@ export interface TextFieldProps {
24
25
  clearable?: boolean;
25
26
  required?: boolean;
26
27
  }
27
- type __VLS_Props = TextFieldProps;
28
+ type __VLS_Props = TextFieldProps & /* @vue-ignore */ Omit<InputAttributes, keyof TextFieldProps | 'onBlur'>;
28
29
  type __VLS_Slots = {
29
30
  prepend?: () => any;
30
31
  append?: () => any;
@@ -33,6 +34,7 @@ type __VLS_Slots = {
33
34
  };
34
35
  type __VLS_ModelProps = {
35
36
  modelValue: string;
37
+ 'modelModifiers'?: Partial<Record<'trim', true>>;
36
38
  };
37
39
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
38
40
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTextField.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createBlock","RuiFieldLabel","_createCommentVNode","_createElementVNode","_normalizeClass","_renderSlot","_createVNode","RuiIcon","_mergeProps","RuiButton","_withModifiers","_withCtx","RuiFormTextDetail","_createSlots"],"sources":["../../../../src/components/forms/text-field/RuiTextField.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiFieldLabel from '@/components/forms/field-label/RuiFieldLabel.vue';\nimport { textFieldStyles } from '@/components/forms/text-field/text-field-styles';\nimport RuiFormTextDetail from '@/components/helpers/RuiFormTextDetail.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { type LabelPlacement, useLabelPlacement } from '@/composables/defaults/field';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { type FormDetails, useFormDetails, useFormTextDetail } from '@/utils/form-text-detail';\nimport { getNonRootAttrs, getRootAttrs } from '@/utils/helpers';\n\nexport interface TextFieldProps {\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n /** Where the label shows; falls back to the nearest `RuiFieldDefaults`, then the app default, then `top`. */\n labelPlacement?: LabelPlacement;\n color?: ContextColorsType;\n textColor?: ContextColorsType;\n dense?: boolean;\n hint?: string;\n errorMessages?: string | string[];\n successMessages?: string | string[];\n /** The line under the field for its hint and messages: `reserve`, `auto` or `hidden`; falls back to the nearest `RuiFieldDefaults`, then the app default, then `reserve`. */\n details?: FormDetails;\n /** @deprecated Use `details=\"hidden\"`. Removed in 4.0. */\n hideDetails?: boolean;\n prependIcon?: RuiIcons;\n appendIcon?: RuiIcons;\n readonly?: boolean;\n clearable?: boolean;\n required?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTextField',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<string>({ required: true });\n\nconst {\n label = '',\n placeholder = '',\n disabled = false,\n labelPlacement = undefined,\n color = undefined,\n textColor = undefined,\n dense = false,\n hint = '',\n errorMessages = [],\n successMessages = [],\n details = undefined,\n hideDetails = false,\n prependIcon = undefined,\n appendIcon = undefined,\n readonly = false,\n clearable = false,\n required = false,\n} = defineProps<TextFieldProps>();\n\nconst emit = defineEmits<{\n 'focus-input': [event: Event];\n 'blur': [event: Event];\n 'remove': [value: unknown];\n 'clear': [];\n}>();\n\ndefineSlots<{\n prepend?: () => any;\n append?: () => any;\n /** Rich hint content under the field, in place of the `hint` text; error and success messages still take precedence. */\n hint?: () => any;\n}>();\n\nconst isHovered = ref<boolean>(false);\nconst showClearButton = ref<boolean>(false);\n\nconst inputRef = useTemplateRef<HTMLInputElement>('inputRef');\n\nconst generatedId = useId();\nconst attrs = useAttrs();\n\nconst { focused } = useFocus(inputRef);\nconst placement = useLabelPlacement(() => labelPlacement);\nconst { clear: cancelClearHide, create: delayClearHide } = useTimeoutManager();\nconst { hasError, hasSuccess, hasMessages, validation } = useFormTextDetail(\n () => errorMessages,\n () => successMessages,\n);\nconst detailsMode = useFormDetails(() => details, () => hideDetails);\n\nconst inputId = computed<string>(() => {\n const id = attrs.id;\n return typeof id === 'string' && id ? id : generatedId;\n});\n\nconst showClearIcon = computed<boolean>(() => clearable && !!get(modelValue) && !disabled && !readonly);\n\nconst effectiveTextColor = computed<ContextColorsType | undefined>(() => {\n if (get(hasError))\n return 'error';\n if (get(hasSuccess))\n return 'success';\n if (textColor && !get(hasMessages))\n return textColor;\n return undefined;\n});\n\nconst effectiveColor = computed<ContextColorsType | undefined>(() => get(validation) ?? color);\n\nconst ui = computed<ReturnType<typeof textFieldStyles>>(() => textFieldStyles({\n dense,\n disabled,\n readonly,\n hovered: get(isHovered),\n focused: get(focused),\n color: get(effectiveColor),\n textColor: get(effectiveTextColor),\n validation: get(validation),\n}));\n\nfunction input(event: Event): void {\n const target = event.target;\n if (target instanceof HTMLInputElement) {\n set(modelValue, target.value);\n }\n}\n\nfunction clearIconClicked(): void {\n set(modelValue, '');\n emit('clear');\n}\n\nwatch(focused, (value) => {\n if (value) {\n // a refocus within the delay keeps the button\n cancelClearHide();\n set(showClearButton, true);\n }\n else {\n delayClearHide(() => set(showClearButton, false), 500);\n }\n});\n\ndefineExpose({\n setSelectionRange: (start: number, end: number) => {\n get(inputRef)?.setSelectionRange(start, end);\n },\n focus: () => get(inputRef)?.focus(),\n element: inputRef,\n});\n</script>\n\n<template>\n <div v-bind=\"getRootAttrs($attrs)\">\n <RuiFieldLabel\n v-if=\"label\"\n :text=\"label\"\n :for=\"inputId\"\n :hidden=\"placement === 'hidden'\"\n :required=\"required\"\n :disabled=\"disabled\"\n />\n <div\n :class=\"ui.wrapper()\"\n data-id=\"wrapper\"\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n >\n <div\n v-if=\"$slots.prepend || prependIcon\"\n :class=\"ui.prepend()\"\n data-id=\"prepend\"\n >\n <slot\n v-if=\"$slots.prepend\"\n name=\"prepend\"\n />\n <div\n v-else-if=\"prependIcon\"\n :class=\"ui.icon()\"\n >\n <RuiIcon\n :name=\"prependIcon\"\n :size=\"18\"\n />\n </div>\n </div>\n <div\n :class=\"ui.inputWrapper()\"\n @click=\"emit('focus-input', $event)\"\n >\n <input\n :id=\"inputId\"\n ref=\"inputRef\"\n :value=\"modelValue\"\n :placeholder=\"placeholder || ' '\"\n :class=\"ui.input()\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-invalid=\"hasError\"\n v-bind=\"getNonRootAttrs($attrs)\"\n @input=\"input($event)\"\n @blur=\"emit('blur', $event)\"\n @remove=\"emit('remove', $event)\"\n />\n <fieldset :class=\"ui.fieldset()\" />\n </div>\n <div\n v-if=\"$slots.append || appendIcon || showClearIcon\"\n :class=\"ui.append()\"\n data-id=\"append\"\n >\n <RuiButton\n v-if=\"showClearIcon\"\n :class=\"[ui.clearButton(), { hidden: !showClearButton }]\"\n variant=\"text\"\n type=\"button\"\n icon\n data-id=\"clear-btn\"\n aria-label=\"Clear\"\n tabindex=\"-1\"\n @click.stop=\"clearIconClicked()\"\n >\n <RuiIcon\n name=\"lu-x\"\n size=\"16\"\n />\n </RuiButton>\n <slot\n v-if=\"$slots.append\"\n name=\"append\"\n />\n <div\n v-else-if=\"appendIcon\"\n :class=\"ui.icon()\"\n >\n <RuiIcon\n :name=\"appendIcon\"\n :size=\"18\"\n />\n </div>\n </div>\n </div>\n <RuiFormTextDetail\n v-if=\"detailsMode !== 'hidden'\"\n :details=\"detailsMode\"\n :error-messages=\"errorMessages\"\n :success-messages=\"successMessages\"\n :hint=\"hint\"\n >\n <template\n v-if=\"$slots.hint\"\n #hint\n >\n <slot name=\"hint\" />\n </template>\n </RuiFormTextDetail>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,aAAaE,SAAmB,SAAA,YAAmB;EAsBzD,MAAM,OAAO;EAcb,MAAM,YAAY,IAAa,KAAK;EACpC,MAAM,kBAAkB,IAAa,KAAK;EAE1C,MAAM,WAAW,eAAiC,UAAU;EAE5D,MAAM,cAAc,MAAM;EAC1B,MAAM,QAAQ,SAAS;EAEvB,MAAM,EAAE,YAAY,SAAS,QAAQ;EACrC,MAAM,YAAY,wBAAwB,QAAA,cAAc;EACxD,MAAM,EAAE,OAAO,iBAAiB,QAAQ,mBAAmB,kBAAkB;EAC7E,MAAM,EAAE,UAAU,YAAY,aAAa,eAAe,wBAClD,QAAA,qBACA,QAAA,eACR;EACA,MAAM,cAAc,qBAAqB,QAAA,eAAe,QAAA,WAAW;EAEnE,MAAM,UAAU,eAAuB;GACrC,MAAM,KAAK,MAAM;GACjB,OAAO,OAAO,OAAO,YAAY,KAAK,KAAK;EAC7C,CAAC;EAED,MAAM,gBAAgB,eAAwB,QAAA,aAAa,CAAC,CAAC,IAAI,UAAU,KAAK,CAAC,QAAA,YAAY,CAAC,QAAA,QAAQ;EAEtG,MAAM,qBAAqB,eAA8C;GACvE,IAAI,IAAI,QAAQ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KAED,IAAAkB,cAAoB,CAApBN,WAAoB,KAAA,QAAA,MAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"RuiTextField.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_createBlock","RuiFieldLabel","_createCommentVNode","_createElementVNode","_normalizeClass","_renderSlot","_createVNode","RuiIcon","_mergeProps","RuiButton","_withModifiers","_withCtx","RuiFormTextDetail","_createSlots"],"sources":["../../../../src/components/forms/text-field/RuiTextField.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport type { InputAttributes } from '@/types/attributes';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiFieldLabel from '@/components/forms/field-label/RuiFieldLabel.vue';\nimport { textFieldStyles } from '@/components/forms/text-field/text-field-styles';\nimport RuiFormTextDetail from '@/components/helpers/RuiFormTextDetail.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { type LabelPlacement, useLabelPlacement } from '@/composables/defaults/field';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { type FormDetails, useFormDetails, useFormTextDetail } from '@/utils/form-text-detail';\nimport { getNonRootAttrs, getRootAttrs } from '@/utils/helpers';\n\nexport interface TextFieldProps {\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n /** Where the label shows; falls back to the nearest `RuiFieldDefaults`, then the app default, then `top`. */\n labelPlacement?: LabelPlacement;\n color?: ContextColorsType;\n textColor?: ContextColorsType;\n dense?: boolean;\n hint?: string;\n errorMessages?: string | string[];\n successMessages?: string | string[];\n /** The line under the field for its hint and messages: `reserve`, `auto` or `hidden`; falls back to the nearest `RuiFieldDefaults`, then the app default, then `reserve`. */\n details?: FormDetails;\n /** @deprecated Use `details=\"hidden\"`. Removed in 4.0. */\n hideDetails?: boolean;\n prependIcon?: RuiIcons;\n appendIcon?: RuiIcons;\n readonly?: boolean;\n clearable?: boolean;\n required?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTextField',\n inheritAttrs: false,\n});\n\n// `v-model.trim` trims the update, which Vue applies to any model event\nconst modelValue = defineModel<string, 'trim'>({ required: true });\n\nconst {\n label = '',\n placeholder = '',\n disabled = false,\n labelPlacement = undefined,\n color = undefined,\n textColor = undefined,\n dense = false,\n hint = '',\n errorMessages = [],\n successMessages = [],\n details = undefined,\n hideDetails = false,\n prependIcon = undefined,\n appendIcon = undefined,\n readonly = false,\n clearable = false,\n required = false,\n} = defineProps<TextFieldProps & /* @vue-ignore */ Omit<InputAttributes, keyof TextFieldProps | 'onBlur'>>();\n\nconst emit = defineEmits<{\n 'focus-input': [event: Event];\n 'blur': [event: Event];\n 'remove': [value: unknown];\n 'clear': [];\n}>();\n\ndefineSlots<{\n prepend?: () => any;\n append?: () => any;\n /** Rich hint content under the field, in place of the `hint` text; error and success messages still take precedence. */\n hint?: () => any;\n}>();\n\nconst isHovered = ref<boolean>(false);\nconst showClearButton = ref<boolean>(false);\n\nconst inputRef = useTemplateRef<HTMLInputElement>('inputRef');\n\nconst generatedId = useId();\nconst attrs = useAttrs();\n\nconst { focused } = useFocus(inputRef);\nconst placement = useLabelPlacement(() => labelPlacement);\nconst { clear: cancelClearHide, create: delayClearHide } = useTimeoutManager();\nconst { hasError, hasSuccess, hasMessages, validation } = useFormTextDetail(\n () => errorMessages,\n () => successMessages,\n);\nconst detailsMode = useFormDetails(() => details, () => hideDetails);\n\nconst inputId = computed<string>(() => {\n const id = attrs.id;\n return typeof id === 'string' && id ? id : generatedId;\n});\n\nconst showClearIcon = computed<boolean>(() => clearable && !!get(modelValue) && !disabled && !readonly);\n\nconst effectiveTextColor = computed<ContextColorsType | undefined>(() => {\n if (get(hasError))\n return 'error';\n if (get(hasSuccess))\n return 'success';\n if (textColor && !get(hasMessages))\n return textColor;\n return undefined;\n});\n\nconst effectiveColor = computed<ContextColorsType | undefined>(() => get(validation) ?? color);\n\nconst ui = computed<ReturnType<typeof textFieldStyles>>(() => textFieldStyles({\n dense,\n disabled,\n readonly,\n hovered: get(isHovered),\n focused: get(focused),\n color: get(effectiveColor),\n textColor: get(effectiveTextColor),\n validation: get(validation),\n}));\n\nfunction input(event: Event): void {\n const target = event.target;\n if (target instanceof HTMLInputElement) {\n set(modelValue, target.value);\n }\n}\n\nfunction clearIconClicked(): void {\n set(modelValue, '');\n emit('clear');\n}\n\nwatch(focused, (value) => {\n if (value) {\n // a refocus within the delay keeps the button\n cancelClearHide();\n set(showClearButton, true);\n }\n else {\n delayClearHide(() => set(showClearButton, false), 500);\n }\n});\n\ndefineExpose({\n setSelectionRange: (start: number, end: number) => {\n get(inputRef)?.setSelectionRange(start, end);\n },\n focus: () => get(inputRef)?.focus(),\n element: inputRef,\n});\n</script>\n\n<template>\n <div v-bind=\"getRootAttrs($attrs)\">\n <RuiFieldLabel\n v-if=\"label\"\n :text=\"label\"\n :for=\"inputId\"\n :hidden=\"placement === 'hidden'\"\n :required=\"required\"\n :disabled=\"disabled\"\n />\n <div\n :class=\"ui.wrapper()\"\n data-id=\"wrapper\"\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n >\n <div\n v-if=\"$slots.prepend || prependIcon\"\n :class=\"ui.prepend()\"\n data-id=\"prepend\"\n >\n <slot\n v-if=\"$slots.prepend\"\n name=\"prepend\"\n />\n <div\n v-else-if=\"prependIcon\"\n :class=\"ui.icon()\"\n >\n <RuiIcon\n :name=\"prependIcon\"\n :size=\"18\"\n />\n </div>\n </div>\n <div\n :class=\"ui.inputWrapper()\"\n @click=\"emit('focus-input', $event)\"\n >\n <input\n :id=\"inputId\"\n ref=\"inputRef\"\n :value=\"modelValue\"\n :placeholder=\"placeholder || ' '\"\n :class=\"ui.input()\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-invalid=\"hasError\"\n v-bind=\"getNonRootAttrs($attrs)\"\n @input=\"input($event)\"\n @blur=\"emit('blur', $event)\"\n @remove=\"emit('remove', $event)\"\n />\n <fieldset :class=\"ui.fieldset()\" />\n </div>\n <div\n v-if=\"$slots.append || appendIcon || showClearIcon\"\n :class=\"ui.append()\"\n data-id=\"append\"\n >\n <RuiButton\n v-if=\"showClearIcon\"\n :class=\"[ui.clearButton(), { hidden: !showClearButton }]\"\n variant=\"text\"\n type=\"button\"\n icon\n data-id=\"clear-btn\"\n aria-label=\"Clear\"\n tabindex=\"-1\"\n @click.stop=\"clearIconClicked()\"\n >\n <RuiIcon\n name=\"lu-x\"\n size=\"16\"\n />\n </RuiButton>\n <slot\n v-if=\"$slots.append\"\n name=\"append\"\n />\n <div\n v-else-if=\"appendIcon\"\n :class=\"ui.icon()\"\n >\n <RuiIcon\n :name=\"appendIcon\"\n :size=\"18\"\n />\n </div>\n </div>\n </div>\n <RuiFormTextDetail\n v-if=\"detailsMode !== 'hidden'\"\n :details=\"detailsMode\"\n :error-messages=\"errorMessages\"\n :success-messages=\"successMessages\"\n :hint=\"hint\"\n >\n <template\n v-if=\"$slots.hint\"\n #hint\n >\n <slot name=\"hint\" />\n </template>\n </RuiFormTextDetail>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,aAAaE,SAA2B,SAAA,YAAmB;EAsBjE,MAAM,OAAO;EAcb,MAAM,YAAY,IAAa,KAAK;EACpC,MAAM,kBAAkB,IAAa,KAAK;EAE1C,MAAM,WAAW,eAAiC,UAAU;EAE5D,MAAM,cAAc,MAAM;EAC1B,MAAM,QAAQ,SAAS;EAEvB,MAAM,EAAE,YAAY,SAAS,QAAQ;EACrC,MAAM,YAAY,wBAAwB,QAAA,cAAc;EACxD,MAAM,EAAE,OAAO,iBAAiB,QAAQ,mBAAmB,kBAAkB;EAC7E,MAAM,EAAE,UAAU,YAAY,aAAa,eAAe,wBAClD,QAAA,qBACA,QAAA,eACR;EACA,MAAM,cAAc,qBA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AA,CAAAA,YAGEC,iBAAA;MAFC,MAAM,QAAA;MACN,MAAM;;;IAMPR,MAAA,WAAA,MAAW,YADnBJ,UAAA,GAAAK,YAaoBY,2BAAA;;KAXjB,SAASb,MAAA,WAAA;KACT,kBAAgB,QAAA;KAChB,oBAAkB,QAAA;KAClB,MAAM,QAAA;IAGCN,GAAAA,YAAAA,EAAAA,GAAAA,EAAAA,GAAAA,CAAAA,KAAAA,OAAO,OAAA;KACZ,MAAA;KAED,IAAAkB,cAAoB,CAApBN,WAAoB,KAAA,QAAA,MAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiIcon.js","names":["_sfc_main"],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ClassValue } from 'vue';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport { objectOmit } from '@vueuse/shared';\nimport { useIcons } from '@/composables/icons';\nimport { cn } from '@/utils/tv';\nimport { iconStyles } from './icon-styles';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n // A fallthrough class would land beside the variant classes and leave the cascade to break the tie; `ui` merges instead\n inheritAttrs: false,\n});\n\nconst { name, size, color } = defineProps<Props>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\n\nfunction ui(attrsClass: ClassValue): string {\n return iconStyles({ color, class: cn(attrsClass) });\n}\n\n/**\n * The `size` prop as an inline CSS custom property on the svg. Inline style\n * beats any inherited value for the same property on this element, so a\n * consumer's size beats the button's `--rui-icon-size` without !important.\n *\n * A bare number is coerced to px, including the numeric string a template\n * binding like `:size=\"16\"` resolves to, while a value that already carries a\n * unit passes through. CSS needs that coercion; the `width`/`height`\n * presentation attributes this replaced treated bare numbers as px themselves.\n */\nconst sizeStyle = computed<Record<string, string> | undefined>(() => {\n if (!get(hasExplicitSize))\n return undefined;\n const raw = String(size);\n const value = /^\\d+(?:\\.\\d+)?$/.test(raw) ? `${raw}px` : raw;\n return { '--rui-icon-size': value };\n});\n\n/**\n * What is registered is the only thing that matters here. An app may register\n * its own icons through `createRui(\\{ theme: \\{ icons \\} \\})`, brand logos\n * among them since the library carries none, and those names never appear in\n * the generated `RuiIcons` list. Validating against that list warned for\n * precisely the icons the registration API exists to support. A genuinely\n * unknown name is still caught by the check that decides whether anything\n * renders.\n */\nconst components = computed<SvgComponent[] | undefined>(() => {\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui($attrs.class)\"\n :style=\"sizeStyle\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n v-bind=\"objectOmit($attrs, ['class'])\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n />\n </svg>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiIcon.js","names":["_sfc_main"],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ClassValue, SVGAttributes } from 'vue';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport { objectOmit } from '@vueuse/shared';\nimport { useIcons } from '@/composables/icons';\nimport { cn } from '@/utils/tv';\nimport { iconStyles } from './icon-styles';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n // A fallthrough class would land beside the variant classes and leave the cascade to break the tie; `ui` merges instead\n inheritAttrs: false,\n});\n\nconst { name, size, color } = defineProps<Props & /* @vue-ignore */ Omit<SVGAttributes, keyof Props>>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\n\nfunction ui(attrsClass: ClassValue): string {\n return iconStyles({ color, class: cn(attrsClass) });\n}\n\n/**\n * The `size` prop as an inline CSS custom property on the svg. Inline style\n * beats any inherited value for the same property on this element, so a\n * consumer's size beats the button's `--rui-icon-size` without !important.\n *\n * A bare number is coerced to px, including the numeric string a template\n * binding like `:size=\"16\"` resolves to, while a value that already carries a\n * unit passes through. CSS needs that coercion; the `width`/`height`\n * presentation attributes this replaced treated bare numbers as px themselves.\n */\nconst sizeStyle = computed<Record<string, string> | undefined>(() => {\n if (!get(hasExplicitSize))\n return undefined;\n const raw = String(size);\n const value = /^\\d+(?:\\.\\d+)?$/.test(raw) ? `${raw}px` : raw;\n return { '--rui-icon-size': value };\n});\n\n/**\n * What is registered is the only thing that matters here. An app may register\n * its own icons through `createRui(\\{ theme: \\{ icons \\} \\})`, brand logos\n * among them since the library carries none, and those names never appear in\n * the generated `RuiIcons` list. Validating against that list warned for\n * precisely the icons the registration API exists to support. A genuinely\n * unknown name is still caught by the check that decides whether anything\n * renders.\n */\nconst components = computed<SvgComponent[] | undefined>(() => {\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui($attrs.class)\"\n :style=\"sizeStyle\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n v-bind=\"objectOmit($attrs, ['class'])\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n />\n </svg>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import type { SVGAttributes } from 'vue';
1
2
  import type { ContextColorsType } from '../../consts/colors.js';
2
3
  import type { RuiIcons } from '../../icons/index.js';
3
4
  export interface Props {
@@ -5,6 +6,7 @@ export interface Props {
5
6
  size?: number | string;
6
7
  color?: ContextColorsType;
7
8
  }
8
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ type __VLS_Props = Props & /* @vue-ignore */ Omit<SVGAttributes, keyof Props>;
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
11
  declare const _default: typeof __VLS_export;
10
12
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RuiIcon.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createElementBlock","_mergeProps","_unref","_Fragment","_renderList","_createBlock","_resolveDynamicComponent"],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ClassValue } from 'vue';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport { objectOmit } from '@vueuse/shared';\nimport { useIcons } from '@/composables/icons';\nimport { cn } from '@/utils/tv';\nimport { iconStyles } from './icon-styles';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n // A fallthrough class would land beside the variant classes and leave the cascade to break the tie; `ui` merges instead\n inheritAttrs: false,\n});\n\nconst { name, size, color } = defineProps<Props>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\n\nfunction ui(attrsClass: ClassValue): string {\n return iconStyles({ color, class: cn(attrsClass) });\n}\n\n/**\n * The `size` prop as an inline CSS custom property on the svg. Inline style\n * beats any inherited value for the same property on this element, so a\n * consumer's size beats the button's `--rui-icon-size` without !important.\n *\n * A bare number is coerced to px, including the numeric string a template\n * binding like `:size=\"16\"` resolves to, while a value that already carries a\n * unit passes through. CSS needs that coercion; the `width`/`height`\n * presentation attributes this replaced treated bare numbers as px themselves.\n */\nconst sizeStyle = computed<Record<string, string> | undefined>(() => {\n if (!get(hasExplicitSize))\n return undefined;\n const raw = String(size);\n const value = /^\\d+(?:\\.\\d+)?$/.test(raw) ? `${raw}px` : raw;\n return { '--rui-icon-size': value };\n});\n\n/**\n * What is registered is the only thing that matters here. An app may register\n * its own icons through `createRui(\\{ theme: \\{ icons \\} \\})`, brand logos\n * among them since the library carries none, and those names never appear in\n * the generated `RuiIcons` list. Validating against that list warned for\n * precisely the icons the registration API exists to support. A genuinely\n * unknown name is still caught by the check that decides whether anything\n * renders.\n */\nconst components = computed<SvgComponent[] | undefined>(() => {\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui($attrs.class)\"\n :style=\"sizeStyle\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n v-bind=\"objectOmit($attrs, ['class'])\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n />\n </svg>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAuBA,MAAM,EAAE,oBAAoB,SAAS;EAIrC,MAAM,kBAAkB,eAAwB,QAAA,SAAS,KAAA,CAAS;EAElE,SAAS,GAAG,YAAgC;GAC1C,OAAO,WAAW;IAAE,OAAI,QAAA;IAAG,OAAO,GAAG,UAAU;GAAE,CAAC;EACpD;;;;;;;;;;;EAYA,MAAM,YAAY,eAAmD;GACnE,IAAI,CAAC,IAAI,eAAe,GACtB,OAAO,KAAA;GACT,MAAM,MAAM,OAAO,QAAA,IAAI;GAEvB,OAAO,EAAE,mBADK,kBAAkB,KAAK,GAAG,IAAI,GAAG,IAAI,MAAM,IACvB;EACpC,CAAC;;;;;;;;;;EAWD,MAAM,aAAa,eAA2C;GAC5D,MAAM,QAAQ,gBAAgB,QAAA;GAE9B,IAAI,CAAC,OACH,QAAQ,MACN,UAAU,QAAA,KAAK,qFACjB;GAEF,OAAO;EACT,CAAC;;GAIC,OAAAC,UAAA,GAAAC,mBAmBM,OAnBNC,WAmBM;IAlBJ,eAAY;IACZ,OAAK,CAAC,YACE,GAAGH,KAAAA,OAAO,KAAK,CAAA;IACtB,OAAOI,MAAA,SAAA;IACR,SAAQ;IACR,OAAM;IACN,MAAK;IACL,QAAO;IACP,kBAAe;IACf,mBAAgB;GACR,GAAAA,MAAA,UAAA,CAAU,CAACJ,KAAAA,QAAM,CAAA,OAAA,CAAA,CAAA,GAAA,EAEzBC,UAAA,IAAA,GAAAC,mBAKEG,UAAA,MAAAC,WAH6BF,MAAA,UAAA,IAArB,WAAW,UAAK;IAF1B,OAAAH,UAAA,GAAAM,YAKEC,wBAJK,UAAS,EAAA,GADhBL,WAKE,EAFC,KAAK,MAAK,GAAA,EAAA,SAAA,KAAA,GACH,UAAS,EAAA,GAAA,MAAA,EAAA"}
1
+ {"version":3,"file":"RuiIcon.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createElementBlock","_mergeProps","_unref","_Fragment","_renderList","_createBlock","_resolveDynamicComponent"],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ClassValue, SVGAttributes } from 'vue';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport { objectOmit } from '@vueuse/shared';\nimport { useIcons } from '@/composables/icons';\nimport { cn } from '@/utils/tv';\nimport { iconStyles } from './icon-styles';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n // A fallthrough class would land beside the variant classes and leave the cascade to break the tie; `ui` merges instead\n inheritAttrs: false,\n});\n\nconst { name, size, color } = defineProps<Props & /* @vue-ignore */ Omit<SVGAttributes, keyof Props>>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\n\nfunction ui(attrsClass: ClassValue): string {\n return iconStyles({ color, class: cn(attrsClass) });\n}\n\n/**\n * The `size` prop as an inline CSS custom property on the svg. Inline style\n * beats any inherited value for the same property on this element, so a\n * consumer's size beats the button's `--rui-icon-size` without !important.\n *\n * A bare number is coerced to px, including the numeric string a template\n * binding like `:size=\"16\"` resolves to, while a value that already carries a\n * unit passes through. CSS needs that coercion; the `width`/`height`\n * presentation attributes this replaced treated bare numbers as px themselves.\n */\nconst sizeStyle = computed<Record<string, string> | undefined>(() => {\n if (!get(hasExplicitSize))\n return undefined;\n const raw = String(size);\n const value = /^\\d+(?:\\.\\d+)?$/.test(raw) ? `${raw}px` : raw;\n return { '--rui-icon-size': value };\n});\n\n/**\n * What is registered is the only thing that matters here. An app may register\n * its own icons through `createRui(\\{ theme: \\{ icons \\} \\})`, brand logos\n * among them since the library carries none, and those names never appear in\n * the generated `RuiIcons` list. Validating against that list warned for\n * precisely the icons the registration API exists to support. A genuinely\n * unknown name is still caught by the check that decides whether anything\n * renders.\n */\nconst components = computed<SvgComponent[] | undefined>(() => {\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui($attrs.class)\"\n :style=\"sizeStyle\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n v-bind=\"objectOmit($attrs, ['class'])\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n />\n </svg>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAuBA,MAAM,EAAE,oBAAoB,SAAS;EAIrC,MAAM,kBAAkB,eAAwB,QAAA,SAAS,KAAA,CAAS;EAElE,SAAS,GAAG,YAAgC;GAC1C,OAAO,WAAW;IAAE,OAAI,QAAA;IAAG,OAAO,GAAG,UAAU;GAAE,CAAC;EACpD;;;;;;;;;;;EAYA,MAAM,YAAY,eAAmD;GACnE,IAAI,CAAC,IAAI,eAAe,GACtB,OAAO,KAAA;GACT,MAAM,MAAM,OAAO,QAAA,IAAI;GAEvB,OAAO,EAAE,mBADK,kBAAkB,KAAK,GAAG,IAAI,GAAG,IAAI,MAAM,IACvB;EACpC,CAAC;;;;;;;;;;EAWD,MAAM,aAAa,eAA2C;GAC5D,MAAM,QAAQ,gBAAgB,QAAA;GAE9B,IAAI,CAAC,OACH,QAAQ,MACN,UAAU,QAAA,KAAK,qFACjB;GAEF,OAAO;EACT,CAAC;;GAIC,OAAAC,UAAA,GAAAC,mBAmBM,OAnBNC,WAmBM;IAlBJ,eAAY;IACZ,OAAK,CAAC,YACE,GAAGH,KAAAA,OAAO,KAAK,CAAA;IACtB,OAAOI,MAAA,SAAA;IACR,SAAQ;IACR,OAAM;IACN,MAAK;IACL,QAAO;IACP,kBAAe;IACf,mBAAgB;GACR,GAAAA,MAAA,UAAA,CAAU,CAACJ,KAAAA,QAAM,CAAA,OAAA,CAAA,CAAA,GAAA,EAEzBC,UAAA,IAAA,GAAAC,mBAKEG,UAAA,MAAAC,WAH6BF,MAAA,UAAA,IAArB,WAAW,UAAK;IAF1B,OAAAH,UAAA,GAAAM,YAKEC,wBAJK,UAAS,EAAA,GADhBL,WAKE,EAFC,KAAK,MAAK,GAAA,EAAA,SAAA,KAAA,GACH,UAAS,EAAA,GAAA,MAAA,EAAA"}
@@ -35,7 +35,7 @@ import RuiSkeletonLoader, { type Props as SkeletonLoaderProps } from './loaders/
35
35
  import RuiLogo, { type Props as LogoProps } from './logos/RuiLogo.vue.js';
36
36
  import RuiBadge, { type Props as BadgeProps } from './overlays/badge/RuiBadge.vue.js';
37
37
  import RuiBottomSheet, { type BottomSheetProps } from './overlays/bottom-sheet/RuiBottomSheet.vue.js';
38
- import RuiDialog, { type DialogProps, type RuiDialogClassNames } from './overlays/dialog/RuiDialog.vue.js';
38
+ import RuiDialog, { type DialogProps, type DialogSlots, type RuiDialogClassNames } from './overlays/dialog/RuiDialog.vue.js';
39
39
  import RuiMenu, { type MenuProps, type RuiMenuClassNames, type RuiMenuRole } from './overlays/menu/RuiMenu.vue.js';
40
40
  import RuiNavigationDrawer, { type NavigationDrawerProps, type RuiNavigationDrawerClassNames } from './overlays/navigation-drawer/RuiNavigationDrawer.vue.js';
41
41
  import RuiNotification, { type NotificationProps } from './overlays/notification/RuiNotification.vue.js';
@@ -55,5 +55,5 @@ import RuiTabItems from './tabs/tab-items/RuiTabItems.vue.js';
55
55
  import RuiTab, { type RuiTabClassNames, type Props as TabProps } from './tabs/tab/RuiTab.vue.js';
56
56
  import RuiTabs, { type Props as TabsProps } from './tabs/tabs/RuiTabs.vue.js';
57
57
  import RuiTimePicker, { type RuiTimePickerProps } from './time-picker/RuiTimePicker.vue.js';
58
- export type { AccordionProps, AccordionsProps, AlertProps, AutoCompleteProps, AvatarGroupProps, AvatarProps, BadgeProps, BottomSheetProps, ButtonGroupProps, ButtonProps, CalendarProps, CardHeaderProps, CardProps, CheckboxGroupProps, CheckboxProps, ChipProps, DataTableColumn, DataTableGroupKeys, DataTableOptions, DataTableProps, DataTableSortColumn, DataTableSortData, DialogProps, DividerProps, ExpandButtonProps, FieldDefaultsProps, FileUploadProps, FooterStepperProps, GroupData, IconProps, LogoProps, MenuProps, MenuSelectProps, NavigationDrawerProps, NotificationProps, ProgressProps, RadioGroupProps, RadioProps, RevealableTextFieldProps, RuiAccordionClassNames, RuiAutoCompleteClassNames, RuiCardClassNames, RuiCategoryPickerClassNames, RuiCategoryPickerProps, RuiChipClassNames, RuiDateTimePickerProps, RuiDialogClassNames, RuiMenuClassNames, RuiMenuRole, RuiMenuSelectClassNames, RuiNavigationDrawerClassNames, RuiSliderClassNames, RuiStepperClassNames, RuiTabClassNames, RuiTimePickerProps, RuiTimezoneSelectProps, RuiTooltipClassNames, SimpleSelectProps, SkeletonLoaderProps, SliderProps, StepperProps, SwitchProps, TabItemProps, TableEmpty, TableEmptyStateProps, TableErrorStateProps, TableLoadingStateProps, TablePaginationData, TablePaginationProps, TableProps, TabProps, TabsProps, TextAreaProps, TextFieldProps, TooltipProps, };
58
+ export type { AccordionProps, AccordionsProps, AlertProps, AutoCompleteProps, AvatarGroupProps, AvatarProps, BadgeProps, BottomSheetProps, ButtonGroupProps, ButtonProps, CalendarProps, CardHeaderProps, CardProps, CheckboxGroupProps, CheckboxProps, ChipProps, DataTableColumn, DataTableGroupKeys, DataTableOptions, DataTableProps, DataTableSortColumn, DataTableSortData, DialogProps, DialogSlots, DividerProps, ExpandButtonProps, FieldDefaultsProps, FileUploadProps, FooterStepperProps, GroupData, IconProps, LogoProps, MenuProps, MenuSelectProps, NavigationDrawerProps, NotificationProps, ProgressProps, RadioGroupProps, RadioProps, RevealableTextFieldProps, RuiAccordionClassNames, RuiAutoCompleteClassNames, RuiCardClassNames, RuiCategoryPickerClassNames, RuiCategoryPickerProps, RuiChipClassNames, RuiDateTimePickerProps, RuiDialogClassNames, RuiMenuClassNames, RuiMenuRole, RuiMenuSelectClassNames, RuiNavigationDrawerClassNames, RuiSliderClassNames, RuiStepperClassNames, RuiTabClassNames, RuiTimePickerProps, RuiTimezoneSelectProps, RuiTooltipClassNames, SimpleSelectProps, SkeletonLoaderProps, SliderProps, StepperProps, SwitchProps, TabItemProps, TableEmpty, TableEmptyStateProps, TableErrorStateProps, TableLoadingStateProps, TablePaginationData, TablePaginationProps, TableProps, TabProps, TabsProps, TextAreaProps, TextFieldProps, TooltipProps, };
59
59
  export { RuiAccordion, RuiAccordions, RuiAlert, RuiAutoComplete, RuiAvatar, RuiAvatarGroup, RuiBadge, RuiBottomSheet, RuiButton, RuiButtonGroup, RuiCalendar, RuiCard, RuiCardHeader, RuiCategoryPicker, RuiCheckbox, RuiCheckboxGroup, RuiChip, RuiColorPicker, RuiDataTable, RuiDateTimePicker, RuiDialog, RuiDivider, RuiFieldDefaults, RuiFileUpload, RuiFooterStepper, RuiIcon, RuiLogo, RuiMenu, RuiMenuSelect, RuiNavigationDrawer, RuiNotification, RuiProgress, RuiRadio, RuiRadioGroup, RuiRevealableTextField, RuiSimpleSelect, RuiSkeletonLoader, RuiSlider, RuiStepper, RuiSwitch, RuiTab, RuiTabItem, RuiTabItems, RuiTable, RuiTableEmptyState, RuiTableErrorState, RuiTableLoadingState, RuiTablePagination, RuiTableRowExpander, RuiTabs, RuiTextArea, RuiTextField, RuiTimePicker, RuiTimezoneSelect, RuiTooltip, };
@@ -1 +1 @@
1
- {"version":3,"file":"RuiSkeletonLoader.js","names":["_sfc_main"],"sources":["../../../src/components/loaders/RuiSkeletonLoader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport RuiSkeletonBase, {\n type Props as SkeletonBaseProps,\n} from '@/components/loaders/RuiSkeletonBase.vue';\nimport { SkeletonType } from '@/components/loaders/skeleton-type';\nimport { cn } from '@/utils/tv';\nimport { skeletonLoaderStyles } from './skeleton-loader-styles';\n\nexport interface Props extends SkeletonBaseProps {\n type?: SkeletonType;\n}\n\ndefineOptions({\n name: 'RuiSkeletonLoader',\n inheritAttrs: false,\n});\n\nconst { type = SkeletonType.TEXT, rounded } = defineProps<Props>();\n\nconst multiLineTypes: SkeletonType[] = [SkeletonType.PARAGRAPH, SkeletonType.ARTICLE];\n\nconst attrs = useAttrs();\nconst ui = computed<string>(() => skeletonLoaderStyles({ type, class: cn(attrs.class) }));\nconst isMultiLine = computed<boolean>(() => multiLineTypes.includes(type));\n</script>\n\n<template>\n <RuiSkeletonBase\n v-if=\"!isMultiLine\"\n :class=\"ui\"\n :rounded=\"rounded\"\n v-bind=\"{ ...attrs, class: undefined }\"\n />\n <div\n v-else\n :class=\"ui\"\n v-bind=\"{ ...attrs, class: undefined }\"\n >\n <RuiSkeletonBase\n v-if=\"type === SkeletonType.ARTICLE\"\n class=\"w-full h-6 rounded-rui-control mb-1\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[80%]\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[90%]\"\n :rounded=\"rounded\"\n />\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiSkeletonLoader.js","names":["_sfc_main"],"sources":["../../../src/components/loaders/RuiSkeletonLoader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { HTMLAttributes } from 'vue';\nimport RuiSkeletonBase, {\n type Props as SkeletonBaseProps,\n} from '@/components/loaders/RuiSkeletonBase.vue';\nimport { SkeletonType } from '@/components/loaders/skeleton-type';\nimport { cn } from '@/utils/tv';\nimport { skeletonLoaderStyles } from './skeleton-loader-styles';\n\nexport interface Props extends SkeletonBaseProps {\n type?: SkeletonType;\n}\n\ndefineOptions({\n name: 'RuiSkeletonLoader',\n inheritAttrs: false,\n});\n\nconst { type = SkeletonType.TEXT, rounded } = defineProps<Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>>();\n\nconst multiLineTypes: SkeletonType[] = [SkeletonType.PARAGRAPH, SkeletonType.ARTICLE];\n\nconst attrs = useAttrs();\nconst ui = computed<string>(() => skeletonLoaderStyles({ type, class: cn(attrs.class) }));\nconst isMultiLine = computed<boolean>(() => multiLineTypes.includes(type));\n</script>\n\n<template>\n <RuiSkeletonBase\n v-if=\"!isMultiLine\"\n :class=\"ui\"\n :rounded=\"rounded\"\n v-bind=\"{ ...attrs, class: undefined }\"\n />\n <div\n v-else\n :class=\"ui\"\n v-bind=\"{ ...attrs, class: undefined }\"\n >\n <RuiSkeletonBase\n v-if=\"type === SkeletonType.ARTICLE\"\n class=\"w-full h-6 rounded-rui-control mb-1\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[80%]\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[90%]\"\n :rounded=\"rounded\"\n />\n </div>\n</template>\n"],"mappings":""}
@@ -1,8 +1,10 @@
1
+ import type { HTMLAttributes } from 'vue';
1
2
  import { type Props as SkeletonBaseProps } from './RuiSkeletonBase.vue.js';
2
3
  import { SkeletonType } from './skeleton-type.js';
3
4
  export interface Props extends SkeletonBaseProps {
4
5
  type?: SkeletonType;
5
6
  }
6
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ type __VLS_Props = Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>;
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
9
  declare const _default: typeof __VLS_export;
8
10
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js","names":["_unref","_openBlock","_createBlock","RuiSkeletonBase","_mergeProps","_createElementBlock","_createCommentVNode","_createVNode"],"sources":["../../../src/components/loaders/RuiSkeletonLoader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport RuiSkeletonBase, {\n type Props as SkeletonBaseProps,\n} from '@/components/loaders/RuiSkeletonBase.vue';\nimport { SkeletonType } from '@/components/loaders/skeleton-type';\nimport { cn } from '@/utils/tv';\nimport { skeletonLoaderStyles } from './skeleton-loader-styles';\n\nexport interface Props extends SkeletonBaseProps {\n type?: SkeletonType;\n}\n\ndefineOptions({\n name: 'RuiSkeletonLoader',\n inheritAttrs: false,\n});\n\nconst { type = SkeletonType.TEXT, rounded } = defineProps<Props>();\n\nconst multiLineTypes: SkeletonType[] = [SkeletonType.PARAGRAPH, SkeletonType.ARTICLE];\n\nconst attrs = useAttrs();\nconst ui = computed<string>(() => skeletonLoaderStyles({ type, class: cn(attrs.class) }));\nconst isMultiLine = computed<boolean>(() => multiLineTypes.includes(type));\n</script>\n\n<template>\n <RuiSkeletonBase\n v-if=\"!isMultiLine\"\n :class=\"ui\"\n :rounded=\"rounded\"\n v-bind=\"{ ...attrs, class: undefined }\"\n />\n <div\n v-else\n :class=\"ui\"\n v-bind=\"{ ...attrs, class: undefined }\"\n >\n <RuiSkeletonBase\n v-if=\"type === SkeletonType.ARTICLE\"\n class=\"w-full h-6 rounded-rui-control mb-1\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[80%]\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[90%]\"\n :rounded=\"rounded\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAmBA,MAAM,iBAAiC,CAAC,aAAa,WAAW,aAAa,OAAO;EAEpF,MAAM,QAAQ,SAAS;EACvB,MAAM,KAAK,eAAuB,qBAAqB;GAAE,MAAG,QAAA;GAAG,OAAO,GAAG,MAAM,KAAK;EAAE,CAAC,CAAC;EACxF,MAAM,cAAc,eAAwB,eAAe,SAAS,QAAA,IAAI,CAAC;;GAK9D,OAAA,CAAAA,MAAA,WAAA,KADTC,UAAA,GAAAC,YAKEC,yBALFC,WAKE;;IAHC,OAAOJ,MAAA,EAAA;IACP,SAAS,QAAA;GACG,GAAA;IAAA,GAAAA,MAAA,KAAA;IAAK,OAAS,KAAA;GAAS,CAAA,GAAA,MAAA,IAAA,CAAA,SAAA,SAAA,CAAA,MAEtCC,UAAA,GAAAI,mBAsBM,OAtBND,WAsBM;;IApBH,OAAOJ,MAAA,EAAA;GACK,GAAA;IAAA,GAAAA,MAAA,KAAA;IAAK,OAAS,KAAA;GAAS,CAAA,GAAA;IAG5B,QAAA,SAASA,MAAA,YAAA,CAAY,CAAC,WAD9BC,UAAA,GAAAC,YAIEC,yBAAA;;KAFA,OAAM;KACL,SAAS,QAAA;;IAEZI,YAGEJ,yBAAA;KAFA,OAAM;KACL,SAAS,QAAA;;IAEZI,YAGEJ,yBAAA;KAFA,OAAM;KACL,SAAS,QAAA;;IAEZI,YAGEJ,yBAAA;KAFA,OAAM;KACL,SAAS,QAAA"}
1
+ {"version":3,"file":"RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js","names":["_unref","_openBlock","_createBlock","RuiSkeletonBase","_mergeProps","_createElementBlock","_createCommentVNode","_createVNode"],"sources":["../../../src/components/loaders/RuiSkeletonLoader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { HTMLAttributes } from 'vue';\nimport RuiSkeletonBase, {\n type Props as SkeletonBaseProps,\n} from '@/components/loaders/RuiSkeletonBase.vue';\nimport { SkeletonType } from '@/components/loaders/skeleton-type';\nimport { cn } from '@/utils/tv';\nimport { skeletonLoaderStyles } from './skeleton-loader-styles';\n\nexport interface Props extends SkeletonBaseProps {\n type?: SkeletonType;\n}\n\ndefineOptions({\n name: 'RuiSkeletonLoader',\n inheritAttrs: false,\n});\n\nconst { type = SkeletonType.TEXT, rounded } = defineProps<Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>>();\n\nconst multiLineTypes: SkeletonType[] = [SkeletonType.PARAGRAPH, SkeletonType.ARTICLE];\n\nconst attrs = useAttrs();\nconst ui = computed<string>(() => skeletonLoaderStyles({ type, class: cn(attrs.class) }));\nconst isMultiLine = computed<boolean>(() => multiLineTypes.includes(type));\n</script>\n\n<template>\n <RuiSkeletonBase\n v-if=\"!isMultiLine\"\n :class=\"ui\"\n :rounded=\"rounded\"\n v-bind=\"{ ...attrs, class: undefined }\"\n />\n <div\n v-else\n :class=\"ui\"\n v-bind=\"{ ...attrs, class: undefined }\"\n >\n <RuiSkeletonBase\n v-if=\"type === SkeletonType.ARTICLE\"\n class=\"w-full h-6 rounded-rui-control mb-1\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[80%]\"\n :rounded=\"rounded\"\n />\n <RuiSkeletonBase\n class=\"w-full h-3 rounded-rui-control max-w-[90%]\"\n :rounded=\"rounded\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAoBA,MAAM,iBAAiC,CAAC,aAAa,WAAW,aAAa,OAAO;EAEpF,MAAM,QAAQ,SAAS;EACvB,MAAM,KAAK,eAAuB,qBAAqB;GAAE,MAAG,QAAA;GAAG,OAAO,GAAG,MAAM,KAAK;EAAE,CAAC,CAAC;EACxF,MAAM,cAAc,eAAwB,eAAe,SAAS,QAAA,IAAI,CAAC;;GAK9D,OAAA,CAAAA,MAAA,WAAA,KADTC,UAAA,GAAAC,YAKEC,yBALFC,WAKE;;IAHC,OAAOJ,MAAA,EAAA;IACP,SAAS,QAAA;GACG,GAAA;IAAA,GAAAA,MAAA,KAAA;IAAK,OAAS,KAAA;GAAS,CAAA,GAAA,MAAA,IAAA,CAAA,SAAA,SAAA,CAAA,MAEtCC,UAAA,GAAAI,mBAsBM,OAtBND,WAsBM;;IApBH,OAAOJ,MAAA,EAAA;GACK,GAAA;IAAA,GAAAA,MAAA,KAAA;IAAK,OAAS,KAAA;GAAS,CAAA,GAAA;IAG5B,QAAA,SAASA,MAAA,YAAA,CAAY,CAAC,WAD9BC,UAAA,GAAAC,YAIEC,yBAAA;;KAFA,OAAM;KACL,SAAS,QAAA;;IAEZI,YAGEJ,yBAAA;KAFA,OAAM;KACL,SAAS,QAAA;;IAEZI,YAGEJ,yBAAA;KAFA,OAAM;KACL,SAAS,QAAA;;IAEZI,YAGEJ,yBAAA;KAFA,OAAM;KACL,SAAS,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiLogo.js","names":["_sfc_main"],"sources":["../../../src/components/logos/RuiLogo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport fallback from '@/components/logos/logo.svg';\nimport { getVerifiedLogoUrl, removeVerifiedLogoUrl, setVerifiedLogoUrl } from '@/components/logos/verified-logo';\nimport { useLogoOptions } from '@/composables/defaults/logo';\n\nexport interface Props {\n text?: boolean;\n /**\n * Name handed to the `logo.resolve` option of `createRui`. Without a resolver\n * the bundled logo shows.\n */\n logo?: string;\n size?: string | number; // in rems\n /**\n * Appended to the resolved URL as `key`, so each instance loads its own copy.\n */\n uniqueKey?: string | number;\n src?: string;\n}\n\ndefineOptions({\n name: 'RuiLogo',\n});\n\nconst { text = false, logo, size = 3, uniqueKey, src } = defineProps<Props>();\n\nconst appName = 'rotki';\n\nconst resolvedUrl = ref<string>();\nconst error = ref<boolean>(false);\nconst seasonalReady = ref<boolean>(false);\n\nconst isMounted = ref<boolean>(false);\n\nconst customImageRef = useTemplateRef<HTMLImageElement>('customImageRef');\n\nconst logoOptions = useLogoOptions();\n\nconst externalSource = computed<string | undefined>(() => {\n if (src)\n return src;\n\n const url = get(resolvedUrl);\n if (!url || uniqueKey === undefined)\n return url;\n\n return `${url}${url.includes('?') ? '&' : '?'}key=${uniqueKey}`;\n});\n\nconst showCustom = computed<boolean>(() => !!src || (!!get(externalSource) && get(seasonalReady) && !get(error)));\n\nfunction preloadImage(url: string): void {\n const existing = document.head.querySelectorAll<HTMLLinkElement>('link[rel=\"preload\"][as=\"image\"]');\n for (const link of existing) {\n if (link.href === url)\n return;\n }\n\n const link = document.createElement('link');\n link.rel = 'preload';\n link.as = 'image';\n link.href = url;\n document.head.appendChild(link);\n}\n\nasync function callResolver(name: string): Promise<string | undefined> {\n try {\n return await logoOptions?.resolve(name);\n }\n catch {\n // A failing resolver leaves the bundled logo in place\n return undefined;\n }\n}\n\n/**\n * Asks the app's resolver for the logo URL. It runs only after mount, so the\n * server and the client's first render both show the bundled fallback (or\n * `src`) and hydration matches.\n */\nasync function resolveLogo(): Promise<void> {\n if (!get(isMounted))\n return;\n\n if (src || !logo || !logoOptions) {\n set(resolvedUrl, undefined);\n return;\n }\n\n const name = logo;\n const url = await callResolver(name);\n\n // The logo prop changed while the resolver ran; that newer run wins\n if (name !== logo)\n return;\n\n set(error, false);\n // A URL that already decoded in this session is shown without waiting for it again\n set(seasonalReady, !!url && getVerifiedLogoUrl(name) === url);\n set(resolvedUrl, url);\n\n const source = get(externalSource);\n if (source)\n preloadImage(source);\n}\n\nfunction onImageError(): void {\n set(error, true);\n if (logo)\n removeVerifiedLogoUrl(logo);\n}\n\nfunction onImageLoaded(): void {\n const img = get(customImageRef);\n if (!img)\n return;\n\n img.decode()\n .then(() => {\n set(seasonalReady, true);\n // Remember the decoded URL so the next page load can trust it immediately\n const url = get(resolvedUrl);\n if (url && logo)\n setVerifiedLogoUrl(logo, url);\n })\n .catch(() => set(error, true));\n}\n\nwatch(() => get(customImageRef)?.complete, (complete) => {\n if (complete)\n onImageLoaded();\n});\n\nwatchEffect(resolveLogo);\n\nonMounted(() => {\n set(isMounted, true);\n});\n</script>\n\n<template>\n <div\n class=\"gap-x-4 flex items-center relative\"\n :style=\"{ height: `${size}rem` }\"\n >\n <div\n class=\"relative\"\n :style=\"{ width: `${size}rem`, height: `${size}rem` }\"\n >\n <!-- Fallback: always in DOM, fades out when custom image is ready -->\n <img\n :src=\"fallback\"\n :alt=\"appName\"\n data-image=\"fallback\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-0' : 'opacity-100'\"\n />\n\n <!-- Custom/seasonal image: fades in when decoded -->\n <img\n v-if=\"externalSource && !error\"\n ref=\"customImageRef\"\n :src=\"externalSource\"\n :alt=\"appName\"\n data-image=\"custom\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-100' : 'opacity-0 pointer-events-none'\"\n @error=\"onImageError()\"\n @load=\"onImageLoaded()\"\n />\n </div>\n\n <div\n v-if=\"text\"\n class=\"text-h4 text-rui-primary dark:text-rui-text\"\n >\n {{ appName }}\n </div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiLogo.js","names":["_sfc_main"],"sources":["../../../src/components/logos/RuiLogo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport fallback from '@/components/logos/logo.svg';\nimport { getVerifiedLogoUrl, removeVerifiedLogoUrl, setVerifiedLogoUrl } from '@/components/logos/verified-logo';\nimport { useLogoOptions } from '@/composables/defaults/logo';\n\nexport interface Props {\n text?: boolean;\n /**\n * Name handed to the `logo.resolve` option of `createRui`. Without a resolver\n * the bundled logo shows.\n */\n logo?: string;\n size?: string | number; // in rems\n /**\n * Appended to the resolved URL as `key`, so each instance loads its own copy.\n */\n uniqueKey?: string | number;\n src?: string;\n}\n\ndefineOptions({\n name: 'RuiLogo',\n});\n\nconst { text = false, logo, size = 3, uniqueKey, src } = defineProps<Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>>();\n\nconst appName = 'rotki';\n\nconst resolvedUrl = ref<string>();\nconst error = ref<boolean>(false);\nconst seasonalReady = ref<boolean>(false);\n\nconst isMounted = ref<boolean>(false);\n\nconst customImageRef = useTemplateRef<HTMLImageElement>('customImageRef');\n\nconst logoOptions = useLogoOptions();\n\nconst externalSource = computed<string | undefined>(() => {\n if (src)\n return src;\n\n const url = get(resolvedUrl);\n if (!url || uniqueKey === undefined)\n return url;\n\n return `${url}${url.includes('?') ? '&' : '?'}key=${uniqueKey}`;\n});\n\nconst showCustom = computed<boolean>(() => !!src || (!!get(externalSource) && get(seasonalReady) && !get(error)));\n\nfunction preloadImage(url: string): void {\n const existing = document.head.querySelectorAll<HTMLLinkElement>('link[rel=\"preload\"][as=\"image\"]');\n for (const link of existing) {\n if (link.href === url)\n return;\n }\n\n const link = document.createElement('link');\n link.rel = 'preload';\n link.as = 'image';\n link.href = url;\n document.head.appendChild(link);\n}\n\nasync function callResolver(name: string): Promise<string | undefined> {\n try {\n return await logoOptions?.resolve(name);\n }\n catch {\n // A failing resolver leaves the bundled logo in place\n return undefined;\n }\n}\n\n/**\n * Asks the app's resolver for the logo URL. It runs only after mount, so the\n * server and the client's first render both show the bundled fallback (or\n * `src`) and hydration matches.\n */\nasync function resolveLogo(): Promise<void> {\n if (!get(isMounted))\n return;\n\n if (src || !logo || !logoOptions) {\n set(resolvedUrl, undefined);\n return;\n }\n\n const name = logo;\n const url = await callResolver(name);\n\n // The logo prop changed while the resolver ran; that newer run wins\n if (name !== logo)\n return;\n\n set(error, false);\n // A URL that already decoded in this session is shown without waiting for it again\n set(seasonalReady, !!url && getVerifiedLogoUrl(name) === url);\n set(resolvedUrl, url);\n\n const source = get(externalSource);\n if (source)\n preloadImage(source);\n}\n\nfunction onImageError(): void {\n set(error, true);\n if (logo)\n removeVerifiedLogoUrl(logo);\n}\n\nfunction onImageLoaded(): void {\n const img = get(customImageRef);\n if (!img)\n return;\n\n img.decode()\n .then(() => {\n set(seasonalReady, true);\n // Remember the decoded URL so the next page load can trust it immediately\n const url = get(resolvedUrl);\n if (url && logo)\n setVerifiedLogoUrl(logo, url);\n })\n .catch(() => set(error, true));\n}\n\nwatch(() => get(customImageRef)?.complete, (complete) => {\n if (complete)\n onImageLoaded();\n});\n\nwatchEffect(resolveLogo);\n\nonMounted(() => {\n set(isMounted, true);\n});\n</script>\n\n<template>\n <div\n class=\"gap-x-4 flex items-center relative\"\n :style=\"{ height: `${size}rem` }\"\n >\n <div\n class=\"relative\"\n :style=\"{ width: `${size}rem`, height: `${size}rem` }\"\n >\n <!-- Fallback: always in DOM, fades out when custom image is ready -->\n <img\n :src=\"fallback\"\n :alt=\"appName\"\n data-image=\"fallback\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-0' : 'opacity-100'\"\n />\n\n <!-- Custom/seasonal image: fades in when decoded -->\n <img\n v-if=\"externalSource && !error\"\n ref=\"customImageRef\"\n :src=\"externalSource\"\n :alt=\"appName\"\n data-image=\"custom\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-100' : 'opacity-0 pointer-events-none'\"\n @error=\"onImageError()\"\n @load=\"onImageLoaded()\"\n />\n </div>\n\n <div\n v-if=\"text\"\n class=\"text-h4 text-rui-primary dark:text-rui-text\"\n >\n {{ appName }}\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from 'vue';
1
2
  export interface Props {
2
3
  text?: boolean;
3
4
  /**
@@ -12,6 +13,7 @@ export interface Props {
12
13
  uniqueKey?: string | number;
13
14
  src?: string;
14
15
  }
15
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ type __VLS_Props = Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>;
17
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
18
  declare const _default: typeof __VLS_export;
17
19
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RuiLogo.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_createElementVNode","_unref","fallback","_normalizeClass","_createCommentVNode","_toDisplayString"],"sources":["../../../src/components/logos/RuiLogo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport fallback from '@/components/logos/logo.svg';\nimport { getVerifiedLogoUrl, removeVerifiedLogoUrl, setVerifiedLogoUrl } from '@/components/logos/verified-logo';\nimport { useLogoOptions } from '@/composables/defaults/logo';\n\nexport interface Props {\n text?: boolean;\n /**\n * Name handed to the `logo.resolve` option of `createRui`. Without a resolver\n * the bundled logo shows.\n */\n logo?: string;\n size?: string | number; // in rems\n /**\n * Appended to the resolved URL as `key`, so each instance loads its own copy.\n */\n uniqueKey?: string | number;\n src?: string;\n}\n\ndefineOptions({\n name: 'RuiLogo',\n});\n\nconst { text = false, logo, size = 3, uniqueKey, src } = defineProps<Props>();\n\nconst appName = 'rotki';\n\nconst resolvedUrl = ref<string>();\nconst error = ref<boolean>(false);\nconst seasonalReady = ref<boolean>(false);\n\nconst isMounted = ref<boolean>(false);\n\nconst customImageRef = useTemplateRef<HTMLImageElement>('customImageRef');\n\nconst logoOptions = useLogoOptions();\n\nconst externalSource = computed<string | undefined>(() => {\n if (src)\n return src;\n\n const url = get(resolvedUrl);\n if (!url || uniqueKey === undefined)\n return url;\n\n return `${url}${url.includes('?') ? '&' : '?'}key=${uniqueKey}`;\n});\n\nconst showCustom = computed<boolean>(() => !!src || (!!get(externalSource) && get(seasonalReady) && !get(error)));\n\nfunction preloadImage(url: string): void {\n const existing = document.head.querySelectorAll<HTMLLinkElement>('link[rel=\"preload\"][as=\"image\"]');\n for (const link of existing) {\n if (link.href === url)\n return;\n }\n\n const link = document.createElement('link');\n link.rel = 'preload';\n link.as = 'image';\n link.href = url;\n document.head.appendChild(link);\n}\n\nasync function callResolver(name: string): Promise<string | undefined> {\n try {\n return await logoOptions?.resolve(name);\n }\n catch {\n // A failing resolver leaves the bundled logo in place\n return undefined;\n }\n}\n\n/**\n * Asks the app's resolver for the logo URL. It runs only after mount, so the\n * server and the client's first render both show the bundled fallback (or\n * `src`) and hydration matches.\n */\nasync function resolveLogo(): Promise<void> {\n if (!get(isMounted))\n return;\n\n if (src || !logo || !logoOptions) {\n set(resolvedUrl, undefined);\n return;\n }\n\n const name = logo;\n const url = await callResolver(name);\n\n // The logo prop changed while the resolver ran; that newer run wins\n if (name !== logo)\n return;\n\n set(error, false);\n // A URL that already decoded in this session is shown without waiting for it again\n set(seasonalReady, !!url && getVerifiedLogoUrl(name) === url);\n set(resolvedUrl, url);\n\n const source = get(externalSource);\n if (source)\n preloadImage(source);\n}\n\nfunction onImageError(): void {\n set(error, true);\n if (logo)\n removeVerifiedLogoUrl(logo);\n}\n\nfunction onImageLoaded(): void {\n const img = get(customImageRef);\n if (!img)\n return;\n\n img.decode()\n .then(() => {\n set(seasonalReady, true);\n // Remember the decoded URL so the next page load can trust it immediately\n const url = get(resolvedUrl);\n if (url && logo)\n setVerifiedLogoUrl(logo, url);\n })\n .catch(() => set(error, true));\n}\n\nwatch(() => get(customImageRef)?.complete, (complete) => {\n if (complete)\n onImageLoaded();\n});\n\nwatchEffect(resolveLogo);\n\nonMounted(() => {\n set(isMounted, true);\n});\n</script>\n\n<template>\n <div\n class=\"gap-x-4 flex items-center relative\"\n :style=\"{ height: `${size}rem` }\"\n >\n <div\n class=\"relative\"\n :style=\"{ width: `${size}rem`, height: `${size}rem` }\"\n >\n <!-- Fallback: always in DOM, fades out when custom image is ready -->\n <img\n :src=\"fallback\"\n :alt=\"appName\"\n data-image=\"fallback\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-0' : 'opacity-100'\"\n />\n\n <!-- Custom/seasonal image: fades in when decoded -->\n <img\n v-if=\"externalSource && !error\"\n ref=\"customImageRef\"\n :src=\"externalSource\"\n :alt=\"appName\"\n data-image=\"custom\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-100' : 'opacity-0 pointer-events-none'\"\n @error=\"onImageError()\"\n @load=\"onImageLoaded()\"\n />\n </div>\n\n <div\n v-if=\"text\"\n class=\"text-h4 text-rui-primary dark:text-rui-text\"\n >\n {{ appName }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAM,UAAU;;;;;;;;;;;;;;;EAEhB,MAAM,cAAc,IAAY;EAChC,MAAM,QAAQ,IAAa,KAAK;EAChC,MAAM,gBAAgB,IAAa,KAAK;EAExC,MAAM,YAAY,IAAa,KAAK;EAEpC,MAAM,iBAAiB,eAAiC,gBAAgB;EAExE,MAAM,cAAc,eAAe;EAEnC,MAAM,iBAAiB,eAAmC;GACxD,IAAI,QAAA,KACF,OAAO,QAAA;GAET,MAAM,MAAM,IAAI,WAAW;GAC3B,IAAI,CAAC,OAAO,QAAA,cAAc,KAAA,GACxB,OAAO;GAET,OAAO,GAAG,MAAM,IAAI,SAAS,GAAG,IAAI,MAAM,IAAI,MAAM,QAAA;EACtD,CAAC;EAED,MAAM,aAAa,eAAwB,CAAC,CAAC,QAAA,OAAQ,CAAC,CAAC,IAAI,cAAc,KAAK,IAAI,aAAa,KAAK,CAAC,IAAI,KAAK,CAAE;EAEhH,SAAS,aAA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AY,WAAW;EAEvB,gBAAgB;GACd,IAAI,WAAW,IAAI;EACrB,CAAC;;GAIC,OAAAA,UAAA,GAAAC,mBAqCM,OAAA;IApCJ,OAAM;IACL,OAAKC,eAAA,EAAA,QAAA,GAAe,QAAA,KAAI,KAAA,CAAA;GAEzBC,GAAAA,CAAAA,mBAyBM,OAAA;IAxBJ,OAAM;IACL,OAAKD,eAAA;KAAA,OAAA,GAAc,QAAA,KAAI;KAAA,QAAA,GAAkB,QAAA,KAAI;IAAA,CAAA;GAG9CC,GAAAA,CAAAA,mBAME,OAAA;IALC,KAAKC,MAAAC,YAAA;IACL,KAAK;IACN,cAAW;IACX,OAAKC,eAAA,CAAC,mEACEF,MAAA,UAAA,IAAU,cAAA,aAAA,CAAA;GAKZA,GAAAA,MAAAA,IAAAA,UAAAA,GAAAA,MAAA,cAAA,KAAc,CAAKA,MAAA,KAAA,KAD3BJ,UAAA,GAAAC,mBAUE,OAAA;;IARI,SAAA;IAAJ,KAAI;IACH,KAAKG,MAAA,cAAA;IACL,KAAK;IACN,cAAW;IACX,OAAKE,eAAA,CAAC,mEACEF,MAAA,UAAA,IAAU,gBAAA,+BAAA,CAAA;IACjB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,aAAY;IACnB,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,cAAa;GAKhB,GAAA,MAAA,IAAA,UAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA,GAAA,QAAA,QADRJ,UAAA,GAAAC,mBAKM,OALN,YAKMO,gBADD,OAAO,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"RuiLogo.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_createElementVNode","_unref","fallback","_normalizeClass","_createCommentVNode","_toDisplayString"],"sources":["../../../src/components/logos/RuiLogo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport fallback from '@/components/logos/logo.svg';\nimport { getVerifiedLogoUrl, removeVerifiedLogoUrl, setVerifiedLogoUrl } from '@/components/logos/verified-logo';\nimport { useLogoOptions } from '@/composables/defaults/logo';\n\nexport interface Props {\n text?: boolean;\n /**\n * Name handed to the `logo.resolve` option of `createRui`. Without a resolver\n * the bundled logo shows.\n */\n logo?: string;\n size?: string | number; // in rems\n /**\n * Appended to the resolved URL as `key`, so each instance loads its own copy.\n */\n uniqueKey?: string | number;\n src?: string;\n}\n\ndefineOptions({\n name: 'RuiLogo',\n});\n\nconst { text = false, logo, size = 3, uniqueKey, src } = defineProps<Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>>();\n\nconst appName = 'rotki';\n\nconst resolvedUrl = ref<string>();\nconst error = ref<boolean>(false);\nconst seasonalReady = ref<boolean>(false);\n\nconst isMounted = ref<boolean>(false);\n\nconst customImageRef = useTemplateRef<HTMLImageElement>('customImageRef');\n\nconst logoOptions = useLogoOptions();\n\nconst externalSource = computed<string | undefined>(() => {\n if (src)\n return src;\n\n const url = get(resolvedUrl);\n if (!url || uniqueKey === undefined)\n return url;\n\n return `${url}${url.includes('?') ? '&' : '?'}key=${uniqueKey}`;\n});\n\nconst showCustom = computed<boolean>(() => !!src || (!!get(externalSource) && get(seasonalReady) && !get(error)));\n\nfunction preloadImage(url: string): void {\n const existing = document.head.querySelectorAll<HTMLLinkElement>('link[rel=\"preload\"][as=\"image\"]');\n for (const link of existing) {\n if (link.href === url)\n return;\n }\n\n const link = document.createElement('link');\n link.rel = 'preload';\n link.as = 'image';\n link.href = url;\n document.head.appendChild(link);\n}\n\nasync function callResolver(name: string): Promise<string | undefined> {\n try {\n return await logoOptions?.resolve(name);\n }\n catch {\n // A failing resolver leaves the bundled logo in place\n return undefined;\n }\n}\n\n/**\n * Asks the app's resolver for the logo URL. It runs only after mount, so the\n * server and the client's first render both show the bundled fallback (or\n * `src`) and hydration matches.\n */\nasync function resolveLogo(): Promise<void> {\n if (!get(isMounted))\n return;\n\n if (src || !logo || !logoOptions) {\n set(resolvedUrl, undefined);\n return;\n }\n\n const name = logo;\n const url = await callResolver(name);\n\n // The logo prop changed while the resolver ran; that newer run wins\n if (name !== logo)\n return;\n\n set(error, false);\n // A URL that already decoded in this session is shown without waiting for it again\n set(seasonalReady, !!url && getVerifiedLogoUrl(name) === url);\n set(resolvedUrl, url);\n\n const source = get(externalSource);\n if (source)\n preloadImage(source);\n}\n\nfunction onImageError(): void {\n set(error, true);\n if (logo)\n removeVerifiedLogoUrl(logo);\n}\n\nfunction onImageLoaded(): void {\n const img = get(customImageRef);\n if (!img)\n return;\n\n img.decode()\n .then(() => {\n set(seasonalReady, true);\n // Remember the decoded URL so the next page load can trust it immediately\n const url = get(resolvedUrl);\n if (url && logo)\n setVerifiedLogoUrl(logo, url);\n })\n .catch(() => set(error, true));\n}\n\nwatch(() => get(customImageRef)?.complete, (complete) => {\n if (complete)\n onImageLoaded();\n});\n\nwatchEffect(resolveLogo);\n\nonMounted(() => {\n set(isMounted, true);\n});\n</script>\n\n<template>\n <div\n class=\"gap-x-4 flex items-center relative\"\n :style=\"{ height: `${size}rem` }\"\n >\n <div\n class=\"relative\"\n :style=\"{ width: `${size}rem`, height: `${size}rem` }\"\n >\n <!-- Fallback: always in DOM, fades out when custom image is ready -->\n <img\n :src=\"fallback\"\n :alt=\"appName\"\n data-image=\"fallback\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-0' : 'opacity-100'\"\n />\n\n <!-- Custom/seasonal image: fades in when decoded -->\n <img\n v-if=\"externalSource && !error\"\n ref=\"customImageRef\"\n :src=\"externalSource\"\n :alt=\"appName\"\n data-image=\"custom\"\n class=\"absolute inset-0 h-full w-full transition ease-out duration-200\"\n :class=\"showCustom ? 'opacity-100' : 'opacity-0 pointer-events-none'\"\n @error=\"onImageError()\"\n @load=\"onImageLoaded()\"\n />\n </div>\n\n <div\n v-if=\"text\"\n class=\"text-h4 text-rui-primary dark:text-r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A;;IARI,SAAA;IAAJ,KAAI;IACH,KAAKG,MAAA,cAAA;IACL,KAAK;IACN,cAAW;IACX,OAAKE,eAAA,CAAC,mEACEF,MAAA,UAAA,IAAU,gBAAA,+BAAA,CAAA;IACjB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,aAAY;IACnB,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,cAAa;GAKhB,GAAA,MAAA,IAAA,UAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA,GAAA,QAAA,QADRJ,UAAA,GAAAC,mBAKM,OALN,YAKMO,gBADD,OAAO,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiBadge.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/badge/RuiBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { BadgePlacement, BadgeRounded, BadgeSize } from '@/components/overlays/badge/badge-props';\nimport { badgeStyles } from './badge-styles';\n\ntype PosConfig = [left: number, right: string, edge: string, center: number];\n\nexport interface Props {\n text?: string | null;\n icon?: RuiIcons | null;\n modelValue?: boolean;\n dot?: boolean;\n left?: boolean;\n offsetX?: string | number;\n offsetY?: string | number;\n placement?: BadgePlacement;\n size?: BadgeSize;\n rounded?: BadgeRounded;\n color?: 'default' | ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiBadge',\n});\n\nconst {\n text = null,\n icon = null,\n modelValue = true,\n dot = false,\n placement = BadgePlacement.top,\n left = false,\n size = BadgeSize.md,\n rounded = BadgeRounded.full,\n color = 'primary',\n offsetX = 0,\n offsetY = 0,\n} = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => any;\n badge?: () => any;\n icon?: () => any;\n}>();\n\nconst hasText = computed<boolean>(() => !!text || !!slots.badge);\n\nconst hasIconAndText = computed<boolean>(() => (!!icon || !!slots.icon) && get(hasText));\n\nconst ui = computed<ReturnType<typeof badgeStyles>>(() => badgeStyles({\n color,\n size,\n rounded,\n dot,\n iconOnly: (!!icon || !!slots.icon) && !get(hasText),\n}));\n\n/** Dot positions as [leftOffset, rightBase, edgeBase, centerOffset]; a dot's center sits on the corner, so each size moves by half its diameter. */\nconst DOT_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.25, '100% - 0.25rem', '100% - 0.25rem', 0.25],\n md: [-0.3125, '100% - 0.3125rem', '100% - 0.3125rem', 0.3125],\n lg: [-0.375, '100% - 0.375rem', '100% - 0.375rem', 0.375],\n};\nconst BADGE_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.85, '100% - 0.375rem', '100% - 0.375rem', 0.55],\n md: [-0.95, '100% - 0.5rem', '100% - 0.5rem', 0.65],\n lg: [-1.05, '100% - 0.5rem', '100% - 0.5rem', 0.75],\n};\n\nconst positionStyle = computed<Record<string, string>>(() => {\n const ox = Number(offsetX) * 0.0625;\n const oy = Number(offsetY) * 0.0625;\n const [l, r, edge, center] = dot ? DOT_POS[size] : BADGE_POS[size];\n\n const horizontal = `calc(${left ? `${l}rem` : r} + ${ox}rem)`;\n const vertical = placement === 'center'\n ? `calc(50% - ${center}rem - ${oy}rem)`\n : `calc(${edge} - ${oy}rem)`;\n\n return {\n left: horizontal,\n [placement === 'top' ? 'bottom' : 'top']: vertical,\n };\n});\n</script>\n\n<template>\n <div :class=\"ui.wrapper()\">\n <slot />\n <!-- under reduced motion the badge appears and leaves at full size, with no scale -->\n <Transition\n appear\n enter-active-class=\"transition-[scale] ease-out duration-200 motion-reduce:transition-none\"\n enter-from-class=\"scale-0 motion-reduce:scale-100\"\n enter-to-class=\"scale-100\"\n leave-active-class=\"transition-[scale] ease-in duration-150 motion-reduce:transition-none\"\n leave-from-class=\"scale-100\"\n leave-to-class=\"scale-0 motion-reduce:scale-100\"\n >\n <div\n v-if=\"modelValue\"\n :class=\"ui.badge()\"\n :style=\"positionStyle\"\n :data-placement=\"placement\"\n :data-dot=\"dot || undefined\"\n :data-left=\"left || undefined\"\n aria-atomic=\"true\"\n aria-live=\"polite\"\n role=\"status\"\n >\n <!-- no aria-label: on a live region it replaced the count, so a reader announced \"Badge\" -->\n <span\n v-if=\"!dot\"\n :class=\"ui.content({ class: hasIconAndText ? 'px-2' : undefined })\"\n >\n <slot name=\"badge\">\n {{ text }}\n </slot>\n <slot name=\"icon\">\n <RuiIcon\n v-if=\"icon\"\n :name=\"icon\"\n />\n </slot>\n </span>\n </div>\n </Transition>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiBadge.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/badge/RuiBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { BadgePlacement, BadgeRounded, BadgeSize } from '@/components/overlays/badge/badge-props';\nimport { badgeStyles } from './badge-styles';\n\ntype PosConfig = [left: number, right: string, edge: string, center: number];\n\nexport interface Props {\n text?: string | null;\n icon?: RuiIcons | null;\n modelValue?: boolean;\n dot?: boolean;\n left?: boolean;\n offsetX?: string | number;\n offsetY?: string | number;\n placement?: BadgePlacement;\n size?: BadgeSize;\n rounded?: BadgeRounded;\n color?: 'default' | ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiBadge',\n});\n\nconst {\n text = null,\n icon = null,\n modelValue = true,\n dot = false,\n placement = BadgePlacement.top,\n left = false,\n size = BadgeSize.md,\n rounded = BadgeRounded.full,\n color = 'primary',\n offsetX = 0,\n offsetY = 0,\n} = defineProps<Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>>();\n\nconst slots = defineSlots<{\n default?: () => any;\n badge?: () => any;\n icon?: () => any;\n}>();\n\nconst hasText = computed<boolean>(() => !!text || !!slots.badge);\n\nconst hasIconAndText = computed<boolean>(() => (!!icon || !!slots.icon) && get(hasText));\n\nconst ui = computed<ReturnType<typeof badgeStyles>>(() => badgeStyles({\n color,\n size,\n rounded,\n dot,\n iconOnly: (!!icon || !!slots.icon) && !get(hasText),\n}));\n\n/** Dot positions as [leftOffset, rightBase, edgeBase, centerOffset]; a dot's center sits on the corner, so each size moves by half its diameter. */\nconst DOT_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.25, '100% - 0.25rem', '100% - 0.25rem', 0.25],\n md: [-0.3125, '100% - 0.3125rem', '100% - 0.3125rem', 0.3125],\n lg: [-0.375, '100% - 0.375rem', '100% - 0.375rem', 0.375],\n};\nconst BADGE_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.85, '100% - 0.375rem', '100% - 0.375rem', 0.55],\n md: [-0.95, '100% - 0.5rem', '100% - 0.5rem', 0.65],\n lg: [-1.05, '100% - 0.5rem', '100% - 0.5rem', 0.75],\n};\n\nconst positionStyle = computed<Record<string, string>>(() => {\n const ox = Number(offsetX) * 0.0625;\n const oy = Number(offsetY) * 0.0625;\n const [l, r, edge, center] = dot ? DOT_POS[size] : BADGE_POS[size];\n\n const horizontal = `calc(${left ? `${l}rem` : r} + ${ox}rem)`;\n const vertical = placement === 'center'\n ? `calc(50% - ${center}rem - ${oy}rem)`\n : `calc(${edge} - ${oy}rem)`;\n\n return {\n left: horizontal,\n [placement === 'top' ? 'bottom' : 'top']: vertical,\n };\n});\n</script>\n\n<template>\n <div :class=\"ui.wrapper()\">\n <slot />\n <!-- under reduced motion the badge appears and leaves at full size, with no scale -->\n <Transition\n appear\n enter-active-class=\"transition-[scale] ease-out duration-200 motion-reduce:transition-none\"\n enter-from-class=\"scale-0 motion-reduce:scale-100\"\n enter-to-class=\"scale-100\"\n leave-active-class=\"transition-[scale] ease-in duration-150 motion-reduce:transition-none\"\n leave-from-class=\"scale-100\"\n leave-to-class=\"scale-0 motion-reduce:scale-100\"\n >\n <div\n v-if=\"modelValue\"\n :class=\"ui.badge()\"\n :style=\"positionStyle\"\n :data-placement=\"placement\"\n :data-dot=\"dot || undefined\"\n :data-left=\"left || undefined\"\n aria-atomic=\"true\"\n aria-live=\"polite\"\n role=\"status\"\n >\n <!-- no aria-label: on a live region it replaced the count, so a reader announced \"Badge\" -->\n <span\n v-if=\"!dot\"\n :class=\"ui.content({ class: hasIconAndText ? 'px-2' : undefined })\"\n >\n <slot name=\"badge\">\n {{ text }}\n </slot>\n <slot name=\"icon\">\n <RuiIcon\n v-if=\"icon\"\n :name=\"icon\"\n />\n </slot>\n </span>\n </div>\n </Transition>\n </div>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from 'vue';
1
2
  import type { ContextColorsType } from '../../../consts/colors.js';
2
3
  import type { RuiIcons } from '../../../icons/index.js';
3
4
  import { BadgePlacement, BadgeRounded, BadgeSize } from './badge-props.js';
@@ -14,12 +15,13 @@ export interface Props {
14
15
  rounded?: BadgeRounded;
15
16
  color?: 'default' | ContextColorsType;
16
17
  }
18
+ type __VLS_Props = Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>;
17
19
  type __VLS_Slots = {
18
20
  default?: () => any;
19
21
  badge?: () => any;
20
22
  icon?: () => any;
21
23
  };
22
- declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
24
26
  declare const _default: typeof __VLS_export;
25
27
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RuiBadge.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_unref","_renderSlot","_createVNode","_Transition","_withCtx","_normalizeStyle","_createTextVNode","_toDisplayString","_createBlock","RuiIcon","_createCommentVNode"],"sources":["../../../../src/components/overlays/badge/RuiBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { BadgePlacement, BadgeRounded, BadgeSize } from '@/components/overlays/badge/badge-props';\nimport { badgeStyles } from './badge-styles';\n\ntype PosConfig = [left: number, right: string, edge: string, center: number];\n\nexport interface Props {\n text?: string | null;\n icon?: RuiIcons | null;\n modelValue?: boolean;\n dot?: boolean;\n left?: boolean;\n offsetX?: string | number;\n offsetY?: string | number;\n placement?: BadgePlacement;\n size?: BadgeSize;\n rounded?: BadgeRounded;\n color?: 'default' | ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiBadge',\n});\n\nconst {\n text = null,\n icon = null,\n modelValue = true,\n dot = false,\n placement = BadgePlacement.top,\n left = false,\n size = BadgeSize.md,\n rounded = BadgeRounded.full,\n color = 'primary',\n offsetX = 0,\n offsetY = 0,\n} = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => any;\n badge?: () => any;\n icon?: () => any;\n}>();\n\nconst hasText = computed<boolean>(() => !!text || !!slots.badge);\n\nconst hasIconAndText = computed<boolean>(() => (!!icon || !!slots.icon) && get(hasText));\n\nconst ui = computed<ReturnType<typeof badgeStyles>>(() => badgeStyles({\n color,\n size,\n rounded,\n dot,\n iconOnly: (!!icon || !!slots.icon) && !get(hasText),\n}));\n\n/** Dot positions as [leftOffset, rightBase, edgeBase, centerOffset]; a dot's center sits on the corner, so each size moves by half its diameter. */\nconst DOT_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.25, '100% - 0.25rem', '100% - 0.25rem', 0.25],\n md: [-0.3125, '100% - 0.3125rem', '100% - 0.3125rem', 0.3125],\n lg: [-0.375, '100% - 0.375rem', '100% - 0.375rem', 0.375],\n};\nconst BADGE_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.85, '100% - 0.375rem', '100% - 0.375rem', 0.55],\n md: [-0.95, '100% - 0.5rem', '100% - 0.5rem', 0.65],\n lg: [-1.05, '100% - 0.5rem', '100% - 0.5rem', 0.75],\n};\n\nconst positionStyle = computed<Record<string, string>>(() => {\n const ox = Number(offsetX) * 0.0625;\n const oy = Number(offsetY) * 0.0625;\n const [l, r, edge, center] = dot ? DOT_POS[size] : BADGE_POS[size];\n\n const horizontal = `calc(${left ? `${l}rem` : r} + ${ox}rem)`;\n const vertical = placement === 'center'\n ? `calc(50% - ${center}rem - ${oy}rem)`\n : `calc(${edge} - ${oy}rem)`;\n\n return {\n left: horizontal,\n [placement === 'top' ? 'bottom' : 'top']: vertical,\n };\n});\n</script>\n\n<template>\n <div :class=\"ui.wrapper()\">\n <slot />\n <!-- under reduced motion the badge appears and leaves at full size, with no scale -->\n <Transition\n appear\n enter-active-class=\"transition-[scale] ease-out duration-200 motion-reduce:transition-none\"\n enter-from-class=\"scale-0 motion-reduce:scale-100\"\n enter-to-class=\"scale-100\"\n leave-active-class=\"transition-[scale] ease-in duration-150 motion-reduce:transition-none\"\n leave-from-class=\"scale-100\"\n leave-to-class=\"scale-0 motion-reduce:scale-100\"\n >\n <div\n v-if=\"modelValue\"\n :class=\"ui.badge()\"\n :style=\"positionStyle\"\n :data-placement=\"placement\"\n :data-dot=\"dot || undefined\"\n :data-left=\"left || undefined\"\n aria-atomic=\"true\"\n aria-live=\"polite\"\n role=\"status\"\n >\n <!-- no aria-label: on a live region it replaced the count, so a reader announced \"Badge\" -->\n <span\n v-if=\"!dot\"\n :class=\"ui.content({ class: hasIconAndText ? 'px-2' : undefined })\"\n >\n <slot name=\"badge\">\n {{ text }}\n </slot>\n <slot name=\"icon\">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zB,OAAO;IACL,MAAM;KACL,QAAA,cAAc,QAAQ,WAAW,QAAQ;GAC5C;EACF,CAAC;;GAIC,OAAAC,UAAA,GAAAC,mBAwCM,OAAA,EAxCA,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,QAAO,CAAA,EAAA,GAAA,CACrBC,WAAQ,KAAA,QAAA,SAAA,GAERC,YAoCaC,YAAA;IAnCX,QAAA;IACA,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;IACf,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;;IAEf,SAAAC,cA0BM,CAzBE,QAAA,cADRP,UAAA,GAAAC,mBA0BM,OAAA;;KAxBH,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,MAAK,CAAA;KACf,OAAKK,eAAEL,MAAA,aAAA,CAAa;KACpB,kBAAgB,QAAA;KAChB,YAAU,QAAA,OAAO,KAAA;KACjB,aAAW,QAAA,QAAQ,KAAA;KACpB,eAAY;KACZ,aAAU;KACV,MAAK;IAII,GAAA,CAAA,CAAA,QAAA,OADTH,UAAA,GAAAC,mBAaO,QAAA;;KAXJ,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,QAAO,EAAA,OAAUA,MAAA,cAAA,IAAc,SAAY,KAAA,EAAS,CAAA,CAAA;IAE/DC,GAAAA,CAAAA,WAEO,KAAA,QAAA,SAAA,CAAA,SAAA,CADFK,gBAAAC,gBAAA,QAAA,IAAI,GAAA,CAAA,CAAA,CAAA,GAETN,WAKO,KAAA,QAAA,QAAA,CAAA,SAAA,CAHG,QAAA,QADRJ,UAAA,GAAAW,YAGEC,iBAAA;;KADC,MAAM,QAAA"}
1
+ {"version":3,"file":"RuiBadge.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_unref","_renderSlot","_createVNode","_Transition","_withCtx","_normalizeStyle","_createTextVNode","_toDisplayString","_createBlock","RuiIcon","_createCommentVNode"],"sources":["../../../../src/components/overlays/badge/RuiBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { RuiIcons } from '@/icons';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { BadgePlacement, BadgeRounded, BadgeSize } from '@/components/overlays/badge/badge-props';\nimport { badgeStyles } from './badge-styles';\n\ntype PosConfig = [left: number, right: string, edge: string, center: number];\n\nexport interface Props {\n text?: string | null;\n icon?: RuiIcons | null;\n modelValue?: boolean;\n dot?: boolean;\n left?: boolean;\n offsetX?: string | number;\n offsetY?: string | number;\n placement?: BadgePlacement;\n size?: BadgeSize;\n rounded?: BadgeRounded;\n color?: 'default' | ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiBadge',\n});\n\nconst {\n text = null,\n icon = null,\n modelValue = true,\n dot = false,\n placement = BadgePlacement.top,\n left = false,\n size = BadgeSize.md,\n rounded = BadgeRounded.full,\n color = 'primary',\n offsetX = 0,\n offsetY = 0,\n} = defineProps<Props & /* @vue-ignore */ Omit<HTMLAttributes, keyof Props>>();\n\nconst slots = defineSlots<{\n default?: () => any;\n badge?: () => any;\n icon?: () => any;\n}>();\n\nconst hasText = computed<boolean>(() => !!text || !!slots.badge);\n\nconst hasIconAndText = computed<boolean>(() => (!!icon || !!slots.icon) && get(hasText));\n\nconst ui = computed<ReturnType<typeof badgeStyles>>(() => badgeStyles({\n color,\n size,\n rounded,\n dot,\n iconOnly: (!!icon || !!slots.icon) && !get(hasText),\n}));\n\n/** Dot positions as [leftOffset, rightBase, edgeBase, centerOffset]; a dot's center sits on the corner, so each size moves by half its diameter. */\nconst DOT_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.25, '100% - 0.25rem', '100% - 0.25rem', 0.25],\n md: [-0.3125, '100% - 0.3125rem', '100% - 0.3125rem', 0.3125],\n lg: [-0.375, '100% - 0.375rem', '100% - 0.375rem', 0.375],\n};\nconst BADGE_POS: Record<BadgeSize, PosConfig> = {\n sm: [-0.85, '100% - 0.375rem', '100% - 0.375rem', 0.55],\n md: [-0.95, '100% - 0.5rem', '100% - 0.5rem', 0.65],\n lg: [-1.05, '100% - 0.5rem', '100% - 0.5rem', 0.75],\n};\n\nconst positionStyle = computed<Record<string, string>>(() => {\n const ox = Number(offsetX) * 0.0625;\n const oy = Number(offsetY) * 0.0625;\n const [l, r, edge, center] = dot ? DOT_POS[size] : BADGE_POS[size];\n\n const horizontal = `calc(${left ? `${l}rem` : r} + ${ox}rem)`;\n const vertical = placement === 'center'\n ? `calc(50% - ${center}rem - ${oy}rem)`\n : `calc(${edge} - ${oy}rem)`;\n\n return {\n left: horizontal,\n [placement === 'top' ? 'bottom' : 'top']: vertical,\n };\n});\n</script>\n\n<template>\n <div :class=\"ui.wrapper()\">\n <slot />\n <!-- under reduced motion the badge appears and leaves at full size, with no scale -->\n <Transition\n appear\n enter-active-class=\"transition-[scale] ease-out duration-200 motion-reduce:transition-none\"\n enter-from-class=\"scale-0 motion-reduce:scale-100\"\n enter-to-class=\"scale-100\"\n leave-active-class=\"transition-[scale] ease-in duration-150 motion-reduce:transition-none\"\n leave-from-class=\"scale-100\"\n leave-to-class=\"scale-0 motion-reduce:scale-100\"\n >\n <div\n v-if=\"modelValue\"\n :class=\"ui.badge()\"\n :style=\"positionStyle\"\n :data-placement=\"placement\"\n :data-dot=\"dot || undefined\"\n :data-left=\"left || undefined\"\n aria-atomic=\"true\"\n aria-live=\"polite\"\n role=\"status\"\n >\n <!-- no aria-label: on a live region it replaced the count, so a reader announced \"Badge\" -->\n <span\n v-if=\"!dot\"\n :class=\"ui.content({ class: hasIconAndText ? 'px-2' : undefined })\"\n >\n <slot name=\"badge\">\n {{ text }}\n </slot>\n <slot name=\"icon\">\n <RuiIcon\n v-if=\"icon\"\n :name=\"icon\"\n />\n </slot>\n </span>\n </div>\n </Transition>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQA,SAAA;EAMd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,CAAA,EAAA,GAAA,CACrBC,WAAQ,KAAA,QAAA,SAAA,GAERC,YAoCaC,YAAA;IAnCX,QAAA;IACA,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;IACf,sBAAmB;IACnB,oBAAiB;IACjB,kBAAe;;IAEf,SAAAC,cA0BM,CAzBE,QAAA,cADRP,UAAA,GAAAC,mBA0BM,OAAA;;KAxBH,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,MAAK,CAAA;KACf,OAAKK,eAAEL,MAAA,aAAA,CAAa;KACpB,kBAAgB,QAAA;KAChB,YAAU,QAAA,OAAO,KAAA;KACjB,aAAW,QAAA,QAAQ,KAAA;KACpB,eAAY;KACZ,aAAU;KACV,MAAK;IAII,GAAA,CAAA,CAAA,QAAA,OADTH,UAAA,GAAAC,mBAaO,QAAA;;KAXJ,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,QAAO,EAAA,OAAUA,MAAA,cAAA,IAAc,SAAY,KAAA,EAAS,CAAA,CAAA;IAE/DC,GAAAA,CAAAA,WAEO,KAAA,QAAA,SAAA,CAAA,SAAA,CADFK,gBAAAC,gBAAA,QAAA,IAAI,GAAA,CAAA,CAAA,CAAA,GAETN,WAKO,KAAA,QAAA,QAAA,CAAA,SAAA,CAHG,QAAA,QADRJ,UAAA,GAAAW,YAGEC,iBAAA;;KADC,MAAM,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiBottomSheet.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/bottom-sheet/RuiBottomSheet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport RuiDialog from '@/components/overlays/dialog/RuiDialog.vue';\n\n/** The sheet's props, which stay in step with RuiDialog's. */\nexport interface BottomSheetProps {\n persistent?: boolean;\n width?: string | number;\n maxWidth?: string | number;\n}\n\ndefineOptions({\n name: 'RuiBottomSheet',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst { persistent = false, width, maxWidth } = defineProps<BottomSheetProps>();\n</script>\n\n<template>\n <RuiDialog\n v-model=\"modelValue\"\n bottom-sheet\n v-bind=\"$attrs\"\n :persistent=\"persistent\"\n :width=\"width\"\n :max-width=\"maxWidth\"\n >\n <template\n v-for=\"slot in Object.keys($slots)\"\n #[slot]=\"scope\"\n >\n <slot\n v-bind=\"scope\"\n :name=\"slot\"\n />\n </template>\n </RuiDialog>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiBottomSheet.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/bottom-sheet/RuiBottomSheet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport RuiDialog, { type DialogSlots } from '@/components/overlays/dialog/RuiDialog.vue';\n\n/** The sheet's props, which stay in step with RuiDialog's. */\nexport interface BottomSheetProps {\n persistent?: boolean;\n width?: string | number;\n maxWidth?: string | number;\n}\n\n/**\n * What the sheet forwards to its RuiDialog through `$attrs`: the dialog's other props and its events\n * (`click:esc`, `click:outside`, `closed`, `dismiss`), besides the HTML attributes.\n */\ntype DialogAttributes = Omit<InstanceType<typeof RuiDialog>['$props'], keyof BottomSheetProps | 'bottomSheet' | 'modelValue' | 'onUpdate:modelValue'>;\n\ndefineOptions({\n name: 'RuiBottomSheet',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst { persistent = false, width, maxWidth } = defineProps<BottomSheetProps & /* @vue-ignore */ DialogAttributes>();\n\ndefineSlots<{\n activator?: DialogSlots['activator'];\n default?: DialogSlots['default'];\n}>();\n</script>\n\n<template>\n <RuiDialog\n v-model=\"modelValue\"\n bottom-sheet\n v-bind=\"$attrs\"\n :persistent=\"persistent\"\n :width=\"width\"\n :max-width=\"maxWidth\"\n >\n <template #activator=\"scope\">\n <slot\n name=\"activator\"\n v-bind=\"scope\"\n />\n </template>\n <template #default=\"scope\">\n <slot v-bind=\"scope\" />\n </template>\n </RuiDialog>\n</template>\n"],"mappings":""}
@@ -1,18 +1,24 @@
1
+ import RuiDialog, { type DialogSlots } from '../dialog/RuiDialog.vue.js';
1
2
  /** The sheet's props, which stay in step with RuiDialog's. */
2
3
  export interface BottomSheetProps {
3
4
  persistent?: boolean;
4
5
  width?: string | number;
5
6
  maxWidth?: string | number;
6
7
  }
7
- type __VLS_Props = BottomSheetProps;
8
+ /**
9
+ * What the sheet forwards to its RuiDialog through `$attrs`: the dialog's other props and its events
10
+ * (`click:esc`, `click:outside`, `closed`, `dismiss`), besides the HTML attributes.
11
+ */
12
+ type DialogAttributes = Omit<InstanceType<typeof RuiDialog>['$props'], keyof BottomSheetProps | 'bottomSheet' | 'modelValue' | 'onUpdate:modelValue'>;
13
+ type __VLS_Props = BottomSheetProps & /* @vue-ignore */ DialogAttributes;
14
+ type __VLS_Slots = {
15
+ activator?: DialogSlots['activator'];
16
+ default?: DialogSlots['default'];
17
+ };
8
18
  type __VLS_ModelProps = {
9
19
  modelValue?: boolean;
10
20
  };
11
21
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
- declare var __VLS_10: string, __VLS_11: any;
13
- type __VLS_Slots = {} & {
14
- [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
15
- };
16
22
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
23
  "update:modelValue": (value: boolean) => any;
18
24
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
@@ -1,5 +1,5 @@
1
1
  import RuiDialog_default from "../dialog/RuiDialog.js";
2
- import { createBlock, createSlots, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, openBlock, renderList, renderSlot, useModel, withCtx } from "vue";
2
+ import { createBlock, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, openBlock, renderSlot, useModel, withCtx } from "vue";
3
3
  //#region src/components/overlays/bottom-sheet/RuiBottomSheet.vue?vue&type=script&setup=true&lang.ts
4
4
  var RuiBottomSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
5
5
  name: "RuiBottomSheet",
@@ -31,12 +31,11 @@ var RuiBottomSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
31
31
  persistent: __props.persistent,
32
32
  width: __props.width,
33
33
  "max-width": __props.maxWidth
34
- }), createSlots({ _: 2 }, [renderList(Object.keys(_ctx.$slots), (slot) => {
35
- return {
36
- name: slot,
37
- fn: withCtx((scope) => [renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(scope)))])
38
- };
39
- })]), 1040, [
34
+ }), {
35
+ activator: withCtx((scope) => [renderSlot(_ctx.$slots, "activator", normalizeProps(guardReactiveProps(scope)))]),
36
+ default: withCtx((scope) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))]),
37
+ _: 3
38
+ }, 16, [
40
39
  "modelValue",
41
40
  "persistent",
42
41
  "width",
@@ -1 +1 @@
1
- {"version":3,"file":"RuiBottomSheet.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_openBlock","_createBlock","RuiDialog","_mergeProps","_createSlots","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"sources":["../../../../src/components/overlays/bottom-sheet/RuiBottomSheet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport RuiDialog from '@/components/overlays/dialog/RuiDialog.vue';\n\n/** The sheet's props, which stay in step with RuiDialog's. */\nexport interface BottomSheetProps {\n persistent?: boolean;\n width?: string | number;\n maxWidth?: string | number;\n}\n\ndefineOptions({\n name: 'RuiBottomSheet',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst { persistent = false, width, maxWidth } = defineProps<BottomSheetProps>();\n</script>\n\n<template>\n <RuiDialog\n v-model=\"modelValue\"\n bottom-sheet\n v-bind=\"$attrs\"\n :persistent=\"persistent\"\n :width=\"width\"\n :max-width=\"maxWidth\"\n >\n <template\n v-for=\"slot in Object.keys($slots)\"\n #[slot]=\"scope\"\n >\n <slot\n v-bind=\"scope\"\n :name=\"slot\"\n />\n </template>\n </RuiDialog>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,aAAaE,SAAoB,SAAA,YAAmB;;GAMxD,OAAAC,UAAA,GAAAC,YAiBYC,mBAjBZC,WAiBY;IAhBD,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAU,QAAA;IACnB,gBAAA;GACQN,GAAAA,KAAAA,QAAM;IACb,YAAY,QAAA;IACZ,OAAO,QAAA;IACP,aAAW,QAAA;GAGKQ,CAAAA,GAAAA,YAAAA,EAAAA,GAAAA,EAAAA,GAAAA,CAAAA,WAAA,OAAO,KAAKP,KAAAA,MAAM,IAA1B,SAAI;;KACV,MAAA;KAED,IAAAQ,SAFS,UAAK,CAEdC,WAGE,KAAA,QADO,MAAIC,eAAAC,mBADH,KAAK,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"RuiBottomSheet.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createBlock","RuiDialog","_mergeProps","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"sources":["../../../../src/components/overlays/bottom-sheet/RuiBottomSheet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport RuiDialog, { type DialogSlots } from '@/components/overlays/dialog/RuiDialog.vue';\n\n/** The sheet's props, which stay in step with RuiDialog's. */\nexport interface BottomSheetProps {\n persistent?: boolean;\n width?: string | number;\n maxWidth?: string | number;\n}\n\n/**\n * What the sheet forwards to its RuiDialog through `$attrs`: the dialog's other props and its events\n * (`click:esc`, `click:outside`, `closed`, `dismiss`), besides the HTML attributes.\n */\ntype DialogAttributes = Omit<InstanceType<typeof RuiDialog>['$props'], keyof BottomSheetProps | 'bottomSheet' | 'modelValue' | 'onUpdate:modelValue'>;\n\ndefineOptions({\n name: 'RuiBottomSheet',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst { persistent = false, width, maxWidth } = defineProps<BottomSheetProps & /* @vue-ignore */ DialogAttributes>();\n\ndefineSlots<{\n activator?: DialogSlots['activator'];\n default?: DialogSlots['default'];\n}>();\n</script>\n\n<template>\n <RuiDialog\n v-model=\"modelValue\"\n bottom-sheet\n v-bind=\"$attrs\"\n :persistent=\"persistent\"\n :width=\"width\"\n :max-width=\"maxWidth\"\n >\n <template #activator=\"scope\">\n <slot\n name=\"activator\"\n v-bind=\"scope\"\n />\n </template>\n <template #default=\"scope\">\n <slot v-bind=\"scope\" />\n </template>\n </RuiDialog>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAqBA,MAAM,aAAaC,SAAoB,SAAA,YAAmB;;GAWxD,OAAAC,UAAA,GAAAC,YAiBYC,mBAjBZC,WAiBY;IAhBD,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAU,QAAA;IACnB,gBAAA;GACQL,GAAAA,KAAAA,QAAM;IACb,YAAY,QAAA;IACZ,OAAO,QAAA;IACP,aAAW,QAAA;;IAED,WAASM,SAAE,UAAK,CACzBC,WAGE,KAAA,QAAA,aAAAC,eAAAC,mBADQ,KAAK,CAAA,CAAA,CAAA,CAAA;IAGN,SAAOH,SAAE,UAAK,CACvBC,WAAuB,KAAA,QAAA,WAAAC,eAAAC,mBAAT,KAAK,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiDialog.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/dialog/RuiDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { DialogSize } from '@/consts/tokens';\nimport type { VueClassValue } from '@/types/class-value';\nimport { ButtonGroupBoundary } from '@/components/buttons/button-group/button-group-context';\nimport { useDismissableOverlay } from '@/composables/overlay-stack';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { getNonRootAttrs, getRootAttrs, transformPropsUnit } from '@/utils/helpers';\nimport { cn } from '@/utils/tv';\nimport { dialogStyles } from './dialog-styles';\n\nexport interface RuiDialogClassNames {\n root?: VueClassValue;\n content?: VueClassValue;\n}\n\nexport interface DialogProps {\n persistent?: boolean;\n width?: string | number;\n maxWidth?: string | number;\n /** A preset max width, `--rui-dialog-<size>`; an explicit `maxWidth` wins */\n size?: DialogSize;\n bottomSheet?: boolean;\n classNames?: RuiDialogClassNames;\n zIndex?: string | number;\n ariaLabel?: string;\n}\n\ndefineOptions({\n name: 'RuiDialog',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst {\n persistent = false,\n width = '98%',\n maxWidth,\n size,\n bottomSheet = false,\n classNames,\n zIndex = 'var(--rui-z-dialog)',\n ariaLabel,\n} = defineProps<DialogProps>();\n\nconst emit = defineEmits<{\n 'closed': [];\n 'click:outside': [];\n 'click:esc': [];\n /**\n * The overlay stack asked this dialog to go, which is what a back gesture\n * reaches it as. Closes unless persistent, like escape does, so a dialog that\n * has to ask before discarding should bind `persistent` and answer here.\n */\n 'dismiss': [];\n}>();\n\ndefineSlots<{\n activator?: (props: { attrs: { onClick: () => void }; isOpen: boolean }) => any;\n default?: (props: { isOpen: boolean; close: () => void }) => any;\n}>();\n\nconst transitioning = ref<boolean>(false);\nconst contentRef = useTemplateRef<HTMLDivElement>('contentRef');\n\nconst leaveTimeout = useTimeoutManager();\n\nconst alive = computed<boolean>(() => get(modelValue) || get(transitioning));\n\nconst style = computed<{ width: string | undefined; maxWidth: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n maxWidth: transformPropsUnit(maxWidth) ?? (size ? `var(--rui-dialog-${size})` : undefined),\n}));\n\nconst ui = computed<ReturnType<typeof dialogStyles>>(() => dialogStyles({ bottomSheet }));\n\nconst dialogAttrs: { onClick: () => void } = {\n onClick: toggle,\n};\n\nconst contentTransition = computed<Record<string, string>>(() => {\n if (!bottomSheet) {\n return {\n enterFromClass: 'opacity-0 scale-95',\n enterActiveClass: 'transition-all ease-out duration-200',\n enterToClass: 'opacity-100 scale-100',\n leaveFromClass: 'opacity-100 scale-100',\n leaveActiveClass: 'transition-all ease-in duration-150',\n leaveToClass: 'opacity-0 scale-95',\n };\n }\n\n return {\n enterFromClass: 'translate-y-full',\n enterActiveClass: 'transition-transform ease-out duration-300',\n enterToClass: 'translate-y-0',\n leaveFromClass: 'translate-y-0',\n leaveActiveClass: 'transition-transform ease-in duration-200',\n leaveToClass: 'translate-y-full',\n };\n});\n\nfunction toggle(): void {\n set(modelValue, !get(modelValue));\n}\n\nfunction close(): void {\n set(modelValue, false);\n}\n\n/**\n * Closes on Escape unless persistent, and reports the press as `click:esc`.\n *\n * @remarks\n * An Escape that arrives while an IME is composing belongs to the IME, which\n * cancels the candidate with it. The dialog leaves that key alone entirely: no\n * close, no `click:esc`, and no `stopPropagation`, so a search field inside the\n * dialog does not lose the dialog mid-word.\n */\nfunction onEscKeydown(event: KeyboardEvent): void {\n if (event.isComposing)\n return;\n\n event.stopPropagation();\n if (!persistent) {\n close();\n }\n emit('click:esc');\n}\n\nfunction onClickOutside(): void {\n if (!persistent) {\n close();\n }\n emit('click:outside');\n}\n\nfunction onDismiss(): void {\n if (!persistent) {\n close();\n }\n emit('dismiss');\n}\n\n/**\n * Registration follows `modelValue` alone, never `persistent`: a dialog that\n * turns persistent partway through its life has to stay in the stack and refuse\n * in `onDismiss`, or the gesture starts passing through exactly once there is\n * work to lose. A dialog playing its leave transition is already on its way out\n * and does not hold the stack.\n */\nuseDismissableOverlay(modelValue, onDismiss);\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 // Safety fallback if transitionend is not detected\n leaveTimeout.create(onLeaveComplete, 400);\n }\n});\n\nwatch(contentRef, (ref) => {\n if (ref) {\n nextTick(() => ref.focus());\n }\n else {\n onLeaveComplete();\n }\n});\n</script>\n\n<template>\n <div v-bind=\"getRootAttrs($attrs)\">\n <slot\n name=\"activator\"\n v-bind=\"{ attrs: dialogAttrs, isOpen: modelValue }\"\n />\n <Teleport to=\"body\">\n <div\n v-if=\"alive\"\n :class=\"ui.root({ class: cn(classNames?.root) })\"\n :style=\"{ zIndex }\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"ariaLabel\"\n tabindex=\"0\"\n v-bind=\"getNonRootAttrs($attrs)\"\n @keydown.esc=\"onEscKeydown($event)\"\n >\n <Transition\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-150\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n data-id=\"overlay\"\n :class=\"ui.overlay()\"\n @click.stop=\"onClickOutside()\"\n />\n </Transition>\n <Transition\n v-bind=\"contentTransition\"\n @after-leave=\"onLeaveComplete()\"\n >\n <div\n v-if=\"modelValue\"\n ref=\"contentRef\"\n data-id=\"content\"\n :style=\"style\"\n tabindex=\"0\"\n :data-bottom-sheet=\"bottomSheet || undefined\"\n :class=\"ui.content({ class: cn(classNames?.content) })\"\n >\n <ButtonGroupBoundary>\n <slot v-bind=\"{ isOpen: modelValue, close }\" />\n </ButtonGroupBoundary>\n </div>\n </Transition>\n </div>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiDialog.js","names":["_sfc_main"],"sources":["../../../../src/components/overlays/dialog/RuiDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { DialogSize } from '@/consts/tokens';\nimport type { VueClassValue } from '@/types/class-value';\nimport { ButtonGroupBoundary } from '@/components/buttons/button-group/button-group-context';\nimport { useDismissableOverlay } from '@/composables/overlay-stack';\nimport { useTimeoutManager } from '@/composables/timeout-manager';\nimport { getNonRootAttrs, getRootAttrs, transformPropsUnit } from '@/utils/helpers';\nimport { cn } from '@/utils/tv';\nimport { dialogStyles } from './dialog-styles';\n\nexport interface RuiDialogClassNames {\n root?: VueClassValue;\n content?: VueClassValue;\n}\n\nexport interface DialogProps {\n persistent?: boolean;\n width?: string | number;\n maxWidth?: string | number;\n /** A preset max width, `--rui-dialog-<size>`; an explicit `maxWidth` wins */\n size?: DialogSize;\n bottomSheet?: boolean;\n classNames?: RuiDialogClassNames;\n zIndex?: string | number;\n ariaLabel?: string;\n}\n\nexport interface DialogSlots {\n activator?: (props: { attrs: { onClick: () => void }; isOpen: boolean }) => any;\n default?: (props: { isOpen: boolean; close: () => void }) => any;\n}\n\ndefineOptions({\n name: 'RuiDialog',\n inheritAttrs: false,\n});\n\nconst modelValue = defineModel<boolean>({ default: false });\n\nconst {\n persistent = false,\n width = '98%',\n maxWidth,\n size,\n bottomSheet = false,\n classNames,\n zIndex = 'var(--rui-z-dialog)',\n ariaLabel,\n} = defineProps<DialogProps & /* @vue-ignore */ Omit<HTMLAttributes, keyof DialogProps>>();\n\nconst emit = defineEmits<{\n 'closed': [];\n 'click:outside': [];\n 'click:esc': [];\n /**\n * The overlay stack asked this dialog to go, which is what a back gesture\n * reaches it as. Closes unless persistent, like escape does, so a dialog that\n * has to ask before discarding should bind `persistent` and answer here.\n */\n 'dismiss': [];\n}>();\n\ndefineSlots<DialogSlots>();\n\nconst transitioning = ref<boolean>(false);\nconst contentRef = useTemplateRef<HTMLDivElement>('contentRef');\n\nconst leaveTimeout = useTimeoutManager();\n\nconst alive = computed<boolean>(() => get(modelValue) || get(transitioning));\n\nconst style = computed<{ width: string | undefined; maxWidth: string | undefined }>(() => ({\n width: transformPropsUnit(width),\n maxWidth: transformPropsUnit(maxWidth) ?? (size ? `var(--rui-dialog-${size})` : undefined),\n}));\n\nconst ui = computed<ReturnType<typeof dialogStyles>>(() => dialogStyles({ bottomSheet }));\n\nconst dialogAttrs: { onClick: () => void } = {\n onClick: toggle,\n};\n\nconst contentTransition = computed<Record<string, string>>(() => {\n if (!bottomSheet) {\n return {\n enterFromClass: 'opacity-0 scale-95',\n enterActiveClass: 'transition-all ease-out duration-200',\n enterToClass: 'opacity-100 scale-100',\n leaveFromClass: 'opacity-100 scale-100',\n leaveActiveClass: 'transition-all ease-in duration-150',\n leaveToClass: 'opacity-0 scale-95',\n };\n }\n\n return {\n enterFromClass: 'translate-y-full',\n enterActiveClass: 'transition-transform ease-out duration-300',\n enterToClass: 'translate-y-0',\n leaveFromClass: 'translate-y-0',\n leaveActiveClass: 'transition-transform ease-in duration-200',\n leaveToClass: 'translate-y-full',\n };\n});\n\nfunction toggle(): void {\n set(modelValue, !get(modelValue));\n}\n\nfunction close(): void {\n set(modelValue, false);\n}\n\n/**\n * Closes on Escape unless persistent, and reports the press as `click:esc`.\n *\n * @remarks\n * An Escape that arrives while an IME is composing belongs to the IME, which\n * cancels the candidate with it. The dialog leaves that key alone entirely: no\n * close, no `click:esc`, and no `stopPropagation`, so a search field inside the\n * dialog does not lose the dialog mid-word.\n */\nfunction onEscKeydown(event: KeyboardEvent): void {\n if (event.isComposing)\n return;\n\n event.stopPropagation();\n if (!persistent) {\n close();\n }\n emit('click:esc');\n}\n\nfunction onClickOutside(): void {\n if (!persistent) {\n close();\n }\n emit('click:outside');\n}\n\nfunction onDismiss(): void {\n if (!persistent) {\n close();\n }\n emit('dismiss');\n}\n\n/**\n * Registration follows `modelValue` alone, never `persistent`: a dialog that\n * turns persistent partway through its life has to stay in the stack and refuse\n * in `onDismiss`, or the gesture starts passing through exactly once there is\n * work to lose. A dialog playing its leave transition is already on its way out\n * and does not hold the stack.\n */\nuseDismissableOverlay(modelValue, onDismiss);\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 // Safety fallback if transitionend is not detected\n leaveTimeout.create(onLeaveComplete, 400);\n }\n});\n\nwatch(contentRef, (ref) => {\n if (ref) {\n nextTick(() => ref.focus());\n }\n else {\n onLeaveComplete();\n }\n});\n</script>\n\n<template>\n <div v-bind=\"getRootAttrs($attrs)\">\n <slot\n name=\"activator\"\n v-bind=\"{ attrs: dialogAttrs, isOpen: modelValue }\"\n />\n <Teleport to=\"body\">\n <div\n v-if=\"alive\"\n :class=\"ui.root({ class: cn(classNames?.root) })\"\n :style=\"{ zIndex }\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"ariaLabel\"\n tabindex=\"0\"\n v-bind=\"getNonRootAttrs($attrs)\"\n @keydown.esc=\"onEscKeydown($event)\"\n >\n <Transition\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-150\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"modelValue\"\n data-id=\"overlay\"\n :class=\"ui.overlay()\"\n @click.stop=\"onClickOutside()\"\n />\n </Transition>\n <Transition\n v-bind=\"contentTransition\"\n @after-leave=\"onLeaveComplete()\"\n >\n <div\n v-if=\"modelValue\"\n ref=\"contentRef\"\n data-id=\"content\"\n :style=\"style\"\n tabindex=\"0\"\n :data-bottom-sheet=\"bottomSheet || undefined\"\n :class=\"ui.content({ class: cn(classNames?.content) })\"\n >\n <ButtonGroupBoundary>\n <slot v-bind=\"{ isOpen: modelValue, close }\" />\n </ButtonGroupBoundary>\n </div>\n </Transition>\n </div>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from 'vue';
1
2
  import type { DialogSize } from '../../../consts/tokens.js';
2
3
  import type { VueClassValue } from '../../../types/class-value.js';
3
4
  export interface RuiDialogClassNames {
@@ -15,8 +16,7 @@ export interface DialogProps {
15
16
  zIndex?: string | number;
16
17
  ariaLabel?: string;
17
18
  }
18
- type __VLS_Props = DialogProps;
19
- type __VLS_Slots = {
19
+ export interface DialogSlots {
20
20
  activator?: (props: {
21
21
  attrs: {
22
22
  onClick: () => void;
@@ -27,7 +27,9 @@ type __VLS_Slots = {
27
27
  isOpen: boolean;
28
28
  close: () => void;
29
29
  }) => any;
30
- };
30
+ }
31
+ type __VLS_Props = DialogProps & /* @vue-ignore */ Omit<HTMLAttributes, keyof DialogProps>;
32
+ type __VLS_Slots = DialogSlots;
31
33
  type __VLS_ModelProps = {
32
34
  modelValue?: boolean;
33
35
  };