mood-ui 0.13.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/components/feedback/Drawer.cjs.map +1 -1
  2. package/dist/components/feedback/Drawer.mjs.map +1 -1
  3. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +11 -7
  4. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  5. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +12 -8
  6. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  7. package/dist/components/feedback/Modal.cjs.map +1 -1
  8. package/dist/components/feedback/Modal.mjs.map +1 -1
  9. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +10 -3
  10. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  11. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +11 -4
  12. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  13. package/dist/components/feedback/Toast.cjs +1 -1
  14. package/dist/components/feedback/Toast.cjs.map +1 -1
  15. package/dist/components/feedback/Toast.mjs +1 -1
  16. package/dist/components/feedback/Toast.mjs.map +1 -1
  17. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.cjs +4 -2
  18. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  19. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.mjs +5 -3
  20. package/dist/components/feedback/Toast.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  21. package/dist/components/feedback/ToastContainer.cjs +1 -1
  22. package/dist/components/feedback/ToastContainer.cjs.map +1 -1
  23. package/dist/components/feedback/ToastContainer.mjs +1 -1
  24. package/dist/components/feedback/ToastContainer.mjs.map +1 -1
  25. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.cjs +4 -2
  26. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  27. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.mjs +6 -4
  28. package/dist/components/feedback/ToastContainer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  29. package/dist/components/feedback/dialog/DialogTrigger.cjs.map +1 -1
  30. package/dist/components/feedback/dialog/DialogTrigger.mjs.map +1 -1
  31. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.cjs +10 -2
  32. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  33. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.mjs +10 -2
  34. package/dist/components/feedback/dialog/DialogTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  35. package/dist/components/feedback/sheet/SheetTrigger.cjs.map +1 -1
  36. package/dist/components/feedback/sheet/SheetTrigger.mjs.map +1 -1
  37. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.cjs +10 -2
  38. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  39. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.mjs +10 -2
  40. package/dist/components/feedback/sheet/SheetTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  41. package/dist/components/forms/morph-select/MorphSelect.cjs.map +1 -1
  42. package/dist/components/forms/morph-select/MorphSelect.mjs.map +1 -1
  43. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.cjs +53 -6
  44. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  45. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.mjs +54 -7
  46. package/dist/components/forms/morph-select/MorphSelect.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  47. package/dist/components/forms/morph-select/MorphSelectContent.cjs.map +1 -1
  48. package/dist/components/forms/morph-select/MorphSelectContent.mjs.map +1 -1
  49. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.cjs +33 -8
  50. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  51. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.mjs +34 -9
  52. package/dist/components/forms/morph-select/MorphSelectContent.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  53. package/dist/components/forms/morph-select/MorphSelectContext.cjs.map +1 -1
  54. package/dist/components/forms/morph-select/MorphSelectContext.mjs.map +1 -1
  55. package/dist/components/forms/morph-select/MorphSelectTrigger.cjs.map +1 -1
  56. package/dist/components/forms/morph-select/MorphSelectTrigger.mjs.map +1 -1
  57. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs +33 -16
  58. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  59. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs +34 -17
  60. package/dist/components/forms/morph-select/MorphSelectTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  61. package/dist/components/layout/popover/PopoverTrigger.cjs.map +1 -1
  62. package/dist/components/layout/popover/PopoverTrigger.mjs.map +1 -1
  63. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs +10 -2
  64. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  65. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs +10 -2
  66. package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  67. package/dist/components/navigation/menu/MenuTrigger.cjs.map +1 -1
  68. package/dist/components/navigation/menu/MenuTrigger.mjs.map +1 -1
  69. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs +7 -0
  70. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  71. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs +7 -0
  72. package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  73. package/dist/config/ModoLocale.cjs +4 -0
  74. package/dist/config/ModoLocale.cjs.map +1 -1
  75. package/dist/config/ModoLocale.mjs +4 -0
  76. package/dist/config/ModoLocale.mjs.map +1 -1
  77. package/dist/config/locales/es.cjs +4 -0
  78. package/dist/config/locales/es.cjs.map +1 -1
  79. package/dist/config/locales/es.mjs +4 -0
  80. package/dist/config/locales/es.mjs.map +1 -1
  81. package/dist/mood-ui.css +39 -41
  82. package/dist/types/components/forms/morph-select/MorphSelect.vue.d.ts +8 -7
  83. package/dist/types/components/forms/morph-select/MorphSelectContext.d.ts +6 -1
  84. package/dist/types/components/forms/morph-select/MorphSelectTrigger.vue.d.ts +6 -3
  85. package/dist/types/components/forms/morph-select/index.d.ts +24 -18
  86. package/dist/types/config/ModoLocale.d.ts +6 -0
  87. package/dist/types/interfaces/feedback/Drawer.interface.d.ts +2 -0
  88. package/dist/types/interfaces/feedback/Modal.interface.d.ts +2 -0
  89. package/dist/types/interfaces/forms/ModeOrb.interface.d.ts +3 -3
  90. package/dist/types/interfaces/forms/MorphSelect.interface.d.ts +13 -5
  91. package/dist/types/utils/morph/morphHelpers.d.ts +6 -0
  92. package/dist/utils/morph/morphHelpers.cjs +16 -0
  93. package/dist/utils/morph/morphHelpers.cjs.map +1 -1
  94. package/dist/utils/morph/morphHelpers.mjs +16 -1
  95. package/dist/utils/morph/morphHelpers.mjs.map +1 -1
  96. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectContent.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'\nimport type { MorphSelectContentProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { useTeleportedModoTheme } from '../../../composables/useTeleportedModoTheme'\nimport { useModoLocale } from '../../../composables/useModoConfig'\nimport { MENU_PRESET, runMorph } from '../../../utils/morph/morphEngine'\nimport { attachCloseScrub, isTopMorphLayer, resolvePlacement } from '../../../utils/morph/morphHelpers'\nimport { CheckIcon } from '@heroicons/vue/24/outline'\nimport RenderContent from '../../../utils/RenderContent'\nimport { useMorphSelect } from './MorphSelectContext'\nimport { useMorphSelectKeyboard } from './useMorphSelectKeyboard'\nconst props = withDefaults(defineProps<MorphSelectContentProps>(), { side: 'auto', align: 'auto' })\nconst { fieldId, options, value, phase, trigger, button, select, setOpen, restoreFocus, stateColor, radius, size } = useMorphSelect()\nconst loc = useModoLocale()\nconst searchLabel = computed(() => props.searchPlaceholder ?? loc.value.morphSelect.searchPlaceholder)\nconst emptyLabel = computed(() => props.emptyMessage ?? loc.value.morphSelect.empty)\n// Same option surfaces and check colors as the native Select, per state color.\nconst OPTION_HOVER: Record<string, string> = {\n default: 'hover:bg-muted focus-visible:bg-muted',\n primary: 'hover:bg-primary/10 focus-visible:bg-primary/10',\n danger: 'hover:bg-destructive/10 focus-visible:bg-destructive/10',\n success: 'hover:bg-success/10 focus-visible:bg-success/10',\n warning: 'hover:bg-warning/10 focus-visible:bg-warning/10',\n}\nconst CHECK_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 optionClass = computed(() => OPTION_HOVER[stateColor.value] ?? OPTION_HOVER.default)\nconst checkClass = computed(() => CHECK_COLOR[stateColor.value] ?? CHECK_COLOR.default)\nconst panel = ref<HTMLElement | null>(null), ghost = ref<HTMLElement | null>(null)\nconst filter = ref('')\nconst shown = computed(() => options.value.filter(option => (option.textValue ?? String(option.label)).toLocaleLowerCase().includes(filter.value.toLocaleLowerCase())))\nconst { scopedTheme, providerStyle } = useTeleportedModoTheme({ radius, size })\nconst key = useMorphSelectKeyboard(panel, () => setOpen(false))\nfunction position() {\n const p = panel.value, t = trigger.value\n if (!p || !t) return\n const rect = t.getBoundingClientRect()\n p.style.width = `${rect.width}px`\n if (button.value) { const cs = getComputedStyle(button.value); p.style.setProperty('--modo-morph-select-ghost-px', cs.paddingLeft); p.style.setProperty('--modo-morph-select-ghost-fs', cs.fontSize) }\n const pos = resolvePlacement(rect, { width: p.offsetWidth, height: p.offsetHeight }, { width: innerWidth, height: innerHeight }, props.side, props.align)\n p.style.left = `${pos.left}px`; p.style.top = `${pos.top}px`\n p.style.transformOrigin = `${pos.align === 'end' ? '100%' : pos.align === 'center' ? '50%' : '0%'} ${pos.side === 'top' ? '100%' : '0%'}`\n}\nwatch(phase, async (current, previous, cleanup) => {\n let cancelled = false\n cleanup(() => { cancelled = true; panel.value?.getAnimations?.().forEach(animation => animation.cancel()) })\n if (current === 'closed') {\n filter.value = ''\n if (previous !== 'closed' && restoreFocus.value) button.value?.focus()\n return\n }\n await nextTick(); if (cancelled) return\n position()\n const p = panel.value\n if (!p) return\n if (current === 'opening' || current === 'closing') {\n runMorph({ panel: p, trigger: trigger.value, ghost: ghost.value, preset: MENU_PRESET, direction: current === 'opening' ? 'open' : 'close', onFinish: () => { if (!cancelled) phase.value = current === 'opening' ? 'open' : 'closed' } })\n } else if (current === 'open') {\n (props.searchable ? p.querySelector<HTMLElement>('input') : p.querySelector<HTMLElement>('[role=\"option\"][aria-selected=\"true\"]:not([disabled])') ?? p.querySelector<HTMLElement>('[role=\"option\"]:not([disabled])') ?? p)?.focus()\n }\n}, { immediate: true })\nwatch([() => phase.value === 'open', panel], ([active, el], _, cleanup) => {\n if (!active || !el || !trigger.value) return\n const stop = attachCloseScrub(el, trigger.value, MENU_PRESET, () => setOpen(false))\n cleanup(stop)\n}, { flush: 'post' })\nwatch(() => phase.value === 'opening' || phase.value === 'open', (active, _, cleanup) => {\n if (!active) return\n function outside(event: PointerEvent) { const p = panel.value, target = event.target as Node; if (p && isTopMorphLayer(p) && !p.contains(target) && !trigger.value?.contains(target)) setOpen(false, false) }\n function scroll(event: Event) { if (!panel.value?.contains(event.target as Node)) setOpen(false, false) }\n function resize() { setOpen(false) }\n document.addEventListener('pointerdown', outside); document.addEventListener('scroll', scroll, true); window.addEventListener('resize', resize)\n cleanup(() => { document.removeEventListener('pointerdown', outside); document.removeEventListener('scroll', scroll, true); window.removeEventListener('resize', resize) })\n})\nwatch([filter, () => props.side, () => props.align, () => options.value.length], () => nextTick(position))\nonBeforeUnmount(() => panel.value?.getAnimations?.().forEach(animation => animation.cancel()))\n</script>\n<template>\n <Teleport to=\"body\">\n <div v-if=\"phase !== 'closed'\" ref=\"panel\" tabindex=\"-1\" class=\"modo-morph-select-panel text-foreground\" data-modo-morph-select-panel=\"\" data-modo-morph-layer=\"\"\n :data-modo-phase=\"phase\" :data-modo-theme=\"scopedTheme\" :data-modo-radius=\"radius\" :data-modo-color=\"stateColor\" :inert=\"phase === 'closing'\" :style=\"[providerStyle, { position: 'fixed' }]\" @keydown=\"key\">\n <div v-if=\"searchable\" class=\"modo-morph-select__search\">\n <input v-model=\"filter\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" :placeholder=\"searchLabel\" :aria-label=\"searchLabel\" :aria-controls=\"`${fieldId}-listbox`\"\n class=\"modo-morph-select__search-input w-full border border-input bg-transparent text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/60\" />\n </div>\n <div :id=\"`${fieldId}-listbox`\" role=\"listbox\" :aria-labelledby=\"fieldId\" class=\"modo-morph-select__list\">\n <button v-for=\"option in shown\" :key=\"option.value\" type=\"button\" role=\"option\" tabindex=\"-1\"\n :class=\"['modo-morph-select__option outline-none', option.value === value ? 'font-medium' : '', option.disabled ? 'text-muted-foreground/60' : optionClass]\"\n :aria-selected=\"option.value === value\" :disabled=\"option.disabled\" :data-text-value=\"option.textValue ?? String(option.label)\" @click=\"select(option.value)\">\n <span class=\"modo-morph-select__option-text\"><slot name=\"option\" :option=\"option\" :selected=\"option.value === value\"><span class=\"truncate\"><RenderContent :content=\"option.label\" /></span><span v-if=\"option.description\" class=\"modo-morph-select__option-desc\"><RenderContent :content=\"option.description\" /></span></slot></span>\n <CheckIcon v-if=\"option.value === value\" :class=\"['modo-morph-select__check shrink-0', checkClass]\" aria-hidden=\"true\" />\n </button>\n </div>\n <p v-if=\"!shown.length\" role=\"status\" class=\"modo-morph-select__empty text-caption text-muted-foreground text-center\">{{ emptyLabel }}</p>\n <div v-if=\"phase === 'closing'\" class=\"modo-morph-select-ghost\" aria-hidden=\"true\"><span ref=\"ghost\" class=\"modo-morph-select-ghost__inner\"><RenderContent :content=\"options.find(option => option.value === value)?.label\" /></span></div>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EACd,MAAM,EAAE,SAAS,SAAS,OAAO,OAAO,SAAS,QAAQ,QAAQ,SAAS,cAAc,YAAY,QAAQ,SAAS,2BAAA,gBAAe;EACpI,MAAM,MAAM,sBAAA,eAAc;EAC1B,MAAM,eAAA,GAAA,IAAA,gBAA6B,MAAM,qBAAqB,IAAI,MAAM,YAAY,kBAAiB;EACrG,MAAM,cAAA,GAAA,IAAA,gBAA4B,MAAM,gBAAgB,IAAI,MAAM,YAAY,MAAK;EAEnF,MAAM,eAAuC;GAC3C,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACX;EACA,MAAM,cAAsC;GAC1C,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACX;EACA,MAAM,eAAA,GAAA,IAAA,gBAA6B,aAAa,WAAW,UAAU,a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EAAA,EAAzB,SAAS,OAAO,OAAA,EAAA,MAAA,GAAA,CAAA,UAAA,CAAA,CAAA,CAAA,EAA4B,OAAO,gBAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAA0G,QAA7H,YAA6H,EAAA,GAAA,IAAA,cAAA,GAAA,IAAA,OAAP,sBAAA,QAAA,EAAA,EAA/B,SAAS,OAAO,aAAA,EAAA,MAAA,GAAA,CAAA,UAAA,CAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,CAAA,CAAA,EAClR,OAAO,WAAA,GAAA,IAAA,OAAU,MAAK,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,OAAkF,0BAAA,UAAA,EAAA;;MAA/E,QAAA,GAAA,IAAA,gBAAK,CAAA,qCAAwC,WAAA,MAAU,CAAA;MAAG,eAAY;;;KAG1G,MAAA,MAAM,WAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAA0H,KAA1I,aAAA,GAAA,IAAA,iBAAyH,WAAA,MAAU,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;mBACxH,MAAK,KAAA,cAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAA2N,OAA3O,aAA2O,EAAA,GAAA,IAAA,oBAAN,QAAA;cAAxI;KAAJ,KAAI;KAAQ,OAAM;4CAAmH,sBAAA,QAAA,EAAA,EAAlE,UAAA,GAAA,IAAA,OAAS,QAAO,CAAC,MAAK,WAAU,OAAO,WAAA,GAAA,IAAA,OAAU,MAAK,CAAA,EAAG,OAAA,EAAA,MAAA,GAAA,CAAA,UAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"MorphSelectContent.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'\nimport type { MorphSelectContentProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { useTeleportedModoTheme } from '../../../composables/useTeleportedModoTheme'\nimport { useModoLocale } from '../../../composables/useModoConfig'\nimport { MENU_PRESET, runMorph } from '../../../utils/morph/morphEngine'\nimport { attachCloseScrub, isTopMorphLayer, resolvePlacement } from '../../../utils/morph/morphHelpers'\nimport { CheckIcon } from '@heroicons/vue/24/outline'\nimport RenderContent from '../../../utils/RenderContent'\nimport { useMorphSelect } from './MorphSelectContext'\nimport { useMorphSelectKeyboard } from './useMorphSelectKeyboard'\nconst props = withDefaults(defineProps<MorphSelectContentProps>(), { side: 'auto', align: 'auto' })\nconst { fieldId, options, multiple, selectedOptions, isSelected, phase, trigger, button, select, setOpen, restoreFocus, stateColor, radius, size } = useMorphSelect()\nconst loc = useModoLocale()\nconst searchLabel = computed(() => props.searchPlaceholder ?? loc.value.morphSelect.searchPlaceholder)\nconst emptyLabel = computed(() => props.emptyMessage ?? loc.value.morphSelect.empty)\n// Same option surfaces and check colors as the native Select, per state color.\nconst OPTION_HOVER: Record<string, string> = {\n default: 'hover:bg-muted focus-visible:bg-muted',\n primary: 'hover:bg-primary/10 focus-visible:bg-primary/10',\n danger: 'hover:bg-destructive/10 focus-visible:bg-destructive/10',\n success: 'hover:bg-success/10 focus-visible:bg-success/10',\n warning: 'hover:bg-warning/10 focus-visible:bg-warning/10',\n}\nconst CHECK_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 optionClass = computed(() => OPTION_HOVER[stateColor.value] ?? OPTION_HOVER.default)\nconst checkClass = computed(() => CHECK_COLOR[stateColor.value] ?? CHECK_COLOR.default)\nconst panel = ref<HTMLElement | null>(null), ghost = ref<HTMLElement | null>(null)\nconst selectedSummary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst filter = ref('')\nconst shown = computed(() => options.value.filter(option => (option.textValue ?? String(option.label)).toLocaleLowerCase().includes(filter.value.toLocaleLowerCase())))\nconst { scopedTheme, providerStyle } = useTeleportedModoTheme({ radius, size })\nconst key = useMorphSelectKeyboard(panel, () => setOpen(false))\nfunction position() {\n const p = panel.value, t = trigger.value\n if (!p || !t) return\n const rect = t.getBoundingClientRect()\n p.style.width = `${rect.width}px`\n if (button.value) { const cs = getComputedStyle(button.value); p.style.setProperty('--modo-morph-select-ghost-px', cs.paddingLeft); p.style.setProperty('--modo-morph-select-ghost-fs', cs.fontSize) }\n const pos = resolvePlacement(rect, { width: p.offsetWidth, height: p.offsetHeight }, { width: innerWidth, height: innerHeight }, props.side, props.align)\n p.style.left = `${pos.left}px`; p.style.top = `${pos.top}px`\n p.style.transformOrigin = `${pos.align === 'end' ? '100%' : pos.align === 'center' ? '50%' : '0%'} ${pos.side === 'top' ? '100%' : '0%'}`\n}\nwatch(phase, async (current, previous, cleanup) => {\n let cancelled = false\n cleanup(() => { cancelled = true; panel.value?.getAnimations?.().forEach(animation => animation.cancel()) })\n if (current === 'closed') {\n filter.value = ''\n if (previous !== 'closed' && restoreFocus.value) button.value?.focus()\n return\n }\n await nextTick(); if (cancelled) return\n position()\n const p = panel.value\n if (!p) return\n if (current === 'opening' || current === 'closing') {\n runMorph({ panel: p, trigger: trigger.value, ghost: ghost.value, preset: MENU_PRESET, direction: current === 'opening' ? 'open' : 'close', onFinish: () => { if (!cancelled) phase.value = current === 'opening' ? 'open' : 'closed' } })\n } else if (current === 'open') {\n (props.searchable ? p.querySelector<HTMLElement>('input') : p.querySelector<HTMLElement>('[role=\"option\"][aria-selected=\"true\"]:not([disabled])') ?? p.querySelector<HTMLElement>('[role=\"option\"]:not([disabled])') ?? p)?.focus()\n }\n}, { immediate: true })\nwatch([() => phase.value === 'open', panel], ([active, el], _, cleanup) => {\n if (!active || !el || !trigger.value) return\n const stop = attachCloseScrub(el, trigger.value, MENU_PRESET, () => setOpen(false))\n cleanup(stop)\n}, { flush: 'post' })\nwatch(() => phase.value === 'opening' || phase.value === 'open', (active, _, cleanup) => {\n if (!active) return\n function outside(event: PointerEvent) { const p = panel.value, target = event.target as Node; if (p && isTopMorphLayer(p) && !p.contains(target) && !trigger.value?.contains(target)) setOpen(false, false) }\n // While the search field has focus, a phone opens its keyboard: the\n // viewport resizes and the page scrolls the field into view. Those are not\n // the user leaving the select, so the panel follows instead of closing.\n function typing() { const el = document.activeElement; return !!el && el.tagName === 'INPUT' && !!panel.value?.contains(el) }\n function scroll(event: Event) { if (panel.value?.contains(event.target as Node)) return; if (typing()) { position(); return } setOpen(false, false) }\n function resize() { if (typing()) { position(); return } setOpen(false) }\n const vv = window.visualViewport\n document.addEventListener('pointerdown', outside); document.addEventListener('scroll', scroll, true); window.addEventListener('resize', resize); vv?.addEventListener('resize', resize)\n cleanup(() => { document.removeEventListener('pointerdown', outside); document.removeEventListener('scroll', scroll, true); window.removeEventListener('resize', resize); vv?.removeEventListener('resize', resize) })\n})\nwatch([filter, () => props.side, () => props.align, () => options.value.length], () => nextTick(position))\nonBeforeUnmount(() => panel.value?.getAnimations?.().forEach(animation => animation.cancel()))\n</script>\n<template>\n <Teleport to=\"body\">\n <div v-if=\"phase !== 'closed'\" ref=\"panel\" tabindex=\"-1\" class=\"modo-morph-select-panel text-foreground\" data-modo-morph-select-panel=\"\" data-modo-morph-layer=\"\"\n :data-modo-phase=\"phase\" :data-modo-theme=\"scopedTheme\" :data-modo-radius=\"radius\" :data-modo-color=\"stateColor\" :inert=\"phase === 'closing'\" :style=\"[providerStyle, { position: 'fixed' }]\" @keydown=\"key\">\n <div v-if=\"searchable\" class=\"modo-morph-select__search\">\n <input v-model=\"filter\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" :placeholder=\"searchLabel\" :aria-label=\"searchLabel\" :aria-controls=\"`${fieldId}-listbox`\"\n class=\"modo-morph-select__search-input w-full border border-input bg-transparent text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/60\" />\n </div>\n <div :id=\"`${fieldId}-listbox`\" role=\"listbox\" :aria-labelledby=\"fieldId\" :aria-multiselectable=\"multiple || undefined\" class=\"modo-morph-select__list\">\n <button v-for=\"option in shown\" :key=\"option.value\" type=\"button\" role=\"option\" tabindex=\"-1\"\n :class=\"['modo-morph-select__option outline-none', isSelected(option.value) ? 'font-medium' : '', option.disabled ? 'text-muted-foreground/60' : optionClass]\"\n :aria-selected=\"isSelected(option.value)\" :disabled=\"option.disabled\" :data-text-value=\"option.textValue ?? String(option.label)\" @click=\"select(option.value)\">\n <span class=\"modo-morph-select__option-text\"><slot name=\"option\" :option=\"option\" :selected=\"isSelected(option.value)\"><span class=\"truncate\"><RenderContent :content=\"option.label\" /></span><span v-if=\"option.description\" class=\"modo-morph-select__option-desc\"><RenderContent :content=\"option.description\" /></span></slot></span>\n <CheckIcon v-if=\"isSelected(option.value)\" :class=\"['modo-morph-select__check shrink-0', checkClass]\" aria-hidden=\"true\" />\n </button>\n </div>\n <p v-if=\"!shown.length\" role=\"status\" class=\"modo-morph-select__empty text-caption text-muted-foreground text-center\">{{ emptyLabel }}</p>\n <div v-if=\"phase === 'closing'\" class=\"modo-morph-select-ghost\" aria-hidden=\"true\"><span ref=\"ghost\" class=\"modo-morph-select-ghost__inner\"><RenderContent v-if=\"!multiple\" :content=\"selectedOptions[0]?.label\" /><template v-else>{{ selectedSummary }}</template></span></div>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EACd,MAAM,EAAE,SAAS,SAAS,UAAU,iBAAiB,YAAY,OAAO,SAAS,QAAQ,QAAQ,SAAS,cAAc,YAAY,QAAQ,SAAS,2BAAA,gBAAe;EACpK,MAAM,MAAM,sBAAA,eAAc;EAC1B,MAAM,eAAA,GAAA,IAAA,gBAA6B,MAA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AAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,OAAmF,0BAAA,UAAA,EAAA;;MAA/E,QAAA,GAAA,IAAA,gBAAK,CAAA,qCAAwC,WAAA,MAAU,CAAA;MAAG,eAAY;;;KAG5G,MAAA,MAAM,WAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAA0H,KAA1I,aAAA,GAAA,IAAA,iBAAyH,WAAA,MAAU,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;mBACxH,MAAK,KAAA,cAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAAiQ,OAAjR,aAAiR,EAAA,GAAA,IAAA,oBAAN,QAAA;cAA9K;KAAJ,KAAI;KAAQ,OAAM;wBAAuD,SAAQ,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,OAAyC,sBAAA,QAAA,EAAA;;KAAtC,UAAA,GAAA,IAAA,OAAS,gBAAe,CAAA,IAAK;mFAA0D,IAAA,UAAA,EAAA,KAAA,GAAA,EAAA,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAA7B,gBAAA,MAAe,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,EAAA,IAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
@@ -5,7 +5,7 @@ import { attachCloseScrub, isTopMorphLayer, resolvePlacement } from "../../../ut
5
5
  import RenderContent from "../../../utils/RenderContent.mjs";
6
6
  import { useMorphSelect } from "./MorphSelectContext.mjs";
7
7
  import { useMorphSelectKeyboard } from "./useMorphSelectKeyboard.mjs";
8
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, toDisplayString, unref, vModelText, watch, withDirectives } from "vue";
8
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, toDisplayString, unref, vModelText, watch, withDirectives } from "vue";
9
9
  import { CheckIcon } from "@heroicons/vue/24/outline";
10
10
  //#region src/components/forms/morph-select/MorphSelectContent.vue?vue&type=script&setup=true&lang.ts
11
11
  var _hoisted_1 = [
@@ -24,7 +24,11 @@ var _hoisted_3 = [
24
24
  "aria-label",
25
25
  "aria-controls"
26
26
  ];
27
- var _hoisted_4 = ["id", "aria-labelledby"];
27
+ var _hoisted_4 = [
28
+ "id",
29
+ "aria-labelledby",
30
+ "aria-multiselectable"
31
+ ];
28
32
  var _hoisted_5 = [
29
33
  "aria-selected",
30
34
  "disabled",
@@ -58,7 +62,7 @@ var MorphSelectContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
58
62
  },
59
63
  setup(__props) {
60
64
  const props = __props;
61
- const { fieldId, options, value, phase, trigger, button, select, setOpen, restoreFocus, stateColor, radius, size } = useMorphSelect();
65
+ const { fieldId, options, multiple, selectedOptions, isSelected, phase, trigger, button, select, setOpen, restoreFocus, stateColor, radius, size } = useMorphSelect();
62
66
  const loc = useModoLocale();
63
67
  const searchLabel = computed(() => props.searchPlaceholder ?? loc.value.morphSelect.searchPlaceholder);
64
68
  const emptyLabel = computed(() => props.emptyMessage ?? loc.value.morphSelect.empty);
@@ -79,6 +83,7 @@ var MorphSelectContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
79
83
  const optionClass = computed(() => OPTION_HOVER[stateColor.value] ?? OPTION_HOVER.default);
80
84
  const checkClass = computed(() => CHECK_COLOR[stateColor.value] ?? CHECK_COLOR.default);
81
85
  const panel = ref(null), ghost = ref(null);
86
+ const selectedSummary = computed(() => selectedOptions.value.map((option) => option.textValue ?? String(option.label)).join(", "));
82
87
  const filter = ref("");
83
88
  const shown = computed(() => options.value.filter((option) => (option.textValue ?? String(option.label)).toLocaleLowerCase().includes(filter.value.toLocaleLowerCase())));
84
89
  const { scopedTheme, providerStyle } = useTeleportedModoTheme({
@@ -145,19 +150,35 @@ var MorphSelectContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
145
150
  const p = panel.value, target = event.target;
146
151
  if (p && isTopMorphLayer(p) && !p.contains(target) && !trigger.value?.contains(target)) setOpen(false, false);
147
152
  }
153
+ function typing() {
154
+ const el = document.activeElement;
155
+ return !!el && el.tagName === "INPUT" && !!panel.value?.contains(el);
156
+ }
148
157
  function scroll(event) {
149
- if (!panel.value?.contains(event.target)) setOpen(false, false);
158
+ if (panel.value?.contains(event.target)) return;
159
+ if (typing()) {
160
+ position();
161
+ return;
162
+ }
163
+ setOpen(false, false);
150
164
  }
151
165
  function resize() {
166
+ if (typing()) {
167
+ position();
168
+ return;
169
+ }
152
170
  setOpen(false);
153
171
  }
172
+ const vv = window.visualViewport;
154
173
  document.addEventListener("pointerdown", outside);
155
174
  document.addEventListener("scroll", scroll, true);
156
175
  window.addEventListener("resize", resize);
176
+ vv?.addEventListener("resize", resize);
157
177
  cleanup(() => {
158
178
  document.removeEventListener("pointerdown", outside);
159
179
  document.removeEventListener("scroll", scroll, true);
160
180
  window.removeEventListener("resize", resize);
181
+ vv?.removeEventListener("resize", resize);
161
182
  });
162
183
  });
163
184
  watch([
@@ -198,6 +219,7 @@ var MorphSelectContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
198
219
  id: `${unref(fieldId)}-listbox`,
199
220
  role: "listbox",
200
221
  "aria-labelledby": unref(fieldId),
222
+ "aria-multiselectable": unref(multiple) || void 0,
201
223
  class: "modo-morph-select__list"
202
224
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(shown.value, (option) => {
203
225
  return openBlock(), createElementBlock("button", {
@@ -207,17 +229,17 @@ var MorphSelectContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
207
229
  tabindex: "-1",
208
230
  class: normalizeClass([
209
231
  "modo-morph-select__option outline-none",
210
- option.value === unref(value) ? "font-medium" : "",
232
+ unref(isSelected)(option.value) ? "font-medium" : "",
211
233
  option.disabled ? "text-muted-foreground/60" : optionClass.value
212
234
  ]),
213
- "aria-selected": option.value === unref(value),
235
+ "aria-selected": unref(isSelected)(option.value),
214
236
  disabled: option.disabled,
215
237
  "data-text-value": option.textValue ?? String(option.label),
216
238
  onClick: ($event) => unref(select)(option.value)
217
239
  }, [createElementVNode("span", _hoisted_6, [renderSlot(_ctx.$slots, "option", {
218
240
  option,
219
- selected: option.value === unref(value)
220
- }, () => [createElementVNode("span", _hoisted_7, [createVNode(unref(RenderContent), { content: option.label }, null, 8, ["content"])]), option.description ? (openBlock(), createElementBlock("span", _hoisted_8, [createVNode(unref(RenderContent), { content: option.description }, null, 8, ["content"])])) : createCommentVNode("", true)])]), option.value === unref(value) ? (openBlock(), createBlock(unref(CheckIcon), {
241
+ selected: unref(isSelected)(option.value)
242
+ }, () => [createElementVNode("span", _hoisted_7, [createVNode(unref(RenderContent), { content: option.label }, null, 8, ["content"])]), option.description ? (openBlock(), createElementBlock("span", _hoisted_8, [createVNode(unref(RenderContent), { content: option.description }, null, 8, ["content"])])) : createCommentVNode("", true)])]), unref(isSelected)(option.value) ? (openBlock(), createBlock(unref(CheckIcon), {
221
243
  key: 0,
222
244
  class: normalizeClass(["modo-morph-select__check shrink-0", checkClass.value]),
223
245
  "aria-hidden": "true"
@@ -228,7 +250,10 @@ var MorphSelectContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
228
250
  ref_key: "ghost",
229
251
  ref: ghost,
230
252
  class: "modo-morph-select-ghost__inner"
231
- }, [createVNode(unref(RenderContent), { content: unref(options).find((option) => option.value === unref(value))?.label }, null, 8, ["content"])], 512)])) : createCommentVNode("", true)
253
+ }, [!unref(multiple) ? (openBlock(), createBlock(unref(RenderContent), {
254
+ key: 0,
255
+ content: unref(selectedOptions)[0]?.label
256
+ }, null, 8, ["content"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(selectedSummary.value), 1)], 64))], 512)])) : createCommentVNode("", true)
232
257
  ], 44, _hoisted_1)) : createCommentVNode("", true)]);
233
258
  };
234
259
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectContent.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'\nimport type { MorphSelectContentProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { useTeleportedModoTheme } from '../../../composables/useTeleportedModoTheme'\nimport { useModoLocale } from '../../../composables/useModoConfig'\nimport { MENU_PRESET, runMorph } from '../../../utils/morph/morphEngine'\nimport { attachCloseScrub, isTopMorphLayer, resolvePlacement } from '../../../utils/morph/morphHelpers'\nimport { CheckIcon } from '@heroicons/vue/24/outline'\nimport RenderContent from '../../../utils/RenderContent'\nimport { useMorphSelect } from './MorphSelectContext'\nimport { useMorphSelectKeyboard } from './useMorphSelectKeyboard'\nconst props = withDefaults(defineProps<MorphSelectContentProps>(), { side: 'auto', align: 'auto' })\nconst { fieldId, options, value, phase, trigger, button, select, setOpen, restoreFocus, stateColor, radius, size } = useMorphSelect()\nconst loc = useModoLocale()\nconst searchLabel = computed(() => props.searchPlaceholder ?? loc.value.morphSelect.searchPlaceholder)\nconst emptyLabel = computed(() => props.emptyMessage ?? loc.value.morphSelect.empty)\n// Same option surfaces and check colors as the native Select, per state color.\nconst OPTION_HOVER: Record<string, string> = {\n default: 'hover:bg-muted focus-visible:bg-muted',\n primary: 'hover:bg-primary/10 focus-visible:bg-primary/10',\n danger: 'hover:bg-destructive/10 focus-visible:bg-destructive/10',\n success: 'hover:bg-success/10 focus-visible:bg-success/10',\n warning: 'hover:bg-warning/10 focus-visible:bg-warning/10',\n}\nconst CHECK_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 optionClass = computed(() => OPTION_HOVER[stateColor.value] ?? OPTION_HOVER.default)\nconst checkClass = computed(() => CHECK_COLOR[stateColor.value] ?? CHECK_COLOR.default)\nconst panel = ref<HTMLElement | null>(null), ghost = ref<HTMLElement | null>(null)\nconst filter = ref('')\nconst shown = computed(() => options.value.filter(option => (option.textValue ?? String(option.label)).toLocaleLowerCase().includes(filter.value.toLocaleLowerCase())))\nconst { scopedTheme, providerStyle } = useTeleportedModoTheme({ radius, size })\nconst key = useMorphSelectKeyboard(panel, () => setOpen(false))\nfunction position() {\n const p = panel.value, t = trigger.value\n if (!p || !t) return\n const rect = t.getBoundingClientRect()\n p.style.width = `${rect.width}px`\n if (button.value) { const cs = getComputedStyle(button.value); p.style.setProperty('--modo-morph-select-ghost-px', cs.paddingLeft); p.style.setProperty('--modo-morph-select-ghost-fs', cs.fontSize) }\n const pos = resolvePlacement(rect, { width: p.offsetWidth, height: p.offsetHeight }, { width: innerWidth, height: innerHeight }, props.side, props.align)\n p.style.left = `${pos.left}px`; p.style.top = `${pos.top}px`\n p.style.transformOrigin = `${pos.align === 'end' ? '100%' : pos.align === 'center' ? '50%' : '0%'} ${pos.side === 'top' ? '100%' : '0%'}`\n}\nwatch(phase, async (current, previous, cleanup) => {\n let cancelled = false\n cleanup(() => { cancelled = true; panel.value?.getAnimations?.().forEach(animation => animation.cancel()) })\n if (current === 'closed') {\n filter.value = ''\n if (previous !== 'closed' && restoreFocus.value) button.value?.focus()\n return\n }\n await nextTick(); if (cancelled) return\n position()\n const p = panel.value\n if (!p) return\n if (current === 'opening' || current === 'closing') {\n runMorph({ panel: p, trigger: trigger.value, ghost: ghost.value, preset: MENU_PRESET, direction: current === 'opening' ? 'open' : 'close', onFinish: () => { if (!cancelled) phase.value = current === 'opening' ? 'open' : 'closed' } })\n } else if (current === 'open') {\n (props.searchable ? p.querySelector<HTMLElement>('input') : p.querySelector<HTMLElement>('[role=\"option\"][aria-selected=\"true\"]:not([disabled])') ?? p.querySelector<HTMLElement>('[role=\"option\"]:not([disabled])') ?? p)?.focus()\n }\n}, { immediate: true })\nwatch([() => phase.value === 'open', panel], ([active, el], _, cleanup) => {\n if (!active || !el || !trigger.value) return\n const stop = attachCloseScrub(el, trigger.value, MENU_PRESET, () => setOpen(false))\n cleanup(stop)\n}, { flush: 'post' })\nwatch(() => phase.value === 'opening' || phase.value === 'open', (active, _, cleanup) => {\n if (!active) return\n function outside(event: PointerEvent) { const p = panel.value, target = event.target as Node; if (p && isTopMorphLayer(p) && !p.contains(target) && !trigger.value?.contains(target)) setOpen(false, false) }\n function scroll(event: Event) { if (!panel.value?.contains(event.target as Node)) setOpen(false, false) }\n function resize() { setOpen(false) }\n document.addEventListener('pointerdown', outside); document.addEventListener('scroll', scroll, true); window.addEventListener('resize', resize)\n cleanup(() => { document.removeEventListener('pointerdown', outside); document.removeEventListener('scroll', scroll, true); window.removeEventListener('resize', resize) })\n})\nwatch([filter, () => props.side, () => props.align, () => options.value.length], () => nextTick(position))\nonBeforeUnmount(() => panel.value?.getAnimations?.().forEach(animation => animation.cancel()))\n</script>\n<template>\n <Teleport to=\"body\">\n <div v-if=\"phase !== 'closed'\" ref=\"panel\" tabindex=\"-1\" class=\"modo-morph-select-panel text-foreground\" data-modo-morph-select-panel=\"\" data-modo-morph-layer=\"\"\n :data-modo-phase=\"phase\" :data-modo-theme=\"scopedTheme\" :data-modo-radius=\"radius\" :data-modo-color=\"stateColor\" :inert=\"phase === 'closing'\" :style=\"[providerStyle, { position: 'fixed' }]\" @keydown=\"key\">\n <div v-if=\"searchable\" class=\"modo-morph-select__search\">\n <input v-model=\"filter\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" :placeholder=\"searchLabel\" :aria-label=\"searchLabel\" :aria-controls=\"`${fieldId}-listbox`\"\n class=\"modo-morph-select__search-input w-full border border-input bg-transparent text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/60\" />\n </div>\n <div :id=\"`${fieldId}-listbox`\" role=\"listbox\" :aria-labelledby=\"fieldId\" class=\"modo-morph-select__list\">\n <button v-for=\"option in shown\" :key=\"option.value\" type=\"button\" role=\"option\" tabindex=\"-1\"\n :class=\"['modo-morph-select__option outline-none', option.value === value ? 'font-medium' : '', option.disabled ? 'text-muted-foreground/60' : optionClass]\"\n :aria-selected=\"option.value === value\" :disabled=\"option.disabled\" :data-text-value=\"option.textValue ?? String(option.label)\" @click=\"select(option.value)\">\n <span class=\"modo-morph-select__option-text\"><slot name=\"option\" :option=\"option\" :selected=\"option.value === value\"><span class=\"truncate\"><RenderContent :content=\"option.label\" /></span><span v-if=\"option.description\" class=\"modo-morph-select__option-desc\"><RenderContent :content=\"option.description\" /></span></slot></span>\n <CheckIcon v-if=\"option.value === value\" :class=\"['modo-morph-select__check shrink-0', checkClass]\" aria-hidden=\"true\" />\n </button>\n </div>\n <p v-if=\"!shown.length\" role=\"status\" class=\"modo-morph-select__empty text-caption text-muted-foreground text-center\">{{ emptyLabel }}</p>\n <div v-if=\"phase === 'closing'\" class=\"modo-morph-select-ghost\" aria-hidden=\"true\"><span ref=\"ghost\" class=\"modo-morph-select-ghost__inner\"><RenderContent :content=\"options.find(option => option.value === value)?.label\" /></span></div>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EACd,MAAM,EAAE,SAAS,SAAS,OAAO,OAAO,SAAS,QAAQ,QAAQ,SAAS,cAAc,YAAY,QAAQ,SAAS,gBAAe;EACpI,MAAM,MAAM,eAAc;EAC1B,MAAM,cAAc,eAAe,MAAM,qBAAqB,IAAI,MAAM,YAAY,kBAAiB;EACrG,MAAM,aAAa,eAAe,MAAM,gBAAgB,IAAI,MAAM,YAAY,MAAK;EAEnF,MAAM,eAAuC;GAC3C,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACX;EACA,MAAM,cAAsC;GAC1C,SAAS;GACT,SAAS;GACT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B,WAAA,MAAU,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;IACxH,MAAA,MAAK,KAAA,aAAA,WAAA,EAAhB,mBAA2O,OAA3O,aAA2O,CAAxJ,mBAAkJ,QAAA;cAAxI;KAAJ,KAAI;KAAQ,OAAM;QAAiC,YAAkF,MAAA,cAAA,EAAA,EAAlE,SAAS,MAAA,QAAO,CAAC,MAAK,WAAU,OAAO,UAAU,MAAA,MAAK,CAAA,EAAG,OAAA,EAAA,MAAA,GAAA,CAAA,UAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"MorphSelectContent.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'\nimport type { MorphSelectContentProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { useTeleportedModoTheme } from '../../../composables/useTeleportedModoTheme'\nimport { useModoLocale } from '../../../composables/useModoConfig'\nimport { MENU_PRESET, runMorph } from '../../../utils/morph/morphEngine'\nimport { attachCloseScrub, isTopMorphLayer, resolvePlacement } from '../../../utils/morph/morphHelpers'\nimport { CheckIcon } from '@heroicons/vue/24/outline'\nimport RenderContent from '../../../utils/RenderContent'\nimport { useMorphSelect } from './MorphSelectContext'\nimport { useMorphSelectKeyboard } from './useMorphSelectKeyboard'\nconst props = withDefaults(defineProps<MorphSelectContentProps>(), { side: 'auto', align: 'auto' })\nconst { fieldId, options, multiple, selectedOptions, isSelected, phase, trigger, button, select, setOpen, restoreFocus, stateColor, radius, size } = useMorphSelect()\nconst loc = useModoLocale()\nconst searchLabel = computed(() => props.searchPlaceholder ?? loc.value.morphSelect.searchPlaceholder)\nconst emptyLabel = computed(() => props.emptyMessage ?? loc.value.morphSelect.empty)\n// Same option surfaces and check colors as the native Select, per state color.\nconst OPTION_HOVER: Record<string, string> = {\n default: 'hover:bg-muted focus-visible:bg-muted',\n primary: 'hover:bg-primary/10 focus-visible:bg-primary/10',\n danger: 'hover:bg-destructive/10 focus-visible:bg-destructive/10',\n success: 'hover:bg-success/10 focus-visible:bg-success/10',\n warning: 'hover:bg-warning/10 focus-visible:bg-warning/10',\n}\nconst CHECK_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 optionClass = computed(() => OPTION_HOVER[stateColor.value] ?? OPTION_HOVER.default)\nconst checkClass = computed(() => CHECK_COLOR[stateColor.value] ?? CHECK_COLOR.default)\nconst panel = ref<HTMLElement | null>(null), ghost = ref<HTMLElement | null>(null)\nconst selectedSummary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst filter = ref('')\nconst shown = computed(() => options.value.filter(option => (option.textValue ?? String(option.label)).toLocaleLowerCase().includes(filter.value.toLocaleLowerCase())))\nconst { scopedTheme, providerStyle } = useTeleportedModoTheme({ radius, size })\nconst key = useMorphSelectKeyboard(panel, () => setOpen(false))\nfunction position() {\n const p = panel.value, t = trigger.value\n if (!p || !t) return\n const rect = t.getBoundingClientRect()\n p.style.width = `${rect.width}px`\n if (button.value) { const cs = getComputedStyle(button.value); p.style.setProperty('--modo-morph-select-ghost-px', cs.paddingLeft); p.style.setProperty('--modo-morph-select-ghost-fs', cs.fontSize) }\n const pos = resolvePlacement(rect, { width: p.offsetWidth, height: p.offsetHeight }, { width: innerWidth, height: innerHeight }, props.side, props.align)\n p.style.left = `${pos.left}px`; p.style.top = `${pos.top}px`\n p.style.transformOrigin = `${pos.align === 'end' ? '100%' : pos.align === 'center' ? '50%' : '0%'} ${pos.side === 'top' ? '100%' : '0%'}`\n}\nwatch(phase, async (current, previous, cleanup) => {\n let cancelled = false\n cleanup(() => { cancelled = true; panel.value?.getAnimations?.().forEach(animation => animation.cancel()) })\n if (current === 'closed') {\n filter.value = ''\n if (previous !== 'closed' && restoreFocus.value) button.value?.focus()\n return\n }\n await nextTick(); if (cancelled) return\n position()\n const p = panel.value\n if (!p) return\n if (current === 'opening' || current === 'closing') {\n runMorph({ panel: p, trigger: trigger.value, ghost: ghost.value, preset: MENU_PRESET, direction: current === 'opening' ? 'open' : 'close', onFinish: () => { if (!cancelled) phase.value = current === 'opening' ? 'open' : 'closed' } })\n } else if (current === 'open') {\n (props.searchable ? p.querySelector<HTMLElement>('input') : p.querySelector<HTMLElement>('[role=\"option\"][aria-selected=\"true\"]:not([disabled])') ?? p.querySelector<HTMLElement>('[role=\"option\"]:not([disabled])') ?? p)?.focus()\n }\n}, { immediate: true })\nwatch([() => phase.value === 'open', panel], ([active, el], _, cleanup) => {\n if (!active || !el || !trigger.value) return\n const stop = attachCloseScrub(el, trigger.value, MENU_PRESET, () => setOpen(false))\n cleanup(stop)\n}, { flush: 'post' })\nwatch(() => phase.value === 'opening' || phase.value === 'open', (active, _, cleanup) => {\n if (!active) return\n function outside(event: PointerEvent) { const p = panel.value, target = event.target as Node; if (p && isTopMorphLayer(p) && !p.contains(target) && !trigger.value?.contains(target)) setOpen(false, false) }\n // While the search field has focus, a phone opens its keyboard: the\n // viewport resizes and the page scrolls the field into view. Those are not\n // the user leaving the select, so the panel follows instead of closing.\n function typing() { const el = document.activeElement; return !!el && el.tagName === 'INPUT' && !!panel.value?.contains(el) }\n function scroll(event: Event) { if (panel.value?.contains(event.target as Node)) return; if (typing()) { position(); return } setOpen(false, false) }\n function resize() { if (typing()) { position(); return } setOpen(false) }\n const vv = window.visualViewport\n document.addEventListener('pointerdown', outside); document.addEventListener('scroll', scroll, true); window.addEventListener('resize', resize); vv?.addEventListener('resize', resize)\n cleanup(() => { document.removeEventListener('pointerdown', outside); document.removeEventListener('scroll', scroll, true); window.removeEventListener('resize', resize); vv?.removeEventListener('resize', resize) })\n})\nwatch([filter, () => props.side, () => props.align, () => options.value.length], () => nextTick(position))\nonBeforeUnmount(() => panel.value?.getAnimations?.().forEach(animation => animation.cancel()))\n</script>\n<template>\n <Teleport to=\"body\">\n <div v-if=\"phase !== 'closed'\" ref=\"panel\" tabindex=\"-1\" class=\"modo-morph-select-panel text-foreground\" data-modo-morph-select-panel=\"\" data-modo-morph-layer=\"\"\n :data-modo-phase=\"phase\" :data-modo-theme=\"scopedTheme\" :data-modo-radius=\"radius\" :data-modo-color=\"stateColor\" :inert=\"phase === 'closing'\" :style=\"[providerStyle, { position: 'fixed' }]\" @keydown=\"key\">\n <div v-if=\"searchable\" class=\"modo-morph-select__search\">\n <input v-model=\"filter\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" :placeholder=\"searchLabel\" :aria-label=\"searchLabel\" :aria-controls=\"`${fieldId}-listbox`\"\n class=\"modo-morph-select__search-input w-full border border-input bg-transparent text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/60\" />\n </div>\n <div :id=\"`${fieldId}-listbox`\" role=\"listbox\" :aria-labelledby=\"fieldId\" :aria-multiselectable=\"multiple || undefined\" class=\"modo-morph-select__list\">\n <button v-for=\"option in shown\" :key=\"option.value\" type=\"button\" role=\"option\" tabindex=\"-1\"\n :class=\"['modo-morph-select__option outline-none', isSelected(option.value) ? 'font-medium' : '', option.disabled ? 'text-muted-foreground/60' : optionClass]\"\n :aria-selected=\"isSelected(option.value)\" :disabled=\"option.disabled\" :data-text-value=\"option.textValue ?? String(option.label)\" @click=\"select(option.value)\">\n <span class=\"modo-morph-select__option-text\"><slot name=\"option\" :option=\"option\" :selected=\"isSelected(option.value)\"><span class=\"truncate\"><RenderContent :content=\"option.label\" /></span><span v-if=\"option.description\" class=\"modo-morph-select__option-desc\"><RenderContent :content=\"option.description\" /></span></slot></span>\n <CheckIcon v-if=\"isSelected(option.value)\" :class=\"['modo-morph-select__check shrink-0', checkClass]\" aria-hidden=\"true\" />\n </button>\n </div>\n <p v-if=\"!shown.length\" role=\"status\" class=\"modo-morph-select__empty text-caption text-muted-foreground text-center\">{{ emptyLabel }}</p>\n <div v-if=\"phase === 'closing'\" class=\"modo-morph-select-ghost\" aria-hidden=\"true\"><span ref=\"ghost\" class=\"modo-morph-select-ghost__inner\"><RenderContent v-if=\"!multiple\" :content=\"selectedOptions[0]?.label\" /><template v-else>{{ selectedSummary }}</template></span></div>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EACd,MAAM,EAAE,SAAS,SAAS,UAAU,iBAAiB,YAAY,OAAO,SAAS,QAAQ,QAAQ,SAAS,cAAc,YAAY,QAAQ,SAAS,gBAAe;EACpK,MAAM,MAAM,eAAc;EAC1B,MAAM,cAAc,eAAe,MAAM,qBAAqB,IAAI,MAAM,YAAY,kBAAiB;EACrG,MAAM,aAAa,eAAe,MAAM,gBAAgB,IAAI,MAAM,YAAY,MAAK;EAEnF,MAAM,eAAuC;GAC3C,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACX;EACA,MAAM,cAAsC;GAC1C,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACX;EACA,MAAM,cAAc,eAAe,aAAa,WAAW,UAAU,aAAa,QAAO;EACzF,MAAM,aAAa,eAAe,YAAY,WAAW,UAAU,YAAY,QAAO;EACtF,MAAM,QAAQ,IAAwB,KAAK,EAAE,QAAQ,IAAwB,KAAI;EACjF,MAAM,kBAAkB,eAAe,gBAAgB,MAAM,KAAI,WAAU,OAAO,aAAa,OAAO,OAAO,MAAM,CAAC,CAAC,KAAK,KAAK,CAAA;EAC/H,MAAM,SAAS,IAAI,GAAE;EACrB,MAAM,QAAQ,eAAe,QAAQ,MAAM,QAAO,YAAW,OAAO,aAAa,OAAO,OAAO,MAAM,EAAE,mBAAmB,CAAC,SAAS,OAAO,MAAM,mBAAmB,CAAC,CAAC,CAAA;EACtK,MAAM,EAAE,aAAa,kBAAkB,uBAAuB;GAA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;IACxH,MAAA,MAAK,KAAA,aAAA,WAAA,EAAhB,mBAAiR,OAAjR,aAAiR,CAA9L,mBAAwL,QAAA;cAA9K;KAAJ,KAAI;KAAQ,OAAM;SAAuD,MAAA,SAAQ,IAAA,WAAA,EAA9B,YAAuE,MAAA,cAAA,EAAA;;KAAtC,SAAS,MAAA,gBAAe,CAAA,IAAK;8CAAS,mBAAiD,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBAA7B,gBAAA,MAAe,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,EAAA,IAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectContext.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContext.ts"],"sourcesContent":["import { inject, type ComputedRef, type InjectionKey, type Ref } from 'vue'\nimport type { ModoColor, ModoHalo, ModoRadius, ModoSize } from '../../../config/ModoConfig'\nimport type { MorphSelectOption } from '../../../interfaces/forms/MorphSelect.interface'\nimport type { MorphPhase } from '../../../utils/morph/morphEngine'\ninterface SelectContext {\n /** Trigger id (FormField-aware); the listbox is `${fieldId}-listbox`. */\n fieldId: ComputedRef<string>\n options: Ref<readonly MorphSelectOption[]>; value: Ref<string>\n disabled: ComputedRef<boolean>; readonly: ComputedRef<boolean>; required: ComputedRef<boolean>\n label: ComputedRef<string | undefined>; ariaLabel: ComputedRef<string | undefined>\n helperText: ComputedRef<string | undefined>; errorText: ComputedRef<string | undefined>\n hasError: ComputedRef<boolean>; stateColor: ComputedRef<ModoColor>\n radius: ComputedRef<ModoRadius>; size: ComputedRef<ModoSize>; halo: ComputedRef<ModoHalo | undefined>\n fullWidth: ComputedRef<boolean>\n errorId: ComputedRef<string>; helperId: ComputedRef<string>; describedBy: ComputedRef<string | undefined>\n phase: Ref<MorphPhase>; open: Ref<boolean>; trigger: Ref<HTMLElement | null>; button: Ref<HTMLButtonElement | null>\n select: (value: string) => void; setOpen: (value: boolean, restore?: boolean) => void; restoreFocus: Ref<boolean>\n}\nexport const selectKey: InjectionKey<SelectContext> = Symbol('MorphSelect')\nexport function useMorphSelect() { const ctx = inject(selectKey); if (!ctx) throw new Error('[mood-ui] MorphSelect parts require MorphSelect'); return ctx }\n"],"mappings":";;;AAkBA,IAAa,YAAyC,OAAO,cAAc;AAC3E,SAAgB,iBAAiB;CAAE,MAAM,OAAA,GAAA,IAAA,QAAa,UAAU;CAAE,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,kDAAkD;CAAE,OAAO"}
1
+ {"version":3,"file":"MorphSelectContext.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContext.ts"],"sourcesContent":["import { inject, type ComputedRef, type InjectionKey, type Ref } from 'vue'\nimport type { ModoColor, ModoHalo, ModoRadius, ModoSize } from '../../../config/ModoConfig'\nimport type { MorphSelectOption } from '../../../interfaces/forms/MorphSelect.interface'\nimport type { MorphPhase } from '../../../utils/morph/morphEngine'\ninterface SelectContext {\n /** Trigger id (FormField-aware); the listbox is `${fieldId}-listbox`. */\n fieldId: ComputedRef<string>\n options: Ref<readonly MorphSelectOption[]>; value: Ref<string | string[]>\n /** True when the select keeps several values (`multiple`). */\n multiple: ComputedRef<boolean>\n /** Selected options, in option order. */\n selectedOptions: ComputedRef<MorphSelectOption[]>\n isSelected: (value: string) => boolean\n disabled: ComputedRef<boolean>; readonly: ComputedRef<boolean>; required: ComputedRef<boolean>\n label: ComputedRef<string | undefined>; ariaLabel: ComputedRef<string | undefined>\n helperText: ComputedRef<string | undefined>; errorText: ComputedRef<string | undefined>\n hasError: ComputedRef<boolean>; stateColor: ComputedRef<ModoColor>\n radius: ComputedRef<ModoRadius>; size: ComputedRef<ModoSize>; halo: ComputedRef<ModoHalo | undefined>\n fullWidth: ComputedRef<boolean>\n errorId: ComputedRef<string>; helperId: ComputedRef<string>; describedBy: ComputedRef<string | undefined>\n phase: Ref<MorphPhase>; open: Ref<boolean>; trigger: Ref<HTMLElement | null>; button: Ref<HTMLButtonElement | null>\n select: (value: string) => void; setOpen: (value: boolean, restore?: boolean) => void; restoreFocus: Ref<boolean>\n}\nexport const selectKey: InjectionKey<SelectContext> = Symbol('MorphSelect')\nexport function useMorphSelect() { const ctx = inject(selectKey); if (!ctx) throw new Error('[mood-ui] MorphSelect parts require MorphSelect'); return ctx }\n"],"mappings":";;;AAuBA,IAAa,YAAyC,OAAO,cAAc;AAC3E,SAAgB,iBAAiB;CAAE,MAAM,OAAA,GAAA,IAAA,QAAa,UAAU;CAAE,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,kDAAkD;CAAE,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectContext.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContext.ts"],"sourcesContent":["import { inject, type ComputedRef, type InjectionKey, type Ref } from 'vue'\nimport type { ModoColor, ModoHalo, ModoRadius, ModoSize } from '../../../config/ModoConfig'\nimport type { MorphSelectOption } from '../../../interfaces/forms/MorphSelect.interface'\nimport type { MorphPhase } from '../../../utils/morph/morphEngine'\ninterface SelectContext {\n /** Trigger id (FormField-aware); the listbox is `${fieldId}-listbox`. */\n fieldId: ComputedRef<string>\n options: Ref<readonly MorphSelectOption[]>; value: Ref<string>\n disabled: ComputedRef<boolean>; readonly: ComputedRef<boolean>; required: ComputedRef<boolean>\n label: ComputedRef<string | undefined>; ariaLabel: ComputedRef<string | undefined>\n helperText: ComputedRef<string | undefined>; errorText: ComputedRef<string | undefined>\n hasError: ComputedRef<boolean>; stateColor: ComputedRef<ModoColor>\n radius: ComputedRef<ModoRadius>; size: ComputedRef<ModoSize>; halo: ComputedRef<ModoHalo | undefined>\n fullWidth: ComputedRef<boolean>\n errorId: ComputedRef<string>; helperId: ComputedRef<string>; describedBy: ComputedRef<string | undefined>\n phase: Ref<MorphPhase>; open: Ref<boolean>; trigger: Ref<HTMLElement | null>; button: Ref<HTMLButtonElement | null>\n select: (value: string) => void; setOpen: (value: boolean, restore?: boolean) => void; restoreFocus: Ref<boolean>\n}\nexport const selectKey: InjectionKey<SelectContext> = Symbol('MorphSelect')\nexport function useMorphSelect() { const ctx = inject(selectKey); if (!ctx) throw new Error('[mood-ui] MorphSelect parts require MorphSelect'); return ctx }\n"],"mappings":";;AAkBA,IAAa,YAAyC,OAAO,cAAc;AAC3E,SAAgB,iBAAiB;CAAE,MAAM,MAAM,OAAO,UAAU;CAAE,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,kDAAkD;CAAE,OAAO"}
1
+ {"version":3,"file":"MorphSelectContext.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectContext.ts"],"sourcesContent":["import { inject, type ComputedRef, type InjectionKey, type Ref } from 'vue'\nimport type { ModoColor, ModoHalo, ModoRadius, ModoSize } from '../../../config/ModoConfig'\nimport type { MorphSelectOption } from '../../../interfaces/forms/MorphSelect.interface'\nimport type { MorphPhase } from '../../../utils/morph/morphEngine'\ninterface SelectContext {\n /** Trigger id (FormField-aware); the listbox is `${fieldId}-listbox`. */\n fieldId: ComputedRef<string>\n options: Ref<readonly MorphSelectOption[]>; value: Ref<string | string[]>\n /** True when the select keeps several values (`multiple`). */\n multiple: ComputedRef<boolean>\n /** Selected options, in option order. */\n selectedOptions: ComputedRef<MorphSelectOption[]>\n isSelected: (value: string) => boolean\n disabled: ComputedRef<boolean>; readonly: ComputedRef<boolean>; required: ComputedRef<boolean>\n label: ComputedRef<string | undefined>; ariaLabel: ComputedRef<string | undefined>\n helperText: ComputedRef<string | undefined>; errorText: ComputedRef<string | undefined>\n hasError: ComputedRef<boolean>; stateColor: ComputedRef<ModoColor>\n radius: ComputedRef<ModoRadius>; size: ComputedRef<ModoSize>; halo: ComputedRef<ModoHalo | undefined>\n fullWidth: ComputedRef<boolean>\n errorId: ComputedRef<string>; helperId: ComputedRef<string>; describedBy: ComputedRef<string | undefined>\n phase: Ref<MorphPhase>; open: Ref<boolean>; trigger: Ref<HTMLElement | null>; button: Ref<HTMLButtonElement | null>\n select: (value: string) => void; setOpen: (value: boolean, restore?: boolean) => void; restoreFocus: Ref<boolean>\n}\nexport const selectKey: InjectionKey<SelectContext> = Symbol('MorphSelect')\nexport function useMorphSelect() { const ctx = inject(selectKey); if (!ctx) throw new Error('[mood-ui] MorphSelect parts require MorphSelect'); return ctx }\n"],"mappings":";;AAuBA,IAAa,YAAyC,OAAO,cAAc;AAC3E,SAAgB,iBAAiB;CAAE,MAAM,MAAM,OAAO,UAAU;CAAE,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,kDAAkD;CAAE,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectTrigger.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, value, options, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => options.value.find(option => option.value === value.value))\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', selected ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"selected ? undefined : ''\">\n <slot :option=\"selected\"><RenderContent :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" /></slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && 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</template>\n"],"mappings":""}
1
+ {"version":3,"file":"MorphSelectTrigger.cjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && 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</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectTrigger.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, value, options, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => options.value.find(option => option.value === value.value))\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', selected ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"selected ? undefined : ''\">\n <slot :option=\"selected\"><RenderContent :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" /></slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && 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</template>\n"],"mappings":""}
1
+ {"version":3,"file":"MorphSelectTrigger.mjs","names":[],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && 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</template>\n"],"mappings":""}
@@ -36,11 +36,12 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
36
36
  __name: "MorphSelectTrigger",
37
37
  props: {
38
38
  placeholder: {},
39
+ icon: {},
39
40
  variant: { default: "outline" }
40
41
  },
41
42
  setup(__props) {
42
43
  const props = __props;
43
- const { fieldId, value, options, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor, radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen } = require_MorphSelectContext.useMorphSelect();
44
+ const { fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor, radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen } = require_MorphSelectContext.useMorphSelect();
44
45
  const loc = require_useModoConfig.useModoLocale();
45
46
  const sz = require_useModoConfig.useSizeTokens(() => size.value);
46
47
  const { wrapperVariantClasses, radiusClasses } = require_useField.useFieldClasses({
@@ -63,7 +64,9 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
63
64
  }
64
65
  });
65
66
  (0, vue.onBeforeUnmount)(() => clearTimeout(landedTimer));
66
- const selected = (0, vue.computed)(() => options.value.find((option) => option.value === value.value));
67
+ const selected = (0, vue.computed)(() => selectedOptions.value[0]);
68
+ const summary = (0, vue.computed)(() => selectedOptions.value.map((option) => option.textValue ?? String(option.label)).join(", "));
69
+ const hasValue = (0, vue.computed)(() => selectedOptions.value.length > 0);
67
70
  function key(event) {
68
71
  if (event.key === "ArrowDown" || event.key === "ArrowUp") {
69
72
  event.preventDefault();
@@ -72,7 +75,7 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
72
75
  }
73
76
  return (_ctx, _cache) => {
74
77
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
75
- class: (0, vue.normalizeClass)(["modo-morph-select flex flex-col", (0, vue.unref)(fullWidth) ? "w-full" : "inline-flex"]),
78
+ class: (0, vue.normalizeClass)(["modo-morph-select flex flex-col gap-1.5", (0, vue.unref)(fullWidth) ? "w-full" : "inline-flex"]),
76
79
  "data-modo-morph-select": "",
77
80
  "data-modo-size": (0, vue.unref)(size),
78
81
  "data-modo-radius": (0, vue.unref)(radius),
@@ -81,7 +84,7 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
81
84
  (0, vue.unref)(label) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("label", {
82
85
  key: 0,
83
86
  for: (0, vue.unref)(fieldId),
84
- class: "modo-morph-select__label"
87
+ class: "modo-morph-select__label text-caption font-medium text-foreground"
85
88
  }, [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(label)) + " ", 1), (0, vue.unref)(required) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3, "*")) : (0, vue.createCommentVNode)("", true)], 8, _hoisted_2)) : (0, vue.createCommentVNode)("", true),
86
89
  (0, vue.createElementVNode)("div", {
87
90
  ref_key: "trigger",
@@ -118,18 +121,32 @@ var MorphSelectTrigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
118
121
  disabled: (0, vue.unref)(disabled),
119
122
  onKeydown: key,
120
123
  onClick: _cache[0] || (_cache[0] = ($event) => (0, vue.unref)(setOpen)(!(0, vue.unref)(open)))
121
- }), [(0, vue.createElementVNode)("span", {
122
- class: (0, vue.normalizeClass)(["modo-morph-select__value min-w-0 flex-1 truncate", selected.value ? "text-foreground" : "text-muted-foreground"]),
123
- "data-modo-placeholder": selected.value ? void 0 : ""
124
- }, [(0, vue.renderSlot)(_ctx.$slots, "default", { option: selected.value }, () => [(0, vue.createVNode)((0, vue.unref)(require_RenderContent.default), { content: selected.value?.label ?? __props.placeholder ?? (0, vue.unref)(loc).morphSelect.placeholder }, null, 8, ["content"])])], 10, _hoisted_6), (0, vue.createVNode)((0, vue.unref)(_heroicons_vue_24_outline.ChevronDownIcon), {
125
- class: (0, vue.normalizeClass)(["modo-morph-select__chevron", [
126
- "shrink-0 transition-transform duration-base ease-standard",
127
- affordanceIconClass.value,
128
- (0, vue.unref)(sz).icon,
129
- (0, vue.unref)(open) ? "rotate-180" : ""
130
- ]]),
131
- "aria-hidden": "true"
132
- }, null, 8, ["class"])], 16, _hoisted_5)], 10, _hoisted_4),
124
+ }), [
125
+ _ctx.$slots.icon || __props.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
126
+ key: 0,
127
+ class: (0, vue.normalizeClass)(["modo-morph-select__icon inline-flex shrink-0 items-center", affordanceIconClass.value]),
128
+ "aria-hidden": "true"
129
+ }, [(0, vue.renderSlot)(_ctx.$slots, "icon", {}, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon), { class: (0, vue.normalizeClass)((0, vue.unref)(sz).icon) }, null, 8, ["class"]))])], 2)) : (0, vue.createCommentVNode)("", true),
130
+ (0, vue.createElementVNode)("span", {
131
+ class: (0, vue.normalizeClass)(["modo-morph-select__value min-w-0 flex-1 truncate", hasValue.value ? "text-foreground" : "text-muted-foreground"]),
132
+ "data-modo-placeholder": hasValue.value ? void 0 : ""
133
+ }, [(0, vue.renderSlot)(_ctx.$slots, "default", {
134
+ option: selected.value,
135
+ options: (0, vue.unref)(selectedOptions)
136
+ }, () => [(0, vue.unref)(multiple) && hasValue.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(summary.value), 1)], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_RenderContent.default), {
137
+ key: 1,
138
+ content: selected.value?.label ?? __props.placeholder ?? (0, vue.unref)(loc).morphSelect.placeholder
139
+ }, null, 8, ["content"]))])], 10, _hoisted_6),
140
+ (0, vue.createVNode)((0, vue.unref)(_heroicons_vue_24_outline.ChevronDownIcon), {
141
+ class: (0, vue.normalizeClass)(["modo-morph-select__chevron", [
142
+ "shrink-0 transition-transform duration-base ease-standard",
143
+ affordanceIconClass.value,
144
+ (0, vue.unref)(sz).icon,
145
+ (0, vue.unref)(open) ? "rotate-180" : ""
146
+ ]]),
147
+ "aria-hidden": "true"
148
+ }, null, 8, ["class"])
149
+ ], 16, _hoisted_5)], 10, _hoisted_4),
133
150
  (0, vue.unref)(hasError) && (0, vue.unref)(errorText) ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_Typography.default, {
134
151
  key: 1,
135
152
  id: (0, vue.unref)(errorId),
@@ -1 +1 @@
1
- {"version":3,"file":"MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, value, options, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => options.value.find(option => option.value === value.value))\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', selected ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"selected ? undefined : ''\">\n <slot :option=\"selected\"><RenderContent :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" /></slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && 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</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EACd,MAAM,EACJ,SAAS,OAAO,SAAS,UAAU,UAAU,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,YAC1G,QAAQ,MAAM,MAAM,WAAW,SAAS,UAAU,aAAa,OAAO,MAAM,SAAS,QAAQ,YAC3F,2BAAA,gBAAe;EACnB,MAAM,MAAM,sBAAA,eAAc;EAC1B,MAAM,KAAK,sBAAA,oBAAoB,KAAK,MAAK;EACzC,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAAE,eAAe,MAAM;GAAS;GAAY;GAAU;GAAQ;GAAM,CAAA;EACrI,MAAM,uBAAA,GAAA,IAAA,gBAAqC,iBAAA,+BAA+B,WAAW,UAAU,wBAAuB;EAEtH,MAAM,UAAA,GAAA,IAAA,KAAa,MAAK;EACxB,IAAI;EACJ,CAAA,GAAA,IAAA,OAAM,QAAQ,MAAM,aAAa;GAC/B,IAAI,aAAa,aAAa,SAAS,UAAU;IAC/C,OAAO,QAAQ;IAAM,aAAa,YAAW;IAC7C,cAAc,iBAAiB;KAAE,OAAO,QAAQ;OAAS,IAAG;;IAE/D;EACD,CAAA,GAAA,IAAA,uBAAsB,aAAa,YAAY,CAAA;EAC/C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BAAqB,GAAE,CAAC;qBAAM,KAAI,GAAA,eAAA;MAAA,CAAA,CAAA;KAA3H,eAAY;;mBAGlD,SAAQ,KAAA,GAAA,IAAA,OAAI,UAAS,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAAkG,mBAAA,SAAA;;KAA/F,KAAA,GAAA,IAAA,OAAI,QAAO;KAAE,SAAQ;KAAU,MAAK;KAAS,OAAM;KAAS,IAAG;;qCAAmB,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAZ,UAAS,CAAA,EAAA,EAAA,CAAA,CAAA;;oCAClG,WAAU,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAAmG,mBAAA,SAAA;;KAAhG,KAAA,GAAA,IAAA,OAAI,SAAQ;KAAE,SAAQ;KAAU,MAAK;KAAS,OAAM;KAAQ,IAAG;;qCAAoB,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAb,WAAU,CAAA,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"MorphSelectTrigger.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs","$slots"],"sources":["../../../../src/components/forms/morph-select/MorphSelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onBeforeUnmount } from 'vue'\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline'\nimport type { MorphSelectTriggerProps } from '../../../interfaces/forms/MorphSelect.interface'\nimport { FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses } from '../../../composables/useField'\nimport { useModoLocale, useSizeTokens } from '../../../composables/useModoConfig'\nimport RenderContent from '../../../utils/RenderContent'\nimport Typography from '../../data-display/Typography.vue'\nimport { useMorphSelect } from './MorphSelectContext'\ndefineOptions({ inheritAttrs: false })\nconst props = withDefaults(defineProps<MorphSelectTriggerProps>(), { variant: 'outline' })\nconst {\n fieldId, multiple, selectedOptions, disabled, readonly, required, label, ariaLabel, helperText, errorText, hasError, stateColor,\n radius, size, halo, fullWidth, errorId, helperId, describedBy, phase, open, trigger, button, setOpen,\n} = useMorphSelect()\nconst loc = useModoLocale()\nconst sz = useSizeTokens(() => size.value)\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ variant: () => props.variant, stateColor, hasError, radius, halo })\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground')\n\nconst landed = ref(false)\nlet landedTimer: ReturnType<typeof setTimeout> | undefined\nwatch(phase, (next, previous) => {\n if (previous === 'closing' && next === 'closed') {\n landed.value = true; clearTimeout(landedTimer)\n landedTimer = setTimeout(() => { landed.value = false }, 500)\n }\n})\nonBeforeUnmount(() => clearTimeout(landedTimer))\nconst selected = computed(() => selectedOptions.value[0])\n// Multiple: the selected labels joined, in option order.\nconst summary = computed(() => selectedOptions.value.map(option => option.textValue ?? String(option.label)).join(', '))\nconst hasValue = computed(() => selectedOptions.value.length > 0)\nfunction key(event: KeyboardEvent) { if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { event.preventDefault(); setOpen(true) } }\n</script>\n<template>\n <div :class=\"['modo-morph-select flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\" data-modo-morph-select=\"\" :data-modo-size=\"size\" :data-modo-radius=\"radius\" :data-modo-variant=\"variant\">\n <label v-if=\"label\" :for=\"fieldId\" class=\"modo-morph-select__label text-caption font-medium text-foreground\">\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span>\n </label>\n <div ref=\"trigger\"\n :class=\"['modo-morph-select__field modo-field-wrapper', wrapperVariantClasses, radiusClasses, sz.control, disabled ? 'opacity-60 cursor-not-allowed' : '']\"\n :data-modo-morph-origin=\"phase === 'closed' ? (landed ? 'landed' : undefined) : phase === 'closing' ? 'closing' : 'hidden'\">\n <button :id=\"fieldId\" ref=\"button\" v-bind=\"$attrs\" type=\"button\" role=\"combobox\" aria-haspopup=\"listbox\"\n :class=\"['modo-morph-select__button flex h-full w-full items-center gap-2 text-left outline-none', sz.padX, sz.text, disabled ? 'cursor-not-allowed' : readonly ? 'cursor-default' : 'cursor-pointer']\"\n :aria-expanded=\"open\" :aria-controls=\"phase !== 'closed' ? `${fieldId}-listbox` : undefined\"\n :aria-label=\"!label ? ariaLabel : undefined\" :aria-describedby=\"describedBy\" :aria-invalid=\"hasError || undefined\"\n :aria-required=\"required || undefined\" :aria-readonly=\"readonly || undefined\" :disabled=\"disabled\" @keydown=\"key\" @click=\"setOpen(!open)\">\n <span v-if=\"$slots.icon || icon\" :class=\"['modo-morph-select__icon inline-flex shrink-0 items-center', affordanceIconClass]\" aria-hidden=\"true\">\n <slot name=\"icon\"><component :is=\"icon\" :class=\"sz.icon\" /></slot>\n </span>\n <span :class=\"['modo-morph-select__value min-w-0 flex-1 truncate', hasValue ? 'text-foreground' : 'text-muted-foreground']\" :data-modo-placeholder=\"hasValue ? undefined : ''\">\n <slot :option=\"selected\" :options=\"selectedOptions\">\n <template v-if=\"multiple && hasValue\">{{ summary }}</template>\n <RenderContent v-else :content=\"selected?.label ?? placeholder ?? loc.morphSelect.placeholder\" />\n </slot>\n </span>\n <ChevronDownIcon class=\"modo-morph-select__chevron\" aria-hidden=\"true\" :class=\"['shrink-0 transition-transform duration-base ease-standard', affordanceIconClass, sz.icon, open ? 'rotate-180' : '']\" />\n </button>\n </div>\n <Typography v-if=\"hasError && 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</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EACd,MAAM,EACJ,SAAS,UAAU,iBAAiB,UAAU,UAAU,UAAU,OAAO,WAAW,YAAY,WA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