@plexui/vue 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/es/components/Badge/Badge.js +1 -1
  2. package/dist/es/components/Badge/Badge.js.map +1 -1
  3. package/dist/es/components/Button/Button.js +13 -5
  4. package/dist/es/components/Button/Button.js.map +1 -1
  5. package/dist/es/components/Button/ButtonLink.js +7 -1
  6. package/dist/es/components/Button/ButtonLink.js.map +1 -1
  7. package/dist/es/components/Button/NavigationButton.js +27 -0
  8. package/dist/es/components/Button/NavigationButton.js.map +1 -0
  9. package/dist/es/components/Button/NavigationGlyph.js +27 -0
  10. package/dist/es/components/Button/NavigationGlyph.js.map +1 -0
  11. package/dist/es/components/Button/index.js +1 -0
  12. package/dist/es/components/Button/index.js.map +1 -1
  13. package/dist/es/components/Checkbox/Checkbox.js +14 -4
  14. package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
  15. package/dist/es/components/DateInput/DateInput.js +7 -3
  16. package/dist/es/components/DateInput/DateInput.js.map +1 -1
  17. package/dist/es/components/DatePicker/Calendar.js +130 -86
  18. package/dist/es/components/DatePicker/Calendar.js.map +1 -1
  19. package/dist/es/components/DatePicker/CalendarNavigationIcon.js +31 -0
  20. package/dist/es/components/DatePicker/CalendarNavigationIcon.js.map +1 -0
  21. package/dist/es/components/DatePicker/DatePicker.js +16 -4
  22. package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
  23. package/dist/es/components/DatePicker/context.js.map +1 -1
  24. package/dist/es/components/DatePicker/useCalendarGutter.js +14 -0
  25. package/dist/es/components/DatePicker/useCalendarGutter.js.map +1 -0
  26. package/dist/es/components/DateRangePicker/Calendar.js +92 -71
  27. package/dist/es/components/DateRangePicker/Calendar.js.map +1 -1
  28. package/dist/es/components/DateRangePicker/DateRangePicker.js +13 -4
  29. package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
  30. package/dist/es/components/DateRangePicker/Trigger.js +1 -0
  31. package/dist/es/components/DateRangePicker/Trigger.js.map +1 -1
  32. package/dist/es/components/Dialog/Dialog.js +124 -52
  33. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  34. package/dist/es/components/Dialog/index.js.map +1 -1
  35. package/dist/es/components/Dialog/sheetDrag.js +77 -24
  36. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  37. package/dist/es/components/Field/Field.js +58 -5
  38. package/dist/es/components/Field/Field.js.map +1 -1
  39. package/dist/es/components/FieldGroup/FieldGroup.js +3 -1
  40. package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
  41. package/dist/es/components/FileUpload/FileUpload.js +50 -11
  42. package/dist/es/components/FileUpload/FileUpload.js.map +1 -1
  43. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +24 -13
  44. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
  45. package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.js +9 -3
  46. package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.js.map +1 -1
  47. package/dist/es/components/Icon/index.js +1 -0
  48. package/dist/es/components/Icon/index.js.map +1 -1
  49. package/dist/es/components/Icon/svg/Disclosure.js +10 -0
  50. package/dist/es/components/Icon/svg/Disclosure.js.map +1 -0
  51. package/dist/es/components/Indicator/LoadingIndicator.js +2 -2
  52. package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
  53. package/dist/es/components/Input/Input.js +15 -5
  54. package/dist/es/components/Input/Input.js.map +1 -1
  55. package/dist/es/components/InputGroup/InputGroup.js +3 -1
  56. package/dist/es/components/InputGroup/InputGroup.js.map +1 -1
  57. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +126 -151
  58. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  59. package/dist/es/components/Menu/Menu.js +217 -35
  60. package/dist/es/components/Menu/Menu.js.map +1 -1
  61. package/dist/es/components/Menu/internal.js +2 -1
  62. package/dist/es/components/Menu/internal.js.map +1 -1
  63. package/dist/es/components/OTPInput/OTPInput.js +7 -4
  64. package/dist/es/components/OTPInput/OTPInput.js.map +1 -1
  65. package/dist/es/components/Page/Page.js +93 -14
  66. package/dist/es/components/Page/Page.js.map +1 -1
  67. package/dist/es/components/Page/index.js +1 -1
  68. package/dist/es/components/Page/index.js.map +1 -1
  69. package/dist/es/components/Popover/Popover.js +16 -6
  70. package/dist/es/components/Popover/Popover.js.map +1 -1
  71. package/dist/es/components/Popover/deferredPointerDownOutside.js +6 -0
  72. package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
  73. package/dist/es/components/RadioGroup/RadioGroup.js +29 -12
  74. package/dist/es/components/RadioGroup/RadioGroup.js.map +1 -1
  75. package/dist/es/components/Select/Select.js +75 -25
  76. package/dist/es/components/Select/Select.js.map +1 -1
  77. package/dist/es/components/SelectControl/SelectControl.js +58 -25
  78. package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
  79. package/dist/es/components/SelectControl/index.js +1 -1
  80. package/dist/es/components/SelectControl/index.js.map +1 -1
  81. package/dist/es/components/ShimmerText/ShimmerText.js +16 -3
  82. package/dist/es/components/ShimmerText/ShimmerText.js.map +1 -1
  83. package/dist/es/components/Slider/Slider.js +56 -16
  84. package/dist/es/components/Slider/Slider.js.map +1 -1
  85. package/dist/es/components/Sortable/Sortable.js +20 -13
  86. package/dist/es/components/Sortable/Sortable.js.map +1 -1
  87. package/dist/es/components/Switch/Switch.js +6 -3
  88. package/dist/es/components/Switch/Switch.js.map +1 -1
  89. package/dist/es/components/Tabs/Tabs.js +12 -11
  90. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  91. package/dist/es/components/TagInput/TagInput.js +46 -6
  92. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  93. package/dist/es/components/Textarea/Textarea.js +13 -2
  94. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  95. package/dist/es/components/Toast/ToastRenderer.js +144 -0
  96. package/dist/es/components/Toast/ToastRenderer.js.map +1 -0
  97. package/dist/es/components/Toast/Toaster.js +23 -1
  98. package/dist/es/components/Toast/Toaster.js.map +1 -1
  99. package/dist/es/components/Toast/toastLifecycle.js +283 -0
  100. package/dist/es/components/Toast/toastLifecycle.js.map +1 -0
  101. package/dist/es/components/Toolbar/Toolbar.js +107 -0
  102. package/dist/es/components/Toolbar/Toolbar.js.map +1 -0
  103. package/dist/es/components/Toolbar/index.js +2 -0
  104. package/dist/es/components/Toolbar/index.js.map +1 -0
  105. package/dist/es/components/Tooltip/CopyTooltip.js +39 -13
  106. package/dist/es/components/Tooltip/CopyTooltip.js.map +1 -1
  107. package/dist/es/components/Tooltip/Tooltip.js +35 -14
  108. package/dist/es/components/Tooltip/Tooltip.js.map +1 -1
  109. package/dist/es/composables/useFloatingBoundary.js +48 -0
  110. package/dist/es/composables/useFloatingBoundary.js.map +1 -0
  111. package/dist/es/composables/usePhoneSubmenu.js +19 -0
  112. package/dist/es/composables/usePhoneSubmenu.js.map +1 -0
  113. package/dist/es/lib/copyToClipboard.js +16 -7
  114. package/dist/es/lib/copyToClipboard.js.map +1 -1
  115. package/dist/es/lib/floatingBoundary.js +90 -0
  116. package/dist/es/lib/floatingBoundary.js.map +1 -0
  117. package/dist/es/lib/focusRestore.js +56 -0
  118. package/dist/es/lib/focusRestore.js.map +1 -0
  119. package/dist/es/lib/helpers.js +0 -18
  120. package/dist/es/lib/helpers.js.map +1 -1
  121. package/dist/es/lib/inputMode.js +9 -0
  122. package/dist/es/lib/inputMode.js.map +1 -0
  123. package/dist/es/lib/menuInitialFocus.js +100 -0
  124. package/dist/es/lib/menuInitialFocus.js.map +1 -0
  125. package/dist/es/lib/menuSubmenuPlacement.js +219 -0
  126. package/dist/es/lib/menuSubmenuPlacement.js.map +1 -0
  127. package/dist/es/lib/observeTextareaWidth.js +49 -0
  128. package/dist/es/lib/observeTextareaWidth.js.map +1 -0
  129. package/dist/es/lib/selectPress.js +34 -0
  130. package/dist/es/lib/selectPress.js.map +1 -0
  131. package/dist/es/lib/sortable.js +74 -20
  132. package/dist/es/lib/sortable.js.map +1 -1
  133. package/dist/types/components/Button/Button.d.ts +6 -2
  134. package/dist/types/components/Button/ButtonLink.d.ts +6 -2
  135. package/dist/types/components/Button/NavigationButton.d.ts +27 -0
  136. package/dist/types/components/Button/NavigationGlyph.d.ts +16 -0
  137. package/dist/types/components/Button/index.d.ts +1 -0
  138. package/dist/types/components/Checkbox/Checkbox.d.ts +12 -12
  139. package/dist/types/components/DateInput/DateInput.d.ts +4 -4
  140. package/dist/types/components/DatePicker/CalendarNavigationIcon.d.ts +6 -0
  141. package/dist/types/components/DatePicker/DatePicker.d.ts +13 -13
  142. package/dist/types/components/DatePicker/context.d.ts +1 -0
  143. package/dist/types/components/DatePicker/useCalendarGutter.d.ts +2 -0
  144. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +13 -13
  145. package/dist/types/components/Dialog/Dialog.d.ts +46 -11
  146. package/dist/types/components/Dialog/index.d.ts +1 -1
  147. package/dist/types/components/Field/Field.d.ts +2 -2
  148. package/dist/types/components/FileUpload/FileUpload.d.ts +6 -6
  149. package/dist/types/components/FloatingLabelInput/FloatingLabelInput.d.ts +4 -4
  150. package/dist/types/components/Icon/index.d.ts +1 -0
  151. package/dist/types/components/Icon/svg/Disclosure.d.ts +3 -0
  152. package/dist/types/components/Indicator/LoadingIndicator.d.ts +2 -2
  153. package/dist/types/components/Input/Input.d.ts +2 -2
  154. package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +8 -8
  155. package/dist/types/components/Menu/Menu.d.ts +18 -25
  156. package/dist/types/components/OTPInput/OTPInput.d.ts +6 -6
  157. package/dist/types/components/Page/Page.d.ts +48 -7
  158. package/dist/types/components/Page/index.d.ts +1 -1
  159. package/dist/types/components/Popover/Popover.d.ts +17 -6
  160. package/dist/types/components/RadioGroup/RadioGroup.d.ts +10 -10
  161. package/dist/types/components/SelectControl/index.d.ts +1 -1
  162. package/dist/types/components/Sortable/Sortable.d.ts +8 -8
  163. package/dist/types/components/Switch/Switch.d.ts +34 -12
  164. package/dist/types/components/Tabs/Tabs.d.ts +6 -6
  165. package/dist/types/components/TagInput/TagInput.d.ts +4 -4
  166. package/dist/types/components/Textarea/Textarea.d.ts +2 -2
  167. package/dist/types/components/Toast/ToastRenderer.d.ts +79 -0
  168. package/dist/types/components/Toast/Toaster.d.ts +6 -2
  169. package/dist/types/components/Toast/toastLifecycle.d.ts +90 -0
  170. package/dist/types/components/Toolbar/Toolbar.d.ts +149 -0
  171. package/dist/types/components/Toolbar/index.d.ts +1 -0
  172. package/dist/types/components/Tooltip/CopyTooltip.d.ts +2 -2
  173. package/dist/types/components/Tooltip/Tooltip.d.ts +6 -6
  174. package/dist/types/composables/useFloatingBoundary.d.ts +24 -0
  175. package/dist/types/composables/usePhoneSubmenu.d.ts +3 -0
  176. package/dist/types/lib/floatingBoundary.d.ts +9 -0
  177. package/dist/types/lib/focusRestore.d.ts +5 -0
  178. package/dist/types/lib/helpers.d.ts +0 -4
  179. package/dist/types/lib/inputMode.d.ts +7 -0
  180. package/dist/types/lib/menuInitialFocus.d.ts +9 -0
  181. package/dist/types/lib/menuSubmenuPlacement.d.ts +44 -0
  182. package/dist/types/lib/observeTextareaWidth.d.ts +2 -0
  183. package/dist/types/lib/selectPress.d.ts +23 -0
  184. package/dist/types/lib/sortable.d.ts +1 -1
  185. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../../src/components/FieldGroup/FieldGroup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAA2E,MAAM,KAAK,CAAA;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,4DAA4D,CAAA;AAE1E,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,mEA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AU,GAAG,mBAA2F,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport { defineComponent, h, useId, type PropType, type SlotsType, type VNodeArrayChildren, type VNodeChild } from \"vue\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/FieldGroup/FieldGroup.module.css\"\n\n// Vue port of packages/ui/src/components/FieldGroup/FieldGroup.tsx.\n//\n// - `title` and `description` take a string prop or a slot of the same name,\n// like React's ReactNode props. `action` and `footer` are slots here.\n// - Attributes reach the root `section`, as React's rest props do.\n\nconst FieldGroupComponent = defineComponent({\n name: \"FieldGroup\",\n inheritAttrs: false,\n props: {\n /** Heading over the block (or the `title` slot); it names the group */\n title: String,\n /** Line under the title (or the `description` slot) */\n description: String,\n /** Every value starts at one column, `--field-row-column-width` into the row, on the web and on a phone. Off, values end at the row's edge */\n columns: { type: Boolean, default: false },\n /** Class for the block that holds the rows */\n bodyClass: [String, Array, Object] as PropType<ClassValue>,\n },\n slots: Object as SlotsType<{\n /** The rows: `Field row`, or rows of your own. */\n default?: () => VNodeChild\n title?: () => VNodeChild\n description?: () => VNodeChild\n /** Content at the end of the header, such as a button */\n action?: () => VNodeChild\n /** Content under the block, such as a note */\n footer?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const titleId = `field-group-${useId()}`\n\n return () => {\n const title = slots.title ? slots.title() : props.title\n const hasTitle = slots.title ? hasContent(title as VNodeArrayChildren) : !!title\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const action = slots.action?.()\n const hasAction = !!action && hasContent(action as VNodeArrayChildren)\n\n return h(\n \"section\",\n {\n \"role\": \"group\",\n \"aria-labelledby\": hasTitle ? titleId : undefined,\n \"data-field-columns\": props.columns ? \"\" : undefined,\n ...attrs,\n \"class\": clsx(s.FieldGroup, attrs.class as ClassValue),\n },\n [\n hasTitle || hasDescription || hasAction\n ? h(\"div\", { class: s.Header }, [\n h(\"div\", { class: s.HeaderText }, [\n hasTitle ? h(\"h2\", { class: s.Title, id: titleId }, [title as VNodeChild]) : null,\n hasDescription ? h(\"p\", { class: s.Description }, [description as VNodeChild]) : null,\n ]),\n hasAction ? action : null,\n ])\n : null,\n h(\"div\", { class: clsx(s.Body, props.bodyClass) }, [slots.default?.()]),\n slots.footer?.(),\n ],\n )\n }\n },\n})\n\ntype FieldGroupOwnProps = InstanceType<typeof FieldGroupComponent>[\"$props\"]\n\n/** FieldGroup props; attributes reach the root element. */\nexport type FieldGroupProps = FieldGroupOwnProps & { class?: ClassValue }\n\n/** A titled block of rows: `Field row` lines with hairlines between them. */\nexport const FieldGroup = FieldGroupComponent as typeof FieldGroupComponent & { new (): { $props: FieldGroupProps } }\n"]}
1
+ {"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../../src/components/FieldGroup/FieldGroup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAA2E,MAAM,KAAK,CAAA;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,4DAA4D,CAAA;AAE1E,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,mEAAmE;AAEnE,MAAM,mBAAmB,GAAG,eAAe,CAAC;IAC1C,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,uEAAuE;QACvE,KAAK,EAAE,MAAM;QACb,uDAAuD;QACvD,WAAW,EAAE,MAAM;QACnB,8IAA8I;QAC9I,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC1C,8CAA8C;QAC9C,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAyB;KAC3D;IACD,KAAK,EAAE,MASL;IACF,KAAK,CAAC,KAAK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D,EACD;gBACE,QAAQ,IAAI,cAAc,IAAI,SAAS;oBACrC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;wBAC5B,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,EAAE;4BAChC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,KAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;4BACjF,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;yBACtF,CAAC;wBACF,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;qBAC1B,CAAC;oBACJ,CAAC,CAAC,IAAI;gBACR,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACvE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;aACzD,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG,mBAA2F,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport { defineComponent, h, useId, type PropType, type SlotsType, type VNodeArrayChildren, type VNodeChild } from \"vue\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/FieldGroup/FieldGroup.module.css\"\n\n// Vue port of packages/ui/src/components/FieldGroup/FieldGroup.tsx.\n//\n// - `title` and `description` take a string prop or a slot of the same name,\n// like React's ReactNode props. `action` and `footer` are slots here.\n// - Attributes reach the root `section`, as React's rest props do.\n\nconst FieldGroupComponent = defineComponent({\n name: \"FieldGroup\",\n inheritAttrs: false,\n props: {\n /** Heading over the block (or the `title` slot); it names the group */\n title: String,\n /** Line under the title (or the `description` slot) */\n description: String,\n /** Every value starts at one column, `--field-row-column-width` into the row, on the web and on a phone. Off, values end at the row's edge */\n columns: { type: Boolean, default: false },\n /** Class for the block that holds the rows */\n bodyClass: [String, Array, Object] as PropType<ClassValue>,\n },\n slots: Object as SlotsType<{\n /** The rows: `Field row`, or rows of your own. */\n default?: () => VNodeChild\n title?: () => VNodeChild\n description?: () => VNodeChild\n /** Content at the end of the header, such as a button */\n action?: () => VNodeChild\n /** Content under the block, such as a note */\n footer?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const titleId = `field-group-${useId()}`\n\n return () => {\n const title = slots.title ? slots.title() : props.title\n const hasTitle = slots.title ? hasContent(title as VNodeArrayChildren) : !!title\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const footer = slots.footer?.()\n const hasFooter = !!footer && hasContent(footer as VNodeArrayChildren)\n const action = slots.action?.()\n const hasAction = !!action && hasContent(action as VNodeArrayChildren)\n\n return h(\n \"section\",\n {\n \"role\": \"group\",\n \"aria-labelledby\": hasTitle ? titleId : undefined,\n \"data-field-columns\": props.columns ? \"\" : undefined,\n ...attrs,\n \"class\": clsx(s.FieldGroup, attrs.class as ClassValue),\n },\n [\n hasTitle || hasDescription || hasAction\n ? h(\"div\", { class: s.Header }, [\n h(\"div\", { class: s.HeaderText }, [\n hasTitle ? h(\"h2\", { class: s.Title, id: titleId }, [title as VNodeChild]) : null,\n hasDescription ? h(\"p\", { class: s.Description }, [description as VNodeChild]) : null,\n ]),\n hasAction ? action : null,\n ])\n : null,\n h(\"div\", { class: clsx(s.Body, props.bodyClass) }, [slots.default?.()]),\n hasFooter ? h(\"div\", { class: s.Footer }, footer) : null,\n ],\n )\n }\n },\n})\n\ntype FieldGroupOwnProps = InstanceType<typeof FieldGroupComponent>[\"$props\"]\n\n/** FieldGroup props; attributes reach the root element. */\nexport type FieldGroupProps = FieldGroupOwnProps & { class?: ClassValue }\n\n/** A titled block of rows: `Field row` lines with hairlines between them. */\nexport const FieldGroup = FieldGroupComponent as typeof FieldGroupComponent & { new (): { $props: FieldGroupProps } }\n"]}
@@ -1,5 +1,5 @@
1
1
  import clsx from "clsx";
2
- import { defineComponent, h, ref, shallowRef, useId } from "vue";
2
+ import { defineComponent, h, onBeforeUnmount, onMounted, ref, shallowRef, useId, watch } from "vue";
3
3
  import { FileBlank, FileDocument, ImageSquare, UploadDocuments, X } from "../Icon/index.js";
4
4
  import { Button } from "../Button/index.js";
5
5
  import { FieldError } from "../FieldError/index.js";
@@ -131,7 +131,7 @@ export const FileUpload = defineComponent({
131
131
  accept: String,
132
132
  /** Allow selecting multiple files. @default false */
133
133
  multiple: { type: Boolean, default: false },
134
- /** Maximum number of files. The button disables at the limit. */
134
+ /** Maximum number of files. In multiple mode, the button disables at the limit. */
135
135
  maxFiles: Number,
136
136
  /** Maximum file size in bytes */
137
137
  maxSize: Number,
@@ -148,15 +148,50 @@ export const FileUpload = defineComponent({
148
148
  },
149
149
  emits: {
150
150
  /** Files were added or removed (`v-model:value`) */
151
- "update:value": (_files) => true,
151
+ "update:value": (files) => Array.isArray(files),
152
152
  /** A file was rejected (wrong type, too large, over the limit) */
153
- "fileReject": (_file, _reason) => true,
153
+ "fileReject": (file, reason) => typeof file.name === "string" && typeof reason === "string",
154
154
  },
155
155
  setup(props, { attrs, emit }) {
156
156
  const internalFiles = shallowRef([]);
157
157
  const inputRef = ref(null);
158
+ const rootRef = ref(null);
159
+ const listRef = ref(null);
160
+ let pendingRemovalFocus = null;
161
+ let stopTrackingFocus;
158
162
  const generatedId = useId();
159
163
  const getFiles = () => props.value ?? internalFiles.value;
164
+ // Like React, wait for accepted deletion and cancel when the user moves on.
165
+ onMounted(() => {
166
+ const doc = rootRef.value?.ownerDocument;
167
+ if (!doc)
168
+ return;
169
+ const cancelAfterMoving = (event) => {
170
+ if (pendingRemovalFocus && event.target instanceof Node && !pendingRemovalFocus.source.contains(event.target)) {
171
+ pendingRemovalFocus = null;
172
+ }
173
+ };
174
+ doc.addEventListener("focusin", cancelAfterMoving, true);
175
+ doc.addEventListener("pointerdown", cancelAfterMoving, true);
176
+ stopTrackingFocus = () => {
177
+ doc.removeEventListener("focusin", cancelAfterMoving, true);
178
+ doc.removeEventListener("pointerdown", cancelAfterMoving, true);
179
+ };
180
+ });
181
+ onBeforeUnmount(() => stopTrackingFocus?.());
182
+ watch(() => getFiles().slice(), (files) => {
183
+ const pending = pendingRemovalFocus;
184
+ if (!pending || files.includes(pending.file))
185
+ return;
186
+ pendingRemovalFocus = null;
187
+ const doc = pending.source.ownerDocument;
188
+ if (props.disabled || (doc.activeElement !== doc.body && !pending.source.contains(doc.activeElement)))
189
+ return;
190
+ const buttons = Array.from(listRef.value?.querySelectorAll("button:not(:disabled)") ?? []);
191
+ const target = buttons[Math.min(pending.index, buttons.length - 1)]
192
+ ?? rootRef.value?.querySelector("button:not(:disabled):not([aria-disabled=true])");
193
+ target?.focus({ preventScroll: true });
194
+ }, { flush: "post" });
160
195
  const updateFiles = (next) => {
161
196
  emit("update:value", next);
162
197
  if (props.value === undefined) {
@@ -192,6 +227,11 @@ export const FileUpload = defineComponent({
192
227
  target.value = "";
193
228
  };
194
229
  const removeFile = (index) => {
230
+ const file = getFiles()[index];
231
+ const source = listRef.value?.querySelectorAll("button")[index];
232
+ if (file && source?.contains(source.ownerDocument.activeElement)) {
233
+ pendingRemovalFocus = { file, index, source };
234
+ }
195
235
  const next = getFiles().filter((_, i) => i !== index);
196
236
  updateFiles(next);
197
237
  };
@@ -208,8 +248,8 @@ export const FileUpload = defineComponent({
208
248
  const ariaDescribedBy = [attrs["aria-describedby"], errorMessage ? errorId : undefined]
209
249
  .filter(Boolean)
210
250
  .join(" ") || undefined;
211
- const atLimit = !!maxFiles && files.length >= maxFiles;
212
- return h("div", { class: clsx(s.Root, attrs.class) }, [
251
+ const atLimit = props.multiple && !!maxFiles && files.length >= maxFiles;
252
+ return h("div", { "ref": rootRef, "class": clsx(s.Root, attrs.class), "role": "group", "aria-describedby": ariaDescribedBy }, [
213
253
  variant === "area"
214
254
  ? h("button", {
215
255
  "type": "button",
@@ -221,9 +261,8 @@ export const FileUpload = defineComponent({
221
261
  openPicker();
222
262
  },
223
263
  "disabled": disabled || atLimit,
224
- // The visible trigger is what keyboard and screen-reader users reach
264
+ // Announce the error from the action; invalid belongs to the file input.
225
265
  "aria-describedby": ariaDescribedBy,
226
- "aria-invalid": ariaInvalid,
227
266
  }, [
228
267
  h(UploadDocuments, { class: s.AreaIcon }),
229
268
  h("span", { class: s.AreaLabel }, label || "Tap to upload files"),
@@ -237,12 +276,10 @@ export const FileUpload = defineComponent({
237
276
  "block": true,
238
277
  "disabled": disabled || atLimit,
239
278
  "onClick": openPicker,
240
- "class": "h-[3.25rem]",
241
279
  "aria-describedby": ariaDescribedBy,
242
- "aria-invalid": ariaInvalid,
243
280
  }, { default: () => [label || "Upload file"] }),
244
281
  files.length > 0
245
- ? h("ul", { "class": s.FileList, "data-variant": variant, "aria-label": "Attached files" }, files.map((file, index) => h("li", { key: `${file.name}-${file.size}-${file.lastModified}` }, [
282
+ ? h("ul", { "ref": listRef, "class": s.FileList, "data-variant": variant, "aria-label": "Attached files" }, files.map((file, index) => h("li", { key: `${file.name}-${file.size}-${file.lastModified}` }, [
246
283
  h(FileCard, { file, onRemove: () => removeFile(index), disabled }),
247
284
  ])))
248
285
  : null,
@@ -255,6 +292,8 @@ export const FileUpload = defineComponent({
255
292
  "onChange": handleFileSelect,
256
293
  "disabled": disabled,
257
294
  "id": inputId,
295
+ "aria-label": label || (variant === "area" ? "Tap to upload files" : "Upload file"),
296
+ "aria-invalid": ariaInvalid,
258
297
  "aria-describedby": ariaDescribedBy,
259
298
  "tabindex": -1,
260
299
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.js","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAiB,MAAM,KAAK,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAA;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,CAAC,MAAM,4DAA4D,CAAA;AAE1E,yEAAyE;AACzE,wEAAwE;AACxE,yEAAyE;AACzE,qCAAqC;AAErC,SAAS,WAAW,CAAC,IAAU;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAA;IAEpC,IACE,IAAI,KAAK,iBAAiB;QAC1B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EACrB,CAAC;QACD,OAAO,CAAC,CAAC,YAAY,CAAC,CAAA;IACxB,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,qCAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CA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H,CAAC,CAAC,IAAI;gBAER,CAAC,CAAC,OAAO,EAAE;oBACT,KAAK,EAAE,QAAQ;oBACf,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,CAAC,WAAW;oBACtB,QAAQ,EAAE,KAAK,CAAC,MAAM;oBACtB,UAAU,EAAE,KAAK,CAAC,QAAQ;oBAC1B,UAAU,EAAE,gBAAgB;oBAC5B,UAAU,EAAE,QAAQ;oBACpB,IAAI,EAAE,OAAO;oBACb,kBAAkB,EAAE,eAAe;oBACnC,UAAU,EAAE,CAAC,CAAC;iBACf,CAAC;gBAEF,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;aAC/G,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport { defineComponent, h, ref, shallowRef, useId, type PropType } from \"vue\"\nimport { FileBlank, FileDocument, ImageSquare, UploadDocuments, X } from \"../Icon/index.js\"\nimport { Button } from \"../Button/index.js\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport s from \"@plexui/styles/components/FileUpload/FileUpload.module.css\"\n\n// Vue port of packages/ui/src/components/FileUpload/FileUpload.tsx. Like\n// React, the components spread no attributes: FileUpload reads `class`,\n// `aria-describedby` and `aria-invalid`, FileCard and FileCardGroup read\n// `class`; anything else is dropped.\n\nfunction getFileIcon(file: File) {\n const type = file.type\n const name = file.name.toLowerCase()\n\n if (\n type === \"application/pdf\" ||\n name.endsWith(\".pdf\") ||\n name.endsWith(\".doc\") ||\n name.endsWith(\".docx\") ||\n name.endsWith(\".txt\") ||\n name.endsWith(\".rtf\")\n ) {\n return h(FileDocument)\n }\n\n if (type.startsWith(\"image/\") || /\\.(png|jpe?g|gif|svg|webp|bmp|ico)$/.test(name)) {\n return h(ImageSquare)\n }\n\n return h(FileBlank)\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes === 0) return \"0 B\"\n if (bytes < 1024) return `${bytes} B`\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n}\n\nfunction splitFileName(name: string): { stem: string; ext: string } {\n const lastDot = name.lastIndexOf(\".\")\n if (lastDot <= 0) return { stem: name, ext: \"\" }\n return {\n stem: name.slice(0, lastDot),\n ext: name.slice(lastDot),\n }\n}\n\n/** Bordered container for standalone `FileCard`s. */\nexport const FileCardGroup = defineComponent({\n name: \"FileCardGroup\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n return () => h(\"div\", { class: clsx(s.FileCardGroup, attrs.class as string | undefined) }, slots.default?.())\n },\n})\n\nexport type FileCardGroupProps = InstanceType<typeof FileCardGroup>[\"$props\"]\n\n/**\n * One attached file: type icon, name, size and an optional remove button.\n * `onRemove` (`@remove`) is a function prop because, as in React, the remove\n * button renders only when it is set.\n */\nexport const FileCard = defineComponent({\n name: \"FileCard\",\n inheritAttrs: false,\n props: {\n /** The file to display */\n file: { type: Object as PropType<File>, required: true },\n /** Remove callback. When omitted, the delete button is hidden. */\n onRemove: Function as PropType<() => void>,\n /** Disable the remove button */\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { attrs }) {\n return () => {\n const { file, onRemove } = props\n const { stem, ext } = splitFileName(file.name)\n\n return h(\"div\", { class: clsx(s.FileItem, attrs.class as string | undefined) }, [\n h(\"div\", { class: s.FileIcon }, [getFileIcon(file)]),\n h(\"div\", { class: s.FileInfo }, [\n h(\"div\", { class: s.FileNameRow }, [\n h(\"span\", { class: s.FileNameStem }, stem),\n ext ? h(\"span\", { class: s.FileNameExt }, ext) : null,\n ]),\n h(\"span\", { class: s.FileSize }, formatFileSize(file.size)),\n ]),\n onRemove\n ? h(\n \"button\",\n {\n \"type\": \"button\",\n \"class\": s.FileRemove,\n // React passes the click event through (onClick={onRemove}) and\n // never runs a mouse handler of a disabled button\n \"onClick\": (event: MouseEvent) => {\n if (props.disabled) return\n ;(onRemove as (event: MouseEvent) => void)(event)\n },\n \"aria-label\": `Remove ${file.name}`,\n \"disabled\": props.disabled,\n },\n [h(X)],\n )\n : null,\n ])\n }\n },\n})\n\nexport type FileCardProps = InstanceType<typeof FileCard>[\"$props\"]\n\nfunction matchesAccept(file: File, accept: string): boolean {\n const acceptTypes = accept.split(\",\").map((t) => t.trim().toLowerCase())\n const fileName = file.name.toLowerCase()\n const fileType = file.type.toLowerCase()\n\n return acceptTypes.some((acceptType) => {\n if (acceptType.startsWith(\".\")) {\n return fileName.endsWith(acceptType)\n }\n if (acceptType.endsWith(\"/*\")) {\n const prefix = acceptType.slice(0, -1)\n return fileType.startsWith(prefix)\n }\n return fileType === acceptType\n })\n}\n\n/**\n * File picker with a file list. `value` + `update:value` (React's `value` +\n * `onValueChange`) support `v-model:value`. Uncontrolled when `value` is not set.\n */\nexport const FileUpload = defineComponent({\n name: \"FileUpload\",\n inheritAttrs: false,\n props: {\n /** Visual variant: compact button or larger tappable area. @default \"compact\" */\n variant: { type: String as PropType<\"compact\" | \"area\">, default: \"compact\" },\n /** Button label text */\n label: String,\n /** Helper text below the icon (area variant only) */\n description: String,\n /** Accepted file types (e.g. \".pdf,.png,image/*\") */\n accept: String,\n /** Allow selecting multiple files. @default false */\n multiple: { type: Boolean, default: false },\n /** Maximum number of files. The button disables at the limit. */\n maxFiles: Number,\n /** Maximum file size in bytes */\n maxSize: Number,\n /** Controlled file list. Bind with `v-model:value`. */\n value: { type: Array as PropType<File[]>, default: undefined },\n /** Error message; sets the invalid visual state */\n errorMessage: String,\n /** Invalid state. @default false (true when errorMessage is set) */\n invalid: { type: Boolean, default: undefined },\n /** Disable all interactions. @default false */\n disabled: { type: Boolean, default: false },\n /** Id of the hidden file input */\n id: String,\n },\n emits: {\n /** Files were added or removed (`v-model:value`) */\n \"update:value\": (_files: File[]) => true,\n /** A file was rejected (wrong type, too large, over the limit) */\n \"fileReject\": (_file: File, _reason: string) => true,\n },\n setup(props, { attrs, emit }) {\n const internalFiles = shallowRef<File[]>([])\n const inputRef = ref<HTMLInputElement | null>(null)\n const generatedId = useId()\n\n const getFiles = () => props.value ?? internalFiles.value\n\n const updateFiles = (next: File[]) => {\n emit(\"update:value\", next)\n if (props.value === undefined) {\n internalFiles.value = next\n }\n }\n\n const handleFileSelect = (e: Event) => {\n const target = e.target as HTMLInputElement\n const files = getFiles()\n const { accept, maxSize, maxFiles } = props\n const selected = Array.from(target.files || [])\n // Without `multiple`, a pick replaces the file instead of adding to it\n const kept = props.multiple ? files : []\n const accepted: File[] = []\n\n for (const file of selected) {\n if (accept && !matchesAccept(file, accept)) {\n emit(\"fileReject\", file, `File type not accepted: ${file.name}`)\n continue\n }\n if (maxSize && file.size > maxSize) {\n emit(\"fileReject\", file, `File too large: ${file.name} (${formatFileSize(file.size)})`)\n continue\n }\n if (maxFiles && kept.length + accepted.length >= maxFiles) {\n emit(\"fileReject\", file, `Maximum ${maxFiles} files allowed`)\n continue\n }\n accepted.push(file)\n }\n\n if (accepted.length > 0) {\n updateFiles([...kept, ...accepted])\n }\n\n target.value = \"\"\n }\n\n const removeFile = (index: number) => {\n const next = getFiles().filter((_, i) => i !== index)\n updateFiles(next)\n }\n\n const openPicker = () => {\n inputRef.value?.click()\n }\n\n\n return () => {\n const { variant, label, description, maxFiles, errorMessage, disabled } = props\n const files = getFiles()\n const inputId = props.id || `file-upload-${generatedId}`\n const errorId = `${inputId}-error`\n const invalid = props.invalid ?? !!errorMessage\n const ariaInvalid = (attrs[\"aria-invalid\"] as boolean | \"true\" | \"false\" | undefined) ?? (invalid || undefined)\n const ariaDescribedBy =\n [attrs[\"aria-describedby\"] as string | undefined, errorMessage ? errorId : undefined]\n .filter(Boolean)\n .join(\" \") || undefined\n const atLimit = !!maxFiles && files.length >= maxFiles\n\n return h(\"div\", { class: clsx(s.Root, attrs.class as string | undefined) }, [\n variant === \"area\"\n ? h(\n \"button\",\n {\n \"type\": \"button\",\n \"class\": s.AreaTrigger,\n \"data-invalid\": invalid ? \"\" : undefined,\n // Like React, no click handling while the button is disabled\n \"onClick\": () => {\n if (!(disabled || atLimit)) openPicker()\n },\n \"disabled\": disabled || atLimit,\n // The visible trigger is what keyboard and screen-reader users reach\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n },\n [\n h(UploadDocuments, { class: s.AreaIcon }),\n h(\"span\", { class: s.AreaLabel }, label || \"Tap to upload files\"),\n description ? h(\"span\", { class: s.AreaDescription }, description) : null,\n ],\n )\n : h(\n Button,\n {\n \"color\": \"secondary\",\n \"variant\": \"soft\",\n \"size\": \"3xl\",\n \"pill\": true,\n \"block\": true,\n \"disabled\": disabled || atLimit,\n \"onClick\": openPicker,\n \"class\": \"h-[3.25rem]\",\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n },\n { default: () => [label || \"Upload file\"] },\n ),\n\n files.length > 0\n ? h(\n \"ul\",\n { \"class\": s.FileList, \"data-variant\": variant, \"aria-label\": \"Attached files\" },\n files.map((file, index) =>\n h(\"li\", { key: `${file.name}-${file.size}-${file.lastModified}` }, [\n h(FileCard, { file, onRemove: () => removeFile(index), disabled }),\n ]),\n ),\n )\n : null,\n\n h(\"input\", {\n \"ref\": inputRef,\n \"type\": \"file\",\n \"class\": s.HiddenInput,\n \"accept\": props.accept,\n \"multiple\": props.multiple,\n \"onChange\": handleFileSelect,\n \"disabled\": disabled,\n \"id\": inputId,\n \"aria-describedby\": ariaDescribedBy,\n \"tabindex\": -1,\n }),\n\n errorMessage ? h(FieldError, { id: errorId, class: s.ErrorMessage }, { default: () => [errorMessage] }) : null,\n ])\n }\n },\n})\n\nexport type FileUploadProps = InstanceType<typeof FileUpload>[\"$props\"]\n"]}
1
+ {"version":3,"file":"FileUpload.js","sourceRoot":"","sources":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,EAAE,KAAK,CAAC,MAAM;oBACtB,UAAU,EAAE,KAAK,CAAC,QAAQ;oBAC1B,UAAU,EAAE,gBAAgB;oBAC5B,UAAU,EAAE,QAAQ;oBACpB,IAAI,EAAE,OAAO;oBACb,YAAY,EAAE,KAAK,IAAI,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,CAAC;oBACnF,cAAc,EAAE,WAAW;oBAC3B,kBAAkB,EAAE,eAAe;oBACnC,UAAU,EAAE,CAAC,CAAC;iBACf,CAAC;gBAEF,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;aAC/G,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref, shallowRef, useId, watch, type PropType } from \"vue\"\nimport { FileBlank, FileDocument, ImageSquare, UploadDocuments, X } from \"../Icon/index.js\"\nimport { Button } from \"../Button/index.js\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport s from \"@plexui/styles/components/FileUpload/FileUpload.module.css\"\n\n// Vue port of packages/ui/src/components/FileUpload/FileUpload.tsx. Like\n// React, the components spread no attributes: FileUpload reads `class`,\n// `aria-describedby` and `aria-invalid`, FileCard and FileCardGroup read\n// `class`; anything else is dropped.\n\nfunction getFileIcon(file: File) {\n const type = file.type\n const name = file.name.toLowerCase()\n\n if (\n type === \"application/pdf\" ||\n name.endsWith(\".pdf\") ||\n name.endsWith(\".doc\") ||\n name.endsWith(\".docx\") ||\n name.endsWith(\".txt\") ||\n name.endsWith(\".rtf\")\n ) {\n return h(FileDocument)\n }\n\n if (type.startsWith(\"image/\") || /\\.(png|jpe?g|gif|svg|webp|bmp|ico)$/.test(name)) {\n return h(ImageSquare)\n }\n\n return h(FileBlank)\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes === 0) return \"0 B\"\n if (bytes < 1024) return `${bytes} B`\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n}\n\nfunction splitFileName(name: string): { stem: string; ext: string } {\n const lastDot = name.lastIndexOf(\".\")\n if (lastDot <= 0) return { stem: name, ext: \"\" }\n return {\n stem: name.slice(0, lastDot),\n ext: name.slice(lastDot),\n }\n}\n\n/** Bordered container for standalone `FileCard`s. */\nexport const FileCardGroup = defineComponent({\n name: \"FileCardGroup\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n return () => h(\"div\", { class: clsx(s.FileCardGroup, attrs.class as string | undefined) }, slots.default?.())\n },\n})\n\nexport type FileCardGroupProps = InstanceType<typeof FileCardGroup>[\"$props\"]\n\n/**\n * One attached file: type icon, name, size and an optional remove button.\n * `onRemove` (`@remove`) is a function prop because, as in React, the remove\n * button renders only when it is set.\n */\nexport const FileCard = defineComponent({\n name: \"FileCard\",\n inheritAttrs: false,\n props: {\n /** The file to display */\n file: { type: Object as PropType<File>, required: true },\n /** Remove callback. When omitted, the delete button is hidden. */\n onRemove: Function as PropType<() => void>,\n /** Disable the remove button */\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { attrs }) {\n return () => {\n const { file, onRemove } = props\n const { stem, ext } = splitFileName(file.name)\n\n return h(\"div\", { class: clsx(s.FileItem, attrs.class as string | undefined) }, [\n h(\"div\", { class: s.FileIcon }, [getFileIcon(file)]),\n h(\"div\", { class: s.FileInfo }, [\n h(\"div\", { class: s.FileNameRow }, [\n h(\"span\", { class: s.FileNameStem }, stem),\n ext ? h(\"span\", { class: s.FileNameExt }, ext) : null,\n ]),\n h(\"span\", { class: s.FileSize }, formatFileSize(file.size)),\n ]),\n onRemove\n ? h(\n \"button\",\n {\n \"type\": \"button\",\n \"class\": s.FileRemove,\n // React passes the click event through (onClick={onRemove}) and\n // never runs a mouse handler of a disabled button\n \"onClick\": (event: MouseEvent) => {\n if (props.disabled) return\n ;(onRemove as (event: MouseEvent) => void)(event)\n },\n \"aria-label\": `Remove ${file.name}`,\n \"disabled\": props.disabled,\n },\n [h(X)],\n )\n : null,\n ])\n }\n },\n})\n\nexport type FileCardProps = InstanceType<typeof FileCard>[\"$props\"]\n\nfunction matchesAccept(file: File, accept: string): boolean {\n const acceptTypes = accept.split(\",\").map((t) => t.trim().toLowerCase())\n const fileName = file.name.toLowerCase()\n const fileType = file.type.toLowerCase()\n\n return acceptTypes.some((acceptType) => {\n if (acceptType.startsWith(\".\")) {\n return fileName.endsWith(acceptType)\n }\n if (acceptType.endsWith(\"/*\")) {\n const prefix = acceptType.slice(0, -1)\n return fileType.startsWith(prefix)\n }\n return fileType === acceptType\n })\n}\n\n/**\n * File picker with a file list. `value` + `update:value` (React's `value` +\n * `onValueChange`) support `v-model:value`. Uncontrolled when `value` is not set.\n */\nexport const FileUpload = defineComponent({\n name: \"FileUpload\",\n inheritAttrs: false,\n props: {\n /** Visual variant: compact button or larger tappable area. @default \"compact\" */\n variant: { type: String as PropType<\"compact\" | \"area\">, default: \"compact\" },\n /** Button label text */\n label: String,\n /** Helper text below the icon (area variant only) */\n description: String,\n /** Accepted file types (e.g. \".pdf,.png,image/*\") */\n accept: String,\n /** Allow selecting multiple files. @default false */\n multiple: { type: Boolean, default: false },\n /** Maximum number of files. In multiple mode, the button disables at the limit. */\n maxFiles: Number,\n /** Maximum file size in bytes */\n maxSize: Number,\n /** Controlled file list. Bind with `v-model:value`. */\n value: { type: Array as PropType<File[]>, default: undefined },\n /** Error message; sets the invalid visual state */\n errorMessage: String,\n /** Invalid state. @default false (true when errorMessage is set) */\n invalid: { type: Boolean, default: undefined },\n /** Disable all interactions. @default false */\n disabled: { type: Boolean, default: false },\n /** Id of the hidden file input */\n id: String,\n },\n emits: {\n /** Files were added or removed (`v-model:value`) */\n \"update:value\": (files: File[]) => Array.isArray(files),\n /** A file was rejected (wrong type, too large, over the limit) */\n \"fileReject\": (file: File, reason: string) => typeof file.name === \"string\" && typeof reason === \"string\",\n },\n setup(props, { attrs, emit }) {\n const internalFiles = shallowRef<File[]>([])\n const inputRef = ref<HTMLInputElement | null>(null)\n const rootRef = ref<HTMLDivElement | null>(null)\n const listRef = ref<HTMLUListElement | null>(null)\n let pendingRemovalFocus: { file: File; index: number; source: HTMLButtonElement } | null = null\n let stopTrackingFocus: (() => void) | undefined\n const generatedId = useId()\n\n const getFiles = () => props.value ?? internalFiles.value\n\n // Like React, wait for accepted deletion and cancel when the user moves on.\n onMounted(() => {\n const doc = rootRef.value?.ownerDocument\n if (!doc) return\n const cancelAfterMoving = (event: Event) => {\n if (pendingRemovalFocus && event.target instanceof Node && !pendingRemovalFocus.source.contains(event.target)) {\n pendingRemovalFocus = null\n }\n }\n doc.addEventListener(\"focusin\", cancelAfterMoving, true)\n doc.addEventListener(\"pointerdown\", cancelAfterMoving, true)\n stopTrackingFocus = () => {\n doc.removeEventListener(\"focusin\", cancelAfterMoving, true)\n doc.removeEventListener(\"pointerdown\", cancelAfterMoving, true)\n }\n })\n onBeforeUnmount(() => stopTrackingFocus?.())\n\n watch(() => getFiles().slice(), (files) => {\n const pending = pendingRemovalFocus\n if (!pending || files.includes(pending.file)) return\n pendingRemovalFocus = null\n const doc = pending.source.ownerDocument\n if (props.disabled || (doc.activeElement !== doc.body && !pending.source.contains(doc.activeElement))) return\n const buttons = Array.from(listRef.value?.querySelectorAll<HTMLButtonElement>(\"button:not(:disabled)\") ?? [])\n const target = buttons[Math.min(pending.index, buttons.length - 1)]\n ?? rootRef.value?.querySelector<HTMLButtonElement>(\"button:not(:disabled):not([aria-disabled=true])\")\n target?.focus({ preventScroll: true })\n }, { flush: \"post\" })\n\n const updateFiles = (next: File[]) => {\n emit(\"update:value\", next)\n if (props.value === undefined) {\n internalFiles.value = next\n }\n }\n\n const handleFileSelect = (e: Event) => {\n const target = e.target as HTMLInputElement\n const files = getFiles()\n const { accept, maxSize, maxFiles } = props\n const selected = Array.from(target.files || [])\n // Without `multiple`, a pick replaces the file instead of adding to it\n const kept = props.multiple ? files : []\n const accepted: File[] = []\n\n for (const file of selected) {\n if (accept && !matchesAccept(file, accept)) {\n emit(\"fileReject\", file, `File type not accepted: ${file.name}`)\n continue\n }\n if (maxSize && file.size > maxSize) {\n emit(\"fileReject\", file, `File too large: ${file.name} (${formatFileSize(file.size)})`)\n continue\n }\n if (maxFiles && kept.length + accepted.length >= maxFiles) {\n emit(\"fileReject\", file, `Maximum ${maxFiles} files allowed`)\n continue\n }\n accepted.push(file)\n }\n\n if (accepted.length > 0) {\n updateFiles([...kept, ...accepted])\n }\n\n target.value = \"\"\n }\n\n const removeFile = (index: number) => {\n const file = getFiles()[index]\n const source = listRef.value?.querySelectorAll<HTMLButtonElement>(\"button\")[index]\n if (file && source?.contains(source.ownerDocument.activeElement)) {\n pendingRemovalFocus = { file, index, source }\n }\n const next = getFiles().filter((_, i) => i !== index)\n updateFiles(next)\n }\n\n const openPicker = () => {\n inputRef.value?.click()\n }\n\n\n return () => {\n const { variant, label, description, maxFiles, errorMessage, disabled } = props\n const files = getFiles()\n const inputId = props.id || `file-upload-${generatedId}`\n const errorId = `${inputId}-error`\n const invalid = props.invalid ?? !!errorMessage\n const ariaInvalid = (attrs[\"aria-invalid\"] as boolean | \"true\" | \"false\" | undefined) ?? (invalid || undefined)\n const ariaDescribedBy =\n [attrs[\"aria-describedby\"] as string | undefined, errorMessage ? errorId : undefined]\n .filter(Boolean)\n .join(\" \") || undefined\n const atLimit = props.multiple && !!maxFiles && files.length >= maxFiles\n\n return h(\"div\", { \"ref\": rootRef, \"class\": clsx(s.Root, attrs.class as string | undefined), \"role\": \"group\", \"aria-describedby\": ariaDescribedBy }, [\n variant === \"area\"\n ? h(\n \"button\",\n {\n \"type\": \"button\",\n \"class\": s.AreaTrigger,\n \"data-invalid\": invalid ? \"\" : undefined,\n // Like React, no click handling while the button is disabled\n \"onClick\": () => {\n if (!(disabled || atLimit)) openPicker()\n },\n \"disabled\": disabled || atLimit,\n // Announce the error from the action; invalid belongs to the file input.\n \"aria-describedby\": ariaDescribedBy,\n },\n [\n h(UploadDocuments, { class: s.AreaIcon }),\n h(\"span\", { class: s.AreaLabel }, label || \"Tap to upload files\"),\n description ? h(\"span\", { class: s.AreaDescription }, description) : null,\n ],\n )\n : h(\n Button,\n {\n \"color\": \"secondary\",\n \"variant\": \"soft\",\n \"size\": \"3xl\",\n \"pill\": true,\n \"block\": true,\n \"disabled\": disabled || atLimit,\n \"onClick\": openPicker,\n \"aria-describedby\": ariaDescribedBy,\n },\n { default: () => [label || \"Upload file\"] },\n ),\n\n files.length > 0\n ? h(\n \"ul\",\n { \"ref\": listRef, \"class\": s.FileList, \"data-variant\": variant, \"aria-label\": \"Attached files\" },\n files.map((file, index) =>\n h(\"li\", { key: `${file.name}-${file.size}-${file.lastModified}` }, [\n h(FileCard, { file, onRemove: () => removeFile(index), disabled }),\n ]),\n ),\n )\n : null,\n\n h(\"input\", {\n \"ref\": inputRef,\n \"type\": \"file\",\n \"class\": s.HiddenInput,\n \"accept\": props.accept,\n \"multiple\": props.multiple,\n \"onChange\": handleFileSelect,\n \"disabled\": disabled,\n \"id\": inputId,\n \"aria-label\": label || (variant === \"area\" ? \"Tap to upload files\" : \"Upload file\"),\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"tabindex\": -1,\n }),\n\n errorMessage ? h(FieldError, { id: errorId, class: s.ErrorMessage }, { default: () => [errorMessage] }) : null,\n ])\n }\n },\n})\n\nexport type FileUploadProps = InstanceType<typeof FileUpload>[\"$props\"]\n"]}
@@ -1,8 +1,10 @@
1
1
  import clsx from "clsx";
2
- import { defineComponent, h, mergeProps, nextTick, onMounted, ref, useId, watch, withDirectives } from "vue";
2
+ import { computed, defineComponent, h, mergeProps, nextTick, onBeforeUnmount, onMounted, ref, useId, watch, withDirectives } from "vue";
3
3
  import { Eye, EyeOff, X } from "../Icon/index.js";
4
+ import { FieldError } from "../FieldError/index.js";
4
5
  import { vDefaultValue, vServerText } from "../../lib/defaultValue.js";
5
6
  import { hasContent } from "../../lib/slotContent.js";
7
+ import { observeTextareaWidth } from "../../lib/observeTextareaWidth.js";
6
8
  import s from "@plexui/styles/components/FloatingLabelInput/FloatingLabelInput.module.css";
7
9
  // A fallthrough listener is a function or, when merged, an array of them
8
10
  const callListeners = (listener, evt) => {
@@ -65,21 +67,19 @@ const FloatingLabelInputComponent = defineComponent({
65
67
  defaultValue: { type: [String, Number], default: undefined },
66
68
  },
67
69
  emits: {
68
- "update:value": (_value) => true,
70
+ "update:value": (value) => typeof value === "string",
69
71
  "autofill": () => true,
70
- "revealedChange": (_revealed) => true,
72
+ "revealedChange": (revealed) => typeof revealed === "boolean",
71
73
  },
72
74
  setup(props, { attrs, slots, emit, expose }) {
73
75
  const inputRef = ref(null);
74
76
  const generatedId = useId();
75
77
  const focused = ref(false);
76
- const hasValue = ref(!!(props.value !== undefined ? props.value : props.defaultValue));
78
+ const hasUncontrolledValue = ref(String((props.value !== undefined ? props.value : props.defaultValue) ?? "") !== "");
77
79
  const revealed = ref(false);
78
- // Sync hasValue with controlled value prop
79
- watch(() => props.value, (value) => {
80
- if (value !== undefined)
81
- hasValue.value = !!value;
82
- });
80
+ const hasValue = computed(() => props.value !== undefined
81
+ ? String(props.value ?? "") !== ""
82
+ : hasUncontrolledValue.value);
83
83
  const autoResize = () => {
84
84
  const el = inputRef.value;
85
85
  if (!props.multiline || !el)
@@ -87,6 +87,15 @@ const FloatingLabelInputComponent = defineComponent({
87
87
  el.style.height = "auto";
88
88
  el.style.height = `${el.scrollHeight}px`;
89
89
  };
90
+ let stopObservingWidth;
91
+ const observeWidth = () => {
92
+ stopObservingWidth?.();
93
+ stopObservingWidth = props.multiline && inputRef.value
94
+ ? observeTextareaWidth(inputRef.value, autoResize)
95
+ : undefined;
96
+ };
97
+ watch(() => props.multiline, observeWidth, { flush: "post" });
98
+ onBeforeUnmount(() => stopObservingWidth?.());
90
99
  // The multiline <textarea> gets its value imperatively, like React DOM: a
91
100
  // `value` prop would make Vue mirror it into a `value` attribute, which
92
101
  // React never renders (its text content carries the value instead)
@@ -104,6 +113,7 @@ const FloatingLabelInputComponent = defineComponent({
104
113
  if (props.multiline && el && el.textContent)
105
114
  el.value = el.textContent;
106
115
  autoResize();
116
+ observeWidth();
107
117
  });
108
118
  // Also resize when a controlled value or rows changes without a keystroke
109
119
  watch([() => props.multiline, () => props.value, () => props.rows], () => {
@@ -139,7 +149,7 @@ const FloatingLabelInputComponent = defineComponent({
139
149
  };
140
150
  const handleInput = (evt) => {
141
151
  const target = evt.currentTarget;
142
- hasValue.value = !!target.value;
152
+ hasUncontrolledValue.value = !!target.value;
143
153
  emit("update:value", target.value);
144
154
  autoResize();
145
155
  // Like a React controlled input, a `value` the parent does not update
@@ -155,7 +165,7 @@ const FloatingLabelInputComponent = defineComponent({
155
165
  const handleAnimationStart = (evt) => {
156
166
  // Detect browser autofill
157
167
  if (evt.animationName === "native-autofill-in") {
158
- hasValue.value = true;
168
+ hasUncontrolledValue.value = true;
159
169
  emit("autofill");
160
170
  }
161
171
  };
@@ -215,7 +225,8 @@ const FloatingLabelInputComponent = defineComponent({
215
225
  const initialValue = props.value === undefined ? props.defaultValue : undefined;
216
226
  // The textarea's text content follows the controlled value, else
217
227
  // `default-value`, as React keeps a textarea's defaultValue
218
- const { value: _value, ...textareaControlProps } = controlProps;
228
+ const textareaControlProps = { ...controlProps };
229
+ delete textareaControlProps.value;
219
230
  const textContent = String(props.value ?? props.defaultValue ?? "");
220
231
  const inside = props.labelPlacement === "inside";
221
232
  return h("div", {
@@ -260,7 +271,7 @@ const FloatingLabelInputComponent = defineComponent({
260
271
  ? h("button", { "type": "button", "aria-label": revealed.value ? "Hide" : "Show", "class": s.RevealButton, "onClick": handleRevealToggle }, [revealed.value ? h(EyeOff) : h(Eye)])
261
272
  : null,
262
273
  ]),
263
- props.errorMessage ? h("div", { id: errorId, class: s.ErrorMessage, role: "alert" }, props.errorMessage) : null,
274
+ props.errorMessage ? h(FieldError, { id: errorId, class: s.ErrorMessage }, { default: () => props.errorMessage }) : null,
264
275
  description ? h("div", { id: descriptionId, class: s.Description }, description) : null,
265
276
  ]);
266
277
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingLabelInput.js","sourceRoot":"","sources":["../../../../src/components/FloatingLabelInput/FloatingLabelInput.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAA4D,MAAM,KAAK,CAAA;AACtK,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,4EAA4E,CAAA;AAE1F,yEAAyE;AACzE,MAAM,aAAa,GAAG,CAAC,QAAiB,EAAE,GAAU,EAAE,EAAE;IACtD,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjE,IAAI,OAAO,EAAE,KAAK,UAAU;YAAE,EAAE,CAAC,GAAG,CAAC,CAAA;IACvC,CAAC;AACH,CAAC,CAAA;AAED,6EAA6E;AAC7E,4EAA4E;AAC5E,mDAAmD;AACnD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAA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,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC/G,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;aACxF,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAQF,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAEjC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport { defineComponent, h, mergeProps, nextTick, onMounted, ref, useId, watch, withDirectives, type InputHTMLAttributes, type PropType, type VNodeChild } from \"vue\"\nimport { Eye, EyeOff, X } from \"../Icon/index.js\"\nimport { vDefaultValue, vServerText } from \"../../lib/defaultValue.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/FloatingLabelInput/FloatingLabelInput.module.css\"\n\n// A fallthrough listener is a function or, when merged, an array of them\nconst callListeners = (listener: unknown, evt: Event) => {\n for (const fn of Array.isArray(listener) ? listener : [listener]) {\n if (typeof fn === \"function\") fn(evt)\n }\n}\n\n// Attributes that only mean something on <input>; everything else (required,\n// maxlength, placeholder, key and clipboard listeners, aria-*, data-*) also\n// applies to the multiline <textarea>, as in React\nconst INPUT_ONLY_ATTRS = new Set([\n \"accept\", \"alt\", \"capture\", \"checked\", \"height\", \"list\", \"max\", \"min\", \"multiple\",\n \"pattern\", \"size\", \"src\", \"step\", \"width\", \"formaction\", \"formenctype\",\n \"formmethod\", \"formnovalidate\", \"formtarget\",\n])\n\nconst textareaAttrs = (attrs: Record<string, unknown>) =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !INPUT_ONLY_ATTRS.has(key.toLowerCase())))\n\n/**\n * Port of packages/ui/src/components/FloatingLabelInput/FloatingLabelInput.tsx.\n * Attributes other than `class` go to the <input>, or to the `multiline`\n * <textarea> except the input-only ones, as in React. `value` +\n * `update:value` support `v-model:value`.\n */\nconst FloatingLabelInputComponent = defineComponent({\n name: \"FloatingLabelInput\",\n inheritAttrs: false,\n props: {\n /** Label text for the floating label */\n label: { type: String, required: true },\n /** Error message to display below the input */\n errorMessage: String,\n /** Mark the input as invalid. @default false (or true if errorMessage is provided) */\n invalid: { type: Boolean, default: undefined },\n /** Disables the input visually and from interactions */\n disabled: { type: Boolean, default: false },\n /** Makes the input read-only */\n readOnly: { type: Boolean, default: false },\n /** Native spelling of `readOnly` (`<FloatingLabelInput readonly />`) */\n readonly: { type: Boolean, default: false },\n /** Shows the clear button; called when it is clicked */\n onClear: Function as PropType<() => void>,\n /** Allow autofill extensions to appear in the input */\n allowAutofillExtensions: { type: Boolean, default: false },\n /** Helper text below the input (or the `description` slot) */\n description: String,\n /** Built-in reveal toggle. @default true when type=\"password\" and no end adornment */\n revealable: { type: Boolean, default: undefined },\n /** Render as a multi-line textarea instead of a single-line input */\n multiline: { type: Boolean, default: false },\n /** Number of visible text lines when `multiline` is true */\n rows: { type: Number, default: 2 },\n /** Where the label rests once it floats: on the border, or inside the box with the value under it (always the rounded box). @default \"border\" */\n labelPlacement: { type: String as PropType<\"border\" | \"inside\">, default: \"border\" },\n /** Pill shape. `false` takes the rounded box of the other fields. @default true */\n pill: { type: Boolean, default: true },\n id: String,\n name: String,\n type: { type: String, default: \"text\" },\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n defaultValue: { type: [String, Number] as PropType<string | number>, default: undefined },\n },\n emits: {\n \"update:value\": (_value: string) => true,\n \"autofill\": () => true,\n \"revealedChange\": (_revealed: boolean) => true,\n },\n setup(props, { attrs, slots, emit, expose }) {\n const inputRef = ref<HTMLInputElement | HTMLTextAreaElement | null>(null)\n const generatedId = useId()\n const focused = ref(false)\n const hasValue = ref(!!(props.value !== undefined ? props.value : props.defaultValue))\n const revealed = ref(false)\n\n // Sync hasValue with controlled value prop\n watch(\n () => props.value,\n (value) => {\n if (value !== undefined) hasValue.value = !!value\n },\n )\n\n const autoResize = () => {\n const el = inputRef.value\n if (!props.multiline || !el) return\n el.style.height = \"auto\"\n el.style.height = `${el.scrollHeight}px`\n }\n // The multiline <textarea> gets its value imperatively, like React DOM: a\n // `value` prop would make Vue mirror it into a `value` attribute, which\n // React never renders (its text content carries the value instead)\n const syncTextareaValue = () => {\n const el = inputRef.value\n if (!props.multiline || !el || props.value === undefined) return\n const value = String(props.value)\n if (el.value !== value) el.value = value\n }\n onMounted(() => {\n // React's initTextarea: the initial text becomes the (dirty) value\n const el = inputRef.value\n if (props.multiline && el && el.textContent) el.value = el.textContent\n autoResize()\n })\n // Also resize when a controlled value or rows changes without a keystroke\n watch(\n [() => props.multiline, () => props.value, () => props.rows],\n () => {\n syncTextareaValue()\n autoResize()\n },\n { flush: \"post\" },\n )\n\n // Handle clicks on the container to focus the input\n const handleContainerMouseDown = (evt: MouseEvent) => {\n const input = inputRef.value\n if (!evt.target || !(evt.target instanceof Element) || !input) {\n return\n }\n if (input.contains(evt.target)) {\n return\n }\n if (evt.target.closest(\"button, [type='button'], [role='button']\")) {\n return\n }\n evt.preventDefault()\n if (document.activeElement !== input) {\n input.focus()\n }\n // email, number and other types without the selection API throw on setSelectionRange\n if (input.selectionStart === null) return\n const length = input.value.length\n input.setSelectionRange(length, length)\n }\n\n // The clear button unmounts once the value is gone, so keep focus in the field\n const handleClear = (evt: MouseEvent) => {\n inputRef.value?.focus()\n ;(props.onClear as ((evt: MouseEvent) => void) | undefined)?.(evt)\n }\n\n const handleInput = (evt: Event) => {\n const target = evt.currentTarget as HTMLInputElement\n hasValue.value = !!target.value\n emit(\"update:value\", target.value)\n autoResize()\n // Like a React controlled input, a `value` the parent does not update\n // is put back (Vue only re-applies `value` when this component renders)\n void nextTick(() => {\n if (props.value === undefined) return\n const value = String(props.value)\n if (target.value !== value) target.value = value\n })\n }\n\n const handleAnimationStart = (evt: AnimationEvent) => {\n // Detect browser autofill\n if (evt.animationName === \"native-autofill-in\") {\n hasValue.value = true\n emit(\"autofill\")\n }\n }\n\n const handleRevealToggle = () => {\n revealed.value = !revealed.value\n emit(\"revealedChange\", revealed.value)\n }\n\n expose({ focus: () => inputRef.value?.focus(), input: inputRef })\n\n return () => {\n const inputId = props.id || `floating-label-input-${generatedId}`\n // Slots that render nothing (a false v-if) count as absent, like a falsy ReactNode\n const descriptionSlot = slots.description?.()\n const description: VNodeChild = hasContent(descriptionSlot) ? descriptionSlot : props.description\n const descriptionId = description ? `${inputId}-description` : undefined\n const errorId = props.errorMessage ? `${inputId}-error` : undefined\n const startAdornmentSlot = slots.startAdornment?.()\n const startAdornment = hasContent(startAdornmentSlot) ? startAdornmentSlot : undefined\n const endAdornmentSlot = slots.endAdornment?.()\n const endAdornment = hasContent(endAdornmentSlot) ? endAdornmentSlot : undefined\n const readOnly = props.readOnly || props.readonly\n // Caller focus/blur listeners run from the shared handlers\n const {\n \"class\": className,\n \"aria-describedby\": ariaDescribedByAttr,\n \"onFocus\": onFocusAttr,\n \"onBlur\": onBlurAttr,\n ...restAttrs\n } = attrs\n\n const invalid = props.invalid ?? !!props.errorMessage\n // Determine if clear button should be shown\n const showClearButton = !!props.onClear && hasValue.value && !props.disabled && !readOnly\n // Built-in password reveal toggle\n const isPassword = props.type === \"password\"\n const revealable = props.revealable ?? (isPassword && !endAdornment)\n const showRevealButton = revealable && !props.disabled\n const effectiveType = isPassword && revealed.value ? \"text\" : props.type\n // Merge aria-describedby with error id\n const ariaDescribedBy = [ariaDescribedByAttr, errorId, descriptionId].filter(Boolean).join(\" \") || undefined\n\n const controlProps = {\n \"ref\": inputRef,\n \"id\": inputId,\n \"name\": props.name,\n // Vue re-applies a present `value` key on every render, so an\n // uncontrolled field must not carry one (it would reset typed text)\n ...(props.value !== undefined ? { value: props.value } : {}),\n \"disabled\": props.disabled,\n \"readonly\": readOnly,\n // An explicit aria-invalid (e.g. from Field) wins over the computed state\n \"aria-invalid\": restAttrs[\"aria-invalid\"] ?? (invalid ? true : undefined),\n \"aria-describedby\": ariaDescribedBy,\n \"onInput\": handleInput,\n \"onFocus\": (evt: FocusEvent) => {\n focused.value = true\n callListeners(onFocusAttr, evt)\n },\n \"onBlur\": (evt: FocusEvent) => {\n focused.value = false\n callListeners(onBlurAttr, evt)\n },\n }\n // Uncontrolled: `vDefaultValue` sets the initial value (server markup,\n // hydration and later changes as in React)\n const initialValue = props.value === undefined ? props.defaultValue : undefined\n // The textarea's text content follows the controlled value, else\n // `default-value`, as React keeps a textarea's defaultValue\n const { value: _value, ...textareaControlProps } = controlProps as typeof controlProps & { value?: unknown }\n const textContent = String(props.value ?? props.defaultValue ?? \"\")\n\n const inside = props.labelPlacement === \"inside\"\n\n return h(\"div\", {\n \"class\": clsx(s.Root, className as string | undefined),\n \"data-label-placement\": inside ? \"inside\" : undefined,\n \"data-pill\": props.pill && !inside ? \"\" : undefined,\n }, [\n h(\n \"div\",\n {\n \"class\": clsx(s.FieldFootprint, { [s.HasValue!]: hasValue.value || !!startAdornment }),\n \"data-focused\": focused.value ? \"\" : undefined,\n \"data-has-value\": hasValue.value ? \"\" : undefined,\n \"data-invalid\": invalid ? \"\" : undefined,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"data-readonly\": readOnly ? \"\" : undefined,\n \"data-multiline\": props.multiline ? \"\" : undefined,\n \"onMousedown\": handleContainerMouseDown,\n },\n [\n h(\"label\", { class: s.TypeableLabel, for: inputId }, [\n h(\"div\", { class: s.LabelPositioner }, [h(\"div\", { class: s.LabelText }, props.label)]),\n ]),\n startAdornment ? h(\"div\", { class: s.StartAdornment }, startAdornment) : null,\n props.multiline\n ? withDirectives(\n h(\n \"textarea\",\n mergeProps(textareaAttrs(restAttrs), {\n ...textareaControlProps,\n rows: props.rows,\n class: s.Textarea,\n textContent,\n }),\n ),\n [[vServerText, textContent]],\n )\n : withDirectives(\n h(\n \"input\",\n mergeProps(restAttrs, {\n ...controlProps,\n \"type\": effectiveType,\n \"class\": s.Input,\n \"onAnimationstart\": handleAnimationStart,\n \"data-lpignore\": props.allowAutofillExtensions ? undefined : true,\n \"data-1p-ignore\": props.allowAutofillExtensions ? undefined : true,\n }),\n ),\n [[vDefaultValue, initialValue]],\n ),\n endAdornment ? h(\"div\", { class: s.EndAdornment }, endAdornment) : null,\n showClearButton\n ? h(\"button\", { \"type\": \"button\", \"aria-label\": \"Clear input\", \"class\": s.ClearButton, \"onClick\": handleClear }, [h(X)])\n : null,\n showRevealButton\n ? h(\n \"button\",\n { \"type\": \"button\", \"aria-label\": revealed.value ? \"Hide\" : \"Show\", \"class\": s.RevealButton, \"onClick\": handleRevealToggle },\n [revealed.value ? h(EyeOff) : h(Eye)],\n )\n : null,\n ],\n ),\n props.errorMessage ? h(\"div\", { id: errorId, class: s.ErrorMessage, role: \"alert\" }, props.errorMessage) : null,\n description ? h(\"div\", { id: descriptionId, class: s.Description }, description) : null,\n ])\n }\n },\n})\n\ntype FloatingLabelInputOwnProps = InstanceType<typeof FloatingLabelInputComponent>[\"$props\"]\n\n/** FloatingLabelInput props plus the native <input> attributes that fall through to it, as in React. */\nexport type FloatingLabelInputProps = FloatingLabelInputOwnProps &\n Omit<InputHTMLAttributes, keyof FloatingLabelInputOwnProps>\n\n/** Text input whose label floats above the value, with optional reveal toggle and multiline mode. */\nexport const FloatingLabelInput = FloatingLabelInputComponent as typeof FloatingLabelInputComponent & {\n new (): { $props: FloatingLabelInputProps }\n}\n"]}
1
+ {"version":3,"file":"FloatingLabelInput.js","sourceRoot":"","sources":["../../../../src/components/FloatingLabelInput/FloatingLabelInput.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,E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E,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAC5H,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CACtC;wBACH,CAAC,CAAC,IAAI;iBACT,CACF;gBACD,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;gBACxH,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;aACxF,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAQF,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAEjC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport { computed, defineComponent, h, mergeProps, nextTick, onBeforeUnmount, onMounted, ref, useId, watch, withDirectives, type InputHTMLAttributes, type PropType, type VNodeChild } from \"vue\"\nimport { Eye, EyeOff, X } from \"../Icon/index.js\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport { vDefaultValue, vServerText } from \"../../lib/defaultValue.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport { observeTextareaWidth } from \"../../lib/observeTextareaWidth.js\"\nimport s from \"@plexui/styles/components/FloatingLabelInput/FloatingLabelInput.module.css\"\n\n// A fallthrough listener is a function or, when merged, an array of them\nconst callListeners = (listener: unknown, evt: Event) => {\n for (const fn of Array.isArray(listener) ? listener : [listener]) {\n if (typeof fn === \"function\") fn(evt)\n }\n}\n\n// Attributes that only mean something on <input>; everything else (required,\n// maxlength, placeholder, key and clipboard listeners, aria-*, data-*) also\n// applies to the multiline <textarea>, as in React\nconst INPUT_ONLY_ATTRS = new Set([\n \"accept\", \"alt\", \"capture\", \"checked\", \"height\", \"list\", \"max\", \"min\", \"multiple\",\n \"pattern\", \"size\", \"src\", \"step\", \"width\", \"formaction\", \"formenctype\",\n \"formmethod\", \"formnovalidate\", \"formtarget\",\n])\n\nconst textareaAttrs = (attrs: Record<string, unknown>) =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !INPUT_ONLY_ATTRS.has(key.toLowerCase())))\n\n/**\n * Port of packages/ui/src/components/FloatingLabelInput/FloatingLabelInput.tsx.\n * Attributes other than `class` go to the <input>, or to the `multiline`\n * <textarea> except the input-only ones, as in React. `value` +\n * `update:value` support `v-model:value`.\n */\nconst FloatingLabelInputComponent = defineComponent({\n name: \"FloatingLabelInput\",\n inheritAttrs: false,\n props: {\n /** Label text for the floating label */\n label: { type: String, required: true },\n /** Error message to display below the input */\n errorMessage: String,\n /** Mark the input as invalid. @default false (or true if errorMessage is provided) */\n invalid: { type: Boolean, default: undefined },\n /** Disables the input visually and from interactions */\n disabled: { type: Boolean, default: false },\n /** Makes the input read-only */\n readOnly: { type: Boolean, default: false },\n /** Native spelling of `readOnly` (`<FloatingLabelInput readonly />`) */\n readonly: { type: Boolean, default: false },\n /** Shows the clear button; called when it is clicked */\n onClear: Function as PropType<() => void>,\n /** Allow autofill extensions to appear in the input */\n allowAutofillExtensions: { type: Boolean, default: false },\n /** Helper text below the input (or the `description` slot) */\n description: String,\n /** Built-in reveal toggle. @default true when type=\"password\" and no end adornment */\n revealable: { type: Boolean, default: undefined },\n /** Render as a multi-line textarea instead of a single-line input */\n multiline: { type: Boolean, default: false },\n /** Number of visible text lines when `multiline` is true */\n rows: { type: Number, default: 2 },\n /** Where the label rests once it floats: on the border, or inside the box with the value under it (always the rounded box). @default \"border\" */\n labelPlacement: { type: String as PropType<\"border\" | \"inside\">, default: \"border\" },\n /** Pill shape. `false` takes the rounded box of the other fields. @default true */\n pill: { type: Boolean, default: true },\n id: String,\n name: String,\n type: { type: String, default: \"text\" },\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n defaultValue: { type: [String, Number] as PropType<string | number>, default: undefined },\n },\n emits: {\n \"update:value\": (value: string) => typeof value === \"string\",\n \"autofill\": () => true,\n \"revealedChange\": (revealed: boolean) => typeof revealed === \"boolean\",\n },\n setup(props, { attrs, slots, emit, expose }) {\n const inputRef = ref<HTMLInputElement | HTMLTextAreaElement | null>(null)\n const generatedId = useId()\n const focused = ref(false)\n const hasUncontrolledValue = ref(String((props.value !== undefined ? props.value : props.defaultValue) ?? \"\") !== \"\")\n const revealed = ref(false)\n\n const hasValue = computed(() => props.value !== undefined\n ? String(props.value ?? \"\") !== \"\"\n : hasUncontrolledValue.value)\n\n const autoResize = () => {\n const el = inputRef.value\n if (!props.multiline || !el) return\n el.style.height = \"auto\"\n el.style.height = `${el.scrollHeight}px`\n }\n let stopObservingWidth: (() => void) | undefined\n const observeWidth = () => {\n stopObservingWidth?.()\n stopObservingWidth = props.multiline && inputRef.value\n ? observeTextareaWidth(inputRef.value, autoResize)\n : undefined\n }\n watch(() => props.multiline, observeWidth, { flush: \"post\" })\n onBeforeUnmount(() => stopObservingWidth?.())\n\n // The multiline <textarea> gets its value imperatively, like React DOM: a\n // `value` prop would make Vue mirror it into a `value` attribute, which\n // React never renders (its text content carries the value instead)\n const syncTextareaValue = () => {\n const el = inputRef.value\n if (!props.multiline || !el || props.value === undefined) return\n const value = String(props.value)\n if (el.value !== value) el.value = value\n }\n onMounted(() => {\n // React's initTextarea: the initial text becomes the (dirty) value\n const el = inputRef.value\n if (props.multiline && el && el.textContent) el.value = el.textContent\n autoResize()\n observeWidth()\n })\n // Also resize when a controlled value or rows changes without a keystroke\n watch(\n [() => props.multiline, () => props.value, () => props.rows],\n () => {\n syncTextareaValue()\n autoResize()\n },\n { flush: \"post\" },\n )\n\n // Handle clicks on the container to focus the input\n const handleContainerMouseDown = (evt: MouseEvent) => {\n const input = inputRef.value\n if (!evt.target || !(evt.target instanceof Element) || !input) {\n return\n }\n if (input.contains(evt.target)) {\n return\n }\n if (evt.target.closest(\"button, [type='button'], [role='button']\")) {\n return\n }\n evt.preventDefault()\n if (document.activeElement !== input) {\n input.focus()\n }\n // email, number and other types without the selection API throw on setSelectionRange\n if (input.selectionStart === null) return\n const length = input.value.length\n input.setSelectionRange(length, length)\n }\n\n // The clear button unmounts once the value is gone, so keep focus in the field\n const handleClear = (evt: MouseEvent) => {\n inputRef.value?.focus()\n ;(props.onClear as ((evt: MouseEvent) => void) | undefined)?.(evt)\n }\n\n const handleInput = (evt: Event) => {\n const target = evt.currentTarget as HTMLInputElement\n hasUncontrolledValue.value = !!target.value\n emit(\"update:value\", target.value)\n autoResize()\n // Like a React controlled input, a `value` the parent does not update\n // is put back (Vue only re-applies `value` when this component renders)\n void nextTick(() => {\n if (props.value === undefined) return\n const value = String(props.value)\n if (target.value !== value) target.value = value\n })\n }\n\n const handleAnimationStart = (evt: AnimationEvent) => {\n // Detect browser autofill\n if (evt.animationName === \"native-autofill-in\") {\n hasUncontrolledValue.value = true\n emit(\"autofill\")\n }\n }\n\n const handleRevealToggle = () => {\n revealed.value = !revealed.value\n emit(\"revealedChange\", revealed.value)\n }\n\n expose({ focus: () => inputRef.value?.focus(), input: inputRef })\n\n return () => {\n const inputId = props.id || `floating-label-input-${generatedId}`\n // Slots that render nothing (a false v-if) count as absent, like a falsy ReactNode\n const descriptionSlot = slots.description?.()\n const description: VNodeChild = hasContent(descriptionSlot) ? descriptionSlot : props.description\n const descriptionId = description ? `${inputId}-description` : undefined\n const errorId = props.errorMessage ? `${inputId}-error` : undefined\n const startAdornmentSlot = slots.startAdornment?.()\n const startAdornment = hasContent(startAdornmentSlot) ? startAdornmentSlot : undefined\n const endAdornmentSlot = slots.endAdornment?.()\n const endAdornment = hasContent(endAdornmentSlot) ? endAdornmentSlot : undefined\n const readOnly = props.readOnly || props.readonly\n // Caller focus/blur listeners run from the shared handlers\n const {\n \"class\": className,\n \"aria-describedby\": ariaDescribedByAttr,\n \"onFocus\": onFocusAttr,\n \"onBlur\": onBlurAttr,\n ...restAttrs\n } = attrs\n\n const invalid = props.invalid ?? !!props.errorMessage\n // Determine if clear button should be shown\n const showClearButton = !!props.onClear && hasValue.value && !props.disabled && !readOnly\n // Built-in password reveal toggle\n const isPassword = props.type === \"password\"\n const revealable = props.revealable ?? (isPassword && !endAdornment)\n const showRevealButton = revealable && !props.disabled\n const effectiveType = isPassword && revealed.value ? \"text\" : props.type\n // Merge aria-describedby with error id\n const ariaDescribedBy = [ariaDescribedByAttr, errorId, descriptionId].filter(Boolean).join(\" \") || undefined\n\n const controlProps = {\n \"ref\": inputRef,\n \"id\": inputId,\n \"name\": props.name,\n // Vue re-applies a present `value` key on every render, so an\n // uncontrolled field must not carry one (it would reset typed text)\n ...(props.value !== undefined ? { value: props.value } : {}),\n \"disabled\": props.disabled,\n \"readonly\": readOnly,\n // An explicit aria-invalid (e.g. from Field) wins over the computed state\n \"aria-invalid\": restAttrs[\"aria-invalid\"] ?? (invalid ? true : undefined),\n \"aria-describedby\": ariaDescribedBy,\n \"onInput\": handleInput,\n \"onFocus\": (evt: FocusEvent) => {\n focused.value = true\n callListeners(onFocusAttr, evt)\n },\n \"onBlur\": (evt: FocusEvent) => {\n focused.value = false\n callListeners(onBlurAttr, evt)\n },\n }\n // Uncontrolled: `vDefaultValue` sets the initial value (server markup,\n // hydration and later changes as in React)\n const initialValue = props.value === undefined ? props.defaultValue : undefined\n // The textarea's text content follows the controlled value, else\n // `default-value`, as React keeps a textarea's defaultValue\n const textareaControlProps = { ...controlProps }\n delete textareaControlProps.value\n const textContent = String(props.value ?? props.defaultValue ?? \"\")\n\n const inside = props.labelPlacement === \"inside\"\n\n return h(\"div\", {\n \"class\": clsx(s.Root, className as string | undefined),\n \"data-label-placement\": inside ? \"inside\" : undefined,\n \"data-pill\": props.pill && !inside ? \"\" : undefined,\n }, [\n h(\n \"div\",\n {\n \"class\": clsx(s.FieldFootprint, { [s.HasValue!]: hasValue.value || !!startAdornment }),\n \"data-focused\": focused.value ? \"\" : undefined,\n \"data-has-value\": hasValue.value ? \"\" : undefined,\n \"data-invalid\": invalid ? \"\" : undefined,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"data-readonly\": readOnly ? \"\" : undefined,\n \"data-multiline\": props.multiline ? \"\" : undefined,\n \"onMousedown\": handleContainerMouseDown,\n },\n [\n h(\"label\", { class: s.TypeableLabel, for: inputId }, [\n h(\"div\", { class: s.LabelPositioner }, [h(\"div\", { class: s.LabelText }, props.label)]),\n ]),\n startAdornment ? h(\"div\", { class: s.StartAdornment }, startAdornment) : null,\n props.multiline\n ? withDirectives(\n h(\n \"textarea\",\n mergeProps(textareaAttrs(restAttrs), {\n ...textareaControlProps,\n rows: props.rows,\n class: s.Textarea,\n textContent,\n }),\n ),\n [[vServerText, textContent]],\n )\n : withDirectives(\n h(\n \"input\",\n mergeProps(restAttrs, {\n ...controlProps,\n \"type\": effectiveType,\n \"class\": s.Input,\n \"onAnimationstart\": handleAnimationStart,\n \"data-lpignore\": props.allowAutofillExtensions ? undefined : true,\n \"data-1p-ignore\": props.allowAutofillExtensions ? undefined : true,\n }),\n ),\n [[vDefaultValue, initialValue]],\n ),\n endAdornment ? h(\"div\", { class: s.EndAdornment }, endAdornment) : null,\n showClearButton\n ? h(\"button\", { \"type\": \"button\", \"aria-label\": \"Clear input\", \"class\": s.ClearButton, \"onClick\": handleClear }, [h(X)])\n : null,\n showRevealButton\n ? h(\n \"button\",\n { \"type\": \"button\", \"aria-label\": revealed.value ? \"Hide\" : \"Show\", \"class\": s.RevealButton, \"onClick\": handleRevealToggle },\n [revealed.value ? h(EyeOff) : h(Eye)],\n )\n : null,\n ],\n ),\n props.errorMessage ? h(FieldError, { id: errorId, class: s.ErrorMessage }, { default: () => props.errorMessage }) : null,\n description ? h(\"div\", { id: descriptionId, class: s.Description }, description) : null,\n ])\n }\n },\n})\n\ntype FloatingLabelInputOwnProps = InstanceType<typeof FloatingLabelInputComponent>[\"$props\"]\n\n/** FloatingLabelInput props plus the native <input> attributes that fall through to it, as in React. */\nexport type FloatingLabelInputProps = FloatingLabelInputOwnProps &\n Omit<InputHTMLAttributes, keyof FloatingLabelInputOwnProps>\n\n/** Text input whose label floats above the value, with optional reveal toggle and multiline mode. */\nexport const FloatingLabelInput = FloatingLabelInputComponent as typeof FloatingLabelInputComponent & {\n new (): { $props: FloatingLabelInputProps }\n}\n"]}
@@ -2,6 +2,7 @@ import clsx from "clsx";
2
2
  import { defineComponent, h, shallowRef, useId } from "vue";
3
3
  import { Button } from "../Button/index.js";
4
4
  import { Dropdown, X } from "../Icon/index.js";
5
+ import { FieldError } from "../FieldError/index.js";
5
6
  import s from "@plexui/styles/components/FloatingLabelSelect/FloatingLabelSelect.module.css";
6
7
  const callListeners = (listeners, event) => {
7
8
  const list = Array.isArray(listeners) ? listeners : [listeners];
@@ -98,11 +99,17 @@ export const FloatingLabelSelect = defineComponent({
98
99
  const handleClearClick = (evt) => {
99
100
  evt.stopPropagation();
100
101
  evt.preventDefault();
102
+ if (props.disabled)
103
+ return;
104
+ // Keep focus in the field before its clear button disappears.
105
+ fieldRef.value?.focus({ preventScroll: true });
101
106
  props.onClearClick?.();
102
107
  };
103
108
  return () => {
104
109
  const { selected, disabled, open, errorMessage } = props;
105
- const { "class": className, "aria-describedby": ariaDescribedByAttr, "onKeydown": _onKeydown, ...restAttrs } = attrs;
110
+ const { "class": className, "aria-describedby": ariaDescribedByAttr, ...restAttrs } = attrs;
111
+ // The composed handler below already invokes the consumer's key listener.
112
+ delete restAttrs.onKeydown;
106
113
  const invalid = props.invalid ?? !!errorMessage;
107
114
  const showClearButton = !!props.onClearClick && selected && !disabled;
108
115
  const ariaDescribedBy = [ariaDescribedByAttr, errorMessage ? errorId : undefined].filter(Boolean).join(" ") ||
@@ -123,7 +130,6 @@ export const FloatingLabelSelect = defineComponent({
123
130
  "data-disabled": disabled ? "" : undefined,
124
131
  "aria-expanded": open,
125
132
  "aria-haspopup": "listbox",
126
- "aria-invalid": invalid ? true : undefined,
127
133
  "aria-describedby": ariaDescribedBy,
128
134
  "aria-disabled": disabled || undefined,
129
135
  "onPointerdown": handlePointerDown,
@@ -152,7 +158,7 @@ export const FloatingLabelSelect = defineComponent({
152
158
  ]),
153
159
  ]),
154
160
  // Same plain line as FloatingLabelInput, so the two read alike on one form
155
- errorMessage ? h("div", { id: errorId, class: s.ErrorMessage, role: "alert" }, [errorMessage]) : null,
161
+ errorMessage ? h(FieldError, { id: errorId, class: s.ErrorMessage }, { default: () => errorMessage }) : null,
156
162
  ]);
157
163
  };
158
164
  },