@auronui/vue 1.4.1 → 1.4.2

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/dist/cjs/index.cjs +719 -460
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/components/_shared/TimeScroller.js.map +1 -1
  4. package/dist/components/_shared/TimeScroller.vue_vue_type_script_setup_true_lang.js +11 -7
  5. package/dist/components/_shared/TimeScroller.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/accordion/Accordion.js.map +1 -1
  7. package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js +17 -6
  8. package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/autocomplete/Autocomplete.js.map +1 -1
  10. package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +23 -3
  11. package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/autocomplete/AutocompleteCreateItem.js.map +1 -1
  13. package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js +11 -7
  14. package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  15. package/dist/components/autocomplete/AutocompleteInput.js.map +1 -1
  16. package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js +23 -11
  17. package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/dist/components/autocomplete/AutocompleteItem.js.map +1 -1
  19. package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js +25 -17
  20. package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/autocomplete/AutocompleteOverflowChips.js.map +1 -1
  22. package/dist/components/autocomplete/AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js +11 -4
  23. package/dist/components/autocomplete/AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/avatar/Avatar.js.map +1 -1
  25. package/dist/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +11 -13
  26. package/dist/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/components/avatar/AvatarGroup.js.map +1 -1
  28. package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js +12 -8
  29. package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
  31. package/dist/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js +11 -2
  32. package/dist/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/button/ButtonGroup.js.map +1 -1
  34. package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js +4 -2
  35. package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/calendar/Calendar.js.map +1 -1
  37. package/dist/components/calendar/Calendar.vue_vue_type_script_setup_true_lang.js +3 -1
  38. package/dist/components/calendar/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  39. package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
  40. package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +32 -19
  41. package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/components/collapsible/CollapsibleGroup.js.map +1 -1
  43. package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js +9 -3
  44. package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/color-field/ColorField.js.map +1 -1
  46. package/dist/components/color-field/ColorField.vue_vue_type_script_setup_true_lang.js +17 -17
  47. package/dist/components/color-field/ColorField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/components/color-input-group/ColorInputGroup.js.map +1 -1
  49. package/dist/components/color-input-group/ColorInputGroup.vue_vue_type_script_setup_true_lang.js +16 -18
  50. package/dist/components/color-input-group/ColorInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/components/combo-box/ComboBox.js.map +1 -1
  52. package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js +10 -2
  53. package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/components/combo-box/ComboBoxInput.js.map +1 -1
  55. package/dist/components/combo-box/ComboBoxInput.vue_vue_type_script_setup_true_lang.js +9 -4
  56. package/dist/components/combo-box/ComboBoxInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  57. package/dist/components/combo-box/ComboBoxItem.js.map +1 -1
  58. package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js +15 -6
  59. package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  60. package/dist/components/date-picker/DatePicker.js.map +1 -1
  61. package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js +8 -4
  62. package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/date-time-picker/DateTimePicker.js.map +1 -1
  64. package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +10 -4
  65. package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  66. package/dist/components/list-box/ListBox.js.map +1 -1
  67. package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js +14 -4
  68. package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/modal/ModalContent.js.map +1 -1
  70. package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js +2 -3
  71. package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/radio/RadioGroup.js.map +1 -1
  73. package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js +32 -19
  74. package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  75. package/dist/components/scroll-area/ScrollArea.js.map +1 -1
  76. package/dist/components/scroll-area/ScrollArea.vue_vue_type_script_setup_true_lang.js +30 -13
  77. package/dist/components/scroll-area/ScrollArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/components/select/Select.js.map +1 -1
  79. package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js +21 -5
  80. package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
  81. package/dist/components/select/SelectItem.js.map +1 -1
  82. package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js +11 -6
  83. package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/components/select/SelectOverflowChips.js.map +1 -1
  85. package/dist/components/select/SelectOverflowChips.vue_vue_type_script_setup_true_lang.js +8 -5
  86. package/dist/components/select/SelectOverflowChips.vue_vue_type_script_setup_true_lang.js.map +1 -1
  87. package/dist/components/select/SelectTrigger.js.map +1 -1
  88. package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js +7 -5
  89. package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/select/SelectValue.js.map +1 -1
  91. package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js +11 -4
  92. package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/separator/Separator.js.map +1 -1
  94. package/dist/components/separator/Separator.vue_vue_type_script_setup_true_lang.js +9 -8
  95. package/dist/components/separator/Separator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  96. package/dist/components/stepper/Stepper.js.map +1 -1
  97. package/dist/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js +20 -10
  98. package/dist/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  99. package/dist/components/switch/SwitchGroup.js.map +1 -1
  100. package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js +29 -15
  101. package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/table/Table.js.map +1 -1
  103. package/dist/components/table/Table.vue_vue_type_script_setup_true_lang.js +29 -9
  104. package/dist/components/table/Table.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/tabs/TabList.js.map +1 -1
  106. package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js +18 -15
  107. package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/components/tabs/Tabs.js.map +1 -1
  109. package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js +30 -7
  110. package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  111. package/dist/components/time-picker/TimePicker.js.map +1 -1
  112. package/dist/components/time-picker/TimePicker.vue_vue_type_script_setup_true_lang.js +6 -2
  113. package/dist/components/time-picker/TimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/toast/ToastViewport.js.map +1 -1
  115. package/dist/components/toast/ToastViewport.vue_vue_type_script_setup_true_lang.js +19 -6
  116. package/dist/components/toast/ToastViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/index.d.ts +363 -0
  118. package/dist/packages/styles/dist/components/modal/modal.styles.js +2 -1
  119. package/dist/packages/styles/dist/components/modal/modal.styles.js.map +1 -1
  120. package/package.json +4 -4
@@ -1,12 +1,10 @@
1
+ import { composeClassName } from "../../utils/composeClassName.js";
1
2
  import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
2
3
  import { useAutocompleteInject } from "./Autocomplete.context.js";
3
4
  import { computed, createBlock, createCommentVNode, createElementVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
5
+ import { autocompleteVariants, listboxItemVariants } from "@auronui/styles";
4
6
  import { AutocompleteItem, injectComboboxRootContext } from "reka-ui";
5
7
  //#region src/components/autocomplete/AutocompleteCreateItem.vue?vue&type=script&setup=true&lang.ts
6
- var _hoisted_1 = {
7
- class: "autocomplete-item__text",
8
- "data-slot": "item-text"
9
- };
10
8
  var AutocompleteCreateItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
11
9
  __name: "AutocompleteCreateItem",
12
10
  props: {
@@ -29,7 +27,8 @@ var AutocompleteCreateItem_vue_vue_type_script_setup_true_lang_default = /* @__P
29
27
  asChild: {
30
28
  type: Boolean,
31
29
  default: false
32
- }
30
+ },
31
+ classNames: {}
33
32
  },
34
33
  emits: ["select"],
35
34
  setup(__props, { emit: __emit }) {
@@ -38,6 +37,8 @@ var AutocompleteCreateItem_vue_vue_type_script_setup_true_lang_default = /* @__P
38
37
  const isDisabled = useDeprecatedBooleanProp("AutocompleteCreateItem", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
39
38
  const ctx = useAutocompleteInject();
40
39
  const comboboxCtx = injectComboboxRootContext();
40
+ const itemSlots = listboxItemVariants();
41
+ const itemTextClass = computed(() => autocompleteVariants().itemText());
41
42
  const term = computed(() => ctx.searchTerm.value.trim());
42
43
  const isVisible = computed(() => !!term.value && !ctx.hasExactMatch.value);
43
44
  const displayLabel = computed(() => {
@@ -59,12 +60,15 @@ var AutocompleteCreateItem_vue_vue_type_script_setup_true_lang_default = /* @__P
59
60
  disabled: unref(isDisabled),
60
61
  as: props.as,
61
62
  "as-child": props.asChild,
62
- class: normalizeClass(["list-box-item list-box-item--default", props.class]),
63
+ class: normalizeClass(unref(composeClassName)(unref(itemSlots).item(), props.classNames?.item, props.class)),
63
64
  "data-slot": "list-box-item",
64
65
  "data-create-item": "",
65
66
  onSelect: handleSelect
66
67
  }, {
67
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", { term: term.value }, () => [createElementVNode("span", _hoisted_1, toDisplayString(displayLabel.value), 1)])]),
68
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", { term: term.value }, () => [createElementVNode("span", {
69
+ class: normalizeClass(unref(composeClassName)(itemTextClass.value, props.classNames?.text)),
70
+ "data-slot": "item-text"
71
+ }, toDisplayString(displayLabel.value), 3)])]),
68
72
  _: 3
69
73
  }, 8, [
70
74
  "value",
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteCreateItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { AutocompleteItem as RekaAutocompleteItem, injectComboboxRootContext } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n /**\n * Label for the create item. Accepts a static string or a function receiving\n * the current search term. Defaults to `Create \"${term}\"`.\n */\n label?: string | ((term: string) => string)\n class?: string\n /** The value of this item when selected. Defaults to the current search term. */\n value?: string\n /** A string value that represents this item during typeahead navigation. */\n textValue?: string\n isDisabled?: boolean\n /** Whether this item is disabled. @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n}>(), {\n label: undefined,\n class: undefined,\n value: undefined,\n textValue: undefined,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteCreateItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst ctx = useAutocompleteInject()\n// Reka's combobox context (provided by AutocompleteRoot) — used to drive the\n// open state and input focus directly, since this item's value equals the\n// current search term and Reka's native select path is unreliable for it.\nconst comboboxCtx = injectComboboxRootContext()\n\nconst term = computed(() => ctx.searchTerm.value.trim())\n\nconst isVisible = computed(() => !!term.value && !ctx.hasExactMatch.value)\n\nconst displayLabel = computed(() => {\n if (typeof props.label === 'function') return props.label(term.value)\n return props.label ?? `Create \"${term.value}\"`\n})\n\nfunction handleSelect(event: Event) {\n emit('select', event)\n // Always manage the creation ourselves — this item's value equals the current\n // search term, so Reka's native select (set-value + close) is unreliable here.\n event.preventDefault()\n ctx.onCreateValue(term.value)\n if (ctx.multiple.value) {\n // Keep the dropdown open for the next entry and restore input focus.\n comboboxCtx.inputElement.value?.focus()\n } else {\n // Single mode: close the dropdown, like selecting a regular item.\n comboboxCtx.onOpenChange(false)\n }\n}\n</script>\n\n<template>\n <RekaAutocompleteItem\n v-if=\"isVisible\"\n :key=\"term\"\n :value=\"props.value ?? term\"\n :text-value=\"props.textValue ?? term\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"['list-box-item list-box-item--default', props.class]\"\n data-slot=\"list-box-item\"\n data-create-item\n @select=\"handleSelect\"\n >\n <slot :term=\"term\">\n <span\n class=\"autocomplete-item__text\"\n data-slot=\"item-text\"\n >\n {{ displayLabel }}\n </span>\n </slot>\n </RekaAutocompleteItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EA6Bd,MAAM,OAAO;EAIb,MAAM,aAAa,yBACjB,0BAA0B,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SAC1F;EAEA,MAAM,MAAM,uBAAsB;EAIlC,MAAM,cAAc,2BAA0B;EAE9C,MAAM,OAAO,eAAe,IAAI,WAAW,MAAM,MAAM,CAAA;EAEvD,MAAM,YAAY,eAAe,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,cAAc,MAAK;EAEzE,MAAM,eAAe,eAAe;AAClC,OAAI,OAAO,MAAM,UAAU,WAAY,QAAO,MAAM,MAAM,KAAK,MAAK;AACpE,UAAO,MAAM,SAAS,WAAW,KAAK,MAAM;IAC7C;EAED,SAAS,aAAa,OAAc;AAClC,QAAK,UAAU,MAAK;AAGpB,SAAM,gBAAe;AACrB,OAAI,cAAc,KAAK,MAAK;AAC5B,OAAI,IAAI,SAAS,MAEf,aAAY,aAAa,OAAO,OAAM;OAGtC,aAAY,aAAa,MAAK;;;UAOxB,UAAA,SAAA,WAAA,EADR,YAqBuB,MAAA,iBAAA,EAAA;IAnBpB,KAAK,KAAA;IACL,OAAO,MAAM,SAAS,KAAA;IACtB,cAAY,MAAM,aAAa,KAAA;IAC/B,UAAU,MAAA,WAAU;IACpB,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,OAAK,eAAA,CAAA,wCAA2C,MAAM,MAAK,CAAA;IAC5D,aAAU;IACV,oBAAA;IACC,UAAQ;;2BASF,CAPP,WAOO,KAAA,QAAA,WAAA,EAPA,MAAM,KAAA,OAAI,QAOV,CANL,mBAKO,QALP,YAKO,gBADF,aAAA,MAAY,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteCreateItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { AutocompleteItem as RekaAutocompleteItem, injectComboboxRootContext } from 'reka-ui'\nimport { listboxItemVariants, autocompleteVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n /**\n * Label for the create item. Accepts a static string or a function receiving\n * the current search term. Defaults to `Create \"${term}\"`.\n */\n label?: string | ((term: string) => string)\n class?: string\n /** The value of this item when selected. Defaults to the current search term. */\n value?: string\n /** A string value that represents this item during typeahead navigation. */\n textValue?: string\n isDisabled?: boolean\n /** Whether this item is disabled. @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n text: ClassValue\n }>\n}>(), {\n label: undefined,\n class: undefined,\n value: undefined,\n textValue: undefined,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteCreateItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst ctx = useAutocompleteInject()\n// Reka's combobox context (provided by AutocompleteRoot) — used to drive the\n// open state and input focus directly, since this item's value equals the\n// current search term and Reka's native select path is unreliable for it.\nconst comboboxCtx = injectComboboxRootContext()\n\nconst itemSlots = listboxItemVariants()\nconst itemTextClass = computed(() => autocompleteVariants().itemText())\n\nconst term = computed(() => ctx.searchTerm.value.trim())\n\nconst isVisible = computed(() => !!term.value && !ctx.hasExactMatch.value)\n\nconst displayLabel = computed(() => {\n if (typeof props.label === 'function') return props.label(term.value)\n return props.label ?? `Create \"${term.value}\"`\n})\n\nfunction handleSelect(event: Event) {\n emit('select', event)\n // Always manage the creation ourselves — this item's value equals the current\n // search term, so Reka's native select (set-value + close) is unreliable here.\n event.preventDefault()\n ctx.onCreateValue(term.value)\n if (ctx.multiple.value) {\n // Keep the dropdown open for the next entry and restore input focus.\n comboboxCtx.inputElement.value?.focus()\n } else {\n // Single mode: close the dropdown, like selecting a regular item.\n comboboxCtx.onOpenChange(false)\n }\n}\n</script>\n\n<template>\n <RekaAutocompleteItem\n v-if=\"isVisible\"\n :key=\"term\"\n :value=\"props.value ?? term\"\n :text-value=\"props.textValue ?? term\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(itemSlots.item(), props.classNames?.item, props.class)\"\n data-slot=\"list-box-item\"\n data-create-item\n @select=\"handleSelect\"\n >\n <slot :term=\"term\">\n <span\n :class=\"composeClassName(itemTextClass, props.classNames?.text)\"\n data-slot=\"item-text\"\n >\n {{ displayLabel }}\n </span>\n </slot>\n </RekaAutocompleteItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EAkCd,MAAM,OAAO;EAIb,MAAM,aAAa,yBACjB,0BAA0B,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SAC1F;EAEA,MAAM,MAAM,uBAAsB;EAIlC,MAAM,cAAc,2BAA0B;EAE9C,MAAM,YAAY,qBAAoB;EACtC,MAAM,gBAAgB,eAAe,sBAAsB,CAAC,UAAU,CAAA;EAEtE,MAAM,OAAO,eAAe,IAAI,WAAW,MAAM,MAAM,CAAA;EAEvD,MAAM,YAAY,eAAe,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,cAAc,MAAK;EAEzE,MAAM,eAAe,eAAe;AAClC,OAAI,OAAO,MAAM,UAAU,WAAY,QAAO,MAAM,MAAM,KAAK,MAAK;AACpE,UAAO,MAAM,SAAS,WAAW,KAAK,MAAM;IAC7C;EAED,SAAS,aAAa,OAAc;AAClC,QAAK,UAAU,MAAK;AAGpB,SAAM,gBAAe;AACrB,OAAI,cAAc,KAAK,MAAK;AAC5B,OAAI,IAAI,SAAS,MAEf,aAAY,aAAa,OAAO,OAAM;OAGtC,aAAY,aAAa,MAAK;;;UAOxB,UAAA,SAAA,WAAA,EADR,YAqBuB,MAAA,iBAAA,EAAA;IAnBpB,KAAK,KAAA;IACL,OAAO,MAAM,SAAS,KAAA;IACtB,cAAY,MAAM,aAAa,KAAA;IAC/B,UAAU,MAAA,WAAU;IACpB,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,UAAS,CAAC,MAAI,EAAI,MAAM,YAAY,MAAM,MAAM,MAAK,CAAA;IAC9E,aAAU;IACV,oBAAA;IACC,UAAQ;;2BASF,CAPP,WAOO,KAAA,QAAA,WAAA,EAPA,MAAM,KAAA,OAAI,QAOV,CANL,mBAKO,QAAA;KAJJ,OAAK,eAAE,MAAA,iBAAgB,CAAC,cAAA,OAAe,MAAM,YAAY,KAAI,CAAA;KAC9D,aAAU;uBAEP,aAAA,MAAY,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteInput.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\nimport { AutocompleteInput, AutocompleteTrigger, AutocompleteCancel, AutocompleteAnchor } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport Chip from '../chip/Chip.vue'\nimport Spinner from '../spinner/Spinner.vue'\nimport AutocompleteOverflowChips from './AutocompleteOverflowChips.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport FieldLabel from '../_shared/FieldLabel.vue'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the AutocompleteInput as a different element. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the AutocompleteTrigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Disable the trigger button. Falls back to context isDisabled. */\n triggerDisabled?: boolean\n /** Render the AutocompleteCancel as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n /** Custom reference element for the AutocompleteAnchor. */\n anchorReference?: object | null\n /** Render the AutocompleteAnchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n}>(), {\n placeholder: undefined,\n class: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerAs: undefined,\n triggerAsChild: false,\n triggerDisabled: undefined,\n cancelAs: undefined,\n cancelAsChild: false,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useAutocompleteInject()\n\n// Resolve own isDisabled/disabled prop pair, falling back to the parent Autocomplete's\n// resolved isDisabled context value (reactively, via a fallback getter) only when neither\n// is set on this input directly.\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n\n// Track focused state via useFocusWithin (NOT manual @focus/@blur listeners) — the\n// inner Reka <AutocompleteInput> wraps the native <input>; useFocusWithin observes\n// the actual DOM subtree of the anchor, so isFocused flips reliably regardless of\n// how Reka forwards refs/attrs.\nconst anchorRef = useTemplateRef<HTMLElement>('anchor')\nconst { focused: isFocused } = useFocusWithin(anchorRef)\n\n// Render the inside-label only when (a) a label is set and (b) labelPlacement is 'inside'\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n\n// In multiple mode, hide placeholder once chips are present\nconst effectivePlaceholder = computed(() =>\n ctx.multiple.value && ctx.selectedValues.value.length > 0 ? undefined : props.placeholder,\n)\n\nconst getLabel = (v: string) => ctx.selectedLabels.value.find(l => l.value === v)?.label ?? v\n</script>\n\n<template>\n <AutocompleteAnchor\n ref=\"anchor\"\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"ctx.slots.value.trigger()\"\n :data-filled=\"ctx.hasLabel.value ? (ctx.isFilled.value || undefined) : undefined\"\n :data-focused=\"isFocused || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-disabled=\"ctx.isDisabled.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :data-multiple-overflow=\"ctx.multiple.value ? ctx.multipleOverflow.value : undefined\"\n data-slot=\"trigger\"\n >\n <FieldLabel\n v-if=\"showInsideLabel\"\n :for=\"ctx.inputId.value\"\n :label=\"ctx.label.value\"\n :is-required=\"ctx.isRequired.value\"\n :class=\"ctx.slots.value.label()\"\n />\n <span\n v-if=\"$slots.startContent\"\n :class=\"ctx.slots.value.startContent()\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <!-- Multiple/collapse: overflow chip area with truncation -->\n <AutocompleteOverflowChips\n v-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\"\n :values=\"ctx.selectedValues.value\"\n :get-label=\"getLabel\"\n :remove-value=\"ctx.removeValue\"\n />\n <!-- Multiple/wrap: chips that wrap onto new lines -->\n <template v-else-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'wrap'\">\n <Chip\n v-for=\"item in ctx.selectedLabels.value\"\n :key=\"item.value\"\n size=\"sm\"\n is-closable\n :close-aria-label=\"`Remove ${item.label}`\"\n data-slot=\"selected-chip\"\n @close.stop=\"ctx.removeValue(item.value)\"\n >\n {{ item.label }}\n </Chip>\n </template>\n <AutocompleteInput\n :id=\"ctx.inputId.value\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :placeholder=\"effectivePlaceholder\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :readonly=\"ctx.isReadonly.value\"\n :required=\"ctx.isRequired.value\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n :class=\"ctx.slots.value.input()\"\n :style=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\n ? { flex: '0 0 auto', minWidth: '80px', width: 'auto' }\n : undefined\"\n data-slot=\"input\"\n autocomplete=\"off\"\n @update:model-value=\"emit('update:modelValue', $event)\"\n />\n <!-- Clear button: only shown when filled and not in a readonly/disabled state.\n Reka's AutocompleteCancel does not set data-empty itself, so we drive it here.\n In multiple mode also clears selectedValues via ctx.clearAll(). -->\n <AutocompleteCancel\n :as=\"props.cancelAs\"\n :as-child=\"props.cancelAsChild\"\n :class=\"ctx.slots.value.clearButton()\"\n :data-empty=\"(!ctx.isFilled.value || ctx.isReadonly.value || ctx.isDisabled.value) ? 'true' : undefined\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n @click=\"ctx.multiple.value ? ctx.clearAll() : undefined\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"autocomplete-clear-button-icon\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </AutocompleteCancel>\n <!-- Inline loading spinner: replaces the dropdown indicator while loadItems is pending -->\n <span\n v-if=\"ctx.isLoading.value\"\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-loading-indicator\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Loading suggestions\"\n >\n <Spinner size=\"sm\" />\n </span>\n <!-- Dropdown trigger indicator (hidden while loading) -->\n <AutocompleteTrigger\n v-else\n :as=\"props.triggerAs\"\n :as-child=\"props.triggerAsChild\"\n :disabled=\"props.triggerDisabled\"\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-default-indicator\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </AutocompleteTrigger>\n </AutocompleteAnchor>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"AutocompleteInput.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\nimport { AutocompleteInput, AutocompleteTrigger, AutocompleteCancel, AutocompleteAnchor } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport Chip from '../chip/Chip.vue'\nimport Spinner from '../spinner/Spinner.vue'\nimport AutocompleteOverflowChips from './AutocompleteOverflowChips.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport FieldLabel from '../_shared/FieldLabel.vue'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the AutocompleteInput as a different element. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the AutocompleteTrigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Disable the trigger button. Falls back to context isDisabled. */\n triggerDisabled?: boolean\n /** Render the AutocompleteCancel as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n /** Custom reference element for the AutocompleteAnchor. */\n anchorReference?: object | null\n /** Render the AutocompleteAnchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n trigger: ClassValue\n label: ClassValue\n startContent: ClassValue\n input: ClassValue\n clearButton: ClassValue\n indicator: ClassValue\n chip: Partial<{\n base: ClassValue\n dot: ClassValue\n startContent: ClassValue\n label: ClassValue\n endContent: ClassValue\n closeButton: ClassValue\n }>\n }>\n}>(), {\n placeholder: undefined,\n class: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerAs: undefined,\n triggerAsChild: false,\n triggerDisabled: undefined,\n cancelAs: undefined,\n cancelAsChild: false,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useAutocompleteInject()\n\n// Resolve own isDisabled/disabled prop pair, falling back to the parent Autocomplete's\n// resolved isDisabled context value (reactively, via a fallback getter) only when neither\n// is set on this input directly.\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n\n// Track focused state via useFocusWithin (NOT manual @focus/@blur listeners) — the\n// inner Reka <AutocompleteInput> wraps the native <input>; useFocusWithin observes\n// the actual DOM subtree of the anchor, so isFocused flips reliably regardless of\n// how Reka forwards refs/attrs.\nconst anchorRef = useTemplateRef<HTMLElement>('anchor')\nconst { focused: isFocused } = useFocusWithin(anchorRef)\n\n// Render the inside-label only when (a) a label is set and (b) labelPlacement is 'inside'\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n\n// In multiple mode, hide placeholder once chips are present\nconst effectivePlaceholder = computed(() =>\n ctx.multiple.value && ctx.selectedValues.value.length > 0 ? undefined : props.placeholder,\n)\n\nconst getLabel = (v: string) => ctx.selectedLabels.value.find(l => l.value === v)?.label ?? v\n</script>\n\n<template>\n <AutocompleteAnchor\n ref=\"anchor\"\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"composeClassName(ctx.slots.value.trigger(), props.classNames?.trigger)\"\n :data-filled=\"ctx.hasLabel.value ? (ctx.isFilled.value || undefined) : undefined\"\n :data-focused=\"isFocused || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-disabled=\"ctx.isDisabled.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :data-multiple-overflow=\"ctx.multiple.value ? ctx.multipleOverflow.value : undefined\"\n data-slot=\"trigger\"\n >\n <FieldLabel\n v-if=\"showInsideLabel\"\n :for=\"ctx.inputId.value\"\n :label=\"ctx.label.value\"\n :is-required=\"ctx.isRequired.value\"\n :class=\"composeClassName(ctx.slots.value.label(), props.classNames?.label)\"\n />\n <span\n v-if=\"$slots.startContent\"\n :class=\"composeClassName(ctx.slots.value.startContent(), props.classNames?.startContent)\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <!-- Multiple/collapse: overflow chip area with truncation -->\n <AutocompleteOverflowChips\n v-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\"\n :values=\"ctx.selectedValues.value\"\n :get-label=\"getLabel\"\n :remove-value=\"ctx.removeValue\"\n :class-names=\"{ chip: props.classNames?.chip }\"\n />\n <!-- Multiple/wrap: chips that wrap onto new lines -->\n <template v-else-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'wrap'\">\n <Chip\n v-for=\"item in ctx.selectedLabels.value\"\n :key=\"item.value\"\n size=\"sm\"\n is-closable\n :close-aria-label=\"`Remove ${item.label}`\"\n data-slot=\"selected-chip\"\n :class-names=\"props.classNames?.chip\"\n @close.stop=\"ctx.removeValue(item.value)\"\n >\n {{ item.label }}\n </Chip>\n </template>\n <AutocompleteInput\n :id=\"ctx.inputId.value\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :placeholder=\"effectivePlaceholder\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :readonly=\"ctx.isReadonly.value\"\n :required=\"ctx.isRequired.value\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n :class=\"composeClassName(ctx.slots.value.input(), props.classNames?.input)\"\n :style=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\n ? { flex: '0 0 auto', minWidth: '80px', width: 'auto' }\n : undefined\"\n data-slot=\"input\"\n autocomplete=\"off\"\n @update:model-value=\"emit('update:modelValue', $event)\"\n />\n <!-- Clear button: only shown when filled and not in a readonly/disabled state.\n Reka's AutocompleteCancel does not set data-empty itself, so we drive it here.\n In multiple mode also clears selectedValues via ctx.clearAll(). -->\n <AutocompleteCancel\n :as=\"props.cancelAs\"\n :as-child=\"props.cancelAsChild\"\n :class=\"composeClassName(ctx.slots.value.clearButton(), props.classNames?.clearButton)\"\n :data-empty=\"(!ctx.isFilled.value || ctx.isReadonly.value || ctx.isDisabled.value) ? 'true' : undefined\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n @click=\"ctx.multiple.value ? ctx.clearAll() : undefined\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"autocomplete-clear-button-icon\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </AutocompleteCancel>\n <!-- Inline loading spinner: replaces the dropdown indicator while loadItems is pending -->\n <span\n v-if=\"ctx.isLoading.value\"\n :class=\"composeClassName(ctx.slots.value.indicator(), props.classNames?.indicator)\"\n data-slot=\"autocomplete-loading-indicator\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Loading suggestions\"\n >\n <Spinner size=\"sm\" />\n </span>\n <!-- Dropdown trigger indicator (hidden while loading) -->\n <AutocompleteTrigger\n v-else\n :as=\"props.triggerAs\"\n :as-child=\"props.triggerAsChild\"\n :disabled=\"props.triggerDisabled\"\n :class=\"composeClassName(ctx.slots.value.indicator(), props.classNames?.indicator)\"\n data-slot=\"autocomplete-default-indicator\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </AutocompleteTrigger>\n </AutocompleteAnchor>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { composeClassName } from "../../utils/composeClassName.js";
1
2
  import Spinner_default from "../spinner/Spinner.js";
2
3
  import Chip_default from "../chip/Chip.js";
3
4
  import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
@@ -50,7 +51,8 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
50
51
  anchorAsChild: {
51
52
  type: Boolean,
52
53
  default: false
53
- }
54
+ },
55
+ classNames: {}
54
56
  },
55
57
  emits: ["update:modelValue"],
56
58
  setup(__props, { emit: __emit }) {
@@ -68,7 +70,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
68
70
  reference: props.anchorReference,
69
71
  as: props.anchorAs,
70
72
  "as-child": props.anchorAsChild,
71
- class: normalizeClass(unref(ctx).slots.value.trigger()),
73
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.trigger(), props.classNames?.trigger)),
72
74
  "data-filled": unref(ctx).hasLabel.value ? unref(ctx).isFilled.value || void 0 : void 0,
73
75
  "data-focused": unref(isFocused) || void 0,
74
76
  "data-invalid": unref(ctx).isInvalid.value || void 0,
@@ -83,7 +85,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
83
85
  for: unref(ctx).inputId.value,
84
86
  label: unref(ctx).label.value,
85
87
  "is-required": unref(ctx).isRequired.value,
86
- class: normalizeClass(unref(ctx).slots.value.label())
88
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.label(), props.classNames?.label))
87
89
  }, null, 8, [
88
90
  "for",
89
91
  "label",
@@ -92,26 +94,36 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
92
94
  ])) : createCommentVNode("", true),
93
95
  _ctx.$slots.startContent ? (openBlock(), createElementBlock("span", {
94
96
  key: 1,
95
- class: normalizeClass(unref(ctx).slots.value.startContent()),
97
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.startContent(), props.classNames?.startContent)),
96
98
  "data-slot": "start-content"
97
99
  }, [renderSlot(_ctx.$slots, "startContent")], 2)) : createCommentVNode("", true),
98
100
  unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "collapse" && unref(ctx).selectedValues.value.length > 0 ? (openBlock(), createBlock(AutocompleteOverflowChips_default, {
99
101
  key: 2,
100
102
  values: unref(ctx).selectedValues.value,
101
103
  "get-label": getLabel,
102
- "remove-value": unref(ctx).removeValue
103
- }, null, 8, ["values", "remove-value"])) : unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "wrap" ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(unref(ctx).selectedLabels.value, (item) => {
104
+ "remove-value": unref(ctx).removeValue,
105
+ "class-names": { chip: props.classNames?.chip }
106
+ }, null, 8, [
107
+ "values",
108
+ "remove-value",
109
+ "class-names"
110
+ ])) : unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "wrap" ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(unref(ctx).selectedLabels.value, (item) => {
104
111
  return openBlock(), createBlock(Chip_default, {
105
112
  key: item.value,
106
113
  size: "sm",
107
114
  "is-closable": "",
108
115
  "close-aria-label": `Remove ${item.label}`,
109
116
  "data-slot": "selected-chip",
117
+ "class-names": props.classNames?.chip,
110
118
  onClose: withModifiers(($event) => unref(ctx).removeValue(item.value), ["stop"])
111
119
  }, {
112
120
  default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
113
121
  _: 2
114
- }, 1032, ["close-aria-label", "onClose"]);
122
+ }, 1032, [
123
+ "close-aria-label",
124
+ "class-names",
125
+ "onClose"
126
+ ]);
115
127
  }), 128)) : createCommentVNode("", true),
116
128
  createVNode(unref(AutocompleteInput), {
117
129
  id: unref(ctx).inputId.value,
@@ -125,7 +137,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
125
137
  required: unref(ctx).isRequired.value,
126
138
  "aria-invalid": unref(ctx).isInvalid.value || void 0,
127
139
  "aria-describedby": unref(ctx).ariaDescribedBy.value,
128
- class: normalizeClass(unref(ctx).slots.value.input()),
140
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.input(), props.classNames?.input)),
129
141
  style: normalizeStyle(unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "collapse" && unref(ctx).selectedValues.value.length > 0 ? {
130
142
  flex: "0 0 auto",
131
143
  minWidth: "80px",
@@ -152,7 +164,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
152
164
  createVNode(unref(AutocompleteCancel), {
153
165
  as: props.cancelAs,
154
166
  "as-child": props.cancelAsChild,
155
- class: normalizeClass(unref(ctx).slots.value.clearButton()),
167
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.clearButton(), props.classNames?.clearButton)),
156
168
  "data-empty": !unref(ctx).isFilled.value || unref(ctx).isReadonly.value || unref(ctx).isDisabled.value ? "true" : void 0,
157
169
  "data-slot": "clear-button",
158
170
  "aria-label": "Clear",
@@ -190,7 +202,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
190
202
  ]),
191
203
  unref(ctx).isLoading.value ? (openBlock(), createElementBlock("span", {
192
204
  key: 4,
193
- class: normalizeClass(unref(ctx).slots.value.indicator()),
205
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.indicator(), props.classNames?.indicator)),
194
206
  "data-slot": "autocomplete-loading-indicator",
195
207
  role: "status",
196
208
  "aria-live": "polite",
@@ -200,7 +212,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
200
212
  as: props.triggerAs,
201
213
  "as-child": props.triggerAsChild,
202
214
  disabled: props.triggerDisabled,
203
- class: normalizeClass(unref(ctx).slots.value.indicator()),
215
+ class: normalizeClass(unref(composeClassName)(unref(ctx).slots.value.indicator(), props.classNames?.indicator)),
204
216
  "data-slot": "autocomplete-default-indicator",
205
217
  "aria-label": "Toggle suggestions"
206
218
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteInput.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/autocomplete/AutocompleteInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\nimport { AutocompleteInput, AutocompleteTrigger, AutocompleteCancel, AutocompleteAnchor } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport Chip from '../chip/Chip.vue'\nimport Spinner from '../spinner/Spinner.vue'\nimport AutocompleteOverflowChips from './AutocompleteOverflowChips.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport FieldLabel from '../_shared/FieldLabel.vue'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the AutocompleteInput as a different element. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the AutocompleteTrigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Disable the trigger button. Falls back to context isDisabled. */\n triggerDisabled?: boolean\n /** Render the AutocompleteCancel as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n /** Custom reference element for the AutocompleteAnchor. */\n anchorReference?: object | null\n /** Render the AutocompleteAnchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n}>(), {\n placeholder: undefined,\n class: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerAs: undefined,\n triggerAsChild: false,\n triggerDisabled: undefined,\n cancelAs: undefined,\n cancelAsChild: false,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useAutocompleteInject()\n\n// Resolve own isDisabled/disabled prop pair, falling back to the parent Autocomplete's\n// resolved isDisabled context value (reactively, via a fallback getter) only when neither\n// is set on this input directly.\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n\n// Track focused state via useFocusWithin (NOT manual @focus/@blur listeners) — the\n// inner Reka <AutocompleteInput> wraps the native <input>; useFocusWithin observes\n// the actual DOM subtree of the anchor, so isFocused flips reliably regardless of\n// how Reka forwards refs/attrs.\nconst anchorRef = useTemplateRef<HTMLElement>('anchor')\nconst { focused: isFocused } = useFocusWithin(anchorRef)\n\n// Render the inside-label only when (a) a label is set and (b) labelPlacement is 'inside'\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n\n// In multiple mode, hide placeholder once chips are present\nconst effectivePlaceholder = computed(() =>\n ctx.multiple.value && ctx.selectedValues.value.length > 0 ? undefined : props.placeholder,\n)\n\nconst getLabel = (v: string) => ctx.selectedLabels.value.find(l => l.value === v)?.label ?? v\n</script>\n\n<template>\n <AutocompleteAnchor\n ref=\"anchor\"\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"ctx.slots.value.trigger()\"\n :data-filled=\"ctx.hasLabel.value ? (ctx.isFilled.value || undefined) : undefined\"\n :data-focused=\"isFocused || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-disabled=\"ctx.isDisabled.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :data-multiple-overflow=\"ctx.multiple.value ? ctx.multipleOverflow.value : undefined\"\n data-slot=\"trigger\"\n >\n <FieldLabel\n v-if=\"showInsideLabel\"\n :for=\"ctx.inputId.value\"\n :label=\"ctx.label.value\"\n :is-required=\"ctx.isRequired.value\"\n :class=\"ctx.slots.value.label()\"\n />\n <span\n v-if=\"$slots.startContent\"\n :class=\"ctx.slots.value.startContent()\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <!-- Multiple/collapse: overflow chip area with truncation -->\n <AutocompleteOverflowChips\n v-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\"\n :values=\"ctx.selectedValues.value\"\n :get-label=\"getLabel\"\n :remove-value=\"ctx.removeValue\"\n />\n <!-- Multiple/wrap: chips that wrap onto new lines -->\n <template v-else-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'wrap'\">\n <Chip\n v-for=\"item in ctx.selectedLabels.value\"\n :key=\"item.value\"\n size=\"sm\"\n is-closable\n :close-aria-label=\"`Remove ${item.label}`\"\n data-slot=\"selected-chip\"\n @close.stop=\"ctx.removeValue(item.value)\"\n >\n {{ item.label }}\n </Chip>\n </template>\n <AutocompleteInput\n :id=\"ctx.inputId.value\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :placeholder=\"effectivePlaceholder\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :readonly=\"ctx.isReadonly.value\"\n :required=\"ctx.isRequired.value\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n :class=\"ctx.slots.value.input()\"\n :style=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\n ? { flex: '0 0 auto', minWidth: '80px', width: 'auto' }\n : undefined\"\n data-slot=\"input\"\n autocomplete=\"off\"\n @update:model-value=\"emit('update:modelValue', $event)\"\n />\n <!-- Clear button: only shown when filled and not in a readonly/disabled state.\n Reka's AutocompleteCancel does not set data-empty itself, so we drive it here.\n In multiple mode also clears selectedValues via ctx.clearAll(). -->\n <AutocompleteCancel\n :as=\"props.cancelAs\"\n :as-child=\"props.cancelAsChild\"\n :class=\"ctx.slots.value.clearButton()\"\n :data-empty=\"(!ctx.isFilled.value || ctx.isReadonly.value || ctx.isDisabled.value) ? 'true' : undefined\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n @click=\"ctx.multiple.value ? ctx.clearAll() : undefined\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"autocomplete-clear-button-icon\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </AutocompleteCancel>\n <!-- Inline loading spinner: replaces the dropdown indicator while loadItems is pending -->\n <span\n v-if=\"ctx.isLoading.value\"\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-loading-indicator\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Loading suggestions\"\n >\n <Spinner size=\"sm\" />\n </span>\n <!-- Dropdown trigger indicator (hidden while loading) -->\n <AutocompleteTrigger\n v-else\n :as=\"props.triggerAs\"\n :as-child=\"props.triggerAsChild\"\n :disabled=\"props.triggerDisabled\"\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-default-indicator\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </AutocompleteTrigger>\n </AutocompleteAnchor>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EAkDd,MAAM,OAAO;EAIb,MAAM,MAAM,uBAAsB;EAKlC,MAAM,aAAa,yBACjB,qBAAqB,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,gBAC7E,IAAI,WAAW,MACvB;EAOA,MAAM,EAAE,SAAS,cAAc,eADb,eAA4B,SAAQ,CACC;EAGvD,MAAM,kBAAkB,eAChB,IAAI,SAAS,SAAS,IAAI,eAAe,UAAU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,QAAA,CAAA,OAAA,OAAA,OAAA,KAdL,mBAaM,OAAA;OAZJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"AutocompleteInput.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/autocomplete/AutocompleteInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\nimport { AutocompleteInput, AutocompleteTrigger, AutocompleteCancel, AutocompleteAnchor } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport Chip from '../chip/Chip.vue'\nimport Spinner from '../spinner/Spinner.vue'\nimport AutocompleteOverflowChips from './AutocompleteOverflowChips.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport FieldLabel from '../_shared/FieldLabel.vue'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the AutocompleteInput as a different element. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the AutocompleteTrigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Disable the trigger button. Falls back to context isDisabled. */\n triggerDisabled?: boolean\n /** Render the AutocompleteCancel as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n /** Custom reference element for the AutocompleteAnchor. */\n anchorReference?: object | null\n /** Render the AutocompleteAnchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n trigger: ClassValue\n label: ClassValue\n startContent: ClassValue\n input: ClassValue\n clearButton: ClassValue\n indicator: ClassValue\n chip: Partial<{\n base: ClassValue\n dot: ClassValue\n startContent: ClassValue\n label: ClassValue\n endContent: ClassValue\n closeButton: ClassValue\n }>\n }>\n}>(), {\n placeholder: undefined,\n class: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerAs: undefined,\n triggerAsChild: false,\n triggerDisabled: undefined,\n cancelAs: undefined,\n cancelAsChild: false,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useAutocompleteInject()\n\n// Resolve own isDisabled/disabled prop pair, falling back to the parent Autocomplete's\n// resolved isDisabled context value (reactively, via a fallback getter) only when neither\n// is set on this input directly.\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n\n// Track focused state via useFocusWithin (NOT manual @focus/@blur listeners) — the\n// inner Reka <AutocompleteInput> wraps the native <input>; useFocusWithin observes\n// the actual DOM subtree of the anchor, so isFocused flips reliably regardless of\n// how Reka forwards refs/attrs.\nconst anchorRef = useTemplateRef<HTMLElement>('anchor')\nconst { focused: isFocused } = useFocusWithin(anchorRef)\n\n// Render the inside-label only when (a) a label is set and (b) labelPlacement is 'inside'\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n\n// In multiple mode, hide placeholder once chips are present\nconst effectivePlaceholder = computed(() =>\n ctx.multiple.value && ctx.selectedValues.value.length > 0 ? undefined : props.placeholder,\n)\n\nconst getLabel = (v: string) => ctx.selectedLabels.value.find(l => l.value === v)?.label ?? v\n</script>\n\n<template>\n <AutocompleteAnchor\n ref=\"anchor\"\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"composeClassName(ctx.slots.value.trigger(), props.classNames?.trigger)\"\n :data-filled=\"ctx.hasLabel.value ? (ctx.isFilled.value || undefined) : undefined\"\n :data-focused=\"isFocused || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-disabled=\"ctx.isDisabled.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :data-multiple-overflow=\"ctx.multiple.value ? ctx.multipleOverflow.value : undefined\"\n data-slot=\"trigger\"\n >\n <FieldLabel\n v-if=\"showInsideLabel\"\n :for=\"ctx.inputId.value\"\n :label=\"ctx.label.value\"\n :is-required=\"ctx.isRequired.value\"\n :class=\"composeClassName(ctx.slots.value.label(), props.classNames?.label)\"\n />\n <span\n v-if=\"$slots.startContent\"\n :class=\"composeClassName(ctx.slots.value.startContent(), props.classNames?.startContent)\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <!-- Multiple/collapse: overflow chip area with truncation -->\n <AutocompleteOverflowChips\n v-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\"\n :values=\"ctx.selectedValues.value\"\n :get-label=\"getLabel\"\n :remove-value=\"ctx.removeValue\"\n :class-names=\"{ chip: props.classNames?.chip }\"\n />\n <!-- Multiple/wrap: chips that wrap onto new lines -->\n <template v-else-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'wrap'\">\n <Chip\n v-for=\"item in ctx.selectedLabels.value\"\n :key=\"item.value\"\n size=\"sm\"\n is-closable\n :close-aria-label=\"`Remove ${item.label}`\"\n data-slot=\"selected-chip\"\n :class-names=\"props.classNames?.chip\"\n @close.stop=\"ctx.removeValue(item.value)\"\n >\n {{ item.label }}\n </Chip>\n </template>\n <AutocompleteInput\n :id=\"ctx.inputId.value\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :placeholder=\"effectivePlaceholder\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :readonly=\"ctx.isReadonly.value\"\n :required=\"ctx.isRequired.value\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n :class=\"composeClassName(ctx.slots.value.input(), props.classNames?.input)\"\n :style=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\n ? { flex: '0 0 auto', minWidth: '80px', width: 'auto' }\n : undefined\"\n data-slot=\"input\"\n autocomplete=\"off\"\n @update:model-value=\"emit('update:modelValue', $event)\"\n />\n <!-- Clear button: only shown when filled and not in a readonly/disabled state.\n Reka's AutocompleteCancel does not set data-empty itself, so we drive it here.\n In multiple mode also clears selectedValues via ctx.clearAll(). -->\n <AutocompleteCancel\n :as=\"props.cancelAs\"\n :as-child=\"props.cancelAsChild\"\n :class=\"composeClassName(ctx.slots.value.clearButton(), props.classNames?.clearButton)\"\n :data-empty=\"(!ctx.isFilled.value || ctx.isReadonly.value || ctx.isDisabled.value) ? 'true' : undefined\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n @click=\"ctx.multiple.value ? ctx.clearAll() : undefined\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"autocomplete-clear-button-icon\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </AutocompleteCancel>\n <!-- Inline loading spinner: replaces the dropdown indicator while loadItems is pending -->\n <span\n v-if=\"ctx.isLoading.value\"\n :class=\"composeClassName(ctx.slots.value.indicator(), props.classNames?.indicator)\"\n data-slot=\"autocomplete-loading-indicator\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Loading suggestions\"\n >\n <Spinner size=\"sm\" />\n </span>\n <!-- Dropdown trigger indicator (hidden while loading) -->\n <AutocompleteTrigger\n v-else\n :as=\"props.triggerAs\"\n :as-child=\"props.triggerAsChild\"\n :disabled=\"props.triggerDisabled\"\n :class=\"composeClassName(ctx.slots.value.indicator(), props.classNames?.indicator)\"\n data-slot=\"autocomplete-default-indicator\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </AutocompleteTrigger>\n </AutocompleteAnchor>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAmEd,MAAM,OAAO;EAIb,MAAM,MAAM,uBAAsB;EAKlC,MAAM,aAAa,yBACjB,qBAAqB,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,gBAC7E,IAAI,WAAW,MACvB;EAOA,MAAM,EAAE,SAAS,cAAc,eADb,eAA4B,SAAQ,CACC;EAGvD,MAAM,kBAAkB,eAChB,IAAI,SAAS,SAAS,IAAI,eAAe,UAAU,SAC3D;EAGA,MAAM,uBAAuB,eAC3B,IAAI,SAAS,SAAS,IAAI,eAAe,MAAM,SAAS,IAAI,KAAA,IAAY,MAAM,YAChF;EAEA,MAAM,YAAY,M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,YAyBsB,MAAA,oBAAA,EAAA;;MAvBnB,IAAI,MAAM;MACV,YAAU,MAAM;MAChB,UAAU,MAAM;MAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,IAAG,CAAC,MAAM,MAAM,WAAS,EAAI,MAAM,YAAY,UAAS,CAAA;MACjF,aAAU;MACV,cAAW;;6BAiBJ,CAfP,WAeO,KAAA,QAAA,eAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAdL,mBAaM,OAAA;OAZJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteItem.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\n\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// In multiple mode, track whether this item is in the selected array\nconst isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value))\n\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n\nfunction handleSelect(event: Event) {\n emit('select', event)\n if (ctx.multiple.value) {\n // Prevent Reka from overwriting the combobox value with the selected item's text.\n // Without this, Reka's internal handler fires after ours and sets searchTerm = displayText.\n event.preventDefault()\n ctx.onMultipleSelect(props.value)\n }\n}\n</script>\n\n<template>\n <AutocompleteItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n :data-selected=\"isChecked || undefined\"\n class=\"list-box-item list-box-item--default\"\n data-slot=\"list-box-item\"\n @select=\"handleSelect\"\n >\n <slot name=\"startContent\" />\n <span\n class=\"autocomplete-item__text\"\n data-slot=\"item-text\"\n ><slot /></span>\n <!-- Single mode: Reka's ComboboxItemIndicator handles the checkmark natively -->\n <ComboboxItemIndicator\n v-if=\"!ctx.multiple.value\"\n :as=\"props.indicatorAs\"\n :as-child=\"props.indicatorAsChild\"\n class=\"list-box-item__indicator\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <!-- Multiple mode: check against our selectedValues array instead -->\n <span\n v-else-if=\"isChecked\"\n class=\"list-box-item__indicator\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </span>\n <slot name=\"endContent\" />\n </AutocompleteItem>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"AutocompleteItem.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { listboxItemVariants, autocompleteVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n text: ClassValue\n indicator: ClassValue\n }>\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\nconst itemSlots = listboxItemVariants()\nconst itemTextClass = computed(() => autocompleteVariants().itemText())\n\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// In multiple mode, track whether this item is in the selected array\nconst isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value))\n\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n\nfunction handleSelect(event: Event) {\n emit('select', event)\n if (ctx.multiple.value) {\n // Prevent Reka from overwriting the combobox value with the selected item's text.\n // Without this, Reka's internal handler fires after ours and sets searchTerm = displayText.\n event.preventDefault()\n ctx.onMultipleSelect(props.value)\n }\n}\n</script>\n\n<template>\n <AutocompleteItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n :data-selected=\"isChecked || undefined\"\n :class=\"composeClassName(itemSlots.item(), props.classNames?.item)\"\n data-slot=\"list-box-item\"\n @select=\"handleSelect\"\n >\n <slot name=\"startContent\" />\n <span\n :class=\"composeClassName(itemTextClass, props.classNames?.text)\"\n data-slot=\"item-text\"\n ><slot /></span>\n <!-- Single mode: Reka's ComboboxItemIndicator handles the checkmark natively -->\n <ComboboxItemIndicator\n v-if=\"!ctx.multiple.value\"\n :as=\"props.indicatorAs\"\n :as-child=\"props.indicatorAsChild\"\n :class=\"composeClassName(itemSlots.indicator(), props.classNames?.indicator)\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <!-- Multiple mode: check against our selectedValues array instead -->\n <span\n v-else-if=\"isChecked\"\n :class=\"composeClassName(itemSlots.indicator(), props.classNames?.indicator)\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </span>\n <slot name=\"endContent\" />\n </AutocompleteItem>\n</template>\n"],"mappings":""}
@@ -1,17 +1,10 @@
1
+ import { composeClassName } from "../../utils/composeClassName.js";
1
2
  import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
2
3
  import { useAutocompleteInject } from "./Autocomplete.context.js";
3
- import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, onMounted, onUnmounted, openBlock, renderSlot, unref, useSlots, withCtx } from "vue";
4
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, onMounted, onUnmounted, openBlock, renderSlot, unref, useSlots, withCtx } from "vue";
5
+ import { autocompleteVariants, listboxItemVariants } from "@auronui/styles";
4
6
  import { AutocompleteItem, ComboboxItemIndicator } from "reka-ui";
5
7
  //#region src/components/autocomplete/AutocompleteItem.vue?vue&type=script&setup=true&lang.ts
6
- var _hoisted_1 = {
7
- class: "autocomplete-item__text",
8
- "data-slot": "item-text"
9
- };
10
- var _hoisted_2 = {
11
- key: 1,
12
- class: "list-box-item__indicator",
13
- "data-slot": "list-box-item-indicator"
14
- };
15
8
  var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
16
9
  __name: "AutocompleteItem",
17
10
  props: {
@@ -35,7 +28,8 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
35
28
  indicatorAsChild: {
36
29
  type: Boolean,
37
30
  default: false
38
- }
31
+ },
32
+ classNames: {}
39
33
  },
40
34
  emits: ["select"],
41
35
  setup(__props, { emit: __emit }) {
@@ -44,6 +38,8 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
44
38
  const isDisabled = useDeprecatedBooleanProp("AutocompleteItem", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
45
39
  const slots = useSlots();
46
40
  const ctx = useAutocompleteInject();
41
+ const itemSlots = listboxItemVariants();
42
+ const itemTextClass = computed(() => autocompleteVariants().itemText());
47
43
  function extractText(nodes) {
48
44
  return nodes.map((n) => {
49
45
  if (typeof n.children === "string") return n.children;
@@ -79,18 +75,21 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
79
75
  "as-child": props.asChild,
80
76
  "data-item-value": props.value,
81
77
  "data-selected": isChecked.value || void 0,
82
- class: "list-box-item list-box-item--default",
78
+ class: normalizeClass(unref(composeClassName)(unref(itemSlots).item(), props.classNames?.item)),
83
79
  "data-slot": "list-box-item",
84
80
  onSelect: handleSelect
85
81
  }, {
86
82
  default: withCtx(() => [
87
83
  renderSlot(_ctx.$slots, "startContent"),
88
- createElementVNode("span", _hoisted_1, [renderSlot(_ctx.$slots, "default")]),
84
+ createElementVNode("span", {
85
+ class: normalizeClass(unref(composeClassName)(itemTextClass.value, props.classNames?.text)),
86
+ "data-slot": "item-text"
87
+ }, [renderSlot(_ctx.$slots, "default")], 2),
89
88
  !unref(ctx).multiple.value ? (openBlock(), createBlock(unref(ComboboxItemIndicator), {
90
89
  key: 0,
91
90
  as: props.indicatorAs,
92
91
  "as-child": props.indicatorAsChild,
93
- class: "list-box-item__indicator",
92
+ class: normalizeClass(unref(composeClassName)(unref(itemSlots).indicator(), props.classNames?.indicator)),
94
93
  "data-slot": "list-box-item-indicator"
95
94
  }, {
96
95
  default: withCtx(() => [renderSlot(_ctx.$slots, "selectedIcon", {}, () => [_cache[0] || (_cache[0] = createElementVNode("svg", {
@@ -107,7 +106,15 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
107
106
  "aria-hidden": "true"
108
107
  }, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])]),
109
108
  _: 3
110
- }, 8, ["as", "as-child"])) : isChecked.value ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "selectedIcon", {}, () => [_cache[1] || (_cache[1] = createElementVNode("svg", {
109
+ }, 8, [
110
+ "as",
111
+ "as-child",
112
+ "class"
113
+ ])) : isChecked.value ? (openBlock(), createElementBlock("span", {
114
+ key: 1,
115
+ class: normalizeClass(unref(composeClassName)(unref(itemSlots).indicator(), props.classNames?.indicator)),
116
+ "data-slot": "list-box-item-indicator"
117
+ }, [renderSlot(_ctx.$slots, "selectedIcon", {}, () => [_cache[1] || (_cache[1] = createElementVNode("svg", {
111
118
  xmlns: "http://www.w3.org/2000/svg",
112
119
  width: "12",
113
120
  height: "12",
@@ -119,7 +126,7 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
119
126
  "stroke-linejoin": "round",
120
127
  "data-slot": "list-box-item-indicator--checkmark",
121
128
  "aria-hidden": "true"
122
- }, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])])) : createCommentVNode("", true),
129
+ }, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])], 2)) : createCommentVNode("", true),
123
130
  renderSlot(_ctx.$slots, "endContent")
124
131
  ]),
125
132
  _: 3
@@ -130,7 +137,8 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
130
137
  "as",
131
138
  "as-child",
132
139
  "data-item-value",
133
- "data-selected"
140
+ "data-selected",
141
+ "class"
134
142
  ]);
135
143
  };
136
144
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\n\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// In multiple mode, track whether this item is in the selected array\nconst isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value))\n\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n\nfunction handleSelect(event: Event) {\n emit('select', event)\n if (ctx.multiple.value) {\n // Prevent Reka from overwriting the combobox value with the selected item's text.\n // Without this, Reka's internal handler fires after ours and sets searchTerm = displayText.\n event.preventDefault()\n ctx.onMultipleSelect(props.value)\n }\n}\n</script>\n\n<template>\n <AutocompleteItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n :data-selected=\"isChecked || undefined\"\n class=\"list-box-item list-box-item--default\"\n data-slot=\"list-box-item\"\n @select=\"handleSelect\"\n >\n <slot name=\"startContent\" />\n <span\n class=\"autocomplete-item__text\"\n data-slot=\"item-text\"\n ><slot /></span>\n <!-- Single mode: Reka's ComboboxItemIndicator handles the checkmark natively -->\n <ComboboxItemIndicator\n v-if=\"!ctx.multiple.value\"\n :as=\"props.indicatorAs\"\n :as-child=\"props.indicatorAsChild\"\n class=\"list-box-item__indicator\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <!-- Multiple mode: check against our selectedValues array instead -->\n <span\n v-else-if=\"isChecked\"\n class=\"list-box-item__indicator\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </span>\n <slot name=\"endContent\" />\n </AutocompleteItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EA2Bd,MAAM,OAAO;EAIb,MAAM,aAAa,yBACjB,oBAAoB,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SACpF;EAEA,MAAM,QAAe,UAAS;EAC9B,MAAM,MAAM,uBAAsB;EAElC,SAAS,YAAY,OAAwB;AAC3C,UAAO,MAAM,KAAI,MAAK;AACpB,QAAI,OAAO,EAAE,aAAa,SAAU,QAAO,EAAE;AAC7C,QAAI,MAAM,QAAQ,EAAE,SAAS,CAAE,QAAO,YAAY,EAAE,SAAmB;AACvE,WAAO;KACP,CAAC,KAAK,GAAE;;EAGZ,MAAM,cAAc,eAAuB;GACzC,MAAM,SAA+B,MAAM,WAA0C;AACrF,OAAI,CAAC,OAAQ,QAAO,MAAM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BO,CAjBL,WAgBO,KAAA,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAfL,mBAcM,OAAA;MAbJ,OAAM;MACN,OAAM;MACN,QAAO;MACP,SAAQ;MACR,MAAK;MACL,QAAO;MACP,gBAAa;MACb,kBAAe;MACf,mBAAgB;MAChB,aAAU;MACV,eAAY;SAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;KAIvC,WAA0B,KAAA,QAAA,aAAA"}
1
+ {"version":3,"file":"AutocompleteItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { listboxItemVariants, autocompleteVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n text: ClassValue\n indicator: ClassValue\n }>\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'AutocompleteItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\nconst itemSlots = listboxItemVariants()\nconst itemTextClass = computed(() => autocompleteVariants().itemText())\n\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// In multiple mode, track whether this item is in the selected array\nconst isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value))\n\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n\nfunction handleSelect(event: Event) {\n emit('select', event)\n if (ctx.multiple.value) {\n // Prevent Reka from overwriting the combobox value with the selected item's text.\n // Without this, Reka's internal handler fires after ours and sets searchTerm = displayText.\n event.preventDefault()\n ctx.onMultipleSelect(props.value)\n }\n}\n</script>\n\n<template>\n <AutocompleteItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n :data-selected=\"isChecked || undefined\"\n :class=\"composeClassName(itemSlots.item(), props.classNames?.item)\"\n data-slot=\"list-box-item\"\n @select=\"handleSelect\"\n >\n <slot name=\"startContent\" />\n <span\n :class=\"composeClassName(itemTextClass, props.classNames?.text)\"\n data-slot=\"item-text\"\n ><slot /></span>\n <!-- Single mode: Reka's ComboboxItemIndicator handles the checkmark natively -->\n <ComboboxItemIndicator\n v-if=\"!ctx.multiple.value\"\n :as=\"props.indicatorAs\"\n :as-child=\"props.indicatorAsChild\"\n :class=\"composeClassName(itemSlots.indicator(), props.classNames?.indicator)\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <!-- Multiple mode: check against our selectedValues array instead -->\n <span\n v-else-if=\"isChecked\"\n :class=\"composeClassName(itemSlots.indicator(), props.classNames?.indicator)\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </span>\n <slot name=\"endContent\" />\n </AutocompleteItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EAiCd,MAAM,OAAO;EAIb,MAAM,aAAa,yBACjB,oBAAoB,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SACpF;EAEA,MAAM,QAAe,UAAS;EAC9B,MAAM,MAAM,uBAAsB;EAClC,MAAM,YAAY,qBAAoB;EACtC,MAAM,gBAAgB,eAAe,sBAAsB,CAAC,UAAU,CAAA;EAEtE,SAAS,YAAY,OAAwB;AAC3C,UAAO,MAAM,KAAI,MAAK;AACpB,QAAI,OAAO,EAAE,aAAa,SAAU,QAAO,EAAE;AAC7C,QAAI,MAAM,QAAQ,EAAE,S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S,EAAI,MAAM,YAAY,UAAS,CAAA;MAC3E,aAAU;;6BAkBH,CAhBP,WAgBO,KAAA,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAfL,mBAcM,OAAA;OAbJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,aAAU;OACV,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA;;;;;;WAM1B,UAAA,SAAA,WAAA,EADb,mBAsBO,QAAA;;MApBJ,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,UAAS,CAAC,WAAS,EAAI,MAAM,YAAY,UAAS,CAAA;MAC3E,aAAU;SAEV,WAgBO,KAAA,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAfL,mBAcM,OAAA;MAbJ,OAAM;MACN,OAAM;MACN,QAAO;MACP,SAAQ;MACR,MAAK;MACL,QAAO;MACP,gBAAa;MACb,kBAAe;MACf,mBAAgB;MAChB,aAAU;MACV,eAAY;SAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;KAIvC,WAA0B,KAAA,QAAA,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteOverflowChips.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteOverflowChips.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, nextTick, useTemplateRef, onMounted, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport Chip from '../chip/Chip.vue'\n\nconst props = defineProps<{\n values: string[]\n getLabel: (value: string) => string\n removeValue: (value: string) => void\n}>()\n\nconst containerEl = useTemplateRef<HTMLElement>('container')\nconst visibleCount = ref(props.values.length)\nconst overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value))\n\n// Prevents re-entrant reflows while we are in the async measurement phase.\nlet measuring = false\n\nasync function reflow() {\n if (measuring) return\n measuring = true\n\n try {\n const el = containerEl.value\n if (!el) return\n\n // Phase 1: show all chips to measure their natural widths\n visibleCount.value = props.values.length\n await nextTick()\n\n const chips = [...el.querySelectorAll<HTMLElement>('[data-chip-item]')]\n if (!chips.length) return\n\n const containerW = el.offsetWidth\n if (!containerW) return\n\n // BADGE_W = estimated chip width (68px) + CSS gap before it (4px).\n const BADGE_W = 76\n\n let usedW = 0\n let n = 0\n\n for (let i = 0; i < chips.length; i++) {\n const gap = i > 0 ? 4 : 0\n const chipW = chips[i].offsetWidth\n const isLast = i === chips.length - 1\n const budget = isLast ? containerW : containerW - BADGE_W\n\n if (usedW + gap + chipW > budget) break\n usedW += gap + chipW\n n++\n }\n\n visibleCount.value = Math.max(1, n)\n } finally {\n measuring = false\n }\n}\n\nonMounted(reflow)\nuseResizeObserver(containerEl, reflow)\nwatch(\n () => props.values.join('\\x00'),\n () => reflow(),\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"container\"\n style=\"display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0;\"\n >\n <Chip\n v-for=\"(val, i) in values\"\n :key=\"val\"\n data-chip-item\n size=\"sm\"\n is-closable\n :style=\"i >= visibleCount ? 'display: none' : undefined\"\n @close.stop=\"removeValue(val)\"\n >\n {{ getLabel(val) }}\n </Chip>\n <Chip\n v-if=\"overflowCount > 0\"\n size=\"sm\"\n color=\"default\"\n >\n +{{ overflowCount }} more\n </Chip>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"AutocompleteOverflowChips.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteOverflowChips.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, nextTick, useTemplateRef, onMounted, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport Chip from '../chip/Chip.vue'\nimport type { ClassValue } from '../../utils/composeClassName'\n\nconst props = defineProps<{\n values: string[]\n getLabel: (value: string) => string\n removeValue: (value: string) => void\n /** Per-slot class overrides */\n classNames?: Partial<{\n chip: Partial<{\n base: ClassValue\n dot: ClassValue\n startContent: ClassValue\n label: ClassValue\n endContent: ClassValue\n closeButton: ClassValue\n }>\n }>\n}>()\n\nconst containerEl = useTemplateRef<HTMLElement>('container')\nconst visibleCount = ref(props.values.length)\nconst overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value))\n\n// Prevents re-entrant reflows while we are in the async measurement phase.\nlet measuring = false\n\nasync function reflow() {\n if (measuring) return\n measuring = true\n\n try {\n const el = containerEl.value\n if (!el) return\n\n // Phase 1: show all chips to measure their natural widths\n visibleCount.value = props.values.length\n await nextTick()\n\n const chips = [...el.querySelectorAll<HTMLElement>('[data-chip-item]')]\n if (!chips.length) return\n\n const containerW = el.offsetWidth\n if (!containerW) return\n\n // BADGE_W = estimated chip width (68px) + CSS gap before it (4px).\n const BADGE_W = 76\n\n let usedW = 0\n let n = 0\n\n for (let i = 0; i < chips.length; i++) {\n const gap = i > 0 ? 4 : 0\n const chipW = chips[i].offsetWidth\n const isLast = i === chips.length - 1\n const budget = isLast ? containerW : containerW - BADGE_W\n\n if (usedW + gap + chipW > budget) break\n usedW += gap + chipW\n n++\n }\n\n visibleCount.value = Math.max(1, n)\n } finally {\n measuring = false\n }\n}\n\nonMounted(reflow)\nuseResizeObserver(containerEl, reflow)\nwatch(\n () => props.values.join('\\x00'),\n () => reflow(),\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"container\"\n style=\"display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0;\"\n >\n <Chip\n v-for=\"(val, i) in values\"\n :key=\"val\"\n data-chip-item\n size=\"sm\"\n is-closable\n :style=\"i >= visibleCount ? 'display: none' : undefined\"\n :class-names=\"props.classNames?.chip\"\n @close.stop=\"removeValue(val)\"\n >\n {{ getLabel(val) }}\n </Chip>\n <Chip\n v-if=\"overflowCount > 0\"\n size=\"sm\"\n color=\"default\"\n :class-names=\"props.classNames?.chip\"\n >\n +{{ overflowCount }} more\n </Chip>\n </div>\n</template>\n"],"mappings":""}
@@ -19,7 +19,8 @@ var AutocompleteOverflowChips_vue_vue_type_script_setup_true_lang_default = /* @
19
19
  props: {
20
20
  values: {},
21
21
  getLabel: { type: Function },
22
- removeValue: { type: Function }
22
+ removeValue: { type: Function },
23
+ classNames: {}
23
24
  },
24
25
  setup(__props) {
25
26
  const props = __props;
@@ -66,19 +67,25 @@ var AutocompleteOverflowChips_vue_vue_type_script_setup_true_lang_default = /* @
66
67
  size: "sm",
67
68
  "is-closable": "",
68
69
  style: normalizeStyle(i >= visibleCount.value ? "display: none" : void 0),
70
+ "class-names": props.classNames?.chip,
69
71
  onClose: withModifiers(($event) => __props.removeValue(val), ["stop"])
70
72
  }, {
71
73
  default: withCtx(() => [createTextVNode(toDisplayString(__props.getLabel(val)), 1)]),
72
74
  _: 2
73
- }, 1032, ["style", "onClose"]);
75
+ }, 1032, [
76
+ "style",
77
+ "class-names",
78
+ "onClose"
79
+ ]);
74
80
  }), 128)), overflowCount.value > 0 ? (openBlock(), createBlock(Chip_default, {
75
81
  key: 0,
76
82
  size: "sm",
77
- color: "default"
83
+ color: "default",
84
+ "class-names": props.classNames?.chip
78
85
  }, {
79
86
  default: withCtx(() => [createTextVNode(" +" + toDisplayString(overflowCount.value) + " more ", 1)]),
80
87
  _: 1
81
- })) : createCommentVNode("", true)], 512);
88
+ }, 8, ["class-names"])) : createCommentVNode("", true)], 512);
82
89
  };
83
90
  }
84
91
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteOverflowChips.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, nextTick, useTemplateRef, onMounted, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport Chip from '../chip/Chip.vue'\n\nconst props = defineProps<{\n values: string[]\n getLabel: (value: string) => string\n removeValue: (value: string) => void\n}>()\n\nconst containerEl = useTemplateRef<HTMLElement>('container')\nconst visibleCount = ref(props.values.length)\nconst overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value))\n\n// Prevents re-entrant reflows while we are in the async measurement phase.\nlet measuring = false\n\nasync function reflow() {\n if (measuring) return\n measuring = true\n\n try {\n const el = containerEl.value\n if (!el) return\n\n // Phase 1: show all chips to measure their natural widths\n visibleCount.value = props.values.length\n await nextTick()\n\n const chips = [...el.querySelectorAll<HTMLElement>('[data-chip-item]')]\n if (!chips.length) return\n\n const containerW = el.offsetWidth\n if (!containerW) return\n\n // BADGE_W = estimated chip width (68px) + CSS gap before it (4px).\n const BADGE_W = 76\n\n let usedW = 0\n let n = 0\n\n for (let i = 0; i < chips.length; i++) {\n const gap = i > 0 ? 4 : 0\n const chipW = chips[i].offsetWidth\n const isLast = i === chips.length - 1\n const budget = isLast ? containerW : containerW - BADGE_W\n\n if (usedW + gap + chipW > budget) break\n usedW += gap + chipW\n n++\n }\n\n visibleCount.value = Math.max(1, n)\n } finally {\n measuring = false\n }\n}\n\nonMounted(reflow)\nuseResizeObserver(containerEl, reflow)\nwatch(\n () => props.values.join('\\x00'),\n () => reflow(),\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"container\"\n style=\"display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0;\"\n >\n <Chip\n v-for=\"(val, i) in values\"\n :key=\"val\"\n data-chip-item\n size=\"sm\"\n is-closable\n :style=\"i >= visibleCount ? 'display: none' : undefined\"\n @close.stop=\"removeValue(val)\"\n >\n {{ getLabel(val) }}\n </Chip>\n <Chip\n v-if=\"overflowCount > 0\"\n size=\"sm\"\n color=\"default\"\n >\n +{{ overflowCount }} more\n </Chip>\n </div>\n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kBAAqB,KAAA,EAAS;KACtD,SAAK,eAAA,WAAO,QAAA,YAAY,IAAG,EAAA,CAAA,OAAA,CAAA;;4BAET,CAAA,gBAAA,gBAAhB,QAAA,SAAS,IAAG,CAAA,EAAA,EAAA,CAAA,CAAA;;;cAGT,cAAA,QAAa,KAAA,WAAA,EADrB,YAMO,cAAA;;IAJL,MAAK;IACL,OAAM;;2BAEL,CAAA,gBADF,OACE,gBAAG,cAAA,MAAa,GAAG,UACtB,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteOverflowChips.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, nextTick, useTemplateRef, onMounted, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport Chip from '../chip/Chip.vue'\nimport type { ClassValue } from '../../utils/composeClassName'\n\nconst props = defineProps<{\n values: string[]\n getLabel: (value: string) => string\n removeValue: (value: string) => void\n /** Per-slot class overrides */\n classNames?: Partial<{\n chip: Partial<{\n base: ClassValue\n dot: ClassValue\n startContent: ClassValue\n label: ClassValue\n endContent: ClassValue\n closeButton: ClassValue\n }>\n }>\n}>()\n\nconst containerEl = useTemplateRef<HTMLElement>('container')\nconst visibleCount = ref(props.values.length)\nconst overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value))\n\n// Prevents re-entrant reflows while we are in the async measurement phase.\nlet measuring = false\n\nasync function reflow() {\n if (measuring) return\n measuring = true\n\n try {\n const el = containerEl.value\n if (!el) return\n\n // Phase 1: show all chips to measure their natural widths\n visibleCount.value = props.values.length\n await nextTick()\n\n const chips = [...el.querySelectorAll<HTMLElement>('[data-chip-item]')]\n if (!chips.length) return\n\n const containerW = el.offsetWidth\n if (!containerW) return\n\n // BADGE_W = estimated chip width (68px) + CSS gap before it (4px).\n const BADGE_W = 76\n\n let usedW = 0\n let n = 0\n\n for (let i = 0; i < chips.length; i++) {\n const gap = i > 0 ? 4 : 0\n const chipW = chips[i].offsetWidth\n const isLast = i === chips.length - 1\n const budget = isLast ? containerW : containerW - BADGE_W\n\n if (usedW + gap + chipW > budget) break\n usedW += gap + chipW\n n++\n }\n\n visibleCount.value = Math.max(1, n)\n } finally {\n measuring = false\n }\n}\n\nonMounted(reflow)\nuseResizeObserver(containerEl, reflow)\nwatch(\n () => props.values.join('\\x00'),\n () => reflow(),\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"container\"\n style=\"display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0;\"\n >\n <Chip\n v-for=\"(val, i) in values\"\n :key=\"val\"\n data-chip-item\n size=\"sm\"\n is-closable\n :style=\"i >= visibleCount ? 'display: none' : undefined\"\n :class-names=\"props.classNames?.chip\"\n @close.stop=\"removeValue(val)\"\n >\n {{ getLabel(val) }}\n </Chip>\n <Chip\n v-if=\"overflowCount > 0\"\n size=\"sm\"\n color=\"default\"\n :class-names=\"props.classNames?.chip\"\n >\n +{{ overflowCount }} more\n </Chip>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAiBd,MAAM,cAAc,eAA4B,YAAW;EAC3D,MAAM,eAAe,IAAI,MAAM,OAAO,OAAM;EAC5C,MAAM,gBAAgB,eAAe,KAAK,IAAI,GAAG,MAAM,OAAO,SAAS,aAAa,MAAM,CAAA;EAG1F,IAAI,YAAY;EAEhB,eAAe,SAAS;AACtB,OAAI,UAAW;AACf,eAAY;AAEZ,OAAI;IACF,MAAM,KAAK,YAAY;AACvB,QAAI,CAAC,GAAI;AAGT,iBAAa,QAAQ,MAAM,OAAO;AAClC,UAAM,UAAS;IAEf,MAAM,QAAQ,CAAC,GAAG,GAAG,iBAA8B,mBAAmB,CAAA;AACtE,QAAI,CAAC,MAAM,OAAQ;IAEnB,MAAM,aAAa,GAAG;AACtB,QAAI,CAAC,WAAY;IAGjB,MAAM,UAAU;IAEhB,IAAI,QAAQ;IACZ,IAAI,IAAI;AAER,SAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;KACrC,MAAM,MAAM,IAAI,IAAI,IAAI;KACxB,MAAM,QAAQ,MAAM,GAAG;KAEvB,MAAM,SADS,MAAM,MAAM,SAAS,IACZ,aAAa,aAAa;AAElD,SAAI,QAAQ,MAAM,QAAQ,OAAQ;AAClC,cAAS,MAAM;AACf;;AAGF,iBAAa,QAAQ,KAAK,IAAI,GAAG,EAAC;aAC1B;AACR,gBAAY;;;AAIhB,YAAU,OAAM;AAChB,oBAAkB,aAAa,OAAM;AACrC,cACQ,MAAM,OAAO,KAAK,KAAO,QACzB,QAAQ,EACd,EAAE,OAAO,QAAQ,CACnB;;uBAIE,mBAwBM,OAxBN,YAwBM,EAAA,UAAA,KAAA,EApBJ,mBAWO,UAAA,MAAA,WAVc,QAAA,SAAX,KAAK,MAAC;wBADhB,YAWO,cAAA;KATJ,KAAK;KACN,kBAAA;KACA,MAAK;KACL,eAAA;KACC,OAAK,eAAE,KAAK,aAAA,QAAY,kBAAqB,KAAA,EAAS;KACtD,eAAa,MAAM,YAAY;KAC/B,SAAK,eAAA,WAAO,QAAA,YAAY,IAAG,EAAA,CAAA,OAAA,CAAA;;4BAET,CAAA,gBAAA,gBAAhB,QAAA,SAAS,IAAG,CAAA,EAAA,EAAA,CAAA,CAAA;;;;;;;cAGT,cAAA,QAAa,KAAA,WAAA,EADrB,YAOO,cAAA;;IALL,MAAK;IACL,OAAM;IACL,eAAa,MAAM,YAAY;;2BAE/B,CAAA,gBADF,OACE,gBAAG,cAAA,MAAa,GAAG,UACtB,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","names":[],"sources":["../../../src/components/avatar/Avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { AvatarRoot, AvatarImage, AvatarFallback } from 'reka-ui'\nimport { avatarVariants, type AvatarVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useAvatarGroupInject } from './avatar-group.context'\n\nconst props = withDefaults(defineProps<{\n src?: string\n alt?: string\n name?: string\n size?: AvatarVariants['size']\n color?: AvatarVariants['color']\n variant?: AvatarVariants['variant']\n isBordered?: boolean\n isDisabled?: boolean\n showFallback?: boolean\n /** AvatarRoot props */\n as?: string\n asChild?: boolean\n /** AvatarImage props */\n referrerPolicy?: string\n crossOrigin?: string\n imageAs?: string\n imageAsChild?: boolean\n /** AvatarFallback props */\n delayMs?: number\n fallbackAs?: string\n fallbackAsChild?: boolean\n class?: ClassValue\n /** Per-slot class name overrides */\n classNames?: Partial<{\n base: ClassValue\n image: ClassValue\n fallback: ClassValue\n }>\n}>(), {\n isBordered: false,\n isDisabled: false,\n showFallback: false,\n})\n\nconst emit = defineEmits<{\n 'loading-status-change': [status: string]\n}>()\n\n// Inject AvatarGroup context with ref-based fallbacks (mirrors Button.vue pattern)\nconst groupCtx = useAvatarGroupInject({\n size: ref('md'),\n isBordered: ref(false),\n isDisabled: ref(false),\n isGrid: ref(false),\n isInGroup: ref(false),\n})\n\n// Prop precedence rules (matching ButtonGroup D-13):\n// - group disabled ALWAYS wins over child prop\n// - other props: child prop wins over group value (child ?? group)\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\nconst finalIsBordered = computed(() => props.isBordered || groupCtx.isBordered.value)\nconst isDisabled = computed(() => groupCtx.isDisabled.value || props.isDisabled)\nconst isInGroup = computed(() => groupCtx.isInGroup.value)\n\n// Compute initials from name: first letter of up to 2 words\nconst initials = computed(() => {\n if (!props.name) return ''\n const parts = props.name.trim().split(/\\s+/)\n if (parts.length === 1) return parts[0].charAt(0).toUpperCase()\n return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase()\n})\n\nconst slotFns = computed(() =>\n avatarVariants({\n size: finalSize.value,\n color: props.color,\n variant: props.variant,\n })\n)\n\n// Border class applied manually since the styles don't have isBordered variant\nconst borderedClass = computed(() =>\n finalIsBordered.value ? 'ring-2 ring-offset-2 ring-default' : undefined\n)\n\n// InGroup class for negative margin overlap\nconst inGroupClass = computed(() =>\n isInGroup.value ? '-me-2' : undefined\n)\n</script>\n\n<template>\n <AvatarRoot\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.base(), borderedClass, inGroupClass, props.class, props.classNames?.base)\"\n :data-disabled=\"isDisabled || undefined\"\n :data-bordered=\"finalIsBordered || undefined\"\n >\n <AvatarImage\n v-if=\"props.src && !props.showFallback\"\n :src=\"props.src\"\n :alt=\"props.alt ?? props.name ?? ''\"\n :as=\"props.imageAs\"\n :as-child=\"props.imageAsChild\"\n :referrer-policy=\"(props.referrerPolicy as any)\"\n :cross-origin=\"(props.crossOrigin as any)\"\n :class=\"composeClassName(slotFns.image(), props.classNames?.image)\"\n @loading-status-change=\"emit('loading-status-change', $event)\"\n />\n <!--\n delayMs: only pass a value when we have a src — Reka UI treats delayMs=undefined\n as \"show immediately\" (canRender starts true). Passing delayMs=0 is falsy but\n not undefined, so the timeout never fires and fallback stays hidden forever.\n -->\n <AvatarFallback\n :as=\"props.fallbackAs\"\n :as-child=\"props.fallbackAsChild\"\n :delay-ms=\"props.delayMs\"\n :class=\"composeClassName(slotFns.fallback(), props.classNames?.fallback)\"\n v-bind=\"props.src && !props.showFallback && props.delayMs === undefined ? { 'delay-ms': 600 } : {}\"\n >\n <slot name=\"fallback\">\n <span\n v-if=\"initials\"\n :class=\"'avatar__name text-xs font-medium leading-none'\"\n >{{ initials }}</span>\n <svg\n v-else\n class=\"avatar__icon size-4/5\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z\" />\n </svg>\n </slot>\n </AvatarFallback>\n </AvatarRoot>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Avatar.js","names":[],"sources":["../../../src/components/avatar/Avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { AvatarRoot, AvatarImage, AvatarFallback } from 'reka-ui'\nimport { avatarVariants, type AvatarVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useAvatarGroupInject } from './avatar-group.context'\n\nconst props = withDefaults(defineProps<{\n src?: string\n alt?: string\n name?: string\n size?: AvatarVariants['size']\n color?: AvatarVariants['color']\n variant?: AvatarVariants['variant']\n isBordered?: boolean\n isDisabled?: boolean\n showFallback?: boolean\n /** AvatarRoot props */\n as?: string\n asChild?: boolean\n /** AvatarImage props */\n referrerPolicy?: string\n crossOrigin?: string\n imageAs?: string\n imageAsChild?: boolean\n /** AvatarFallback props */\n delayMs?: number\n fallbackAs?: string\n fallbackAsChild?: boolean\n class?: ClassValue\n /** Per-slot class name overrides */\n classNames?: Partial<{\n base: ClassValue\n image: ClassValue\n fallback: ClassValue\n icon: ClassValue\n name: ClassValue\n }>\n}>(), {\n isBordered: false,\n isDisabled: false,\n showFallback: false,\n})\n\nconst emit = defineEmits<{\n 'loading-status-change': [status: string]\n}>()\n\n// Inject AvatarGroup context with ref-based fallbacks (mirrors Button.vue pattern)\nconst groupCtx = useAvatarGroupInject({\n size: ref('md'),\n isBordered: ref(false),\n isDisabled: ref(false),\n isGrid: ref(false),\n isInGroup: ref(false),\n})\n\n// Prop precedence rules (matching ButtonGroup D-13):\n// - group disabled ALWAYS wins over child prop\n// - other props: child prop wins over group value (child ?? group)\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\nconst finalIsBordered = computed(() => props.isBordered || groupCtx.isBordered.value)\nconst isDisabled = computed(() => groupCtx.isDisabled.value || props.isDisabled)\nconst isInGroup = computed(() => groupCtx.isInGroup.value)\n\n// Compute initials from name: first letter of up to 2 words\nconst initials = computed(() => {\n if (!props.name) return ''\n const parts = props.name.trim().split(/\\s+/)\n if (parts.length === 1) return parts[0].charAt(0).toUpperCase()\n return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase()\n})\n\nconst slotFns = computed(() =>\n avatarVariants({\n size: finalSize.value,\n color: props.color,\n variant: props.variant,\n })\n)\n\n// Border class applied manually since the styles don't have isBordered variant\nconst borderedClass = computed(() =>\n finalIsBordered.value ? 'ring-2 ring-offset-2 ring-default' : undefined\n)\n\n// InGroup class for negative margin overlap\nconst inGroupClass = computed(() =>\n isInGroup.value ? '-me-2' : undefined\n)\n</script>\n\n<template>\n <AvatarRoot\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.base(), borderedClass, inGroupClass, props.class, props.classNames?.base)\"\n :data-disabled=\"isDisabled || undefined\"\n :data-bordered=\"finalIsBordered || undefined\"\n >\n <AvatarImage\n v-if=\"props.src && !props.showFallback\"\n :src=\"props.src\"\n :alt=\"props.alt ?? props.name ?? ''\"\n :as=\"props.imageAs\"\n :as-child=\"props.imageAsChild\"\n :referrer-policy=\"(props.referrerPolicy as any)\"\n :cross-origin=\"(props.crossOrigin as any)\"\n :class=\"composeClassName(slotFns.image(), props.classNames?.image)\"\n @loading-status-change=\"emit('loading-status-change', $event)\"\n />\n <!--\n delayMs: only pass a value when we have a src — Reka UI treats delayMs=undefined\n as \"show immediately\" (canRender starts true). Passing delayMs=0 is falsy but\n not undefined, so the timeout never fires and fallback stays hidden forever.\n -->\n <AvatarFallback\n :as=\"props.fallbackAs\"\n :as-child=\"props.fallbackAsChild\"\n :delay-ms=\"props.delayMs\"\n :class=\"composeClassName(slotFns.fallback(), props.classNames?.fallback)\"\n v-bind=\"props.src && !props.showFallback && props.delayMs === undefined ? { 'delay-ms': 600 } : {}\"\n >\n <slot name=\"fallback\">\n <span\n v-if=\"initials\"\n :class=\"composeClassName(slotFns.name(), 'text-xs font-medium leading-none', props.classNames?.name)\"\n >{{ initials }}</span>\n <svg\n v-else\n :class=\"composeClassName(slotFns.icon(), 'size-4/5', props.classNames?.icon)\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z\" />\n </svg>\n </slot>\n </AvatarFallback>\n </AvatarRoot>\n</template>\n"],"mappings":""}