@plexui/vue 0.10.0 → 0.11.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 (101) hide show
  1. package/dist/es/components/ButtonGroup/ButtonGroup.js +7 -0
  2. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  3. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  4. package/dist/es/components/ContextMenu/shared.js +3 -2
  5. package/dist/es/components/ContextMenu/shared.js.map +1 -1
  6. package/dist/es/components/Dialog/Dialog.js +135 -18
  7. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  8. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  9. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  10. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  11. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  12. package/dist/es/components/Dialog/index.js +1 -1
  13. package/dist/es/components/Dialog/index.js.map +1 -1
  14. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  15. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  16. package/dist/es/components/IndexBar/IndexBar.js +215 -0
  17. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  18. package/dist/es/components/IndexBar/index.js +2 -0
  19. package/dist/es/components/IndexBar/index.js.map +1 -0
  20. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +149 -1
  21. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  22. package/dist/es/components/Menu/Menu.js +10 -6
  23. package/dist/es/components/Menu/Menu.js.map +1 -1
  24. package/dist/es/components/Page/Page.js +2 -2
  25. package/dist/es/components/Page/Page.js.map +1 -1
  26. package/dist/es/components/PhoneLayout/PhoneLayout.js +50 -0
  27. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  28. package/dist/es/components/PhoneLayout/index.js +2 -0
  29. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  30. package/dist/es/components/Popover/Popover.js +1 -1
  31. package/dist/es/components/Popover/Popover.js.map +1 -1
  32. package/dist/es/components/Popover/deferredPointerDownOutside.js +59 -4
  33. package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
  34. package/dist/es/components/Select/Select.js +2 -2
  35. package/dist/es/components/Select/Select.js.map +1 -1
  36. package/dist/es/components/Slider/Slider.js +34 -3
  37. package/dist/es/components/Slider/Slider.js.map +1 -1
  38. package/dist/es/components/SwipeActions/SwipeActions.js +374 -0
  39. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  40. package/dist/es/components/SwipeActions/index.js +2 -0
  41. package/dist/es/components/SwipeActions/index.js.map +1 -0
  42. package/dist/es/components/Switch/Switch.js +3 -1
  43. package/dist/es/components/Switch/Switch.js.map +1 -1
  44. package/dist/es/components/TabBar/TabBar.js +23 -8
  45. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  46. package/dist/es/components/TabBar/index.js.map +1 -1
  47. package/dist/es/components/Tabs/Tabs.js +1 -0
  48. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  49. package/dist/es/components/TagInput/TagInput.js +3 -46
  50. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  51. package/dist/es/components/Textarea/Textarea.js +1 -0
  52. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  53. package/dist/es/components/Tip/Tip.js +276 -0
  54. package/dist/es/components/Tip/Tip.js.map +1 -0
  55. package/dist/es/components/Tip/index.js +2 -0
  56. package/dist/es/components/Tip/index.js.map +1 -0
  57. package/dist/es/components/Toast/ToastRenderer.js +30 -13
  58. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  59. package/dist/es/components/Toast/Toaster.js +17 -6
  60. package/dist/es/components/Toast/Toaster.js.map +1 -1
  61. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  62. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  63. package/dist/es/components/Toolbar/Toolbar.js +3 -3
  64. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  65. package/dist/es/composables/useEscCloseStack.js +8 -4
  66. package/dist/es/composables/useEscCloseStack.js.map +1 -1
  67. package/dist/es/lib/floatingBoundary.js +3 -1
  68. package/dist/es/lib/floatingBoundary.js.map +1 -1
  69. package/dist/es/lib/helpers.js +21 -0
  70. package/dist/es/lib/helpers.js.map +1 -1
  71. package/dist/es/lib/phoneLayout.js +16 -0
  72. package/dist/es/lib/phoneLayout.js.map +1 -0
  73. package/dist/es/lib/toastRegion.js +6 -0
  74. package/dist/es/lib/toastRegion.js.map +1 -0
  75. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +13 -0
  76. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  77. package/dist/types/components/ContextMenu/shared.d.ts +3 -2
  78. package/dist/types/components/Dialog/Dialog.d.ts +93 -3
  79. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  80. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  81. package/dist/types/components/Dialog/index.d.ts +1 -1
  82. package/dist/types/components/IndexBar/IndexBar.d.ts +112 -0
  83. package/dist/types/components/IndexBar/index.d.ts +1 -0
  84. package/dist/types/components/Menu/Menu.d.ts +14 -15
  85. package/dist/types/components/Page/Page.d.ts +2 -2
  86. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +21 -0
  87. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  88. package/dist/types/components/Popover/deferredPointerDownOutside.d.ts +1 -1
  89. package/dist/types/components/SwipeActions/SwipeActions.d.ts +135 -0
  90. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  91. package/dist/types/components/TabBar/TabBar.d.ts +55 -6
  92. package/dist/types/components/TabBar/index.d.ts +1 -1
  93. package/dist/types/components/Tip/Tip.d.ts +146 -0
  94. package/dist/types/components/Tip/index.d.ts +1 -0
  95. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  96. package/dist/types/components/Toolbar/Toolbar.d.ts +9 -7
  97. package/dist/types/composables/useEscCloseStack.d.ts +2 -2
  98. package/dist/types/lib/helpers.d.ts +6 -0
  99. package/dist/types/lib/phoneLayout.d.ts +11 -0
  100. package/dist/types/lib/toastRegion.d.ts +5 -0
  101. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"TagInput.js","sourceRoot":"","sources":["../../../../src/components/TagInput/TagInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,QAAQ,EACR,eAAe,EACf,SAAS,EACT,GAAG,EACH,UAAU,EACV,KAAK,GAEN,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAA;AACpC,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAOtE,oGAAoG;AACpG,MAAM,yBAAyB,GAAG,EAAE,CAAA;AACpC,mEAAmE;AACnE,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,2BAA2B,GAAG,GAAG,CAAA;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,IAAI,EAAE,UAAU;IAChB,2EAA2E;IAC3E,wEAAwE;IACxE,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,uFAAuF;QACvF,YAAY,EAAE,EAAE,IAAI,EAAE,KAAwB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QACnE,gEAAgE;QAChE,KAAK,EAAE,KAAwB;QAC/B,qDAAqD;QACrD,EAAE,EAAE,MAAM;QACV,+DAA+D;QAC/D,IAAI,EAAE,EAAE,IAAI,EAAE,MAAoE,EAAE,OAAO,EAAE,IAAI,EAAE;QACnG,4GAA4G;QAC5G,OAAO,EAAE,EAAE,IAAI,EAAE,MAAiD,EAAE,OAAO,EAAE,SAAS,EAAE;QACxF,qCAAqC;QACrC,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO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,IAAI;iBACT,CAAC;aACH,CACF;YACD,uDAAuD;YACvD,KAAK,CAAC,OAAO;gBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpH,CAAC,CAAC,IAAI;SACT,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n type PropType,\n} from \"vue\"\nimport type { Sizes, Variants } from \"@plexui/styles/types\"\nimport { toCssVariables } from \"../../lib/helpers.js\"\nimport { X } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/TagInput/TagInput.module.css\"\n\nexport type Tag = {\n value: string\n valid: boolean\n}\n\n// How many pixels to reserve on the right of the input as a buffer before wrapping to the next line\nconst INPUT_CURSOR_TOLERANCE_PX = 10\n// The total space reserved on either side of the input for padding\nconst CONTAINER_PADDING_PX = 24\nconst SHAKE_ANIMATION_DURATION_MS = 500\n\n/**\n * Port of packages/ui/src/components/TagInput/TagInput.tsx. Controlled with\n * `value` (`v-model:value`), uncontrolled with `defaultValue`; every change\n * emits `update:value` and `change` with the new tag list.\n */\nexport const TagInput = defineComponent({\n name: \"TagInput\",\n // React's TagInput takes no extra attributes (Field's aria-describedby and\n // aria-invalid are ignored); the render has several roots, so drop them\n inheritAttrs: false,\n props: {\n /** The state of the tag input when it is initially rendered, used when uncontrolled */\n defaultValue: { type: Array as PropType<Tag[]>, default: () => [] },\n /** The value of the tag input, used to control the tag input */\n value: Array as PropType<Tag[]>,\n /** Allows the tag input to be targeted with `for` */\n id: String,\n /** Corresponds with Input height when rows=1. @default \"xl\" */\n size: { type: String as PropType<Sizes<\"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\">>, default: \"xl\" },\n /** Visual style. `ghost` has no frame, for a field that its container already frames. @default \"outline\" */\n variant: { type: String as PropType<Variants<\"outline\" | \"ghost\">>, default: \"outline\" },\n /** Placeholder text for the input */\n placeholder: { type: String, default: \"\" },\n /** Returns whether a value is a valid tag; invalid tags are highlighted. Evaluated on creation only. */\n validator: Function as PropType<(value: string) => boolean>,\n /** The maximum number of tags allowed before the input is disabled; displays a counter below the input */\n maxTags: Number,\n /** Whether to focus this input on mount */\n autoFocus: { type: Boolean, default: false },\n /** The minimum number of rows for the tag input. @default 1 */\n rows: { type: Number, default: 1 },\n /** Controls what characters will count towards creating a new tag. @default [\",\", \" \"] */\n delimiters: { type: Array as PropType<string[]>, default: () => [\",\", \" \"] },\n /** Disables the tag input visually and from interactions */\n disabled: { type: Boolean, default: undefined },\n /** Fully-rounded container and chips, matching `Input pill` */\n pill: { type: Boolean, default: false },\n },\n emits: {\n \"update:value\": (tags: Tag[]) => { void tags; return true },\n \"change\": (tags: Tag[]) => { void tags; return true },\n },\n setup(props, { emit }) {\n // Shallow, like React state: emitted lists hold the caller's tag objects, not proxies\n const internalTags = shallowRef<Tag[]>(props.defaultValue)\n const value = computed(() => props.value ?? internalTags.value)\n const isControlled = computed(() => props.value !== undefined)\n const tags = computed(() => new Map(value.value.map((tag) => [tag.value, tag])))\n\n const currentInput = ref(\"\")\n const focused = ref(props.autoFocus)\n const selectedTag = ref<string | null>(null)\n const duplicateTags = ref(new Set<string>())\n const inputWidth = ref(0)\n\n const inputRef = ref<HTMLInputElement | null>(null)\n const containerRef = ref<HTMLDivElement | null>(null)\n const measureRef = ref<HTMLSpanElement | null>(null)\n let pendingRemovalFocus: { tag: string; source: HTMLElement } | null = null\n\n const showInput = computed(() => !props.maxTags || tags.value.size < props.maxTags)\n // A ghost has no frame: the hint stays after the first tag to show where to type.\n const placeholderText = computed(() =>\n tags.value.size === 0 || props.variant === \"ghost\" ? props.placeholder : undefined,\n )\n\n // Handle focusing the correct part of the tag input\n watch(\n [focused, selectedTag, showInput],\n () => {\n if (!focused.value || !containerRef.value) {\n return\n }\n const defaultFocusEl = inputRef.value ?? containerRef.value\n if (selectedTag.value === null) {\n defaultFocusEl.focus()\n } else {\n const selectedTagElement = containerRef.value.querySelector(\n `[data-tag=\"${CSS.escape(selectedTag.value)}\"]`,\n ) as HTMLElement | null\n if (selectedTagElement) {\n selectedTagElement.focus()\n } else {\n defaultFocusEl.focus()\n }\n }\n },\n { flush: \"post\" },\n )\n\n // Restore only after the controlled/uncontrolled list actually removes the\n // focused chip, without stealing focus from another control.\n watch(tags, () => {\n const pending = pendingRemovalFocus\n if (!pending || tags.value.has(pending.tag)) return\n pendingRemovalFocus = null\n const doc = pending.source.ownerDocument\n if (doc.activeElement !== doc.body && !pending.source.contains(doc.activeElement)) return\n ;(inputRef.value ?? containerRef.value)?.focus({ preventScroll: true })\n }, { flush: \"post\" })\n\n // A touch drag need not blur or emit mousedown. Cancel restoration only.\n let stopTrackingRemovalPointer: (() => void) | undefined\n onMounted(() => {\n const doc = containerRef.value?.ownerDocument\n if (!doc) return\n const cancelAfterPointer = (event: Event) => {\n if (pendingRemovalFocus && event.target instanceof Node && !pendingRemovalFocus.source.contains(event.target)) {\n pendingRemovalFocus = null\n }\n }\n doc.addEventListener(\"pointerdown\", cancelAfterPointer, true)\n stopTrackingRemovalPointer = () => doc.removeEventListener(\"pointerdown\", cancelAfterPointer, true)\n })\n onBeforeUnmount(() => stopTrackingRemovalPointer?.())\n\n // Position the real input inside the container (see the React source for the reasoning)\n let observer: ResizeObserver | undefined\n const measure = () => {\n observer?.disconnect()\n const container = containerRef.value\n const measureEl = measureRef.value\n if (!container || !measureEl) {\n return\n }\n\n const recompute = () => {\n const containerRect = container.getBoundingClientRect()\n const tagElements = Array.from(container.querySelectorAll(\"[data-tag]\")) as HTMLDivElement[]\n\n // Grab the right edge of the last tag if it exists, otherwise the left edge of the container\n const leftBound =\n tagElements.length > 0\n ? tagElements[tagElements.length - 1]!.getBoundingClientRect().right\n : containerRect.left\n\n measureEl.textContent = currentInput.value || placeholderText.value || \"\"\n\n // By padding the text width, we ensure the input wraps to the next line\n // before we get to the point where we start to overflow\n const textWidth = measureEl.getBoundingClientRect().width + INPUT_CURSOR_TOLERANCE_PX\n const remainingSpace = containerRect.right - leftBound - CONTAINER_PADDING_PX\n\n if (textWidth <= remainingSpace) {\n inputWidth.value = remainingSpace\n } else {\n // We are going to flow to a new line, so recalculate remaining space based on the container size\n inputWidth.value = containerRect.right - containerRect.left - CONTAINER_PADDING_PX\n }\n }\n\n recompute()\n observer = new ResizeObserver(recompute)\n observer.observe(container)\n container.querySelectorAll(\"[data-tag]\").forEach((chip) => observer!.observe(chip))\n }\n onMounted(measure)\n watch([currentInput, placeholderText, tags], measure, { flush: \"post\" })\n\n const setTags = (newTags: Tag[]) => {\n emit(\"update:value\", newTags)\n emit(\"change\", newTags)\n if (!isControlled.value) {\n internalTags.value = newTags\n }\n }\n\n // Adds every value in one update: a paste of \"a,b\" must not compute\n // each addition from the same stale `tags` snapshot.\n const addTags = (tagValues: string[]) => {\n const next = new Map(tags.value)\n let changed = false\n for (const tagValue of tagValues) {\n if (props.maxTags && next.size >= props.maxTags) {\n break\n }\n const trimmed = tagValue.trim()\n if (!trimmed) {\n continue\n }\n if (next.has(trimmed)) {\n duplicateTags.value = new Set(duplicateTags.value).add(trimmed)\n setTimeout(() => {\n const remaining = new Set(duplicateTags.value)\n remaining.delete(trimmed)\n duplicateTags.value = remaining\n }, SHAKE_ANIMATION_DURATION_MS)\n continue\n }\n const validTag = props.validator?.(trimmed) ?? true\n next.set(trimmed, { value: trimmed, valid: validTag })\n changed = true\n }\n if (!changed) {\n return\n }\n setTags(Array.from(next.values()))\n }\n\n const addTag = (tagValue: string) => addTags([tagValue])\n\n const removeTag = (tag: string) => {\n if (props.disabled) {\n return\n }\n const source = containerRef.value?.querySelector<HTMLElement>(`[data-tag=\"${CSS.escape(tag)}\"]`)\n if (source?.contains(source.ownerDocument.activeElement)) pendingRemovalFocus = { tag, source }\n const next = new Map(tags.value)\n next.delete(tag)\n setTags(Array.from(next.values()))\n }\n\n const selectPreviousTag = () => {\n if (tags.value.size === 0) {\n return\n }\n const tagList = Array.from(tags.value.keys())\n if (selectedTag.value === null) {\n selectedTag.value = tagList[tagList.length - 1]!\n } else {\n const prevIndex = tagList.indexOf(selectedTag.value)\n selectedTag.value = tagList[Math.max(0, prevIndex - 1)]!\n }\n }\n\n const selectNextTag = () => {\n if (selectedTag.value === null) {\n return\n }\n const tagList = Array.from(tags.value.keys())\n const index = tagList.indexOf(selectedTag.value) + 1\n selectedTag.value = index < tagList.length ? tagList[index]! : null\n }\n\n const isEmptyStartingSelection = () => {\n const input = inputRef.value\n if (!input) {\n return true\n }\n return input.selectionStart === 0 && input.selectionEnd === 0\n }\n\n const handleContainerBlur = () => {\n pendingRemovalFocus = null\n focused.value = false\n selectedTag.value = null\n // A disabled tag input keeps the pending text instead of committing it\n if (currentInput.value && !props.disabled) {\n addTag(currentInput.value)\n currentInput.value = \"\"\n }\n }\n\n const handleContainerKeyDown = (e: KeyboardEvent) => {\n // IME candidate navigation belongs to the input, including Safari's 229 key.\n if (e.isComposing || e.keyCode === 229) return\n // A tag can keep focus while the input turns disabled: no selecting or removing then\n if (props.disabled) {\n return\n }\n if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") {\n if (isEmptyStartingSelection()) {\n e.preventDefault()\n selectPreviousTag()\n }\n } else if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") {\n if (selectedTag.value !== null) {\n e.preventDefault()\n selectNextTag()\n }\n } else if (e.key === \"Backspace\") {\n if (selectedTag.value !== null) {\n removeTag(selectedTag.value)\n } else if (isEmptyStartingSelection()) {\n selectPreviousTag()\n }\n }\n }\n\n const handleInputKeyDown = (e: KeyboardEvent) => {\n // Confirming an IME candidate must not commit or clear the pre-edit buffer.\n if (e.isComposing || e.keyCode === 229) return\n if (e.key === \"Enter\" || props.delimiters.includes(e.key)) {\n e.preventDefault()\n if (currentInput.value) {\n addTag(currentInput.value)\n currentInput.value = \"\"\n }\n } else if (e.key === \"Tab\") {\n if (currentInput.value) {\n e.preventDefault()\n addTag(currentInput.value)\n currentInput.value = \"\"\n }\n }\n }\n\n const handlePaste = (e: ClipboardEvent) => {\n const text = e.clipboardData?.getData(\"Text\") ?? \"\"\n let parts = [text]\n\n // Split by all delimiters\n for (const delimiter of props.delimiters) {\n const newParts: string[] = []\n for (const segment of parts) {\n newParts.push(...segment.split(delimiter))\n }\n parts = newParts\n }\n\n // Remove empty parts\n parts = parts.filter(Boolean)\n\n if (parts.length > 1) {\n e.preventDefault()\n addTags(parts)\n }\n }\n\n const handleContainerMouseDown = (e: MouseEvent) => {\n // All clicks in the container focus the container\n focused.value = true\n\n // If the click is on a tag pill, the tag's click handler focuses it\n if (e.target && e.target instanceof Element && e.target.closest(\"[data-tag]\")) {\n return\n }\n\n // Since we know we didn't click a tag, clear any selected tag\n selectedTag.value = null\n\n // If this click is outside of the input, prevent it from \"stealing\" focus from the input\n const input = inputRef.value\n if (e.target && e.target instanceof Element && input && !input.contains(e.target)) {\n e.preventDefault()\n\n const { left, right, top, bottom } = input.getBoundingClientRect()\n const { clientX, clientY } = e\n\n // If this is the first click, clear the selection. Otherwise, select the input contents\n if (e.detail === 1) {\n if (clientY < top || clientX < left) {\n // \"Before\" the input: top/left\n input.setSelectionRange(0, 0)\n } else if (clientY > bottom || clientX > right) {\n // \"After\" the input: bottom/right\n const length = input.value.length\n input.setSelectionRange(length, length)\n }\n } else {\n input.select()\n }\n }\n }\n\n const handleFocus = (e: FocusEvent) => {\n // If the focus is on a tag pill, the click handler for the tag handles it\n if (e.target && e.target instanceof Element && e.target.closest(\"[data-tag]\")) {\n return\n }\n focused.value = true\n selectedTag.value = null\n }\n\n const handleBlur = (e: FocusEvent) => {\n // If there is no related target, don't remove focus (clicks inside the container)\n if (!e.relatedTarget || !(e.relatedTarget instanceof Node)) {\n return\n }\n // Don't clear focus if focus is only moved elsewhere within the container\n if (containerRef.value && containerRef.value.contains(e.relatedTarget)) {\n // If we just tabbed into the input, clear the selected tag\n if (inputRef.value && inputRef.value.contains(e.relatedTarget)) {\n selectedTag.value = null\n }\n return\n }\n handleContainerBlur()\n }\n\n // usehooks-ts' useOnClickOutside: mousedown outside the container\n const handleDocumentMouseDown = (e: MouseEvent) => {\n const container = containerRef.value\n if (!container || !(e.target instanceof Node) || container.contains(e.target)) return\n handleContainerBlur()\n }\n onMounted(() => document.addEventListener(\"mousedown\", handleDocumentMouseDown))\n onBeforeUnmount(() => {\n document.removeEventListener(\"mousedown\", handleDocumentMouseDown)\n observer?.disconnect()\n })\n\n // Focus on mount when requested, like React's initial `focused` state\n onMounted(() => {\n if (focused.value) void nextTick(() => (inputRef.value ?? containerRef.value)?.focus())\n })\n\n return () => [\n h(\n \"div\",\n {\n \"class\": s.Container,\n \"ref\": containerRef,\n \"onKeydown\": handleContainerKeyDown,\n \"onMousedown\": handleContainerMouseDown,\n \"onFocusin\": handleFocus,\n \"onFocusout\": handleBlur,\n \"data-size\": props.size,\n \"data-variant\": props.variant,\n \"data-focused\": focused.value ? \"\" : undefined,\n \"data-empty\": tags.value.size === 0 ? \"\" : undefined,\n \"data-pill\": props.pill ? \"\" : undefined,\n // At maxTags the input is gone, so the container becomes the tab stop;\n // arrow keys and Backspace then select and remove tags from here\n \"tabindex\": showInput.value || props.disabled ? -1 : 0,\n \"style\": toCssVariables({ \"min-rows\": String(props.rows) }),\n \"data-disabled\": props.disabled ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.TagInput }, [\n ...Array.from(tags.value.values()).map((tag) =>\n h(\n \"div\",\n {\n \"key\": tag.value,\n \"class\": s.Tag,\n \"tabindex\": -1,\n \"onClick\": () => (selectedTag.value = tag.value),\n \"data-tag\": tag.value,\n \"data-invalid\": !tag.valid ? \"\" : undefined,\n \"data-duplicate\": duplicateTags.value.has(tag.value) ? \"\" : undefined,\n },\n [\n h(\"span\", { class: \"overflow-hidden text-ellipsis\", title: tag.value }, [\n h(\"span\", { class: s.TagValue }, tag.value),\n ]),\n h(\n \"button\",\n {\n \"type\": \"button\", \"class\": s.TagRemove, \"disabled\": props.disabled,\n \"onClick\": (event: MouseEvent) => { event.stopPropagation(); removeTag(tag.value) },\n \"aria-label\": `Remove ${tag.value}`,\n },\n [h(X)],\n ),\n ],\n ),\n ),\n showInput.value\n ? h(\"div\", { class: s.InputContainer }, [\n // Hidden element to measure input width\n h(\"span\", { ref: measureRef, class: s.InputMeasure }),\n h(\"div\", { class: s.InputWrapper }, [\n h(\"input\", {\n id: props.id,\n class: s.Input,\n ref: inputRef,\n value: currentInput.value,\n onInput: (e: Event) => (currentInput.value = (e.target as HTMLInputElement).value),\n onPaste: handlePaste,\n onKeydown: handleInputKeyDown,\n placeholder: placeholderText.value,\n style: { width: `${inputWidth.value}px` },\n disabled: props.disabled,\n }),\n ]),\n ])\n : null,\n ]),\n ],\n ),\n // 0 means no limit, as for the input above: no counter\n props.maxTags\n ? h(\"div\", { class: s.Limit }, [String(tags.value.size), h(\"span\", { class: \"mx-px\" }, \"/\"), String(props.maxTags)])\n : null,\n ]\n },\n})\n\nexport type TagInputProps = InstanceType<typeof TagInput>[\"$props\"]\n"]}
1
+ {"version":3,"file":"TagInput.js","sourceRoot":"","sources":["../../../../src/components/TagInput/TagInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,QAAQ,EACR,eAAe,EACf,SAAS,EACT,GAAG,EACH,UAAU,EACV,KAAK,GAEN,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAA;AACpC,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAOtE,MAAM,2BAA2B,GAAG,GAAG,CAAA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AC,IAAI;iBACT,CAAC;aACH,CACF;YACD,uDAAuD;YACvD,KAAK,CAAC,OAAO;gBACX,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpH,CAAC,CAAC,IAAI;SACT,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n type PropType,\n} from \"vue\"\nimport type { Sizes, Variants } from \"@plexui/styles/types\"\nimport { toCssVariables } from \"../../lib/helpers.js\"\nimport { X } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/TagInput/TagInput.module.css\"\n\nexport type Tag = {\n value: string\n valid: boolean\n}\n\nconst SHAKE_ANIMATION_DURATION_MS = 500\n\n/**\n * Port of packages/ui/src/components/TagInput/TagInput.tsx. Controlled with\n * `value` (`v-model:value`), uncontrolled with `defaultValue`; every change\n * emits `update:value` and `change` with the new tag list.\n */\nexport const TagInput = defineComponent({\n name: \"TagInput\",\n // React's TagInput takes no extra attributes (Field's aria-describedby and\n // aria-invalid are ignored); the render has several roots, so drop them\n inheritAttrs: false,\n props: {\n /** The state of the tag input when it is initially rendered, used when uncontrolled */\n defaultValue: { type: Array as PropType<Tag[]>, default: () => [] },\n /** The value of the tag input, used to control the tag input */\n value: Array as PropType<Tag[]>,\n /** Allows the tag input to be targeted with `for` */\n id: String,\n /** Corresponds with Input height when rows=1. @default \"xl\" */\n size: { type: String as PropType<Sizes<\"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\">>, default: \"xl\" },\n /** Visual style. `ghost` has no frame, for a field that its container already frames. @default \"outline\" */\n variant: { type: String as PropType<Variants<\"outline\" | \"ghost\">>, default: \"outline\" },\n /** Placeholder text for the input */\n placeholder: { type: String, default: \"\" },\n /** Returns whether a value is a valid tag; invalid tags are highlighted. Evaluated on creation only. */\n validator: Function as PropType<(value: string) => boolean>,\n /** The maximum number of tags allowed before the input is disabled; displays a counter below the input */\n maxTags: Number,\n /** Whether to focus this input on mount */\n autoFocus: { type: Boolean, default: false },\n /** The minimum number of rows for the tag input. @default 1 */\n rows: { type: Number, default: 1 },\n /** Controls what characters will count towards creating a new tag. @default [\",\", \" \"] */\n delimiters: { type: Array as PropType<string[]>, default: () => [\",\", \" \"] },\n /** Disables the tag input visually and from interactions */\n disabled: { type: Boolean, default: undefined },\n /** Fully-rounded container and chips, matching `Input pill` */\n pill: { type: Boolean, default: false },\n },\n emits: {\n \"update:value\": (tags: Tag[]) => { void tags; return true },\n \"change\": (tags: Tag[]) => { void tags; return true },\n },\n setup(props, { emit }) {\n // Shallow, like React state: emitted lists hold the caller's tag objects, not proxies\n const internalTags = shallowRef<Tag[]>(props.defaultValue)\n const value = computed(() => props.value ?? internalTags.value)\n const isControlled = computed(() => props.value !== undefined)\n const tags = computed(() => new Map(value.value.map((tag) => [tag.value, tag])))\n\n const currentInput = ref(\"\")\n const focused = ref(props.autoFocus)\n const selectedTag = ref<string | null>(null)\n const duplicateTags = ref(new Set<string>())\n\n const inputRef = ref<HTMLInputElement | null>(null)\n const containerRef = ref<HTMLDivElement | null>(null)\n let pendingRemovalFocus: { tag: string; source: HTMLElement } | null = null\n\n const showInput = computed(() => !props.maxTags || tags.value.size < props.maxTags)\n // A ghost has no frame: the hint stays after the first tag to show where to type.\n const placeholderText = computed(() =>\n tags.value.size === 0 || props.variant === \"ghost\" ? props.placeholder : undefined,\n )\n\n // Handle focusing the correct part of the tag input\n watch(\n [focused, selectedTag, showInput],\n () => {\n if (!focused.value || !containerRef.value) {\n return\n }\n const defaultFocusEl = inputRef.value ?? containerRef.value\n if (selectedTag.value === null) {\n defaultFocusEl.focus()\n } else {\n const selectedTagElement = containerRef.value.querySelector(\n `[data-tag=\"${CSS.escape(selectedTag.value)}\"]`,\n ) as HTMLElement | null\n if (selectedTagElement) {\n selectedTagElement.focus()\n } else {\n defaultFocusEl.focus()\n }\n }\n },\n { flush: \"post\" },\n )\n\n // Restore only after the controlled/uncontrolled list actually removes the\n // focused chip, without stealing focus from another control.\n watch(tags, () => {\n const pending = pendingRemovalFocus\n if (!pending || tags.value.has(pending.tag)) return\n pendingRemovalFocus = null\n const doc = pending.source.ownerDocument\n if (doc.activeElement !== doc.body && !pending.source.contains(doc.activeElement)) return\n ;(inputRef.value ?? containerRef.value)?.focus({ preventScroll: true })\n }, { flush: \"post\" })\n\n // A touch drag need not blur or emit mousedown. Cancel restoration only.\n let stopTrackingRemovalPointer: (() => void) | undefined\n onMounted(() => {\n const doc = containerRef.value?.ownerDocument\n if (!doc) return\n const cancelAfterPointer = (event: Event) => {\n if (pendingRemovalFocus && event.target instanceof Node && !pendingRemovalFocus.source.contains(event.target)) {\n pendingRemovalFocus = null\n }\n }\n doc.addEventListener(\"pointerdown\", cancelAfterPointer, true)\n stopTrackingRemovalPointer = () => doc.removeEventListener(\"pointerdown\", cancelAfterPointer, true)\n })\n onBeforeUnmount(() => stopTrackingRemovalPointer?.())\n\n // The field takes the width of its text (or hint) from the hidden copy beside it, in CSS (see the React source)\n\n const setTags = (newTags: Tag[]) => {\n emit(\"update:value\", newTags)\n emit(\"change\", newTags)\n if (!isControlled.value) {\n internalTags.value = newTags\n }\n }\n\n // Adds every value in one update: a paste of \"a,b\" must not compute\n // each addition from the same stale `tags` snapshot.\n const addTags = (tagValues: string[]) => {\n const next = new Map(tags.value)\n let changed = false\n for (const tagValue of tagValues) {\n if (props.maxTags && next.size >= props.maxTags) {\n break\n }\n const trimmed = tagValue.trim()\n if (!trimmed) {\n continue\n }\n if (next.has(trimmed)) {\n duplicateTags.value = new Set(duplicateTags.value).add(trimmed)\n setTimeout(() => {\n const remaining = new Set(duplicateTags.value)\n remaining.delete(trimmed)\n duplicateTags.value = remaining\n }, SHAKE_ANIMATION_DURATION_MS)\n continue\n }\n const validTag = props.validator?.(trimmed) ?? true\n next.set(trimmed, { value: trimmed, valid: validTag })\n changed = true\n }\n if (!changed) {\n return\n }\n setTags(Array.from(next.values()))\n }\n\n const addTag = (tagValue: string) => addTags([tagValue])\n\n const removeTag = (tag: string) => {\n if (props.disabled) {\n return\n }\n const source = containerRef.value?.querySelector<HTMLElement>(`[data-tag=\"${CSS.escape(tag)}\"]`)\n if (source?.contains(source.ownerDocument.activeElement)) pendingRemovalFocus = { tag, source }\n const next = new Map(tags.value)\n next.delete(tag)\n setTags(Array.from(next.values()))\n }\n\n const selectPreviousTag = () => {\n if (tags.value.size === 0) {\n return\n }\n const tagList = Array.from(tags.value.keys())\n if (selectedTag.value === null) {\n selectedTag.value = tagList[tagList.length - 1]!\n } else {\n const prevIndex = tagList.indexOf(selectedTag.value)\n selectedTag.value = tagList[Math.max(0, prevIndex - 1)]!\n }\n }\n\n const selectNextTag = () => {\n if (selectedTag.value === null) {\n return\n }\n const tagList = Array.from(tags.value.keys())\n const index = tagList.indexOf(selectedTag.value) + 1\n selectedTag.value = index < tagList.length ? tagList[index]! : null\n }\n\n const isEmptyStartingSelection = () => {\n const input = inputRef.value\n if (!input) {\n return true\n }\n return input.selectionStart === 0 && input.selectionEnd === 0\n }\n\n const handleContainerBlur = () => {\n pendingRemovalFocus = null\n focused.value = false\n selectedTag.value = null\n // A disabled tag input keeps the pending text instead of committing it\n if (currentInput.value && !props.disabled) {\n addTag(currentInput.value)\n currentInput.value = \"\"\n }\n }\n\n const handleContainerKeyDown = (e: KeyboardEvent) => {\n // IME candidate navigation belongs to the input, including Safari's 229 key.\n if (e.isComposing || e.keyCode === 229) return\n // A tag can keep focus while the input turns disabled: no selecting or removing then\n if (props.disabled) {\n return\n }\n if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") {\n if (isEmptyStartingSelection()) {\n e.preventDefault()\n selectPreviousTag()\n }\n } else if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") {\n if (selectedTag.value !== null) {\n e.preventDefault()\n selectNextTag()\n }\n } else if (e.key === \"Backspace\") {\n if (selectedTag.value !== null) {\n removeTag(selectedTag.value)\n } else if (isEmptyStartingSelection()) {\n selectPreviousTag()\n }\n }\n }\n\n const handleInputKeyDown = (e: KeyboardEvent) => {\n // Confirming an IME candidate must not commit or clear the pre-edit buffer.\n if (e.isComposing || e.keyCode === 229) return\n if (e.key === \"Enter\" || props.delimiters.includes(e.key)) {\n e.preventDefault()\n if (currentInput.value) {\n addTag(currentInput.value)\n currentInput.value = \"\"\n }\n } else if (e.key === \"Tab\") {\n if (currentInput.value) {\n e.preventDefault()\n addTag(currentInput.value)\n currentInput.value = \"\"\n }\n }\n }\n\n const handlePaste = (e: ClipboardEvent) => {\n const text = e.clipboardData?.getData(\"Text\") ?? \"\"\n let parts = [text]\n\n // Split by all delimiters\n for (const delimiter of props.delimiters) {\n const newParts: string[] = []\n for (const segment of parts) {\n newParts.push(...segment.split(delimiter))\n }\n parts = newParts\n }\n\n // Remove empty parts\n parts = parts.filter(Boolean)\n\n if (parts.length > 1) {\n e.preventDefault()\n addTags(parts)\n }\n }\n\n const handleContainerMouseDown = (e: MouseEvent) => {\n // All clicks in the container focus the container\n focused.value = true\n\n // If the click is on a tag pill, the tag's click handler focuses it\n if (e.target && e.target instanceof Element && e.target.closest(\"[data-tag]\")) {\n return\n }\n\n // Since we know we didn't click a tag, clear any selected tag\n selectedTag.value = null\n\n // If this click is outside of the input, prevent it from \"stealing\" focus from the input\n const input = inputRef.value\n if (e.target && e.target instanceof Element && input && !input.contains(e.target)) {\n e.preventDefault()\n\n const { left, right, top, bottom } = input.getBoundingClientRect()\n const { clientX, clientY } = e\n\n // If this is the first click, clear the selection. Otherwise, select the input contents\n if (e.detail === 1) {\n if (clientY < top || clientX < left) {\n // \"Before\" the input: top/left\n input.setSelectionRange(0, 0)\n } else if (clientY > bottom || clientX > right) {\n // \"After\" the input: bottom/right\n const length = input.value.length\n input.setSelectionRange(length, length)\n }\n } else {\n input.select()\n }\n }\n }\n\n const handleFocus = (e: FocusEvent) => {\n // If the focus is on a tag pill, the click handler for the tag handles it\n if (e.target && e.target instanceof Element && e.target.closest(\"[data-tag]\")) {\n return\n }\n focused.value = true\n selectedTag.value = null\n }\n\n const handleBlur = (e: FocusEvent) => {\n // If there is no related target, don't remove focus (clicks inside the container)\n if (!e.relatedTarget || !(e.relatedTarget instanceof Node)) {\n return\n }\n // Don't clear focus if focus is only moved elsewhere within the container\n if (containerRef.value && containerRef.value.contains(e.relatedTarget)) {\n // If we just tabbed into the input, clear the selected tag\n if (inputRef.value && inputRef.value.contains(e.relatedTarget)) {\n selectedTag.value = null\n }\n return\n }\n handleContainerBlur()\n }\n\n // usehooks-ts' useOnClickOutside: mousedown outside the container\n const handleDocumentMouseDown = (e: MouseEvent) => {\n const container = containerRef.value\n if (!container || !(e.target instanceof Node) || container.contains(e.target)) return\n handleContainerBlur()\n }\n onMounted(() => document.addEventListener(\"mousedown\", handleDocumentMouseDown))\n onBeforeUnmount(() => {\n document.removeEventListener(\"mousedown\", handleDocumentMouseDown)\n })\n\n // Focus on mount when requested, like React's initial `focused` state\n onMounted(() => {\n if (focused.value) void nextTick(() => (inputRef.value ?? containerRef.value)?.focus())\n })\n\n return () => [\n h(\n \"div\",\n {\n \"class\": s.Container,\n \"ref\": containerRef,\n \"onKeydown\": handleContainerKeyDown,\n \"onMousedown\": handleContainerMouseDown,\n \"onFocusin\": handleFocus,\n \"onFocusout\": handleBlur,\n \"data-size\": props.size,\n \"data-variant\": props.variant,\n \"data-focused\": focused.value ? \"\" : undefined,\n \"data-empty\": tags.value.size === 0 ? \"\" : undefined,\n \"data-pill\": props.pill ? \"\" : undefined,\n // At maxTags the input is gone, so the container becomes the tab stop;\n // arrow keys and Backspace then select and remove tags from here\n \"tabindex\": showInput.value || props.disabled ? -1 : 0,\n \"style\": toCssVariables({ \"min-rows\": String(props.rows) }),\n \"data-disabled\": props.disabled ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.TagInput }, [\n ...Array.from(tags.value.values()).map((tag) =>\n h(\n \"div\",\n {\n \"key\": tag.value,\n \"class\": s.Tag,\n \"tabindex\": -1,\n \"onClick\": () => (selectedTag.value = tag.value),\n \"data-tag\": tag.value,\n \"data-invalid\": !tag.valid ? \"\" : undefined,\n \"data-duplicate\": duplicateTags.value.has(tag.value) ? \"\" : undefined,\n },\n [\n h(\"span\", { class: \"overflow-hidden text-ellipsis\", title: tag.value }, [\n h(\"span\", { class: s.TagValue }, tag.value),\n ]),\n h(\n \"button\",\n {\n \"type\": \"button\", \"class\": s.TagRemove, \"disabled\": props.disabled,\n \"onClick\": (event: MouseEvent) => { event.stopPropagation(); removeTag(tag.value) },\n \"aria-label\": `Remove ${tag.value}`,\n },\n [h(X)],\n ),\n ],\n ),\n ),\n showInput.value\n ? h(\"div\", { class: s.InputContainer }, [\n // A hidden copy of the text gives the field its width\n h(\"span\", { class: s.InputMeasure, \"aria-hidden\": \"true\" }, currentInput.value || placeholderText.value || \"\"),\n h(\"div\", { class: s.InputWrapper }, [\n h(\"input\", {\n id: props.id,\n class: s.Input,\n ref: inputRef,\n value: currentInput.value,\n onInput: (e: Event) => (currentInput.value = (e.target as HTMLInputElement).value),\n onPaste: handlePaste,\n onKeydown: handleInputKeyDown,\n placeholder: placeholderText.value,\n disabled: props.disabled,\n }),\n ]),\n ])\n : null,\n ]),\n ],\n ),\n // 0 means no limit, as for the input above: no counter\n props.maxTags\n ? h(\"div\", { class: s.Limit }, [String(tags.value.size), h(\"span\", { class: \"mx-px\" }, \"/\"), String(props.maxTags)])\n : null,\n ]\n },\n})\n\nexport type TagInputProps = InstanceType<typeof TagInput>[\"$props\"]\n"]}
@@ -151,6 +151,7 @@ const TextareaComponent = defineComponent({
151
151
  "data-disabled": disabled ? "" : undefined,
152
152
  "data-readonly": readOnly ? "" : undefined,
153
153
  "data-invalid": invalid ? "" : undefined,
154
+ "data-auto-resize": props.autoResize ? "" : undefined,
154
155
  "style": toCssVariables({
155
156
  "textarea-min-rows": `${rows}`,
156
157
  "textarea-max-rows": `${computedMaxRows.value}`,
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Textarea/Textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,QAAQ,EACR,SAAS,EACT,eAAe,EACf,GAAG,EACH,KAAK,EACL,KAAK,EACL,cAAc,GAGf,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAmBtE,MAAM,MAAM,GAAG,CAAC,OAAgB,EAAE,KAAY,EAAE,EAAE;IAChD,KAAK,MAAM,EAAE,IAAK,EAAgB,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QACzD,IAAI,OAAO,EAAE,KAAK,UAAU;YAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,uDAAuD;QACvD,OAAO,EAAE,EAAE,IAAI,EAAE,MAA0D,EAAE,OAAO,EAAE,SAAS,EAAE;QACjG,uDAAuD;QACvD,IAAI,EAAE,EAAE,IAAI,EAAE,MAA+B,EAAE,OAAO,EAAE,IAAI,EAAE;QAC9D,+GAA+G;QAC/G,cAAc,EAAE,MAAmC;QACnD,mFAAmF;QACnF,UAAU,EAAE,MAAmE;QAC/E,2EAA2E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C,YAAY;oBAC5D,mFAAmF;oBACnF,cAAc,EAAE,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC;oBACnE,UAAU,EAAE,QAAQ;oBACpB,UAAU,EAAE,QAAQ;oBACpB,MAAM,EAAE,IAAI;oBACZ,SAAS,EAAE,CAAC,GAAU,EAAE,EAAE;wBACxB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAA;wBACpB,MAAM,CAAC,OAAwB,EAAE,GAAG,CAAC,CAAA;oBACvC,CAAC;oBACD,QAAQ,EAAE,CAAC,GAAU,EAAE,EAAE;wBACvB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;wBACrB,MAAM,CAAC,MAAuB,EAAE,GAAG,CAAC,CAAA;oBACtC,CAAC;oBACD,kBAAkB,EAAE,CAAC,GAAmB,EAAE,EAAE;wBAC1C,MAAM,CAAC,gBAAiC,EAAE,GAAG,CAAC,CAAA;wBAC9C,IAAI,GAAG,CAAC,aAAa,KAAK,oBAAoB,EAAE,CAAC;4BAC/C,IAAI,CAAC,UAAU,CAAC,CAAA;wBAClB,CAAC;oBACH,CAAC;oBACD,gDAAgD;oBAChD,eAAe,EAAE,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;oBAC3D,gBAAgB,EAAE,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;oBAC5D,aAAa,EAAE,WAAW;iBAC3B,CAAC,EACF,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAC7B;aACF,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAqF,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n nextTick,\n onMounted,\n onBeforeUnmount,\n ref,\n useId,\n watch,\n withDirectives,\n type PropType,\n type TextareaHTMLAttributes,\n} from \"vue\"\nimport type { ControlSize, Sizes, Variants } from \"@plexui/styles/types\"\nimport { vServerText } from \"../../lib/defaultValue.js\"\nimport { toCssVariables } from \"../../lib/helpers.js\"\nimport { observeTextareaWidth } from \"../../lib/observeTextareaWidth.js\"\nimport s from \"@plexui/styles/components/Textarea/Textarea.module.css\"\n\n// Vue port of packages/ui/src/components/Textarea/Textarea.tsx. Props,\n// defaults and rendered DOM match React 1:1 (checked by the parity tests).\n//\n// - `class` goes to the container; every other attribute and listener\n// (`style`, `placeholder`, `@input`, `@change`, ...) goes to the <textarea>,\n// like React's `className` and `...restProps`.\n// - Value: `value` + `update:value` mirror React's `value` prop\n// (`v-model:value`) and fire on every input. Uncontrolled use takes\n// `default-value`. Like a React controlled textarea, a `value` the parent\n// does not update after input is put back.\n// - As in React, the textarea's text content (its `defaultValue`) follows\n// the controlled value, or `default-value` when uncontrolled. It is set\n// through the `textContent` property, which Vue's server renderer prints\n// as the element's content, so `vServerText` can adjust it at SSR.\n\ntype ListenerValue = ((event: Event) => void) | Array<(event: Event) => void> | undefined\n\nconst invoke = (handler: unknown, event: Event) => {\n for (const fn of ([] as unknown[]).concat(handler ?? [])) {\n if (typeof fn === \"function\") fn(event)\n }\n}\n\nconst TextareaComponent = defineComponent({\n name: \"Textarea\",\n inheritAttrs: false,\n props: {\n /** Visual style of the textarea. @default \"outline\" */\n variant: { type: String as PropType<Variants<\"outline\" | \"soft\" | \"ghost\">>, default: \"outline\" },\n /** Controls the size of the textarea. @default \"md\" */\n size: { type: String as PropType<ControlSize>, default: \"md\" },\n /** Applies a negative margin using the current gutter to optically align the text with surrounding content. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n /** Controls gutter on the edges of the textarea, defaults to value from `size`. */\n gutterSize: String as PropType<Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">>,\n /** Disables the textarea visually and from interactions. @default false */\n disabled: { type: Boolean, default: false },\n /** Makes the textarea read-only. @default false */\n readOnly: { type: Boolean, default: false },\n /** Native spelling of `readOnly` (`<Textarea readonly />`). @default false */\n readonly: { type: Boolean, default: false },\n /** Mark the textarea as invalid. @default false */\n invalid: { type: Boolean, default: false },\n /** Allow autofill extensions to appear in the textarea. @default `true` when `name` is set, else `false` */\n allowAutofillExtensions: { type: Boolean, default: undefined },\n /** Select all contents of the textarea when mounted (and whenever it turns `true`). @default false */\n autoSelect: { type: Boolean, default: undefined },\n /** Default number of rows to display. @default 3 */\n rows: { type: Number, default: 3 },\n /** Automatically adjust the height of the textarea based on its contents. @default false */\n autoResize: { type: Boolean, default: undefined },\n /** Maximum number of rows that can be displayed when autoResize is enabled. @default Math.max(rows, 10) */\n maxRows: Number,\n id: String,\n name: String,\n /** Controlled value (`v-model:value`) */\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n /** Initial value when uncontrolled */\n defaultValue: { type: [String, Number] as PropType<string | number>, default: undefined },\n /** The textarea's `autocomplete` attribute */\n autoComplete: String,\n },\n emits: {\n \"update:value\": (value: string) => typeof value === \"string\",\n /** Fired when the browser autofills the textarea */\n \"autofill\": () => true,\n },\n setup(props, { attrs, emit, expose }) {\n const textAreaRef = ref<HTMLTextAreaElement | null>(null)\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${useId()}`\n const focused = ref(false)\n\n const computedMaxRows = computed(() =>\n props.autoResize ? Math.max(props.maxRows ?? 10, props.rows) : props.rows,\n )\n const controlledValue = () => props.value\n\n const runAutoSelect = () => {\n if (props.autoSelect) {\n textAreaRef.value?.select()\n }\n }\n\n const autosizeTextarea = () => {\n const textarea = textAreaRef.value\n if (!props.autoResize || !textarea || computedMaxRows.value === undefined) return\n textarea.style.height = \"0px\"\n const scrollHeight = textarea.scrollHeight\n textarea.style.height = scrollHeight + \"px\"\n }\n\n let stopObservingWidth: (() => void) | undefined\n const observeWidth = () => {\n stopObservingWidth?.()\n stopObservingWidth = props.autoResize && textAreaRef.value\n ? observeTextareaWidth(textAreaRef.value, autosizeTextarea)\n : undefined\n }\n watch(() => props.autoResize, observeWidth, { flush: \"post\" })\n onBeforeUnmount(() => stopObservingWidth?.())\n\n // The textarea's value is set imperatively, like React DOM does: a `value`\n // prop would make Vue mirror it into a `value` attribute, which React\n // never renders. Puts the controlled value back when it differs.\n const syncValue = () => {\n const textarea = textAreaRef.value\n const value = controlledValue()\n if (!textarea || value == null) return\n const nextValue = String(value)\n if (textarea.value !== nextValue) textarea.value = nextValue\n }\n\n // React runs these effects after mount and when their dependencies change\n onMounted(() => {\n const textarea = textAreaRef.value\n // React's initTextarea: the initial text becomes the (dirty) value\n const initialValue = textarea?.textContent ?? \"\"\n if (textarea && initialValue !== \"\") textarea.value = initialValue\n runAutoSelect()\n autosizeTextarea()\n observeWidth()\n })\n // React DOM writes a new value while committing, before any effect runs,\n // so the selection covers the value that arrives with `autoSelect`\n watch(\n () => props.autoSelect,\n () => {\n syncValue()\n runAutoSelect()\n },\n { flush: \"post\" },\n )\n // Resize if value changes outside of user input - e.g. form reset\n watch(\n () => [controlledValue(), props.rows, props.autoResize, computedMaxRows.value],\n () => {\n syncValue()\n autosizeTextarea()\n },\n { flush: \"post\" },\n )\n\n const handleInput = (evt: Event) => {\n const next = (evt.target as HTMLTextAreaElement).value\n emit(\"update:value\", next)\n autosizeTextarea()\n // A controlled value the parent did not update wins over the typed text,\n // as in React\n void nextTick(syncValue)\n }\n\n expose({\n /** The rendered <textarea> element */\n textarea: textAreaRef,\n focus: () => textAreaRef.value?.focus(),\n })\n\n return () => {\n const {\n class: className,\n onInput,\n onFocus,\n onBlur,\n onAnimationstart,\n ...restAttrs\n } = attrs as Record<string, unknown>\n\n const { variant, size, gutterSize, disabled, invalid, rows } = props\n const readOnly = props.readOnly || props.readonly\n // Default to `true` when presence of `name`\n const allowAutofillExtensions = props.allowAutofillExtensions ?? !!props.name\n const value = controlledValue()\n // React keeps the textarea's defaultValue (its text content) in sync with\n // the controlled value, else with `defaultValue`\n const textContent = String(value ?? props.defaultValue ?? \"\")\n\n return h(\n \"div\",\n {\n \"class\": [s.Container, className],\n \"data-slot\": \"textarea\",\n \"data-variant\": variant,\n \"data-size\": size,\n \"data-gutter-size\": gutterSize,\n \"data-optically-align\": props.opticallyAlign,\n \"data-focused\": String(focused.value),\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-readonly\": readOnly ? \"\" : undefined,\n \"data-invalid\": invalid ? \"\" : undefined,\n \"style\": toCssVariables({\n \"textarea-min-rows\": `${rows}`,\n \"textarea-max-rows\": `${computedMaxRows.value}`,\n }),\n },\n [\n withDirectives(\n h(\"textarea\", {\n ...restAttrs,\n \"onInput\": (evt: Event) => {\n invoke(onInput as ListenerValue, evt)\n handleInput(evt)\n },\n \"ref\": textAreaRef,\n \"id\": props.id || (allowAutofillExtensions ? undefined : onePasswordPreventionId),\n \"class\": s.Textarea,\n \"name\": props.name,\n \"autocomplete\": props.autoComplete ?? restAttrs.autocomplete,\n // Expose the visual invalid state to assistive tech; an explicit aria-invalid wins\n \"aria-invalid\": restAttrs[\"aria-invalid\"] ?? (invalid || undefined),\n \"readonly\": readOnly,\n \"disabled\": disabled,\n \"rows\": rows,\n \"onFocus\": (evt: Event) => {\n focused.value = true\n invoke(onFocus as ListenerValue, evt)\n },\n \"onBlur\": (evt: Event) => {\n focused.value = false\n invoke(onBlur as ListenerValue, evt)\n },\n \"onAnimationstart\": (evt: AnimationEvent) => {\n invoke(onAnimationstart as ListenerValue, evt)\n if (evt.animationName === \"native-autofill-in\") {\n emit(\"autofill\")\n }\n },\n // Prevent LastPass and 1Password from appearing\n \"data-lpignore\": allowAutofillExtensions ? undefined : true,\n \"data-1p-ignore\": allowAutofillExtensions ? undefined : true,\n \"textContent\": textContent,\n }),\n [[vServerText, textContent]],\n ),\n ],\n )\n }\n },\n})\n\ntype TextareaOwnProps = InstanceType<typeof TextareaComponent>[\"$props\"]\n\n/** Textarea props plus the native <textarea> attributes that fall through to it, as in React. */\nexport type TextareaProps = TextareaOwnProps & Omit<TextareaHTMLAttributes, keyof TextareaOwnProps | \"readonly\">\n\nexport const Textarea = TextareaComponent as typeof TextareaComponent & { new (): { $props: TextareaProps } }\n"]}
1
+ {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Textarea/Textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,QAAQ,EACR,SAAS,EACT,eAAe,EACf,GAAG,EACH,KAAK,EACL,KAAK,EACL,cAAc,GAGf,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAmBtE,MAAM,MAAM,GAAG,CAAC,OAAgB,EAAE,KAAY,EAAE,EAAE;IAChD,KAAK,MAAM,EAAE,IAAK,EAAgB,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QACzD,IAAI,OAAO,EAAE,KAAK,UAAU;YAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,uDAAuD;QACvD,OAAO,EAAE,EAAE,IAAI,EAAE,MAA0D,EAAE,OAAO,EAAE,SAAS,EAAE;QACjG,uDAAuD;QACvD,IAAI,EAAE,EAAE,IAAI,EAAE,MAA+B,EAAE,OAAO,EAAE,IAAI,EAAE;QAC9D,+GAA+G;QAC/G,cAAc,EAAE,MAAmC;QACnD,mFAAmF;QACnF,UAAU,EAAE,MAAmE;QAC/E,2EAA2E;QAC3E,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3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AS,CAAC,YAAY;oBAC5D,mFAAmF;oBACnF,cAAc,EAAE,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC;oBACnE,UAAU,EAAE,QAAQ;oBACpB,UAAU,EAAE,QAAQ;oBACpB,MAAM,EAAE,IAAI;oBACZ,SAAS,EAAE,CAAC,GAAU,EAAE,EAAE;wBACxB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAA;wBACpB,MAAM,CAAC,OAAwB,EAAE,GAAG,CAAC,CAAA;oBACvC,CAAC;oBACD,QAAQ,EAAE,CAAC,GAAU,EAAE,EAAE;wBACvB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;wBACrB,MAAM,CAAC,MAAuB,EAAE,GAAG,CAAC,CAAA;oBACtC,CAAC;oBACD,kBAAkB,EAAE,CAAC,GAAmB,EAAE,EAAE;wBAC1C,MAAM,CAAC,gBAAiC,EAAE,GAAG,CAAC,CAAA;wBAC9C,IAAI,GAAG,CAAC,aAAa,KAAK,oBAAoB,EAAE,CAAC;4BAC/C,IAAI,CAAC,UAAU,CAAC,CAAA;wBAClB,CAAC;oBACH,CAAC;oBACD,gDAAgD;oBAChD,eAAe,EAAE,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;oBAC3D,gBAAgB,EAAE,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;oBAC5D,aAAa,EAAE,WAAW;iBAC3B,CAAC,EACF,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAC7B;aACF,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAqF,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n nextTick,\n onMounted,\n onBeforeUnmount,\n ref,\n useId,\n watch,\n withDirectives,\n type PropType,\n type TextareaHTMLAttributes,\n} from \"vue\"\nimport type { ControlSize, Sizes, Variants } from \"@plexui/styles/types\"\nimport { vServerText } from \"../../lib/defaultValue.js\"\nimport { toCssVariables } from \"../../lib/helpers.js\"\nimport { observeTextareaWidth } from \"../../lib/observeTextareaWidth.js\"\nimport s from \"@plexui/styles/components/Textarea/Textarea.module.css\"\n\n// Vue port of packages/ui/src/components/Textarea/Textarea.tsx. Props,\n// defaults and rendered DOM match React 1:1 (checked by the parity tests).\n//\n// - `class` goes to the container; every other attribute and listener\n// (`style`, `placeholder`, `@input`, `@change`, ...) goes to the <textarea>,\n// like React's `className` and `...restProps`.\n// - Value: `value` + `update:value` mirror React's `value` prop\n// (`v-model:value`) and fire on every input. Uncontrolled use takes\n// `default-value`. Like a React controlled textarea, a `value` the parent\n// does not update after input is put back.\n// - As in React, the textarea's text content (its `defaultValue`) follows\n// the controlled value, or `default-value` when uncontrolled. It is set\n// through the `textContent` property, which Vue's server renderer prints\n// as the element's content, so `vServerText` can adjust it at SSR.\n\ntype ListenerValue = ((event: Event) => void) | Array<(event: Event) => void> | undefined\n\nconst invoke = (handler: unknown, event: Event) => {\n for (const fn of ([] as unknown[]).concat(handler ?? [])) {\n if (typeof fn === \"function\") fn(event)\n }\n}\n\nconst TextareaComponent = defineComponent({\n name: \"Textarea\",\n inheritAttrs: false,\n props: {\n /** Visual style of the textarea. @default \"outline\" */\n variant: { type: String as PropType<Variants<\"outline\" | \"soft\" | \"ghost\">>, default: \"outline\" },\n /** Controls the size of the textarea. @default \"md\" */\n size: { type: String as PropType<ControlSize>, default: \"md\" },\n /** Applies a negative margin using the current gutter to optically align the text with surrounding content. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n /** Controls gutter on the edges of the textarea, defaults to value from `size`. */\n gutterSize: String as PropType<Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">>,\n /** Disables the textarea visually and from interactions. @default false */\n disabled: { type: Boolean, default: false },\n /** Makes the textarea read-only. @default false */\n readOnly: { type: Boolean, default: false },\n /** Native spelling of `readOnly` (`<Textarea readonly />`). @default false */\n readonly: { type: Boolean, default: false },\n /** Mark the textarea as invalid. @default false */\n invalid: { type: Boolean, default: false },\n /** Allow autofill extensions to appear in the textarea. @default `true` when `name` is set, else `false` */\n allowAutofillExtensions: { type: Boolean, default: undefined },\n /** Select all contents of the textarea when mounted (and whenever it turns `true`). @default false */\n autoSelect: { type: Boolean, default: undefined },\n /** Default number of rows to display. @default 3 */\n rows: { type: Number, default: 3 },\n /** Automatically adjust the height of the textarea based on its contents. @default false */\n autoResize: { type: Boolean, default: undefined },\n /** Maximum number of rows that can be displayed when autoResize is enabled. @default Math.max(rows, 10) */\n maxRows: Number,\n id: String,\n name: String,\n /** Controlled value (`v-model:value`) */\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n /** Initial value when uncontrolled */\n defaultValue: { type: [String, Number] as PropType<string | number>, default: undefined },\n /** The textarea's `autocomplete` attribute */\n autoComplete: String,\n },\n emits: {\n \"update:value\": (value: string) => typeof value === \"string\",\n /** Fired when the browser autofills the textarea */\n \"autofill\": () => true,\n },\n setup(props, { attrs, emit, expose }) {\n const textAreaRef = ref<HTMLTextAreaElement | null>(null)\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${useId()}`\n const focused = ref(false)\n\n const computedMaxRows = computed(() =>\n props.autoResize ? Math.max(props.maxRows ?? 10, props.rows) : props.rows,\n )\n const controlledValue = () => props.value\n\n const runAutoSelect = () => {\n if (props.autoSelect) {\n textAreaRef.value?.select()\n }\n }\n\n const autosizeTextarea = () => {\n const textarea = textAreaRef.value\n if (!props.autoResize || !textarea || computedMaxRows.value === undefined) return\n textarea.style.height = \"0px\"\n const scrollHeight = textarea.scrollHeight\n textarea.style.height = scrollHeight + \"px\"\n }\n\n let stopObservingWidth: (() => void) | undefined\n const observeWidth = () => {\n stopObservingWidth?.()\n stopObservingWidth = props.autoResize && textAreaRef.value\n ? observeTextareaWidth(textAreaRef.value, autosizeTextarea)\n : undefined\n }\n watch(() => props.autoResize, observeWidth, { flush: \"post\" })\n onBeforeUnmount(() => stopObservingWidth?.())\n\n // The textarea's value is set imperatively, like React DOM does: a `value`\n // prop would make Vue mirror it into a `value` attribute, which React\n // never renders. Puts the controlled value back when it differs.\n const syncValue = () => {\n const textarea = textAreaRef.value\n const value = controlledValue()\n if (!textarea || value == null) return\n const nextValue = String(value)\n if (textarea.value !== nextValue) textarea.value = nextValue\n }\n\n // React runs these effects after mount and when their dependencies change\n onMounted(() => {\n const textarea = textAreaRef.value\n // React's initTextarea: the initial text becomes the (dirty) value\n const initialValue = textarea?.textContent ?? \"\"\n if (textarea && initialValue !== \"\") textarea.value = initialValue\n runAutoSelect()\n autosizeTextarea()\n observeWidth()\n })\n // React DOM writes a new value while committing, before any effect runs,\n // so the selection covers the value that arrives with `autoSelect`\n watch(\n () => props.autoSelect,\n () => {\n syncValue()\n runAutoSelect()\n },\n { flush: \"post\" },\n )\n // Resize if value changes outside of user input - e.g. form reset\n watch(\n () => [controlledValue(), props.rows, props.autoResize, computedMaxRows.value],\n () => {\n syncValue()\n autosizeTextarea()\n },\n { flush: \"post\" },\n )\n\n const handleInput = (evt: Event) => {\n const next = (evt.target as HTMLTextAreaElement).value\n emit(\"update:value\", next)\n autosizeTextarea()\n // A controlled value the parent did not update wins over the typed text,\n // as in React\n void nextTick(syncValue)\n }\n\n expose({\n /** The rendered <textarea> element */\n textarea: textAreaRef,\n focus: () => textAreaRef.value?.focus(),\n })\n\n return () => {\n const {\n class: className,\n onInput,\n onFocus,\n onBlur,\n onAnimationstart,\n ...restAttrs\n } = attrs as Record<string, unknown>\n\n const { variant, size, gutterSize, disabled, invalid, rows } = props\n const readOnly = props.readOnly || props.readonly\n // Default to `true` when presence of `name`\n const allowAutofillExtensions = props.allowAutofillExtensions ?? !!props.name\n const value = controlledValue()\n // React keeps the textarea's defaultValue (its text content) in sync with\n // the controlled value, else with `defaultValue`\n const textContent = String(value ?? props.defaultValue ?? \"\")\n\n return h(\n \"div\",\n {\n \"class\": [s.Container, className],\n \"data-slot\": \"textarea\",\n \"data-variant\": variant,\n \"data-size\": size,\n \"data-gutter-size\": gutterSize,\n \"data-optically-align\": props.opticallyAlign,\n \"data-focused\": String(focused.value),\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-readonly\": readOnly ? \"\" : undefined,\n \"data-invalid\": invalid ? \"\" : undefined,\n \"data-auto-resize\": props.autoResize ? \"\" : undefined,\n \"style\": toCssVariables({\n \"textarea-min-rows\": `${rows}`,\n \"textarea-max-rows\": `${computedMaxRows.value}`,\n }),\n },\n [\n withDirectives(\n h(\"textarea\", {\n ...restAttrs,\n \"onInput\": (evt: Event) => {\n invoke(onInput as ListenerValue, evt)\n handleInput(evt)\n },\n \"ref\": textAreaRef,\n \"id\": props.id || (allowAutofillExtensions ? undefined : onePasswordPreventionId),\n \"class\": s.Textarea,\n \"name\": props.name,\n \"autocomplete\": props.autoComplete ?? restAttrs.autocomplete,\n // Expose the visual invalid state to assistive tech; an explicit aria-invalid wins\n \"aria-invalid\": restAttrs[\"aria-invalid\"] ?? (invalid || undefined),\n \"readonly\": readOnly,\n \"disabled\": disabled,\n \"rows\": rows,\n \"onFocus\": (evt: Event) => {\n focused.value = true\n invoke(onFocus as ListenerValue, evt)\n },\n \"onBlur\": (evt: Event) => {\n focused.value = false\n invoke(onBlur as ListenerValue, evt)\n },\n \"onAnimationstart\": (evt: AnimationEvent) => {\n invoke(onAnimationstart as ListenerValue, evt)\n if (evt.animationName === \"native-autofill-in\") {\n emit(\"autofill\")\n }\n },\n // Prevent LastPass and 1Password from appearing\n \"data-lpignore\": allowAutofillExtensions ? undefined : true,\n \"data-1p-ignore\": allowAutofillExtensions ? undefined : true,\n \"textContent\": textContent,\n }),\n [[vServerText, textContent]],\n ),\n ],\n )\n }\n },\n})\n\ntype TextareaOwnProps = InstanceType<typeof TextareaComponent>[\"$props\"]\n\n/** Textarea props plus the native <textarea> attributes that fall through to it, as in React. */\nexport type TextareaProps = TextareaOwnProps & Omit<TextareaHTMLAttributes, keyof TextareaOwnProps | \"readonly\">\n\nexport const Textarea = TextareaComponent as typeof TextareaComponent & { new (): { $props: TextareaProps } }\n"]}
@@ -0,0 +1,276 @@
1
+ import clsx from "clsx";
2
+ import { computed, createCommentVNode, defineComponent, h, inject, markRaw, onBeforeUnmount, provide, ref, watch, } from "vue";
3
+ import { PopoverAnchor as RekaPopoverAnchor, PopoverArrow as RekaPopoverArrow, PopoverContent as RekaPopoverContent, PopoverPortal as RekaPopoverPortal, PopoverRoot as RekaPopoverRoot, useId, } from "reka-ui";
4
+ import s from "@plexui/styles/components/Tip/Tip.module.css";
5
+ import { useEscCloseStack } from "../../composables/useEscCloseStack.js";
6
+ import { preventDefaultHandler } from "../../lib/helpers.js";
7
+ import { hasContent } from "../../lib/slotContent.js";
8
+ import { Button } from "../Button/index.js";
9
+ import { X } from "../Icon/index.js";
10
+ import { useDeferredPointerDownOutside } from "../Popover/deferredPointerDownOutside.js";
11
+ import { TransitionGroup } from "../Transition/index.js";
12
+ import { overlayTiming } from "../Transition/shared.js";
13
+ // The tip itself, the same DOM as React's: the symbol, the title over the description, the actions, Close
14
+ const renderBody = (options, slots) => {
15
+ const title = slots.title ? slots.title() : options.title;
16
+ const description = slots.description ? slots.description() : options.description;
17
+ const icon = slots.icon?.();
18
+ const actions = slots.actions?.();
19
+ const hasDescription = hasContent([description]);
20
+ return h("div", {
21
+ "class": clsx(s.Tip, options.className),
22
+ "role": options.role,
23
+ "aria-labelledby": options.role ? options.titleId : undefined,
24
+ "data-arrow-edge": options.arrowEdge,
25
+ "data-mobile-actions": options.mobileActions === "buttons" ? options.mobileActions : undefined,
26
+ }, [
27
+ hasContent(icon) ? h("div", { class: s.Icon }, icon) : null,
28
+ h("div", { class: s.Message }, [
29
+ h("div", { class: s.Title, id: options.titleId }, [title]),
30
+ hasDescription ? h("div", { class: s.Description, id: options.descriptionId }, [description]) : null,
31
+ ]),
32
+ hasContent(actions) ? h("div", { class: s.Actions }, actions) : null,
33
+ options.onClose
34
+ ? h(Button, { "type": "button", "onClick": options.onClose, "color": "secondary", "variant": "soft", "uniform": true, "pill": true, "aria-label": "Close tip", "class": s.Close }, { default: () => [h(X)] })
35
+ : null,
36
+ ]);
37
+ };
38
+ // The ids that name and describe a popover tip
39
+ const TIP_POPOVER_LABELS = Symbol("TipPopoverLabels");
40
+ // The element Reka's content renders (`as`): Reka names its content after a trigger, and a tip has none, so the
41
+ // tip's title names it (and its description describes it) here. Raw: Reka passes `as` through reactive props.
42
+ const TipPopoverElement = markRaw(defineComponent({
43
+ name: "TipPopoverElement",
44
+ inheritAttrs: false,
45
+ setup(_props, { slots, attrs }) {
46
+ const labels = inject(TIP_POPOVER_LABELS);
47
+ return () => {
48
+ const rest = { ...attrs };
49
+ delete rest.dir;
50
+ delete rest.forceMount;
51
+ const { labelledBy, describedBy } = labels();
52
+ return h("div", { ...rest, "aria-labelledby": labelledBy, "aria-describedby": describedBy }, slots.default?.());
53
+ };
54
+ },
55
+ }));
56
+ const contentProps = {
57
+ /** The tip's title: what the feature is (or the `title` slot). */
58
+ title: String,
59
+ /** One or two sentences on how to use it (or the `description` slot). */
60
+ description: String,
61
+ /**
62
+ * How the actions show at 767px and below: rows of text under a separator, as iOS tips show them, or the buttons
63
+ * as given, each a full-width capsule under the message, as an iOS card that asks for a permission.
64
+ * @default "rows"
65
+ */
66
+ mobileActions: String,
67
+ };
68
+ const TipComponent = defineComponent({
69
+ name: "Tip",
70
+ inheritAttrs: false,
71
+ props: {
72
+ ...contentProps,
73
+ /** Shows the Close button; called when it is clicked. */
74
+ onClose: Function,
75
+ /** Draws an arrow at this edge, pointing at what the tip explains (TipKit's annotation). */
76
+ arrowEdge: String,
77
+ },
78
+ setup(props, { slots, attrs }) {
79
+ const id = useId(undefined, "plexui-tip");
80
+ return () => renderBody({
81
+ ...props,
82
+ className: attrs.class,
83
+ titleId: `${id}-title`,
84
+ descriptionId: `${id}-description`,
85
+ role: "note",
86
+ }, slots);
87
+ },
88
+ });
89
+ const TABBABLE = 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
90
+ // What Tab can reach: no focus guards, nothing hidden (checkVisibility where the browser has it)
91
+ const tabbables = (root) => [...root.querySelectorAll(TABBABLE)].filter((element) => element.tabIndex >= 0 &&
92
+ !element.closest("[hidden], [inert], [data-radix-focus-guard], [data-reka-focus-guard]") &&
93
+ (typeof element.checkVisibility !== "function" || element.checkVisibility({ visibilityProperty: true })));
94
+ // The first element Tab reaches after the control, outside the tip
95
+ const nextAfter = (control, tip) => tabbables(control.ownerDocument).find((element) => !tip.contains(element) &&
96
+ !control.contains(element) &&
97
+ !!(control.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING));
98
+ // Takes the Tab only when the focus moved
99
+ const focusInstead = (event, element) => {
100
+ if (!element)
101
+ return;
102
+ element.focus();
103
+ if (element.ownerDocument.activeElement === element)
104
+ event.preventDefault();
105
+ };
106
+ // A popover tip renders at the end of the page, but Tab reaches it as if it sat right after its control: from the
107
+ // control (or its last control) Tab moves into the tip, and Shift+Tab from what follows the control moves to the
108
+ // tip's last control. Listened for on the document, after the control's own handlers.
109
+ const tabIntoTip = (event, control, tip) => {
110
+ if (event.key !== "Tab" || event.defaultPrevented || !(event.target instanceof Node) || tip.contains(event.target))
111
+ return;
112
+ const items = tabbables(tip);
113
+ if (event.shiftKey) {
114
+ if (event.target === nextAfter(control, tip))
115
+ focusInstead(event, items.at(-1));
116
+ }
117
+ else if (event.target === (tabbables(control).at(-1) ?? control)) {
118
+ focusInstead(event, items[0]);
119
+ }
120
+ };
121
+ // Shift+Tab from the tip's first control returns to the control; Tab from its last moves on to what follows it
122
+ const tabOutOfTip = (event, control, tip) => {
123
+ if (event.key !== "Tab" || event.defaultPrevented)
124
+ return;
125
+ const items = tabbables(tip);
126
+ if (event.shiftKey) {
127
+ if (event.target === items[0])
128
+ focusInstead(event, tabbables(control).at(-1) ?? (control.tabIndex >= 0 ? control : undefined));
129
+ }
130
+ else if (event.target === items.at(-1)) {
131
+ focusInstead(event, nextAfter(control, tip));
132
+ }
133
+ };
134
+ /**
135
+ * A tip anchored to a control, after TipKit's popover tip. The default slot is the control; `icon`,
136
+ * `title`, `description` and `actions` slots fill the tip. It does not take the focus. Bind `v-model:open`.
137
+ */
138
+ export const TipPopover = defineComponent({
139
+ name: "TipPopover",
140
+ inheritAttrs: false,
141
+ props: {
142
+ ...contentProps,
143
+ /** Shows the tip (controlled, `v-model:open`). */
144
+ open: { type: Boolean, default: undefined },
145
+ /** Shows the tip at first (uncontrolled). @default false */
146
+ defaultOpen: { type: Boolean, default: false },
147
+ /** The side of the control the tip shows on. Turned when it does not fit. @default "bottom" */
148
+ side: { type: String, default: "bottom" },
149
+ /** The alignment against the control. @default "center" */
150
+ align: { type: String, default: "center" },
151
+ /** The distance from the control to the arrow's point, in pixels. @default 4 */
152
+ sideOffset: { type: Number, default: 4 },
153
+ /** Shows the Close button. @default true */
154
+ closeButton: { type: Boolean, default: true },
155
+ },
156
+ emits: {
157
+ /** Close, Escape or a press outside closes the tip. */
158
+ "update:open": (open) => typeof open === "boolean",
159
+ },
160
+ setup(props, { slots, attrs, emit }) {
161
+ const uncontrolledOpen = ref(props.defaultOpen);
162
+ const open = computed(() => props.open ?? uncontrolledOpen.value);
163
+ const setOpen = (next) => {
164
+ if (props.open === undefined)
165
+ uncontrolledOpen.value = next;
166
+ emit("update:open", next);
167
+ };
168
+ const anchor = ref(null);
169
+ const tip = ref(null);
170
+ const id = useId(undefined, "plexui-tip");
171
+ const titleId = `${id}-title`;
172
+ const descriptionId = `${id}-description`;
173
+ const control = () => (anchor.value?.$el instanceof HTMLElement ? anchor.value.$el : undefined);
174
+ const tipElement = () => (tip.value?.$el instanceof HTMLElement ? tip.value.$el : undefined);
175
+ // A press outside closes the tip on the click that completes it, as a Popover does; a press on the control
176
+ // does not close it. The tip never takes the focus, so focus moving elsewhere does not close it either.
177
+ const deferred = useDeferredPointerDownOutside(() => setOpen(false));
178
+ const { reset } = deferred;
179
+ const onPointerDownOutside = (event) => {
180
+ const target = event.detail.originalEvent.target;
181
+ if (target instanceof Node && control()?.contains(target)) {
182
+ reset();
183
+ event.preventDefault();
184
+ return;
185
+ }
186
+ deferred.onPointerDownOutside(event);
187
+ };
188
+ // Tab reaches the tip as if it sat right after the control: on the document, after the control's own handlers
189
+ const onDocumentKeydown = (event) => {
190
+ const element = control();
191
+ const content = tipElement();
192
+ if (element && content)
193
+ tabIntoTip(event, element, content);
194
+ };
195
+ let listening;
196
+ const stopListening = () => {
197
+ listening?.removeEventListener("keydown", onDocumentKeydown);
198
+ listening = undefined;
199
+ };
200
+ watch(open, (isOpen) => {
201
+ stopListening();
202
+ if (!isOpen || typeof document === "undefined")
203
+ return;
204
+ listening = control()?.ownerDocument ?? document;
205
+ listening.addEventListener("keydown", onDocumentKeydown);
206
+ }, { immediate: true, flush: "post" });
207
+ onBeforeUnmount(stopListening);
208
+ const onTipKeydown = (event) => {
209
+ const element = control();
210
+ const content = tipElement();
211
+ if (element && content)
212
+ tabOutOfTip(event, element, content);
213
+ };
214
+ provide(TIP_POPOVER_LABELS, () => ({
215
+ labelledBy: titleId,
216
+ describedBy: props.description || slots.description ? descriptionId : undefined,
217
+ }));
218
+ watch(open, (isOpen) => { if (!isOpen)
219
+ reset(); });
220
+ useEscCloseStack(open, () => setOpen(false));
221
+ return () => h(RekaPopoverRoot, { "open": open.value, "onUpdate:open": setOpen, "modal": false }, {
222
+ default: () => [
223
+ h(RekaPopoverAnchor, { asChild: true, ref: anchor }, { default: () => slots.default?.() }),
224
+ h(RekaPopoverPortal, null, {
225
+ default: () => [
226
+ h(TransitionGroup, { class: s.Transition, ...overlayTiming, overlay: true }, {
227
+ default: () => [
228
+ open.value
229
+ ? h(RekaPopoverContent, {
230
+ "key": "tip",
231
+ "ref": tip,
232
+ "forceMount": true,
233
+ "as": TipPopoverElement,
234
+ "class": clsx(s.Popover, attrs.class),
235
+ "side": props.side,
236
+ "align": props.align,
237
+ "sideOffset": props.sideOffset,
238
+ // The arrow stays clear of the tip's corners
239
+ "arrowPadding": 26,
240
+ "collisionPadding": 16,
241
+ "hideWhenDetached": true,
242
+ "onOpenAutoFocus": preventDefaultHandler,
243
+ "onCloseAutoFocus": preventDefaultHandler,
244
+ "onEscapeKeyDown": preventDefaultHandler,
245
+ onPointerDownOutside,
246
+ "onFocusOutside": preventDefaultHandler,
247
+ // Before Reka's focus scope, which would wrap Tab around inside the tip
248
+ "onKeydownCapture": onTipKeydown,
249
+ }, {
250
+ default: () => [
251
+ renderBody({
252
+ title: props.title,
253
+ description: props.description,
254
+ mobileActions: props.mobileActions,
255
+ onClose: props.closeButton ? () => setOpen(false) : undefined,
256
+ titleId,
257
+ descriptionId,
258
+ }, slots),
259
+ h(RekaPopoverArrow, { asChild: true, width: 47, height: 13 }, { default: () => h("span", { class: s.Arrow }) }),
260
+ ],
261
+ })
262
+ : createCommentVNode(),
263
+ ],
264
+ }),
265
+ ],
266
+ }),
267
+ ],
268
+ });
269
+ },
270
+ });
271
+ /** A tip inside the page, after TipKit: a title, a description, an optional symbol, actions and Close. */
272
+ // Typed explicitly so the published declaration refers to the part instead of expanding it
273
+ export const Tip = Object.assign(TipComponent, {
274
+ Popover: TipPopover,
275
+ });
276
+ //# sourceMappingURL=Tip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tip.js","sourceRoot":"","sources":["../../../../src/components/Tip/Tip.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,CAAC,EACD,MAAM,EACN,OAAO,EACP,eAAe,EACf,OAAO,EACP,GAAG,EACH,KAAK,GAMN,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,YAAY,IAAI,gBAAgB,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E,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;yCAChH;qCACF,CACF;oCACH,CAAC,CAAC,kBAAkB,EAAE;6BACzB;yBACF,CACF;qBACF;iBACF,CAAC;aACH;SACF,CACF,CAAA;IACL,CAAC;CACF,CAAC,CAAA;AAEF,0GAA0G;AAC1G,2FAA2F;AAC3F,MAAM,CAAC,MAAM,GAAG,GAAyD,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;IACnG,OAAO,EAAE,UAAU;CACpB,CAAC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport {\n computed,\n createCommentVNode,\n defineComponent,\n h,\n inject,\n markRaw,\n onBeforeUnmount,\n provide,\n ref,\n watch,\n type InjectionKey,\n type PropType,\n type Slots,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport {\n PopoverAnchor as RekaPopoverAnchor,\n PopoverArrow as RekaPopoverArrow,\n PopoverContent as RekaPopoverContent,\n PopoverPortal as RekaPopoverPortal,\n PopoverRoot as RekaPopoverRoot,\n useId,\n} from \"reka-ui\"\nimport s from \"@plexui/styles/components/Tip/Tip.module.css\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { preventDefaultHandler } from \"../../lib/helpers.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport { Button } from \"../Button/index.js\"\nimport { X } from \"../Icon/index.js\"\nimport { useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { overlayTiming } from \"../Transition/shared.js\"\n\n/** The edge of an inline tip that points at what it explains. */\nexport type TipArrowEdge = \"top\" | \"bottom\" | \"left\" | \"right\"\n\n/** How a tip's actions show on a phone. */\nexport type TipMobileActions = \"rows\" | \"buttons\"\n\ntype BodyOptions = {\n title?: string\n description?: string\n onClose?: () => void\n arrowEdge?: TipArrowEdge\n mobileActions?: TipMobileActions\n className?: unknown\n titleId: string\n descriptionId: string\n role?: string\n}\n\n// The tip itself, the same DOM as React's: the symbol, the title over the description, the actions, Close\nconst renderBody = (options: BodyOptions, slots: Slots) => {\n const title: VNodeChild = slots.title ? slots.title() : options.title\n const description: VNodeChild = slots.description ? slots.description() : options.description\n const icon = slots.icon?.()\n const actions = slots.actions?.()\n const hasDescription = hasContent([description as VNodeArrayChildren])\n return h(\n \"div\",\n {\n \"class\": clsx(s.Tip, options.className as string),\n \"role\": options.role,\n \"aria-labelledby\": options.role ? options.titleId : undefined,\n \"data-arrow-edge\": options.arrowEdge,\n \"data-mobile-actions\": options.mobileActions === \"buttons\" ? options.mobileActions : undefined,\n },\n [\n hasContent(icon) ? h(\"div\", { class: s.Icon }, icon) : null,\n h(\"div\", { class: s.Message }, [\n h(\"div\", { class: s.Title, id: options.titleId }, [title]),\n hasDescription ? h(\"div\", { class: s.Description, id: options.descriptionId }, [description]) : null,\n ]),\n hasContent(actions) ? h(\"div\", { class: s.Actions }, actions) : null,\n options.onClose\n ? h(\n Button,\n { \"type\": \"button\", \"onClick\": options.onClose, \"color\": \"secondary\", \"variant\": \"soft\", \"uniform\": true, \"pill\": true, \"aria-label\": \"Close tip\", \"class\": s.Close },\n { default: () => [h(X)] },\n )\n : null,\n ],\n )\n}\n\n// The ids that name and describe a popover tip\nconst TIP_POPOVER_LABELS: InjectionKey<() => { labelledBy: string, describedBy?: string }> = Symbol(\"TipPopoverLabels\")\n\n// The element Reka's content renders (`as`): Reka names its content after a trigger, and a tip has none, so the\n// tip's title names it (and its description describes it) here. Raw: Reka passes `as` through reactive props.\nconst TipPopoverElement = markRaw(\n defineComponent({\n name: \"TipPopoverElement\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const labels = inject(TIP_POPOVER_LABELS)!\n return () => {\n const rest: Record<string, unknown> = { ...attrs }\n delete rest.dir\n delete rest.forceMount\n const { labelledBy, describedBy } = labels()\n return h(\"div\", { ...rest, \"aria-labelledby\": labelledBy, \"aria-describedby\": describedBy }, slots.default?.())\n }\n },\n }),\n)\n\nconst contentProps = {\n /** The tip's title: what the feature is (or the `title` slot). */\n title: String,\n /** One or two sentences on how to use it (or the `description` slot). */\n description: String,\n /**\n * How the actions show at 767px and below: rows of text under a separator, as iOS tips show them, or the buttons\n * as given, each a full-width capsule under the message, as an iOS card that asks for a permission.\n * @default \"rows\"\n */\n mobileActions: String as PropType<TipMobileActions>,\n}\n\nconst TipComponent = defineComponent({\n name: \"Tip\",\n inheritAttrs: false,\n props: {\n ...contentProps,\n /** Shows the Close button; called when it is clicked. */\n onClose: Function as PropType<() => void>,\n /** Draws an arrow at this edge, pointing at what the tip explains (TipKit's annotation). */\n arrowEdge: String as PropType<TipArrowEdge>,\n },\n setup(props, { slots, attrs }) {\n const id = useId(undefined, \"plexui-tip\")\n return () =>\n renderBody(\n {\n ...props,\n className: attrs.class,\n titleId: `${id}-title`,\n descriptionId: `${id}-description`,\n role: \"note\",\n },\n slots,\n )\n },\n})\n\nconst TABBABLE =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]'\n\n// What Tab can reach: no focus guards, nothing hidden (checkVisibility where the browser has it)\nconst tabbables = (root: ParentNode) =>\n [...root.querySelectorAll<HTMLElement>(TABBABLE)].filter(\n (element) =>\n element.tabIndex >= 0 &&\n !element.closest(\"[hidden], [inert], [data-radix-focus-guard], [data-reka-focus-guard]\") &&\n (typeof element.checkVisibility !== \"function\" || element.checkVisibility({ visibilityProperty: true })),\n )\n\n// The first element Tab reaches after the control, outside the tip\nconst nextAfter = (control: HTMLElement, tip: HTMLElement) =>\n tabbables(control.ownerDocument).find(\n (element) =>\n !tip.contains(element) &&\n !control.contains(element) &&\n !!(control.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING),\n )\n\n// Takes the Tab only when the focus moved\nconst focusInstead = (event: KeyboardEvent, element: HTMLElement | undefined) => {\n if (!element) return\n element.focus()\n if (element.ownerDocument.activeElement === element) event.preventDefault()\n}\n\n// A popover tip renders at the end of the page, but Tab reaches it as if it sat right after its control: from the\n// control (or its last control) Tab moves into the tip, and Shift+Tab from what follows the control moves to the\n// tip's last control. Listened for on the document, after the control's own handlers.\nconst tabIntoTip = (event: KeyboardEvent, control: HTMLElement, tip: HTMLElement) => {\n if (event.key !== \"Tab\" || event.defaultPrevented || !(event.target instanceof Node) || tip.contains(event.target)) return\n const items = tabbables(tip)\n if (event.shiftKey) {\n if (event.target === nextAfter(control, tip)) focusInstead(event, items.at(-1))\n } else if (event.target === (tabbables(control).at(-1) ?? control)) {\n focusInstead(event, items[0])\n }\n}\n\n// Shift+Tab from the tip's first control returns to the control; Tab from its last moves on to what follows it\nconst tabOutOfTip = (event: KeyboardEvent, control: HTMLElement, tip: HTMLElement) => {\n if (event.key !== \"Tab\" || event.defaultPrevented) return\n const items = tabbables(tip)\n if (event.shiftKey) {\n if (event.target === items[0]) focusInstead(event, tabbables(control).at(-1) ?? (control.tabIndex >= 0 ? control : undefined))\n } else if (event.target === items.at(-1)) {\n focusInstead(event, nextAfter(control, tip))\n }\n}\n\n/**\n * A tip anchored to a control, after TipKit's popover tip. The default slot is the control; `icon`,\n * `title`, `description` and `actions` slots fill the tip. It does not take the focus. Bind `v-model:open`.\n */\nexport const TipPopover = defineComponent({\n name: \"TipPopover\",\n inheritAttrs: false,\n props: {\n ...contentProps,\n /** Shows the tip (controlled, `v-model:open`). */\n open: { type: Boolean, default: undefined },\n /** Shows the tip at first (uncontrolled). @default false */\n defaultOpen: { type: Boolean, default: false },\n /** The side of the control the tip shows on. Turned when it does not fit. @default \"bottom\" */\n side: { type: String as PropType<\"top\" | \"right\" | \"bottom\" | \"left\">, default: \"bottom\" },\n /** The alignment against the control. @default \"center\" */\n align: { type: String as PropType<\"start\" | \"center\" | \"end\">, default: \"center\" },\n /** The distance from the control to the arrow's point, in pixels. @default 4 */\n sideOffset: { type: Number, default: 4 },\n /** Shows the Close button. @default true */\n closeButton: { type: Boolean, default: true },\n },\n emits: {\n /** Close, Escape or a press outside closes the tip. */\n \"update:open\": (open: boolean) => typeof open === \"boolean\",\n },\n setup(props, { slots, attrs, emit }) {\n const uncontrolledOpen = ref(props.defaultOpen)\n const open = computed(() => props.open ?? uncontrolledOpen.value)\n const setOpen = (next: boolean) => {\n if (props.open === undefined) uncontrolledOpen.value = next\n emit(\"update:open\", next)\n }\n const anchor = ref<{ $el?: Element } | null>(null)\n const tip = ref<{ $el?: Element } | null>(null)\n const id = useId(undefined, \"plexui-tip\")\n const titleId = `${id}-title`\n const descriptionId = `${id}-description`\n const control = () => (anchor.value?.$el instanceof HTMLElement ? anchor.value.$el : undefined)\n const tipElement = () => (tip.value?.$el instanceof HTMLElement ? tip.value.$el : undefined)\n // A press outside closes the tip on the click that completes it, as a Popover does; a press on the control\n // does not close it. The tip never takes the focus, so focus moving elsewhere does not close it either.\n const deferred = useDeferredPointerDownOutside(() => setOpen(false))\n const { reset } = deferred\n const onPointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n const target = event.detail.originalEvent.target\n if (target instanceof Node && control()?.contains(target)) {\n reset()\n event.preventDefault()\n return\n }\n deferred.onPointerDownOutside(event)\n }\n // Tab reaches the tip as if it sat right after the control: on the document, after the control's own handlers\n const onDocumentKeydown = (event: KeyboardEvent) => {\n const element = control()\n const content = tipElement()\n if (element && content) tabIntoTip(event, element, content)\n }\n let listening: Document | undefined\n const stopListening = () => {\n listening?.removeEventListener(\"keydown\", onDocumentKeydown)\n listening = undefined\n }\n watch(open, (isOpen) => {\n stopListening()\n if (!isOpen || typeof document === \"undefined\") return\n listening = control()?.ownerDocument ?? document\n listening.addEventListener(\"keydown\", onDocumentKeydown)\n }, { immediate: true, flush: \"post\" })\n onBeforeUnmount(stopListening)\n const onTipKeydown = (event: KeyboardEvent) => {\n const element = control()\n const content = tipElement()\n if (element && content) tabOutOfTip(event, element, content)\n }\n provide(TIP_POPOVER_LABELS, () => ({\n labelledBy: titleId,\n describedBy: props.description || slots.description ? descriptionId : undefined,\n }))\n watch(open, (isOpen) => { if (!isOpen) reset() })\n useEscCloseStack(open, () => setOpen(false))\n\n return () =>\n h(\n RekaPopoverRoot,\n { \"open\": open.value, \"onUpdate:open\": setOpen, \"modal\": false },\n {\n default: () => [\n h(RekaPopoverAnchor, { asChild: true, ref: anchor }, { default: () => slots.default?.() }),\n h(RekaPopoverPortal, null, {\n default: () => [\n h(\n TransitionGroup,\n { class: s.Transition, ...overlayTiming, overlay: true },\n {\n default: () => [\n open.value\n ? h(\n RekaPopoverContent,\n {\n \"key\": \"tip\",\n \"ref\": tip,\n \"forceMount\": true,\n \"as\": TipPopoverElement,\n \"class\": clsx(s.Popover, attrs.class as string),\n \"side\": props.side,\n \"align\": props.align,\n \"sideOffset\": props.sideOffset,\n // The arrow stays clear of the tip's corners\n \"arrowPadding\": 26,\n \"collisionPadding\": 16,\n \"hideWhenDetached\": true,\n \"onOpenAutoFocus\": preventDefaultHandler,\n \"onCloseAutoFocus\": preventDefaultHandler,\n \"onEscapeKeyDown\": preventDefaultHandler,\n onPointerDownOutside,\n \"onFocusOutside\": preventDefaultHandler,\n // Before Reka's focus scope, which would wrap Tab around inside the tip\n \"onKeydownCapture\": onTipKeydown,\n },\n {\n default: () => [\n renderBody(\n {\n title: props.title,\n description: props.description,\n mobileActions: props.mobileActions,\n onClose: props.closeButton ? () => setOpen(false) : undefined,\n titleId,\n descriptionId,\n },\n slots,\n ),\n h(RekaPopoverArrow, { asChild: true, width: 47, height: 13 }, { default: () => h(\"span\", { class: s.Arrow }) }),\n ],\n },\n )\n : createCommentVNode(),\n ],\n },\n ),\n ],\n }),\n ],\n },\n )\n },\n})\n\n/** A tip inside the page, after TipKit: a title, a description, an optional symbol, actions and Close. */\n// Typed explicitly so the published declaration refers to the part instead of expanding it\nexport const Tip: typeof TipComponent & { Popover: typeof TipPopover } = Object.assign(TipComponent, {\n Popover: TipPopover,\n})\n\nexport type TipProps = InstanceType<typeof TipComponent>[\"$props\"]\nexport type TipPopoverProps = InstanceType<typeof TipPopover>[\"$props\"]\n"]}