mood-ui 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/data-display/table/Table.cjs +1 -1
- package/dist/components/data-display/table/Table.cjs.map +1 -1
- package/dist/components/data-display/table/Table.mjs +1 -1
- package/dist/components/data-display/table/Table.mjs.map +1 -1
- package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs +37 -1
- package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs +38 -2
- package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/table/TablePagination.cjs.map +1 -1
- package/dist/components/data-display/table/TablePagination.mjs.map +1 -1
- package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.cjs +24 -16
- package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.mjs +24 -16
- package/dist/components/data-display/table/TablePagination.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/EmptyState.cjs.map +1 -1
- package/dist/components/feedback/EmptyState.mjs.map +1 -1
- package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/feedback/EmptyState.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.cjs +369 -0
- package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.mjs +368 -0
- package/dist/components/feedback/tour/Tour.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/feedback/tour/Tour2.cjs +6 -0
- package/dist/components/feedback/tour/Tour2.cjs.map +1 -0
- package/dist/components/feedback/tour/Tour2.mjs +7 -0
- package/dist/components/feedback/tour/Tour2.mjs.map +1 -0
- package/dist/components/feedback/tour/TourCard.cjs +6 -0
- package/dist/components/feedback/tour/TourCard.cjs.map +1 -0
- package/dist/components/feedback/tour/TourCard.mjs +7 -0
- package/dist/components/feedback/tour/TourCard.mjs.map +1 -0
- package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.cjs +102 -0
- package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.mjs +101 -0
- package/dist/components/feedback/tour/TourCard.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/feedback/tour/tourAnchor.cjs +75 -0
- package/dist/components/feedback/tour/tourAnchor.cjs.map +1 -0
- package/dist/components/feedback/tour/tourAnchor.mjs +72 -0
- package/dist/components/feedback/tour/tourAnchor.mjs.map +1 -0
- package/dist/components/feedback/tour/tourPlace.cjs +108 -0
- package/dist/components/feedback/tour/tourPlace.cjs.map +1 -0
- package/dist/components/feedback/tour/tourPlace.mjs +107 -0
- package/dist/components/feedback/tour/tourPlace.mjs.map +1 -0
- package/dist/components/feedback/tour/tourShape.cjs +121 -0
- package/dist/components/feedback/tour/tourShape.cjs.map +1 -0
- package/dist/components/feedback/tour/tourShape.mjs +118 -0
- package/dist/components/feedback/tour/tourShape.mjs.map +1 -0
- package/dist/components/feedback/tour/useTourSpotlight.cjs +60 -0
- package/dist/components/feedback/tour/useTourSpotlight.cjs.map +1 -0
- package/dist/components/feedback/tour/useTourSpotlight.mjs +59 -0
- package/dist/components/feedback/tour/useTourSpotlight.mjs.map +1 -0
- package/dist/components/feedback/tour/useTourSteps.cjs +108 -0
- package/dist/components/feedback/tour/useTourSteps.cjs.map +1 -0
- package/dist/components/feedback/tour/useTourSteps.mjs +107 -0
- package/dist/components/feedback/tour/useTourSteps.mjs.map +1 -0
- package/dist/components/forms/Button.cjs +1 -1
- package/dist/components/forms/Button.cjs.map +1 -1
- package/dist/components/forms/Button.mjs +1 -1
- package/dist/components/forms/Button.mjs.map +1 -1
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/FileInput.cjs +1 -1
- package/dist/components/forms/FileInput.cjs.map +1 -1
- package/dist/components/forms/FileInput.mjs +1 -1
- package/dist/components/forms/FileInput.mjs.map +1 -1
- package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs +34 -17
- package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs +34 -17
- package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/MultiSelect.cjs +1 -1
- package/dist/components/forms/MultiSelect.cjs.map +1 -1
- package/dist/components/forms/MultiSelect.mjs +1 -1
- package/dist/components/forms/MultiSelect.mjs.map +1 -1
- package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs +2 -1
- package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs +2 -1
- package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/TagInput.cjs.map +1 -1
- package/dist/components/forms/TagInput.mjs.map +1 -1
- package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.mjs +1 -0
- package/dist/components/forms/TagInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Textarea.cjs.map +1 -1
- package/dist/components/forms/Textarea.mjs.map +1 -1
- package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/Canvas.cjs +1 -1
- package/dist/components/layout/Canvas.cjs.map +1 -1
- package/dist/components/layout/Canvas.mjs +1 -1
- package/dist/components/layout/Canvas.mjs.map +1 -1
- package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/layout/Canvas.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/PopoverPanel.cjs +1 -1
- package/dist/components/layout/PopoverPanel.cjs.map +1 -1
- package/dist/components/layout/PopoverPanel.mjs +1 -1
- package/dist/components/layout/PopoverPanel.mjs.map +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/popover/PopoverTrigger.cjs.map +1 -1
- package/dist/components/layout/popover/PopoverTrigger.mjs.map +1 -1
- package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/layout/popover/PopoverTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/navigation/DropdownMenu.cjs +1 -1
- package/dist/components/navigation/DropdownMenu.cjs.map +1 -1
- package/dist/components/navigation/DropdownMenu.mjs +1 -1
- package/dist/components/navigation/DropdownMenu.mjs.map +1 -1
- package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/navigation/DropdownMenu.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/navigation/Switcher.cjs.map +1 -1
- package/dist/components/navigation/Switcher.mjs.map +1 -1
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +77 -45
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +77 -45
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/navigation/menu/MenuTrigger.cjs.map +1 -1
- package/dist/components/navigation/menu/MenuTrigger.mjs.map +1 -1
- package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/navigation/menu/MenuTrigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/composables/useField.cjs +28 -8
- package/dist/composables/useField.cjs.map +1 -1
- package/dist/composables/useField.mjs +28 -8
- package/dist/composables/useField.mjs.map +1 -1
- package/dist/config/ModoLocale.cjs +10 -1
- package/dist/config/ModoLocale.cjs.map +1 -1
- package/dist/config/ModoLocale.mjs +10 -1
- package/dist/config/ModoLocale.mjs.map +1 -1
- package/dist/config/locales/es.cjs +10 -1
- package/dist/config/locales/es.cjs.map +1 -1
- package/dist/config/locales/es.mjs +10 -1
- package/dist/config/locales/es.mjs.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.mjs +3 -1
- package/dist/mood-ui.css +289 -103
- package/dist/types/components/data-display/surface-card/SurfaceCardBody.vue.d.ts +1 -1
- package/dist/types/components/data-display/surface-card/SurfaceCardFooter.vue.d.ts +1 -1
- package/dist/types/components/data-display/surface-card/SurfaceCardHeader.vue.d.ts +1 -1
- package/dist/types/components/feedback/dialog/DialogContent.vue.d.ts +1 -1
- package/dist/types/components/feedback/tour/Tour.vue.d.ts +31 -0
- package/dist/types/components/feedback/tour/TourCard.vue.d.ts +25 -0
- package/dist/types/components/feedback/tour/index.d.ts +2 -0
- package/dist/types/components/feedback/tour/tourAnchor.d.ts +12 -0
- package/dist/types/components/feedback/tour/tourPlace.d.ts +60 -0
- package/dist/types/components/feedback/tour/tourShape.d.ts +36 -0
- package/dist/types/components/feedback/tour/useTourSpotlight.d.ts +14 -0
- package/dist/types/components/feedback/tour/useTourSteps.d.ts +31 -0
- package/dist/types/components/layout/Canvas.vue.d.ts +1 -1
- package/dist/types/components/layout/popover/PopoverContent.vue.d.ts +1 -1
- package/dist/types/components/navigation/menu/MenuContent.vue.d.ts +1 -1
- package/dist/types/composables/useField.d.ts +23 -0
- package/dist/types/config/ModoLocale.d.ts +14 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interfaces/feedback/Tour.interface.d.ts +73 -0
- package/dist/types/interfaces/navigation/Switcher.interface.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagInput.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/forms/TagInput.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n </label>\n\n <div\n :class=\"[\n 'flex flex-wrap items-center gap-1.5 transition-shadow',\n wrapperVariantClasses,\n radiusClasses,\n paddingClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed pointer-events-none' : 'cursor-text',\n readonly ? 'pointer-events-none' : '',\n ]\"\n @click=\"focusInput\"\n >\n <span\n v-for=\"(tag, idx) in modelValue\"\n :key=\"`${tag}-${idx}`\"\n :class=\"[\n 'inline-flex items-center gap-1 font-medium whitespace-nowrap',\n chipSizeClasses,\n chipRadiusClasses,\n chipColorClasses,\n ]\"\n >\n {{ tag }}\n <button\n v-if=\"!readonly && !disabled\"\n type=\"button\"\n :aria-label=\"`Eliminar ${tag}`\"\n class=\"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-foreground/10 transition-colors\"\n @click.stop=\"removeTag(idx)\"\n >\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"w-3 h-3\">\n <path d=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\" />\n </svg>\n </button>\n </span>\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n v-model=\"draft\"\n type=\"text\"\n :placeholder=\"modelValue?.length ? '' : placeholder\"\n :aria-label=\"label ? undefined : (ariaLabel ?? 'Tags')\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :disabled=\"isDisabled || readonly || (max !== undefined && (modelValue?.length ?? 0) >= max)\"\n :class=\"[\n 'modo-field-native flex-1 min-w-[6rem] bg-transparent p-0 text-foreground placeholder:text-muted-foreground',\n inputSizeClasses,\n ]\"\n @keydown=\"onKeydown\"\n @blur=\"commitDraft\"\n @paste=\"onPaste\"\n />\n </div>\n\n <div v-if=\"errorText || helperText\" class=\"flex items-start\">\n <p\n v-if=\"errorText\"\n :id=\"errorId\"\n class=\"text-caption text-destructive\"\n >\n {{ errorText }}\n </p>\n <p\n v-else-if=\"helperText\"\n :id=\"helperId\"\n class=\"text-caption text-muted-foreground\"\n >\n {{ helperText }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport type { TagInput } from '../../interfaces/forms/TagInput.interface';\nimport { useResolvedColor, useSizeTokens } from '../../composables/useModoConfig';\nimport { useFieldState, useFieldClasses } from '../../composables/useField';\n\nconst props = withDefaults(defineProps<TagInput>(), {\n modelValue: () => [],\n placeholder: 'Añade un tag y pulsa Enter…',\n unique: true,\n delimiters: () => [','],\n color: 'default',\n variant: 'subtle',\n fieldVariant: 'outline',\n fullWidth: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [v: string[]];\n 'add': [tag: string];\n 'remove': [tag: string, index: number];\n 'change': [v: string[]];\n}>();\n\n/* ── Field system (same as Input / Select / Combobox) ── */\nconst { fieldId, radius, stateColor, hasError, isDisabled, errorId, helperId, describedBy } =\n useFieldState(props, { componentName: 'TagInput', idPrefix: 'modo-tag-input' });\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.fieldVariant ?? 'outline',\n stateColor,\n hasError,\n radius,\n halo: () => props.halo,\n});\n\n/* ── Chip color (separate from field state color) ── */\nconst sz = useSizeTokens(() => props.size);\nconst resolvedColor = useResolvedColor(() => props.color);\n\n/* ── Input state ── */\nconst draft = ref('');\nconst inputEl = ref<HTMLInputElement | null>(null);\n\nfunction focusInput() {\n inputEl.value?.focus();\n}\n\nfunction addTag(raw: string) {\n const tag = raw.trim();\n if (!tag) return;\n if (props.max !== undefined && (props.modelValue?.length ?? 0) >= props.max) return;\n if (props.unique && props.modelValue?.some((t) => t.toLowerCase() === tag.toLowerCase())) return;\n if (props.validator && !props.validator(tag)) return;\n const next = [...(props.modelValue ?? []), tag];\n emit('update:modelValue', next);\n emit('add', tag);\n emit('change', next);\n}\n\nfunction removeTag(idx: number) {\n const tag = props.modelValue?.[idx];\n if (tag === undefined) return;\n const next = [...(props.modelValue ?? [])];\n next.splice(idx, 1);\n emit('update:modelValue', next);\n emit('remove', tag, idx);\n emit('change', next);\n}\n\nfunction commitDraft() {\n if (draft.value.trim()) {\n addTag(draft.value);\n draft.value = '';\n }\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n e.preventDefault();\n commitDraft();\n } else if ((e.key === 'Backspace') && draft.value === '' && (props.modelValue?.length ?? 0) > 0) {\n removeTag(props.modelValue!.length - 1);\n } else if (props.delimiters?.includes(e.key)) {\n e.preventDefault();\n commitDraft();\n }\n}\n\nfunction onPaste(e: ClipboardEvent) {\n const text = e.clipboardData?.getData('text');\n if (!text) return;\n const parts = text.split(/[,\\n\\t]/).map((p) => p.trim()).filter(Boolean);\n if (parts.length > 1) {\n e.preventDefault();\n for (const p of parts) addTag(p);\n draft.value = '';\n }\n}\n\n/* ── Size classes ── */\nconst paddingClasses = computed(() => {\n const minH = sz.value.control.replace('h-', 'min-h-');\n const pad = sz.value.control === 'h-12' ? 'p-2.5' : sz.value.control === 'h-8' ? 'p-1.5' : 'p-2';\n return `${pad} ${minH}`;\n});\n\nconst inputSizeClasses = computed(() => {\n switch (sz.value.control) {\n case 'h-8': return 'text-xs h-5';\n case 'h-12': return 'text-base h-7';\n default: return 'text-sm h-6';\n }\n});\n\nconst chipSizeClasses = computed(() => {\n const h = sz.value.label;\n const t = sz.value.text;\n switch (sz.value.control) {\n case 'h-8': return `${h} px-2 ${t}`;\n case 'h-12': return `${h} px-3 ${t}`;\n default: return `${h} px-2.5 ${t}`;\n }\n});\n\nconst chipRadiusClasses = computed(() => {\n switch (radius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded';\n case 'large': return 'rounded-lg';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-md';\n }\n});\n\nconst chipColorClasses = computed(() => {\n const c = resolvedColor.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n subtle: 'bg-muted text-foreground',\n outline: 'border border-border text-foreground',\n solid: 'bg-foreground text-background',\n },\n primary: {\n subtle: 'bg-primary/12 text-primary',\n outline: 'border border-primary/40 text-primary',\n solid: 'bg-primary text-primary-foreground',\n },\n danger: {\n subtle: 'bg-destructive/10 text-destructive',\n outline: 'border border-destructive/40 text-destructive',\n solid: 'bg-destructive text-destructive-foreground',\n },\n success: {\n subtle: 'bg-success/10 text-success',\n outline: 'border border-success/40 text-success',\n solid: 'bg-success text-success-foreground',\n },\n warning: {\n subtle: 'bg-warning/10 text-warning',\n outline: 'border border-warning/40 text-warning',\n solid: 'bg-warning text-warning-foreground',\n },\n };\n return map[c]?.[props.variant] ?? map.default.subtle;\n});\n</script>\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAQb,MAAM,EAAE,SAAS,QAAQ,YAAY,UAAU,YAAY,SAAS,UAAU,gBAC1E,iBAAA,cAAc,OAAO;GAAE,eAAe;GAAY,UAAU;GAAkB,CAAC;EAEnF,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAC7D,eAAe,MAAM,gBAAgB;GACrC;GACA;GACA;GACA,YAAY,MAAM;GACrB,CAAC;EAGF,MAAM,KAAK,sBAAA,oBAAoB,MAAM,KAAK;EAC1C,MAAM,gBAAgB,sBAAA,uBAAuB,MAAM,MAAM;EAGzD,MAAM,SAAA,GAAA,IAAA,KAAY,GAAG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A,GAAA,WAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,EAAA,EAAA;mEAsBhM,SAAA;KAhBG,KAAA,GAAA,IAAA,OAAI,QAAO;cACR;KAAJ,KAAI;wEACU,QAAA;KACd,MAAK;KACJ,aAAa,QAAA,YAAY,SAAM,KAAQ,QAAA;KACvC,cAAY,QAAA,QAAQ,KAAA,IAAa,QAAA,aAAS;KAC1C,iBAAA,GAAA,IAAA,OAAc,SAAQ,IAAI,KAAA;KAC1B,qBAAA,GAAA,IAAA,OAAkB,YAAW;KAC7B,WAAA,GAAA,IAAA,OAAU,WAAU,IAAI,QAAA,YAAa,QAAA,QAAQ,KAAA,MAAc,QAAA,YAAY,UAAM,MAAU,QAAA;KACvF,QAAA,GAAA,IAAA,gBAAK,CAAA,8GAA0J,iBAAA,MAAA,CAAA;KAItJ;KACT,QAAM;KACC;gDAbC,MAAA,MAAK,CAAA,CAAA,CAAA,EAAA,EAAA;IAiBX,QAAA,aAAa,QAAA,eAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAelB,OAfN,YAeM,CAbQ,QAAA,cAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAKN,KAAA;;KAJC,KAAA,GAAA,IAAA,OAAI,QAAO;KACZ,OAAM;gCAEH,QAAA,UAAS,EAAA,GAAA,WAAA,IAGD,QAAA,eAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAKX,KAAA;;KAJC,KAAA,GAAA,IAAA,OAAI,SAAQ;KACb,OAAM;gCAEH,QAAA,WAAU,EAAA,GAAA,WAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"TagInput.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/forms/TagInput.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n </label>\n\n <div\n :class=\"[\n 'flex flex-wrap items-center gap-1.5 transition-shadow',\n wrapperVariantClasses,\n radiusClasses,\n paddingClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed pointer-events-none' : 'cursor-text',\n readonly ? 'pointer-events-none' : '',\n ]\"\n @click=\"focusInput\"\n >\n <span\n v-for=\"(tag, idx) in modelValue\"\n :key=\"`${tag}-${idx}`\"\n :class=\"[\n 'inline-flex items-center gap-1 font-medium whitespace-nowrap',\n chipSizeClasses,\n chipRadiusClasses,\n chipColorClasses,\n ]\"\n >\n {{ tag }}\n <button\n v-if=\"!readonly && !disabled\"\n type=\"button\"\n :aria-label=\"`Eliminar ${tag}`\"\n class=\"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-foreground/10 transition-colors\"\n @click.stop=\"removeTag(idx)\"\n >\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"w-3 h-3\">\n <path d=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\" />\n </svg>\n </button>\n </span>\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n v-model=\"draft\"\n type=\"text\"\n :placeholder=\"modelValue?.length ? '' : placeholder\"\n :aria-label=\"label ? undefined : (ariaLabel ?? 'Tags')\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :disabled=\"isDisabled || readonly || (max !== undefined && (modelValue?.length ?? 0) >= max)\"\n :class=\"[\n 'modo-field-native flex-1 min-w-[6rem] bg-transparent p-0 text-foreground placeholder:text-muted-foreground',\n inputSizeClasses,\n ]\"\n @keydown=\"onKeydown\"\n @blur=\"commitDraft\"\n @paste=\"onPaste\"\n />\n </div>\n\n <div v-if=\"errorText || helperText\" class=\"flex items-start\">\n <p\n v-if=\"errorText\"\n :id=\"errorId\"\n class=\"text-caption text-destructive\"\n >\n {{ errorText }}\n </p>\n <p\n v-else-if=\"helperText\"\n :id=\"helperId\"\n class=\"text-caption text-muted-foreground\"\n >\n {{ helperText }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport type { TagInput } from '../../interfaces/forms/TagInput.interface';\nimport { useResolvedColor, useSizeTokens } from '../../composables/useModoConfig';\nimport { useFieldState, useFieldClasses } from '../../composables/useField';\n\nconst props = withDefaults(defineProps<TagInput>(), {\n modelValue: () => [],\n placeholder: 'Añade un tag y pulsa Enter…',\n unique: true,\n delimiters: () => [','],\n color: 'default',\n variant: 'subtle',\n fieldVariant: 'outline',\n fullWidth: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [v: string[]];\n 'add': [tag: string];\n 'remove': [tag: string, index: number];\n 'change': [v: string[]];\n}>();\n\n/* ── Field system (same as Input / Select / Combobox) ── */\nconst { fieldId, radius, stateColor, hasError, isDisabled, errorId, helperId, describedBy } =\n useFieldState(props, { componentName: 'TagInput', idPrefix: 'modo-tag-input' });\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.fieldVariant ?? 'outline',\n stateColor,\n hasError,\n radius,\n radiusKind: 'grow',\n halo: () => props.halo,\n});\n\n/* ── Chip color (separate from field state color) ── */\nconst sz = useSizeTokens(() => props.size);\nconst resolvedColor = useResolvedColor(() => props.color);\n\n/* ── Input state ── */\nconst draft = ref('');\nconst inputEl = ref<HTMLInputElement | null>(null);\n\nfunction focusInput() {\n inputEl.value?.focus();\n}\n\nfunction addTag(raw: string) {\n const tag = raw.trim();\n if (!tag) return;\n if (props.max !== undefined && (props.modelValue?.length ?? 0) >= props.max) return;\n if (props.unique && props.modelValue?.some((t) => t.toLowerCase() === tag.toLowerCase())) return;\n if (props.validator && !props.validator(tag)) return;\n const next = [...(props.modelValue ?? []), tag];\n emit('update:modelValue', next);\n emit('add', tag);\n emit('change', next);\n}\n\nfunction removeTag(idx: number) {\n const tag = props.modelValue?.[idx];\n if (tag === undefined) return;\n const next = [...(props.modelValue ?? [])];\n next.splice(idx, 1);\n emit('update:modelValue', next);\n emit('remove', tag, idx);\n emit('change', next);\n}\n\nfunction commitDraft() {\n if (draft.value.trim()) {\n addTag(draft.value);\n draft.value = '';\n }\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n e.preventDefault();\n commitDraft();\n } else if ((e.key === 'Backspace') && draft.value === '' && (props.modelValue?.length ?? 0) > 0) {\n removeTag(props.modelValue!.length - 1);\n } else if (props.delimiters?.includes(e.key)) {\n e.preventDefault();\n commitDraft();\n }\n}\n\nfunction onPaste(e: ClipboardEvent) {\n const text = e.clipboardData?.getData('text');\n if (!text) return;\n const parts = text.split(/[,\\n\\t]/).map((p) => p.trim()).filter(Boolean);\n if (parts.length > 1) {\n e.preventDefault();\n for (const p of parts) addTag(p);\n draft.value = '';\n }\n}\n\n/* ── Size classes ── */\nconst paddingClasses = computed(() => {\n const minH = sz.value.control.replace('h-', 'min-h-');\n const pad = sz.value.control === 'h-12' ? 'p-2.5' : sz.value.control === 'h-8' ? 'p-1.5' : 'p-2';\n return `${pad} ${minH}`;\n});\n\nconst inputSizeClasses = computed(() => {\n switch (sz.value.control) {\n case 'h-8': return 'text-xs h-5';\n case 'h-12': return 'text-base h-7';\n default: return 'text-sm h-6';\n }\n});\n\nconst chipSizeClasses = computed(() => {\n const h = sz.value.label;\n const t = sz.value.text;\n switch (sz.value.control) {\n case 'h-8': return `${h} px-2 ${t}`;\n case 'h-12': return `${h} px-3 ${t}`;\n default: return `${h} px-2.5 ${t}`;\n }\n});\n\nconst chipRadiusClasses = computed(() => {\n switch (radius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded';\n case 'large': return 'rounded-lg';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-md';\n }\n});\n\nconst chipColorClasses = computed(() => {\n const c = resolvedColor.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n subtle: 'bg-muted text-foreground',\n outline: 'border border-border text-foreground',\n solid: 'bg-foreground text-background',\n },\n primary: {\n subtle: 'bg-primary/12 text-primary',\n outline: 'border border-primary/40 text-primary',\n solid: 'bg-primary text-primary-foreground',\n },\n danger: {\n subtle: 'bg-destructive/10 text-destructive',\n outline: 'border border-destructive/40 text-destructive',\n solid: 'bg-destructive text-destructive-foreground',\n },\n success: {\n subtle: 'bg-success/10 text-success',\n outline: 'border border-success/40 text-success',\n solid: 'bg-success text-success-foreground',\n },\n warning: {\n subtle: 'bg-warning/10 text-warning',\n outline: 'border border-warning/40 text-warning',\n solid: 'bg-warning text-warning-foreground',\n },\n };\n return map[c]?.[props.variant] ?? map.default.subtle;\n});\n</script>\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAQb,MAAM,EAAE,SAAS,QAAQ,YAAY,UAAU,YAAY,SAAS,UAAU,gBAC1E,iBAAA,cAAc,OAAO;GAAE,eAAe;GAAY,UAAU;GAAkB,CAAC;EAEnF,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAC7D,eAAe,MAAM,gBAAgB;GACrC;GACA;GACA;GACA,YAAY;GACZ,YAAY,MAAM;GACrB,CAAC;EAGF,MAAM,KAAK,sBAAA,oBAAoB,MAAM,KAAK;EAC1C,MAAM,gBAAgB,sBAAA,uBAAuB,MAAM,MAAM;EAGzD,MAAM,SAAA,GAAA,IAAA,KAAY,GAAG;EACrB,MAAM,WAAA,GAAA,IAAA,KAAuC,KAAK;EAElD,SAAS,aAAa;GAClB,QAAQ,OAAO,OAAO;;EAG1B,SAAS,OAAO,KAAa;GACzB,MAAM,MAAM,IA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KAAI;wEACU,QAAA;KACd,MAAK;KACJ,aAAa,QAAA,YAAY,SAAM,KAAQ,QAAA;KACvC,cAAY,QAAA,QAAQ,KAAA,IAAa,QAAA,aAAS;KAC1C,iBAAA,GAAA,IAAA,OAAc,SAAQ,IAAI,KAAA;KAC1B,qBAAA,GAAA,IAAA,OAAkB,YAAW;KAC7B,WAAA,GAAA,IAAA,OAAU,WAAU,IAAI,QAAA,YAAa,QAAA,QAAQ,KAAA,MAAc,QAAA,YAAY,UAAM,MAAU,QAAA;KACvF,QAAA,GAAA,IAAA,gBAAK,CAAA,8GAA0J,iBAAA,MAAA,CAAA;KAItJ;KACT,QAAM;KACC;gDAbC,MAAA,MAAK,CAAA,CAAA,CAAA,EAAA,EAAA;IAiBX,QAAA,aAAa,QAAA,eAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAelB,OAfN,YAeM,CAbQ,QAAA,cAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAKN,KAAA;;KAJC,KAAA,GAAA,IAAA,OAAI,QAAO;KACZ,OAAM;gCAEH,QAAA,UAAS,EAAA,GAAA,WAAA,IAGD,QAAA,eAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAKX,KAAA;;KAJC,KAAA,GAAA,IAAA,OAAI,SAAQ;KACb,OAAM;gCAEH,QAAA,WAAU,EAAA,GAAA,WAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagInput.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/TagInput.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n </label>\n\n <div\n :class=\"[\n 'flex flex-wrap items-center gap-1.5 transition-shadow',\n wrapperVariantClasses,\n radiusClasses,\n paddingClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed pointer-events-none' : 'cursor-text',\n readonly ? 'pointer-events-none' : '',\n ]\"\n @click=\"focusInput\"\n >\n <span\n v-for=\"(tag, idx) in modelValue\"\n :key=\"`${tag}-${idx}`\"\n :class=\"[\n 'inline-flex items-center gap-1 font-medium whitespace-nowrap',\n chipSizeClasses,\n chipRadiusClasses,\n chipColorClasses,\n ]\"\n >\n {{ tag }}\n <button\n v-if=\"!readonly && !disabled\"\n type=\"button\"\n :aria-label=\"`Eliminar ${tag}`\"\n class=\"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-foreground/10 transition-colors\"\n @click.stop=\"removeTag(idx)\"\n >\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"w-3 h-3\">\n <path d=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\" />\n </svg>\n </button>\n </span>\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n v-model=\"draft\"\n type=\"text\"\n :placeholder=\"modelValue?.length ? '' : placeholder\"\n :aria-label=\"label ? undefined : (ariaLabel ?? 'Tags')\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :disabled=\"isDisabled || readonly || (max !== undefined && (modelValue?.length ?? 0) >= max)\"\n :class=\"[\n 'modo-field-native flex-1 min-w-[6rem] bg-transparent p-0 text-foreground placeholder:text-muted-foreground',\n inputSizeClasses,\n ]\"\n @keydown=\"onKeydown\"\n @blur=\"commitDraft\"\n @paste=\"onPaste\"\n />\n </div>\n\n <div v-if=\"errorText || helperText\" class=\"flex items-start\">\n <p\n v-if=\"errorText\"\n :id=\"errorId\"\n class=\"text-caption text-destructive\"\n >\n {{ errorText }}\n </p>\n <p\n v-else-if=\"helperText\"\n :id=\"helperId\"\n class=\"text-caption text-muted-foreground\"\n >\n {{ helperText }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport type { TagInput } from '../../interfaces/forms/TagInput.interface';\nimport { useResolvedColor, useSizeTokens } from '../../composables/useModoConfig';\nimport { useFieldState, useFieldClasses } from '../../composables/useField';\n\nconst props = withDefaults(defineProps<TagInput>(), {\n modelValue: () => [],\n placeholder: 'Añade un tag y pulsa Enter…',\n unique: true,\n delimiters: () => [','],\n color: 'default',\n variant: 'subtle',\n fieldVariant: 'outline',\n fullWidth: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [v: string[]];\n 'add': [tag: string];\n 'remove': [tag: string, index: number];\n 'change': [v: string[]];\n}>();\n\n/* ── Field system (same as Input / Select / Combobox) ── */\nconst { fieldId, radius, stateColor, hasError, isDisabled, errorId, helperId, describedBy } =\n useFieldState(props, { componentName: 'TagInput', idPrefix: 'modo-tag-input' });\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.fieldVariant ?? 'outline',\n stateColor,\n hasError,\n radius,\n halo: () => props.halo,\n});\n\n/* ── Chip color (separate from field state color) ── */\nconst sz = useSizeTokens(() => props.size);\nconst resolvedColor = useResolvedColor(() => props.color);\n\n/* ── Input state ── */\nconst draft = ref('');\nconst inputEl = ref<HTMLInputElement | null>(null);\n\nfunction focusInput() {\n inputEl.value?.focus();\n}\n\nfunction addTag(raw: string) {\n const tag = raw.trim();\n if (!tag) return;\n if (props.max !== undefined && (props.modelValue?.length ?? 0) >= props.max) return;\n if (props.unique && props.modelValue?.some((t) => t.toLowerCase() === tag.toLowerCase())) return;\n if (props.validator && !props.validator(tag)) return;\n const next = [...(props.modelValue ?? []), tag];\n emit('update:modelValue', next);\n emit('add', tag);\n emit('change', next);\n}\n\nfunction removeTag(idx: number) {\n const tag = props.modelValue?.[idx];\n if (tag === undefined) return;\n const next = [...(props.modelValue ?? [])];\n next.splice(idx, 1);\n emit('update:modelValue', next);\n emit('remove', tag, idx);\n emit('change', next);\n}\n\nfunction commitDraft() {\n if (draft.value.trim()) {\n addTag(draft.value);\n draft.value = '';\n }\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n e.preventDefault();\n commitDraft();\n } else if ((e.key === 'Backspace') && draft.value === '' && (props.modelValue?.length ?? 0) > 0) {\n removeTag(props.modelValue!.length - 1);\n } else if (props.delimiters?.includes(e.key)) {\n e.preventDefault();\n commitDraft();\n }\n}\n\nfunction onPaste(e: ClipboardEvent) {\n const text = e.clipboardData?.getData('text');\n if (!text) return;\n const parts = text.split(/[,\\n\\t]/).map((p) => p.trim()).filter(Boolean);\n if (parts.length > 1) {\n e.preventDefault();\n for (const p of parts) addTag(p);\n draft.value = '';\n }\n}\n\n/* ── Size classes ── */\nconst paddingClasses = computed(() => {\n const minH = sz.value.control.replace('h-', 'min-h-');\n const pad = sz.value.control === 'h-12' ? 'p-2.5' : sz.value.control === 'h-8' ? 'p-1.5' : 'p-2';\n return `${pad} ${minH}`;\n});\n\nconst inputSizeClasses = computed(() => {\n switch (sz.value.control) {\n case 'h-8': return 'text-xs h-5';\n case 'h-12': return 'text-base h-7';\n default: return 'text-sm h-6';\n }\n});\n\nconst chipSizeClasses = computed(() => {\n const h = sz.value.label;\n const t = sz.value.text;\n switch (sz.value.control) {\n case 'h-8': return `${h} px-2 ${t}`;\n case 'h-12': return `${h} px-3 ${t}`;\n default: return `${h} px-2.5 ${t}`;\n }\n});\n\nconst chipRadiusClasses = computed(() => {\n switch (radius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded';\n case 'large': return 'rounded-lg';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-md';\n }\n});\n\nconst chipColorClasses = computed(() => {\n const c = resolvedColor.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n subtle: 'bg-muted text-foreground',\n outline: 'border border-border text-foreground',\n solid: 'bg-foreground text-background',\n },\n primary: {\n subtle: 'bg-primary/12 text-primary',\n outline: 'border border-primary/40 text-primary',\n solid: 'bg-primary text-primary-foreground',\n },\n danger: {\n subtle: 'bg-destructive/10 text-destructive',\n outline: 'border border-destructive/40 text-destructive',\n solid: 'bg-destructive text-destructive-foreground',\n },\n success: {\n subtle: 'bg-success/10 text-success',\n outline: 'border border-success/40 text-success',\n solid: 'bg-success text-success-foreground',\n },\n warning: {\n subtle: 'bg-warning/10 text-warning',\n outline: 'border border-warning/40 text-warning',\n solid: 'bg-warning text-warning-foreground',\n },\n };\n return map[c]?.[props.variant] ?? map.default.subtle;\n});\n</script>\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAQb,MAAM,EAAE,SAAS,QAAQ,YAAY,UAAU,YAAY,SAAS,UAAU,gBAC1E,cAAc,OAAO;GAAE,eAAe;GAAY,UAAU;GAAkB,CAAC;EAEnF,MAAM,EAAE,uBAAuB,kBAAkB,gBAAgB;GAC7D,eAAe,MAAM,gBAAgB;GACrC;GACA;GACA;GACA,YAAY,MAAM;GACrB,CAAC;EAGF,MAAM,KAAK,oBAAoB,MAAM,KAAK;EAC1C,MAAM,gBAAgB,uBAAuB,MAAM,MAAM;EAGzD,MAAM,QAAQ,IAAI,GAAG;EACrB,MAAM,UAAU,IAA6B,KAAK;EAElD,SAAS,aAAa;GAClB,QAAQ,OAAO,OAAO;;EAG1B,SAAS,OAAO,KAAa;GACzB,MAAM,MAAM,IAAI,MAAM;GACtB,IAAI,CAAC,KAAK;GACV,IAAI,MAAM,QAAQ,KAAA,MAAc,MAAM,YAAY,UAAU,MAAM,MAAM,KAAK;GAC7E,IAAI,MAAM,UAAU,MAAM,YAAY,MAAM,MAAM,EAAE,aAAa,KAAK,IAAI,aAAa,CAAC,EA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4CAbC,MAAA,MAAK,CAAA,CAAA,CAAA,EAAA,EAAA;IAiBX,QAAA,aAAa,QAAA,cAAA,WAAA,EAAxB,mBAeM,OAfN,YAeM,CAbQ,QAAA,aAAA,WAAA,EADV,mBAMI,KAAA;;KAJC,IAAI,MAAA,QAAO;KACZ,OAAM;uBAEH,QAAA,UAAS,EAAA,GAAA,WAAA,IAGD,QAAA,cAAA,WAAA,EADf,mBAMI,KAAA;;KAJC,IAAI,MAAA,SAAQ;KACb,OAAM;uBAEH,QAAA,WAAU,EAAA,GAAA,WAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"TagInput.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/TagInput.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n </label>\n\n <div\n :class=\"[\n 'flex flex-wrap items-center gap-1.5 transition-shadow',\n wrapperVariantClasses,\n radiusClasses,\n paddingClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed pointer-events-none' : 'cursor-text',\n readonly ? 'pointer-events-none' : '',\n ]\"\n @click=\"focusInput\"\n >\n <span\n v-for=\"(tag, idx) in modelValue\"\n :key=\"`${tag}-${idx}`\"\n :class=\"[\n 'inline-flex items-center gap-1 font-medium whitespace-nowrap',\n chipSizeClasses,\n chipRadiusClasses,\n chipColorClasses,\n ]\"\n >\n {{ tag }}\n <button\n v-if=\"!readonly && !disabled\"\n type=\"button\"\n :aria-label=\"`Eliminar ${tag}`\"\n class=\"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-foreground/10 transition-colors\"\n @click.stop=\"removeTag(idx)\"\n >\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"w-3 h-3\">\n <path d=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\" />\n </svg>\n </button>\n </span>\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n v-model=\"draft\"\n type=\"text\"\n :placeholder=\"modelValue?.length ? '' : placeholder\"\n :aria-label=\"label ? undefined : (ariaLabel ?? 'Tags')\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :disabled=\"isDisabled || readonly || (max !== undefined && (modelValue?.length ?? 0) >= max)\"\n :class=\"[\n 'modo-field-native flex-1 min-w-[6rem] bg-transparent p-0 text-foreground placeholder:text-muted-foreground',\n inputSizeClasses,\n ]\"\n @keydown=\"onKeydown\"\n @blur=\"commitDraft\"\n @paste=\"onPaste\"\n />\n </div>\n\n <div v-if=\"errorText || helperText\" class=\"flex items-start\">\n <p\n v-if=\"errorText\"\n :id=\"errorId\"\n class=\"text-caption text-destructive\"\n >\n {{ errorText }}\n </p>\n <p\n v-else-if=\"helperText\"\n :id=\"helperId\"\n class=\"text-caption text-muted-foreground\"\n >\n {{ helperText }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport type { TagInput } from '../../interfaces/forms/TagInput.interface';\nimport { useResolvedColor, useSizeTokens } from '../../composables/useModoConfig';\nimport { useFieldState, useFieldClasses } from '../../composables/useField';\n\nconst props = withDefaults(defineProps<TagInput>(), {\n modelValue: () => [],\n placeholder: 'Añade un tag y pulsa Enter…',\n unique: true,\n delimiters: () => [','],\n color: 'default',\n variant: 'subtle',\n fieldVariant: 'outline',\n fullWidth: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [v: string[]];\n 'add': [tag: string];\n 'remove': [tag: string, index: number];\n 'change': [v: string[]];\n}>();\n\n/* ── Field system (same as Input / Select / Combobox) ── */\nconst { fieldId, radius, stateColor, hasError, isDisabled, errorId, helperId, describedBy } =\n useFieldState(props, { componentName: 'TagInput', idPrefix: 'modo-tag-input' });\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.fieldVariant ?? 'outline',\n stateColor,\n hasError,\n radius,\n radiusKind: 'grow',\n halo: () => props.halo,\n});\n\n/* ── Chip color (separate from field state color) ── */\nconst sz = useSizeTokens(() => props.size);\nconst resolvedColor = useResolvedColor(() => props.color);\n\n/* ── Input state ── */\nconst draft = ref('');\nconst inputEl = ref<HTMLInputElement | null>(null);\n\nfunction focusInput() {\n inputEl.value?.focus();\n}\n\nfunction addTag(raw: string) {\n const tag = raw.trim();\n if (!tag) return;\n if (props.max !== undefined && (props.modelValue?.length ?? 0) >= props.max) return;\n if (props.unique && props.modelValue?.some((t) => t.toLowerCase() === tag.toLowerCase())) return;\n if (props.validator && !props.validator(tag)) return;\n const next = [...(props.modelValue ?? []), tag];\n emit('update:modelValue', next);\n emit('add', tag);\n emit('change', next);\n}\n\nfunction removeTag(idx: number) {\n const tag = props.modelValue?.[idx];\n if (tag === undefined) return;\n const next = [...(props.modelValue ?? [])];\n next.splice(idx, 1);\n emit('update:modelValue', next);\n emit('remove', tag, idx);\n emit('change', next);\n}\n\nfunction commitDraft() {\n if (draft.value.trim()) {\n addTag(draft.value);\n draft.value = '';\n }\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n e.preventDefault();\n commitDraft();\n } else if ((e.key === 'Backspace') && draft.value === '' && (props.modelValue?.length ?? 0) > 0) {\n removeTag(props.modelValue!.length - 1);\n } else if (props.delimiters?.includes(e.key)) {\n e.preventDefault();\n commitDraft();\n }\n}\n\nfunction onPaste(e: ClipboardEvent) {\n const text = e.clipboardData?.getData('text');\n if (!text) return;\n const parts = text.split(/[,\\n\\t]/).map((p) => p.trim()).filter(Boolean);\n if (parts.length > 1) {\n e.preventDefault();\n for (const p of parts) addTag(p);\n draft.value = '';\n }\n}\n\n/* ── Size classes ── */\nconst paddingClasses = computed(() => {\n const minH = sz.value.control.replace('h-', 'min-h-');\n const pad = sz.value.control === 'h-12' ? 'p-2.5' : sz.value.control === 'h-8' ? 'p-1.5' : 'p-2';\n return `${pad} ${minH}`;\n});\n\nconst inputSizeClasses = computed(() => {\n switch (sz.value.control) {\n case 'h-8': return 'text-xs h-5';\n case 'h-12': return 'text-base h-7';\n default: return 'text-sm h-6';\n }\n});\n\nconst chipSizeClasses = computed(() => {\n const h = sz.value.label;\n const t = sz.value.text;\n switch (sz.value.control) {\n case 'h-8': return `${h} px-2 ${t}`;\n case 'h-12': return `${h} px-3 ${t}`;\n default: return `${h} px-2.5 ${t}`;\n }\n});\n\nconst chipRadiusClasses = computed(() => {\n switch (radius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded';\n case 'large': return 'rounded-lg';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-md';\n }\n});\n\nconst chipColorClasses = computed(() => {\n const c = resolvedColor.value;\n const map: Record<string, Record<string, string>> = {\n default: {\n subtle: 'bg-muted text-foreground',\n outline: 'border border-border text-foreground',\n solid: 'bg-foreground text-background',\n },\n primary: {\n subtle: 'bg-primary/12 text-primary',\n outline: 'border border-primary/40 text-primary',\n solid: 'bg-primary text-primary-foreground',\n },\n danger: {\n subtle: 'bg-destructive/10 text-destructive',\n outline: 'border border-destructive/40 text-destructive',\n solid: 'bg-destructive text-destructive-foreground',\n },\n success: {\n subtle: 'bg-success/10 text-success',\n outline: 'border border-success/40 text-success',\n solid: 'bg-success text-success-foreground',\n },\n warning: {\n subtle: 'bg-warning/10 text-warning',\n outline: 'border border-warning/40 text-warning',\n solid: 'bg-warning text-warning-foreground',\n },\n };\n return map[c]?.[props.variant] ?? map.default.subtle;\n});\n</script>\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,MA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"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n
|
|
1
|
+
{"version":3,"file":"Textarea.cjs","names":[],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n radiusKind: 'surface', \n halo: () => props.halo, \n}); \n \n/** Horizontal padding from tokens; vertical padding stays size-stepped. */\nconst wrapperPaddingClasses = computed(() => {\n const pyByControl: Record<string, string> = {\n 'h-8': 'py-1', 'h-9': 'py-1.5', 'h-10': 'py-2', 'h-12': 'py-3',\n };\n const py = pyByControl[sz.value.control] ?? 'py-2';\n return `${sz.value.padX} ${py}`;\n});\n\n/** Min-height mirrors the control scale (h-8/h-9/h-10/h-12 → min-h-8/9/10/12). */\nconst wrapperMinHeightClass = computed(() => sz.value.control.replace('h-', 'min-h-'));\n\nconst textareaTextClasses = computed(() => `${sz.value.text} leading-relaxed`); \n \nconst resizeClass = computed(() => { \n if (props.autoresize) return 'resize-none'; \n switch (props.resize) { \n case 'none': return 'resize-none'; \n case 'horizontal': return 'resize-x'; \n case 'both': return 'resize'; \n case 'vertical': \n default: return 'resize-y'; \n } \n}); \n \nfunction adjustHeight() { \n if (!props.autoresize) return; \n const el = textareaRef.value; \n if (!el) return; \n \n el.style.height = 'auto'; \n \n const styles = window.getComputedStyle(el); \n const lineHeight = parseFloat(styles.lineHeight) || 20; \n const paddingTop = parseFloat(styles.paddingTop) || 0; \n const paddingBottom = parseFloat(styles.paddingBottom) || 0; \n const borderTop = parseFloat(styles.borderTopWidth) || 0; \n const borderBottom = parseFloat(styles.borderBottomWidth) || 0; \n \n const maxHeight = \n lineHeight * props.maxRows + paddingTop + paddingBottom + borderTop + borderBottom; \n const next = Math.min(el.scrollHeight, maxHeight); \n \n el.style.height = `${next}px`; \n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden'; \n} \n \nfunction onInput(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('update:modelValue', target.value); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nfunction onChange(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('change', target.value); \n} \n \nfunction onClear() { \n emit('update:modelValue', ''); \n emit('clear'); \n textareaRef.value?.focus(); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nwatch(() => props.modelValue, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \nwatch(() => props.autoresize, (v) => { \n if (v) nextTick(adjustHeight); \n else if (textareaRef.value) { \n textareaRef.value.style.height = ''; \n textareaRef.value.style.overflowY = ''; \n } \n}); \nwatch(() => props.maxRows, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \n \nonMounted(() => { \n if (props.autoresize) adjustHeight(); \n}); \n \ndefineExpose({ \n focus: () => textareaRef.value?.focus(), \n blur: () => textareaRef.value?.blur(), \n select: () => textareaRef.value?.select(), \n textareaRef, \n}); \n</script>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.mjs","names":[],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n
|
|
1
|
+
{"version":3,"file":"Textarea.mjs","names":[],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n radiusKind: 'surface', \n halo: () => props.halo, \n}); \n \n/** Horizontal padding from tokens; vertical padding stays size-stepped. */\nconst wrapperPaddingClasses = computed(() => {\n const pyByControl: Record<string, string> = {\n 'h-8': 'py-1', 'h-9': 'py-1.5', 'h-10': 'py-2', 'h-12': 'py-3',\n };\n const py = pyByControl[sz.value.control] ?? 'py-2';\n return `${sz.value.padX} ${py}`;\n});\n\n/** Min-height mirrors the control scale (h-8/h-9/h-10/h-12 → min-h-8/9/10/12). */\nconst wrapperMinHeightClass = computed(() => sz.value.control.replace('h-', 'min-h-'));\n\nconst textareaTextClasses = computed(() => `${sz.value.text} leading-relaxed`); \n \nconst resizeClass = computed(() => { \n if (props.autoresize) return 'resize-none'; \n switch (props.resize) { \n case 'none': return 'resize-none'; \n case 'horizontal': return 'resize-x'; \n case 'both': return 'resize'; \n case 'vertical': \n default: return 'resize-y'; \n } \n}); \n \nfunction adjustHeight() { \n if (!props.autoresize) return; \n const el = textareaRef.value; \n if (!el) return; \n \n el.style.height = 'auto'; \n \n const styles = window.getComputedStyle(el); \n const lineHeight = parseFloat(styles.lineHeight) || 20; \n const paddingTop = parseFloat(styles.paddingTop) || 0; \n const paddingBottom = parseFloat(styles.paddingBottom) || 0; \n const borderTop = parseFloat(styles.borderTopWidth) || 0; \n const borderBottom = parseFloat(styles.borderBottomWidth) || 0; \n \n const maxHeight = \n lineHeight * props.maxRows + paddingTop + paddingBottom + borderTop + borderBottom; \n const next = Math.min(el.scrollHeight, maxHeight); \n \n el.style.height = `${next}px`; \n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden'; \n} \n \nfunction onInput(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('update:modelValue', target.value); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nfunction onChange(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('change', target.value); \n} \n \nfunction onClear() { \n emit('update:modelValue', ''); \n emit('clear'); \n textareaRef.value?.focus(); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nwatch(() => props.modelValue, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \nwatch(() => props.autoresize, (v) => { \n if (v) nextTick(adjustHeight); \n else if (textareaRef.value) { \n textareaRef.value.style.height = ''; \n textareaRef.value.style.overflowY = ''; \n } \n}); \nwatch(() => props.maxRows, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \n \nonMounted(() => { \n if (props.autoresize) adjustHeight(); \n}); \n \ndefineExpose({ \n focus: () => textareaRef.value?.focus(), \n blur: () => textareaRef.value?.blur(), \n select: () => textareaRef.value?.select(), \n textareaRef, \n}); \n</script>\n"],"mappings":""}
|
|
@@ -121,7 +121,7 @@ var Textarea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, v
|
|
|
121
121
|
stateColor,
|
|
122
122
|
hasError,
|
|
123
123
|
radius,
|
|
124
|
-
|
|
124
|
+
radiusKind: "surface",
|
|
125
125
|
halo: () => props.halo
|
|
126
126
|
});
|
|
127
127
|
/** Horizontal padding from tokens; vertical padding stays size-stepped. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.vue_vue_type_script_setup_true_lang.cjs","names":["$emit"],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n fullRadiusClass: 'rounded-2xl', \n halo: () => props.halo, \n}); \n \n/** Horizontal padding from tokens; vertical padding stays size-stepped. */\nconst wrapperPaddingClasses = computed(() => {\n const pyByControl: Record<string, string> = {\n 'h-8': 'py-1', 'h-9': 'py-1.5', 'h-10': 'py-2', 'h-12': 'py-3',\n };\n const py = pyByControl[sz.value.control] ?? 'py-2';\n return `${sz.value.padX} ${py}`;\n});\n\n/** Min-height mirrors the control scale (h-8/h-9/h-10/h-12 → min-h-8/9/10/12). */\nconst wrapperMinHeightClass = computed(() => sz.value.control.replace('h-', 'min-h-'));\n\nconst textareaTextClasses = computed(() => `${sz.value.text} leading-relaxed`); \n \nconst resizeClass = computed(() => { \n if (props.autoresize) return 'resize-none'; \n switch (props.resize) { \n case 'none': return 'resize-none'; \n case 'horizontal': return 'resize-x'; \n case 'both': return 'resize'; \n case 'vertical': \n default: return 'resize-y'; \n } \n}); \n \nfunction adjustHeight() { \n if (!props.autoresize) return; \n const el = textareaRef.value; \n if (!el) return; \n \n el.style.height = 'auto'; \n \n const styles = window.getComputedStyle(el); \n const lineHeight = parseFloat(styles.lineHeight) || 20; \n const paddingTop = parseFloat(styles.paddingTop) || 0; \n const paddingBottom = parseFloat(styles.paddingBottom) || 0; \n const borderTop = parseFloat(styles.borderTopWidth) || 0; \n const borderBottom = parseFloat(styles.borderBottomWidth) || 0; \n \n const maxHeight = \n lineHeight * props.maxRows + paddingTop + paddingBottom + borderTop + borderBottom; \n const next = Math.min(el.scrollHeight, maxHeight); \n \n el.style.height = `${next}px`; \n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden'; \n} \n \nfunction onInput(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('update:modelValue', target.value); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nfunction onChange(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('change', target.value); \n} \n \nfunction onClear() { \n emit('update:modelValue', ''); \n emit('clear'); \n textareaRef.value?.focus(); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nwatch(() => props.modelValue, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \nwatch(() => props.autoresize, (v) => { \n if (v) nextTick(adjustHeight); \n else if (textareaRef.value) { \n textareaRef.value.style.height = ''; \n textareaRef.value.style.overflowY = ''; \n } \n}); \nwatch(() => props.maxRows, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \n \nonMounted(() => { \n if (props.autoresize) adjustHeight(); \n}); \n \ndefineExpose({ \n focus: () => textareaRef.value?.focus(), \n blur: () => textareaRef.value?.blur(), \n select: () => textareaRef.value?.select(), \n textareaRef, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HA,MAAM,MAAM,sBAAA,eAAe;EAE3B,MAAM,OAAO;EAQb,MAAM,QAAQ;EAiBO,sBAAA,sBAAsB,MAAM,KAAK;EACtD,MAAM,KAAK,sBAAA,oBAAoB,MAAM,KAAK;EAE1C,MAAM,eAAA,GAAA,IAAA,KAA8C,KAAK;EAEzD,MAAM,EACF,SACA,QACA,YACA,UACA,UACA,YACA,eACA,sBACA,iBACA,SACA,UACA,WACA,gBACA,iBAAA,cAAc,OAAO;GAAE,eAAe;GAAY,UAAU;GAAiB,CAAC;EAElF,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAC7D,eAAe,MAAM;GACrB;GACA;GACA;GACA,iBAAiB;GACjB,YAAY,MAAM;GACrB,CAAC;;EAGF,MAAM,yBAAA,GAAA,IAAA,gBAAuC;GAIzC,MAAM,KAAK;IAFP,OAAO;IAAQ,OAAO;IAAU,QAAQ;IAAQ,QAAQ;IAEjD,CAAY,GAAG,MAAM,YAAY;GAC5C,OAAO,GAAG,GAAG,MAAM,KAAK,GAAG;IAC7B;;EAGF,MAAM,yBAAA,GAAA,IAAA,gBAAuC,GAAG,MAAM,QAAQ,QAAQ,MAAM,SAAS,CAAC;EAEtF,MAAM,uBAAA,G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PR,KAAA,GAAA,IAAA,OAAI,QAAO;KACZ,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;qCAEY,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAZ,QAAA,UAAS,EAAA,EAAA,CAAA,CAAA;;qBAGD,QAAA,eAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAQF,mBAAA,SAAA;;KAPR,KAAA,GAAA,IAAA,OAAI,SAAQ;KACb,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;qCAEa,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAb,QAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;wEAEa,QAA9B,WAA8B,IAAA,GAAA,IAAA,OAGpB,qBAAoB,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAQvB,QAAA;;KAPF,KAAA,GAAA,IAAA,OAAI,UAAS;KACb,QAAA,GAAA,IAAA,gBAAK,CAAA,uCAAA,GAAA,IAAA,OAAoF,gBAAe,GAAA,qBAAA,wBAAA,CAAA;+CAKtG,cAAa,CAAA,GAAG,OAAA,GAAA,IAAA,iBAAI,QAAA,UAAS,EAAA,IAAA,WAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"Textarea.vue_vue_type_script_setup_true_lang.cjs","names":["$emit"],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n radiusKind: 'surface', \n halo: () => props.halo, \n}); \n \n/** Horizontal padding from tokens; vertical padding stays size-stepped. */\nconst wrapperPaddingClasses = computed(() => {\n const pyByControl: Record<string, string> = {\n 'h-8': 'py-1', 'h-9': 'py-1.5', 'h-10': 'py-2', 'h-12': 'py-3',\n };\n const py = pyByControl[sz.value.control] ?? 'py-2';\n return `${sz.value.padX} ${py}`;\n});\n\n/** Min-height mirrors the control scale (h-8/h-9/h-10/h-12 → min-h-8/9/10/12). */\nconst wrapperMinHeightClass = computed(() => sz.value.control.replace('h-', 'min-h-'));\n\nconst textareaTextClasses = computed(() => `${sz.value.text} leading-relaxed`); \n \nconst resizeClass = computed(() => { \n if (props.autoresize) return 'resize-none'; \n switch (props.resize) { \n case 'none': return 'resize-none'; \n case 'horizontal': return 'resize-x'; \n case 'both': return 'resize'; \n case 'vertical': \n default: return 'resize-y'; \n } \n}); \n \nfunction adjustHeight() { \n if (!props.autoresize) return; \n const el = textareaRef.value; \n if (!el) return; \n \n el.style.height = 'auto'; \n \n const styles = window.getComputedStyle(el); \n const lineHeight = parseFloat(styles.lineHeight) || 20; \n const paddingTop = parseFloat(styles.paddingTop) || 0; \n const paddingBottom = parseFloat(styles.paddingBottom) || 0; \n const borderTop = parseFloat(styles.borderTopWidth) || 0; \n const borderBottom = parseFloat(styles.borderBottomWidth) || 0; \n \n const maxHeight = \n lineHeight * props.maxRows + paddingTop + paddingBottom + borderTop + borderBottom; \n const next = Math.min(el.scrollHeight, maxHeight); \n \n el.style.height = `${next}px`; \n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden'; \n} \n \nfunction onInput(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('update:modelValue', target.value); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nfunction onChange(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('change', target.value); \n} \n \nfunction onClear() { \n emit('update:modelValue', ''); \n emit('clear'); \n textareaRef.value?.focus(); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nwatch(() => props.modelValue, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \nwatch(() => props.autoresize, (v) => { \n if (v) nextTick(adjustHeight); \n else if (textareaRef.value) { \n textareaRef.value.style.height = ''; \n textareaRef.value.style.overflowY = ''; \n } \n}); \nwatch(() => props.maxRows, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \n \nonMounted(() => { \n if (props.autoresize) adjustHeight(); \n}); \n \ndefineExpose({ \n focus: () => textareaRef.value?.focus(), \n blur: () => textareaRef.value?.blur(), \n select: () => textareaRef.value?.select(), \n textareaRef, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HA,MAAM,MAAM,sBAAA,eAAe;EAE3B,MAAM,OAAO;EAQb,MAAM,QAAQ;EAiBO,sBAAA,sBAAsB,MAAM,KAAK;EACtD,MAAM,KAAK,sBAAA,oBAAoB,MAAM,KAAK;EAE1C,MAAM,eAAA,GAAA,IAAA,KAA8C,KAAK;EAEzD,MAAM,EACF,SACA,QACA,YACA,UACA,UACA,YACA,eACA,sBACA,iBACA,SACA,UACA,WACA,gBACA,iBAAA,cAAc,OAAO;GAAE,eAAe;GAAY,UAAU;GAAiB,CAAC;EAElF,MAAM,EAAE,uBAAuB,kBAAkB,iBAAA,gBAAgB;GAC7D,eAAe,MAAM;GACrB;GACA;GACA;GACA,YAAY;GACZ,YAAY,MAAM;GACrB,CAAC;;EAGF,MAAM,yBAAA,GAAA,IAAA,gBAAuC;GAIzC,MAAM,KAAK;IAFP,OAAO;IAAQ,OAAO;IAAU,QAAQ;IAAQ,QAAQ;IAEjD,CAAY,GAAG,MAAM,YAAY;GAC5C,OAAO,GAAG,GAAG,MAAM,KAAK,GAAG;IAC7B;;EAGF,MAAM,yBAAA,GAAA,IAAA,gBAAuC,GAAG,MAAM,QAAQ,QAAQ,MAAM,SAAS,CAAC;EAEtF,MAAM,uBAAA,GAAA,IAAA,gBAAqC,GAAG,GAAG,MAAM,K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,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;qCAEY,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAZ,QAAA,UAAS,EAAA,EAAA,CAAA,CAAA;;qBAGD,QAAA,eAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAQF,mBAAA,SAAA;;KAPR,KAAA,GAAA,IAAA,OAAI,SAAQ;KACb,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;qCAEa,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAb,QAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;wEAEa,QAA9B,WAA8B,IAAA,GAAA,IAAA,OAGpB,qBAAoB,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAQvB,QAAA;;KAPF,KAAA,GAAA,IAAA,OAAI,UAAS;KACb,QAAA,GAAA,IAAA,gBAAK,CAAA,uCAAA,GAAA,IAAA,OAAoF,gBAAe,GAAA,qBAAA,wBAAA,CAAA;+CAKtG,cAAa,CAAA,GAAG,OAAA,GAAA,IAAA,iBAAI,QAAA,UAAS,EAAA,IAAA,WAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
|
|
@@ -120,7 +120,7 @@ var Textarea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
120
120
|
stateColor,
|
|
121
121
|
hasError,
|
|
122
122
|
radius,
|
|
123
|
-
|
|
123
|
+
radiusKind: "surface",
|
|
124
124
|
halo: () => props.halo
|
|
125
125
|
});
|
|
126
126
|
/** Horizontal padding from tokens; vertical padding stays size-stepped. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.vue_vue_type_script_setup_true_lang.mjs","names":["$emit"],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n fullRadiusClass: 'rounded-2xl', \n halo: () => props.halo, \n}); \n \n/** Horizontal padding from tokens; vertical padding stays size-stepped. */\nconst wrapperPaddingClasses = computed(() => {\n const pyByControl: Record<string, string> = {\n 'h-8': 'py-1', 'h-9': 'py-1.5', 'h-10': 'py-2', 'h-12': 'py-3',\n };\n const py = pyByControl[sz.value.control] ?? 'py-2';\n return `${sz.value.padX} ${py}`;\n});\n\n/** Min-height mirrors the control scale (h-8/h-9/h-10/h-12 → min-h-8/9/10/12). */\nconst wrapperMinHeightClass = computed(() => sz.value.control.replace('h-', 'min-h-'));\n\nconst textareaTextClasses = computed(() => `${sz.value.text} leading-relaxed`); \n \nconst resizeClass = computed(() => { \n if (props.autoresize) return 'resize-none'; \n switch (props.resize) { \n case 'none': return 'resize-none'; \n case 'horizontal': return 'resize-x'; \n case 'both': return 'resize'; \n case 'vertical': \n default: return 'resize-y'; \n } \n}); \n \nfunction adjustHeight() { \n if (!props.autoresize) return; \n const el = textareaRef.value; \n if (!el) return; \n \n el.style.height = 'auto'; \n \n const styles = window.getComputedStyle(el); \n const lineHeight = parseFloat(styles.lineHeight) || 20; \n const paddingTop = parseFloat(styles.paddingTop) || 0; \n const paddingBottom = parseFloat(styles.paddingBottom) || 0; \n const borderTop = parseFloat(styles.borderTopWidth) || 0; \n const borderBottom = parseFloat(styles.borderBottomWidth) || 0; \n \n const maxHeight = \n lineHeight * props.maxRows + paddingTop + paddingBottom + borderTop + borderBottom; \n const next = Math.min(el.scrollHeight, maxHeight); \n \n el.style.height = `${next}px`; \n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden'; \n} \n \nfunction onInput(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('update:modelValue', target.value); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nfunction onChange(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('change', target.value); \n} \n \nfunction onClear() { \n emit('update:modelValue', ''); \n emit('clear'); \n textareaRef.value?.focus(); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nwatch(() => props.modelValue, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \nwatch(() => props.autoresize, (v) => { \n if (v) nextTick(adjustHeight); \n else if (textareaRef.value) { \n textareaRef.value.style.height = ''; \n textareaRef.value.style.overflowY = ''; \n } \n}); \nwatch(() => props.maxRows, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \n \nonMounted(() => { \n if (props.autoresize) adjustHeight(); \n}); \n \ndefineExpose({ \n focus: () => textareaRef.value?.focus(), \n blur: () => textareaRef.value?.blur(), \n select: () => textareaRef.value?.select(), \n textareaRef, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HA,MAAM,MAAM,eAAe;EAE3B,MAAM,OAAO;EAQb,MAAM,QAAQ;EAiBO,sBAAsB,MAAM,KAAK;EACtD,MAAM,KAAK,oBAAoB,MAAM,KAAK;EAE1C,MAAM,cAAc,IAAgC,KAAK;EAEzD,MAAM,EACF,SACA,QACA,YACA,UACA,UACA,YACA,eACA,sBACA,iBACA,SACA,UACA,WACA,gBACA,cAAc,OAAO;GAAE,eAAe;GAAY,UAAU;GAAiB,CAAC;EAElF,MAAM,EAAE,uBAAuB,kBAAkB,gBAAgB;GAC7D,eAAe,MAAM;GACrB;GACA;GACA;GACA,iBAAiB;GACjB,YAAY,MAAM;GACrB,CAAC;;EAGF,MAAM,wBAAwB,eAAe;GAIzC,MAAM,KAAK;IAFP,OAAO;IAAQ,OAAO;IAAU,QAAQ;IAAQ,QAAQ;IAEjD,CAAY,GAAG,MAAM,YAAY;GAC5C,OAAO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,WAAA,EAD9B,mBASO,QAAA;;KAPF,IAAI,MAAA,UAAS;KACb,OAAK,eAAA,CAAA,sCAAoF,MAAA,gBAAe,GAAA,qBAAA,wBAAA,CAAA;uBAKtG,MAAA,cAAa,CAAA,GAAG,MAAC,gBAAG,QAAA,UAAS,EAAA,IAAA,WAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"Textarea.vue_vue_type_script_setup_true_lang.mjs","names":["$emit"],"sources":["../../../src/components/forms/Textarea.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n :class=\"[\n 'modo-field-wrapper flex items-start gap-2',\n wrapperVariantClasses,\n wrapperPaddingClasses,\n wrapperMinHeightClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n > \n <textarea \n :id=\"fieldId\" \n ref=\"textareaRef\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :autofocus=\"autofocus\" \n :maxlength=\"maxLength\" \n :rows=\"rows\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n textareaTextClasses, \n resizeClass, \n autoresize ? 'overflow-hidden' : '', \n ]\" \n @input=\"onInput\" \n @change=\"onChange\" \n @focus=\"$emit('focus', $event)\" \n @blur=\"$emit('blur', $event)\" \n /> \n \n <div class=\"flex flex-col items-center gap-1 shrink-0 pt-0.5\"> \n <Button \n v-if=\"clearable && hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.textarea.clear\" \n tabindex=\"-1\" \n class=\"text-muted-foreground hover:text-foreground\" \n @click=\"onClear\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n class=\"text-muted-foreground\" \n /> \n </div> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, nextTick, onMounted, ref, watch } from 'vue'; \nimport type { Textarea } from '../../interfaces/forms/Textarea.interface'; \nimport { useFieldState, useFieldClasses } from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n}>(); \n \nconst props = withDefaults(defineProps<Textarea>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n clearable: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n rows: 3, \n autoresize: false, \n maxRows: 8, \n resize: 'vertical', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'Textarea', idPrefix: 'modo-textarea' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n radiusKind: 'surface', \n halo: () => props.halo, \n}); \n \n/** Horizontal padding from tokens; vertical padding stays size-stepped. */\nconst wrapperPaddingClasses = computed(() => {\n const pyByControl: Record<string, string> = {\n 'h-8': 'py-1', 'h-9': 'py-1.5', 'h-10': 'py-2', 'h-12': 'py-3',\n };\n const py = pyByControl[sz.value.control] ?? 'py-2';\n return `${sz.value.padX} ${py}`;\n});\n\n/** Min-height mirrors the control scale (h-8/h-9/h-10/h-12 → min-h-8/9/10/12). */\nconst wrapperMinHeightClass = computed(() => sz.value.control.replace('h-', 'min-h-'));\n\nconst textareaTextClasses = computed(() => `${sz.value.text} leading-relaxed`); \n \nconst resizeClass = computed(() => { \n if (props.autoresize) return 'resize-none'; \n switch (props.resize) { \n case 'none': return 'resize-none'; \n case 'horizontal': return 'resize-x'; \n case 'both': return 'resize'; \n case 'vertical': \n default: return 'resize-y'; \n } \n}); \n \nfunction adjustHeight() { \n if (!props.autoresize) return; \n const el = textareaRef.value; \n if (!el) return; \n \n el.style.height = 'auto'; \n \n const styles = window.getComputedStyle(el); \n const lineHeight = parseFloat(styles.lineHeight) || 20; \n const paddingTop = parseFloat(styles.paddingTop) || 0; \n const paddingBottom = parseFloat(styles.paddingBottom) || 0; \n const borderTop = parseFloat(styles.borderTopWidth) || 0; \n const borderBottom = parseFloat(styles.borderBottomWidth) || 0; \n \n const maxHeight = \n lineHeight * props.maxRows + paddingTop + paddingBottom + borderTop + borderBottom; \n const next = Math.min(el.scrollHeight, maxHeight); \n \n el.style.height = `${next}px`; \n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden'; \n} \n \nfunction onInput(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('update:modelValue', target.value); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nfunction onChange(e: Event) { \n const target = e.target as HTMLTextAreaElement; \n emit('change', target.value); \n} \n \nfunction onClear() { \n emit('update:modelValue', ''); \n emit('clear'); \n textareaRef.value?.focus(); \n if (props.autoresize) nextTick(adjustHeight); \n} \n \nwatch(() => props.modelValue, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \nwatch(() => props.autoresize, (v) => { \n if (v) nextTick(adjustHeight); \n else if (textareaRef.value) { \n textareaRef.value.style.height = ''; \n textareaRef.value.style.overflowY = ''; \n } \n}); \nwatch(() => props.maxRows, () => { \n if (props.autoresize) nextTick(adjustHeight); \n}); \n \nonMounted(() => { \n if (props.autoresize) adjustHeight(); \n}); \n \ndefineExpose({ \n focus: () => textareaRef.value?.focus(), \n blur: () => textareaRef.value?.blur(), \n select: () => textareaRef.value?.select(), \n textareaRef, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HA,MAAM,MAAM,eAAe;EAE3B,MAAM,OAAO;EAQb,MAAM,QAAQ;EAiBO,sBAAsB,MAAM,KAAK;EACtD,MAAM,KAAK,oBAAoB,MAAM,KAAK;EAE1C,MAAM,c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Q,QAAA,aAAA,WAAA,EADV,YASa,oBAAA;;KAPR,IAAI,MAAA,QAAO;KACZ,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;4BAEY,CAAA,gBAAA,gBAAZ,QAAA,UAAS,EAAA,EAAA,CAAA,CAAA;;qBAGD,QAAA,cAAA,WAAA,EADf,YASa,oBAAA;;KAPR,IAAI,MAAA,SAAQ;KACb,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;4BAEa,CAAA,gBAAA,gBAAb,QAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;mCAEjB,mBAA8B,QAA9B,WAA8B,GAGpB,MAAA,qBAAoB,IAAA,WAAA,EAD9B,mBASO,QAAA;;KAPF,IAAI,MAAA,UAAS;KACb,OAAK,eAAA,CAAA,sCAAoF,MAAA,gBAAe,GAAA,qBAAA,wBAAA,CAAA;uBAKtG,MAAA,cAAa,CAAA,GAAG,MAAC,gBAAG,QAAA,UAAS,EAAA,IAAA,WAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -2,7 +2,7 @@ const require__plugin_vue_export_helper = require("../../_virtual/_plugin-vue_ex
|
|
|
2
2
|
const require_Canvas_vue_vue_type_script_setup_true_lang = require("./Canvas.vue_vue_type_script_setup_true_lang.cjs");
|
|
3
3
|
;/* empty css */
|
|
4
4
|
//#region src/components/layout/Canvas.vue
|
|
5
|
-
var Canvas_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_Canvas_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
5
|
+
var Canvas_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_Canvas_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-0256e5e1"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
exports.default = Canvas_default;
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.cjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-
|
|
1
|
+
{"version":3,"file":"Canvas.cjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n // A large surface never goes past a card-like radius (Card's own `full`).\n case 'full': return 'rounded-3xl'; \n case 'medium': \n default: return 'rounded-md'; \n } \n}); \n \n/** Map intensity → opacity applied to the foreground stroke. */ \nconst intensityAlpha = computed(() => { \n switch (props.intensity) { \n case 'strong': return 0.55; \n case 'normal': return 0.32; \n case 'subtle': \n default: return 0.18; \n } \n}); \n \nconst canvasStyle = computed<CSSProperties>(() => ({ \n '--canvas-cell': `${props.cellSize}px`, \n '--canvas-stroke-alpha': String(intensityAlpha.value), \n} as CSSProperties)); \n</script> \n \n<style scoped> \n.modo-canvas { \n /* Foreground stroke uses the border token, alpha modulated by intensity. \n `color-mix` keeps it light/dark/palette-aware automatically. */ \n --canvas-stroke: color-mix( \n in oklch, \n var(--border) calc(var(--canvas-stroke-alpha) * 100%), \n transparent \n ); \n} \n \n.modo-canvas[data-pattern='dots'] { \n background-image: radial-gradient( \n circle at 1px 1px, \n var(--canvas-stroke) 1px, \n transparent 0 \n ); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='grid'] { \n background-image: \n linear-gradient(to right, var(--canvas-stroke) 1px, transparent 1px), \n linear-gradient(to bottom, var(--canvas-stroke) 1px, transparent 1px); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='lines'] { \n background-image: linear-gradient( \n to bottom, \n var(--canvas-stroke) 1px, \n transparent 1px \n ); \n background-size: 100% var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='none'] { \n background-image: none; \n} \n \n@media print { \n .modo-canvas { \n background-image: none !important; \n } \n} \n</style>\n"],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import Canvas_vue_vue_type_script_setup_true_lang_default from "./Canvas.vue_vue_type_script_setup_true_lang.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/layout/Canvas.vue
|
|
5
|
-
var Canvas_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Canvas_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var Canvas_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Canvas_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-0256e5e1"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Canvas_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.mjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-
|
|
1
|
+
{"version":3,"file":"Canvas.mjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n // A large surface never goes past a card-like radius (Card's own `full`).\n case 'full': return 'rounded-3xl'; \n case 'medium': \n default: return 'rounded-md'; \n } \n}); \n \n/** Map intensity → opacity applied to the foreground stroke. */ \nconst intensityAlpha = computed(() => { \n switch (props.intensity) { \n case 'strong': return 0.55; \n case 'normal': return 0.32; \n case 'subtle': \n default: return 0.18; \n } \n}); \n \nconst canvasStyle = computed<CSSProperties>(() => ({ \n '--canvas-cell': `${props.cellSize}px`, \n '--canvas-stroke-alpha': String(intensityAlpha.value), \n} as CSSProperties)); \n</script> \n \n<style scoped> \n.modo-canvas { \n /* Foreground stroke uses the border token, alpha modulated by intensity. \n `color-mix` keeps it light/dark/palette-aware automatically. */ \n --canvas-stroke: color-mix( \n in oklch, \n var(--border) calc(var(--canvas-stroke-alpha) * 100%), \n transparent \n ); \n} \n \n.modo-canvas[data-pattern='dots'] { \n background-image: radial-gradient( \n circle at 1px 1px, \n var(--canvas-stroke) 1px, \n transparent 0 \n ); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='grid'] { \n background-image: \n linear-gradient(to right, var(--canvas-stroke) 1px, transparent 1px), \n linear-gradient(to bottom, var(--canvas-stroke) 1px, transparent 1px); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='lines'] { \n background-image: linear-gradient( \n to bottom, \n var(--canvas-stroke) 1px, \n transparent 1px \n ); \n background-size: 100% var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='none'] { \n background-image: none; \n} \n \n@media print { \n .modo-canvas { \n background-image: none !important; \n } \n} \n</style>\n"],"mappings":""}
|
|
@@ -31,7 +31,7 @@ var Canvas_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
|
|
|
31
31
|
case "none": return "rounded-none";
|
|
32
32
|
case "small": return "rounded-sm";
|
|
33
33
|
case "large": return "rounded-xl";
|
|
34
|
-
case "full": return "rounded-
|
|
34
|
+
case "full": return "rounded-3xl";
|
|
35
35
|
default: return "rounded-md";
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-
|
|
1
|
+
{"version":3,"file":"Canvas.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n // A large surface never goes past a card-like radius (Card's own `full`).\n case 'full': return 'rounded-3xl'; \n case 'medium': \n default: return 'rounded-md'; \n } \n}); \n \n/** Map intensity → opacity applied to the foreground stroke. */ \nconst intensityAlpha = computed(() => { \n switch (props.intensity) { \n case 'strong': return 0.55; \n case 'normal': return 0.32; \n case 'subtle': \n default: return 0.18; \n } \n}); \n \nconst canvasStyle = computed<CSSProperties>(() => ({ \n '--canvas-cell': `${props.cellSize}px`, \n '--canvas-stroke-alpha': String(intensityAlpha.value), \n} as CSSProperties)); \n</script> \n \n<style scoped> \n.modo-canvas { \n /* Foreground stroke uses the border token, alpha modulated by intensity. \n `color-mix` keeps it light/dark/palette-aware automatically. */ \n --canvas-stroke: color-mix( \n in oklch, \n var(--border) calc(var(--canvas-stroke-alpha) * 100%), \n transparent \n ); \n} \n \n.modo-canvas[data-pattern='dots'] { \n background-image: radial-gradient( \n circle at 1px 1px, \n var(--canvas-stroke) 1px, \n transparent 0 \n ); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='grid'] { \n background-image: \n linear-gradient(to right, var(--canvas-stroke) 1px, transparent 1px), \n linear-gradient(to bottom, var(--canvas-stroke) 1px, transparent 1px); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='lines'] { \n background-image: linear-gradient( \n to bottom, \n var(--canvas-stroke) 1px, \n transparent 1px \n ); \n background-size: 100% var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='none'] { \n background-image: none; \n} \n \n@media print { \n .modo-canvas { \n background-image: none !important; \n } \n} \n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ;EASd,MAAM,iBAAiB,sBAAA,wBAAwB,MAAM,OAAO;EAE5D,MAAM,kBAAA,GAAA,IAAA,gBAAgC;GAClC,QAAQ,MAAM,SAAd;IACI,KAAK,cAAc,OAAO;IAC1B,KAAK,SAAS,OAAO;IAErB,SAAS,OAAO;;IAEtB;EAEF,MAAM,iBAAA,GAAA,IAAA,gBAA+B;GACjC,QAAQ,eAAe,OAAvB;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IAErB,KAAK,QAAQ,OAAO;IAEpB,SAAS,OAAO;;IAEtB;;EAGF,MAAM,kBAAA,GAAA,IAAA,gBAAgC;GAClC,QAAQ,MAAM,WAAd;IACI,KAAK,UAAU,OAAO;IACtB,KAAK,UAAU,OAAO;IAEtB,SAAS,OAAO;;IAEtB;EAEF,MAAM,eAAA,GAAA,IAAA,iBAA6C;GAC/C,iBAAiB,GAAG,MAAM,SAAS;GACnC,yBAAyB,OAAO,eAAe,MAAM;GACxD,EAAmB;;sFA5DP,QAAA,GAAE,EAAA;IACP,QAAA,GAAA,IAAA,gBAAK,CAAC,eAAa;KACV,eAAA;KAAgB,cAAA;KAAe,QAAA,WAAQ,yBAAA;KAAA,CAAA,CAAA;IAC/C,QAAA,GAAA,IAAA,gBAAO,YAAA,MAAW;IAClB,gBAAc,QAAA;;oCAEP,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
|
|
@@ -30,7 +30,7 @@ var Canvas_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
30
30
|
case "none": return "rounded-none";
|
|
31
31
|
case "small": return "rounded-sm";
|
|
32
32
|
case "large": return "rounded-xl";
|
|
33
|
-
case "full": return "rounded-
|
|
33
|
+
case "full": return "rounded-3xl";
|
|
34
34
|
default: return "rounded-md";
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return 'rounded-
|
|
1
|
+
{"version":3,"file":"Canvas.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/layout/Canvas.vue"],"sourcesContent":["<template> \n <component \n :is=\"as\" \n class=\"modo-canvas\" \n :class=\"[surfaceClasses, radiusClasses, bordered ? 'border border-border' : '']\" \n :style=\"canvasStyle\" \n :data-pattern=\"pattern\" \n > \n <slot /> \n </component> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, type CSSProperties } from 'vue'; \nimport type { Canvas } from '../../interfaces/layout/Canvas.interface'; \nimport { useResolvedRadius } from '../../composables/useModoConfig'; \n \nconst props = withDefaults(defineProps<Canvas>(), { \n pattern: 'dots', \n cellSize: 16, \n intensity: 'subtle', \n surface: 'card', \n bordered: false, \n as: 'div', \n}); \n \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst surfaceClasses = computed(() => { \n switch (props.surface) { \n case 'background': return 'bg-background'; \n case 'muted': return 'bg-muted'; \n case 'card': \n default: return 'bg-card'; \n } \n}); \n \nconst radiusClasses = computed(() => { \n switch (resolvedRadius.value) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n // A large surface never goes past a card-like radius (Card's own `full`).\n case 'full': return 'rounded-3xl'; \n case 'medium': \n default: return 'rounded-md'; \n } \n}); \n \n/** Map intensity → opacity applied to the foreground stroke. */ \nconst intensityAlpha = computed(() => { \n switch (props.intensity) { \n case 'strong': return 0.55; \n case 'normal': return 0.32; \n case 'subtle': \n default: return 0.18; \n } \n}); \n \nconst canvasStyle = computed<CSSProperties>(() => ({ \n '--canvas-cell': `${props.cellSize}px`, \n '--canvas-stroke-alpha': String(intensityAlpha.value), \n} as CSSProperties)); \n</script> \n \n<style scoped> \n.modo-canvas { \n /* Foreground stroke uses the border token, alpha modulated by intensity. \n `color-mix` keeps it light/dark/palette-aware automatically. */ \n --canvas-stroke: color-mix( \n in oklch, \n var(--border) calc(var(--canvas-stroke-alpha) * 100%), \n transparent \n ); \n} \n \n.modo-canvas[data-pattern='dots'] { \n background-image: radial-gradient( \n circle at 1px 1px, \n var(--canvas-stroke) 1px, \n transparent 0 \n ); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='grid'] { \n background-image: \n linear-gradient(to right, var(--canvas-stroke) 1px, transparent 1px), \n linear-gradient(to bottom, var(--canvas-stroke) 1px, transparent 1px); \n background-size: var(--canvas-cell) var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='lines'] { \n background-image: linear-gradient( \n to bottom, \n var(--canvas-stroke) 1px, \n transparent 1px \n ); \n background-size: 100% var(--canvas-cell); \n} \n \n.modo-canvas[data-pattern='none'] { \n background-image: none; \n} \n \n@media print { \n .modo-canvas { \n background-image: none !important; \n } \n} \n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ;EASd,MAAM,iBAAiB,wBAAwB,MAAM,OAAO;EAE5D,MAAM,iBAAiB,eAAe;GAClC,QAAQ,MAAM,SAAd;IACI,KAAK,cAAc,OAAO;IAC1B,KAAK,SAAS,OAAO;IAErB,SAAS,OAAO;;IAEtB;EAEF,MAAM,gBAAgB,eAAe;GACjC,QAAQ,eAAe,OAAvB;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IAErB,KAAK,QAAQ,OAAO;IAEpB,SAAS,OAAO;;IAEtB;;EAGF,MAAM,iBAAiB,eAAe;GAClC,QAAQ,MAAM,WAAd;IACI,KAAK,UAAU,OAAO;IACtB,KAAK,UAAU,OAAO;IAEtB,SAAS,OAAO;;IAEtB;EAEF,MAAM,cAAc,gBAA+B;GAC/C,iBAAiB,GAAG,MAAM,SAAS;GACnC,yBAAyB,OAAO,eAAe,MAAM;GACxD,EAAmB;;uBA7DhB,YAQY,wBAPH,QAAA,GAAE,EAAA;IACP,OAAK,eAAA,CAAC,eAAa;KACV,eAAA;KAAgB,cAAA;KAAe,QAAA,WAAQ,yBAAA;KAAA,CAAA,CAAA;IAC/C,OAAK,eAAE,YAAA,MAAW;IAClB,gBAAc,QAAA;;2BAEP,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
|
|
@@ -2,7 +2,7 @@ const require__plugin_vue_export_helper = require("../../_virtual/_plugin-vue_ex
|
|
|
2
2
|
const require_PopoverPanel_vue_vue_type_script_setup_true_lang = require("./PopoverPanel.vue_vue_type_script_setup_true_lang.cjs");
|
|
3
3
|
;/* empty css */
|
|
4
4
|
//#region src/components/layout/PopoverPanel.vue
|
|
5
|
-
var PopoverPanel_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_PopoverPanel_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
5
|
+
var PopoverPanel_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_PopoverPanel_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-6068fa7f"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
exports.default = PopoverPanel_default;
|
|
8
8
|
|