@plexui/vue 0.1.8 → 0.1.10
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.
- package/dist/es/components/Dialog/Dialog.js +23 -4
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Dialog/sheetDrag.js +77 -0
- package/dist/es/components/Dialog/sheetDrag.js.map +1 -0
- package/dist/es/components/Field/Field.js +8 -3
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/FieldGroup/FieldGroup.js +54 -0
- package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -0
- package/dist/es/components/FieldGroup/index.js +2 -0
- package/dist/es/components/FieldGroup/index.js.map +1 -0
- package/dist/es/components/Tabs/Tabs.js +2 -2
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/types/components/Dialog/sheetDrag.d.ts +1 -0
- package/dist/types/components/Field/Field.d.ts +13 -9
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +40 -0
- package/dist/types/components/FieldGroup/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,8 +5,10 @@ import { keepMovedFocus, preventDefaultHandler, toCssVariables } from "../../lib
|
|
|
5
5
|
import { dismissableSurfaces, useDeferredPointerDownOutside } from "../Popover/deferredPointerDownOutside.js";
|
|
6
6
|
import { firstElementChild } from "../Tooltip/slot.js";
|
|
7
7
|
import { TransitionGroup } from "../Transition/index.js";
|
|
8
|
+
import { attachSheetDrag } from "./sheetDrag.js";
|
|
8
9
|
import { overlayTiming, overlayTimingLarge } from "../Transition/shared.js";
|
|
9
10
|
import s from "@plexui/styles/components/Dialog/Dialog.module.css";
|
|
11
|
+
const DOUBLE_CLICK = 300;
|
|
10
12
|
const DialogContextKey = Symbol("PlexUIDialog");
|
|
11
13
|
const useDialogContext = () => {
|
|
12
14
|
const context = inject(DialogContextKey, null);
|
|
@@ -140,15 +142,32 @@ export const DialogContent = defineComponent({
|
|
|
140
142
|
useEscCloseStack(open, () => {
|
|
141
143
|
setOpen(false);
|
|
142
144
|
});
|
|
145
|
+
// The second click of a double click lands on the overlay: it must not undo the first
|
|
146
|
+
let openedAt = 0;
|
|
143
147
|
// Radix's modal content: a Ctrl+click (macOS right click) does not dismiss
|
|
144
148
|
const outsidePress = useDeferredPointerDownOutside((originalEvent) => {
|
|
145
|
-
if (!originalEvent.ctrlKey)
|
|
149
|
+
if (!originalEvent.ctrlKey && performance.now() - openedAt >= DOUBLE_CLICK)
|
|
146
150
|
setOpen(false);
|
|
147
151
|
});
|
|
148
152
|
watch(open, (isOpen) => {
|
|
149
|
-
if (
|
|
153
|
+
if (isOpen)
|
|
154
|
+
openedAt = performance.now();
|
|
155
|
+
else
|
|
150
156
|
outsidePress.reset();
|
|
151
|
-
});
|
|
157
|
+
}, { immediate: true });
|
|
158
|
+
let panelElement;
|
|
159
|
+
let detachDrag;
|
|
160
|
+
const setPanelRef = (instance) => {
|
|
161
|
+
const element = instance instanceof HTMLElement ? instance : undefined;
|
|
162
|
+
if (element === panelElement)
|
|
163
|
+
return;
|
|
164
|
+
detachDrag?.();
|
|
165
|
+
detachDrag = undefined;
|
|
166
|
+
panelElement = element;
|
|
167
|
+
if (element && props.mobilePlacement === "bottom") {
|
|
168
|
+
detachDrag = attachSheetDrag(element, () => setOpen(false));
|
|
169
|
+
}
|
|
170
|
+
};
|
|
152
171
|
let overlayElement;
|
|
153
172
|
const setOverlayRef = (instance) => {
|
|
154
173
|
const el = instance?.$el;
|
|
@@ -180,7 +199,7 @@ export const DialogContent = defineComponent({
|
|
|
180
199
|
"onFocusOutside": outsidePress.onFocusOutside,
|
|
181
200
|
}, {
|
|
182
201
|
default: () => [
|
|
183
|
-
h("div", { class: [s.Panel, attrs.class] }, [
|
|
202
|
+
h("div", { class: [s.Panel, attrs.class], ref: setPanelRef }, [
|
|
184
203
|
props.showClose
|
|
185
204
|
? h(DialogClose, null, {
|
|
186
205
|
default: () => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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E,KAAK,EAAE;QACrB,eAAe,CAAC,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,CAAA;QACpD,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IACvG,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE;QACrB,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAA;QAC7C,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,EAAE;YAC/B,IAAI,CAAC,KAAK,CAAC,gBAAgB;gBAAE,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAC9D,CAAC,CAAA;QACD,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;IACjG,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n cloneVNode,\n computed,\n createCommentVNode,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n watch,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n type VNode,\n} from \"vue\"\nimport {\n DialogContent as RekaDialogContent,\n DialogDescription as RekaDialogDescription,\n DialogOverlay as RekaDialogOverlay,\n DialogPortal as RekaDialogPortal,\n DialogRoot as RekaDialogRoot,\n DialogTitle as RekaDialogTitle,\n injectDialogRootContext,\n useForwardExpose,\n useId,\n} from \"reka-ui\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers.js\"\nimport { dismissableSurfaces, useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { firstElementChild } from \"../Tooltip/slot.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { overlayTiming, overlayTimingLarge } from \"../Transition/shared.js\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\n\n// Vue port of packages/ui/src/components/Dialog/Dialog.tsx on Reka UI\n// (the Vue lineage of Radix, same anatomy). Exports are flat (`Dialog`,\n// `DialogTrigger`, ...) because runtime-compiled templates cannot resolve\n// `Dialog.Trigger` from the `components` option.\n//\n// Where Reka differs from Radix (radix-ui 1.8), the port follows Radix:\n// - The content is labelled and described only while a DialogTitle /\n// DialogDescription is mounted.\n// - A press outside (the overlay) closes it on the click that follows\n// (../Popover/deferredPointerDownOutside.ts); the overlay is a dismiss\n// surface.\n// - The portal renders once mounted, so a closed dialog server-renders\n// nothing.\n\ntype DialogContextValue = {\n open: ComputedRef<boolean>\n setOpen: (nextState: boolean) => void\n /** Mounted DialogTitle / DialogDescription parts (Radix's title and description counts) */\n titleCount: Ref<number>\n descriptionCount: Ref<number>\n}\n\nconst DialogContextKey: InjectionKey<DialogContextValue> = Symbol(\"PlexUIDialog\")\n\nconst useDialogContext = () => {\n const context = inject(DialogContextKey, null)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\n/** Modal dialog root. Uncontrolled by default; bind `v-model:open` to control it. */\nexport const Dialog = defineComponent({\n name: \"Dialog\",\n props: {\n open: { type: Boolean, default: undefined },\n },\n emits: {\n \"update:open\": (_open: boolean) => true,\n },\n setup(props, { slots, emit }) {\n const internalOpen = ref(false)\n const isOpen = computed(() => props.open ?? internalOpen.value)\n\n const setOpen = (nextState: boolean) => {\n emit(\"update:open\", nextState)\n internalOpen.value = nextState\n }\n\n provide(DialogContextKey, { open: isOpen, setOpen, titleCount: ref(0), descriptionCount: ref(0) })\n\n return () =>\n h(RekaDialogRoot, { \"open\": isOpen.value, \"onUpdate:open\": setOpen }, { default: () => slots.default?.() })\n },\n})\n\n// Trigger and Close render their child with the dialog wiring merged in,\n// like Reka's `asChild` parts, but run the dialog action after the child's\n// own click handlers and skip it when one called preventDefault() (Radix's\n// composeEventHandlers). Reka's parts run first and cannot be cancelled.\n// Attributes the child sets itself win, as with Radix and Reka slots. The\n// child is the first element, also through a forwarded `<slot />`.\nconst withDialogProps = (\n child: VNode | undefined,\n props: Record<string, unknown>,\n onClick: (event: Event) => void,\n ref?: (el: unknown) => void,\n) => {\n if (!child) return null\n const own = child.props ?? {}\n const extra = Object.fromEntries(Object.entries(props).filter(([key]) => !(key in own)))\n return cloneVNode(child, { ...extra, onClick, ...(ref ? { ref } : {}) }, true)\n}\n\nexport const DialogTrigger = defineComponent({\n name: \"DialogTrigger\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const { forwardRef, currentElement } = useForwardExpose()\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n // Focus returns here when the dialog closes\n onMounted(() => {\n rootContext.triggerElement.value = currentElement.value\n })\n\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) rootContext.onOpenToggle()\n }\n\n return () => {\n const open = rootContext.open.value\n return withDialogProps(\n firstElementChild(slots.default?.()),\n {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": open || false,\n \"aria-controls\": open ? rootContext.contentId : undefined,\n \"data-state\": open ? \"open\" : \"closed\",\n },\n onClick,\n forwardRef as (el: unknown) => void,\n )\n }\n },\n})\n\nconst CloseIcon = () =>\n h(\"svg\", { \"class\": s.CloseIcon, \"viewBox\": \"0 0 20 20\", \"width\": \"20\", \"height\": \"20\", \"aria-hidden\": \"true\" }, [\n h(\"path\", {\n fill: \"currentColor\",\n d: \"M5.22 5.22a.75.75 0 0 1 1.06 0L10 8.94l3.72-3.72a.75.75 0 1 1 1.06 1.06L11.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06L10 11.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06L8.94 10 5.22 6.28a.75.75 0 0 1 0-1.06\",\n }),\n ])\n\n/** Overlay and panel. `class` lands on the panel, like `className` in React. */\nexport const DialogContent = defineComponent({\n name: \"DialogContent\",\n inheritAttrs: false,\n props: {\n /** Panel width; numbers are pixels. @default 480 */\n width: { type: [Number, String] as PropType<number | string>, default: 480 },\n /** Renders the close button in the top corner. @default true */\n showClose: { type: Boolean, default: true },\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill: { type: Boolean, default: false },\n /**\n * Where the panel sits: centered, near the top, a sheet along the bottom,\n * a full-height panel on the start or end side, or the whole screen.\n * @default \"center\"\n */\n placement: { type: String as PropType<DialogPlacement>, default: \"center\" },\n /** Placement at 640px and below, such as a bottom sheet on phones. @default placement */\n mobilePlacement: String as PropType<Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">>,\n /** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */\n onOpenAutoFocus: Function as PropType<(event: Event) => void>,\n /** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */\n onCloseAutoFocus: Function as PropType<(event: Event) => void>,\n },\n setup(props, { slots, attrs }) {\n const { open, setOpen, titleCount, descriptionCount } = useDialogContext()\n const rootContext = injectDialogRootContext()\n // Radix's root makes the content id; Reka's trigger does, so a dialog\n // without one would render `id=\"\"`\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n\n // Force-mounted content refocuses Reka's trigger the moment it closes.\n // Focus waits for the exit, as in Radix: the trigger is held back until\n // the content unmounts, where Reka's own close auto focus uses it.\n let closingTrigger: HTMLElement | undefined\n watch(\n open,\n (isOpen) => {\n if (isOpen) {\n if (closingTrigger) rootContext.triggerElement.value = closingTrigger\n closingTrigger = undefined\n } else {\n closingTrigger = rootContext.triggerElement.value\n rootContext.triggerElement.value = undefined\n }\n },\n { flush: \"sync\" },\n )\n const handleCloseAutoFocus = (event: Event) => {\n props.onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n if (closingTrigger) rootContext.triggerElement.value = closingTrigger\n closingTrigger = undefined\n }\n\n // Escape goes through the shared stack, as in React, so the dialog\n // closes before overlays opened earlier (a forced-open Tooltip)\n useEscCloseStack(open, () => {\n setOpen(false)\n })\n\n // Radix's modal content: a Ctrl+click (macOS right click) does not dismiss\n const outsidePress = useDeferredPointerDownOutside((originalEvent) => {\n if (!originalEvent.ctrlKey) setOpen(false)\n })\n watch(open, (isOpen) => {\n if (!isOpen) outsidePress.reset()\n })\n\n let overlayElement: Element | undefined\n const setOverlayRef = (instance: unknown) => {\n const el = (instance as { $el?: unknown } | null)?.$el\n const element = el instanceof Element ? el : undefined\n if (element === overlayElement) return\n if (overlayElement) dismissableSurfaces.delete(overlayElement)\n overlayElement = element\n if (element) dismissableSurfaces.add(element)\n }\n\n const renderDialog = () =>\n h(\"div\", { key: \"dialog\" }, [\n h(RekaDialogOverlay, { class: s.Overlay, forceMount: true, ref: setOverlayRef }),\n h(\n RekaDialogContent,\n {\n \"forceMount\": true,\n \"class\": s.Content,\n \"style\": toCssVariables({ \"dialog-width\": props.width }),\n \"data-placement\": props.placement === \"center\" ? undefined : props.placement,\n \"data-mobile-placement\": props.mobilePlacement,\n \"data-pill\": props.pill ? \"\" : undefined,\n \"onOpenAutoFocus\": props.onOpenAutoFocus,\n \"onCloseAutoFocus\": handleCloseAutoFocus,\n // Radix labels and describes the content only by mounted parts\n ...(titleCount.value > 0 ? {} : { \"aria-labelledby\": undefined }),\n ...(descriptionCount.value > 0 ? {} : { \"aria-describedby\": undefined }),\n \"onEscapeKeyDown\": preventDefaultHandler,\n \"onPointerDownOutside\": outsidePress.onPointerDownOutside,\n \"onFocusOutside\": outsidePress.onFocusOutside,\n },\n {\n default: () => [\n h(\"div\", { class: [s.Panel, attrs.class] }, [\n props.showClose\n ? h(DialogClose, null, {\n default: () => [\n h(\"button\", { \"type\": \"button\", \"class\": s.CloseButton, \"aria-label\": \"Close dialog\" }, [\n h(CloseIcon),\n ]),\n ],\n })\n : null,\n slots.default?.(),\n ]),\n ],\n },\n ),\n ])\n\n return () => {\n const { placement, mobilePlacement } = props\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || mobilePlacement === \"bottom\"\n return h(RekaDialogPortal, null, {\n default: () => [\n h(\n TransitionGroup,\n // A dialog mounted open enters too, as `v-if` and `open` together do\n {\n class: s.Transition,\n ...(crossesScreen ? overlayTimingLarge : overlayTiming),\n overlay: true,\n preventInitialTransition: false,\n },\n // `open && <div>` in React: closed still renders the empty wrapper\n { default: () => [open.value ? renderDialog() : createCommentVNode()] },\n ),\n ],\n })\n }\n },\n})\n\nexport const DialogHeader = defineComponent({\n name: \"DialogHeader\",\n setup(_props, { slots }) {\n return () => h(\"div\", { class: s.Header }, slots.default?.())\n },\n})\n\n/** The scrolling part between DialogHeader and DialogFooter: with it, only the body scrolls. */\nexport const DialogBody = defineComponent({\n name: \"DialogBody\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n return () => h(\"div\", { class: [s.Body, attrs.class] }, slots.default?.())\n },\n})\n\nexport const DialogFooter = defineComponent({\n name: \"DialogFooter\",\n setup(_props, { slots }) {\n return () => h(\"div\", { class: s.Footer }, slots.default?.())\n },\n})\n\n/** Counts a mounted part, as Radix's title and description counts do. */\nconst useMountedCount = (count: Ref<number>) => {\n onMounted(() => {\n count.value++\n })\n onBeforeUnmount(() => {\n count.value--\n })\n}\n\nexport const DialogTitle = defineComponent({\n name: \"DialogTitle\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().titleCount)\n return () => h(RekaDialogTitle, { class: s.Title }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogDescription = defineComponent({\n name: \"DialogDescription\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().descriptionCount)\n return () => h(RekaDialogDescription, { class: s.Description }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogClose = defineComponent({\n name: \"DialogClose\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) rootContext.onOpenChange(false)\n }\n return () => withDialogProps(firstElementChild(slots.default?.()), { type: \"button\" }, onClick)\n },\n})\n\nexport type DialogProps = InstanceType<typeof Dialog>[\"$props\"]\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/** DialogContent props; `class` lands on the panel, like `className` in React. */\nexport type DialogContentProps = InstanceType<typeof DialogContent>[\"$props\"] & { class?: HTMLAttributes[\"class\"] }\n"]}
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,CAAC,EACD,MAAM,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,EACH,KAAK,GAON,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,IAAI,qBAAqB,EAC1C,aAAa,IAAI,iBAAiB,EAClC,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,eAAe,EAC9B,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,GACN,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAA;AAC7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD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KAAK,EAAE;QACrB,eAAe,CAAC,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,CAAA;QACpD,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IACvG,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE;QACrB,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAA;QAC7C,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,EAAE;YAC/B,IAAI,CAAC,KAAK,CAAC,gBAAgB;gBAAE,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAC9D,CAAC,CAAA;QACD,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;IACjG,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n cloneVNode,\n computed,\n createCommentVNode,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n watch,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n type VNode,\n} from \"vue\"\nimport {\n DialogContent as RekaDialogContent,\n DialogDescription as RekaDialogDescription,\n DialogOverlay as RekaDialogOverlay,\n DialogPortal as RekaDialogPortal,\n DialogRoot as RekaDialogRoot,\n DialogTitle as RekaDialogTitle,\n injectDialogRootContext,\n useForwardExpose,\n useId,\n} from \"reka-ui\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers.js\"\nimport { dismissableSurfaces, useDeferredPointerDownOutside } from \"../Popover/deferredPointerDownOutside.js\"\nimport { firstElementChild } from \"../Tooltip/slot.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { attachSheetDrag } from \"./sheetDrag.js\"\nimport { overlayTiming, overlayTimingLarge } from \"../Transition/shared.js\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\n\nconst DOUBLE_CLICK = 300\n\n// Vue port of packages/ui/src/components/Dialog/Dialog.tsx on Reka UI\n// (the Vue lineage of Radix, same anatomy). Exports are flat (`Dialog`,\n// `DialogTrigger`, ...) because runtime-compiled templates cannot resolve\n// `Dialog.Trigger` from the `components` option.\n//\n// Where Reka differs from Radix (radix-ui 1.8), the port follows Radix:\n// - The content is labelled and described only while a DialogTitle /\n// DialogDescription is mounted.\n// - A press outside (the overlay) closes it on the click that follows\n// (../Popover/deferredPointerDownOutside.ts); the overlay is a dismiss\n// surface.\n// - The portal renders once mounted, so a closed dialog server-renders\n// nothing.\n\ntype DialogContextValue = {\n open: ComputedRef<boolean>\n setOpen: (nextState: boolean) => void\n /** Mounted DialogTitle / DialogDescription parts (Radix's title and description counts) */\n titleCount: Ref<number>\n descriptionCount: Ref<number>\n}\n\nconst DialogContextKey: InjectionKey<DialogContextValue> = Symbol(\"PlexUIDialog\")\n\nconst useDialogContext = () => {\n const context = inject(DialogContextKey, null)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\n/** Modal dialog root. Uncontrolled by default; bind `v-model:open` to control it. */\nexport const Dialog = defineComponent({\n name: \"Dialog\",\n props: {\n open: { type: Boolean, default: undefined },\n },\n emits: {\n \"update:open\": (_open: boolean) => true,\n },\n setup(props, { slots, emit }) {\n const internalOpen = ref(false)\n const isOpen = computed(() => props.open ?? internalOpen.value)\n\n const setOpen = (nextState: boolean) => {\n emit(\"update:open\", nextState)\n internalOpen.value = nextState\n }\n\n provide(DialogContextKey, { open: isOpen, setOpen, titleCount: ref(0), descriptionCount: ref(0) })\n\n return () =>\n h(RekaDialogRoot, { \"open\": isOpen.value, \"onUpdate:open\": setOpen }, { default: () => slots.default?.() })\n },\n})\n\n// Trigger and Close render their child with the dialog wiring merged in,\n// like Reka's `asChild` parts, but run the dialog action after the child's\n// own click handlers and skip it when one called preventDefault() (Radix's\n// composeEventHandlers). Reka's parts run first and cannot be cancelled.\n// Attributes the child sets itself win, as with Radix and Reka slots. The\n// child is the first element, also through a forwarded `<slot />`.\nconst withDialogProps = (\n child: VNode | undefined,\n props: Record<string, unknown>,\n onClick: (event: Event) => void,\n ref?: (el: unknown) => void,\n) => {\n if (!child) return null\n const own = child.props ?? {}\n const extra = Object.fromEntries(Object.entries(props).filter(([key]) => !(key in own)))\n return cloneVNode(child, { ...extra, onClick, ...(ref ? { ref } : {}) }, true)\n}\n\nexport const DialogTrigger = defineComponent({\n name: \"DialogTrigger\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const { forwardRef, currentElement } = useForwardExpose()\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n // Focus returns here when the dialog closes\n onMounted(() => {\n rootContext.triggerElement.value = currentElement.value\n })\n\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) rootContext.onOpenToggle()\n }\n\n return () => {\n const open = rootContext.open.value\n return withDialogProps(\n firstElementChild(slots.default?.()),\n {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": open || false,\n \"aria-controls\": open ? rootContext.contentId : undefined,\n \"data-state\": open ? \"open\" : \"closed\",\n },\n onClick,\n forwardRef as (el: unknown) => void,\n )\n }\n },\n})\n\nconst CloseIcon = () =>\n h(\"svg\", { \"class\": s.CloseIcon, \"viewBox\": \"0 0 20 20\", \"width\": \"20\", \"height\": \"20\", \"aria-hidden\": \"true\" }, [\n h(\"path\", {\n fill: \"currentColor\",\n d: \"M5.22 5.22a.75.75 0 0 1 1.06 0L10 8.94l3.72-3.72a.75.75 0 1 1 1.06 1.06L11.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06L10 11.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06L8.94 10 5.22 6.28a.75.75 0 0 1 0-1.06\",\n }),\n ])\n\n/** Overlay and panel. `class` lands on the panel, like `className` in React. */\nexport const DialogContent = defineComponent({\n name: \"DialogContent\",\n inheritAttrs: false,\n props: {\n /** Panel width; numbers are pixels. @default 480 */\n width: { type: [Number, String] as PropType<number | string>, default: 480 },\n /** Renders the close button in the top corner. @default true */\n showClose: { type: Boolean, default: true },\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill: { type: Boolean, default: false },\n /**\n * Where the panel sits: centered, near the top, a sheet along the bottom,\n * a full-height panel on the start or end side, or the whole screen.\n * @default \"center\"\n */\n placement: { type: String as PropType<DialogPlacement>, default: \"center\" },\n /** Placement at 640px and below, such as a bottom sheet on phones. @default placement */\n mobilePlacement: String as PropType<Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">>,\n /** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */\n onOpenAutoFocus: Function as PropType<(event: Event) => void>,\n /** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */\n onCloseAutoFocus: Function as PropType<(event: Event) => void>,\n },\n setup(props, { slots, attrs }) {\n const { open, setOpen, titleCount, descriptionCount } = useDialogContext()\n const rootContext = injectDialogRootContext()\n // Radix's root makes the content id; Reka's trigger does, so a dialog\n // without one would render `id=\"\"`\n rootContext.contentId ||= useId(undefined, \"reka-dialog-content\")\n\n // Force-mounted content refocuses Reka's trigger the moment it closes.\n // Focus waits for the exit, as in Radix: the trigger is held back until\n // the content unmounts, where Reka's own close auto focus uses it.\n let closingTrigger: HTMLElement | undefined\n watch(\n open,\n (isOpen) => {\n if (isOpen) {\n if (closingTrigger) rootContext.triggerElement.value = closingTrigger\n closingTrigger = undefined\n } else {\n closingTrigger = rootContext.triggerElement.value\n rootContext.triggerElement.value = undefined\n }\n },\n { flush: \"sync\" },\n )\n const handleCloseAutoFocus = (event: Event) => {\n props.onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n if (closingTrigger) rootContext.triggerElement.value = closingTrigger\n closingTrigger = undefined\n }\n\n // Escape goes through the shared stack, as in React, so the dialog\n // closes before overlays opened earlier (a forced-open Tooltip)\n useEscCloseStack(open, () => {\n setOpen(false)\n })\n\n // The second click of a double click lands on the overlay: it must not undo the first\n let openedAt = 0\n\n // Radix's modal content: a Ctrl+click (macOS right click) does not dismiss\n const outsidePress = useDeferredPointerDownOutside((originalEvent) => {\n if (!originalEvent.ctrlKey && performance.now() - openedAt >= DOUBLE_CLICK) setOpen(false)\n })\n watch(\n open,\n (isOpen) => {\n if (isOpen) openedAt = performance.now()\n else outsidePress.reset()\n },\n { immediate: true },\n )\n\n let panelElement: HTMLElement | undefined\n let detachDrag: (() => void) | undefined\n const setPanelRef = (instance: unknown) => {\n const element = instance instanceof HTMLElement ? instance : undefined\n if (element === panelElement) return\n detachDrag?.()\n detachDrag = undefined\n panelElement = element\n if (element && props.mobilePlacement === \"bottom\") {\n detachDrag = attachSheetDrag(element, () => setOpen(false))\n }\n }\n\n let overlayElement: Element | undefined\n const setOverlayRef = (instance: unknown) => {\n const el = (instance as { $el?: unknown } | null)?.$el\n const element = el instanceof Element ? el : undefined\n if (element === overlayElement) return\n if (overlayElement) dismissableSurfaces.delete(overlayElement)\n overlayElement = element\n if (element) dismissableSurfaces.add(element)\n }\n\n const renderDialog = () =>\n h(\"div\", { key: \"dialog\" }, [\n h(RekaDialogOverlay, { class: s.Overlay, forceMount: true, ref: setOverlayRef }),\n h(\n RekaDialogContent,\n {\n \"forceMount\": true,\n \"class\": s.Content,\n \"style\": toCssVariables({ \"dialog-width\": props.width }),\n \"data-placement\": props.placement === \"center\" ? undefined : props.placement,\n \"data-mobile-placement\": props.mobilePlacement,\n \"data-pill\": props.pill ? \"\" : undefined,\n \"onOpenAutoFocus\": props.onOpenAutoFocus,\n \"onCloseAutoFocus\": handleCloseAutoFocus,\n // Radix labels and describes the content only by mounted parts\n ...(titleCount.value > 0 ? {} : { \"aria-labelledby\": undefined }),\n ...(descriptionCount.value > 0 ? {} : { \"aria-describedby\": undefined }),\n \"onEscapeKeyDown\": preventDefaultHandler,\n \"onPointerDownOutside\": outsidePress.onPointerDownOutside,\n \"onFocusOutside\": outsidePress.onFocusOutside,\n },\n {\n default: () => [\n h(\"div\", { class: [s.Panel, attrs.class], ref: setPanelRef }, [\n props.showClose\n ? h(DialogClose, null, {\n default: () => [\n h(\"button\", { \"type\": \"button\", \"class\": s.CloseButton, \"aria-label\": \"Close dialog\" }, [\n h(CloseIcon),\n ]),\n ],\n })\n : null,\n slots.default?.(),\n ]),\n ],\n },\n ),\n ])\n\n return () => {\n const { placement, mobilePlacement } = props\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || mobilePlacement === \"bottom\"\n return h(RekaDialogPortal, null, {\n default: () => [\n h(\n TransitionGroup,\n // A dialog mounted open enters too, as `v-if` and `open` together do\n {\n class: s.Transition,\n ...(crossesScreen ? overlayTimingLarge : overlayTiming),\n overlay: true,\n preventInitialTransition: false,\n },\n // `open && <div>` in React: closed still renders the empty wrapper\n { default: () => [open.value ? renderDialog() : createCommentVNode()] },\n ),\n ],\n })\n }\n },\n})\n\nexport const DialogHeader = defineComponent({\n name: \"DialogHeader\",\n setup(_props, { slots }) {\n return () => h(\"div\", { class: s.Header }, slots.default?.())\n },\n})\n\n/** The scrolling part between DialogHeader and DialogFooter: with it, only the body scrolls. */\nexport const DialogBody = defineComponent({\n name: \"DialogBody\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n return () => h(\"div\", { class: [s.Body, attrs.class] }, slots.default?.())\n },\n})\n\nexport const DialogFooter = defineComponent({\n name: \"DialogFooter\",\n setup(_props, { slots }) {\n return () => h(\"div\", { class: s.Footer }, slots.default?.())\n },\n})\n\n/** Counts a mounted part, as Radix's title and description counts do. */\nconst useMountedCount = (count: Ref<number>) => {\n onMounted(() => {\n count.value++\n })\n onBeforeUnmount(() => {\n count.value--\n })\n}\n\nexport const DialogTitle = defineComponent({\n name: \"DialogTitle\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().titleCount)\n return () => h(RekaDialogTitle, { class: s.Title }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogDescription = defineComponent({\n name: \"DialogDescription\",\n setup(_props, { slots }) {\n useMountedCount(useDialogContext().descriptionCount)\n return () => h(RekaDialogDescription, { class: s.Description }, { default: () => slots.default?.() })\n },\n})\n\nexport const DialogClose = defineComponent({\n name: \"DialogClose\",\n setup(_props, { slots }) {\n const rootContext = injectDialogRootContext()\n const onClick = (event: Event) => {\n if (!event.defaultPrevented) rootContext.onOpenChange(false)\n }\n return () => withDialogProps(firstElementChild(slots.default?.()), { type: \"button\" }, onClick)\n },\n})\n\nexport type DialogProps = InstanceType<typeof Dialog>[\"$props\"]\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/** DialogContent props; `class` lands on the panel, like `className` in React. */\nexport type DialogContentProps = InstanceType<typeof DialogContent>[\"$props\"] & { class?: HTMLAttributes[\"class\"] }\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its
|
|
2
|
+
// height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.
|
|
3
|
+
const GRIP = 44;
|
|
4
|
+
const CLOSE_SHARE = 0.3;
|
|
5
|
+
const CLOSE_SPEED = 0.5;
|
|
6
|
+
const REST = 100;
|
|
7
|
+
const SETTLE = 400;
|
|
8
|
+
const INTERACTIVE = "a, button, input, select, textarea, [role='button']";
|
|
9
|
+
export const attachSheetDrag = (panel, close) => {
|
|
10
|
+
let startY = null;
|
|
11
|
+
let lastY = 0;
|
|
12
|
+
let lastTime = 0;
|
|
13
|
+
let speed = 0;
|
|
14
|
+
const clear = () => {
|
|
15
|
+
panel.style.transition = "";
|
|
16
|
+
panel.style.transform = "";
|
|
17
|
+
};
|
|
18
|
+
const onStart = (event) => {
|
|
19
|
+
if (event.touches.length !== 1 || !window.matchMedia("(max-width: 767px)").matches)
|
|
20
|
+
return;
|
|
21
|
+
const { clientY } = event.touches[0];
|
|
22
|
+
if (clientY - panel.getBoundingClientRect().top > GRIP)
|
|
23
|
+
return;
|
|
24
|
+
if (event.target?.closest?.(INTERACTIVE))
|
|
25
|
+
return;
|
|
26
|
+
startY = clientY;
|
|
27
|
+
lastY = clientY;
|
|
28
|
+
lastTime = event.timeStamp;
|
|
29
|
+
speed = 0;
|
|
30
|
+
};
|
|
31
|
+
const onMove = (event) => {
|
|
32
|
+
if (startY === null)
|
|
33
|
+
return;
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
const { clientY } = event.touches[0];
|
|
36
|
+
speed = (clientY - lastY) / Math.max(1, event.timeStamp - lastTime);
|
|
37
|
+
lastY = clientY;
|
|
38
|
+
lastTime = event.timeStamp;
|
|
39
|
+
panel.style.transition = "none";
|
|
40
|
+
panel.style.transform = `translateY(${Math.max(0, clientY - startY)}px)`;
|
|
41
|
+
};
|
|
42
|
+
const onEnd = (event) => {
|
|
43
|
+
if (startY === null)
|
|
44
|
+
return;
|
|
45
|
+
const travelled = lastY - startY;
|
|
46
|
+
// A finger that rested before lifting is no flick
|
|
47
|
+
const flick = speed > CLOSE_SPEED && event.timeStamp - lastTime < REST;
|
|
48
|
+
startY = null;
|
|
49
|
+
if (travelled <= 0) {
|
|
50
|
+
clear();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {
|
|
54
|
+
close();
|
|
55
|
+
// Something may keep it open, unsaved changes for one
|
|
56
|
+
window.setTimeout(() => {
|
|
57
|
+
if (panel.isConnected)
|
|
58
|
+
clear();
|
|
59
|
+
}, SETTLE);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
panel.style.transition = "transform 250ms var(--cubic-enter)";
|
|
63
|
+
panel.style.transform = "";
|
|
64
|
+
panel.addEventListener("transitionend", clear, { once: true });
|
|
65
|
+
};
|
|
66
|
+
panel.addEventListener("touchstart", onStart, { passive: true });
|
|
67
|
+
panel.addEventListener("touchmove", onMove, { passive: false });
|
|
68
|
+
panel.addEventListener("touchend", onEnd);
|
|
69
|
+
panel.addEventListener("touchcancel", onEnd);
|
|
70
|
+
return () => {
|
|
71
|
+
panel.removeEventListener("touchstart", onStart);
|
|
72
|
+
panel.removeEventListener("touchmove", onMove);
|
|
73
|
+
panel.removeEventListener("touchend", onEnd);
|
|
74
|
+
panel.removeEventListener("touchcancel", onEnd);
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=sheetDrag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheetDrag.js","sourceRoot":"","sources":["../../../../src/components/Dialog/sheetDrag.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,mGAAmG;AACnG,MAAM,IAAI,GAAG,EAAE,CAAA;AACf,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,IAAI,GAAG,GAAG,CAAA;AAChB,MAAM,MAAM,GAAG,GAAG,CAAA;AAClB,MAAM,WAAW,GAAG,qDAAqD,CAAA;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAkB,EAAE,KAAiB,EAAE,EAAE;IACvE,IAAI,MAAM,GAAkB,IAAI,CAAA;IAChC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,CAAA;QAC3B,KAAK,CA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,GAAG,EAAE;QACV,KAAK,CAAC,mBAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;QAChD,KAAK,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAC9C,KAAK,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAC5C,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;IACjD,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["// A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its\n// height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.\nconst GRIP = 44\nconst CLOSE_SHARE = 0.3\nconst CLOSE_SPEED = 0.5\nconst REST = 100\nconst SETTLE = 400\nconst INTERACTIVE = \"a, button, input, select, textarea, [role='button']\"\n\nexport const attachSheetDrag = (panel: HTMLElement, close: () => void) => {\n let startY: number | null = null\n let lastY = 0\n let lastTime = 0\n let speed = 0\n\n const clear = () => {\n panel.style.transition = \"\"\n panel.style.transform = \"\"\n }\n\n const onStart = (event: TouchEvent) => {\n if (event.touches.length !== 1 || !window.matchMedia(\"(max-width: 767px)\").matches) return\n const { clientY } = event.touches[0]\n if (clientY - panel.getBoundingClientRect().top > GRIP) return\n if ((event.target as Element | null)?.closest?.(INTERACTIVE)) return\n startY = clientY\n lastY = clientY\n lastTime = event.timeStamp\n speed = 0\n }\n\n const onMove = (event: TouchEvent) => {\n if (startY === null) return\n event.preventDefault()\n const { clientY } = event.touches[0]\n speed = (clientY - lastY) / Math.max(1, event.timeStamp - lastTime)\n lastY = clientY\n lastTime = event.timeStamp\n panel.style.transition = \"none\"\n panel.style.transform = `translateY(${Math.max(0, clientY - startY)}px)`\n }\n\n const onEnd = (event: TouchEvent) => {\n if (startY === null) return\n const travelled = lastY - startY\n // A finger that rested before lifting is no flick\n const flick = speed > CLOSE_SPEED && event.timeStamp - lastTime < REST\n startY = null\n if (travelled <= 0) {\n clear()\n return\n }\n if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {\n close()\n // Something may keep it open, unsaved changes for one\n window.setTimeout(() => {\n if (panel.isConnected) clear()\n }, SETTLE)\n return\n }\n panel.style.transition = \"transform 250ms var(--cubic-enter)\"\n panel.style.transform = \"\"\n panel.addEventListener(\"transitionend\", clear, { once: true })\n }\n\n panel.addEventListener(\"touchstart\", onStart, { passive: true })\n panel.addEventListener(\"touchmove\", onMove, { passive: false })\n panel.addEventListener(\"touchend\", onEnd)\n panel.addEventListener(\"touchcancel\", onEnd)\n\n return () => {\n panel.removeEventListener(\"touchstart\", onStart)\n panel.removeEventListener(\"touchmove\", onMove)\n panel.removeEventListener(\"touchend\", onEnd)\n panel.removeEventListener(\"touchcancel\", onEnd)\n }\n}\n"]}
|
|
@@ -112,8 +112,10 @@ const FieldComponent = defineComponent({
|
|
|
112
112
|
size: String,
|
|
113
113
|
/** Shows a required asterisk after the label. Visual only: no `required` attribute. @default false */
|
|
114
114
|
required: { type: Boolean, default: false },
|
|
115
|
-
/** Layout direction of label and control. @default "vertical" */
|
|
116
|
-
orientation:
|
|
115
|
+
/** Layout direction of label and control. @default "horizontal" on a `row`, else "vertical" */
|
|
116
|
+
orientation: String,
|
|
117
|
+
/** One line of a FieldGroup: label at the start, control at the end. @default false */
|
|
118
|
+
row: { type: Boolean, default: false },
|
|
117
119
|
/** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */
|
|
118
120
|
id: String,
|
|
119
121
|
/** Optically aligns the control's text with surrounding content; passed to the control. */
|
|
@@ -123,7 +125,8 @@ const FieldComponent = defineComponent({
|
|
|
123
125
|
setup(props, { attrs, slots }) {
|
|
124
126
|
const generatedId = useId();
|
|
125
127
|
return () => {
|
|
126
|
-
const { required,
|
|
128
|
+
const { required, row, opticallyAlign } = props;
|
|
129
|
+
const orientation = props.orientation ?? (row ? "horizontal" : "vertical");
|
|
127
130
|
const fieldId = props.id || `field-${generatedId}`;
|
|
128
131
|
const labelId = `${fieldId}-label`;
|
|
129
132
|
const description = slots.description ? slots.description() : props.description;
|
|
@@ -163,10 +166,12 @@ const FieldComponent = defineComponent({
|
|
|
163
166
|
required ? h("span", { "class": s.RequiredIndicator, "aria-hidden": "true" }, "*") : null,
|
|
164
167
|
]);
|
|
165
168
|
return h("div", {
|
|
169
|
+
...(row && attrs),
|
|
166
170
|
"class": clsx(s.Field, attrs.class),
|
|
167
171
|
"data-size": size,
|
|
168
172
|
"data-orientation": orientation,
|
|
169
173
|
"data-optically-align": opticallyAlign,
|
|
174
|
+
"data-row": row ? "" : undefined,
|
|
170
175
|
}, [
|
|
171
176
|
h("div", { class: s.LabelGroup }, [
|
|
172
177
|
hasLabelAction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/components/Field/Field.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,CAAC,EACD,OAAO,EACP,KAAK,GAMN,MAAM,KAAK,CAAA;AAEZ,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,kDAAkD,CAAA;AAsChE,MAAM,aAAa,GAAyB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAE/G,mFAAmF;AACnF,MAAM,QAAQ,GAAG,CAAC,MAAuB,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;IAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM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CAAC;aACH,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,mFAAmF;AACnF,MAAM,CAAC,MAAM,KAAK,GAAG,cAA4E,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n Comment,\n Fragment,\n Static,\n Text,\n camelize,\n cloneVNode,\n defineComponent,\n h,\n isVNode,\n useId,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport type { ControlSize } from \"@plexui/styles/types\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/Field/Field.module.css\"\n\n// Vue port of packages/ui/src/components/Field/Field.tsx.\n//\n// - `label`, `description` and `errorMessage` take a string prop or a slot of\n// the same name (the slot wins), like React's ReactNode props.\n// - Children: React accepts an element, which Field clones with the field\n// props, or a render prop `(fieldProps) => ReactNode`, which it leaves alone.\n// Both are the default slot here, which receives the field props:\n// - a slot that reads them (`v-slot=\"fieldProps\"` + `v-bind=\"fieldProps\"`,\n// `v-slot=\"{ id }\"`, `(fieldProps) => h(...)`) is the render prop: its\n// content renders as it is.\n// - a slot that does not read them and holds exactly one element or\n// component gets it cloned like React's `cloneElement`: `opticallyAlign`\n// replaces the child's own, the child's own `id` stays and the label's\n// `for` follows it, `aria-describedby` is joined after the child's own\n// ids, and an explicit `aria-invalid` on the child wins. Template\n// comments do not count as children (JSX comments); the\n// placeholder of a `v-if` that renders nothing does, like `{false}` in a\n// React children array, so `<A v-if=\"x\" /><Input />` is not cloned.\n// - anything else (text, several roots, a `v-for` list) renders as it is,\n// like a React child that is not a single element.\n// - content a wrapper forwards with `<slot />` counts as its own roots, as\n// React's `children` passed on to Field are the elements themselves.\n// - As in React only `class` reaches the root element; other attributes are\n// dropped.\n\nexport type FieldChildProps = {\n id: string\n /** The label's id. Bind it to a control that the label's `for` cannot name, such as a Select trigger. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n \"aria-invalid\"?: boolean\n opticallyAlign?: \"start\" | \"end\"\n}\n\ntype Props = Record<string, unknown>\n\nconst CONTROL_SIZES: ReadonlySet<unknown> = new Set([\"3xs\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\"])\n\n/** The slot props, recording whether the slot read them (the render-prop form). */\nconst trackUse = (target: FieldChildProps) => {\n const state = { used: false }\n const proxy = new Proxy(target, {\n get(object, key, receiver) {\n state.used = true\n return Reflect.get(object, key, receiver)\n },\n has(object, key) {\n state.used = true\n return Reflect.has(object, key)\n },\n ownKeys(object) {\n state.used = true\n return Reflect.ownKeys(object)\n },\n getOwnPropertyDescriptor(object, key) {\n state.used = true\n return Reflect.getOwnPropertyDescriptor(object, key)\n },\n })\n return { proxy, state }\n}\n\n/** Like React's `isValidElement` for a slot root: an element or a component. */\nconst isElementVNode = (node: VNode) => {\n const { type } = node\n if (type === Fragment || type === Text || type === Comment || type === Static) return false\n if (typeof type === \"object\" && type !== null && (\"__isTeleport\" in type || \"__isSuspense\" in type)) return false\n return true\n}\n\n/**\n * Template comments (`<!-- note -->`) are no children, like JSX comments.\n * The empty placeholder of a `v-if` that renders nothing (or of a `false`\n * child) still counts, like `{false}` in a React children array.\n */\nconst isTemplateComment = (node: VNodeArrayChildren[number]) =>\n isVNode(node) && node.type === Comment && !!node.children && node.children !== \"v-if\"\n\n/**\n * Unwraps content forwarded through a wrapper's `<slot />`: the fragment\n * `renderSlot` creates, keyed `_<slot name>`.\n */\nconst unwrapForwardedSlots = (nodes: VNodeArrayChildren): VNodeArrayChildren =>\n nodes.flatMap((node) =>\n isVNode(node) &&\n node.type === Fragment &&\n typeof node.key === \"string\" &&\n node.key.startsWith(\"_\") &&\n Array.isArray(node.children)\n ? unwrapForwardedSlots(node.children)\n : [node],\n )\n\n/** The one element a non-render-prop slot holds, if it holds exactly one. */\nconst singleElement = (nodes: VNodeArrayChildren): VNode | undefined => {\n const roots = unwrapForwardedSlots(nodes).filter((node) => !isTemplateComment(node))\n if (roots.length !== 1) return undefined\n const [root] = roots\n return isVNode(root) && isElementVNode(root) ? root : undefined\n}\n\n/** A child prop under its attribute name or its camelCase prop name. */\nconst childProp = (props: Props, name: string) => props[name] ?? props[camelize(name)]\n\n/**\n * `cloneElement(child, fieldProps)` with React Field's merging rules. A child\n * without its own name (`aria-label`, `aria-labelledby`, `label`, a `#label`\n * slot) is also labelled by the field's label, which names triggers `for`\n * cannot reach.\n */\nconst cloneWithFieldProps = (child: VNode, fieldChildProps: FieldChildProps, labelId: string): VNode => {\n const own: Props = { ...(child.props ?? {}) }\n const childDescribedBy = childProp(own, \"aria-describedby\") as string | undefined\n const childInvalid = childProp(own, \"aria-invalid\")\n const childSlots = child.children\n const childNamed =\n childProp(own, \"aria-label\") != null ||\n childProp(own, \"aria-labelledby\") != null ||\n own.label != null ||\n (childSlots != null && typeof childSlots === \"object\" && !Array.isArray(childSlots) && \"label\" in childSlots)\n\n const overrides: Props = {\n ...fieldChildProps,\n // Merge with the child's own associations instead of overwriting them\n \"aria-describedby\": [childDescribedBy, fieldChildProps[\"aria-describedby\"]].filter(Boolean).join(\" \") || undefined,\n \"aria-invalid\": childInvalid ?? fieldChildProps[\"aria-invalid\"],\n ...(!childNamed && { \"aria-labelledby\": labelId }),\n }\n\n // One spelling per prop, so the field's value is the one that applies\n for (const key of Object.keys(overrides)) {\n for (const spelling of [key, camelize(key), key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)]) {\n delete own[spelling]\n }\n }\n\n return cloneVNode({ ...child, props: own } as VNode, overrides)\n}\n\nconst FieldComponent = defineComponent({\n name: \"Field\",\n inheritAttrs: false,\n props: {\n /** Label text for the field (or the `label` slot) */\n label: String,\n /** Helper text below the label, linked via `aria-describedby` (or the `description` slot) */\n description: String,\n /**\n * Error message below the control (or the `errorMessage` slot). When set,\n * the control gets `aria-invalid=\"true\"`. Rendered with FieldError.\n */\n errorMessage: String,\n /** Content at the end of the label row, such as a link that acts on the field (or the `labelAction` slot) */\n labelAction: String,\n /** Font size of the label, to match the control's size. @default the child control's `size`, else \"md\" */\n size: String as PropType<ControlSize>,\n /** Shows a required asterisk after the label. Visual only: no `required` attribute. @default false */\n required: { type: Boolean, default: false },\n /** Layout direction of label and control. @default \"vertical\" */\n orientation: { type: String as PropType<\"vertical\" | \"horizontal\">, default: \"vertical\" },\n /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */\n id: String,\n /** Optically aligns the control's text with surrounding content; passed to the control. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n },\n slots: Object as SlotsType<{\n /** The control. Read the props to render them yourself (React's render prop). */\n default?: (fieldProps: FieldChildProps) => VNodeChild\n label?: () => VNodeChild\n labelAction?: () => VNodeChild\n description?: () => VNodeChild\n errorMessage?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const generatedId = useId()\n\n return () => {\n const { required, orientation, opticallyAlign } = props\n const fieldId = props.id || `field-${generatedId}`\n const labelId = `${fieldId}-label`\n\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const errorMessage = slots.errorMessage ? slots.errorMessage() : props.errorMessage\n const hasError = slots.errorMessage ? hasContent(errorMessage as VNodeArrayChildren) : !!errorMessage\n\n const descriptionId = hasDescription ? `${fieldId}-description` : undefined\n const errorId = hasError ? `${fieldId}-error` : undefined\n\n // Build aria-describedby from description + error IDs\n const ariaDescribedBy = [descriptionId, errorId].filter(Boolean).join(\" \") || undefined\n const invalid = hasError\n\n // Props to inject into the child control\n const fieldChildProps: FieldChildProps = {\n \"id\": fieldId,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": invalid || undefined,\n ...(opticallyAlign && { opticallyAlign }),\n }\n\n // Resolve the children\n let resolvedChildren: VNodeArrayChildren | undefined\n let childSize: unknown\n // The control's id, which the label's `for` has to match\n let controlId = fieldId\n if (slots.default) {\n const { proxy, state } = trackUse({ ...fieldChildProps, \"aria-labelledby\": labelId })\n const nodes = slots.default(proxy) as VNodeArrayChildren\n const child = state.used ? undefined : singleElement(nodes)\n childSize = child?.props?.size\n controlId = (child?.props?.id as string | undefined) || fieldId\n resolvedChildren = child ? [cloneWithFieldProps(child, { ...fieldChildProps, id: controlId }, labelId)] : nodes\n }\n const size = props.size ?? (CONTROL_SIZES.has(childSize) ? (childSize as ControlSize) : \"md\")\n\n const labelAction = slots.labelAction ? slots.labelAction() : props.labelAction\n const hasLabelAction = slots.labelAction ? hasContent(labelAction as VNodeArrayChildren) : !!labelAction\n const labelElement = h(\"label\", { class: s.Label, id: labelId, for: controlId }, [\n slots.label ? slots.label() : props.label,\n required ? h(\"span\", { \"class\": s.RequiredIndicator, \"aria-hidden\": \"true\" }, \"*\") : null,\n ])\n\n return h(\n \"div\",\n {\n \"class\": clsx(s.Field, attrs.class as ClassValue),\n \"data-size\": size,\n \"data-orientation\": orientation,\n \"data-optically-align\": opticallyAlign,\n },\n [\n h(\"div\", { class: s.LabelGroup }, [\n hasLabelAction\n ? h(\"div\", { class: s.LabelRow }, [labelElement, h(\"div\", { class: s.LabelAction }, [labelAction as VNodeChild])])\n : labelElement,\n hasDescription ? h(\"div\", { class: s.Description, id: descriptionId }, [description as VNodeChild]) : null,\n ]),\n h(\"div\", { class: s.Content }, [\n h(\"div\", { class: s.Control }, resolvedChildren),\n hasError ? h(FieldError, { id: errorId }, () => [errorMessage as VNodeChild]) : null,\n ]),\n ],\n )\n }\n },\n})\n\ntype FieldOwnProps = InstanceType<typeof FieldComponent>[\"$props\"]\n\n/** Field props; `class` reaches the root element. */\nexport type FieldProps = FieldOwnProps & { class?: ClassValue }\n\n/** Form field wrapper with label, description, error and accessibility linking. */\nexport const Field = FieldComponent as typeof FieldComponent & { new (): { $props: FieldProps } }\n"]}
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/components/Field/Field.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE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AU,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;aACjC,EACD;gBACE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,EAAE;oBAChC,cAAc;wBACZ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAyB,CAAC,CAAC,CAAC,CAAC;wBAClH,CAAC,CAAC,YAAY;oBAChB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,CAAC,WAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;iBAC3G,CAAC;gBACF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC7B,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,gBAAgB,CAAC;oBAChD,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,YAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;iBACrF,CAAC;aACH,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,mFAAmF;AACnF,MAAM,CAAC,MAAM,KAAK,GAAG,cAA4E,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n Comment,\n Fragment,\n Static,\n Text,\n camelize,\n cloneVNode,\n defineComponent,\n h,\n isVNode,\n useId,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport type { ControlSize } from \"@plexui/styles/types\"\nimport { FieldError } from \"../FieldError/index.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/Field/Field.module.css\"\n\n// Vue port of packages/ui/src/components/Field/Field.tsx.\n//\n// - `label`, `description` and `errorMessage` take a string prop or a slot of\n// the same name (the slot wins), like React's ReactNode props.\n// - Children: React accepts an element, which Field clones with the field\n// props, or a render prop `(fieldProps) => ReactNode`, which it leaves alone.\n// Both are the default slot here, which receives the field props:\n// - a slot that reads them (`v-slot=\"fieldProps\"` + `v-bind=\"fieldProps\"`,\n// `v-slot=\"{ id }\"`, `(fieldProps) => h(...)`) is the render prop: its\n// content renders as it is.\n// - a slot that does not read them and holds exactly one element or\n// component gets it cloned like React's `cloneElement`: `opticallyAlign`\n// replaces the child's own, the child's own `id` stays and the label's\n// `for` follows it, `aria-describedby` is joined after the child's own\n// ids, and an explicit `aria-invalid` on the child wins. Template\n// comments do not count as children (JSX comments); the\n// placeholder of a `v-if` that renders nothing does, like `{false}` in a\n// React children array, so `<A v-if=\"x\" /><Input />` is not cloned.\n// - anything else (text, several roots, a `v-for` list) renders as it is,\n// like a React child that is not a single element.\n// - content a wrapper forwards with `<slot />` counts as its own roots, as\n// React's `children` passed on to Field are the elements themselves.\n// - As in React only `class` reaches the root element; other attributes are\n// dropped. On a `row` they all reach it, as React's rest props do.\n\nexport type FieldChildProps = {\n id: string\n /** The label's id. Bind it to a control that the label's `for` cannot name, such as a Select trigger. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n \"aria-invalid\"?: boolean\n opticallyAlign?: \"start\" | \"end\"\n}\n\ntype Props = Record<string, unknown>\n\nconst CONTROL_SIZES: ReadonlySet<unknown> = new Set([\"3xs\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\"])\n\n/** The slot props, recording whether the slot read them (the render-prop form). */\nconst trackUse = (target: FieldChildProps) => {\n const state = { used: false }\n const proxy = new Proxy(target, {\n get(object, key, receiver) {\n state.used = true\n return Reflect.get(object, key, receiver)\n },\n has(object, key) {\n state.used = true\n return Reflect.has(object, key)\n },\n ownKeys(object) {\n state.used = true\n return Reflect.ownKeys(object)\n },\n getOwnPropertyDescriptor(object, key) {\n state.used = true\n return Reflect.getOwnPropertyDescriptor(object, key)\n },\n })\n return { proxy, state }\n}\n\n/** Like React's `isValidElement` for a slot root: an element or a component. */\nconst isElementVNode = (node: VNode) => {\n const { type } = node\n if (type === Fragment || type === Text || type === Comment || type === Static) return false\n if (typeof type === \"object\" && type !== null && (\"__isTeleport\" in type || \"__isSuspense\" in type)) return false\n return true\n}\n\n/**\n * Template comments (`<!-- note -->`) are no children, like JSX comments.\n * The empty placeholder of a `v-if` that renders nothing (or of a `false`\n * child) still counts, like `{false}` in a React children array.\n */\nconst isTemplateComment = (node: VNodeArrayChildren[number]) =>\n isVNode(node) && node.type === Comment && !!node.children && node.children !== \"v-if\"\n\n/**\n * Unwraps content forwarded through a wrapper's `<slot />`: the fragment\n * `renderSlot` creates, keyed `_<slot name>`.\n */\nconst unwrapForwardedSlots = (nodes: VNodeArrayChildren): VNodeArrayChildren =>\n nodes.flatMap((node) =>\n isVNode(node) &&\n node.type === Fragment &&\n typeof node.key === \"string\" &&\n node.key.startsWith(\"_\") &&\n Array.isArray(node.children)\n ? unwrapForwardedSlots(node.children)\n : [node],\n )\n\n/** The one element a non-render-prop slot holds, if it holds exactly one. */\nconst singleElement = (nodes: VNodeArrayChildren): VNode | undefined => {\n const roots = unwrapForwardedSlots(nodes).filter((node) => !isTemplateComment(node))\n if (roots.length !== 1) return undefined\n const [root] = roots\n return isVNode(root) && isElementVNode(root) ? root : undefined\n}\n\n/** A child prop under its attribute name or its camelCase prop name. */\nconst childProp = (props: Props, name: string) => props[name] ?? props[camelize(name)]\n\n/**\n * `cloneElement(child, fieldProps)` with React Field's merging rules. A child\n * without its own name (`aria-label`, `aria-labelledby`, `label`, a `#label`\n * slot) is also labelled by the field's label, which names triggers `for`\n * cannot reach.\n */\nconst cloneWithFieldProps = (child: VNode, fieldChildProps: FieldChildProps, labelId: string): VNode => {\n const own: Props = { ...(child.props ?? {}) }\n const childDescribedBy = childProp(own, \"aria-describedby\") as string | undefined\n const childInvalid = childProp(own, \"aria-invalid\")\n const childSlots = child.children\n const childNamed =\n childProp(own, \"aria-label\") != null ||\n childProp(own, \"aria-labelledby\") != null ||\n own.label != null ||\n (childSlots != null && typeof childSlots === \"object\" && !Array.isArray(childSlots) && \"label\" in childSlots)\n\n const overrides: Props = {\n ...fieldChildProps,\n // Merge with the child's own associations instead of overwriting them\n \"aria-describedby\": [childDescribedBy, fieldChildProps[\"aria-describedby\"]].filter(Boolean).join(\" \") || undefined,\n \"aria-invalid\": childInvalid ?? fieldChildProps[\"aria-invalid\"],\n ...(!childNamed && { \"aria-labelledby\": labelId }),\n }\n\n // One spelling per prop, so the field's value is the one that applies\n for (const key of Object.keys(overrides)) {\n for (const spelling of [key, camelize(key), key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)]) {\n delete own[spelling]\n }\n }\n\n return cloneVNode({ ...child, props: own } as VNode, overrides)\n}\n\nconst FieldComponent = defineComponent({\n name: \"Field\",\n inheritAttrs: false,\n props: {\n /** Label text for the field (or the `label` slot) */\n label: String,\n /** Helper text below the label, linked via `aria-describedby` (or the `description` slot) */\n description: String,\n /**\n * Error message below the control (or the `errorMessage` slot). When set,\n * the control gets `aria-invalid=\"true\"`. Rendered with FieldError.\n */\n errorMessage: String,\n /** Content at the end of the label row, such as a link that acts on the field (or the `labelAction` slot) */\n labelAction: String,\n /** Font size of the label, to match the control's size. @default the child control's `size`, else \"md\" */\n size: String as PropType<ControlSize>,\n /** Shows a required asterisk after the label. Visual only: no `required` attribute. @default false */\n required: { type: Boolean, default: false },\n /** Layout direction of label and control. @default \"horizontal\" on a `row`, else \"vertical\" */\n orientation: String as PropType<\"vertical\" | \"horizontal\">,\n /** One line of a FieldGroup: label at the start, control at the end. @default false */\n row: { type: Boolean, default: false },\n /** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */\n id: String,\n /** Optically aligns the control's text with surrounding content; passed to the control. */\n opticallyAlign: String as PropType<\"start\" | \"end\">,\n },\n slots: Object as SlotsType<{\n /** The control. Read the props to render them yourself (React's render prop). */\n default?: (fieldProps: FieldChildProps) => VNodeChild\n label?: () => VNodeChild\n labelAction?: () => VNodeChild\n description?: () => VNodeChild\n errorMessage?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const generatedId = useId()\n\n return () => {\n const { required, row, opticallyAlign } = props\n const orientation = props.orientation ?? (row ? \"horizontal\" : \"vertical\")\n const fieldId = props.id || `field-${generatedId}`\n const labelId = `${fieldId}-label`\n\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const errorMessage = slots.errorMessage ? slots.errorMessage() : props.errorMessage\n const hasError = slots.errorMessage ? hasContent(errorMessage as VNodeArrayChildren) : !!errorMessage\n\n const descriptionId = hasDescription ? `${fieldId}-description` : undefined\n const errorId = hasError ? `${fieldId}-error` : undefined\n\n // Build aria-describedby from description + error IDs\n const ariaDescribedBy = [descriptionId, errorId].filter(Boolean).join(\" \") || undefined\n const invalid = hasError\n\n // Props to inject into the child control\n const fieldChildProps: FieldChildProps = {\n \"id\": fieldId,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": invalid || undefined,\n ...(opticallyAlign && { opticallyAlign }),\n }\n\n // Resolve the children\n let resolvedChildren: VNodeArrayChildren | undefined\n let childSize: unknown\n // The control's id, which the label's `for` has to match\n let controlId = fieldId\n if (slots.default) {\n const { proxy, state } = trackUse({ ...fieldChildProps, \"aria-labelledby\": labelId })\n const nodes = slots.default(proxy) as VNodeArrayChildren\n const child = state.used ? undefined : singleElement(nodes)\n childSize = child?.props?.size\n controlId = (child?.props?.id as string | undefined) || fieldId\n resolvedChildren = child ? [cloneWithFieldProps(child, { ...fieldChildProps, id: controlId }, labelId)] : nodes\n }\n const size = props.size ?? (CONTROL_SIZES.has(childSize) ? (childSize as ControlSize) : \"md\")\n\n const labelAction = slots.labelAction ? slots.labelAction() : props.labelAction\n const hasLabelAction = slots.labelAction ? hasContent(labelAction as VNodeArrayChildren) : !!labelAction\n const labelElement = h(\"label\", { class: s.Label, id: labelId, for: controlId }, [\n slots.label ? slots.label() : props.label,\n required ? h(\"span\", { \"class\": s.RequiredIndicator, \"aria-hidden\": \"true\" }, \"*\") : null,\n ])\n\n return h(\n \"div\",\n {\n ...(row && attrs),\n \"class\": clsx(s.Field, attrs.class as ClassValue),\n \"data-size\": size,\n \"data-orientation\": orientation,\n \"data-optically-align\": opticallyAlign,\n \"data-row\": row ? \"\" : undefined,\n },\n [\n h(\"div\", { class: s.LabelGroup }, [\n hasLabelAction\n ? h(\"div\", { class: s.LabelRow }, [labelElement, h(\"div\", { class: s.LabelAction }, [labelAction as VNodeChild])])\n : labelElement,\n hasDescription ? h(\"div\", { class: s.Description, id: descriptionId }, [description as VNodeChild]) : null,\n ]),\n h(\"div\", { class: s.Content }, [\n h(\"div\", { class: s.Control }, resolvedChildren),\n hasError ? h(FieldError, { id: errorId }, () => [errorMessage as VNodeChild]) : null,\n ]),\n ],\n )\n }\n },\n})\n\ntype FieldOwnProps = InstanceType<typeof FieldComponent>[\"$props\"]\n\n/** Field props; `class` reaches the root element. */\nexport type FieldProps = FieldOwnProps & { class?: ClassValue }\n\n/** Form field wrapper with label, description, error and accessibility linking. */\nexport const Field = FieldComponent as typeof FieldComponent & { new (): { $props: FieldProps } }\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import clsx, {} from "clsx";
|
|
2
|
+
import { defineComponent, h, useId } from "vue";
|
|
3
|
+
import { hasContent } from "../../lib/slotContent.js";
|
|
4
|
+
import s from "@plexui/styles/components/FieldGroup/FieldGroup.module.css";
|
|
5
|
+
// Vue port of packages/ui/src/components/FieldGroup/FieldGroup.tsx.
|
|
6
|
+
//
|
|
7
|
+
// - `title` and `description` take a string prop or a slot of the same name,
|
|
8
|
+
// like React's ReactNode props. `action` and `footer` are slots here.
|
|
9
|
+
// - Attributes reach the root `section`, as React's rest props do.
|
|
10
|
+
const FieldGroupComponent = defineComponent({
|
|
11
|
+
name: "FieldGroup",
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
props: {
|
|
14
|
+
/** Heading over the block (or the `title` slot); it names the group */
|
|
15
|
+
title: String,
|
|
16
|
+
/** Line under the title (or the `description` slot) */
|
|
17
|
+
description: String,
|
|
18
|
+
/** Class for the block that holds the rows */
|
|
19
|
+
bodyClass: [String, Array, Object],
|
|
20
|
+
},
|
|
21
|
+
slots: Object,
|
|
22
|
+
setup(props, { attrs, slots }) {
|
|
23
|
+
const titleId = `field-group-${useId()}`;
|
|
24
|
+
return () => {
|
|
25
|
+
const title = slots.title ? slots.title() : props.title;
|
|
26
|
+
const hasTitle = slots.title ? hasContent(title) : !!title;
|
|
27
|
+
const description = slots.description ? slots.description() : props.description;
|
|
28
|
+
const hasDescription = slots.description ? hasContent(description) : !!description;
|
|
29
|
+
const action = slots.action?.();
|
|
30
|
+
const hasAction = !!action && hasContent(action);
|
|
31
|
+
return h("section", {
|
|
32
|
+
"role": "group",
|
|
33
|
+
"aria-labelledby": hasTitle ? titleId : undefined,
|
|
34
|
+
...attrs,
|
|
35
|
+
"class": clsx(s.FieldGroup, attrs.class),
|
|
36
|
+
}, [
|
|
37
|
+
hasTitle || hasDescription || hasAction
|
|
38
|
+
? h("div", { class: s.Header }, [
|
|
39
|
+
h("div", { class: s.HeaderText }, [
|
|
40
|
+
hasTitle ? h("h2", { class: s.Title, id: titleId }, [title]) : null,
|
|
41
|
+
hasDescription ? h("p", { class: s.Description }, [description]) : null,
|
|
42
|
+
]),
|
|
43
|
+
hasAction ? action : null,
|
|
44
|
+
])
|
|
45
|
+
: null,
|
|
46
|
+
h("div", { class: clsx(s.Body, props.bodyClass) }, [slots.default?.()]),
|
|
47
|
+
slots.footer?.(),
|
|
48
|
+
]);
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
/** A titled block of rows: `Field row` lines with hairlines between them. */
|
|
53
|
+
export const FieldGroup = FieldGroupComponent;
|
|
54
|
+
//# sourceMappingURL=FieldGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../../src/components/FieldGroup/FieldGroup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAA2E,MAAM,KAAK,CAAA;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,4DAA4D,CAAA;AAE1E,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,mEAAmE;AAEnE,MAAM,mBAAmB,GAAG,eAAe,CAAC;IAC1C,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,uEAAuE;QACvE,KAAK,EAAE,MAAM;QACb,uDAAuD;QACvD,WAAW,EAAE,MAAM;QACnB,8CAA8C;QAC9C,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAyB;KAC3D;IACD,KAAK,EAAE,MASL;IACF,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAC3B,MAAM,OAAO,GAAG,eAAe,KAAK,EAAE,EAAE,CAAA;QAExC,OAAO,GAAG,EAAE;YACV,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAA;YACvD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAA2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BACtF,CAAC;wBACF,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;qBAC1B,CAAC;oBACJ,CAAC,CAAC,IAAI;gBACR,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACvE,KAAK,CAAC,MAAM,EAAE,EAAE;aACjB,CACF,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG,mBAA2F,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport { defineComponent, h, useId, type PropType, type SlotsType, type VNodeArrayChildren, type VNodeChild } from \"vue\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/FieldGroup/FieldGroup.module.css\"\n\n// Vue port of packages/ui/src/components/FieldGroup/FieldGroup.tsx.\n//\n// - `title` and `description` take a string prop or a slot of the same name,\n// like React's ReactNode props. `action` and `footer` are slots here.\n// - Attributes reach the root `section`, as React's rest props do.\n\nconst FieldGroupComponent = defineComponent({\n name: \"FieldGroup\",\n inheritAttrs: false,\n props: {\n /** Heading over the block (or the `title` slot); it names the group */\n title: String,\n /** Line under the title (or the `description` slot) */\n description: String,\n /** Class for the block that holds the rows */\n bodyClass: [String, Array, Object] as PropType<ClassValue>,\n },\n slots: Object as SlotsType<{\n /** The rows: `Field row`, or rows of your own. */\n default?: () => VNodeChild\n title?: () => VNodeChild\n description?: () => VNodeChild\n /** Content at the end of the header, such as a button */\n action?: () => VNodeChild\n /** Content under the block, such as a note */\n footer?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n const titleId = `field-group-${useId()}`\n\n return () => {\n const title = slots.title ? slots.title() : props.title\n const hasTitle = slots.title ? hasContent(title as VNodeArrayChildren) : !!title\n const description = slots.description ? slots.description() : props.description\n const hasDescription = slots.description ? hasContent(description as VNodeArrayChildren) : !!description\n const action = slots.action?.()\n const hasAction = !!action && hasContent(action as VNodeArrayChildren)\n\n return h(\n \"section\",\n {\n \"role\": \"group\",\n \"aria-labelledby\": hasTitle ? titleId : undefined,\n ...attrs,\n \"class\": clsx(s.FieldGroup, attrs.class as ClassValue),\n },\n [\n hasTitle || hasDescription || hasAction\n ? h(\"div\", { class: s.Header }, [\n h(\"div\", { class: s.HeaderText }, [\n hasTitle ? h(\"h2\", { class: s.Title, id: titleId }, [title as VNodeChild]) : null,\n hasDescription ? h(\"p\", { class: s.Description }, [description as VNodeChild]) : null,\n ]),\n hasAction ? action : null,\n ])\n : null,\n h(\"div\", { class: clsx(s.Body, props.bodyClass) }, [slots.default?.()]),\n slots.footer?.(),\n ],\n )\n }\n },\n})\n\ntype FieldGroupOwnProps = InstanceType<typeof FieldGroupComponent>[\"$props\"]\n\n/** FieldGroup props; attributes reach the root element. */\nexport type FieldGroupProps = FieldGroupOwnProps & { class?: ClassValue }\n\n/** A titled block of rows: `Field row` lines with hairlines between them. */\nexport const FieldGroup = FieldGroupComponent as typeof FieldGroupComponent & { new (): { $props: FieldGroupProps } }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FieldGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAA","sourcesContent":["export { FieldGroup, type FieldGroupProps } from \"./FieldGroup.js\"\n"]}
|
|
@@ -257,8 +257,8 @@ const TabsComponent = defineComponent({
|
|
|
257
257
|
}
|
|
258
258
|
const isVertical = props.orientation === "vertical";
|
|
259
259
|
const transitionProperty = isVertical
|
|
260
|
-
? "height
|
|
261
|
-
: "width
|
|
260
|
+
? "height 200ms var(--cubic-enter), transform 200ms var(--cubic-enter)"
|
|
261
|
+
: "width 200ms var(--cubic-enter), transform 200ms var(--cubic-enter)";
|
|
262
262
|
const sizeChanged = prevSize !== props.size;
|
|
263
263
|
prevSize = props.size;
|
|
264
264
|
if (sizeChanged) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../../src/components/Tabs/Tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,CAAC,EACD,MAAM,EACN,OAAO,EACP,eAAe,EACf,SAAS,EACT,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,GASN,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACvF,OAAO,aAAa,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAChG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,CAAC,MAAM,gDAAgD,CAAA;AAyC9D,MAAM,cAAc,GAAmC,MAAM,CAAC,YAAY,CAAC,CAAA;AAM3E,+DAA+D;AAC/D,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAE,GAAmB,EAAE,QAAoC,EAAE,EAAE;IAC5G,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAA0D,CAAA;IACnF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,GAAG,KAAK,gBAAgB,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC,WAAW,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,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computed,\n defineComponent,\n h,\n inject,\n isVNode,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n provide,\n ref,\n shallowRef,\n watch,\n type Component,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n type VNode,\n type VNodeArrayChildren,\n} from \"vue\"\nimport { RovingFocusGroup, RovingFocusItem } from \"reka-ui\"\nimport type { ControlSize, SemanticColors, Sizes, Variants } from \"@plexui/styles/types\"\nimport { handlePressableMouseEnter, waitForAnimationFrame } from \"../../lib/helpers.js\"\nimport ChevronDownMd from \"../Icon/svg/ChevronDownMd.js\"\nimport { LoadingIndicator } from \"../Indicator/index.js\"\nimport { Menu, MenuContent, MenuRadioGroup, MenuRadioItem, MenuTrigger } from \"../Menu/index.js\"\nimport { fitCount, visibleTabCount } from \"./overflow.js\"\nimport s from \"@plexui/styles/components/Tabs/Tabs.module.css\"\n\n// Vue port of packages/ui/src/components/Tabs/Tabs.tsx. Props, defaults,\n// rendered DOM and behaviour match React (checked by the parity tests).\n//\n// React builds on Radix ToggleGroup (type=\"single\"). Reka's ToggleGroupItem\n// renders Toggle semantics (`aria-pressed`, `data-active`, no `role=\"radio\"`)\n// and runs its click toggle before handlers the caller passes, so the\n// single-select part of Radix ToggleGroup/Toggle (about twenty lines) is\n// inlined here, and keyboard focus comes from Reka's RovingFocusGroup and\n// RovingFocusItem, the same roving tabindex Radix ToggleGroup uses.\n\nexport type SizeVariant = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\nexport type TabsVariant = \"segmented\" | \"underline\"\nexport type TabsOrientation = \"horizontal\" | \"vertical\"\n\n/** Content React accepts as a ReactNode, in Vue terms */\ntype TabsContent = string | number | VNode | VNodeArrayChildren\n\n/** Badge configuration for TabsTab: a plain value, or an object with content and styling */\nexport type TabsBadgeProp =\n | string\n | number\n | VNode\n | {\n content: TabsContent\n color?: SemanticColors<\"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\" | \"discovery\" | \"caution\">\n variant?: Variants<\"soft\" | \"solid\">\n pill?: boolean\n loading?: boolean\n }\n\n/** Icon for TabsTab: a component (e.g. an icon from @plexui/vue), a vnode, or text */\nexport type TabsIconProp = string | VNode | Component\n\ntype TabsContextValue = {\n value: ComputedRef<string>\n disabled: ComputedRef<boolean>\n setValue: (nextValue: string) => void\n}\n\nconst TabsContextKey: InjectionKey<TabsContextValue> = Symbol(\"PlexUITabs\")\n\ntype ExposedRovingFocusGroup = { getItems: () => { ref: HTMLElement }[] }\n\ntype ResizeEntryBox = \"contentBoxSize\" | \"borderBoxSize\" | \"devicePixelContentBoxSize\"\n\n// Same reading as usehooks-ts' useResizeObserver (content-box)\nconst extractSize = (entry: ResizeObserverEntry, box: ResizeEntryBox, sizeType: \"inlineSize\" | \"blockSize\") => {\n const boxSize = entry[box] as ResizeObserverSize[] | ResizeObserverSize | undefined\n if (!boxSize) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"]\n }\n return undefined\n }\n return Array.isArray(boxSize) ? boxSize[0][sizeType] : boxSize[sizeType]\n}\n\n// Radix RovingFocusGroup's focusFirst\nconst focusFirst = (candidates: HTMLElement[]) => {\n const previouslyFocused = document.activeElement\n for (const candidate of candidates) {\n if (candidate === previouslyFocused) return\n candidate.focus({ preventScroll: false })\n if (document.activeElement !== previouslyFocused) return\n }\n}\n\nconst callHandlers = (handlers: unknown, event: Event) => {\n for (const handler of Array.isArray(handlers) ? handlers : [handlers]) {\n if (typeof handler === \"function\") handler(event)\n }\n}\n\n// Events a caller's handler called preventDefault() on. React's synthetic\n// event reports that call in `defaultPrevented` even when the native event is\n// not cancelable (focus), for every later handler of the same event.\nconst preventedEvents = new WeakSet<Event>()\n\nconst isPrevented = (event: Event) => event.defaultPrevented || preventedEvents.has(event)\n\nconst callCallerHandlers = (handlers: unknown, event: Event) => {\n if (!handlers) return\n const preventDefault = event.preventDefault\n event.preventDefault = () => {\n preventedEvents.add(event)\n preventDefault.call(event)\n }\n try {\n callHandlers(handlers, event)\n } finally {\n Reflect.deleteProperty(event, \"preventDefault\")\n }\n}\n\n// Internal: the element Tabs and TabsTab render through Reka's\n// RovingFocusGroup and RovingFocusItem with `asChild`. Reka merges its\n// handlers into these attrs and would run them before the caller's. Radix\n// composes them the other way (composeEventHandlers): the caller's handler\n// runs first, and Radix skips its own once the event is default-prevented.\n// So the caller's listeners for the `composed` events arrive separately in\n// `listeners` and are composed that way here.\nconst RovingElement = defineComponent({\n name: \"TabsRovingElement\",\n inheritAttrs: false,\n props: {\n as: { type: String, required: true },\n elementRef: Object as PropType<Ref<HTMLElement | null>>,\n /** Events whose Reka handler Radix composes after the caller's */\n composed: { type: Array as PropType<string[]>, required: true },\n /** The caller's listeners for the `composed` events */\n listeners: { type: Object as PropType<Record<string, unknown>>, default: () => ({}) },\n },\n setup(props, { attrs, slots }) {\n return () => {\n const handlers: Record<string, (event: Event) => void> = {}\n for (const key of props.composed) {\n const caller = props.listeners[key]\n const internal = attrs[key]\n handlers[key] = (event: Event) => {\n callCallerHandlers(caller, event)\n if (!isPrevented(event)) callHandlers(internal, event)\n }\n }\n return h(props.as, { ...attrs, ...handlers, ref: props.elementRef }, slots.default?.())\n }\n },\n})\n\n/** Splits the caller's listeners for `keys` from the other attributes. */\nconst splitListeners = (attrs: Record<string, unknown>, keys: string[]) => {\n const listeners: Record<string, unknown> = {}\n const rest: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(attrs)) {\n if (keys.includes(key)) listeners[key] = value\n else rest[key] = value\n }\n return { listeners, rest }\n}\n\n// Radix RovingFocusGroup composes mousedown, focus and blur; its items\n// mousedown and focus (keydown too, which Reka already leaves to the caller)\nconst GROUP_COMPOSED = [\"onMousedown\", \"onFocus\", \"onBlur\"]\nconst ITEM_COMPOSED = [\"onMousedown\", \"onFocus\"]\n\nconst tabsProps = {\n /** Controlled value for the group. Bind with `v-model:value`; leave unset for an uncontrolled group. */\n value: String,\n /**\n * Visual variant of the tab group\n * - `\"segmented\"`: background container with sliding highlight (default)\n * - `\"underline\"`: no background, animated line indicator under active tab\n * @default \"segmented\"\n */\n variant: { type: String as PropType<TabsVariant>, default: \"segmented\" },\n /** Orientation of the tab layout. @default \"horizontal\" */\n orientation: { type: String as PropType<TabsOrientation>, default: \"horizontal\" },\n /** Controls the size of the tabs, `3xs` (22px) to `3xl` (48px). @default \"md\" */\n size: { type: String as PropType<ControlSize>, default: \"md\" },\n /** Controls gutter on the edges of the tabs, defaults to value from `size`. */\n gutterSize: String as PropType<Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">>,\n /** Disable the entire group. @default false */\n disabled: { type: Boolean, default: false },\n /** Display the control as a block element with equal width segments. @default false */\n block: { type: Boolean, default: false },\n /** Fully rounded pill shape. Only applies to the `\"segmented\"` variant. @default true */\n pill: { type: Boolean, default: true },\n /**\n * Flush underline style: no tab padding, so the indicator matches the text\n * width, gap spacing and no bottom border. Only applies to the `\"underline\"` variant.\n * @default false\n */\n flush: { type: Boolean, default: false },\n}\n\nconst tabsEmits = {\n /** A new value was selected (`v-model:value`) */\n \"update:value\": (_value: string) => true,\n /** Same payload as `update:value`, named after React's `onChange` */\n \"change\": (_value: string) => true,\n /** Any click on the control, even if a new value was not selected */\n \"click\": (_event: MouseEvent) => true,\n}\n\n// The group itself. `Tabs` renders it as it is, or measures and splits it\n// for `overflow=\"menu\"`\nconst TabsComponent = defineComponent({\n name: \"TabsRoot\",\n inheritAttrs: false,\n props: tabsProps,\n emits: tabsEmits,\n setup(props, { slots, attrs, emit }) {\n const rootRef = ref<HTMLDivElement | null>(null)\n const thumbRef = ref<HTMLDivElement | null>(null)\n const groupRef = ref<ExposedRovingFocusGroup | null>(null)\n let prevSize = props.size\n\n // Radix useControllableState: `value` undefined means uncontrolled, starting empty\n const uncontrolledValue = ref(\"\")\n const currentValue = computed(() => (props.value !== undefined ? props.value : uncontrolledValue.value))\n\n const handleValueChange = (nextValue: string) => {\n // Only trigger onChange when a value exists\n // Disallow toggling off enabled items\n if (nextValue) {\n emit(\"update:value\", nextValue)\n emit(\"change\", nextValue)\n }\n }\n\n const setValue = (nextValue: string) => {\n if (props.value !== undefined) {\n if (nextValue !== props.value) handleValueChange(nextValue)\n } else {\n uncontrolledValue.value = nextValue\n }\n }\n\n // Radix reports uncontrolled changes from an effect, after the click has\n // finished bubbling (so the group's `click` comes first)\n watch(uncontrolledValue, handleValueChange, { flush: \"post\" })\n\n provide(TabsContextKey, {\n value: currentValue,\n disabled: computed(() => props.disabled),\n setValue,\n })\n\n const applyThumbSizing = (isVertical: boolean, attemptScroll: boolean) => {\n const root = rootRef.value\n const thumb = thumbRef.value\n\n if (!root || !thumb) {\n return\n }\n\n // Get selected node\n const activeNode = root.querySelector<HTMLDivElement>('[data-state=\"on\"]')\n\n // Impossible\n if (!activeNode) {\n return\n }\n\n if (isVertical) {\n const rootHeight = root.clientHeight\n let targetHeight = Math.floor(activeNode.clientHeight)\n const targetOffset = activeNode.offsetTop\n\n // Detect subpixel edge case\n if (rootHeight - (targetHeight + targetOffset) < 2) {\n targetHeight = targetHeight - 1\n }\n\n thumb.style.height = `${Math.floor(targetHeight)}px`\n thumb.style.width = \"\"\n thumb.style.transform = `translateY(${targetOffset}px)`\n\n // Scroll into view if needed\n if (root.scrollHeight > rootHeight) {\n const buffer = rootHeight * 0.15\n const scrollTop = root.scrollTop\n const top = activeNode.offsetTop\n const bottom = top + targetHeight\n if (top < scrollTop + buffer || bottom > scrollTop + rootHeight - buffer) {\n if (attemptScroll) {\n activeNode.scrollIntoView({ block: \"center\", inline: \"nearest\", behavior: \"smooth\" })\n }\n }\n }\n } else {\n const rootWidth = root.clientWidth\n let targetWidth = Math.floor(activeNode.clientWidth)\n const targetOffset = activeNode.offsetLeft\n\n // Detect if the thumb is moving too far to the edge of the container.\n // This would most commonly be due to subpixel widths adding up to excessive distance.\n if (rootWidth - (targetWidth + targetOffset) < 2) {\n targetWidth = targetWidth - 1\n }\n\n thumb.style.width = `${Math.floor(targetWidth)}px`\n thumb.style.height = \"\"\n thumb.style.transform = `translateX(${targetOffset}px)`\n\n // If the control is scrollable, ensure the active option is visible\n if (root.scrollWidth > rootWidth) {\n // Only scroll items near the edge, but not the inner 2/3.\n const buffer = rootWidth * 0.15\n const scrollLeft = root.scrollLeft\n const left = activeNode.offsetLeft\n const right = left + targetWidth\n if (left < scrollLeft + buffer || right > scrollLeft + rootWidth - buffer) {\n // Cheap trick to avoid unintentional scroll on mount - transition is set after mounting\n if (attemptScroll) {\n activeNode.scrollIntoView({ block: \"nearest\", inline: \"center\", behavior: \"smooth\" })\n }\n }\n }\n }\n }\n\n // React's useLayoutEffect on [value, size, gutterSize, pill, flush, isVertical].\n // `value` is the prop, so an uncontrolled selection does not move the thumb\n // until the next resize, exactly as in React.\n const syncThumb = () => {\n const root = rootRef.value\n const thumb = thumbRef.value\n\n if (!root || !thumb) {\n return\n }\n\n const isVertical = props.orientation === \"vertical\"\n const transitionProperty = isVertical\n ? \"height 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)\"\n : \"width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)\"\n\n const sizeChanged = prevSize !== props.size\n prevSize = props.size\n\n if (sizeChanged) {\n // Size changed - disable transition, wait for CSS, then apply sizing\n const currentTransition = thumb.style.transition\n thumb.style.transition = \"\"\n\n waitForAnimationFrame(() => {\n applyThumbSizing(isVertical, false)\n waitForAnimationFrame(() => {\n thumb.style.transition = currentTransition\n })\n })\n } else {\n // Normal update (value change, etc.)\n waitForAnimationFrame(() => {\n applyThumbSizing(isVertical, !!thumb.style.transition)\n\n // Apply transition after initial calculation is set\n if (!thumb.style.transition) {\n waitForAnimationFrame(() => {\n thumb.style.transition = transitionProperty\n })\n }\n })\n }\n }\n\n watch(\n [\n () => props.value,\n () => props.size,\n () => props.gutterSize,\n () => props.pill,\n () => props.flush,\n () => props.orientation === \"vertical\",\n ],\n syncThumb,\n { flush: \"post\" },\n )\n\n let observer: ResizeObserver | undefined\n\n onMounted(() => {\n syncThumb()\n\n // usehooks-ts useResizeObserver: only fires when the content box changed\n const root = rootRef.value\n if (!root || typeof window === \"undefined\" || !(\"ResizeObserver\" in window)) {\n return\n }\n const previousSize: { width?: number; height?: number } = { width: undefined, height: undefined }\n observer = new ResizeObserver(([entry]) => {\n const width = extractSize(entry, \"contentBoxSize\", \"inlineSize\")\n const height = extractSize(entry, \"contentBoxSize\", \"blockSize\")\n if (previousSize.width === width && previousSize.height === height) {\n return\n }\n previousSize.width = width\n previousSize.height = height\n\n const thumb = thumbRef.value\n if (!thumb) {\n return\n }\n\n // Perform the size update instantly\n const currentTransition = thumb.style.transition\n thumb.style.transition = \"\"\n applyThumbSizing(props.orientation === \"vertical\", false)\n thumb.style.transition = currentTransition\n })\n observer.observe(root, { box: \"content-box\" })\n })\n\n // Tabs added, removed, reordered or relabelled move the active tab without\n // resizing the group: measure again, instantly, like a resize\n let mutationObserver: MutationObserver | undefined\n onMounted(() => {\n const root = rootRef.value\n if (!root || typeof MutationObserver === \"undefined\") return\n mutationObserver = new MutationObserver(() => {\n const thumb = thumbRef.value\n if (!thumb) return\n const currentTransition = thumb.style.transition\n thumb.style.transition = \"\"\n applyThumbSizing(props.orientation === \"vertical\", false)\n thumb.style.transition = currentTransition\n })\n mutationObserver.observe(root, { childList: true, characterData: true, subtree: true })\n })\n\n onBeforeUnmount(() => {\n observer?.disconnect()\n mutationObserver?.disconnect()\n })\n\n // Radix moves focus into the group onto the selected tab, then the last\n // focused one, then the first. Reka looks for a `data-active` attribute\n // that Radix does not render, so its entry focus is replaced here.\n const handleEntryFocus = (event: Event) => {\n event.preventDefault()\n const items = (groupRef.value?.getItems() ?? []).map((item) => item.ref)\n const activeItem = items.find((item) => item.getAttribute(\"data-state\") === \"on\")\n const currentItem = items.find((item) => item.getAttribute(\"tabindex\") === \"0\")\n focusFirst([activeItem, currentItem, ...items].filter((item): item is HTMLElement => !!item))\n }\n\n return () => {\n const { class: className, dir, ...otherAttrs } = attrs\n const { listeners, rest: restAttrs } = splitListeners(otherAttrs, GROUP_COMPOSED)\n // Only apply pill for segmented variant\n const isPill = props.variant === \"segmented\" && props.pill\n // Only apply flush for underline variant\n const isFlush = props.variant === \"underline\" && props.flush\n\n return h(\n RovingFocusGroup,\n {\n ref: groupRef,\n asChild: true,\n loop: false,\n dir: dir as \"ltr\" | \"rtl\" | undefined,\n onEntryFocus: handleEntryFocus,\n },\n {\n default: () =>\n h(\n RovingElement,\n {\n \"as\": \"div\",\n \"elementRef\": rootRef,\n \"composed\": GROUP_COMPOSED,\n \"listeners\": listeners,\n \"class\": [s.Tabs, className],\n // `dir` comes from RovingFocusGroup (\"ltr\" unless set), like Radix\n // Radix ToggleGroup type=\"single\" (radix-ui 1.8) is a radiogroup\n \"role\": \"radiogroup\",\n \"onClick\": (event: MouseEvent) => emit(\"click\", event),\n \"data-variant\": props.variant,\n \"data-orientation\": props.orientation,\n \"data-block\": props.block ? \"\" : undefined,\n \"data-pill\": isPill ? \"\" : undefined,\n \"data-flush\": isFlush ? \"\" : undefined,\n \"data-size\": props.size,\n \"data-gutter-size\": props.gutterSize,\n ...restAttrs,\n },\n { default: () => [h(\"div\", { class: s.TabsThumb, ref: thumbRef }), slots.default?.()] },\n ),\n },\n )\n }\n },\n})\n\n\nconst useTabsContext = () => {\n const context = inject(TabsContextKey, null)\n\n if (!context) {\n throw new Error(\"`TabsTab` must be used within `Tabs`\")\n }\n\n return context\n}\n\nconst hasContent = (nodes: VNode[] | undefined): nodes is VNode[] =>\n !!nodes?.some((node) => {\n if (!isVNode(node)) return node != null && typeof node !== \"boolean\" && String(node) !== \"\"\n if (node.type === Comment) return false\n if (node.type === Text) return String(node.children ?? \"\") !== \"\"\n if (Array.isArray(node.children) && typeof node.type === \"symbol\") return hasContent(node.children as VNode[])\n return true\n })\n\nconst isBadgeObject = (badge: TabsBadgeProp | undefined): badge is Extract<TabsBadgeProp, { content: unknown }> =>\n badge != null && typeof badge === \"object\" && \"content\" in badge\n\nconst renderIcon = (icon: TabsIconProp | undefined) => {\n if (icon == null || typeof icon === \"string\" || isVNode(icon)) return icon\n return h(icon)\n}\n\nconst TabComponent = defineComponent({\n name: \"TabsTab\",\n inheritAttrs: false,\n props: {\n /** Tab value */\n value: { type: String, required: true },\n /** Icon before the text content: a component, a vnode or text. The `icon` slot takes precedence. */\n icon: [String, Object, Function] as PropType<TabsIconProp>,\n /**\n * Badge after the text content: a plain value, or an object with\n * `content`, `color`, `variant`, `pill` and `loading`. The `badge` slot\n * replaces the content and keeps the object's styling.\n */\n badge: { type: [String, Number, Object] as PropType<TabsBadgeProp>, default: undefined },\n /** Disable the individual tab */\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { slots, attrs }) {\n const context = useTabsContext()\n\n return () => {\n const disabled = context.disabled.value || !!props.disabled\n const selected = context.value.value\n const pressed = !!selected && selected === props.value\n const { onClick, ...otherAttrs } = attrs\n const { listeners, rest: restAttrs } = splitListeners(otherAttrs, ITEM_COMPOSED)\n\n // Normalize badge prop; the slot replaces its content\n const badgeSlot = slots.badge?.()\n const badgeObject = isBadgeObject(props.badge) ? props.badge : undefined\n const badgeProps = hasContent(badgeSlot)\n ? { ...badgeObject, content: badgeSlot }\n : props.badge != null\n ? (badgeObject ?? { content: props.badge as TabsContent })\n : null\n\n const children = slots.default?.()\n const iconSlot = slots.icon?.()\n\n // Radix Toggle: the caller's click handler runs first and can cancel the toggle\n const handleClick = (event: MouseEvent) => {\n // React does not dispatch mouse handlers on a disabled button\n if (disabled) return\n callHandlers(onClick, event)\n if (event.defaultPrevented) return\n context.setValue(pressed ? \"\" : props.value)\n }\n\n return h(\n RovingFocusItem,\n { asChild: true, focusable: !disabled, active: pressed },\n {\n default: () =>\n h(\n RovingElement,\n {\n \"as\": \"button\",\n \"composed\": ITEM_COMPOSED,\n \"listeners\": listeners,\n // Radix Toggle defaults, then the single-select radio semantics\n \"type\": \"button\",\n \"data-state\": pressed ? \"on\" : \"off\",\n \"data-disabled\": disabled ? \"\" : undefined,\n \"role\": \"radio\",\n \"aria-checked\": pressed,\n // Reka's RovingFocusItem marks the active item; Radix does not\n \"data-active\": undefined,\n // Caller attributes win, as React spreads them after `className`\n \"class\": s.Tab,\n ...restAttrs,\n \"disabled\": disabled,\n \"onPointerenter\": handlePressableMouseEnter,\n \"onClick\": handleClick,\n },\n {\n default: () => [\n h(\"span\", { class: s.TabContent }, [\n hasContent(iconSlot) ? iconSlot : renderIcon(props.icon),\n hasContent(children) ? h(\"span\", null, children) : null,\n badgeProps\n ? h(\n \"span\",\n {\n \"class\": s.TabBadge,\n \"data-color\": badgeProps.color ?? \"secondary\",\n \"data-variant\": badgeProps.variant ?? \"soft\",\n \"data-pill\": badgeProps.pill ? \"\" : undefined,\n },\n badgeProps.loading ? [h(LoadingIndicator)] : [badgeProps.content as VNodeArrayChildren[number]],\n )\n : null,\n ]),\n ],\n },\n ),\n },\n )\n }\n },\n})\n\ntype TabOwnProps = InstanceType<typeof TabComponent>[\"$props\"]\n\n/** TabsTab props; other attributes (`aria-label`, ...) fall through to the button. */\nexport type TabProps = TabOwnProps & { \"aria-label\"?: string }\n\nexport const TabsTab = TabComponent as typeof TabComponent & { new (): { $props: TabProps } }\n\n/** Backward-compat alias of `TabsTab`, like React's `Tabs.Option` */\nexport const TabsOption: typeof TabsTab = TabsTab\n\n// ---------------------------------------------------------------------------\n// overflow=\"menu\" (React's OverflowTabs)\n\n/** Value of the menu button; no real tab has it */\nconst MORE_VALUE = \"__plexui_tabs_more__\"\n\ntype Slots = Record<string, ((...args: unknown[]) => VNodeArrayChildren) | undefined>\n\n/** The TabsTab vnodes of a default slot, through fragments (`v-for`, `<template>`) */\nconst tabVNodes = (nodes: VNodeArrayChildren | undefined): VNode[] =>\n (nodes ?? []).flatMap((node) => {\n if (!isVNode(node)) return []\n if (node.type === Fragment && Array.isArray(node.children)) return tabVNodes(node.children as VNodeArrayChildren)\n return node.type === TabComponent ? [node] : []\n })\n\nconst slotsOf = (node: VNode) => (node.children && typeof node.children === \"object\" && !Array.isArray(node.children) ? (node.children as Slots) : {})\n\n/** A tab's slot content; a vnode's raw slot may return a string or nothing */\nconst slotContent = (node: VNode, name: string): VNodeArrayChildren => {\n const content = slotsOf(node)[name]?.() as VNodeArrayChildren | VNodeArrayChildren[number] | undefined\n if (content == null) return []\n return Array.isArray(content) ? content : [content]\n}\n\nconst labelContent = (node: VNode) => slotContent(node, \"default\")\n\nconst plainText = (node: unknown): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(plainText).join(\"\")\n if (isVNode(node)) {\n if (node.type === Comment) return \"\"\n if (typeof node.children === \"string\") return node.children\n if (Array.isArray(node.children)) return plainText(node.children)\n return plainText(labelContent(node))\n }\n return \"\"\n}\n\nconst tabProps = (node: VNode) => (node.props ?? {}) as Record<string, unknown>\n\n/** Slot content that renders something: text, or a vnode other than a comment */\nconst filled = (nodes: VNodeArrayChildren) =>\n plainText(nodes) !== \"\" || nodes.some((node) => isVNode(node) && node.type !== Comment)\n\nconst badgeText = (badge: unknown) => (isBadgeObject(badge as TabsBadgeProp) ? plainText((badge as { content: unknown }).content) : plainText(badge))\n\n/** A tab's icon: the `icon` slot, else the prop */\nconst tabIcon = (node: VNode) => {\n const iconSlot = slotContent(node, \"icon\")\n return filled(iconSlot) ? iconSlot : renderIcon(tabProps(node).icon as TabsIconProp | undefined)\n}\n\n/** A tab's count as text: the `badge` slot, else the prop */\nconst tabCount = (node: VNode) => plainText(slotContent(node, \"badge\")) || badgeText(tabProps(node).badge)\n\n/** A raw vnode prop holds a boolean attribute as written: `<TabsTab disabled>` is \"\" */\nconst tabDisabled = (node: VNode) => {\n const disabled = tabProps(node).disabled\n return disabled != null && disabled !== false\n}\n\n/** A tab's name: its text, else its accessible name, else its value */\nconst tabLabel = (node: VNode) =>\n plainText(labelContent(node)) || (tabProps(node)[\"aria-label\"] as string | undefined) || String(tabProps(node).value)\n\n/** What a tab's width depends on: the strip measures again when it changes */\nconst tabsSignature = (nodes: VNode[]) =>\n nodes\n .map((node) =>\n [\n tabProps(node).value,\n plainText(labelContent(node)),\n tabCount(node),\n tabProps(node).icon != null || slotsOf(node).icon != null,\n ].join(\"\\u0000\"),\n )\n .join(\"\\u0001\")\n\n/**\n * MenuTrigger sets `data-state` (open or closed) on its child, while a tab\n * keeps `on` or `off` in the same attribute and the thumb finds the active tab\n * by it. The menu's value does not reach the tab; its handlers and\n * `aria-haspopup` / `aria-expanded` do.\n */\nconst MoreTab = defineComponent({\n name: \"TabsMoreTab\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n return () => {\n const { \"data-state\": _menuState, ...rest } = attrs\n return h(TabComponent, rest as TabProps, slots)\n }\n },\n})\n\nconst TabsPublic = defineComponent({\n name: \"Tabs\",\n inheritAttrs: false,\n props: {\n ...tabsProps,\n /**\n * What happens to tabs that do not fit in one row: the strip scrolls\n * sideways (`scroll`), or they move into a menu at its end (`menu`). The\n * menu button shows the active tab's name when it is a hidden one.\n * Horizontal tabs without `block` only.\n * @default \"scroll\"\n */\n overflow: { type: String as PropType<\"scroll\" | \"menu\">, default: \"scroll\" },\n /** Text of the menu button with `overflow=\"menu\"`. @default \"More\" */\n overflowLabel: { type: String, default: \"More\" },\n },\n emits: tabsEmits,\n setup(props, { slots, attrs, emit }) {\n const hostRef = ref<HTMLDivElement | null>(null)\n // Uncontrolled like the group: `value` unset starts empty\n const uncontrolledValue = ref(\"\")\n const current = computed(() => (props.value !== undefined ? props.value : uncontrolledValue.value))\n const select = (next: string) => {\n if (props.value === undefined) uncontrolledValue.value = next\n emit(\"update:value\", next)\n emit(\"change\", next)\n }\n\n // { count: null } while the measuring pass renders every tab and the\n // menu button; a new object each time, so an unchanged count still renders\n const measured = shallowRef<{ count: number | null }>({ count: null })\n let measuredSignature = \"\"\n let measuredActive = -1\n let lastRender = { measuring: true, signature: \"\", activeIndex: -1, length: 0 }\n let boxWidth = -1\n\n const measure = () => {\n if (!lastRender.measuring) return\n const root = hostRef.value?.firstElementChild\n if (!(root instanceof HTMLElement)) return\n\n const buttons = Array.from(root.querySelectorAll<HTMLElement>(\":scope > button\"))\n if (buttons.length !== lastRender.length + 1) return\n\n const widths = buttons.map((button) => button.getBoundingClientRect().width)\n const moreButton = buttons[buttons.length - 1]\n const moreWidth = widths.pop() ?? 0\n const style = getComputedStyle(root)\n const available =\n root.getBoundingClientRect().width -\n (Number.parseFloat(style.paddingLeft) || 0) -\n (Number.parseFloat(style.paddingRight) || 0)\n const gap = Number.parseFloat(style.columnGap) || 0\n boxWidth = hostRef.value?.parentElement?.clientWidth ?? -1\n measuredSignature = lastRender.signature\n measuredActive = lastRender.activeIndex\n\n if (available <= 0) {\n measured.value = { count: lastRender.length }\n return\n }\n\n const { activeIndex } = lastRender\n const chevron = moreButton?.querySelector(\"svg\")\n const chevronWidth = chevron?.getBoundingClientRect().width ?? 0\n const labelGap = chevron?.parentElement ? Number.parseFloat(getComputedStyle(chevron.parentElement).columnGap) || 0 : 0\n const activeWidth = activeIndex < 0 ? 0 : (widths[activeIndex] ?? 0) + chevronWidth + labelGap\n measured.value = { count: visibleTabCount(widths, moreWidth, activeWidth, activeIndex, gap, available) }\n }\n\n // The width to fit is the container's; reports during a measuring pass\n // are skipped. The menu strip may appear or go after mount, with `overflow`\n let observer: ResizeObserver | undefined\n let observed: HTMLElement | null = null\n const observeBox = () => {\n const box = hostRef.value?.parentElement ?? null\n if (box === observed) return\n observer?.disconnect()\n observer = undefined\n observed = box\n if (!box || typeof ResizeObserver === \"undefined\") return\n observer = new ResizeObserver(() => {\n if (lastRender.measuring) return\n const width = box.clientWidth\n if (width === boxWidth) return\n boxWidth = width\n measured.value = { count: null }\n })\n observer.observe(box)\n }\n onMounted(() => {\n measure()\n observeBox()\n })\n onUpdated(() => {\n measure()\n observeBox()\n })\n onBeforeUnmount(() => observer?.disconnect())\n\n const forward = {\n \"onUpdate:value\": (value: string) => emit(\"update:value\", value),\n \"onChange\": (value: string) => emit(\"change\", value),\n \"onClick\": (event: MouseEvent) => emit(\"click\", event),\n }\n\n return () => {\n const { overflow, overflowLabel, ...rootProps } = props\n if (overflow !== \"menu\" || props.block || props.orientation === \"vertical\") {\n return h(TabsComponent, { ...rootProps, ...attrs, ...forward }, slots)\n }\n\n const items = tabVNodes(slots.default?.() as VNodeArrayChildren | undefined)\n // The strip's own props size the tabs and the menu button too\n const signature = [overflowLabel, props.size, props.variant, props.gutterSize, props.pill, props.flush, tabsSignature(items)].join(\n \"\\u0002\",\n )\n const activeIndex = items.findIndex((item) => tabProps(item).value === current.value)\n const { count } = measured.value\n // New tabs measure again; so does an active tab that moves under the\n // menu button or back out, since the button carries the hidden one's name\n const stale =\n count !== null &&\n (signature !== measuredSignature ||\n (activeIndex !== measuredActive && (measuredActive >= count || activeIndex >= count)))\n const measuring = count === null || stale\n lastRender = { measuring, signature, activeIndex, length: items.length }\n\n const shown = measuring ? items : items.slice(0, count)\n const hidden = measuring ? [] : items.slice(count)\n const hiddenActive = hidden.find((item) => tabProps(item).value === current.value) ?? null\n\n const strip = h(\n TabsComponent,\n {\n ...rootProps,\n ...attrs,\n \"data-overflow\": \"menu\",\n \"value\": hiddenActive ? MORE_VALUE : current.value,\n // Pressing the menu button opens the menu; it is not a tab\n \"onUpdate:value\": (next: string) => {\n if (next !== MORE_VALUE) select(next)\n },\n \"onClick\": forward.onClick,\n },\n {\n default: () => [\n ...shown,\n measuring || hidden.length > 0\n ? h(MenuTrigger, null, {\n default: () =>\n h(MoreTab, { value: MORE_VALUE }, {\n default: () => [\n h(\"span\", { class: s.OverflowLabel }, [hiddenActive ? tabLabel(hiddenActive) : overflowLabel, h(ChevronDownMd)]),\n ],\n }),\n })\n : null,\n ],\n },\n )\n\n return h(\"div\", { ref: hostRef, class: s.OverflowHost }, [\n h(Menu, null, {\n default: () => [\n strip,\n h(MenuContent, { align: \"end\", minWidth: \"auto\" }, {\n default: () =>\n h(MenuRadioGroup, { \"value\": current.value, \"onUpdate:value\": select }, {\n default: () =>\n hidden.map((item) => {\n const itemProps = tabProps(item)\n const count = tabCount(item)\n const label = labelContent(item)\n return h(\n MenuRadioItem,\n {\n key: String(itemProps.value),\n value: String(itemProps.value),\n disabled: props.disabled || tabDisabled(item),\n },\n {\n default: () => [\n tabIcon(item),\n filled(label)\n ? label\n : ((itemProps[\"aria-label\"] as string | undefined) ?? String(itemProps.value)),\n // A tab's count moves into the menu with it\n count !== \"\" ? h(\"span\", { class: s.OverflowBadge }, count) : null,\n ],\n },\n )\n }),\n }),\n }),\n ],\n }),\n ])\n }\n },\n})\n\ntype TabsOwnProps = InstanceType<typeof TabsPublic>[\"$props\"]\n\n/** Tabs props plus the attributes that fall through to the group element, as in React. */\nexport type TabsProps = TabsOwnProps & Omit<HTMLAttributes, keyof TabsOwnProps> & { \"aria-label\"?: string }\n\nexport const Tabs = TabsPublic as typeof TabsPublic & { new (): { $props: TabsProps } }\n"]}
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../../src/components/Tabs/Tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,CAAC,EACD,MAAM,EACN,OAAO,EACP,eAAe,EACf,SAAS,EACT,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,GASN,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACvF,OAAO,aAAa,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAChG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,CAAC,MAAM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,CAAC,CAAC;4CAChF,4CAA4C;4CAC5C,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;yCACnE;qCACF,CACF,CAAA;gCACH,CAAC,CAAC;6BACL,CAAC;yBACL,CAAC;qBACH;iBACF,CAAC;aACH,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,MAAM,CAAC,MAAM,IAAI,GAAG,UAAmE,CAAA","sourcesContent":["import {\n Comment,\n Fragment,\n Text,\n computed,\n defineComponent,\n h,\n inject,\n isVNode,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n provide,\n ref,\n shallowRef,\n watch,\n type Component,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n type VNode,\n type VNodeArrayChildren,\n} from \"vue\"\nimport { RovingFocusGroup, RovingFocusItem } from \"reka-ui\"\nimport type { ControlSize, SemanticColors, Sizes, Variants } from \"@plexui/styles/types\"\nimport { handlePressableMouseEnter, waitForAnimationFrame } from \"../../lib/helpers.js\"\nimport ChevronDownMd from \"../Icon/svg/ChevronDownMd.js\"\nimport { LoadingIndicator } from \"../Indicator/index.js\"\nimport { Menu, MenuContent, MenuRadioGroup, MenuRadioItem, MenuTrigger } from \"../Menu/index.js\"\nimport { fitCount, visibleTabCount } from \"./overflow.js\"\nimport s from \"@plexui/styles/components/Tabs/Tabs.module.css\"\n\n// Vue port of packages/ui/src/components/Tabs/Tabs.tsx. Props, defaults,\n// rendered DOM and behaviour match React (checked by the parity tests).\n//\n// React builds on Radix ToggleGroup (type=\"single\"). Reka's ToggleGroupItem\n// renders Toggle semantics (`aria-pressed`, `data-active`, no `role=\"radio\"`)\n// and runs its click toggle before handlers the caller passes, so the\n// single-select part of Radix ToggleGroup/Toggle (about twenty lines) is\n// inlined here, and keyboard focus comes from Reka's RovingFocusGroup and\n// RovingFocusItem, the same roving tabindex Radix ToggleGroup uses.\n\nexport type SizeVariant = \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\nexport type TabsVariant = \"segmented\" | \"underline\"\nexport type TabsOrientation = \"horizontal\" | \"vertical\"\n\n/** Content React accepts as a ReactNode, in Vue terms */\ntype TabsContent = string | number | VNode | VNodeArrayChildren\n\n/** Badge configuration for TabsTab: a plain value, or an object with content and styling */\nexport type TabsBadgeProp =\n | string\n | number\n | VNode\n | {\n content: TabsContent\n color?: SemanticColors<\"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\" | \"discovery\" | \"caution\">\n variant?: Variants<\"soft\" | \"solid\">\n pill?: boolean\n loading?: boolean\n }\n\n/** Icon for TabsTab: a component (e.g. an icon from @plexui/vue), a vnode, or text */\nexport type TabsIconProp = string | VNode | Component\n\ntype TabsContextValue = {\n value: ComputedRef<string>\n disabled: ComputedRef<boolean>\n setValue: (nextValue: string) => void\n}\n\nconst TabsContextKey: InjectionKey<TabsContextValue> = Symbol(\"PlexUITabs\")\n\ntype ExposedRovingFocusGroup = { getItems: () => { ref: HTMLElement }[] }\n\ntype ResizeEntryBox = \"contentBoxSize\" | \"borderBoxSize\" | \"devicePixelContentBoxSize\"\n\n// Same reading as usehooks-ts' useResizeObserver (content-box)\nconst extractSize = (entry: ResizeObserverEntry, box: ResizeEntryBox, sizeType: \"inlineSize\" | \"blockSize\") => {\n const boxSize = entry[box] as ResizeObserverSize[] | ResizeObserverSize | undefined\n if (!boxSize) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"]\n }\n return undefined\n }\n return Array.isArray(boxSize) ? boxSize[0][sizeType] : boxSize[sizeType]\n}\n\n// Radix RovingFocusGroup's focusFirst\nconst focusFirst = (candidates: HTMLElement[]) => {\n const previouslyFocused = document.activeElement\n for (const candidate of candidates) {\n if (candidate === previouslyFocused) return\n candidate.focus({ preventScroll: false })\n if (document.activeElement !== previouslyFocused) return\n }\n}\n\nconst callHandlers = (handlers: unknown, event: Event) => {\n for (const handler of Array.isArray(handlers) ? handlers : [handlers]) {\n if (typeof handler === \"function\") handler(event)\n }\n}\n\n// Events a caller's handler called preventDefault() on. React's synthetic\n// event reports that call in `defaultPrevented` even when the native event is\n// not cancelable (focus), for every later handler of the same event.\nconst preventedEvents = new WeakSet<Event>()\n\nconst isPrevented = (event: Event) => event.defaultPrevented || preventedEvents.has(event)\n\nconst callCallerHandlers = (handlers: unknown, event: Event) => {\n if (!handlers) return\n const preventDefault = event.preventDefault\n event.preventDefault = () => {\n preventedEvents.add(event)\n preventDefault.call(event)\n }\n try {\n callHandlers(handlers, event)\n } finally {\n Reflect.deleteProperty(event, \"preventDefault\")\n }\n}\n\n// Internal: the element Tabs and TabsTab render through Reka's\n// RovingFocusGroup and RovingFocusItem with `asChild`. Reka merges its\n// handlers into these attrs and would run them before the caller's. Radix\n// composes them the other way (composeEventHandlers): the caller's handler\n// runs first, and Radix skips its own once the event is default-prevented.\n// So the caller's listeners for the `composed` events arrive separately in\n// `listeners` and are composed that way here.\nconst RovingElement = defineComponent({\n name: \"TabsRovingElement\",\n inheritAttrs: false,\n props: {\n as: { type: String, required: true },\n elementRef: Object as PropType<Ref<HTMLElement | null>>,\n /** Events whose Reka handler Radix composes after the caller's */\n composed: { type: Array as PropType<string[]>, required: true },\n /** The caller's listeners for the `composed` events */\n listeners: { type: Object as PropType<Record<string, unknown>>, default: () => ({}) },\n },\n setup(props, { attrs, slots }) {\n return () => {\n const handlers: Record<string, (event: Event) => void> = {}\n for (const key of props.composed) {\n const caller = props.listeners[key]\n const internal = attrs[key]\n handlers[key] = (event: Event) => {\n callCallerHandlers(caller, event)\n if (!isPrevented(event)) callHandlers(internal, event)\n }\n }\n return h(props.as, { ...attrs, ...handlers, ref: props.elementRef }, slots.default?.())\n }\n },\n})\n\n/** Splits the caller's listeners for `keys` from the other attributes. */\nconst splitListeners = (attrs: Record<string, unknown>, keys: string[]) => {\n const listeners: Record<string, unknown> = {}\n const rest: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(attrs)) {\n if (keys.includes(key)) listeners[key] = value\n else rest[key] = value\n }\n return { listeners, rest }\n}\n\n// Radix RovingFocusGroup composes mousedown, focus and blur; its items\n// mousedown and focus (keydown too, which Reka already leaves to the caller)\nconst GROUP_COMPOSED = [\"onMousedown\", \"onFocus\", \"onBlur\"]\nconst ITEM_COMPOSED = [\"onMousedown\", \"onFocus\"]\n\nconst tabsProps = {\n /** Controlled value for the group. Bind with `v-model:value`; leave unset for an uncontrolled group. */\n value: String,\n /**\n * Visual variant of the tab group\n * - `\"segmented\"`: background container with sliding highlight (default)\n * - `\"underline\"`: no background, animated line indicator under active tab\n * @default \"segmented\"\n */\n variant: { type: String as PropType<TabsVariant>, default: \"segmented\" },\n /** Orientation of the tab layout. @default \"horizontal\" */\n orientation: { type: String as PropType<TabsOrientation>, default: \"horizontal\" },\n /** Controls the size of the tabs, `3xs` (22px) to `3xl` (48px). @default \"md\" */\n size: { type: String as PropType<ControlSize>, default: \"md\" },\n /** Controls gutter on the edges of the tabs, defaults to value from `size`. */\n gutterSize: String as PropType<Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">>,\n /** Disable the entire group. @default false */\n disabled: { type: Boolean, default: false },\n /** Display the control as a block element with equal width segments. @default false */\n block: { type: Boolean, default: false },\n /** Fully rounded pill shape. Only applies to the `\"segmented\"` variant. @default true */\n pill: { type: Boolean, default: true },\n /**\n * Flush underline style: no tab padding, so the indicator matches the text\n * width, gap spacing and no bottom border. Only applies to the `\"underline\"` variant.\n * @default false\n */\n flush: { type: Boolean, default: false },\n}\n\nconst tabsEmits = {\n /** A new value was selected (`v-model:value`) */\n \"update:value\": (_value: string) => true,\n /** Same payload as `update:value`, named after React's `onChange` */\n \"change\": (_value: string) => true,\n /** Any click on the control, even if a new value was not selected */\n \"click\": (_event: MouseEvent) => true,\n}\n\n// The group itself. `Tabs` renders it as it is, or measures and splits it\n// for `overflow=\"menu\"`\nconst TabsComponent = defineComponent({\n name: \"TabsRoot\",\n inheritAttrs: false,\n props: tabsProps,\n emits: tabsEmits,\n setup(props, { slots, attrs, emit }) {\n const rootRef = ref<HTMLDivElement | null>(null)\n const thumbRef = ref<HTMLDivElement | null>(null)\n const groupRef = ref<ExposedRovingFocusGroup | null>(null)\n let prevSize = props.size\n\n // Radix useControllableState: `value` undefined means uncontrolled, starting empty\n const uncontrolledValue = ref(\"\")\n const currentValue = computed(() => (props.value !== undefined ? props.value : uncontrolledValue.value))\n\n const handleValueChange = (nextValue: string) => {\n // Only trigger onChange when a value exists\n // Disallow toggling off enabled items\n if (nextValue) {\n emit(\"update:value\", nextValue)\n emit(\"change\", nextValue)\n }\n }\n\n const setValue = (nextValue: string) => {\n if (props.value !== undefined) {\n if (nextValue !== props.value) handleValueChange(nextValue)\n } else {\n uncontrolledValue.value = nextValue\n }\n }\n\n // Radix reports uncontrolled changes from an effect, after the click has\n // finished bubbling (so the group's `click` comes first)\n watch(uncontrolledValue, handleValueChange, { flush: \"post\" })\n\n provide(TabsContextKey, {\n value: currentValue,\n disabled: computed(() => props.disabled),\n setValue,\n })\n\n const applyThumbSizing = (isVertical: boolean, attemptScroll: boolean) => {\n const root = rootRef.value\n const thumb = thumbRef.value\n\n if (!root || !thumb) {\n return\n }\n\n // Get selected node\n const activeNode = root.querySelector<HTMLDivElement>('[data-state=\"on\"]')\n\n // Impossible\n if (!activeNode) {\n return\n }\n\n if (isVertical) {\n const rootHeight = root.clientHeight\n let targetHeight = Math.floor(activeNode.clientHeight)\n const targetOffset = activeNode.offsetTop\n\n // Detect subpixel edge case\n if (rootHeight - (targetHeight + targetOffset) < 2) {\n targetHeight = targetHeight - 1\n }\n\n thumb.style.height = `${Math.floor(targetHeight)}px`\n thumb.style.width = \"\"\n thumb.style.transform = `translateY(${targetOffset}px)`\n\n // Scroll into view if needed\n if (root.scrollHeight > rootHeight) {\n const buffer = rootHeight * 0.15\n const scrollTop = root.scrollTop\n const top = activeNode.offsetTop\n const bottom = top + targetHeight\n if (top < scrollTop + buffer || bottom > scrollTop + rootHeight - buffer) {\n if (attemptScroll) {\n activeNode.scrollIntoView({ block: \"center\", inline: \"nearest\", behavior: \"smooth\" })\n }\n }\n }\n } else {\n const rootWidth = root.clientWidth\n let targetWidth = Math.floor(activeNode.clientWidth)\n const targetOffset = activeNode.offsetLeft\n\n // Detect if the thumb is moving too far to the edge of the container.\n // This would most commonly be due to subpixel widths adding up to excessive distance.\n if (rootWidth - (targetWidth + targetOffset) < 2) {\n targetWidth = targetWidth - 1\n }\n\n thumb.style.width = `${Math.floor(targetWidth)}px`\n thumb.style.height = \"\"\n thumb.style.transform = `translateX(${targetOffset}px)`\n\n // If the control is scrollable, ensure the active option is visible\n if (root.scrollWidth > rootWidth) {\n // Only scroll items near the edge, but not the inner 2/3.\n const buffer = rootWidth * 0.15\n const scrollLeft = root.scrollLeft\n const left = activeNode.offsetLeft\n const right = left + targetWidth\n if (left < scrollLeft + buffer || right > scrollLeft + rootWidth - buffer) {\n // Cheap trick to avoid unintentional scroll on mount - transition is set after mounting\n if (attemptScroll) {\n activeNode.scrollIntoView({ block: \"nearest\", inline: \"center\", behavior: \"smooth\" })\n }\n }\n }\n }\n }\n\n // React's useLayoutEffect on [value, size, gutterSize, pill, flush, isVertical].\n // `value` is the prop, so an uncontrolled selection does not move the thumb\n // until the next resize, exactly as in React.\n const syncThumb = () => {\n const root = rootRef.value\n const thumb = thumbRef.value\n\n if (!root || !thumb) {\n return\n }\n\n const isVertical = props.orientation === \"vertical\"\n const transitionProperty = isVertical\n ? \"height 200ms var(--cubic-enter), transform 200ms var(--cubic-enter)\"\n : \"width 200ms var(--cubic-enter), transform 200ms var(--cubic-enter)\"\n\n const sizeChanged = prevSize !== props.size\n prevSize = props.size\n\n if (sizeChanged) {\n // Size changed - disable transition, wait for CSS, then apply sizing\n const currentTransition = thumb.style.transition\n thumb.style.transition = \"\"\n\n waitForAnimationFrame(() => {\n applyThumbSizing(isVertical, false)\n waitForAnimationFrame(() => {\n thumb.style.transition = currentTransition\n })\n })\n } else {\n // Normal update (value change, etc.)\n waitForAnimationFrame(() => {\n applyThumbSizing(isVertical, !!thumb.style.transition)\n\n // Apply transition after initial calculation is set\n if (!thumb.style.transition) {\n waitForAnimationFrame(() => {\n thumb.style.transition = transitionProperty\n })\n }\n })\n }\n }\n\n watch(\n [\n () => props.value,\n () => props.size,\n () => props.gutterSize,\n () => props.pill,\n () => props.flush,\n () => props.orientation === \"vertical\",\n ],\n syncThumb,\n { flush: \"post\" },\n )\n\n let observer: ResizeObserver | undefined\n\n onMounted(() => {\n syncThumb()\n\n // usehooks-ts useResizeObserver: only fires when the content box changed\n const root = rootRef.value\n if (!root || typeof window === \"undefined\" || !(\"ResizeObserver\" in window)) {\n return\n }\n const previousSize: { width?: number; height?: number } = { width: undefined, height: undefined }\n observer = new ResizeObserver(([entry]) => {\n const width = extractSize(entry, \"contentBoxSize\", \"inlineSize\")\n const height = extractSize(entry, \"contentBoxSize\", \"blockSize\")\n if (previousSize.width === width && previousSize.height === height) {\n return\n }\n previousSize.width = width\n previousSize.height = height\n\n const thumb = thumbRef.value\n if (!thumb) {\n return\n }\n\n // Perform the size update instantly\n const currentTransition = thumb.style.transition\n thumb.style.transition = \"\"\n applyThumbSizing(props.orientation === \"vertical\", false)\n thumb.style.transition = currentTransition\n })\n observer.observe(root, { box: \"content-box\" })\n })\n\n // Tabs added, removed, reordered or relabelled move the active tab without\n // resizing the group: measure again, instantly, like a resize\n let mutationObserver: MutationObserver | undefined\n onMounted(() => {\n const root = rootRef.value\n if (!root || typeof MutationObserver === \"undefined\") return\n mutationObserver = new MutationObserver(() => {\n const thumb = thumbRef.value\n if (!thumb) return\n const currentTransition = thumb.style.transition\n thumb.style.transition = \"\"\n applyThumbSizing(props.orientation === \"vertical\", false)\n thumb.style.transition = currentTransition\n })\n mutationObserver.observe(root, { childList: true, characterData: true, subtree: true })\n })\n\n onBeforeUnmount(() => {\n observer?.disconnect()\n mutationObserver?.disconnect()\n })\n\n // Radix moves focus into the group onto the selected tab, then the last\n // focused one, then the first. Reka looks for a `data-active` attribute\n // that Radix does not render, so its entry focus is replaced here.\n const handleEntryFocus = (event: Event) => {\n event.preventDefault()\n const items = (groupRef.value?.getItems() ?? []).map((item) => item.ref)\n const activeItem = items.find((item) => item.getAttribute(\"data-state\") === \"on\")\n const currentItem = items.find((item) => item.getAttribute(\"tabindex\") === \"0\")\n focusFirst([activeItem, currentItem, ...items].filter((item): item is HTMLElement => !!item))\n }\n\n return () => {\n const { class: className, dir, ...otherAttrs } = attrs\n const { listeners, rest: restAttrs } = splitListeners(otherAttrs, GROUP_COMPOSED)\n // Only apply pill for segmented variant\n const isPill = props.variant === \"segmented\" && props.pill\n // Only apply flush for underline variant\n const isFlush = props.variant === \"underline\" && props.flush\n\n return h(\n RovingFocusGroup,\n {\n ref: groupRef,\n asChild: true,\n loop: false,\n dir: dir as \"ltr\" | \"rtl\" | undefined,\n onEntryFocus: handleEntryFocus,\n },\n {\n default: () =>\n h(\n RovingElement,\n {\n \"as\": \"div\",\n \"elementRef\": rootRef,\n \"composed\": GROUP_COMPOSED,\n \"listeners\": listeners,\n \"class\": [s.Tabs, className],\n // `dir` comes from RovingFocusGroup (\"ltr\" unless set), like Radix\n // Radix ToggleGroup type=\"single\" (radix-ui 1.8) is a radiogroup\n \"role\": \"radiogroup\",\n \"onClick\": (event: MouseEvent) => emit(\"click\", event),\n \"data-variant\": props.variant,\n \"data-orientation\": props.orientation,\n \"data-block\": props.block ? \"\" : undefined,\n \"data-pill\": isPill ? \"\" : undefined,\n \"data-flush\": isFlush ? \"\" : undefined,\n \"data-size\": props.size,\n \"data-gutter-size\": props.gutterSize,\n ...restAttrs,\n },\n { default: () => [h(\"div\", { class: s.TabsThumb, ref: thumbRef }), slots.default?.()] },\n ),\n },\n )\n }\n },\n})\n\n\nconst useTabsContext = () => {\n const context = inject(TabsContextKey, null)\n\n if (!context) {\n throw new Error(\"`TabsTab` must be used within `Tabs`\")\n }\n\n return context\n}\n\nconst hasContent = (nodes: VNode[] | undefined): nodes is VNode[] =>\n !!nodes?.some((node) => {\n if (!isVNode(node)) return node != null && typeof node !== \"boolean\" && String(node) !== \"\"\n if (node.type === Comment) return false\n if (node.type === Text) return String(node.children ?? \"\") !== \"\"\n if (Array.isArray(node.children) && typeof node.type === \"symbol\") return hasContent(node.children as VNode[])\n return true\n })\n\nconst isBadgeObject = (badge: TabsBadgeProp | undefined): badge is Extract<TabsBadgeProp, { content: unknown }> =>\n badge != null && typeof badge === \"object\" && \"content\" in badge\n\nconst renderIcon = (icon: TabsIconProp | undefined) => {\n if (icon == null || typeof icon === \"string\" || isVNode(icon)) return icon\n return h(icon)\n}\n\nconst TabComponent = defineComponent({\n name: \"TabsTab\",\n inheritAttrs: false,\n props: {\n /** Tab value */\n value: { type: String, required: true },\n /** Icon before the text content: a component, a vnode or text. The `icon` slot takes precedence. */\n icon: [String, Object, Function] as PropType<TabsIconProp>,\n /**\n * Badge after the text content: a plain value, or an object with\n * `content`, `color`, `variant`, `pill` and `loading`. The `badge` slot\n * replaces the content and keeps the object's styling.\n */\n badge: { type: [String, Number, Object] as PropType<TabsBadgeProp>, default: undefined },\n /** Disable the individual tab */\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { slots, attrs }) {\n const context = useTabsContext()\n\n return () => {\n const disabled = context.disabled.value || !!props.disabled\n const selected = context.value.value\n const pressed = !!selected && selected === props.value\n const { onClick, ...otherAttrs } = attrs\n const { listeners, rest: restAttrs } = splitListeners(otherAttrs, ITEM_COMPOSED)\n\n // Normalize badge prop; the slot replaces its content\n const badgeSlot = slots.badge?.()\n const badgeObject = isBadgeObject(props.badge) ? props.badge : undefined\n const badgeProps = hasContent(badgeSlot)\n ? { ...badgeObject, content: badgeSlot }\n : props.badge != null\n ? (badgeObject ?? { content: props.badge as TabsContent })\n : null\n\n const children = slots.default?.()\n const iconSlot = slots.icon?.()\n\n // Radix Toggle: the caller's click handler runs first and can cancel the toggle\n const handleClick = (event: MouseEvent) => {\n // React does not dispatch mouse handlers on a disabled button\n if (disabled) return\n callHandlers(onClick, event)\n if (event.defaultPrevented) return\n context.setValue(pressed ? \"\" : props.value)\n }\n\n return h(\n RovingFocusItem,\n { asChild: true, focusable: !disabled, active: pressed },\n {\n default: () =>\n h(\n RovingElement,\n {\n \"as\": \"button\",\n \"composed\": ITEM_COMPOSED,\n \"listeners\": listeners,\n // Radix Toggle defaults, then the single-select radio semantics\n \"type\": \"button\",\n \"data-state\": pressed ? \"on\" : \"off\",\n \"data-disabled\": disabled ? \"\" : undefined,\n \"role\": \"radio\",\n \"aria-checked\": pressed,\n // Reka's RovingFocusItem marks the active item; Radix does not\n \"data-active\": undefined,\n // Caller attributes win, as React spreads them after `className`\n \"class\": s.Tab,\n ...restAttrs,\n \"disabled\": disabled,\n \"onPointerenter\": handlePressableMouseEnter,\n \"onClick\": handleClick,\n },\n {\n default: () => [\n h(\"span\", { class: s.TabContent }, [\n hasContent(iconSlot) ? iconSlot : renderIcon(props.icon),\n hasContent(children) ? h(\"span\", null, children) : null,\n badgeProps\n ? h(\n \"span\",\n {\n \"class\": s.TabBadge,\n \"data-color\": badgeProps.color ?? \"secondary\",\n \"data-variant\": badgeProps.variant ?? \"soft\",\n \"data-pill\": badgeProps.pill ? \"\" : undefined,\n },\n badgeProps.loading ? [h(LoadingIndicator)] : [badgeProps.content as VNodeArrayChildren[number]],\n )\n : null,\n ]),\n ],\n },\n ),\n },\n )\n }\n },\n})\n\ntype TabOwnProps = InstanceType<typeof TabComponent>[\"$props\"]\n\n/** TabsTab props; other attributes (`aria-label`, ...) fall through to the button. */\nexport type TabProps = TabOwnProps & { \"aria-label\"?: string }\n\nexport const TabsTab = TabComponent as typeof TabComponent & { new (): { $props: TabProps } }\n\n/** Backward-compat alias of `TabsTab`, like React's `Tabs.Option` */\nexport const TabsOption: typeof TabsTab = TabsTab\n\n// ---------------------------------------------------------------------------\n// overflow=\"menu\" (React's OverflowTabs)\n\n/** Value of the menu button; no real tab has it */\nconst MORE_VALUE = \"__plexui_tabs_more__\"\n\ntype Slots = Record<string, ((...args: unknown[]) => VNodeArrayChildren) | undefined>\n\n/** The TabsTab vnodes of a default slot, through fragments (`v-for`, `<template>`) */\nconst tabVNodes = (nodes: VNodeArrayChildren | undefined): VNode[] =>\n (nodes ?? []).flatMap((node) => {\n if (!isVNode(node)) return []\n if (node.type === Fragment && Array.isArray(node.children)) return tabVNodes(node.children as VNodeArrayChildren)\n return node.type === TabComponent ? [node] : []\n })\n\nconst slotsOf = (node: VNode) => (node.children && typeof node.children === \"object\" && !Array.isArray(node.children) ? (node.children as Slots) : {})\n\n/** A tab's slot content; a vnode's raw slot may return a string or nothing */\nconst slotContent = (node: VNode, name: string): VNodeArrayChildren => {\n const content = slotsOf(node)[name]?.() as VNodeArrayChildren | VNodeArrayChildren[number] | undefined\n if (content == null) return []\n return Array.isArray(content) ? content : [content]\n}\n\nconst labelContent = (node: VNode) => slotContent(node, \"default\")\n\nconst plainText = (node: unknown): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(plainText).join(\"\")\n if (isVNode(node)) {\n if (node.type === Comment) return \"\"\n if (typeof node.children === \"string\") return node.children\n if (Array.isArray(node.children)) return plainText(node.children)\n return plainText(labelContent(node))\n }\n return \"\"\n}\n\nconst tabProps = (node: VNode) => (node.props ?? {}) as Record<string, unknown>\n\n/** Slot content that renders something: text, or a vnode other than a comment */\nconst filled = (nodes: VNodeArrayChildren) =>\n plainText(nodes) !== \"\" || nodes.some((node) => isVNode(node) && node.type !== Comment)\n\nconst badgeText = (badge: unknown) => (isBadgeObject(badge as TabsBadgeProp) ? plainText((badge as { content: unknown }).content) : plainText(badge))\n\n/** A tab's icon: the `icon` slot, else the prop */\nconst tabIcon = (node: VNode) => {\n const iconSlot = slotContent(node, \"icon\")\n return filled(iconSlot) ? iconSlot : renderIcon(tabProps(node).icon as TabsIconProp | undefined)\n}\n\n/** A tab's count as text: the `badge` slot, else the prop */\nconst tabCount = (node: VNode) => plainText(slotContent(node, \"badge\")) || badgeText(tabProps(node).badge)\n\n/** A raw vnode prop holds a boolean attribute as written: `<TabsTab disabled>` is \"\" */\nconst tabDisabled = (node: VNode) => {\n const disabled = tabProps(node).disabled\n return disabled != null && disabled !== false\n}\n\n/** A tab's name: its text, else its accessible name, else its value */\nconst tabLabel = (node: VNode) =>\n plainText(labelContent(node)) || (tabProps(node)[\"aria-label\"] as string | undefined) || String(tabProps(node).value)\n\n/** What a tab's width depends on: the strip measures again when it changes */\nconst tabsSignature = (nodes: VNode[]) =>\n nodes\n .map((node) =>\n [\n tabProps(node).value,\n plainText(labelContent(node)),\n tabCount(node),\n tabProps(node).icon != null || slotsOf(node).icon != null,\n ].join(\"\\u0000\"),\n )\n .join(\"\\u0001\")\n\n/**\n * MenuTrigger sets `data-state` (open or closed) on its child, while a tab\n * keeps `on` or `off` in the same attribute and the thumb finds the active tab\n * by it. The menu's value does not reach the tab; its handlers and\n * `aria-haspopup` / `aria-expanded` do.\n */\nconst MoreTab = defineComponent({\n name: \"TabsMoreTab\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n return () => {\n const { \"data-state\": _menuState, ...rest } = attrs\n return h(TabComponent, rest as TabProps, slots)\n }\n },\n})\n\nconst TabsPublic = defineComponent({\n name: \"Tabs\",\n inheritAttrs: false,\n props: {\n ...tabsProps,\n /**\n * What happens to tabs that do not fit in one row: the strip scrolls\n * sideways (`scroll`), or they move into a menu at its end (`menu`). The\n * menu button shows the active tab's name when it is a hidden one.\n * Horizontal tabs without `block` only.\n * @default \"scroll\"\n */\n overflow: { type: String as PropType<\"scroll\" | \"menu\">, default: \"scroll\" },\n /** Text of the menu button with `overflow=\"menu\"`. @default \"More\" */\n overflowLabel: { type: String, default: \"More\" },\n },\n emits: tabsEmits,\n setup(props, { slots, attrs, emit }) {\n const hostRef = ref<HTMLDivElement | null>(null)\n // Uncontrolled like the group: `value` unset starts empty\n const uncontrolledValue = ref(\"\")\n const current = computed(() => (props.value !== undefined ? props.value : uncontrolledValue.value))\n const select = (next: string) => {\n if (props.value === undefined) uncontrolledValue.value = next\n emit(\"update:value\", next)\n emit(\"change\", next)\n }\n\n // { count: null } while the measuring pass renders every tab and the\n // menu button; a new object each time, so an unchanged count still renders\n const measured = shallowRef<{ count: number | null }>({ count: null })\n let measuredSignature = \"\"\n let measuredActive = -1\n let lastRender = { measuring: true, signature: \"\", activeIndex: -1, length: 0 }\n let boxWidth = -1\n\n const measure = () => {\n if (!lastRender.measuring) return\n const root = hostRef.value?.firstElementChild\n if (!(root instanceof HTMLElement)) return\n\n const buttons = Array.from(root.querySelectorAll<HTMLElement>(\":scope > button\"))\n if (buttons.length !== lastRender.length + 1) return\n\n const widths = buttons.map((button) => button.getBoundingClientRect().width)\n const moreButton = buttons[buttons.length - 1]\n const moreWidth = widths.pop() ?? 0\n const style = getComputedStyle(root)\n const available =\n root.getBoundingClientRect().width -\n (Number.parseFloat(style.paddingLeft) || 0) -\n (Number.parseFloat(style.paddingRight) || 0)\n const gap = Number.parseFloat(style.columnGap) || 0\n boxWidth = hostRef.value?.parentElement?.clientWidth ?? -1\n measuredSignature = lastRender.signature\n measuredActive = lastRender.activeIndex\n\n if (available <= 0) {\n measured.value = { count: lastRender.length }\n return\n }\n\n const { activeIndex } = lastRender\n const chevron = moreButton?.querySelector(\"svg\")\n const chevronWidth = chevron?.getBoundingClientRect().width ?? 0\n const labelGap = chevron?.parentElement ? Number.parseFloat(getComputedStyle(chevron.parentElement).columnGap) || 0 : 0\n const activeWidth = activeIndex < 0 ? 0 : (widths[activeIndex] ?? 0) + chevronWidth + labelGap\n measured.value = { count: visibleTabCount(widths, moreWidth, activeWidth, activeIndex, gap, available) }\n }\n\n // The width to fit is the container's; reports during a measuring pass\n // are skipped. The menu strip may appear or go after mount, with `overflow`\n let observer: ResizeObserver | undefined\n let observed: HTMLElement | null = null\n const observeBox = () => {\n const box = hostRef.value?.parentElement ?? null\n if (box === observed) return\n observer?.disconnect()\n observer = undefined\n observed = box\n if (!box || typeof ResizeObserver === \"undefined\") return\n observer = new ResizeObserver(() => {\n if (lastRender.measuring) return\n const width = box.clientWidth\n if (width === boxWidth) return\n boxWidth = width\n measured.value = { count: null }\n })\n observer.observe(box)\n }\n onMounted(() => {\n measure()\n observeBox()\n })\n onUpdated(() => {\n measure()\n observeBox()\n })\n onBeforeUnmount(() => observer?.disconnect())\n\n const forward = {\n \"onUpdate:value\": (value: string) => emit(\"update:value\", value),\n \"onChange\": (value: string) => emit(\"change\", value),\n \"onClick\": (event: MouseEvent) => emit(\"click\", event),\n }\n\n return () => {\n const { overflow, overflowLabel, ...rootProps } = props\n if (overflow !== \"menu\" || props.block || props.orientation === \"vertical\") {\n return h(TabsComponent, { ...rootProps, ...attrs, ...forward }, slots)\n }\n\n const items = tabVNodes(slots.default?.() as VNodeArrayChildren | undefined)\n // The strip's own props size the tabs and the menu button too\n const signature = [overflowLabel, props.size, props.variant, props.gutterSize, props.pill, props.flush, tabsSignature(items)].join(\n \"\\u0002\",\n )\n const activeIndex = items.findIndex((item) => tabProps(item).value === current.value)\n const { count } = measured.value\n // New tabs measure again; so does an active tab that moves under the\n // menu button or back out, since the button carries the hidden one's name\n const stale =\n count !== null &&\n (signature !== measuredSignature ||\n (activeIndex !== measuredActive && (measuredActive >= count || activeIndex >= count)))\n const measuring = count === null || stale\n lastRender = { measuring, signature, activeIndex, length: items.length }\n\n const shown = measuring ? items : items.slice(0, count)\n const hidden = measuring ? [] : items.slice(count)\n const hiddenActive = hidden.find((item) => tabProps(item).value === current.value) ?? null\n\n const strip = h(\n TabsComponent,\n {\n ...rootProps,\n ...attrs,\n \"data-overflow\": \"menu\",\n \"value\": hiddenActive ? MORE_VALUE : current.value,\n // Pressing the menu button opens the menu; it is not a tab\n \"onUpdate:value\": (next: string) => {\n if (next !== MORE_VALUE) select(next)\n },\n \"onClick\": forward.onClick,\n },\n {\n default: () => [\n ...shown,\n measuring || hidden.length > 0\n ? h(MenuTrigger, null, {\n default: () =>\n h(MoreTab, { value: MORE_VALUE }, {\n default: () => [\n h(\"span\", { class: s.OverflowLabel }, [hiddenActive ? tabLabel(hiddenActive) : overflowLabel, h(ChevronDownMd)]),\n ],\n }),\n })\n : null,\n ],\n },\n )\n\n return h(\"div\", { ref: hostRef, class: s.OverflowHost }, [\n h(Menu, null, {\n default: () => [\n strip,\n h(MenuContent, { align: \"end\", minWidth: \"auto\" }, {\n default: () =>\n h(MenuRadioGroup, { \"value\": current.value, \"onUpdate:value\": select }, {\n default: () =>\n hidden.map((item) => {\n const itemProps = tabProps(item)\n const count = tabCount(item)\n const label = labelContent(item)\n return h(\n MenuRadioItem,\n {\n key: String(itemProps.value),\n value: String(itemProps.value),\n disabled: props.disabled || tabDisabled(item),\n },\n {\n default: () => [\n tabIcon(item),\n filled(label)\n ? label\n : ((itemProps[\"aria-label\"] as string | undefined) ?? String(itemProps.value)),\n // A tab's count moves into the menu with it\n count !== \"\" ? h(\"span\", { class: s.OverflowBadge }, count) : null,\n ],\n },\n )\n }),\n }),\n }),\n ],\n }),\n ])\n }\n },\n})\n\ntype TabsOwnProps = InstanceType<typeof TabsPublic>[\"$props\"]\n\n/** Tabs props plus the attributes that fall through to the group element, as in React. */\nexport type TabsProps = TabsOwnProps & Omit<HTMLAttributes, keyof TabsOwnProps> & { \"aria-label\"?: string }\n\nexport const Tabs = TabsPublic as typeof TabsPublic & { new (): { $props: TabsProps } }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const attachSheetDrag: (panel: HTMLElement, close: () => void) => () => void;
|
|
@@ -28,10 +28,12 @@ declare const FieldComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
28
28
|
type: BooleanConstructor;
|
|
29
29
|
default: boolean;
|
|
30
30
|
};
|
|
31
|
-
/** Layout direction of label and control. @default "vertical" */
|
|
32
|
-
orientation:
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
/** Layout direction of label and control. @default "horizontal" on a `row`, else "vertical" */
|
|
32
|
+
orientation: PropType<"vertical" | "horizontal">;
|
|
33
|
+
/** One line of a FieldGroup: label at the start, control at the end. @default false */
|
|
34
|
+
row: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
35
37
|
};
|
|
36
38
|
/** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */
|
|
37
39
|
id: StringConstructor;
|
|
@@ -58,10 +60,12 @@ declare const FieldComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
58
60
|
type: BooleanConstructor;
|
|
59
61
|
default: boolean;
|
|
60
62
|
};
|
|
61
|
-
/** Layout direction of label and control. @default "vertical" */
|
|
62
|
-
orientation:
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
/** Layout direction of label and control. @default "horizontal" on a `row`, else "vertical" */
|
|
64
|
+
orientation: PropType<"vertical" | "horizontal">;
|
|
65
|
+
/** One line of a FieldGroup: label at the start, control at the end. @default false */
|
|
66
|
+
row: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
65
69
|
};
|
|
66
70
|
/** Overrides the generated id set on the control and the label's `for`. A child's own `id` wins over both. */
|
|
67
71
|
id: StringConstructor;
|
|
@@ -69,7 +73,7 @@ declare const FieldComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
69
73
|
opticallyAlign: PropType<"start" | "end">;
|
|
70
74
|
}>> & Readonly<{}>, {
|
|
71
75
|
required: boolean;
|
|
72
|
-
|
|
76
|
+
row: boolean;
|
|
73
77
|
}, SlotsType<{
|
|
74
78
|
/** The control. Read the props to render them yourself (React's render prop). */
|
|
75
79
|
default?: (fieldProps: FieldChildProps) => VNodeChild;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
import { type PropType, type SlotsType, type VNodeChild } from "vue";
|
|
3
|
+
declare const FieldGroupComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
/** Heading over the block (or the `title` slot); it names the group */
|
|
5
|
+
title: StringConstructor;
|
|
6
|
+
/** Line under the title (or the `description` slot) */
|
|
7
|
+
description: StringConstructor;
|
|
8
|
+
/** Class for the block that holds the rows */
|
|
9
|
+
bodyClass: PropType<ClassValue>;
|
|
10
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
/** Heading over the block (or the `title` slot); it names the group */
|
|
14
|
+
title: StringConstructor;
|
|
15
|
+
/** Line under the title (or the `description` slot) */
|
|
16
|
+
description: StringConstructor;
|
|
17
|
+
/** Class for the block that holds the rows */
|
|
18
|
+
bodyClass: PropType<ClassValue>;
|
|
19
|
+
}>> & Readonly<{}>, {}, SlotsType<{
|
|
20
|
+
/** The rows: `Field row`, or rows of your own. */
|
|
21
|
+
default?: () => VNodeChild;
|
|
22
|
+
title?: () => VNodeChild;
|
|
23
|
+
description?: () => VNodeChild;
|
|
24
|
+
/** Content at the end of the header, such as a button */
|
|
25
|
+
action?: () => VNodeChild;
|
|
26
|
+
/** Content under the block, such as a note */
|
|
27
|
+
footer?: () => VNodeChild;
|
|
28
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
type FieldGroupOwnProps = InstanceType<typeof FieldGroupComponent>["$props"];
|
|
30
|
+
/** FieldGroup props; attributes reach the root element. */
|
|
31
|
+
export type FieldGroupProps = FieldGroupOwnProps & {
|
|
32
|
+
class?: ClassValue;
|
|
33
|
+
};
|
|
34
|
+
/** A titled block of rows: `Field row` lines with hairlines between them. */
|
|
35
|
+
export declare const FieldGroup: typeof FieldGroupComponent & {
|
|
36
|
+
new (): {
|
|
37
|
+
$props: FieldGroupProps;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FieldGroup, type FieldGroupProps } from "./FieldGroup.js";
|