mood-ui 0.14.0 → 0.15.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 (199) hide show
  1. package/README.md +1 -1
  2. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +6 -6
  3. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  4. package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs +4 -4
  5. package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  6. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -7
  7. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  8. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +2 -2
  9. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  10. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -7
  11. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  12. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -7
  13. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  14. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +3 -3
  15. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  16. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +2 -2
  17. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  18. package/dist/components/data-display/table/Table.cjs +1 -1
  19. package/dist/components/data-display/table/Table.cjs.map +1 -1
  20. package/dist/components/data-display/table/Table.mjs +1 -1
  21. package/dist/components/data-display/table/Table.mjs.map +1 -1
  22. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs +37 -1
  23. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  24. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs +38 -2
  25. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  26. package/dist/components/data-display/table/TablePagination.cjs.map +1 -1
  27. package/dist/components/data-display/table/TablePagination.mjs.map +1 -1
  28. package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.cjs +24 -16
  29. package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  30. package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.mjs +24 -16
  31. package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  32. package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs +4 -4
  33. package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  34. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +5 -5
  35. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  36. package/dist/components/feedback/EmptyState.cjs.map +1 -1
  37. package/dist/components/feedback/EmptyState.mjs.map +1 -1
  38. package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.cjs +1 -1
  39. package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  40. package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.mjs +1 -1
  41. package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  42. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +5 -5
  43. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  44. package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.cjs +369 -0
  45. package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  46. package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.mjs +368 -0
  47. package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  48. package/dist/components/feedback/tour/Tour2.cjs +6 -0
  49. package/dist/components/feedback/tour/Tour2.cjs.map +1 -0
  50. package/dist/components/feedback/tour/Tour2.mjs +7 -0
  51. package/dist/components/feedback/tour/Tour2.mjs.map +1 -0
  52. package/dist/components/feedback/tour/TourCard.cjs +6 -0
  53. package/dist/components/feedback/tour/TourCard.cjs.map +1 -0
  54. package/dist/components/feedback/tour/TourCard.mjs +7 -0
  55. package/dist/components/feedback/tour/TourCard.mjs.map +1 -0
  56. package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.cjs +102 -0
  57. package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  58. package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.mjs +101 -0
  59. package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  60. package/dist/components/feedback/tour/tourAnchor.cjs +75 -0
  61. package/dist/components/feedback/tour/tourAnchor.cjs.map +1 -0
  62. package/dist/components/feedback/tour/tourAnchor.mjs +72 -0
  63. package/dist/components/feedback/tour/tourAnchor.mjs.map +1 -0
  64. package/dist/components/feedback/tour/tourPlace.cjs +108 -0
  65. package/dist/components/feedback/tour/tourPlace.cjs.map +1 -0
  66. package/dist/components/feedback/tour/tourPlace.mjs +107 -0
  67. package/dist/components/feedback/tour/tourPlace.mjs.map +1 -0
  68. package/dist/components/feedback/tour/tourShape.cjs +121 -0
  69. package/dist/components/feedback/tour/tourShape.cjs.map +1 -0
  70. package/dist/components/feedback/tour/tourShape.mjs +118 -0
  71. package/dist/components/feedback/tour/tourShape.mjs.map +1 -0
  72. package/dist/components/feedback/tour/useTourSpotlight.cjs +60 -0
  73. package/dist/components/feedback/tour/useTourSpotlight.cjs.map +1 -0
  74. package/dist/components/feedback/tour/useTourSpotlight.mjs +59 -0
  75. package/dist/components/feedback/tour/useTourSpotlight.mjs.map +1 -0
  76. package/dist/components/feedback/tour/useTourSteps.cjs +108 -0
  77. package/dist/components/feedback/tour/useTourSteps.cjs.map +1 -0
  78. package/dist/components/feedback/tour/useTourSteps.mjs +107 -0
  79. package/dist/components/feedback/tour/useTourSteps.mjs.map +1 -0
  80. package/dist/components/forms/Button.cjs +1 -1
  81. package/dist/components/forms/Button.cjs.map +1 -1
  82. package/dist/components/forms/Button.mjs +1 -1
  83. package/dist/components/forms/Button.mjs.map +1 -1
  84. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs +1 -1
  85. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  86. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs +1 -1
  87. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  88. package/dist/components/forms/FileInput.cjs +1 -1
  89. package/dist/components/forms/FileInput.cjs.map +1 -1
  90. package/dist/components/forms/FileInput.mjs +1 -1
  91. package/dist/components/forms/FileInput.mjs.map +1 -1
  92. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs +34 -17
  93. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  94. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs +34 -17
  95. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  96. package/dist/components/forms/MultiSelect.cjs +1 -1
  97. package/dist/components/forms/MultiSelect.cjs.map +1 -1
  98. package/dist/components/forms/MultiSelect.mjs +1 -1
  99. package/dist/components/forms/MultiSelect.mjs.map +1 -1
  100. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs +2 -1
  101. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  102. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs +2 -1
  103. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  104. package/dist/components/forms/TagInput.cjs.map +1 -1
  105. package/dist/components/forms/TagInput.mjs.map +1 -1
  106. package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.cjs +1 -0
  107. package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  108. package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.mjs +1 -0
  109. package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  110. package/dist/components/forms/Textarea.cjs.map +1 -1
  111. package/dist/components/forms/Textarea.mjs.map +1 -1
  112. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
  113. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  114. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs +1 -1
  115. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  116. package/dist/components/forms/morph-select/MorphSelectTrigger.cjs.map +1 -1
  117. package/dist/components/forms/morph-select/MorphSelectTrigger.mjs.map +1 -1
  118. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs +2 -2
  119. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  120. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs +2 -2
  121. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  122. package/dist/components/layout/Canvas.cjs +1 -1
  123. package/dist/components/layout/Canvas.cjs.map +1 -1
  124. package/dist/components/layout/Canvas.mjs +1 -1
  125. package/dist/components/layout/Canvas.mjs.map +1 -1
  126. package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.cjs +1 -1
  127. package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  128. package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.mjs +1 -1
  129. package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  130. package/dist/components/layout/PopoverPanel.cjs +1 -1
  131. package/dist/components/layout/PopoverPanel.cjs.map +1 -1
  132. package/dist/components/layout/PopoverPanel.mjs +1 -1
  133. package/dist/components/layout/PopoverPanel.mjs.map +1 -1
  134. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +1 -1
  135. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  136. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +1 -1
  137. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  138. package/dist/components/layout/popover/PopoverTrigger.cjs.map +1 -1
  139. package/dist/components/layout/popover/PopoverTrigger.mjs.map +1 -1
  140. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs +1 -1
  141. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  142. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs +1 -1
  143. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  144. package/dist/components/navigation/DropdownMenu.cjs +1 -1
  145. package/dist/components/navigation/DropdownMenu.cjs.map +1 -1
  146. package/dist/components/navigation/DropdownMenu.mjs +1 -1
  147. package/dist/components/navigation/DropdownMenu.mjs.map +1 -1
  148. package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.cjs +1 -1
  149. package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  150. package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.mjs +1 -1
  151. package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  152. package/dist/components/navigation/Switcher.cjs.map +1 -1
  153. package/dist/components/navigation/Switcher.mjs.map +1 -1
  154. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +77 -45
  155. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  156. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +77 -45
  157. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  158. package/dist/components/navigation/menu/MenuTrigger.cjs.map +1 -1
  159. package/dist/components/navigation/menu/MenuTrigger.mjs.map +1 -1
  160. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs +1 -1
  161. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  162. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs +1 -1
  163. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  164. package/dist/composables/useField.cjs +28 -8
  165. package/dist/composables/useField.cjs.map +1 -1
  166. package/dist/composables/useField.mjs +28 -8
  167. package/dist/composables/useField.mjs.map +1 -1
  168. package/dist/config/ModoLocale.cjs +10 -1
  169. package/dist/config/ModoLocale.cjs.map +1 -1
  170. package/dist/config/ModoLocale.mjs +10 -1
  171. package/dist/config/ModoLocale.mjs.map +1 -1
  172. package/dist/config/locales/es.cjs +10 -1
  173. package/dist/config/locales/es.cjs.map +1 -1
  174. package/dist/config/locales/es.mjs +10 -1
  175. package/dist/config/locales/es.mjs.map +1 -1
  176. package/dist/index.cjs +4 -0
  177. package/dist/index.mjs +3 -1
  178. package/dist/mood-ui.css +293 -117
  179. package/dist/types/components/data-display/surface-card/SurfaceCardBody.vue.d.ts +1 -1
  180. package/dist/types/components/data-display/surface-card/SurfaceCardFooter.vue.d.ts +1 -1
  181. package/dist/types/components/data-display/surface-card/SurfaceCardHeader.vue.d.ts +1 -1
  182. package/dist/types/components/feedback/dialog/DialogContent.vue.d.ts +1 -1
  183. package/dist/types/components/feedback/tour/Tour.vue.d.ts +31 -0
  184. package/dist/types/components/feedback/tour/TourCard.vue.d.ts +25 -0
  185. package/dist/types/components/feedback/tour/index.d.ts +2 -0
  186. package/dist/types/components/feedback/tour/tourAnchor.d.ts +12 -0
  187. package/dist/types/components/feedback/tour/tourPlace.d.ts +60 -0
  188. package/dist/types/components/feedback/tour/tourShape.d.ts +36 -0
  189. package/dist/types/components/feedback/tour/useTourSpotlight.d.ts +14 -0
  190. package/dist/types/components/feedback/tour/useTourSteps.d.ts +31 -0
  191. package/dist/types/components/layout/Canvas.vue.d.ts +1 -1
  192. package/dist/types/components/layout/popover/PopoverContent.vue.d.ts +1 -1
  193. package/dist/types/components/navigation/menu/MenuContent.vue.d.ts +1 -1
  194. package/dist/types/composables/useField.d.ts +23 -0
  195. package/dist/types/config/ModoLocale.d.ts +14 -0
  196. package/dist/types/index.d.ts +2 -0
  197. package/dist/types/interfaces/feedback/Tour.interface.d.ts +73 -0
  198. package/dist/types/interfaces/navigation/Switcher.interface.d.ts +5 -0
  199. package/package.json +1 -1
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
2
2
  import Button_vue_vue_type_script_setup_true_lang_default from "./Button.vue_vue_type_script_setup_true_lang.mjs";
3
3
  /* empty css */
4
4
  //#region src/components/forms/Button.vue
5
- var Button_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Button_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-15141189"]]);
5
+ var Button_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Button_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-2410a1f6"]]);
6
6
  //#endregion
7
7
  export { Button_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","names":[],"sources":["../../../src/components/forms/Button.vue"],"sourcesContent":["<template>\n <!-- Skeleton placeholder — mirrors the real button's footprint (size, \n radius, fullWidth). Useful for action rows that load after the \n page paints. -->\n <Skeleton\n v-if=\"skeleton\"\n shape=\"button\"\n :size=\"forwardSize\"\n :radius=\"radius\"\n :fullWidth=\"fullWidth\"\n />\n\n <component\n :is=\"rootTag\"\n v-else\n :type=\"isLink ? undefined : type\"\n :href=\"linkHref\"\n :target=\"isLink ? target : undefined\"\n :rel=\"isLink ? rel : undefined\"\n :disabled=\"isLink ? undefined : isDisabled || loading\"\n :aria-disabled=\"isLink && isEffectivelyDisabled ? 'true' : undefined\"\n :tabindex=\"isLink && isEffectivelyDisabled ? -1 : undefined\"\n :aria-busy=\"loading || undefined\"\n :aria-label=\"resolvedAriaLabel\"\n :class=\"[\n baseClasses,\n variantClasses,\n colorClasses,\n haloClasses,\n sizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isLink && isEffectivelyDisabled\n ? 'opacity-40 pointer-events-none cursor-not-allowed'\n : '',\n ]\"\n >\n <Loader\n v-if=\"loading && iconPosition === 'left'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'left'\"\n :class=\"iconSizeClasses\"\n />\n\n <template v-if=\"loading\">{{\n loadingText || label || \"Loading...\"\n }}</template>\n <template v-else>\n <slot>{{ label }}</slot>\n </template>\n <Loader\n v-if=\"loading && iconPosition === 'right'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'right'\"\n :class=\"iconSizeClasses\"\n />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useSlots } from \"vue\";\nimport type { Button } from \"../../interfaces/forms/Button.interface\";\nimport type { ModoSize } from \"../../config/ModoConfig\";\nimport {\n useResolvedColor,\n useResolvedHalo,\n useResolvedRadius,\n useModoConfig,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\nimport { CONTROL_FOCUS_RING } from \"../../composables/useField\";\nimport Loader from \"../feedback/Loader.vue\";\nimport Skeleton from \"../feedback/Skeleton.vue\";\n\nconst groupProps = inject<{\n variant?: string;\n color?: string;\n size?: string;\n radius?: string;\n disabled?: boolean;\n gradient?: boolean;\n fullWidth?: boolean;\n}>(\"buttonGroup\", {});\nconst isInGroup = computed(() => Object.keys(groupProps).length > 0);\n\nconst props = withDefaults(defineProps<Button>(), {\n disabled: false,\n loading: false,\n variant: \"normal\",\n color: \"default\",\n gradient: false,\n type: \"button\",\n as: \"button\",\n fullWidth: false,\n iconPosition: \"left\",\n skeleton: false,\n});\n\n// Render as a real anchor when `as=\"a\"` (navigation links). A `<button>` can't\n// carry `href`, and an `<a>` can't carry `type`/`disabled` — so we swap the root\n// tag and route the tag-specific attributes accordingly.\nconst isLink = computed(() => props.as === \"a\");\nconst isEffectivelyDisabled = computed(() => isDisabled.value || props.loading);\nconst rootTag = computed(() => (isLink.value ? \"a\" : \"button\"));\n// A disabled link drops its href (so it isn't navigable) and relies on\n// aria-disabled + pointer-events-none for the disabled affordance.\nconst linkHref = computed(() =>\n isLink.value && !isEffectivelyDisabled.value ? props.href : undefined,\n);\n\nconst variant = computed(\n () => (groupProps.variant as Button[\"variant\"]) ?? props.variant,\n);\nconst color = useResolvedColor(() => {\n // Child button can override group color when explicitly set\n if (props.color !== \"default\") return props.color;\n return (groupProps.color as Button[\"color\"]) ?? props.color;\n});\n// Inside a ButtonGroup the group's radius wins over the provider default\n// so all corners (including the buttons' outer ones) match.\nconst radius = useResolvedRadius(\n () => (groupProps.radius as Button[\"radius\"]) ?? props.radius,\n);\nconst halo = useResolvedHalo();\nconst cfg = useModoConfig();\nconst size = computed<Button[\"size\"]>(\n () =>\n (groupProps.size as Button[\"size\"]) ??\n props.size ??\n cfg?.value.size ??\n \"medium\",\n);\nconst sz = useSizeTokens(\n () => {\n const s = (groupProps.size as Button[\"size\"]) ?? props.size ?? cfg?.value.size ?? \"medium\";\n // normalizeSize handles the legacy 'xs' alias — cast to satisfy useSizeTokens signature\n return s === \"xs\" ? \"small\" : s as ModoSize;\n },\n);\n// Loader/Skeleton don't have an 'xs'/'xsmall' size — collapse to 'small' when\n// forwarding so the visual footprint of `<Button size=\"xs\" loading>` stays compact.\nconst forwardSize = computed<\"xsmall\" | \"small\" | \"medium\" | \"large\">(() =>\n size.value === \"xs\" ? \"small\" : (size.value as \"xsmall\" | \"small\" | \"medium\" | \"large\"),\n);\nconst isDisabled = computed(() => groupProps.disabled ?? props.disabled);\nconst gradient = computed(() => groupProps.gradient ?? props.gradient);\nconst fullWidth = computed(() => groupProps.fullWidth ?? props.fullWidth);\n\n// Accessible name resolution:\n// - explicit `ariaLabel` wins\n// - else fall back to visible `label`\n// - icon-only buttons without either will emit a dev warning so consumers notice\nconst slots = useSlots();\n\nconst resolvedAriaLabel = computed(() => {\n if (props.ariaLabel) return props.ariaLabel;\n if (props.label) return undefined; // visible text via prop\n if (slots.default) return undefined; // visible text via slot\n if (import.meta.env.DEV && props.icon) {\n console.warn(\n \"[mood-ui] <Button> is icon-only but has no `ariaLabel` — add one for screen readers.\",\n );\n }\n return undefined;\n});\n\nconst baseClasses =\n `${CONTROL_FOCUS_RING} transition-colors duration-300 ease-in-out inline-flex items-center justify-center gap-2 cursor-pointer disabled:cursor-not-allowed`;\n\nconst variantClasses = computed(() => {\n switch (variant.value) {\n case \"outline\":\n return \"border font-medium\";\n case \"ghost\":\n return \"font-medium\";\n case \"text\":\n return \"font-medium\";\n default:\n return \"font-medium\";\n }\n});\n\nconst haloClasses = computed(() => {\n // Persistent (idle) halo, opt-in via 'neutral'/'tinted'. The FOCUS ring is\n // handled uniformly by `baseClasses` (CONTROL_FOCUS_RING), so these maps only\n // describe the resting + hover ring — no per-component focus ring here.\n // Suppressed inside a ButtonGroup (adjacent buttons would overlap rings).\n if (isInGroup.value) return \"\";\n if (variant.value !== \"normal\" && variant.value !== \"outline\") return \"\";\n\n const haloMode = halo.value;\n\n // 'off' (default): no idle/hover halo. Focus still shows the unified ring.\n if (haloMode === \"off\") return \"\";\n\n // 'neutral': idle grey ring.\n if (haloMode === \"neutral\") {\n return \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\";\n }\n\n // 'tinted' (legacy): idle ring tinted to the color.\n const map: Record<string, string> = {\n default: \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\",\n primary: \"ring-[3px] ring-primary/15 hover:ring-primary/25\",\n danger: \"ring-[3px] ring-destructive/15 hover:ring-destructive/25\",\n success: \"ring-[3px] ring-success/15 hover:ring-success/25\",\n warning: \"ring-[3px] ring-warning/15 hover:ring-warning/25\",\n };\n return map[color.value] ?? map.default;\n});\n\nconst colorClasses = computed(() => {\n const isGradient = gradient.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n normal: isGradient\n ? \"text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40\"\n : \"text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40\",\n outline:\n \"border-border text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-border disabled:bg-muted/60\",\n ghost:\n \"text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60\",\n text: \"text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground\",\n },\n primary: {\n normal: isGradient\n ? \"text-primary-foreground bg-gradient-to-r from-primary via-primary/90 to-primary/90 hover:from-primary-hover hover:via-primary-hover/90 hover:to-primary-hover/90 active:from-primary-active active:via-primary-active/90 active:to-primary-active/90 disabled:opacity-40\"\n : \"text-primary-foreground bg-primary hover:bg-primary-hover active:bg-primary-active disabled:opacity-40\",\n outline:\n \"border-primary/40 text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50 disabled:border-primary/20 disabled:bg-primary/5\",\n ghost:\n \"text-primary bg-primary-subtle hover:bg-primary/20 active:bg-primary/25 disabled:text-primary/50 disabled:bg-primary/5\",\n text: \"text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50\",\n },\n danger: {\n normal: isGradient\n ? \"text-destructive-foreground bg-gradient-to-r from-destructive via-destructive/90 to-destructive/90 hover:from-destructive-hover hover:via-destructive-hover/90 hover:to-destructive-hover/90 active:from-destructive-active active:via-destructive-active/90 active:to-destructive-active/90 disabled:opacity-40\"\n : \"text-destructive-foreground bg-destructive hover:bg-destructive-hover active:bg-destructive-active disabled:opacity-40\",\n outline:\n \"border-destructive/40 text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50 disabled:border-destructive/20 disabled:bg-destructive/5\",\n ghost:\n \"text-destructive bg-destructive-subtle hover:bg-destructive/20 active:bg-destructive/25 disabled:text-destructive/50 disabled:bg-destructive/5\",\n text: \"text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50\",\n },\n success: {\n normal: isGradient\n ? \"text-success-foreground bg-gradient-to-r from-success via-success/90 to-success/90 hover:from-success-hover hover:via-success-hover/90 hover:to-success-hover/90 active:from-success-active active:via-success-active/90 active:to-success-active/90 disabled:opacity-40\"\n : \"text-success-foreground bg-success hover:bg-success-hover active:bg-success-active disabled:opacity-40\",\n outline:\n \"border-success/40 text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50 disabled:border-success/20 disabled:bg-success/5\",\n ghost:\n \"text-success bg-success-subtle hover:bg-success/20 active:bg-success/25 disabled:text-success/50 disabled:bg-success/5\",\n text: \"text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50\",\n },\n warning: {\n normal: isGradient\n ? \"text-warning-foreground bg-gradient-to-r from-warning via-warning/90 to-warning/90 hover:from-warning-hover hover:via-warning-hover/90 hover:to-warning-hover/90 active:from-warning-active active:via-warning-active/90 active:to-warning-active/90 disabled:opacity-40\"\n : \"text-warning-foreground bg-warning hover:bg-warning-hover active:bg-warning-active disabled:opacity-40\",\n outline:\n \"border-warning/40 text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50 disabled:border-warning/20 disabled:bg-warning/5\",\n ghost:\n \"text-warning bg-warning-subtle hover:bg-warning/20 active:bg-warning/25 disabled:text-warning/50 disabled:bg-warning/5\",\n text: \"text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50\",\n },\n };\n return map[color.value]?.[variant.value] ?? map.default.normal;\n});\n\nconst sizeClasses = computed(() => {\n if (!props.label && !slots.default && props.icon) {\n // icon-only button: square, height = control height\n return `${sz.value.control} aspect-square justify-center ${sz.value.text}`;\n }\n // text button: fixed control height (the anchor) + horizontal padding from tokens\n return `${sz.value.control} ${sz.value.text} ${sz.value.padX}`;\n});\n\nconst radiusClasses = computed(() => {\n switch (radius.value) {\n case \"none\":\n return \"rounded-none\";\n case \"small\":\n return \"rounded-sm\";\n case \"large\":\n return \"rounded-lg\";\n case \"full\":\n return \"rounded-[999px]\";\n default:\n return \"rounded-md\";\n }\n});\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n</script>\n\n<style scoped>\nbutton,\na {\n transition-property:\n background-color, border-color, color, box-shadow, --tw-ring-color,\n --tw-ring-shadow;\n transition-duration: 220ms;\n transition-timing-function: cubic-bezier(0.2, 0, 0, 1);\n}\n@media (prefers-reduced-motion: reduce) {\n button,\n a {\n transition: none;\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"Button.mjs","names":[],"sources":["../../../src/components/forms/Button.vue"],"sourcesContent":["<template>\n <!-- Skeleton placeholder — mirrors the real button's footprint (size, \n radius, fullWidth). Useful for action rows that load after the \n page paints. -->\n <Skeleton\n v-if=\"skeleton\"\n shape=\"button\"\n :size=\"forwardSize\"\n :radius=\"radius\"\n :fullWidth=\"fullWidth\"\n />\n\n <component\n :is=\"rootTag\"\n v-else\n :type=\"isLink ? undefined : type\"\n :href=\"linkHref\"\n :target=\"isLink ? target : undefined\"\n :rel=\"isLink ? rel : undefined\"\n :disabled=\"isLink ? undefined : isDisabled || loading\"\n :aria-disabled=\"isLink && isEffectivelyDisabled ? 'true' : undefined\"\n :tabindex=\"isLink && isEffectivelyDisabled ? -1 : undefined\"\n :aria-busy=\"loading || undefined\"\n :aria-label=\"resolvedAriaLabel\"\n :class=\"[\n baseClasses,\n variantClasses,\n colorClasses,\n haloClasses,\n sizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isLink && isEffectivelyDisabled\n ? 'opacity-40 pointer-events-none cursor-not-allowed'\n : '',\n ]\"\n >\n <Loader\n v-if=\"loading && iconPosition === 'left'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'left'\"\n :class=\"iconSizeClasses\"\n />\n\n <template v-if=\"loading\">{{\n loadingText || label || \"Loading...\"\n }}</template>\n <template v-else>\n <slot>{{ label }}</slot>\n </template>\n <Loader\n v-if=\"loading && iconPosition === 'right'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'right'\"\n :class=\"iconSizeClasses\"\n />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useSlots } from \"vue\";\nimport type { Button } from \"../../interfaces/forms/Button.interface\";\nimport type { ModoSize } from \"../../config/ModoConfig\";\nimport {\n useResolvedColor,\n useResolvedHalo,\n useResolvedRadius,\n useModoConfig,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\nimport { CONTROL_FOCUS_RING } from \"../../composables/useField\";\nimport Loader from \"../feedback/Loader.vue\";\nimport Skeleton from \"../feedback/Skeleton.vue\";\n\nconst groupProps = inject<{\n variant?: string;\n color?: string;\n size?: string;\n radius?: string;\n disabled?: boolean;\n gradient?: boolean;\n fullWidth?: boolean;\n}>(\"buttonGroup\", {});\nconst isInGroup = computed(() => Object.keys(groupProps).length > 0);\n\nconst props = withDefaults(defineProps<Button>(), {\n disabled: false,\n loading: false,\n variant: \"normal\",\n color: \"default\",\n gradient: false,\n type: \"button\",\n as: \"button\",\n fullWidth: false,\n iconPosition: \"left\",\n skeleton: false,\n});\n\n// Render as a real anchor when `as=\"a\"` (navigation links). A `<button>` can't\n// carry `href`, and an `<a>` can't carry `type`/`disabled` — so we swap the root\n// tag and route the tag-specific attributes accordingly.\nconst isLink = computed(() => props.as === \"a\");\nconst isEffectivelyDisabled = computed(() => isDisabled.value || props.loading);\nconst rootTag = computed(() => (isLink.value ? \"a\" : \"button\"));\n// A disabled link drops its href (so it isn't navigable) and relies on\n// aria-disabled + pointer-events-none for the disabled affordance.\nconst linkHref = computed(() =>\n isLink.value && !isEffectivelyDisabled.value ? props.href : undefined,\n);\n\nconst variant = computed(\n () => (groupProps.variant as Button[\"variant\"]) ?? props.variant,\n);\nconst color = useResolvedColor(() => {\n // Child button can override group color when explicitly set\n if (props.color !== \"default\") return props.color;\n return (groupProps.color as Button[\"color\"]) ?? props.color;\n});\n// Inside a ButtonGroup the group's radius wins over the provider default\n// so all corners (including the buttons' outer ones) match.\nconst radius = useResolvedRadius(\n () => (groupProps.radius as Button[\"radius\"]) ?? props.radius,\n);\nconst halo = useResolvedHalo();\nconst cfg = useModoConfig();\nconst size = computed<Button[\"size\"]>(\n () =>\n (groupProps.size as Button[\"size\"]) ??\n props.size ??\n cfg?.value.size ??\n \"medium\",\n);\nconst sz = useSizeTokens(\n () => {\n const s = (groupProps.size as Button[\"size\"]) ?? props.size ?? cfg?.value.size ?? \"medium\";\n // normalizeSize handles the legacy 'xs' alias — cast to satisfy useSizeTokens signature\n return s === \"xs\" ? \"small\" : s as ModoSize;\n },\n);\n// Loader/Skeleton don't have an 'xs'/'xsmall' size — collapse to 'small' when\n// forwarding so the visual footprint of `<Button size=\"xs\" loading>` stays compact.\nconst forwardSize = computed<\"xsmall\" | \"small\" | \"medium\" | \"large\">(() =>\n size.value === \"xs\" ? \"small\" : (size.value as \"xsmall\" | \"small\" | \"medium\" | \"large\"),\n);\nconst isDisabled = computed(() => groupProps.disabled ?? props.disabled);\nconst gradient = computed(() => groupProps.gradient ?? props.gradient);\nconst fullWidth = computed(() => groupProps.fullWidth ?? props.fullWidth);\n\n// Accessible name resolution:\n// - explicit `ariaLabel` wins\n// - else fall back to visible `label`\n// - icon-only buttons without either will emit a dev warning so consumers notice\nconst slots = useSlots();\n\nconst resolvedAriaLabel = computed(() => {\n if (props.ariaLabel) return props.ariaLabel;\n if (props.label) return undefined; // visible text via prop\n if (slots.default) return undefined; // visible text via slot\n if (import.meta.env.DEV && props.icon) {\n console.warn(\n \"[mood-ui] <Button> is icon-only but has no `ariaLabel` — add one for screen readers.\",\n );\n }\n return undefined;\n});\n\nconst baseClasses =\n `${CONTROL_FOCUS_RING} transition-colors duration-300 ease-in-out inline-flex items-center justify-center gap-2 cursor-pointer disabled:cursor-not-allowed`;\n\nconst variantClasses = computed(() => {\n switch (variant.value) {\n case \"outline\":\n return \"border font-medium\";\n case \"ghost\":\n return \"font-medium\";\n case \"text\":\n return \"font-medium\";\n default:\n return \"font-medium\";\n }\n});\n\nconst haloClasses = computed(() => {\n // Persistent (idle) halo, opt-in via 'neutral'/'tinted'. The FOCUS ring is\n // handled uniformly by `baseClasses` (CONTROL_FOCUS_RING), so these maps only\n // describe the resting + hover ring — no per-component focus ring here.\n // Suppressed inside a ButtonGroup (adjacent buttons would overlap rings).\n if (isInGroup.value) return \"\";\n if (variant.value !== \"normal\" && variant.value !== \"outline\") return \"\";\n\n const haloMode = halo.value;\n\n // 'off' (default): no idle/hover halo. Focus still shows the unified ring.\n if (haloMode === \"off\") return \"\";\n\n // 'neutral': idle grey ring.\n if (haloMode === \"neutral\") {\n return \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\";\n }\n\n // 'tinted' (legacy): idle ring tinted to the color.\n const map: Record<string, string> = {\n default: \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\",\n primary: \"ring-[3px] ring-primary/15 hover:ring-primary/25\",\n danger: \"ring-[3px] ring-destructive/15 hover:ring-destructive/25\",\n success: \"ring-[3px] ring-success/15 hover:ring-success/25\",\n warning: \"ring-[3px] ring-warning/15 hover:ring-warning/25\",\n };\n return map[color.value] ?? map.default;\n});\n\nconst colorClasses = computed(() => {\n const isGradient = gradient.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n normal: isGradient\n ? \"text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40\"\n : \"text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40\",\n outline:\n \"border-input hover:border-input-hover text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-input disabled:bg-muted/60\",\n ghost:\n \"text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60\",\n text: \"text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground\",\n },\n primary: {\n normal: isGradient\n ? \"text-primary-foreground bg-gradient-to-r from-primary via-primary/90 to-primary/90 hover:from-primary-hover hover:via-primary-hover/90 hover:to-primary-hover/90 active:from-primary-active active:via-primary-active/90 active:to-primary-active/90 disabled:opacity-40\"\n : \"text-primary-foreground bg-primary hover:bg-primary-hover active:bg-primary-active disabled:opacity-40\",\n outline:\n \"border-primary/40 text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50 disabled:border-primary/20 disabled:bg-primary/5\",\n ghost:\n \"text-primary bg-primary-subtle hover:bg-primary/20 active:bg-primary/25 disabled:text-primary/50 disabled:bg-primary/5\",\n text: \"text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50\",\n },\n danger: {\n normal: isGradient\n ? \"text-destructive-foreground bg-gradient-to-r from-destructive via-destructive/90 to-destructive/90 hover:from-destructive-hover hover:via-destructive-hover/90 hover:to-destructive-hover/90 active:from-destructive-active active:via-destructive-active/90 active:to-destructive-active/90 disabled:opacity-40\"\n : \"text-destructive-foreground bg-destructive hover:bg-destructive-hover active:bg-destructive-active disabled:opacity-40\",\n outline:\n \"border-destructive/40 text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50 disabled:border-destructive/20 disabled:bg-destructive/5\",\n ghost:\n \"text-destructive bg-destructive-subtle hover:bg-destructive/20 active:bg-destructive/25 disabled:text-destructive/50 disabled:bg-destructive/5\",\n text: \"text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50\",\n },\n success: {\n normal: isGradient\n ? \"text-success-foreground bg-gradient-to-r from-success via-success/90 to-success/90 hover:from-success-hover hover:via-success-hover/90 hover:to-success-hover/90 active:from-success-active active:via-success-active/90 active:to-success-active/90 disabled:opacity-40\"\n : \"text-success-foreground bg-success hover:bg-success-hover active:bg-success-active disabled:opacity-40\",\n outline:\n \"border-success/40 text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50 disabled:border-success/20 disabled:bg-success/5\",\n ghost:\n \"text-success bg-success-subtle hover:bg-success/20 active:bg-success/25 disabled:text-success/50 disabled:bg-success/5\",\n text: \"text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50\",\n },\n warning: {\n normal: isGradient\n ? \"text-warning-foreground bg-gradient-to-r from-warning via-warning/90 to-warning/90 hover:from-warning-hover hover:via-warning-hover/90 hover:to-warning-hover/90 active:from-warning-active active:via-warning-active/90 active:to-warning-active/90 disabled:opacity-40\"\n : \"text-warning-foreground bg-warning hover:bg-warning-hover active:bg-warning-active disabled:opacity-40\",\n outline:\n \"border-warning/40 text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50 disabled:border-warning/20 disabled:bg-warning/5\",\n ghost:\n \"text-warning bg-warning-subtle hover:bg-warning/20 active:bg-warning/25 disabled:text-warning/50 disabled:bg-warning/5\",\n text: \"text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50\",\n },\n };\n return map[color.value]?.[variant.value] ?? map.default.normal;\n});\n\nconst sizeClasses = computed(() => {\n if (!props.label && !slots.default && props.icon) {\n // icon-only button: square, height = control height\n return `${sz.value.control} aspect-square justify-center ${sz.value.text}`;\n }\n // text button: fixed control height (the anchor) + horizontal padding from tokens\n return `${sz.value.control} ${sz.value.text} ${sz.value.padX}`;\n});\n\nconst radiusClasses = computed(() => {\n switch (radius.value) {\n case \"none\":\n return \"rounded-none\";\n case \"small\":\n return \"rounded-sm\";\n case \"large\":\n return \"rounded-lg\";\n case \"full\":\n return \"rounded-[999px]\";\n default:\n return \"rounded-md\";\n }\n});\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n</script>\n\n<style scoped>\nbutton,\na {\n transition-property:\n background-color, border-color, color, box-shadow, --tw-ring-color,\n --tw-ring-shadow;\n transition-duration: 220ms;\n transition-timing-function: cubic-bezier(0.2, 0, 0, 1);\n}\n@media (prefers-reduced-motion: reduce) {\n button,\n a {\n transition: none;\n }\n}\n</style>\n"],"mappings":""}
@@ -103,7 +103,7 @@ var Button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
103
103
  const map = {
104
104
  default: {
105
105
  normal: isGradient ? "text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40" : "text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40",
106
- outline: "border-border text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-border disabled:bg-muted/60",
106
+ outline: "border-input hover:border-input-hover text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-input disabled:bg-muted/60",
107
107
  ghost: "text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60",
108
108
  text: "text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground"
109
109
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/forms/Button.vue"],"sourcesContent":["<template>\n <!-- Skeleton placeholder — mirrors the real button's footprint (size, \n radius, fullWidth). Useful for action rows that load after the \n page paints. -->\n <Skeleton\n v-if=\"skeleton\"\n shape=\"button\"\n :size=\"forwardSize\"\n :radius=\"radius\"\n :fullWidth=\"fullWidth\"\n />\n\n <component\n :is=\"rootTag\"\n v-else\n :type=\"isLink ? undefined : type\"\n :href=\"linkHref\"\n :target=\"isLink ? target : undefined\"\n :rel=\"isLink ? rel : undefined\"\n :disabled=\"isLink ? undefined : isDisabled || loading\"\n :aria-disabled=\"isLink && isEffectivelyDisabled ? 'true' : undefined\"\n :tabindex=\"isLink && isEffectivelyDisabled ? -1 : undefined\"\n :aria-busy=\"loading || undefined\"\n :aria-label=\"resolvedAriaLabel\"\n :class=\"[\n baseClasses,\n variantClasses,\n colorClasses,\n haloClasses,\n sizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isLink && isEffectivelyDisabled\n ? 'opacity-40 pointer-events-none cursor-not-allowed'\n : '',\n ]\"\n >\n <Loader\n v-if=\"loading && iconPosition === 'left'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'left'\"\n :class=\"iconSizeClasses\"\n />\n\n <template v-if=\"loading\">{{\n loadingText || label || \"Loading...\"\n }}</template>\n <template v-else>\n <slot>{{ label }}</slot>\n </template>\n <Loader\n v-if=\"loading && iconPosition === 'right'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'right'\"\n :class=\"iconSizeClasses\"\n />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useSlots } from \"vue\";\nimport type { Button } from \"../../interfaces/forms/Button.interface\";\nimport type { ModoSize } from \"../../config/ModoConfig\";\nimport {\n useResolvedColor,\n useResolvedHalo,\n useResolvedRadius,\n useModoConfig,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\nimport { CONTROL_FOCUS_RING } from \"../../composables/useField\";\nimport Loader from \"../feedback/Loader.vue\";\nimport Skeleton from \"../feedback/Skeleton.vue\";\n\nconst groupProps = inject<{\n variant?: string;\n color?: string;\n size?: string;\n radius?: string;\n disabled?: boolean;\n gradient?: boolean;\n fullWidth?: boolean;\n}>(\"buttonGroup\", {});\nconst isInGroup = computed(() => Object.keys(groupProps).length > 0);\n\nconst props = withDefaults(defineProps<Button>(), {\n disabled: false,\n loading: false,\n variant: \"normal\",\n color: \"default\",\n gradient: false,\n type: \"button\",\n as: \"button\",\n fullWidth: false,\n iconPosition: \"left\",\n skeleton: false,\n});\n\n// Render as a real anchor when `as=\"a\"` (navigation links). A `<button>` can't\n// carry `href`, and an `<a>` can't carry `type`/`disabled` — so we swap the root\n// tag and route the tag-specific attributes accordingly.\nconst isLink = computed(() => props.as === \"a\");\nconst isEffectivelyDisabled = computed(() => isDisabled.value || props.loading);\nconst rootTag = computed(() => (isLink.value ? \"a\" : \"button\"));\n// A disabled link drops its href (so it isn't navigable) and relies on\n// aria-disabled + pointer-events-none for the disabled affordance.\nconst linkHref = computed(() =>\n isLink.value && !isEffectivelyDisabled.value ? props.href : undefined,\n);\n\nconst variant = computed(\n () => (groupProps.variant as Button[\"variant\"]) ?? props.variant,\n);\nconst color = useResolvedColor(() => {\n // Child button can override group color when explicitly set\n if (props.color !== \"default\") return props.color;\n return (groupProps.color as Button[\"color\"]) ?? props.color;\n});\n// Inside a ButtonGroup the group's radius wins over the provider default\n// so all corners (including the buttons' outer ones) match.\nconst radius = useResolvedRadius(\n () => (groupProps.radius as Button[\"radius\"]) ?? props.radius,\n);\nconst halo = useResolvedHalo();\nconst cfg = useModoConfig();\nconst size = computed<Button[\"size\"]>(\n () =>\n (groupProps.size as Button[\"size\"]) ??\n props.size ??\n cfg?.value.size ??\n \"medium\",\n);\nconst sz = useSizeTokens(\n () => {\n const s = (groupProps.size as Button[\"size\"]) ?? props.size ?? cfg?.value.size ?? \"medium\";\n // normalizeSize handles the legacy 'xs' alias — cast to satisfy useSizeTokens signature\n return s === \"xs\" ? \"small\" : s as ModoSize;\n },\n);\n// Loader/Skeleton don't have an 'xs'/'xsmall' size — collapse to 'small' when\n// forwarding so the visual footprint of `<Button size=\"xs\" loading>` stays compact.\nconst forwardSize = computed<\"xsmall\" | \"small\" | \"medium\" | \"large\">(() =>\n size.value === \"xs\" ? \"small\" : (size.value as \"xsmall\" | \"small\" | \"medium\" | \"large\"),\n);\nconst isDisabled = computed(() => groupProps.disabled ?? props.disabled);\nconst gradient = computed(() => groupProps.gradient ?? props.gradient);\nconst fullWidth = computed(() => groupProps.fullWidth ?? props.fullWidth);\n\n// Accessible name resolution:\n// - explicit `ariaLabel` wins\n// - else fall back to visible `label`\n// - icon-only buttons without either will emit a dev warning so consumers notice\nconst slots = useSlots();\n\nconst resolvedAriaLabel = computed(() => {\n if (props.ariaLabel) return props.ariaLabel;\n if (props.label) return undefined; // visible text via prop\n if (slots.default) return undefined; // visible text via slot\n if (import.meta.env.DEV && props.icon) {\n console.warn(\n \"[mood-ui] <Button> is icon-only but has no `ariaLabel` — add one for screen readers.\",\n );\n }\n return undefined;\n});\n\nconst baseClasses =\n `${CONTROL_FOCUS_RING} transition-colors duration-300 ease-in-out inline-flex items-center justify-center gap-2 cursor-pointer disabled:cursor-not-allowed`;\n\nconst variantClasses = computed(() => {\n switch (variant.value) {\n case \"outline\":\n return \"border font-medium\";\n case \"ghost\":\n return \"font-medium\";\n case \"text\":\n return \"font-medium\";\n default:\n return \"font-medium\";\n }\n});\n\nconst haloClasses = computed(() => {\n // Persistent (idle) halo, opt-in via 'neutral'/'tinted'. The FOCUS ring is\n // handled uniformly by `baseClasses` (CONTROL_FOCUS_RING), so these maps only\n // describe the resting + hover ring — no per-component focus ring here.\n // Suppressed inside a ButtonGroup (adjacent buttons would overlap rings).\n if (isInGroup.value) return \"\";\n if (variant.value !== \"normal\" && variant.value !== \"outline\") return \"\";\n\n const haloMode = halo.value;\n\n // 'off' (default): no idle/hover halo. Focus still shows the unified ring.\n if (haloMode === \"off\") return \"\";\n\n // 'neutral': idle grey ring.\n if (haloMode === \"neutral\") {\n return \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\";\n }\n\n // 'tinted' (legacy): idle ring tinted to the color.\n const map: Record<string, string> = {\n default: \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\",\n primary: \"ring-[3px] ring-primary/15 hover:ring-primary/25\",\n danger: \"ring-[3px] ring-destructive/15 hover:ring-destructive/25\",\n success: \"ring-[3px] ring-success/15 hover:ring-success/25\",\n warning: \"ring-[3px] ring-warning/15 hover:ring-warning/25\",\n };\n return map[color.value] ?? map.default;\n});\n\nconst colorClasses = computed(() => {\n const isGradient = gradient.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n normal: isGradient\n ? \"text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40\"\n : \"text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40\",\n outline:\n \"border-border text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-border disabled:bg-muted/60\",\n ghost:\n \"text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60\",\n text: \"text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground\",\n },\n primary: {\n normal: isGradient\n ? \"text-primary-foreground bg-gradient-to-r from-primary via-primary/90 to-primary/90 hover:from-primary-hover hover:via-primary-hover/90 hover:to-primary-hover/90 active:from-primary-active active:via-primary-active/90 active:to-primary-active/90 disabled:opacity-40\"\n : \"text-primary-foreground bg-primary hover:bg-primary-hover active:bg-primary-active disabled:opacity-40\",\n outline:\n \"border-primary/40 text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50 disabled:border-primary/20 disabled:bg-primary/5\",\n ghost:\n \"text-primary bg-primary-subtle hover:bg-primary/20 active:bg-primary/25 disabled:text-primary/50 disabled:bg-primary/5\",\n text: \"text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50\",\n },\n danger: {\n normal: isGradient\n ? \"text-destructive-foreground bg-gradient-to-r from-destructive via-destructive/90 to-destructive/90 hover:from-destructive-hover hover:via-destructive-hover/90 hover:to-destructive-hover/90 active:from-destructive-active active:via-destructive-active/90 active:to-destructive-active/90 disabled:opacity-40\"\n : \"text-destructive-foreground bg-destructive hover:bg-destructive-hover active:bg-destructive-active disabled:opacity-40\",\n outline:\n \"border-destructive/40 text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50 disabled:border-destructive/20 disabled:bg-destructive/5\",\n ghost:\n \"text-destructive bg-destructive-subtle hover:bg-destructive/20 active:bg-destructive/25 disabled:text-destructive/50 disabled:bg-destructive/5\",\n text: \"text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50\",\n },\n success: {\n normal: isGradient\n ? \"text-success-foreground bg-gradient-to-r from-success via-success/90 to-success/90 hover:from-success-hover hover:via-success-hover/90 hover:to-success-hover/90 active:from-success-active active:via-success-active/90 active:to-success-active/90 disabled:opacity-40\"\n : \"text-success-foreground bg-success hover:bg-success-hover active:bg-success-active disabled:opacity-40\",\n outline:\n \"border-success/40 text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50 disabled:border-success/20 disabled:bg-success/5\",\n ghost:\n \"text-success bg-success-subtle hover:bg-success/20 active:bg-success/25 disabled:text-success/50 disabled:bg-success/5\",\n text: \"text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50\",\n },\n warning: {\n normal: isGradient\n ? \"text-warning-foreground bg-gradient-to-r from-warning via-warning/90 to-warning/90 hover:from-warning-hover hover:via-warning-hover/90 hover:to-warning-hover/90 active:from-warning-active active:via-warning-active/90 active:to-warning-active/90 disabled:opacity-40\"\n : \"text-warning-foreground bg-warning hover:bg-warning-hover active:bg-warning-active disabled:opacity-40\",\n outline:\n \"border-warning/40 text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50 disabled:border-warning/20 disabled:bg-warning/5\",\n ghost:\n \"text-warning bg-warning-subtle hover:bg-warning/20 active:bg-warning/25 disabled:text-warning/50 disabled:bg-warning/5\",\n text: \"text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50\",\n },\n };\n return map[color.value]?.[variant.value] ?? map.default.normal;\n});\n\nconst sizeClasses = computed(() => {\n if (!props.label && !slots.default && props.icon) {\n // icon-only button: square, height = control height\n return `${sz.value.control} aspect-square justify-center ${sz.value.text}`;\n }\n // text button: fixed control height (the anchor) + horizontal padding from tokens\n return `${sz.value.control} ${sz.value.text} ${sz.value.padX}`;\n});\n\nconst radiusClasses = computed(() => {\n switch (radius.value) {\n case \"none\":\n return \"rounded-none\";\n case \"small\":\n return \"rounded-sm\";\n case \"large\":\n return \"rounded-lg\";\n case \"full\":\n return \"rounded-[999px]\";\n default:\n return \"rounded-md\";\n }\n});\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n</script>\n\n<style scoped>\nbutton,\na {\n transition-property:\n background-color, border-color, color, box-shadow, --tw-ring-color,\n --tw-ring-shadow;\n transition-duration: 220ms;\n transition-timing-function: cubic-bezier(0.2, 0, 0, 1);\n}\n@media (prefers-reduced-motion: reduce) {\n button,\n a {\n transition: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFA,MAAM,cAAA,GAAA,IAAA,QAQH,eAAe,EAAE,CAAC;EACrB,MAAM,aAAA,GAAA,IAAA,gBAA2B,OAAO,KAAK,WA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,QAAA,iBAAY,WAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,yBADjC,QAAA,KAAI,EAAA;;MAER,QAAA,GAAA,IAAA,gBAAO,gBAAA,MAAe;;KAGT,QAAA,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAEH,IAAA,UAAA,EAAA,KAAA,GAAA,EAAA,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBADX,QAAA,eAAe,QAAA,SAAK,aAAA,EAAA,EAAA,CAAA,EAAA,GAAA,KAAA,GAAA,IAAA,YAGI,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,QAAA,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAf,QAAA,MAAK,EAAA,EAAA,CAAA,EAAA,KAAA;KAGR,QAAA,WAAW,QAAA,iBAAY,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAG7B,eAAA,SAAA;;MAFC,SAAS,QAAA;MACT,MAAM,YAAA;;KAID,QAAA,QAAI,CAAK,QAAA,WAAW,QAAA,iBAAY,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,yBADjC,QAAA,KAAI,EAAA;;MAER,QAAA,GAAA,IAAA,gBAAO,gBAAA,MAAe"}
1
+ {"version":3,"file":"Button.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/forms/Button.vue"],"sourcesContent":["<template>\n <!-- Skeleton placeholder — mirrors the real button's footprint (size, \n radius, fullWidth). Useful for action rows that load after the \n page paints. -->\n <Skeleton\n v-if=\"skeleton\"\n shape=\"button\"\n :size=\"forwardSize\"\n :radius=\"radius\"\n :fullWidth=\"fullWidth\"\n />\n\n <component\n :is=\"rootTag\"\n v-else\n :type=\"isLink ? undefined : type\"\n :href=\"linkHref\"\n :target=\"isLink ? target : undefined\"\n :rel=\"isLink ? rel : undefined\"\n :disabled=\"isLink ? undefined : isDisabled || loading\"\n :aria-disabled=\"isLink && isEffectivelyDisabled ? 'true' : undefined\"\n :tabindex=\"isLink && isEffectivelyDisabled ? -1 : undefined\"\n :aria-busy=\"loading || undefined\"\n :aria-label=\"resolvedAriaLabel\"\n :class=\"[\n baseClasses,\n variantClasses,\n colorClasses,\n haloClasses,\n sizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isLink && isEffectivelyDisabled\n ? 'opacity-40 pointer-events-none cursor-not-allowed'\n : '',\n ]\"\n >\n <Loader\n v-if=\"loading && iconPosition === 'left'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'left'\"\n :class=\"iconSizeClasses\"\n />\n\n <template v-if=\"loading\">{{\n loadingText || label || \"Loading...\"\n }}</template>\n <template v-else>\n <slot>{{ label }}</slot>\n </template>\n <Loader\n v-if=\"loading && iconPosition === 'right'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'right'\"\n :class=\"iconSizeClasses\"\n />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useSlots } from \"vue\";\nimport type { Button } from \"../../interfaces/forms/Button.interface\";\nimport type { ModoSize } from \"../../config/ModoConfig\";\nimport {\n useResolvedColor,\n useResolvedHalo,\n useResolvedRadius,\n useModoConfig,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\nimport { CONTROL_FOCUS_RING } from \"../../composables/useField\";\nimport Loader from \"../feedback/Loader.vue\";\nimport Skeleton from \"../feedback/Skeleton.vue\";\n\nconst groupProps = inject<{\n variant?: string;\n color?: string;\n size?: string;\n radius?: string;\n disabled?: boolean;\n gradient?: boolean;\n fullWidth?: boolean;\n}>(\"buttonGroup\", {});\nconst isInGroup = computed(() => Object.keys(groupProps).length > 0);\n\nconst props = withDefaults(defineProps<Button>(), {\n disabled: false,\n loading: false,\n variant: \"normal\",\n color: \"default\",\n gradient: false,\n type: \"button\",\n as: \"button\",\n fullWidth: false,\n iconPosition: \"left\",\n skeleton: false,\n});\n\n// Render as a real anchor when `as=\"a\"` (navigation links). A `<button>` can't\n// carry `href`, and an `<a>` can't carry `type`/`disabled` — so we swap the root\n// tag and route the tag-specific attributes accordingly.\nconst isLink = computed(() => props.as === \"a\");\nconst isEffectivelyDisabled = computed(() => isDisabled.value || props.loading);\nconst rootTag = computed(() => (isLink.value ? \"a\" : \"button\"));\n// A disabled link drops its href (so it isn't navigable) and relies on\n// aria-disabled + pointer-events-none for the disabled affordance.\nconst linkHref = computed(() =>\n isLink.value && !isEffectivelyDisabled.value ? props.href : undefined,\n);\n\nconst variant = computed(\n () => (groupProps.variant as Button[\"variant\"]) ?? props.variant,\n);\nconst color = useResolvedColor(() => {\n // Child button can override group color when explicitly set\n if (props.color !== \"default\") return props.color;\n return (groupProps.color as Button[\"color\"]) ?? props.color;\n});\n// Inside a ButtonGroup the group's radius wins over the provider default\n// so all corners (including the buttons' outer ones) match.\nconst radius = useResolvedRadius(\n () => (groupProps.radius as Button[\"radius\"]) ?? props.radius,\n);\nconst halo = useResolvedHalo();\nconst cfg = useModoConfig();\nconst size = computed<Button[\"size\"]>(\n () =>\n (groupProps.size as Button[\"size\"]) ??\n props.size ??\n cfg?.value.size ??\n \"medium\",\n);\nconst sz = useSizeTokens(\n () => {\n const s = (groupProps.size as Button[\"size\"]) ?? props.size ?? cfg?.value.size ?? \"medium\";\n // normalizeSize handles the legacy 'xs' alias — cast to satisfy useSizeTokens signature\n return s === \"xs\" ? \"small\" : s as ModoSize;\n },\n);\n// Loader/Skeleton don't have an 'xs'/'xsmall' size — collapse to 'small' when\n// forwarding so the visual footprint of `<Button size=\"xs\" loading>` stays compact.\nconst forwardSize = computed<\"xsmall\" | \"small\" | \"medium\" | \"large\">(() =>\n size.value === \"xs\" ? \"small\" : (size.value as \"xsmall\" | \"small\" | \"medium\" | \"large\"),\n);\nconst isDisabled = computed(() => groupProps.disabled ?? props.disabled);\nconst gradient = computed(() => groupProps.gradient ?? props.gradient);\nconst fullWidth = computed(() => groupProps.fullWidth ?? props.fullWidth);\n\n// Accessible name resolution:\n// - explicit `ariaLabel` wins\n// - else fall back to visible `label`\n// - icon-only buttons without either will emit a dev warning so consumers notice\nconst slots = useSlots();\n\nconst resolvedAriaLabel = computed(() => {\n if (props.ariaLabel) return props.ariaLabel;\n if (props.label) return undefined; // visible text via prop\n if (slots.default) return undefined; // visible text via slot\n if (import.meta.env.DEV && props.icon) {\n console.warn(\n \"[mood-ui] <Button> is icon-only but has no `ariaLabel` — add one for screen readers.\",\n );\n }\n return undefined;\n});\n\nconst baseClasses =\n `${CONTROL_FOCUS_RING} transition-colors duration-300 ease-in-out inline-flex items-center justify-center gap-2 cursor-pointer disabled:cursor-not-allowed`;\n\nconst variantClasses = computed(() => {\n switch (variant.value) {\n case \"outline\":\n return \"border font-medium\";\n case \"ghost\":\n return \"font-medium\";\n case \"text\":\n return \"font-medium\";\n default:\n return \"font-medium\";\n }\n});\n\nconst haloClasses = computed(() => {\n // Persistent (idle) halo, opt-in via 'neutral'/'tinted'. The FOCUS ring is\n // handled uniformly by `baseClasses` (CONTROL_FOCUS_RING), so these maps only\n // describe the resting + hover ring — no per-component focus ring here.\n // Suppressed inside a ButtonGroup (adjacent buttons would overlap rings).\n if (isInGroup.value) return \"\";\n if (variant.value !== \"normal\" && variant.value !== \"outline\") return \"\";\n\n const haloMode = halo.value;\n\n // 'off' (default): no idle/hover halo. Focus still shows the unified ring.\n if (haloMode === \"off\") return \"\";\n\n // 'neutral': idle grey ring.\n if (haloMode === \"neutral\") {\n return \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\";\n }\n\n // 'tinted' (legacy): idle ring tinted to the color.\n const map: Record<string, string> = {\n default: \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\",\n primary: \"ring-[3px] ring-primary/15 hover:ring-primary/25\",\n danger: \"ring-[3px] ring-destructive/15 hover:ring-destructive/25\",\n success: \"ring-[3px] ring-success/15 hover:ring-success/25\",\n warning: \"ring-[3px] ring-warning/15 hover:ring-warning/25\",\n };\n return map[color.value] ?? map.default;\n});\n\nconst colorClasses = computed(() => {\n const isGradient = gradient.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n normal: isGradient\n ? \"text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40\"\n : \"text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40\",\n outline:\n \"border-input hover:border-input-hover text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-input disabled:bg-muted/60\",\n ghost:\n \"text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60\",\n text: \"text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground\",\n },\n primary: {\n normal: isGradient\n ? \"text-primary-foreground bg-gradient-to-r from-primary via-primary/90 to-primary/90 hover:from-primary-hover hover:via-primary-hover/90 hover:to-primary-hover/90 active:from-primary-active active:via-primary-active/90 active:to-primary-active/90 disabled:opacity-40\"\n : \"text-primary-foreground bg-primary hover:bg-primary-hover active:bg-primary-active disabled:opacity-40\",\n outline:\n \"border-primary/40 text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50 disabled:border-primary/20 disabled:bg-primary/5\",\n ghost:\n \"text-primary bg-primary-subtle hover:bg-primary/20 active:bg-primary/25 disabled:text-primary/50 disabled:bg-primary/5\",\n text: \"text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50\",\n },\n danger: {\n normal: isGradient\n ? \"text-destructive-foreground bg-gradient-to-r from-destructive via-destructive/90 to-destructive/90 hover:from-destructive-hover hover:via-destructive-hover/90 hover:to-destructive-hover/90 active:from-destructive-active active:via-destructive-active/90 active:to-destructive-active/90 disabled:opacity-40\"\n : \"text-destructive-foreground bg-destructive hover:bg-destructive-hover active:bg-destructive-active disabled:opacity-40\",\n outline:\n \"border-destructive/40 text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50 disabled:border-destructive/20 disabled:bg-destructive/5\",\n ghost:\n \"text-destructive bg-destructive-subtle hover:bg-destructive/20 active:bg-destructive/25 disabled:text-destructive/50 disabled:bg-destructive/5\",\n text: \"text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50\",\n },\n success: {\n normal: isGradient\n ? \"text-success-foreground bg-gradient-to-r from-success via-success/90 to-success/90 hover:from-success-hover hover:via-success-hover/90 hover:to-success-hover/90 active:from-success-active active:via-success-active/90 active:to-success-active/90 disabled:opacity-40\"\n : \"text-success-foreground bg-success hover:bg-success-hover active:bg-success-active disabled:opacity-40\",\n outline:\n \"border-success/40 text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50 disabled:border-success/20 disabled:bg-success/5\",\n ghost:\n \"text-success bg-success-subtle hover:bg-success/20 active:bg-success/25 disabled:text-success/50 disabled:bg-success/5\",\n text: \"text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50\",\n },\n warning: {\n normal: isGradient\n ? \"text-warning-foreground bg-gradient-to-r from-warning via-warning/90 to-warning/90 hover:from-warning-hover hover:via-warning-hover/90 hover:to-warning-hover/90 active:from-warning-active active:via-warning-active/90 active:to-warning-active/90 disabled:opacity-40\"\n : \"text-warning-foreground bg-warning hover:bg-warning-hover active:bg-warning-active disabled:opacity-40\",\n outline:\n \"border-warning/40 text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50 disabled:border-warning/20 disabled:bg-warning/5\",\n ghost:\n \"text-warning bg-warning-subtle hover:bg-warning/20 active:bg-warning/25 disabled:text-warning/50 disabled:bg-warning/5\",\n text: \"text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50\",\n },\n };\n return map[color.value]?.[variant.value] ?? map.default.normal;\n});\n\nconst sizeClasses = computed(() => {\n if (!props.label && !slots.default && props.icon) {\n // icon-only button: square, height = control height\n return `${sz.value.control} aspect-square justify-center ${sz.value.text}`;\n }\n // text button: fixed control height (the anchor) + horizontal padding from tokens\n return `${sz.value.control} ${sz.value.text} ${sz.value.padX}`;\n});\n\nconst radiusClasses = computed(() => {\n switch (radius.value) {\n case \"none\":\n return \"rounded-none\";\n case \"small\":\n return \"rounded-sm\";\n case \"large\":\n return \"rounded-lg\";\n case \"full\":\n return \"rounded-[999px]\";\n default:\n return \"rounded-md\";\n }\n});\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n</script>\n\n<style scoped>\nbutton,\na {\n transition-property:\n background-color, border-color, color, box-shadow, --tw-ring-color,\n --tw-ring-shadow;\n transition-duration: 220ms;\n transition-timing-function: cubic-bezier(0.2, 0, 0, 1);\n}\n@media (prefers-reduced-motion: reduce) {\n button,\n a {\n transition: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFA,MAAM,cAAA,GAAA,IAAA,QAQH,eAAe,EAAE,CAAC;EACrB,MAAM,aAAA,GAAA,IAAA,gBAA2B,OAAO,KAAK,WAAW,CAAC,SAAS,EAAE;EAEpE,MAAM,QAAQ;EAgBd,MAAM,UAAA,GAAA,IAAA,gBAAwB,MAAM,OAAO,IAAI;EAC/C,MAAM,yBAAA,GAAA,IAAA,gBAAuC,WAAW,SAAS,MAAM,QAAQ;EAC/E,MAAM,WAAA,GAAA,IAAA,gBAA0B,OAAO,QAAQ,MAAM,SAAU;EAG/D,MAAM,YAAA,GAAA,IAAA,gBACJ,OAAO,SAAS,CAAC,sBAAsB,QAAQ,MAAM,OAAO,KAAA,EAC7D;EAED,MAAM,WAAA,GAAA,IAAA,gBACG,WAAW,WAAiC,MAAM,QAC1D;EACD,MAAM,QAAQ,sBAAA,uBAAuB;GAEnC,IAAI,MAAM,UAAU,WAAW,OAAO,MAAM;GAC5C,OAAQ,WAAW,SAA6B,MAAM;IACtD;EAGF,MAAM,SAAS,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BAAY,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAG7B,eAAA,SAAA;;MAFC,SAAS,QAAA;MACT,MAAM,YAAA;;KAID,QAAA,QAAI,CAAK,QAAA,WAAW,QAAA,iBAAY,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,yBADjC,QAAA,KAAI,EAAA;;MAER,QAAA,GAAA,IAAA,gBAAO,gBAAA,MAAe"}
@@ -102,7 +102,7 @@ var Button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
102
102
  const map = {
103
103
  default: {
104
104
  normal: isGradient ? "text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40" : "text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40",
105
- outline: "border-border text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-border disabled:bg-muted/60",
105
+ outline: "border-input hover:border-input-hover text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-input disabled:bg-muted/60",
106
106
  ghost: "text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60",
107
107
  text: "text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground"
108
108
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/Button.vue"],"sourcesContent":["<template>\n <!-- Skeleton placeholder — mirrors the real button's footprint (size, \n radius, fullWidth). Useful for action rows that load after the \n page paints. -->\n <Skeleton\n v-if=\"skeleton\"\n shape=\"button\"\n :size=\"forwardSize\"\n :radius=\"radius\"\n :fullWidth=\"fullWidth\"\n />\n\n <component\n :is=\"rootTag\"\n v-else\n :type=\"isLink ? undefined : type\"\n :href=\"linkHref\"\n :target=\"isLink ? target : undefined\"\n :rel=\"isLink ? rel : undefined\"\n :disabled=\"isLink ? undefined : isDisabled || loading\"\n :aria-disabled=\"isLink && isEffectivelyDisabled ? 'true' : undefined\"\n :tabindex=\"isLink && isEffectivelyDisabled ? -1 : undefined\"\n :aria-busy=\"loading || undefined\"\n :aria-label=\"resolvedAriaLabel\"\n :class=\"[\n baseClasses,\n variantClasses,\n colorClasses,\n haloClasses,\n sizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isLink && isEffectivelyDisabled\n ? 'opacity-40 pointer-events-none cursor-not-allowed'\n : '',\n ]\"\n >\n <Loader\n v-if=\"loading && iconPosition === 'left'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'left'\"\n :class=\"iconSizeClasses\"\n />\n\n <template v-if=\"loading\">{{\n loadingText || label || \"Loading...\"\n }}</template>\n <template v-else>\n <slot>{{ label }}</slot>\n </template>\n <Loader\n v-if=\"loading && iconPosition === 'right'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'right'\"\n :class=\"iconSizeClasses\"\n />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useSlots } from \"vue\";\nimport type { Button } from \"../../interfaces/forms/Button.interface\";\nimport type { ModoSize } from \"../../config/ModoConfig\";\nimport {\n useResolvedColor,\n useResolvedHalo,\n useResolvedRadius,\n useModoConfig,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\nimport { CONTROL_FOCUS_RING } from \"../../composables/useField\";\nimport Loader from \"../feedback/Loader.vue\";\nimport Skeleton from \"../feedback/Skeleton.vue\";\n\nconst groupProps = inject<{\n variant?: string;\n color?: string;\n size?: string;\n radius?: string;\n disabled?: boolean;\n gradient?: boolean;\n fullWidth?: boolean;\n}>(\"buttonGroup\", {});\nconst isInGroup = computed(() => Object.keys(groupProps).length > 0);\n\nconst props = withDefaults(defineProps<Button>(), {\n disabled: false,\n loading: false,\n variant: \"normal\",\n color: \"default\",\n gradient: false,\n type: \"button\",\n as: \"button\",\n fullWidth: false,\n iconPosition: \"left\",\n skeleton: false,\n});\n\n// Render as a real anchor when `as=\"a\"` (navigation links). A `<button>` can't\n// carry `href`, and an `<a>` can't carry `type`/`disabled` — so we swap the root\n// tag and route the tag-specific attributes accordingly.\nconst isLink = computed(() => props.as === \"a\");\nconst isEffectivelyDisabled = computed(() => isDisabled.value || props.loading);\nconst rootTag = computed(() => (isLink.value ? \"a\" : \"button\"));\n// A disabled link drops its href (so it isn't navigable) and relies on\n// aria-disabled + pointer-events-none for the disabled affordance.\nconst linkHref = computed(() =>\n isLink.value && !isEffectivelyDisabled.value ? props.href : undefined,\n);\n\nconst variant = computed(\n () => (groupProps.variant as Button[\"variant\"]) ?? props.variant,\n);\nconst color = useResolvedColor(() => {\n // Child button can override group color when explicitly set\n if (props.color !== \"default\") return props.color;\n return (groupProps.color as Button[\"color\"]) ?? props.color;\n});\n// Inside a ButtonGroup the group's radius wins over the provider default\n// so all corners (including the buttons' outer ones) match.\nconst radius = useResolvedRadius(\n () => (groupProps.radius as Button[\"radius\"]) ?? props.radius,\n);\nconst halo = useResolvedHalo();\nconst cfg = useModoConfig();\nconst size = computed<Button[\"size\"]>(\n () =>\n (groupProps.size as Button[\"size\"]) ??\n props.size ??\n cfg?.value.size ??\n \"medium\",\n);\nconst sz = useSizeTokens(\n () => {\n const s = (groupProps.size as Button[\"size\"]) ?? props.size ?? cfg?.value.size ?? \"medium\";\n // normalizeSize handles the legacy 'xs' alias — cast to satisfy useSizeTokens signature\n return s === \"xs\" ? \"small\" : s as ModoSize;\n },\n);\n// Loader/Skeleton don't have an 'xs'/'xsmall' size — collapse to 'small' when\n// forwarding so the visual footprint of `<Button size=\"xs\" loading>` stays compact.\nconst forwardSize = computed<\"xsmall\" | \"small\" | \"medium\" | \"large\">(() =>\n size.value === \"xs\" ? \"small\" : (size.value as \"xsmall\" | \"small\" | \"medium\" | \"large\"),\n);\nconst isDisabled = computed(() => groupProps.disabled ?? props.disabled);\nconst gradient = computed(() => groupProps.gradient ?? props.gradient);\nconst fullWidth = computed(() => groupProps.fullWidth ?? props.fullWidth);\n\n// Accessible name resolution:\n// - explicit `ariaLabel` wins\n// - else fall back to visible `label`\n// - icon-only buttons without either will emit a dev warning so consumers notice\nconst slots = useSlots();\n\nconst resolvedAriaLabel = computed(() => {\n if (props.ariaLabel) return props.ariaLabel;\n if (props.label) return undefined; // visible text via prop\n if (slots.default) return undefined; // visible text via slot\n if (import.meta.env.DEV && props.icon) {\n console.warn(\n \"[mood-ui] <Button> is icon-only but has no `ariaLabel` — add one for screen readers.\",\n );\n }\n return undefined;\n});\n\nconst baseClasses =\n `${CONTROL_FOCUS_RING} transition-colors duration-300 ease-in-out inline-flex items-center justify-center gap-2 cursor-pointer disabled:cursor-not-allowed`;\n\nconst variantClasses = computed(() => {\n switch (variant.value) {\n case \"outline\":\n return \"border font-medium\";\n case \"ghost\":\n return \"font-medium\";\n case \"text\":\n return \"font-medium\";\n default:\n return \"font-medium\";\n }\n});\n\nconst haloClasses = computed(() => {\n // Persistent (idle) halo, opt-in via 'neutral'/'tinted'. The FOCUS ring is\n // handled uniformly by `baseClasses` (CONTROL_FOCUS_RING), so these maps only\n // describe the resting + hover ring — no per-component focus ring here.\n // Suppressed inside a ButtonGroup (adjacent buttons would overlap rings).\n if (isInGroup.value) return \"\";\n if (variant.value !== \"normal\" && variant.value !== \"outline\") return \"\";\n\n const haloMode = halo.value;\n\n // 'off' (default): no idle/hover halo. Focus still shows the unified ring.\n if (haloMode === \"off\") return \"\";\n\n // 'neutral': idle grey ring.\n if (haloMode === \"neutral\") {\n return \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\";\n }\n\n // 'tinted' (legacy): idle ring tinted to the color.\n const map: Record<string, string> = {\n default: \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\",\n primary: \"ring-[3px] ring-primary/15 hover:ring-primary/25\",\n danger: \"ring-[3px] ring-destructive/15 hover:ring-destructive/25\",\n success: \"ring-[3px] ring-success/15 hover:ring-success/25\",\n warning: \"ring-[3px] ring-warning/15 hover:ring-warning/25\",\n };\n return map[color.value] ?? map.default;\n});\n\nconst colorClasses = computed(() => {\n const isGradient = gradient.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n normal: isGradient\n ? \"text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40\"\n : \"text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40\",\n outline:\n \"border-border text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-border disabled:bg-muted/60\",\n ghost:\n \"text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60\",\n text: \"text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground\",\n },\n primary: {\n normal: isGradient\n ? \"text-primary-foreground bg-gradient-to-r from-primary via-primary/90 to-primary/90 hover:from-primary-hover hover:via-primary-hover/90 hover:to-primary-hover/90 active:from-primary-active active:via-primary-active/90 active:to-primary-active/90 disabled:opacity-40\"\n : \"text-primary-foreground bg-primary hover:bg-primary-hover active:bg-primary-active disabled:opacity-40\",\n outline:\n \"border-primary/40 text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50 disabled:border-primary/20 disabled:bg-primary/5\",\n ghost:\n \"text-primary bg-primary-subtle hover:bg-primary/20 active:bg-primary/25 disabled:text-primary/50 disabled:bg-primary/5\",\n text: \"text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50\",\n },\n danger: {\n normal: isGradient\n ? \"text-destructive-foreground bg-gradient-to-r from-destructive via-destructive/90 to-destructive/90 hover:from-destructive-hover hover:via-destructive-hover/90 hover:to-destructive-hover/90 active:from-destructive-active active:via-destructive-active/90 active:to-destructive-active/90 disabled:opacity-40\"\n : \"text-destructive-foreground bg-destructive hover:bg-destructive-hover active:bg-destructive-active disabled:opacity-40\",\n outline:\n \"border-destructive/40 text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50 disabled:border-destructive/20 disabled:bg-destructive/5\",\n ghost:\n \"text-destructive bg-destructive-subtle hover:bg-destructive/20 active:bg-destructive/25 disabled:text-destructive/50 disabled:bg-destructive/5\",\n text: \"text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50\",\n },\n success: {\n normal: isGradient\n ? \"text-success-foreground bg-gradient-to-r from-success via-success/90 to-success/90 hover:from-success-hover hover:via-success-hover/90 hover:to-success-hover/90 active:from-success-active active:via-success-active/90 active:to-success-active/90 disabled:opacity-40\"\n : \"text-success-foreground bg-success hover:bg-success-hover active:bg-success-active disabled:opacity-40\",\n outline:\n \"border-success/40 text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50 disabled:border-success/20 disabled:bg-success/5\",\n ghost:\n \"text-success bg-success-subtle hover:bg-success/20 active:bg-success/25 disabled:text-success/50 disabled:bg-success/5\",\n text: \"text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50\",\n },\n warning: {\n normal: isGradient\n ? \"text-warning-foreground bg-gradient-to-r from-warning via-warning/90 to-warning/90 hover:from-warning-hover hover:via-warning-hover/90 hover:to-warning-hover/90 active:from-warning-active active:via-warning-active/90 active:to-warning-active/90 disabled:opacity-40\"\n : \"text-warning-foreground bg-warning hover:bg-warning-hover active:bg-warning-active disabled:opacity-40\",\n outline:\n \"border-warning/40 text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50 disabled:border-warning/20 disabled:bg-warning/5\",\n ghost:\n \"text-warning bg-warning-subtle hover:bg-warning/20 active:bg-warning/25 disabled:text-warning/50 disabled:bg-warning/5\",\n text: \"text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50\",\n },\n };\n return map[color.value]?.[variant.value] ?? map.default.normal;\n});\n\nconst sizeClasses = computed(() => {\n if (!props.label && !slots.default && props.icon) {\n // icon-only button: square, height = control height\n return `${sz.value.control} aspect-square justify-center ${sz.value.text}`;\n }\n // text button: fixed control height (the anchor) + horizontal padding from tokens\n return `${sz.value.control} ${sz.value.text} ${sz.value.padX}`;\n});\n\nconst radiusClasses = computed(() => {\n switch (radius.value) {\n case \"none\":\n return \"rounded-none\";\n case \"small\":\n return \"rounded-sm\";\n case \"large\":\n return \"rounded-lg\";\n case \"full\":\n return \"rounded-[999px]\";\n default:\n return \"rounded-md\";\n }\n});\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n</script>\n\n<style scoped>\nbutton,\na {\n transition-property:\n background-color, border-color, color, box-shadow, --tw-ring-color,\n --tw-ring-shadow;\n transition-duration: 220ms;\n transition-timing-function: cubic-bezier(0.2, 0, 0, 1);\n}\n@media (prefers-reduced-motion: reduce) {\n button,\n a {\n transition: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFA,MAAM,aAAa,OAQhB,eAAe,EAAE,CAAC;EACrB,MAAM,YAAY,eAAe,OAAO,KAAK,WAAW,CAAC,SAAS,EAAE;EAEpE,MAAM,QAAQ;EAgBd,MAAM,SAAS,eAAe,MAAM,OAAO,IAAI;EAC/C,MAAM,wBAAwB,eAAe,WAAW,SAAS,MAAM,QAAQ;EAC/E,MAAM,UAAU,eAAgB,OAAO,QAAQ,MAAM,SAAU;EAG/D,MAAM,WAAW,eACf,OAAO,SAAS,CAAC,sBAAsB,QAAQ,MAAM,OAAO,KAAA,EAC7D;EAED,MAAM,UAAU,eACP,WAAW,WAAiC,MAAM,QAC1D;EACD,MAAM,QAAQ,uBAAuB;GAEnC,IAAI,MAAM,UAAU,WAAW,OAAO,MAAM;GAC5C,OAAQ,WAAW,SAA6B,MAAM;IACtD;EAGF,MAAM,SAAS,wBACN,WAAW,UAA+B,MAAM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UAAU,OAAA,SAAU,sBAAA,QAAqB,KAAQ,KAAA;IACjD,aAAW,QAAA,WAAW,KAAA;IACtB,cAAY,kBAAA;IACZ,OAAK,eAAA;KAAU;KAAmB,eAAA;KAAsB,aAAA;KAAoB,YAAA;KAAmB,YAAA;KAAmB,cAAA;KAAqB,UAAA,QAAS,WAAA;KAAwB,OAAA,SAAU,sBAAA,QAAA,sDAAA;;;2BAiBjL;KAHM,QAAA,WAAW,QAAA,iBAAY,UAAA,WAAA,EAD/B,YAIE,gBAAA;;MAFC,SAAS,QAAA;MACT,MAAM,YAAA;;KAID,QAAA,QAAI,CAAK,QAAA,WAAW,QAAA,iBAAY,UAAA,WAAA,EAFxC,YAIE,wBAHK,QAAA,KAAI,EAAA;;MAER,OAAK,eAAE,gBAAA,MAAe;;KAGT,QAAA,WAAA,WAAA,EAAhB,mBAEa,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADX,QAAA,eAAe,QAAA,SAAK,aAAA,EAAA,EAAA,CAAA,EAAA,GAAA,IAGpB,WAAwB,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,QAAA,CAAA,gBAAA,gBAAf,QAAA,MAAK,EAAA,EAAA,CAAA,EAAA,KAAA;KAGR,QAAA,WAAW,QAAA,iBAAY,WAAA,WAAA,EAD/B,YAIE,gBAAA;;MAFC,SAAS,QAAA;MACT,MAAM,YAAA;;KAID,QAAA,QAAI,CAAK,QAAA,WAAW,QAAA,iBAAY,WAAA,WAAA,EAFxC,YAIE,wBAHK,QAAA,KAAI,EAAA;;MAER,OAAK,eAAE,gBAAA,MAAe"}
1
+ {"version":3,"file":"Button.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/Button.vue"],"sourcesContent":["<template>\n <!-- Skeleton placeholder — mirrors the real button's footprint (size, \n radius, fullWidth). Useful for action rows that load after the \n page paints. -->\n <Skeleton\n v-if=\"skeleton\"\n shape=\"button\"\n :size=\"forwardSize\"\n :radius=\"radius\"\n :fullWidth=\"fullWidth\"\n />\n\n <component\n :is=\"rootTag\"\n v-else\n :type=\"isLink ? undefined : type\"\n :href=\"linkHref\"\n :target=\"isLink ? target : undefined\"\n :rel=\"isLink ? rel : undefined\"\n :disabled=\"isLink ? undefined : isDisabled || loading\"\n :aria-disabled=\"isLink && isEffectivelyDisabled ? 'true' : undefined\"\n :tabindex=\"isLink && isEffectivelyDisabled ? -1 : undefined\"\n :aria-busy=\"loading || undefined\"\n :aria-label=\"resolvedAriaLabel\"\n :class=\"[\n baseClasses,\n variantClasses,\n colorClasses,\n haloClasses,\n sizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isLink && isEffectivelyDisabled\n ? 'opacity-40 pointer-events-none cursor-not-allowed'\n : '',\n ]\"\n >\n <Loader\n v-if=\"loading && iconPosition === 'left'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'left'\"\n :class=\"iconSizeClasses\"\n />\n\n <template v-if=\"loading\">{{\n loadingText || label || \"Loading...\"\n }}</template>\n <template v-else>\n <slot>{{ label }}</slot>\n </template>\n <Loader\n v-if=\"loading && iconPosition === 'right'\"\n :variant=\"variant\"\n :size=\"forwardSize\"\n />\n <component\n :is=\"icon\"\n v-if=\"icon && !loading && iconPosition === 'right'\"\n :class=\"iconSizeClasses\"\n />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useSlots } from \"vue\";\nimport type { Button } from \"../../interfaces/forms/Button.interface\";\nimport type { ModoSize } from \"../../config/ModoConfig\";\nimport {\n useResolvedColor,\n useResolvedHalo,\n useResolvedRadius,\n useModoConfig,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\nimport { CONTROL_FOCUS_RING } from \"../../composables/useField\";\nimport Loader from \"../feedback/Loader.vue\";\nimport Skeleton from \"../feedback/Skeleton.vue\";\n\nconst groupProps = inject<{\n variant?: string;\n color?: string;\n size?: string;\n radius?: string;\n disabled?: boolean;\n gradient?: boolean;\n fullWidth?: boolean;\n}>(\"buttonGroup\", {});\nconst isInGroup = computed(() => Object.keys(groupProps).length > 0);\n\nconst props = withDefaults(defineProps<Button>(), {\n disabled: false,\n loading: false,\n variant: \"normal\",\n color: \"default\",\n gradient: false,\n type: \"button\",\n as: \"button\",\n fullWidth: false,\n iconPosition: \"left\",\n skeleton: false,\n});\n\n// Render as a real anchor when `as=\"a\"` (navigation links). A `<button>` can't\n// carry `href`, and an `<a>` can't carry `type`/`disabled` — so we swap the root\n// tag and route the tag-specific attributes accordingly.\nconst isLink = computed(() => props.as === \"a\");\nconst isEffectivelyDisabled = computed(() => isDisabled.value || props.loading);\nconst rootTag = computed(() => (isLink.value ? \"a\" : \"button\"));\n// A disabled link drops its href (so it isn't navigable) and relies on\n// aria-disabled + pointer-events-none for the disabled affordance.\nconst linkHref = computed(() =>\n isLink.value && !isEffectivelyDisabled.value ? props.href : undefined,\n);\n\nconst variant = computed(\n () => (groupProps.variant as Button[\"variant\"]) ?? props.variant,\n);\nconst color = useResolvedColor(() => {\n // Child button can override group color when explicitly set\n if (props.color !== \"default\") return props.color;\n return (groupProps.color as Button[\"color\"]) ?? props.color;\n});\n// Inside a ButtonGroup the group's radius wins over the provider default\n// so all corners (including the buttons' outer ones) match.\nconst radius = useResolvedRadius(\n () => (groupProps.radius as Button[\"radius\"]) ?? props.radius,\n);\nconst halo = useResolvedHalo();\nconst cfg = useModoConfig();\nconst size = computed<Button[\"size\"]>(\n () =>\n (groupProps.size as Button[\"size\"]) ??\n props.size ??\n cfg?.value.size ??\n \"medium\",\n);\nconst sz = useSizeTokens(\n () => {\n const s = (groupProps.size as Button[\"size\"]) ?? props.size ?? cfg?.value.size ?? \"medium\";\n // normalizeSize handles the legacy 'xs' alias — cast to satisfy useSizeTokens signature\n return s === \"xs\" ? \"small\" : s as ModoSize;\n },\n);\n// Loader/Skeleton don't have an 'xs'/'xsmall' size — collapse to 'small' when\n// forwarding so the visual footprint of `<Button size=\"xs\" loading>` stays compact.\nconst forwardSize = computed<\"xsmall\" | \"small\" | \"medium\" | \"large\">(() =>\n size.value === \"xs\" ? \"small\" : (size.value as \"xsmall\" | \"small\" | \"medium\" | \"large\"),\n);\nconst isDisabled = computed(() => groupProps.disabled ?? props.disabled);\nconst gradient = computed(() => groupProps.gradient ?? props.gradient);\nconst fullWidth = computed(() => groupProps.fullWidth ?? props.fullWidth);\n\n// Accessible name resolution:\n// - explicit `ariaLabel` wins\n// - else fall back to visible `label`\n// - icon-only buttons without either will emit a dev warning so consumers notice\nconst slots = useSlots();\n\nconst resolvedAriaLabel = computed(() => {\n if (props.ariaLabel) return props.ariaLabel;\n if (props.label) return undefined; // visible text via prop\n if (slots.default) return undefined; // visible text via slot\n if (import.meta.env.DEV && props.icon) {\n console.warn(\n \"[mood-ui] <Button> is icon-only but has no `ariaLabel` — add one for screen readers.\",\n );\n }\n return undefined;\n});\n\nconst baseClasses =\n `${CONTROL_FOCUS_RING} transition-colors duration-300 ease-in-out inline-flex items-center justify-center gap-2 cursor-pointer disabled:cursor-not-allowed`;\n\nconst variantClasses = computed(() => {\n switch (variant.value) {\n case \"outline\":\n return \"border font-medium\";\n case \"ghost\":\n return \"font-medium\";\n case \"text\":\n return \"font-medium\";\n default:\n return \"font-medium\";\n }\n});\n\nconst haloClasses = computed(() => {\n // Persistent (idle) halo, opt-in via 'neutral'/'tinted'. The FOCUS ring is\n // handled uniformly by `baseClasses` (CONTROL_FOCUS_RING), so these maps only\n // describe the resting + hover ring — no per-component focus ring here.\n // Suppressed inside a ButtonGroup (adjacent buttons would overlap rings).\n if (isInGroup.value) return \"\";\n if (variant.value !== \"normal\" && variant.value !== \"outline\") return \"\";\n\n const haloMode = halo.value;\n\n // 'off' (default): no idle/hover halo. Focus still shows the unified ring.\n if (haloMode === \"off\") return \"\";\n\n // 'neutral': idle grey ring.\n if (haloMode === \"neutral\") {\n return \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\";\n }\n\n // 'tinted' (legacy): idle ring tinted to the color.\n const map: Record<string, string> = {\n default: \"ring-[3px] ring-foreground/10 hover:ring-foreground/15\",\n primary: \"ring-[3px] ring-primary/15 hover:ring-primary/25\",\n danger: \"ring-[3px] ring-destructive/15 hover:ring-destructive/25\",\n success: \"ring-[3px] ring-success/15 hover:ring-success/25\",\n warning: \"ring-[3px] ring-warning/15 hover:ring-warning/25\",\n };\n return map[color.value] ?? map.default;\n});\n\nconst colorClasses = computed(() => {\n const isGradient = gradient.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n normal: isGradient\n ? \"text-background bg-gradient-to-r from-foreground via-foreground/90 to-foreground/90 hover:from-foreground/90 hover:via-foreground/80 hover:to-foreground/80 active:from-foreground/80 active:via-foreground/70 active:to-foreground/70 disabled:opacity-40\"\n : \"text-background bg-foreground hover:bg-foreground/90 active:bg-foreground/80 disabled:opacity-40\",\n outline:\n \"border-input hover:border-input-hover text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground disabled:border-input disabled:bg-muted/60\",\n ghost:\n \"text-foreground bg-muted hover:bg-muted-hover active:bg-accent-hover disabled:text-muted-foreground disabled:bg-muted/60\",\n text: \"text-foreground hover:bg-muted active:bg-muted-hover disabled:text-muted-foreground\",\n },\n primary: {\n normal: isGradient\n ? \"text-primary-foreground bg-gradient-to-r from-primary via-primary/90 to-primary/90 hover:from-primary-hover hover:via-primary-hover/90 hover:to-primary-hover/90 active:from-primary-active active:via-primary-active/90 active:to-primary-active/90 disabled:opacity-40\"\n : \"text-primary-foreground bg-primary hover:bg-primary-hover active:bg-primary-active disabled:opacity-40\",\n outline:\n \"border-primary/40 text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50 disabled:border-primary/20 disabled:bg-primary/5\",\n ghost:\n \"text-primary bg-primary-subtle hover:bg-primary/20 active:bg-primary/25 disabled:text-primary/50 disabled:bg-primary/5\",\n text: \"text-primary hover:bg-primary-subtle active:bg-primary/20 disabled:text-primary/50\",\n },\n danger: {\n normal: isGradient\n ? \"text-destructive-foreground bg-gradient-to-r from-destructive via-destructive/90 to-destructive/90 hover:from-destructive-hover hover:via-destructive-hover/90 hover:to-destructive-hover/90 active:from-destructive-active active:via-destructive-active/90 active:to-destructive-active/90 disabled:opacity-40\"\n : \"text-destructive-foreground bg-destructive hover:bg-destructive-hover active:bg-destructive-active disabled:opacity-40\",\n outline:\n \"border-destructive/40 text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50 disabled:border-destructive/20 disabled:bg-destructive/5\",\n ghost:\n \"text-destructive bg-destructive-subtle hover:bg-destructive/20 active:bg-destructive/25 disabled:text-destructive/50 disabled:bg-destructive/5\",\n text: \"text-destructive hover:bg-destructive-subtle active:bg-destructive/20 disabled:text-destructive/50\",\n },\n success: {\n normal: isGradient\n ? \"text-success-foreground bg-gradient-to-r from-success via-success/90 to-success/90 hover:from-success-hover hover:via-success-hover/90 hover:to-success-hover/90 active:from-success-active active:via-success-active/90 active:to-success-active/90 disabled:opacity-40\"\n : \"text-success-foreground bg-success hover:bg-success-hover active:bg-success-active disabled:opacity-40\",\n outline:\n \"border-success/40 text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50 disabled:border-success/20 disabled:bg-success/5\",\n ghost:\n \"text-success bg-success-subtle hover:bg-success/20 active:bg-success/25 disabled:text-success/50 disabled:bg-success/5\",\n text: \"text-success hover:bg-success-subtle active:bg-success/20 disabled:text-success/50\",\n },\n warning: {\n normal: isGradient\n ? \"text-warning-foreground bg-gradient-to-r from-warning via-warning/90 to-warning/90 hover:from-warning-hover hover:via-warning-hover/90 hover:to-warning-hover/90 active:from-warning-active active:via-warning-active/90 active:to-warning-active/90 disabled:opacity-40\"\n : \"text-warning-foreground bg-warning hover:bg-warning-hover active:bg-warning-active disabled:opacity-40\",\n outline:\n \"border-warning/40 text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50 disabled:border-warning/20 disabled:bg-warning/5\",\n ghost:\n \"text-warning bg-warning-subtle hover:bg-warning/20 active:bg-warning/25 disabled:text-warning/50 disabled:bg-warning/5\",\n text: \"text-warning hover:bg-warning-subtle active:bg-warning/20 disabled:text-warning/50\",\n },\n };\n return map[color.value]?.[variant.value] ?? map.default.normal;\n});\n\nconst sizeClasses = computed(() => {\n if (!props.label && !slots.default && props.icon) {\n // icon-only button: square, height = control height\n return `${sz.value.control} aspect-square justify-center ${sz.value.text}`;\n }\n // text button: fixed control height (the anchor) + horizontal padding from tokens\n return `${sz.value.control} ${sz.value.text} ${sz.value.padX}`;\n});\n\nconst radiusClasses = computed(() => {\n switch (radius.value) {\n case \"none\":\n return \"rounded-none\";\n case \"small\":\n return \"rounded-sm\";\n case \"large\":\n return \"rounded-lg\";\n case \"full\":\n return \"rounded-[999px]\";\n default:\n return \"rounded-md\";\n }\n});\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n</script>\n\n<style scoped>\nbutton,\na {\n transition-property:\n background-color, border-color, color, box-shadow, --tw-ring-color,\n --tw-ring-shadow;\n transition-duration: 220ms;\n transition-timing-function: cubic-bezier(0.2, 0, 0, 1);\n}\n@media (prefers-reduced-motion: reduce) {\n button,\n a {\n transition: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFA,MAAM,aAAa,OAQhB,eAAe,EAAE,CAAC;EACrB,MAAM,YAAY,eAAe,OAAO,KAAK,WAAW,CAAC,SAAS,EAAE;EAEpE,MAAM,QAAQ;EAgBd,MAAM,SAAS,eAAe,MAAM,OAAO,IAAI;EAC/C,MAAM,wBAAwB,eAAe,WAAW,SAAS,MAAM,QAAQ;EAC/E,MAAM,UAAU,eAAgB,OAAO,QAAQ,MAAM,SAAU;EAG/D,MAAM,WAAW,eACf,OAAO,SAAS,CAAC,sBAAsB,QAAQ,MAAM,OAAO,KAAA,EAC7D;EAED,MAAM,UAAU,eACP,WAAW,WAAiC,MAAM,QAC1D;EACD,MAAM,QAAQ,uBAAuB;GAEnC,IAAI,MAAM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AAU,OAAA,QAAS,KAAA,IAAY,WAAA,SAAc,QAAA;IAC7C,iBAAe,OAAA,SAAU,sBAAA,QAAqB,SAAY,KAAA;IAC1D,UAAU,OAAA,SAAU,sBAAA,QAAqB,KAAQ,KAAA;IACjD,aAAW,QAAA,WAAW,KAAA;IACtB,cAAY,kBAAA;IACZ,OAAK,eAAA;KAAU;KAAmB,eAAA;KAAsB,aAAA;KAAoB,YAAA;KAAmB,YAAA;KAAmB,cAAA;KAAqB,UAAA,QAAS,WAAA;KAAwB,OAAA,SAAU,sBAAA,QAAA,sDAAA;;;2BAiBjL;KAHM,QAAA,WAAW,QAAA,iBAAY,UAAA,WAAA,EAD/B,YAIE,gBAAA;;MAFC,SAAS,QAAA;MACT,MAAM,YAAA;;KAID,QAAA,QAAI,CAAK,QAAA,WAAW,QAAA,iBAAY,UAAA,WAAA,EAFxC,YAIE,wBAHK,QAAA,KAAI,EAAA;;MAER,OAAK,eAAE,gBAAA,MAAe;;KAGT,QAAA,WAAA,WAAA,EAAhB,mBAEa,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADX,QAAA,eAAe,QAAA,SAAK,aAAA,EAAA,EAAA,CAAA,EAAA,GAAA,IAGpB,WAAwB,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,QAAA,CAAA,gBAAA,gBAAf,QAAA,MAAK,EAAA,EAAA,CAAA,EAAA,KAAA;KAGR,QAAA,WAAW,QAAA,iBAAY,WAAA,WAAA,EAD/B,YAIE,gBAAA;;MAFC,SAAS,QAAA;MACT,MAAM,YAAA;;KAID,QAAA,QAAI,CAAK,QAAA,WAAW,QAAA,iBAAY,WAAA,WAAA,EAFxC,YAIE,wBAHK,QAAA,KAAI,EAAA;;MAER,OAAK,eAAE,gBAAA,MAAe"}
@@ -2,7 +2,7 @@ const require__plugin_vue_export_helper = require("../../_virtual/_plugin-vue_ex
2
2
  const require_FileInput_vue_vue_type_script_setup_true_lang = require("./FileInput.vue_vue_type_script_setup_true_lang.cjs");
3
3
  ;/* empty css */
4
4
  //#region src/components/forms/FileInput.vue
5
- var FileInput_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_FileInput_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-e1dd6bae"]]);
5
+ var FileInput_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_FileInput_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-7949fda3"]]);
6
6
  //#endregion
7
7
  exports.default = FileInput_default;
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.cjs","names":[],"sources":["../../../src/components/forms/FileInput.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div \n :class=\"[ \n 'modo-field-wrapper transition-colors', \n dashed ? dashedWrapperClasses : wrapperVariantClasses, \n isAreaVariant ? '' : wrapperSizeClasses, \n radiusClasses, \n colorBorderClass, \n fullWidth ? 'w-full' : '', \n isDisabled ? 'opacity-60 cursor-not-allowed' : '', \n isDragOver ? dragOverRingClass : '', \n isAreaVariant && clickToSelect && !isDisabled && !readonly ? 'cursor-pointer' : '', \n ]\" \n :role=\"isAreaVariant ? 'button' : undefined\" \n :tabindex=\"isAreaVariant && !isDisabled && !readonly ? 0 : undefined\" \n :aria-label=\"isAreaVariant ? (ariaLabel ?? label ?? dropzoneLabel ?? loc.fileInput.uploadFiles) : undefined\" \n @dragover.prevent=\"onDragOver\" \n @dragleave.prevent=\"onDragLeave\" \n @drop.prevent=\"onDrop\" \n @click=\"onWrapperClick\" \n @keydown=\"onWrapperKeydown\" \n > \n <!-- Area variant --> \n <div \n v-if=\"isAreaVariant\" \n :class=\"[ \n 'flex flex-col items-center justify-center text-center gap-2 px-4', \n areaHeightClasses, \n ]\" \n > \n <component \n :is=\"iconLeft ?? ArrowUpTrayIcon\" \n aria-hidden=\"true\" \n :class=\"[ \n 'shrink-0 transition-colors duration-base ease-standard', \n isDragOver ? accentTextClass : accentTextIdleClass, \n areaIconSizeClasses, \n ]\" \n /> \n <Typography variant=\"body\" :size=\"size\" weight=\"medium\"> \n {{ areaPrimaryText }} \n </Typography> \n <Typography v-if=\"areaSecondaryText\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\"> \n {{ areaSecondaryText }} \n </Typography> \n <div @click.stop> \n <Button \n :disabled=\"isDisabled || readonly\" \n :color=\"color\" \n :size=\"size\" \n :radius=\"radius\" \n :icon=\"ArrowUpTrayIcon\" \n variant=\"outline\" \n :label=\"browseLabel\" \n class=\"mt-1\" \n @click=\"openFilePicker\" \n /> \n </div> \n </div> \n \n <!-- Inline variant (default) --> \n <div v-else class=\"flex items-center gap-3\"> \n <component \n :is=\"iconLeft ?? ArrowUpTrayIcon\" \n aria-hidden=\"true\" \n :class=\"['shrink-0', accentTextIdleClass, iconSizeClasses]\" \n /> \n <div class=\"flex-1 min-w-0\"> \n <Typography variant=\"body\" :size=\"size\" weight=\"medium\" :truncate=\"true\"> \n {{ files.length === 0 ? (placeholder ?? loc.fileInput.placeholder) : headlineText }} \n </Typography> \n <Typography v-if=\"helperInlineText\" variant=\"caption\" size=\"medium\" color=\"muted\" :truncate=\"true\" as=\"p\"> \n {{ helperInlineText }} \n </Typography> \n </div> \n <div @click.stop> \n <Button \n :disabled=\"isDisabled || readonly\" \n :color=\"color\" \n :size=\"size\" \n :radius=\"radius\" \n :icon=\"ArrowUpTrayIcon\" \n variant=\"outline\" \n :label=\"browseLabel\" \n @click=\"openFilePicker\" \n /> \n </div> \n </div> \n \n <!-- Hidden native input --> \n <input \n :id=\"fieldId\" \n ref=\"inputEl\" \n type=\"file\" \n class=\"sr-only\" \n :name=\"name\" \n :accept=\"accept\" \n :multiple=\"multiple\" \n :disabled=\"isDisabled\" \n :required=\"required\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n @change=\"onPickerChange\" \n /> \n </div> \n \n <!-- File list / previews (fuera del dropzone para no romper su forma) --> \n <TransitionGroup \n v-show=\"files.length\" \n appear \n name=\"modo-file\" \n tag=\"ul\" \n :class=\"[ \n 'flex flex-col mt-1', \n previews ? 'md:grid md:grid-cols-2 lg:grid-cols-3 md:gap-2' : '', \n ]\" \n > \n <li \n v-for=\"entry in files\" \n :key=\"entry.id\" \n :class=\"[ \n 'modo-file-item relative flex items-center gap-2 p-2 border border-border bg-background', \n // Vertical spacing via margin-bottom (not parent gap) so \n // it can animate to 0 on leave without causing a sibling \n // snap. Using mb (not mt) means when an item is removed \n // the newly-exposed sibling keeps its position. \n '[&:not(:last-child)]:mb-1.5 md:[&:not(:last-child)]:mb-0', \n itemRadiusClass, \n ]\" \n > \n <div \n v-if=\"previews && entry.previewUrl\" \n :class=\"[ \n 'shrink-0 w-10 h-10 overflow-hidden bg-muted', \n itemThumbRadiusClass, \n ]\" \n > \n <img :src=\"entry.previewUrl\" :alt=\"entry.name\" class=\"w-full h-full object-cover\" /> \n </div> \n <component \n v-else \n :is=\"isImage(entry) ? PhotoIcon : DocumentIcon\" \n aria-hidden=\"true\" \n :class=\"[ \n 'shrink-0 w-8 h-8 text-muted-foreground p-1.5 bg-muted', \n itemThumbRadiusClass, \n ]\" \n /> \n \n <div class=\"flex-1 min-w-0\"> \n <Typography variant=\"caption\" size=\"medium\" weight=\"medium\" :truncate=\"true\" as=\"p\">{{ entry.name }}</Typography> \n <p class=\"text-[11px] text-muted-foreground\"> \n {{ formatBytes(entry.size) }} \n <span v-if=\"entry.error\" class=\"text-destructive\">· {{ entry.error }}</span> \n </p> \n <!-- Progress bar --> \n <div \n v-if=\"typeof entry.progress === 'number' && entry.progress >= 0 && entry.progress < 100\" \n :class=\"['mt-1 h-1 overflow-hidden', progressRadiusClass, 'bg-muted']\" \n > \n <div \n :class=\"['h-full transition-all duration-base ease-standard', progressFillClass]\" \n :style=\"{ width: `${entry.progress}%` }\" \n /> \n </div> \n </div> \n \n <div v-if=\"!isDisabled && !readonly\" @click.stop> \n <Button \n variant=\"text\" \n :color=\"color\" \n size=\"small\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"`Remove ${entry.name}`\" \n @click=\"removeFile(entry.id)\" \n /> \n </div> \n </li> \n </TransitionGroup> \n \n <div v-if=\"errorText || helperText\" class=\"flex items-start gap-2\"> \n <Typography v-if=\"errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography> \n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, onBeforeUnmount, ref, useId, watch } from 'vue'; \nimport type { \n FileInput, \n FileInputFile, \n FileInputRejectCode, \n FileInputRejectContext, \n FileInputRejection, \n} from '../../interfaces/forms/FileInput.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\nimport { interpolate } from '../../config/ModoLocale'; \nimport { ArrowUpTrayIcon, XMarkIcon, PhotoIcon, DocumentIcon } from '@heroicons/vue/24/outline'; \nimport Button from './Button.vue'; \nimport Typography from '../data-display/Typography.vue'; \n \nconst props = withDefaults(defineProps<FileInput>(), { \n modelValue: null, \n multiple: false, \n previews: true, \n dropzone: true, \n dropzoneVariant: 'inline', \n dropzoneHeight: 'medium', \n dashed: false, \n clickToSelect: true, \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n fullWidth: false, \n // `placeholder` is resolved at render time against the locale fallback. \n // Leaving the default undefined so `props.placeholder ?? loc...` works. \n autofocus: false, \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst emit = defineEmits<{ \n 'update:modelValue': [files: File[] | null]; \n change: [files: File[] | null]; \n add: [files: File[]]; \n remove: [file: File]; \n reject: [rejections: FileInputRejection[]]; \n}>(); \n \nconst loc = useModoLocale(); \n \nconst { \n fieldId, hasError, isDisabled, errorId, helperId, describedBy, \n stateColor, radius, \n} = useFieldState(props, { componentName: 'FileInput', idPrefix: 'modo-file' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, hasError, radius, \n forceFocus: () => isDragOver.value, \n halo: () => props.halo, \n}); \n \nconst inputEl = ref<HTMLInputElement | null>(null); \nconst isDragOver = ref(false); \nconst internalFiles = ref<FileInputFile[]>([]); \nconst autoId = useId(); \nlet counter = 0; \nconst makeId = () => `modo-file-${autoId}-${++counter}`; \n \nfunction isImage(entry: FileInputFile) { \n return entry.type.startsWith('image/'); \n} \n \nfunction formatBytes(n: number) { \n if (n < 1024) return `${n} B`; \n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`; \n if (n < 1024 * 1024 * 1024) return `${(n / (1024 * 1024)).toFixed(1)} MB`; \n return `${(n / (1024 * 1024 * 1024)).toFixed(2)} GB`; \n} \n \nfunction openFilePicker() { \n if (isDisabled.value || props.readonly) return; \n inputEl.value?.click(); \n} \n \nfunction validate(file: File): { code: FileInputRejectCode; limit?: number | string } | null { \n if (props.maxSize && file.size > props.maxSize) { \n return { code: 'size', limit: props.maxSize }; \n } \n // Accept check (simple prefix + ext match) \n if (props.accept) { \n const tokens = props.accept.split(',').map((t) => t.trim().toLowerCase()); \n const name = file.name.toLowerCase(); \n const type = file.type.toLowerCase(); \n const ok = tokens.some((t) => { \n if (t.startsWith('.')) return name.endsWith(t); \n if (t.endsWith('/*')) return type.startsWith(t.slice(0, -1)); \n return type === t; \n }); \n if (!ok) return { code: 'type', limit: props.accept }; \n } \n return null; \n} \n \n/** \n * Reject message resolver with three-tier precedence: \n * 1. Per-component prop `rejectMessages` (fn > string with `{limit}`). \n * 2. `ModoProvider`-level `locale.fileInput.reject`. \n * 3. Built-in English defaults in `defaultLocale`. \n */ \nfunction resolveRejectMessage(ctx: FileInputRejectContext): string { \n const override = props.rejectMessages?.[ctx.code]; \n if (typeof override === 'function') return override(ctx); \n if (typeof override === 'string') { \n return applyLimit(override, ctx); \n } \n // Fall back to locale (which itself falls back to defaultLocale EN). \n const reject = loc.value.fileInput.reject; \n let template: string; \n if (ctx.code === 'size') { \n template = typeof ctx.limit === 'number' ? reject.size : reject.sizeNoLimit; \n } else if (ctx.code === 'count') { \n template = typeof ctx.limit === 'number' ? reject.count : reject.countNoLimit; \n } else { \n template = reject.type; \n } \n return applyLimit(template, ctx); \n} \n \nfunction applyLimit(template: string, ctx: FileInputRejectContext): string { \n if (!template.includes('{limit}')) return template; \n const value = \n typeof ctx.limit === 'number' && ctx.code === 'size' \n ? ctx.formatBytes(ctx.limit) \n : String(ctx.limit ?? ''); \n return template.split('{limit}').join(value); \n} \n \nfunction buildRejection( \n file: File, \n code: FileInputRejectCode, \n limit?: number | string, \n): FileInputRejection { \n const ctx: FileInputRejectContext = { file, code, limit, formatBytes }; \n return { file, code, limit, message: resolveRejectMessage(ctx) }; \n} \n \nfunction addFiles(list: FileList | File[]) { \n const incoming = Array.from(list); \n const accepted: FileInputFile[] = []; \n const rejected: FileInputRejection[] = []; \n \n for (const file of incoming) { \n const err = validate(file); \n if (err) { \n rejected.push(buildRejection(file, err.code, err.limit)); \n continue; \n } \n const entry: FileInputFile = { \n id: makeId(), \n file, \n name: file.name, \n size: file.size, \n type: file.type, \n }; \n if (props.previews && file.type.startsWith('image/')) { \n entry.previewUrl = URL.createObjectURL(file); \n } \n accepted.push(entry); \n } \n \n // Respect multiple + maxFiles \n if (!props.multiple) { \n // Replace with first \n revokeAll(); \n internalFiles.value = accepted.slice(0, 1); \n } else { \n const next = [...internalFiles.value, ...accepted]; \n if (props.maxFiles && next.length > props.maxFiles) { \n const overflow = next.slice(props.maxFiles); \n overflow.forEach((e) => { \n if (e.previewUrl) URL.revokeObjectURL(e.previewUrl); \n }); \n internalFiles.value = next.slice(0, props.maxFiles); \n overflow.forEach((e) => \n rejected.push(buildRejection(e.file, 'count', props.maxFiles)), \n ); \n } else { \n internalFiles.value = next; \n } \n } \n \n if (accepted.length) emit('add', accepted.map((e) => e.file)); \n if (rejected.length) emit('reject', rejected); \n emitUpdate(); \n} \n \nfunction removeFile(id: string) { \n const idx = internalFiles.value.findIndex((e) => e.id === id); \n if (idx === -1) return; \n const [removed] = internalFiles.value.splice(idx, 1); \n if (removed.previewUrl) URL.revokeObjectURL(removed.previewUrl); \n emit('remove', removed.file); \n emitUpdate(); \n} \n \nfunction emitUpdate() { \n const out = internalFiles.value.map((e) => e.file); \n emit('update:modelValue', out.length ? out : null); \n emit('change', out.length ? out : null); \n} \n \nfunction revokeAll() { \n internalFiles.value.forEach((e) => { \n if (e.previewUrl) URL.revokeObjectURL(e.previewUrl); \n }); \n internalFiles.value = []; \n} \n \nonBeforeUnmount(() => revokeAll()); \n \n/* ---------- Events ---------- */ \n \nfunction onPickerChange(e: Event) { \n const input = e.target as HTMLInputElement; \n if (input.files && input.files.length) { \n addFiles(input.files); \n } \n // Reset para permitir re-seleccionar el mismo archivo \n input.value = ''; \n} \n \nfunction onDragOver(e: DragEvent) { \n if (!props.dropzone || isDisabled.value || props.readonly) return; \n if (e.dataTransfer) e.dataTransfer.dropEffect = 'copy'; \n isDragOver.value = true; \n} \nfunction onDragLeave() { \n isDragOver.value = false; \n} \nfunction onDrop(e: DragEvent) { \n isDragOver.value = false; \n if (!props.dropzone || isDisabled.value || props.readonly) return; \n if (e.dataTransfer?.files?.length) { \n addFiles(e.dataTransfer.files); \n } \n} \n \nfunction onWrapperClick(e: MouseEvent) { \n if (!isAreaVariant.value) return; \n if (!props.clickToSelect) return; \n if (isDisabled.value || props.readonly) return; \n // Ignora clicks provenientes de elementos interactivos (botones, remove) \n const target = e.target as HTMLElement | null; \n if (target?.closest('button, a, input, [role=\"button\"][data-modo-item]')) return; \n openFilePicker(); \n} \nfunction onWrapperKeydown(e: KeyboardEvent) { \n if (!isAreaVariant.value) return; \n if (!props.clickToSelect) return; \n if (isDisabled.value || props.readonly) return; \n if (e.key === 'Enter' || e.key === ' ') { \n e.preventDefault(); \n openFilePicker(); \n } \n} \n \n/* ---------- Merge external progress / errors ---------- */ \nconst files = computed<FileInputFile[]>(() => \n internalFiles.value.map((e) => ({ \n ...e, \n progress: props.progress?.[e.id] ?? e.progress, \n error: props.errors?.[e.id] ?? e.error, \n })), \n); \n \n/* ---------- v-model sync from outside ---------- */ \nwatch(() => props.modelValue, (v) => { \n if (!v) { \n if (internalFiles.value.length) revokeAll(); \n return; \n } \n // Solo sincroniza si el caller reemplazó la lista entera con otras refs. \n const current = internalFiles.value.map((e) => e.file); \n if (v.length === current.length && v.every((f, i) => f === current[i])) return; \n revokeAll(); \n const wrapped: FileInputFile[] = v.map((file) => { \n const entry: FileInputFile = { \n id: makeId(), \n file, \n name: file.name, \n size: file.size, \n type: file.type, \n }; \n if (props.previews && file.type.startsWith('image/')) { \n entry.previewUrl = URL.createObjectURL(file); \n } \n return entry; \n }); \n internalFiles.value = wrapped; \n}, { immediate: true }); \n \n/* ---------- Display ---------- */ \n \nconst headlineText = computed(() => { \n if (files.value.length === 1) return files.value[0].name; \n return interpolate(loc.value.fileInput.filesSelected, { count: files.value.length }); \n}); \n \nconst helperInlineText = computed(() => { \n const bits: string[] = []; \n if (props.accept) bits.push(props.accept); \n if (props.maxSize) bits.push(interpolate(loc.value.fileInput.hintUpTo, { limit: formatBytes(props.maxSize) })); \n if (props.multiple && props.maxFiles) bits.push(interpolate(loc.value.fileInput.hintMax, { limit: props.maxFiles })); \n return bits.join(' · '); \n}); \n \nconst browseLabel = computed(() => \n props.multiple \n ? (files.value.length ? loc.value.fileInput.addMore : loc.value.fileInput.browse) \n : (files.value.length ? loc.value.fileInput.replace : loc.value.fileInput.browse), \n); \n \n/* ---------- Size maps ---------- */\nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\nconst iconSizeClasses = computed(() => sz.value.icon); \n \n/* ---------- Area variant ---------- */ \nconst isAreaVariant = computed(() => props.dropzoneVariant === 'area'); \n \nconst areaHeightClasses = computed(() => { \n switch (props.dropzoneHeight) { \n case 'small': return 'min-h-[120px] py-4'; \n case 'large': return 'min-h-[240px] py-10'; \n default: return 'min-h-[180px] py-8'; \n } \n}); \n \nconst areaIconSizeClasses = computed(() => { \n switch (props.dropzoneHeight) { \n case 'small': return 'w-8 h-8'; \n case 'large': return 'w-14 h-14'; \n default: return 'w-10 h-10'; \n } \n}); \n \nconst areaPrimaryText = computed(() => { \n if (props.dropzoneLabel) return props.dropzoneLabel; \n if (files.value.length === 0) { \n return props.multiple \n ? loc.value.fileInput.dropzoneLabelMultiple \n : loc.value.fileInput.dropzoneLabel; \n } \n return headlineText.value; \n}); \n \nconst areaSecondaryText = computed<string | undefined>(() => { \n if (props.dropzoneHint) return props.dropzoneHint; \n return helperInlineText.value || undefined; \n}); \n \n/* ---------- Color / dashed accents ---------- */ \nconst ACCENT_TEXT_BY_COLOR: Record<string, string> = { \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}; \nconst ACCENT_TEXT_IDLE_BY_COLOR: Record<string, string> = { \n default: 'text-muted-foreground', \n primary: 'text-primary/70', \n danger: 'text-destructive/70', \n success: 'text-success/70', \n warning: 'text-warning/70', \n}; \n// Dashed variant keeps a transparent surface — colored fills felt heavy \n// against form backgrounds. Color only surfaces via icon/button accents. \nconst DRAG_OVER_RING_BY_COLOR: Record<string, string> = { \n default: 'ring-4 ring-foreground/25 border-foreground', \n primary: 'ring-4 ring-primary/40 border-primary', \n danger: 'ring-4 ring-destructive/40 border-destructive', \n success: 'ring-4 ring-success/40 border-success', \n warning: 'ring-4 ring-warning/40 border-warning', \n}; \nconst PROGRESS_FILL_BY_COLOR: Record<string, string> = { \n default: 'bg-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \n \nconst accentTextClass = computed(() => ACCENT_TEXT_BY_COLOR[stateColor.value] ?? ACCENT_TEXT_BY_COLOR.default); \nconst accentTextIdleClass = computed(() => ACCENT_TEXT_IDLE_BY_COLOR[stateColor.value] ?? ACCENT_TEXT_IDLE_BY_COLOR.default); \n// Idle border is always neutral — the color only surfaces as accent on \n// drag-over, focus, or in the upload Button. Matches Modal/Card surface pattern. \nconst colorBorderClass = computed(() => ''); \nconst dragOverRingClass = computed(() => \n DRAG_OVER_RING_BY_COLOR[stateColor.value] ?? DRAG_OVER_RING_BY_COLOR.default, \n); \nconst progressFillClass = computed(() => \n PROGRESS_FILL_BY_COLOR[stateColor.value] ?? PROGRESS_FILL_BY_COLOR.default, \n); \n \n/** Wrapper classes when `dashed=true` (overrides the field variant entirely). */ \nconst dashedWrapperClasses = computed(() => { \n // Border stays neutral; only error state gets a colored border. \n const borderTint = hasError.value ? 'border-destructive/50' : 'border-border'; \n return [ \n 'border-2 border-dashed', \n borderTint, \n ].join(' '); \n}); \n \n/* ---------- Radius helpers ---------- */ \nconst itemRadiusClass = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-lg'; \n case 'full': return 'rounded-xl'; \n default: return 'rounded-md'; \n } \n}); \nconst itemThumbRadiusClass = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-md'; \n case 'full': return 'rounded-lg'; \n default: return 'rounded-md'; \n } \n}); \nconst progressRadiusClass = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n default: return 'rounded-full'; \n } \n}); \n</script> \n \n<style scoped> \n/* File item enter/leave + move. Mirrors the MultiSelect chip pattern but \n * collapses vertical space (max-height + margin-bottom + padding) so siblings \n * slide cleanly when files are added or removed. \n * \n * NOTE: spacing between items uses margin-bottom (see template), NOT the \n * parent's `gap`. `gap` cannot animate per-item so removing the first \n * file would leave a 6px gap that snaps closed when the node unmounts. \n */ \n.modo-file-enter-active, \n.modo-file-leave-active { \n transition: \n opacity 220ms cubic-bezier(0.2, 0, 0, 1), \n transform 260ms cubic-bezier(0.2, 0, 0, 1), \n max-height 260ms cubic-bezier(0.2, 0, 0, 1), \n margin-bottom 260ms cubic-bezier(0.2, 0, 0, 1), \n padding-top 260ms cubic-bezier(0.2, 0, 0, 1), \n padding-bottom 260ms cubic-bezier(0.2, 0, 0, 1), \n border-width 260ms cubic-bezier(0.2, 0, 0, 1); \n overflow: hidden; \n} \n.modo-file-move { \n transition: transform 260ms cubic-bezier(0.2, 0, 0, 1); \n} \n.modo-file-enter-from, \n.modo-file-leave-to { \n opacity: 0; \n transform: translateY(-4px) scale(0.98); \n max-height: 0; \n margin-bottom: 0 !important; \n padding-top: 0; \n padding-bottom: 0; \n border-width: 0; \n} \n.modo-file-enter-to, \n.modo-file-leave-from { \n /* 5rem comfortably fits the tallest file row (40px thumb + padding). */ \n max-height: 5rem; \n} \n \n@media (prefers-reduced-motion: reduce) { \n .modo-file-enter-active, \n .modo-file-leave-active, \n .modo-file-move { \n transition: none; \n } \n .modo-file-enter-from, \n .modo-file-leave-to { \n opacity: 1; \n transform: none; \n max-height: none; \n margin-bottom: initial !important; \n padding: initial; \n border-width: initial; \n } \n} \n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"FileInput.cjs","names":[],"sources":["../../../src/components/forms/FileInput.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div \n :class=\"[ \n 'modo-field-wrapper transition-colors', \n dashed ? dashedWrapperClasses : wrapperVariantClasses, \n isAreaVariant ? '' : `flex items-center ${wrapperSizeClasses}`, \n radiusClasses, \n colorBorderClass, \n fullWidth ? 'w-full' : '', \n isDisabled ? 'opacity-60 cursor-not-allowed' : '', \n isDragOver ? dragOverRingClass : '', \n isAreaVariant && clickToSelect && !isDisabled && !readonly ? 'cursor-pointer' : '', \n ]\" \n :role=\"isAreaVariant ? 'button' : undefined\" \n :tabindex=\"isAreaVariant && !isDisabled && !readonly ? 0 : undefined\" \n :aria-label=\"isAreaVariant ? (ariaLabel ?? label ?? dropzoneLabel ?? loc.fileInput.uploadFiles) : undefined\" \n @dragover.prevent=\"onDragOver\" \n @dragleave.prevent=\"onDragLeave\" \n @drop.prevent=\"onDrop\" \n @click=\"onWrapperClick\" \n @keydown=\"onWrapperKeydown\" \n > \n <!-- Area variant --> \n <div \n v-if=\"isAreaVariant\" \n :class=\"[ \n 'flex flex-col items-center justify-center text-center gap-2 px-4', \n areaHeightClasses, \n ]\" \n > \n <component \n :is=\"iconLeft ?? ArrowUpTrayIcon\" \n aria-hidden=\"true\" \n :class=\"[ \n 'shrink-0 transition-colors duration-base ease-standard', \n isDragOver ? accentTextClass : accentTextIdleClass, \n areaIconSizeClasses, \n ]\" \n /> \n <Typography variant=\"body\" :size=\"size\" weight=\"medium\"> \n {{ areaPrimaryText }} \n </Typography> \n <Typography v-if=\"areaSecondaryText\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\"> \n {{ areaSecondaryText }} \n </Typography> \n <div @click.stop> \n <Button \n :disabled=\"isDisabled || readonly\" \n :color=\"color\" \n :size=\"size\" \n :radius=\"radius\" \n :icon=\"ArrowUpTrayIcon\" \n variant=\"outline\" \n :label=\"browseLabel\" \n class=\"mt-1\" \n @click=\"openFilePicker\" \n /> \n </div> \n </div> \n \n <!-- Inline variant (default) --> \n <div v-else class=\"flex items-center gap-3 w-full min-w-0\"> \n <component \n :is=\"iconLeft ?? ArrowUpTrayIcon\" \n aria-hidden=\"true\" \n :class=\"['shrink-0', accentTextIdleClass, iconSizeClasses]\" \n /> \n <div class=\"flex-1 min-w-0\"> \n <p :class=\"['truncate', inputTextClasses, files.length === 0 ? 'text-muted-foreground' : 'text-foreground']\"> \n {{ files.length === 0 ? (placeholder ?? loc.fileInput.placeholder) : headlineText }} \n </p> \n <Typography v-if=\"helperInlineText\" variant=\"caption\" size=\"medium\" color=\"muted\" :truncate=\"true\" as=\"p\"> \n {{ helperInlineText }} \n </Typography> \n </div> \n <div class=\"flex shrink-0 items-center\" @click.stop> \n <Button \n :disabled=\"isDisabled || readonly\" \n :color=\"color\" \n :size=\"inlineButtonSize\" \n :class=\"['shrink-0', inlineButtonHeight]\" \n :radius=\"radius\" \n :icon=\"ArrowUpTrayIcon\" \n variant=\"outline\" \n :label=\"browseLabel\" \n @click=\"openFilePicker\" \n /> \n </div> \n </div> \n \n <!-- Hidden native input --> \n <input \n :id=\"fieldId\" \n ref=\"inputEl\" \n type=\"file\" \n class=\"sr-only\" \n :name=\"name\" \n :accept=\"accept\" \n :multiple=\"multiple\" \n :disabled=\"isDisabled\" \n :required=\"required\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n @change=\"onPickerChange\" \n /> \n </div> \n \n <!-- File list / previews (fuera del dropzone para no romper su forma) --> \n <TransitionGroup \n v-show=\"files.length\" \n appear \n name=\"modo-file\" \n tag=\"ul\" \n :class=\"[ \n 'flex flex-col mt-1', \n previews ? 'md:grid md:grid-cols-2 lg:grid-cols-3 md:gap-2' : '', \n ]\" \n > \n <li \n v-for=\"entry in files\" \n :key=\"entry.id\" \n :class=\"[ \n 'modo-file-item relative flex items-center gap-2 p-2 border border-border bg-background', \n // Vertical spacing via margin-bottom (not parent gap) so \n // it can animate to 0 on leave without causing a sibling \n // snap. Using mb (not mt) means when an item is removed \n // the newly-exposed sibling keeps its position. \n '[&:not(:last-child)]:mb-1.5 md:[&:not(:last-child)]:mb-0', \n itemRadiusClass, \n ]\" \n > \n <div \n v-if=\"previews && entry.previewUrl\" \n :class=\"[ \n 'shrink-0 w-10 h-10 overflow-hidden bg-muted', \n itemThumbRadiusClass, \n ]\" \n > \n <img :src=\"entry.previewUrl\" :alt=\"entry.name\" class=\"w-full h-full object-cover\" /> \n </div> \n <component \n v-else \n :is=\"isImage(entry) ? PhotoIcon : DocumentIcon\" \n aria-hidden=\"true\" \n :class=\"[ \n 'shrink-0 w-8 h-8 text-muted-foreground p-1.5 bg-muted', \n itemThumbRadiusClass, \n ]\" \n /> \n \n <div class=\"flex-1 min-w-0\"> \n <Typography variant=\"caption\" size=\"medium\" weight=\"medium\" :truncate=\"true\" as=\"p\">{{ entry.name }}</Typography> \n <p class=\"text-[11px] text-muted-foreground\"> \n {{ formatBytes(entry.size) }} \n <span v-if=\"entry.error\" class=\"text-destructive\">· {{ entry.error }}</span> \n </p> \n <!-- Progress bar --> \n <div \n v-if=\"typeof entry.progress === 'number' && entry.progress >= 0 && entry.progress < 100\" \n :class=\"['mt-1 h-1 overflow-hidden', progressRadiusClass, 'bg-muted']\" \n > \n <div \n :class=\"['h-full transition-all duration-base ease-standard', progressFillClass]\" \n :style=\"{ width: `${entry.progress}%` }\" \n /> \n </div> \n </div> \n \n <div v-if=\"!isDisabled && !readonly\" @click.stop> \n <Button \n variant=\"text\" \n :color=\"color\" \n size=\"small\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"`Remove ${entry.name}`\" \n @click=\"removeFile(entry.id)\" \n /> \n </div> \n </li> \n </TransitionGroup> \n \n <div v-if=\"errorText || helperText\" class=\"flex items-start gap-2\"> \n <Typography v-if=\"errorText\" :id=\"errorId\" variant=\"caption\" size=\"medium\" color=\"danger\" as=\"p\">{{ errorText }}</Typography> \n <Typography v-else-if=\"helperText\" :id=\"helperId\" variant=\"caption\" size=\"medium\" color=\"muted\" as=\"p\">{{ helperText }}</Typography> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, onBeforeUnmount, ref, useId, watch } from 'vue'; \nimport type { \n FileInput, \n FileInputFile, \n FileInputRejectCode, \n FileInputRejectContext, \n FileInputRejection, \n} from '../../interfaces/forms/FileInput.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\nimport { interpolate } from '../../config/ModoLocale'; \nimport { ArrowUpTrayIcon, XMarkIcon, PhotoIcon, DocumentIcon } from '@heroicons/vue/24/outline'; \nimport Button from './Button.vue'; \nimport Typography from '../data-display/Typography.vue'; \n \nconst props = withDefaults(defineProps<FileInput>(), { \n modelValue: null, \n multiple: false, \n previews: true, \n dropzone: true, \n dropzoneVariant: 'inline', \n dropzoneHeight: 'medium', \n dashed: false, \n clickToSelect: true, \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n fullWidth: false, \n // `placeholder` is resolved at render time against the locale fallback. \n // Leaving the default undefined so `props.placeholder ?? loc...` works. \n autofocus: false, \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst emit = defineEmits<{ \n 'update:modelValue': [files: File[] | null]; \n change: [files: File[] | null]; \n add: [files: File[]]; \n remove: [file: File]; \n reject: [rejections: FileInputRejection[]]; \n}>(); \n \nconst loc = useModoLocale(); \n \nconst { \n fieldId, hasError, isDisabled, errorId, helperId, describedBy, \n stateColor, radius, \n} = useFieldState(props, { componentName: 'FileInput', idPrefix: 'modo-file' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, hasError, radius, \n // The drop zone is a big box: `radius=\"full\"` caps at a card-like radius.\n radiusKind: () => (props.dropzoneVariant === 'area' ? 'surface' : 'control'), \n forceFocus: () => isDragOver.value, \n halo: () => props.halo, \n}); \n \nconst inputEl = ref<HTMLInputElement | null>(null); \nconst isDragOver = ref(false); \nconst internalFiles = ref<FileInputFile[]>([]); \nconst autoId = useId(); \nlet counter = 0; \nconst makeId = () => `modo-file-${autoId}-${++counter}`; \n \nfunction isImage(entry: FileInputFile) { \n return entry.type.startsWith('image/'); \n} \n \nfunction formatBytes(n: number) { \n if (n < 1024) return `${n} B`; \n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`; \n if (n < 1024 * 1024 * 1024) return `${(n / (1024 * 1024)).toFixed(1)} MB`; \n return `${(n / (1024 * 1024 * 1024)).toFixed(2)} GB`; \n} \n \nfunction openFilePicker() { \n if (isDisabled.value || props.readonly) return; \n inputEl.value?.click(); \n} \n \nfunction validate(file: File): { code: FileInputRejectCode; limit?: number | string } | null { \n if (props.maxSize && file.size > props.maxSize) { \n return { code: 'size', limit: props.maxSize }; \n } \n // Accept check (simple prefix + ext match) \n if (props.accept) { \n const tokens = props.accept.split(',').map((t) => t.trim().toLowerCase()); \n const name = file.name.toLowerCase(); \n const type = file.type.toLowerCase(); \n const ok = tokens.some((t) => { \n if (t.startsWith('.')) return name.endsWith(t); \n if (t.endsWith('/*')) return type.startsWith(t.slice(0, -1)); \n return type === t; \n }); \n if (!ok) return { code: 'type', limit: props.accept }; \n } \n return null; \n} \n \n/** \n * Reject message resolver with three-tier precedence: \n * 1. Per-component prop `rejectMessages` (fn > string with `{limit}`). \n * 2. `ModoProvider`-level `locale.fileInput.reject`. \n * 3. Built-in English defaults in `defaultLocale`. \n */ \nfunction resolveRejectMessage(ctx: FileInputRejectContext): string { \n const override = props.rejectMessages?.[ctx.code]; \n if (typeof override === 'function') return override(ctx); \n if (typeof override === 'string') { \n return applyLimit(override, ctx); \n } \n // Fall back to locale (which itself falls back to defaultLocale EN). \n const reject = loc.value.fileInput.reject; \n let template: string; \n if (ctx.code === 'size') { \n template = typeof ctx.limit === 'number' ? reject.size : reject.sizeNoLimit; \n } else if (ctx.code === 'count') { \n template = typeof ctx.limit === 'number' ? reject.count : reject.countNoLimit; \n } else { \n template = reject.type; \n } \n return applyLimit(template, ctx); \n} \n \nfunction applyLimit(template: string, ctx: FileInputRejectContext): string { \n if (!template.includes('{limit}')) return template; \n const value = \n typeof ctx.limit === 'number' && ctx.code === 'size' \n ? ctx.formatBytes(ctx.limit) \n : String(ctx.limit ?? ''); \n return template.split('{limit}').join(value); \n} \n \nfunction buildRejection( \n file: File, \n code: FileInputRejectCode, \n limit?: number | string, \n): FileInputRejection { \n const ctx: FileInputRejectContext = { file, code, limit, formatBytes }; \n return { file, code, limit, message: resolveRejectMessage(ctx) }; \n} \n \nfunction addFiles(list: FileList | File[]) { \n const incoming = Array.from(list); \n const accepted: FileInputFile[] = []; \n const rejected: FileInputRejection[] = []; \n \n for (const file of incoming) { \n const err = validate(file); \n if (err) { \n rejected.push(buildRejection(file, err.code, err.limit)); \n continue; \n } \n const entry: FileInputFile = { \n id: makeId(), \n file, \n name: file.name, \n size: file.size, \n type: file.type, \n }; \n if (props.previews && file.type.startsWith('image/')) { \n entry.previewUrl = URL.createObjectURL(file); \n } \n accepted.push(entry); \n } \n \n // Respect multiple + maxFiles \n if (!props.multiple) { \n // Replace with first \n revokeAll(); \n internalFiles.value = accepted.slice(0, 1); \n } else { \n const next = [...internalFiles.value, ...accepted]; \n if (props.maxFiles && next.length > props.maxFiles) { \n const overflow = next.slice(props.maxFiles); \n overflow.forEach((e) => { \n if (e.previewUrl) URL.revokeObjectURL(e.previewUrl); \n }); \n internalFiles.value = next.slice(0, props.maxFiles); \n overflow.forEach((e) => \n rejected.push(buildRejection(e.file, 'count', props.maxFiles)), \n ); \n } else { \n internalFiles.value = next; \n } \n } \n \n if (accepted.length) emit('add', accepted.map((e) => e.file)); \n if (rejected.length) emit('reject', rejected); \n emitUpdate(); \n} \n \nfunction removeFile(id: string) { \n const idx = internalFiles.value.findIndex((e) => e.id === id); \n if (idx === -1) return; \n const [removed] = internalFiles.value.splice(idx, 1); \n if (removed.previewUrl) URL.revokeObjectURL(removed.previewUrl); \n emit('remove', removed.file); \n emitUpdate(); \n} \n \nfunction emitUpdate() { \n const out = internalFiles.value.map((e) => e.file); \n emit('update:modelValue', out.length ? out : null); \n emit('change', out.length ? out : null); \n} \n \nfunction revokeAll() { \n internalFiles.value.forEach((e) => { \n if (e.previewUrl) URL.revokeObjectURL(e.previewUrl); \n }); \n internalFiles.value = []; \n} \n \nonBeforeUnmount(() => revokeAll()); \n \n/* ---------- Events ---------- */ \n \nfunction onPickerChange(e: Event) { \n const input = e.target as HTMLInputElement; \n if (input.files && input.files.length) { \n addFiles(input.files); \n } \n // Reset para permitir re-seleccionar el mismo archivo \n input.value = ''; \n} \n \nfunction onDragOver(e: DragEvent) { \n if (!props.dropzone || isDisabled.value || props.readonly) return; \n if (e.dataTransfer) e.dataTransfer.dropEffect = 'copy'; \n isDragOver.value = true; \n} \nfunction onDragLeave() { \n isDragOver.value = false; \n} \nfunction onDrop(e: DragEvent) { \n isDragOver.value = false; \n if (!props.dropzone || isDisabled.value || props.readonly) return; \n if (e.dataTransfer?.files?.length) { \n addFiles(e.dataTransfer.files); \n } \n} \n \nfunction onWrapperClick(e: MouseEvent) { \n if (!isAreaVariant.value) return; \n if (!props.clickToSelect) return; \n if (isDisabled.value || props.readonly) return; \n // Ignora clicks provenientes de elementos interactivos (botones, remove) \n const target = e.target as HTMLElement | null; \n if (target?.closest('button, a, input, [role=\"button\"][data-modo-item]')) return; \n openFilePicker(); \n} \nfunction onWrapperKeydown(e: KeyboardEvent) { \n if (!isAreaVariant.value) return; \n if (!props.clickToSelect) return; \n if (isDisabled.value || props.readonly) return; \n if (e.key === 'Enter' || e.key === ' ') { \n e.preventDefault(); \n openFilePicker(); \n } \n} \n \n/* ---------- Merge external progress / errors ---------- */ \nconst files = computed<FileInputFile[]>(() => \n internalFiles.value.map((e) => ({ \n ...e, \n progress: props.progress?.[e.id] ?? e.progress, \n error: props.errors?.[e.id] ?? e.error, \n })), \n); \n \n/* ---------- v-model sync from outside ---------- */ \nwatch(() => props.modelValue, (v) => { \n if (!v) { \n if (internalFiles.value.length) revokeAll(); \n return; \n } \n // Solo sincroniza si el caller reemplazó la lista entera con otras refs. \n const current = internalFiles.value.map((e) => e.file); \n if (v.length === current.length && v.every((f, i) => f === current[i])) return; \n revokeAll(); \n const wrapped: FileInputFile[] = v.map((file) => { \n const entry: FileInputFile = { \n id: makeId(), \n file, \n name: file.name, \n size: file.size, \n type: file.type, \n }; \n if (props.previews && file.type.startsWith('image/')) { \n entry.previewUrl = URL.createObjectURL(file); \n } \n return entry; \n }); \n internalFiles.value = wrapped; \n}, { immediate: true }); \n \n/* ---------- Display ---------- */ \n \nconst headlineText = computed(() => { \n if (files.value.length === 1) return files.value[0].name; \n return interpolate(loc.value.fileInput.filesSelected, { count: files.value.length }); \n}); \n \nconst helperInlineText = computed(() => { \n const bits: string[] = []; \n if (props.accept) bits.push(props.accept); \n if (props.maxSize) bits.push(interpolate(loc.value.fileInput.hintUpTo, { limit: formatBytes(props.maxSize) })); \n if (props.multiple && props.maxFiles) bits.push(interpolate(loc.value.fileInput.hintMax, { limit: props.maxFiles })); \n return bits.join(' · '); \n}); \n \nconst browseLabel = computed(() => \n props.multiple \n ? (files.value.length ? loc.value.fileInput.addMore : loc.value.fileInput.browse) \n : (files.value.length ? loc.value.fileInput.replace : loc.value.fileInput.browse), \n); \n \n/* ---------- Size maps ---------- */\nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\nconst iconSizeClasses = computed(() => sz.value.icon);\nconst inputTextClasses = computed(() => sz.value.text);\n// The inline Browse button is a trailing control: it sits inside the field with\n// 4px of air above and below (control height - 8px), so it never touches the\n// border at any radius. Same idea as the clear / eye buttons of other fields.\nconst INLINE_BUTTON_SIZE: Record<string, 'xsmall' | 'small' | 'medium'> = { xsmall: 'xsmall', small: 'xsmall', medium: 'small', large: 'medium' };\nconst inlineButtonSize = computed(() => INLINE_BUTTON_SIZE[resolvedSize.value] ?? 'small');\nconst INLINE_BUTTON_HEIGHT: Record<string, string> = { xsmall: '!h-6', small: '!h-7', medium: '!h-8', large: '!h-10' };\nconst inlineButtonHeight = computed(() => INLINE_BUTTON_HEIGHT[resolvedSize.value] ?? '!h-8'); \n \n/* ---------- Area variant ---------- */ \nconst isAreaVariant = computed(() => props.dropzoneVariant === 'area'); \n \nconst areaHeightClasses = computed(() => { \n switch (props.dropzoneHeight) { \n case 'small': return 'min-h-[120px] py-4'; \n case 'large': return 'min-h-[240px] py-10'; \n default: return 'min-h-[180px] py-8'; \n } \n}); \n \nconst areaIconSizeClasses = computed(() => { \n switch (props.dropzoneHeight) { \n case 'small': return 'w-8 h-8'; \n case 'large': return 'w-14 h-14'; \n default: return 'w-10 h-10'; \n } \n}); \n \nconst areaPrimaryText = computed(() => { \n if (props.dropzoneLabel) return props.dropzoneLabel; \n if (files.value.length === 0) { \n return props.multiple \n ? loc.value.fileInput.dropzoneLabelMultiple \n : loc.value.fileInput.dropzoneLabel; \n } \n return headlineText.value; \n}); \n \nconst areaSecondaryText = computed<string | undefined>(() => { \n if (props.dropzoneHint) return props.dropzoneHint; \n return helperInlineText.value || undefined; \n}); \n \n/* ---------- Color / dashed accents ---------- */ \nconst ACCENT_TEXT_BY_COLOR: Record<string, string> = { \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}; \nconst ACCENT_TEXT_IDLE_BY_COLOR: Record<string, string> = { \n default: 'text-muted-foreground', \n primary: 'text-primary/70', \n danger: 'text-destructive/70', \n success: 'text-success/70', \n warning: 'text-warning/70', \n}; \n// Dashed variant keeps a transparent surface — colored fills felt heavy \n// against form backgrounds. Color only surfaces via icon/button accents. \nconst DRAG_OVER_RING_BY_COLOR: Record<string, string> = { \n default: 'ring-4 ring-foreground/25 border-foreground', \n primary: 'ring-4 ring-primary/40 border-primary', \n danger: 'ring-4 ring-destructive/40 border-destructive', \n success: 'ring-4 ring-success/40 border-success', \n warning: 'ring-4 ring-warning/40 border-warning', \n}; \nconst PROGRESS_FILL_BY_COLOR: Record<string, string> = { \n default: 'bg-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \n \nconst accentTextClass = computed(() => ACCENT_TEXT_BY_COLOR[stateColor.value] ?? ACCENT_TEXT_BY_COLOR.default); \nconst accentTextIdleClass = computed(() => ACCENT_TEXT_IDLE_BY_COLOR[stateColor.value] ?? ACCENT_TEXT_IDLE_BY_COLOR.default); \n// Idle border is always neutral — the color only surfaces as accent on \n// drag-over, focus, or in the upload Button. Matches Modal/Card surface pattern. \nconst colorBorderClass = computed(() => ''); \nconst dragOverRingClass = computed(() => \n DRAG_OVER_RING_BY_COLOR[stateColor.value] ?? DRAG_OVER_RING_BY_COLOR.default, \n); \nconst progressFillClass = computed(() => \n PROGRESS_FILL_BY_COLOR[stateColor.value] ?? PROGRESS_FILL_BY_COLOR.default, \n); \n \n/** Wrapper classes when `dashed=true` (overrides the field variant entirely). */ \nconst dashedWrapperClasses = computed(() => { \n // Border stays neutral; only error state gets a colored border. \n const borderTint = hasError.value ? 'border-destructive/50' : 'border-input not-[.cursor-not-allowed]:not-focus-within:hover:border-input-hover'; \n return [ \n 'border-2 border-dashed', \n borderTint, \n ].join(' '); \n}); \n \n/* ---------- Radius helpers ---------- */ \nconst itemRadiusClass = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-lg'; \n // File chips are inner controls: they take the full pill.\n case 'full': return 'rounded-full pl-3'; \n default: return 'rounded-md'; \n } \n}); \nconst itemThumbRadiusClass = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-md'; \n case 'full': return 'rounded-full'; \n default: return 'rounded-md'; \n } \n}); \nconst progressRadiusClass = computed(() => { \n switch (radius.value) { \n case 'none': return 'rounded-none'; \n default: return 'rounded-full'; \n } \n}); \n</script> \n \n<style scoped> \n/* File item enter/leave + move. Mirrors the MultiSelect chip pattern but \n * collapses vertical space (max-height + margin-bottom + padding) so siblings \n * slide cleanly when files are added or removed. \n * \n * NOTE: spacing between items uses margin-bottom (see template), NOT the \n * parent's `gap`. `gap` cannot animate per-item so removing the first \n * file would leave a 6px gap that snaps closed when the node unmounts. \n */ \n.modo-file-enter-active, \n.modo-file-leave-active { \n transition: \n opacity 220ms cubic-bezier(0.2, 0, 0, 1), \n transform 260ms cubic-bezier(0.2, 0, 0, 1), \n max-height 260ms cubic-bezier(0.2, 0, 0, 1), \n margin-bottom 260ms cubic-bezier(0.2, 0, 0, 1), \n padding-top 260ms cubic-bezier(0.2, 0, 0, 1), \n padding-bottom 260ms cubic-bezier(0.2, 0, 0, 1), \n border-width 260ms cubic-bezier(0.2, 0, 0, 1); \n overflow: hidden; \n} \n.modo-file-move { \n transition: transform 260ms cubic-bezier(0.2, 0, 0, 1); \n} \n.modo-file-enter-from, \n.modo-file-leave-to { \n opacity: 0; \n transform: translateY(-4px) scale(0.98); \n max-height: 0; \n margin-bottom: 0 !important; \n padding-top: 0; \n padding-bottom: 0; \n border-width: 0; \n} \n.modo-file-enter-to, \n.modo-file-leave-from { \n /* 5rem comfortably fits the tallest file row (40px thumb + padding). */ \n max-height: 5rem; \n} \n \n@media (prefers-reduced-motion: reduce) { \n .modo-file-enter-active, \n .modo-file-leave-active, \n .modo-file-move { \n transition: none; \n } \n .modo-file-enter-from, \n .modo-file-leave-to { \n opacity: 1; \n transform: none; \n max-height: none; \n margin-bottom: initial !important; \n padding: initial; \n border-width: initial; \n } \n} \n</style>\n"],"mappings":""}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
2
2
  import FileInput_vue_vue_type_script_setup_true_lang_default from "./FileInput.vue_vue_type_script_setup_true_lang.mjs";
3
3
  /* empty css */
4
4
  //#region src/components/forms/FileInput.vue
5
- var FileInput_default = /* @__PURE__ */ _plugin_vue_export_helper_default(FileInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e1dd6bae"]]);
5
+ var FileInput_default = /* @__PURE__ */ _plugin_vue_export_helper_default(FileInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7949fda3"]]);
6
6
  //#endregion
7
7
  export { FileInput_default as default };
8
8