@livestorm/ui-vue 3.0.0 → 4.0.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 (291) hide show
  1. package/README.md +3 -3
  2. package/components-vite.js +2 -2
  3. package/dist/UiButton-uyW8EHRJ.mjs +602 -0
  4. package/dist/UiTimelineItem-EiOEi1yF.mjs +7293 -0
  5. package/dist/UiTooltip-DZcPD6_N.mjs +158 -0
  6. package/dist/a11y-CaZxRWzo.mjs +6 -0
  7. package/dist/breakpoints.mjs +4 -9
  8. package/dist/bus.mjs +5 -5
  9. package/dist/components.mjs +236 -231
  10. package/dist/i18n-B8QOMuFD.mjs +46 -0
  11. package/dist/index.mjs +4 -91
  12. package/dist/integrations.mjs +3 -14
  13. package/dist/layouts.mjs +228 -236
  14. package/dist/responsive.mjs +31 -36
  15. package/dist/slot.mjs +11 -17
  16. package/dist/toastDSV2-D3xDZPe5.mjs +105 -0
  17. package/dist/types/index.d.ts +19 -1
  18. package/dist/types/src/components/Toast/ToastMessage.vue.d.ts +17 -7
  19. package/dist/types/src/components/Toast/toastDSV2.d.ts +89 -64
  20. package/dist/types/src/components/UiActionBar/types.d.ts +2 -0
  21. package/dist/types/src/components/UiAvatar/UiAvatar.vue.d.ts +4 -2
  22. package/dist/types/src/components/UiAvatarList/UiAvatarList.vue.d.ts +3 -2
  23. package/dist/types/src/components/UiBanner/UiBanner.vue.d.ts +13 -1
  24. package/dist/types/src/components/UiButton/UiButton.vue.d.ts +95 -35
  25. package/dist/types/src/components/UiButtonGroup/UiButtonGroup.vue.d.ts +8 -2
  26. package/dist/types/src/components/UiButtonGroup/types.d.ts +4 -0
  27. package/dist/types/src/components/UiChoice/UiChoice.vue.d.ts +71 -0
  28. package/dist/types/src/components/UiChoice/index.d.ts +2 -0
  29. package/dist/types/src/components/UiChoice/types.d.ts +7 -0
  30. package/dist/types/src/components/UiColorField/UiColorField.vue.d.ts +1 -1
  31. package/dist/types/src/components/UiColorPicker/UiColorPicker.vue.d.ts +2 -2
  32. package/dist/types/src/components/UiCombobox/UiCombobox.types.d.ts +47 -0
  33. package/dist/types/src/components/UiCombobox/UiCombobox.vue.d.ts +40 -0
  34. package/dist/types/src/components/UiCombobox/index.d.ts +2 -0
  35. package/dist/types/src/components/UiDataTable/UiDataTable.types.d.ts +46 -0
  36. package/dist/types/src/components/UiDataTable/UiDataTable.vue.d.ts +136 -0
  37. package/dist/types/src/components/UiDataTable/index.d.ts +5 -0
  38. package/dist/types/src/components/UiDrawer/UiDrawer.vue.d.ts +28 -0
  39. package/dist/types/src/components/UiDrawer/UiDrawerContent.vue.d.ts +18 -0
  40. package/dist/types/src/components/UiDrawer/UiDrawerTrigger.vue.d.ts +14 -0
  41. package/dist/types/src/components/UiDropdown/DropdownItemCheckbox.vue.d.ts +3 -0
  42. package/dist/types/src/components/UiDropdown/UiDropdownContent.vue.d.ts +10 -0
  43. package/dist/types/src/components/UiDropdown/UiDropdownGroup.vue.d.ts +17 -0
  44. package/dist/types/src/components/UiDropdown/UiDropdownItem.vue.d.ts +8 -5
  45. package/dist/types/src/components/UiDropdown/UiDropdownTrigger.vue.d.ts +21 -5
  46. package/dist/types/src/components/UiDropdown/index.d.ts +1 -0
  47. package/dist/types/src/components/UiEmojiPickerList/UiEmojiPickerList.vue.d.ts +22 -0
  48. package/dist/types/src/components/UiEmptyState/UiEmptyState.vue.d.ts +8 -3
  49. package/dist/types/src/components/UiFieldWrapper/UiFieldWrapper.vue.d.ts +2 -2
  50. package/dist/types/src/components/UiInputCheckbox/CheckboxGlyph.vue.d.ts +17 -0
  51. package/dist/types/src/components/UiInputCheckbox/UiInputCheckbox.vue.d.ts +35 -4
  52. package/dist/types/src/components/UiInputRadio/RadioGlyph.vue.d.ts +19 -0
  53. package/dist/types/src/components/UiInputRadio/UiInputRadio.vue.d.ts +21 -8
  54. package/dist/types/src/components/UiInputRadio/UiInputRadioGroup.vue.d.ts +6 -1
  55. package/dist/types/src/components/UiInputRadio/types.d.ts +1 -1
  56. package/dist/types/src/components/UiInputSelect/UiInputSelect.vue.d.ts +5 -5
  57. package/dist/types/src/components/UiInputTextarea/UiInputTextarea.vue.d.ts +5 -5
  58. package/dist/types/src/components/UiListItem/UiListItem.vue.d.ts +18 -4
  59. package/dist/types/src/components/UiLoader/UiSpinnerIcon.vue.d.ts +3 -0
  60. package/dist/types/src/components/UiMenu/UiMenuContent.vue.d.ts +15 -2
  61. package/dist/types/src/components/UiMenu/UiMenuItem.vue.d.ts +9 -3
  62. package/dist/types/src/components/UiNestedOptions/UiNestedOptions.vue.d.ts +13 -0
  63. package/dist/types/src/components/UiPage/UiPage.vue.d.ts +79 -15
  64. package/dist/types/src/components/UiPagination/UiPagination.vue.d.ts +36 -0
  65. package/dist/types/src/components/UiPagination/index.d.ts +2 -0
  66. package/dist/types/src/components/UiPagination/types.d.ts +4 -0
  67. package/dist/types/src/components/UiPane/UiPane.vue.d.ts +22 -0
  68. package/dist/types/src/components/UiPane/UiPaneContent.vue.d.ts +75 -0
  69. package/dist/types/src/components/UiPane/UiPaneTrigger.vue.d.ts +14 -0
  70. package/dist/types/src/components/UiPane/index.d.ts +5 -0
  71. package/dist/types/src/components/UiRating/UiRating.vue.d.ts +62 -0
  72. package/dist/types/src/components/UiRating/types.d.ts +1 -0
  73. package/dist/types/src/components/UiRoomButton/UiRoomButton.vue.d.ts +5 -3
  74. package/dist/types/src/components/UiRoomCountdown/UiRoomCountdown.vue.d.ts +32 -0
  75. package/dist/types/src/components/UiShell/UiShell.vue.d.ts +3 -0
  76. package/dist/types/src/components/UiSideMenu/UiSideMenu.vue.d.ts +22 -1
  77. package/dist/types/src/components/UiSideMenu/UiSideMenuItemContent.vue.d.ts +2 -2
  78. package/dist/types/src/components/UiSwitch/UiSwitch.vue.d.ts +10 -5
  79. package/dist/types/src/components/UiTable/UiTable.vue.d.ts +13 -4
  80. package/dist/types/src/components/UiTable/UiTableActionsCell.vue.d.ts +49 -0
  81. package/dist/types/src/components/UiTable/UiTableActionsHeaderCell.vue.d.ts +3 -0
  82. package/dist/types/src/components/UiTable/UiTableBody.vue.d.ts +11 -1
  83. package/dist/types/src/components/UiTable/UiTableCell.vue.d.ts +16 -1
  84. package/dist/types/src/components/UiTable/UiTableHeaderCell.vue.d.ts +31 -2
  85. package/dist/types/src/components/UiTable/UiTableRow.vue.d.ts +32 -2
  86. package/dist/types/src/components/UiTable/context.d.ts +3 -0
  87. package/dist/types/src/components/UiTable/index.d.ts +4 -0
  88. package/dist/types/src/components/UiTabs/UiTabs.vue.d.ts +3 -0
  89. package/dist/types/src/components/UiTag/UiTag.types.d.ts +25 -0
  90. package/dist/types/src/components/UiTag/UiTag.vue.d.ts +5 -26
  91. package/dist/types/src/components/UiTag/index.d.ts +2 -1
  92. package/dist/types/src/components/UiTextField/UiTextField.vue.d.ts +10 -5
  93. package/dist/types/src/components/UiTooltip/UiTooltipProvider.vue.d.ts +1 -0
  94. package/dist/types/src/components/UiTooltip/UiTooltipTrigger.vue.d.ts +2 -2
  95. package/dist/types/src/composables/storedThemingApplies.d.ts +17 -0
  96. package/dist/types/src/composables/useButtonStyles.d.ts +1 -0
  97. package/dist/types/src/composables/useChoiceboxSurface.d.ts +11 -0
  98. package/dist/types/src/composables/useContentMode.d.ts +7 -9
  99. package/dist/types/src/composables/useControlModes.d.ts +7 -0
  100. package/dist/types/src/composables/useControlShape.d.ts +24 -0
  101. package/dist/types/src/composables/useFieldFocusEvents.d.ts +12 -0
  102. package/dist/types/src/composables/useIconSize.d.ts +2 -0
  103. package/dist/types/src/composables/usePullGesture.d.ts +42 -0
  104. package/dist/types/src/composables/useThemeAndModes.d.ts +4 -0
  105. package/dist/types/src/theming/colorScale.d.ts +165 -0
  106. package/dist/types/src/theming/legacyColorScale.d.ts +27 -0
  107. package/dist/types/src/theming/presetColors.d.ts +11 -0
  108. package/dist/types/src/theming/primitiveTokens.d.ts +2 -0
  109. package/dist/types/src/utils/effectiveOpacity.d.ts +2 -0
  110. package/dist/types/src/utils/numbers.d.ts +1 -2
  111. package/dist/types/src/utils/tokenColor.d.ts +2 -0
  112. package/dist/ui-vue.css +2 -1
  113. package/dist/utils.mjs +165 -194
  114. package/index.d.ts +18 -0
  115. package/index.js +36 -0
  116. package/package.json +26 -21
  117. package/src/components/Toast/LayoutToasts.vue +19 -11
  118. package/src/components/Toast/ToastMessage.vue +125 -68
  119. package/src/components/Toast/toastDSV2.ts +238 -67
  120. package/src/components/UiActionBar/UiActionBar.vue +4 -3
  121. package/src/components/UiActionBar/UiActionBarItem.vue +9 -6
  122. package/src/components/UiActionBar/types.ts +13 -0
  123. package/src/components/UiAvatar/UiAvatar.vue +8 -2
  124. package/src/components/UiAvatarList/UiAvatarList.vue +51 -20
  125. package/src/components/UiBadge/UiBadge.vue +1 -1
  126. package/src/components/UiBanner/UiBanner.vue +71 -21
  127. package/src/components/UiBreadcrumb/UiBreadcrumb.vue +1 -1
  128. package/src/components/UiButton/UiButton.vue +92 -25
  129. package/src/components/UiButtonGroup/UiButtonGroup.vue +21 -17
  130. package/src/components/UiButtonGroup/UiButtonGroupItem.vue +33 -15
  131. package/src/components/UiButtonGroup/types.ts +19 -0
  132. package/src/components/UiCard/UiCard.vue +20 -23
  133. package/src/components/UiChoice/UiChoice.vue +187 -0
  134. package/src/components/UiChoice/index.ts +2 -0
  135. package/src/components/UiChoice/types.ts +11 -0
  136. package/src/components/UiColorField/UiColorField.vue +2 -2
  137. package/src/components/UiColorPicker/UiColorPicker.vue +11 -8
  138. package/src/components/UiCombobox/UiCombobox.types.ts +52 -0
  139. package/src/components/UiCombobox/UiCombobox.vue +296 -0
  140. package/src/components/UiCombobox/index.ts +2 -0
  141. package/src/components/UiDataTable/UiDataTable.types.ts +47 -0
  142. package/src/components/UiDataTable/UiDataTable.vue +422 -0
  143. package/src/components/UiDataTable/index.ts +12 -0
  144. package/src/components/UiDialog/UiDialogContent.vue +22 -7
  145. package/src/components/UiDrawer/UiDrawer.vue +16 -0
  146. package/src/components/UiDrawer/UiDrawerContent.vue +42 -0
  147. package/src/components/UiDrawer/UiDrawerTrigger.vue +17 -0
  148. package/src/components/UiDropdown/DropdownItemCheckbox.vue +10 -0
  149. package/src/components/UiDropdown/UiDropdownContent.vue +32 -21
  150. package/src/components/UiDropdown/UiDropdownGroup.vue +23 -0
  151. package/src/components/UiDropdown/UiDropdownItem.vue +38 -18
  152. package/src/components/UiDropdown/UiDropdownSeparator.vue +1 -1
  153. package/src/components/UiDropdown/UiDropdownTrigger.vue +138 -43
  154. package/src/components/UiDropdown/index.ts +1 -0
  155. package/src/components/UiEmojiPickerList/UiEmojiPickerList.vue +122 -0
  156. package/src/components/UiEmptyState/UiEmptyState.vue +16 -4
  157. package/src/components/UiFieldWrapper/UiFieldWrapper.vue +9 -3
  158. package/src/components/UiHorizontalSeparator/UiHorizontalSeparator.vue +2 -2
  159. package/src/components/UiInputCheckbox/CheckboxGlyph.vue +78 -0
  160. package/src/components/UiInputCheckbox/UiInputCheckbox.vue +213 -177
  161. package/src/components/UiInputEmoji/UiInputEmoji.vue +18 -95
  162. package/src/components/UiInputRadio/RadioGlyph.vue +45 -0
  163. package/src/components/UiInputRadio/UiInputRadio.vue +177 -169
  164. package/src/components/UiInputRadio/UiInputRadioGroup.vue +15 -5
  165. package/src/components/UiInputRadio/types.ts +1 -2
  166. package/src/components/UiInputSelect/UiInputSelect.vue +9 -7
  167. package/src/components/UiInputTextarea/UiInputTextarea.vue +20 -35
  168. package/src/components/UiLabel/UiLabel.vue +1 -1
  169. package/src/components/UiListItem/UiListItem.vue +55 -9
  170. package/src/components/UiLoader/UiLoader.vue +4 -20
  171. package/src/components/UiLoader/UiSpinnerIcon.vue +21 -0
  172. package/src/components/UiMenu/UiMenuContent.vue +24 -3
  173. package/src/components/UiMenu/UiMenuGroup.vue +1 -1
  174. package/src/components/UiMenu/UiMenuItem.vue +14 -3
  175. package/src/components/UiMenu/UiMenuSubContent.vue +1 -1
  176. package/src/components/UiMenu/UiMenuSubTrigger.vue +1 -1
  177. package/src/components/UiNestedOptions/UiNestedOptions.vue +6 -0
  178. package/src/components/UiPage/UiPage.vue +190 -32
  179. package/src/components/UiPagination/UiPagination.vue +99 -0
  180. package/src/components/UiPagination/index.ts +2 -0
  181. package/src/components/UiPagination/types.ts +28 -0
  182. package/src/components/UiPane/UiPane.vue +20 -0
  183. package/src/components/UiPane/UiPaneContent.vue +232 -0
  184. package/src/components/UiPane/UiPaneTrigger.vue +14 -0
  185. package/src/components/UiPane/index.ts +12 -0
  186. package/src/components/UiPopover/UiPopoverContent.vue +21 -1
  187. package/src/components/UiProgress/UiProgress.vue +2 -2
  188. package/src/components/UiRating/UiRating.vue +258 -0
  189. package/src/components/UiRating/types.ts +1 -0
  190. package/src/components/UiRoomButton/UiRoomButton.vue +10 -41
  191. package/src/components/UiRoomCountdown/UiRoomCountdown.vue +376 -0
  192. package/src/components/UiShell/UiShell.vue +9 -3
  193. package/src/components/UiSideMenu/UiSideMenu.vue +155 -18
  194. package/src/components/UiSideMenu/UiSideMenuItemContent.vue +20 -16
  195. package/src/components/UiStepper/UiStepper.vue +3 -16
  196. package/src/components/UiStepper/UiStepperDescription.vue +1 -13
  197. package/src/components/UiStepper/UiStepperIndicator.vue +11 -48
  198. package/src/components/UiStepper/UiStepperItem.vue +1 -8
  199. package/src/components/UiStepper/UiStepperSeparator.vue +5 -16
  200. package/src/components/UiStepper/UiStepperTitle.vue +1 -10
  201. package/src/components/UiSwitch/UiSwitch.vue +44 -28
  202. package/src/components/UiTable/UiTable.vue +98 -8
  203. package/src/components/UiTable/UiTableActionsCell.vue +135 -0
  204. package/src/components/UiTable/UiTableActionsHeaderCell.vue +19 -0
  205. package/src/components/UiTable/UiTableBody.vue +16 -1
  206. package/src/components/UiTable/UiTableCell.vue +33 -16
  207. package/src/components/UiTable/UiTableHeader.vue +6 -5
  208. package/src/components/UiTable/UiTableHeaderCell.vue +61 -9
  209. package/src/components/UiTable/UiTableRow.vue +46 -10
  210. package/src/components/UiTable/context.ts +5 -0
  211. package/src/components/UiTable/index.ts +4 -0
  212. package/src/components/UiTabs/UiTabs.vue +56 -61
  213. package/src/components/UiTag/UiTag.types.ts +28 -0
  214. package/src/components/UiTag/UiTag.vue +24 -42
  215. package/src/components/UiTag/index.ts +2 -0
  216. package/src/components/UiTextField/UiTextField.vue +21 -36
  217. package/src/components/UiTooltip/UiTooltipContent.vue +1 -1
  218. package/src/components/UiTooltip/UiTooltipProvider.vue +3 -0
  219. package/src/components/UiTooltip/UiTooltipTrigger.vue +16 -1
  220. package/src/composables/storedThemingApplies.ts +19 -0
  221. package/src/composables/useButtonStyles.ts +9 -13
  222. package/src/composables/useChoiceboxSurface.ts +36 -0
  223. package/src/composables/useContentMode.ts +29 -16
  224. package/src/composables/useControlModes.ts +11 -0
  225. package/src/composables/useControlShape.ts +34 -0
  226. package/src/composables/useFieldFocusEvents.ts +30 -0
  227. package/src/composables/useIconSize.ts +15 -0
  228. package/src/composables/usePullGesture.ts +142 -0
  229. package/src/composables/useThemeAndModes.ts +28 -1
  230. package/src/css/body.css +16 -1
  231. package/src/css/fonts.css +39 -5
  232. package/src/global.d.ts +36 -0
  233. package/src/theming/colorScale.ts +173 -0
  234. package/src/theming/legacyColorScale.ts +58 -0
  235. package/src/theming/presetColors.ts +33 -0
  236. package/src/theming/primitiveTokens.ts +71 -0
  237. package/src/utils/effectiveOpacity.ts +8 -0
  238. package/src/utils/i18n.ts +6 -0
  239. package/src/utils/numbers.ts +1 -1
  240. package/src/utils/responsive.d.ts +14 -0
  241. package/src/utils/tokenColor.ts +9 -0
  242. package/dist/UiTimelineItem.vue_vue_type_style_index_0_lang-LpdvGf5X.mjs +0 -6093
  243. package/dist/a11y-BhF_nl7L.mjs +0 -159
  244. package/dist/i18n-Cktw9hIu.mjs +0 -49
  245. package/dist/toastDSV2-wMh-UMzW.mjs +0 -74
  246. package/dist/types/src/components/UiAvatar/index.d.ts +0 -1
  247. package/dist/types/src/components/UiAvatarList/index.d.ts +0 -1
  248. package/dist/types/src/components/UiBadge/index.d.ts +0 -1
  249. package/dist/types/src/components/UiBanner/index.d.ts +0 -2
  250. package/dist/types/src/components/UiButtonGroup/index.d.ts +0 -3
  251. package/dist/types/src/components/UiCarousel/index.d.ts +0 -2
  252. package/dist/types/src/components/UiColorField/index.d.ts +0 -2
  253. package/dist/types/src/components/UiDialog/MarketplaceHeaderExample.vue.d.ts +0 -28
  254. package/dist/types/src/components/UiDialog/index.d.ts +0 -7
  255. package/dist/types/src/components/UiFieldWrapper/index.d.ts +0 -1
  256. package/dist/types/src/components/UiInputCheckbox/index.d.ts +0 -2
  257. package/dist/types/src/components/UiInputEmoji/index.d.ts +0 -1
  258. package/dist/types/src/components/UiInputRadio/index.d.ts +0 -3
  259. package/dist/types/src/components/UiInputSelect/index.d.ts +0 -2
  260. package/dist/types/src/components/UiInputTextarea/index.d.ts +0 -2
  261. package/dist/types/src/components/UiMenu/index.d.ts +0 -10
  262. package/dist/types/src/components/UiProgress/index.d.ts +0 -2
  263. package/dist/types/src/components/UiSwitch/index.d.ts +0 -2
  264. package/dist/types/src/components/UiTabs/index.d.ts +0 -2
  265. package/dist/types/src/components/UiTimeline/index.d.ts +0 -2
  266. package/dist/types/src/components/UiTooltip/index.d.ts +0 -4
  267. package/dist/types/src/mixins/DynamicAction.d.ts +0 -30
  268. package/dist/useThemeAndModes-BzYwSOEv.mjs +0 -108
  269. package/src/components/UiAvatar/index.js +0 -1
  270. package/src/components/UiAvatarList/index.js +0 -1
  271. package/src/components/UiBadge/index.ts +0 -2
  272. package/src/components/UiBanner/index.ts +0 -2
  273. package/src/components/UiButtonGroup/index.ts +0 -3
  274. package/src/components/UiCarousel/index.ts +0 -2
  275. package/src/components/UiColorField/index.ts +0 -2
  276. package/src/components/UiDialog/MarketplaceHeaderExample.vue +0 -217
  277. package/src/components/UiDialog/index.ts +0 -18
  278. package/src/components/UiFieldWrapper/index.ts +0 -1
  279. package/src/components/UiInputCheckbox/index.ts +0 -2
  280. package/src/components/UiInputEmoji/index.ts +0 -1
  281. package/src/components/UiInputRadio/index.ts +0 -3
  282. package/src/components/UiInputSelect/index.ts +0 -2
  283. package/src/components/UiInputTextarea/index.ts +0 -2
  284. package/src/components/UiMenu/index.ts +0 -10
  285. package/src/components/UiProgress/index.ts +0 -2
  286. package/src/components/UiSwitch/index.ts +0 -2
  287. package/src/components/UiTabs/index.ts +0 -5
  288. package/src/components/UiTag/index.js +0 -1
  289. package/src/components/UiTimeline/index.ts +0 -2
  290. package/src/components/UiTooltip/index.js +0 -4
  291. package/src/mixins/DynamicAction.js +0 -61
package/README.md CHANGED
@@ -36,7 +36,7 @@ A modern, strongly-typed Vue 3 component library for Livestorm’s design system
36
36
  - the logo link of `UiPageHeader` when `showLogo` is enabled;
37
37
  - the `@livestorm/ui-vue/utils` entry point: its `useRouteQueryModel` helper is built on the router, so importing this entry requires vue-router to be installed.
38
38
  - **Tailwind CSS 4**, since components are styled with Tailwind utility classes.
39
- - **The Inter font**, which components are designed for. The package never loads it for you: self-host it, or import the optional Google Fonts shortcut once (`import '@livestorm/ui-vue/fonts'`). Without Inter, components fall back to the system font stack.
39
+ - **The Inter font**, which components are designed for. The package never loads it for you: load it yourself, or import the optional self-hosted shortcut once (`import '@livestorm/ui-vue/fonts'`, Inter Variable served from the `inter-ui` dependency). Without Inter, components fall back to the system font stack.
40
40
 
41
41
  Installing the package also pulls in `@livestorm/ui-tokens` (design tokens) and `@livestorm/ui-icons` (icon utilities).
42
42
 
@@ -160,7 +160,7 @@ registerComponents(app, 'Ls') // <LsButton>, <LsTextField>, ...
160
160
  | --- | --- |
161
161
  | `@livestorm/ui-vue` | All components and utilities |
162
162
  | `@livestorm/ui-vue/style` | Base stylesheet (import once) |
163
- | `@livestorm/ui-vue/fonts` | Optional: loads Inter from Google Fonts (skip it if you self-host) |
163
+ | `@livestorm/ui-vue/fonts` | Optional: declares Inter Variable from the bundled `inter-ui` package (skip it if you load Inter yourself) |
164
164
  | `@livestorm/ui-vue/components-vite` | `registerComponents` for global registration |
165
165
  | `@livestorm/ui-vue/integrations` | Toast helpers (`openToast`, ... — call client-side only: toast state is per-process on a server) and translation wiring (`setTranslator`, `UI_VUE_TRANSLATOR`) |
166
166
  | `@livestorm/ui-vue/layouts` | Layout components such as the toast container |
@@ -171,4 +171,4 @@ The package ships prebuilt ES modules, so no special bundler configuration is ne
171
171
 
172
172
  ## Contributing
173
173
 
174
- This package lives in Livestorm's [entropy](https://github.com/livestorm/entropy) monorepo, under `packages/ui-vue`. See that directory's `CONTRIBUTING.md` for architecture, conventions and the release process.
174
+ This package lives in Livestorm's [entropy](https://github.com/livestorm/entropy) monorepo, under `packages/ui-vue`. See that directory's `AGENTS.md` for architecture, conventions and the release process.
@@ -5,7 +5,7 @@ const NAME_REG = /Ui([a-z0-9]+)\./i
5
5
  export function registerComponents (app, prefix = 'Ui') {
6
6
  app.component('RenderSlot', RenderSlot)
7
7
 
8
- const componentsLib = import.meta.glob('./src/components/**/Ui+([a-zA-Z0-9]).{js,jsx,vue,ts}', { eager: true })
8
+ const componentsLib = import.meta.glob(['./src/components/**/Ui*.{js,jsx,vue,ts}', '!./src/components/**/*.*.*'], { eager: true })
9
9
  for (const key in componentsLib) {
10
10
  const component = componentsLib[key]
11
11
  const name = key.match(NAME_REG)[1]
@@ -18,7 +18,7 @@ export function getComponents (prefix = 'Ui') {
18
18
 
19
19
  componentsMap.RenderSlot = RenderSlot
20
20
 
21
- const componentsLib = import.meta.glob('./src/components/**/Ui+([a-zA-Z0-9]).{js,jsx,vue,ts}', { eager: true })
21
+ const componentsLib = import.meta.glob(['./src/components/**/Ui*.{js,jsx,vue,ts}', '!./src/components/**/*.*.*'], { eager: true })
22
22
  for (const key in componentsLib) {
23
23
  const component = componentsLib[key]
24
24
  const name = key.match(NAME_REG)[1]
@@ -0,0 +1,602 @@
1
+ import { l as e, t } from "./UiTooltip-DZcPD6_N.mjs";
2
+ import { RenderSlot as n, useSlotsAsComponents as r } from "./slot.mjs";
3
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, mergeProps as p, normalizeClass as m, normalizeStyle as h, openBlock as g, ref as _, renderSlot as v, resolveComponent as y, resolveDynamicComponent as b, toDisplayString as x, toValue as S, unref as C, useSlots as w, watch as T, withCtx as E } from "vue";
4
+ //#region src/composables/useIconSize.ts
5
+ var D = {
6
+ xs: "size-3",
7
+ sm: "size-4",
8
+ md: "size-5",
9
+ lg: "size-6",
10
+ xl: "size-7"
11
+ };
12
+ function O(e) {
13
+ return a(() => D[S(e)]);
14
+ }
15
+ var k = {
16
+ xs: "size-2.5",
17
+ sm: "size-3.5",
18
+ md: "size-4",
19
+ lg: "size-5",
20
+ xl: "size-6"
21
+ };
22
+ function ee(e) {
23
+ return a(() => k[S(e)]);
24
+ }
25
+ //#endregion
26
+ //#region src/components/UiAvatar/UiAvatar.vue?vue&type=script&setup=true&lang.ts
27
+ var te = ["data-size", "data-variant"], ne = ["src", "alt"], A = {
28
+ key: 1,
29
+ class: "px-0.5 overflow-hidden text-ellipsis whitespace-nowrap",
30
+ "data-recording-sensitive": ""
31
+ }, j = /*@__PURE__*/ d({
32
+ __name: "UiAvatar",
33
+ props: {
34
+ src: { default: null },
35
+ firstName: { default: null },
36
+ lastName: { default: null },
37
+ customText: { default: null },
38
+ size: { default: "md" },
39
+ variant: { default: "default" },
40
+ alt: { default: void 0 },
41
+ color: { default: null },
42
+ icon: { default: "i-ph-user-fill" }
43
+ },
44
+ setup(e) {
45
+ let t = e, n = a(() => {
46
+ if (t.variant !== "more" && (!t.src || r.value) && t.color) return {
47
+ backgroundColor: t.color,
48
+ color: "white"
49
+ };
50
+ }), r = _(!1);
51
+ T(() => t.src, () => {
52
+ r.value = !1;
53
+ });
54
+ let i = a(() => t.customText ? t.customText : ((t.firstName?.trim()?.[0] ?? "") + (t.lastName?.trim()?.[0] ?? "")).toUpperCase() || null), o = a(() => `${t.firstName ?? ""} ${t.lastName ?? ""}`.trim()), u = a(() => {
55
+ switch (t.size) {
56
+ case "sm": return "w-8 h-8 text-content-legends-bold-md";
57
+ case "md": return "w-10 h-10 text-content-text-md-bold";
58
+ case "lg": return "w-12 h-12 text-content-text-lg-bold";
59
+ case "xl": return "w-16 h-16 text-title-md-bold";
60
+ case "10xl": return "w-32 h-32 text-title-lg-bold";
61
+ default: return "w-6 h-6 text-content-badges-bold-md";
62
+ }
63
+ }), d = a(() => {
64
+ switch (t.size) {
65
+ case "sm": return "w-3 h-3";
66
+ case "md": return "w-3.5 h-3.5";
67
+ case "lg": return "w-4 h-4";
68
+ case "xl": return "w-6 h-6";
69
+ case "10xl": return "w-8 h-8";
70
+ default: return "w-2.5 h-2.5";
71
+ }
72
+ }), f = a(() => {
73
+ switch (t.variant) {
74
+ case "more": return "bg-surface-neutral-100 text-text-neutral-base";
75
+ default: return "bg-surface-neutral-invert-bg-main text-text-neutral-invert-base";
76
+ }
77
+ }), p = w(), y = a(() => !!p.badge), b = a(() => y.value ? ["ui-avatar relative inline-flex shrink-0", u.value] : [
78
+ "ui-avatar inline-flex items-center justify-center shrink-0 rounded-full overflow-hidden text-center",
79
+ u.value,
80
+ f.value
81
+ ]), S = a(() => y.value ? ["inline-flex items-center justify-center w-full h-full rounded-full overflow-hidden text-center", f.value] : "contents");
82
+ return (t, a) => (g(), c("span", {
83
+ class: m(b.value),
84
+ style: h(y.value ? void 0 : n.value),
85
+ "data-size": e.size,
86
+ "data-variant": e.variant,
87
+ "data-testid": "ui-avatar"
88
+ }, [l("span", {
89
+ class: m(S.value),
90
+ style: h(y.value ? n.value : void 0)
91
+ }, [e.src && !r.value ? (g(), c("img", {
92
+ key: 0,
93
+ src: e.src,
94
+ alt: e.alt ?? o.value,
95
+ class: "w-full h-full object-cover",
96
+ onError: a[0] ||= (e) => r.value = !0
97
+ }, null, 40, ne)) : i.value ? (g(), c("span", A, x(i.value), 1)) : (g(), c("span", {
98
+ key: 2,
99
+ class: m([e.icon, d.value])
100
+ }, null, 2))], 6), y.value ? v(t.$slots, "badge", { key: 0 }) : s("", !0)], 14, te));
101
+ }
102
+ }), M = /* @__PURE__ */ e({ default: () => N }), N = j, P = (e, t) => {
103
+ let n = e.__vccOpts || e;
104
+ for (let [e, r] of t) n[e] = r;
105
+ return n;
106
+ }, F = [
107
+ "xs",
108
+ "sm",
109
+ "md",
110
+ "lg"
111
+ ], I = [
112
+ "primary",
113
+ "neutral",
114
+ "success",
115
+ "warning",
116
+ "error",
117
+ "neutral-invert"
118
+ ], L = {
119
+ cta: {
120
+ primary: "bg-actions-primary-idle",
121
+ neutral: "bg-actions-neutral-idle",
122
+ "neutral-invert": "bg-actions-neutral-invert-idle",
123
+ success: "bg-actions-success-idle",
124
+ warning: "bg-actions-warning-idle",
125
+ error: "bg-actions-danger-idle"
126
+ },
127
+ "cta-alpha": {
128
+ primary: "bg-actions-primary-idle-alpha-strong",
129
+ neutral: "bg-actions-neutral-idle-alpha-strong",
130
+ "neutral-invert": "bg-actions-neutral-invert-idle-alpha-strong",
131
+ success: "bg-actions-success-idle-alpha-strong",
132
+ warning: "bg-actions-warning-idle-alpha-strong",
133
+ error: "bg-actions-danger-idle-alpha-strong"
134
+ },
135
+ secondary: {
136
+ primary: "bg-actions-primary-idle-alpha-light",
137
+ neutral: "bg-actions-neutral-idle-alpha-light",
138
+ "neutral-invert": "bg-actions-neutral-invert-idle-alpha-light",
139
+ success: "bg-actions-success-idle-alpha-light",
140
+ warning: "bg-actions-warning-idle-alpha-light",
141
+ error: "bg-actions-danger-idle-alpha-light"
142
+ }
143
+ }, R = {
144
+ cta: {
145
+ primary: "text-actions-neutral-invert-idle",
146
+ neutral: "text-actions-neutral-invert-idle",
147
+ "neutral-invert": "text-actions-neutral-idle",
148
+ success: "text-actions-neutral-invert-idle",
149
+ warning: "text-actions-neutral-invert-idle",
150
+ error: "text-actions-neutral-invert-idle"
151
+ },
152
+ "cta-alpha": {
153
+ primary: "text-actions-neutral-invert-idle",
154
+ neutral: "text-actions-neutral-invert-idle",
155
+ "neutral-invert": "text-actions-neutral-idle",
156
+ success: "text-actions-neutral-invert-idle",
157
+ warning: "text-actions-neutral-invert-idle",
158
+ error: "text-actions-neutral-invert-idle"
159
+ },
160
+ secondary: {
161
+ primary: "text-actions-primary-idle",
162
+ neutral: "text-actions-neutral-idle",
163
+ "neutral-invert": "text-actions-neutral-invert-idle",
164
+ success: "text-actions-success-idle",
165
+ warning: "text-actions-warning-idle",
166
+ error: "text-actions-danger-idle"
167
+ },
168
+ tertiary: {
169
+ primary: "text-actions-primary-idle",
170
+ neutral: "text-actions-neutral-idle",
171
+ "neutral-invert": "text-actions-neutral-invert-idle",
172
+ success: "text-actions-success-idle",
173
+ warning: "text-actions-warning-idle",
174
+ error: "text-actions-danger-idle"
175
+ }
176
+ }, z = {
177
+ "cta-primary": "group-hover:bg-actions-neutral-invert-hover-overlay",
178
+ "cta-neutral": "group-hover:bg-actions-neutral-invert-hover-overlay",
179
+ "cta-neutral-invert": "group-hover:bg-actions-neutral-hover-overlay",
180
+ "cta-success": "group-hover:bg-actions-neutral-invert-hover-overlay",
181
+ "cta-warning": "group-hover:bg-actions-neutral-invert-hover-overlay",
182
+ "cta-error": "group-hover:bg-actions-neutral-invert-hover-overlay",
183
+ "cta-alpha-primary": "group-hover:bg-actions-neutral-invert-hover-overlay",
184
+ "cta-alpha-neutral": "group-hover:bg-actions-neutral-invert-hover-overlay",
185
+ "cta-alpha-neutral-invert": "group-hover:bg-actions-neutral-hover-overlay",
186
+ "cta-alpha-success": "group-hover:bg-actions-neutral-invert-hover-overlay",
187
+ "cta-alpha-warning": "group-hover:bg-actions-neutral-invert-hover-overlay",
188
+ "cta-alpha-error": "group-hover:bg-actions-neutral-invert-hover-overlay",
189
+ "secondary-primary": "group-hover:bg-actions-primary-hover-overlay",
190
+ "secondary-neutral": "group-hover:bg-actions-neutral-hover-overlay",
191
+ "secondary-neutral-invert": "group-hover:bg-actions-neutral-invert-hover-overlay",
192
+ "secondary-success": "group-hover:bg-actions-success-hover-overlay",
193
+ "secondary-warning": "group-hover:bg-actions-warning-hover-overlay",
194
+ "secondary-error": "group-hover:bg-actions-danger-hover-overlay",
195
+ "tertiary-primary": "group-hover:bg-actions-primary-hover-overlay",
196
+ "tertiary-neutral": "group-hover:bg-actions-neutral-hover-overlay",
197
+ "tertiary-neutral-invert": "group-hover:bg-actions-neutral-invert-hover-overlay",
198
+ "tertiary-success": "group-hover:bg-actions-success-hover-overlay",
199
+ "tertiary-warning": "group-hover:bg-actions-warning-hover-overlay",
200
+ "tertiary-error": "group-hover:bg-actions-danger-hover-overlay"
201
+ }, B = {
202
+ "cta-primary": "group-active:bg-actions-primary-pressed-overlay",
203
+ "cta-neutral": "group-active:bg-actions-neutral-invert-pressed-overlay",
204
+ "cta-neutral-invert": "group-active:bg-actions-neutral-pressed-overlay",
205
+ "cta-success": "group-active:bg-actions-success-pressed-overlay",
206
+ "cta-warning": "group-active:bg-actions-warning-pressed-overlay",
207
+ "cta-error": "group-active:bg-actions-danger-pressed-overlay",
208
+ "cta-alpha-primary": "group-active:bg-actions-primary-pressed-overlay",
209
+ "cta-alpha-neutral": "group-active:bg-actions-neutral-pressed-overlay",
210
+ "cta-alpha-neutral-invert": "group-active:bg-actions-neutral-invert-pressed-overlay",
211
+ "cta-alpha-success": "group-active:bg-actions-neutral-pressed-overlay",
212
+ "cta-alpha-warning": "group-active:bg-actions-danger-pressed-overlay",
213
+ "cta-alpha-error": "group-active:bg-actions-danger-pressed-overlay",
214
+ "secondary-primary": "group-active:bg-actions-primary-pressed-overlay",
215
+ "secondary-neutral": "group-active:bg-actions-neutral-idle-alpha-light",
216
+ "secondary-neutral-invert": "group-active:bg-actions-neutral-invert-idle-alpha-light",
217
+ "secondary-success": "group-active:bg-actions-success-pressed-overlay",
218
+ "secondary-warning": "group-active:bg-actions-warning-pressed-overlay",
219
+ "secondary-error": "group-active:bg-actions-danger-pressed-overlay",
220
+ "tertiary-primary": "group-active:bg-actions-primary-pressed-overlay",
221
+ "tertiary-neutral": "group-active:bg-actions-neutral-pressed-overlay",
222
+ "tertiary-neutral-invert": "group-active:bg-actions-neutral-invert-pressed-overlay",
223
+ "tertiary-success": "group-active:bg-actions-success-pressed-overlay",
224
+ "tertiary-warning": "group-active:bg-actions-warning-pressed-overlay",
225
+ "tertiary-error": "group-active:bg-actions-danger-pressed-overlay"
226
+ }, V = {
227
+ "cta-primary": "before:bg-actions-neutral-invert-hover-overlay",
228
+ "cta-neutral": "before:bg-actions-neutral-invert-hover-overlay",
229
+ "cta-neutral-invert": "before:bg-actions-neutral-hover-overlay",
230
+ "cta-success": "before:bg-actions-neutral-invert-hover-overlay",
231
+ "cta-warning": "before:bg-actions-neutral-invert-hover-overlay",
232
+ "cta-error": "before:bg-actions-neutral-invert-hover-overlay",
233
+ "cta-alpha-primary": "before:bg-actions-neutral-invert-hover-overlay",
234
+ "cta-alpha-neutral": "before:bg-actions-neutral-invert-hover-overlay",
235
+ "cta-alpha-neutral-invert": "before:bg-actions-neutral-hover-overlay",
236
+ "cta-alpha-success": "before:bg-actions-neutral-invert-hover-overlay",
237
+ "cta-alpha-warning": "before:bg-actions-neutral-invert-hover-overlay",
238
+ "cta-alpha-error": "before:bg-actions-neutral-invert-hover-overlay",
239
+ "secondary-primary": "before:bg-actions-primary-hover-overlay",
240
+ "secondary-neutral": "before:bg-actions-neutral-hover-overlay",
241
+ "secondary-neutral-invert": "before:bg-actions-neutral-invert-hover-overlay",
242
+ "secondary-success": "before:bg-actions-success-hover-overlay",
243
+ "secondary-warning": "before:bg-actions-warning-hover-overlay",
244
+ "secondary-error": "before:bg-actions-danger-hover-overlay",
245
+ "tertiary-primary": "before:bg-actions-primary-hover-overlay",
246
+ "tertiary-neutral": "before:bg-actions-neutral-hover-overlay",
247
+ "tertiary-neutral-invert": "before:bg-actions-neutral-invert-hover-overlay",
248
+ "tertiary-success": "before:bg-actions-success-hover-overlay",
249
+ "tertiary-warning": "before:bg-actions-warning-hover-overlay",
250
+ "tertiary-error": "before:bg-actions-danger-hover-overlay"
251
+ };
252
+ function H(e) {
253
+ let t = a(() => S(e.variant)), n = a(() => S(e.color)), r = a(() => S(e.disabled) ?? !1), i = a(() => `${t.value}-${n.value}`);
254
+ return {
255
+ variant: t,
256
+ color: n,
257
+ bgClass: a(() => L[t.value]?.[n.value] ?? ""),
258
+ textClass: a(() => R[t.value][n.value]),
259
+ borderClasses: a(() => t.value === "secondary" ? ["border", "border-control-soft-border"] : []),
260
+ decorationClass: a(() => t.value === "tertiary" ? "[text-decoration-line:var(--control-link-decoration)] underline-offset-3" : ""),
261
+ overlayClasses: a(() => r.value ? [] : [z[i.value] ?? "", B[i.value] ?? ""]),
262
+ beforeHoverOverlayClass: a(() => r.value ? "" : V[i.value] ?? "")
263
+ };
264
+ }
265
+ //#endregion
266
+ //#region src/composables/useControlShape.ts
267
+ var U = {
268
+ sm: {
269
+ height: "h-field-sm",
270
+ radius: "rounded-field-sm",
271
+ chevron: "size-3.5"
272
+ },
273
+ md: {
274
+ height: "h-field-md",
275
+ radius: "rounded-field-md",
276
+ chevron: "size-4"
277
+ },
278
+ lg: {
279
+ height: "h-field-lg",
280
+ radius: "rounded-field-lg",
281
+ chevron: "size-5"
282
+ },
283
+ xl: {
284
+ height: "h-field-xl",
285
+ radius: "rounded-field-xl",
286
+ chevron: "size-6"
287
+ }
288
+ }, W = {
289
+ xs: {
290
+ height: "h-button-xs",
291
+ square: "size-button-xs",
292
+ radius: "rounded-button-xs"
293
+ },
294
+ sm: {
295
+ height: "h-button-sm",
296
+ square: "size-button-sm",
297
+ radius: "rounded-button-sm"
298
+ },
299
+ md: {
300
+ height: "h-button-md",
301
+ square: "size-button-md",
302
+ radius: "rounded-button-md"
303
+ },
304
+ lg: {
305
+ height: "h-button-lg",
306
+ square: "size-button-lg",
307
+ radius: "rounded-button-lg"
308
+ }
309
+ };
310
+ function G(e, t) {
311
+ return a(() => e === "field" ? U[S(t)] : W[S(t)]);
312
+ }
313
+ //#endregion
314
+ //#region src/components/UiLoader/UiSpinnerIcon.vue
315
+ var K = /* @__PURE__ */ e({ default: () => X }), q = {}, J = {
316
+ xmlns: "http://www.w3.org/2000/svg",
317
+ fill: "none",
318
+ viewBox: "0 0 24 24"
319
+ };
320
+ function Y(e, t) {
321
+ return g(), c("svg", J, [...t[0] ||= [l("circle", {
322
+ class: "opacity-20",
323
+ cx: "12",
324
+ cy: "12",
325
+ r: "10",
326
+ stroke: "currentColor",
327
+ "stroke-width": "4"
328
+ }, null, -1), l("path", {
329
+ class: "opacity-100",
330
+ fill: "currentColor",
331
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
332
+ }, null, -1)]]);
333
+ }
334
+ var X = /*#__PURE__*/ P(q, [["render", Y]]), re = /*@__PURE__*/ d({
335
+ __name: "UiLoader",
336
+ props: { size: {
337
+ type: String,
338
+ default: "md",
339
+ validator: (e) => F.includes(e)
340
+ } },
341
+ setup(e) {
342
+ let t = e, n = O(() => t.size);
343
+ return (e, t) => (g(), c("div", null, [u(X, { class: m([C(n), "text-current animate-spin"]) }, null, 8, ["class"])]));
344
+ }
345
+ }), ie = /* @__PURE__ */ e({ default: () => Z }), Z = re, ae = I, oe = ["action", "body"], se = {
346
+ components: {
347
+ RenderSlot: n,
348
+ UiLoader: Z,
349
+ UiTooltip: t
350
+ },
351
+ props: {
352
+ variant: {
353
+ type: String,
354
+ default: "cta"
355
+ },
356
+ size: {
357
+ type: String,
358
+ default: "md",
359
+ validator: (e) => F.includes(e)
360
+ },
361
+ color: {
362
+ type: String,
363
+ default: "primary",
364
+ validator: (e) => ae.includes(e)
365
+ },
366
+ disabled: {
367
+ type: Boolean,
368
+ default: !1
369
+ },
370
+ showIconLeft: {
371
+ type: Boolean,
372
+ default: !0
373
+ },
374
+ icon: {
375
+ type: [String, Boolean],
376
+ default: void 0
377
+ },
378
+ label: {
379
+ type: String,
380
+ default: void 0
381
+ },
382
+ iconRight: {
383
+ type: [String, Boolean],
384
+ default: void 0
385
+ },
386
+ textStyle: {
387
+ type: String,
388
+ default: "action",
389
+ validator: (e) => oe.includes(e)
390
+ },
391
+ loading: {
392
+ type: Boolean,
393
+ default: !1
394
+ },
395
+ imageSource: {
396
+ type: String,
397
+ default: void 0
398
+ },
399
+ tooltip: {
400
+ type: [String, Object],
401
+ default: void 0
402
+ },
403
+ type: {
404
+ type: String,
405
+ default: "button"
406
+ },
407
+ href: {
408
+ type: String,
409
+ default: void 0
410
+ },
411
+ to: {
412
+ type: Object,
413
+ default: void 0
414
+ },
415
+ inline: {
416
+ type: Boolean,
417
+ default: !1
418
+ }
419
+ },
420
+ emits: [
421
+ "click",
422
+ "mouseenter",
423
+ "mouseleave"
424
+ ],
425
+ setup(e) {
426
+ let t = r(), n = a(() => t.default && t.default()), i = a(() => t.icon && t.icon()), o = a(() => !!n.value), s = a(() => !o.value && !n.value && (!!e.icon || !!e.iconRight)), c = a(() => e.disabled || e.loading), l = a(() => {
427
+ let t = c.value;
428
+ return e.inline && (t || !e.to && !e.href) ? {
429
+ is: "span",
430
+ props: {
431
+ role: "button",
432
+ tabindex: t ? -1 : 0,
433
+ "aria-disabled": t || void 0
434
+ }
435
+ } : t && (e.to || e.href) ? {
436
+ is: "button",
437
+ props: {
438
+ type: "button",
439
+ disabled: !0
440
+ }
441
+ } : e.to ? {
442
+ is: "router-link",
443
+ props: { to: e.to }
444
+ } : e.href ? {
445
+ is: "a",
446
+ props: { href: e.href }
447
+ } : {
448
+ is: "button",
449
+ props: {
450
+ type: e.type,
451
+ disabled: t
452
+ }
453
+ };
454
+ }), u = a(() => !c.value && (!!e.href || !!e.to)), d = ee(() => e.size), p = O(() => e.size), m = a(() => e.textStyle === "body" ? d.value : p.value), h = G("button", () => e.size), g = a(() => {
455
+ let t = (n.value && typeof n.value[0].children == "string" && n.value[0].children || e.label)?.trim();
456
+ if (t) return t;
457
+ if (s.value && e.icon && typeof e.icon == "string") {
458
+ let t = e.icon.replace(/^i-[a-z0-9]+-/, "").replace(/-/g, " ");
459
+ return t ? `${t} icon` : "icon";
460
+ }
461
+ }), _ = f();
462
+ function v(e) {
463
+ c.value ? e.preventDefault() : _?.emit("click", e);
464
+ }
465
+ let y = a(() => [
466
+ s.value ? h.value.square : h.value.height,
467
+ { "grid place-items-center": s.value },
468
+ e.textStyle === "body" ? {
469
+ "text-content-legends-medium-md": e.size === "xs" || e.size === "sm",
470
+ "text-content-text-md-regular": e.size === "md",
471
+ "text-content-text-lg-regular": e.size === "lg"
472
+ } : {
473
+ "text-action-button-sm": e.size === "xs" || e.size === "sm",
474
+ "text-action-button-md": e.size === "md",
475
+ "text-action-button-lg": e.size === "lg"
476
+ },
477
+ e.size === "xs" ? "px-2" : e.size === "sm" ? "px-2.5" : e.size === "lg" ? "px-4" : "px-3",
478
+ { "inline-flex": u.value }
479
+ ]), { bgClass: b, textClass: x, borderClasses: S, decorationClass: C, overlayClasses: w } = H({
480
+ variant: () => e.inline ? "tertiary" : e.variant,
481
+ color: () => e.color,
482
+ disabled: c
483
+ }), E = b, D = a(() => x.value ? [x.value] : []);
484
+ function k(e) {
485
+ l.value.is !== "span" || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.currentTarget.click());
486
+ }
487
+ return T(() => !e.label && !e.icon && !e.iconRight && !n.value, (e) => {
488
+ e && console.warn("UiButton: You must provide a label or an icon to the button");
489
+ }, { immediate: !0 }), {
490
+ component: l,
491
+ defaultSlot: n,
492
+ iconSlot: i,
493
+ hasLabel: o,
494
+ isLink: u,
495
+ iconSizeClasses: m,
496
+ trailingIconSizeClasses: d,
497
+ shape: h,
498
+ buttonClasses: y,
499
+ bgClasses: E,
500
+ focusRingClasses: "group-focus-visible:focus-ring",
501
+ textClasses: D,
502
+ borderClasses: S,
503
+ decorationClass: C,
504
+ overlayClasses: w,
505
+ isSquare: s,
506
+ finalDisabled: c,
507
+ labelFinal: g,
508
+ onClick: v,
509
+ onInlineKeydown: k
510
+ };
511
+ }
512
+ }, ce = /* @__PURE__ */ e({ default: () => $ }), le = { class: "button-wrapper flex items-center whitespace-nowrap h-full relative z-20" }, ue = ["src", "alt"];
513
+ function Q(e, t, n, r, a, d) {
514
+ let f = y("RenderSlot"), h = y("UiLoader"), _ = y("UiTooltip");
515
+ return n.inline ? (g(), o(b(r.component.is), p({ key: 0 }, r.component.props, {
516
+ class: ["ui-button inline -mx-0.5 px-0.5 py-0.5 box-decoration-clone text-left font-semibold underline-offset-3 focus-indicator-none focus-visible:focus-ring", [
517
+ r.textClasses,
518
+ r.decorationClass,
519
+ r.finalDisabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:underline"
520
+ ]],
521
+ "data-testid": "ui-button",
522
+ onClick: r.onClick,
523
+ onKeydown: r.onInlineKeydown,
524
+ onMouseenter: t[0] ||= (t) => e.$emit("mouseenter"),
525
+ onMouseleave: t[1] ||= (t) => e.$emit("mouseleave")
526
+ }), {
527
+ default: E(() => [u(f, { vnodes: r.defaultSlot }, null, 8, ["vnodes"])]),
528
+ _: 1
529
+ }, 16, [
530
+ "class",
531
+ "onClick",
532
+ "onKeydown"
533
+ ])) : (g(), o(b(r.component.is), p({ key: 1 }, r.component.props, {
534
+ "aria-label": !r.isLink || r.isSquare ? r.labelFinal : void 0,
535
+ class: ["ui-button group align-center flex justify-center relative transition-all duration-150 focus-indicator-none", [
536
+ r.shape.radius,
537
+ r.buttonClasses,
538
+ r.textClasses,
539
+ { "cursor-pointer": !r.finalDisabled },
540
+ { "cursor-not-allowed": r.finalDisabled },
541
+ { "opacity-50": n.disabled }
542
+ ]],
543
+ "data-testid": "ui-button",
544
+ onClick: r.onClick,
545
+ onMouseenter: t[2] ||= (t) => e.$emit("mouseenter"),
546
+ onMouseleave: t[3] ||= (t) => e.$emit("mouseleave")
547
+ }), {
548
+ default: E(() => [
549
+ l("div", { class: m(["absolute h-full top-0 left-0 z-0 rounded-[inherit] w-full", [
550
+ r.bgClasses,
551
+ r.borderClasses,
552
+ r.focusRingClasses
553
+ ]]) }, null, 2),
554
+ l("div", { class: m(["button-overlay absolute h-full top-0 left-0 z-10 rounded-[inherit] w-full", r.overlayClasses]) }, null, 2),
555
+ u(_, { content: typeof n.tooltip == "string" ? n.tooltip : n.tooltip?.content }, {
556
+ default: E(() => [l("div", le, [
557
+ n.loading ? (g(), o(h, {
558
+ key: 0,
559
+ size: n.size,
560
+ class: m({ "mr-2": r.hasLabel })
561
+ }, null, 8, ["size", "class"])) : n.showIconLeft ? (g(), c(i, { key: 1 }, [r.iconSlot ? (g(), c("div", {
562
+ key: 0,
563
+ class: m([[r.iconSizeClasses, { "mr-2": r.hasLabel }], "shrink-0"])
564
+ }, [u(f, { vnodes: r.iconSlot }, null, 8, ["vnodes"])], 2)) : n.imageSource ? (g(), c("div", {
565
+ key: 1,
566
+ class: m([[r.iconSizeClasses, { "mr-2": r.hasLabel }], "shrink-0"])
567
+ }, [l("img", {
568
+ src: n.imageSource,
569
+ alt: `${r.labelFinal} button image`
570
+ }, null, 8, ue)], 2)) : n.icon ? (g(), c("div", {
571
+ key: 2,
572
+ class: m([[
573
+ n.icon,
574
+ r.iconSizeClasses,
575
+ { "mr-2": r.hasLabel }
576
+ ], "shrink-0"]),
577
+ "data-testid": "ui-button-icon"
578
+ }, null, 2)) : s("", !0)], 64)) : s("", !0),
579
+ l("span", { class: m(["content w-full", r.decorationClass]) }, [u(f, { vnodes: r.defaultSlot }, null, 8, ["vnodes"])], 2),
580
+ n.iconRight ? (g(), c("div", {
581
+ key: 2,
582
+ class: m([[
583
+ n.iconRight,
584
+ r.trailingIconSizeClasses,
585
+ { "ml-2": r.hasLabel }
586
+ ], "shrink-0"]),
587
+ "data-testid": "ui-button-icon-right"
588
+ }, null, 2)) : s("", !0)
589
+ ])]),
590
+ _: 1
591
+ }, 8, ["content"])
592
+ ]),
593
+ _: 1
594
+ }, 16, [
595
+ "aria-label",
596
+ "class",
597
+ "onClick"
598
+ ]));
599
+ }
600
+ var $ = /*#__PURE__*/ P(se, [["render", Q]]);
601
+ //#endregion
602
+ export { X as a, H as c, M as d, O as f, ie as i, P as l, ce as n, K as o, Z as r, G as s, $ as t, N as u };