@plexui/vue 0.42.16 → 0.42.18
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.
|
@@ -152,6 +152,13 @@ export const TipPopover = defineComponent({
|
|
|
152
152
|
sideOffset: { type: Number, default: 4 },
|
|
153
153
|
/** Shows the Close button. @default true */
|
|
154
154
|
closeButton: { type: Boolean, default: true },
|
|
155
|
+
/**
|
|
156
|
+
* The tip's surface on a phone: `glass`, TipKit's Liquid Glass, or `solid`, the opaque elevated surface iOS draws
|
|
157
|
+
* the tip on with Reduce Transparency (`--tip-popover-background`, the same shape, arrow and shadow), for a tip over
|
|
158
|
+
* a photo or anything busy, where a browser's glass cannot turn its words light or dark to the picture as iOS's does.
|
|
159
|
+
* @default "glass"
|
|
160
|
+
*/
|
|
161
|
+
material: { type: String, default: "glass" },
|
|
155
162
|
},
|
|
156
163
|
emits: {
|
|
157
164
|
/** Close, Escape or a press outside closes the tip. */
|
|
@@ -232,6 +239,7 @@ export const TipPopover = defineComponent({
|
|
|
232
239
|
"forceMount": true,
|
|
233
240
|
"as": TipPopoverElement,
|
|
234
241
|
"class": clsx(s.Popover, attrs.class),
|
|
242
|
+
"data-material": props.material,
|
|
235
243
|
"side": props.side,
|
|
236
244
|
"align": props.align,
|
|
237
245
|
"sideOffset": props.sideOffset,
|
|
@@ -1 +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,EAChC,cAAc,IAAI,kBAAkB,EACpC,aAAa,IAAI,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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"]}
|
|
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,EAChC,cAAc,IAAI,kBAAkB,EACpC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,KAAK,GACN,MAAM,SAAS,CAAA;AAChB,OAAO,CAAC,MAAM,8CAA8C,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAA;AACpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAoBvD,0GAA0G;AAC1G,MAAM,UAAU,GAAG,CAAC,OAAoB,EAAE,KAAY,EAAE,EAAE;IACxD,MAAM,KAAK,GAAe,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAA;IACrE,MA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qBAAqB;wCACxC,kBAAkB,EAAE,qBAAqB;wCACzC,iBAAiB,EAAE,qBAAqB;wCACxC,oBAAoB;wCACpB,gBAAgB,EAAE,qBAAqB;wCACvC,wEAAwE;wCACxE,kBAAkB,EAAE,YAAY;qCACjC,EACD;wCACE,OAAO,EAAE,GAAG,EAAE,CAAC;4CACb,UAAU,CACR;gDACE,KAAK,EAAE,KAAK,CAAC,KAAK;gDAClB,WAAW,EAAE,KAAK,CAAC,WAAW;gDAC9B,aAAa,EAAE,KAAK,CAAC,aAAa;gDAClC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;gDAC7D,OAAO;gDACP,aAAa;6CACd,EACD,KAAK,CACN;4CACD,CAAC,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,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 * The tip's surface on a phone: `glass`, TipKit's Liquid Glass, or `solid`, the opaque elevated surface iOS draws\n * the tip on with Reduce Transparency (`--tip-popover-background`, the same shape, arrow and shadow), for a tip over\n * a photo or anything busy, where a browser's glass cannot turn its words light or dark to the picture as iOS's does.\n * @default \"glass\"\n */\n material: { type: String as PropType<\"glass\" | \"solid\">, default: \"glass\" },\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 \"data-material\": props.material,\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"]}
|
|
@@ -71,6 +71,16 @@ export declare const TipPopover: import("vue").DefineComponent<import("vue").Ext
|
|
|
71
71
|
type: BooleanConstructor;
|
|
72
72
|
default: boolean;
|
|
73
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* The tip's surface on a phone: `glass`, TipKit's Liquid Glass, or `solid`, the opaque elevated surface iOS draws
|
|
76
|
+
* the tip on with Reduce Transparency (`--tip-popover-background`, the same shape, arrow and shadow), for a tip over
|
|
77
|
+
* a photo or anything busy, where a browser's glass cannot turn its words light or dark to the picture as iOS's does.
|
|
78
|
+
* @default "glass"
|
|
79
|
+
*/
|
|
80
|
+
material: {
|
|
81
|
+
type: PropType<"glass" | "solid">;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
74
84
|
/** The tip's title: what the feature is (or the `title` slot). */
|
|
75
85
|
title: StringConstructor;
|
|
76
86
|
/** One or two sentences on how to use it (or the `description` slot). */
|
|
@@ -117,6 +127,16 @@ export declare const TipPopover: import("vue").DefineComponent<import("vue").Ext
|
|
|
117
127
|
type: BooleanConstructor;
|
|
118
128
|
default: boolean;
|
|
119
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* The tip's surface on a phone: `glass`, TipKit's Liquid Glass, or `solid`, the opaque elevated surface iOS draws
|
|
132
|
+
* the tip on with Reduce Transparency (`--tip-popover-background`, the same shape, arrow and shadow), for a tip over
|
|
133
|
+
* a photo or anything busy, where a browser's glass cannot turn its words light or dark to the picture as iOS's does.
|
|
134
|
+
* @default "glass"
|
|
135
|
+
*/
|
|
136
|
+
material: {
|
|
137
|
+
type: PropType<"glass" | "solid">;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
120
140
|
/** The tip's title: what the feature is (or the `title` slot). */
|
|
121
141
|
title: StringConstructor;
|
|
122
142
|
/** One or two sentences on how to use it (or the `description` slot). */
|
|
@@ -136,6 +156,7 @@ export declare const TipPopover: import("vue").DefineComponent<import("vue").Ext
|
|
|
136
156
|
side: "left" | "right" | "bottom" | "top";
|
|
137
157
|
align: "center" | "end" | "start";
|
|
138
158
|
closeButton: boolean;
|
|
159
|
+
material: "solid" | "glass";
|
|
139
160
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
140
161
|
/** A tip inside the page, after TipKit: a title, a description, an optional symbol, actions and Close. */
|
|
141
162
|
export declare const Tip: typeof TipComponent & {
|