@volverjs/ui-vue 0.0.9 → 0.0.10-beta.10

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 (184) hide show
  1. package/README.md +64 -1
  2. package/auto-imports.d.ts +1 -1
  3. package/bin/icons.cjs +1 -1
  4. package/bin/icons.js +34 -19
  5. package/dist/components/VvAccordion/VvAccordion.es.js +33 -4
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -4
  8. package/dist/components/VvAccordion/index.d.ts +1 -1
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +75 -27
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -5
  12. package/dist/components/VvAction/VvAction.es.js +26 -4
  13. package/dist/components/VvAction/VvAction.umd.js +1 -1
  14. package/dist/components/VvAction/VvAction.vue.d.ts +17 -4
  15. package/dist/components/VvAction/index.d.ts +5 -0
  16. package/dist/components/VvAlert/VvAlert.es.js +96 -45
  17. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  18. package/dist/components/VvAlert/VvAlert.vue.d.ts +4 -4
  19. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +136 -66
  20. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  21. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +4 -4
  22. package/dist/components/VvAvatar/VvAvatar.es.js +22 -1
  23. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  24. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +79 -28
  25. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  26. package/dist/components/VvBadge/VvBadge.es.js +39 -8
  27. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  28. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +224 -41
  29. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  30. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +14 -3
  31. package/dist/components/VvBreadcrumb/index.d.ts +2 -9
  32. package/dist/components/VvButton/VvButton.es.js +70 -25
  33. package/dist/components/VvButton/VvButton.umd.js +1 -1
  34. package/dist/components/VvButton/VvButton.vue.d.ts +25 -9
  35. package/dist/components/VvButton/index.d.ts +5 -0
  36. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +33 -6
  37. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  38. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +6 -6
  39. package/dist/components/VvCard/VvCard.es.js +47 -16
  40. package/dist/components/VvCard/VvCard.umd.js +1 -1
  41. package/dist/components/VvCheckbox/VvCheckbox.es.js +35 -7
  42. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  43. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +8 -8
  44. package/dist/components/VvCheckbox/index.d.ts +1 -1
  45. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +106 -51
  46. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  47. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  48. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  49. package/dist/components/VvCombobox/VvCombobox.es.js +635 -400
  50. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  51. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +112 -112
  52. package/dist/components/VvCombobox/index.d.ts +32 -32
  53. package/dist/components/VvDialog/VvDialog.es.js +65 -27
  54. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  55. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
  56. package/dist/components/VvDropdown/VvDropdown.es.js +87 -46
  57. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  58. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +203 -189
  59. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +12 -0
  60. package/dist/components/VvDropdown/index.d.ts +32 -32
  61. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +46 -12
  62. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  63. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
  64. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +28 -1
  65. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  66. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +40 -8
  67. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  68. package/dist/components/VvIcon/VvIcon.es.js +1 -1
  69. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  70. package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
  71. package/dist/components/VvInputText/VvInputText.es.js +149 -99
  72. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  73. package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
  74. package/dist/components/VvInputText/index.d.ts +8 -2
  75. package/dist/components/VvNav/VvNav.es.js +115 -63
  76. package/dist/components/VvNav/VvNav.umd.js +1 -1
  77. package/dist/components/VvNav/VvNav.vue.d.ts +31 -12
  78. package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
  79. package/dist/components/VvNav/index.d.ts +1 -12
  80. package/dist/components/VvNavItem/VvNavItem.es.js +413 -0
  81. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
  82. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
  83. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
  84. package/dist/components/VvProgress/VvProgress.es.js +33 -6
  85. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  86. package/dist/components/VvRadio/VvRadio.es.js +35 -7
  87. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  88. package/dist/components/VvRadio/VvRadio.vue.d.ts +8 -8
  89. package/dist/components/VvRadio/index.d.ts +1 -1
  90. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +106 -51
  91. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  92. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  93. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  94. package/dist/components/VvSelect/VvSelect.es.js +159 -99
  95. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  96. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  97. package/dist/components/VvSelect/index.d.ts +1 -1
  98. package/dist/components/VvTab/VvTab.es.js +214 -99
  99. package/dist/components/VvTab/VvTab.umd.js +1 -1
  100. package/dist/components/VvTab/VvTab.vue.d.ts +40 -11
  101. package/dist/components/VvTab/index.d.ts +9 -3
  102. package/dist/components/VvTextarea/VvTextarea.es.js +123 -77
  103. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  104. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +10 -10
  105. package/dist/components/VvTooltip/VvTooltip.es.js +40 -9
  106. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  107. package/dist/components/index.es.js +1593 -1012
  108. package/dist/components/index.umd.js +1 -1
  109. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  110. package/dist/composables/useOptions.d.ts +1 -1
  111. package/dist/composables/useVolver.d.ts +1 -1
  112. package/dist/directives/index.d.ts +3 -5
  113. package/dist/directives/index.es.js +60 -23
  114. package/dist/directives/index.umd.js +1 -1
  115. package/dist/directives/v-tooltip.es.js +58 -18
  116. package/dist/directives/v-tooltip.umd.js +1 -1
  117. package/dist/icons.es.js +3 -3
  118. package/dist/icons.umd.js +1 -1
  119. package/dist/index.d.ts +3 -1
  120. package/dist/index.es.js +19 -16
  121. package/dist/index.umd.js +1 -1
  122. package/dist/props/index.d.ts +58 -34
  123. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +50 -15
  124. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +332 -83
  125. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  126. package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +1 -0
  127. package/dist/stories/InputText/InputTextMask.stories.d.ts +1 -1
  128. package/dist/stories/Tab/Tab.settings.d.ts +4 -37
  129. package/dist/types/alert.d.ts +13 -0
  130. package/dist/types/floating-ui.d.ts +6 -0
  131. package/dist/types/generic.d.ts +4 -0
  132. package/dist/types/group.d.ts +37 -0
  133. package/dist/types/index.d.ts +5 -0
  134. package/dist/types/nav.d.ts +17 -0
  135. package/package.json +61 -52
  136. package/src/Volver.ts +22 -16
  137. package/src/assets/icons/detailed.json +1 -1
  138. package/src/assets/icons/normal.json +1 -1
  139. package/src/assets/icons/simple.json +1 -1
  140. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  141. package/src/components/VvAction/VvAction.vue +5 -2
  142. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  143. package/src/components/VvBreadcrumb/index.ts +2 -8
  144. package/src/components/VvCombobox/VvCombobox.vue +32 -33
  145. package/src/components/VvCombobox/index.ts +4 -0
  146. package/src/components/VvInputText/VvInputText.vue +2 -2
  147. package/src/components/VvNav/VvNav.vue +30 -50
  148. package/src/components/VvNav/VvNavItem.vue +18 -0
  149. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  150. package/src/components/VvNav/index.ts +2 -15
  151. package/src/components/VvSelect/VvSelect.vue +4 -4
  152. package/src/components/VvTab/VvTab.vue +63 -35
  153. package/src/components/VvTab/index.ts +10 -4
  154. package/src/components/VvTextarea/VvTextarea.vue +1 -1
  155. package/src/composables/useOptions.ts +2 -2
  156. package/src/composables/useUniqueId.ts +2 -2
  157. package/src/directives/index.ts +1 -4
  158. package/src/directives/v-tooltip.ts +19 -10
  159. package/src/index.ts +3 -1
  160. package/src/props/index.ts +27 -3
  161. package/src/stories/Button/ButtonModifiers.stories.ts +4 -14
  162. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  163. package/src/stories/Combobox/ComboboxOptions.stories.ts +18 -0
  164. package/src/stories/InputText/InputTextMask.stories.ts +1 -1
  165. package/src/stories/Nav/Nav.settings.ts +3 -4
  166. package/src/stories/Nav/Nav.test.ts +4 -15
  167. package/src/stories/Tab/Tab.settings.ts +9 -9
  168. package/src/stories/Tab/Tab.stories.ts +2 -2
  169. package/src/stories/Tab/Tab.test.ts +6 -14
  170. package/src/stories/argTypes.ts +1 -1
  171. package/src/types/generic.ts +6 -0
  172. package/src/types/index.ts +5 -0
  173. package/src/types/nav.ts +19 -0
  174. package/src/utils/ObjectUtilities.ts +3 -2
  175. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  176. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  177. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  178. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  179. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  180. package/src/types/generic.d.ts +0 -6
  181. /package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +0 -0
  182. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  183. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  184. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, toRefs, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createVNode, toHandlers } from "vue";
1
+ import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, toRefs, normalizeClass, createElementVNode, withModifiers, Fragment, renderList, toHandlers, normalizeProps, guardReactiveProps } from "vue";
2
2
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
3
3
  Strategy2["absolute"] = "absolute";
4
4
  Strategy2["fixed"] = "fixed";
@@ -93,6 +93,12 @@ const ActiveProps = {
93
93
  */
94
94
  active: Boolean
95
95
  };
96
+ const CurrentProps = {
97
+ /**
98
+ * Whether the item is current
99
+ */
100
+ current: Boolean
101
+ };
96
102
  const PressedProps = {
97
103
  /**
98
104
  * Whether the item is pressed
@@ -223,6 +229,7 @@ const ActionProps = {
223
229
  ...LabelProps,
224
230
  ...PressedProps,
225
231
  ...ActiveProps,
232
+ ...CurrentProps,
226
233
  ...LinkProps,
227
234
  /**
228
235
  * Button type
@@ -238,16 +245,25 @@ const ActionProps = {
238
245
  ariaLabel: {
239
246
  type: String,
240
247
  default: void 0
248
+ },
249
+ /**
250
+ * Default tag for the action
251
+ */
252
+ defaultTag: {
253
+ type: String,
254
+ default: ActionTag.button
241
255
  }
242
256
  };
243
- const VvNavProps = {
244
- ...ModifiersProps,
257
+ const NavProps = {
245
258
  items: {
246
259
  type: Array,
247
- required: true,
248
260
  default: () => []
249
261
  }
250
262
  };
263
+ const VvNavProps = {
264
+ ...ModifiersProps,
265
+ ...NavProps
266
+ };
251
267
  const VvNavEvents = ["click"];
252
268
  const VvActionEvents = ["click", "mouseover", "mouseleave"];
253
269
  const VvActionProps = ActionProps;
@@ -260,11 +276,11 @@ function useInjectedDropdownTrigger() {
260
276
  function useInjectedDropdownAction() {
261
277
  return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
262
278
  }
263
- const __default__ = {
279
+ const __default__$1 = {
264
280
  name: "VvAction"
265
281
  };
266
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
267
- ...__default__,
282
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
283
+ ...__default__$1,
268
284
  props: VvActionProps,
269
285
  emits: VvActionEvents,
270
286
  setup(__props, { expose: __expose, emit }) {
@@ -299,7 +315,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
299
315
  case props.href !== void 0:
300
316
  return ActionTag.a;
301
317
  default:
302
- return ActionTag.button;
318
+ return props.defaultTag;
303
319
  }
304
320
  });
305
321
  const hasProps = computed(() => {
@@ -324,12 +340,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
324
340
  to: props.to,
325
341
  target: props.target
326
342
  };
327
- default:
343
+ case ActionTag.button:
328
344
  return {
329
345
  ...toReturn,
330
346
  type: props.type,
331
347
  disabled: props.disabled
332
348
  };
349
+ default:
350
+ return toReturn;
333
351
  }
334
352
  });
335
353
  const onClick = (e) => {
@@ -355,7 +373,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
355
373
  class: {
356
374
  active: _ctx.active,
357
375
  pressed: unref(pressed),
358
- disabled: _ctx.disabled
376
+ disabled: _ctx.disabled,
377
+ current: _ctx.current
359
378
  },
360
379
  onClickPassive: onClick,
361
380
  onMouseoverPassive: onMouseover,
@@ -363,14 +382,49 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
363
382
  }), {
364
383
  default: withCtx(() => [
365
384
  renderSlot(_ctx.$slots, "default", {}, () => [
366
- createTextVNode(toDisplayString(_ctx.label), 1)
385
+ createTextVNode(
386
+ toDisplayString(_ctx.label),
387
+ 1
388
+ /* TEXT */
389
+ )
367
390
  ])
368
391
  ]),
369
392
  _: 3
393
+ /* FORWARDED */
370
394
  }, 16, ["class"]);
371
395
  };
372
396
  }
373
397
  });
398
+ const _hoisted_1$1 = {
399
+ class: "vv-nav__item",
400
+ role: "presentation"
401
+ };
402
+ const __default__ = {
403
+ name: "VvNavItem",
404
+ inheritAttrs: false
405
+ };
406
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
407
+ ...__default__,
408
+ setup(__props) {
409
+ return (_ctx, _cache) => {
410
+ return openBlock(), createElementBlock("li", _hoisted_1$1, [
411
+ createVNode(
412
+ _sfc_main$2,
413
+ mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
414
+ {
415
+ default: withCtx(() => [
416
+ renderSlot(_ctx.$slots, "default")
417
+ ]),
418
+ _: 3
419
+ /* FORWARDED */
420
+ },
421
+ 16
422
+ /* FULL_PROPS */
423
+ )
424
+ ]);
425
+ };
426
+ }
427
+ });
374
428
  function useModifiers(prefix, modifiers, others) {
375
429
  return computed(() => {
376
430
  const toReturn = {
@@ -394,67 +448,65 @@ function useModifiers(prefix, modifiers, others) {
394
448
  return toReturn;
395
449
  });
396
450
  }
397
- const _hoisted_1 = {
398
- class: "vv-nav__menu",
399
- role: "menu",
400
- "aria-busy": "true"
401
- };
451
+ const _hoisted_1 = ["onClick"];
402
452
  const _sfc_main = /* @__PURE__ */ defineComponent({
403
453
  __name: "VvNav",
404
454
  props: VvNavProps,
405
455
  emits: VvNavEvents,
406
456
  setup(__props, { emit }) {
407
457
  const props = __props;
408
- const { modifiers, items } = toRefs(props);
409
- const activeItem = ref(null);
410
- const bemCssClasses = useModifiers("vv-nav", modifiers);
411
- const localItems = computed(() => {
412
- return items.value.map((item, index) => {
413
- return {
414
- ...item,
415
- id: item.id || `nav-item_${index}`
416
- };
417
- });
418
- });
419
- function onClick(item) {
420
- if (!item.disabled) {
458
+ const { modifiers } = toRefs(props);
459
+ const onClick = (event) => {
460
+ var _a;
461
+ const target = event.target;
462
+ if (target == null ? void 0 : target.dataset.index) {
463
+ const index = parseInt(target.dataset.index);
464
+ const item = (_a = props.items) == null ? void 0 : _a[index];
465
+ if (!item || (item == null ? void 0 : item.disabled)) {
466
+ return;
467
+ }
421
468
  emit("click", item);
422
- activeItem.value = item.id;
423
469
  }
424
- }
470
+ };
471
+ const bemCssClasses = useModifiers("vv-nav", modifiers);
425
472
  return (_ctx, _cache) => {
426
- return openBlock(), createElementBlock("nav", {
427
- class: normalizeClass(unref(bemCssClasses))
428
- }, [
429
- createElementVNode("ul", _hoisted_1, [
430
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
431
- return openBlock(), createElementBlock("li", {
432
- key: navItem.id,
433
- class: "vv-nav__item",
434
- role: "presentation"
435
- }, [
436
- createVNode(_sfc_main$1, mergeProps({
437
- disabled: navItem.disabled,
438
- to: navItem.to,
439
- href: navItem.href,
440
- tabindex: 0
441
- }, {
442
- class: [{
443
- current: unref(activeItem) == navItem.id,
444
- disabled: navItem.disabled
445
- }, "vv-nav__item-label"]
446
- }, toHandlers(navItem.on), {
447
- onClick: ($event) => onClick(navItem)
448
- }), {
449
- default: withCtx(() => [
450
- createTextVNode(toDisplayString(navItem.title), 1)
451
- ]),
452
- _: 2
453
- }, 1040, ["class", "onClick"])
454
- ]);
455
- }), 128))
456
- ])
457
- ], 2);
473
+ return openBlock(), createElementBlock(
474
+ "nav",
475
+ {
476
+ class: normalizeClass(unref(bemCssClasses))
477
+ },
478
+ [
479
+ createElementVNode("ul", {
480
+ class: "vv-nav__menu",
481
+ role: "menu",
482
+ "aria-busy": "true",
483
+ onClick: withModifiers(onClick, ["stop"])
484
+ }, [
485
+ renderSlot(_ctx.$slots, "default", {}, () => [
486
+ (openBlock(true), createElementBlock(
487
+ Fragment,
488
+ null,
489
+ renderList(_ctx.items, ({ on = {}, ...item }, index) => {
490
+ return openBlock(), createBlock(_sfc_main$1, mergeProps({
491
+ key: index,
492
+ "data-index": index
493
+ }, item, toHandlers(on)), {
494
+ default: withCtx(() => [
495
+ renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps({ item, index })))
496
+ ]),
497
+ _: 2
498
+ /* DYNAMIC */
499
+ }, 1040, ["data-index"]);
500
+ }),
501
+ 128
502
+ /* KEYED_FRAGMENT */
503
+ ))
504
+ ])
505
+ ], 8, _hoisted_1)
506
+ ],
507
+ 2
508
+ /* CLASS */
509
+ );
458
510
  };
459
511
  }
460
512
  });
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNav=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={pressed:Boolean},f={label:[String,Number]},p={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const m={...d,...f,...v,...c,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0}},b={...p,items:{type:Array,required:!0,default:()=>[]}},k=m;const y=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const m=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==f?void 0:f.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};default:return{...e,type:l.type,disabled:l.disabled}}})),g=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),r("click",e))},_=e=>{null==v||v.emit("mouseover",e),r("mouseover",e)},B=e=>{null==v||v.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:g,onMouseoverPassive:_,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const g={class:"vv-nav__menu",role:"menu","aria-busy":"true"};return e.defineComponent({__name:"VvNav",props:b,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n,items:l}=e.toRefs(r),a=e.ref(null),i=function(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-nav",n),s=e.computed((()=>l.value.map(((e,t)=>({...e,id:e.id||`nav-item_${t}`})))));return(t,r)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createElementBlock("li",{key:t.id,class:"vv-nav__item",role:"presentation"},[e.createVNode(y,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(a)==t.id,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on),{onClick:e=>{var r;(r=t).disabled||(o("click",r),a.value=r.id)}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNav=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={current:Boolean},f={pressed:Boolean},p={label:[String,Number]},m={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...f,...c,...v,...u,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}},k={...m,...{items:{type:Array,default:()=>[]}}},g=b;const y=e.defineComponent({name:"VvAction",props:g,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const m=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return l.defaultTag}})),g=e.computed((()=>{const e={...null==f?void 0:f.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};case r.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),y=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),n("click",e))},B=e=>{null==v||v.emit("mouseover",e),n("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(g),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),B={class:"vv-nav__item",role:"presentation"},_=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",B,[e.createVNode(y,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});const h=["onClick"];return e.defineComponent({__name:"VvNav",props:k,emits:["click"],setup(t,{emit:o}){const n=t,{modifiers:r}=e.toRefs(n),l=e=>{var t;const r=e.target;if(null==r?void 0:r.dataset.index){const e=parseInt(r.dataset.index),l=null==(t=n.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;o("click",l)}},a=function(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}("vv-nav",r);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},...n},r)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:r,"data-index":r},n,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:n,index:r})))])),_:2},1040,["data-index"])))),128))]))],8,h)],2))}})}));
@@ -1,21 +1,40 @@
1
- import { type NavItem } from '@/components/VvNav';
2
- declare const _default: import("vue").DefineComponent<{
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
2
  items: {
4
- type: globalThis.PropType<NavItem[]>;
5
- required: boolean;
3
+ type: globalThis.PropType<import("../..").NavItem[]>;
6
4
  default: () => never[];
7
5
  };
8
6
  modifiers: globalThis.PropType<string | string[]>;
9
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ [x: string]: (...args: any[]) => void;
9
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
10
10
  items: {
11
- type: globalThis.PropType<NavItem[]>;
12
- required: boolean;
11
+ type: globalThis.PropType<import("../..").NavItem[]>;
13
12
  default: () => never[];
14
13
  };
15
14
  modifiers: globalThis.PropType<string | string[]>;
16
- }>> & {
17
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
18
- }, {
19
- items: NavItem[];
20
- }, {}>;
15
+ }>>, {
16
+ items: import("../..").NavItem[];
17
+ }, {}>, {
18
+ default?(_: {}): any;
19
+ item?(_: {
20
+ item: {
21
+ label: string;
22
+ ariaLabel?: string | undefined;
23
+ title?: string | undefined;
24
+ to?: string | Record<string, unknown> | undefined;
25
+ href?: string | undefined;
26
+ target?: "_blank" | "_self" | "_parent" | "_top" | undefined;
27
+ rel?: string | undefined;
28
+ disabled?: boolean | undefined;
29
+ current?: boolean | undefined;
30
+ class?: string | string[] | undefined;
31
+ };
32
+ index: number;
33
+ }): any;
34
+ }>;
21
35
  export default _default;
36
+ type __VLS_WithTemplateSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,9 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
2
+ default?(_: {}): any;
3
+ }>;
4
+ export default _default;
5
+ type __VLS_WithTemplateSlots<T, S> = T & {
6
+ new (): {
7
+ $slots: S;
8
+ };
9
+ };
@@ -1,17 +1,6 @@
1
- export type NavItem = {
2
- id?: string;
3
- title: string;
4
- to?: string | {
5
- [key: string]: unknown;
6
- };
7
- href?: string;
8
- disabled?: boolean;
9
- on?: Record<string, () => void>;
10
- };
11
1
  export declare const VvNavProps: {
12
2
  items: {
13
- type: globalThis.PropType<NavItem[]>;
14
- required: boolean;
3
+ type: globalThis.PropType<import("../..").NavItem[]>;
15
4
  default: () => never[];
16
5
  };
17
6
  modifiers: globalThis.PropType<string | string[]>;