@kanso-labs/kanso-ui 0.47.1 → 0.47.3

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":"index.js","names":["_c","stylex","createContext","useContext","useId","useLayoutEffect","useRef","useState","useSyncExternalStore","HeadingContext","Dialog","useSlottedContext","useHoldBottomEdge","useScrollStop","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","sizing","typography","controlSm","headlineSmallLineHeight","FULL_SCREEN","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kHjlTd","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","HeaderContext","DescriptionContext","id","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","describe","generated","undefined","title","scrollStop","label","t2","merged","t3","modalBodyRing","t4","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","setBody","scrim","0","1","t5","t6","Symbol","for","modalDialog","t7","t8","t9","t10","t11","DialogFooter","useFullScreen","DialogHeader","DialogTitle","isHeaded","4","2","6","5","3","7","isFullScreen","window","matchMedia","matches","isFullScreenOnServer","subscribeToFullScreen","listener","query","addEventListener","removeEventListener","Body","Content","Footer","Header","Title","RACDialog"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DialogTriggerProps, HeadingProps, ModalOverlayProps, ModalRenderProps, DialogProps as RACDialogProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, Dialog as RACDialog, useSlottedContext } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollStop } from '../../hooks/useScrollStop';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a headline in a header reaches past its own line, above and below:\n// half of what the headline-small line lacks of a standard control's\n// height, which is 4 at the default tokens. The header gives the same back\n// out of its padding. See `header`.\nconst HEADLINE_REACH = `max(0px, calc((${sizing.controlSm} - ${typography.headlineSmallLineHeight}) / 2))`;\n\n// The window size the full-screen dialog is drawn at, which the styles read\n// as `media.belowMedium`. Spelled again for `matchMedia`, which is the one\n// thing in this file that has to know it outside a stylesheet: the footer\n// holds the window's bottom edge only there. See `useFullScreen`.\nconst FULL_SCREEN = '(width < 600px)';\n\n// The dialogs page's two dialogs, which are one component here for the same\n// reason Sheet's two presentations are: the page pairs them by window size\n// rather than offering a choice. Above the medium breakpoint it is the basic\n// dialog — a container on surface container high with a 28dp corner, between\n// 280 and 560dp wide, centred over the scrim, with 24dp of padding all round,\n// 16dp between the headline and the body and 24dp between the body and the\n// actions. Below it the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline and a\n// divider under it, and a 56dp action bar with a divider over it.\n//\n// The pairing is for a dialog that is a task, which needs the room. An alert\n// dialog is a question with two or three answers, and the page keeps the\n// full-screen dialog for tasks, so `role=\"alertdialog\"` stays the basic dialog\n// at every width. Filled to a phone's window it read as a headline at the top\n// of the screen and its answers at the bottom, with nothing between them but\n// the chrome. The `basic` styles below are how: each restates, without the\n// breakpoint, the properties the paired styles change below it.\n//\n// The headline is headline-small on surface, the body body-medium on surface\n// variant, and the buttons are the call site's — the page draws text buttons\n// there, which is `Button`'s `text` variant.\n//\n// Two things the page draws are the call site's rather than the component's.\n// The optional icon above the headline, which the page centres the headline\n// and body with when it is there, is anything a `Dialog.Header` is given; a\n// dialog that wants it centres its own header. And the dividers a basic\n// dialog may show around a scrolling body are left out, since the page has\n// them only for that case and the body here scrolls with the header and\n// footer pinned either side of it, which is what they were marking.\n//\n// React Aria's overlay is three nested elements — the scrim, the container,\n// and the dialog inside it — so the styles split the same way, and the scrim\n// and the element carrying the dialog role are the ones every modal overlay\n// shares.\nconst scaleIn = \"xnirehn-B\";\nconst slideInFromBottom = \"x1itx4s0-B\";\nconst styles = {\n body: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kHjlTd: \"xj0a0fe\",\n kORKVm: \"x1odjw0f\",\n kGO01o: \"x1az23kl x18d9i69\",\n kLKAdn: \"x886u18 xexx8yu x3reb9c\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1apw6a7 xd76zvj\",\n $$css: true\n }\n};\n\n// The basic dialog at every width, for an alert dialog. Each entry is the\n// above-breakpoint value of every property its namesake in `styles` changes\n// below the breakpoint, laid over that namesake, so a property it leaves out\n// is the same in both presentations already. A value changed above the\n// breakpoint there has to change here too, which `index.test.tsx` checks by\n// comparing an alert dialog on a phone with any dialog on a desktop.\nconst basic = {\n body: {\n kLKAdn: \"x886u18 xexx8yu\",\n $$css: true\n },\n centre: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n }\n};\n\n// Whether this dialog is the basic one at every width. Content decides it from\n// the role and the parts read it, since each part carries its own share of\n// the full-screen presentation.\nconst BasicContext = createContext(false);\n\n// Whether a title sits in a header, which is what it reaches past its line\n// in; see `header`. Content clears it, so a dialog opened from inside a\n// header starts outside one.\nconst HeaderContext = createContext(false);\n\n// Where an alert dialog's body hands Content its id, so the dialog can name\n// the body as its description: the message an alert dialog interrupts with\n// is what a screen reader should read out with the title. Null in a dialog\n// of any other role, whose body may hold a form or a long document rather\n// than one message.\nconst DescriptionContext = createContext<((id: string | undefined) => void) | null>(null);\ntype DialogProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n};\n\n/**\n * A modal dialog centred over the page, and the same dialog filling the\n * window below the medium breakpoint — the dialogs page's basic and\n * full-screen dialogs, paired by window size as the page pairs them. An\n * alert dialog stays the basic one at every width. Open state is React\n * Aria's: pass `isOpen` with `onOpenChange` to control it, or\n * `defaultOpen` to let it keep its own.\n *\n * Composed rather than configured by props, as `Sheet` is, since a dialog's\n * header, body and actions all take arbitrary content — the parts are\n * `Dialog.Content`, `Dialog.Header`, `Dialog.Title`, `Dialog.Body` and\n * `Dialog.Footer`. A `Button` or `IconButton` placed directly inside\n * `Dialog` opens it, and one given `slot=\"close\"` anywhere inside the\n * content closes it; neither needs a part of its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open dialog</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * <IconButton aria-label=\"Close\" slot=\"close\">\n * <CloseIcon />\n * </IconButton>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">\n * Cancel\n * </Button>\n * <Button onPress={confirm} slot=\"close\" variant=\"text\">\n * Confirm\n * </Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * `Dialog` is the trigger's half, so a dialog nothing on the page opens — one\n * a route shows, or a menu item raises — leaves it out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no\n * button inside it, React Aria warns that its press responder found nothing\n * to press.\n *\n * Tab stays inside an open dialog, so a `Snackbar` shown meanwhile is\n * reached with F6, which React Aria uses to move between landmarks. Tabbing\n * on past the snackbar's last control leads back into the dialog.\n */\nfunction Dialog({\n children,\n ...props\n}: DialogProps) {\n return <DialogTrigger {...props}>{children}</DialogTrigger>;\n}\nfunction DialogBody({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const describe = useContext(DescriptionContext);\n const generated = useId();\n // An alert dialog's body describes the dialog, so it carries an id for the\n // dialog to point at: the call site's own, or one of its own. In a layout\n // effect, so the dialog carries its description from its first paint.\n const id = props.id ?? (describe === null ? undefined : generated);\n useLayoutEffect(() => {\n if (describe === null || id === undefined) {\n return undefined;\n }\n describe(id);\n return () => {\n describe(undefined);\n };\n }, [describe, id]);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop named by the title, so a\n // keyboard can scroll it, when nothing inside it takes focus; a call\n // site's own name, role and tabIndex still win. See useScrollStop.\n const title = useSlottedContext(HeadingContext, 'title');\n const scrollStop = useScrollStop(ref, {\n label: props['aria-label'],\n title: title?.id\n });\n // The body measures itself through its own ref, and the call site's lands\n // on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...scrollStop} id={id} {...props} ref={merged} {...mergeStyles(stylex.props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props)} />;\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the trigger stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n *\n * `role=\"alertdialog\"` is React Aria's, for a dialog interrupting with\n * something that has to be answered before the page carries on — a screen\n * reader announces it rather than waiting to be asked. It also keeps the\n * dialog the basic one below the medium breakpoint, centred and sized to its\n * content, where a dialog of the default role fills the window. Its\n * `Dialog.Body` is its description, so the message is read out with the\n * title; an `aria-describedby` of the call site's own names another.\n *\n * A press on the scrim closes the dialog unless `isDismissable` says\n * otherwise, which is the same default `Sheet` takes and the reverse of\n * React Aria's own. Escape is a separate prop, `isKeyboardDismissDisabled`,\n * and `isDismissable` says nothing about it — so a dialog that has to be\n * answered from one of its actions, as an alert dialog usually does, turns\n * off both.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own, with no\n * trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and\n * a `slot=\"close\"` button, Escape and the scrim all report through\n * `onOpenChange`, as they would to `Dialog`.\n *\n * The scrim draws at `z-index: 900`, over any page content layered below\n * that, such as a sticky header, and the panel draws inside it. A\n * `Snackbar` draws at 1000, so a toast raised from inside the dialog is read\n * over it, and React Aria's popovers and menus draw above both.\n */\nfunction DialogContent({\n children,\n className,\n container,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled,\n isOpen,\n onOpenChange,\n ref,\n style,\n ...props\n}: DialogContentProps & RefAttributes<HTMLDivElement>) {\n const isBasic = props.role === 'alertdialog';\n // The id of the body, which an alert dialog is described by unless the\n // call site names a description of its own.\n const [body, setBody] = useState<string>();\n return <BasicContext value={isBasic}>\n <DescriptionContext value={isBasic ? setBody : null}>\n <OverlayScope>\n <ModalOverlay defaultOpen={defaultOpen} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled} isOpen={isOpen} onOpenChange={onOpenChange}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre, isBasic && basic.centre)}>\n <Modal\n // The panel, where the call site's class and style land, rather\n // than the dialog inside it, which takes the rest of the props.\n ref={ref} {...mergeStatefulStyles({\n 0: {\n className: \"x1n1nwrg x1u6grsq xbhiib0 x1ebxanj x16dv9tl xvkjz1l xt7dq6l x1ju3lih x1w1tqly x19pkqky x1f120ba xx61lck x1gb867b x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r x27kpxv x6iovhr x1u2d2a2 xxzqys8 xb3r6kr x9xqwrn xg8iv3o x19b5e0v xsds98l\"\n },\n 1: {\n className: \"x1n1nwrg x1u6grsq x16dv9tl xvkjz1l x1w1tqly x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r xb3r6kr xbhiib0 xt7dq6l x19pkqky xx61lck x27kpxv x1u2d2a2\"\n }\n }[!!isBasic << 0], {\n className,\n style\n })}>\n <HeaderContext value={false}>\n <RACDialog {...props} aria-describedby={props['aria-describedby'] ?? (isBasic ? body : undefined)} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </HeaderContext>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </DescriptionContext>\n </BasicContext>;\n}\n\n/**\n * The dialog's actions. Full screen they are the action bar on the window's\n * bottom edge, which a toast rises clear of while the dialog is open, so a\n * tap meant for one of them never lands on the toast's own action instead.\n */\nfunction DialogFooter({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n useHoldBottomEdge(ref, useFullScreen() && !isBasic);\n // The footer measures itself through its own ref, and the call site's\n // lands on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...props} ref={merged} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x12smttz x1ejq31n x1vv4zg8 x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xnvi70j x8i8c5o x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x12smttz x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xg0ps1x x1ejq31n x8i8c5o x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\nfunction DialogHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n return <HeaderContext value>\n <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j x11wnguw x1pr6p50 x1837goc xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr x11wnguw x1837goc\"\n }\n }[!!isBasic << 0], props)} />\n </HeaderContext>;\n}\n\n/**\n * Names the dialog. Rendered through React Aria's title slot, which is what\n * points the dialog's `aria-labelledby` at it — a dialog without one\n * announces itself unnamed.\n */\nfunction DialogTitle(props: DialogTitleProps & RefAttributes<HTMLHeadingElement>) {\n const isBasic = useContext(BasicContext);\n const isHeaded = useContext(HeaderContext);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe\"\n },\n 4: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs\"\n },\n 2: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 6: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 5: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 3: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n },\n 7: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n }\n }[!!isHeaded << 2 | !!isBasic << 1 | !!(isBasic && isHeaded) << 0], props)} />;\n}\n\n// Whether the window is at the size the full-screen dialog is drawn at, kept\n// current as it resizes. False on the server, where there is no window and\n// nothing is open.\nfunction isFullScreen() {\n return window.matchMedia(FULL_SCREEN).matches;\n}\nfunction isFullScreenOnServer() {\n return false;\n}\nfunction subscribeToFullScreen(listener: () => void) {\n const query = window.matchMedia(FULL_SCREEN);\n query.addEventListener('change', listener);\n return () => {\n query.removeEventListener('change', listener);\n };\n}\nfunction useFullScreen() {\n return useSyncExternalStore(subscribeToFullScreen, isFullScreen, isFullScreenOnServer);\n}\nDialog.Body = DialogBody;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Header = DialogHeader;\nDialog.Title = DialogTitle;\n\n// The dialog's own props, plus the scrim's open state and dismissal settings\n// and the container's styling. A call site has no reason to know there are\n// three elements: `className` and `style` reach the container, which is the\n// one worth restyling, the open state and the dismissal settings reach the\n// scrim, and everything else lands on the dialog.\n//\n// `isDismissable` is declared here rather than picked with its siblings,\n// since the picked one carries React Aria's documentation, whose default is\n// the reverse of this component's.\ntype DialogContentProps = {\n /** A function may compute the class from the container's render state. */\n className?: ClassNameOrFunction<ModalRenderProps>;\n /**\n * Where to portal the dialog and scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the dialog on that scope's tokens, or\n * to the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the dialog renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. `true` here where React Aria's own default is `false`, the\n * same default `Sheet` takes. Escape is `isKeyboardDismissDisabled`'s,\n * and this says nothing about it — an alert dialog, which has to be\n * answered from one of its actions, turns off both.\n * @default true\n */\n isDismissable?: boolean;\n /** A function may compute the style from the container's render state. */\n style?: StyleOrFunction<ModalRenderProps>;\n} & Omit<RACDialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isKeyboardDismissDisabled' | 'isOpen' | 'onOpenChange'>;\ntype DialogTitleProps = HeadingProps;\nexport type { DialogContentProps, DialogProps, DialogTitleProps };\nexport { DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle };\nexport default Dialog;"],"mappings":";;;;;;;;;;;;;;AA0BuB,GAAkBkB,OAAOE,YAAeD,WAAWE;AAM1E,MAAMC,cAAc;AAsCpB,MAAMC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRhB,QAAQ;EACRiB,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;AACF;AAQA,MAAMK,QAAQ;CACZtB,MAAM;EACJe,QAAQ;EACRE,OAAO;CACT;CACAC,QAAQ;EACNG,QAAQ;EACRJ,OAAO;CACT;AACF;AAKA,MAAMM,eAAe7C,cAAc,K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QAAQtB"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useId","useLayoutEffect","useRef","useState","useSyncExternalStore","HeadingContext","Dialog","useSlottedContext","createPortal","useHoldBottomEdge","useScrollStop","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","sizing","typography","controlSm","headlineSmallLineHeight","FULL_SCREEN","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kHjlTd","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","HeaderContext","FooterSlotContext","SetFooterSlotContext","slot","DescriptionContext","id","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","describe","generated","undefined","title","scrollStop","label","t2","merged","t3","modalBodyRing","t4","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","setBody","setSlot","scrim","0","1","t5","t6","Symbol","for","modalDialog","t7","t8","t9","t10","t11","t12","DialogFooter","fullScreen","useFullScreen","footerSlot","footer","DialogHeader","setFooterSlot","DialogTitle","isHeaded","4","2","6","5","3","7","isFullScreen","window","matchMedia","matches","isFullScreenOnServer","subscribeToFullScreen","listener","query","addEventListener","removeEventListener","Body","Content","Footer","Header","Title","RACDialog"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DialogTriggerProps, HeadingProps, ModalOverlayProps, ModalRenderProps, DialogProps as RACDialogProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, Dialog as RACDialog, useSlottedContext } from 'react-aria-components';\nimport { createPortal } from 'react-dom';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollStop } from '../../hooks/useScrollStop';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a headline in a header reaches past its own line, above and below:\n// half of what the headline-small line lacks of a standard control's\n// height, which is 4 at the default tokens. The header gives the same back\n// out of its padding. See `header`.\nconst HEADLINE_REACH = `max(0px, calc((${sizing.controlSm} - ${typography.headlineSmallLineHeight}) / 2))`;\n\n// The window size the full-screen dialog is drawn at, which the styles read\n// as `media.belowMedium`. Spelled again for `matchMedia`, which is the one\n// thing in this file that has to know it outside a stylesheet: the footer's\n// actions are drawn in the header only there. See `useFullScreen`.\nconst FULL_SCREEN = '(width < 600px)';\n\n// The dialogs page's two dialogs, which are one component here for the same\n// reason Sheet's two presentations are: the page pairs them by window size\n// rather than offering a choice. Above the medium breakpoint it is the basic\n// dialog — a container on surface container high with a 28dp corner, between\n// 280 and 560dp wide, centred over the scrim, with 24dp of padding all round,\n// 16dp between the headline and the body and 24dp between the body and the\n// actions. Below it the same dialog fills the window as the page's\n// full-screen dialog: square corners and a 56dp header over a divider, which\n// leads with the close button, follows it with the headline, and ends in the\n// confirming action as a text button, with no action bar below the body.\n//\n// The full-screen header is drawn from the same parts as the basic dialog,\n// so a call site writes the dialog once. Whatever the header holds besides\n// its title, which is where a call site puts the close button, is drawn\n// before the title there, though written after it for the basic dialog,\n// where it trails. And `Dialog.Footer`'s actions are drawn at the header's\n// trailing end rather than in a bar: portalled into the header, so they come\n// after the close button and before the body in the order Tab reaches them\n// as well as on screen. A dialog with no header keeps the footer as a 56dp\n// action bar over a divider, since nothing above the body can take its\n// actions.\n//\n// The pairing is for a dialog that is a task, which needs the room. An alert\n// dialog is a question with two or three answers, and the page keeps the\n// full-screen dialog for tasks, so `role=\"alertdialog\"` stays the basic dialog\n// at every width. Filled to a phone's window it read as a headline at the top\n// of the screen and its answers at the bottom, with nothing between them but\n// the chrome. The `basic` styles below are how: each restates, without the\n// breakpoint, the properties the paired styles change below it.\n//\n// The headline is headline-small on surface, the body body-medium on surface\n// variant, and the buttons are the call site's — the page draws text buttons\n// there, which is `Button`'s `text` variant.\n//\n// Two things the page draws are the call site's rather than the component's.\n// The optional icon above the headline, which the page centres the headline\n// and body with when it is there, is anything a `Dialog.Header` is given; a\n// dialog that wants it centres its own header. And the dividers a basic\n// dialog may show around a scrolling body are left out, since the page has\n// them only for that case and the body here scrolls with the header and\n// footer pinned either side of it, which is what they were marking.\n//\n// React Aria's overlay is three nested elements — the scrim, the container,\n// and the dialog inside it — so the styles split the same way, and the scrim\n// and the element carrying the dialog role are the ones every modal overlay\n// shares.\nconst scaleIn = \"xnirehn-B\";\nconst slideInFromBottom = \"x1itx4s0-B\";\nconst styles = {\n body: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kHjlTd: \"xj0a0fe\",\n kORKVm: \"x1odjw0f\",\n kGO01o: \"x1az23kl x18d9i69\",\n kLKAdn: \"x886u18 xexx8yu x3reb9c\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1apw6a7 xd76zvj\",\n $$css: true\n }\n};\n\n// The basic dialog at every width, for an alert dialog. Each entry is the\n// above-breakpoint value of every property its namesake in `styles` changes\n// below the breakpoint, laid over that namesake, so a property it leaves out\n// is the same in both presentations already. A value changed above the\n// breakpoint there has to change here too, which `index.test.tsx` checks by\n// comparing an alert dialog on a phone with any dialog on a desktop.\nconst basic = {\n body: {\n kLKAdn: \"x886u18 xexx8yu\",\n $$css: true\n },\n centre: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n }\n};\n\n// Whether this dialog is the basic one at every width. Content decides it from\n// the role and the parts read it, since each part carries its own share of\n// the full-screen presentation.\nconst BasicContext = createContext(false);\n\n// Whether a title sits in a header, which is what it reaches past its line\n// in; see `header`. Content clears it, so a dialog opened from inside a\n// header starts outside one.\nconst HeaderContext = createContext(false);\n\n// Where the full-screen header holds the footer's actions: null while no\n// header is drawn full screen, which leaves the footer where it was written.\n// The header hands Content the element through the second.\nconst FooterSlotContext = createContext<HTMLDivElement | null>(null);\nconst SetFooterSlotContext = createContext<((slot: HTMLDivElement | null) => void) | null>(null);\n\n// Where an alert dialog's body hands Content its id, so the dialog can name\n// the body as its description: the message an alert dialog interrupts with\n// is what a screen reader should read out with the title. Null in a dialog\n// of any other role, whose body may hold a form or a long document rather\n// than one message.\nconst DescriptionContext = createContext<((id: string | undefined) => void) | null>(null);\ntype DialogProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n};\n\n/**\n * A modal dialog centred over the page, and the same dialog filling the\n * window below the medium breakpoint — the dialogs page's basic and\n * full-screen dialogs, paired by window size as the page pairs them. An\n * alert dialog stays the basic one at every width. Open state is React\n * Aria's: pass `isOpen` with `onOpenChange` to control it, or\n * `defaultOpen` to let it keep its own.\n *\n * Composed rather than configured by props, as `Sheet` is, since a dialog's\n * header, body and actions all take arbitrary content — the parts are\n * `Dialog.Content`, `Dialog.Header`, `Dialog.Title`, `Dialog.Body` and\n * `Dialog.Footer`. A `Button` or `IconButton` placed directly inside\n * `Dialog` opens it, and one given `slot=\"close\"` anywhere inside the\n * content closes it; neither needs a part of its own.\n *\n * Full screen, the header leads with its close button and ends in the\n * footer's actions, and there is no action bar: the full-screen dialog's\n * dismissive action is its close button, and its confirming one a text\n * button at the header's trailing end. A dialog that fills a phone's window\n * therefore gives its footer the confirming action alone, as below; a Cancel\n * beside it would be drawn in the header too.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open dialog</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * <IconButton aria-label=\"Close\" slot=\"close\">\n * <CloseIcon />\n * </IconButton>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button onPress={confirm} slot=\"close\" variant=\"text\">\n * Confirm\n * </Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * `Dialog` is the trigger's half, so a dialog nothing on the page opens — one\n * a route shows, or a menu item raises — leaves it out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no\n * button inside it, React Aria warns that its press responder found nothing\n * to press.\n *\n * Tab stays inside an open dialog, so a `Snackbar` shown meanwhile is\n * reached with F6, which React Aria uses to move between landmarks. Tabbing\n * on past the snackbar's last control leads back into the dialog.\n */\nfunction Dialog({\n children,\n ...props\n}: DialogProps) {\n return <DialogTrigger {...props}>{children}</DialogTrigger>;\n}\nfunction DialogBody({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const describe = useContext(DescriptionContext);\n const generated = useId();\n // An alert dialog's body describes the dialog, so it carries an id for the\n // dialog to point at: the call site's own, or one of its own. In a layout\n // effect, so the dialog carries its description from its first paint.\n const id = props.id ?? (describe === null ? undefined : generated);\n useLayoutEffect(() => {\n if (describe === null || id === undefined) {\n return undefined;\n }\n describe(id);\n return () => {\n describe(undefined);\n };\n }, [describe, id]);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop named by the title, so a\n // keyboard can scroll it, when nothing inside it takes focus; a call\n // site's own name, role and tabIndex still win. See useScrollStop.\n const title = useSlottedContext(HeadingContext, 'title');\n const scrollStop = useScrollStop(ref, {\n label: props['aria-label'],\n title: title?.id\n });\n // The body measures itself through its own ref, and the call site's lands\n // on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...scrollStop} id={id} {...props} ref={merged} {...mergeStyles(stylex.props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props)} />;\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the trigger stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n *\n * `role=\"alertdialog\"` is React Aria's, for a dialog interrupting with\n * something that has to be answered before the page carries on — a screen\n * reader announces it rather than waiting to be asked. It also keeps the\n * dialog the basic one below the medium breakpoint, centred and sized to its\n * content, where a dialog of the default role fills the window. Its\n * `Dialog.Body` is its description, so the message is read out with the\n * title; an `aria-describedby` of the call site's own names another.\n *\n * A press on the scrim closes the dialog unless `isDismissable` says\n * otherwise, which is the same default `Sheet` takes and the reverse of\n * React Aria's own. Escape is a separate prop, `isKeyboardDismissDisabled`,\n * and `isDismissable` says nothing about it — so a dialog that has to be\n * answered from one of its actions, as an alert dialog usually does, turns\n * off both.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own, with no\n * trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and\n * a `slot=\"close\"` button, Escape and the scrim all report through\n * `onOpenChange`, as they would to `Dialog`.\n *\n * The scrim draws at `z-index: 900`, over any page content layered below\n * that, such as a sticky header, and the panel draws inside it. A\n * `Snackbar` draws at 1000, so a toast raised from inside the dialog is read\n * over it, and React Aria's popovers and menus draw above both.\n */\nfunction DialogContent({\n children,\n className,\n container,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled,\n isOpen,\n onOpenChange,\n ref,\n style,\n ...props\n}: DialogContentProps & RefAttributes<HTMLDivElement>) {\n const isBasic = props.role === 'alertdialog';\n // The id of the body, which an alert dialog is described by unless the\n // call site names a description of its own.\n const [body, setBody] = useState<string>();\n // Where the full-screen header holds the footer's actions.\n const [slot, setSlot] = useState<HTMLDivElement | null>(null);\n return <BasicContext value={isBasic}>\n <DescriptionContext value={isBasic ? setBody : null}>\n <FooterSlotContext value={slot}>\n <SetFooterSlotContext value={setSlot}>\n <OverlayScope>\n <ModalOverlay defaultOpen={defaultOpen} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled} isOpen={isOpen} onOpenChange={onOpenChange}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre, isBasic && basic.centre)}>\n <Modal\n // The panel, where the call site's class and style land, rather\n // than the dialog inside it, which takes the rest of the props.\n ref={ref} {...mergeStatefulStyles({\n 0: {\n className: \"x1n1nwrg x1u6grsq xbhiib0 x1ebxanj x16dv9tl xvkjz1l xt7dq6l x1ju3lih x1w1tqly x19pkqky x1f120ba xx61lck x1gb867b x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r x27kpxv x6iovhr x1u2d2a2 xxzqys8 xb3r6kr x9xqwrn xg8iv3o x19b5e0v xsds98l\"\n },\n 1: {\n className: \"x1n1nwrg x1u6grsq x16dv9tl xvkjz1l x1w1tqly x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r xb3r6kr xbhiib0 xt7dq6l x19pkqky xx61lck x27kpxv x1u2d2a2\"\n }\n }[!!isBasic << 0], {\n className,\n style\n })}>\n <HeaderContext value={false}>\n <RACDialog {...props} aria-describedby={props['aria-describedby'] ?? (isBasic ? body : undefined)} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </HeaderContext>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </SetFooterSlotContext>\n </FooterSlotContext>\n </DescriptionContext>\n </BasicContext>;\n}\n\n/**\n * The dialog's actions. Full screen they are drawn at the trailing end of\n * `Dialog.Header`, where the page's full-screen dialog has its confirming\n * action. In a dialog with no header they are the action bar on the\n * window's bottom edge instead, which a toast rises clear of while the\n * dialog is open, so a tap meant for one of them never lands on the toast's\n * own action instead.\n */\nfunction DialogFooter({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const fullScreen = useFullScreen() && !isBasic;\n const footerSlot = useContext(FooterSlotContext);\n // The header's slot, while one is drawn full screen. Read against the\n // window as well as the slot, since on the render that crosses the\n // breakpoint the header has not yet let its slot go.\n const slot = fullScreen ? footerSlot : null;\n const ref = useRef<HTMLDivElement>(null);\n useHoldBottomEdge(ref, fullScreen && slot === null);\n // The footer measures itself through its own ref, and the call site's\n // lands on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n const footer = <div {...props} ref={merged} {...mergeStyles(slot === null ? {\n 0: {\n className: \"x6s0dn4 x12smttz x1ejq31n x1vv4zg8 x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xnvi70j x8i8c5o x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x12smttz x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xg0ps1x x1ejq31n x8i8c5o x13h71tw\"\n }\n }[!!isBasic << 0] : {\n className: \"x6s0dn4 x9f619 x78zum5 x2lah0s x126z3so x14yy4lh\"\n }, props)} />;\n return slot === null ? footer : createPortal(footer, slot);\n}\n\n// The headline's row, and the close button's. Full screen it also holds the\n// footer's actions, at its trailing end.\nfunction DialogHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const fullScreen = useFullScreen() && !isBasic;\n const setFooterSlot = useContext(SetFooterSlotContext);\n return <HeaderContext value>\n <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j x11wnguw x1pr6p50 x1837goc xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr x11wnguw x1837goc\"\n }\n }[!!isBasic << 0], props)}>\n {props.children}\n {fullScreen && setFooterSlot !== null ? <div ref={setFooterSlot} className=\"xjp7ctv\" /> : null}\n </div>\n </HeaderContext>;\n}\n\n/**\n * Names the dialog. Rendered through React Aria's title slot, which is what\n * points the dialog's `aria-labelledby` at it — a dialog without one\n * announces itself unnamed.\n */\nfunction DialogTitle(props: DialogTitleProps & RefAttributes<HTMLHeadingElement>) {\n const isBasic = useContext(BasicContext);\n const isHeaded = useContext(HeaderContext);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x139gbkf xy5ce5c x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xrnjqs5 xj0a0fe\"\n },\n 4: {\n className: \"x9f619 x139gbkf xy5ce5c x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xrnjqs5 xj0a0fe xs2ltda xa4amcs\"\n },\n 2: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 6: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 1: {\n className: \"x9f619 x139gbkf xy5ce5c x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xrnjqs5 xj0a0fe xs2ltda\"\n },\n 5: {\n className: \"x9f619 x139gbkf xy5ce5c x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xrnjqs5 xj0a0fe xs2ltda\"\n },\n 3: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n },\n 7: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n }\n }[!!isHeaded << 2 | !!isBasic << 1 | !!(isBasic && isHeaded) << 0], props)} />;\n}\n\n// Whether the window is at the size the full-screen dialog is drawn at, kept\n// current as it resizes. False on the server, where there is no window and\n// nothing is open.\nfunction isFullScreen() {\n return window.matchMedia(FULL_SCREEN).matches;\n}\nfunction isFullScreenOnServer() {\n return false;\n}\nfunction subscribeToFullScreen(listener: () => void) {\n const query = window.matchMedia(FULL_SCREEN);\n query.addEventListener('change', listener);\n return () => {\n query.removeEventListener('change', listener);\n };\n}\nfunction useFullScreen() {\n return useSyncExternalStore(subscribeToFullScreen, isFullScreen, isFullScreenOnServer);\n}\nDialog.Body = DialogBody;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Header = DialogHeader;\nDialog.Title = DialogTitle;\n\n// The dialog's own props, plus the scrim's open state and dismissal settings\n// and the container's styling. A call site has no reason to know there are\n// three elements: `className` and `style` reach the container, which is the\n// one worth restyling, the open state and the dismissal settings reach the\n// scrim, and everything else lands on the dialog.\n//\n// `isDismissable` is declared here rather than picked with its siblings,\n// since the picked one carries React Aria's documentation, whose default is\n// the reverse of this component's.\ntype DialogContentProps = {\n /** A function may compute the class from the container's render state. */\n className?: ClassNameOrFunction<ModalRenderProps>;\n /**\n * Where to portal the dialog and scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the dialog on that scope's tokens, or\n * to the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the dialog renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. `true` here where React Aria's own default is `false`, the\n * same default `Sheet` takes. Escape is `isKeyboardDismissDisabled`'s,\n * and this says nothing about it — an alert dialog, which has to be\n * answered from one of its actions, turns off both.\n * @default true\n */\n isDismissable?: boolean;\n /** A function may compute the style from the container's render state. */\n style?: StyleOrFunction<ModalRenderProps>;\n} & Omit<RACDialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isKeyboardDismissDisabled' | 'isOpen' | 'onOpenChange'>;\ntype DialogTitleProps = HeadingProps;\nexport type { DialogContentProps, DialogProps, DialogTitleProps };\nexport { DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle };\nexport default Dialog;"],"mappings":";;;;;;;;;;;;;;;AA2BuB,GAAkBmB,OAAOE,YAAeD,WAAWE;AAM1E,MAAMC,cAAc;AAkDpB,MAAMC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRhB,QAAQ;EACRiB,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;AACF;AAQA,MAAMK,QAAQ;CACZtB,MAAM;EACJe,QAAQ;EACRE,OAAO;CACT;CACAC,QAAQ;EACNG,QAAQ;E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lD,OAAOqH,UAAUpD;AACjBjE,OAAOsH,SAAS3B;AAChB3F,OAAOuH,SAASvB;AAChBhG,OAAOwH,QAAQtB"}
@@ -358,7 +358,7 @@ function MenuSection(t0) {
358
358
  let t1;
359
359
  if ($[4] !== header) {
360
360
  t1 = header === void 0 ? null : /* @__PURE__ */ jsx(Header, {
361
- className: "x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x790zyz",
361
+ className: "x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x18fpw6u",
362
362
  children: header
363
363
  });
364
364
  $[4] = header;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","useContext","useEffect","useRef","AutocompleteStateContext","Menu","MenuItem","RACMenuItem","RACMenuLoadMoreItem","MenuSection","textOf","useRipple","rowStyles","supportingTone","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","Separator","styles","content","kWkggS","kaIpWk","ks0D6T","k7Eaqz","k3XXqK","k8WAf4","$$css","shortcut","kMwMTN","align","alignOffset","className","container","search","side","sideOffset","style","children","leading","trailing","label","header","emptyState","itemContent","ripple","state","hasLeading","undefined","check","isSelected","selectionMode","isDisabled","trailingOf","itemStyles","props","base","menu","selectedMenu","isHovered","hovered","isFocusVisible","focusVisible","focusVisibleSelected","isPressed","pressed","disabled","t0","$","t1","MenuContent","ref","t2","surfaceStyles","t3","t4","t5","t6","SEARCH_CONTROL","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","T0","handlers","surface","MenuLoadMore","MenuSeparator","MenuSubmenu","SearchSlot","autocomplete","latest","current","Symbol","for","querySelector","focus","setInputValue","popup","placement","hasSubmenu","Content","Item","LoadMore","Section","Submenu","RACMenuTrigger","RACMenu","RACPopover","RACMenuSection","Separator","RACSubmenuTrigger"],"sources":["../../../src/components/menu/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps, ReactElement, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, MenuItemRenderProps, PopoverRenderProps, MenuItemProps as RACMenuItemProps, MenuLoadMoreItemProps as RACMenuLoadMoreItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useEffect, useRef } from 'react';\nimport { AutocompleteStateContext, Header, Keyboard, Menu as RACMenu, MenuItem as RACMenuItem, MenuLoadMoreItem as RACMenuLoadMoreItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Popover as RACPopover, SubmenuTrigger as RACSubmenuTrigger, Text } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { CollectionEmpty, CollectionLoadMore, CollectionStatus } from '../../collection';\nimport { textOf } from '../../collection/text';\nimport { CheckGlyph, ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { KeycapToneContext } from '../../keycap/context';\nimport { RowContent } from '../../row';\nimport { rowStyles, supportingTone } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Separator from '../separator';\n\n// The menus page's menu: a surface between 112 and 280 wide with a 4dp\n// corner and 8dp above and below its items, holding rows of the row module's\n// menu variant — 48dp tall, a label-large label, tertiary container when\n// selected, with a check beside the label. The container alone sits as close\n// as 1.1:1 to the surface, so the check is what carries the selection for a\n// reader who cannot tell the two apart. The surface itself is the overlay module's, shared with Popover\n// and Sheet, with the two things the menus page decides differently applied\n// over it: the corner, which is the extra-small step rather than the\n// medium one every other overlay takes, and the container colour, which is\n// the Expressive column's surface container low rather than the baseline's\n// surface container.\n//\n// Six parts, because everything a menu holds takes arbitrary content:\n// `Menu.Content`, `Menu.Item`, `Menu.Section`, `Menu.Separator`,\n// `Menu.Submenu` and `Menu.LoadMore`. A `Button` or `IconButton` placed\n// directly inside `Menu` is the trigger, wired through React Aria's context\n// rather than a part of ours — the same arrangement Sheet and Popover use.\n//\n// Four things are worth knowing about how this maps onto React Aria.\n//\n// **The item's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function, wrapped in `mergeStatefulStyles` so a call site's own\n// `className` survives.\n//\n// **A shortcut goes through React Aria's `Keyboard` slot**, and the label\n// through its `Text` slot. The second is what makes the first work: React\n// Aria points the item's `aria-labelledby` at the labelled text, so a screen\n// reader reads the label alone and announces the keystroke separately. Left\n// as plain content, the item's name is its whole text and the shortcut is\n// read as part of what the item does. The keycap itself is the library's.\n// The shortcut's colour follows the item's state as the supporting line's\n// does, through the same `supportingTone`, and a selected or disabled item\n// hands a keycap inside it the `inherit` tone, so the keycap follows too.\n//\n// **A submenu's arrow is drawn from render state, not from a prop.** React\n// Aria reports `hasSubmenu` on the item inside a `SubmenuTrigger`, so an item\n// that opens one gets the chevron without the call site saying so twice. The\n// glyph carries no direction of its own, so the style mirrors it under a\n// right-to-left writing mode.\n//\n// **A menu's children are a collection**, so anything that is not an item is\n// dropped: React Aria walks them looking for items and finds a search input\n// no place to be. `Menu.Content` therefore takes a `search` slot, drawn on\n// the surface above the items — which is also what puts the bar and the\n// items inside one `Autocomplete` when the menu is filtered.\n//\n// **A separator needs no slot from the call site.** React Aria's menu\n// provides the separator context, which is what `Menu.Separator` picks up —\n// that is why Separator moved onto React Aria in Phase 0. What is added here\n// is the menus page's 8dp either side of the rule.\n\nconst MENU_MIN = '112px';\nconst MENU_MAX = '280px';\nconst styles = {\n content: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n ks0D6T: \"x1jkqq1h\",\n k7Eaqz: \"x1c7vg25\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n shortcut: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\ntype MenuAlign = OverlayAlign;\ntype MenuContentProps<T extends object = object> = {\n /**\n * Where the menu lines up along that side. Left out, a menu lines up with\n * the start of its trigger, and a submenu with the top of the item that\n * opens it.\n */\n align?: MenuAlign;\n /** Moves the menu along that side, in pixels. */\n alignOffset?: number;\n /**\n * Lands on the surface, which is the element a layout positions. A\n * function may compute the class from the surface's render state.\n */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * Where to portal the menu. Defaults to the container of the `ThemeScope`\n * around it, which keeps the menu on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the menu\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * What the menu shows when nothing is in it — after a search that matched\n * nothing, usually. Left out, it is a muted row saying \"No results\" in the\n * I18nProvider's locale, which the surface also announces, so the menu\n * keeps a row's height rather than shrinking to its search bar. One of the\n * call site's own replaces the announcement as well as the row.\n */\n renderEmptyState?: RACMenuProps<T>['renderEmptyState'];\n /**\n * Content drawn on the surface above the items — a search bar that filters\n * them, usually. It goes here rather than among the children because a\n * menu's children are a collection: React Aria walks them for items and\n * drops anything else, so an input written beside them disappears.\n *\n * To filter with it, wrap this whole part in `Autocomplete`, which puts\n * the bar and the items inside one wrapper. The bar takes focus as the\n * menu opens, however it was opened, so typing filters straight away,\n * and its query is cleared as the menu closes, so a reopened menu shows\n * every item.\n */\n search?: ReactNode;\n /**\n * Which side of the trigger the menu opens on. Left out, a menu opens below\n * its trigger and a submenu at the inline end of the item that opens it,\n * where the item's chevron points — the places React Aria gives each.\n * Given `align` alone, the side is `bottom`. `start` and `end` follow the\n * writing direction, as a submenu does; `left` and `right` stay put in\n * either.\n */\n side?: MenuSide;\n /**\n * How far the menu sits from the trigger, in pixels. Left out, React Aria's:\n * 8, or 0 for a menu opened with `trigger=\"contextMenu\"`.\n */\n sideOffset?: number;\n /** Lands on the surface, as `className` does. */\n style?: StyleOrFunction<PopoverRenderProps>;\n} & Omit<RACMenuProps<T>, 'className' | 'renderEmptyState' | 'style'>;\ntype MenuItemProps<T extends object = object> = {\n /** The item's label — what it does. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACMenuItemProps<T>['className'];\n /** Content before the label, usually an icon. */\n leading?: ReactNode;\n /**\n * The keystroke that runs the item, at the end of the row. Pass a `Keycap`\n * to draw it as one; a string is set as plain text in the muted role. Either\n * goes through React Aria's keyboard slot, so a screen reader announces it\n * apart from the label rather than reading the two as one name. It takes\n * the item's colour while the item is selected or disabled, and so does a\n * `Keycap` inside it, its rule included.\n */\n shortcut?: ReactNode;\n /** A function may compute the style from the item's render state. */\n style?: RACMenuItemProps<T>['style'];\n /** Content after the label, before the shortcut. */\n trailing?: ReactNode;\n} & Omit<RACMenuItemProps<T>, 'children' | 'className' | 'style'>;\ntype MenuLoadMoreProps = Omit<RACMenuLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\n\n// `children` is optional here where React Aria makes it required, so the\n// type reads the way Sheet's and Popover's do: a root that composes rather\n// than one that has to be handed something. Sheet does the same for the same\n// reason.\ntype MenuProps = Omit<RACMenuTriggerProps, 'children'> & {\n /** The trigger, then the `Menu.Content` it opens. */\n children?: ReactNode;\n};\ntype MenuSectionProps<T extends object = object> = Omit<RACMenuSectionProps<T>, 'children'> & {\n /**\n * The items in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\ntype MenuSeparatorProps = Omit<ComponentProps<typeof Separator>, 'orientation'>;\ntype MenuSide = OverlaySide;\ntype MenuSubmenuProps = {\n /**\n * The item that opens the submenu, then the `Menu.Content` it opens.\n * Exactly those two, in that order. The count is the type's to enforce;\n * the order is not, since every JSX element has the same type.\n */\n children: [trigger: ReactElement, content: ReactElement];\n /**\n * How long the pointer rests on the item before the submenu opens, in\n * milliseconds.\n * @default 200\n */\n delay?: number;\n};\n\n// The default empty state, at module scope so every menu hands React Aria\n// the same function.\nfunction emptyState() {\n return <CollectionEmpty variant=\"menu\" />;\n}\n\n// What the item draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// The render state decides three things: the chevron, which an item inside a\n// SubmenuTrigger gets without the call site asking twice, the check on a\n// selected item, and the supporting line's colour, which the row module takes\n// from whether the row is selected or disabled.\n//\n// The check takes the leading slot where the item has leading content, in\n// place of it, and comes at the end of the row where it has none. Either way\n// the label stays where it was, so choosing an item moves nothing in the\n// menu. Hidden from the tree, since React Aria's `aria-checked` already says\n// the item is chosen.\n//\n// At the end of the row, an item that is not chosen keeps the check's 24dp\n// empty in its place, in a menu that selects at all. The check comes after a\n// shortcut, so drawn on the chosen item alone it pushed that item's keycap\n// in from the others', and the shortcuts stopped forming a column. A menu\n// that selects nothing has no check to make room for, and keeps none.\nfunction itemContent(children: ReactNode, leading: ReactNode, shortcut: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: MenuItemRenderProps) => {\n const hasLeading = leading !== undefined && leading !== null;\n const check = state.isSelected ? <CheckGlyph className=\"xxk0z11 x9f619 x2lah0s xvy4d1p\" /> : hasLeading || state.selectionMode === 'none' ? undefined : <span aria-hidden className=\"xxk0z11 x9f619 x2lah0s xvy4d1p\" />;\n return <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={hasLeading ? check ?? leading : undefined} trailing={trailingOf(state, shortcut, trailing, hasLeading ? undefined : check)} variant=\"menu\">\n <Text slot=\"label\">{children}</Text>\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n };\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// item's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled item, so nothing has to outrank them.\n// No overline, and so no three-line row: the menus page gives one item\n// height and one line of text. `List.Item` and `ListBox.Item` take the prop\n// because the lists page is what they draw, and this row is 48dp rather than\n// that page's 56. A label longer than the surface's 280dp still wraps, and\n// breaks inside a word that is wider than that, rather than running out of\n// the surface and under the shortcut — the shared row's rule, which nothing\n// here truncates.\nfunction itemStyles(state: MenuItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.menu, state.isSelected && rowStyles.selectedMenu, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isFocusVisible && state.isSelected && rowStyles.focusVisibleSelected, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of actions opened from a control. Open state is React Aria's: pass\n * `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it keep\n * its own.\n *\n * A `Button` or `IconButton` placed directly inside opens it; everything the\n * menu shows goes in `Menu.Content`, since the trigger lives in the page\n * while the menu is portalled out to the end of the body.\n *\n * ```tsx\n * <Menu>\n * <Button>Open</Button>\n * <Menu.Content>\n * <Menu.Item id=\"first\">First item</Menu.Item>\n * </Menu.Content>\n * </Menu>\n * ```\n *\n * The trigger's text names the menu, so the button is where a label goes.\n */\nfunction Menu({\n children,\n ...props\n}: MenuProps) {\n return <RACMenuTrigger {...props}>{children}</RACMenuTrigger>;\n}\n\n/**\n * The menu itself, and the surface it is drawn on. React Aria names it after\n * the control that opened it, so `aria-label` here is ignored — name the\n * trigger instead.\n *\n * The call site's `className` and `style` land on the surface, which is the\n * element a layout positions.\n *\n * The placement and the offsets are passed on only where the call site gives\n * them. React Aria hands the popover a placement of its own through context —\n * below the trigger for a menu, at the item's inline end for a submenu — and\n * a prop set here replaces it, so a default written here opened every\n * submenu below its item, over the rest of the menu it came from.\n *\n * A menu with nothing in it shows a muted \"No results\" row in place of its\n * items, and says so through a status on the surface, which is what a search\n * that matches nothing leaves; pass `renderEmptyState` to draw something\n * else.\n */\nfunction MenuContent<T extends object = object>({\n align,\n alignOffset,\n className,\n container,\n ref,\n search,\n side,\n sideOffset,\n style,\n ...props\n}: MenuContentProps<T> & RefAttributes<HTMLElement>) {\n return <RACPopover crossOffset={alignOffset} offset={sideOffset} placement={side === undefined && align === undefined ? undefined : placementOf(side ?? 'bottom', align ?? 'start')}\n // The surface, where the call site's class and style land, rather than\n // the menu inside it, which takes the rest of the props.\n ref={ref}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles(surfaceStyles, {\n className,\n style\n })}>\n <CollectionStatus>\n {search === undefined ? null : <SearchSlot>{search}</SearchSlot>}\n <RACMenu<T> renderEmptyState={emptyState} {...props} className=\"x9f619 x78zum5 xdt5ytf x1t137rt\" />\n </CollectionStatus>\n </RACPopover>;\n}\n\n// What a press on the search slot focuses: its field's own control.\nconst SEARCH_CONTROL = 'input, textarea, [contenteditable=\"true\"]';\n\n/**\n * One action. Its slots are the row's: `leading` before the label, the label\n * as children, and `trailing` after it, with `shortcut` at the end. An item\n * that opens a submenu draws the chevron itself.\n */\nfunction MenuItem<T extends object = object>({\n children,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n shortcut,\n textValue,\n trailing,\n ...props\n}: MenuItemProps<T> & RefAttributes<HTMLDivElement>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {itemContent(children, leading, shortcut, trailing, ripple.surface)}\n </RACMenuItem>;\n}\n\n/**\n * The row shown while more items are being fetched. React Aria calls\n * `onLoadMore` when it comes into view, and draws it only while `isLoading`.\n */\nfunction MenuLoadMore({\n label,\n ...props\n}: MenuLoadMoreProps & RefAttributes<HTMLDivElement>) {\n return <RACMenuLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k x1ddmzdj\"\n }, props)}>\n <CollectionLoadMore diameter=\"20px\" label={label} />\n </RACMenuLoadMoreItem>;\n}\n\n/**\n * A named group of items. `header` names it, and is what a screen reader\n * reads before the items inside.\n */\nfunction MenuSection<T extends object = object>({\n children,\n header,\n ...props\n}: MenuSectionProps<T> & RefAttributes<HTMLElement>) {\n return <RACMenuSection {...props}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x790zyz\">{header}</Header>}\n {children}\n </RACMenuSection>;\n}\n\n/**\n * A rule between groups of items. It takes its role from the menu around it,\n * so it needs no slot from the call site.\n */\nfunction MenuSeparator(props: MenuSeparatorProps) {\n return <Separator {...props} {...mergeStyles({\n className: \"xwpi13i\"\n }, props)} />;\n}\n\n/**\n * An item that opens a menu of its own. Takes exactly two children: the\n * `Menu.Item` that opens it, then the `Menu.Content` it opens.\n */\nfunction MenuSubmenu(props: MenuSubmenuProps) {\n return <RACSubmenuTrigger {...props} />;\n}\n\n/**\n * The search bar above a menu's items, mounted only while the menu is open.\n *\n * Its field takes focus as it mounts. React Aria's popover otherwise took\n * focus itself whenever a pointer opened the menu, so typing went nowhere\n * and only a keyboard's Enter happened to land in the field. Mounted before\n * the items, so the popover finds focus already inside it and leaves it.\n *\n * The query is cleared as it unmounts. The `Autocomplete` that filters the\n * items wraps this whole part and outlives the popover, so its query did\n * too: a menu filtered, used and reopened came back filtered.\n */\nfunction SearchSlot({\n children\n}: {\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const autocomplete = useContext(AutocompleteStateContext);\n // The latest state, for the cleanup below to clear: the state object is a\n // new one on every render, and the effect that mounts the bar runs once.\n const latest = useRef(autocomplete);\n useEffect(() => {\n latest.current = autocomplete;\n });\n useEffect(() => {\n ref.current?.querySelector<HTMLElement>(SEARCH_CONTROL)?.focus();\n return () => {\n latest.current?.setInputValue('');\n };\n }, []);\n return <div ref={ref} className=\"x9f619 xqf7pud xn60lsn\">\n {children}\n </div>;\n}\n\n// The surface grows from the edge it is anchored by, which is what makes it\n// read as coming out of the trigger. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after.\nfunction surfaceStyles(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.content, popupOrigin(state.placement));\n}\n\n/** What sits after the label: the call site's content, then the shortcut or\n * the submenu's chevron. */\nfunction trailingOf(state: MenuItemRenderProps, shortcut: ReactNode, trailing: ReactNode, check: ReactNode) {\n if (state.hasSubmenu) {\n return <>\n {trailing}\n <ChevronEndGlyph className=\"x1qx5ct2 xw4jnvo x19axjrm x1c071of\" />\n </>;\n }\n if (shortcut === undefined && trailing === undefined && check === undefined) {\n return undefined;\n }\n return <>\n {trailing}\n {shortcut === undefined ? null : <Keyboard {...stylex.props(styles.shortcut, supportingTone('menu', state))}>\n <KeycapToneContext value={state.isDisabled || state.isSelected ? 'inherit' : 'neutral'}>\n {shortcut}\n </KeycapToneContext>\n </Keyboard>}\n {check}\n </>;\n}\nMenu.Content = MenuContent;\nMenu.Item = MenuItem;\nMenu.LoadMore = MenuLoadMore;\nMenu.Section = MenuSection;\nMenu.Separator = MenuSeparator;\nMenu.Submenu = MenuSubmenu;\nexport type { MenuAlign, MenuContentProps, MenuItemProps, MenuLoadMoreProps, MenuProps, MenuSectionProps, MenuSeparatorProps, MenuSide, MenuSubmenuProps };\nexport { MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu };\nexport default Menu;"],"mappings":";;;;;;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AAkB;CAC1G,IAAIH,MAAMwD,YACR,OAAO,qBAAA,YAAA,EAAA,UAAA,CACF9D,UACD,oBAAC,iBAAD,EAAiB,WAAU,qCAAoC,CAAA,CACjE,EAAA,CAAA;CAEJ,IAAIZ,aAAaoB,KAAAA,KAAaR,aAAaQ,KAAAA,KAAaC,UAAUD,KAAAA,GAChE;CAEF,OAAO,qBAAA,YAAA,EAAA,UAAA;EACFR;EACAZ,aAAaoB,KAAAA,IAAY,OAAO,oBAAC,UAAD;GAAU,GAAIjD,MAAaoB,OAAOS,UAAUhB,eAAe,QAAQkC,KAAK,CAAC;GACtG,UAAA,oBAAC,mBAAD;IAAmB,OAAOA,MAAMM,cAAcN,MAAMI,aAAa,YAAY;IAC1EtB,UAAAA;GACgB,CAAA;EACX,CAAA;EACXqB;CACH,EAAA,CAAA;AACJ;AACA7C,KAAKmG,UAAUjC;AACflE,KAAKoG,OAAOnG;AACZD,KAAKqG,WAAWjB;AAChBpF,KAAKsG,UAAUlG;AACfJ,KAAKc,YAAYuE;AACjBrF,KAAKuG,UAAUjB"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useContext","useEffect","useRef","AutocompleteStateContext","Menu","MenuItem","RACMenuItem","RACMenuLoadMoreItem","MenuSection","textOf","useRipple","rowStyles","supportingTone","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","Separator","styles","content","kWkggS","kaIpWk","ks0D6T","k7Eaqz","k3XXqK","k8WAf4","$$css","shortcut","kMwMTN","align","alignOffset","className","container","search","side","sideOffset","style","children","leading","trailing","label","header","emptyState","itemContent","ripple","state","hasLeading","undefined","check","isSelected","selectionMode","isDisabled","trailingOf","itemStyles","props","base","menu","selectedMenu","isHovered","hovered","isFocusVisible","focusVisible","focusVisibleSelected","isPressed","pressed","disabled","t0","$","t1","MenuContent","ref","t2","surfaceStyles","t3","t4","t5","t6","SEARCH_CONTROL","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","T0","handlers","surface","MenuLoadMore","MenuSeparator","MenuSubmenu","SearchSlot","autocomplete","latest","current","Symbol","for","querySelector","focus","setInputValue","popup","placement","hasSubmenu","Content","Item","LoadMore","Section","Submenu","RACMenuTrigger","RACMenu","RACPopover","RACMenuSection","Separator","RACSubmenuTrigger"],"sources":["../../../src/components/menu/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps, ReactElement, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, MenuItemRenderProps, PopoverRenderProps, MenuItemProps as RACMenuItemProps, MenuLoadMoreItemProps as RACMenuLoadMoreItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useEffect, useRef } from 'react';\nimport { AutocompleteStateContext, Header, Keyboard, Menu as RACMenu, MenuItem as RACMenuItem, MenuLoadMoreItem as RACMenuLoadMoreItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Popover as RACPopover, SubmenuTrigger as RACSubmenuTrigger, Text } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { CollectionEmpty, CollectionLoadMore, CollectionStatus } from '../../collection';\nimport { textOf } from '../../collection/text';\nimport { CheckGlyph, ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { KeycapToneContext } from '../../keycap/context';\nimport { RowContent } from '../../row';\nimport { rowStyles, supportingTone } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Separator from '../separator';\n\n// The menus page's menu: a surface between 112 and 280 wide with a 4dp\n// corner and 8dp above and below its items, holding rows of the row module's\n// menu variant — 48dp tall, a label-large label, tertiary container when\n// selected, with a check beside the label. The container alone sits as close\n// as 1.1:1 to the surface, so the check is what carries the selection for a\n// reader who cannot tell the two apart. The surface itself is the overlay module's, shared with Popover\n// and Sheet, with the two things the menus page decides differently applied\n// over it: the corner, which is the extra-small step rather than the\n// medium one every other overlay takes, and the container colour, which is\n// the Expressive column's surface container low rather than the baseline's\n// surface container.\n//\n// Six parts, because everything a menu holds takes arbitrary content:\n// `Menu.Content`, `Menu.Item`, `Menu.Section`, `Menu.Separator`,\n// `Menu.Submenu` and `Menu.LoadMore`. A `Button` or `IconButton` placed\n// directly inside `Menu` is the trigger, wired through React Aria's context\n// rather than a part of ours — the same arrangement Sheet and Popover use.\n//\n// Four things are worth knowing about how this maps onto React Aria.\n//\n// **The item's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function, wrapped in `mergeStatefulStyles` so a call site's own\n// `className` survives.\n//\n// **A shortcut goes through React Aria's `Keyboard` slot**, and the label\n// through its `Text` slot. The second is what makes the first work: React\n// Aria points the item's `aria-labelledby` at the labelled text, so a screen\n// reader reads the label alone and announces the keystroke separately. Left\n// as plain content, the item's name is its whole text and the shortcut is\n// read as part of what the item does. The keycap itself is the library's.\n// The shortcut's colour follows the item's state as the supporting line's\n// does, through the same `supportingTone`, and a selected or disabled item\n// hands a keycap inside it the `inherit` tone, so the keycap follows too.\n//\n// **A submenu's arrow is drawn from render state, not from a prop.** React\n// Aria reports `hasSubmenu` on the item inside a `SubmenuTrigger`, so an item\n// that opens one gets the chevron without the call site saying so twice. The\n// glyph carries no direction of its own, so the style mirrors it under a\n// right-to-left writing mode.\n//\n// **A menu's children are a collection**, so anything that is not an item is\n// dropped: React Aria walks them looking for items and finds a search input\n// no place to be. `Menu.Content` therefore takes a `search` slot, drawn on\n// the surface above the items — which is also what puts the bar and the\n// items inside one `Autocomplete` when the menu is filtered.\n//\n// **A separator needs no slot from the call site.** React Aria's menu\n// provides the separator context, which is what `Menu.Separator` picks up —\n// that is why Separator moved onto React Aria in Phase 0. What is added here\n// is the menus page's 8dp either side of the rule.\n\nconst MENU_MIN = '112px';\nconst MENU_MAX = '280px';\nconst styles = {\n content: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n ks0D6T: \"x1jkqq1h\",\n k7Eaqz: \"x1c7vg25\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n shortcut: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\ntype MenuAlign = OverlayAlign;\ntype MenuContentProps<T extends object = object> = {\n /**\n * Where the menu lines up along that side. Left out, a menu lines up with\n * the start of its trigger, and a submenu with the top of the item that\n * opens it.\n */\n align?: MenuAlign;\n /** Moves the menu along that side, in pixels. */\n alignOffset?: number;\n /**\n * Lands on the surface, which is the element a layout positions. A\n * function may compute the class from the surface's render state.\n */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * Where to portal the menu. Defaults to the container of the `ThemeScope`\n * around it, which keeps the menu on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the menu\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * What the menu shows when nothing is in it — after a search that matched\n * nothing, usually. Left out, it is a muted row saying \"No results\" in the\n * I18nProvider's locale, which the surface also announces, so the menu\n * keeps a row's height rather than shrinking to its search bar. One of the\n * call site's own replaces the announcement as well as the row.\n */\n renderEmptyState?: RACMenuProps<T>['renderEmptyState'];\n /**\n * Content drawn on the surface above the items — a search bar that filters\n * them, usually. It goes here rather than among the children because a\n * menu's children are a collection: React Aria walks them for items and\n * drops anything else, so an input written beside them disappears.\n *\n * To filter with it, wrap this whole part in `Autocomplete`, which puts\n * the bar and the items inside one wrapper. The bar takes focus as the\n * menu opens, however it was opened, so typing filters straight away,\n * and its query is cleared as the menu closes, so a reopened menu shows\n * every item.\n */\n search?: ReactNode;\n /**\n * Which side of the trigger the menu opens on. Left out, a menu opens below\n * its trigger and a submenu at the inline end of the item that opens it,\n * where the item's chevron points — the places React Aria gives each.\n * Given `align` alone, the side is `bottom`. `start` and `end` follow the\n * writing direction, as a submenu does; `left` and `right` stay put in\n * either.\n */\n side?: MenuSide;\n /**\n * How far the menu sits from the trigger, in pixels. Left out, React Aria's:\n * 8, or 0 for a menu opened with `trigger=\"contextMenu\"`.\n */\n sideOffset?: number;\n /** Lands on the surface, as `className` does. */\n style?: StyleOrFunction<PopoverRenderProps>;\n} & Omit<RACMenuProps<T>, 'className' | 'renderEmptyState' | 'style'>;\ntype MenuItemProps<T extends object = object> = {\n /** The item's label — what it does. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACMenuItemProps<T>['className'];\n /** Content before the label, usually an icon. */\n leading?: ReactNode;\n /**\n * The keystroke that runs the item, at the end of the row. Pass a `Keycap`\n * to draw it as one; a string is set as plain text in the muted role. Either\n * goes through React Aria's keyboard slot, so a screen reader announces it\n * apart from the label rather than reading the two as one name. It takes\n * the item's colour while the item is selected or disabled, and so does a\n * `Keycap` inside it, its rule included.\n */\n shortcut?: ReactNode;\n /** A function may compute the style from the item's render state. */\n style?: RACMenuItemProps<T>['style'];\n /** Content after the label, before the shortcut. */\n trailing?: ReactNode;\n} & Omit<RACMenuItemProps<T>, 'children' | 'className' | 'style'>;\ntype MenuLoadMoreProps = Omit<RACMenuLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\n\n// `children` is optional here where React Aria makes it required, so the\n// type reads the way Sheet's and Popover's do: a root that composes rather\n// than one that has to be handed something. Sheet does the same for the same\n// reason.\ntype MenuProps = Omit<RACMenuTriggerProps, 'children'> & {\n /** The trigger, then the `Menu.Content` it opens. */\n children?: ReactNode;\n};\ntype MenuSectionProps<T extends object = object> = Omit<RACMenuSectionProps<T>, 'children'> & {\n /**\n * The items in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\ntype MenuSeparatorProps = Omit<ComponentProps<typeof Separator>, 'orientation'>;\ntype MenuSide = OverlaySide;\ntype MenuSubmenuProps = {\n /**\n * The item that opens the submenu, then the `Menu.Content` it opens.\n * Exactly those two, in that order. The count is the type's to enforce;\n * the order is not, since every JSX element has the same type.\n */\n children: [trigger: ReactElement, content: ReactElement];\n /**\n * How long the pointer rests on the item before the submenu opens, in\n * milliseconds.\n * @default 200\n */\n delay?: number;\n};\n\n// The default empty state, at module scope so every menu hands React Aria\n// the same function.\nfunction emptyState() {\n return <CollectionEmpty variant=\"menu\" />;\n}\n\n// What the item draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// The render state decides three things: the chevron, which an item inside a\n// SubmenuTrigger gets without the call site asking twice, the check on a\n// selected item, and the supporting line's colour, which the row module takes\n// from whether the row is selected or disabled.\n//\n// The check takes the leading slot where the item has leading content, in\n// place of it, and comes at the end of the row where it has none. Either way\n// the label stays where it was, so choosing an item moves nothing in the\n// menu. Hidden from the tree, since React Aria's `aria-checked` already says\n// the item is chosen.\n//\n// At the end of the row, an item that is not chosen keeps the check's 24dp\n// empty in its place, in a menu that selects at all. The check comes after a\n// shortcut, so drawn on the chosen item alone it pushed that item's keycap\n// in from the others', and the shortcuts stopped forming a column. A menu\n// that selects nothing has no check to make room for, and keeps none.\nfunction itemContent(children: ReactNode, leading: ReactNode, shortcut: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: MenuItemRenderProps) => {\n const hasLeading = leading !== undefined && leading !== null;\n const check = state.isSelected ? <CheckGlyph className=\"xxk0z11 x9f619 x2lah0s xvy4d1p\" /> : hasLeading || state.selectionMode === 'none' ? undefined : <span aria-hidden className=\"xxk0z11 x9f619 x2lah0s xvy4d1p\" />;\n return <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={hasLeading ? check ?? leading : undefined} trailing={trailingOf(state, shortcut, trailing, hasLeading ? undefined : check)} variant=\"menu\">\n <Text slot=\"label\">{children}</Text>\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n };\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// item's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled item, so nothing has to outrank them.\n// No overline, and so no three-line row: the menus page gives one item\n// height and one line of text. `List.Item` and `ListBox.Item` take the prop\n// because the lists page is what they draw, and this row is 48dp rather than\n// that page's 56. A label longer than the surface's 280dp still wraps, and\n// breaks inside a word that is wider than that, rather than running out of\n// the surface and under the shortcut — the shared row's rule, which nothing\n// here truncates.\nfunction itemStyles(state: MenuItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.menu, state.isSelected && rowStyles.selectedMenu, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isFocusVisible && state.isSelected && rowStyles.focusVisibleSelected, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of actions opened from a control. Open state is React Aria's: pass\n * `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it keep\n * its own.\n *\n * A `Button` or `IconButton` placed directly inside opens it; everything the\n * menu shows goes in `Menu.Content`, since the trigger lives in the page\n * while the menu is portalled out to the end of the body.\n *\n * ```tsx\n * <Menu>\n * <Button>Open</Button>\n * <Menu.Content>\n * <Menu.Item id=\"first\">First item</Menu.Item>\n * </Menu.Content>\n * </Menu>\n * ```\n *\n * The trigger's text names the menu, so the button is where a label goes.\n */\nfunction Menu({\n children,\n ...props\n}: MenuProps) {\n return <RACMenuTrigger {...props}>{children}</RACMenuTrigger>;\n}\n\n/**\n * The menu itself, and the surface it is drawn on. React Aria names it after\n * the control that opened it, so `aria-label` here is ignored — name the\n * trigger instead.\n *\n * The call site's `className` and `style` land on the surface, which is the\n * element a layout positions.\n *\n * The placement and the offsets are passed on only where the call site gives\n * them. React Aria hands the popover a placement of its own through context —\n * below the trigger for a menu, at the item's inline end for a submenu — and\n * a prop set here replaces it, so a default written here opened every\n * submenu below its item, over the rest of the menu it came from.\n *\n * A menu with nothing in it shows a muted \"No results\" row in place of its\n * items, and says so through a status on the surface, which is what a search\n * that matches nothing leaves; pass `renderEmptyState` to draw something\n * else.\n */\nfunction MenuContent<T extends object = object>({\n align,\n alignOffset,\n className,\n container,\n ref,\n search,\n side,\n sideOffset,\n style,\n ...props\n}: MenuContentProps<T> & RefAttributes<HTMLElement>) {\n return <RACPopover crossOffset={alignOffset} offset={sideOffset} placement={side === undefined && align === undefined ? undefined : placementOf(side ?? 'bottom', align ?? 'start')}\n // The surface, where the call site's class and style land, rather than\n // the menu inside it, which takes the rest of the props.\n ref={ref}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles(surfaceStyles, {\n className,\n style\n })}>\n <CollectionStatus>\n {search === undefined ? null : <SearchSlot>{search}</SearchSlot>}\n <RACMenu<T> renderEmptyState={emptyState} {...props} className=\"x9f619 x78zum5 xdt5ytf x1t137rt\" />\n </CollectionStatus>\n </RACPopover>;\n}\n\n// What a press on the search slot focuses: its field's own control.\nconst SEARCH_CONTROL = 'input, textarea, [contenteditable=\"true\"]';\n\n/**\n * One action. Its slots are the row's: `leading` before the label, the label\n * as children, and `trailing` after it, with `shortcut` at the end. An item\n * that opens a submenu draws the chevron itself.\n */\nfunction MenuItem<T extends object = object>({\n children,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n shortcut,\n textValue,\n trailing,\n ...props\n}: MenuItemProps<T> & RefAttributes<HTMLDivElement>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {itemContent(children, leading, shortcut, trailing, ripple.surface)}\n </RACMenuItem>;\n}\n\n/**\n * The row shown while more items are being fetched. React Aria calls\n * `onLoadMore` when it comes into view, and draws it only while `isLoading`.\n */\nfunction MenuLoadMore({\n label,\n ...props\n}: MenuLoadMoreProps & RefAttributes<HTMLDivElement>) {\n return <RACMenuLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k x1ddmzdj\"\n }, props)}>\n <CollectionLoadMore diameter=\"20px\" label={label} />\n </RACMenuLoadMoreItem>;\n}\n\n/**\n * A named group of items. `header` names it, and is what a screen reader\n * reads before the items inside.\n */\nfunction MenuSection<T extends object = object>({\n children,\n header,\n ...props\n}: MenuSectionProps<T> & RefAttributes<HTMLElement>) {\n return <RACMenuSection {...props}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x18fpw6u\">{header}</Header>}\n {children}\n </RACMenuSection>;\n}\n\n/**\n * A rule between groups of items. It takes its role from the menu around it,\n * so it needs no slot from the call site.\n */\nfunction MenuSeparator(props: MenuSeparatorProps) {\n return <Separator {...props} {...mergeStyles({\n className: \"xwpi13i\"\n }, props)} />;\n}\n\n/**\n * An item that opens a menu of its own. Takes exactly two children: the\n * `Menu.Item` that opens it, then the `Menu.Content` it opens.\n */\nfunction MenuSubmenu(props: MenuSubmenuProps) {\n return <RACSubmenuTrigger {...props} />;\n}\n\n/**\n * The search bar above a menu's items, mounted only while the menu is open.\n *\n * Its field takes focus as it mounts. React Aria's popover otherwise took\n * focus itself whenever a pointer opened the menu, so typing went nowhere\n * and only a keyboard's Enter happened to land in the field. Mounted before\n * the items, so the popover finds focus already inside it and leaves it.\n *\n * The query is cleared as it unmounts. The `Autocomplete` that filters the\n * items wraps this whole part and outlives the popover, so its query did\n * too: a menu filtered, used and reopened came back filtered.\n */\nfunction SearchSlot({\n children\n}: {\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const autocomplete = useContext(AutocompleteStateContext);\n // The latest state, for the cleanup below to clear: the state object is a\n // new one on every render, and the effect that mounts the bar runs once.\n const latest = useRef(autocomplete);\n useEffect(() => {\n latest.current = autocomplete;\n });\n useEffect(() => {\n ref.current?.querySelector<HTMLElement>(SEARCH_CONTROL)?.focus();\n return () => {\n latest.current?.setInputValue('');\n };\n }, []);\n return <div ref={ref} className=\"x9f619 xqf7pud xn60lsn\">\n {children}\n </div>;\n}\n\n// The surface grows from the edge it is anchored by, which is what makes it\n// read as coming out of the trigger. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after.\nfunction surfaceStyles(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.content, popupOrigin(state.placement));\n}\n\n/** What sits after the label: the call site's content, then the shortcut or\n * the submenu's chevron. */\nfunction trailingOf(state: MenuItemRenderProps, shortcut: ReactNode, trailing: ReactNode, check: ReactNode) {\n if (state.hasSubmenu) {\n return <>\n {trailing}\n <ChevronEndGlyph className=\"x1qx5ct2 xw4jnvo x19axjrm x1c071of\" />\n </>;\n }\n if (shortcut === undefined && trailing === undefined && check === undefined) {\n return undefined;\n }\n return <>\n {trailing}\n {shortcut === undefined ? null : <Keyboard {...stylex.props(styles.shortcut, supportingTone('menu', state))}>\n <KeycapToneContext value={state.isDisabled || state.isSelected ? 'inherit' : 'neutral'}>\n {shortcut}\n </KeycapToneContext>\n </Keyboard>}\n {check}\n </>;\n}\nMenu.Content = MenuContent;\nMenu.Item = MenuItem;\nMenu.LoadMore = MenuLoadMore;\nMenu.Section = MenuSection;\nMenu.Separator = MenuSeparator;\nMenu.Submenu = MenuSubmenu;\nexport type { MenuAlign, MenuContentProps, MenuItemProps, MenuLoadMoreProps, MenuProps, MenuSectionProps, MenuSeparatorProps, MenuSide, MenuSubmenuProps };\nexport { MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu };\nexport default Menu;"],"mappings":";;;;;;;;;;;;;;;;;AA4EA,MAAMqB,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRC,QAAQ;EACRF,OAAO;CACT;AACF;AAqIA,SAASgB,aAAa;CACpB,OAAO,oBAAC,iBAAD,EAAiB,SAAQ,OAAM,CAAA;AACxC;AAuBA,SAASC,YAAYN,UAAqBC,SAAoBX,UAAqBY,UAAqBK,QAAmB;CACzH,QAAQC,UAA+B;EACrC,MAAMC,aAAaR,YAAYS,KAAAA,KAAaT,YAAY;EACxD,MAAMU,QAAQH,MAAMI,aAAa,oBAAC,YAAD,EAAY,WAAU,iCAAgC,CAAA,IAAMH,cAAcD,MAAMK,kBAAkB,SAASH,KAAAA,IAAY,oBAAC,QAAD;GAAM,eAAA;GAAY,WAAU;EAAgC,CAAA;EACpN,OAAO,qBAAA,YAAA,EAAA,UAAA,CACH,oBAAC,YAAD;GAAY,YAAYF,MAAMM;GAAY,YAAYN,MAAMI;GAAY,SAASH,aAAaE,SAASV,UAAUS,KAAAA;GAAW,UAAUK,WAAWP,OAAOlB,UAAUY,UAAUO,aAAaC,KAAAA,IAAYC,KAAK;GAAG,SAAQ;GACnN,UAAA,oBAAC,MAAD;IAAM,MAAK;IAASX;GAAe,CAAA;EACzB,CAAA,GACXQ,MAAMM,aAAa,OAAOP,MAC7B,EAAA,CAAA;CACJ;AACF;AAeA,SAASS,WAAWR,OAA4B;CAC9C,OAAO/C,MAAaY,UAAU6C,MAAM7C,UAAU8C,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AAA9B;EAAA8B,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAFDO;AAEC;AAOV,SAASF,cAAc3B,OAA2B;CAChD,OAAO/C,MAAagB,QAAQqF,OAAOjF,OAAOC,SAASH,YAAY6B,MAAMuD,SAAS,CAAC;AACjF;;;AAIA,SAAShD,WAAWP,OAA4BlB,UAAqBY,UAAqBS,OAAkB;CAC1G,IAAIH,MAAMwD,YACR,OAAO,qBAAA,YAAA,EAAA,UAAA,CACF9D,UACD,oBAAC,iBAAD,EAAiB,WAAU,qCAAoC,CAAA,CACjE,EAAA,CAAA;CAEJ,IAAIZ,aAAaoB,KAAAA,KAAaR,aAAaQ,KAAAA,KAAaC,UAAUD,KAAAA,GAChE;CAEF,OAAO,qBAAA,YAAA,EAAA,UAAA;EACFR;EACAZ,aAAaoB,KAAAA,IAAY,OAAO,oBAAC,UAAD;GAAU,GAAIjD,MAAaoB,OAAOS,UAAUhB,eAAe,QAAQkC,KAAK,CAAC;GACtG,UAAA,oBAAC,mBAAD;IAAmB,OAAOA,MAAMM,cAAcN,MAAMI,aAAa,YAAY;IAC1EtB,UAAAA;GACgB,CAAA;EACX,CAAA;EACXqB;CACH,EAAA,CAAA;AACJ;AACA7C,KAAKmG,UAAUjC;AACflE,KAAKoG,OAAOnG;AACZD,KAAKqG,WAAWjB;AAChBpF,KAAKsG,UAAUlG;AACfJ,KAAKc,YAAYuE;AACjBrF,KAAKuG,UAAUjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","useLayoutEffect","useState","mergeRefs","useRender","mergeStyles","styles","destinations","kGNEyG","k1xSpc","kzQI83","kjj79g","k7Eaqz","$$css","HORIZONTAL","selectedRoute","NavigationBar","t0","$","children","props","render","element","setElement","isCramped","useCramped","t1","ref","undefined","t2","merged","t3","t4","form","context","t5","className","t6","t7","t8","defaultTagName","bar","t9","NavigationBarItem","shortfallOf","HTMLElement","total","destination","querySelectorAll","label","lastElementChild","Math","max","scrollWidth","clientWidth","needed","setNeeded","measure","window","matchMedia","matches","shortfall","relabel","resize","ResizeObserver","observe","text","MutationObserver","characterData","childList","subtree","disconnect","Item"],"sources":["../../../src/components/navigation-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLayoutEffect, useMemo, useState } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { mergeRefs } from '../../render/ref';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors } from '../../tokens/design.tokens.stylex';\n\n// The navigation bar page's flexible bar: three to five destinations across\n// the bottom of a compact window, on the surface container, 64dp tall. Below\n// the medium breakpoint each destination is vertical and the destinations\n// share the bar's width equally; at it and above, each is the page's\n// horizontal pill, as wide as what it holds, and the group sits centred with\n// the spare width at the bar's ends. The destinations are `src/navigation`'s,\n// shared with NavigationRail, which holds the two forms' values.\n//\n// The 8dp between two horizontal pills is the library's own. The page puts\n// each pill in an item of a fixed width it does not give, and with no space\n// at all the pills met edge to edge.\n//\n// A horizontal destination is as wide as its icon, its label and 16dp either\n// side, so five of them need far more than the 600dp the breakpoint starts\n// at: five fifteen-letter labels come to about 780. Drawn anyway, every label\n// was cut short the moment the window crossed the breakpoint, while one\n// pixel narrower the vertical form showed them whole. So the bar measures\n// what its horizontal labels lack, and keeps the vertical form until it is\n// that much wider — see `useCramped`.\n//\n// A vertical destination's label stays on one line and is cut short with an\n// ellipsis where the destination's share of the bar ends, and a label cut\n// short shows its full text in the browser's tooltip on hover — see\n// `src/navigation`. The label is held 4dp in from either side of the share,\n// so an ellipsis never touches the label beside it. Five destinations give\n// each label 61dp at a 375dp window and 58dp at 360dp, about nine\n// characters of label medium, so five destinations' names have to be short.\n//\n// The 64dp is the destinations' row rather than the bar's height, and the\n// bar grows past it: by padding the call site gives it, such as the inset a\n// phone's home indicator asks for, and with its labels under a reader's\n// wider text spacing. The bar adds no inset of its own, since only the call\n// site knows whether the bar sits at the screen's edge.\n//\n// The bar is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kzQI83: \"x1iyjqo2\",\n kjj79g: \"xl56j7k\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\n\n// The window size the bar draws its horizontal form at, which the styles read\n// as `media.medium`. Spelled again for `matchMedia`, the one thing here that\n// has to know it outside a stylesheet — see `useCramped`.\nconst HORIZONTAL = '(width >= 600px)';\ntype NavigationBarProps = RenderComponentProps<'nav'> & {\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The bar of three to five top-level destinations a compact window keeps at\n * its bottom edge. Each destination is a link, so it routes through React\n * Aria's `RouterProvider` when the app has one. The bar is a navigation\n * landmark, so name it with `aria-label`, and give a badge its words in\n * `badgeLabel`, since the badge itself is hidden from assistive technology.\n *\n * Its form follows the window. Below 600px each destination is vertical, its\n * icon over its label, and the destinations share the bar's width; from 600px\n * each is a horizontal pill, once the window is wide enough for every label\n * to show whole.\n *\n * ```tsx\n * <NavigationBar aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationBar.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationBar.Item>\n * <NavigationBar.Item\n * badge={3}\n * badgeLabel=\"3 new\"\n * href=\"/second\"\n * icon={<SecondIcon />}\n * >\n * Second item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/third\" icon={<ThirdIcon />}>\n * Third item\n * </NavigationBar.Item>\n * </NavigationBar>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`. A bar kept at\n * the bottom edge of a phone's screen clears its home indicator with padding,\n * which adds to the bar's height rather than squeezing the destinations:\n *\n * ```tsx\n * <NavigationBar\n * aria-label=\"Label\"\n * style={{ paddingBlockEnd: 'env(safe-area-inset-bottom)' }}\n * >\n * ```\n */\nfunction NavigationBar({\n children,\n render,\n selectedRoute,\n ...props\n}: NavigationBarProps) {\n // The element, held as state rather than in a ref object, since the bar\n // measures it from an effect and has to run again when it changes.\n const [element, setElement] = useState<HTMLElement | null>(null);\n const isCramped = useCramped(element);\n // The call site's ref lands on the same element. Read off `props` rather\n // than destructured, as `useRender` reads it, so the compiler sees a prop\n // holding still rather than a ref read during render.\n const merged = useMemo(() => mergeRefs(setElement, props.ref ?? undefined), [props.ref]);\n const context = useMemo(() => ({\n form: isCramped ? 'barCramped' as const : 'bar' as const,\n selectedRoute\n }), [isCramped, selectedRoute]);\n const bar = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n className: \"x6s0dn4 x1mjdul6 x9f619 x78zum5 xh8yej3 x8nclml\"\n }, props),\n children: <NavigationList layout={styles.destinations}>{children}</NavigationList>,\n ref: merged\n },\n render\n });\n return <NavigationContext value={context}>{bar}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation bar — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationBar`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationBarItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\n\n/**\n * How much wider the bar would have to be for none of its labels to be cut\n * short: what each one lacks of its own width, summed. A label is the last\n * part of its destination's link, in its item of the bar's list.\n */\nfunction shortfallOf(bar: HTMLElement) {\n let total = 0;\n for (const destination of bar.querySelectorAll(':scope > ul > li > a')) {\n const label = destination.lastElementChild;\n if (label instanceof HTMLElement) {\n total += Math.max(0, label.scrollWidth - label.clientWidth);\n }\n }\n return total;\n}\n\n/**\n * Whether `bar`, at a width that draws its horizontal form, is too narrow\n * for it, so it draws the vertical one instead.\n *\n * The horizontal form is measured as it is drawn: where it cuts labels short,\n * the bar records the width it would need and switches, and it switches back\n * once it is that wide. A change to the destinations' text clears the record,\n * since what they need has changed with it. Measured in a layout effect, so\n * a bar that cannot fit is never painted cut short.\n */\nfunction useCramped(bar: HTMLElement | null) {\n // The bar's width the horizontal form needs, while it is wider than the\n // bar; undefined while the horizontal form fits, or has not been measured.\n const [needed, setNeeded] = useState<number | undefined>(undefined);\n useLayoutEffect(() => {\n if (bar === null) {\n return undefined;\n }\n const measure = () => {\n if (needed !== undefined) {\n if (bar.clientWidth >= needed) {\n setNeeded(undefined);\n }\n return;\n }\n if (!window.matchMedia(HORIZONTAL).matches) {\n return;\n }\n const shortfall = shortfallOf(bar);\n if (shortfall > 0) {\n // A pixel over, so a bar exactly as wide as the sum of fractional\n // widths does not flip back and forth.\n setNeeded(bar.clientWidth + shortfall + 1);\n }\n };\n const relabel = () => {\n setNeeded(undefined);\n };\n measure();\n const resize = new ResizeObserver(measure);\n resize.observe(bar);\n const text = new MutationObserver(relabel);\n text.observe(bar, {\n characterData: true,\n childList: true,\n subtree: true\n });\n return () => {\n resize.disconnect();\n text.disconnect();\n };\n }, [bar, needed]);\n return needed !== undefined;\n}\nNavigationBar.Item = NavigationBarItem;\nexport type { NavigationItemProps as NavigationBarItemProps, NavigationBarProps };\nexport { NavigationBarItem };\nexport default NavigationBar;"],"mappings":";;;;;;;;;;AAoDA,MAAMM,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AAKA,MAAMC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDnB,SAAAE,cAAAC,IAAA;CAAA,MAAAC,IAAAlB,EAAA,EAAA;CAAA,IAAAmB;CA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a;CAAC,OACV6B,WAAW3B,KAAAA;AAAS;AAE7BZ,cAAcwD,OAAO7B"}
1
+ {"version":3,"file":"index.js","names":["_c","useLayoutEffect","useState","mergeRefs","useRender","mergeStyles","styles","destinations","kGNEyG","k1xSpc","kzQI83","kjj79g","k7Eaqz","$$css","HORIZONTAL","selectedRoute","NavigationBar","t0","$","children","props","render","element","setElement","isCramped","useCramped","t1","ref","undefined","t2","merged","t3","t4","form","context","t5","className","t6","t7","t8","defaultTagName","bar","t9","NavigationBarItem","shortfallOf","HTMLElement","total","destination","querySelectorAll","label","lastElementChild","Math","max","scrollWidth","clientWidth","needed","setNeeded","measure","window","matchMedia","matches","shortfall","relabel","resize","ResizeObserver","observe","text","MutationObserver","characterData","childList","subtree","disconnect","Item"],"sources":["../../../src/components/navigation-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLayoutEffect, useMemo, useState } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { mergeRefs } from '../../render/ref';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors } from '../../tokens/design.tokens.stylex';\n\n// The navigation bar page's flexible bar: three to five destinations across\n// the bottom of a compact window, on the surface container, 64dp tall. Below\n// the medium breakpoint each destination is vertical and the destinations\n// share the bar's width equally; at it and above, each is the page's\n// horizontal pill, as wide as what it holds, and the group sits centred with\n// the spare width at the bar's ends. The destinations are `src/navigation`'s,\n// shared with NavigationRail, which holds the two forms' values.\n//\n// The 8dp between two horizontal pills is the library's own. The page puts\n// each pill in an item of a fixed width it does not give, and with no space\n// at all the pills met edge to edge.\n//\n// A horizontal destination is as wide as its icon, its label and 16dp either\n// side, so five of them need far more than the 600dp the breakpoint starts\n// at: five fifteen-letter labels come to about 780. Drawn anyway, every label\n// was cut short the moment the window crossed the breakpoint, while one\n// pixel narrower the vertical form showed them whole. So the bar measures\n// what its horizontal labels lack, and keeps the vertical form until it is\n// that much wider — see `useCramped`.\n//\n// A vertical destination's label stays on one line and is cut short with an\n// ellipsis where the destination's share of the bar ends, and a label cut\n// short shows its full text in the browser's tooltip on hover — see\n// `src/navigation`. The label is held 4dp in from either side of the share,\n// so an ellipsis never touches the label beside it. Five destinations give\n// each label 61dp at a 375dp window and 58dp at 360dp, about nine\n// characters of label medium, so five destinations' names have to be short.\n// Once the reader has enlarged their text, by a text-only zoom or a minimum\n// font size, the label takes further lines instead and the bar grows to hold\n// them, since that text no longer fits the lengths around it — see\n// src/hooks/useEnlargedText.ts.\n//\n// The 64dp is the destinations' row rather than the bar's height, and the\n// bar grows past it: by padding the call site gives it, such as the inset a\n// phone's home indicator asks for, and with its labels under a reader's\n// wider text spacing. The bar adds no inset of its own, since only the call\n// site knows whether the bar sits at the screen's edge.\n//\n// The bar is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kzQI83: \"x1iyjqo2\",\n kjj79g: \"xl56j7k\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n }\n};\n\n// The window size the bar draws its horizontal form at, which the styles read\n// as `media.medium`. Spelled again for `matchMedia`, the one thing here that\n// has to know it outside a stylesheet — see `useCramped`.\nconst HORIZONTAL = '(width >= 600px)';\ntype NavigationBarProps = RenderComponentProps<'nav'> & {\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The bar of three to five top-level destinations a compact window keeps at\n * its bottom edge. Each destination is a link, so it routes through React\n * Aria's `RouterProvider` when the app has one. The bar is a navigation\n * landmark, so name it with `aria-label`, and give a badge its words in\n * `badgeLabel`, since the badge itself is hidden from assistive technology.\n *\n * Its form follows the window. Below 600px each destination is vertical, its\n * icon over its label, and the destinations share the bar's width; from 600px\n * each is a horizontal pill, once the window is wide enough for every label\n * to show whole.\n *\n * ```tsx\n * <NavigationBar aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationBar.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationBar.Item>\n * <NavigationBar.Item\n * badge={3}\n * badgeLabel=\"3 new\"\n * href=\"/second\"\n * icon={<SecondIcon />}\n * >\n * Second item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/third\" icon={<ThirdIcon />}>\n * Third item\n * </NavigationBar.Item>\n * </NavigationBar>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`. A bar kept at\n * the bottom edge of a phone's screen clears its home indicator with padding,\n * which adds to the bar's height rather than squeezing the destinations:\n *\n * ```tsx\n * <NavigationBar\n * aria-label=\"Label\"\n * style={{ paddingBlockEnd: 'env(safe-area-inset-bottom)' }}\n * >\n * ```\n */\nfunction NavigationBar({\n children,\n render,\n selectedRoute,\n ...props\n}: NavigationBarProps) {\n // The element, held as state rather than in a ref object, since the bar\n // measures it from an effect and has to run again when it changes.\n const [element, setElement] = useState<HTMLElement | null>(null);\n const isCramped = useCramped(element);\n // The call site's ref lands on the same element. Read off `props` rather\n // than destructured, as `useRender` reads it, so the compiler sees a prop\n // holding still rather than a ref read during render.\n const merged = useMemo(() => mergeRefs(setElement, props.ref ?? undefined), [props.ref]);\n const context = useMemo(() => ({\n form: isCramped ? 'barCramped' as const : 'bar' as const,\n selectedRoute\n }), [isCramped, selectedRoute]);\n const bar = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n className: \"x6s0dn4 x1mjdul6 x9f619 x78zum5 xh8yej3 x8nclml\"\n }, props),\n children: <NavigationList layout={styles.destinations}>{children}</NavigationList>,\n ref: merged\n },\n render\n });\n return <NavigationContext value={context}>{bar}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation bar — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationBar`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationBarItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\n\n/**\n * How much wider the bar would have to be for none of its labels to be cut\n * short: what each one lacks of its own width, summed. A label is the last\n * part of its destination's link, in its item of the bar's list.\n */\nfunction shortfallOf(bar: HTMLElement) {\n let total = 0;\n for (const destination of bar.querySelectorAll(':scope > ul > li > a')) {\n const label = destination.lastElementChild;\n if (label instanceof HTMLElement) {\n total += Math.max(0, label.scrollWidth - label.clientWidth);\n }\n }\n return total;\n}\n\n/**\n * Whether `bar`, at a width that draws its horizontal form, is too narrow\n * for it, so it draws the vertical one instead.\n *\n * The horizontal form is measured as it is drawn: where it cuts labels short,\n * the bar records the width it would need and switches, and it switches back\n * once it is that wide. A change to the destinations' text clears the record,\n * since what they need has changed with it. Measured in a layout effect, so\n * a bar that cannot fit is never painted cut short.\n */\nfunction useCramped(bar: HTMLElement | null) {\n // The bar's width the horizontal form needs, while it is wider than the\n // bar; undefined while the horizontal form fits, or has not been measured.\n const [needed, setNeeded] = useState<number | undefined>(undefined);\n useLayoutEffect(() => {\n if (bar === null) {\n return undefined;\n }\n const measure = () => {\n if (needed !== undefined) {\n if (bar.clientWidth >= needed) {\n setNeeded(undefined);\n }\n return;\n }\n if (!window.matchMedia(HORIZONTAL).matches) {\n return;\n }\n const shortfall = shortfallOf(bar);\n if (shortfall > 0) {\n // A pixel over, so a bar exactly as wide as the sum of fractional\n // widths does not flip back and forth.\n setNeeded(bar.clientWidth + shortfall + 1);\n }\n };\n const relabel = () => {\n setNeeded(undefined);\n };\n measure();\n const resize = new ResizeObserver(measure);\n resize.observe(bar);\n const text = new MutationObserver(relabel);\n text.observe(bar, {\n characterData: true,\n childList: true,\n subtree: true\n });\n return () => {\n resize.disconnect();\n text.disconnect();\n };\n }, [bar, needed]);\n return needed !== undefined;\n}\nNavigationBar.Item = NavigationBarItem;\nexport type { NavigationItemProps as NavigationBarItemProps, NavigationBarProps };\nexport { NavigationBarItem };\nexport default NavigationBar;"],"mappings":";;;;;;;;;;AAwDA,MAAMM,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AAKA,MAAMC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDnB,SAAAE,cAAAC,IAAA;CAAA,MAAAC,IAAAlB,EAAA,EAAA;CAAA,IAAAmB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN;CAAA,IAAAG,EAAA,OAAAD,IAAA;EAAuB,CAAA,CAAAE,UAAAE,QAAAN,eAAA,GAAAK,SAAAH;EAKFC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAH;CAAA,OAAA;EAAAI,WAAAD,EAAA;EAAAE,QAAAF,EAAA;EAAAG,SAAAH,EAAA;EAAAH,gBAAAG,EAAA;CAAA;CAGnB,MAAA,CAAAI,SAAAC,cAA8BrB,SAA6B,IAAI;CAC/D,MAAAsB,YAAkBC,WAAWH,OAAO;CAIe,MAAAI,KAAAN,MAAKO,OAALC,KAAAA;CAAsB,IAAAC;CAAA,IAAAX,EAAA,OAAAQ,IAAA;EAA5CG,KAAA1B,UAAUoB,YAAYG,EAAsB;EAACR,EAAA,KAAAQ;EAAAR,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAA1E,MAAAY,SAA6BD;CAErB,MAAAE,KAAAP,YAAY,eAAwB;CAAc,IAAAQ;CAAA,IAAAd,EAAA,OAAAH,iBAAAG,EAAA,OAAAa,IAAA;E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KAAAA,CAAS;GAAC;GAEtB6B,QAAQ;GACR,MAAAM,SAAe,IAAIC,eAAeP,OAAO;GACzCM,OAAME,QAASxB,GAAG;GAClB,MAAAyB,OAAa,IAAIC,iBAAiBL,OAAO;GACzCI,KAAID,QAASxB,KAAK;IAAA2B,eACD;IAAIC,WACR;IAAIC,SACN;GACX,CAAC;GAAC,aACK;IACLP,OAAMQ,WAAY;IAClBL,KAAIK,WAAY;GAAC;EAClB;EACA7C,KAAA,CAACe,KAAKc,MAAM;EAACrC,EAAA,KAAAuB;EAAAvB,EAAA,KAAAqC;EAAArC,EAAA,KAAAD;EAAAC,EAAA,KAAAQ;CAAA,OAAA;EAAAT,KAAAC,EAAA;EAAAQ,KAAAR,EAAA;CAAA;CArChBjB,gBAAgBgB,IAqCbS,EAAa;CAAC,OACV6B,WAAW3B,KAAAA;AAAS;AAE7BZ,cAAcwD,OAAO7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","useRender","mergeStyles","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. The expanded rail's labels sit beside their\n// icons, with the rest of the rail's 360dp at most.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 2dp ring, and 2dp more under forced colours, where the ring is twice\n// as heavy — see `ringWeight` in src/navigation/styles.ts. The destinations\n// scroll, and a scroll container clips what overflows it, so the block they\n// scroll in is padded by this much and pulled back out by as much, which\n// leaves every destination where it was and every ring whole.\nconst RING_REACH = {\n default: '4px',\n [FORCED_COLORS]: '6px'\n};\nconst RING_PULL = {\n default: '-4px',\n [FORCED_COLORS]: '-6px'\n};\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x1k49i25 x1n2n1b5\",\n kUOVxO: \"xr6ywxm x1g55pzu\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"x12ulsxz xf989l1\",\n kg3NbH: \"xfn1xvj x1rsxkid\",\n $$css: true\n }\n};\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;AAoDA,MAAMG,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAI,eAAAC,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAA,IAAA0B;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAA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mBAAAV,OAAA;CAAA,MAAAZ,IAAAzB,EAAA,CAAA;CAAA,IAAAwB;CAAA,IAAAC,EAAA,OAAAY,OAAA;EACSb,KAAA,oBAAC,gBAAD,EAAe,GAAKa,MAAK,CAAA;EAAIZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAeyB,OAAOD"}
1
+ {"version":3,"file":"index.js","names":["_c","useRender","mergeStyles","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. Once the reader has enlarged their text, by\n// a text-only zoom or a minimum font size, the label takes further lines\n// instead and its destination grows to hold them, since that text no longer\n// fits the lengths around it — see src/hooks/useEnlargedText.ts. The expanded\n// rail's labels sit beside their icons, with the rest of the rail's 360dp at\n// most.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 2dp ring, and 2dp more under forced colours, where the ring is twice\n// as heavy — see `ringWeight` in src/navigation/styles.ts. The destinations\n// scroll, and a scroll container clips what overflows it, so the block they\n// scroll in is padded by this much and pulled back out by as much, which\n// leaves every destination where it was and every ring whole.\nconst RING_REACH = {\n default: '4px',\n [FORCED_COLORS]: '6px'\n};\nconst RING_PULL = {\n default: '-4px',\n [FORCED_COLORS]: '-6px'\n};\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x1k49i25 x1n2n1b5\",\n kUOVxO: \"xr6ywxm x1g55pzu\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"x12ulsxz xf989l1\",\n kg3NbH: \"xfn1xvj x1rsxkid\",\n $$css: true\n }\n};\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;AAwDA,MAAMG,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAI,eAAAC,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAA,IAAA0B;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAAAQ;EAGtBf,aAAAc,OAAAG,KAAAA,IAAA,QAAAH;EAMQ,MAAAI,KAAAlB,aAAa,aAAsB;EAAoB,IAAAmB;EAAA,IAAAf,EAAA,QAAAH,iBAAAG,EAAA,QAAAc,IAAA;GADhCC,MAAA;IAAAC,MACvBF;IAAuDjB;GA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AA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAeyB,OAAOD"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
+ import { useEnlargedText } from "../../hooks/useEnlargedText.js";
3
4
  import { refCallback } from "../../render/ref.js";
4
5
  import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
5
6
  import Badge from "../badge/index.js";
@@ -283,7 +284,7 @@ function tabClasses({ layout, orientation, variant }, stacked) {
283
284
  return props(styles.tab, layout === "scrollable" && !vertical && styles.tabScrollable, vertical && styles.tabVertical, stacked && styles.tabStacked, state.isSelected ? roles.active : styles.tabInactive, !state.isSelected && engaged && styles.tabInactiveEngaged, state.isHovered && (state.isSelected ? roles.activeHovered : roles.inactiveHovered), state.isFocusVisible && (state.isSelected ? roles.activeFocused : roles.inactiveFocused), state.isPressed && roles.pressed, state.isDisabled && styles.tabDisabled);
284
285
  };
285
286
  }
286
- function tabContent(children, { layout, orientation, variant }, icon, badge) {
287
+ function tabContent(children, { layout, orientation, variant }, icon, badge, isEnlarged) {
287
288
  const hasIcon = icon !== void 0 && icon !== null;
288
289
  const stacked = hasIcon && variant === "primary";
289
290
  const after = stacked ? null : badgeFor(badge);
@@ -293,10 +294,14 @@ function tabContent(children, { layout, orientation, variant }, icon, badge) {
293
294
  const text = /* @__PURE__ */ jsx("span", {
294
295
  ...{
295
296
  0: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub x1h7i4cw" },
296
- 2: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub xh0615m" },
297
- 1: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1h7i4cw x1yc453h" },
298
- 3: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub xh0615m x1yc453h" }
299
- }[!!stacked << 1 | !!(orientation === "vertical") << 0],
297
+ 4: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub xh0615m" },
298
+ 2: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1h7i4cw x1yc453h" },
299
+ 6: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub xh0615m x1yc453h" },
300
+ 1: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub x1uy8f9d" },
301
+ 5: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x2b8uid x1ua5tub x1uy8f9d" },
302
+ 3: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1yc453h x1uy8f9d" },
303
+ 7: { className: "x104kibb xkjl1po xb3r6kr xj0a0fe x1ua5tub x1yc453h x1uy8f9d" }
304
+ }[!!stacked << 2 | !!(orientation === "vertical") << 1 | !!(isEnlarged && layout === "fixed") << 0],
300
305
  children: typeof children === "function" ? children(state) : children
301
306
  });
302
307
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("span", {
@@ -523,12 +528,13 @@ function TabsPanels(props) {
523
528
  return t1;
524
529
  }
525
530
  function TabsTab(t0) {
526
- const $ = c(14);
531
+ const $ = c(15);
527
532
  const { badge, children, icon, ref, render, ...props } = t0;
528
533
  const panels = useContext(PanelsContext);
529
534
  const bar = useContext(BarContext);
530
535
  const hasPanel = props.id !== void 0 && panels.has(props.id);
531
536
  const stacked = icon !== void 0 && icon !== null && bar.variant === "primary";
537
+ const isEnlarged = useEnlargedText();
532
538
  const T0 = Tab;
533
539
  let t1;
534
540
  if ($[0] !== ref) {
@@ -539,16 +545,17 @@ function TabsTab(t0) {
539
545
  const t2 = tabRenderer(hasPanel, render);
540
546
  const t3 = mergeStatefulStyles(tabClasses(bar, stacked), props);
541
547
  let t4;
542
- if ($[2] !== badge || $[3] !== bar || $[4] !== children || $[5] !== icon) {
543
- t4 = tabContent(children, bar, icon, badge);
548
+ if ($[2] !== badge || $[3] !== bar || $[4] !== children || $[5] !== icon || $[6] !== isEnlarged) {
549
+ t4 = tabContent(children, bar, icon, badge, isEnlarged);
544
550
  $[2] = badge;
545
551
  $[3] = bar;
546
552
  $[4] = children;
547
553
  $[5] = icon;
548
- $[6] = t4;
549
- } else t4 = $[6];
554
+ $[6] = isEnlarged;
555
+ $[7] = t4;
556
+ } else t4 = $[7];
550
557
  let t5;
551
- if ($[7] !== T0 || $[8] !== props || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
558
+ if ($[8] !== T0 || $[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t4) {
552
559
  t5 = /* @__PURE__ */ jsx(T0, {
553
560
  ...props,
554
561
  ref: t1,
@@ -556,14 +563,14 @@ function TabsTab(t0) {
556
563
  ...t3,
557
564
  children: t4
558
565
  });
559
- $[7] = T0;
560
- $[8] = props;
561
- $[9] = t1;
562
- $[10] = t2;
563
- $[11] = t3;
564
- $[12] = t4;
565
- $[13] = t5;
566
- } else t5 = $[13];
566
+ $[8] = T0;
567
+ $[9] = props;
568
+ $[10] = t1;
569
+ $[11] = t2;
570
+ $[12] = t3;
571
+ $[13] = t4;
572
+ $[14] = t5;
573
+ } else t5 = $[14];
567
574
  return t5;
568
575
  }
569
576
  Tabs.List = TabsList;