@volverjs/ui-vue 0.0.6-beta.7 → 0.0.7-beta.1

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 (422) hide show
  1. package/README.md +3 -5
  2. package/auto-imports.d.ts +2 -0
  3. package/dist/components/VvAccordion/VvAccordion.es.js +220 -4
  4. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  5. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +8 -8
  6. package/dist/components/VvAccordion/index.d.ts +1 -4
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +221 -8
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +6 -6
  10. package/dist/components/VvAccordionGroup/index.d.ts +2 -5
  11. package/dist/components/VvAction/VvAction.es.js +12 -8
  12. package/dist/components/VvAction/VvAction.umd.js +1 -1
  13. package/dist/components/VvAction/VvAction.vue.d.ts +4 -4
  14. package/dist/components/VvAction/index.d.ts +1 -1
  15. package/dist/components/VvAlert/VvAlert.es.js +661 -0
  16. package/dist/components/VvAlert/VvAlert.umd.js +1 -0
  17. package/dist/components/VvAlert/VvAlert.vue.d.ts +104 -0
  18. package/dist/components/VvAlert/index.d.ts +95 -0
  19. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +799 -0
  20. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -0
  21. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +89 -0
  22. package/dist/components/VvAlertGroup/index.d.ts +55 -0
  23. package/dist/components/VvAvatar/VvAvatar.es.js +3 -3
  24. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -2
  25. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +3 -3
  26. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -2
  27. package/dist/components/VvBadge/VvBadge.es.js +3 -3
  28. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  29. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +3 -3
  30. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +3 -3
  31. package/dist/components/VvButton/VvButton.es.js +14 -10
  32. package/dist/components/VvButton/VvButton.umd.js +1 -1
  33. package/dist/components/VvButton/VvButton.vue.d.ts +13 -13
  34. package/dist/components/VvButton/index.d.ts +2 -2
  35. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +3 -3
  36. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +4 -4
  37. package/dist/components/VvCard/VvCard.es.js +221 -2
  38. package/dist/components/VvCard/VvCard.umd.js +1 -1
  39. package/dist/components/VvCard/VvCard.vue.d.ts +5 -5
  40. package/dist/components/VvCheckbox/VvCheckbox.es.js +3 -3
  41. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +18 -18
  42. package/dist/components/VvCheckbox/index.d.ts +3 -3
  43. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +3 -3
  44. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +16 -16
  45. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  46. package/dist/components/VvCombobox/VvCombobox.es.js +65 -60
  47. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  48. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +56 -44
  49. package/dist/components/VvCombobox/index.d.ts +13 -7
  50. package/dist/components/VvDialog/VvDialog.es.js +19 -14
  51. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  52. package/dist/components/VvDialog/VvDialog.vue.d.ts +7 -7
  53. package/dist/components/VvDialog/index.d.ts +2 -2
  54. package/dist/components/VvDropdown/VvDropdown.es.js +22 -23
  55. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  56. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +16 -16
  57. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +4 -4
  58. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
  59. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +1 -1
  60. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +4 -4
  61. package/dist/components/VvDropdown/index.d.ts +1 -1
  62. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +17 -11
  63. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  64. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +9 -5
  65. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  66. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +3 -3
  67. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +12 -8
  68. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  69. package/dist/components/VvIcon/VvIcon.vue.d.ts +1 -1
  70. package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
  71. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
  72. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  73. package/dist/components/VvInputText/VvInputText.es.js +5 -5
  74. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  75. package/dist/components/VvInputText/VvInputText.vue.d.ts +30 -30
  76. package/dist/components/VvInputText/index.d.ts +5 -5
  77. package/dist/components/VvNav/VvNav.es.js +12 -8
  78. package/dist/components/VvNav/VvNav.umd.js +1 -1
  79. package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
  80. package/dist/components/VvNavItemTitle/VvNavItemTitle.vue.d.ts +1 -1
  81. package/dist/components/VvNavSeparator/VvNavSeparator.d.ts +1 -1
  82. package/dist/components/VvProgress/VvProgress.es.js +3 -3
  83. package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
  84. package/dist/components/VvRadio/VvRadio.es.js +3 -3
  85. package/dist/components/VvRadio/VvRadio.vue.d.ts +18 -18
  86. package/dist/components/VvRadio/index.d.ts +3 -3
  87. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +3 -3
  88. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +16 -16
  89. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  90. package/dist/components/VvSelect/VvSelect.es.js +3 -3
  91. package/dist/components/VvSelect/VvSelect.vue.d.ts +26 -26
  92. package/dist/components/VvSelect/index.d.ts +4 -4
  93. package/dist/components/VvTab/VvTab.es.js +12 -8
  94. package/dist/components/VvTab/VvTab.umd.js +1 -1
  95. package/dist/components/VvTab/VvTab.vue.d.ts +1 -1
  96. package/dist/components/VvTextarea/VvTextarea.es.js +3 -3
  97. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +24 -24
  98. package/dist/components/VvTextarea/index.d.ts +3 -3
  99. package/dist/components/VvTooltip/VvTooltip.es.js +3 -3
  100. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
  101. package/dist/components/common/HintSlot.d.ts +1 -1
  102. package/dist/components/index.es.js +773 -769
  103. package/dist/components/index.umd.js +1 -1
  104. package/dist/composables/alert/useInjectAlert.d.ts +9 -0
  105. package/dist/composables/alert/useProvideAlert.d.ts +10 -0
  106. package/dist/composables/dropdown/useInjectDropdown.d.ts +17 -16
  107. package/dist/composables/dropdown/useProvideDropdown.d.ts +7 -3
  108. package/dist/composables/useVolver.d.ts +1 -2
  109. package/dist/constants.d.ts +33 -4
  110. package/dist/directives/index.es.js +3 -3
  111. package/dist/directives/v-tooltip.es.js +3 -3
  112. package/dist/icons.es.js +3 -3
  113. package/dist/icons.umd.js +1 -1
  114. package/dist/props/index.d.ts +16 -16
  115. package/dist/resolvers/unplugin.es.js +6 -3
  116. package/dist/resolvers/unplugin.umd.js +1 -1
  117. package/dist/stories/Accordion/Accordion.settings.d.ts +18 -17
  118. package/dist/stories/Accordion/Accordion.stories.d.ts +7 -0
  119. package/dist/stories/Accordion/AccordionSlots.stories.d.ts +7 -0
  120. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +23 -4
  121. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +134 -0
  122. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +894 -0
  123. package/dist/stories/Alert/Alert.settings.d.ts +105 -0
  124. package/dist/stories/Alert/Alert.stories.d.ts +9 -0
  125. package/dist/stories/Alert/Alert.test.d.ts +2 -0
  126. package/dist/stories/Alert/AlertModifiers.stories.d.ts +13 -0
  127. package/dist/stories/Alert/AlertSlots.stories.d.ts +10 -0
  128. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +97 -0
  129. package/dist/stories/AlertGroup/AlertGroup.stories.d.ts +8 -0
  130. package/dist/stories/AlertGroup/AlertGroup.test.d.ts +2 -0
  131. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +14 -0
  132. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +8 -0
  133. package/dist/stories/Avatar/Avatar.settings.d.ts +2 -33
  134. package/dist/stories/Avatar/Avatar.stories.d.ts +7 -0
  135. package/dist/stories/Avatar/AvatarBadge.stories.d.ts +6 -0
  136. package/dist/stories/Avatar/AvatarModifiers.stories.d.ts +13 -0
  137. package/dist/stories/Avatar/AvatarSlots.stories.d.ts +6 -0
  138. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +0 -6
  139. package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -0
  140. package/dist/stories/AvatarGroup/AvatarGroupModifiers.stories.d.ts +7 -0
  141. package/dist/stories/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +6 -0
  142. package/dist/stories/Badge/Badge.settings.d.ts +0 -3
  143. package/dist/stories/Badge/Badge.stories.d.ts +7 -0
  144. package/dist/stories/Badge/BadgeSlots.stories.d.ts +6 -0
  145. package/dist/stories/Breadcrumb/Breadcrumb.stories.d.ts +7 -0
  146. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
  147. package/dist/stories/Breadcrumb/BreadcrumbSlots.stories.d.ts +6 -0
  148. package/dist/stories/Button/Button.settings.d.ts +1 -18
  149. package/dist/stories/Button/Button.stories.d.ts +6 -0
  150. package/dist/stories/Button/ButtonIcon.stories.d.ts +10 -0
  151. package/dist/stories/Button/ButtonLink.stories.d.ts +7 -0
  152. package/dist/stories/Button/ButtonLoading.stories.d.ts +8 -0
  153. package/dist/stories/Button/ButtonModifiers.stories.d.ts +17 -0
  154. package/dist/stories/Button/ButtonSlots.stories.d.ts +9 -0
  155. package/dist/stories/Button/ButtonState.stories.d.ts +8 -0
  156. package/dist/stories/Button/ButtonToggle.stories.d.ts +9 -0
  157. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +0 -4
  158. package/dist/stories/ButtonGroup/ButtonGroup.stories.d.ts +6 -0
  159. package/dist/stories/ButtonGroup/ButtonGroupModifiers.stories.d.ts +8 -0
  160. package/dist/stories/ButtonGroup/ButtonGroupSlots.stories.d.ts +6 -0
  161. package/dist/stories/ButtonGroup/ButtonGroupToggle.stories.d.ts +8 -0
  162. package/dist/stories/Card/Card.settings.d.ts +0 -3
  163. package/dist/stories/Card/Card.stories.d.ts +6 -0
  164. package/dist/stories/Card/CardSlots.stories.d.ts +9 -0
  165. package/dist/stories/Checkbox/Checkbox.settings.d.ts +1 -21
  166. package/dist/stories/Checkbox/Checkbox.stories.d.ts +13 -0
  167. package/dist/stories/Checkbox/CheckboxBinary.stories.d.ts +7 -0
  168. package/dist/stories/Checkbox/CheckboxSlots.stories.d.ts +7 -0
  169. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -27
  170. package/dist/stories/CheckboxGroup/CheckboxGroup.stories.d.ts +12 -0
  171. package/dist/stories/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +8 -0
  172. package/dist/stories/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +7 -0
  173. package/dist/stories/Combobox/Combobox.settings.d.ts +2 -54
  174. package/dist/stories/Combobox/Combobox.stories.d.ts +21 -0
  175. package/dist/stories/Combobox/ComboboxIconPosition.stories.d.ts +8 -0
  176. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +8 -0
  177. package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +9 -0
  178. package/dist/stories/Combobox/ComboboxSlots.stories.d.ts +10 -0
  179. package/dist/stories/Dialog/Dialog.settings.d.ts +1 -1
  180. package/dist/stories/Dialog/Dialog.stories.d.ts +7 -0
  181. package/dist/stories/Dialog/DialogSlots.stories.d.ts +8 -0
  182. package/dist/stories/Dropdown/Dropdown.settings.d.ts +1 -1
  183. package/dist/stories/Dropdown/Dropdown.stories.d.ts +9 -0
  184. package/dist/stories/Dropdown/DropdownContextmenuDirective.stories.d.ts +6 -0
  185. package/dist/stories/Dropdown/DropdownMultilevel.stories.d.ts +6 -0
  186. package/dist/stories/Dropdown/DropdownSlots.stories.d.ts +8 -0
  187. package/dist/stories/Icon/Icon.settings.d.ts +1 -3
  188. package/dist/stories/Icon/Icon.stories.d.ts +8 -0
  189. package/dist/stories/Icon/IconsCollection.stories.d.ts +6 -0
  190. package/dist/stories/InputText/InputText.settings.d.ts +1 -74
  191. package/dist/stories/InputText/InputText.stories.d.ts +15 -0
  192. package/dist/stories/InputText/InputTextIconPosition.stories.d.ts +8 -0
  193. package/dist/stories/InputText/InputTextLength.stories.d.ts +10 -0
  194. package/dist/stories/InputText/InputTextMinMax.stories.d.ts +9 -0
  195. package/dist/stories/InputText/InputTextSlots.stories.d.ts +8 -0
  196. package/dist/stories/InputText/InputTextType.stories.d.ts +18 -0
  197. package/dist/stories/Nav/Nav.settings.d.ts +0 -3
  198. package/dist/stories/Nav/Nav.stories.d.ts +6 -0
  199. package/dist/stories/Nav/NavModifiers.stories.d.ts +9 -0
  200. package/dist/stories/Progress/Progress.settings.d.ts +0 -6
  201. package/dist/stories/Progress/Progress.stories.d.ts +7 -0
  202. package/dist/stories/Radio/Radio.settings.d.ts +1 -19
  203. package/dist/stories/Radio/Radio.stories.d.ts +11 -0
  204. package/dist/stories/Radio/RadioSlots.stories.d.ts +7 -0
  205. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -27
  206. package/dist/stories/RadioGroup/RadioGroup.stories.d.ts +12 -0
  207. package/dist/stories/RadioGroup/RadioGroupOptions.stories.d.ts +8 -0
  208. package/dist/stories/RadioGroup/RadioGroupSlots.stories.d.ts +7 -0
  209. package/dist/stories/Select/Select.settings.d.ts +1 -47
  210. package/dist/stories/Select/Select.stories.d.ts +15 -0
  211. package/dist/stories/Select/SelectIconPosition.stories.d.ts +8 -0
  212. package/dist/stories/Select/SelectOptions.stories.d.ts +9 -0
  213. package/dist/stories/Select/SelectSlots.stories.d.ts +8 -0
  214. package/dist/stories/Tab/Tab.stories.d.ts +6 -0
  215. package/dist/stories/Textarea/Textarea.settings.d.ts +1 -43
  216. package/dist/stories/Textarea/Textarea.stories.d.ts +14 -0
  217. package/dist/stories/Textarea/TextareaLength.stories.d.ts +10 -0
  218. package/dist/stories/Textarea/TextareaSlots.stories.d.ts +8 -0
  219. package/dist/stories/Textarea/TextareatIconPosition.stories.d.ts +8 -0
  220. package/dist/stories/Tooltip/Tooltip.settings.d.ts +2 -39
  221. package/dist/stories/Tooltip/Tooltip.stories.d.ts +6 -0
  222. package/dist/stories/Tooltip/TooltipDirective.stories.d.ts +10 -0
  223. package/dist/stories/argTypes.d.ts +5 -125
  224. package/package.json +66 -49
  225. package/src/assets/icons/detailed.json +1 -1
  226. package/src/assets/icons/normal.json +1 -1
  227. package/src/assets/icons/simple.json +1 -1
  228. package/src/components/VvAccordion/index.ts +2 -4
  229. package/src/components/VvAccordionGroup/index.ts +3 -4
  230. package/src/components/VvAction/VvAction.vue +1 -1
  231. package/src/components/VvAlert/VvAlert.vue +54 -0
  232. package/src/components/VvAlert/index.ts +162 -0
  233. package/src/components/VvAlertGroup/VvAlertGroup.vue +34 -0
  234. package/src/components/VvAlertGroup/index.ts +122 -0
  235. package/src/components/VvCard/index.ts +3 -1
  236. package/src/components/VvCombobox/VvCombobox.vue +22 -26
  237. package/src/components/VvCombobox/index.ts +9 -3
  238. package/src/components/VvDialog/VvDialog.vue +11 -7
  239. package/src/components/VvDialog/index.ts +2 -2
  240. package/src/components/VvDropdown/VvDropdown.vue +8 -4
  241. package/src/components/VvDropdown/VvDropdownItem.vue +2 -2
  242. package/src/composables/alert/useInjectAlert.ts +8 -0
  243. package/src/composables/alert/useProvideAlert.ts +23 -0
  244. package/src/composables/dropdown/useInjectDropdown.ts +3 -28
  245. package/src/composables/dropdown/useProvideDropdown.ts +14 -15
  246. package/src/composables/useVolver.ts +1 -2
  247. package/src/constants.ts +42 -4
  248. package/src/props/index.ts +3 -3
  249. package/src/resolvers/unplugin.ts +6 -3
  250. package/src/stories/Accordion/Accordion.settings.ts +18 -7
  251. package/src/stories/Accordion/Accordion.stories.ts +45 -0
  252. package/src/stories/Accordion/AccordionSlots.stories.ts +29 -0
  253. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +22 -0
  254. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +62 -0
  255. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +53 -0
  256. package/src/stories/Alert/Alert.settings.ts +110 -0
  257. package/src/stories/Alert/Alert.stories.ts +60 -0
  258. package/src/stories/Alert/Alert.test.ts +95 -0
  259. package/src/stories/Alert/AlertModifiers.stories.ts +77 -0
  260. package/src/stories/Alert/AlertSlots.stories.ts +74 -0
  261. package/src/stories/AlertGroup/AlertGroup.settings.ts +110 -0
  262. package/src/stories/AlertGroup/AlertGroup.stories.ts +50 -0
  263. package/src/stories/AlertGroup/AlertGroup.test.ts +76 -0
  264. package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +103 -0
  265. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +67 -0
  266. package/src/stories/Avatar/Avatar.settings.ts +7 -6
  267. package/src/stories/Avatar/Avatar.stories.ts +42 -0
  268. package/src/stories/Avatar/Avatar.test.ts +1 -1
  269. package/src/stories/Avatar/AvatarBadge.stories.ts +36 -0
  270. package/src/stories/Avatar/AvatarModifiers.stories.ts +100 -0
  271. package/src/stories/Avatar/AvatarSlots.stories.ts +34 -0
  272. package/src/stories/AvatarGroup/AvatarGroup.stories.ts +35 -0
  273. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +31 -0
  274. package/src/stories/AvatarGroup/{AvatarGroupSlotDefault.stories.mdx → AvatarGroupSlotDefault.stories.ts} +24 -30
  275. package/src/stories/Badge/Badge.stories.ts +43 -0
  276. package/src/stories/Badge/BadgeSlots.stories.ts +23 -0
  277. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +41 -0
  278. package/src/stories/Breadcrumb/Breadcrumb.test.ts +1 -1
  279. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +37 -0
  280. package/src/stories/Button/Button.settings.ts +2 -11
  281. package/src/stories/Button/Button.stories.ts +38 -0
  282. package/src/stories/Button/ButtonIcon.stories.ts +67 -0
  283. package/src/stories/Button/ButtonLink.stories.ts +40 -0
  284. package/src/stories/Button/ButtonLoading.stories.ts +41 -0
  285. package/src/stories/Button/ButtonModifiers.stories.ts +158 -0
  286. package/src/stories/Button/ButtonSlots.stories.ts +87 -0
  287. package/src/stories/Button/ButtonState.stories.ts +42 -0
  288. package/src/stories/Button/ButtonToggle.stories.ts +52 -0
  289. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +39 -0
  290. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +39 -0
  291. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +38 -0
  292. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +41 -0
  293. package/src/stories/Card/Card.stories.ts +46 -0
  294. package/src/stories/Card/CardSlots.stories.ts +81 -0
  295. package/src/stories/Checkbox/Checkbox.settings.ts +0 -2
  296. package/src/stories/Checkbox/Checkbox.stories.ts +97 -0
  297. package/src/stories/Checkbox/CheckboxBinary.stories.ts +33 -0
  298. package/src/stories/Checkbox/CheckboxSlots.stories.ts +31 -0
  299. package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +87 -0
  300. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +53 -0
  301. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +47 -0
  302. package/src/stories/Combobox/Combobox.settings.ts +3 -23
  303. package/src/stories/Combobox/Combobox.stories.ts +176 -0
  304. package/src/stories/Combobox/Combobox.test.ts +2 -2
  305. package/src/stories/Combobox/ComboboxIconPosition.stories.ts +43 -0
  306. package/src/stories/Combobox/ComboboxMultiple.stories.ts +41 -0
  307. package/src/stories/Combobox/ComboboxOptions.stories.ts +78 -0
  308. package/src/stories/Combobox/ComboboxSlots.stories.ts +104 -0
  309. package/src/stories/Dialog/Dialog.settings.ts +1 -1
  310. package/src/stories/Dialog/Dialog.stories.ts +51 -0
  311. package/src/stories/Dialog/Dialog.test.ts +2 -2
  312. package/src/stories/Dialog/DialogSlots.stories.ts +39 -0
  313. package/src/stories/Dropdown/Dropdown.stories.ts +107 -0
  314. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +49 -0
  315. package/src/stories/Dropdown/DropdownMultilevel.stories.ts +61 -0
  316. package/src/stories/Dropdown/DropdownSlots.stories.ts +95 -0
  317. package/src/stories/Icon/Icon.settings.ts +1 -0
  318. package/src/stories/Icon/Icon.stories.ts +48 -0
  319. package/src/stories/Icon/IconsCollection.stories.ts +53 -0
  320. package/src/stories/InputText/InputText.settings.ts +3 -39
  321. package/src/stories/InputText/InputText.stories.ts +121 -0
  322. package/src/stories/InputText/InputTextIconPosition.stories.ts +43 -0
  323. package/src/stories/InputText/InputTextLength.stories.ts +58 -0
  324. package/src/stories/InputText/InputTextMinMax.stories.ts +51 -0
  325. package/src/stories/InputText/InputTextSlots.stories.ts +39 -0
  326. package/src/stories/InputText/InputTextType.stories.ts +119 -0
  327. package/src/stories/Nav/Nav.stories.ts +33 -0
  328. package/src/stories/Nav/NavModifiers.stories.ts +47 -0
  329. package/src/stories/Progress/Progress.settings.ts +0 -3
  330. package/src/stories/Progress/Progress.stories.ts +41 -0
  331. package/src/stories/Radio/Radio.stories.ts +81 -0
  332. package/src/stories/Radio/RadioSlots.stories.ts +31 -0
  333. package/src/stories/RadioGroup/RadioGroup.stories.ts +88 -0
  334. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +53 -0
  335. package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +47 -0
  336. package/src/stories/Select/Select.settings.ts +0 -5
  337. package/src/stories/Select/Select.stories.ts +113 -0
  338. package/src/stories/Select/SelectIconPosition.stories.ts +43 -0
  339. package/src/stories/Select/SelectOptions.stories.ts +77 -0
  340. package/src/stories/Select/SelectSlots.stories.ts +39 -0
  341. package/src/stories/Tab/Tab.stories.ts +70 -0
  342. package/src/stories/Textarea/Textarea.settings.ts +0 -8
  343. package/src/stories/Textarea/Textarea.stories.ts +107 -0
  344. package/src/stories/Textarea/TextareaLength.stories.ts +58 -0
  345. package/src/stories/Textarea/TextareaSlots.stories.ts +39 -0
  346. package/src/stories/Textarea/TextareatIconPosition.stories.ts +43 -0
  347. package/src/stories/Tooltip/Tooltip.settings.ts +4 -4
  348. package/src/stories/Tooltip/Tooltip.stories.ts +40 -0
  349. package/src/stories/Tooltip/TooltipDirective.stories.ts +68 -0
  350. package/src/stories/argTypes.ts +5 -59
  351. package/src/stories/Accordion/Accordion.stories.mdx +0 -45
  352. package/src/stories/Accordion/AccordionSlots.stories.mdx +0 -58
  353. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +0 -58
  354. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +0 -59
  355. package/src/stories/Avatar/Avatar.stories.mdx +0 -40
  356. package/src/stories/Avatar/AvatarBadge.stories.mdx +0 -41
  357. package/src/stories/Avatar/AvatarModifiers.stories.mdx +0 -87
  358. package/src/stories/Avatar/AvatarSlotDefault.stories.mdx +0 -29
  359. package/src/stories/AvatarGroup/AvatarGroup.stories.mdx +0 -30
  360. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.mdx +0 -24
  361. package/src/stories/Badge/Badge.stories.mdx +0 -51
  362. package/src/stories/Badge/BadgeSlots.stories.mdx +0 -20
  363. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +0 -50
  364. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +0 -43
  365. package/src/stories/Button/Button.stories.mdx +0 -35
  366. package/src/stories/Button/ButtonIcon.stories.mdx +0 -153
  367. package/src/stories/Button/ButtonLink.stories.mdx +0 -72
  368. package/src/stories/Button/ButtonLoading.stories.mdx +0 -108
  369. package/src/stories/Button/ButtonModifiers.stories.mdx +0 -257
  370. package/src/stories/Button/ButtonSlots.stories.mdx +0 -116
  371. package/src/stories/Button/ButtonState.stories.mdx +0 -66
  372. package/src/stories/Button/ButtonToggle.stories.mdx +0 -112
  373. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +0 -37
  374. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.mdx +0 -52
  375. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +0 -37
  376. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +0 -73
  377. package/src/stories/Card/Card.stories.mdx +0 -40
  378. package/src/stories/Card/CardSlots.stories.mdx +0 -98
  379. package/src/stories/Checkbox/Checkbox.stories.mdx +0 -164
  380. package/src/stories/Checkbox/CheckboxBinary.stories.mdx +0 -68
  381. package/src/stories/Checkbox/CheckboxSlots.stories.mdx +0 -46
  382. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +0 -135
  383. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.mdx +0 -100
  384. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +0 -68
  385. package/src/stories/Combobox/Combobox.stories.mdx +0 -324
  386. package/src/stories/Combobox/ComboboxIconPosition.stories.mdx +0 -78
  387. package/src/stories/Combobox/ComboboxMultiple.stories.mdx +0 -73
  388. package/src/stories/Combobox/ComboboxOptions.stories.mdx +0 -135
  389. package/src/stories/Combobox/ComboboxSlots.stories.mdx +0 -153
  390. package/src/stories/Dialog/Dialog.stories.mdx +0 -56
  391. package/src/stories/Dialog/DialogSlots.stories.mdx +0 -63
  392. package/src/stories/Dropdown/Dropdown.stories.mdx +0 -124
  393. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +0 -41
  394. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +0 -56
  395. package/src/stories/Dropdown/DropdownSlots.stories.mdx +0 -114
  396. package/src/stories/Icon/Icon.stories.mdx +0 -91
  397. package/src/stories/Icon/IconsCollection.stories.mdx +0 -69
  398. package/src/stories/InputText/InputText.stories.mdx +0 -211
  399. package/src/stories/InputText/InputTextIconPosition.stories.mdx +0 -78
  400. package/src/stories/InputText/InputTextLength.stories.mdx +0 -110
  401. package/src/stories/InputText/InputTextMinMax.stories.mdx +0 -112
  402. package/src/stories/InputText/InputTextSlots.stories.mdx +0 -69
  403. package/src/stories/InputText/InputTextType.stories.mdx +0 -259
  404. package/src/stories/Nav/Nav.stories.mdx +0 -28
  405. package/src/stories/Nav/NavModifiers.stories.mdx +0 -48
  406. package/src/stories/Progress/Progress.stories.mdx +0 -30
  407. package/src/stories/Radio/Radio.stories.mdx +0 -128
  408. package/src/stories/Radio/RadioSlots.stories.mdx +0 -46
  409. package/src/stories/RadioGroup/RadioGroup.stories.mdx +0 -135
  410. package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +0 -100
  411. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +0 -68
  412. package/src/stories/Select/Select.stories.mdx +0 -196
  413. package/src/stories/Select/SelectIconPosition.stories.mdx +0 -78
  414. package/src/stories/Select/SelectOptions.stories.mdx +0 -135
  415. package/src/stories/Select/SelectSlots.stories.mdx +0 -48
  416. package/src/stories/Tab/Tab.stories.mdx +0 -65
  417. package/src/stories/Textarea/Textarea.stories.mdx +0 -187
  418. package/src/stories/Textarea/TextareaLength.stories.mdx +0 -110
  419. package/src/stories/Textarea/TextareaSlots.stories.mdx +0 -69
  420. package/src/stories/Textarea/TextareatIconPosition.stories.mdx +0 -78
  421. package/src/stories/Tooltip/Tooltip.stories.mdx +0 -102
  422. package/src/stories/Tooltip/TooltipDirective.stories.mdx +0 -99
@@ -0,0 +1,799 @@
1
+ import { provide, computed, unref, inject, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, createElementVNode, renderSlot, toDisplayString, createTextVNode, createVNode, TransitionGroup, withCtx, Fragment, renderList } from "vue";
2
+ import mitt from "mitt";
3
+ import { iconExists, Icon, addIcon } from "@iconify/vue";
4
+ import { nanoid } from "nanoid";
5
+ var Side = /* @__PURE__ */ ((Side2) => {
6
+ Side2["left"] = "left";
7
+ Side2["right"] = "right";
8
+ Side2["top"] = "top";
9
+ Side2["bottom"] = "bottom";
10
+ return Side2;
11
+ })(Side || {});
12
+ var Placement = /* @__PURE__ */ ((Placement2) => {
13
+ Placement2["topStart"] = "top-start";
14
+ Placement2["topEnd"] = "top-end";
15
+ Placement2["bottomStart"] = "bottom-start";
16
+ Placement2["bottomEnd"] = "bottom-end";
17
+ Placement2["leftStart"] = "left-start";
18
+ Placement2["leftEnd"] = "left-end";
19
+ Placement2["rightStart"] = "right-start";
20
+ Placement2["rightEnd"] = "right-end";
21
+ return Placement2;
22
+ })(Placement || {});
23
+ var Position = /* @__PURE__ */ ((Position2) => {
24
+ Position2["before"] = "before";
25
+ Position2["after"] = "after";
26
+ return Position2;
27
+ })(Position || {});
28
+ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
29
+ ButtonType2["button"] = "button";
30
+ ButtonType2["submit"] = "submit";
31
+ ButtonType2["reset"] = "reset";
32
+ return ButtonType2;
33
+ })(ButtonType || {});
34
+ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
35
+ AnchorTarget2["_blank"] = "_blank";
36
+ AnchorTarget2["_self"] = "_self";
37
+ AnchorTarget2["_parent"] = "_parent";
38
+ AnchorTarget2["_top"] = "_top";
39
+ return AnchorTarget2;
40
+ })(AnchorTarget || {});
41
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
42
+ const INJECTION_KEY_ALERT_GROUP = Symbol.for(
43
+ "alertGroup"
44
+ );
45
+ const LinkProps = {
46
+ /**
47
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
48
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
49
+ */
50
+ to: {
51
+ type: [String, Object]
52
+ },
53
+ /**
54
+ * Anchor href
55
+ */
56
+ href: String,
57
+ /**
58
+ * Anchor target
59
+ */
60
+ target: {
61
+ type: String,
62
+ validator: (value) => Object.values(AnchorTarget).includes(value)
63
+ },
64
+ /**
65
+ * Anchor rel
66
+ */
67
+ rel: {
68
+ type: String,
69
+ default: "noopener noreferrer"
70
+ }
71
+ };
72
+ const DisabledProps = {
73
+ /**
74
+ * Whether the form control is disabled
75
+ */
76
+ disabled: Boolean
77
+ };
78
+ const ActiveProps = {
79
+ /**
80
+ * Whether the item is active
81
+ */
82
+ active: Boolean
83
+ };
84
+ const PressedProps = {
85
+ /**
86
+ * Whether the item is pressed
87
+ */
88
+ pressed: Boolean
89
+ };
90
+ const LabelProps = {
91
+ /**
92
+ * The item label
93
+ */
94
+ label: [String, Number]
95
+ };
96
+ const ModifiersProps = {
97
+ /**
98
+ * Component BEM modifiers
99
+ */
100
+ modifiers: [String, Array]
101
+ };
102
+ const IconProps = {
103
+ /**
104
+ * VvIcon name or props
105
+ * @see VVIcon
106
+ */
107
+ icon: { type: [String, Object] },
108
+ /**
109
+ * VvIcon position
110
+ */
111
+ iconPosition: {
112
+ type: String,
113
+ default: Position.before,
114
+ validation: (value) => Object.values(Position).includes(value)
115
+ }
116
+ };
117
+ const IdProps = {
118
+ /**
119
+ * Global attribute id
120
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
121
+ */
122
+ id: [String, Number]
123
+ };
124
+ ({
125
+ /**
126
+ * Dropdown placement
127
+ */
128
+ placement: {
129
+ type: String,
130
+ default: Side.bottom,
131
+ validator: (value) => {
132
+ return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
133
+ }
134
+ },
135
+ /**
136
+ * Dropdown strategy
137
+ */
138
+ strategy: {
139
+ type: String,
140
+ default: "absolute",
141
+ validator: (value) => {
142
+ return ["fixed", "absolute"].includes(value);
143
+ }
144
+ },
145
+ /**
146
+ * Dropdown show / hide transition name
147
+ */
148
+ transitionName: {
149
+ type: String
150
+ },
151
+ /**
152
+ * Offset of the dropdown from the trigger
153
+ * @see https://floating-ui.com/docs/offset
154
+ */
155
+ offset: {
156
+ type: [Number, String, Object],
157
+ default: 0
158
+ },
159
+ /**
160
+ * Move dropdown to the side if there is no space in the default position
161
+ * @see https://floating-ui.com/docs/shift
162
+ */
163
+ shift: {
164
+ type: [Boolean, Object],
165
+ default: false
166
+ },
167
+ /**
168
+ * Flip dropdown position if there is no space in the default position
169
+ * @see https://floating-ui.com/docs/flip
170
+ */
171
+ flip: {
172
+ type: [Boolean, Object],
173
+ default: true
174
+ },
175
+ /**
176
+ * Size of the dropdown
177
+ * @see https://floating-ui.com/docs/size
178
+ */
179
+ size: {
180
+ type: [Boolean, Object],
181
+ default: () => ({ padding: 10 })
182
+ },
183
+ /**
184
+ * Automatically change the position of the dropdown
185
+ * @see https://floating-ui.com/docs/autoPlacement
186
+ */
187
+ autoPlacement: {
188
+ type: [Boolean, Object],
189
+ default: false
190
+ },
191
+ /**
192
+ * Add arrow to the dropdown
193
+ * @see https://floating-ui.com/docs/arrow
194
+ */
195
+ arrow: {
196
+ type: Boolean,
197
+ default: false
198
+ },
199
+ /**
200
+ * Keep open dropdown on click outside
201
+ */
202
+ keepOpen: {
203
+ type: Boolean,
204
+ default: false
205
+ },
206
+ /**
207
+ * Autofocus first item on dropdown open
208
+ */
209
+ autofocusFirst: {
210
+ type: Boolean,
211
+ default: true
212
+ },
213
+ /**
214
+ * Set dropdown width to the same as the trigger
215
+ */
216
+ triggerWidth: {
217
+ type: Boolean
218
+ }
219
+ });
220
+ ({
221
+ ...DisabledProps,
222
+ ...LabelProps,
223
+ ...PressedProps,
224
+ ...ActiveProps,
225
+ ...LinkProps,
226
+ /**
227
+ * Button type
228
+ */
229
+ type: {
230
+ type: String,
231
+ default: ButtonType.button,
232
+ validator: (value) => Object.values(ButtonType).includes(value)
233
+ }
234
+ });
235
+ function useProvideAlertGroup({
236
+ name
237
+ }) {
238
+ const bus = mitt();
239
+ provide(INJECTION_KEY_ALERT_GROUP, {
240
+ name,
241
+ bus
242
+ });
243
+ return bus;
244
+ }
245
+ function useModifiers(prefix, modifiers, others) {
246
+ return computed(() => {
247
+ const toReturn = {
248
+ [prefix]: true
249
+ };
250
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
251
+ if (modifiersArray) {
252
+ if (Array.isArray(modifiersArray)) {
253
+ modifiersArray.forEach((modifier) => {
254
+ if (modifier) {
255
+ toReturn[`${prefix}--${modifier}`] = true;
256
+ }
257
+ });
258
+ }
259
+ }
260
+ if (others) {
261
+ Object.keys(others.value).forEach((key) => {
262
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
263
+ });
264
+ }
265
+ return toReturn;
266
+ });
267
+ }
268
+ const VvAlertGroupProps = {
269
+ ...ModifiersProps,
270
+ name: {
271
+ type: String,
272
+ required: true
273
+ },
274
+ items: {
275
+ type: Array,
276
+ default: () => []
277
+ },
278
+ stack: {
279
+ type: Boolean,
280
+ default: false
281
+ },
282
+ reverse: {
283
+ type: Boolean,
284
+ default: false
285
+ },
286
+ inline: {
287
+ type: String,
288
+ default: void 0
289
+ },
290
+ block: {
291
+ type: String,
292
+ default: void 0
293
+ },
294
+ position: {
295
+ type: String,
296
+ default: void 0
297
+ },
298
+ transition: {
299
+ type: String,
300
+ default: void 0
301
+ }
302
+ };
303
+ const VvAlertGroupEvents = ["close"];
304
+ const useVvAlertGroup = (props, emit) => {
305
+ const bus = useProvideAlertGroup({ name: computed(() => props.name) });
306
+ if (props.block && !props.inline || !props.block && props.inline) {
307
+ console.warn(
308
+ `[VvAlertGroup]: block and inline props must coexist at the same time.`
309
+ );
310
+ }
311
+ const hasClass = computed(() => {
312
+ const toReturn = [
313
+ useModifiers(
314
+ "vv-alert-group",
315
+ computed(() => props.modifiers),
316
+ computed(() => ({
317
+ stack: props.stack,
318
+ reverse: props.reverse,
319
+ absolute: props.position === "absolute",
320
+ fixed: props.position === "fixed"
321
+ }))
322
+ ).value
323
+ ];
324
+ if (props.inline && props.block) {
325
+ toReturn.push(`vv-alert-group--${props.block}-${props.inline}`);
326
+ }
327
+ return toReturn;
328
+ });
329
+ const hasTransition = computed(() => {
330
+ if (props.transition) {
331
+ return props.transition;
332
+ }
333
+ if (!props.position) {
334
+ return "vv-alert--fade";
335
+ }
336
+ if (props.inline === "start") {
337
+ return "vv-alert--fade-inline-start";
338
+ }
339
+ if (props.inline === "end") {
340
+ return "vv-alert--fade-inline-end";
341
+ }
342
+ if (props.block === "top") {
343
+ return "vv-alert--fade-block-top";
344
+ }
345
+ if (props.block === "bottom") {
346
+ return "vv-alert--fade-block-bottom";
347
+ }
348
+ return "vv-alert--fade";
349
+ });
350
+ bus.on("close", (id) => {
351
+ emit("close", id);
352
+ });
353
+ return {
354
+ hasTransition,
355
+ hasProps: computed(() => ({
356
+ class: hasClass.value
357
+ }))
358
+ };
359
+ };
360
+ const VvIconProps = {
361
+ /**
362
+ * Color
363
+ */
364
+ color: String,
365
+ /**
366
+ * Width
367
+ */
368
+ width: {
369
+ type: [String, Number]
370
+ },
371
+ /**
372
+ * Height
373
+ */
374
+ height: {
375
+ type: [String, Number]
376
+ },
377
+ /**
378
+ * Icon name
379
+ * Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
380
+ * https://docs.iconify.design/api/providers.html#provider-in-icon-name
381
+ */
382
+ name: {
383
+ type: String,
384
+ required: true
385
+ },
386
+ /**
387
+ * By default 'vv'
388
+ * If custom collection is not added with "addCollection" DS class method, this prop could not be used
389
+ * Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
390
+ */
391
+ provider: {
392
+ type: String
393
+ },
394
+ /**
395
+ * The name of icon set.
396
+ * Icon default options prefix: simple | normal | detailed
397
+ */
398
+ prefix: {
399
+ type: String,
400
+ default: "normal"
401
+ },
402
+ /**
403
+ * Url remote SVG icon
404
+ */
405
+ src: String,
406
+ /**
407
+ * Horizontal flip
408
+ */
409
+ horizontalFlip: Boolean,
410
+ /**
411
+ * Vertical flip
412
+ */
413
+ verticalFlip: Boolean,
414
+ /**
415
+ * String alternative to "horizontalFlip" and "verticalFlip".
416
+ * Example: https://docs.iconify.design/icon-components/vue/transform.html
417
+ */
418
+ flip: String,
419
+ /**
420
+ * Icon render mode
421
+ * 'style' = 'bg' or 'mask', depending on icon content
422
+ * 'bg' = span with style using `background`
423
+ * 'mask' = span with style using `mask`
424
+ * 'svg' = svg
425
+ * Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
426
+ */
427
+ mode: String,
428
+ /**
429
+ * Toggles inline or block mode
430
+ * Example https://docs.iconify.design/icon-components/vue/inline.html
431
+ */
432
+ inline: Boolean,
433
+ /**
434
+ * rotates icon
435
+ * Example https://docs.iconify.design/icon-components/vue/transform.html
436
+ */
437
+ rotate: [Number, String],
438
+ /**
439
+ * A callback that is called when icon data has been loaded
440
+ */
441
+ onLoad: Function,
442
+ /**
443
+ * SVG icon string
444
+ */
445
+ svg: String,
446
+ /**
447
+ * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
448
+ * @values string | string[]
449
+ */
450
+ modifiers: {
451
+ type: [String, Array]
452
+ }
453
+ };
454
+ function useVolver() {
455
+ return inject(INJECTION_KEY_VOLVER);
456
+ }
457
+ const __default__$2 = {
458
+ name: "VvIcon"
459
+ };
460
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
461
+ ...__default__$2,
462
+ props: VvIconProps,
463
+ setup(__props) {
464
+ const props = __props;
465
+ const hasRotate = computed(() => {
466
+ if (typeof props.rotate === "string") {
467
+ return parseFloat(props.rotate);
468
+ }
469
+ return props.rotate;
470
+ });
471
+ const show = ref(true);
472
+ const volver = useVolver();
473
+ const { modifiers } = toRefs(props);
474
+ const bemCssClasses = useModifiers("vv-icon", modifiers);
475
+ const provider = computed(() => {
476
+ return props.provider || (volver == null ? void 0 : volver.iconsProvider);
477
+ });
478
+ const icon = computed(() => {
479
+ const name = props.name ?? "";
480
+ const iconName = `@${provider.value}:${props.prefix}:${name}`;
481
+ if (iconExists(iconName)) {
482
+ return iconName;
483
+ }
484
+ const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
485
+ (iconsCollection2) => {
486
+ const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
487
+ return iconExists(icon2);
488
+ }
489
+ );
490
+ if (iconsCollection) {
491
+ return `@${provider.value}:${iconsCollection.prefix}:${name}`;
492
+ }
493
+ return name;
494
+ });
495
+ function getSvgContent(svg) {
496
+ let dom;
497
+ if (typeof window === "undefined") {
498
+ const { JSDOM } = require("jsdom");
499
+ dom = new JSDOM().window;
500
+ }
501
+ const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
502
+ const svgDomString = domParser.parseFromString(svg, "text/html");
503
+ const svgEl = svgDomString.querySelector("svg");
504
+ return svgEl;
505
+ }
506
+ function addIconFromSvg(svg) {
507
+ const svgContentEl = getSvgContent(svg);
508
+ const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
509
+ if (svgContentEl && svgContent) {
510
+ addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
511
+ body: svgContent,
512
+ // Set height and width from svg content
513
+ height: svgContentEl.viewBox.baseVal.height,
514
+ width: svgContentEl.viewBox.baseVal.width
515
+ });
516
+ }
517
+ }
518
+ if (volver) {
519
+ if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
520
+ show.value = false;
521
+ volver.fetchIcon(props.src).then((svg) => {
522
+ if (svg) {
523
+ addIconFromSvg(svg);
524
+ show.value = true;
525
+ }
526
+ }).catch((e) => {
527
+ throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
528
+ });
529
+ }
530
+ }
531
+ if (props.svg) {
532
+ addIconFromSvg(props.svg);
533
+ }
534
+ return (_ctx, _cache) => {
535
+ return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
536
+ key: 0,
537
+ class: unref(bemCssClasses)
538
+ }, {
539
+ inline: _ctx.inline,
540
+ width: _ctx.width,
541
+ height: _ctx.height,
542
+ horizontalFlip: _ctx.horizontalFlip,
543
+ verticalFlip: _ctx.verticalFlip,
544
+ flip: _ctx.flip,
545
+ rotate: unref(hasRotate),
546
+ color: _ctx.color,
547
+ onLoad: _ctx.onLoad,
548
+ icon: unref(icon)
549
+ }), null, 16, ["class"])) : createCommentVNode("", true);
550
+ };
551
+ }
552
+ });
553
+ function useInjectedAlertGroup() {
554
+ return inject(INJECTION_KEY_ALERT_GROUP, {});
555
+ }
556
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
557
+ const VvAlertProps = {
558
+ ...IdProps,
559
+ ...ModifiersProps,
560
+ ...IconProps,
561
+ /**
562
+ * The alert is dismissable
563
+ * @default false
564
+ * @type boolean
565
+ */
566
+ dismissable: {
567
+ type: Boolean,
568
+ default: false
569
+ },
570
+ /**
571
+ * The alert auto close after the specified time in milliseconds
572
+ * @default 0
573
+ * @type number
574
+ */
575
+ autoClose: {
576
+ type: Number,
577
+ default: 0
578
+ },
579
+ /**
580
+ * The alert close label
581
+ * @default 'Close'
582
+ * @type string
583
+ */
584
+ closeLabel: {
585
+ type: String,
586
+ default: "Close"
587
+ },
588
+ /**
589
+ * The alert title
590
+ * @default ''
591
+ * @type string
592
+ */
593
+ title: {
594
+ type: String,
595
+ default: ""
596
+ },
597
+ /**
598
+ * The alert content
599
+ * @default ''
600
+ * @type string
601
+ */
602
+ content: {
603
+ type: String,
604
+ default: ""
605
+ },
606
+ /**
607
+ * The alert footer
608
+ * @default ''
609
+ * @type string
610
+ */
611
+ footer: {
612
+ type: String,
613
+ default: ""
614
+ },
615
+ /**
616
+ * The alert role
617
+ * @default 'alert'
618
+ * @type string
619
+ * @values 'alert', 'alertdialog'
620
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alert_Role
621
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alertdialog_role
622
+ */
623
+ role: {
624
+ type: String,
625
+ default: "alert"
626
+ }
627
+ };
628
+ const VvAlertEvents = ["close"];
629
+ const useVvAlert = (props, emit) => {
630
+ const { bus } = useInjectedAlertGroup();
631
+ const hasId = useUniqueId(computed(() => props.id));
632
+ const hasTitleId = computed(() => `${hasId.value}-title`);
633
+ const hasIcon = computed(
634
+ () => typeof props.icon === "string" ? { name: props.icon } : props.icon
635
+ );
636
+ const hasClass = useModifiers(
637
+ "vv-alert",
638
+ computed(() => props.modifiers),
639
+ computed(() => ({
640
+ dismissable: props.autoClose > 0 || props.dismissable,
641
+ "auto-close": props.autoClose > 0,
642
+ hover: isMouseover.value
643
+ }))
644
+ );
645
+ const hasStyle = computed(() => ({
646
+ "--alert-duration": `${props.autoClose}ms`
647
+ }));
648
+ const close = () => {
649
+ if (timeout) {
650
+ clearTimeout(timeout);
651
+ }
652
+ emit("close", hasId.value);
653
+ bus == null ? void 0 : bus.emit("close", hasId.value);
654
+ };
655
+ let timeout;
656
+ watch(
657
+ () => props.autoClose,
658
+ (value) => {
659
+ if (value > 0) {
660
+ timeout = setTimeout(close, value);
661
+ return;
662
+ }
663
+ if (timeout) {
664
+ clearTimeout(timeout);
665
+ }
666
+ },
667
+ {
668
+ immediate: true
669
+ }
670
+ );
671
+ const isMouseover = ref(false);
672
+ const onMouseover = withModifiers(() => {
673
+ isMouseover.value = true;
674
+ if (timeout) {
675
+ clearTimeout(timeout);
676
+ }
677
+ }, ["passive"]);
678
+ const onMouseleave = withModifiers(() => {
679
+ isMouseover.value = false;
680
+ if (props.autoClose > 0) {
681
+ timeout = setTimeout(close, props.autoClose);
682
+ }
683
+ }, ["passive"]);
684
+ return {
685
+ close,
686
+ hasIcon,
687
+ hasTitleId,
688
+ hasProps: computed(() => ({
689
+ onMouseover,
690
+ onMouseleave,
691
+ class: hasClass.value,
692
+ style: hasStyle.value,
693
+ role: props.role,
694
+ "aria-labelledby": hasTitleId.value
695
+ }))
696
+ };
697
+ };
698
+ const _hoisted_1 = { class: "vv-alert__header" };
699
+ const _hoisted_2 = ["id"];
700
+ const _hoisted_3 = ["aria-label"];
701
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "vv-alert__close-mask" }, null, -1);
702
+ const _hoisted_5 = [
703
+ _hoisted_4
704
+ ];
705
+ const _hoisted_6 = {
706
+ key: 0,
707
+ class: "vv-alert__content"
708
+ };
709
+ const _hoisted_7 = {
710
+ key: 1,
711
+ class: "vv-alert__footer"
712
+ };
713
+ const __default__$1 = {
714
+ name: "VvAlert"
715
+ };
716
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
717
+ ...__default__$1,
718
+ props: VvAlertProps,
719
+ emits: VvAlertEvents,
720
+ setup(__props, { expose: __expose, emit }) {
721
+ const props = __props;
722
+ const { hasProps, hasTitleId, hasIcon, close } = useVvAlert(props, emit);
723
+ __expose({ close });
724
+ return (_ctx, _cache) => {
725
+ return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(hasProps))), [
726
+ createElementVNode("div", _hoisted_1, [
727
+ unref(hasIcon) ? (openBlock(), createBlock(_sfc_main$2, mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-alert__icon" }), null, 16)) : createCommentVNode("", true),
728
+ renderSlot(_ctx.$slots, "header", {}, () => [
729
+ renderSlot(_ctx.$slots, "title::before"),
730
+ createElementVNode("strong", {
731
+ id: unref(hasTitleId),
732
+ class: "vv-alert__title"
733
+ }, toDisplayString(_ctx.title), 9, _hoisted_2),
734
+ renderSlot(_ctx.$slots, "title::after")
735
+ ]),
736
+ _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("button", {
737
+ key: 1,
738
+ class: "vv-alert__close",
739
+ type: "button",
740
+ "aria-label": _ctx.closeLabel,
741
+ onClick: _cache[0] || (_cache[0] = withModifiers(
742
+ //@ts-ignore
743
+ (...args) => unref(close) && unref(close)(...args),
744
+ ["stop"]
745
+ ))
746
+ }, _hoisted_5, 8, _hoisted_3)) : createCommentVNode("", true)
747
+ ]),
748
+ _ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_6, [
749
+ renderSlot(_ctx.$slots, "default", {}, () => [
750
+ createTextVNode(toDisplayString(_ctx.content), 1)
751
+ ])
752
+ ])) : createCommentVNode("", true),
753
+ _ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_7, [
754
+ renderSlot(_ctx.$slots, "footer", {}, () => [
755
+ createTextVNode(toDisplayString(_ctx.footer), 1)
756
+ ])
757
+ ])) : createCommentVNode("", true)
758
+ ], 16);
759
+ };
760
+ }
761
+ });
762
+ const __default__ = {
763
+ name: "VvAlertGroup"
764
+ };
765
+ const _sfc_main = /* @__PURE__ */ defineComponent({
766
+ ...__default__,
767
+ props: VvAlertGroupProps,
768
+ emits: VvAlertGroupEvents,
769
+ setup(__props, { emit }) {
770
+ const props = __props;
771
+ const { hasProps, hasTransition } = useVvAlertGroup(props, emit);
772
+ return (_ctx, _cache) => {
773
+ return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(hasProps))), [
774
+ renderSlot(_ctx.$slots, "before"),
775
+ createVNode(TransitionGroup, {
776
+ tag: "div",
777
+ role: "group",
778
+ name: unref(hasTransition),
779
+ class: "vv-alert-group__list"
780
+ }, {
781
+ default: withCtx(() => [
782
+ renderSlot(_ctx.$slots, "default", {}, () => [
783
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item) => {
784
+ return openBlock(), createBlock(_sfc_main$1, mergeProps(item, {
785
+ key: item.id
786
+ }), null, 16);
787
+ }), 128))
788
+ ])
789
+ ]),
790
+ _: 3
791
+ }, 8, ["name"]),
792
+ renderSlot(_ctx.$slots, "after")
793
+ ], 16);
794
+ };
795
+ }
796
+ });
797
+ export {
798
+ _sfc_main as default
799
+ };