@plexui/ui 0.44.3 → 0.46.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/Page/Page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,eAAe,EACf,MAAM,EACN,QAAQ,GAKT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrI,OAAO,EAAE,kBAAkB,EAA+D,MAAM,oBAAoB,CAAA;AACpH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAA;AAC9G,OAAO,CAAC,MAAM,gDAAgD,CAAA;AAmB9D,MAAM,WAAW,GAAG,aAAa,CAA0B,IAAI,CAAC,CAAA;AAEhE,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,2BAA2B,CAAC,CAAA;IAC1D,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAsBD,SAAS,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,GAAG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,SAAS,EAAa;IAC/G,MAAM,QAAQ,GAAG,wBAAwB,EAAE,CAAA;IAC3C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;IAChC,MAAM,IAAI,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAA;IAChD,MAAM,MAAM,GAA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C,CAAC,CAAA;IACrB,OAAO,CACL,cACE,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,qBACnB,UAAU,wBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAC7C,SAAS,YAEb,cAAK,SAAS,EAAE,CAAC,CAAC,aAAa,YAAG,QAAQ,GAAO,GAC7C,CACP,CAAA;AACH,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,aAAa,CAAA;AAEtC,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,QAUnB,CAAA;AACD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;AACxB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAA;AAClB,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;AACtB,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAA;AAC5B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useContext,\n useCallback,\n useMemo,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type CSSProperties,\n type Ref,\n type UIEvent,\n} from \"react\"\nimport { FloatingBoundaryProvider, useFloatingBoundaryRegistration, useFloatingBoundaryScope } from \"../../hooks/useFloatingBoundary\"\nimport { ToolbarHostContext, type BarBackground, type ToolbarHost, type ToolbarPlacement } from \"../Toolbar/Toolbar\"\nimport { NO_SCROLL_EDGES, observeScrollEdges, sameScrollEdges, type ScrollEdges } from \"../../lib/scrollEdges\"\nimport s from \"@plexui/styles/components/Page/Page.module.css\"\n\n/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. */\nexport type PageBarBackground = BarBackground\n\nexport type PageWidth = \"full\" | \"wide\" | \"column\"\n\ntype PageContextValue = {\n /** Content under the header (scrolled) and under the footer (content below). */\n edges: ScrollEdges\n setEdges: (edges: ScrollEdges) => void\n setFooterHeight: (height: number) => void\n setHeaderHeight: (height: number | undefined) => void\n /** Writes the content's scroll offset to the page as `--page-scroll-y`, which a large Toolbar title follows. */\n setScrollY: (scrollY: number) => void\n /** Tells the bars that follow the scroll, such as a minimizing TabBar, the content's scroll offset. */\n notifyScroll: (scrollY: number) => void\n}\n\nconst PageContext = createContext<PageContextValue | null>(null)\n\nfunction usePageContext(part: string): PageContextValue {\n const context = useContext(PageContext)\n if (!context) {\n throw new Error(`Page.${part} must be used within Page`)\n }\n return context\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type PageProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * Width of the column that header and content share.\n * - `\"full\"` — edge to edge, for tables (default)\n * - `\"wide\"` — 1280px, centred, for overviews\n * - `\"column\"` — 768px, centred, for settings and forms\n *\n * Set `--page-width` on the page for any other width.\n * @default \"full\"\n */\n width?: PageWidth\n /** Mobile canvas and grouped-field palette. @default \"plain\" */\n surface?: \"plain\" | \"grouped\"\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageRoot({ width = \"full\", surface = \"plain\", className, children, style, ref, ...restProps }: PageProps) {\n const boundary = useFloatingBoundaryScope()\n const setRoot = boundary.setRoot\n const root = useRef<HTMLDivElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n root.current = node\n setRoot(node)\n if (typeof ref === \"function\") {\n const cleanup = ref(node)\n if (typeof cleanup === \"function\") return () => { root.current = null; setRoot(null); cleanup() }\n return\n }\n if (ref) ref.current = node\n }, [ref, setRoot])\n const [edges, setEdgesState] = useState(NO_SCROLL_EDGES)\n const setEdges = useCallback((next: ScrollEdges) => setEdgesState((current) => sameScrollEdges(current, next) ? current : next), [])\n const [footerHeight, setFooterHeight] = useState(0)\n const [headerHeight, setHeaderHeight] = useState<number>()\n // Written straight to the element: a scroll frame must not render the page again.\n const setScrollY = useCallback((scrollY: number) => root.current?.style.setProperty(\"--page-scroll-y\", String(Math.max(0, scrollY))), [])\n const scrollListeners = useRef(new Set<(scrollTop: number) => void>())\n const notifyScroll = useCallback((scrollY: number) => scrollListeners.current.forEach((listener) => listener(scrollY)), [])\n const subscribeScroll = useCallback((listener: (scrollTop: number) => void) => {\n const listeners = scrollListeners.current\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n }, [])\n const context = useMemo(() => ({ edges, setEdges, setFooterHeight, setHeaderHeight, setScrollY, notifyScroll }), [edges, setEdges, setScrollY, notifyScroll])\n // A phone Toolbar replaces the header and footer bars; it reports its own heights.\n const [toolbarTop, setToolbarTop] = useState<number>()\n const [toolbarBottom, setToolbarBottom] = useState<number>()\n const setToolbarHeight = useCallback((placement: ToolbarPlacement, height: number | undefined) => (placement === \"top\" ? setToolbarTop : setToolbarBottom)(height), [])\n const toolbarHost = useMemo<ToolbarHost>(() => ({ kind: \"page\", setHeight: setToolbarHeight, scrolled: edges.scrolled, contentBelow: edges.contentBelow, subscribeScroll }), [setToolbarHeight, edges, subscribeScroll])\n const pageStyle = {\n \"--page-footer-height\": `${footerHeight}px`,\n ...(headerHeight !== undefined ? { \"--page-header-height\": `${headerHeight}px` } : {}),\n ...(toolbarTop !== undefined ? { \"--page-toolbar-height\": `${toolbarTop}px` } : {}),\n ...(toolbarBottom !== undefined ? { \"--page-toolbar-bottom-height\": `${toolbarBottom}px` } : {}),\n ...style,\n } as CSSProperties\n\n return (\n <FloatingBoundaryProvider value={boundary}>\n <PageContext.Provider value={context}>\n <ToolbarHostContext.Provider value={toolbarHost}>\n <div ref={setRef} className={clsx(s.Page, className)} data-width={width} data-surface={surface} style={pageStyle} {...restProps}>\n {children}\n </div>\n </ToolbarHostContext.Provider>\n </PageContext.Provider>\n </FloatingBoundaryProvider>\n )\n}\nPageRoot.displayName = \"Page\"\n\n/* ------------------------------------------------------------------ */\n/* Header */\n/* ------------------------------------------------------------------ */\n\nexport type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * Shows a divider once the content has scrolled under the header: on a desktop layout, and on a phone\n * with a `\"hard\"` or `\"glass\"` background.\n * Turn it off when the content already draws a line of its own at that place.\n * @default true\n */\n divider?: boolean\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" */\n background?: PageBarBackground\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageHeader({ divider = true, background = \"glass\", className, children, ref, ...restProps }: PageHeaderProps) {\n const { edges: { scrolled }, setHeaderHeight } = usePageContext(\"Header\")\n const element = useRef<HTMLDivElement | 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 const header = element.current\n if (!header) return\n const update = () => setHeaderHeight(header.offsetHeight)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(header, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeaderHeight(undefined) }\n }, [setHeaderHeight])\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Header, className)}\n data-background={background}\n data-scrolled={scrolled ? \"\" : undefined}\n data-divider={divider ? \"\" : undefined}\n {...restProps}\n >\n <div className={s.Head}>{children}</div>\n </div>\n )\n}\nPageHeader.displayName = \"Page.Header\"\n\n/* ------------------------------------------------------------------ */\n/* Slots */\n/* ------------------------------------------------------------------ */\n\nexport type PageSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction PageBar({ className, ref, ...restProps }: PageSlotProps) {\n const element = useRef<HTMLDivElement | 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 const bar = element.current\n if (!bar) return\n const sides = () => bar.querySelectorAll<HTMLElement>(`:scope > .${s.Leading}, :scope > .${s.Actions}`)\n const update = () => {\n const width = Math.max(44, ...Array.from(sides(), (side) => side.offsetWidth))\n bar.style.setProperty(\"--page-bar-side-width\", `${width}px`)\n }\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeSides = () => { observer?.disconnect(); sides().forEach((side) => observer?.observe(side, { box: \"border-box\" })); update() }\n observeSides()\n const children = new MutationObserver(observeSides)\n children.observe(bar, { childList: true })\n return () => { observer?.disconnect(); children.disconnect() }\n }, [])\n return <div ref={setRef} className={clsx(s.Bar, className)} {...restProps} />\n}\nPageBar.displayName = \"Page.Bar\"\n\nfunction PageLeading({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Leading, className)} {...restProps} />\n}\nPageLeading.displayName = \"Page.Leading\"\n\nfunction PageHeading({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Heading, className)} {...restProps} />\n}\nPageHeading.displayName = \"Page.Heading\"\n\nfunction PageTitle({\n className,\n ...restProps\n}: HTMLAttributes<HTMLHeadingElement> & { ref?: Ref<HTMLHeadingElement> }) {\n return <h1 className={clsx(s.Title, className)} {...restProps} />\n}\nPageTitle.displayName = \"Page.Title\"\n\nfunction PageSubtitle({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Subtitle, className)} {...restProps} />\n}\nPageSubtitle.displayName = \"Page.Subtitle\"\n\nfunction PageActions({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Actions, className)} {...restProps} />\n}\nPageActions.displayName = \"Page.Actions\"\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\nexport type PageContentProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The content fills the page and scrolls inside itself, as a table does: the page stops\n * scrolling from 768px up.\n * @default false\n */\n fill?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageContent({ fill = false, className, children, onScroll, ref, ...restProps }: PageContentProps) {\n const { setEdges, setScrollY, notifyScroll } = usePageContext(\"Content\")\n const element = useRef<HTMLDivElement | 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 const content = element.current\n if (!content) return\n const stop = observeScrollEdges(content, setEdges)\n return () => { stop(); setEdges(NO_SCROLL_EDGES) }\n }, [setEdges])\n\n const handleScroll = (event: UIEvent<HTMLDivElement>) => {\n setScrollY(event.currentTarget.scrollTop)\n notifyScroll(event.currentTarget.scrollTop)\n onScroll?.(event)\n }\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Content, className)}\n data-fill={fill ? \"\" : undefined}\n onScroll={handleScroll}\n {...restProps}\n >\n <div className={s.Column}>{children}</div>\n </div>\n )\n}\nPageContent.displayName = \"Page.Content\"\n\nexport type PageFooterProps = PageSlotProps & {\n /** How the bar meets the content scrolled under it on a phone. @default \"soft\" */\n background?: PageBarBackground\n}\n\n/** Actions that remain below the scrolling content, inside the page's safe area. */\nfunction PageFooter({ className, children, background = \"soft\", ref, ...restProps }: PageFooterProps) {\n const element = useRef<HTMLDivElement | null>(null)\n const { edges: { contentBelow }, setFooterHeight } = usePageContext(\"Footer\")\n const setFloatingFooter = useFloatingBoundaryRegistration()?.setFooter\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n setFloatingFooter?.(node)\n if (typeof ref === \"function\") {\n const cleanup = ref(node)\n if (typeof cleanup === \"function\") return () => { element.current = null; setFloatingFooter?.(null); cleanup() }\n return\n }\n if (ref) ref.current = node\n }, [ref, setFloatingFooter])\n useLayoutEffect(() => {\n const footer = element.current\n if (!footer) return\n const update = () => setFooterHeight(footer.offsetHeight)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(footer, { box: \"border-box\" })\n return () => { observer?.disconnect(); setFooterHeight(0) }\n }, [setFooterHeight])\n return (\n <div\n ref={setRef}\n className={clsx(s.Footer, className)}\n data-background={background}\n data-content-below={contentBelow ? \"\" : undefined}\n {...restProps}\n >\n <div className={s.FooterContent}>{children}</div>\n </div>\n )\n}\nPageFooter.displayName = \"Page.Footer\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Page = PageRoot as typeof PageRoot & {\n Header: typeof PageHeader\n Bar: typeof PageBar\n Leading: typeof PageLeading\n Heading: typeof PageHeading\n Title: typeof PageTitle\n Subtitle: typeof PageSubtitle\n Actions: typeof PageActions\n Content: typeof PageContent\n Footer: typeof PageFooter\n}\nPage.Header = PageHeader\nPage.Bar = PageBar\nPage.Leading = PageLeading\nPage.Heading = PageHeading\nPage.Title = PageTitle\nPage.Subtitle = PageSubtitle\nPage.Actions = PageActions\nPage.Content = PageContent\nPage.Footer = PageFooter\n"]}
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/Page/Page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,eAAe,EACf,MAAM,EACN,QAAQ,GAKT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrI,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAwF,MAAM,oBAAoB,CAAA;AAC5J,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAA;AAC9G,OAAO,CAAC,MAAM,gDAAgD,CAAA;AAwB9D;;;;GAIG;AACH,SAAS,eAAe,CAAC,OAAoB,EAAE,IAAiB,EAAE,MAAiD;IACjH,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,MAAM,MAAM,GAA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,YAAG,QAAQ,GAAO,GAC7C,CACP,CAAA;AACH,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,aAAa,CAAA;AAEtC,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,QAUnB,CAAA;AACD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;AACxB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAA;AAClB,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;AACtB,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAA;AAC5B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useContext,\n useCallback,\n useMemo,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type CSSProperties,\n type Ref,\n type UIEvent,\n} from \"react\"\nimport { FloatingBoundaryProvider, useFloatingBoundaryRegistration, useFloatingBoundaryScope } from \"../../hooks/useFloatingBoundary\"\nimport { barBackground, ToolbarHostContext, type BarBackground, type BarBackgroundAlias, type ToolbarHost, type ToolbarPlacement } from \"../Toolbar/Toolbar\"\nimport { NO_SCROLL_EDGES, observeScrollEdges, sameScrollEdges, type ScrollEdges } from \"../../lib/scrollEdges\"\nimport s from \"@plexui/styles/components/Page/Page.module.css\"\n\n/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. `\"solid\"` is the earlier name of `\"hard\"`. */\nexport type PageBarBackground = BarBackground | BarBackgroundAlias\n\nexport type PageWidth = \"full\" | \"wide\" | \"column\"\n\ntype PageContextValue = {\n /** Content under the header (scrolled) and under the footer (content below). */\n edges: ScrollEdges\n setEdges: (edges: ScrollEdges) => void\n setFooterHeight: (height: number) => void\n setHeaderHeight: (height: number | undefined) => void\n /** Tells the bars that follow the scroll, such as a minimizing TabBar or a large title, the content's scroll offset. */\n notifyScroll: (scrollY: number) => void\n /** A large Toolbar title asks for a place at the top of the content, where it scrolls with the content. */\n largeTitle: boolean\n setLargeTitleSlot: (slot: HTMLDivElement | null) => void\n /** The place of the bar's rows under a large title, which pins them under the bar. */\n largeTitleRowSlot: HTMLDivElement | null\n setLargeTitleRowSlot: (slot: HTMLDivElement | null) => void\n setTitleRows: (pinned: boolean, height: number) => void\n}\n\n/**\n * Follows the rows of a large title's bar (Toolbar.Row) in the content. They stand under the title and, scrolled up to\n * the bar, stay under its controls (`position: sticky`): they are pinned once the sticky offset moves them off the\n * title's bottom, where they would stand. It reports that and their height, which the bar's background takes in.\n */\nfunction followTitleRows(content: HTMLElement, rows: HTMLElement, report: (pinned: boolean, height: number) => void) {\n let last = \"\"\n const update = () => {\n const height = rows.offsetHeight\n const title = rows.previousElementSibling\n const pinned = height > 0 && !!title && rows.getBoundingClientRect().top - title.getBoundingClientRect().bottom > 0.5\n if (`${pinned} ${height}` === last) return\n last = `${pinned} ${height}`\n report(pinned, height)\n }\n update()\n content.addEventListener(\"scroll\", update, { passive: true })\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(rows)\n observer?.observe(content)\n // The title changing its height (a subtitle shown or gone) moves the rows with no scroll (Codex #7).\n const title = rows.previousElementSibling\n if (title) observer?.observe(title)\n return () => {\n content.removeEventListener(\"scroll\", update)\n observer?.disconnect()\n report(false, 0)\n }\n}\n\nconst PageContext = createContext<PageContextValue | null>(null)\n\nfunction usePageContext(part: string): PageContextValue {\n const context = useContext(PageContext)\n if (!context) {\n throw new Error(`Page.${part} must be used within Page`)\n }\n return context\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type PageProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * Width of the column that header and content share.\n * - `\"full\"` — edge to edge, for tables (default)\n * - `\"wide\"` — 1280px, centred, for overviews\n * - `\"column\"` — 768px, centred, for settings and forms\n *\n * Set `--page-width` on the page for any other width.\n * @default \"full\"\n */\n width?: PageWidth\n /** Mobile canvas and grouped-field palette. @default \"plain\" */\n surface?: \"plain\" | \"grouped\"\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageRoot({ width = \"full\", surface = \"plain\", className, children, style, ref, ...restProps }: PageProps) {\n const boundary = useFloatingBoundaryScope()\n const setRoot = boundary.setRoot\n const setRef = useCallback((node: HTMLDivElement | null) => {\n setRoot(node)\n if (typeof ref === \"function\") {\n const cleanup = ref(node)\n if (typeof cleanup === \"function\") return () => { setRoot(null); cleanup() }\n return\n }\n if (ref) ref.current = node\n }, [ref, setRoot])\n const [edges, setEdgesState] = useState(NO_SCROLL_EDGES)\n const setEdges = useCallback((next: ScrollEdges) => setEdgesState((current) => sameScrollEdges(current, next) ? current : next), [])\n const [footerHeight, setFooterHeight] = useState(0)\n const [headerHeight, setHeaderHeight] = useState<number>()\n const scrollListeners = useRef(new Set<(scrollTop: number) => void>())\n const notifyScroll = useCallback((scrollY: number) => scrollListeners.current.forEach((listener) => listener(scrollY)), [])\n const subscribeScroll = useCallback((listener: (scrollTop: number) => void) => {\n const listeners = scrollListeners.current\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n }, [])\n // A large Toolbar title lives in the content, where the browser scrolls it with the content and its overscroll;\n // Page.Content keeps a place for it at its top while a title asks for one.\n const [largeTitleRequests, setLargeTitleRequests] = useState(0)\n const [largeTitleSlot, setLargeTitleSlot] = useState<HTMLDivElement | null>(null)\n const requestLargeTitleSlot = useCallback(() => {\n setLargeTitleRequests((count) => count + 1)\n return () => setLargeTitleRequests((count) => count - 1)\n }, [])\n const largeTitle = largeTitleRequests > 0\n // The bar's rows under a large title have a place of their own under it, which pins them under the bar once scrolled.\n const [largeTitleRowSlot, setLargeTitleRowSlot] = useState<HTMLDivElement | null>(null)\n const [titleRows, setTitleRowsState] = useState({ pinned: false, height: 0 })\n const setTitleRows = useCallback((pinned: boolean, height: number) => setTitleRowsState((current) => (current.pinned === pinned && current.height === height ? current : { pinned, height })), [])\n const context = useMemo(\n () => ({ edges, setEdges, setFooterHeight, setHeaderHeight, notifyScroll, largeTitle, setLargeTitleSlot, largeTitleRowSlot, setLargeTitleRowSlot, setTitleRows }),\n [edges, setEdges, notifyScroll, largeTitle, largeTitleRowSlot, setTitleRows],\n )\n // A phone Toolbar replaces the header and footer bars; it reports its own heights.\n const [toolbarTop, setToolbarTop] = useState<number>()\n const [toolbarBottom, setToolbarBottom] = useState<number>()\n const setToolbarHeight = useCallback((placement: ToolbarPlacement, height: number | undefined) => (placement === \"top\" ? setToolbarTop : setToolbarBottom)(height), [])\n const toolbarHost = useMemo<ToolbarHost>(() => ({\n kind: \"page\",\n setHeight: setToolbarHeight,\n scrolled: edges.scrolled,\n contentBelow: edges.contentBelow,\n subscribeScroll,\n requestLargeTitleSlot,\n largeTitleSlot: largeTitle ? largeTitleSlot : null,\n largeTitleRowSlot: largeTitle ? largeTitleRowSlot : null,\n rowsPinned: largeTitle && titleRows.pinned,\n }), [setToolbarHeight, edges, subscribeScroll, requestLargeTitleSlot, largeTitle, largeTitleSlot, largeTitleRowSlot, titleRows.pinned])\n const pageStyle = {\n \"--page-footer-height\": `${footerHeight}px`,\n ...(headerHeight !== undefined ? { \"--page-header-height\": `${headerHeight}px` } : {}),\n ...(toolbarTop !== undefined ? { \"--page-toolbar-height\": `${toolbarTop}px` } : {}),\n ...(toolbarBottom !== undefined ? { \"--page-toolbar-bottom-height\": `${toolbarBottom}px` } : {}),\n ...(titleRows.height > 0 ? { \"--page-toolbar-rows-height\": `${titleRows.height}px` } : {}),\n ...style,\n } as CSSProperties\n\n return (\n <FloatingBoundaryProvider value={boundary}>\n <PageContext.Provider value={context}>\n <ToolbarHostContext.Provider value={toolbarHost}>\n <div ref={setRef} className={clsx(s.Page, className)} data-width={width} data-surface={surface} style={pageStyle} {...restProps}>\n {children}\n </div>\n </ToolbarHostContext.Provider>\n </PageContext.Provider>\n </FloatingBoundaryProvider>\n )\n}\nPageRoot.displayName = \"Page\"\n\n/* ------------------------------------------------------------------ */\n/* Header */\n/* ------------------------------------------------------------------ */\n\nexport type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * Shows a divider once the content has scrolled under the header: on a desktop layout, and on a phone\n * with a `\"hard\"` or `\"glass\"` background.\n * Turn it off when the content already draws a line of its own at that place.\n * @default true\n */\n divider?: boolean\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" */\n background?: PageBarBackground\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageHeader({ divider = true, background = \"glass\", className, children, ref, ...restProps }: PageHeaderProps) {\n const { edges: { scrolled }, setHeaderHeight } = usePageContext(\"Header\")\n const element = useRef<HTMLDivElement | 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 const header = element.current\n if (!header) return\n const update = () => setHeaderHeight(header.offsetHeight)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(header, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeaderHeight(undefined) }\n }, [setHeaderHeight])\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Header, className)}\n data-background={barBackground(background)}\n data-scrolled={scrolled ? \"\" : undefined}\n data-divider={divider ? \"\" : undefined}\n {...restProps}\n >\n <div className={s.Head}>{children}</div>\n </div>\n )\n}\nPageHeader.displayName = \"Page.Header\"\n\n/* ------------------------------------------------------------------ */\n/* Slots */\n/* ------------------------------------------------------------------ */\n\nexport type PageSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction PageBar({ className, ref, ...restProps }: PageSlotProps) {\n const element = useRef<HTMLDivElement | 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 const bar = element.current\n if (!bar) return\n const sides = () => bar.querySelectorAll<HTMLElement>(`:scope > .${s.Leading}, :scope > .${s.Actions}`)\n const update = () => {\n const width = Math.max(44, ...Array.from(sides(), (side) => side.offsetWidth))\n bar.style.setProperty(\"--page-bar-side-width\", `${width}px`)\n }\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeSides = () => { observer?.disconnect(); sides().forEach((side) => observer?.observe(side, { box: \"border-box\" })); update() }\n observeSides()\n const children = new MutationObserver(observeSides)\n children.observe(bar, { childList: true })\n return () => { observer?.disconnect(); children.disconnect() }\n }, [])\n return <div ref={setRef} className={clsx(s.Bar, className)} {...restProps} />\n}\nPageBar.displayName = \"Page.Bar\"\n\nfunction PageLeading({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Leading, className)} {...restProps} />\n}\nPageLeading.displayName = \"Page.Leading\"\n\nfunction PageHeading({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Heading, className)} {...restProps} />\n}\nPageHeading.displayName = \"Page.Heading\"\n\nfunction PageTitle({\n className,\n ...restProps\n}: HTMLAttributes<HTMLHeadingElement> & { ref?: Ref<HTMLHeadingElement> }) {\n return <h1 className={clsx(s.Title, className)} {...restProps} />\n}\nPageTitle.displayName = \"Page.Title\"\n\nfunction PageSubtitle({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Subtitle, className)} {...restProps} />\n}\nPageSubtitle.displayName = \"Page.Subtitle\"\n\nfunction PageActions({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Actions, className)} {...restProps} />\n}\nPageActions.displayName = \"Page.Actions\"\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\nexport type PageContentProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The content fills the page and scrolls inside itself, as a table does: the page stops\n * scrolling from 768px up.\n * @default false\n */\n fill?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageContent({ fill = false, className, children, onScroll, ref, ...restProps }: PageContentProps) {\n const { setEdges, notifyScroll, largeTitle, setLargeTitleSlot, largeTitleRowSlot, setLargeTitleRowSlot, setTitleRows } = usePageContext(\"Content\")\n const element = useRef<HTMLDivElement | 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 const content = element.current\n if (!content) return\n const stop = observeScrollEdges(content, setEdges)\n return () => { stop(); setEdges(NO_SCROLL_EDGES) }\n }, [setEdges])\n useLayoutEffect(() => {\n const content = element.current\n if (!content || !largeTitleRowSlot) return\n return followTitleRows(content, largeTitleRowSlot, setTitleRows)\n }, [largeTitleRowSlot, setTitleRows])\n\n const handleScroll = (event: UIEvent<HTMLDivElement>) => {\n notifyScroll(event.currentTarget.scrollTop)\n onScroll?.(event)\n }\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Content, className)}\n data-fill={fill ? \"\" : undefined}\n onScroll={handleScroll}\n {...restProps}\n >\n <div className={s.Column}>\n {largeTitle && <div ref={setLargeTitleSlot} className={s.LargeTitle} />}\n {largeTitle && <div ref={setLargeTitleRowSlot} className={s.LargeTitleRows} />}\n {children}\n </div>\n </div>\n )\n}\nPageContent.displayName = \"Page.Content\"\n\nexport type PageFooterProps = PageSlotProps & {\n /** How the bar meets the content scrolled under it on a phone. @default \"soft\" */\n background?: PageBarBackground\n}\n\n/** Actions that remain below the scrolling content, inside the page's safe area. */\nfunction PageFooter({ className, children, background = \"soft\", ref, ...restProps }: PageFooterProps) {\n const element = useRef<HTMLDivElement | null>(null)\n const { edges: { contentBelow }, setFooterHeight } = usePageContext(\"Footer\")\n const setFloatingFooter = useFloatingBoundaryRegistration()?.setFooter\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n setFloatingFooter?.(node)\n if (typeof ref === \"function\") {\n const cleanup = ref(node)\n if (typeof cleanup === \"function\") return () => { element.current = null; setFloatingFooter?.(null); cleanup() }\n return\n }\n if (ref) ref.current = node\n }, [ref, setFloatingFooter])\n useLayoutEffect(() => {\n const footer = element.current\n if (!footer) return\n const update = () => setFooterHeight(footer.offsetHeight)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(footer, { box: \"border-box\" })\n return () => { observer?.disconnect(); setFooterHeight(0) }\n }, [setFooterHeight])\n return (\n <div\n ref={setRef}\n className={clsx(s.Footer, className)}\n data-background={barBackground(background)}\n data-content-below={contentBelow ? \"\" : undefined}\n {...restProps}\n >\n <div className={s.FooterContent}>{children}</div>\n </div>\n )\n}\nPageFooter.displayName = \"Page.Footer\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Page = PageRoot as typeof PageRoot & {\n Header: typeof PageHeader\n Bar: typeof PageBar\n Leading: typeof PageLeading\n Heading: typeof PageHeading\n Title: typeof PageTitle\n Subtitle: typeof PageSubtitle\n Actions: typeof PageActions\n Content: typeof PageContent\n Footer: typeof PageFooter\n}\nPage.Header = PageHeader\nPage.Bar = PageBar\nPage.Leading = PageLeading\nPage.Heading = PageHeading\nPage.Title = PageTitle\nPage.Subtitle = PageSubtitle\nPage.Actions = PageActions\nPage.Content = PageContent\nPage.Footer = PageFooter\n"]}
@@ -70,6 +70,18 @@ export const Slider = memo((props) => {
70
70
  singleOnChange?.(nextValue);
71
71
  }), 250);
72
72
  const [pointerDown, setPointerDown] = useState(false);
73
+ // A phone's reset is a button of its own beside the value (below)
74
+ const tabletAndUp = useBreakpoint("md");
75
+ // A press ends where the finger lifts, even when something else takes the pointer away (a sheet that a touch
76
+ // drags, a scroll the browser takes over): the slider's own pointerup never comes then, so the window hears the
77
+ // lift and a lost capture ends the press too.
78
+ const releasePress = useRef(null);
79
+ const endPress = useCallback(() => {
80
+ releasePress.current?.();
81
+ releasePress.current = null;
82
+ setPointerDown(false);
83
+ }, []);
84
+ useEffect(() => () => releasePress.current?.(), []);
73
85
  const [resetPending, setResetPending] = useState(false);
74
86
  // Read the controlled owner after a reset request, including a refused request.
75
87
  useEffect(() => {
@@ -84,10 +96,10 @@ export const Slider = memo((props) => {
84
96
  if (!disabled)
85
97
  return;
86
98
  debouncedOnChange.cancel();
87
- setPointerDown(false);
99
+ endPress();
88
100
  if (!isRange)
89
101
  setInputValueNumber(singleValue);
90
- }, [disabled, isRange, singleValue, setInputValueNumber, debouncedOnChange]);
102
+ }, [disabled, isRange, singleValue, setInputValueNumber, debouncedOnChange, endPress]);
91
103
  const isMounted = useIsMounted();
92
104
  // Used to position the input over the thumb
93
105
  const inputRef = useRef(null);
@@ -250,7 +262,7 @@ export const Slider = memo((props) => {
250
262
  .map((v) => `${prefixUnit ?? ""}${v.toFixed(precision)}${unit ?? ""}`)
251
263
  .join(" – ")
252
264
  : "";
253
- return (_jsxs("div", { className: clsx(s.SliderWrap, className), "data-orientation": orientation, children: [label && (_jsxs("div", { className: s.SliderLabel, children: [_jsx("label", { htmlFor: isRange ? undefined : id, id: labelId, className: "flex-1", children: label }), !isRange && resetValue !== undefined && (_jsx(Tooltip, { content: resetTooltip, compact: true, children: _jsx(Button, { size: "2xs", variant: "ghost", color: "secondary", className: s.Reset, "aria-label": resetTooltip, disabled: disabled, "data-hide": disabled || (resetValue === singleValue && !pointerDown), onClick: () => {
265
+ return (_jsxs("div", { className: clsx(s.SliderWrap, className), "data-orientation": orientation, children: [label && (_jsxs("div", { className: s.SliderLabel, children: [_jsx("label", { htmlFor: isRange ? undefined : id, id: labelId, className: "flex-1", children: label }), !isRange && resetValue !== undefined && (_jsx(Tooltip, { content: resetTooltip, compact: true, children: _jsx(Button, { size: "2xs", variant: tabletAndUp ? "ghost" : "soft", color: "secondary", uniform: !tabletAndUp, pill: !tabletAndUp, className: s.Reset, "aria-label": resetTooltip, disabled: disabled, "data-hide": disabled || (resetValue === singleValue && !pointerDown), onClick: () => {
254
266
  if (disabled)
255
267
  return;
256
268
  debouncedOnChange.cancel();
@@ -264,9 +276,21 @@ export const Slider = memo((props) => {
264
276
  if (disabled)
265
277
  return;
266
278
  setPointerDown(true);
279
+ releasePress.current?.();
280
+ const { pointerId } = event;
281
+ const end = (lift) => {
282
+ if (lift.pointerId === pointerId)
283
+ endPress();
284
+ };
285
+ window.addEventListener("pointerup", end, true);
286
+ window.addEventListener("pointercancel", end, true);
287
+ releasePress.current = () => {
288
+ window.removeEventListener("pointerup", end, true);
289
+ window.removeEventListener("pointercancel", end, true);
290
+ };
267
291
  if (isRange)
268
292
  focusThumbToMove(event.nativeEvent, event.currentTarget, radixValue, min, max, isVertical, direction === "rtl");
269
- }, onPointerUp: () => setPointerDown(false), onPointerCancel: () => setPointerDown(false), "data-pressed": pointerDown ? "" : undefined, "data-range": isRange ? "" : undefined, style: toCssVariables({
293
+ }, onPointerUp: endPress, onPointerCancel: endPress, onLostPointerCapture: endPress, "data-pressed": pointerDown ? "" : undefined, "data-range": isRange ? "" : undefined, style: toCssVariables({
270
294
  "slider-duration": `${animationDurationMS}ms`,
271
295
  "slider-track-color": trackColor,
272
296
  "slider-range-color": rangeColor,
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,KAAK,MAAM,cAAc,CAAA;AAChC,OAAO,KAAK,MAAM,cAAc,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAKL,IAAI,EAEJ,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EA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vC;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,CAAA;IACjD,OAAO,QAAQ,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,WAAW,CAAA;AAC5E,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport clamp from \"lodash/clamp\"\nimport round from \"lodash/round\"\nimport { Direction, Slider as RadixSlider } from \"radix-ui\"\nimport {\n type ChangeEventHandler,\n type ElementRef,\n type FocusEventHandler,\n type KeyboardEventHandler,\n memo,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useDebounceCallback, useResizeObserver } from \"usehooks-ts\"\nimport { useBreakpoint } from \"../../hooks/useBreakpoints\"\nimport { useIsMounted } from \"../../hooks/useIsMounted\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { usePrevious } from \"../../hooks/usePrevious\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport { Button } from \"../Button\"\nimport { Reload } from \"../Icon\"\nimport { Tooltip } from \"../Tooltip\"\nimport s from \"@plexui/styles/components/Slider/Slider.module.css\"\n\nexport type SliderMark = {\n value: number\n label: string\n}\n\ntype SliderBaseProps = {\n /**\n * The minimum value the slider can have\n */\n min: number\n /**\n * The maximum value the slider can have\n */\n max: number\n /**\n * The step increment between slider values\n */\n step: number\n /**\n * Unit to display next to the slider value (e.g., ms, px)\n */\n unit?: string\n /**\n * Unit to display to the right of the slider value (e.g., $)\n */\n prefixUnit?: string\n /**\n * Optional label for the slider, which can be a string or React node.\n */\n label?: ReactNode\n /**\n * Accessible name for the slider when there is no visible `label`\n */\n \"aria-label\"?: string\n /**\n * Id of an element that names the slider; takes precedence over `label`\n */\n \"aria-labelledby\"?: string\n /**\n * List of marks to display below the slider track\n */\n marks?: SliderMark[]\n /**\n * Color of the slider track\n */\n trackColor?: string\n /**\n * Color of the slider progress along the track\n */\n rangeColor?: string\n className?: string\n disabled?: boolean\n /**\n * Orientation of the slider\n * @default \"horizontal\"\n */\n orientation?: \"horizontal\" | \"vertical\"\n onBlur?: FocusEventHandler<HTMLInputElement>\n onFocus?: FocusEventHandler<HTMLInputElement>\n ref?: React.Ref<ElementRef<typeof RadixSlider.Root> | null>\n}\n\ntype SingleSliderProps = SliderBaseProps & {\n /**\n * When false or omitted, the slider has a single thumb\n */\n range?: false\n /**\n * The current value of the slider\n */\n value: number\n /**\n * Callback function invoked when the slider value changes.\n */\n onChange: (value: number) => void\n /**\n * Value that will be offered as a \"reset to default\" option\n */\n resetValue?: number\n /**\n * String that will be displayed in the tooltip\n * @default Reset to default\n */\n resetTooltip?: string\n}\n\ntype RangeSliderProps = SliderBaseProps & {\n /**\n * When true, the slider supports multiple thumbs\n */\n range: true\n /**\n * Array of values, one per thumb\n */\n value: number[]\n /**\n * Callback function invoked when slider values change.\n */\n onChange: (value: number[]) => void\n /**\n * Minimum number of steps between thumbs\n */\n minStepsBetweenThumbs?: number\n}\n\nexport type SliderProps = SingleSliderProps | RangeSliderProps\n\n/**\n * A press on the track of a range moves the thumb whose value lies nearest the press, which Radix focuses only\n * once that value changes. Focusing it at once lets a phone draw the knob being pressed as the lens of glass\n * (Slider.module.css), even when the press leaves the value as it is. The thumb is the one Radix moves: the\n * pointer mapped onto min to max across the root (from the right in a right-to-left direction, which Radix\n * takes from a DirectionProvider), the nearest value, the first on a tie. A press on a thumb itself is left\n * to Radix, which focuses that thumb.\n */\nconst focusThumbToMove = (event: PointerEvent, root: HTMLElement, values: number[], min: number, max: number, vertical: boolean, rtl: boolean) => {\n const thumbs = Array.from(root.querySelectorAll<HTMLElement>('[role=\"slider\"]'))\n if (thumbs.includes(event.target as HTMLElement)) return\n const rect = root.getBoundingClientRect()\n const ratio = vertical ? (rect.bottom - event.clientY) / rect.height : (rtl ? rect.right - event.clientX : event.clientX - rect.left) / rect.width\n const pointerValue = min + ratio * (max - min)\n const distances = values.map((value) => Math.abs(value - pointerValue))\n const thumb = thumbs[distances.indexOf(Math.min(...distances))]\n if (thumb && thumb !== document.activeElement) thumb.focus({ preventScroll: true, focusVisible: false } as FocusOptions)\n}\n\n/** A knob's value from 0 to 1, by which a phone stands the knob on its value as iOS does (Slider.module.css). */\nconst thumbPercentStyle = (value: number, min: number, max: number) =>\n ({ \"--slider-thumb-percent\": String(max > min ? clamp((value - min) / (max - min), 0, 1) : 0) }) as React.CSSProperties\n\n/**\n * Where a knob's centre stands at a value (0 to 1), from the start of a track `width` wide. Radix eases the knob\n * over the whole track to keep it inside; on a phone it stands on the value and stops half its width from each\n * end, as iOS (`clamped`, Slider.module.css).\n */\nconst thumbCentre = (percent: number, width: number, thumbHalf: number, clamped: boolean) =>\n clamped ? clamp(percent * width, thumbHalf, width - thumbHalf) : percent * width + thumbHalf * (1 - 2 * percent)\n\nexport const Slider = memo((props: SliderProps) => {\n const {\n className,\n onChange,\n min,\n max,\n step,\n disabled,\n value,\n onBlur,\n onFocus,\n unit,\n prefixUnit,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n marks: propMarks = [],\n trackColor,\n rangeColor,\n orientation = \"horizontal\",\n ref: forwardedRef,\n } = props\n\n const isRange = props.range === true\n const isVertical = orientation === \"vertical\"\n // The direction Radix slides in: no `dir` is passed, so it is the one of a DirectionProvider, else left to right.\n const direction = Direction.useDirection()\n\n const id = useId()\n const labelId = `${id}-label`\n // What names the thumbs: an explicit labelledby, else the visible label\n const nameId = ariaLabelledBy ?? (label ? labelId : undefined)\n const precision = useMemo(() => String(step).split(\".\")[1]?.length ?? 0, [step])\n\n // Single-mode state for editable input\n const singleValue = isRange ? 0 : (value as number)\n const [inputValue, setInputValue] = useState<string>(\n isRange ? \"\" : String((value as number).toFixed(precision)),\n )\n const setInputValueNumber = useCallback(\n (nextValue: number) => {\n setInputValue(nextValue.toFixed(precision))\n },\n [precision],\n )\n\n // prevents input from jumping around while the user is typing\n const singleOnChange = isRange ? undefined : (onChange as (v: number) => void)\n // One debounced function for the slider's lifetime (calling the latest\n // onChange), so an immediate change can cancel the pending typed one\n const debouncedOnChange = useDebounceCallback(\n useStableCallback((nextValue: number) => {\n if (!disabled) singleOnChange?.(nextValue)\n }),\n 250,\n )\n const [pointerDown, setPointerDown] = useState(false)\n const [resetPending, setResetPending] = useState(false)\n // Read the controlled owner after a reset request, including a refused request.\n useEffect(() => {\n if (!resetPending) return\n setResetPending(false)\n if (!isRange) setInputValueNumber(singleValue)\n }, [resetPending, isRange, singleValue, setInputValueNumber])\n useEffect(() => () => debouncedOnChange.cancel(), [debouncedOnChange])\n useEffect(() => {\n if (!disabled) return\n debouncedOnChange.cancel()\n setPointerDown(false)\n if (!isRange) setInputValueNumber(singleValue)\n }, [disabled, isRange, singleValue, setInputValueNumber, debouncedOnChange])\n const isMounted = useIsMounted()\n\n // Used to position the input over the thumb\n const inputRef = useRef<HTMLInputElement>(null)\n\n const inputWidth = getValueWidth(inputValue)\n\n // Calculate animation duration based on the distance the thumb needs to move\n // Skip custom animation for range mode — let Radix handle it\n const percent = isRange ? 0 : ((value as number) - min) / (max - min)\n const previousPercent = usePrevious(percent)\n const animationDurationMS =\n isRange || !isMounted || pointerDown\n ? 0\n : Math.max(Math.abs(percent - previousPercent) * 300, 100)\n\n // We assume that the width of the thumb does not change from render to render\n const thumbRef = useRef<HTMLDivElement>(null)\n\n // Sort marks for collision detection, again only when a value or label changes\n const marksKey = JSON.stringify(propMarks.map(({ value, label }) => [value, label]))\n const marks = useMemo<SliderMark[]>(\n () => [...propMarks].sort((a, b) => a.value - b.value),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [marksKey],\n )\n\n // Validate marks\n useEffect(() => {\n if (!marks) return\n const markValues = new Set<number>()\n for (const mark of marks) {\n if (mark.value < min || mark.value > max) {\n throw new Error(`Slider mark value ${mark.value} is out of bounds [${min}, ${max}]`)\n }\n if (markValues.has(mark.value)) {\n throw new Error(\"Slider marks must have unique values\")\n }\n markValues.add(mark.value)\n }\n }, [marks, max, min])\n\n // Update value if out of bounds (single mode only)\n const latestValue = useLatestValue(value)\n const latestOnChange = useLatestValue(onChange)\n useEffect(() => {\n if (isRange) return\n const v = latestValue.current as number\n const clamped = clamp(v, min, max)\n if (clamped !== v) {\n ;(latestOnChange.current as (v: number) => void)(clamped)\n setInputValueNumber(clamped)\n }\n }, [max, min, latestValue, latestOnChange, setInputValueNumber, isRange])\n\n useEffect(() => {\n if (isRange) return\n if (inputRef.current !== document.activeElement) {\n setInputValueNumber(value as number)\n }\n }, [value, setInputValueNumber, isRange])\n\n // Single-mode keyboard handler: a key's change replaces a pending typed one\n const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = (evt) => {\n if (disabled || isRange || !singleOnChange) return\n if (evt.key === \"Home\") {\n evt.preventDefault()\n debouncedOnChange.cancel()\n singleOnChange(min)\n setInputValueNumber(min)\n }\n if (evt.key === \"End\") {\n evt.preventDefault()\n debouncedOnChange.cancel()\n singleOnChange(max)\n setInputValueNumber(max)\n }\n if (evt.key === \"ArrowUp\") {\n evt.preventDefault()\n const multiplier = evt.shiftKey ? 10 : 1\n const next = clamp(singleValue + step * multiplier, min, max)\n debouncedOnChange.cancel()\n singleOnChange(next)\n setInputValueNumber(next)\n }\n if (evt.key === \"ArrowDown\") {\n evt.preventDefault()\n const multiplier = evt.shiftKey ? 10 : 1\n const next = clamp(singleValue - step * multiplier, min, max)\n debouncedOnChange.cancel()\n singleOnChange(next)\n setInputValueNumber(next)\n }\n if (evt.key === \"Enter\" || evt.key === \"Escape\") {\n evt.preventDefault()\n evt.currentTarget.blur()\n }\n }\n\n const handleInputChange: ChangeEventHandler<HTMLInputElement> = (evt) => {\n if (disabled || isRange || !singleOnChange) return\n // Mobile decimal keyboards may use a comma. A minus is valid only below zero.\n const nextValue = evt.currentTarget.value.trim().replace(/,/g, \".\").replace(min < 0 ? /(?!^-)[^\\d.]/g : /[^\\d.]/g, \"\")\n debouncedOnChange.cancel()\n let parsed = parseFloat(nextValue || \"0\")\n if (Number.isNaN(parsed)) {\n // A lone \"-\" or \".\" is a number still being typed: nothing to report yet\n setInputValue(nextValue)\n return\n }\n parsed = clamp(parsed, min, max)\n if (step >= 1) {\n parsed = Math.floor(parsed)\n }\n debouncedOnChange(parsed)\n setInputValue(nextValue)\n }\n\n const handleInputBlur: FocusEventHandler<HTMLInputElement> = (evt) => {\n if (isRange || !singleOnChange) return\n // Blur commits the typed text, so its pending debounced change is dropped\n debouncedOnChange.cancel()\n if (disabled) {\n setInputValueNumber(singleValue)\n onBlur?.(evt)\n return\n }\n let parsed = parseFloat(evt.target.value.trim().replace(/,/g, \".\")) || 0\n if (step >= 1) {\n parsed = Math.floor(parsed)\n } else {\n parsed = round(parsed, precision)\n }\n parsed = clamp(parsed, min, max)\n if (parsed !== singleValue) {\n singleOnChange(parsed)\n }\n setInputValueNumber(parsed)\n onBlur?.(evt)\n }\n\n // Radix value/onChange wiring\n const radixValue = isRange ? (value as number[]) : [value as number]\n const handleValueChange = (values: number[]) => {\n if (disabled) return\n debouncedOnChange.cancel()\n if (isRange) (onChange as (v: number[]) => void)(values)\n else (onChange as (v: number) => void)(values[0])\n }\n\n // Single-mode props\n const resetValue = !isRange ? (props as SingleSliderProps).resetValue : undefined\n const resetTooltip = !isRange\n ? (props as SingleSliderProps).resetTooltip ?? \"Reset to default\"\n : undefined\n\n // Range-mode props\n const minStepsBetweenThumbs = isRange\n ? (props as RangeSliderProps).minStepsBetweenThumbs\n : undefined\n\n // Show marks only in horizontal orientation\n const showMarks = marks.length > 0 && !isVertical\n\n // Format range display text\n const rangeDisplayText = isRange\n ? (value as number[])\n .map((v) => `${prefixUnit ?? \"\"}${v.toFixed(precision)}${unit ?? \"\"}`)\n .join(\" – \")\n : \"\"\n\n return (\n <div\n className={clsx(s.SliderWrap, className)}\n data-orientation={orientation}\n >\n {label && (\n <div className={s.SliderLabel}>\n {/* Range mode renders no value input, so the label only names the thumbs */}\n <label htmlFor={isRange ? undefined : id} id={labelId} className=\"flex-1\">\n {label}\n </label>\n {!isRange && resetValue !== undefined && (\n <Tooltip content={resetTooltip!} compact>\n <Button\n size=\"2xs\"\n variant=\"ghost\"\n color=\"secondary\"\n className={s.Reset}\n aria-label={resetTooltip}\n disabled={disabled}\n data-hide={disabled || (resetValue === singleValue && !pointerDown)}\n onClick={() => {\n if (disabled) return\n debouncedOnChange.cancel()\n singleOnChange?.(resetValue)\n setResetPending(true)\n }}\n >\n <Reload />\n </Button>\n </Tooltip>\n )}\n {isRange ? (\n <span className={s.RangeDisplay}>{rangeDisplayText}</span>\n ) : (\n <div className={s.SliderValue} onClick={() => { if (!disabled) inputRef.current?.focus() }}>\n {prefixUnit && <span className={s.ValueUnit}>{prefixUnit}</span>}\n <input\n id={id}\n className={s.ValueInput}\n ref={inputRef}\n style={{ width: inputWidth }}\n onKeyDown={handleKeyDown}\n value={inputValue}\n type=\"text\"\n inputMode={min < 0 ? \"text\" : Number.isInteger(min) && Number.isInteger(max) && Number.isInteger(step) ? \"numeric\" : \"decimal\"}\n onClick={(e) => e.stopPropagation()}\n onBlur={handleInputBlur}\n onFocus={(e) => {\n e.currentTarget.setSelectionRange(0, e.currentTarget.value.length)\n onFocus?.(e)\n }}\n onChange={handleInputChange}\n disabled={disabled}\n />\n {unit && <span className={s.ValueUnit}>{unit}</span>}\n </div>\n )}\n </div>\n )}\n <div className={s.SliderContainer}>\n <RadixSlider.Root\n ref={forwardedRef}\n className={s.Slider}\n onValueChange={handleValueChange}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n value={radixValue}\n orientation={orientation}\n minStepsBetweenThumbs={minStepsBetweenThumbs}\n onBlur={onBlur}\n onFocus={onFocus}\n onPointerDown={(event) => {\n if (disabled) return\n setPointerDown(true)\n if (isRange) focusThumbToMove(event.nativeEvent, event.currentTarget, radixValue, min, max, isVertical, direction === \"rtl\")\n }}\n onPointerUp={() => setPointerDown(false)}\n onPointerCancel={() => setPointerDown(false)}\n data-pressed={pointerDown ? \"\" : undefined}\n data-range={isRange ? \"\" : undefined}\n style={toCssVariables({\n \"slider-duration\": `${animationDurationMS}ms`,\n \"slider-track-color\": trackColor,\n \"slider-range-color\": rangeColor,\n })}\n >\n <RadixSlider.Track className={s.Track}>\n <RadixSlider.Range className={s.Range} />\n </RadixSlider.Track>\n {isRange ? (\n (value as number[]).map((_, i) => (\n <RadixSlider.Thumb\n key={i}\n id={`${id}-thumb-${i}`}\n className={s.Thumb}\n style={thumbPercentStyle((value as number[])[i], min, max)}\n // The marks measure the first thumb (all thumbs are the same size)\n ref={i === 0 ? thumbRef : undefined}\n // Name plus the thumb's own Radix name (\"Minimum\" / \"Maximum\"),\n // so the endpoints stay distinguishable\n aria-labelledby={nameId ? `${nameId} ${id}-thumb-${i}` : undefined}\n // Only pass aria-label when set: an explicit undefined would\n // replace the name Radix gives the thumb\n {...(!nameId && ariaLabel\n ? {\n \"aria-label\":\n `${ariaLabel} ${rangeThumbName(i, (value as number[]).length)}`.trim(),\n }\n : {})}\n />\n ))\n ) : (\n <RadixSlider.Thumb\n className={s.Thumb}\n style={thumbPercentStyle(value as number, min, max)}\n ref={thumbRef}\n aria-labelledby={nameId}\n {...(!nameId && ariaLabel ? { \"aria-label\": ariaLabel } : {})}\n />\n )}\n </RadixSlider.Root>\n {showMarks && <SliderMarks marks={marks} thumbRef={thumbRef} min={min} max={max} />}\n </div>\n </div>\n )\n})\nSlider.displayName = \"Slider\"\n\n// Matches the names Radix gives range thumbs on its own\nconst rangeThumbName = (index: number, count: number) =>\n count === 2 ? (index === 0 ? \"Minimum\" : \"Maximum\") : count > 2 ? `Value ${index + 1} of ${count}` : \"\"\n\ntype MarksProps = {\n marks: SliderMark[]\n thumbRef: React.RefObject<HTMLDivElement | null>\n min: number\n max: number\n}\n\n// The minimum difference we enforce between marks, in pixels\nconst MINIMUM_MARK_SPACING_PX = 16\n\nconst SliderMarks = memo(({ marks, thumbRef, min, max }: MarksProps) => {\n // We seperate the container and measure divs so that our resize observer\n // does not fire when we adjust the height of the marks container.\n const marksContainerRef = useRef<HTMLDivElement>(null)\n const measureRef = useRef<HTMLDivElement>(null)\n\n // We measure the width of the slider within this component so that sliders\n // without marks do not pay a performance penalty.\n // @ts-expect-error(2322) -- bug in types: https://github.com/juliencrn/usehooks-ts/issues/663\n const { width: sliderWidth } = useResizeObserver({ ref: measureRef })\n // The knob's travel changes at the phone breakpoint (Slider.module.css), also where the width stays\n const tabletAndUp = useBreakpoint(\"md\")\n\n useLayoutEffect(() => {\n // Impossible\n if (!thumbRef.current || !marksContainerRef.current) {\n return\n }\n\n const markElements = Array.from(\n marksContainerRef.current.querySelectorAll(\"[data-mark]\"),\n ) as HTMLDivElement[]\n\n // Its layout width: a pressed knob is scaled into the lens\n const thumbHalfWidth = thumbRef.current.offsetWidth / 2\n const clamped = getComputedStyle(thumbRef.current).getPropertyValue(\"--slider-thumb-travel\").trim() === \"clamped\"\n\n // Wipe all styles so we can accurately determine the positions of the marks\n markElements.forEach((markEl) => {\n markEl.style.width = \"\"\n markEl.style.display = \"\"\n })\n\n const positionMarks = () => {\n if (!sliderWidth) {\n return\n }\n\n markElements.forEach((markEl, index) => {\n const markValue = marks[index].value\n const valuePercent = (markValue - min) / (max - min)\n const markWidth = markEl.getBoundingClientRect().width\n const markHalfWidth = markWidth / 2\n\n // Under the knob's centre at the mark's value, accounting for the width of the mark itself\n let left = thumbCentre(valuePercent, sliderWidth, thumbHalfWidth, clamped) - markHalfWidth\n\n // Clamp to the left and right bounds of the container\n left = Math.max(0, Math.min(left, sliderWidth - markWidth))\n\n markEl.style.left = `${left}px`\n })\n }\n\n const marksHaveCollisions = () => {\n for (let i = 0; i < markElements.length - 1; i++) {\n const currentRect = markElements[i].getBoundingClientRect()\n const nextRect = markElements[i + 1].getBoundingClientRect()\n\n if (currentRect.right + MINIMUM_MARK_SPACING_PX > nextRect.left) {\n return true\n }\n }\n return false\n }\n\n positionMarks()\n\n // If we have collisions, try to wrap the content\n if (marksHaveCollisions()) {\n markElements.forEach((markEl) => {\n markEl.style.width = \"min-content\"\n })\n\n positionMarks()\n\n // Hide all marks if we still have collisions\n if (marksHaveCollisions()) {\n markElements.forEach((markEl) => {\n markEl.style.display = \"none\"\n })\n }\n }\n\n const tallestHeight = Math.max(\n ...markElements.map((markEl) => markEl.getBoundingClientRect().height),\n )\n\n // Give our container a height so that we allocate space on the page\n // for the marks and push down other content when we have to wrap\n marksContainerRef.current.style.height = tallestHeight > 0 ? `${tallestHeight}px` : \"\"\n // Placed against the slider's width: the marks show, at their own height (Slider.module.css)\n if (sliderWidth) marksContainerRef.current.dataset.measured = \"\"\n }, [marks, thumbRef, marksContainerRef, min, max, sliderWidth, tabletAndUp])\n\n return (\n <div className={s.MarksContainer} ref={marksContainerRef}>\n <div ref={measureRef}>\n {marks.map((mark) => (\n <div key={mark.value} className={s.Mark} data-mark>\n <span className={s.MarkLabel}>{mark.label}</span>\n </div>\n ))}\n </div>\n </div>\n )\n})\nSliderMarks.displayName = \"SliderMarks\"\n\n/**\n * The value field is as wide as its characters at any font size: tabular digits are one `ch` each, and a sign,\n * a decimal point or a separator about half of one, so a right-aligned value sits next to its prefix unit.\n */\nconst getValueWidth = (text: string): string => {\n const digits = text.replace(/[^0-9]/g, \"\").length\n return `calc(${Math.max(digits + (text.length - digits) / 2, 1)}ch + 1px)`\n}\n"]}
1
+ {"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,KAAK,MAAM,cAAc,CAAA;AAChC,OAAO,KAAK,MAAM,cAAc,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,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,CAAC,KAAK,CAEd,CACP,CAAC,GACE,GACF,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AACF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,CAAA;IACjD,OAAO,QAAQ,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,WAAW,CAAA;AAC5E,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport clamp from \"lodash/clamp\"\nimport round from \"lodash/round\"\nimport { Direction, Slider as RadixSlider } from \"radix-ui\"\nimport {\n type ChangeEventHandler,\n type ElementRef,\n type FocusEventHandler,\n type KeyboardEventHandler,\n memo,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useDebounceCallback, useResizeObserver } from \"usehooks-ts\"\nimport { useBreakpoint } from \"../../hooks/useBreakpoints\"\nimport { useIsMounted } from \"../../hooks/useIsMounted\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { usePrevious } from \"../../hooks/usePrevious\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport { Button } from \"../Button\"\nimport { Reload } from \"../Icon\"\nimport { Tooltip } from \"../Tooltip\"\nimport s from \"@plexui/styles/components/Slider/Slider.module.css\"\n\nexport type SliderMark = {\n value: number\n label: string\n}\n\ntype SliderBaseProps = {\n /**\n * The minimum value the slider can have\n */\n min: number\n /**\n * The maximum value the slider can have\n */\n max: number\n /**\n * The step increment between slider values\n */\n step: number\n /**\n * Unit to display next to the slider value (e.g., ms, px)\n */\n unit?: string\n /**\n * Unit to display to the right of the slider value (e.g., $)\n */\n prefixUnit?: string\n /**\n * Optional label for the slider, which can be a string or React node.\n */\n label?: ReactNode\n /**\n * Accessible name for the slider when there is no visible `label`\n */\n \"aria-label\"?: string\n /**\n * Id of an element that names the slider; takes precedence over `label`\n */\n \"aria-labelledby\"?: string\n /**\n * List of marks to display below the slider track\n */\n marks?: SliderMark[]\n /**\n * Color of the slider track\n */\n trackColor?: string\n /**\n * Color of the slider progress along the track\n */\n rangeColor?: string\n className?: string\n disabled?: boolean\n /**\n * Orientation of the slider\n * @default \"horizontal\"\n */\n orientation?: \"horizontal\" | \"vertical\"\n onBlur?: FocusEventHandler<HTMLInputElement>\n onFocus?: FocusEventHandler<HTMLInputElement>\n ref?: React.Ref<ElementRef<typeof RadixSlider.Root> | null>\n}\n\ntype SingleSliderProps = SliderBaseProps & {\n /**\n * When false or omitted, the slider has a single thumb\n */\n range?: false\n /**\n * The current value of the slider\n */\n value: number\n /**\n * Callback function invoked when the slider value changes.\n */\n onChange: (value: number) => void\n /**\n * Value that will be offered as a \"reset to default\" option\n */\n resetValue?: number\n /**\n * String that will be displayed in the tooltip\n * @default Reset to default\n */\n resetTooltip?: string\n}\n\ntype RangeSliderProps = SliderBaseProps & {\n /**\n * When true, the slider supports multiple thumbs\n */\n range: true\n /**\n * Array of values, one per thumb\n */\n value: number[]\n /**\n * Callback function invoked when slider values change.\n */\n onChange: (value: number[]) => void\n /**\n * Minimum number of steps between thumbs\n */\n minStepsBetweenThumbs?: number\n}\n\nexport type SliderProps = SingleSliderProps | RangeSliderProps\n\n/**\n * A press on the track of a range moves the thumb whose value lies nearest the press, which Radix focuses only\n * once that value changes. Focusing it at once lets a phone draw the knob being pressed as the lens of glass\n * (Slider.module.css), even when the press leaves the value as it is. The thumb is the one Radix moves: the\n * pointer mapped onto min to max across the root (from the right in a right-to-left direction, which Radix\n * takes from a DirectionProvider), the nearest value, the first on a tie. A press on a thumb itself is left\n * to Radix, which focuses that thumb.\n */\nconst focusThumbToMove = (event: PointerEvent, root: HTMLElement, values: number[], min: number, max: number, vertical: boolean, rtl: boolean) => {\n const thumbs = Array.from(root.querySelectorAll<HTMLElement>('[role=\"slider\"]'))\n if (thumbs.includes(event.target as HTMLElement)) return\n const rect = root.getBoundingClientRect()\n const ratio = vertical ? (rect.bottom - event.clientY) / rect.height : (rtl ? rect.right - event.clientX : event.clientX - rect.left) / rect.width\n const pointerValue = min + ratio * (max - min)\n const distances = values.map((value) => Math.abs(value - pointerValue))\n const thumb = thumbs[distances.indexOf(Math.min(...distances))]\n if (thumb && thumb !== document.activeElement) thumb.focus({ preventScroll: true, focusVisible: false } as FocusOptions)\n}\n\n/** A knob's value from 0 to 1, by which a phone stands the knob on its value as iOS does (Slider.module.css). */\nconst thumbPercentStyle = (value: number, min: number, max: number) =>\n ({ \"--slider-thumb-percent\": String(max > min ? clamp((value - min) / (max - min), 0, 1) : 0) }) as React.CSSProperties\n\n/**\n * Where a knob's centre stands at a value (0 to 1), from the start of a track `width` wide. Radix eases the knob\n * over the whole track to keep it inside; on a phone it stands on the value and stops half its width from each\n * end, as iOS (`clamped`, Slider.module.css).\n */\nconst thumbCentre = (percent: number, width: number, thumbHalf: number, clamped: boolean) =>\n clamped ? clamp(percent * width, thumbHalf, width - thumbHalf) : percent * width + thumbHalf * (1 - 2 * percent)\n\nexport const Slider = memo((props: SliderProps) => {\n const {\n className,\n onChange,\n min,\n max,\n step,\n disabled,\n value,\n onBlur,\n onFocus,\n unit,\n prefixUnit,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n marks: propMarks = [],\n trackColor,\n rangeColor,\n orientation = \"horizontal\",\n ref: forwardedRef,\n } = props\n\n const isRange = props.range === true\n const isVertical = orientation === \"vertical\"\n // The direction Radix slides in: no `dir` is passed, so it is the one of a DirectionProvider, else left to right.\n const direction = Direction.useDirection()\n\n const id = useId()\n const labelId = `${id}-label`\n // What names the thumbs: an explicit labelledby, else the visible label\n const nameId = ariaLabelledBy ?? (label ? labelId : undefined)\n const precision = useMemo(() => String(step).split(\".\")[1]?.length ?? 0, [step])\n\n // Single-mode state for editable input\n const singleValue = isRange ? 0 : (value as number)\n const [inputValue, setInputValue] = useState<string>(\n isRange ? \"\" : String((value as number).toFixed(precision)),\n )\n const setInputValueNumber = useCallback(\n (nextValue: number) => {\n setInputValue(nextValue.toFixed(precision))\n },\n [precision],\n )\n\n // prevents input from jumping around while the user is typing\n const singleOnChange = isRange ? undefined : (onChange as (v: number) => void)\n // One debounced function for the slider's lifetime (calling the latest\n // onChange), so an immediate change can cancel the pending typed one\n const debouncedOnChange = useDebounceCallback(\n useStableCallback((nextValue: number) => {\n if (!disabled) singleOnChange?.(nextValue)\n }),\n 250,\n )\n const [pointerDown, setPointerDown] = useState(false)\n // A phone's reset is a button of its own beside the value (below)\n const tabletAndUp = useBreakpoint(\"md\")\n // A press ends where the finger lifts, even when something else takes the pointer away (a sheet that a touch\n // drags, a scroll the browser takes over): the slider's own pointerup never comes then, so the window hears the\n // lift and a lost capture ends the press too.\n const releasePress = useRef<(() => void) | null>(null)\n const endPress = useCallback(() => {\n releasePress.current?.()\n releasePress.current = null\n setPointerDown(false)\n }, [])\n useEffect(() => () => releasePress.current?.(), [])\n const [resetPending, setResetPending] = useState(false)\n // Read the controlled owner after a reset request, including a refused request.\n useEffect(() => {\n if (!resetPending) return\n setResetPending(false)\n if (!isRange) setInputValueNumber(singleValue)\n }, [resetPending, isRange, singleValue, setInputValueNumber])\n useEffect(() => () => debouncedOnChange.cancel(), [debouncedOnChange])\n useEffect(() => {\n if (!disabled) return\n debouncedOnChange.cancel()\n endPress()\n if (!isRange) setInputValueNumber(singleValue)\n }, [disabled, isRange, singleValue, setInputValueNumber, debouncedOnChange, endPress])\n const isMounted = useIsMounted()\n\n // Used to position the input over the thumb\n const inputRef = useRef<HTMLInputElement>(null)\n\n const inputWidth = getValueWidth(inputValue)\n\n // Calculate animation duration based on the distance the thumb needs to move\n // Skip custom animation for range mode — let Radix handle it\n const percent = isRange ? 0 : ((value as number) - min) / (max - min)\n const previousPercent = usePrevious(percent)\n const animationDurationMS =\n isRange || !isMounted || pointerDown\n ? 0\n : Math.max(Math.abs(percent - previousPercent) * 300, 100)\n\n // We assume that the width of the thumb does not change from render to render\n const thumbRef = useRef<HTMLDivElement>(null)\n\n // Sort marks for collision detection, again only when a value or label changes\n const marksKey = JSON.stringify(propMarks.map(({ value, label }) => [value, label]))\n const marks = useMemo<SliderMark[]>(\n () => [...propMarks].sort((a, b) => a.value - b.value),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [marksKey],\n )\n\n // Validate marks\n useEffect(() => {\n if (!marks) return\n const markValues = new Set<number>()\n for (const mark of marks) {\n if (mark.value < min || mark.value > max) {\n throw new Error(`Slider mark value ${mark.value} is out of bounds [${min}, ${max}]`)\n }\n if (markValues.has(mark.value)) {\n throw new Error(\"Slider marks must have unique values\")\n }\n markValues.add(mark.value)\n }\n }, [marks, max, min])\n\n // Update value if out of bounds (single mode only)\n const latestValue = useLatestValue(value)\n const latestOnChange = useLatestValue(onChange)\n useEffect(() => {\n if (isRange) return\n const v = latestValue.current as number\n const clamped = clamp(v, min, max)\n if (clamped !== v) {\n ;(latestOnChange.current as (v: number) => void)(clamped)\n setInputValueNumber(clamped)\n }\n }, [max, min, latestValue, latestOnChange, setInputValueNumber, isRange])\n\n useEffect(() => {\n if (isRange) return\n if (inputRef.current !== document.activeElement) {\n setInputValueNumber(value as number)\n }\n }, [value, setInputValueNumber, isRange])\n\n // Single-mode keyboard handler: a key's change replaces a pending typed one\n const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = (evt) => {\n if (disabled || isRange || !singleOnChange) return\n if (evt.key === \"Home\") {\n evt.preventDefault()\n debouncedOnChange.cancel()\n singleOnChange(min)\n setInputValueNumber(min)\n }\n if (evt.key === \"End\") {\n evt.preventDefault()\n debouncedOnChange.cancel()\n singleOnChange(max)\n setInputValueNumber(max)\n }\n if (evt.key === \"ArrowUp\") {\n evt.preventDefault()\n const multiplier = evt.shiftKey ? 10 : 1\n const next = clamp(singleValue + step * multiplier, min, max)\n debouncedOnChange.cancel()\n singleOnChange(next)\n setInputValueNumber(next)\n }\n if (evt.key === \"ArrowDown\") {\n evt.preventDefault()\n const multiplier = evt.shiftKey ? 10 : 1\n const next = clamp(singleValue - step * multiplier, min, max)\n debouncedOnChange.cancel()\n singleOnChange(next)\n setInputValueNumber(next)\n }\n if (evt.key === \"Enter\" || evt.key === \"Escape\") {\n evt.preventDefault()\n evt.currentTarget.blur()\n }\n }\n\n const handleInputChange: ChangeEventHandler<HTMLInputElement> = (evt) => {\n if (disabled || isRange || !singleOnChange) return\n // Mobile decimal keyboards may use a comma. A minus is valid only below zero.\n const nextValue = evt.currentTarget.value.trim().replace(/,/g, \".\").replace(min < 0 ? /(?!^-)[^\\d.]/g : /[^\\d.]/g, \"\")\n debouncedOnChange.cancel()\n let parsed = parseFloat(nextValue || \"0\")\n if (Number.isNaN(parsed)) {\n // A lone \"-\" or \".\" is a number still being typed: nothing to report yet\n setInputValue(nextValue)\n return\n }\n parsed = clamp(parsed, min, max)\n if (step >= 1) {\n parsed = Math.floor(parsed)\n }\n debouncedOnChange(parsed)\n setInputValue(nextValue)\n }\n\n const handleInputBlur: FocusEventHandler<HTMLInputElement> = (evt) => {\n if (isRange || !singleOnChange) return\n // Blur commits the typed text, so its pending debounced change is dropped\n debouncedOnChange.cancel()\n if (disabled) {\n setInputValueNumber(singleValue)\n onBlur?.(evt)\n return\n }\n let parsed = parseFloat(evt.target.value.trim().replace(/,/g, \".\")) || 0\n if (step >= 1) {\n parsed = Math.floor(parsed)\n } else {\n parsed = round(parsed, precision)\n }\n parsed = clamp(parsed, min, max)\n if (parsed !== singleValue) {\n singleOnChange(parsed)\n }\n setInputValueNumber(parsed)\n onBlur?.(evt)\n }\n\n // Radix value/onChange wiring\n const radixValue = isRange ? (value as number[]) : [value as number]\n const handleValueChange = (values: number[]) => {\n if (disabled) return\n debouncedOnChange.cancel()\n if (isRange) (onChange as (v: number[]) => void)(values)\n else (onChange as (v: number) => void)(values[0])\n }\n\n // Single-mode props\n const resetValue = !isRange ? (props as SingleSliderProps).resetValue : undefined\n const resetTooltip = !isRange\n ? (props as SingleSliderProps).resetTooltip ?? \"Reset to default\"\n : undefined\n\n // Range-mode props\n const minStepsBetweenThumbs = isRange\n ? (props as RangeSliderProps).minStepsBetweenThumbs\n : undefined\n\n // Show marks only in horizontal orientation\n const showMarks = marks.length > 0 && !isVertical\n\n // Format range display text\n const rangeDisplayText = isRange\n ? (value as number[])\n .map((v) => `${prefixUnit ?? \"\"}${v.toFixed(precision)}${unit ?? \"\"}`)\n .join(\" – \")\n : \"\"\n\n return (\n <div\n className={clsx(s.SliderWrap, className)}\n data-orientation={orientation}\n >\n {label && (\n <div className={s.SliderLabel}>\n {/* Range mode renders no value input, so the label only names the thumbs */}\n <label htmlFor={isRange ? undefined : id} id={labelId} className=\"flex-1\">\n {label}\n </label>\n {!isRange && resetValue !== undefined && (\n <Tooltip content={resetTooltip!} compact>\n {/* A phone draws the reset as the small round gray button of the iOS 27 kit beside the row's value:\n uniform and soft, touch.css makes it the 28px circle that takes touches 44px around it. A desktop\n one is the bare glyph that shows on hover. */}\n <Button\n size=\"2xs\"\n variant={tabletAndUp ? \"ghost\" : \"soft\"}\n color=\"secondary\"\n uniform={!tabletAndUp}\n pill={!tabletAndUp}\n className={s.Reset}\n aria-label={resetTooltip}\n disabled={disabled}\n data-hide={disabled || (resetValue === singleValue && !pointerDown)}\n onClick={() => {\n if (disabled) return\n debouncedOnChange.cancel()\n singleOnChange?.(resetValue)\n setResetPending(true)\n }}\n >\n <Reload />\n </Button>\n </Tooltip>\n )}\n {isRange ? (\n <span className={s.RangeDisplay}>{rangeDisplayText}</span>\n ) : (\n <div className={s.SliderValue} onClick={() => { if (!disabled) inputRef.current?.focus() }}>\n {prefixUnit && <span className={s.ValueUnit}>{prefixUnit}</span>}\n <input\n id={id}\n className={s.ValueInput}\n ref={inputRef}\n style={{ width: inputWidth }}\n onKeyDown={handleKeyDown}\n value={inputValue}\n type=\"text\"\n inputMode={min < 0 ? \"text\" : Number.isInteger(min) && Number.isInteger(max) && Number.isInteger(step) ? \"numeric\" : \"decimal\"}\n onClick={(e) => e.stopPropagation()}\n onBlur={handleInputBlur}\n onFocus={(e) => {\n e.currentTarget.setSelectionRange(0, e.currentTarget.value.length)\n onFocus?.(e)\n }}\n onChange={handleInputChange}\n disabled={disabled}\n />\n {unit && <span className={s.ValueUnit}>{unit}</span>}\n </div>\n )}\n </div>\n )}\n <div className={s.SliderContainer}>\n <RadixSlider.Root\n ref={forwardedRef}\n className={s.Slider}\n onValueChange={handleValueChange}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n value={radixValue}\n orientation={orientation}\n minStepsBetweenThumbs={minStepsBetweenThumbs}\n onBlur={onBlur}\n onFocus={onFocus}\n onPointerDown={(event) => {\n if (disabled) return\n setPointerDown(true)\n releasePress.current?.()\n const { pointerId } = event\n const end = (lift: PointerEvent) => {\n if (lift.pointerId === pointerId) endPress()\n }\n window.addEventListener(\"pointerup\", end, true)\n window.addEventListener(\"pointercancel\", end, true)\n releasePress.current = () => {\n window.removeEventListener(\"pointerup\", end, true)\n window.removeEventListener(\"pointercancel\", end, true)\n }\n if (isRange) focusThumbToMove(event.nativeEvent, event.currentTarget, radixValue, min, max, isVertical, direction === \"rtl\")\n }}\n onPointerUp={endPress}\n onPointerCancel={endPress}\n onLostPointerCapture={endPress}\n data-pressed={pointerDown ? \"\" : undefined}\n data-range={isRange ? \"\" : undefined}\n style={toCssVariables({\n \"slider-duration\": `${animationDurationMS}ms`,\n \"slider-track-color\": trackColor,\n \"slider-range-color\": rangeColor,\n })}\n >\n <RadixSlider.Track className={s.Track}>\n <RadixSlider.Range className={s.Range} />\n </RadixSlider.Track>\n {isRange ? (\n (value as number[]).map((_, i) => (\n <RadixSlider.Thumb\n key={i}\n id={`${id}-thumb-${i}`}\n className={s.Thumb}\n style={thumbPercentStyle((value as number[])[i], min, max)}\n // The marks measure the first thumb (all thumbs are the same size)\n ref={i === 0 ? thumbRef : undefined}\n // Name plus the thumb's own Radix name (\"Minimum\" / \"Maximum\"),\n // so the endpoints stay distinguishable\n aria-labelledby={nameId ? `${nameId} ${id}-thumb-${i}` : undefined}\n // Only pass aria-label when set: an explicit undefined would\n // replace the name Radix gives the thumb\n {...(!nameId && ariaLabel\n ? {\n \"aria-label\":\n `${ariaLabel} ${rangeThumbName(i, (value as number[]).length)}`.trim(),\n }\n : {})}\n />\n ))\n ) : (\n <RadixSlider.Thumb\n className={s.Thumb}\n style={thumbPercentStyle(value as number, min, max)}\n ref={thumbRef}\n aria-labelledby={nameId}\n {...(!nameId && ariaLabel ? { \"aria-label\": ariaLabel } : {})}\n />\n )}\n </RadixSlider.Root>\n {showMarks && <SliderMarks marks={marks} thumbRef={thumbRef} min={min} max={max} />}\n </div>\n </div>\n )\n})\nSlider.displayName = \"Slider\"\n\n// Matches the names Radix gives range thumbs on its own\nconst rangeThumbName = (index: number, count: number) =>\n count === 2 ? (index === 0 ? \"Minimum\" : \"Maximum\") : count > 2 ? `Value ${index + 1} of ${count}` : \"\"\n\ntype MarksProps = {\n marks: SliderMark[]\n thumbRef: React.RefObject<HTMLDivElement | null>\n min: number\n max: number\n}\n\n// The minimum difference we enforce between marks, in pixels\nconst MINIMUM_MARK_SPACING_PX = 16\n\nconst SliderMarks = memo(({ marks, thumbRef, min, max }: MarksProps) => {\n // We seperate the container and measure divs so that our resize observer\n // does not fire when we adjust the height of the marks container.\n const marksContainerRef = useRef<HTMLDivElement>(null)\n const measureRef = useRef<HTMLDivElement>(null)\n\n // We measure the width of the slider within this component so that sliders\n // without marks do not pay a performance penalty.\n // @ts-expect-error(2322) -- bug in types: https://github.com/juliencrn/usehooks-ts/issues/663\n const { width: sliderWidth } = useResizeObserver({ ref: measureRef })\n // The knob's travel changes at the phone breakpoint (Slider.module.css), also where the width stays\n const tabletAndUp = useBreakpoint(\"md\")\n\n useLayoutEffect(() => {\n // Impossible\n if (!thumbRef.current || !marksContainerRef.current) {\n return\n }\n\n const markElements = Array.from(\n marksContainerRef.current.querySelectorAll(\"[data-mark]\"),\n ) as HTMLDivElement[]\n\n // Its layout width: a pressed knob is scaled into the lens\n const thumbHalfWidth = thumbRef.current.offsetWidth / 2\n const clamped = getComputedStyle(thumbRef.current).getPropertyValue(\"--slider-thumb-travel\").trim() === \"clamped\"\n\n // Wipe all styles so we can accurately determine the positions of the marks\n markElements.forEach((markEl) => {\n markEl.style.width = \"\"\n markEl.style.display = \"\"\n })\n\n const positionMarks = () => {\n if (!sliderWidth) {\n return\n }\n\n markElements.forEach((markEl, index) => {\n const markValue = marks[index].value\n const valuePercent = (markValue - min) / (max - min)\n const markWidth = markEl.getBoundingClientRect().width\n const markHalfWidth = markWidth / 2\n\n // Under the knob's centre at the mark's value, accounting for the width of the mark itself\n let left = thumbCentre(valuePercent, sliderWidth, thumbHalfWidth, clamped) - markHalfWidth\n\n // Clamp to the left and right bounds of the container\n left = Math.max(0, Math.min(left, sliderWidth - markWidth))\n\n markEl.style.left = `${left}px`\n })\n }\n\n const marksHaveCollisions = () => {\n for (let i = 0; i < markElements.length - 1; i++) {\n const currentRect = markElements[i].getBoundingClientRect()\n const nextRect = markElements[i + 1].getBoundingClientRect()\n\n if (currentRect.right + MINIMUM_MARK_SPACING_PX > nextRect.left) {\n return true\n }\n }\n return false\n }\n\n positionMarks()\n\n // If we have collisions, try to wrap the content\n if (marksHaveCollisions()) {\n markElements.forEach((markEl) => {\n markEl.style.width = \"min-content\"\n })\n\n positionMarks()\n\n // Hide all marks if we still have collisions\n if (marksHaveCollisions()) {\n markElements.forEach((markEl) => {\n markEl.style.display = \"none\"\n })\n }\n }\n\n const tallestHeight = Math.max(\n ...markElements.map((markEl) => markEl.getBoundingClientRect().height),\n )\n\n // Give our container a height so that we allocate space on the page\n // for the marks and push down other content when we have to wrap\n marksContainerRef.current.style.height = tallestHeight > 0 ? `${tallestHeight}px` : \"\"\n // Placed against the slider's width: the marks show, at their own height (Slider.module.css)\n if (sliderWidth) marksContainerRef.current.dataset.measured = \"\"\n }, [marks, thumbRef, marksContainerRef, min, max, sliderWidth, tabletAndUp])\n\n return (\n <div className={s.MarksContainer} ref={marksContainerRef}>\n <div ref={measureRef}>\n {marks.map((mark) => (\n <div key={mark.value} className={s.Mark} data-mark>\n <span className={s.MarkLabel}>{mark.label}</span>\n </div>\n ))}\n </div>\n </div>\n )\n})\nSliderMarks.displayName = \"SliderMarks\"\n\n/**\n * The value field is as wide as its characters at any font size: tabular digits are one `ch` each, and a sign,\n * a decimal point or a separator about half of one, so a right-aligned value sits next to its prefix unit.\n */\nconst getValueWidth = (text: string): string => {\n const digits = text.replace(/[^0-9]/g, \"\").length\n return `calc(${Math.max(digits + (text.length - digits) / 2, 1)}ch + 1px)`\n}\n"]}
@@ -5,7 +5,7 @@ import { createContext, useCallback, useContext, useEffect, useLayoutEffect, use
5
5
  import s from "@plexui/styles/components/TabBar/TabBar.module.css";
6
6
  import { useLatestValue } from "../../hooks/useLatestValue.js";
7
7
  import { Search as SearchIcon } from "../Icon/index.js";
8
- import { ToolbarHostContext } from "../Toolbar/Toolbar.js";
8
+ import { barBackground, ToolbarHostContext } from "../Toolbar/Toolbar.js";
9
9
  /** A scroll of at least this many pixels in one direction minimizes or expands the bar. */
10
10
  const MINIMIZE_AFTER = 8;
11
11
  const TabBarContext = createContext(null);
@@ -95,7 +95,7 @@ function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, pro
95
95
  const accessoryCapsule = hasAccessory && _jsx("div", { className: s.Accessory, children: accessory }, "accessory");
96
96
  const tabs = (_jsxs("div", { className: s.Tabs, children: [children, search && prominent && _jsx(TabBarItem, { value: search.value, label: search.label ?? "Search", icon: _jsx(SearchIcon, {}) })] }, "tabs"));
97
97
  const circle = prominent ? (_jsx(TabBarItem, { className: s.Prominent, value: prominent.value, label: prominent.label, icon: prominent.icon, hideLabel: true }, "prominent")) : search && (_jsx(TabBarItem, { className: s.Search, value: search.value, label: search.label ?? "Search", icon: _jsx(SearchIcon, {}), hideLabel: true }, "search"));
98
- return (_jsx("nav", { ref: setRef, "aria-label": ariaLabel, className: clsx(s.TabBar, className), "data-host": host?.kind, "data-background": background, "data-content-below": host?.contentBelow ? "" : undefined, "data-minimized": minimized ? "" : undefined, "data-search": search && !prominent ? "" : undefined, "data-prominent": prominent ? "" : undefined, "data-accessory": hasAccessory ? "" : undefined, children: _jsx(TabBarContext.Provider, { value: context, children: minimized ? [tabs, accessoryCapsule, circle] : [accessoryCapsule, tabs, circle] }) }));
98
+ return (_jsx("nav", { ref: setRef, "aria-label": ariaLabel, className: clsx(s.TabBar, className), "data-host": host?.kind, "data-background": barBackground(background), "data-content-below": host?.contentBelow ? "" : undefined, "data-minimized": minimized ? "" : undefined, "data-search": search && !prominent ? "" : undefined, "data-prominent": prominent ? "" : undefined, "data-accessory": hasAccessory ? "" : undefined, children: _jsx(TabBarContext.Provider, { value: context, children: minimized ? [tabs, accessoryCapsule, circle] : [accessoryCapsule, tabs, circle] }) }));
99
99
  }
100
100
  TabBarRoot.displayName = "TabBar";
101
101
  /** A badge shows unless it is empty: nothing, false, an empty text or a count of 0 (iOS hides `.badge(0)`). */
@@ -1 +1 @@
1
- {"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../../../../src/components/TabBar/TabBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,CAAC,MAAM,oDAAoD,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAsB,MAAM,oBAAoB,CAAA;AAE3E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;QAC1C,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,WAAW;KACvB,CAAA;IACD,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ;QAAE,OAAO,YAAG,IAAI,EAAE,IAAI,KAAM,KAAK,YAAG,OAAO,GAAK,CAAA;IACnF,OAAO,iBAAQ,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,KAAM,KAAK,YAAG,OAAO,GAAU,CAAA;AAChF,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport s from \"@plexui/styles/components/TabBar/TabBar.module.css\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { Search as SearchIcon } from \"../Icon\"\nimport { ToolbarHostContext, type BarBackground } from \"../Toolbar/Toolbar\"\n\n/** A scroll of at least this many pixels in one direction minimizes or expands the bar. */\nconst MINIMIZE_AFTER = 8\n\ntype TabBarContextValue = {\n value: string | undefined\n minimized: boolean\n select: (value: string) => void\n expand: () => void\n}\n\nconst TabBarContext = createContext<TabBarContextValue | null>(null)\n\nfunction useTabBarContext(part: string) {\n const context = useContext(TabBarContext)\n if (!context) throw new Error(`${part} must be used within TabBar`)\n return context\n}\n\nexport type TabBarSearch = {\n /** The value of the search tab. */\n value: string\n /** Accessible name of the search tab. @default \"Search\" */\n label?: string\n}\n\nexport type TabBarProminent = {\n /** The value of the prominent tab. */\n value: string\n /** Accessible name of the prominent tab: its circle shows the symbol only. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n}\n\nexport type TabBarProps = {\n /** The controlled value of the selected tab. Use with `onValueChange`. */\n value?: string\n /** The selected tab when it is initially rendered. */\n defaultValue?: string\n /** Called with the value of the tab a person selects. */\n onValueChange?: (value: string) => void\n /** A search tab in a glass circle of its own at the trailing end, as the iOS 26 separate search tab. */\n search?: TabBarSearch\n /**\n * The one destination the app lifts out of the capsule, a cart or a library, in a glass circle of its own at\n * the trailing end, as the iOS 27 prominent tab role. It takes the circle of the search tab: with both, search\n * is the last tab of the capsule, as iOS gives search that place only when no other tab is prominent.\n */\n prominent?: TabBarProminent\n /**\n * `onScrollDown` minimizes the bar to the selected tab while the content of the `Page` scrolls down and\n * expands it when the content scrolls back up; a tap on the minimized tab expands it too. @default \"never\"\n */\n minimizeBehavior?: \"never\" | \"onScrollDown\"\n /** Controlled minimized state. Use with `onMinimizedChange`. */\n minimized?: boolean\n /** The minimized state when it is initially rendered. @default false */\n defaultMinimized?: boolean\n /** Called when the bar minimizes or expands. */\n onMinimizedChange?: (minimized: boolean) => void\n /** How the bar meets the content scrolled under it; see `BarBackground`. @default \"soft\" */\n background?: BarBackground\n /**\n * Content in a glass capsule above the tabs, a now playing row or a status, as the iOS 27 bottom accessory;\n * minimized, it stands between the two circles. The bar grows by its height.\n */\n accessory?: ReactNode\n /** Accessible name of the navigation. @default \"Tabs\" */\n \"aria-label\"?: string\n /** `TabBar.Item` elements. */\n children?: ReactNode\n /** CSS classes applied to the bar */\n className?: string\n ref?: Ref<HTMLElement>\n}\n\n/**\n * The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a\n * symbol over a label, in a floating glass capsule at the bottom, the selected tab on a pill, and an optional\n * search or prominent tab in a circle of its own. It minimizes to the selected tab while the content scrolls\n * down. A desktop layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.\n */\nfunction TabBarRoot({\n value: valueProp,\n defaultValue,\n onValueChange,\n search,\n prominent,\n minimizeBehavior = \"never\",\n minimized: minimizedProp,\n defaultMinimized = false,\n onMinimizedChange,\n background = \"soft\",\n accessory,\n \"aria-label\": ariaLabel = \"Tabs\",\n children,\n className,\n ref,\n}: TabBarProps) {\n const host = useContext(ToolbarHostContext)\n const [internalValue, setInternalValue] = useState(defaultValue)\n const value = valueProp ?? internalValue\n const [internalMinimized, setInternalMinimized] = useState(defaultMinimized)\n const minimized = minimizedProp ?? internalMinimized\n const onValueChangeRef = useLatestValue(onValueChange)\n const onMinimizedChangeRef = useLatestValue(onMinimizedChange)\n const minimizedRef = useLatestValue(minimized)\n const controlledMinimized = minimizedProp !== undefined\n\n const select = useCallback((next: string) => {\n if (valueProp === undefined) setInternalValue(next)\n onValueChangeRef.current?.(next)\n }, [valueProp, onValueChangeRef])\n\n const setMinimized = useCallback((next: boolean) => {\n if (next === minimizedRef.current) return\n // A controlled state changes only when the owner passes it back.\n if (!controlledMinimized) {\n minimizedRef.current = next\n setInternalMinimized(next)\n }\n onMinimizedChangeRef.current?.(next)\n }, [controlledMinimized, minimizedRef, onMinimizedChangeRef])\n\n const expand = useCallback(() => setMinimized(false), [setMinimized])\n\n // The bar follows the Page content: down by MINIMIZE_AFTER minimizes it, up by as much (or the top) expands it.\n const subscribeScroll = host?.subscribeScroll\n useEffect(() => {\n if (minimizeBehavior !== \"onScrollDown\" || !subscribeScroll) return\n let anchor = 0\n return subscribeScroll((scrollTop) => {\n if (scrollTop <= 0) {\n anchor = 0\n return setMinimized(false)\n }\n const delta = scrollTop - anchor\n if (minimizedRef.current ? delta < 0 : delta > 0) {\n if (Math.abs(delta) >= MINIMIZE_AFTER) {\n anchor = scrollTop\n setMinimized(!minimizedRef.current)\n }\n return\n }\n anchor = scrollTop\n })\n }, [minimizeBehavior, subscribeScroll, setMinimized, minimizedRef])\n\n const element = useRef<HTMLElement | null>(null)\n const setRef = useCallback((node: HTMLElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n\n // Like a bottom Toolbar, the bar reserves its height on the Page; a desktop layout hides it.\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n const update = () => setHeight(\"bottom\", 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(\"bottom\", undefined) }\n }, [setHeight])\n\n const context = { value, minimized, select, expand }\n // `accessory={playing && <NowPlaying />}` leaves no empty capsule when nothing plays.\n const hasAccessory = accessory != null && typeof accessory !== \"boolean\" && accessory !== \"\"\n const accessoryCapsule = hasAccessory && <div key=\"accessory\" className={s.Accessory}>{accessory}</div>\n const tabs = (\n <div key=\"tabs\" className={s.Tabs}>\n {children}\n {search && prominent && <TabBarItem value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} />}\n </div>\n )\n const circle = prominent ? (\n <TabBarItem key=\"prominent\" className={s.Prominent} value={prominent.value} label={prominent.label} icon={prominent.icon} hideLabel />\n ) : search && (\n <TabBarItem key=\"search\" className={s.Search} value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} hideLabel />\n )\n\n return (\n <nav\n ref={setRef}\n aria-label={ariaLabel}\n className={clsx(s.TabBar, className)}\n data-host={host?.kind}\n data-background={background}\n data-content-below={host?.contentBelow ? \"\" : undefined}\n data-minimized={minimized ? \"\" : undefined}\n data-search={search && !prominent ? \"\" : undefined}\n data-prominent={prominent ? \"\" : undefined}\n data-accessory={hasAccessory ? \"\" : undefined}\n >\n <TabBarContext.Provider value={context}>\n {/* The accessory is read where it stands: above the tabs, and minimized between the two circles. The keys\n move it there without remounting its content. */}\n {minimized ? [tabs, accessoryCapsule, circle] : [accessoryCapsule, tabs, circle]}\n </TabBarContext.Provider>\n </nav>\n )\n}\nTabBarRoot.displayName = \"TabBar\"\n\nexport type TabBarItemProps = {\n /** The value of the tab. */\n value: string\n /** The label under the symbol, and the accessible name of the tab. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n /**\n * A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.\n * A count of 0 shows none, as on iOS.\n */\n badge?: ReactNode\n /** Makes the tab a link to this URL. */\n href?: string\n /** When `true`, the tab cannot be selected. */\n disabled?: boolean\n /** Called when the tab is pressed, before it is selected. */\n onClick?: (event: MouseEvent<HTMLElement>) => void\n /** CSS classes applied to the tab */\n className?: string\n /** @internal The search and the prominent tab show their symbol only. */\n hideLabel?: boolean\n}\n\n/** A badge shows unless it is empty: nothing, false, an empty text or a count of 0 (iOS hides `.badge(0)`). */\nconst hasBadge = (badge: ReactNode) => badge != null && badge !== false && badge !== \"\" && badge !== 0\n\nfunction TabBarItem({ value, label, icon, badge, href, disabled = false, onClick, className, hideLabel = false }: TabBarItemProps) {\n const context = useTabBarContext(\"TabBar.Item\")\n const selected = context.value === value\n // A minimized bar shows the selected tab only; pressing it brings the other tabs back.\n const collapsed = context.minimized && selected && !hideLabel\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n onClick?.(event)\n if (event.defaultPrevented || disabled) return\n if (collapsed) {\n event.preventDefault()\n return context.expand()\n }\n context.select(value)\n }\n const content = (\n <>\n <span className={s.Icon} aria-hidden=\"true\">{icon}</span>\n {!hideLabel && <span className={s.Label}>{label}</span>}\n {/* The space keeps the accessible name \"Inbox 3\", not \"Inbox3\". */}\n {hasBadge(badge) && <>{\" \"}<span className={s.Badge}>{badge}</span></>}\n </>\n )\n const props = {\n \"className\": clsx(s.Item, className),\n \"aria-current\": selected ? (\"page\" as const) : undefined,\n \"aria-label\": hideLabel ? label : undefined,\n \"aria-expanded\": collapsed ? false : undefined,\n \"data-selected\": selected ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-value\": value,\n \"onClick\": handleClick,\n }\n if (href !== undefined && !disabled) return <a href={href} {...props}>{content}</a>\n return <button type=\"button\" disabled={disabled} {...props}>{content}</button>\n}\nTabBarItem.displayName = \"TabBar.Item\"\n\nexport const TabBar = Object.assign(TabBarRoot, { Item: TabBarItem })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YAAG,KAAK,GAAQ,IAAG,IACrE,CACJ,CAAA;IACD,MAAM,KAAK,GAAG;QACZ,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC;QACpC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;QACxD,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAC3C,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAC9C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,WAAW;KACvB,CAAA;IACD,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ;QAAE,OAAO,YAAG,IAAI,EAAE,IAAI,KAAM,KAAK,YAAG,OAAO,GAAK,CAAA;IACnF,OAAO,iBAAQ,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,KAAM,KAAK,YAAG,OAAO,GAAU,CAAA;AAChF,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport s from \"@plexui/styles/components/TabBar/TabBar.module.css\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { Search as SearchIcon } from \"../Icon\"\nimport { barBackground, ToolbarHostContext, type BarBackground, type BarBackgroundAlias } from \"../Toolbar/Toolbar\"\n\n/** A scroll of at least this many pixels in one direction minimizes or expands the bar. */\nconst MINIMIZE_AFTER = 8\n\ntype TabBarContextValue = {\n value: string | undefined\n minimized: boolean\n select: (value: string) => void\n expand: () => void\n}\n\nconst TabBarContext = createContext<TabBarContextValue | null>(null)\n\nfunction useTabBarContext(part: string) {\n const context = useContext(TabBarContext)\n if (!context) throw new Error(`${part} must be used within TabBar`)\n return context\n}\n\nexport type TabBarSearch = {\n /** The value of the search tab. */\n value: string\n /** Accessible name of the search tab. @default \"Search\" */\n label?: string\n}\n\nexport type TabBarProminent = {\n /** The value of the prominent tab. */\n value: string\n /** Accessible name of the prominent tab: its circle shows the symbol only. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n}\n\nexport type TabBarProps = {\n /** The controlled value of the selected tab. Use with `onValueChange`. */\n value?: string\n /** The selected tab when it is initially rendered. */\n defaultValue?: string\n /** Called with the value of the tab a person selects. */\n onValueChange?: (value: string) => void\n /** A search tab in a glass circle of its own at the trailing end, as the iOS 26 separate search tab. */\n search?: TabBarSearch\n /**\n * The one destination the app lifts out of the capsule, a cart or a library, in a glass circle of its own at\n * the trailing end, as the iOS 27 prominent tab role. It takes the circle of the search tab: with both, search\n * is the last tab of the capsule, as iOS gives search that place only when no other tab is prominent.\n */\n prominent?: TabBarProminent\n /**\n * `onScrollDown` minimizes the bar to the selected tab while the content of the `Page` scrolls down and\n * expands it when the content scrolls back up; a tap on the minimized tab expands it too. @default \"never\"\n */\n minimizeBehavior?: \"never\" | \"onScrollDown\"\n /** Controlled minimized state. Use with `onMinimizedChange`. */\n minimized?: boolean\n /** The minimized state when it is initially rendered. @default false */\n defaultMinimized?: boolean\n /** Called when the bar minimizes or expands. */\n onMinimizedChange?: (minimized: boolean) => void\n /** How the bar meets the content scrolled under it; see `BarBackground` (`\"solid\"` is the earlier name of `\"hard\"`). @default \"soft\" */\n background?: BarBackground | BarBackgroundAlias\n /**\n * Content in a glass capsule above the tabs, a now playing row or a status, as the iOS 27 bottom accessory;\n * minimized, it stands between the two circles. The bar grows by its height.\n */\n accessory?: ReactNode\n /** Accessible name of the navigation. @default \"Tabs\" */\n \"aria-label\"?: string\n /** `TabBar.Item` elements. */\n children?: ReactNode\n /** CSS classes applied to the bar */\n className?: string\n ref?: Ref<HTMLElement>\n}\n\n/**\n * The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a\n * symbol over a label, in a floating glass capsule at the bottom, the selected tab on a pill, and an optional\n * search or prominent tab in a circle of its own. It minimizes to the selected tab while the content scrolls\n * down. A desktop layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.\n */\nfunction TabBarRoot({\n value: valueProp,\n defaultValue,\n onValueChange,\n search,\n prominent,\n minimizeBehavior = \"never\",\n minimized: minimizedProp,\n defaultMinimized = false,\n onMinimizedChange,\n background = \"soft\",\n accessory,\n \"aria-label\": ariaLabel = \"Tabs\",\n children,\n className,\n ref,\n}: TabBarProps) {\n const host = useContext(ToolbarHostContext)\n const [internalValue, setInternalValue] = useState(defaultValue)\n const value = valueProp ?? internalValue\n const [internalMinimized, setInternalMinimized] = useState(defaultMinimized)\n const minimized = minimizedProp ?? internalMinimized\n const onValueChangeRef = useLatestValue(onValueChange)\n const onMinimizedChangeRef = useLatestValue(onMinimizedChange)\n const minimizedRef = useLatestValue(minimized)\n const controlledMinimized = minimizedProp !== undefined\n\n const select = useCallback((next: string) => {\n if (valueProp === undefined) setInternalValue(next)\n onValueChangeRef.current?.(next)\n }, [valueProp, onValueChangeRef])\n\n const setMinimized = useCallback((next: boolean) => {\n if (next === minimizedRef.current) return\n // A controlled state changes only when the owner passes it back.\n if (!controlledMinimized) {\n minimizedRef.current = next\n setInternalMinimized(next)\n }\n onMinimizedChangeRef.current?.(next)\n }, [controlledMinimized, minimizedRef, onMinimizedChangeRef])\n\n const expand = useCallback(() => setMinimized(false), [setMinimized])\n\n // The bar follows the Page content: down by MINIMIZE_AFTER minimizes it, up by as much (or the top) expands it.\n const subscribeScroll = host?.subscribeScroll\n useEffect(() => {\n if (minimizeBehavior !== \"onScrollDown\" || !subscribeScroll) return\n let anchor = 0\n return subscribeScroll((scrollTop) => {\n if (scrollTop <= 0) {\n anchor = 0\n return setMinimized(false)\n }\n const delta = scrollTop - anchor\n if (minimizedRef.current ? delta < 0 : delta > 0) {\n if (Math.abs(delta) >= MINIMIZE_AFTER) {\n anchor = scrollTop\n setMinimized(!minimizedRef.current)\n }\n return\n }\n anchor = scrollTop\n })\n }, [minimizeBehavior, subscribeScroll, setMinimized, minimizedRef])\n\n const element = useRef<HTMLElement | null>(null)\n const setRef = useCallback((node: HTMLElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n\n // Like a bottom Toolbar, the bar reserves its height on the Page; a desktop layout hides it.\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n const update = () => setHeight(\"bottom\", 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(\"bottom\", undefined) }\n }, [setHeight])\n\n const context = { value, minimized, select, expand }\n // `accessory={playing && <NowPlaying />}` leaves no empty capsule when nothing plays.\n const hasAccessory = accessory != null && typeof accessory !== \"boolean\" && accessory !== \"\"\n const accessoryCapsule = hasAccessory && <div key=\"accessory\" className={s.Accessory}>{accessory}</div>\n const tabs = (\n <div key=\"tabs\" className={s.Tabs}>\n {children}\n {search && prominent && <TabBarItem value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} />}\n </div>\n )\n const circle = prominent ? (\n <TabBarItem key=\"prominent\" className={s.Prominent} value={prominent.value} label={prominent.label} icon={prominent.icon} hideLabel />\n ) : search && (\n <TabBarItem key=\"search\" className={s.Search} value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} hideLabel />\n )\n\n return (\n <nav\n ref={setRef}\n aria-label={ariaLabel}\n className={clsx(s.TabBar, className)}\n data-host={host?.kind}\n data-background={barBackground(background)}\n data-content-below={host?.contentBelow ? \"\" : undefined}\n data-minimized={minimized ? \"\" : undefined}\n data-search={search && !prominent ? \"\" : undefined}\n data-prominent={prominent ? \"\" : undefined}\n data-accessory={hasAccessory ? \"\" : undefined}\n >\n <TabBarContext.Provider value={context}>\n {/* The accessory is read where it stands: above the tabs, and minimized between the two circles. The keys\n move it there without remounting its content. */}\n {minimized ? [tabs, accessoryCapsule, circle] : [accessoryCapsule, tabs, circle]}\n </TabBarContext.Provider>\n </nav>\n )\n}\nTabBarRoot.displayName = \"TabBar\"\n\nexport type TabBarItemProps = {\n /** The value of the tab. */\n value: string\n /** The label under the symbol, and the accessible name of the tab. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n /**\n * A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.\n * A count of 0 shows none, as on iOS.\n */\n badge?: ReactNode\n /** Makes the tab a link to this URL. */\n href?: string\n /** When `true`, the tab cannot be selected. */\n disabled?: boolean\n /** Called when the tab is pressed, before it is selected. */\n onClick?: (event: MouseEvent<HTMLElement>) => void\n /** CSS classes applied to the tab */\n className?: string\n /** @internal The search and the prominent tab show their symbol only. */\n hideLabel?: boolean\n}\n\n/** A badge shows unless it is empty: nothing, false, an empty text or a count of 0 (iOS hides `.badge(0)`). */\nconst hasBadge = (badge: ReactNode) => badge != null && badge !== false && badge !== \"\" && badge !== 0\n\nfunction TabBarItem({ value, label, icon, badge, href, disabled = false, onClick, className, hideLabel = false }: TabBarItemProps) {\n const context = useTabBarContext(\"TabBar.Item\")\n const selected = context.value === value\n // A minimized bar shows the selected tab only; pressing it brings the other tabs back.\n const collapsed = context.minimized && selected && !hideLabel\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n onClick?.(event)\n if (event.defaultPrevented || disabled) return\n if (collapsed) {\n event.preventDefault()\n return context.expand()\n }\n context.select(value)\n }\n const content = (\n <>\n <span className={s.Icon} aria-hidden=\"true\">{icon}</span>\n {!hideLabel && <span className={s.Label}>{label}</span>}\n {/* The space keeps the accessible name \"Inbox 3\", not \"Inbox3\". */}\n {hasBadge(badge) && <>{\" \"}<span className={s.Badge}>{badge}</span></>}\n </>\n )\n const props = {\n \"className\": clsx(s.Item, className),\n \"aria-current\": selected ? (\"page\" as const) : undefined,\n \"aria-label\": hideLabel ? label : undefined,\n \"aria-expanded\": collapsed ? false : undefined,\n \"data-selected\": selected ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-value\": value,\n \"onClick\": handleClick,\n }\n if (href !== undefined && !disabled) return <a href={href} {...props}>{content}</a>\n return <button type=\"button\" disabled={disabled} {...props}>{content}</button>\n}\nTabBarItem.displayName = \"TabBar.Item\"\n\nexport const TabBar = Object.assign(TabBarRoot, { Item: TabBarItem })\n"]}
@@ -10,6 +10,7 @@ import { CheckMd, ChevronDownMd } from "../Icon/index.js";
10
10
  import { LoadingIndicator } from "../Indicator/index.js";
11
11
  import { Menu } from "../Menu/index.js";
12
12
  import { visibleTabCount } from "./overflow.js";
13
+ import { equalizeSegments, watchSegments } from "./segments.js";
13
14
  import s from "@plexui/styles/components/Tabs/Tabs.module.css";
14
15
  /** Vertical tabs are a list on a phone, where the selected row shows a checkmark */
15
16
  const TabsVerticalContext = createContext(false);
@@ -126,6 +127,29 @@ const TabsRoot = ({ value, onChange, children, variant = "segmented", orientatio
126
127
  observer.observe(root, { childList: true, characterData: true, subtree: true });
127
128
  return () => observer.disconnect();
128
129
  }, [applyThumbSizing]);
130
+ // A phone's segmented control at its own width gives every segment the widest one's width, as UISegmentedControl
131
+ // does in iOS 27.2; where that does not fit, each segment takes its label and the same air around it, as
132
+ // apportionsSegmentWidthsByContent does (ref-app segmented-hug, 13.11). A grid that hugs its content cannot take the
133
+ // widest track for each by itself, so this measures it. Runs before the thumb measures (declared first).
134
+ useLayoutEffect(() => {
135
+ equalizeSegments(rootRef.current, thumbRef.current);
136
+ });
137
+ useEffect(() => {
138
+ const root = rootRef.current;
139
+ if (!root)
140
+ return;
141
+ // The room, the breakpoint or the font changes. The segments can change without the control changing size, so the
142
+ // thumb follows them here, instantly, like a resize.
143
+ return watchSegments(root, () => thumbRef.current, () => {
144
+ const thumb = thumbRef.current;
145
+ if (!thumb)
146
+ return;
147
+ const currentTransition = thumb.style.transition;
148
+ thumb.style.transition = "";
149
+ applyThumbSizing(false);
150
+ thumb.style.transition = currentTransition;
151
+ });
152
+ }, [applyThumbSizing]);
129
153
  const transitionProperty = isVertical
130
154
  ? "height var(--tabs-thumb-transition-duration, 200ms) var(--tabs-thumb-transition-easing, var(--cubic-enter)), transform var(--tabs-thumb-transition-duration, 200ms) var(--tabs-thumb-transition-easing, var(--cubic-enter))"
131
155
  : "width var(--tabs-thumb-transition-duration, 200ms) var(--tabs-thumb-transition-easing, var(--cubic-enter)), transform var(--tabs-thumb-transition-duration, 200ms) var(--tabs-thumb-transition-easing, var(--cubic-enter))";