numori-ui 0.3.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 (120) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/README.md +36 -34
  3. package/dist/components/AppShell.js +234 -0
  4. package/dist/components/AppShell.js.map +1 -0
  5. package/dist/components/Banner.js +29 -32
  6. package/dist/components/Banner.js.map +1 -1
  7. package/dist/components/Button.js +10 -19
  8. package/dist/components/Button.js.map +1 -1
  9. package/dist/components/Card.js +15 -9
  10. package/dist/components/Card.js.map +1 -1
  11. package/dist/components/Checkbox.js +13 -9
  12. package/dist/components/Checkbox.js.map +1 -1
  13. package/dist/components/CopyField.js +195 -0
  14. package/dist/components/CopyField.js.map +1 -0
  15. package/dist/components/DescriptionList.js +116 -0
  16. package/dist/components/DescriptionList.js.map +1 -0
  17. package/dist/components/Dropdown.js +10 -3
  18. package/dist/components/Dropdown.js.map +1 -1
  19. package/dist/components/DropdownSubmenu.js +5 -3
  20. package/dist/components/DropdownSubmenu.js.map +1 -1
  21. package/dist/components/EmptyState.js +123 -0
  22. package/dist/components/EmptyState.js.map +1 -0
  23. package/dist/components/FileInput.js +12 -4
  24. package/dist/components/FileInput.js.map +1 -1
  25. package/dist/components/FormField.js +43 -13
  26. package/dist/components/FormField.js.map +1 -1
  27. package/dist/components/IconTile.js +5 -9
  28. package/dist/components/IconTile.js.map +1 -1
  29. package/dist/components/Input.js +21 -7
  30. package/dist/components/Input.js.map +1 -1
  31. package/dist/components/ListMenuItem.js +38 -31
  32. package/dist/components/ListMenuItem.js.map +1 -1
  33. package/dist/components/Numpad.js +4 -4
  34. package/dist/components/Numpad.js.map +1 -1
  35. package/dist/components/PageHeader.js +106 -0
  36. package/dist/components/PageHeader.js.map +1 -0
  37. package/dist/components/Pagination.js +236 -0
  38. package/dist/components/Pagination.js.map +1 -0
  39. package/dist/components/Popup.js +9 -3
  40. package/dist/components/Popup.js.map +1 -1
  41. package/dist/components/Radio.js +2 -7
  42. package/dist/components/Radio.js.map +1 -1
  43. package/dist/components/Segmented.js +109 -27
  44. package/dist/components/Segmented.js.map +1 -1
  45. package/dist/components/Select.js +16 -5
  46. package/dist/components/Select.js.map +1 -1
  47. package/dist/components/Sidebar.js +69 -0
  48. package/dist/components/Sidebar.js.map +1 -0
  49. package/dist/components/SidebarGroup.js +50 -0
  50. package/dist/components/SidebarGroup.js.map +1 -0
  51. package/dist/components/SidebarItem.js +167 -0
  52. package/dist/components/SidebarItem.js.map +1 -0
  53. package/dist/components/StatCard.js +185 -0
  54. package/dist/components/StatCard.js.map +1 -0
  55. package/dist/components/Table.js +306 -0
  56. package/dist/components/Table.js.map +1 -0
  57. package/dist/components/Tabs.js +216 -0
  58. package/dist/components/Tabs.js.map +1 -0
  59. package/dist/components/Toggle.js +11 -2
  60. package/dist/components/Toggle.js.map +1 -1
  61. package/dist/components/index.js +91 -76
  62. package/dist/components/index.js.map +1 -1
  63. package/dist/composables/useMergedClasses.js +52 -0
  64. package/dist/composables/useMergedClasses.js.map +1 -0
  65. package/dist/icons/mdi.js +11 -0
  66. package/dist/icons/mdi.js.map +1 -1
  67. package/dist/index.d.ts +13 -3
  68. package/dist/index.js +47 -37
  69. package/dist/index.js.map +1 -1
  70. package/dist/internal/controlSizes.js +21 -0
  71. package/dist/internal/controlSizes.js.map +1 -0
  72. package/dist/internal/formField.js +26 -0
  73. package/dist/internal/formField.js.map +1 -0
  74. package/dist/internal/menu.js +20 -0
  75. package/dist/internal/menu.js.map +1 -0
  76. package/dist/manifest.js +12 -2
  77. package/dist/manifest.js.map +1 -1
  78. package/package.json +2 -1
  79. package/src/components/AppShell.vue +231 -0
  80. package/src/components/Banner.vue +20 -9
  81. package/src/components/Button.vue +12 -19
  82. package/src/components/Card.vue +11 -12
  83. package/src/components/Checkbox.vue +7 -10
  84. package/src/components/CopyField.vue +178 -0
  85. package/src/components/DescriptionList.vue +114 -0
  86. package/src/components/Dropdown.vue +14 -2
  87. package/src/components/DropdownSubmenu.vue +4 -2
  88. package/src/components/EmptyState.vue +107 -0
  89. package/src/components/FileInput.vue +19 -4
  90. package/src/components/FormField.vue +37 -4
  91. package/src/components/IconTile.vue +4 -9
  92. package/src/components/Input.vue +15 -6
  93. package/src/components/ListMenuItem.vue +21 -5
  94. package/src/components/Numpad.vue +7 -4
  95. package/src/components/PageHeader.vue +102 -0
  96. package/src/components/Pagination.vue +199 -0
  97. package/src/components/Popup.vue +6 -2
  98. package/src/components/Radio.vue +2 -10
  99. package/src/components/Segmented.vue +113 -38
  100. package/src/components/Select.vue +16 -2
  101. package/src/components/Sidebar.vue +61 -0
  102. package/src/components/SidebarGroup.vue +43 -0
  103. package/src/components/SidebarItem.vue +159 -0
  104. package/src/components/StatCard.vue +165 -0
  105. package/src/components/Table.vue +323 -0
  106. package/src/components/Tabs.vue +217 -0
  107. package/src/components/Toggle.vue +5 -0
  108. package/src/components/index.js +36 -11
  109. package/src/composables/useMergedClasses.js +49 -0
  110. package/src/icons/mdi.js +11 -0
  111. package/src/internal/controlSizes.js +17 -0
  112. package/src/internal/formField.js +23 -0
  113. package/src/internal/menu.js +16 -0
  114. package/src/manifest.js +12 -2
  115. package/dist/components/ButtonsGroup.js +0 -153
  116. package/dist/components/ButtonsGroup.js.map +0 -1
  117. package/dist/components/ComparisonTable.js +0 -152
  118. package/dist/components/ComparisonTable.js.map +0 -1
  119. package/src/components/ButtonsGroup.vue +0 -140
  120. package/src/components/ComparisonTable.vue +0 -141
@@ -1 +1 @@
1
- {"version":3,"file":"IconTile.js","names":[],"sources":["../../src/components/IconTile.vue"],"sourcesContent":["<template>\n <span class=\"inline-flex items-center justify-center\" :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <UiIcon :name=\"icon\" :class=\"iconSizeClass\" aria-hidden=\"true\" />\n </span>\n</template>\n\n<script setup>\n/**\n * UiIconTile — a small rounded, tinted tile holding a single icon: the motif\n * that stands in for a product logo or marks a feature next to a heading.\n *\n * Decorative by default — the icon is `aria-hidden`, on the assumption that a\n * label sits next to it in text. The tint uses the design system's semantic\n * colours; for a colour outside that set (a Tailwind palette, say) pass the\n * `bg-*`/`text-*` classes directly and they override the built-in tint via\n * `tailwind-merge`.\n *\n * @example Primary feature tile\n * <UiIconTile icon=\"mdi:shield-lock-outline\" />\n *\n * @example Large product mark in a custom colour\n * <UiIconTile icon=\"mdi:note-text-outline\" size=\"lg\" class=\"bg-sky-100 text-sky-700\" />\n *\n * @example Success tile\n * <UiIconTile icon=\"mdi:check\" color=\"success\" size=\"sm\" />\n */\nimport { computed, useAttrs } from 'vue'\nimport { twMerge } from 'tailwind-merge'\nimport UiIcon from '../icons/Icon.vue'\n\nconst props = defineProps({\n /**\n * MDI icon name.\n * @type {string}\n */\n icon: { type: String, required: true },\n\n /**\n * Tint colour from the semantic palette.\n * @type {string}\n * @default 'primary'\n * @values 'primary' | 'gray' | 'success' | 'warning' | 'error' | 'blue'\n */\n color: { type: String, default: 'primary' },\n\n /**\n * Tile size (the radius scales with it).\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md' | 'lg' | 'xl'\n */\n size: { type: String, default: 'md' },\n})\n\nconst sizeClass = computed(\n () =>\n ({\n sm: 'size-9 rounded-lg',\n md: 'size-11 rounded-xl',\n lg: 'size-14 rounded-2xl',\n xl: 'size-16 rounded-2xl',\n })[props.size] ?? 'size-11 rounded-xl',\n)\n\nconst iconSizeClass = computed(\n () =>\n ({\n sm: 'size-5',\n md: 'size-6',\n lg: 'size-8',\n xl: 'size-9',\n })[props.size] ?? 'size-6',\n)\n\nconst colorClass = computed(\n () =>\n ({\n primary: 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300',\n gray: 'bg-gray-100 text-gray-700 dark:bg-gray-700/60 dark:text-gray-200',\n success: 'bg-success-100 text-success-700 dark:bg-success-400/15 dark:text-success-300',\n warning: 'bg-warning-100 text-warning-700 dark:bg-warning-400/15 dark:text-warning-300',\n error: 'bg-error-100 text-error-700 dark:bg-error-400/15 dark:text-error-300',\n blue: 'bg-blue-100 text-blue-700 dark:bg-blue-400/15 dark:text-blue-300',\n })[props.color] ??\n 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300',\n)\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst restAttrs = computed(() => {\n const { class: _class, ...rest } = attrs\n return rest\n})\n\n// External classes merge last so a caller's `bg-*`/`text-*` (e.g. a Tailwind\n// palette outside the semantic set) overrides the built-in tint rather than\n// colliding with it.\nconst mergedClasses = computed(() => twMerge(sizeClass.value, colorClass.value, attrs.class))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,QAAQ;EAwBd,MAAM,YAAY,gBAEb;GACC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,EAAA,CAAG,MAAM,SAAS,oBACtB;EAEA,MAAM,gBAAgB,gBAEjB;GACC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,EAAA,CAAG,MAAM,SAAS,QACtB;EAEA,MAAM,aAAa,gBAEd;GACC,SAAS;GACT,MAAM;GACN,SAAS;GACT,SAAS;GACT,OAAO;GACP,MAAM;EACR,EAAA,CAAG,MAAM,UACT,8EACJ;EAIA,MAAM,QAAQ,SAAS;EACvB,MAAM,YAAY,eAAe;GAC/B,MAAM,EAAE,OAAO,QAAQ,GAAG,SAAS;GACnC,OAAO;EACT,CAAC;EAKD,MAAM,gBAAgB,eAAe,QAAQ,UAAU,OAAO,WAAW,OAAO,MAAM,KAAK,CAAC;;GAjG1F,OAAA,UAAA,GAAA,mBAEO,QAFP,WAEO,EAFD,OAAK,CAAC,2CAAkD,cAAA,KAAa,EAAU,GAAA,UAAA,KAAS,GAAA,CAC5F,YAAiE,aAAA;IAAxD,MAAM,QAAA;IAAO,OAAK,eAAE,cAAA,KAAa;IAAE,eAAY"}
1
+ {"version":3,"file":"IconTile.js","names":[],"sources":["../../src/components/IconTile.vue"],"sourcesContent":["<template>\n <span class=\"inline-flex items-center justify-center\" :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <UiIcon :name=\"icon\" :class=\"iconSizeClass\" aria-hidden=\"true\" />\n </span>\n</template>\n\n<script setup>\n/**\n * UiIconTile — a small rounded, tinted tile holding a single icon: the motif\n * that stands in for a product logo or marks a feature next to a heading.\n *\n * Decorative by default — the icon is `aria-hidden`, on the assumption that a\n * label sits next to it in text. The tint uses the design system's semantic\n * colours; for a colour outside that set (a Tailwind palette, say) pass the\n * `bg-*`/`text-*` classes directly and they override the built-in tint via\n * `tailwind-merge`.\n *\n * @example Primary feature tile\n * <UiIconTile icon=\"mdi:shield-lock-outline\" />\n *\n * @example Large product mark in a custom colour\n * <UiIconTile icon=\"mdi:note-text-outline\" size=\"lg\" class=\"bg-sky-100 text-sky-700\" />\n *\n * @example Success tile\n * <UiIconTile icon=\"mdi:check\" color=\"success\" size=\"sm\" />\n */\nimport { computed } from 'vue'\nimport { useMergedClasses } from '../composables/useMergedClasses.js'\nimport UiIcon from '../icons/Icon.vue'\n\nconst props = defineProps({\n /**\n * MDI icon name.\n * @type {string}\n */\n icon: { type: String, required: true },\n\n /**\n * Tint colour from the semantic palette.\n * @type {string}\n * @default 'primary'\n * @values 'primary' | 'gray' | 'success' | 'warning' | 'error' | 'blue'\n */\n color: { type: String, default: 'primary' },\n\n /**\n * Tile size (the radius scales with it).\n * @type {string}\n * @default 'md'\n * @values 'sm' | 'md' | 'lg' | 'xl'\n */\n size: { type: String, default: 'md' },\n})\n\nconst sizeClass = computed(\n () =>\n ({\n sm: 'size-9 rounded-lg',\n md: 'size-11 rounded-xl',\n lg: 'size-14 rounded-2xl',\n xl: 'size-16 rounded-2xl',\n })[props.size] ?? 'size-11 rounded-xl',\n)\n\nconst iconSizeClass = computed(\n () =>\n ({\n sm: 'size-5',\n md: 'size-6',\n lg: 'size-8',\n xl: 'size-9',\n })[props.size] ?? 'size-6',\n)\n\nconst colorClass = computed(\n () =>\n ({\n primary: 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300',\n gray: 'bg-gray-100 text-gray-700 dark:bg-gray-700/60 dark:text-gray-200',\n success: 'bg-success-100 text-success-700 dark:bg-success-400/15 dark:text-success-300',\n warning: 'bg-warning-100 text-warning-700 dark:bg-warning-400/15 dark:text-warning-300',\n error: 'bg-error-100 text-error-700 dark:bg-error-400/15 dark:text-error-300',\n blue: 'bg-blue-100 text-blue-700 dark:bg-blue-400/15 dark:text-blue-300',\n })[props.color] ??\n 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-300',\n)\n\ndefineOptions({ inheritAttrs: false })\n\n// External classes merge last so a caller's `bg-*`/`text-*` (e.g. a Tailwind\n// palette outside the semantic set) overrides the built-in tint rather than\n// colliding with it.\nconst internalClasses = computed(() => `${sizeClass.value} ${colorClass.value}`)\nconst { mergedClasses, restAttrs } = useMergedClasses(internalClasses)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,QAAQ;EAwBd,MAAM,YAAY,gBAEb;GACC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,EAAA,CAAG,MAAM,SAAS,oBACtB;EAEA,MAAM,gBAAgB,gBAEjB;GACC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,EAAA,CAAG,MAAM,SAAS,QACtB;EAEA,MAAM,aAAa,gBAEd;GACC,SAAS;GACT,MAAM;GACN,SAAS;GACT,SAAS;GACT,OAAO;GACP,MAAM;EACR,EAAA,CAAG,MAAM,UACT,8EACJ;EAOA,MAAM,kBAAkB,eAAe,GAAG,UAAU,MAAM,GAAG,WAAW,OAAO;EAC/E,MAAM,EAAE,eAAe,cAAc,iBAAiB,eAAe;;GA5FnE,OAAA,UAAA,GAAA,mBAEO,QAFP,WAEO,EAFD,OAAK,CAAC,2CAAkD,MAAA,aAAA,CAAa,EAAU,GAAA,MAAA,SAAA,CAAS,GAAA,CAC5F,YAAiE,aAAA;IAAxD,MAAM,QAAA;IAAO,OAAK,eAAE,cAAA,KAAa;IAAE,eAAY"}
@@ -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);
@@ -467,11 +475,11 @@ var _sfc_main = {
467
475
  })], 2)) : createCommentVNode("", true),
468
476
  isNumber.value && __props.stepperLayout === "stacked-left" ? (openBlock(), createElementBlock("div", {
469
477
  key: 1,
470
- class: normalizeClass(["flex flex-col w-6 border border-r-0 border-gray-300 dark:border-gray-600 rounded-l-lg overflow-hidden", { "opacity-50 pointer-events-none": __props.disabled }])
478
+ class: normalizeClass(["flex flex-col w-7 border border-r-0 border-gray-300 dark:border-gray-600 rounded-l-lg overflow-hidden", { "opacity-50 pointer-events-none": __props.disabled }])
471
479
  }, [createElementVNode("button", {
472
480
  type: "button",
473
481
  tabindex: "-1",
474
- class: "grid place-items-center w-4 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",
482
+ 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",
475
483
  "aria-label": "Increase value",
476
484
  onClick: stepUp
477
485
  }, [createVNode(_sfc_main$1, {
@@ -480,7 +488,7 @@ var _sfc_main = {
480
488
  })]), createElementVNode("button", {
481
489
  type: "button",
482
490
  tabindex: "-1",
483
- class: "grid place-items-center w-4 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",
491
+ 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",
484
492
  "aria-label": "Decrease value",
485
493
  onClick: stepDown
486
494
  }, [createVNode(_sfc_main$1, {
@@ -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,
@@ -562,11 +576,11 @@ var _sfc_main = {
562
576
  }, null, 8, ["name"])], 40, _hoisted_7)) : createCommentVNode("", true),
563
577
  isNumber.value && __props.stepperLayout === "stacked-right" ? (openBlock(), createElementBlock("div", {
564
578
  key: 8,
565
- class: normalizeClass(["flex flex-col w-6 border border-l-0 border-gray-300 dark:border-gray-600 rounded-r-lg overflow-hidden", { "opacity-50 pointer-events-none": __props.disabled }])
579
+ class: normalizeClass(["flex flex-col w-7 border border-l-0 border-gray-300 dark:border-gray-600 rounded-r-lg overflow-hidden", { "opacity-50 pointer-events-none": __props.disabled }])
566
580
  }, [createElementVNode("button", {
567
581
  type: "button",
568
582
  tabindex: "-1",
569
- class: "grid place-items-center w-4 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",
583
+ 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",
570
584
  "aria-label": "Increase value",
571
585
  onClick: stepUp
572
586
  }, [createVNode(_sfc_main$1, {
@@ -575,7 +589,7 @@ var _sfc_main = {
575
589
  })]), createElementVNode("button", {
576
590
  type: "button",
577
591
  tabindex: "-1",
578
- class: "grid place-items-center w-4 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",
592
+ 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",
579
593
  "aria-label": "Decrease value",
580
594
  onClick: stepDown
581
595
  }, [createVNode(_sfc_main$1, {
@@ -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-6 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-4 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-4 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-6 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-4 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-4 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AS,OAAA,OAAA,OAAA,KAAA,oBAAV,CAAA,GAAkB,CAAA,SAAA,CAAA;KACjB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,gBAAA,QAAe,CAAI,gBAAA;IAE3B,GAAA,CAAA,YAGE,aAAA;KAFC,MAAM,gBAAA,QAAe,wBAAA;KACtB,OAAM;;IAMF,SAAA,SAAY,QAAA,kBAAa,mBADjC,UAAA,GAAA,mBAuBM,OAAA;;KArBJ,OAAK,eAAA,CAAC,yGAAuG,EAAA,kCACjE,QAAA,SAAQ,CAAA,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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.js";
2
- import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, withCtx, withModifiers } from "vue";
2
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, normalizeClass, openBlock, renderSlot, toDisplayString, withModifiers } from "vue";
3
3
  //#region src/components/ListMenuItem.vue
4
- var _hoisted_1 = { class: "flex-1 min-w-0" };
5
- var _hoisted_2 = { class: "block truncate" };
6
- var _hoisted_3 = {
4
+ var _hoisted_1 = [
5
+ "role",
6
+ "tabindex",
7
+ "aria-disabled"
8
+ ];
9
+ var _hoisted_2 = { class: "flex-1 min-w-0" };
10
+ var _hoisted_3 = { class: "block truncate" };
11
+ var _hoisted_4 = {
7
12
  key: 0,
8
13
  class: "block text-xs text-gray-400 dark:text-gray-500 truncate mt-0.5"
9
14
  };
@@ -115,6 +120,13 @@ var _sfc_main = {
115
120
  else if (isSelect.value) props.selectRef?.toggle?.();
116
121
  else if (props.clickable) emit("click");
117
122
  };
123
+ const onKeydown = (e) => {
124
+ if (!isInteractive.value || props.disabled) return;
125
+ if (e.key === "Enter" || e.key === " ") {
126
+ e.preventDefault();
127
+ handleClick();
128
+ }
129
+ };
118
130
  const handleSuffixClick = (e) => {
119
131
  if (isToggle.value && !props.disabled) {
120
132
  e.stopPropagation();
@@ -152,34 +164,29 @@ var _sfc_main = {
152
164
  return "text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/40 active:bg-gray-100 dark:active:bg-gray-700/60 cursor-pointer";
153
165
  });
154
166
  return (_ctx, _cache) => {
155
- return openBlock(), createBlock(resolveDynamicComponent(isInteractive.value ? "button" : "div"), {
156
- type: isInteractive.value ? "button" : void 0,
167
+ return openBlock(), createElementBlock("div", {
157
168
  class: normalizeClass(["w-full flex items-center gap-3 text-sm text-left transition-colors", [sizeClass.value, colorClass.value]]),
158
- disabled: isInteractive.value ? __props.disabled : void 0,
159
- onClick: handleClick
160
- }, {
161
- default: withCtx(() => [
162
- __props.icon ? (openBlock(), createBlock(_sfc_main$1, {
163
- key: 0,
164
- name: __props.icon,
165
- class: normalizeClass(["shrink-0", [iconSizeClass.value, __props.iconClass || defaultIconColorClass.value]])
166
- }, null, 8, ["name", "class"])) : createCommentVNode("", true),
167
- createElementVNode("span", _hoisted_1, [createElementVNode("span", _hoisted_2, [renderSlot(_ctx.$slots, "default")]), __props.hint ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)]),
168
- createElementVNode("div", {
169
- class: "shrink-0 flex items-center",
170
- onClick: withModifiers(handleSuffixClick, ["stop"])
171
- }, [renderSlot(_ctx.$slots, "suffix", {}, () => [__props.clickable && __props.chevron ? (openBlock(), createBlock(_sfc_main$1, {
172
- key: 0,
173
- name: "mdi:chevron-right",
174
- class: normalizeClass(["w-4 h-4", __props.danger ? "text-red-300 dark:text-red-800" : "text-gray-300 dark:text-gray-600"])
175
- }, null, 8, ["class"])) : createCommentVNode("", true)])])
176
- ]),
177
- _: 3
178
- }, 8, [
179
- "type",
180
- "class",
181
- "disabled"
182
- ]);
169
+ role: isInteractive.value ? "button" : void 0,
170
+ tabindex: isInteractive.value && !__props.disabled ? 0 : void 0,
171
+ "aria-disabled": isInteractive.value && __props.disabled ? "true" : void 0,
172
+ onClick: handleClick,
173
+ onKeydown
174
+ }, [
175
+ __props.icon ? (openBlock(), createBlock(_sfc_main$1, {
176
+ key: 0,
177
+ name: __props.icon,
178
+ class: normalizeClass(["shrink-0", [iconSizeClass.value, __props.iconClass || defaultIconColorClass.value]])
179
+ }, null, 8, ["name", "class"])) : createCommentVNode("", true),
180
+ createElementVNode("span", _hoisted_2, [createElementVNode("span", _hoisted_3, [renderSlot(_ctx.$slots, "default")]), __props.hint ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)]),
181
+ createElementVNode("div", {
182
+ class: "shrink-0 flex items-center",
183
+ onClick: withModifiers(handleSuffixClick, ["stop"])
184
+ }, [renderSlot(_ctx.$slots, "suffix", {}, () => [__props.clickable && __props.chevron ? (openBlock(), createBlock(_sfc_main$1, {
185
+ key: 0,
186
+ name: "mdi:chevron-right",
187
+ class: normalizeClass(["w-4 h-4", __props.danger ? "text-red-300 dark:text-red-800" : "text-gray-300 dark:text-gray-600"])
188
+ }, null, 8, ["class"])) : createCommentVNode("", true)])])
189
+ ], 42, _hoisted_1);
183
190
  };
184
191
  }
185
192
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ListMenuItem.js","names":[],"sources":["../../src/components/ListMenuItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"isInteractive ? 'button' : 'div'\"\n :type=\"isInteractive ? 'button' : undefined\"\n class=\"w-full flex items-center gap-3 text-sm text-left transition-colors\"\n :class=\"[sizeClass, colorClass]\"\n :disabled=\"isInteractive ? disabled : undefined\"\n @click=\"handleClick\"\n >\n <UiIcon\n v-if=\"icon\"\n :name=\"icon\"\n class=\"shrink-0\"\n :class=\"[iconSizeClass, iconClass || defaultIconColorClass]\"\n />\n <span class=\"flex-1 min-w-0\">\n <span class=\"block truncate\"><slot /></span>\n <span v-if=\"hint\" class=\"block text-xs text-gray-400 dark:text-gray-500 truncate mt-0.5\">{{\n hint\n }}</span>\n </span>\n <div class=\"shrink-0 flex items-center\" @click.stop=\"handleSuffixClick\">\n <slot name=\"suffix\">\n <UiIcon\n v-if=\"clickable && chevron\"\n name=\"mdi:chevron-right\"\n class=\"w-4 h-4\"\n :class=\"danger ? 'text-red-300 dark:text-red-800' : 'text-gray-300 dark:text-gray-600'\"\n />\n </slot>\n </div>\n </component>\n</template>\n\n<script setup>\n/**\n * UiListMenuItem — Single row item for use inside UiListMenu.\n *\n * A versatile row component that can serve as:\n * - A clickable action row (set `clickable`)\n * - A toggle row where tapping anywhere toggles (set `toggle`)\n * - A select row where tapping anywhere opens the select (set `selectRef`)\n * - A static row hosting suffix controls (default)\n *\n * @example Clickable action row\n * <UiListMenuItem icon=\"mdi:account\" clickable @click=\"goProfile\">Profile</UiListMenuItem>\n *\n * @example Toggle row (whole row is tappable)\n * <UiListMenuItem icon=\"mdi:wrap\" :toggle=\"wordWrap\" @update:toggle=\"wordWrap = $event\">\n * Word Wrap\n * <template #suffix><UiToggle :model-value=\"wordWrap\" readonly /></template>\n * </UiListMenuItem>\n *\n * @example Select row (whole row opens the select)\n * <UiListMenuItem icon=\"mdi:translate\" :select-ref=\"langRef\">\n * Language\n * <template #suffix><UiSelect ref=\"langRef\" ... /></template>\n * </UiListMenuItem>\n *\n * @emits {void} click — Emitted when a clickable item is clicked\n * @emits {boolean} update:toggle — Emitted with the new value when a toggle row is tapped\n *\n * @slot default — Label text\n * @slot suffix — Trailing content (toggle, select, badge, etc.)\n *\n * @see UiListMenu — Parent container for grouping list items\n */\nimport { computed } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nconst props = defineProps({\n /** MDI icon name displayed at the start of the row. */\n icon: { type: String, default: '' },\n\n /** Custom CSS class override for the icon element. */\n iconClass: { type: String, default: '' },\n\n /** Whether this item is a clickable action (renders as button with hover states + chevron). */\n clickable: { type: Boolean, default: false },\n\n /**\n * Toggle state. When set to a boolean, the row becomes a tappable toggle.\n * Clicking anywhere emits `update:toggle` with the inverted value.\n */\n toggle: { type: Boolean, default: undefined },\n\n /**\n * Reference to a UiSelect component instance. When provided, the row becomes\n * tappable and clicking anywhere opens the select dropdown.\n */\n selectRef: { type: Object, default: undefined },\n\n /** Show a chevron-right icon as the trailing suffix (only when clickable). */\n chevron: { type: Boolean, default: true },\n\n /** Danger/red styling for destructive actions. */\n danger: { type: Boolean, default: false },\n\n /** Disabled state — dims the item and prevents interaction. */\n disabled: { type: Boolean, default: false },\n\n /** Optional hint text displayed below the label. */\n hint: { type: String, default: '' },\n\n /**\n * Size preset for padding and icon dimensions.\n * @values 'md' | 'sm'\n */\n size: { type: String, default: 'md' },\n})\n\nconst emit = defineEmits(['click', 'update:toggle'])\n\nconst isToggle = computed(() => props.toggle !== undefined)\nconst isSelect = computed(() => props.selectRef !== undefined)\nconst isInteractive = computed(() => props.clickable || isToggle.value || isSelect.value)\n\nconst handleClick = () => {\n if (props.disabled) return\n if (isToggle.value) {\n emit('update:toggle', !props.toggle)\n } else if (isSelect.value) {\n props.selectRef?.toggle?.()\n } else if (props.clickable) {\n emit('click')\n }\n}\n\nconst handleSuffixClick = (e) => {\n // For toggle rows, clicking the suffix (the toggle itself) should also toggle\n if (isToggle.value && !props.disabled) {\n e.stopPropagation()\n emit('update:toggle', !props.toggle)\n return\n }\n // For select rows, let the select handle its own click (it calls toggleOpen)\n // but stop propagation so the row doesn't double-open\n if (isSelect.value) {\n e.stopPropagation()\n return\n }\n // For clickable rows, stop propagation so suffix controls work independently\n if (props.clickable) {\n e.stopPropagation()\n }\n}\n\nconst sizeClass = computed(() => {\n const map = { md: 'px-4 py-3', sm: 'px-3 py-2.5' }\n return map[props.size] ?? map.md\n})\n\nconst iconSizeClass = computed(() => {\n const map = { md: 'w-[18px] h-[18px]', sm: 'w-4 h-4' }\n return map[props.size] ?? map.md\n})\n\nconst defaultIconColorClass = computed(() => {\n if (props.danger) return 'text-red-500 dark:text-red-400'\n return 'text-gray-400 dark:text-gray-500'\n})\n\nconst colorClass = computed(() => {\n if (props.disabled) return 'opacity-40 cursor-not-allowed'\n if (!isInteractive.value) {\n return props.danger ? 'text-red-600 dark:text-red-400' : 'text-gray-700 dark:text-gray-300'\n }\n if (props.danger)\n return 'text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 cursor-pointer'\n return 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/40 active:bg-gray-100 dark:active:bg-gray-700/60 cursor-pointer'\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAK,eAAA,CAAC,sEAAoE,CACjE,UAAA,OAAW,WAAA,KAAU,CAAA,CAAA;IAC7B,UAAU,cAAA,QAAgB,QAAA,WAAW,KAAA;IACrC,SAAO;;IAER,SAAA,cAKE;KAJM,QAAA,QADR,UAAA,GAAA,YAKE,aAAA;;MAHC,MAAM,QAAA;MACP,OAAK,eAAA,CAAC,YAAU,CACP,cAAA,OAAe,QAAA,aAAa,sBAAA,KAAqB,CAAA,CAAA;;KAE5D,mBAKO,QALP,YAKO,CAJL,mBAA4C,QAA5C,YAA4C,CAAf,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,GACzB,QAAA,QAAZ,UAAA,GAAA,mBAES,QAFT,YAES,gBADP,QAAA,IAAI,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;KAGR,mBASM,OAAA;MATD,OAAM;MAA8B,SAAK,cAAO,mBAAiB,CAAA,MAAA,CAAA;KACpE,GAAA,CAAA,WAOO,KAAA,QAAA,UAAA,CAAA,SAAA,CALG,QAAA,aAAa,QAAA,WADrB,UAAA,GAAA,YAKE,aAAA;;MAHA,MAAK;MACL,OAAK,eAAA,CAAC,WACE,QAAA,SAAM,mCAAA,kCAAA,CAAA"}
1
+ {"version":3,"file":"ListMenuItem.js","names":[],"sources":["../../src/components/ListMenuItem.vue"],"sourcesContent":["<template>\n <!-- A <div role=\"button\"> rather than a real <button> when interactive: the\n suffix slot commonly holds interactive controls (UiToggle, UiSelect —\n both <button>s), and nesting a <button> inside a <button> is invalid HTML\n the browser restructures, which breaks SSR hydration. A <div> can legally\n contain those controls. -->\n <div\n class=\"w-full flex items-center gap-3 text-sm text-left transition-colors\"\n :class=\"[sizeClass, colorClass]\"\n :role=\"isInteractive ? 'button' : undefined\"\n :tabindex=\"isInteractive && !disabled ? 0 : undefined\"\n :aria-disabled=\"isInteractive && disabled ? 'true' : undefined\"\n @click=\"handleClick\"\n @keydown=\"onKeydown\"\n >\n <UiIcon\n v-if=\"icon\"\n :name=\"icon\"\n class=\"shrink-0\"\n :class=\"[iconSizeClass, iconClass || defaultIconColorClass]\"\n />\n <span class=\"flex-1 min-w-0\">\n <span class=\"block truncate\"><slot /></span>\n <span v-if=\"hint\" class=\"block text-xs text-gray-400 dark:text-gray-500 truncate mt-0.5\">{{\n hint\n }}</span>\n </span>\n <div class=\"shrink-0 flex items-center\" @click.stop=\"handleSuffixClick\">\n <slot name=\"suffix\">\n <UiIcon\n v-if=\"clickable && chevron\"\n name=\"mdi:chevron-right\"\n class=\"w-4 h-4\"\n :class=\"danger ? 'text-red-300 dark:text-red-800' : 'text-gray-300 dark:text-gray-600'\"\n />\n </slot>\n </div>\n </div>\n</template>\n\n<script setup>\n/**\n * UiListMenuItem — Single row item for use inside UiListMenu.\n *\n * A versatile row component that can serve as:\n * - A clickable action row (set `clickable`)\n * - A toggle row where tapping anywhere toggles (set `toggle`)\n * - A select row where tapping anywhere opens the select (set `selectRef`)\n * - A static row hosting suffix controls (default)\n *\n * @example Clickable action row\n * <UiListMenuItem icon=\"mdi:account\" clickable @click=\"goProfile\">Profile</UiListMenuItem>\n *\n * @example Toggle row (whole row is tappable)\n * <UiListMenuItem icon=\"mdi:wrap\" :toggle=\"wordWrap\" @update:toggle=\"wordWrap = $event\">\n * Word Wrap\n * <template #suffix><UiToggle :model-value=\"wordWrap\" readonly /></template>\n * </UiListMenuItem>\n *\n * @example Select row (whole row opens the select)\n * <UiListMenuItem icon=\"mdi:translate\" :select-ref=\"langRef\">\n * Language\n * <template #suffix><UiSelect ref=\"langRef\" ... /></template>\n * </UiListMenuItem>\n *\n * @emits {void} click — Emitted when a clickable item is clicked\n * @emits {boolean} update:toggle — Emitted with the new value when a toggle row is tapped\n *\n * @slot default — Label text\n * @slot suffix — Trailing content (toggle, select, badge, etc.)\n *\n * @see UiListMenu — Parent container for grouping list items\n */\nimport { computed } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nconst props = defineProps({\n /** MDI icon name displayed at the start of the row. */\n icon: { type: String, default: '' },\n\n /** Custom CSS class override for the icon element. */\n iconClass: { type: String, default: '' },\n\n /** Whether this item is a clickable action (renders as button with hover states + chevron). */\n clickable: { type: Boolean, default: false },\n\n /**\n * Toggle state. When set to a boolean, the row becomes a tappable toggle.\n * Clicking anywhere emits `update:toggle` with the inverted value.\n */\n toggle: { type: Boolean, default: undefined },\n\n /**\n * Reference to a UiSelect component instance. When provided, the row becomes\n * tappable and clicking anywhere opens the select dropdown.\n */\n selectRef: { type: Object, default: undefined },\n\n /** Show a chevron-right icon as the trailing suffix (only when clickable). */\n chevron: { type: Boolean, default: true },\n\n /** Danger/red styling for destructive actions. */\n danger: { type: Boolean, default: false },\n\n /** Disabled state — dims the item and prevents interaction. */\n disabled: { type: Boolean, default: false },\n\n /** Optional hint text displayed below the label. */\n hint: { type: String, default: '' },\n\n /**\n * Size preset for padding and icon dimensions.\n * @values 'md' | 'sm'\n */\n size: { type: String, default: 'md' },\n})\n\nconst emit = defineEmits(['click', 'update:toggle'])\n\nconst isToggle = computed(() => props.toggle !== undefined)\nconst isSelect = computed(() => props.selectRef !== undefined)\nconst isInteractive = computed(() => props.clickable || isToggle.value || isSelect.value)\n\nconst handleClick = () => {\n if (props.disabled) return\n if (isToggle.value) {\n emit('update:toggle', !props.toggle)\n } else if (isSelect.value) {\n props.selectRef?.toggle?.()\n } else if (props.clickable) {\n emit('click')\n }\n}\n\n// Keep the row keyboard-operable now that it is a div[role=button] rather than\n// a native button.\nconst onKeydown = (e) => {\n if (!isInteractive.value || props.disabled) return\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleClick()\n }\n}\n\nconst handleSuffixClick = (e) => {\n // For toggle rows, clicking the suffix (the toggle itself) should also toggle\n if (isToggle.value && !props.disabled) {\n e.stopPropagation()\n emit('update:toggle', !props.toggle)\n return\n }\n // For select rows, let the select handle its own click (it calls toggleOpen)\n // but stop propagation so the row doesn't double-open\n if (isSelect.value) {\n e.stopPropagation()\n return\n }\n // For clickable rows, stop propagation so suffix controls work independently\n if (props.clickable) {\n e.stopPropagation()\n }\n}\n\nconst sizeClass = computed(() => {\n const map = { md: 'px-4 py-3', sm: 'px-3 py-2.5' }\n return map[props.size] ?? map.md\n})\n\nconst iconSizeClass = computed(() => {\n const map = { md: 'w-[18px] h-[18px]', sm: 'w-4 h-4' }\n return map[props.size] ?? map.md\n})\n\nconst defaultIconColorClass = computed(() => {\n if (props.danger) return 'text-red-500 dark:text-red-400'\n return 'text-gray-400 dark:text-gray-500'\n})\n\nconst colorClass = computed(() => {\n if (props.disabled) return 'opacity-40 cursor-not-allowed'\n if (!isInteractive.value) {\n return props.danger ? 'text-red-600 dark:text-red-400' : 'text-gray-700 dark:text-gray-300'\n }\n if (props.danger)\n return 'text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 cursor-pointer'\n return 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/40 active:bg-gray-100 dark:active:bg-gray-700/60 cursor-pointer'\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EA,MAAM,QAAQ;EAyCd,MAAM,OAAO;EAEb,MAAM,WAAW,eAAe,MAAM,WAAW,KAAA,CAAS;EAC1D,MAAM,WAAW,eAAe,MAAM,cAAc,KAAA,CAAS;EAC7D,MAAM,gBAAgB,eAAe,MAAM,aAAa,SAAS,SAAS,SAAS,KAAK;EAExF,MAAM,oBAAoB;GACxB,IAAI,MAAM,UAAU;GACpB,IAAI,SAAS,OACX,KAAK,iBAAiB,CAAC,MAAM,MAAM;QAC9B,IAAI,SAAS,OAClB,MAAM,WAAW,SAAS;QACrB,IAAI,MAAM,WACf,KAAK,OAAO;EAEhB;EAIA,MAAM,aAAa,MAAM;GACvB,IAAI,CAAC,cAAc,SAAS,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AAA,KAAqB,CAAA,CAAA;;IAE5D,mBAKO,QALP,YAKO,CAJL,mBAA4C,QAA5C,YAA4C,CAAf,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,GACzB,QAAA,QAAZ,UAAA,GAAA,mBAES,QAFT,YAES,gBADP,QAAA,IAAI,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;IAGR,mBASM,OAAA;KATD,OAAM;KAA8B,SAAK,cAAO,mBAAiB,CAAA,MAAA,CAAA;IACpE,GAAA,CAAA,WAOO,KAAA,QAAA,UAAA,CAAA,SAAA,CALG,QAAA,aAAa,QAAA,WADrB,UAAA,GAAA,YAKE,aAAA;;KAHA,MAAK;KACL,OAAK,eAAA,CAAC,WACE,QAAA,SAAM,mCAAA,kCAAA,CAAA"}
@@ -73,7 +73,7 @@ var _sfc_main = {
73
73
  return openBlock(), createElementBlock("div", {
74
74
  ref_key: "numpadRef",
75
75
  ref: numpadRef,
76
- class: "grid grid-cols-3 gap-3 max-w-[264px] mx-auto outline-none"
76
+ class: "grid grid-cols-3 gap-3 min-w-[264px] max-w-[264px] mx-auto outline-none"
77
77
  }, [
78
78
  (openBlock(), createElementBlock(Fragment, null, renderList([
79
79
  1,
@@ -90,7 +90,7 @@ var _sfc_main = {
90
90
  key: n,
91
91
  type: "button",
92
92
  tabindex: "-1",
93
- class: normalizeClass(["h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95", pressedKey.value === n ? "bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95" : "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-750 active:bg-gray-100 dark:active:bg-gray-700"]),
93
+ class: normalizeClass(["h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95", pressedKey.value === n ? "bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95" : "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600"]),
94
94
  disabled: __props.disabled,
95
95
  onClick: ($event) => onDigit(n)
96
96
  }, toDisplayString(n), 11, _hoisted_1);
@@ -99,14 +99,14 @@ var _sfc_main = {
99
99
  createElementVNode("button", {
100
100
  type: "button",
101
101
  tabindex: "-1",
102
- class: normalizeClass(["h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95", pressedKey.value === 0 ? "bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95" : "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-750 active:bg-gray-100 dark:active:bg-gray-700"]),
102
+ class: normalizeClass(["h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95", pressedKey.value === 0 ? "bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95" : "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600"]),
103
103
  disabled: __props.disabled,
104
104
  onClick: _cache[0] || (_cache[0] = ($event) => onDigit(0))
105
105
  }, " 0 ", 10, _hoisted_2),
106
106
  createElementVNode("button", {
107
107
  type: "button",
108
108
  tabindex: "-1",
109
- class: "h-16 w-full rounded-2xl transition-all duration-150 flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 active:scale-95 disabled:opacity-30 disabled:pointer-events-none",
109
+ class: "h-16 w-full rounded-2xl transition-all duration-150 flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600 active:scale-95 disabled:opacity-30 disabled:pointer-events-none",
110
110
  disabled: !__props.canDelete,
111
111
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("delete"))
112
112
  }, [createVNode(_sfc_main$1, {
@@ -1 +1 @@
1
- {"version":3,"file":"Numpad.js","names":["$emit"],"sources":["../../src/components/Numpad.vue"],"sourcesContent":["<template>\n <div ref=\"numpadRef\" class=\"grid grid-cols-3 gap-3 max-w-[264px] mx-auto outline-none\">\n <button\n v-for=\"n in [1, 2, 3, 4, 5, 6, 7, 8, 9]\"\n :key=\"n\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95\"\n :class=\"\n pressedKey === n\n ? 'bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95'\n : 'bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-750 active:bg-gray-100 dark:active:bg-gray-700'\n \"\n :disabled=\"disabled\"\n @click=\"onDigit(n)\"\n >\n {{ n }}\n </button>\n\n <!-- Bottom-left slot (e.g. biometrics button) -->\n <slot name=\"bottom-left\">\n <div />\n </slot>\n\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95\"\n :class=\"\n pressedKey === 0\n ? 'bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95'\n : 'bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-750 active:bg-gray-100 dark:active:bg-gray-700'\n \"\n :disabled=\"disabled\"\n @click=\"onDigit(0)\"\n >\n 0\n </button>\n\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"h-16 w-full rounded-2xl transition-all duration-150 flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 active:scale-95 disabled:opacity-30 disabled:pointer-events-none\"\n :disabled=\"!canDelete\"\n @click=\"$emit('delete')\"\n >\n <UiIcon name=\"mdi:backspace-outline\" class=\"w-6 h-6\" />\n </button>\n </div>\n</template>\n\n<script setup>\n/**\n * UiNumpad — A numeric keypad primitive for PIN entry and similar use cases.\n *\n * Emits digit presses and delete actions. Supports physical keyboard input\n * with visual key highlighting. Exposes a bottom-left slot for custom actions\n * (e.g. biometrics button).\n *\n * @example Basic usage\n * <UiNumpad :can-delete=\"pin.length > 0\" @digit=\"onDigit\" @delete=\"onDelete\" />\n *\n * @example With biometrics slot\n * <UiNumpad :can-delete=\"pin.length > 0\" @digit=\"onDigit\" @delete=\"onDelete\">\n * <template #bottom-left>\n * <button @click=\"useBiometrics\">🔒</button>\n * </template>\n * </UiNumpad>\n */\nimport { ref } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nimport { useEventListener } from '../composables/useEventListener.js'\n\nconst props = defineProps({\n /** Whether the numpad is disabled */\n disabled: { type: Boolean, default: false },\n /** Whether the delete button is enabled */\n canDelete: { type: Boolean, default: false },\n /** Whether the numpad listens for keyboard input globally */\n captureKeyboard: { type: Boolean, default: false },\n})\n\nconst emit = defineEmits(['digit', 'delete'])\n\nconst numpadRef = ref(null)\nconst pressedKey = ref(null)\n\nconst onDigit = (digit) => {\n if (props.disabled) return\n emit('digit', digit)\n}\n\nconst handleKeydown = (e) => {\n if (props.disabled) return\n\n if (/^[0-9]$/.test(e.key)) {\n e.preventDefault()\n const digit = Number(e.key)\n pressedKey.value = digit\n setTimeout(() => {\n pressedKey.value = null\n }, 150)\n onDigit(digit)\n return\n }\n\n if (e.key === 'Backspace') {\n e.preventDefault()\n emit('delete')\n }\n}\n\n// Global keyboard capture, bound only while `captureKeyboard` is set.\n// The target is a getter so it re-evaluates when the prop changes, and is\n// nullish during SSR — useEventListener skips nullish targets and tears the\n// listener down with the component, so no manual cleanup is needed.\nuseEventListener(() => (props.captureKeyboard ? globalThis.window : null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AK,eAAA,CAAC,6IACW,WAAA,UAAU,IAAA,6FAAA,mJAAA,CAAA;KAK1B,UAAU,QAAA;KACV,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAO,CAAA;IAChB,GAAA,OAED,IAAA,UAAA;IAEA,mBAQS,UAAA;KAPP,MAAK;KACL,UAAS;KACT,OAAM;KACL,UAAQ,CAAG,QAAA;KACX,SAAK,OAAA,OAAA,OAAA,MAAA,WAAEA,KAAAA,MAAK,QAAA;IAEb,GAAA,CAAA,YAAuD,aAAA;KAA/C,MAAK;KAAwB,OAAM"}
1
+ {"version":3,"file":"Numpad.js","names":["$emit"],"sources":["../../src/components/Numpad.vue"],"sourcesContent":["<template>\n <div\n ref=\"numpadRef\"\n class=\"grid grid-cols-3 gap-3 min-w-[264px] max-w-[264px] mx-auto outline-none\"\n >\n <button\n v-for=\"n in [1, 2, 3, 4, 5, 6, 7, 8, 9]\"\n :key=\"n\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95\"\n :class=\"\n pressedKey === n\n ? 'bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95'\n : 'bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600'\n \"\n :disabled=\"disabled\"\n @click=\"onDigit(n)\"\n >\n {{ n }}\n </button>\n\n <!-- Bottom-left slot (e.g. biometrics button) -->\n <slot name=\"bottom-left\">\n <div />\n </slot>\n\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"h-16 w-full text-xl font-medium rounded-2xl transition-all duration-150 text-gray-800 dark:text-gray-100 border shadow-sm active:scale-95\"\n :class=\"\n pressedKey === 0\n ? 'bg-primary-50 dark:bg-primary-900/30 border-primary-300 dark:border-primary-600 scale-95'\n : 'bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600'\n \"\n :disabled=\"disabled\"\n @click=\"onDigit(0)\"\n >\n 0\n </button>\n\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"h-16 w-full rounded-2xl transition-all duration-150 flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-gray-600 active:scale-95 disabled:opacity-30 disabled:pointer-events-none\"\n :disabled=\"!canDelete\"\n @click=\"$emit('delete')\"\n >\n <UiIcon name=\"mdi:backspace-outline\" class=\"w-6 h-6\" />\n </button>\n </div>\n</template>\n\n<script setup>\n/**\n * UiNumpad — A numeric keypad primitive for PIN entry and similar use cases.\n *\n * Emits digit presses and delete actions. Supports physical keyboard input\n * with visual key highlighting. Exposes a bottom-left slot for custom actions\n * (e.g. biometrics button).\n *\n * @example Basic usage\n * <UiNumpad :can-delete=\"pin.length > 0\" @digit=\"onDigit\" @delete=\"onDelete\" />\n *\n * @example With biometrics slot\n * <UiNumpad :can-delete=\"pin.length > 0\" @digit=\"onDigit\" @delete=\"onDelete\">\n * <template #bottom-left>\n * <button @click=\"useBiometrics\">🔒</button>\n * </template>\n * </UiNumpad>\n */\nimport { ref } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nimport { useEventListener } from '../composables/useEventListener.js'\n\nconst props = defineProps({\n /** Whether the numpad is disabled */\n disabled: { type: Boolean, default: false },\n /** Whether the delete button is enabled */\n canDelete: { type: Boolean, default: false },\n /** Whether the numpad listens for keyboard input globally */\n captureKeyboard: { type: Boolean, default: false },\n})\n\nconst emit = defineEmits(['digit', 'delete'])\n\nconst numpadRef = ref(null)\nconst pressedKey = ref(null)\n\nconst onDigit = (digit) => {\n if (props.disabled) return\n emit('digit', digit)\n}\n\nconst handleKeydown = (e) => {\n if (props.disabled) return\n\n if (/^[0-9]$/.test(e.key)) {\n e.preventDefault()\n const digit = Number(e.key)\n pressedKey.value = digit\n setTimeout(() => {\n pressedKey.value = null\n }, 150)\n onDigit(digit)\n return\n }\n\n if (e.key === 'Backspace') {\n e.preventDefault()\n emit('delete')\n }\n}\n\n// Global keyboard capture, bound only while `captureKeyboard` is set.\n// The target is a getter so it re-evaluates when the prop changes, and is\n// nullish during SSR — useEventListener skips nullish targets and tears the\n// listener down with the component, so no manual cleanup is needed.\nuseEventListener(() => (props.captureKeyboard ? globalThis.window : null), 'keydown', handleKeydown)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,MAAM,QAAQ;EASd,MAAM,OAAO;EAEb,MAAM,YAAY,IAAI,IAAI;EAC1B,MAAM,aAAa,IAAI,IAAI;EAE3B,MAAM,WAAW,UAAU;GACzB,IAAI,MAAM,UAAU;GACpB,KAAK,SAAS,KAAK;EACrB;EAEA,MAAM,iBAAiB,MAAM;GAC3B,IAAI,MAAM,UAAU;GAEpB,IAAI,UAAU,KAAK,EAAE,GAAG,GAAG;IACzB,EAAE,eAAe;IACjB,MAAM,QAAQ,OAAO,EAAE,GAAG;IAC1B,WAAW,QAAQ;IACnB,iBAAiB;KACf,WAAW,QAAQ;IACrB,GAAG,GAAG;IACN,QAAQ,KAAK;IACb;GACF;GAEA,IAAI,EAAE,QAAQ,aAAa;IACzB,EAAE,eAAe;IACjB,KAAK,QAAQ;GACf;EACF;EAMA,uBAAwB,MAAM,kBAAkB,WAAW,SAAS,MAAO,WAAW,aAAa;;GAtHjG,OAAA,UAAA,GAAA,mBAkDM,OAAA;IAjDA,SAAA;IAAJ,KAAI;IACJ,OAAM;;KAEN,UAAA,GAAA,mBAeS,UAAA,MAAA,WAdK;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA,IAAL,MAAC;KADV,OAAA,mBAeS,UAAA;MAbN,KAAK;MACN,MAAK;MACL,UAAS;MACT,OAAK,eAAA,CAAC,6IACW,WAAA,UAAe,IAAA,6FAAA,oJAAA,CAAA;MAK/B,UAAU,QAAA;MACV,UAAK,WAAE,QAAQ,CAAC;KAEd,GAAA,gBAAA,CAAC,GAAA,IAAA,UAAA;;IAIN,WAEO,KAAA,QAAA,eAAA,CAAA,SAAA,CADL,OAAA,OAAA,OAAA,KAAA,mBAAO,OAAA,MAAA,MAAA,EAAA,EAAA,CAAA;IAGT,mBAaS,UAAA;KAZP,MAAK;KACL,UAAS;KACT,OAAK,eAAA,CAAC,6IACW,WAAA,UAAU,IAAA,6FAAA,oJAAA,CAAA;KAK1B,UAAU,QAAA;KACV,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAO,CAAA;IAChB,GAAA,OAED,IAAA,UAAA;IAEA,mBAQS,UAAA;KAPP,MAAK;KACL,UAAS;KACT,OAAM;KACL,UAAQ,CAAG,QAAA;KACX,SAAK,OAAA,OAAA,OAAA,MAAA,WAAEA,KAAAA,MAAK,QAAA;IAEb,GAAA,CAAA,YAAuD,aAAA;KAA/C,MAAK;KAAwB,OAAM"}
@@ -0,0 +1,106 @@
1
+ import { useMergedClasses } from "../composables/useMergedClasses.js";
2
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
3
+ //#region src/components/PageHeader.vue
4
+ var _hoisted_1 = {
5
+ key: 0,
6
+ class: "mb-3"
7
+ };
8
+ var _hoisted_2 = { class: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between" };
9
+ var _hoisted_3 = { class: "min-w-0 flex-1" };
10
+ var _hoisted_4 = { class: "flex flex-wrap items-center gap-x-3 gap-y-2" };
11
+ var _hoisted_5 = {
12
+ key: 0,
13
+ class: "mt-1 max-w-3xl text-sm text-gray-600 dark:text-gray-400"
14
+ };
15
+ var _hoisted_6 = {
16
+ key: 0,
17
+ class: "flex shrink-0 flex-wrap items-center gap-2"
18
+ };
19
+ var _sfc_main = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
20
+ __name: "PageHeader",
21
+ props: {
22
+ /**
23
+ * Page title.
24
+ * @type {string}
25
+ * @default ''
26
+ */
27
+ title: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ /**
32
+ * One line explaining the page.
33
+ * @type {string}
34
+ * @default ''
35
+ */
36
+ description: {
37
+ type: String,
38
+ default: ""
39
+ },
40
+ /**
41
+ * Heading level of the title.
42
+ * @type {number}
43
+ * @default 1
44
+ * @values 1 | 2 | 3
45
+ */
46
+ level: {
47
+ type: Number,
48
+ default: 1
49
+ },
50
+ /**
51
+ * Draw a rule below the header.
52
+ * @type {boolean}
53
+ * @default false
54
+ */
55
+ bordered: {
56
+ type: Boolean,
57
+ default: false
58
+ }
59
+ },
60
+ setup(__props) {
61
+ /**
62
+ * UiPageHeader — the title block at the top of an application page: optional
63
+ * breadcrumb, heading, badges, a line of description and the page's actions.
64
+ *
65
+ * Actions sit to the right on wide screens and wrap below the title on narrow
66
+ * ones. The heading is an `<h1>` by default; lower it with `level` when the
67
+ * header sits inside a section that already has one.
68
+ *
69
+ * @example
70
+ * <UiPageHeader title="Apps" description="Every application that syncs through this service.">
71
+ * <template #actions>
72
+ * <UiButton><UiIcon name="mdi:plus" class="size-4" />New app</UiButton>
73
+ * </template>
74
+ * </UiPageHeader>
75
+ *
76
+ * @example With breadcrumb and a status badge
77
+ * <UiPageHeader title="notes">
78
+ * <template #breadcrumb><UiBreadcrumb :items="crumbs" /></template>
79
+ * <template #meta><UiBadge color="green">Active</UiBadge></template>
80
+ * </UiPageHeader>
81
+ *
82
+ * @slot title — Rich title content (overrides `title`).
83
+ * @slot meta — Inline content after the title, such as badges.
84
+ * @slot description — Rich description (overrides `description`).
85
+ * @slot breadcrumb — Content above the title, usually a `UiBreadcrumb`.
86
+ * @slot actions — Buttons for the page's primary actions.
87
+ */
88
+ const props = __props;
89
+ const headingTag = computed(() => `h${[
90
+ 1,
91
+ 2,
92
+ 3
93
+ ].includes(props.level) ? props.level : 1}`);
94
+ const { mergedClasses, restAttrs } = useMergedClasses(() => props.bordered ? "mb-6 border-b border-gray-200 pb-5 dark:border-gray-800" : "mb-6");
95
+ return (_ctx, _cache) => {
96
+ return openBlock(), createElementBlock("div", mergeProps({ class: unref(mergedClasses) }, unref(restAttrs)), [_ctx.$slots.breadcrumb ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "breadcrumb")])) : createCommentVNode("", true), createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [(openBlock(), createBlock(resolveDynamicComponent(headingTag.value), { class: "min-w-0 truncate text-2xl font-semibold tracking-tight text-gray-900 dark:text-gray-50" }, {
97
+ default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
98
+ _: 3
99
+ })), renderSlot(_ctx.$slots, "meta")]), __props.description || _ctx.$slots.description ? (openBlock(), createElementBlock("p", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("", true)]), _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true)])], 16);
100
+ };
101
+ }
102
+ });
103
+ //#endregion
104
+ export { _sfc_main as default };
105
+
106
+ //# sourceMappingURL=PageHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageHeader.js","names":["$slots"],"sources":["../../src/components/PageHeader.vue"],"sourcesContent":["<template>\n <div :class=\"mergedClasses\" v-bind=\"restAttrs\">\n <div v-if=\"$slots.breadcrumb\" class=\"mb-3\">\n <slot name=\"breadcrumb\" />\n </div>\n\n <div class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div class=\"min-w-0 flex-1\">\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-2\">\n <component\n :is=\"headingTag\"\n class=\"min-w-0 truncate text-2xl font-semibold tracking-tight text-gray-900 dark:text-gray-50\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </component>\n <slot name=\"meta\" />\n </div>\n <p\n v-if=\"description || $slots.description\"\n class=\"mt-1 max-w-3xl text-sm text-gray-600 dark:text-gray-400\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </p>\n </div>\n\n <div v-if=\"$slots.actions\" class=\"flex shrink-0 flex-wrap items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\n/**\n * UiPageHeader — the title block at the top of an application page: optional\n * breadcrumb, heading, badges, a line of description and the page's actions.\n *\n * Actions sit to the right on wide screens and wrap below the title on narrow\n * ones. The heading is an `<h1>` by default; lower it with `level` when the\n * header sits inside a section that already has one.\n *\n * @example\n * <UiPageHeader title=\"Apps\" description=\"Every application that syncs through this service.\">\n * <template #actions>\n * <UiButton><UiIcon name=\"mdi:plus\" class=\"size-4\" />New app</UiButton>\n * </template>\n * </UiPageHeader>\n *\n * @example With breadcrumb and a status badge\n * <UiPageHeader title=\"notes\">\n * <template #breadcrumb><UiBreadcrumb :items=\"crumbs\" /></template>\n * <template #meta><UiBadge color=\"green\">Active</UiBadge></template>\n * </UiPageHeader>\n *\n * @slot title — Rich title content (overrides `title`).\n * @slot meta — Inline content after the title, such as badges.\n * @slot description — Rich description (overrides `description`).\n * @slot breadcrumb — Content above the title, usually a `UiBreadcrumb`.\n * @slot actions — Buttons for the page's primary actions.\n */\nimport { computed } from 'vue'\nimport { useMergedClasses } from '../composables/useMergedClasses.js'\n\nconst props = defineProps({\n /**\n * Page title.\n * @type {string}\n * @default ''\n */\n title: { type: String, default: '' },\n\n /**\n * One line explaining the page.\n * @type {string}\n * @default ''\n */\n description: { type: String, default: '' },\n\n /**\n * Heading level of the title.\n * @type {number}\n * @default 1\n * @values 1 | 2 | 3\n */\n level: { type: Number, default: 1 },\n\n /**\n * Draw a rule below the header.\n * @type {boolean}\n * @default false\n */\n bordered: { type: Boolean, default: false },\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst headingTag = computed(() => `h${[1, 2, 3].includes(props.level) ? props.level : 1}`)\n\nconst { mergedClasses, restAttrs } = useMergedClasses(() =>\n props.bordered ? 'mb-6 border-b border-gray-200 pb-5 dark:border-gray-800' : 'mb-6',\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+DA,MAAM,QAAQ;EAiCd,MAAM,aAAa,eAAe,IAAI;GAAC;GAAG;GAAG;EAAC,CAAC,CAAC,SAAS,MAAM,KAAK,IAAI,MAAM,QAAQ,GAAG;EAEzF,MAAM,EAAE,eAAe,cAAc,uBACnC,MAAM,WAAW,4DAA4D,MAC/E;;GAnGE,OAAA,UAAA,GAAA,mBA4BM,OA5BN,WA4BM,EA5BA,OAAO,MAAA,aAAA,EAAa,GAAU,MAAA,SAAA,CAAS,GAAA,CAChCA,KAAAA,OAAO,cAAlB,UAAA,GAAA,mBAEM,OAFN,YAEM,CADJ,WAA0B,KAAA,QAAA,YAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAG5B,mBAsBM,OAtBN,YAsBM,CArBJ,mBAgBM,OAhBN,YAgBM,CAfJ,mBAQM,OARN,YAQM,EAPJ,UAAA,GAAA,YAKY,wBAJL,WAAA,KAAU,GAAA,EACf,OAAM,yFAAwF,GAAA;IAE9F,SAAA,cAAqC,CAArC,WAAqC,KAAA,QAAA,SAAA,CAAA,SAAA,CAAf,gBAAA,gBAAA,QAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;GAE7B,CAAA,IAAA,WAAoB,KAAA,QAAA,MAAA,CAAA,CAAA,GAGd,QAAA,eAAeA,KAAAA,OAAO,eAD9B,UAAA,GAAA,mBAKI,KALJ,YAKI,CADF,WAAiD,KAAA,QAAA,eAAA,CAAA,SAAA,CAArB,gBAAA,gBAAA,QAAA,WAAW,GAAA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