@kanso-labs/kanso-ui 0.45.21 → 0.45.22

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.
Files changed (46) hide show
  1. package/dist/calendar/index.js +119 -11
  2. package/dist/calendar/index.js.map +1 -1
  3. package/dist/calendar/styles.js +19 -1
  4. package/dist/calendar/styles.js.map +1 -1
  5. package/dist/components/app-bar/index.d.ts +8 -2
  6. package/dist/components/app-bar/index.js +123 -73
  7. package/dist/components/app-bar/index.js.map +1 -1
  8. package/dist/components/calendar/index.d.ts +3 -3
  9. package/dist/components/calendar/index.js +8 -19
  10. package/dist/components/calendar/index.js.map +1 -1
  11. package/dist/components/carousel/index.d.ts +22 -3
  12. package/dist/components/carousel/index.js +26 -14
  13. package/dist/components/carousel/index.js.map +1 -1
  14. package/dist/components/chip-group/index.js +3 -0
  15. package/dist/components/chip-group/index.js.map +1 -1
  16. package/dist/components/color-picker/index.js +64 -46
  17. package/dist/components/color-picker/index.js.map +1 -1
  18. package/dist/components/color-swatch/index.js +20 -16
  19. package/dist/components/color-swatch/index.js.map +1 -1
  20. package/dist/components/copy-field/index.js +1 -0
  21. package/dist/components/copy-field/index.js.map +1 -1
  22. package/dist/components/date-range-picker/index.js +165 -81
  23. package/dist/components/date-range-picker/index.js.map +1 -1
  24. package/dist/components/index.d.ts +2 -2
  25. package/dist/components/popover/index.js +14 -4
  26. package/dist/components/popover/index.js.map +1 -1
  27. package/dist/components/range-calendar/index.js +53 -80
  28. package/dist/components/range-calendar/index.js.map +1 -1
  29. package/dist/components/segmented-button/index.js +261 -145
  30. package/dist/components/segmented-button/index.js.map +1 -1
  31. package/dist/components/sheet/index.js +149 -82
  32. package/dist/components/sheet/index.js.map +1 -1
  33. package/dist/components/table/index.js +251 -123
  34. package/dist/components/table/index.js.map +1 -1
  35. package/dist/hooks/useRipple.js +3 -2
  36. package/dist/hooks/useRipple.js.map +1 -1
  37. package/dist/index.d.ts +2 -2
  38. package/dist/segments/index.js +2 -1
  39. package/dist/segments/index.js.map +1 -1
  40. package/dist/segments/styles.js +5 -1
  41. package/dist/segments/styles.js.map +1 -1
  42. package/dist/styles/focus.js.map +1 -1
  43. package/dist/styles.css +40 -8
  44. package/dist/swatch/index.js +19 -0
  45. package/dist/swatch/index.js.map +1 -0
  46. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","RefObject","ClassNameOrFunction","DialogProps","DialogTriggerProps","HeadingProps","PopoverRenderProps","StyleOrFunction","TextProps","stylex","createContext","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","useInteractOutside","ButtonContext","DEFAULT_SLOT","Dialog","DialogContext","DialogTrigger","Heading","HeadingContext","OverlayTriggerStateContext","PreviewTrigger","Popover","RACPopover","PopoverContext","RACPopoverContext","Text","TextContext","useSlottedContext","OverlayAlign","OverlaySide","OverlayScope","mergeRefs","focus","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","spacing","typography","DEFAULT_SIDE_OFFSET","styles","content","kGO01o","kLKAdn","kg3NbH","$$css","description","kB7OPa","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","md","ks0D6T","sm","title","DEFAULT_HOVER_DELAY","DEFAULT_HOVER_CLOSE_DELAY","PopoverAlign","PopoverSide","PopoverSize","modal","size","DescriptionContext","id","TitleContext","TEXT_SLOTS","slots","PopoverProps","Omit","children","closeDelay","delay","trigger","PopoverTrigger","PanelDialog","t0","$","labelledBy","onPressWithin","props","slot","t1","t2","t3","t4","render","_render","t5","t6","ref","state","triggerOf","pressed","undefined","titleId","titled","setTitled","Symbol","for","registerTitle","level","headings","onPress","close","t7","t8","buttons","t10","t9","element","current","contains","document","activeElement","preventScroll","t11","t12","t13","t14","popupDialog","ring","t15","t16","t17","t18","context","PopoverContent","alignOffset","className","container","style","triggerRef","align","side","sideOffset","handed","panel","merged","pressedWithin","markPressWithin","own","triggers","fromTrigger","isOutsideTrigger","isOpen","event","target","Element","isDisabled","onInteractOutside","onInteractOutsideStart","descriptions","setDescriptions","ids","ids_0","at","indexOf","slice","registerDescription","length","Set","join","describedBy","t19","t20","popup","placement","t21","t22","t23","PopoverDescription","register","generated","PopoverTitle","Content","Description","Title","PopoverContentProps","PopoverDescriptionProps","PopoverTitleProps","PopoverContext","_c","props","stylex.props","Popover","RACPopoverContext","RACPopover"],"sources":["../../../src/components/popover/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes, RefObject } from 'react';\nimport type { ClassNameOrFunction, DialogProps, DialogTriggerProps, HeadingProps, PopoverRenderProps, StyleOrFunction, TextProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { useInteractOutside } from 'react-aria';\nimport { ButtonContext, DEFAULT_SLOT, Dialog, DialogContext, DialogTrigger, Heading, HeadingContext, OverlayTriggerStateContext, PreviewTrigger, Popover as RACPopover, PopoverContext as RACPopoverContext, Text, TextContext, useSlottedContext } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The gap between the anchor and the panel, matching `spacing.sm`'s default.\n// A number rather than the token, because React Aria computes the position in\n// JavaScript and so cannot read a CSS custom property — this is the one place\n// in the component where a step of the spacing scale is spelled out. React\n// Aria's own default is 8 as well, but the value is this component's decision\n// rather than an inherited one.\nconst DEFAULT_SIDE_OFFSET = 8;\n\n// The surface, its entry and the dialog's focus ring are the overlay module's,\n// shared with every anchored overlay; what is here is Popover's own — its\n// inset, its two widths, and the type of its title and description.\n//\n// Popover has no page of its own, so the inset and the type follow the rich\n// tooltip, the nearest thing the Material Design pages draw: a plain rounded\n// panel offset from its anchor, with no caret drawn between the two, holding\n// a subhead over supporting text.\n//\n// React Aria's popover is two elements — the positioned panel and the dialog\n// inside it — so the styles are split the same way: the surface, `content`\n// and a size on the panel, the dialog style on the element that carries the\n// role.\nconst styles = {\n content: {\n kGO01o: \"xqf7pud\",\n kLKAdn: \"x6gmt8y\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n description: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n md: {\n ks0D6T: \"x10u2fgw\",\n $$css: true\n },\n sm: {\n ks0D6T: \"xjjheoa\",\n $$css: true\n },\n title: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\n\n// How long a pointer rests on the trigger before a hovered popover opens,\n// and how long it has to leave before it closes. React Aria's own defaults,\n// spelled out because they are the whole feel of a hover trigger and worth\n// finding in the component rather than in a changelog.\nconst DEFAULT_HOVER_DELAY = 600;\nconst DEFAULT_HOVER_CLOSE_DELAY = 200;\n\n// The overlay module's, since which side a surface opens on is the same\n// question for every anchored overlay. Aliased rather than re-declared so\n// the names a call site imports stay this component's.\ntype PopoverAlign = OverlayAlign;\ntype PopoverSide = OverlaySide;\ntype PopoverSize = 'md' | 'sm';\n\n// `size` and `modal` are declared on the root, where a reader expects to set\n// the shape of the whole popover, but it is `Popover.Content` that has to\n// apply them. Through context rather than making the call site repeat them —\n// the same arrangement Sheet uses, and worth keeping identical between the\n// two panels a consumer is most likely to reach for in the same afternoon.\nconst PopoverContext = createContext<{\n modal: boolean;\n size: PopoverSize;\n}>({\n modal: false,\n size: 'md'\n});\n\n// React Aria points a dialog's `aria-describedby` at its description slot\n// only for an alert dialog, on the grounds that an ordinary dialog's content\n// is read anyway. A popover's description names what the panel is for, so it\n// is pointed at here: each description reports the id it renders while it is\n// mounted, and the dialog follows those ids, since an `aria-describedby` with\n// nothing at the other end is an invalid reference rather than a harmless one.\n// The id is the one the element carries, a call site's own included, and each\n// description has one of its own, so a second description adds its id rather\n// than sharing the first's, and unmounting either leaves the other.\nconst DescriptionContext = createContext<(id: string) => () => void>(() => () => {});\n\n// The same for the title, which the non-modal panel names itself by — see\n// PanelDialog. React Aria's own Dialog finds its title by looking for it;\n// the panel here is told it is there.\nconst TitleContext = createContext<() => () => void>(() => () => {});\n\n// The text slot the description fills, with the default beside it so a\n// plain `Text` still renders. Hoisted, since it never changes.\nconst TEXT_SLOTS = {\n slots: {\n [DEFAULT_SLOT]: {},\n description: {}\n }\n};\ntype PopoverProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n /**\n * How long the pointer has to leave a hovered popover before it closes, in\n * milliseconds. Ignored by a pressed one.\n * @default 200\n */\n closeDelay?: number;\n /**\n * How long the pointer has to rest on the trigger before a hovered popover\n * opens, in milliseconds. Ignored by a pressed one.\n * @default 600\n */\n delay?: number;\n /**\n * Blocks the page behind the panel while it is open, as a dialog would.\n * Off by default: a popover leaves the page interactive, which is the\n * difference from `Sheet`.\n * @default false\n */\n modal?: boolean;\n /**\n * Panel width: `sm` caps at 240px, `md` at 320px. Either way the panel is\n * only as wide as its contents, and never wider than the viewport.\n * @default 'md'\n */\n size?: PopoverSize;\n /**\n * What opens the panel: a press, or a pointer resting on the trigger.\n * `hover` is the tooltips page's rich tooltip — it opens on hover, focus\n * or a long press, and stays open while the pointer is inside it, so the\n * panel's own buttons and links can be reached.\n * @default 'press'\n */\n trigger?: PopoverTrigger;\n};\ntype PopoverTrigger = 'hover' | 'press';\n\n/**\n * The element that carries the dialog role in a non-modal popover: what\n * React Aria's `Dialog` gives a modal one — the role, the name from the\n * title, the description, and the close slot — without the two things that\n * make `Dialog` a modal's.\n *\n * `Dialog` moves focus into itself as it mounts, whatever opened it, and\n * holds focus inside the overlay until it closes. A hover popover therefore\n * took focus from wherever the reader was typing the moment a pointer\n * rested on its trigger, and Tab in an open popover went round its own\n * controls forever, though the page behind a non-modal popover is meant to\n * stay in reach. Here a pressed popover still takes focus as it opens, since\n * a press asked for the panel, but a hovered one leaves it where it is, and\n * Tab past the panel's last control carries on from the trigger in the\n * page. React Aria's popover sees a dialog inside it and so adds no role or\n * focus handling of its own.\n */\nfunction PanelDialog({\n 'aria-labelledby': labelledBy,\n children,\n id,\n onPressWithin,\n // React Aria's render prop is the one part of a dialog's props this\n // element cannot honour, being an element of its own rather than React\n // Aria's; left out rather than spread onto the DOM.\n render: _render,\n slot,\n ...props\n}: Omit<PopoverContentProps, 'align' | 'alignOffset' | 'className' | 'container' | 'side' | 'sideOffset' | 'style' | 'triggerRef'> & {\n /**\n * Called when a press starts anywhere inside the panel in React's tree,\n * which takes in what an overlay opened from the panel draws elsewhere in\n * the document — see `PopoverContent`.\n */\n onPressWithin: () => void;\n}) {\n const ref = useRef<HTMLElement>(null);\n const state = useContext(OverlayTriggerStateContext);\n // What the trigger hands its overlay: the id the trigger's\n // `aria-controls` points at, and the trigger itself as the name of a\n // panel with no title. A hover trigger hands nothing, and is a hover\n // trigger for exactly that reason.\n const trigger = triggerOf(useContext(DialogContext));\n const pressed = trigger !== undefined;\n const titleId = useId();\n const [titled, setTitled] = useState(false);\n const registerTitle = useCallback(() => {\n setTitled(true);\n return () => {\n setTitled(false);\n };\n }, []);\n const headings = useMemo(() => ({\n slots: {\n [DEFAULT_SLOT]: {},\n title: {\n id: titleId,\n level: 2\n }\n }\n }), [titleId]);\n const buttons = useMemo(() => ({\n slots: {\n close: {\n onPress: () => {\n state?.close();\n }\n },\n [DEFAULT_SLOT]: {}\n }\n }), [state]);\n useEffect(() => {\n const element = ref.current;\n if (pressed && element !== null && !element.contains(document.activeElement)) {\n element.focus({\n preventScroll: true\n });\n }\n }, [pressed]);\n return (\n // A section with the role, as React Aria's own dialog is: a `<dialog>`\n // element brings the browser's own positioning, border, padding and top\n // layer, all of which the panel around it already decides.\n <section {...props} aria-labelledby={labelledBy ?? (titled ? titleId : trigger?.labelledBy)} id={id ?? trigger?.id} onPointerDownCapture={onPressWithin} ref={ref}\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a `<dialog>` element would bring the browser's own positioning and top layer, which the panel around it already decides\n role=\"dialog\" slot={slot ?? undefined} tabIndex={-1} {...stylex.props(overlay.popupDialog, focus.ring)}>\n <HeadingContext value={headings}>\n <TextContext value={TEXT_SLOTS}>\n <ButtonContext value={buttons}>\n <TitleContext value={registerTitle}>{children}</TitleContext>\n </ButtonContext>\n </TextContext>\n </HeadingContext>\n </section>\n );\n}\n\n/**\n * A panel anchored to the control that opened it. Open state is React Aria's:\n * pass `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Non-modal by design — the page behind stays scrollable and clickable, which\n * is the difference from `Sheet`. Pass `modal` to change that. Escape, a press\n * anywhere outside the panel and a button given `slot=\"close\"` close it, and\n * a press on its trigger toggles it. Inside a dialog, a press on the scrim\n * closes the popover first and the dialog on the next, as a menu does.\n *\n * Composed rather than configured by props, because a popover's contents are\n * arbitrary — the parts are `Popover.Content`, `Popover.Title`, and\n * `Popover.Description`. A `Button` or `IconButton` placed directly inside\n * `Popover` opens it, and one given `slot=\"close\"` inside the content closes\n * it; neither needs a part of its own. Where the panel sits against its\n * trigger is `Popover.Content`'s `side` and `align`.\n *\n * ```tsx\n * <Popover>\n * <Button>Open</Button>\n * <Popover.Content side=\"end\">\n * <Popover.Title>Headline</Popover.Title>\n * <Popover.Description>Supporting line</Popover.Description>\n * <Button slot=\"close\" variant=\"text\">\n * Dismiss\n * </Button>\n * </Popover.Content>\n * </Popover>\n * ```\n */\nfunction Popover({\n children,\n closeDelay = DEFAULT_HOVER_CLOSE_DELAY,\n delay = DEFAULT_HOVER_DELAY,\n modal = false,\n size = 'md',\n trigger = 'press',\n ...props\n}: PopoverProps) {\n // A hovered popover is React Aria's preview trigger, which is a different\n // element around the same parts rather than a mode of the pressed one: it\n // opens from hover, focus or a long press, and it is always non-modal,\n // since a panel that blocked the page while the pointer merely rested on\n // something would be a trap. `modal` is ignored there rather than\n // refused, so the content draws the non-modal panel whatever it says.\n const context = useMemo(() => ({\n modal: modal && trigger !== 'hover',\n size\n }), [modal, size, trigger]);\n if (trigger === 'hover') {\n return <PopoverContext value={context}>\n <PreviewTrigger closeDelay={closeDelay} delay={delay} {...props}>\n {children}\n </PreviewTrigger>\n </PopoverContext>;\n }\n return <PopoverContext value={context}>\n <DialogTrigger {...props}>{children}</DialogTrigger>\n </PopoverContext>;\n}\n\n/**\n * The panel itself. Everything the popover shows goes in here; the trigger\n * stays outside it, since the trigger lives in the page while this is\n * portalled out to the end of the body.\n *\n * Placement is React Aria's anchor positioning, so the panel flips to the\n * opposite side and shifts along the edge of the viewport on its own rather\n * than being clipped by it.\n */\nfunction PopoverContent({\n align = 'center',\n alignOffset,\n children,\n className,\n container,\n ref,\n side = 'bottom',\n sideOffset = DEFAULT_SIDE_OFFSET,\n style,\n triggerRef,\n ...props\n}: PopoverContentProps & RefAttributes<HTMLElement>) {\n const {\n modal,\n size\n } = useContext(PopoverContext);\n const state = useContext(OverlayTriggerStateContext);\n // The trigger React Aria hands its popover, for a content part given no\n // `triggerRef` of its own.\n const handed = useSlottedContext(RACPopoverContext)?.triggerRef;\n\n // A non-modal popover is one React Aria closes on blur alone: a press on\n // blank page left it open, and a press on its own trigger closed it as\n // focus left the panel and opened it again on the same press. Here a\n // press anywhere outside the panel closes it, and a press on the trigger\n // is left to the trigger, which toggles it.\n //\n // What an overlay opened from inside the panel draws — a select's list, a\n // menu — is portalled elsewhere in the document, so a press there is\n // outside the panel's element though it is within the panel's tree. React\n // carries the press up that tree, and the panel marks it as within before\n // the press ends; the outside press is read on its end, so the mark is\n // there to read. Each press outside clears it as it starts.\n const panel = useRef<HTMLElement>(null);\n const merged = useMemo(() => mergeRefs(panel, ref ?? undefined), [ref]);\n const pressedWithin = useRef(false);\n const markPressWithin = useCallback(() => {\n pressedWithin.current = true;\n }, []);\n // The two refs the trigger may come through, kept where a callback can\n // read them at the moment of a press rather than as dependencies, which a\n // ref is not.\n const triggers = useRef({\n handed,\n own: triggerRef\n });\n useEffect(() => {\n triggers.current = {\n handed,\n own: triggerRef\n };\n });\n const isOutsideTrigger = useCallback((element: Element) => {\n const {\n handed: fromTrigger,\n own\n } = triggers.current;\n const trigger = own?.current ?? fromTrigger?.current;\n return !(trigger?.contains(element) ?? false);\n }, []);\n useInteractOutside({\n isDisabled: modal || state === null || !state.isOpen,\n onInteractOutside: event => {\n if (pressedWithin.current) {\n pressedWithin.current = false;\n return;\n }\n if (event.target instanceof Element && !isOutsideTrigger(event.target)) {\n return;\n }\n state?.close();\n },\n onInteractOutsideStart: () => {\n pressedWithin.current = false;\n },\n ref: panel\n });\n\n // The ids of the descriptions mounted in the panel, one entry per\n // description, in the order they mounted.\n const [descriptions, setDescriptions] = useState<readonly string[]>([]);\n const registerDescription = useCallback((id: string) => {\n setDescriptions(ids => [...ids, id]);\n return () => {\n setDescriptions(ids => {\n const at = ids.indexOf(id);\n return at === -1 ? ids : [...ids.slice(0, at), ...ids.slice(at + 1)];\n });\n };\n }, []);\n const describedBy = descriptions.length > 0 ? [...new Set(descriptions)].join(' ') : undefined;\n return <OverlayScope>\n <RACPopover crossOffset={alignOffset} isNonModal={!modal} offset={sideOffset} placement={placementOf(side, align)}\n // The surface, where the call site's class and style land, rather than\n // the dialog inside it, which takes the rest of the props.\n ref={merged}\n // Focus leaving for the trigger closes nothing: the trigger's own\n // press toggles the panel, and closing it first reopened it.\n shouldCloseOnInteractOutside={modal ? undefined : isOutsideTrigger} triggerRef={triggerRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles((render: PopoverRenderProps) => stylex.props(overlay.popup, styles.content, styles[size], popupOrigin(render.placement)), {\n className,\n style\n })}>\n {modal ? <Dialog aria-describedby={describedBy} {...props} {...stylex.props(overlay.popupDialog, focus.ring)}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </Dialog> : <PanelDialog aria-describedby={describedBy} onPressWithin={markPressWithin} {...props}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </PanelDialog>}\n </RACPopover>\n </OverlayScope>;\n}\n\n/**\n * Supporting copy under the title. The panel's `aria-describedby` points at\n * it — see DescriptionContext for why that is this component's doing.\n */\nfunction PopoverDescription(props: PopoverDescriptionProps & RefAttributes<HTMLElement>) {\n const register = useContext(DescriptionContext);\n const generated = useId();\n const id = props.id ?? generated;\n useEffect(() => register(id), [id, register]);\n return <Text slot=\"description\" {...props} id={id} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * Names the popover. Rendered through React Aria's title slot, which is what\n * points the panel's `aria-labelledby` at it — a popover without one announces\n * itself unnamed.\n */\nfunction PopoverTitle(props: PopoverTitleProps & RefAttributes<HTMLHeadingElement>) {\n const register = useContext(TitleContext);\n useEffect(() => register(), [register]);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * What a pressed trigger hands the overlay it opens: the id its\n * `aria-controls` points at, and its own id to name a panel with no title.\n * Read field by field, since the context's type also admits a slotted\n * value; a hover trigger hands nothing.\n */\nfunction triggerOf(context: unknown) {\n if (typeof context !== 'object' || context === null || 'slots' in context) {\n return undefined;\n }\n return {\n id: 'id' in context && typeof context.id === 'string' ? context.id : undefined,\n labelledBy: 'aria-labelledby' in context && typeof context['aria-labelledby'] === 'string' ? context['aria-labelledby'] : undefined\n };\n}\nPopover.Content = PopoverContent;\nPopover.Description = PopoverDescription;\nPopover.Title = PopoverTitle;\n\n// The dialog's own props, plus the four that place the panel and its\n// styling. Those belong to the positioned panel rather than to the dialog,\n// but a call site has no reason to know there are two elements — `className`\n// and `style` reach the panel, which is the one worth restyling, and\n// everything else lands on the dialog.\ntype PopoverContentProps = Omit<DialogProps, 'children' | 'className' | 'style'> & {\n /**\n * Where the panel sits along the side it opens on.\n * @default 'center'\n */\n align?: PopoverAlign;\n /** Moves the panel along that side, in pixels. */\n alignOffset?: number;\n children?: ReactNode;\n /** A function may compute the class from the panel's render state. */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * Where to portal the panel. Defaults to the container of the `ThemeScope`\n * around it, which keeps the popover 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 popover\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Which side of the trigger the panel opens on. It flips to the opposite\n * side when there is no room. `start` and `end` follow the writing\n * direction, so `end` is the right in English and the left in Arabic;\n * `left` and `right` stay put in either.\n * @default 'bottom'\n */\n side?: PopoverSide;\n /**\n * The gap between the trigger and the panel, in pixels.\n * @default 8\n */\n sideOffset?: number;\n /** A function may compute the style from the panel's render state. */\n style?: StyleOrFunction<PopoverRenderProps>;\n /**\n * An element to anchor the panel to other than the trigger that opened it.\n */\n triggerRef?: RefObject<Element | null>;\n};\ntype PopoverDescriptionProps = TextProps;\ntype PopoverTitleProps = HeadingProps;\nexport type { PopoverAlign, PopoverContentProps, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitleProps, PopoverTrigger };\nexport { PopoverContent, PopoverDescription, PopoverTitle };\nexport default Popover;"],"mappings":";;;;;;;;;;;;;AAu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AMgG,SAAS;EAAG1F,KAAA,CAAC0F,QAAQ;EAAC/F,EAAA,KAAA+F;EAAA/F,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAA;EAAAN,KAAAC,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAtC5E,UAAU2E,IAAkBM,EAAU;CAAC,IAAAC;CAAA,IAAAN,EAAA,OAAAG,OAAA;EACKG,KAAAtD,YAAY,EAAAoG,WAC3C,qEACb,GAAGjD,KAAK;EAACH,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAG,SAAAH,EAAA,OAAAM,IAAA;EAFFC,KAAA,oBAAC,SAAD;GAAc,MAAA;GAAO,GAAKJ;GAAK,GAAMG;EAEnC,CAAA;EAAIN,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAFNO;AAEM;;;;;;;AASf,SAASQ,UAAUkC,SAAkB;CACnC,IAAI,OAAOA,YAAY,YAAYA,YAAY,QAAQ,WAAWA,SAChE;CAEF,OAAO;EACL9D,IAAI,QAAQ8D,WAAW,OAAOA,QAAQ9D,OAAO,WAAW8D,QAAQ9D,KAAK8B,KAAAA;EACrEhB,YAAY,qBAAqBgD,WAAW,OAAOA,QAAQ,uBAAuB,WAAWA,QAAQ,qBAAqBhC,KAAAA;CAC5H;AACF;AACA9E,UAAQ+J,UAAUhD;AAClB/G,UAAQgK,cAAcL;AACtB3J,UAAQiK,QAAQH"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","RefObject","ClassNameOrFunction","DialogProps","DialogTriggerProps","HeadingProps","PopoverRenderProps","StyleOrFunction","TextProps","stylex","createContext","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","useInteractOutside","ButtonContext","DEFAULT_SLOT","Dialog","DialogContext","DialogTrigger","Heading","HeadingContext","OverlayTriggerStateContext","PreviewTrigger","Popover","RACPopover","PopoverContext","RACPopoverContext","Text","TextContext","useSlottedContext","OverlayAlign","OverlaySide","OverlayScope","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","spacing","typography","DEFAULT_SIDE_OFFSET","styles","content","kGO01o","kLKAdn","kg3NbH","$$css","description","kB7OPa","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","dialog","k3XXqK","dialogRing","kjBf7l","kInvED","kMeerF","md","ks0D6T","sm","title","DEFAULT_HOVER_DELAY","DEFAULT_HOVER_CLOSE_DELAY","PopoverAlign","PopoverSide","PopoverSize","modal","size","DescriptionContext","id","TitleContext","TEXT_SLOTS","slots","PopoverProps","Omit","children","closeDelay","delay","trigger","PopoverTrigger","PanelDialog","t0","$","labelledBy","onPressWithin","props","slot","t1","t2","t3","t4","render","_render","t5","t6","ref","state","triggerOf","pressed","undefined","titleId","titled","setTitled","Symbol","for","registerTitle","level","headings","onPress","close","t7","t8","buttons","t10","t9","element","current","contains","document","activeElement","focus","preventScroll","t11","t12","t13","t14","popupDialog","t15","t16","t17","t18","context","PopoverContent","alignOffset","className","container","style","triggerRef","align","side","sideOffset","handed","panel","merged","pressedWithin","markPressWithin","own","triggers","fromTrigger","isOutsideTrigger","isOpen","event","target","Element","isDisabled","onInteractOutside","onInteractOutsideStart","descriptions","setDescriptions","ids","ids_0","at","indexOf","slice","registerDescription","length","Set","join","describedBy","t19","t20","popup","placement","t21","t22","t23","PopoverDescription","register","generated","PopoverTitle","Content","Description","Title","PopoverContentProps","PopoverDescriptionProps","PopoverTitleProps","PopoverContext","_c","props","stylex.props","Popover","RACPopoverContext","RACPopover"],"sources":["../../../src/components/popover/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes, RefObject } from 'react';\nimport type { ClassNameOrFunction, DialogProps, DialogTriggerProps, HeadingProps, PopoverRenderProps, StyleOrFunction, TextProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { useInteractOutside } from 'react-aria';\nimport { ButtonContext, DEFAULT_SLOT, Dialog, DialogContext, DialogTrigger, Heading, HeadingContext, OverlayTriggerStateContext, PreviewTrigger, Popover as RACPopover, PopoverContext as RACPopoverContext, Text, TextContext, useSlottedContext } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The gap between the anchor and the panel, matching `spacing.sm`'s default.\n// A number rather than the token, because React Aria computes the position in\n// JavaScript and so cannot read a CSS custom property — this is the one place\n// in the component where a step of the spacing scale is spelled out. React\n// Aria's own default is 8 as well, but the value is this component's decision\n// rather than an inherited one.\nconst DEFAULT_SIDE_OFFSET = 8;\n\n// The surface and its entry are the overlay module's, shared with every\n// anchored overlay; what is here is Popover's own — its inset, its two\n// widths, the type of its title and description, and where the dialog's\n// focus ring is drawn.\n//\n// Popover has no page of its own, so the inset and the type follow the rich\n// tooltip, the nearest thing the Material Design pages draw: a plain rounded\n// panel offset from its anchor, with no caret drawn between the two, holding\n// a subhead over supporting text.\n//\n// React Aria's popover is two elements — the positioned panel and the dialog\n// inside it — so the styles are split the same way: the surface, `content`,\n// a size and the dialog's focus ring on the panel, the dialog style on the\n// element that carries the role.\nconst styles = {\n content: {\n kGO01o: \"xqf7pud\",\n kLKAdn: \"x6gmt8y\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n description: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n dialog: {\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n dialogRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xbrmr3i x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n md: {\n ks0D6T: \"x10u2fgw\",\n $$css: true\n },\n sm: {\n ks0D6T: \"xjjheoa\",\n $$css: true\n },\n title: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\n\n// How long a pointer rests on the trigger before a hovered popover opens,\n// and how long it has to leave before it closes. React Aria's own defaults,\n// spelled out because they are the whole feel of a hover trigger and worth\n// finding in the component rather than in a changelog.\nconst DEFAULT_HOVER_DELAY = 600;\nconst DEFAULT_HOVER_CLOSE_DELAY = 200;\n\n// The overlay module's, since which side a surface opens on is the same\n// question for every anchored overlay. Aliased rather than re-declared so\n// the names a call site imports stay this component's.\ntype PopoverAlign = OverlayAlign;\ntype PopoverSide = OverlaySide;\ntype PopoverSize = 'md' | 'sm';\n\n// `size` and `modal` are declared on the root, where a reader expects to set\n// the shape of the whole popover, but it is `Popover.Content` that has to\n// apply them. Through context rather than making the call site repeat them —\n// the same arrangement Sheet uses, and worth keeping identical between the\n// two panels a consumer is most likely to reach for in the same afternoon.\nconst PopoverContext = createContext<{\n modal: boolean;\n size: PopoverSize;\n}>({\n modal: false,\n size: 'md'\n});\n\n// React Aria points a dialog's `aria-describedby` at its description slot\n// only for an alert dialog, on the grounds that an ordinary dialog's content\n// is read anyway. A popover's description names what the panel is for, so it\n// is pointed at here: each description reports the id it renders while it is\n// mounted, and the dialog follows those ids, since an `aria-describedby` with\n// nothing at the other end is an invalid reference rather than a harmless one.\n// The id is the one the element carries, a call site's own included, and each\n// description has one of its own, so a second description adds its id rather\n// than sharing the first's, and unmounting either leaves the other.\nconst DescriptionContext = createContext<(id: string) => () => void>(() => () => {});\n\n// The same for the title, which the non-modal panel names itself by — see\n// PanelDialog. React Aria's own Dialog finds its title by looking for it;\n// the panel here is told it is there.\nconst TitleContext = createContext<() => () => void>(() => () => {});\n\n// The text slot the description fills, with the default beside it so a\n// plain `Text` still renders. Hoisted, since it never changes.\nconst TEXT_SLOTS = {\n slots: {\n [DEFAULT_SLOT]: {},\n description: {}\n }\n};\ntype PopoverProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n /**\n * How long the pointer has to leave a hovered popover before it closes, in\n * milliseconds. Ignored by a pressed one.\n * @default 200\n */\n closeDelay?: number;\n /**\n * How long the pointer has to rest on the trigger before a hovered popover\n * opens, in milliseconds. Ignored by a pressed one.\n * @default 600\n */\n delay?: number;\n /**\n * Blocks the page behind the panel while it is open, as a dialog would.\n * Off by default: a popover leaves the page interactive, which is the\n * difference from `Sheet`.\n * @default false\n */\n modal?: boolean;\n /**\n * Panel width: `sm` caps at 240px, `md` at 320px. Either way the panel is\n * only as wide as its contents, and never wider than the viewport.\n * @default 'md'\n */\n size?: PopoverSize;\n /**\n * What opens the panel: a press, or a pointer resting on the trigger.\n * `hover` is the tooltips page's rich tooltip — it opens on hover, focus\n * or a long press, and stays open while the pointer is inside it, so the\n * panel's own buttons and links can be reached.\n * @default 'press'\n */\n trigger?: PopoverTrigger;\n};\ntype PopoverTrigger = 'hover' | 'press';\n\n/**\n * The element that carries the dialog role in a non-modal popover: what\n * React Aria's `Dialog` gives a modal one — the role, the name from the\n * title, the description, and the close slot — without the two things that\n * make `Dialog` a modal's.\n *\n * `Dialog` moves focus into itself as it mounts, whatever opened it, and\n * holds focus inside the overlay until it closes. A hover popover therefore\n * took focus from wherever the reader was typing the moment a pointer\n * rested on its trigger, and Tab in an open popover went round its own\n * controls forever, though the page behind a non-modal popover is meant to\n * stay in reach. Here a pressed popover still takes focus as it opens, since\n * a press asked for the panel, but a hovered one leaves it where it is, and\n * Tab past the panel's last control carries on from the trigger in the\n * page. React Aria's popover sees a dialog inside it and so adds no role or\n * focus handling of its own.\n */\nfunction PanelDialog({\n 'aria-labelledby': labelledBy,\n children,\n id,\n onPressWithin,\n // React Aria's render prop is the one part of a dialog's props this\n // element cannot honour, being an element of its own rather than React\n // Aria's; left out rather than spread onto the DOM.\n render: _render,\n slot,\n ...props\n}: Omit<PopoverContentProps, 'align' | 'alignOffset' | 'className' | 'container' | 'side' | 'sideOffset' | 'style' | 'triggerRef'> & {\n /**\n * Called when a press starts anywhere inside the panel in React's tree,\n * which takes in what an overlay opened from the panel draws elsewhere in\n * the document — see `PopoverContent`.\n */\n onPressWithin: () => void;\n}) {\n const ref = useRef<HTMLElement>(null);\n const state = useContext(OverlayTriggerStateContext);\n // What the trigger hands its overlay: the id the trigger's\n // `aria-controls` points at, and the trigger itself as the name of a\n // panel with no title. A hover trigger hands nothing, and is a hover\n // trigger for exactly that reason.\n const trigger = triggerOf(useContext(DialogContext));\n const pressed = trigger !== undefined;\n const titleId = useId();\n const [titled, setTitled] = useState(false);\n const registerTitle = useCallback(() => {\n setTitled(true);\n return () => {\n setTitled(false);\n };\n }, []);\n const headings = useMemo(() => ({\n slots: {\n [DEFAULT_SLOT]: {},\n title: {\n id: titleId,\n level: 2\n }\n }\n }), [titleId]);\n const buttons = useMemo(() => ({\n slots: {\n close: {\n onPress: () => {\n state?.close();\n }\n },\n [DEFAULT_SLOT]: {}\n }\n }), [state]);\n useEffect(() => {\n const element = ref.current;\n if (pressed && element !== null && !element.contains(document.activeElement)) {\n element.focus({\n preventScroll: true\n });\n }\n }, [pressed]);\n return (\n // A section with the role, as React Aria's own dialog is: a `<dialog>`\n // element brings the browser's own positioning, border, padding and top\n // layer, all of which the panel around it already decides.\n <section {...props} aria-labelledby={labelledBy ?? (titled ? titleId : trigger?.labelledBy)} id={id ?? trigger?.id} onPointerDownCapture={onPressWithin} ref={ref}\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a `<dialog>` element would bring the browser's own positioning and top layer, which the panel around it already decides\n role=\"dialog\" slot={slot ?? undefined} tabIndex={-1} {...stylex.props(overlay.popupDialog, styles.dialog)}>\n <HeadingContext value={headings}>\n <TextContext value={TEXT_SLOTS}>\n <ButtonContext value={buttons}>\n <TitleContext value={registerTitle}>{children}</TitleContext>\n </ButtonContext>\n </TextContext>\n </HeadingContext>\n </section>\n );\n}\n\n/**\n * A panel anchored to the control that opened it. Open state is React Aria's:\n * pass `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Non-modal by design — the page behind stays scrollable and clickable, which\n * is the difference from `Sheet`. Pass `modal` to change that. Escape, a press\n * anywhere outside the panel and a button given `slot=\"close\"` close it, and\n * a press on its trigger toggles it. Inside a dialog, a press on the scrim\n * closes the popover first and the dialog on the next, as a menu does.\n *\n * Composed rather than configured by props, because a popover's contents are\n * arbitrary — the parts are `Popover.Content`, `Popover.Title`, and\n * `Popover.Description`. A `Button` or `IconButton` placed directly inside\n * `Popover` opens it, and one given `slot=\"close\"` inside the content closes\n * it; neither needs a part of its own. Where the panel sits against its\n * trigger is `Popover.Content`'s `side` and `align`.\n *\n * ```tsx\n * <Popover>\n * <Button>Open</Button>\n * <Popover.Content side=\"end\">\n * <Popover.Title>Headline</Popover.Title>\n * <Popover.Description>Supporting line</Popover.Description>\n * <Button slot=\"close\" variant=\"text\">\n * Dismiss\n * </Button>\n * </Popover.Content>\n * </Popover>\n * ```\n */\nfunction Popover({\n children,\n closeDelay = DEFAULT_HOVER_CLOSE_DELAY,\n delay = DEFAULT_HOVER_DELAY,\n modal = false,\n size = 'md',\n trigger = 'press',\n ...props\n}: PopoverProps) {\n // A hovered popover is React Aria's preview trigger, which is a different\n // element around the same parts rather than a mode of the pressed one: it\n // opens from hover, focus or a long press, and it is always non-modal,\n // since a panel that blocked the page while the pointer merely rested on\n // something would be a trap. `modal` is ignored there rather than\n // refused, so the content draws the non-modal panel whatever it says.\n const context = useMemo(() => ({\n modal: modal && trigger !== 'hover',\n size\n }), [modal, size, trigger]);\n if (trigger === 'hover') {\n return <PopoverContext value={context}>\n <PreviewTrigger closeDelay={closeDelay} delay={delay} {...props}>\n {children}\n </PreviewTrigger>\n </PopoverContext>;\n }\n return <PopoverContext value={context}>\n <DialogTrigger {...props}>{children}</DialogTrigger>\n </PopoverContext>;\n}\n\n/**\n * The panel itself. Everything the popover shows goes in here; the trigger\n * stays outside it, since the trigger lives in the page while this is\n * portalled out to the end of the body.\n *\n * Placement is React Aria's anchor positioning, so the panel flips to the\n * opposite side and shifts along the edge of the viewport on its own rather\n * than being clipped by it.\n */\nfunction PopoverContent({\n align = 'center',\n alignOffset,\n children,\n className,\n container,\n ref,\n side = 'bottom',\n sideOffset = DEFAULT_SIDE_OFFSET,\n style,\n triggerRef,\n ...props\n}: PopoverContentProps & RefAttributes<HTMLElement>) {\n const {\n modal,\n size\n } = useContext(PopoverContext);\n const state = useContext(OverlayTriggerStateContext);\n // The trigger React Aria hands its popover, for a content part given no\n // `triggerRef` of its own.\n const handed = useSlottedContext(RACPopoverContext)?.triggerRef;\n\n // A non-modal popover is one React Aria closes on blur alone: a press on\n // blank page left it open, and a press on its own trigger closed it as\n // focus left the panel and opened it again on the same press. Here a\n // press anywhere outside the panel closes it, and a press on the trigger\n // is left to the trigger, which toggles it.\n //\n // What an overlay opened from inside the panel draws — a select's list, a\n // menu — is portalled elsewhere in the document, so a press there is\n // outside the panel's element though it is within the panel's tree. React\n // carries the press up that tree, and the panel marks it as within before\n // the press ends; the outside press is read on its end, so the mark is\n // there to read. Each press outside clears it as it starts.\n const panel = useRef<HTMLElement>(null);\n const merged = useMemo(() => mergeRefs(panel, ref ?? undefined), [ref]);\n const pressedWithin = useRef(false);\n const markPressWithin = useCallback(() => {\n pressedWithin.current = true;\n }, []);\n // The two refs the trigger may come through, kept where a callback can\n // read them at the moment of a press rather than as dependencies, which a\n // ref is not.\n const triggers = useRef({\n handed,\n own: triggerRef\n });\n useEffect(() => {\n triggers.current = {\n handed,\n own: triggerRef\n };\n });\n const isOutsideTrigger = useCallback((element: Element) => {\n const {\n handed: fromTrigger,\n own\n } = triggers.current;\n const trigger = own?.current ?? fromTrigger?.current;\n return !(trigger?.contains(element) ?? false);\n }, []);\n useInteractOutside({\n isDisabled: modal || state === null || !state.isOpen,\n onInteractOutside: event => {\n if (pressedWithin.current) {\n pressedWithin.current = false;\n return;\n }\n if (event.target instanceof Element && !isOutsideTrigger(event.target)) {\n return;\n }\n state?.close();\n },\n onInteractOutsideStart: () => {\n pressedWithin.current = false;\n },\n ref: panel\n });\n\n // The ids of the descriptions mounted in the panel, one entry per\n // description, in the order they mounted.\n const [descriptions, setDescriptions] = useState<readonly string[]>([]);\n const registerDescription = useCallback((id: string) => {\n setDescriptions(ids => [...ids, id]);\n return () => {\n setDescriptions(ids => {\n const at = ids.indexOf(id);\n return at === -1 ? ids : [...ids.slice(0, at), ...ids.slice(at + 1)];\n });\n };\n }, []);\n const describedBy = descriptions.length > 0 ? [...new Set(descriptions)].join(' ') : undefined;\n return <OverlayScope>\n <RACPopover crossOffset={alignOffset} isNonModal={!modal} offset={sideOffset} placement={placementOf(side, align)}\n // The surface, where the call site's class and style land, rather than\n // the dialog inside it, which takes the rest of the props.\n ref={merged}\n // Focus leaving for the trigger closes nothing: the trigger's own\n // press toggles the panel, and closing it first reopened it.\n shouldCloseOnInteractOutside={modal ? undefined : isOutsideTrigger} triggerRef={triggerRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles((render: PopoverRenderProps) => stylex.props(overlay.popup, styles.content, styles.dialogRing, styles[size], popupOrigin(render.placement)), {\n className,\n style\n })}>\n {modal ? <Dialog aria-describedby={describedBy} {...props} {...stylex.props(overlay.popupDialog, styles.dialog)}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </Dialog> : <PanelDialog aria-describedby={describedBy} onPressWithin={markPressWithin} {...props}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </PanelDialog>}\n </RACPopover>\n </OverlayScope>;\n}\n\n/**\n * Supporting copy under the title. The panel's `aria-describedby` points at\n * it — see DescriptionContext for why that is this component's doing.\n */\nfunction PopoverDescription(props: PopoverDescriptionProps & RefAttributes<HTMLElement>) {\n const register = useContext(DescriptionContext);\n const generated = useId();\n const id = props.id ?? generated;\n useEffect(() => register(id), [id, register]);\n return <Text slot=\"description\" {...props} id={id} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * Names the popover. Rendered through React Aria's title slot, which is what\n * points the panel's `aria-labelledby` at it — a popover without one announces\n * itself unnamed.\n */\nfunction PopoverTitle(props: PopoverTitleProps & RefAttributes<HTMLHeadingElement>) {\n const register = useContext(TitleContext);\n useEffect(() => register(), [register]);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * What a pressed trigger hands the overlay it opens: the id its\n * `aria-controls` points at, and its own id to name a panel with no title.\n * Read field by field, since the context's type also admits a slotted\n * value; a hover trigger hands nothing.\n */\nfunction triggerOf(context: unknown) {\n if (typeof context !== 'object' || context === null || 'slots' in context) {\n return undefined;\n }\n return {\n id: 'id' in context && typeof context.id === 'string' ? context.id : undefined,\n labelledBy: 'aria-labelledby' in context && typeof context['aria-labelledby'] === 'string' ? context['aria-labelledby'] : undefined\n };\n}\nPopover.Content = PopoverContent;\nPopover.Description = PopoverDescription;\nPopover.Title = PopoverTitle;\n\n// The dialog's own props, plus the four that place the panel and its\n// styling. Those belong to the positioned panel rather than to the dialog,\n// but a call site has no reason to know there are two elements — `className`\n// and `style` reach the panel, which is the one worth restyling, and\n// everything else lands on the dialog.\ntype PopoverContentProps = Omit<DialogProps, 'children' | 'className' | 'style'> & {\n /**\n * Where the panel sits along the side it opens on.\n * @default 'center'\n */\n align?: PopoverAlign;\n /** Moves the panel along that side, in pixels. */\n alignOffset?: number;\n children?: ReactNode;\n /** A function may compute the class from the panel's render state. */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * Where to portal the panel. Defaults to the container of the `ThemeScope`\n * around it, which keeps the popover 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 popover\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Which side of the trigger the panel opens on. It flips to the opposite\n * side when there is no room. `start` and `end` follow the writing\n * direction, so `end` is the right in English and the left in Arabic;\n * `left` and `right` stay put in either.\n * @default 'bottom'\n */\n side?: PopoverSide;\n /**\n * The gap between the trigger and the panel, in pixels.\n * @default 8\n */\n sideOffset?: number;\n /** A function may compute the style from the panel's render state. */\n style?: StyleOrFunction<PopoverRenderProps>;\n /**\n * An element to anchor the panel to other than the trigger that opened it.\n */\n triggerRef?: RefObject<Element | null>;\n};\ntype PopoverDescriptionProps = TextProps;\ntype PopoverTitleProps = HeadingProps;\nexport type { PopoverAlign, PopoverContentProps, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitleProps, PopoverTrigger };\nexport { PopoverContent, PopoverDescription, PopoverTitle };\nexport default Popover;"],"mappings":";;;;;;;;;;;;AAsBA,MAAMkD,sBAAsB;AAgB5B,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,QAAQ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EAAAN,KAAAC,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAtCjF,UAAUgF,IAAkBM,EAAU;CAAC,IAAAC;CAAA,IAAAN,EAAA,OAAAG,OAAA;EACKG,KAAA5D,YAAY,EAAA0G,WAC3C,qEACb,GAAGjD,KAAK;EAACH,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAG,SAAAH,EAAA,OAAAM,IAAA;EAFFC,KAAA,oBAAC,SAAD;GAAc,MAAA;GAAO,GAAKJ;GAAK,GAAMG;EAEnC,CAAA;EAAIN,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAFNO;AAEM;;;;;;;AASf,SAASQ,UAAUkC,SAAkB;CACnC,IAAI,OAAOA,YAAY,YAAYA,YAAY,QAAQ,WAAWA,SAChE;CAEF,OAAO;EACL9D,IAAI,QAAQ8D,WAAW,OAAOA,QAAQ9D,OAAO,WAAW8D,QAAQ9D,KAAK8B,KAAAA;EACrEhB,YAAY,qBAAqBgD,WAAW,OAAOA,QAAQ,uBAAuB,WAAWA,QAAQ,qBAAqBhC,KAAAA;CAC5H;AACF;AACAnF,UAAQoK,UAAUhD;AAClBpH,UAAQqK,cAAcL;AACtBhK,UAAQsK,QAAQH"}
@@ -1,13 +1,12 @@
1
1
  "use client";
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
- import { CalendarFrame, CalendarGridHeader as CalendarGridHeader$1 } from "../../calendar/index.js";
4
- import { monthOffsets } from "../../calendar/months.js";
3
+ import { CalendarFrame, CalendarMonths } from "../../calendar/index.js";
5
4
  import { calendarStyles, dateLayers } from "../../calendar/styles.js";
6
5
  import { focus } from "../../styles/focus.js";
7
6
  import { mergeStatefulStyles } from "../../styles/merge.js";
8
7
  import { c } from "react/compiler-runtime";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- import { CalendarCell, CalendarGrid, CalendarGridBody, RangeCalendar } from "react-aria-components";
8
+ import { jsx } from "react/jsx-runtime";
9
+ import { CalendarCell, RangeCalendar } from "react-aria-components";
11
10
  // src/components/range-calendar/index.tsx
12
11
  function cellClassName(state) {
13
12
  const isEnd = state.isSelected && (state.isSelectionStart || state.isSelectionEnd);
@@ -47,95 +46,69 @@ function gridCell(date) {
47
46
  * element a layout positions.
48
47
  */
49
48
  function RangeCalendar$1(t0) {
50
- const $ = c(23);
49
+ const $ = c(17);
51
50
  let T0;
52
- let T1;
51
+ let props$1;
52
+ let showMonthYearMenus;
53
53
  let t1;
54
54
  let t2;
55
- let t3;
56
- let t4;
57
- let t5;
58
- let t6;
59
55
  if ($[0] !== t0) {
60
- const { showMonthYearMenus: t7, ...props$1 } = t0;
61
- const showMonthYearMenus = t7 === void 0 ? false : t7;
62
- T1 = RangeCalendar;
63
- t5 = props$1;
64
- t6 = mergeStatefulStyles(props(calendarStyles.root), props$1);
65
- T0 = CalendarFrame;
66
- t3 = props$1.visibleDuration?.months ?? 1;
67
- t4 = showMonthYearMenus;
68
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
69
- t1 = props(calendarStyles.months);
70
- $[9] = t1;
71
- } else t1 = $[9];
72
- t2 = monthOffsets(props$1.visibleDuration?.months ?? 1).map(_temp);
56
+ const { showMonthYearMenus: t3, ...t4 } = t0;
57
+ props$1 = t4;
58
+ showMonthYearMenus = t3 === void 0 ? false : t3;
59
+ T0 = RangeCalendar;
60
+ t1 = props$1;
61
+ t2 = mergeStatefulStyles(props(calendarStyles.root), props$1);
73
62
  $[0] = t0;
74
63
  $[1] = T0;
75
- $[2] = T1;
76
- $[3] = t1;
77
- $[4] = t2;
78
- $[5] = t3;
79
- $[6] = t4;
80
- $[7] = t5;
81
- $[8] = t6;
64
+ $[2] = props$1;
65
+ $[3] = showMonthYearMenus;
66
+ $[4] = t1;
67
+ $[5] = t2;
82
68
  } else {
83
69
  T0 = $[1];
84
- T1 = $[2];
85
- t1 = $[3];
86
- t2 = $[4];
87
- t3 = $[5];
88
- t4 = $[6];
89
- t5 = $[7];
90
- t6 = $[8];
70
+ props$1 = $[2];
71
+ showMonthYearMenus = $[3];
72
+ t1 = $[4];
73
+ t2 = $[5];
91
74
  }
92
- let t7;
93
- if ($[10] !== t1 || $[11] !== t2) {
94
- t7 = /* @__PURE__ */ jsx("div", {
95
- ...t1,
96
- children: t2
75
+ const t3 = props$1.visibleDuration?.months ?? 1;
76
+ const t4 = props$1.visibleDuration?.months ?? 1;
77
+ let t5;
78
+ if ($[6] !== t4) {
79
+ t5 = /* @__PURE__ */ jsx(CalendarMonths, {
80
+ months: t4,
81
+ children: gridCell
97
82
  });
98
- $[10] = t1;
99
- $[11] = t2;
100
- $[12] = t7;
101
- } else t7 = $[12];
102
- let t8;
103
- if ($[13] !== T0 || $[14] !== t3 || $[15] !== t4 || $[16] !== t7) {
104
- t8 = /* @__PURE__ */ jsx(T0, {
83
+ $[6] = t4;
84
+ $[7] = t5;
85
+ } else t5 = $[7];
86
+ let t6;
87
+ if ($[8] !== showMonthYearMenus || $[9] !== t3 || $[10] !== t5) {
88
+ t6 = /* @__PURE__ */ jsx(CalendarFrame, {
105
89
  months: t3,
106
- showMonthYearMenus: t4,
107
- children: t7
90
+ showMonthYearMenus,
91
+ children: t5
108
92
  });
109
- $[13] = T0;
110
- $[14] = t3;
111
- $[15] = t4;
112
- $[16] = t7;
113
- $[17] = t8;
114
- } else t8 = $[17];
115
- let t9;
116
- if ($[18] !== T1 || $[19] !== t5 || $[20] !== t6 || $[21] !== t8) {
117
- t9 = /* @__PURE__ */ jsx(T1, {
118
- ...t5,
119
- ...t6,
120
- children: t8
93
+ $[8] = showMonthYearMenus;
94
+ $[9] = t3;
95
+ $[10] = t5;
96
+ $[11] = t6;
97
+ } else t6 = $[11];
98
+ let t7;
99
+ if ($[12] !== T0 || $[13] !== t1 || $[14] !== t2 || $[15] !== t6) {
100
+ t7 = /* @__PURE__ */ jsx(T0, {
101
+ ...t1,
102
+ ...t2,
103
+ children: t6
121
104
  });
122
- $[18] = T1;
123
- $[19] = t5;
124
- $[20] = t6;
125
- $[21] = t8;
126
- $[22] = t9;
127
- } else t9 = $[22];
128
- return t9;
129
- }
130
- function _temp(offset) {
131
- return /* @__PURE__ */ jsx("div", {
132
- ...props(calendarStyles.month),
133
- children: /* @__PURE__ */ jsxs(CalendarGrid, {
134
- offset,
135
- ...props(calendarStyles.grid),
136
- children: [/* @__PURE__ */ jsx(CalendarGridHeader$1, {}), /* @__PURE__ */ jsx(CalendarGridBody, { children: gridCell })]
137
- })
138
- }, offset.months);
105
+ $[12] = T0;
106
+ $[13] = t1;
107
+ $[14] = t2;
108
+ $[15] = t6;
109
+ $[16] = t7;
110
+ } else t7 = $[16];
111
+ return t7;
139
112
  }
140
113
  export { RangeCalendar$1 as default };
141
114
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","CalendarDate","ReactElement","RefAttributes","DateValue","RangeCalendarProps","RACRangeCalendarProps","stylex","CalendarCell","RACCalendarCell","CalendarGrid","RACCalendarGrid","CalendarGridBody","RACCalendarGridBody","RangeCalendar","RACRangeCalendar","CalendarFrame","CalendarGridHeader","monthOffsets","calendarStyles","dateLayers","focus","mergeStatefulStyles","className","T","showMonthYearMenus","style","Omit","cellClassName","state","isDisabled","isHovered","isPressed","isSelected","isSelectionEnd","isSelectionStart","isToday","isUnavailable","isEnd","props","cell","ring","cellToday","cellInRange","cellRangeStart","cellRangeEnd","cellSelected","selectedHovered","inRangeHovered","plainHovered","selectedPressed","inRangePressed","plainPressed","cellUnavailable","cellDisabled","gridCell","date","t0","$","T0","T1","t1","t2","t3","t4","t5","t6","t7","undefined","root","visibleDuration","months","Symbol","for","map","_temp","t8","t9","offset","month","grid","stylex.props","RACCalendarCell","RangeCalendar","_c","props","RACRangeCalendar","RACCalendarGrid","CalendarGridHeader","RACCalendarGridBody"],"sources":["../../../src/components/range-calendar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, RefAttributes } from 'react';\nimport type { DateValue, RangeCalendarProps as RACRangeCalendarProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { CalendarCell as RACCalendarCell, CalendarGrid as RACCalendarGrid, CalendarGridBody as RACCalendarGridBody, RangeCalendar as RACRangeCalendar } from 'react-aria-components';\nimport { CalendarFrame, CalendarGridHeader } from '../../calendar';\nimport { monthOffsets } from '../../calendar/months';\nimport { calendarStyles, dateLayers } from '../../calendar/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The date pickers page's calendar again, picking two dates rather than one.\n// Every part it draws is Calendar's, from `src/calendar` — the container, the\n// grid, the weekday row, the chevrons and the date circle — so the two cannot\n// come apart.\n//\n// What a range adds is the band between its two ends. The docked token set\n// stops at the selected date, so the band's colours are the modal date\n// picker's range-selection tokens — the secondary container, one step down\n// from the primary the two ends take — and its reasons are in\n// `src/calendar/styles.ts` where it is defined.\n//\n// Two things follow from drawing a band across a grid whose cells are spaced\n// apart.\n//\n// **The band is square and the ends are round.** A range of consecutive days\n// reads as one shape rather than a row of circles, and the first and last day\n// round only their outer edge, which is what makes the band begin and end at\n// a circle.\n//\n// **The band fills the whole of each day's 48dp.** A day in the range drops\n// the 4dp margin either side that every other date keeps and takes the full\n// width of its cell, so one day's band meets the next one's. Without it the\n// band arrives as a dashed run of separate blocks.\n\ntype RangeCalendarProps<T extends DateValue = DateValue> = {\n /** A function may compute the class from the calendar's render state. */\n className?: RACRangeCalendarProps<T>['className'];\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as `Calendar`'s does. The\n * year list runs a century either side of the year shown, or to\n * `minValue` and `maxValue` where they are closer.\n *\n * For one visible month. With `visibleDuration` of more than one, the\n * header is the plain one, whose heading names every month shown — the\n * menus name only the first, which would leave the others unlabelled.\n * @default false\n */\n showMonthYearMenus?: boolean;\n /** A function may compute the style from the calendar's render state. */\n style?: RACRangeCalendarProps<T>['style'];\n} & Omit<RACRangeCalendarProps<T>, 'children' | 'className' | 'style'>;\n\n// A date's classes, from React Aria's render state. StyleX cannot target\n// `[data-selected]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order is what makes a range read as one shape. Every selected day takes\n// the band; the two ends then take the circle over it, and round the outer\n// edge the band does not continue past. The hover and pressed layers come\n// next, each written for the ground under it — the circle, the band, or\n// nothing — a press over a hover. `unavailable` comes after those, so a\n// ruled-out day inside a range keeps the band and takes the strikethrough\n// over it. `disabled` is last of all, and StyleX replaces a property whole,\n// so it takes the branches above it with it.\nfunction cellClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n isSelectionEnd: boolean;\n isSelectionStart: boolean;\n isToday: boolean;\n isUnavailable: boolean;\n}) {\n const isEnd = state.isSelected && (state.isSelectionStart || state.isSelectionEnd);\n return stylex.props(calendarStyles.cell, focus.ring, state.isToday && calendarStyles.cellToday, state.isSelected && calendarStyles.cellInRange, state.isSelected && state.isSelectionStart && calendarStyles.cellRangeStart, state.isSelected && state.isSelectionEnd && calendarStyles.cellRangeEnd, isEnd && calendarStyles.cellSelected, state.isHovered && (isEnd ? dateLayers.selectedHovered : state.isSelected ? dateLayers.inRangeHovered : dateLayers.plainHovered), state.isPressed && (isEnd ? dateLayers.selectedPressed : state.isSelected ? dateLayers.inRangePressed : dateLayers.plainPressed), state.isUnavailable && calendarStyles.cellUnavailable, state.isDisabled && calendarStyles.cellDisabled).className ?? '';\n}\nfunction gridCell(date: CalendarDate): ReactElement {\n return <RACCalendarCell className={cellClassName} date={date} />;\n}\n\n/**\n * A calendar for picking a range of dates. The value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep its\n * own, both as a `{ start, end }` pair of `@internationalized/date` values\n * from this package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <RangeCalendar\n * aria-label=\"Label\"\n * defaultValue={{\n * start: new CalendarDate(2026, 9, 8),\n * end: new CalendarDate(2026, 9, 15),\n * }}\n * />\n * ```\n *\n * The two ends take the circle a selected date takes in `Calendar`, and the\n * days between them a band in the secondary container. `minValue`,\n * `maxValue`, `isDateUnavailable` and `visibleDuration` are the same props\n * `Calendar` takes, and `allowsNonContiguousRanges` lets a range skip the\n * dates ruled out inside it rather than stopping at the first.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction RangeCalendar<T extends DateValue>({\n showMonthYearMenus = false,\n ...props\n}: RangeCalendarProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACRangeCalendar<T> {...props} {...mergeStatefulStyles(stylex.props(calendarStyles.root), props)}>\n <CalendarFrame months={props.visibleDuration?.months ?? 1} showMonthYearMenus={showMonthYearMenus}>\n <div {...stylex.props(calendarStyles.months)}>\n {monthOffsets(props.visibleDuration?.months ?? 1).map(offset => <div key={offset.months} {...stylex.props(calendarStyles.month)}>\n <RACCalendarGrid offset={offset} {...stylex.props(calendarStyles.grid)}>\n <CalendarGridHeader />\n <RACCalendarGridBody>{gridCell}</RACCalendarGridBody>\n </RACCalendarGrid>\n </div>)}\n </div>\n </CalendarFrame>\n </RACRangeCalendar>;\n}\nexport type { RangeCalendarProps };\nexport default RangeCalendar;"],"mappings":";;;;;;;;;;;AAoEA,SAAS6B,cAAcC,OASpB;CACD,MAAMS,QAAQT,MAAMI,eAAeJ,MAAMM,oBAAoBN,MAAMK;CACnE,OAAO3B,MAAaY,eAAeqB,MAAMnB,MAAMoB,MAAMZ,MAAMO,WAAWjB,eAAeuB,WAAWb,MAAMI,cAAcd,eAAewB,aAAad,MAAMI,cAAcJ,MAAMM,oBAAoBhB,eAAeyB,gBAAgBf,MAAMI,cAAcJ,MAAMK,kBAAkBf,eAAe0B,cAAcP,SAASnB,eAAe2B,cAAcjB,MAAME,cAAcO,QAAQlB,WAAW2B,kBAAkBlB,M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,GAAMvE,MAAaY,eAAc6D,IAAK;GAArE,UAAA,CACE,oBAACQ,sBAAD,CAAmB,CAAA,GACnB,oBAACC,kBAAD,EAAA,UAAsBlC,SAAF,CAAA,CAFN;;CAIZ,GALkEuB,OAAMP,MAKxE;AAAA"}
1
+ {"version":3,"file":"index.js","names":["c","_c","CalendarDate","ReactElement","RefAttributes","DateValue","RangeCalendarProps","RACRangeCalendarProps","stylex","CalendarCell","RACCalendarCell","RangeCalendar","RACRangeCalendar","CalendarFrame","CalendarMonths","calendarStyles","dateLayers","focus","mergeStatefulStyles","className","T","showMonthYearMenus","style","Omit","cellClassName","state","isDisabled","isHovered","isPressed","isSelected","isSelectionEnd","isSelectionStart","isToday","isUnavailable","isEnd","props","cell","ring","cellToday","cellInRange","cellRangeStart","cellRangeEnd","cellSelected","selectedHovered","inRangeHovered","plainHovered","selectedPressed","inRangePressed","plainPressed","cellUnavailable","cellDisabled","gridCell","date","t0","$","T0","t1","t2","t3","t4","undefined","root","visibleDuration","months","t5","t6","t7","stylex.props","RACCalendarCell","RangeCalendar","_c","props","RACRangeCalendar"],"sources":["../../../src/components/range-calendar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, RefAttributes } from 'react';\nimport type { DateValue, RangeCalendarProps as RACRangeCalendarProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { CalendarCell as RACCalendarCell, RangeCalendar as RACRangeCalendar } from 'react-aria-components';\nimport { CalendarFrame, CalendarMonths } from '../../calendar';\nimport { calendarStyles, dateLayers } from '../../calendar/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The date pickers page's calendar again, picking two dates rather than one.\n// Every part it draws is Calendar's, from `src/calendar` — the container, the\n// grid, the weekday row, the chevrons and the date circle — so the two cannot\n// come apart.\n//\n// What a range adds is the band between its two ends. The docked token set\n// stops at the selected date, so the band's colours are the modal date\n// picker's range-selection tokens — the secondary container, one step down\n// from the primary the two ends take — and its reasons are in\n// `src/calendar/styles.ts` where it is defined.\n//\n// Two things follow from drawing a band across a grid whose cells are spaced\n// apart.\n//\n// **The band is square and the ends are round.** A range of consecutive days\n// reads as one shape rather than a row of circles, and the first and last day\n// round only their outer edge, which is what makes the band begin and end at\n// a circle.\n//\n// **The band fills the whole of each day's 48dp.** A day in the range drops\n// the 4dp margin either side that every other date keeps and takes the full\n// width of its cell, so one day's band meets the next one's. Without it the\n// band arrives as a dashed run of separate blocks.\n\ntype RangeCalendarProps<T extends DateValue = DateValue> = {\n /** A function may compute the class from the calendar's render state. */\n className?: RACRangeCalendarProps<T>['className'];\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as `Calendar`'s does. The\n * year list runs a century either side of the year shown, or to\n * `minValue` and `maxValue` where they are closer.\n *\n * For one visible month. With `visibleDuration` of more than one, the\n * header is the plain one, whose heading names every month shown — the\n * menus name only the first, which would leave the others unlabelled.\n * @default false\n */\n showMonthYearMenus?: boolean;\n /** A function may compute the style from the calendar's render state. */\n style?: RACRangeCalendarProps<T>['style'];\n} & Omit<RACRangeCalendarProps<T>, 'children' | 'className' | 'style'>;\n\n// A date's classes, from React Aria's render state. StyleX cannot target\n// `[data-selected]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order is what makes a range read as one shape. Every selected day takes\n// the band; the two ends then take the circle over it, and round the outer\n// edge the band does not continue past. The hover and pressed layers come\n// next, each written for the ground under it — the circle, the band, or\n// nothing — a press over a hover. `unavailable` comes after those, so a\n// ruled-out day inside a range keeps the band and takes the strikethrough\n// over it. `disabled` is last of all, and StyleX replaces a property whole,\n// so it takes the branches above it with it.\nfunction cellClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n isSelectionEnd: boolean;\n isSelectionStart: boolean;\n isToday: boolean;\n isUnavailable: boolean;\n}) {\n const isEnd = state.isSelected && (state.isSelectionStart || state.isSelectionEnd);\n return stylex.props(calendarStyles.cell, focus.ring, state.isToday && calendarStyles.cellToday, state.isSelected && calendarStyles.cellInRange, state.isSelected && state.isSelectionStart && calendarStyles.cellRangeStart, state.isSelected && state.isSelectionEnd && calendarStyles.cellRangeEnd, isEnd && calendarStyles.cellSelected, state.isHovered && (isEnd ? dateLayers.selectedHovered : state.isSelected ? dateLayers.inRangeHovered : dateLayers.plainHovered), state.isPressed && (isEnd ? dateLayers.selectedPressed : state.isSelected ? dateLayers.inRangePressed : dateLayers.plainPressed), state.isUnavailable && calendarStyles.cellUnavailable, state.isDisabled && calendarStyles.cellDisabled).className ?? '';\n}\nfunction gridCell(date: CalendarDate): ReactElement {\n return <RACCalendarCell className={cellClassName} date={date} />;\n}\n\n/**\n * A calendar for picking a range of dates. The value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep its\n * own, both as a `{ start, end }` pair of `@internationalized/date` values\n * from this package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <RangeCalendar\n * aria-label=\"Label\"\n * defaultValue={{\n * start: new CalendarDate(2026, 9, 8),\n * end: new CalendarDate(2026, 9, 15),\n * }}\n * />\n * ```\n *\n * The two ends take the circle a selected date takes in `Calendar`, and the\n * days between them a band in the secondary container. `minValue`,\n * `maxValue`, `isDateUnavailable` and `visibleDuration` are the same props\n * `Calendar` takes, and `allowsNonContiguousRanges` lets a range skip the\n * dates ruled out inside it rather than stopping at the first.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction RangeCalendar<T extends DateValue>({\n showMonthYearMenus = false,\n ...props\n}: RangeCalendarProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACRangeCalendar<T> {...props} {...mergeStatefulStyles(stylex.props(calendarStyles.root), props)}>\n <CalendarFrame months={props.visibleDuration?.months ?? 1} showMonthYearMenus={showMonthYearMenus}>\n <CalendarMonths months={props.visibleDuration?.months ?? 1}>\n {gridCell}\n </Calend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