@plexui/vue 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Dialog/Dialog.js +29 -6
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Dialog/index.js +1 -1
- package/dist/es/components/Dialog/index.js.map +1 -1
- package/dist/es/components/Dialog/sheetDrag.js +17 -4
- package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
- package/dist/es/components/Page/Page.js +12 -3
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/Page/index.js +1 -1
- package/dist/es/components/Page/index.js.map +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +15 -2
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Page/Page.d.ts +4 -0
- package/dist/types/components/Page/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -104,6 +104,8 @@ export const DialogContent = defineComponent({
|
|
|
104
104
|
placement: { type: String, default: "center" },
|
|
105
105
|
/** Placement at 640px and below, such as a bottom sheet on phones. @default placement */
|
|
106
106
|
mobilePlacement: String,
|
|
107
|
+
/** Mobile presentation at 640px and below. Sheets default to bottom placement. */
|
|
108
|
+
mobileVariant: String,
|
|
107
109
|
/** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */
|
|
108
110
|
onOpenAutoFocus: Function,
|
|
109
111
|
/** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */
|
|
@@ -111,6 +113,9 @@ export const DialogContent = defineComponent({
|
|
|
111
113
|
},
|
|
112
114
|
setup(props, { slots, attrs }) {
|
|
113
115
|
const { open, setOpen, titleCount, descriptionCount } = useDialogContext();
|
|
116
|
+
const mobilePlacement = computed(() => props.mobileVariant === "alert"
|
|
117
|
+
? "center"
|
|
118
|
+
: props.mobilePlacement ?? (props.mobileVariant === "sheet" ? "bottom" : undefined));
|
|
114
119
|
const rootContext = injectDialogRootContext();
|
|
115
120
|
// Radix's root makes the content id; Reka's trigger does, so a dialog
|
|
116
121
|
// without one would render `id=""`
|
|
@@ -164,10 +169,17 @@ export const DialogContent = defineComponent({
|
|
|
164
169
|
detachDrag?.();
|
|
165
170
|
detachDrag = undefined;
|
|
166
171
|
panelElement = element;
|
|
167
|
-
if (element &&
|
|
172
|
+
if (element && mobilePlacement.value === "bottom") {
|
|
168
173
|
detachDrag = attachSheetDrag(element, () => setOpen(false));
|
|
169
174
|
}
|
|
170
175
|
};
|
|
176
|
+
watch(mobilePlacement, () => {
|
|
177
|
+
detachDrag?.();
|
|
178
|
+
detachDrag = panelElement && mobilePlacement.value === "bottom"
|
|
179
|
+
? attachSheetDrag(panelElement, () => setOpen(false))
|
|
180
|
+
: undefined;
|
|
181
|
+
});
|
|
182
|
+
onBeforeUnmount(() => detachDrag?.());
|
|
171
183
|
let overlayElement;
|
|
172
184
|
const setOverlayRef = (instance) => {
|
|
173
185
|
const el = instance?.$el;
|
|
@@ -187,7 +199,8 @@ export const DialogContent = defineComponent({
|
|
|
187
199
|
"class": s.Content,
|
|
188
200
|
"style": toCssVariables({ "dialog-width": props.width }),
|
|
189
201
|
"data-placement": props.placement === "center" ? undefined : props.placement,
|
|
190
|
-
"data-mobile-placement":
|
|
202
|
+
"data-mobile-placement": mobilePlacement.value,
|
|
203
|
+
"data-mobile-variant": props.mobileVariant,
|
|
191
204
|
"data-pill": props.pill ? "" : undefined,
|
|
192
205
|
"onOpenAutoFocus": props.onOpenAutoFocus,
|
|
193
206
|
"onCloseAutoFocus": handleCloseAutoFocus,
|
|
@@ -215,8 +228,8 @@ export const DialogContent = defineComponent({
|
|
|
215
228
|
}),
|
|
216
229
|
]);
|
|
217
230
|
return () => {
|
|
218
|
-
const { placement
|
|
219
|
-
const crossesScreen = placement === "bottom" || placement === "start" || placement === "end" || mobilePlacement === "bottom";
|
|
231
|
+
const { placement } = props;
|
|
232
|
+
const crossesScreen = placement === "bottom" || placement === "start" || placement === "end" || mobilePlacement.value === "bottom";
|
|
220
233
|
return h(RekaDialogPortal, null, {
|
|
221
234
|
default: () => [
|
|
222
235
|
h(TransitionGroup,
|
|
@@ -240,6 +253,12 @@ export const DialogHeader = defineComponent({
|
|
|
240
253
|
return () => h("div", { class: s.Header }, slots.default?.());
|
|
241
254
|
},
|
|
242
255
|
});
|
|
256
|
+
export const DialogHeaderAction = defineComponent({
|
|
257
|
+
name: "DialogHeaderAction",
|
|
258
|
+
setup(_props, { slots }) {
|
|
259
|
+
return () => h("div", { class: s.HeaderAction }, slots.default?.());
|
|
260
|
+
},
|
|
261
|
+
});
|
|
243
262
|
/** The scrolling part between DialogHeader and DialogFooter: with it, only the body scrolls. */
|
|
244
263
|
export const DialogBody = defineComponent({
|
|
245
264
|
name: "DialogBody",
|
|
@@ -250,8 +269,12 @@ export const DialogBody = defineComponent({
|
|
|
250
269
|
});
|
|
251
270
|
export const DialogFooter = defineComponent({
|
|
252
271
|
name: "DialogFooter",
|
|
253
|
-
|
|
254
|
-
|
|
272
|
+
props: {
|
|
273
|
+
/** Override the mobile action layout. Alerts default to inline; sheets to stacked. */
|
|
274
|
+
mobileLayout: String,
|
|
275
|
+
},
|
|
276
|
+
setup(props, { slots }) {
|
|
277
|
+
return () => h("div", { class: s.Footer, "data-mobile-layout": props.mobileLayout }, slots.default?.());
|
|
255
278
|
},
|
|
256
279
|
});
|
|
257
280
|
/** Counts a mounted part, as Radix's title and description counts do. */
|
|
@@ -1 +1 @@
|
|
|
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,i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,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"]}
|
|
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,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,oDAAoD,CAAA;AAElE,MAAM,YAAY,GAAG,GAAG,CAAA;AAwBxB,MAAM,gBAAgB,GAAqC,MAAM,CAAC,cAAc,CAAC,CAAA;AAEjF,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAA;IAE9C,IAAI,CAAC,OAAO,EA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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 /** Mobile presentation at 640px and below. Sheets default to bottom placement. */\n mobileVariant: String as PropType<\"alert\" | \"sheet\">,\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 mobilePlacement = computed(() =>\n props.mobileVariant === \"alert\"\n ? \"center\"\n : props.mobilePlacement ?? (props.mobileVariant === \"sheet\" ? \"bottom\" : undefined),\n )\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 && mobilePlacement.value === \"bottom\") {\n detachDrag = attachSheetDrag(element, () => setOpen(false))\n }\n }\n\n watch(mobilePlacement, () => {\n detachDrag?.()\n detachDrag = panelElement && mobilePlacement.value === \"bottom\"\n ? attachSheetDrag(panelElement, () => setOpen(false))\n : undefined\n })\n onBeforeUnmount(() => detachDrag?.())\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\": mobilePlacement.value,\n \"data-mobile-variant\": props.mobileVariant,\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 } = props\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || mobilePlacement.value === \"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\nexport const DialogHeaderAction = defineComponent({\n name: \"DialogHeaderAction\",\n setup(_props, { slots }) {\n return () => h(\"div\", { class: s.HeaderAction }, 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 props: {\n /** Override the mobile action layout. Alerts default to inline; sheets to stacked. */\n mobileLayout: String as PropType<\"inline\" | \"stacked\">,\n },\n setup(props, { slots }) {\n return () => h(\"div\", { class: s.Footer, \"data-mobile-layout\": props.mobileLayout }, 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,2 +1,2 @@
|
|
|
1
|
-
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./Dialog.js";
|
|
1
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderAction, DialogTitle, DialogTrigger, } from "./Dialog.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GAId,MAAM,aAAa,CAAA","sourcesContent":["export {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n type DialogContentProps,\n type DialogPlacement,\n type DialogProps,\n} from \"./Dialog.js\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,GAId,MAAM,aAAa,CAAA","sourcesContent":["export {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogHeaderAction,\n DialogTitle,\n DialogTrigger,\n type DialogContentProps,\n type DialogPlacement,\n type DialogProps,\n} from \"./Dialog.js\"\n"]}
|
|
@@ -11,18 +11,23 @@ export const attachSheetDrag = (panel, close) => {
|
|
|
11
11
|
let lastY = 0;
|
|
12
12
|
let lastTime = 0;
|
|
13
13
|
let speed = 0;
|
|
14
|
+
let settleTimer;
|
|
14
15
|
const clear = () => {
|
|
15
16
|
panel.style.transition = "";
|
|
16
17
|
panel.style.transform = "";
|
|
17
18
|
};
|
|
18
19
|
const onStart = (event) => {
|
|
19
|
-
if (event.touches.length !== 1 || !window.matchMedia("(max-width:
|
|
20
|
+
if (event.touches.length !== 1 || !window.matchMedia("(max-width: 640px)").matches)
|
|
20
21
|
return;
|
|
21
22
|
const { clientY } = event.touches[0];
|
|
22
23
|
if (clientY - panel.getBoundingClientRect().top > GRIP)
|
|
23
24
|
return;
|
|
24
25
|
if (event.target?.closest?.(INTERACTIVE))
|
|
25
26
|
return;
|
|
27
|
+
if (settleTimer !== undefined)
|
|
28
|
+
window.clearTimeout(settleTimer);
|
|
29
|
+
settleTimer = undefined;
|
|
30
|
+
panel.removeEventListener("transitionend", clear);
|
|
26
31
|
startY = clientY;
|
|
27
32
|
lastY = clientY;
|
|
28
33
|
lastTime = event.timeStamp;
|
|
@@ -51,12 +56,14 @@ export const attachSheetDrag = (panel, close) => {
|
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
58
|
if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
window.setTimeout(() => {
|
|
59
|
+
// Something may keep it open, unsaved changes for one.
|
|
60
|
+
// Register before close, which may synchronously detach this gesture.
|
|
61
|
+
settleTimer = window.setTimeout(() => {
|
|
62
|
+
settleTimer = undefined;
|
|
57
63
|
if (panel.isConnected)
|
|
58
64
|
clear();
|
|
59
65
|
}, SETTLE);
|
|
66
|
+
close();
|
|
60
67
|
return;
|
|
61
68
|
}
|
|
62
69
|
panel.style.transition = "transform 250ms var(--cubic-enter)";
|
|
@@ -72,6 +79,12 @@ export const attachSheetDrag = (panel, close) => {
|
|
|
72
79
|
panel.removeEventListener("touchmove", onMove);
|
|
73
80
|
panel.removeEventListener("touchend", onEnd);
|
|
74
81
|
panel.removeEventListener("touchcancel", onEnd);
|
|
82
|
+
panel.removeEventListener("transitionend", clear);
|
|
83
|
+
if (settleTimer !== undefined)
|
|
84
|
+
window.clearTimeout(settleTimer);
|
|
85
|
+
settleTimer = undefined;
|
|
86
|
+
startY = null;
|
|
87
|
+
clear();
|
|
75
88
|
};
|
|
76
89
|
};
|
|
77
90
|
//# sourceMappingURL=sheetDrag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheetDrag.js","sourceRoot":"","sources":["../../../../src/components/Dialog/sheetDrag.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,mGAAmG;AACnG,MAAM,IAAI,GAAG,EA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AAU,EAAE,KAAK,CAAC,CAAA;IACzC,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;IAE5C,OAAO,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;QAC/C,KAAK,CAAC,mBAAmB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;QACjD,IAAI,WAAW,KAAK,SAAS;YAAE,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;QAC/D,WAAW,GAAG,SAAS,CAAA;QACvB,MAAM,GAAG,IAAI,CAAA;QACb,KAAK,EAAE,CAAA;IACT,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 let settleTimer: number | undefined\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: 640px)\").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 if (settleTimer !== undefined) window.clearTimeout(settleTimer)\n settleTimer = undefined\n panel.removeEventListener(\"transitionend\", clear)\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 // Something may keep it open, unsaved changes for one.\n // Register before close, which may synchronously detach this gesture.\n settleTimer = window.setTimeout(() => {\n settleTimer = undefined\n if (panel.isConnected) clear()\n }, SETTLE)\n close()\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 panel.removeEventListener(\"transitionend\", clear)\n if (settleTimer !== undefined) window.clearTimeout(settleTimer)\n settleTimer = undefined\n startY = null\n clear()\n }\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import s from "@plexui/styles/components/Page/Page.module.css";
|
|
|
3
3
|
// A trackpad's small settle at the top must not flash the line.
|
|
4
4
|
const SCROLLED_AFTER = 4;
|
|
5
5
|
const PAGE_CONTEXT = Symbol("Page");
|
|
6
|
-
function
|
|
6
|
+
function injectPageContext(part) {
|
|
7
7
|
const scrolled = inject(PAGE_CONTEXT, null);
|
|
8
8
|
if (!scrolled) {
|
|
9
9
|
throw new Error(`${part} must be used within Page`);
|
|
@@ -41,7 +41,7 @@ export const PageHeader = defineComponent({
|
|
|
41
41
|
divider: { type: Boolean, default: true },
|
|
42
42
|
},
|
|
43
43
|
setup(props, { slots }) {
|
|
44
|
-
const scrolled =
|
|
44
|
+
const scrolled = injectPageContext("PageHeader");
|
|
45
45
|
const line = computed(() => props.divider && scrolled.value);
|
|
46
46
|
return () => h("div", { "class": s.Header, "data-scrolled": line.value ? "" : undefined }, [
|
|
47
47
|
h("div", { class: s.Head }, slots.default?.()),
|
|
@@ -79,11 +79,20 @@ export const PageContent = defineComponent({
|
|
|
79
79
|
fill: { type: Boolean, default: false },
|
|
80
80
|
},
|
|
81
81
|
setup(props, { attrs, slots }) {
|
|
82
|
-
const scrolled =
|
|
82
|
+
const scrolled = injectPageContext("PageContent");
|
|
83
83
|
const onScroll = (event) => {
|
|
84
84
|
scrolled.value = event.currentTarget.scrollTop > SCROLLED_AFTER;
|
|
85
85
|
};
|
|
86
86
|
return () => h("div", mergeProps({ "class": s.Content, "data-fill": props.fill ? "" : undefined, onScroll }, attrs), [h("div", { class: s.Column }, slots.default?.())]);
|
|
87
87
|
},
|
|
88
88
|
});
|
|
89
|
+
/** Actions that remain below the scrolling content (React `Page.Footer`). */
|
|
90
|
+
export const PageFooter = defineComponent({
|
|
91
|
+
name: "PageFooter",
|
|
92
|
+
setup(_props, { slots }) {
|
|
93
|
+
return () => h("div", { class: s.Footer }, [
|
|
94
|
+
h("div", { class: s.FooterContent }, slots.default?.()),
|
|
95
|
+
]);
|
|
96
|
+
},
|
|
97
|
+
});
|
|
89
98
|
//# sourceMappingURL=Page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/Page/Page.ts"],"names":[],"mappings":"AAAA,O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C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,EAC1E,KAAK,CACN,EACD,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CACnD,CAAA;IACL,CAAC;CACF,CAAC,CAAA;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE;QACrB,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;YACzC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;SACxD,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n inject,\n mergeProps,\n provide,\n ref,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport s from \"@plexui/styles/components/Page/Page.module.css\"\n\n// Vue port of packages/ui/src/components/Page/Page.tsx. Exports are flat\n// (`PageHeader` for `Page.Header`, ...). As in React, caller attributes are\n// applied after the page's own (`class` is merged), so they win.\n\nexport type PageWidth = \"full\" | \"wide\" | \"column\"\n\n// A trackpad's small settle at the top must not flash the line.\nconst SCROLLED_AFTER = 4\n\nconst PAGE_CONTEXT: InjectionKey<Ref<boolean>> = Symbol(\"Page\")\n\nfunction injectPageContext(part: string): Ref<boolean> {\n const scrolled = inject(PAGE_CONTEXT, null)\n if (!scrolled) {\n throw new Error(`${part} must be used within Page`)\n }\n return scrolled\n}\n\nconst PageComponent = defineComponent({\n name: \"Page\",\n props: {\n /**\n * Width of the column that header and content share: `\"full\"` (edge to\n * edge, for tables), `\"wide\"` (1280px, centred, for overviews) or `\"column\"`\n * (768px, centred, for settings and forms). Set `--page-width` on the page\n * for any other width.\n * @default \"full\"\n */\n width: { type: String as PropType<PageWidth>, default: \"full\" },\n },\n setup(props, { slots }) {\n provide(PAGE_CONTEXT, ref(false))\n\n return () => h(\"div\", { \"class\": s.Page, \"data-width\": props.width }, slots.default?.())\n },\n})\n\n/** Props of `Page`. */\nexport type PageProps = { width?: PageWidth } & HTMLAttributes\n\nexport const Page = PageComponent as typeof PageComponent & { new (): { $props: PageProps } }\n\n/** The band above the content, one column with it (React `Page.Header`). */\nexport const PageHeader = defineComponent({\n name: \"PageHeader\",\n props: {\n /**\n * Shows the line, and the glass on a phone, once the content has scrolled\n * under the header. Turn it off when the content already draws a line of\n * its own at that place.\n * @default true\n */\n divider: { type: Boolean, default: true },\n },\n setup(props, { slots }) {\n const scrolled = injectPageContext(\"PageHeader\")\n const line = computed(() => props.divider && scrolled.value)\n\n return () =>\n h(\"div\", { \"class\": s.Header, \"data-scrolled\": line.value ? \"\" : undefined }, [\n h(\"div\", { class: s.Head }, slots.default?.()),\n ])\n },\n})\n\nfunction part(name: string, tag: string, className: string) {\n return defineComponent({\n name,\n setup(_, { slots }) {\n return () => h(tag, { class: className }, slots.default?.())\n },\n })\n}\n\n/** The row of the title and the actions (React `Page.Bar`). */\nexport const PageBar = part(\"PageBar\", \"div\", s.Bar)\n/** Title with what stands beside it, a subtitle under it on a phone (React `Page.Heading`). */\nexport const PageHeading = part(\"PageHeading\", \"div\", s.Heading)\n/** Page heading, an `<h1>` (React `Page.Title`). */\nexport const PageTitle = part(\"PageTitle\", \"h1\", s.Title)\n/** Status of the page, a `<p>` (React `Page.Subtitle`). */\nexport const PageSubtitle = part(\"PageSubtitle\", \"p\", s.Subtitle)\n/** Buttons on the trailing side of the bar (React `Page.Actions`). */\nexport const PageActions = part(\"PageActions\", \"div\", s.Actions)\n\n/** The part of the page that scrolls (React `Page.Content`). */\nexport const PageContent = defineComponent({\n name: \"PageContent\",\n inheritAttrs: false,\n props: {\n /**\n * The content fills the page and scrolls inside itself, as a table does:\n * the page stops scrolling from 768px up.\n * @default false\n */\n fill: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const scrolled = injectPageContext(\"PageContent\")\n\n const onScroll = (event: Event) => {\n scrolled.value = (event.currentTarget as HTMLElement).scrollTop > SCROLLED_AFTER\n }\n\n return () =>\n h(\n \"div\",\n mergeProps(\n { \"class\": s.Content, \"data-fill\": props.fill ? \"\" : undefined, onScroll },\n attrs,\n ),\n [h(\"div\", { class: s.Column }, slots.default?.())],\n )\n },\n})\n\n/** Actions that remain below the scrolling content (React `Page.Footer`). */\nexport const PageFooter = defineComponent({\n name: \"PageFooter\",\n setup(_props, { slots }) {\n return () => h(\"div\", { class: s.Footer }, [\n h(\"div\", { class: s.FooterContent }, slots.default?.()),\n ])\n },\n})\n\n/** Props of the Page parts: native attributes of their element. */\nexport type PageSlotProps = HTMLAttributes\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Page, PageActions, PageBar, PageContent, PageHeader, PageHeading, PageSubtitle, PageTitle, } from "./Page.js";
|
|
1
|
+
export { Page, PageActions, PageBar, PageContent, PageFooter, PageHeader, PageHeading, PageSubtitle, PageTitle, } from "./Page.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,SAAS,GAIV,MAAM,WAAW,CAAA","sourcesContent":["export {\n Page,\n PageActions,\n PageBar,\n PageContent,\n PageHeader,\n PageHeading,\n PageSubtitle,\n PageTitle,\n type PageProps,\n type PageSlotProps,\n type PageWidth,\n} from \"./Page.js\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,SAAS,GAIV,MAAM,WAAW,CAAA","sourcesContent":["export {\n Page,\n PageActions,\n PageBar,\n PageContent,\n PageFooter,\n PageHeader,\n PageHeading,\n PageSubtitle,\n PageTitle,\n type PageProps,\n type PageSlotProps,\n type PageWidth,\n} from \"./Page.js\"\n"]}
|
|
@@ -53,6 +53,8 @@ export declare const DialogContent: import("vue").DefineComponent<import("vue").
|
|
|
53
53
|
};
|
|
54
54
|
/** Placement at 640px and below, such as a bottom sheet on phones. @default placement */
|
|
55
55
|
mobilePlacement: PropType<Extract<DialogPlacement, "center" | "bottom" | "fullscreen">>;
|
|
56
|
+
/** Mobile presentation at 640px and below. Sheets default to bottom placement. */
|
|
57
|
+
mobileVariant: PropType<"alert" | "sheet">;
|
|
56
58
|
/** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */
|
|
57
59
|
onOpenAutoFocus: PropType<(event: Event) => void>;
|
|
58
60
|
/** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */
|
|
@@ -89,6 +91,8 @@ export declare const DialogContent: import("vue").DefineComponent<import("vue").
|
|
|
89
91
|
};
|
|
90
92
|
/** Placement at 640px and below, such as a bottom sheet on phones. @default placement */
|
|
91
93
|
mobilePlacement: PropType<Extract<DialogPlacement, "center" | "bottom" | "fullscreen">>;
|
|
94
|
+
/** Mobile presentation at 640px and below. Sheets default to bottom placement. */
|
|
95
|
+
mobileVariant: PropType<"alert" | "sheet">;
|
|
92
96
|
/** Called when focus moves into the dialog on open; `event.preventDefault()` keeps it for you to place. */
|
|
93
97
|
onOpenAutoFocus: PropType<(event: Event) => void>;
|
|
94
98
|
/** Called when focus returns on close; `event.preventDefault()` keeps it elsewhere. */
|
|
@@ -102,13 +106,22 @@ export declare const DialogContent: import("vue").DefineComponent<import("vue").
|
|
|
102
106
|
export declare const DialogHeader: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
103
107
|
[key: string]: any;
|
|
104
108
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
109
|
+
export declare const DialogHeaderAction: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
110
|
+
[key: string]: any;
|
|
111
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
105
112
|
/** The scrolling part between DialogHeader and DialogFooter: with it, only the body scrolls. */
|
|
106
113
|
export declare const DialogBody: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
107
114
|
[key: string]: any;
|
|
108
115
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
109
|
-
export declare const DialogFooter: import("vue").DefineComponent<
|
|
116
|
+
export declare const DialogFooter: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
117
|
+
/** Override the mobile action layout. Alerts default to inline; sheets to stacked. */
|
|
118
|
+
mobileLayout: PropType<"inline" | "stacked">;
|
|
119
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
110
120
|
[key: string]: any;
|
|
111
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<
|
|
121
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
122
|
+
/** Override the mobile action layout. Alerts default to inline; sheets to stacked. */
|
|
123
|
+
mobileLayout: PropType<"inline" | "stacked">;
|
|
124
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
112
125
|
export declare const DialogTitle: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
113
126
|
[key: string]: any;
|
|
114
127
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DialogContentProps, type DialogPlacement, type DialogProps, } from "./Dialog.js";
|
|
1
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderAction, DialogTitle, DialogTrigger, type DialogContentProps, type DialogPlacement, type DialogProps, } from "./Dialog.js";
|
|
@@ -112,6 +112,10 @@ export declare const PageContent: import("vue").DefineComponent<import("vue").Ex
|
|
|
112
112
|
}>> & Readonly<{}>, {
|
|
113
113
|
fill: boolean;
|
|
114
114
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
115
|
+
/** Actions that remain below the scrolling content (React `Page.Footer`). */
|
|
116
|
+
export declare const PageFooter: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
117
|
+
[key: string]: any;
|
|
118
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
115
119
|
/** Props of the Page parts: native attributes of their element. */
|
|
116
120
|
export type PageSlotProps = HTMLAttributes;
|
|
117
121
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Page, PageActions, PageBar, PageContent, PageHeader, PageHeading, PageSubtitle, PageTitle, type PageProps, type PageSlotProps, type PageWidth, } from "./Page.js";
|
|
1
|
+
export { Page, PageActions, PageBar, PageContent, PageFooter, PageHeader, PageHeading, PageSubtitle, PageTitle, type PageProps, type PageSlotProps, type PageWidth, } from "./Page.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@maskito/core": "5.2.2",
|
|
78
78
|
"@maskito/kit": "5.2.2",
|
|
79
79
|
"@maskito/vue": "5.2.2",
|
|
80
|
-
"@plexui/styles": "^0.1.
|
|
80
|
+
"@plexui/styles": "^0.1.31",
|
|
81
81
|
"@tanstack/table-core": "8.21.3",
|
|
82
82
|
"@tanstack/vue-table": "8.21.3",
|
|
83
83
|
"@tiptap/core": "3.21.0",
|