@plexui/ui 0.50.0 → 0.52.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/DatePicker/Calendar.js +2 -1
- package/dist/es/components/DatePicker/Calendar.js.map +1 -1
- package/dist/es/components/DateRangePicker/Calendar.js +2 -1
- package/dist/es/components/DateRangePicker/Calendar.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +79 -7
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Page/Page.js +3 -2
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/Toolbar/Toolbar.js +10 -5
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/lib/calendarFit.js +57 -0
- package/dist/es/lib/calendarFit.js.map +1 -0
- package/dist/types/components/Page/Page.d.ts +7 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +7 -1
- package/dist/types/lib/calendarFit.d.ts +11 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,CAAC,MAAM,sDAAsD,CAAA;AA2BpE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAyC,EAA6B,EAAE,CACpG,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAA;AAyB/E,MAAM,CAAC,MAAM,kB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AAQ,GAAO,EAClF,WAAW,IAAI,YAAG,SAAS,EAAE,CAAC,CAAC,QAAQ,YAAG,QAAQ,GAAK,IACpD,CACP,CAAA;IACD,IAAI,CAAC,KAAK;QAAE,OAAO,OAAO,CAAA;IAC1B,gHAAgH;IAChH,8GAA8G;IAC9G,wHAAwH;IACxH,OAAO,CACL,8BACG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAC7C,eAAM,SAAS,EAAE,CAAC,CAAC,cAAc,iBAAc,MAAM,YAClD,WAAW,CAAC,CAAC,CAAC,8BAAE,eAAM,SAAS,EAAE,CAAC,CAAC,aAAa,YAAG,QAAQ,GAAQ,EAAA,eAAM,SAAS,EAAE,CAAC,CAAC,iBAAiB,YAAG,QAAQ,GAAQ,IAAG,CAAC,CAAC,CAAC,QAAQ,GACpI,IACN,CACJ,CAAA;AACH,CAAC;AACD,YAAY,CAAC,WAAW,GAAG,eAAe,CAAA;AAE1C,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,CAAC,MAAM,OAAO,GAAG,WAOtB,CAAA;AAED,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAA;AAClC,OAAO,CAAC,GAAG,GAAG,UAAU,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport s from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\nexport type ToolbarPlacement = \"top\" | \"bottom\"\n/** Title layouts of the phone top bar. */\nexport type ToolbarTitleStyle = \"inline\" | \"large\" | \"compact-large\" | \"compact-medium\"\nexport type ToolbarTitleAlign = \"center\" | \"start\"\n/**\n * How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:\n * - `\"soft\"` (the default of a bottom bar): at the top, once content is under the bar, a blur that grows toward the top under a\n * thin veil of the canvas color, with no line, which lets go past the bar; at the bottom of a page the content stays clear\n * under and around the controls, as on native iOS 26, and a Sheet's bottom bar fades its content into the panel\n * - `\"hard\"`: an opaque bar of the canvas color with a hairline once content is under it\n * - `\"glass\"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it\n * - `\"blur\"`: no fill and no line, once content is under the bar: the content blurred a little over the bar and past it,\n * and heavily toward the screen's edge\n *\n * iOS 27.2 has two scroll edges, soft and hard; glass is the bar of earlier iOS and blur an app's own.\n */\nexport type BarBackground = \"soft\" | \"hard\" | \"glass\" | \"blur\"\n/**\n * `\"solid\"` is the earlier name of `\"hard\"`: iOS has no opaque bar without a line, and it draws the line of a hard edge\n * only once content is under the bar, so at rest the two look the same.\n */\nexport type BarBackgroundAlias = \"solid\"\n/** `\"edge\"` is the earlier name of `\"soft\"`, `\"solid\"` of `\"hard\"`. */\nexport type ToolbarBackground = BarBackground | BarBackgroundAlias | \"edge\"\n\n/** The background a bar draws, from its current name or an earlier one. */\nexport const barBackground = (background: ToolbarBackground | undefined): BarBackground | undefined =>\n background === \"edge\" ? \"soft\" : background === \"solid\" ? \"hard\" : background\n\n/**\n * A surface that places phone toolbars: `Page` puts the top bar over its content\n * and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.\n */\nexport type ToolbarHost = {\n kind: \"page\" | \"dialog\"\n setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void\n /** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */\n scrolled?: boolean\n /** Content continues under the bottom bar, so a hard or glass bar shows its line. */\n contentBelow?: boolean\n /** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */\n subscribeScroll?: (listener: (scrollTop: number) => void) => () => void\n /** A large title asks for a place in the content; returns the release. */\n requestLargeTitleSlot?: () => () => void\n /** The place at the top of the content where a large title scrolls with it, once the content has made one. */\n largeTitleSlot?: HTMLElement | null\n /** The place under a large title where the bar's rows stand, pinned under the bar once scrolled up to it. */\n largeTitleRowSlot?: HTMLElement | null\n /** The rows under a large title are pinned under the bar, so its background reaches under them. */\n rowsPinned?: boolean\n}\n\nexport const ToolbarHostContext = createContext<ToolbarHost | null>(null)\n\n// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.\nconst ToolbarTitleStyleContext = createContext<ToolbarTitleStyle | undefined>(undefined)\n// The bar itself, which a large title in the content marks once it has gone under the bar. It is state, so a title\n// that mounts before its bar (a bar replaced under a page that keeps its content) follows the bar once it is there.\nconst ToolbarElementContext = createContext<HTMLDivElement | null>(null)\n\n// The tokens of a large title a bar can set for itself, which the title in the content no longer inherits from it.\nconst LARGE_TITLE_TOKENS = [\n \"--toolbar-padding-bottom\",\n \"--toolbar-large-title-gap\",\n \"--toolbar-large-title-font-size\",\n \"--toolbar-large-title-line-height\",\n \"--toolbar-large-title-descent\",\n \"--toolbar-large-subtitle-font-size\",\n \"--toolbar-large-subtitle-line-height\",\n \"--toolbar-large-subtitle-descent\",\n]\n\n/**\n * Follows a large title in the content: it takes the large title tokens the bar sets for itself, and once its last line\n * is at the bar's bottom the bar shows it inline. Scrolling moves it; a change of layout (a wide window turning into a\n * phone's, which shows the bar and the title) or of a class or style on the bar, the content or around them measures it\n * again. A token the bar shares with the content stays inherited, so it follows the page's changes. A hidden title has\n * not gone under anything.\n */\nfunction followLargeTitle(bar: HTMLElement, heading: HTMLElement, subscribeScroll: (listener: () => void) => () => void) {\n const collapse = () => {\n const box = heading.getBoundingClientRect()\n bar.toggleAttribute(\"data-title-collapsed\", box.height > 0 && box.bottom <= bar.getBoundingClientRect().bottom)\n }\n const layout = () => {\n const own = getComputedStyle(bar)\n const place = heading.parentElement ? getComputedStyle(heading.parentElement) : undefined\n for (const token of LARGE_TITLE_TOKENS) {\n const value = own.getPropertyValue(token).trim()\n if (value && value !== place?.getPropertyValue(token).trim()) heading.style.setProperty(token, value)\n else heading.style.removeProperty(token)\n }\n collapse()\n }\n layout()\n const unsubscribe = subscribeScroll(collapse)\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(layout) : undefined\n observer?.observe(bar)\n observer?.observe(heading)\n const mutations = typeof MutationObserver !== \"undefined\" ? new MutationObserver(layout) : undefined\n // A token reaches the bar or the content from the class or style of either or of anything around them.\n for (const start of [bar, heading.parentElement]) {\n for (let node = start; node; node = node.parentElement) mutations?.observe(node, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n }\n return () => {\n unsubscribe()\n observer?.disconnect()\n mutations?.disconnect()\n bar.removeAttribute(\"data-title-collapsed\")\n for (const token of LARGE_TITLE_TOKENS) heading.style.removeProperty(token)\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarProps = HTMLAttributes<HTMLDivElement> & {\n /** @default \"top\" */\n placement?: ToolbarPlacement\n /** Layout of `Toolbar.Title` in a top bar. @default \"inline\" */\n titleStyle?: ToolbarTitleStyle\n /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default \"center\" */\n titleAlign?: ToolbarTitleAlign\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" at the top, \"soft\" at the bottom */\n background?: ToolbarBackground\n ref?: Ref<HTMLDivElement>\n}\n\nfunction ToolbarRoot({\n placement = \"top\",\n titleStyle = \"inline\",\n titleAlign = \"center\",\n background = placement === \"bottom\" ? \"soft\" : \"glass\",\n className,\n children,\n ref,\n ...restProps\n}: ToolbarProps) {\n const host = useContext(ToolbarHostContext)\n const element = useRef<HTMLDivElement | null>(null)\n const [barElement, setBarElement] = useState<HTMLDivElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n setBarElement(node)\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n // A desktop layout hides the bar; its height then leaves the host's own header in charge.\n const update = () => setHeight(placement, bar.offsetHeight || undefined)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeight(placement, undefined) }\n }, [placement, setHeight])\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Toolbar, className)}\n data-toolbar=\"\"\n data-placement={placement}\n data-title-style={placement === \"top\" ? titleStyle : undefined}\n data-title-align={placement === \"top\" ? titleAlign : undefined}\n data-background={barBackground(background)}\n data-host={host?.kind}\n data-scrolled={placement === \"top\" && host?.scrolled ? \"\" : undefined}\n data-content-below={placement === \"bottom\" && host?.contentBelow ? \"\" : undefined}\n data-rows-pinned={placement === \"top\" && host?.rowsPinned ? \"\" : undefined}\n {...restProps}\n >\n <ToolbarElementContext.Provider value={barElement}>\n <ToolbarTitleStyleContext.Provider value={placement === \"top\" ? titleStyle : undefined}>{children}</ToolbarTitleStyleContext.Provider>\n </ToolbarElementContext.Provider>\n </div>\n )\n}\nToolbarRoot.displayName = \"Toolbar\"\n\n/* ------------------------------------------------------------------ */\n/* Parts */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction ToolbarLeading({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Leading, className)} {...restProps} />\n}\nToolbarLeading.displayName = \"Toolbar.Leading\"\n\nfunction ToolbarTrailing({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Trailing, className)} {...restProps} />\n}\nToolbarTrailing.displayName = \"Toolbar.Trailing\"\n\nexport type ToolbarContentProps = ToolbarSlotProps & {\n /** Stretch between the leading and trailing items, as a search field does. */\n fill?: boolean\n}\n\n/** Custom middle content: a search field, a segmented control or a single centered action. */\nfunction ToolbarContent({ fill = false, className, ...restProps }: ToolbarContentProps) {\n return <div className={clsx(s.Content, className)} data-fill={fill ? \"\" : undefined} {...restProps} />\n}\nToolbarContent.displayName = \"Toolbar.Content\"\n\n/** Buttons that share one capsule. */\nfunction ToolbarGroup({ className, ...restProps }: ToolbarSlotProps) {\n return <div role=\"group\" className={clsx(s.Group, className)} {...restProps} />\n}\nToolbarGroup.displayName = \"Toolbar.Group\"\n\nconst rowOfAnchor = new WeakMap<Element, HTMLElement>()\n\n/**\n * Under a large title each row is portaled into the rows' place as it mounts, so a row that comes later (a search field\n * shown over a segmented control already there) would stand last. An empty anchor in the bar keeps the row's place among\n * the bar's rows, and the rows are moved into that order in the content, so the keyboard and a screen reader meet them\n * as they stand (Codex #7); a row added or removed in the bar orders them again.\n */\nfunction followRowOrder(anchor: HTMLElement, row: HTMLElement) {\n const bar = anchor.closest(\"[data-toolbar]\") ?? anchor.parentElement\n if (!bar) return () => {}\n rowOfAnchor.set(anchor, row)\n const place = () => {\n const slot = row.parentElement\n if (!slot) return\n const rows = Array.from(bar.querySelectorAll(\"[data-toolbar-row-anchor]\"), (mark) => rowOfAnchor.get(mark))\n .filter((each): each is HTMLElement => each?.parentElement === slot)\n // From the last row back, a row that does not stand before the next one goes right before it: only a row out of\n // place moves (the one that came later), so a field focused in another row keeps its focus (Codex #8); moveBefore,\n // where the browser has it, keeps it even in the row that moves.\n const move = (slot as HTMLElement & { moveBefore?: (node: Node, child: Node | null) => void }).moveBefore\n for (let index = rows.length - 2; index >= 0; index--) {\n const each = rows[index]\n const next = rows[index + 1]\n if (each.compareDocumentPosition(next) & Node.DOCUMENT_POSITION_FOLLOWING) continue\n try {\n if (move) {\n move.call(slot, each, next)\n continue\n }\n } catch {\n // falls back to a plain move\n }\n slot.insertBefore(each, next)\n }\n }\n place()\n const observer = typeof MutationObserver !== \"undefined\" ? new MutationObserver(place) : undefined\n observer?.observe(bar, { childList: true, subtree: true })\n return () => {\n observer?.disconnect()\n rowOfAnchor.delete(anchor)\n }\n}\n\n/**\n * A row under the controls, part of the bar: a segmented control that switches the screen's views (a chat list's\n * folders under its bar), or a search field. It spans the bar, and a control in it fills the row; several rows stand in\n * their order (a search field over a segmented control). Under a large title on a page the rows stand under the title,\n * at the top of the content, and once scrolled up to the bar they stay pinned under its controls, as iOS 27.2 pins a\n * safeAreaBar under a large title's bar.\n */\nfunction ToolbarRow({ className, ref, ...restProps }: ToolbarSlotProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n const large = titleStyle === \"large\" && host?.kind === \"page\"\n const requestSlot = large ? host?.requestLargeTitleSlot : undefined\n const slot = large ? host?.largeTitleRowSlot ?? null : null\n useLayoutEffect(() => requestSlot?.(), [requestSlot])\n const element = useRef<HTMLDivElement | null>(null)\n const anchor = useRef<HTMLSpanElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n useLayoutEffect(() => {\n if (!slot || !anchor.current || !element.current) return\n return followRowOrder(anchor.current, element.current)\n }, [slot])\n const row = <div ref={setRef} className={clsx(s.Row, className)} data-toolbar-row=\"\" data-in-content={slot ? \"\" : undefined} {...restProps} />\n // Under a large title the row waits for its place in the content (it comes before the first paint) and never stands\n // in the bar first: moving it from the bar into the portal would mount its children again, and a switcher that holds\n // its own selection would lose it (Codex #5).\n if (large) return slot ? <>{createPortal(row, slot)}<span ref={anchor} data-toolbar-row-anchor=\"\" hidden /></> : null\n return row\n}\nToolbarRow.displayName = \"Toolbar.Row\"\n\nexport type ToolbarTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, \"children\"> & {\n children: ReactNode\n /** A second, smaller line below the title. */\n subtitle?: ReactNode\n /**\n * Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden from\n * assistive technology there. @default \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\"\n ref?: Ref<HTMLHeadingElement>\n}\n\nfunction ToolbarTitle({ children, subtitle, as, className, ref, ...restProps }: ToolbarTitleProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n const bar = useContext(ToolbarElementContext)\n const headingRef = useRef<HTMLDivElement | null>(null)\n const large = titleStyle === \"large\" && host?.kind === \"page\"\n const requestSlot = large ? host?.requestLargeTitleSlot : undefined\n const slot = large ? host?.largeTitleSlot ?? null : null\n const subscribeScroll = host?.subscribeScroll\n useLayoutEffect(() => requestSlot?.(), [requestSlot])\n // In the content the title scrolls with it, on the compositor and through the overscroll, as on iOS 26. Once it has\n // gone under the bar (its last line at the bar's bottom), the bar shows it inline and a hard or glass bar its line.\n useLayoutEffect(() => {\n const heading = headingRef.current\n if (!slot || !bar || !heading || !subscribeScroll) return\n return followLargeTitle(bar, heading, subscribeScroll)\n }, [bar, slot, subscribeScroll])\n const decorative = host?.kind === \"dialog\"\n const Tag = as ?? \"h1\"\n const hasSubtitle = subtitle != null && subtitle !== false && subtitle !== \"\"\n const heading = (\n <div ref={headingRef} className={s.Heading} aria-hidden={decorative || undefined} data-in-content={slot ? \"\" : undefined}>\n <Tag ref={ref} className={clsx(s.Title, className)} {...restProps}>{children}</Tag>\n {hasSubtitle && <p className={s.Subtitle}>{subtitle}</p>}\n </div>\n )\n if (!large) return heading\n // Until the content has made its place (a server-rendered page before it hydrates), the title stands in the bar\n // where it will stand in the content. The inline copy the row of controls shows once the large title has gone\n // under it keeps a subtitle as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).\n return (\n <>\n {slot ? createPortal(heading, slot) : heading}\n <span className={s.CollapsedTitle} aria-hidden=\"true\">\n {hasSubtitle ? <><span className={s.CollapsedLine}>{children}</span><span className={s.CollapsedSubtitle}>{subtitle}</span></> : children}\n </span>\n </>\n )\n}\nToolbarTitle.displayName = \"Toolbar.Title\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Leading: typeof ToolbarLeading\n Title: typeof ToolbarTitle\n Content: typeof ToolbarContent\n Group: typeof ToolbarGroup\n Trailing: typeof ToolbarTrailing\n Row: typeof ToolbarRow\n}\n\nToolbar.Leading = ToolbarLeading\nToolbar.Title = ToolbarTitle\nToolbar.Content = ToolbarContent\nToolbar.Group = ToolbarGroup\nToolbar.Trailing = ToolbarTrailing\nToolbar.Row = ToolbarRow\n"]}
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,CAAC,MAAM,sDAAsD,CAAA;AA2BpE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAyC,EAA6B,EAAE,CACpG,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAA;AA+B/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAEzE,2GAA2G;AAC3G,MAAM,wBAAwB,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAA;AACxF,mHAAmH;AACnH,oHAAoH;AACpH,MAAM,qBAAqB,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAA;AAExE,mHAAmH;AACnH,MAAM,kBAAkB,GAAG;IACzB,0BAA0B;IAC1B,2BAA2B;IAC3B,iCAAiC;IACjC,mCAAmC;IACnC,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,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAC7C,eAAM,SAAS,EAAE,CAAC,CAAC,cAAc,iBAAc,MAAM,YAClD,WAAW,CAAC,CAAC,CAAC,8BAAE,eAAM,SAAS,EAAE,CAAC,CAAC,aAAa,YAAG,QAAQ,GAAQ,EAAA,eAAM,SAAS,EAAE,CAAC,CAAC,iBAAiB,YAAG,QAAQ,GAAQ,IAAG,CAAC,CAAC,CAAC,QAAQ,GACpI,IACN,CACJ,CAAA;AACH,CAAC;AACD,YAAY,CAAC,WAAW,GAAG,eAAe,CAAA;AAE1C,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,CAAC,MAAM,OAAO,GAAG,WAOtB,CAAA;AAED,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAA;AAClC,OAAO,CAAC,GAAG,GAAG,UAAU,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport s from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\nexport type ToolbarPlacement = \"top\" | \"bottom\"\n/** Title layouts of the phone top bar. */\nexport type ToolbarTitleStyle = \"inline\" | \"large\" | \"compact-large\" | \"compact-medium\"\nexport type ToolbarTitleAlign = \"center\" | \"start\"\n/**\n * How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:\n * - `\"soft\"` (the default of a bottom bar): at the top, once content is under the bar, a blur that grows toward the top under a\n * thin veil of the canvas color, with no line, which lets go past the bar; at the bottom of a page the content stays clear\n * under and around the controls, as on native iOS 26, and a Sheet's bottom bar fades its content into the panel\n * - `\"hard\"`: an opaque bar of the canvas color with a hairline once content is under it\n * - `\"glass\"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it\n * - `\"blur\"`: no fill and no line, once content is under the bar: the content blurred a little over the bar and past it,\n * and heavily toward the screen's edge\n *\n * iOS 27.2 has two scroll edges, soft and hard; glass is the bar of earlier iOS and blur an app's own.\n */\nexport type BarBackground = \"soft\" | \"hard\" | \"glass\" | \"blur\"\n/**\n * `\"solid\"` is the earlier name of `\"hard\"`: iOS has no opaque bar without a line, and it draws the line of a hard edge\n * only once content is under the bar, so at rest the two look the same.\n */\nexport type BarBackgroundAlias = \"solid\"\n/** `\"edge\"` is the earlier name of `\"soft\"`, `\"solid\"` of `\"hard\"`. */\nexport type ToolbarBackground = BarBackground | BarBackgroundAlias | \"edge\"\n\n/** The background a bar draws, from its current name or an earlier one. */\nexport const barBackground = (background: ToolbarBackground | undefined): BarBackground | undefined =>\n background === \"edge\" ? \"soft\" : background === \"solid\" ? \"hard\" : background\n\n/**\n * A surface that places phone toolbars: `Page` puts the top bar over its content\n * and reserves the space; `Dialog` puts it 16px under the Sheet's top edge. Both keep a large title at the top of\n * their content (Page.Content, Dialog.Body), where it scrolls and collapses into the bar.\n */\nexport type ToolbarHost = {\n kind: \"page\" | \"dialog\"\n setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void\n /** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */\n scrolled?: boolean\n /** Content continues under the bottom bar, so a hard or glass bar shows its line. */\n contentBelow?: boolean\n /** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */\n subscribeScroll?: (listener: (scrollTop: number) => void) => () => void\n /** A large title asks for a place in the content; returns the release. */\n requestLargeTitleSlot?: () => () => void\n /** The place at the top of the content where a large title scrolls with it, once the content has made one. */\n largeTitleSlot?: HTMLElement | null\n /** The place under a large title where the bar's rows stand, pinned under the bar once scrolled up to it. */\n largeTitleRowSlot?: HTMLElement | null\n /** The rows under a large title are pinned under the bar, so its background reaches under them. */\n rowsPinned?: boolean\n /**\n * `false` while the host has no content to keep a large title in (a Dialog without Dialog.Body): the title and its\n * rows stay in the bar. Otherwise the rows wait for their place, so they mount once, there.\n */\n holdsLargeTitle?: boolean\n}\n\nexport const ToolbarHostContext = createContext<ToolbarHost | null>(null)\n\n// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.\nconst ToolbarTitleStyleContext = createContext<ToolbarTitleStyle | undefined>(undefined)\n// The bar itself, which a large title in the content marks once it has gone under the bar. It is state, so a title\n// that mounts before its bar (a bar replaced under a page that keeps its content) follows the bar once it is there.\nconst ToolbarElementContext = createContext<HTMLDivElement | null>(null)\n\n// The tokens of a large title a bar can set for itself, which the title in the content no longer inherits from it.\nconst LARGE_TITLE_TOKENS = [\n \"--toolbar-padding-bottom\",\n \"--toolbar-large-title-gap\",\n \"--toolbar-large-title-font-size\",\n \"--toolbar-large-title-line-height\",\n \"--toolbar-large-title-descent\",\n \"--toolbar-large-subtitle-font-size\",\n \"--toolbar-large-subtitle-line-height\",\n \"--toolbar-large-subtitle-descent\",\n]\n\n/**\n * Follows a large title in the content: it takes the large title tokens the bar sets for itself, and once its last line\n * is at the bar's bottom the bar shows it inline. Scrolling moves it; a change of layout (a wide window turning into a\n * phone's, which shows the bar and the title) or of a class or style on the bar, the content or around them measures it\n * again. A token the bar shares with the content stays inherited, so it follows the page's changes. A hidden title has\n * not gone under anything.\n */\nfunction followLargeTitle(bar: HTMLElement, heading: HTMLElement, subscribeScroll: (listener: () => void) => () => void) {\n const collapse = () => {\n const box = heading.getBoundingClientRect()\n bar.toggleAttribute(\"data-title-collapsed\", box.height > 0 && box.bottom <= bar.getBoundingClientRect().bottom)\n }\n const layout = () => {\n const own = getComputedStyle(bar)\n const place = heading.parentElement ? getComputedStyle(heading.parentElement) : undefined\n for (const token of LARGE_TITLE_TOKENS) {\n const value = own.getPropertyValue(token).trim()\n if (value && value !== place?.getPropertyValue(token).trim()) heading.style.setProperty(token, value)\n else heading.style.removeProperty(token)\n }\n collapse()\n }\n layout()\n const unsubscribe = subscribeScroll(collapse)\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(layout) : undefined\n observer?.observe(bar)\n observer?.observe(heading)\n const mutations = typeof MutationObserver !== \"undefined\" ? new MutationObserver(layout) : undefined\n // A token reaches the bar or the content from the class or style of either or of anything around them.\n for (const start of [bar, heading.parentElement]) {\n for (let node = start; node; node = node.parentElement) mutations?.observe(node, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n }\n return () => {\n unsubscribe()\n observer?.disconnect()\n mutations?.disconnect()\n bar.removeAttribute(\"data-title-collapsed\")\n for (const token of LARGE_TITLE_TOKENS) heading.style.removeProperty(token)\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarProps = HTMLAttributes<HTMLDivElement> & {\n /** @default \"top\" */\n placement?: ToolbarPlacement\n /** Layout of `Toolbar.Title` in a top bar. @default \"inline\" */\n titleStyle?: ToolbarTitleStyle\n /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default \"center\" */\n titleAlign?: ToolbarTitleAlign\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" at the top, \"soft\" at the bottom */\n background?: ToolbarBackground\n ref?: Ref<HTMLDivElement>\n}\n\nfunction ToolbarRoot({\n placement = \"top\",\n titleStyle = \"inline\",\n titleAlign = \"center\",\n background = placement === \"bottom\" ? \"soft\" : \"glass\",\n className,\n children,\n ref,\n ...restProps\n}: ToolbarProps) {\n const host = useContext(ToolbarHostContext)\n const element = useRef<HTMLDivElement | null>(null)\n const [barElement, setBarElement] = useState<HTMLDivElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n setBarElement(node)\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n // A desktop layout hides the bar; its height then leaves the host's own header in charge.\n const update = () => setHeight(placement, bar.offsetHeight || undefined)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeight(placement, undefined) }\n }, [placement, setHeight])\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Toolbar, className)}\n data-toolbar=\"\"\n data-placement={placement}\n data-title-style={placement === \"top\" ? titleStyle : undefined}\n data-title-align={placement === \"top\" ? titleAlign : undefined}\n data-background={barBackground(background)}\n data-host={host?.kind}\n data-scrolled={placement === \"top\" && host?.scrolled ? \"\" : undefined}\n data-content-below={placement === \"bottom\" && host?.contentBelow ? \"\" : undefined}\n data-rows-pinned={placement === \"top\" && host?.rowsPinned ? \"\" : undefined}\n {...restProps}\n >\n <ToolbarElementContext.Provider value={barElement}>\n <ToolbarTitleStyleContext.Provider value={placement === \"top\" ? titleStyle : undefined}>{children}</ToolbarTitleStyleContext.Provider>\n </ToolbarElementContext.Provider>\n </div>\n )\n}\nToolbarRoot.displayName = \"Toolbar\"\n\n/* ------------------------------------------------------------------ */\n/* Parts */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction ToolbarLeading({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Leading, className)} {...restProps} />\n}\nToolbarLeading.displayName = \"Toolbar.Leading\"\n\nfunction ToolbarTrailing({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Trailing, className)} {...restProps} />\n}\nToolbarTrailing.displayName = \"Toolbar.Trailing\"\n\nexport type ToolbarContentProps = ToolbarSlotProps & {\n /** Stretch between the leading and trailing items, as a search field does. */\n fill?: boolean\n}\n\n/** Custom middle content: a search field, a segmented control or a single centered action. */\nfunction ToolbarContent({ fill = false, className, ...restProps }: ToolbarContentProps) {\n return <div className={clsx(s.Content, className)} data-fill={fill ? \"\" : undefined} {...restProps} />\n}\nToolbarContent.displayName = \"Toolbar.Content\"\n\n/** Buttons that share one capsule. */\nfunction ToolbarGroup({ className, ...restProps }: ToolbarSlotProps) {\n return <div role=\"group\" className={clsx(s.Group, className)} {...restProps} />\n}\nToolbarGroup.displayName = \"Toolbar.Group\"\n\nconst rowOfAnchor = new WeakMap<Element, HTMLElement>()\n\n/**\n * Under a large title each row is portaled into the rows' place as it mounts, so a row that comes later (a search field\n * shown over a segmented control already there) would stand last. An empty anchor in the bar keeps the row's place among\n * the bar's rows, and the rows are moved into that order in the content, so the keyboard and a screen reader meet them\n * as they stand (Codex #7); a row added or removed in the bar orders them again.\n */\nfunction followRowOrder(anchor: HTMLElement, row: HTMLElement) {\n const bar = anchor.closest(\"[data-toolbar]\") ?? anchor.parentElement\n if (!bar) return () => {}\n rowOfAnchor.set(anchor, row)\n const place = () => {\n const slot = row.parentElement\n if (!slot) return\n const rows = Array.from(bar.querySelectorAll(\"[data-toolbar-row-anchor]\"), (mark) => rowOfAnchor.get(mark))\n .filter((each): each is HTMLElement => each?.parentElement === slot)\n // From the last row back, a row that does not stand before the next one goes right before it: only a row out of\n // place moves (the one that came later), so a field focused in another row keeps its focus (Codex #8); moveBefore,\n // where the browser has it, keeps it even in the row that moves.\n const move = (slot as HTMLElement & { moveBefore?: (node: Node, child: Node | null) => void }).moveBefore\n for (let index = rows.length - 2; index >= 0; index--) {\n const each = rows[index]\n const next = rows[index + 1]\n if (each.compareDocumentPosition(next) & Node.DOCUMENT_POSITION_FOLLOWING) continue\n try {\n if (move) {\n move.call(slot, each, next)\n continue\n }\n } catch {\n // falls back to a plain move\n }\n slot.insertBefore(each, next)\n }\n }\n place()\n const observer = typeof MutationObserver !== \"undefined\" ? new MutationObserver(place) : undefined\n observer?.observe(bar, { childList: true, subtree: true })\n return () => {\n observer?.disconnect()\n rowOfAnchor.delete(anchor)\n }\n}\n\n/**\n * A row under the controls, part of the bar: a segmented control that switches the screen's views (a chat list's\n * folders under its bar), or a search field. It spans the bar, and a control in it fills the row; several rows stand in\n * their order (a search field over a segmented control). Under a large title on a page the rows stand under the title,\n * at the top of the content, and once scrolled up to the bar they stay pinned under its controls, as iOS 27.2 pins a\n * safeAreaBar under a large title's bar.\n */\nfunction ToolbarRow({ className, ref, ...restProps }: ToolbarSlotProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n // The rows go with the title: under it at the top of a page's content or a Sheet's body\n const large = titleStyle === \"large\" && !!host?.requestLargeTitleSlot\n const requestSlot = large ? host?.requestLargeTitleSlot : undefined\n const slot = large ? host?.largeTitleRowSlot ?? null : null\n useLayoutEffect(() => requestSlot?.(), [requestSlot])\n const element = useRef<HTMLDivElement | null>(null)\n const anchor = useRef<HTMLSpanElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n useLayoutEffect(() => {\n if (!slot || !anchor.current || !element.current) return\n return followRowOrder(anchor.current, element.current)\n }, [slot])\n const row = <div ref={setRef} className={clsx(s.Row, className)} data-toolbar-row=\"\" data-in-content={slot ? \"\" : undefined} {...restProps} />\n // Under a large title the row waits for its place in the content (it comes before the first paint) and never stands\n // in the bar first: moving it from the bar into the portal would mount its children again, and a switcher that holds\n // its own selection would lose it (Codex #5). A host with no content to keep the title in (a Sheet without a body)\n // keeps it in the bar.\n if (large && slot) return <>{createPortal(row, slot)}<span ref={anchor} data-toolbar-row-anchor=\"\" hidden /></>\n if (large && host?.holdsLargeTitle !== false) return null\n return row\n}\nToolbarRow.displayName = \"Toolbar.Row\"\n\nexport type ToolbarTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, \"children\"> & {\n children: ReactNode\n /** A second, smaller line below the title. */\n subtitle?: ReactNode\n /**\n * Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden from\n * assistive technology there. @default \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\"\n ref?: Ref<HTMLHeadingElement>\n}\n\nfunction ToolbarTitle({ children, subtitle, as, className, ref, ...restProps }: ToolbarTitleProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n const bar = useContext(ToolbarElementContext)\n const headingRef = useRef<HTMLDivElement | null>(null)\n // A page, and a Dialog with its body, keep the title at the top of their content\n const large = titleStyle === \"large\" && !!host?.requestLargeTitleSlot\n const requestSlot = large ? host?.requestLargeTitleSlot : undefined\n const slot = large ? host?.largeTitleSlot ?? null : null\n const subscribeScroll = host?.subscribeScroll\n useLayoutEffect(() => requestSlot?.(), [requestSlot])\n // In the content the title scrolls with it, on the compositor and through the overscroll, as on iOS 26. Once it has\n // gone under the bar (its last line at the bar's bottom), the bar shows it inline and a hard or glass bar its line.\n useLayoutEffect(() => {\n const heading = headingRef.current\n if (!slot || !bar || !heading || !subscribeScroll) return\n return followLargeTitle(bar, heading, subscribeScroll)\n }, [bar, slot, subscribeScroll])\n const decorative = host?.kind === \"dialog\"\n const Tag = as ?? \"h1\"\n const hasSubtitle = subtitle != null && subtitle !== false && subtitle !== \"\"\n const heading = (\n <div ref={headingRef} className={s.Heading} aria-hidden={decorative || undefined} data-in-content={slot ? \"\" : undefined}>\n <Tag ref={ref} className={clsx(s.Title, className)} {...restProps}>{children}</Tag>\n {hasSubtitle && <p className={s.Subtitle}>{subtitle}</p>}\n </div>\n )\n if (!large) return heading\n // Until the content has made its place (a server-rendered page before it hydrates), the title stands in the bar\n // where it will stand in the content. The inline copy the row of controls shows once the large title has gone\n // under it keeps a subtitle as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).\n return (\n <>\n {slot ? createPortal(heading, slot) : heading}\n <span className={s.CollapsedTitle} aria-hidden=\"true\">\n {hasSubtitle ? <><span className={s.CollapsedLine}>{children}</span><span className={s.CollapsedSubtitle}>{subtitle}</span></> : children}\n </span>\n </>\n )\n}\nToolbarTitle.displayName = \"Toolbar.Title\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Leading: typeof ToolbarLeading\n Title: typeof ToolbarTitle\n Content: typeof ToolbarContent\n Group: typeof ToolbarGroup\n Trailing: typeof ToolbarTrailing\n Row: typeof ToolbarRow\n}\n\nToolbar.Leading = ToolbarLeading\nToolbar.Title = ToolbarTitle\nToolbar.Content = ToolbarContent\nToolbar.Group = ToolbarGroup\nToolbar.Trailing = ToolbarTrailing\nToolbar.Row = ToolbarRow\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room
|
|
3
|
+
* (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so
|
|
4
|
+
* every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height
|
|
5
|
+
* whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a
|
|
6
|
+
* Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as
|
|
7
|
+
* the page scrolls. Returns the cleanup.
|
|
8
|
+
*/
|
|
9
|
+
export function watchCalendarFit(wrapper) {
|
|
10
|
+
if (typeof window === "undefined" || typeof requestAnimationFrame === "undefined")
|
|
11
|
+
return () => { };
|
|
12
|
+
let content = null;
|
|
13
|
+
let mutations;
|
|
14
|
+
let frame = 0;
|
|
15
|
+
let tries = 0;
|
|
16
|
+
const check = () => {
|
|
17
|
+
frame = 0;
|
|
18
|
+
if (!content) {
|
|
19
|
+
content = wrapper.closest('[role="dialog"]');
|
|
20
|
+
if (content && typeof MutationObserver !== "undefined") {
|
|
21
|
+
mutations = new MutationObserver(schedule);
|
|
22
|
+
mutations.observe(content, { attributes: true, attributeFilter: ["style", "data-side"] });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const room = content
|
|
26
|
+
? parseFloat(getComputedStyle(content).getPropertyValue("--radix-popover-content-available-height"))
|
|
27
|
+
: NaN;
|
|
28
|
+
if (!content || !Number.isFinite(room) || room <= 0) {
|
|
29
|
+
if (++tries < 20)
|
|
30
|
+
frame = requestAnimationFrame(check);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const squeezed = content.scrollHeight > room + 0.5;
|
|
34
|
+
if (content.hasAttribute("data-calendar-squeezed") !== squeezed)
|
|
35
|
+
content.toggleAttribute("data-calendar-squeezed", squeezed);
|
|
36
|
+
};
|
|
37
|
+
function schedule() {
|
|
38
|
+
tries = 0;
|
|
39
|
+
if (!frame)
|
|
40
|
+
frame = requestAnimationFrame(check);
|
|
41
|
+
}
|
|
42
|
+
schedule();
|
|
43
|
+
const resizes = typeof ResizeObserver !== "undefined" ? new ResizeObserver(schedule) : undefined;
|
|
44
|
+
resizes?.observe(wrapper);
|
|
45
|
+
window.addEventListener("resize", schedule);
|
|
46
|
+
return () => {
|
|
47
|
+
if (frame)
|
|
48
|
+
cancelAnimationFrame(frame);
|
|
49
|
+
resizes?.disconnect();
|
|
50
|
+
mutations?.disconnect();
|
|
51
|
+
window.removeEventListener("resize", schedule);
|
|
52
|
+
content?.removeAttribute("data-calendar-squeezed");
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** A ref callback for the calendar's wrapper (React 19 runs the returned cleanup when it goes). */
|
|
56
|
+
export const calendarFitRef = (node) => (node ? watchCalendarFit(node) : undefined);
|
|
57
|
+
//# sourceMappingURL=calendarFit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarFit.js","sourceRoot":"","sources":["../../../src/lib/calendarFit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAoB;IACnD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,qBAAqB,KAAK,WAAW;QAAE,OAAO,G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G,CAAC,CAAA;QACT,IAAI,CAAC,KAAK;YAAE,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC;IACD,QAAQ,EAAE,CAAA;IACV,MAAM,OAAO,GAAG,OAAO,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAChG,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC3C,OAAO,GAAG,EAAE;QACV,IAAI,KAAK;YAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;QACtC,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,SAAS,EAAE,UAAU,EAAE,CAAA;QACvB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC9C,OAAO,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAA;IACpD,CAAC,CAAA;AACH,CAAC;AAED,mGAAmG;AACnG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAA2B,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA","sourcesContent":["/**\n * On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room\n * (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so\n * every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height\n * whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a\n * Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as\n * the page scrolls. Returns the cleanup.\n */\nexport function watchCalendarFit(wrapper: HTMLElement): () => void {\n if (typeof window === \"undefined\" || typeof requestAnimationFrame === \"undefined\") return () => {}\n let content: HTMLElement | null = null\n let mutations: MutationObserver | undefined\n let frame = 0\n let tries = 0\n const check = () => {\n frame = 0\n if (!content) {\n content = wrapper.closest<HTMLElement>('[role=\"dialog\"]')\n if (content && typeof MutationObserver !== \"undefined\") {\n mutations = new MutationObserver(schedule)\n mutations.observe(content, { attributes: true, attributeFilter: [\"style\", \"data-side\"] })\n }\n }\n const room = content\n ? parseFloat(getComputedStyle(content).getPropertyValue(\"--radix-popover-content-available-height\"))\n : NaN\n if (!content || !Number.isFinite(room) || room <= 0) {\n if (++tries < 20) frame = requestAnimationFrame(check)\n return\n }\n const squeezed = content.scrollHeight > room + 0.5\n if (content.hasAttribute(\"data-calendar-squeezed\") !== squeezed) content.toggleAttribute(\"data-calendar-squeezed\", squeezed)\n }\n function schedule() {\n tries = 0\n if (!frame) frame = requestAnimationFrame(check)\n }\n schedule()\n const resizes = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(schedule) : undefined\n resizes?.observe(wrapper)\n window.addEventListener(\"resize\", schedule)\n return () => {\n if (frame) cancelAnimationFrame(frame)\n resizes?.disconnect()\n mutations?.disconnect()\n window.removeEventListener(\"resize\", schedule)\n content?.removeAttribute(\"data-calendar-squeezed\")\n }\n}\n\n/** A ref callback for the calendar's wrapper (React 19 runs the returned cleanup when it goes). */\nexport const calendarFitRef = (node: HTMLDivElement | null) => (node ? watchCalendarFit(node) : undefined)\n"]}
|
|
@@ -3,6 +3,13 @@ import { type BarBackground, type BarBackgroundAlias } from "../Toolbar/Toolbar.
|
|
|
3
3
|
/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. `"solid"` is the earlier name of `"hard"`. */
|
|
4
4
|
export type PageBarBackground = BarBackground | BarBackgroundAlias;
|
|
5
5
|
export type PageWidth = "full" | "wide" | "column";
|
|
6
|
+
/**
|
|
7
|
+
* Follows the rows of a large title's bar (Toolbar.Row) in the content. They stand under the title and, scrolled up to
|
|
8
|
+
* the bar, stay under its controls (`position: sticky`): they are pinned once the sticky offset moves them off the
|
|
9
|
+
* title's bottom, where they would stand. It reports that and their height, which the bar's background takes in. A
|
|
10
|
+
* Sheet follows the rows in Dialog.Body the same way.
|
|
11
|
+
*/
|
|
12
|
+
export declare function followTitleRows(content: HTMLElement, rows: HTMLElement, report: (pinned: boolean, height: number) => void): () => void;
|
|
6
13
|
export type PageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
14
|
/**
|
|
8
15
|
* Width of the column that header and content share.
|
|
@@ -27,7 +27,8 @@ export type ToolbarBackground = BarBackground | BarBackgroundAlias | "edge";
|
|
|
27
27
|
export declare const barBackground: (background: ToolbarBackground | undefined) => BarBackground | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* A surface that places phone toolbars: `Page` puts the top bar over its content
|
|
30
|
-
* and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.
|
|
30
|
+
* and reserves the space; `Dialog` puts it 16px under the Sheet's top edge. Both keep a large title at the top of
|
|
31
|
+
* their content (Page.Content, Dialog.Body), where it scrolls and collapses into the bar.
|
|
31
32
|
*/
|
|
32
33
|
export type ToolbarHost = {
|
|
33
34
|
kind: "page" | "dialog";
|
|
@@ -46,6 +47,11 @@ export type ToolbarHost = {
|
|
|
46
47
|
largeTitleRowSlot?: HTMLElement | null;
|
|
47
48
|
/** The rows under a large title are pinned under the bar, so its background reaches under them. */
|
|
48
49
|
rowsPinned?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* `false` while the host has no content to keep a large title in (a Dialog without Dialog.Body): the title and its
|
|
52
|
+
* rows stay in the bar. Otherwise the rows wait for their place, so they mount once, there.
|
|
53
|
+
*/
|
|
54
|
+
holdsLargeTitle?: boolean;
|
|
49
55
|
};
|
|
50
56
|
export declare const ToolbarHostContext: import("react").Context<ToolbarHost | null>;
|
|
51
57
|
export type ToolbarProps = HTMLAttributes<HTMLDivElement> & {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room
|
|
3
|
+
* (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so
|
|
4
|
+
* every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height
|
|
5
|
+
* whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a
|
|
6
|
+
* Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as
|
|
7
|
+
* the page scrolls. Returns the cleanup.
|
|
8
|
+
*/
|
|
9
|
+
export declare function watchCalendarFit(wrapper: HTMLElement): () => void;
|
|
10
|
+
/** A ref callback for the calendar's wrapper (React 19 runs the returned cleanup when it goes). */
|
|
11
|
+
export declare const calendarFitRef: (node: HTMLDivElement | null) => (() => void) | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "Modern design system for building high-quality applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@maskito/core": "^5.2.2",
|
|
100
100
|
"@maskito/kit": "^5.2.2",
|
|
101
101
|
"@maskito/react": "^5.2.2",
|
|
102
|
-
"@plexui/styles": "^0.
|
|
102
|
+
"@plexui/styles": "^0.11.0",
|
|
103
103
|
"@radix-ui/react-dismissable-layer": "1.2.1",
|
|
104
104
|
"@radix-ui/react-focus-guards": "1.2.0",
|
|
105
105
|
"@radix-ui/react-focus-scope": "1.3.1",
|