numori-ui 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +18 -19
  3. package/dist/components/AppShell.js +234 -0
  4. package/dist/components/AppShell.js.map +1 -0
  5. package/dist/components/Checkbox.js +11 -2
  6. package/dist/components/Checkbox.js.map +1 -1
  7. package/dist/components/CopyField.js +195 -0
  8. package/dist/components/CopyField.js.map +1 -0
  9. package/dist/components/DescriptionList.js +116 -0
  10. package/dist/components/DescriptionList.js.map +1 -0
  11. package/dist/components/EmptyState.js +123 -0
  12. package/dist/components/EmptyState.js.map +1 -0
  13. package/dist/components/FormField.js +43 -13
  14. package/dist/components/FormField.js.map +1 -1
  15. package/dist/components/Input.js +15 -1
  16. package/dist/components/Input.js.map +1 -1
  17. package/dist/components/PageHeader.js +106 -0
  18. package/dist/components/PageHeader.js.map +1 -0
  19. package/dist/components/Pagination.js +236 -0
  20. package/dist/components/Pagination.js.map +1 -0
  21. package/dist/components/Segmented.js +10 -2
  22. package/dist/components/Segmented.js.map +1 -1
  23. package/dist/components/Select.js +10 -1
  24. package/dist/components/Select.js.map +1 -1
  25. package/dist/components/Sidebar.js +69 -0
  26. package/dist/components/Sidebar.js.map +1 -0
  27. package/dist/components/SidebarGroup.js +50 -0
  28. package/dist/components/SidebarGroup.js.map +1 -0
  29. package/dist/components/SidebarItem.js +167 -0
  30. package/dist/components/SidebarItem.js.map +1 -0
  31. package/dist/components/StatCard.js +185 -0
  32. package/dist/components/StatCard.js.map +1 -0
  33. package/dist/components/Table.js +182 -50
  34. package/dist/components/Table.js.map +1 -1
  35. package/dist/components/Tabs.js +216 -0
  36. package/dist/components/Tabs.js.map +1 -0
  37. package/dist/components/Toggle.js +11 -2
  38. package/dist/components/Toggle.js.map +1 -1
  39. package/dist/components/index.js +97 -80
  40. package/dist/components/index.js.map +1 -1
  41. package/dist/icons/mdi.js +10 -0
  42. package/dist/icons/mdi.js.map +1 -1
  43. package/dist/index.d.ts +12 -1
  44. package/dist/index.js +50 -39
  45. package/dist/index.js.map +1 -1
  46. package/dist/internal/formField.js +26 -0
  47. package/dist/internal/formField.js.map +1 -0
  48. package/dist/manifest.js +11 -0
  49. package/dist/manifest.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/components/AppShell.vue +231 -0
  52. package/src/components/Checkbox.vue +5 -0
  53. package/src/components/CopyField.vue +178 -0
  54. package/src/components/DescriptionList.vue +114 -0
  55. package/src/components/EmptyState.vue +107 -0
  56. package/src/components/FormField.vue +37 -4
  57. package/src/components/Input.vue +9 -0
  58. package/src/components/PageHeader.vue +102 -0
  59. package/src/components/Pagination.vue +199 -0
  60. package/src/components/Segmented.vue +5 -0
  61. package/src/components/Select.vue +5 -0
  62. package/src/components/Sidebar.vue +61 -0
  63. package/src/components/SidebarGroup.vue +43 -0
  64. package/src/components/SidebarItem.vue +159 -0
  65. package/src/components/StatCard.vue +165 -0
  66. package/src/components/Table.vue +148 -18
  67. package/src/components/Tabs.vue +217 -0
  68. package/src/components/Toggle.vue +5 -0
  69. package/src/components/index.js +33 -5
  70. package/src/icons/mdi.js +10 -0
  71. package/src/internal/formField.js +23 -0
  72. package/src/manifest.js +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyField.js","names":[],"sources":["../../src/components/CopyField.vue"],"sourcesContent":["<template>\n <div :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <span\n class=\"min-w-0 flex-1 px-3 text-gray-800 select-all dark:text-gray-200\"\n :class=\"[\n size === 'sm' ? 'py-1.5 text-xs' : 'py-2 text-sm',\n mono ? 'font-mono' : '',\n wrap ? 'break-all whitespace-pre-wrap' : 'truncate',\n masked ? 'tracking-widest text-gray-500 select-none dark:text-gray-400' : '',\n ]\"\n :aria-label=\"masked ? hiddenLabel : undefined\"\n >{{ masked ? mask : value }}</span\n >\n\n <button\n v-if=\"secret\"\n type=\"button\"\n :class=\"buttonClass\"\n :aria-label=\"masked ? revealLabel : hideLabel\"\n :aria-pressed=\"masked ? 'false' : 'true'\"\n @click=\"toggleReveal\"\n >\n <UiIcon :name=\"masked ? 'mdi:eye-outline' : 'mdi:eye-off-outline'\" class=\"size-4\" />\n </button>\n\n <button\n type=\"button\"\n :class=\"buttonClass\"\n :aria-label=\"copied ? copiedLabel : copyLabel\"\n @click=\"copy\"\n >\n <UiIcon\n :name=\"copied ? 'mdi:check' : 'mdi:content-copy'\"\n class=\"size-4\"\n :class=\"copied ? 'text-success-600 dark:text-success-400' : ''\"\n />\n <span v-if=\"showCopyText\" class=\"hidden sm:inline\">{{\n copied ? copiedLabel : copyLabel\n }}</span>\n </button>\n </div>\n</template>\n\n<script setup>\n/**\n * UiCopyField — a read-only value with a copy button, and optional masking for\n * secrets.\n *\n * For connect URLs, ids, API keys and generated secrets. With `secret`, the\n * value is masked until revealed and the real text is not in the DOM while it\n * is masked, so a screen share or a screenshot does not leak it. Copying works\n * either way.\n *\n * Copy uses the async Clipboard API and fails silently when unavailable (an\n * insecure context or denied permission). Every label is a prop, so nothing\n * is baked into one language.\n *\n * @example\n * <UiFormField label=\"Connect URL\">\n * <UiCopyField value=\"wss://crdt.numori.app/notes\" />\n * </UiFormField>\n *\n * @example A secret shown once\n * <UiCopyField :value=\"signingKey\" secret @copy=\"markCopied\" />\n *\n * @emits {string} copy — The value was copied.\n * @emits {boolean} update:revealed — The secret was revealed or hidden.\n */\nimport { computed, ref, watch } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nimport { useMergedClasses } from '../composables/useMergedClasses.js'\n\nconst props = defineProps({\n /**\n * The text to show and copy.\n * @type {string}\n */\n value: { type: String, required: true },\n\n /**\n * Mask the value until revealed.\n * @type {boolean}\n * @default false\n */\n secret: { type: Boolean, default: false },\n\n /**\n * Revealed state of a secret, for `v-model:revealed`.\n * @type {boolean}\n * @default false\n */\n revealed: { type: Boolean, default: false },\n\n /**\n * Monospace text.\n * @type {boolean}\n * @default true\n */\n mono: { type: Boolean, default: true },\n\n /**\n * Wrap long values onto several lines instead of truncating.\n * @type {boolean}\n * @default false\n */\n wrap: { type: Boolean, default: false },\n\n /**\n * Control size.\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md'\n */\n size: { type: String, default: 'md' },\n\n /**\n * Show the copy label beside the icon (from `sm` up).\n * @type {boolean}\n * @default false\n */\n showCopyText: { type: Boolean, default: false },\n\n /** @type {string} @default 'Copy' */\n copyLabel: { type: String, default: 'Copy' },\n /** @type {string} @default 'Copied' */\n copiedLabel: { type: String, default: 'Copied' },\n /** @type {string} @default 'Reveal' */\n revealLabel: { type: String, default: 'Reveal' },\n /** @type {string} @default 'Hide' */\n hideLabel: { type: String, default: 'Hide' },\n /** Accessible text read in place of a masked value. @type {string} @default 'Hidden value' */\n hiddenLabel: { type: String, default: 'Hidden value' },\n})\n\nconst emit = defineEmits(['copy', 'update:revealed'])\n\ndefineOptions({ inheritAttrs: false })\n\nconst isRevealed = ref(props.revealed)\nwatch(\n () => props.revealed,\n (value) => {\n isRevealed.value = value\n },\n)\n\nconst masked = computed(() => props.secret && !isRevealed.value)\nconst mask = computed(() => '•'.repeat(Math.min(Math.max(props.value.length, 8), 24)))\n\nfunction toggleReveal() {\n isRevealed.value = !isRevealed.value\n emit('update:revealed', isRevealed.value)\n}\n\nconst copied = ref(false)\nlet timer = null\n\nasync function copy() {\n try {\n await navigator.clipboard.writeText(props.value)\n copied.value = true\n emit('copy', props.value)\n clearTimeout(timer)\n timer = setTimeout(() => {\n copied.value = false\n }, 1600)\n } catch {\n // Clipboard unavailable; the value is still selectable by hand.\n }\n}\n\nconst buttonClass =\n 'inline-flex shrink-0 items-center gap-1.5 border-l border-gray-200 px-3 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary-500 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100'\n\nconst { mergedClasses, restAttrs } = useMergedClasses(\n 'flex w-full min-w-0 items-stretch overflow-hidden rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800/60',\n)\n</script>\n"],"mappings":";;;;;;;;;;;AA2KA,IAAM,cACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EApGF,MAAM,QAAQ;EA8Dd,MAAM,OAAO;EAIb,MAAM,aAAa,IAAI,MAAM,QAAQ;EACrC,YACQ,MAAM,WACX,UAAU;GACT,WAAW,QAAQ;EACrB,CACF;EAEA,MAAM,SAAS,eAAe,MAAM,UAAU,CAAC,WAAW,KAAK;EAC/D,MAAM,OAAO,eAAe,IAAI,OAAO,KAAK,IAAI,KAAK,IAAI,MAAM,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;EAErF,SAAS,eAAe;GACtB,WAAW,QAAQ,CAAC,WAAW;GAC/B,KAAK,mBAAmB,WAAW,KAAK;EAC1C;EAEA,MAAM,SAAS,IAAI,KAAK;EACxB,IAAI,QAAQ;EAEZ,eAAe,OAAO;GACpB,IAAI;IACF,MAAM,UAAU,UAAU,UAAU,MAAM,KAAK;IAC/C,OAAO,QAAQ;IACf,KAAK,QAAQ,MAAM,KAAK;IACxB,aAAa,KAAK;IAClB,QAAQ,iBAAiB;KACvB,OAAO,QAAQ;IACjB,GAAG,IAAI;GACT,QAAQ,CAER;EACF;EAKA,MAAM,EAAE,eAAe,cAAc,iBACnC,yIACF;;GA/KE,OAAA,UAAA,GAAA,mBAuCM,OAvCN,WAuCM,EAvCA,OAAO,MAAA,aAAA,EAAa,GAAU,MAAA,SAAA,CAAS,GAAA;IAC3C,mBAUC,QAAA;KATC,OAAK,eAAA,CAAC,mEAAiE;MACrD,QAAA,SAAI,OAAA,mBAAA;MAAuD,QAAA,OAAI,cAAA;MAA6B,QAAA,OAAI,kCAAA;MAAyD,OAAA,QAAM,iEAAA;;KAMhL,cAAY,OAAA,QAAS,QAAA,cAAc,KAAA;IAChC,GAAA,gBAAA,OAAA,QAAS,KAAA,QAAO,QAAA,KAAK,GAAA,IAAA,UAAA;IAInB,QAAA,UADR,UAAA,GAAA,mBASS,UAAA;;KAPP,MAAK;KACJ,OAAK,eAAE,WAAW;KAClB,cAAY,OAAA,QAAS,QAAA,cAAc,QAAA;KACnC,gBAAc,OAAA,QAAM,UAAA;KACpB,SAAO;IAER,GAAA,CAAA,YAAoF,aAAA;KAA3E,MAAM,OAAA,QAAM,oBAAA;KAA8C,OAAM;;IAG3E,mBAcS,UAAA;KAbP,MAAK;KACJ,OAAK,eAAE,WAAW;KAClB,cAAY,OAAA,QAAS,QAAA,cAAc,QAAA;KACnC,SAAO;IAER,GAAA,CAAA,YAIE,aAAA;KAHC,MAAM,OAAA,QAAM,cAAA;KACb,OAAK,eAAA,CAAC,UACE,OAAA,QAAM,2CAAA,EAAA,CAAA;IAEJ,GAAA,MAAA,GAAA,CAAA,QAAA,OAAA,CAAA,GAAA,QAAA,gBAAZ,UAAA,GAAA,mBAES,QAFT,YAES,gBADP,OAAA,QAAS,QAAA,cAAc,QAAA,SAAS,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,GAAA,UAAA"}
@@ -0,0 +1,116 @@
1
+ import { useMergedClasses } from "../composables/useMergedClasses.js";
2
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, mergeProps, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref } from "vue";
3
+ //#region src/components/DescriptionList.vue
4
+ var _hoisted_1 = { class: "text-sm font-medium text-gray-500 dark:text-gray-400" };
5
+ var _hoisted_2 = {
6
+ key: 0,
7
+ class: "mt-0.5 block text-xs font-normal text-gray-400 dark:text-gray-500"
8
+ };
9
+ var _hoisted_3 = {
10
+ key: 0,
11
+ class: "text-gray-400 dark:text-gray-500"
12
+ };
13
+ var _sfc_main = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
14
+ __name: "DescriptionList",
15
+ props: {
16
+ /**
17
+ * Pairs to show. Each is `{ label, value, key?, hint?, mono? }`; `mono`
18
+ * renders the value in a monospace font that breaks anywhere (ids, keys).
19
+ * @type {Array<{ label: string, value?: unknown, key?: string, hint?: string, mono?: boolean }>}
20
+ */
21
+ items: {
22
+ type: Array,
23
+ required: true
24
+ },
25
+ /**
26
+ * Arrangement of each pair.
27
+ * @type {string}
28
+ * @default 'inline'
29
+ * @values 'inline' | 'stacked' | 'grid'
30
+ */
31
+ layout: {
32
+ type: String,
33
+ default: "inline"
34
+ },
35
+ /**
36
+ * Dividers between rows (ignored by `grid`).
37
+ * @type {boolean}
38
+ * @default true
39
+ */
40
+ divided: {
41
+ type: Boolean,
42
+ default: true
43
+ },
44
+ /**
45
+ * Shown in place of an empty value.
46
+ * @type {string}
47
+ * @default '—'
48
+ */
49
+ emptyText: {
50
+ type: String,
51
+ default: "—"
52
+ }
53
+ },
54
+ setup(__props) {
55
+ /**
56
+ * UiDescriptionList — label / value pairs, such as a record's details or a
57
+ * service's settings, rendered as a real `<dl>`.
58
+ *
59
+ * Three layouts:
60
+ * - `inline` (default): label in a narrow left column, value beside it, one
61
+ * pair per row with dividers. Stacks on narrow screens.
62
+ * - `stacked`: label above value, one pair per row.
63
+ * - `grid`: label above value, pairs flowing into two columns.
64
+ *
65
+ * Empty values (`null`, `undefined`, `''`) render `emptyText` so a missing
66
+ * setting reads as deliberate rather than as a rendering bug. Use the `#value`
67
+ * slot to render badges, links or copy fields.
68
+ *
69
+ * @example
70
+ * <UiDescriptionList
71
+ * :items="[
72
+ * { label: 'App id', value: 'notes', mono: true },
73
+ * { label: 'Storage', value: 'postgres' },
74
+ * { label: 'Audience', value: null, hint: 'Optional app/aud claim' },
75
+ * ]"
76
+ * />
77
+ *
78
+ * @example Custom value rendering
79
+ * <UiDescriptionList :items="items">
80
+ * <template #value="{ item, value }">
81
+ * <UiBadge v-if="item.key === 'status'" color="green">{{ value }}</UiBadge>
82
+ * <template v-else>{{ value }}</template>
83
+ * </template>
84
+ * </UiDescriptionList>
85
+ *
86
+ * @slot value — Custom value content. Scope: `{ item, value }`.
87
+ */
88
+ const props = __props;
89
+ const isEmpty = (value) => value === null || value === void 0 || value === "";
90
+ const rowClass = computed(() => {
91
+ if (props.layout === "grid") return "";
92
+ if (props.layout === "stacked") return "py-3 first:pt-0 last:pb-0";
93
+ return "py-3 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4";
94
+ });
95
+ const internalClasses = computed(() => {
96
+ if (props.layout === "grid") return "grid gap-x-6 gap-y-4 sm:grid-cols-2";
97
+ return props.divided ? "divide-y divide-gray-100 dark:divide-gray-800" : "";
98
+ });
99
+ const { mergedClasses, restAttrs } = useMergedClasses(() => internalClasses.value);
100
+ return (_ctx, _cache) => {
101
+ return openBlock(), createElementBlock("dl", mergeProps({ class: unref(mergedClasses) }, unref(restAttrs)), [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
102
+ return openBlock(), createElementBlock("div", {
103
+ key: item.key ?? item.label ?? index,
104
+ class: normalizeClass(rowClass.value)
105
+ }, [createElementVNode("dt", _hoisted_1, [createTextVNode(toDisplayString(item.label) + " ", 1), item.hint ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(item.hint), 1)) : createCommentVNode("", true)]), createElementVNode("dd", { class: normalizeClass(["min-w-0 text-sm text-gray-900 dark:text-gray-100", [item.mono ? "font-mono text-[13px] break-all" : "break-words", __props.layout === "inline" ? "mt-1 sm:col-span-2 sm:mt-0" : "mt-1"]]) }, [renderSlot(_ctx.$slots, "value", {
106
+ item,
107
+ value: item.value
108
+ }, () => [isEmpty(item.value) ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.emptyText), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(item.value), 1)], 64))])], 2)], 2);
109
+ }), 128))], 16);
110
+ };
111
+ }
112
+ });
113
+ //#endregion
114
+ export { _sfc_main as default };
115
+
116
+ //# sourceMappingURL=DescriptionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DescriptionList.js","names":[],"sources":["../../src/components/DescriptionList.vue"],"sourcesContent":["<template>\n <dl :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <div v-for=\"(item, index) in items\" :key=\"item.key ?? item.label ?? index\" :class=\"rowClass\">\n <dt class=\"text-sm font-medium text-gray-500 dark:text-gray-400\">\n {{ item.label }}\n <span\n v-if=\"item.hint\"\n class=\"mt-0.5 block text-xs font-normal text-gray-400 dark:text-gray-500\"\n >{{ item.hint }}</span\n >\n </dt>\n <dd\n class=\"min-w-0 text-sm text-gray-900 dark:text-gray-100\"\n :class=\"[\n item.mono ? 'font-mono text-[13px] break-all' : 'break-words',\n layout === 'inline' ? 'mt-1 sm:col-span-2 sm:mt-0' : 'mt-1',\n ]\"\n >\n <slot name=\"value\" :item=\"item\" :value=\"item.value\">\n <span v-if=\"isEmpty(item.value)\" class=\"text-gray-400 dark:text-gray-500\">{{\n emptyText\n }}</span>\n <template v-else>{{ item.value }}</template>\n </slot>\n </dd>\n </div>\n </dl>\n</template>\n\n<script setup>\n/**\n * UiDescriptionList — label / value pairs, such as a record's details or a\n * service's settings, rendered as a real `<dl>`.\n *\n * Three layouts:\n * - `inline` (default): label in a narrow left column, value beside it, one\n * pair per row with dividers. Stacks on narrow screens.\n * - `stacked`: label above value, one pair per row.\n * - `grid`: label above value, pairs flowing into two columns.\n *\n * Empty values (`null`, `undefined`, `''`) render `emptyText` so a missing\n * setting reads as deliberate rather than as a rendering bug. Use the `#value`\n * slot to render badges, links or copy fields.\n *\n * @example\n * <UiDescriptionList\n * :items=\"[\n * { label: 'App id', value: 'notes', mono: true },\n * { label: 'Storage', value: 'postgres' },\n * { label: 'Audience', value: null, hint: 'Optional app/aud claim' },\n * ]\"\n * />\n *\n * @example Custom value rendering\n * <UiDescriptionList :items=\"items\">\n * <template #value=\"{ item, value }\">\n * <UiBadge v-if=\"item.key === 'status'\" color=\"green\">{{ value }}</UiBadge>\n * <template v-else>{{ value }}</template>\n * </template>\n * </UiDescriptionList>\n *\n * @slot value — Custom value content. Scope: `{ item, value }`.\n */\nimport { computed } from 'vue'\nimport { useMergedClasses } from '../composables/useMergedClasses.js'\n\nconst props = defineProps({\n /**\n * Pairs to show. Each is `{ label, value, key?, hint?, mono? }`; `mono`\n * renders the value in a monospace font that breaks anywhere (ids, keys).\n * @type {Array<{ label: string, value?: unknown, key?: string, hint?: string, mono?: boolean }>}\n */\n items: { type: Array, required: true },\n\n /**\n * Arrangement of each pair.\n * @type {string}\n * @default 'inline'\n * @values 'inline' | 'stacked' | 'grid'\n */\n layout: { type: String, default: 'inline' },\n\n /**\n * Dividers between rows (ignored by `grid`).\n * @type {boolean}\n * @default true\n */\n divided: { type: Boolean, default: true },\n\n /**\n * Shown in place of an empty value.\n * @type {string}\n * @default '—'\n */\n emptyText: { type: String, default: '—' },\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst isEmpty = (value) => value === null || value === undefined || value === ''\n\nconst rowClass = computed(() => {\n if (props.layout === 'grid') return ''\n if (props.layout === 'stacked') return 'py-3 first:pt-0 last:pb-0'\n return 'py-3 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4'\n})\n\nconst internalClasses = computed(() => {\n if (props.layout === 'grid') return 'grid gap-x-6 gap-y-4 sm:grid-cols-2'\n return props.divided ? 'divide-y divide-gray-100 dark:divide-gray-800' : ''\n})\n\nconst { mergedClasses, restAttrs } = useMergedClasses(() => internalClasses.value)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEA,MAAM,QAAQ;EAiCd,MAAM,WAAW,UAAU,UAAU,QAAQ,UAAU,KAAA,KAAa,UAAU;EAE9E,MAAM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GAAA,CAAA"}
@@ -0,0 +1,123 @@
1
+ import _sfc_main$1 from "../icons/Icon.js";
2
+ import { useMergedClasses } from "../composables/useMergedClasses.js";
3
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
4
+ //#region src/components/EmptyState.vue
5
+ var _hoisted_1 = {
6
+ class: "mx-auto flex size-12 items-center justify-center rounded-2xl bg-gray-100 text-gray-400 dark:bg-gray-800 dark:text-gray-500",
7
+ "aria-hidden": "true"
8
+ };
9
+ var _hoisted_2 = {
10
+ key: 0,
11
+ class: "mx-auto mt-1 max-w-sm text-sm text-gray-500 dark:text-gray-400"
12
+ };
13
+ var _hoisted_3 = {
14
+ key: 1,
15
+ class: "mt-5 flex flex-wrap justify-center gap-2"
16
+ };
17
+ var _sfc_main = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
18
+ __name: "EmptyState",
19
+ props: {
20
+ /**
21
+ * Short statement of the state, e.g. "No apps yet".
22
+ * @type {string}
23
+ * @default ''
24
+ */
25
+ title: {
26
+ type: String,
27
+ default: ""
28
+ },
29
+ /**
30
+ * One line explaining why, or what to do.
31
+ * @type {string}
32
+ * @default ''
33
+ */
34
+ description: {
35
+ type: String,
36
+ default: ""
37
+ },
38
+ /**
39
+ * MDI icon.
40
+ * @type {string}
41
+ * @default 'mdi:inbox-outline'
42
+ */
43
+ icon: {
44
+ type: String,
45
+ default: "mdi:inbox-outline"
46
+ },
47
+ /**
48
+ * Tighter vertical padding, for use inside cards and tables.
49
+ * @type {boolean}
50
+ * @default false
51
+ */
52
+ compact: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ /**
57
+ * Dashed outline around the state, for standalone use on a page.
58
+ * @type {boolean}
59
+ * @default false
60
+ */
61
+ bordered: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ /**
66
+ * Element used for the title.
67
+ * @type {string}
68
+ * @default 'h3'
69
+ * @values 'h2' | 'h3' | 'h4' | 'p'
70
+ */
71
+ headingTag: {
72
+ type: String,
73
+ default: "h3"
74
+ }
75
+ },
76
+ setup(__props) {
77
+ /**
78
+ * UiEmptyState — what a list, table or page shows when there is nothing in it
79
+ * yet: an icon, a short title, one line of explanation and the action that
80
+ * fixes it.
81
+ *
82
+ * Say why it is empty and what to do next, rather than only that it is empty.
83
+ *
84
+ * @example
85
+ * <UiEmptyState
86
+ * icon="mdi:sync"
87
+ * title="No apps yet"
88
+ * description="Register an app to give its clients a place to sync."
89
+ * >
90
+ * <UiButton><UiIcon name="mdi:plus" class="size-4" />New app</UiButton>
91
+ * </UiEmptyState>
92
+ *
93
+ * @slot default — Actions.
94
+ * @slot icon — Custom icon content.
95
+ * @slot description — Rich description (overrides `description`).
96
+ */
97
+ const props = __props;
98
+ const internalClasses = computed(() => [
99
+ "text-center",
100
+ props.compact ? "px-4 py-6" : "px-6 py-12",
101
+ props.bordered ? "rounded-2xl border-2 border-dashed border-gray-200 dark:border-gray-700" : ""
102
+ ].filter(Boolean).join(" "));
103
+ const { mergedClasses, restAttrs } = useMergedClasses(() => internalClasses.value);
104
+ return (_ctx, _cache) => {
105
+ return openBlock(), createElementBlock("div", mergeProps({ class: unref(mergedClasses) }, unref(restAttrs)), [
106
+ createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$1, {
107
+ name: __props.icon,
108
+ class: "size-6"
109
+ }, null, 8, ["name"])])]),
110
+ (openBlock(), createBlock(resolveDynamicComponent(__props.headingTag), { class: "mt-4 text-sm font-semibold text-gray-900 dark:text-gray-100" }, {
111
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
112
+ _: 1
113
+ })),
114
+ __props.description || _ctx.$slots.description ? (openBlock(), createElementBlock("p", _hoisted_2, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("", true),
115
+ _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("", true)
116
+ ], 16);
117
+ };
118
+ }
119
+ });
120
+ //#endregion
121
+ export { _sfc_main as default };
122
+
123
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","names":["$slots"],"sources":["../../src/components/EmptyState.vue"],"sourcesContent":["<template>\n <div :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <div\n class=\"mx-auto flex size-12 items-center justify-center rounded-2xl bg-gray-100 text-gray-400 dark:bg-gray-800 dark:text-gray-500\"\n aria-hidden=\"true\"\n >\n <slot name=\"icon\"><UiIcon :name=\"icon\" class=\"size-6\" /></slot>\n </div>\n <component :is=\"headingTag\" class=\"mt-4 text-sm font-semibold text-gray-900 dark:text-gray-100\">\n {{ title }}\n </component>\n <p\n v-if=\"description || $slots.description\"\n class=\"mx-auto mt-1 max-w-sm text-sm text-gray-500 dark:text-gray-400\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </p>\n <div v-if=\"$slots.default\" class=\"mt-5 flex flex-wrap justify-center gap-2\">\n <slot />\n </div>\n </div>\n</template>\n\n<script setup>\n/**\n * UiEmptyState — what a list, table or page shows when there is nothing in it\n * yet: an icon, a short title, one line of explanation and the action that\n * fixes it.\n *\n * Say why it is empty and what to do next, rather than only that it is empty.\n *\n * @example\n * <UiEmptyState\n * icon=\"mdi:sync\"\n * title=\"No apps yet\"\n * description=\"Register an app to give its clients a place to sync.\"\n * >\n * <UiButton><UiIcon name=\"mdi:plus\" class=\"size-4\" />New app</UiButton>\n * </UiEmptyState>\n *\n * @slot default — Actions.\n * @slot icon — Custom icon content.\n * @slot description — Rich description (overrides `description`).\n */\nimport { computed } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nimport { useMergedClasses } from '../composables/useMergedClasses.js'\n\nconst props = defineProps({\n /**\n * Short statement of the state, e.g. \"No apps yet\".\n * @type {string}\n * @default ''\n */\n title: { type: String, default: '' },\n\n /**\n * One line explaining why, or what to do.\n * @type {string}\n * @default ''\n */\n description: { type: String, default: '' },\n\n /**\n * MDI icon.\n * @type {string}\n * @default 'mdi:inbox-outline'\n */\n icon: { type: String, default: 'mdi:inbox-outline' },\n\n /**\n * Tighter vertical padding, for use inside cards and tables.\n * @type {boolean}\n * @default false\n */\n compact: { type: Boolean, default: false },\n\n /**\n * Dashed outline around the state, for standalone use on a page.\n * @type {boolean}\n * @default false\n */\n bordered: { type: Boolean, default: false },\n\n /**\n * Element used for the title.\n * @type {string}\n * @default 'h3'\n * @values 'h2' | 'h3' | 'h4' | 'p'\n */\n headingTag: { type: String, default: 'h3' },\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst internalClasses = computed(() =>\n [\n 'text-center',\n props.compact ? 'px-4 py-6' : 'px-6 py-12',\n props.bordered ? 'rounded-2xl border-2 border-dashed border-gray-200 dark:border-gray-700' : '',\n ]\n .filter(Boolean)\n .join(' '),\n)\n\nconst { mergedClasses, restAttrs } = useMergedClasses(() => internalClasses.value)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDA,MAAM,QAAQ;EA+Cd,MAAM,kBAAkB,eACtB;GACE;GACA,MAAM,UAAU,cAAc;GAC9B,MAAM,WAAW,4EAA4E;EAC/F,CAAA,CACG,OAAO,OAAO,CAAA,CACd,KAAK,GAAG,CACb;EAEA,MAAM,EAAE,eAAe,cAAc,uBAAuB,gBAAgB,KAAK;;GAxG/E,OAAA,UAAA,GAAA,mBAmBM,OAnBN,WAmBM,EAnBA,OAAO,MAAA,aAAA,EAAa,GAAU,MAAA,SAAA,CAAS,GAAA;IAC3C,mBAKM,OALN,YAKM,CADJ,WAA+D,KAAA,QAAA,QAAA,CAAA,SAAA,CAA7C,YAAsC,aAAA;KAA7B,MAAM,QAAA;KAAM,OAAM;;KAE/C,UAAA,GAAA,YAEY,wBAFI,QAAA,UAAU,GAAA,EAAE,OAAM,8DAA6D,GAAA;KAC7F,SAAA,cAAW,CAAR,gBAAA,gBAAA,QAAA,KAAK,GAAA,CAAA,CAAA,CAAA;;;IAGF,QAAA,eAAeA,KAAAA,OAAO,eAD9B,UAAA,GAAA,mBAKI,KALJ,YAKI,CADF,WAAiD,KAAA,QAAA,eAAA,CAAA,SAAA,CAArB,gBAAA,gBAAA,QAAA,WAAW,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;IAE9BA,KAAAA,OAAO,WAAlB,UAAA,GAAA,mBAEM,OAFN,YAEM,CADJ,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA"}
@@ -1,17 +1,11 @@
1
- import { computed, createCommentVNode, createElementBlock, createTextVNode, normalizeClass, openBlock, renderSlot, toDisplayString } from "vue";
1
+ import { FORM_FIELD_KEY } from "../internal/formField.js";
2
+ import { computed, createCommentVNode, createElementBlock, createTextVNode, normalizeClass, openBlock, provide, renderSlot, toDisplayString, useId } from "vue";
2
3
  //#region src/components/FormField.vue
3
- var _hoisted_1 = {
4
+ var _hoisted_1 = ["for"];
5
+ var _hoisted_2 = {
4
6
  key: 0,
5
7
  class: "font-normal text-gray-400 dark:text-gray-600"
6
8
  };
7
- var _hoisted_2 = {
8
- key: 1,
9
- class: "text-xs text-gray-500 dark:text-gray-500 mt-1"
10
- };
11
- var _hoisted_3 = {
12
- key: 2,
13
- class: "text-xs text-red-600 dark:text-red-400 mt-1"
14
- };
15
9
  var _sfc_main = {
16
10
  __name: "FormField",
17
11
  props: {
@@ -59,6 +53,16 @@ var _sfc_main = {
59
53
  inline: {
60
54
  type: Boolean,
61
55
  default: false
56
+ },
57
+ /**
58
+ * Id of the control the label points at. Generated when omitted; set it
59
+ * when the control is not a Numori UI form component.
60
+ * @type {string}
61
+ * @default ''
62
+ */
63
+ for: {
64
+ type: String,
65
+ default: ""
62
66
  }
63
67
  },
64
68
  setup(__props) {
@@ -89,19 +93,45 @@ var _sfc_main = {
89
93
  * <UiToggle v-model="ligatures" />
90
94
  * </UiFormField>
91
95
  *
96
+ * The label is associated with the control: UiInput, UiSelect, UiToggle,
97
+ * UiCheckbox and UiSegmented pick up the field's id, so the label, hint and
98
+ * error are announced by screen readers and clicking the label focuses the
99
+ * control. For any other control, give it the id passed as `for`.
100
+ *
92
101
  * @slot default — Form control (e.g. UiInput, UiSelect, UiToggle)
93
102
  */
94
103
  const props = __props;
104
+ const uid = useId();
105
+ const controlId = computed(() => props.for || `${uid}-control`);
106
+ const labelId = `${uid}-label`;
107
+ const hintId = `${uid}-hint`;
108
+ const errorId = `${uid}-error`;
109
+ provide(FORM_FIELD_KEY, {
110
+ controlId,
111
+ labelId,
112
+ describedBy: computed(() => [props.hint ? hintId : null, props.error ? errorId : null].filter(Boolean).join(" ") || void 0),
113
+ invalid: computed(() => !!props.error)
114
+ });
95
115
  const labelClasses = computed(() => props.inline ? "block text-sm font-medium text-gray-700 dark:text-gray-400" : "block text-sm font-medium text-gray-700 dark:text-gray-400 mb-1");
96
116
  return (_ctx, _cache) => {
97
117
  return openBlock(), createElementBlock("div", null, [
98
118
  __props.label ? (openBlock(), createElementBlock("label", {
99
119
  key: 0,
120
+ id: labelId,
121
+ for: controlId.value,
100
122
  class: normalizeClass(labelClasses.value)
101
- }, [createTextVNode(toDisplayString(__props.label) + " ", 1), __props.optional ? (openBlock(), createElementBlock("span", _hoisted_1, "(optional)")) : createCommentVNode("", true)], 2)) : createCommentVNode("", true),
123
+ }, [createTextVNode(toDisplayString(__props.label) + " ", 1), __props.optional ? (openBlock(), createElementBlock("span", _hoisted_2, "(optional)")) : createCommentVNode("", true)], 10, _hoisted_1)) : createCommentVNode("", true),
102
124
  renderSlot(_ctx.$slots, "default"),
103
- __props.hint ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(__props.hint), 1)) : createCommentVNode("", true),
104
- __props.error ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.error), 1)) : createCommentVNode("", true)
125
+ __props.hint ? (openBlock(), createElementBlock("p", {
126
+ key: 1,
127
+ id: hintId,
128
+ class: "text-xs text-gray-500 dark:text-gray-500 mt-1"
129
+ }, toDisplayString(__props.hint), 1)) : createCommentVNode("", true),
130
+ __props.error ? (openBlock(), createElementBlock("p", {
131
+ key: 2,
132
+ id: errorId,
133
+ class: "text-xs text-red-600 dark:text-red-400 mt-1"
134
+ }, toDisplayString(__props.error), 1)) : createCommentVNode("", true)
105
135
  ]);
106
136
  };
107
137
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FormField.js","names":[],"sources":["../../src/components/FormField.vue"],"sourcesContent":["<template>\n <div>\n <label v-if=\"label\" :class=\"labelClasses\">\n {{ label }}\n <span v-if=\"optional\" class=\"font-normal text-gray-400 dark:text-gray-600\">(optional)</span>\n </label>\n <slot />\n <p v-if=\"hint\" class=\"text-xs text-gray-500 dark:text-gray-500 mt-1\">{{ hint }}</p>\n <p v-if=\"error\" class=\"text-xs text-red-600 dark:text-red-400 mt-1\">{{ error }}</p>\n </div>\n</template>\n\n<script setup>\n/**\n * UiFormField — Label + input wrapper with optional hint and error text.\n *\n * Wraps any form control (UiInput, UiSelect, etc.) with a consistent label,\n * optional \"(optional)\" suffix, hint text below the input, and error message.\n * Reduces the repeated label + div + hint pattern across all form-heavy modals.\n *\n * @example Basic field\n * <UiFormField label=\"Email\">\n * <UiInput v-model=\"email\" type=\"email\" />\n * </UiFormField>\n *\n * @example Field with hint and optional marker\n * <UiFormField label=\"Password hint\" optional hint=\"A clue to help remember\">\n * <UiInput v-model=\"hint\" />\n * </UiFormField>\n *\n * @example Field with error\n * <UiFormField label=\"Password\" :error=\"pwError\">\n * <UiInput v-model=\"pw\" type=\"password\" />\n * </UiFormField>\n *\n * @example Inline label style (no bottom margin)\n * <UiFormField label=\"Font Ligatures\" inline>\n * <UiToggle v-model=\"ligatures\" />\n * </UiFormField>\n *\n * @slot default — Form control (e.g. UiInput, UiSelect, UiToggle)\n */\nimport { computed } from 'vue'\nconst props = defineProps({\n /**\n * Label text displayed above the input.\n * @type {string}\n * @default ''\n */\n label: { type: String, default: '' },\n\n /**\n * Show \"(optional)\" suffix after the label.\n * @type {boolean}\n * @default false\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Hint text displayed below the input in gray.\n * @type {string}\n * @default ''\n */\n hint: { type: String, default: '' },\n\n /**\n * Error message displayed below the input in red.\n * @type {string}\n * @default ''\n */\n error: { type: String, default: '' },\n\n /**\n * Inline label style — no bottom margin, suitable for toggle rows.\n * @type {boolean}\n * @default false\n */\n inline: { type: Boolean, default: false },\n})\n\nconst labelClasses = computed(() =>\n props.inline\n ? 'block text-sm font-medium text-gray-700 dark:text-gray-400'\n : 'block text-sm font-medium text-gray-700 dark:text-gray-400 mb-1',\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,QAAQ;EAqCd,MAAM,eAAe,eACnB,MAAM,SACF,+DACA,iEACN;;GAnFE,OAAA,UAAA,GAAA,mBAQM,OAAA,MAAA;IAPS,QAAA,SAAb,UAAA,GAAA,mBAGQ,SAAA;;KAHa,OAAK,eAAE,aAAA,KAAY;IACnC,GAAA,CAAA,gBAAA,gBAAA,QAAA,KAAK,IAAG,KACX,CAAA,GAAY,QAAA,YAAZ,UAAA,GAAA,mBAA4F,QAA5F,YAA2E,YAAU,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;IAEvF,WAAQ,KAAA,QAAA,SAAA;IACC,QAAA,QAAT,UAAA,GAAA,mBAAmF,KAAnF,YAAmF,gBAAX,QAAA,IAAI,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;IACnE,QAAA,SAAT,UAAA,GAAA,mBAAmF,KAAnF,YAAmF,gBAAZ,QAAA,KAAK,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA"}
1
+ {"version":3,"file":"FormField.js","names":[],"sources":["../../src/components/FormField.vue"],"sourcesContent":["<template>\n <div>\n <label v-if=\"label\" :id=\"labelId\" :for=\"controlId\" :class=\"labelClasses\">\n {{ label }}\n <span v-if=\"optional\" class=\"font-normal text-gray-400 dark:text-gray-600\">(optional)</span>\n </label>\n <slot />\n <p v-if=\"hint\" :id=\"hintId\" class=\"text-xs text-gray-500 dark:text-gray-500 mt-1\">{{ hint }}</p>\n <p v-if=\"error\" :id=\"errorId\" class=\"text-xs text-red-600 dark:text-red-400 mt-1\">\n {{ error }}\n </p>\n </div>\n</template>\n\n<script setup>\n/**\n * UiFormField — Label + input wrapper with optional hint and error text.\n *\n * Wraps any form control (UiInput, UiSelect, etc.) with a consistent label,\n * optional \"(optional)\" suffix, hint text below the input, and error message.\n * Reduces the repeated label + div + hint pattern across all form-heavy modals.\n *\n * @example Basic field\n * <UiFormField label=\"Email\">\n * <UiInput v-model=\"email\" type=\"email\" />\n * </UiFormField>\n *\n * @example Field with hint and optional marker\n * <UiFormField label=\"Password hint\" optional hint=\"A clue to help remember\">\n * <UiInput v-model=\"hint\" />\n * </UiFormField>\n *\n * @example Field with error\n * <UiFormField label=\"Password\" :error=\"pwError\">\n * <UiInput v-model=\"pw\" type=\"password\" />\n * </UiFormField>\n *\n * @example Inline label style (no bottom margin)\n * <UiFormField label=\"Font Ligatures\" inline>\n * <UiToggle v-model=\"ligatures\" />\n * </UiFormField>\n *\n * The label is associated with the control: UiInput, UiSelect, UiToggle,\n * UiCheckbox and UiSegmented pick up the field's id, so the label, hint and\n * error are announced by screen readers and clicking the label focuses the\n * control. For any other control, give it the id passed as `for`.\n *\n * @slot default — Form control (e.g. UiInput, UiSelect, UiToggle)\n */\nimport { computed, provide, useId } from 'vue'\nimport { FORM_FIELD_KEY } from '../internal/formField.js'\nconst props = defineProps({\n /**\n * Label text displayed above the input.\n * @type {string}\n * @default ''\n */\n label: { type: String, default: '' },\n\n /**\n * Show \"(optional)\" suffix after the label.\n * @type {boolean}\n * @default false\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Hint text displayed below the input in gray.\n * @type {string}\n * @default ''\n */\n hint: { type: String, default: '' },\n\n /**\n * Error message displayed below the input in red.\n * @type {string}\n * @default ''\n */\n error: { type: String, default: '' },\n\n /**\n * Inline label style — no bottom margin, suitable for toggle rows.\n * @type {boolean}\n * @default false\n */\n inline: { type: Boolean, default: false },\n\n /**\n * Id of the control the label points at. Generated when omitted; set it\n * when the control is not a Numori UI form component.\n * @type {string}\n * @default ''\n */\n for: { type: String, default: '' },\n})\n\nconst uid = useId()\nconst controlId = computed(() => props.for || `${uid}-control`)\nconst labelId = `${uid}-label`\nconst hintId = `${uid}-hint`\nconst errorId = `${uid}-error`\n\nprovide(FORM_FIELD_KEY, {\n controlId,\n labelId,\n describedBy: computed(\n () =>\n [props.hint ? hintId : null, props.error ? errorId : null].filter(Boolean).join(' ') ||\n undefined,\n ),\n invalid: computed(() => !!props.error),\n})\n\nconst labelClasses = computed(() =>\n props.inline\n ? 'block text-sm font-medium text-gray-700 dark:text-gray-400'\n : 'block text-sm font-medium text-gray-700 dark:text-gray-400 mb-1',\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,QAAQ;EA6Cd,MAAM,MAAM,MAAM;EAClB,MAAM,YAAY,eAAe,MAAM,OAAO,GAAG,IAAI,SAAS;EAC9D,MAAM,UAAU,GAAG,IAAI;EACvB,MAAM,SAAS,GAAG,IAAI;EACtB,MAAM,UAAU,GAAG,IAAI;EAEvB,QAAQ,gBAAgB;GACtB;GACA;GACA,aAAa,eAET,CAAC,MAAM,OAAO,SAAS,MAAM,MAAM,QAAQ,UAAU,IAAI,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KACnF,KAAA,CACJ;GACA,SAAS,eAAe,CAAC,CAAC,MAAM,KAAK;EACvC,CAAC;EAED,MAAM,eAAe,eACnB,MAAM,SACF,+DACA,iEACN;;GApHE,OAAA,UAAA,GAAA,mBAUM,OAAA,MAAA;IATS,QAAA,SAAb,UAAA,GAAA,mBAGQ,SAAA;;KAHa,IAAI;KAAU,KAAK,UAAA;KAAY,OAAK,eAAE,aAAA,KAAY;IAClE,GAAA,CAAA,gBAAA,gBAAA,QAAA,KAAK,IAAG,KACX,CAAA,GAAY,QAAA,YAAZ,UAAA,GAAA,mBAA4F,QAA5F,YAA2E,YAAU,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,IAAA,UAAA,KAAA,mBAAA,IAAA,IAAA;IAEvF,WAAQ,KAAA,QAAA,SAAA;IACC,QAAA,QAAT,UAAA,GAAA,mBAAgG,KAAA;;KAAhF,IAAI;KAAQ,OAAM;IAAmD,GAAA,gBAAA,QAAA,IAAI,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;IAChF,QAAA,SAAT,UAAA,GAAA,mBAEI,KAAA;;KAFa,IAAI;KAAS,OAAM;IAC/B,GAAA,gBAAA,QAAA,KAAK,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA"}
@@ -1,9 +1,13 @@
1
1
  import _sfc_main$1 from "../icons/Icon.js";
2
- import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, toDisplayString, useSlots, watch, withModifiers } from "vue";
2
+ import { useFormField } from "../internal/formField.js";
3
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, toDisplayString, unref, useSlots, watch, withModifiers } from "vue";
3
4
  //#region src/components/Input.vue
4
5
  var _hoisted_1 = { class: "w-full" };
5
6
  var _hoisted_2 = { class: "relative flex" };
6
7
  var _hoisted_3 = [
8
+ "id",
9
+ "aria-describedby",
10
+ "aria-invalid",
7
11
  "value",
8
12
  "placeholder",
9
13
  "required",
@@ -17,6 +21,9 @@ var _hoisted_4 = {
17
21
  class: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400 dark:text-gray-500"
18
22
  };
19
23
  var _hoisted_5 = [
24
+ "id",
25
+ "aria-describedby",
26
+ "aria-invalid",
20
27
  "type",
21
28
  "value",
22
29
  "placeholder",
@@ -325,6 +332,7 @@ var _sfc_main = {
325
332
  */
326
333
  const props = __props;
327
334
  const emit = __emit;
335
+ const field = useFormField();
328
336
  const inputRef = ref(null);
329
337
  const passwordVisible = ref(false);
330
338
  const touched = ref(false);
@@ -489,8 +497,11 @@ var _sfc_main = {
489
497
  })])], 2)) : createCommentVNode("", true),
490
498
  isTextarea.value ? (openBlock(), createElementBlock("textarea", {
491
499
  key: 2,
500
+ id: unref(field)?.controlId.value,
492
501
  ref_key: "inputRef",
493
502
  ref: inputRef,
503
+ "aria-describedby": unref(field)?.describedBy.value,
504
+ "aria-invalid": unref(field)?.invalid.value ? "true" : void 0,
494
505
  value: __props.modelValue,
495
506
  placeholder: __props.placeholder,
496
507
  required: __props.required,
@@ -510,8 +521,11 @@ var _sfc_main = {
510
521
  }, null, 8, ["name"])) : createCommentVNode("", true)])])) : createCommentVNode("", true),
511
522
  !isTextarea.value ? (openBlock(), createElementBlock("input", {
512
523
  key: 4,
524
+ id: unref(field)?.controlId.value,
513
525
  ref_key: "inputRef",
514
526
  ref: inputRef,
527
+ "aria-describedby": unref(field)?.describedBy.value,
528
+ "aria-invalid": unref(field)?.invalid.value ? "true" : void 0,
515
529
  type: computedType.value,
516
530
  value: __props.modelValue,
517
531
  placeholder: __props.placeholder,
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","names":["$slots"],"sources":["../../src/components/Input.vue"],"sourcesContent":["<template>\n <div class=\"w-full\">\n <div class=\"relative flex\">\n <!-- Number stepper: minus button on left (both-sides layout) -->\n <button\n v-if=\"isNumber && stepperLayout === 'both-sides'\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"flex items-center justify-center w-9 rounded-l-lg border border-r-0 border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n aria-label=\"Decrease value\"\n @click=\"stepDown\"\n >\n <UiIcon name=\"mdi:minus\" class=\"w-4 h-4\" />\n </button>\n\n <!-- Number stepper: stacked up/down buttons on left -->\n <div\n v-if=\"isNumber && stepperLayout === 'stacked-left'\"\n class=\"flex flex-col w-7 border border-r-0 border-gray-300 dark:border-gray-600 rounded-l-lg overflow-hidden\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n >\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none border-b border-gray-300 dark:border-gray-600\"\n aria-label=\"Increase value\"\n @click=\"stepUp\"\n >\n <UiIcon name=\"mdi:chevron-up\" class=\"block w-3 h-3\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n aria-label=\"Decrease value\"\n @click=\"stepDown\"\n >\n <UiIcon name=\"mdi:chevron-down\" class=\"block w-3 h-3\" />\n </button>\n </div>\n\n <!-- Textarea mode: multi-line text input with custom scrollbar styling -->\n <textarea\n v-if=\"isTextarea\"\n ref=\"inputRef\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :rows=\"rows\"\n :maxlength=\"maxlength\"\n class=\"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-400 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none text-sm transition-colors [scrollbar-width:thin] [scrollbar-color:var(--color-gray-300)_transparent] dark:[scrollbar-color:var(--color-gray-600)_transparent] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-thumb]:bg-gray-600 hover:[&::-webkit-scrollbar-thumb]:bg-gray-400 dark:hover:[&::-webkit-scrollbar-thumb]:bg-gray-500\"\n :class=\"resizeClass\"\n :style=\"textareaStyle\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n />\n\n <!-- The actual input element (text, number, password, email, phone) -->\n <!-- Left icon/image slot -->\n <span\n v-if=\"!isTextarea && ($slots.left || iconLeft)\"\n class=\"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400 dark:text-gray-500\"\n >\n <slot name=\"left\">\n <UiIcon v-if=\"iconLeft\" :name=\"iconLeft\" class=\"w-4 h-4\" />\n </slot>\n </span>\n\n <input\n v-if=\"!isTextarea\"\n ref=\"inputRef\"\n :type=\"computedType\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :minlength=\"minlength\"\n :maxlength=\"maxlength\"\n :inputmode=\"computedInputMode\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :pattern=\"pattern\"\n class=\"w-full py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-400 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none text-sm transition-colors\"\n :class=\"inputClasses\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n />\n\n <!-- Right icon/image slot (hidden when clear button or password toggle is shown) -->\n <span\n v-if=\"\n !isTextarea &&\n ($slots.right || iconRight) &&\n !(clearable && modelValue) &&\n !(isPassword && showToggle)\n \"\n class=\"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-gray-400 dark:text-gray-500\"\n >\n <slot name=\"right\">\n <UiIcon v-if=\"iconRight\" :name=\"iconRight\" class=\"w-4 h-4\" />\n </slot>\n </span>\n\n <!-- Clear button -->\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors\"\n aria-label=\"Clear\"\n @mousedown.prevent\n @click=\"emit('update:modelValue', '')\"\n >\n <UiIcon name=\"mdi:close-circle\" class=\"w-4 h-4\" />\n </button>\n\n <!-- Password visibility toggle button -->\n <button\n v-if=\"isPassword && showToggle\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors\"\n :aria-label=\"passwordVisible ? 'Hide password' : 'Show password'\"\n @mousedown.prevent\n @click=\"passwordVisible = !passwordVisible\"\n >\n <UiIcon\n :name=\"passwordVisible ? 'mdi:eye-off-outline' : 'mdi:eye-outline'\"\n class=\"w-4 h-4\"\n />\n </button>\n\n <!-- Number stepper: stacked up/down buttons on right -->\n <div\n v-if=\"isNumber && stepperLayout === 'stacked-right'\"\n class=\"flex flex-col w-7 border border-l-0 border-gray-300 dark:border-gray-600 rounded-r-lg overflow-hidden\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n >\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none border-b border-gray-300 dark:border-gray-600\"\n aria-label=\"Increase value\"\n @click=\"stepUp\"\n >\n <UiIcon name=\"mdi:chevron-up\" class=\"block w-3 h-3\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n aria-label=\"Decrease value\"\n @click=\"stepDown\"\n >\n <UiIcon name=\"mdi:chevron-down\" class=\"block w-3 h-3\" />\n </button>\n </div>\n\n <!-- Number stepper: plus button on right (both-sides layout) -->\n <button\n v-if=\"isNumber && stepperLayout === 'both-sides'\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"flex items-center justify-center w-9 rounded-r-lg border border-l-0 border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n aria-label=\"Increase value\"\n @click=\"stepUp\"\n >\n <UiIcon name=\"mdi:plus\" class=\"w-4 h-4\" />\n </button>\n </div>\n\n <!-- Validation error message (shown after first blur) -->\n <p v-if=\"showError && validationError\" class=\"text-xs text-red-600 dark:text-red-400 mt-1\">\n {{ validationError }}\n </p>\n </div>\n</template>\n\n<script setup>\n/**\n * UiInput — Multi-purpose input component supporting text, number, password, email,\n * phone, and textarea modes in a single unified interface.\n *\n * Features:\n * - Number mode with configurable stepper layouts (both-sides, stacked-left, stacked-right, none)\n * - Password mode with show/hide toggle\n * - Textarea mode with configurable resize, min/max dimensions\n * - Built-in validation for email, phone, and number patterns\n * - Custom regex validation with configurable error messages\n * - Exposes `focus()` method and `el` ref for parent control\n *\n * @example Basic text input\n * <UiInput v-model=\"name\" placeholder=\"Enter your name\" />\n *\n * @example Number input with min/max\n * <UiInput v-model=\"quantity\" type=\"number\" :min=\"0\" :max=\"100\" :step=\"1\" />\n *\n * @example Password with toggle\n * <UiInput v-model=\"password\" type=\"password\" />\n *\n * @example Textarea\n * <UiInput v-model=\"bio\" type=\"textarea\" :rows=\"5\" resize=\"vertical\" />\n *\n * @example Email with validation\n * <UiInput v-model=\"email\" type=\"email\" :validate=\"true\" />\n *\n * @emits {string | number} update:modelValue — Emitted when the input value changes (v-model)\n * @emits {{ valid: boolean, error: string | null }} validation — Emitted when the validation state changes\n */\nimport { ref, computed, watch, useSlots } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nconst props = defineProps({\n /**\n * Bound value (v-model).\n * @type {string | number}\n * @default ''\n */\n modelValue: { type: [String, Number], default: '' },\n\n /**\n * Input type determining the mode and behavior.\n * @type {string}\n * @default 'text'\n * @values 'text' | 'number' | 'password' | 'email' | 'phone' | 'textarea'\n */\n type: { type: String, default: 'text' },\n\n /**\n * Placeholder text shown when the input is empty.\n * @type {string}\n * @default ''\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Whether the field is required for form validation.\n * @type {boolean}\n * @default false\n */\n required: { type: Boolean, default: false },\n\n /**\n * Disabled state — dims the input and prevents interaction.\n * @type {boolean}\n * @default false\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Read-only state — allows focus/selection but prevents editing.\n * @type {boolean}\n * @default false\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * HTML autocomplete attribute hint for the browser.\n * @type {string}\n * @default undefined\n */\n autocomplete: { type: String, default: undefined },\n\n /**\n * Minimum character length for text validation.\n * @type {number}\n * @default undefined\n */\n minlength: { type: Number, default: undefined },\n\n /**\n * Maximum character length for text validation.\n * @type {number}\n * @default undefined\n */\n maxlength: { type: Number, default: undefined },\n\n // ── Textarea-specific props ──\n\n /**\n * Number of visible text rows (textarea mode only).\n * @type {number}\n * @default 3\n */\n rows: { type: Number, default: 3 },\n\n /**\n * Resize behavior for textarea mode.\n * @type {string}\n * @default 'none'\n * @values 'none' | 'vertical' | 'horizontal' | 'both'\n */\n resize: { type: String, default: 'none' },\n\n /**\n * Minimum height CSS value for textarea (e.g. '80px', '5rem').\n * @type {string}\n * @default undefined\n */\n minHeight: { type: String, default: undefined },\n\n /**\n * Maximum height CSS value for textarea (e.g. '300px', '20rem').\n * @type {string}\n * @default undefined\n */\n maxHeight: { type: String, default: undefined },\n\n /**\n * Minimum width CSS value for textarea (e.g. '200px').\n * @type {string}\n * @default undefined\n */\n minWidth: { type: String, default: undefined },\n\n /**\n * Maximum width CSS value for textarea (e.g. '600px').\n * @type {string}\n * @default undefined\n */\n maxWidth: { type: String, default: undefined },\n\n /**\n * HTML pattern attribute for native form validation.\n * @type {string}\n * @default undefined\n */\n pattern: { type: String, default: undefined },\n\n // ── Password-specific props ──\n\n /**\n * Show the password visibility toggle button (password mode only).\n * @type {boolean}\n * @default true\n */\n showToggle: { type: Boolean, default: true },\n\n // ── Number-specific props ──\n\n /**\n * Minimum allowed numeric value.\n * @type {number}\n * @default undefined\n */\n min: { type: Number, default: undefined },\n\n /**\n * Maximum allowed numeric value.\n * @type {number}\n * @default undefined\n */\n max: { type: Number, default: undefined },\n\n /**\n * Step increment for number stepper buttons.\n * @type {number}\n * @default 1\n */\n step: { type: Number, default: 1 },\n\n /**\n * Layout of the +/- stepper buttons for number inputs.\n * @type {string}\n * @default 'both-sides'\n * @values 'stacked-left' | 'stacked-right' | 'both-sides' | 'none'\n */\n stepperLayout: { type: String, default: 'both-sides' },\n\n // ── Validation props ──\n\n /**\n * Show a clear button when the input has a value.\n * @type {boolean}\n * @default false\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Icon name to display on the left side of the input.\n * @type {string}\n * @default undefined\n */\n iconLeft: { type: String, default: undefined },\n\n /**\n * Icon name to display on the right side of the input.\n * @type {string}\n * @default undefined\n */\n iconRight: { type: String, default: undefined },\n\n /**\n * Enable built-in validation feedback shown below the input on blur.\n * @type {boolean}\n * @default true\n */\n validate: { type: Boolean, default: true },\n\n /**\n * Custom regex pattern string — overrides built-in type-based patterns.\n * @type {string}\n * @default undefined\n */\n validationPattern: { type: String, default: undefined },\n\n /**\n * Custom error message shown when validation fails.\n * @type {string}\n * @default undefined\n */\n validationMessage: { type: String, default: undefined },\n})\n\nconst emit = defineEmits(['update:modelValue', 'validation'])\n\nconst inputRef = ref(null)\nconst passwordVisible = ref(false)\nconst touched = ref(false)\n\n// --- Computed helpers ---\n\n// Detect input mode from the type prop\nconst isPassword = computed(() => props.type === 'password')\nconst isNumber = computed(() => props.type === 'number')\nconst isTextarea = computed(() => props.type === 'textarea')\n\n// Map resize prop to Tailwind resize utility class\nconst resizeClass = computed(() => {\n const map = { none: 'resize-none', vertical: 'resize-y', horizontal: 'resize-x', both: 'resize' }\n return map[props.resize] || 'resize-none'\n})\n\nconst textareaStyle = computed(() => {\n const s = {}\n if (props.minHeight) s.minHeight = props.minHeight\n if (props.maxHeight) s.maxHeight = props.maxHeight\n if (props.minWidth) s.minWidth = props.minWidth\n if (props.maxWidth) s.maxWidth = props.maxWidth\n return s\n})\n\n// For number type, render as text input so we can filter keystrokes ourselves\nconst computedType = computed(() => {\n if (isPassword.value) return passwordVisible.value ? 'text' : 'password'\n if (isNumber.value) return 'text' // we handle number filtering ourselves\n if (props.type === 'phone') return 'tel'\n return props.type\n})\n\n// Set appropriate mobile keyboard via inputmode attribute\nconst computedInputMode = computed(() => {\n if (isNumber.value) return 'decimal'\n if (props.type === 'phone') return 'tel'\n if (props.type === 'email') return 'email'\n return undefined\n})\n\nconst hasStepper = computed(() => isNumber.value && props.stepperLayout !== 'none')\n\nconst slots = useSlots()\n\nconst hasLeftIcon = computed(() => !!props.iconLeft || !!slots.left)\nconst hasRightIcon = computed(() => !!props.iconRight || !!slots.right)\n\nconst inputClasses = computed(() => {\n const classes = []\n\n // Horizontal padding — tighter when steppers are present\n if (hasStepper.value) {\n classes.push('px-1.5')\n } else {\n // Adjust padding for icons/slots\n classes.push(hasLeftIcon.value ? 'pl-9' : 'pl-3')\n classes.push(hasRightIcon.value ? 'pr-9' : 'pr-3')\n }\n\n // Rounding based on stepper layout\n if (hasStepper.value) {\n if (props.stepperLayout === 'both-sides') classes.push('rounded-none')\n else if (props.stepperLayout === 'stacked-left') classes.push('rounded-l-none', 'rounded-r-lg')\n else if (props.stepperLayout === 'stacked-right') classes.push('rounded-r-none', 'rounded-l-lg')\n } else {\n classes.push('rounded-lg')\n }\n\n // Extra right padding for password toggle\n if (isPassword.value && props.showToggle) classes.push('pr-10')\n\n // Extra right padding for clear button\n if (props.clearable) classes.push('pr-8')\n\n // Number text alignment\n if (isNumber.value && hasStepper.value) classes.push('text-center')\n\n return classes\n})\n\n// --- Validation ---\n\n// Built-in regex patterns for common input types\nconst PATTERNS = {\n email: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,\n phone: /^\\+?[\\d\\s\\-().]{7,}$/,\n number: /^-?\\d*\\.?\\d+$/,\n}\n\nconst MESSAGES = {\n email: 'Please enter a valid email address',\n phone: 'Please enter a valid phone number',\n number: 'Please enter a valid number',\n}\n\nconst validationError = computed(() => {\n const val = String(props.modelValue ?? '')\n if (!val) return null\n\n // Custom pattern takes priority\n if (props.validationPattern) {\n const re = new RegExp(props.validationPattern)\n if (!re.test(val)) return props.validationMessage || 'Invalid format'\n }\n\n // Built-in patterns\n const builtIn = PATTERNS[props.type]\n if (builtIn && !builtIn.test(val)) {\n return props.validationMessage || MESSAGES[props.type] || 'Invalid input'\n }\n\n return null\n})\n\nconst showError = computed(() => props.validate && touched.value)\n\nwatch(validationError, (err) => {\n emit('validation', { valid: !err, error: err })\n})\n\n// --- Event handlers ---\n\n// Regex for validating partial number input (allows intermediate states like \"-\" or \".\")\nconst NUMBER_ALLOWED = /^-?\\d*\\.?\\d*$/\n\nfunction onInput(e) {\n const val = e.target.value\n\n // For number type, reject non-numeric characters\n if (isNumber.value) {\n if (!NUMBER_ALLOWED.test(val)) {\n // Revert to previous valid value\n e.target.value = String(props.modelValue ?? '')\n return\n }\n }\n\n emit(\n 'update:modelValue',\n isNumber.value && val !== '' && val !== '-' && val !== '.' && val !== '-.' ? Number(val) : val,\n )\n}\n\nfunction onBlur() {\n touched.value = true\n}\n\nfunction onKeydown(e) {\n if (!isNumber.value) return\n\n // Allow: backspace, delete, tab, escape, enter, arrows, home, end, decimal point, minus\n const allowed = [\n 'Backspace',\n 'Delete',\n 'Tab',\n 'Escape',\n 'Enter',\n 'ArrowLeft',\n 'ArrowRight',\n 'Home',\n 'End',\n ]\n if (allowed.includes(e.key)) return\n if (e.key === '.' && !String(props.modelValue).includes('.')) return\n if (e.key === '-' && e.target.selectionStart === 0 && !String(props.modelValue).includes('-'))\n return\n if (e.ctrlKey || e.metaKey) return // allow copy/paste/select-all\n\n // Block non-digit keys\n if (!/^\\d$/.test(e.key)) {\n e.preventDefault()\n }\n}\n\nfunction stepUp() {\n const current = Number(props.modelValue) || 0\n let next = current + (props.step ?? 1)\n if (props.max !== undefined) next = Math.min(next, props.max)\n emit('update:modelValue', next)\n}\n\nfunction stepDown() {\n const current = Number(props.modelValue) || 0\n let next = current - (props.step ?? 1)\n if (props.min !== undefined) next = Math.max(next, props.min)\n emit('update:modelValue', next)\n}\n\n// Expose focus method\ndefineExpose({\n focus: () => inputRef.value?.focus(),\n el: inputRef,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2NA,MAAM,QAAQ;EA0Md,MAAM,OAAO;EAEb,MAAM,WAAW,IAAI,IAAI;EACzB,MAAM,kBAAkB,IAAI,KAAK;EACjC,MAAM,UAAU,IAAI,KAAK;EAKzB,MAAM,aAAa,eAAe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A,CAAA;IAEpD,GAAA,CAAA,mBAQS,UAAA;KAPP,MAAK;KACL,UAAS;KACT,OAAM;KACN,cAAW;KACV,SAAO;IAER,GAAA,CAAA,YAAsD,aAAA;KAA9C,MAAK;KAAiB,OAAM;IAEtC,CAAA,CAAA,CAAA,GAAA,mBAQS,UAAA;KAPP,MAAK;KACL,UAAS;KACT,OAAM;KACN,cAAW;KACV,SAAO;IAER,GAAA,CAAA,YAAwD,aAAA;KAAhD,MAAK;KAAmB,OAAM;;IAMlC,SAAA,SAAY,QAAA,kBAAa,gBADjC,UAAA,GAAA,mBAUS,UAAA;;KARP,MAAK;KACL,UAAS;KACT,OAAK,eAAA,CAAC,gPAA8O,EAAA,kCACxM,QAAA,SAAQ,CAAA,CAAA;KACpD,cAAW;KACV,SAAO;IAER,GAAA,CAAA,YAA0C,aAAA;KAAlC,MAAK;KAAW,OAAM;;GAKzB,CAAA,GAAA,UAAA,SAAa,gBAAA,SAAtB,UAAA,GAAA,mBAEI,KAFJ,YAEI,gBADC,gBAAA,KAAe,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Input.js","names":["$slots"],"sources":["../../src/components/Input.vue"],"sourcesContent":["<template>\n <div class=\"w-full\">\n <div class=\"relative flex\">\n <!-- Number stepper: minus button on left (both-sides layout) -->\n <button\n v-if=\"isNumber && stepperLayout === 'both-sides'\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"flex items-center justify-center w-9 rounded-l-lg border border-r-0 border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n aria-label=\"Decrease value\"\n @click=\"stepDown\"\n >\n <UiIcon name=\"mdi:minus\" class=\"w-4 h-4\" />\n </button>\n\n <!-- Number stepper: stacked up/down buttons on left -->\n <div\n v-if=\"isNumber && stepperLayout === 'stacked-left'\"\n class=\"flex flex-col w-7 border border-r-0 border-gray-300 dark:border-gray-600 rounded-l-lg overflow-hidden\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n >\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none border-b border-gray-300 dark:border-gray-600\"\n aria-label=\"Increase value\"\n @click=\"stepUp\"\n >\n <UiIcon name=\"mdi:chevron-up\" class=\"block w-3 h-3\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n aria-label=\"Decrease value\"\n @click=\"stepDown\"\n >\n <UiIcon name=\"mdi:chevron-down\" class=\"block w-3 h-3\" />\n </button>\n </div>\n\n <!-- Textarea mode: multi-line text input with custom scrollbar styling -->\n <textarea\n v-if=\"isTextarea\"\n :id=\"field?.controlId.value\"\n ref=\"inputRef\"\n :aria-describedby=\"field?.describedBy.value\"\n :aria-invalid=\"field?.invalid.value ? 'true' : undefined\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :rows=\"rows\"\n :maxlength=\"maxlength\"\n class=\"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-400 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none text-sm transition-colors [scrollbar-width:thin] [scrollbar-color:var(--color-gray-300)_transparent] dark:[scrollbar-color:var(--color-gray-600)_transparent] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-thumb]:bg-gray-600 hover:[&::-webkit-scrollbar-thumb]:bg-gray-400 dark:hover:[&::-webkit-scrollbar-thumb]:bg-gray-500\"\n :class=\"resizeClass\"\n :style=\"textareaStyle\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n />\n\n <!-- The actual input element (text, number, password, email, phone) -->\n <!-- Left icon/image slot -->\n <span\n v-if=\"!isTextarea && ($slots.left || iconLeft)\"\n class=\"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400 dark:text-gray-500\"\n >\n <slot name=\"left\">\n <UiIcon v-if=\"iconLeft\" :name=\"iconLeft\" class=\"w-4 h-4\" />\n </slot>\n </span>\n\n <input\n v-if=\"!isTextarea\"\n :id=\"field?.controlId.value\"\n ref=\"inputRef\"\n :aria-describedby=\"field?.describedBy.value\"\n :aria-invalid=\"field?.invalid.value ? 'true' : undefined\"\n :type=\"computedType\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :minlength=\"minlength\"\n :maxlength=\"maxlength\"\n :inputmode=\"computedInputMode\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :pattern=\"pattern\"\n class=\"w-full py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-400 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none text-sm transition-colors\"\n :class=\"inputClasses\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n />\n\n <!-- Right icon/image slot (hidden when clear button or password toggle is shown) -->\n <span\n v-if=\"\n !isTextarea &&\n ($slots.right || iconRight) &&\n !(clearable && modelValue) &&\n !(isPassword && showToggle)\n \"\n class=\"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-gray-400 dark:text-gray-500\"\n >\n <slot name=\"right\">\n <UiIcon v-if=\"iconRight\" :name=\"iconRight\" class=\"w-4 h-4\" />\n </slot>\n </span>\n\n <!-- Clear button -->\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors\"\n aria-label=\"Clear\"\n @mousedown.prevent\n @click=\"emit('update:modelValue', '')\"\n >\n <UiIcon name=\"mdi:close-circle\" class=\"w-4 h-4\" />\n </button>\n\n <!-- Password visibility toggle button -->\n <button\n v-if=\"isPassword && showToggle\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors\"\n :aria-label=\"passwordVisible ? 'Hide password' : 'Show password'\"\n @mousedown.prevent\n @click=\"passwordVisible = !passwordVisible\"\n >\n <UiIcon\n :name=\"passwordVisible ? 'mdi:eye-off-outline' : 'mdi:eye-outline'\"\n class=\"w-4 h-4\"\n />\n </button>\n\n <!-- Number stepper: stacked up/down buttons on right -->\n <div\n v-if=\"isNumber && stepperLayout === 'stacked-right'\"\n class=\"flex flex-col w-7 border border-l-0 border-gray-300 dark:border-gray-600 rounded-r-lg overflow-hidden\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n >\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none border-b border-gray-300 dark:border-gray-600\"\n aria-label=\"Increase value\"\n @click=\"stepUp\"\n >\n <UiIcon name=\"mdi:chevron-up\" class=\"block w-3 h-3\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"grid place-items-center w-full flex-1 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n aria-label=\"Decrease value\"\n @click=\"stepDown\"\n >\n <UiIcon name=\"mdi:chevron-down\" class=\"block w-3 h-3\" />\n </button>\n </div>\n\n <!-- Number stepper: plus button on right (both-sides layout) -->\n <button\n v-if=\"isNumber && stepperLayout === 'both-sides'\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"flex items-center justify-center w-9 rounded-r-lg border border-l-0 border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors select-none\"\n :class=\"{ 'opacity-50 pointer-events-none': disabled }\"\n aria-label=\"Increase value\"\n @click=\"stepUp\"\n >\n <UiIcon name=\"mdi:plus\" class=\"w-4 h-4\" />\n </button>\n </div>\n\n <!-- Validation error message (shown after first blur) -->\n <p v-if=\"showError && validationError\" class=\"text-xs text-red-600 dark:text-red-400 mt-1\">\n {{ validationError }}\n </p>\n </div>\n</template>\n\n<script setup>\n/**\n * UiInput — Multi-purpose input component supporting text, number, password, email,\n * phone, and textarea modes in a single unified interface.\n *\n * Features:\n * - Number mode with configurable stepper layouts (both-sides, stacked-left, stacked-right, none)\n * - Password mode with show/hide toggle\n * - Textarea mode with configurable resize, min/max dimensions\n * - Built-in validation for email, phone, and number patterns\n * - Custom regex validation with configurable error messages\n * - Exposes `focus()` method and `el` ref for parent control\n *\n * @example Basic text input\n * <UiInput v-model=\"name\" placeholder=\"Enter your name\" />\n *\n * @example Number input with min/max\n * <UiInput v-model=\"quantity\" type=\"number\" :min=\"0\" :max=\"100\" :step=\"1\" />\n *\n * @example Password with toggle\n * <UiInput v-model=\"password\" type=\"password\" />\n *\n * @example Textarea\n * <UiInput v-model=\"bio\" type=\"textarea\" :rows=\"5\" resize=\"vertical\" />\n *\n * @example Email with validation\n * <UiInput v-model=\"email\" type=\"email\" :validate=\"true\" />\n *\n * @emits {string | number} update:modelValue — Emitted when the input value changes (v-model)\n * @emits {{ valid: boolean, error: string | null }} validation — Emitted when the validation state changes\n */\nimport { ref, computed, watch, useSlots } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nimport { useFormField } from '../internal/formField.js'\nconst props = defineProps({\n /**\n * Bound value (v-model).\n * @type {string | number}\n * @default ''\n */\n modelValue: { type: [String, Number], default: '' },\n\n /**\n * Input type determining the mode and behavior.\n * @type {string}\n * @default 'text'\n * @values 'text' | 'number' | 'password' | 'email' | 'phone' | 'textarea'\n */\n type: { type: String, default: 'text' },\n\n /**\n * Placeholder text shown when the input is empty.\n * @type {string}\n * @default ''\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Whether the field is required for form validation.\n * @type {boolean}\n * @default false\n */\n required: { type: Boolean, default: false },\n\n /**\n * Disabled state — dims the input and prevents interaction.\n * @type {boolean}\n * @default false\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Read-only state — allows focus/selection but prevents editing.\n * @type {boolean}\n * @default false\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * HTML autocomplete attribute hint for the browser.\n * @type {string}\n * @default undefined\n */\n autocomplete: { type: String, default: undefined },\n\n /**\n * Minimum character length for text validation.\n * @type {number}\n * @default undefined\n */\n minlength: { type: Number, default: undefined },\n\n /**\n * Maximum character length for text validation.\n * @type {number}\n * @default undefined\n */\n maxlength: { type: Number, default: undefined },\n\n // ── Textarea-specific props ──\n\n /**\n * Number of visible text rows (textarea mode only).\n * @type {number}\n * @default 3\n */\n rows: { type: Number, default: 3 },\n\n /**\n * Resize behavior for textarea mode.\n * @type {string}\n * @default 'none'\n * @values 'none' | 'vertical' | 'horizontal' | 'both'\n */\n resize: { type: String, default: 'none' },\n\n /**\n * Minimum height CSS value for textarea (e.g. '80px', '5rem').\n * @type {string}\n * @default undefined\n */\n minHeight: { type: String, default: undefined },\n\n /**\n * Maximum height CSS value for textarea (e.g. '300px', '20rem').\n * @type {string}\n * @default undefined\n */\n maxHeight: { type: String, default: undefined },\n\n /**\n * Minimum width CSS value for textarea (e.g. '200px').\n * @type {string}\n * @default undefined\n */\n minWidth: { type: String, default: undefined },\n\n /**\n * Maximum width CSS value for textarea (e.g. '600px').\n * @type {string}\n * @default undefined\n */\n maxWidth: { type: String, default: undefined },\n\n /**\n * HTML pattern attribute for native form validation.\n * @type {string}\n * @default undefined\n */\n pattern: { type: String, default: undefined },\n\n // ── Password-specific props ──\n\n /**\n * Show the password visibility toggle button (password mode only).\n * @type {boolean}\n * @default true\n */\n showToggle: { type: Boolean, default: true },\n\n // ── Number-specific props ──\n\n /**\n * Minimum allowed numeric value.\n * @type {number}\n * @default undefined\n */\n min: { type: Number, default: undefined },\n\n /**\n * Maximum allowed numeric value.\n * @type {number}\n * @default undefined\n */\n max: { type: Number, default: undefined },\n\n /**\n * Step increment for number stepper buttons.\n * @type {number}\n * @default 1\n */\n step: { type: Number, default: 1 },\n\n /**\n * Layout of the +/- stepper buttons for number inputs.\n * @type {string}\n * @default 'both-sides'\n * @values 'stacked-left' | 'stacked-right' | 'both-sides' | 'none'\n */\n stepperLayout: { type: String, default: 'both-sides' },\n\n // ── Validation props ──\n\n /**\n * Show a clear button when the input has a value.\n * @type {boolean}\n * @default false\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Icon name to display on the left side of the input.\n * @type {string}\n * @default undefined\n */\n iconLeft: { type: String, default: undefined },\n\n /**\n * Icon name to display on the right side of the input.\n * @type {string}\n * @default undefined\n */\n iconRight: { type: String, default: undefined },\n\n /**\n * Enable built-in validation feedback shown below the input on blur.\n * @type {boolean}\n * @default true\n */\n validate: { type: Boolean, default: true },\n\n /**\n * Custom regex pattern string — overrides built-in type-based patterns.\n * @type {string}\n * @default undefined\n */\n validationPattern: { type: String, default: undefined },\n\n /**\n * Custom error message shown when validation fails.\n * @type {string}\n * @default undefined\n */\n validationMessage: { type: String, default: undefined },\n})\n\nconst emit = defineEmits(['update:modelValue', 'validation'])\n\nconst field = useFormField()\n\nconst inputRef = ref(null)\nconst passwordVisible = ref(false)\nconst touched = ref(false)\n\n// --- Computed helpers ---\n\n// Detect input mode from the type prop\nconst isPassword = computed(() => props.type === 'password')\nconst isNumber = computed(() => props.type === 'number')\nconst isTextarea = computed(() => props.type === 'textarea')\n\n// Map resize prop to Tailwind resize utility class\nconst resizeClass = computed(() => {\n const map = { none: 'resize-none', vertical: 'resize-y', horizontal: 'resize-x', both: 'resize' }\n return map[props.resize] || 'resize-none'\n})\n\nconst textareaStyle = computed(() => {\n const s = {}\n if (props.minHeight) s.minHeight = props.minHeight\n if (props.maxHeight) s.maxHeight = props.maxHeight\n if (props.minWidth) s.minWidth = props.minWidth\n if (props.maxWidth) s.maxWidth = props.maxWidth\n return s\n})\n\n// For number type, render as text input so we can filter keystrokes ourselves\nconst computedType = computed(() => {\n if (isPassword.value) return passwordVisible.value ? 'text' : 'password'\n if (isNumber.value) return 'text' // we handle number filtering ourselves\n if (props.type === 'phone') return 'tel'\n return props.type\n})\n\n// Set appropriate mobile keyboard via inputmode attribute\nconst computedInputMode = computed(() => {\n if (isNumber.value) return 'decimal'\n if (props.type === 'phone') return 'tel'\n if (props.type === 'email') return 'email'\n return undefined\n})\n\nconst hasStepper = computed(() => isNumber.value && props.stepperLayout !== 'none')\n\nconst slots = useSlots()\n\nconst hasLeftIcon = computed(() => !!props.iconLeft || !!slots.left)\nconst hasRightIcon = computed(() => !!props.iconRight || !!slots.right)\n\nconst inputClasses = computed(() => {\n const classes = []\n\n // Horizontal padding — tighter when steppers are present\n if (hasStepper.value) {\n classes.push('px-1.5')\n } else {\n // Adjust padding for icons/slots\n classes.push(hasLeftIcon.value ? 'pl-9' : 'pl-3')\n classes.push(hasRightIcon.value ? 'pr-9' : 'pr-3')\n }\n\n // Rounding based on stepper layout\n if (hasStepper.value) {\n if (props.stepperLayout === 'both-sides') classes.push('rounded-none')\n else if (props.stepperLayout === 'stacked-left') classes.push('rounded-l-none', 'rounded-r-lg')\n else if (props.stepperLayout === 'stacked-right') classes.push('rounded-r-none', 'rounded-l-lg')\n } else {\n classes.push('rounded-lg')\n }\n\n // Extra right padding for password toggle\n if (isPassword.value && props.showToggle) classes.push('pr-10')\n\n // Extra right padding for clear button\n if (props.clearable) classes.push('pr-8')\n\n // Number text alignment\n if (isNumber.value && hasStepper.value) classes.push('text-center')\n\n return classes\n})\n\n// --- Validation ---\n\n// Built-in regex patterns for common input types\nconst PATTERNS = {\n email: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,\n phone: /^\\+?[\\d\\s\\-().]{7,}$/,\n number: /^-?\\d*\\.?\\d+$/,\n}\n\nconst MESSAGES = {\n email: 'Please enter a valid email address',\n phone: 'Please enter a valid phone number',\n number: 'Please enter a valid number',\n}\n\nconst validationError = computed(() => {\n const val = String(props.modelValue ?? '')\n if (!val) return null\n\n // Custom pattern takes priority\n if (props.validationPattern) {\n const re = new RegExp(props.validationPattern)\n if (!re.test(val)) return props.validationMessage || 'Invalid format'\n }\n\n // Built-in patterns\n const builtIn = PATTERNS[props.type]\n if (builtIn && !builtIn.test(val)) {\n return props.validationMessage || MESSAGES[props.type] || 'Invalid input'\n }\n\n return null\n})\n\nconst showError = computed(() => props.validate && touched.value)\n\nwatch(validationError, (err) => {\n emit('validation', { valid: !err, error: err })\n})\n\n// --- Event handlers ---\n\n// Regex for validating partial number input (allows intermediate states like \"-\" or \".\")\nconst NUMBER_ALLOWED = /^-?\\d*\\.?\\d*$/\n\nfunction onInput(e) {\n const val = e.target.value\n\n // For number type, reject non-numeric characters\n if (isNumber.value) {\n if (!NUMBER_ALLOWED.test(val)) {\n // Revert to previous valid value\n e.target.value = String(props.modelValue ?? '')\n return\n }\n }\n\n emit(\n 'update:modelValue',\n isNumber.value && val !== '' && val !== '-' && val !== '.' && val !== '-.' ? Number(val) : val,\n )\n}\n\nfunction onBlur() {\n touched.value = true\n}\n\nfunction onKeydown(e) {\n if (!isNumber.value) return\n\n // Allow: backspace, delete, tab, escape, enter, arrows, home, end, decimal point, minus\n const allowed = [\n 'Backspace',\n 'Delete',\n 'Tab',\n 'Escape',\n 'Enter',\n 'ArrowLeft',\n 'ArrowRight',\n 'Home',\n 'End',\n ]\n if (allowed.includes(e.key)) return\n if (e.key === '.' && !String(props.modelValue).includes('.')) return\n if (e.key === '-' && e.target.selectionStart === 0 && !String(props.modelValue).includes('-'))\n return\n if (e.ctrlKey || e.metaKey) return // allow copy/paste/select-all\n\n // Block non-digit keys\n if (!/^\\d$/.test(e.key)) {\n e.preventDefault()\n }\n}\n\nfunction stepUp() {\n const current = Number(props.modelValue) || 0\n let next = current + (props.step ?? 1)\n if (props.max !== undefined) next = Math.min(next, props.max)\n emit('update:modelValue', next)\n}\n\nfunction stepDown() {\n const current = Number(props.modelValue) || 0\n let next = current - (props.step ?? 1)\n if (props.min !== undefined) next = Math.max(next, props.min)\n emit('update:modelValue', next)\n}\n\n// Expose focus method\ndefineExpose({\n focus: () => inputRef.value?.focus(),\n el: inputRef,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkOA,MAAM,QAAQ;EA0Md,MAAM,OAAO;EAEb,MAAM,QAAQ,aAAa;EAE3B,MAAM,WAAW,IAAI,IAAI;EACzB,MAAM,kBAAkB,IAAI,KAAK;EACjC,MAAM,UAAU,IAAI,KAAK;EAKzB,MAAM,aAAa,eAAe,MAAM,SAAS,UAAU;EAC3D,MAAM,WAAW,eAAe,MAAM,SAAS,QAAQ;EACvD,MAAM,aAAa,eAAe,MAAM,SAAS,UAAU;EAG3D,MAAM,cAAc,eAAe;GAEjC,OAAO;IADO,MAAM;IAA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