@motech-development/breeze-ui 4.8.0 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/provider/BreezeContext.ts","../src/patterns/AppearanceControl/AppearanceControl.tsx","../src/primitives/Skeleton/Skeleton.tsx","../src/primitives/VisuallyHidden/VisuallyHidden.tsx","../src/primitives/Badge/Badge.tsx","../src/primitives/Button/Button.tsx","../src/primitives/Field/field.styles.ts","../src/primitives/Icon/Icon.tsx","../src/primitives/Calendar/Calendar.tsx","../src/primitives/layout.accessibility.ts","../src/primitives/Card/Card.tsx","../src/primitives/Field/field.presentation.tsx","../src/primitives/Checkbox/Checkbox.tsx","../src/primitives/SelectionControl/SelectionControl.tsx","../src/primitives/Chip/Chip.tsx","../src/primitives/Collection/collection.styles.ts","../src/overlays/OverlayStack.ts","../src/overlays/OverlayProvider.tsx","../src/primitives/Collection/CollectionPopover.tsx","../src/primitives/Collection/DescriptorContent.tsx","../src/primitives/Collection/DescriptorOption.tsx","../src/primitives/ComboBox/ComboBox.tsx","../src/primitives/Container/Container.tsx","../src/primitives/Typography/Typography.tsx","../src/primitives/DatePicker/DatePicker.tsx","../src/overlays/OverlaySurface.tsx","../src/primitives/Dialog/Dialog.tsx","../src/primitives/Drawer/Drawer.tsx","../src/primitives/Grid/Grid.tsx","../src/primitives/IconTile/IconTile.tsx","../src/primitives/Inline/Inline.tsx","../src/primitives/Menu/Menu.tsx","../src/primitives/NumberField/NumberField.tsx","../src/primitives/Popover/Popover.tsx","../src/primitives/Select/Select.tsx","../src/primitives/Separator/Separator.tsx","../src/primitives/Stack/Stack.tsx","../src/primitives/TextField/TextField.tsx","../src/primitives/Toast/Toast.tsx","../src/primitives/Toggle/Toggle.tsx","../src/primitives/ToggleGroup/ToggleGroup.tsx","../src/provider/en-GB.ts","../src/provider/BreezeProvider.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type enGB from './en-GB';\n\nexport type Appearance = 'automatic' | 'dark' | 'light';\nexport type ResolvedAppearance = Exclude<Appearance, 'automatic'>;\n\ninterface BreezeContextValue {\n appearance: Appearance;\n getMessageLocale: (message: keyof typeof enGB) => string;\n locale: string;\n messages: typeof enGB;\n resolvedAppearance: ResolvedAppearance;\n setAppearance: (appearance: Appearance) => void;\n}\n\nexport const BreezeContext = createContext<BreezeContextValue | null>(null);\n\nexport function useBreezeContext(): BreezeContextValue {\n const context = useContext(BreezeContext);\n\n if (context === null) {\n throw new Error(\n 'Breeze components must be rendered within BreezeProvider.',\n );\n }\n\n return context;\n}\n","import { ToggleButton } from 'react-aria-components/ToggleButton';\nimport { ToggleButtonGroup } from 'react-aria-components/ToggleButtonGroup';\nimport {\n type Appearance,\n useBreezeContext,\n} from '../../provider/BreezeContext';\n\nconst variants = {\n base: {\n control:\n 'breeze:flex breeze:items-center breeze:gap-breeze-2 breeze:font-breeze-sans',\n group: 'breeze:flex breeze:items-center breeze:gap-breeze-2',\n label: 'breeze:grow breeze:text-breeze-sm breeze:text-breeze-ink',\n option:\n 'breeze:inline-flex breeze:items-center breeze:min-block-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:rounded-breeze-full breeze:bg-breeze-surface breeze:text-breeze-xs breeze:font-semibold breeze:text-breeze-ink breeze:cursor-pointer breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n },\n compound: {},\n size: {},\n state: {\n selected:\n 'breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\nconst appearanceOptions = [\n {\n message: 'appearanceLight',\n value: 'light',\n },\n {\n message: 'appearanceAutomatic',\n value: 'automatic',\n },\n {\n message: 'appearanceDark',\n value: 'dark',\n },\n] as const;\n\nfunction isAppearance(value: unknown): value is Appearance {\n return appearanceOptions.some((option) => option.value === value);\n}\n\n/**\n * Lets a person choose light, automatic or dark appearance.\n *\n * @summary A three-option appearance control backed by BreezeProvider.\n */\nfunction AppearanceControl() {\n const { appearance, getMessageLocale, messages, setAppearance } =\n useBreezeContext();\n\n return (\n <div className={variants.base.control}>\n <span\n className={variants.base.label}\n lang={getMessageLocale('appearance')}\n >\n {messages.appearance}\n </span>\n <ToggleButtonGroup\n aria-label={messages.appearance}\n className={variants.base.group}\n disallowEmptySelection\n lang={getMessageLocale('appearance')}\n onSelectionChange={(keys) => {\n const [selection] = keys;\n\n if (isAppearance(selection)) {\n setAppearance(selection);\n }\n }}\n selectedKeys={[appearance]}\n selectionMode=\"single\"\n >\n {appearanceOptions.map((option) => (\n <ToggleButton\n className={[variants.base.option, variants.state.selected].join(\n ' ',\n )}\n id={option.value}\n key={option.value}\n lang={getMessageLocale(option.message)}\n >\n {messages[option.message]}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n </div>\n );\n}\n\nexport default AppearanceControl;\n","import type { CSSProperties } from 'react';\nimport { useBreezeContext } from '../../provider/BreezeContext';\n\nconst variants = {\n base: {\n skeleton:\n 'breeze:block breeze:animate-pulse breeze:appearance-none breeze:bg-breeze-ink-3 breeze:pointer-events-none breeze:forced-colors:outline breeze:forced-colors:outline-1 breeze:forced-colors:outline-[CanvasText]',\n },\n compound: {},\n size: {},\n state: {},\n variant: {\n circle: 'breeze:aspect-square breeze:rounded-breeze-full',\n rectangle: 'breeze:rounded-breeze-sm',\n text: 'breeze:block-size-breeze-3 breeze:inline-size-full breeze:rounded-breeze-xs',\n },\n} as const;\n\nexport type SkeletonShape = keyof typeof variants.variant;\n\nexport interface SkeletonProps {\n /** Any CSS length; Skeleton is the deliberate exception to token-only dimensions. */\n blockSize?: number | string;\n /** Any CSS length; Skeleton is the deliberate exception to token-only dimensions. */\n inlineSize?: number | string;\n /** Announces the loading region. Omit when another component owns the announcement. */\n label?: string;\n /** Selects the placeholder geometry. Defaults to `text`. */\n shape?: SkeletonShape;\n}\n\n/**\n * Draws an arbitrary placeholder shaped like the content it will replace.\n *\n * @summary A flexible indeterminate content placeholder.\n */\nexport function Skeleton({\n blockSize,\n inlineSize,\n label,\n shape = 'text',\n}: Readonly<SkeletonProps>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const accessibleLabel = label?.trim() || undefined;\n const circleSize = blockSize ?? inlineSize ?? '0.75rem';\n\n const dimensions: CSSProperties = {\n blockSize: shape === 'circle' ? circleSize : blockSize,\n inlineSize: shape === 'circle' ? circleSize : inlineSize,\n };\n\n return (\n <progress\n aria-hidden={accessibleLabel === undefined ? true : undefined}\n aria-label={accessibleLabel}\n className={[variants.base.skeleton, variants.variant[shape]].join(' ')}\n lang={\n accessibleLabel === messages.loading.trim()\n ? getMessageLocale('loading')\n : undefined\n }\n style={dimensions}\n />\n );\n}\n","import type { ReactNode } from 'react';\n\nconst variants = {\n base: {\n hidden: 'breeze:sr-only',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\nexport interface VisuallyHiddenProps {\n /** Content hidden visually but retained for assistive technology. */\n children: ReactNode;\n}\n\n/**\n * Hides explanatory content visually while preserving it for assistive technology.\n *\n * @summary Accessible content with no visual footprint.\n */\nexport function VisuallyHidden({ children }: Readonly<VisuallyHiddenProps>) {\n return <span className={variants.base.hidden}>{children}</span>;\n}\n","import { useBreezeContext } from '../../provider/BreezeContext';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\n\nconst variants = {\n base: {\n badge:\n 'breeze:inline-grid breeze:shrink-0 breeze:items-center breeze:whitespace-nowrap breeze:rounded-breeze-chip breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:py-breeze-px breeze:text-breeze-2xs breeze:font-bold breeze:leading-breeze-snug breeze:tracking-breeze-wide',\n content: 'breeze:[grid-area:1/1]',\n skeleton:\n 'breeze:[grid-area:1/1] breeze:grid breeze:inline-size-full breeze:items-center',\n },\n compound: {},\n size: {},\n state: {\n contentLoading: 'breeze:opacity-0',\n },\n variant: {\n brand: 'breeze:bg-breeze-brand-soft breeze:text-breeze-brand-text',\n danger: 'breeze:bg-breeze-danger/10 breeze:text-breeze-danger',\n neutral: 'breeze:bg-breeze-sunken breeze:text-breeze-ink-2',\n positive: 'breeze:bg-breeze-pos-soft breeze:text-breeze-pos',\n warning: 'breeze:bg-breeze-warn-soft breeze:text-breeze-warn',\n },\n} as const;\n\n/** Badge-specific status treatments. */\nexport type BadgeVariant = keyof typeof variants.variant;\n\nexport interface BadgeProps {\n /** Provides expanded screen-reader text when the visible badge is abbreviated. */\n 'aria-label'?: string;\n /** Short status text or a numeric count displayed by the badge. */\n children: number | string;\n /** Replaces the status with an accessible placeholder while preserving its size. */\n loading?: boolean;\n /** Selects the semantic colour treatment. Defaults to `neutral`. */\n variant?: BadgeVariant;\n}\n\n/**\n * Marks a short status or count with a Badge-specific treatment.\n *\n * @summary Compact, non-interactive status content.\n */\nexport function Badge({\n 'aria-label': ariaLabel,\n children,\n loading = false,\n variant = 'neutral',\n}: Readonly<BadgeProps>) {\n const { messages } = useBreezeContext();\n const accessibleLabel = ariaLabel?.trim() || undefined;\n let statusContent;\n\n if (loading) {\n statusContent = (\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize={8}\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n );\n } else if (accessibleLabel !== undefined) {\n statusContent = <VisuallyHidden>{accessibleLabel}</VisuallyHidden>;\n }\n\n return (\n <span\n aria-busy={loading || undefined}\n className={[variants.base.badge, variants.variant[variant]].join(' ')}\n >\n <span\n aria-hidden={\n loading || accessibleLabel !== undefined ? true : undefined\n }\n className={[\n variants.base.content,\n loading && variants.state.contentLoading,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </span>\n {statusContent}\n </span>\n );\n}\n","import type { ButtonHTMLAttributes, Ref } from 'react';\nimport { createElement } from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { ProgressBarContext } from 'react-aria-components/ProgressBar';\nimport { useSlottedContext } from 'react-aria-components/slots';\nimport { useBreezeContext } from '../../provider/BreezeContext';\n\nconst variants = {\n base: {\n button:\n 'breeze:relative breeze:inline-grid breeze:items-center breeze:justify-center breeze:gap-breeze-2 breeze:border breeze:border-solid breeze:rounded-breeze-ctl breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:cursor-pointer breeze:select-none breeze:[text-align:center] breeze:outline-offset-2 breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n label: 'breeze:[grid-area:1/1]',\n skeleton:\n 'breeze:[grid-area:1/1] breeze:inline-size-full breeze:block-size-breeze-3 breeze:rounded-breeze-xs',\n },\n compound: {\n loading: {\n danger: 'breeze:bg-breeze-on-brand/35',\n primary: 'breeze:bg-breeze-on-brand/35',\n quiet: 'breeze:bg-breeze-line-strong',\n secondary: 'breeze:bg-breeze-line-strong',\n },\n },\n size: {\n lg: 'breeze:min-block-breeze-lg breeze:ps-breeze-5 breeze:pe-breeze-5 breeze:py-breeze-3',\n md: 'breeze:min-block-breeze-md breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2',\n sm: 'breeze:min-block-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-1',\n },\n state: {\n disabled: 'breeze:cursor-not-allowed breeze:opacity-50',\n loading: 'breeze:cursor-wait',\n loadingLabel: 'breeze:opacity-0',\n loadingStatus: 'breeze:sr-only',\n },\n variant: {\n danger:\n 'breeze:border-transparent breeze:bg-breeze-danger-fill breeze:text-breeze-on-brand breeze:data-[hovered]:bg-breeze-danger-hover breeze:data-[pressed]:bg-breeze-danger-hover',\n primary:\n 'breeze:border-transparent breeze:bg-breeze-brand breeze:text-breeze-on-brand breeze:data-[hovered]:bg-breeze-brand-hover breeze:data-[pressed]:bg-breeze-brand-hover',\n quiet:\n 'breeze:border-transparent breeze:bg-transparent breeze:text-breeze-brand-text breeze:data-[hovered]:bg-breeze-brand-soft breeze:data-[pressed]:bg-breeze-brand-soft',\n secondary:\n 'breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:text-breeze-ink breeze:data-[hovered]:bg-breeze-sunken breeze:data-[pressed]:bg-breeze-sunken',\n },\n} as const;\n\n/** Connect the pending announcement to a phrasing element inside the button. */\nfunction LoadingStatus() {\n const progress = useSlottedContext(ProgressBarContext);\n const { getMessageLocale, messages } = useBreezeContext();\n\n return (\n <progress\n aria-label={messages.loading}\n className={variants.state.loadingStatus}\n id={progress?.id}\n lang={getMessageLocale('loading')}\n />\n );\n}\n\n/** Button-specific visual treatments. */\nexport type ButtonVariant = keyof typeof variants.variant;\n\n/** Shared control sizes: 34, 38 and 52px, with a 44px coarse-pointer floor. */\nexport type ControlSize = 'sm' | 'md' | 'lg';\n\nexport interface ButtonProps {\n /** Identifies the element whose contents or presence this button controls. */\n 'aria-controls'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-controls'];\n /** Identifies elements that provide additional information about the button. */\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n /** Indicates whether the controlled element is currently expanded. */\n 'aria-expanded'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-expanded'];\n /** Indicates the type of interactive popup opened by the button. */\n 'aria-haspopup'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-haspopup'];\n /** Provides an accessible name when it should differ from the visible label. */\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n /** Identifies elements whose text provides the button's accessible name. */\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n /** Visible action label, retained as the accessible name while loading. */\n children: string;\n /** Prevents activation and removes the button from the tab order. */\n disabled?: boolean;\n /** Associates a submit button with a form by its HTML `id`. */\n form?: ButtonHTMLAttributes<HTMLButtonElement>['form'];\n /** Sets the rendered button's HTML `id`. */\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Shows the button's own skeleton and prevents repeat activation. */\n loading?: boolean;\n /** Sets the name submitted with the button's form value. */\n name?: ButtonHTMLAttributes<HTMLButtonElement>['name'];\n /** Reports a semantic activation, without a DOM event. */\n onAction?: () => void;\n /** Provides access to the rendered button element. */\n ref?: Ref<HTMLButtonElement>;\n /** Selects the button's dimensions. Defaults to `md`. */\n size?: ControlSize;\n /** Selects ordinary or form-submission behaviour. Defaults to `button`. */\n type?: 'button' | 'submit';\n /** Sets the value submitted when this button submits a form. */\n value?: string;\n /** Selects the button's visual and semantic treatment. Defaults to `primary`. */\n variant?: ButtonVariant;\n}\n\n/**\n * Performs a semantic action with a visible label and an optional loading skeleton.\n *\n * @summary A closed, labelled action in four treatments and three sizes.\n */\nexport function Button({\n 'aria-controls': ariaControls,\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n disabled = false,\n form,\n id,\n loading = false,\n name,\n onAction,\n ref,\n size = 'md',\n type = 'button',\n value,\n variant = 'primary',\n}: Readonly<ButtonProps>) {\n useBreezeContext();\n\n const className = [\n variants.base.button,\n variants.variant[variant],\n variants.size[size],\n disabled && variants.state.disabled,\n loading && variants.state.loading,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <AriaButton\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel ?? children}\n aria-labelledby={ariaLabelledBy}\n className={className}\n form={form}\n id={id}\n isDisabled={disabled}\n isPending={loading}\n name={name}\n onPress={() => onAction?.()}\n ref={ref}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n // React Aria filters aria-busy; Breeze owns it on the native button.\n 'aria-busy': loading || undefined,\n // Keep the form's default submitter while pending so Enter cannot\n // bypass it through the browser's implicit-submission fallback.\n onClick: loading\n ? (event) => event.preventDefault()\n : buttonProps.onClick,\n type: type === 'submit' ? 'submit' : 'button',\n })\n }\n type={type}\n value={value}\n >\n <span\n className={[variants.base.label, loading && variants.state.loadingLabel]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </span>\n {loading && (\n <>\n <LoadingStatus />\n <span\n aria-hidden=\"true\"\n className={[\n variants.base.skeleton,\n variants.compound.loading[variant],\n ].join(' ')}\n data-breeze-skeleton=\"\"\n />\n </>\n )}\n </AriaButton>\n );\n}\n","/** Shared field chrome used by Breeze's flat field primitives. */\nexport const fieldVariants = {\n base: {\n control:\n 'breeze:relative breeze:inline-grid breeze:min-inline-size-0 breeze:inline-size-full',\n description:\n 'breeze:m-0 breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n error:\n 'breeze:m-0 breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-danger',\n input:\n 'breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-offset-2 breeze:placeholder:text-breeze-ink-3 breeze:data-[hovered]:border-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[invalid]:border-breeze-danger breeze:disabled:cursor-not-allowed breeze:disabled:bg-breeze-sunken breeze:disabled:opacity-60 breeze:read-only:cursor-default breeze:read-only:bg-breeze-sunken',\n label:\n 'breeze:m-0 breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-ink',\n root: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col breeze:gap-breeze-2',\n skeleton:\n 'breeze:pointer-events-none breeze:absolute breeze:[inset-block:0] breeze:[inset-inline:0]',\n },\n compound: {},\n size: {},\n state: {\n loadingInput: 'breeze:!opacity-0',\n },\n variant: {},\n} as const;\n\nexport function joinClassNames(\n ...classNames: Array<string | false | undefined>\n): string {\n return classNames.filter(Boolean).join(' ');\n}\n","import {\n ArrowDownLeft,\n ArrowUpRight,\n Bell,\n Building2,\n CalendarDays,\n Camera,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n Clock3,\n Download,\n Ellipsis,\n FileText,\n House,\n List as ListIcon,\n LockKeyhole,\n LogOut,\n type LucideIcon,\n Plus,\n Settings,\n Trash2,\n TriangleAlert,\n Upload,\n Users,\n X,\n} from 'lucide-react';\n\nconst artwork = {\n add: Plus,\n back: ChevronLeft,\n building: Building2,\n calendar: CalendarDays,\n camera: Camera,\n check: Check,\n clock: Clock3,\n close: X,\n delete: Trash2,\n document: FileText,\n download: Download,\n expand: ChevronDown,\n forward: ChevronRight,\n lock: LockKeyhole,\n money: ListIcon,\n moneyIn: ArrowDownLeft,\n moneyOut: ArrowUpRight,\n more: Ellipsis,\n next: ChevronRight,\n notifications: Bell,\n overview: House,\n people: Users,\n settings: Settings,\n signOut: LogOut,\n upload: Upload,\n warning: TriangleAlert,\n} satisfies Record<string, LucideIcon>;\n\nconst variants = {\n base: {\n icon: 'breeze:block breeze:shrink-0',\n },\n compound: {},\n size: {\n lg: 'breeze:block-size-breeze-6 breeze:inline-size-breeze-6',\n md: 'breeze:block-size-breeze-5 breeze:inline-size-breeze-5',\n sm: 'breeze:block-size-breeze-4 breeze:inline-size-breeze-4',\n },\n state: {\n logicalDirection: 'breeze:rtl:rotate-180',\n },\n variant: {},\n} as const;\n\nconst logicalDirectionIcons = new Set<IconName>(['back', 'forward', 'next']);\n\nexport type IconName = keyof typeof artwork;\nexport type IconSize = keyof typeof variants.size;\n\nexport interface IconProps {\n /** Names meaningful artwork; omit for an icon already described by nearby text. */\n label?: string;\n /** Selects artwork from the curated Breeze icon set. */\n name: IconName;\n /** Selects `sm`, `md`, or `lg` dimensions. Defaults to `md`. */\n size?: IconSize;\n}\n\n/**\n * Renders one curated Lucide glyph under Breeze's semantic artwork names.\n *\n * @summary The single dependency boundary for Breeze icon artwork.\n */\nexport function Icon({ label, name, size = 'md' }: Readonly<IconProps>) {\n const Artwork = artwork[name];\n const accessibleLabel = label?.trim() || undefined;\n\n return (\n <Artwork\n aria-hidden={accessibleLabel === undefined ? true : undefined}\n aria-label={accessibleLabel}\n className={[\n variants.base.icon,\n variants.size[size],\n logicalDirectionIcons.has(name) && variants.state.logicalDirection,\n ]\n .filter(Boolean)\n .join(' ')}\n focusable=\"false\"\n role={accessibleLabel === undefined ? undefined : 'img'}\n strokeWidth={1.75}\n />\n );\n}\n","import type { CalendarDate } from '@internationalized/date';\nimport { parseDate } from '@internationalized/date';\nimport {\n createElement,\n type JSX as ReactJSX,\n type KeyboardEvent as ReactKeyboardEvent,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n Calendar as AriaCalendar,\n CalendarCell as AriaCalendarCell,\n CalendarGrid as AriaCalendarGrid,\n CalendarGridBody as AriaCalendarGridBody,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarHeaderCell as AriaCalendarHeaderCell,\n CalendarHeading as AriaCalendarHeading,\n} from 'react-aria-components/Calendar';\nimport { joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport type { IsoCalendarDate } from '../Typography/Typography';\n\nconst calendarVariants = {\n base: {\n cell: 'breeze:grid breeze:min-block-breeze-8 breeze:min-inline-breeze-8 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap breeze:place-items-center breeze:rounded-breeze-full breeze:font-breeze-sans breeze:text-breeze-sm breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[focused]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[outside-month]:text-breeze-ink-3',\n disabledRoot: 'breeze:pointer-events-none breeze:[&>div:last-child]:hidden',\n grid: 'breeze:w-full breeze:table-fixed breeze:border-separate breeze:border-spacing-1 breeze:any-pointer-coarse:border-spacing-0',\n header:\n 'breeze:mb-breeze-2 breeze:flex breeze:min-block-breeze-tap breeze:items-center breeze:justify-between',\n heading:\n 'breeze:m-0 breeze:font-breeze-sans breeze:text-breeze-sm breeze:font-semibold breeze:text-breeze-ink',\n navButton:\n 'breeze:grid breeze:block-size-breeze-8 breeze:inline-size-breeze-8 breeze:place-items-center breeze:rounded-breeze-full breeze:border-0 breeze:bg-transparent breeze:text-breeze-ink-2 breeze:outline-offset-2 breeze:hover:bg-breeze-sunken breeze:focus-visible:outline-2 breeze:focus-visible:outline-solid breeze:focus-visible:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n root: 'breeze:flex breeze:flex-col breeze:gap-breeze-2 breeze:outline-none',\n selectedCell:\n 'breeze:bg-breeze-brand breeze:text-breeze-on-brand breeze:data-[focused]:data-[selected]:bg-breeze-brand breeze:data-[selected]:data-[hovered]:bg-breeze-brand breeze:data-[outside-month]:data-[selected]:text-breeze-on-brand breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-solid breeze:forced-colors:data-[selected]:outline-offset-2',\n todayCell:\n 'breeze:outline-2 breeze:outline-solid breeze:outline-breeze-brand',\n weekday:\n 'breeze:pb-breeze-1 breeze:text-center breeze:font-breeze-sans breeze:text-breeze-xs breeze:font-medium breeze:text-breeze-ink-3',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface CalendarCommonProps {\n /** Focuses the current date when the calendar mounts. */\n autoFocus?: boolean;\n /** Prevents date changes. Defaults to `false`. */\n disabled?: boolean;\n /** Accessible name for the calendar grid. */\n label: string;\n}\n\ninterface ControlledCalendarProps {\n /** Current selected ISO calendar date. */\n value: IsoCalendarDate;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledCalendarProps {\n /** Initial selected ISO calendar date. */\n defaultValue?: IsoCalendarDate;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange?: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for a controlled or uncontrolled single-date calendar. */\nexport type CalendarProps = CalendarCommonProps &\n (ControlledCalendarProps | UncontrolledCalendarProps);\n\nexport function parseCalendarDate(value: IsoCalendarDate): CalendarDate | null {\n try {\n return parseDate(value);\n } catch {\n return null;\n }\n}\n\ninterface CalendarSurfaceProps {\n autoFocus?: boolean;\n disabled: boolean;\n label: string;\n value?: CalendarDate | null;\n defaultValue?: CalendarDate | null;\n onChange?: (value: CalendarDate | null) => void;\n}\n\nfunction CalendarContent({ disabled }: Readonly<{ disabled: boolean }>) {\n return (\n <>\n <div className={calendarVariants.base.header}>\n <AriaButton\n className={calendarVariants.base.navButton}\n isDisabled={disabled}\n slot=\"previous\"\n >\n <Icon name=\"back\" size=\"sm\" />\n </AriaButton>\n <AriaCalendarHeading className={calendarVariants.base.heading} />\n <AriaButton\n className={calendarVariants.base.navButton}\n isDisabled={disabled}\n slot=\"next\"\n >\n <Icon name=\"next\" size=\"sm\" />\n </AriaButton>\n </div>\n <AriaCalendarGrid\n className={calendarVariants.base.grid}\n weekdayStyle=\"short\"\n >\n <AriaCalendarGridHeader>\n {(day) => (\n <AriaCalendarHeaderCell className={calendarVariants.base.weekday}>\n {day}\n </AriaCalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n <AriaCalendarGridBody>\n {(date) => (\n <AriaCalendarCell\n className={({ isSelected, isToday }) =>\n joinClassNames(\n calendarVariants.base.cell,\n isSelected && calendarVariants.base.selectedCell,\n isToday && !isSelected && calendarVariants.base.todayCell,\n )\n }\n date={date}\n render={(props) =>\n createElement('div', {\n ...props,\n 'aria-disabled': disabled || props['aria-disabled'],\n ...(disabled ? { 'data-disabled': true } : {}),\n tabIndex: disabled ? -1 : props.tabIndex,\n })\n }\n />\n )}\n </AriaCalendarGridBody>\n </AriaCalendarGrid>\n </>\n );\n}\n\nexport function CalendarSurface({\n autoFocus,\n defaultValue,\n disabled,\n label,\n onChange,\n value,\n}: Readonly<CalendarSurfaceProps>) {\n const selectedValueKey = value?.toString();\n const previousSelectedValueKey = useRef(selectedValueKey);\n const [focusedValue, setFocusedValue] = useState(value ?? undefined);\n\n useEffect(() => {\n if (selectedValueKey === previousSelectedValueKey.current) return;\n\n previousSelectedValueKey.current = selectedValueKey;\n\n if (value != null) {\n setFocusedValue(value);\n }\n }, [selectedValueKey, value]);\n\n const currentFocusedValue =\n value != null && selectedValueKey !== previousSelectedValueKey.current\n ? value\n : focusedValue;\n const focusProps =\n value == null\n ? {}\n : {\n focusedValue: currentFocusedValue,\n onFocusChange: setFocusedValue,\n };\n const calendarValue = value === undefined ? {} : { value };\n const calendarDefaultValue =\n defaultValue === undefined ? {} : { defaultValue };\n const calendarOnChange = onChange === undefined ? {} : { onChange };\n const calendarProps = {\n 'aria-label': label,\n autoFocus: autoFocus && !disabled,\n className: joinClassNames(\n calendarVariants.base.root,\n disabled && calendarVariants.base.disabledRoot,\n ),\n firstDayOfWeek: 'mon' as const,\n isReadOnly: disabled,\n render: disabled\n ? (props: ReactJSX.IntrinsicElements['div']) =>\n createElement('div', {\n ...props,\n 'aria-disabled': true,\n onKeyDownCapture: (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n\n event.preventDefault();\n event.stopPropagation();\n },\n })\n : undefined,\n weeksInMonth: 6,\n ...focusProps,\n ...calendarDefaultValue,\n ...calendarOnChange,\n ...calendarValue,\n };\n\n return createElement(\n AriaCalendar<CalendarDate>,\n calendarProps,\n <CalendarContent disabled={disabled} />,\n );\n}\n\n/**\n * Renders an accessible six-week, Monday-first calendar with ISO date values.\n *\n * @summary Single-date calendar selection with semantic ISO values.\n */\nexport function Calendar({\n autoFocus = false,\n defaultValue,\n disabled = false,\n label,\n onChange,\n value,\n}: Readonly<CalendarProps>) {\n const selectedValue =\n value === undefined ? undefined : parseCalendarDate(value);\n const initialValue =\n defaultValue === undefined ? undefined : parseCalendarDate(defaultValue);\n\n const handleChange = (date: CalendarDate | null) => {\n if (date) {\n onChange?.(date.toString() as IsoCalendarDate);\n }\n };\n\n return (\n <CalendarSurface\n autoFocus={autoFocus}\n defaultValue={initialValue}\n disabled={disabled}\n label={label}\n onChange={handleChange}\n value={selectedValue}\n />\n );\n}\n","interface LayoutAccessibility {\n accessibleLabel?: string;\n role?: 'group';\n}\n\nfunction getLayoutAccessibility(\n ariaLabel: string | undefined,\n element: string,\n): LayoutAccessibility {\n const accessibleLabel = ariaLabel?.trim() || undefined;\n\n return {\n accessibleLabel,\n role:\n accessibleLabel !== undefined && element === 'div' ? 'group' : undefined,\n };\n}\n\nexport default getLayoutAccessibility;\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n card: 'breeze:min-inline-size-0 breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:shadow-breeze-panel',\n },\n compound: {},\n size: {\n 0: 'breeze:p-0',\n 1: 'breeze:p-breeze-1',\n 2: 'breeze:p-breeze-2',\n 3: 'breeze:p-breeze-3',\n 4: 'breeze:p-breeze-4',\n 5: 'breeze:p-breeze-5',\n 6: 'breeze:p-breeze-6',\n 7: 'breeze:p-breeze-7',\n 8: 'breeze:p-breeze-8',\n },\n state: {\n clipped: 'breeze:overflow-hidden',\n },\n variant: {\n raised: 'breeze:bg-breeze-raised',\n surface: 'breeze:bg-breeze-surface',\n },\n} as const;\n\nexport type CardVariant = keyof typeof variants.variant;\nexport type CardElement = 'article' | 'aside' | 'div' | 'section';\n\nexport interface CardProps {\n /** Names the card region when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Content displayed inside the card. */\n children: ReactNode;\n /** Clips content to the rounded card boundary. Defaults to `true`. */\n clipped?: boolean;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: CardElement;\n /** Applies padding from the Breeze spacing scale. Defaults to `4`. */\n padding?: LayoutGap;\n /** Selects the card surface treatment. Defaults to `surface`. */\n variant?: CardVariant;\n}\n\n/**\n * Decorates related content as a bordered Breeze panel.\n *\n * @summary A closed surface or raised content card.\n */\nexport function Card({\n 'aria-label': ariaLabel,\n children,\n clipped = true,\n element = 'div',\n padding = 4,\n variant = 'surface',\n}: Readonly<CardProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.card,\n variants.variant[variant],\n variants.size[padding],\n clipped && variants.state.clipped,\n ]\n .filter(Boolean)\n .join(' '),\n role,\n },\n children,\n );\n}\n","import type { MouseEventHandler } from 'react';\nimport { FieldError as AriaFieldError } from 'react-aria-components/FieldError';\nimport { Label as AriaLabel } from 'react-aria-components/Label';\nimport { Text as AriaText } from 'react-aria-components/Text';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { fieldVariants } from './field.styles';\n\ninterface FieldLabelProps {\n htmlFor?: string;\n id?: string;\n label: string;\n loading: boolean;\n onClick?: MouseEventHandler<HTMLLabelElement>;\n}\n\nexport function FieldLabel({\n htmlFor,\n id,\n label,\n loading,\n onClick,\n}: Readonly<FieldLabelProps>) {\n return (\n <AriaLabel\n className={fieldVariants.base.label}\n htmlFor={htmlFor}\n id={id}\n onClick={onClick}\n >\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n label\n )}\n </AriaLabel>\n );\n}\n\ninterface FieldSupportProps {\n description?: string;\n descriptionId?: string;\n error?: string;\n errorId?: string;\n loading: boolean;\n}\n\nexport function FieldSupportingContent({\n description,\n descriptionId,\n error,\n errorId,\n loading,\n}: Readonly<FieldSupportProps>) {\n return (\n <>\n {description && (\n <AriaText\n className={fieldVariants.base.description}\n id={descriptionId}\n slot=\"description\"\n >\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n description\n )}\n </AriaText>\n )}\n {error &&\n (loading ? (\n <span\n aria-hidden=\"true\"\n className={fieldVariants.base.error}\n id={errorId}\n >\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n </span>\n ) : (\n <AriaFieldError className={fieldVariants.base.error} id={errorId}>\n {error}\n </AriaFieldError>\n ))}\n </>\n );\n}\n","import type { Ref } from 'react';\nimport { useObjectRef } from 'react-aria/useObjectRef';\nimport {\n CheckboxButton as AriaCheckboxButton,\n CheckboxField as AriaCheckboxField,\n} from 'react-aria-components/Checkbox';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { FieldSupportingContent } from '../Field/field.presentation';\nimport { fieldVariants } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n control:\n 'breeze:relative breeze:inline-grid breeze:min-block-breeze-tap breeze:grid-flow-col breeze:items-center breeze:gap-breeze-2 breeze:cursor-pointer breeze:select-none breeze:font-breeze-sans breeze:text-breeze-sm breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-ink breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60',\n indicator:\n 'breeze:inline-grid breeze:block-size-breeze-5 breeze:inline-size-breeze-5 breeze:shrink-0 breeze:place-items-center breeze:rounded-breeze-chip breeze:border breeze:border-solid breeze:border-breeze-ink-3 breeze:bg-breeze-surface breeze:text-breeze-on-brand breeze:transition-colors breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand',\n label: 'breeze:[grid-area:1/2]',\n skeleton: 'breeze:pointer-events-none breeze:[grid-area:1/2]',\n skeletonIndicator:\n 'breeze:pointer-events-none breeze:[grid-area:1/1] breeze:block-size-breeze-5 breeze:inline-size-breeze-5',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface CheckboxCommonProps {\n /** Prevents selection and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Associates the checkbox with a form outside its ancestor tree. */\n form?: string;\n /** Sets the native input id. */\n id?: string;\n /** Accessible checkbox label, shown as text outside loading state. */\n label: string;\n /** Replaces the checkbox content with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Sets the submitted name of the checkbox. */\n name?: string;\n /** Supporting guidance announced with the checkbox. */\n description?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native checkbox input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the checkbox as required. Defaults to `false`. */\n required?: boolean;\n /** Visible validation message; any non-empty value marks the checkbox invalid. */\n error?: string;\n /** Native value submitted when the checkbox is selected. */\n value?: string;\n}\n\ninterface ControlledCheckboxProps {\n /** Current selected state. */\n selected: boolean;\n /** Reports the next selected state without exposing a DOM event. */\n onChange: (selected: boolean) => void;\n /** Controlled and uncontrolled selection props are mutually exclusive. */\n defaultSelected?: never;\n}\n\ninterface UncontrolledCheckboxProps {\n /** Initial selected state. Defaults to `false`. */\n defaultSelected?: boolean;\n /** Reports the next selected state without exposing a DOM event. */\n onChange?: (selected: boolean) => void;\n /** Controlled and uncontrolled selection props are mutually exclusive. */\n selected?: never;\n}\n\n/** Props for controlled or uncontrolled boolean selection. */\nexport type CheckboxProps = CheckboxCommonProps &\n (ControlledCheckboxProps | UncontrolledCheckboxProps);\n\n/**\n * Renders an accessible checkbox with a visible label, validation messages,\n * semantic boolean changes, and a closed loading presentation.\n *\n * @summary Flat boolean selection with semantic value changes.\n */\nexport function Checkbox({\n defaultSelected,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n readOnly = false,\n ref,\n required = false,\n selected,\n value,\n}: Readonly<CheckboxProps>) {\n const { messages } = useBreezeContext();\n const inputRef = useObjectRef(ref);\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaCheckboxField\n className={fieldVariants.base.root}\n defaultSelected={defaultSelected}\n form={form}\n id={id}\n inputRef={inputRef}\n aria-label={loading ? label : undefined}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n isSelected={selected}\n name={name}\n onChange={onChange}\n value={value}\n validationBehavior=\"aria\"\n >\n <AriaCheckboxButton className={variants.base.control}>\n {({ isFocusVisible, isSelected }) => (\n <>\n {loading && (\n <>\n <span\n aria-hidden=\"true\"\n className={variants.base.skeletonIndicator}\n >\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n shape=\"rectangle\"\n />\n </span>\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"1lh\"\n inlineSize=\"12em\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n </>\n )}\n {!loading && (\n <>\n <span\n aria-hidden=\"true\"\n className={variants.base.indicator}\n data-focus-visible={isFocusVisible || undefined}\n data-selected={isSelected || undefined}\n >\n {isSelected ? '✓' : ''}\n </span>\n <span className={variants.base.label}>{label}</span>\n </>\n )}\n </>\n )}\n </AriaCheckboxButton>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaCheckboxField>\n );\n}\n","import type { ButtonHTMLAttributes, ReactNode, Ref } from 'react';\nimport { createElement, useState } from 'react';\nimport { ToggleButton as AriaToggleButton } from 'react-aria-components/ToggleButton';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n label: 'breeze:[grid-area:1/1]',\n skeleton:\n 'breeze:[grid-area:1/1] breeze:inline-size-full breeze:block-size-breeze-3',\n status: 'breeze:sr-only',\n },\n state: {\n loading: 'breeze:cursor-wait',\n loadingLabel: 'breeze:opacity-0',\n },\n} as const;\n\ninterface SelectionControlProps {\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n children: ReactNode;\n className: string;\n defaultPressed?: boolean;\n disabled: boolean;\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Lets a containing group provide one loading announcement for all options. */\n announceLoading?: boolean;\n loading: boolean;\n onChange?: (pressed: boolean) => void;\n pressed?: boolean;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/** Renders the shared selected button and its loading presentation. */\nexport default function SelectionControl({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n className,\n defaultPressed,\n disabled,\n id,\n announceLoading = true,\n loading,\n onChange,\n pressed,\n ref,\n}: Readonly<SelectionControlProps>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const [uncontrolledPressed, setUncontrolledPressed] = useState(\n defaultPressed ?? false,\n );\n const isControlled = pressed !== undefined;\n const isPressed = isControlled ? pressed : uncontrolledPressed;\n\n return (\n <>\n <AriaToggleButton\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={[className, loading && variants.state.loading]\n .filter(Boolean)\n .join(' ')}\n id={id}\n isDisabled={disabled}\n isSelected={isPressed}\n onChange={(nextPressed) => {\n if (loading) return;\n\n if (!isControlled) {\n setUncontrolledPressed(nextPressed);\n }\n\n onChange?.(nextPressed);\n }}\n ref={ref}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n 'aria-disabled': disabled || loading || undefined,\n type: 'button',\n })\n }\n >\n <span\n className={[\n variants.base.label,\n loading && variants.state.loadingLabel,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </span>\n {loading && (\n <span\n aria-hidden=\"true\"\n className={variants.base.skeleton}\n data-breeze-skeleton=\"\"\n >\n <Skeleton inlineSize=\"100%\" />\n </span>\n )}\n </AriaToggleButton>\n {loading && announceLoading && (\n <span className={variants.base.status}>\n <Skeleton label={messages.loading} />\n </span>\n )}\n {announceLoading && (\n <output\n aria-live=\"polite\"\n className={variants.base.status}\n lang={getMessageLocale('loading')}\n >\n {loading ? messages.loading : ''}\n </output>\n )}\n </>\n );\n}\n","import type { ButtonHTMLAttributes, Ref } from 'react';\nimport SelectionControl from '../SelectionControl/SelectionControl';\n\nconst variants = {\n base: {\n chip: 'breeze:inline-grid breeze:items-center breeze:justify-center breeze:whitespace-nowrap breeze:rounded-breeze-full breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:font-breeze-sans breeze:text-breeze-xs breeze:font-semibold breeze:text-breeze-ink breeze:cursor-pointer breeze:select-none breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap breeze:min-block-breeze-sm',\n },\n compound: {},\n size: {},\n state: {\n pressed:\n 'breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\ninterface ChipCommonProps {\n /** Provides an accessible name when it differs from the visible label. */\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n /** Identifies elements that provide additional information about the chip. */\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n /** Identifies elements whose text provides the chip's accessible name. */\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n /** Visible filter label and default accessible name. */\n children: string;\n /** Prevents the chip from being activated. Defaults to `false`. */\n disabled?: boolean;\n /** Sets the rendered button's HTML `id`. */\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Shows a placeholder while a pressed-state change is being saved. */\n loading?: boolean;\n /** Provides access to the rendered button element. */\n ref?: Ref<HTMLButtonElement>;\n}\n\ninterface ControlledChipProps {\n /** Current pressed state. */\n pressed: boolean;\n /** Reports the next pressed state. */\n onChange: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n defaultPressed?: never;\n}\n\ninterface UncontrolledChipProps {\n /** Initial pressed state. Defaults to `false`. */\n defaultPressed?: boolean;\n /** Reports the next pressed state. */\n onChange?: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n pressed?: never;\n}\n\n/** Props for controlled or uncontrolled boolean chip state. */\nexport type ChipProps = ChipCommonProps &\n (ControlledChipProps | UncontrolledChipProps);\n\n/**\n * Renders an independently selectable filter chip.\n *\n * @summary A compact filter with a pressed state.\n */\nexport function Chip({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n defaultPressed,\n disabled = false,\n id,\n loading = false,\n onChange,\n pressed,\n ref,\n}: Readonly<ChipProps>) {\n return (\n <SelectionControl\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={[variants.base.chip, variants.state.pressed].join(' ')}\n defaultPressed={defaultPressed}\n disabled={disabled}\n id={id}\n loading={loading}\n onChange={onChange}\n pressed={pressed}\n ref={ref}\n >\n {children}\n </SelectionControl>\n );\n}\n","/** Shared listbox geometry and descriptor treatment for collection controls. */\nconst collectionVariants = {\n base: {\n badge: 'breeze:ms-auto',\n content:\n 'breeze:flex breeze:min-inline-size-0 breeze:flex-1 breeze:flex-col breeze:gap-breeze-1',\n description:\n 'breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n item: 'breeze:flex breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:items-start breeze:gap-breeze-2 breeze:rounded-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-offset-[-2px] breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[focused]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text',\n label: 'breeze:font-medium',\n listBox: 'breeze:min-inline-size-0 breeze:outline-none',\n popover:\n 'breeze:min-inline-size-[var(--trigger-width)] breeze:max-inline-size-[calc(100vw-24px)] breeze:overflow-auto breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:bg-breeze-surface breeze:p-breeze-1 breeze:shadow-breeze-overlay',\n selectedIndicator:\n 'breeze:ms-auto breeze:block-size-breeze-4 breeze:inline-size-breeze-4 breeze:shrink-0 breeze:text-breeze-brand-text',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\nexport default collectionVariants;\n","import {\n createContext,\n useContext,\n useId,\n useLayoutEffect,\n useSyncExternalStore,\n} from 'react';\nimport type { OverlayKind } from './overlay.types';\n\ninterface Layer {\n active: boolean;\n id: string;\n kind: OverlayKind;\n parent?: string;\n visual: boolean;\n}\n\n/** Breeze owns ordering; React Aria still owns modality, focus and animations. */\nexport function createOverlayStack() {\n let layers: Layer[] = [];\n const listeners = new Set<() => void>();\n const publish = () => listeners.forEach((listener) => listener());\n\n return {\n getSnapshot: () => layers,\n remove: (id: string) => {\n layers = layers.filter((layer) => layer.id !== id);\n publish();\n },\n set: (layer: Layer) => {\n const previous = layers.find((entry) => entry.id === layer.id);\n if (\n previous?.active === layer.active &&\n previous.kind === layer.kind &&\n previous.parent === layer.parent &&\n previous.visual === layer.visual\n )\n return;\n // Reopening goes above other siblings, while closing retains exit geometry.\n layers =\n previous && (!layer.active || previous.active)\n ? layers.map((entry) => (entry.id === layer.id ? layer : entry))\n : [...layers.filter((entry) => entry.id !== layer.id), layer];\n publish();\n },\n subscribe: (listener: () => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nexport const OverlayStackContext = createContext<ReturnType<\n typeof createOverlayStack\n> | null>(null);\n\n/** Returns the next layer above every registered overlay for provider-owned UI. */\nexport function useOverlayToastZIndex() {\n const store = useContext(OverlayStackContext);\n if (!store)\n throw new Error(\n 'Breeze components must be rendered within BreezeProvider.',\n );\n const layers = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot,\n );\n\n return 100 + layers.length * 2;\n}\n\nexport const ParentOverlayContext = createContext<{\n id: string;\n open: boolean;\n restoreFocus: () => void;\n} | null>(null);\n\nexport function useOverlayLayer(\n kind: OverlayKind,\n open: boolean,\n visual: boolean,\n) {\n const store = useContext(OverlayStackContext);\n const parent = useContext(ParentOverlayContext);\n const id = useId();\n if (!store)\n throw new Error(\n 'Breeze components must be rendered within BreezeProvider.',\n );\n const layers = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot,\n );\n const parentId = parent?.id;\n\n useLayoutEffect(() => () => store.remove(id), [id, store]);\n useLayoutEffect(() => {\n store.set({ active: open, id, kind, parent: parentId, visual });\n }, [id, kind, open, parentId, store, visual]);\n\n // Effects mount children first. Walk ancestry rather than relying on effect order.\n const ordered: Layer[] = [];\n const append = (layer: Layer) => {\n if (ordered.includes(layer)) return;\n const ancestor = layers.find((entry) => entry.id === layer.parent);\n if (ancestor) append(ancestor);\n ordered.push(layer);\n };\n layers.forEach(append);\n const isActive = (layer: Layer): boolean => {\n const ancestor = layers.find((entry) => entry.id === layer.parent);\n return layer.active && (!ancestor || isActive(ancestor));\n };\n const active = ordered.filter(isActive);\n const activeIndex = active.findIndex((layer) => layer.id === id);\n const interactive =\n open &&\n activeIndex !== -1 &&\n !active.slice(activeIndex + 1).some((layer) => layer.kind !== 'popover');\n const topmost = open && active.at(-1)?.id === id;\n const activeModal = active.findLast(\n (layer) => layer.kind === 'drawer' || layer.kind === 'dialog',\n );\n const visualModal = ordered.findLast(\n (layer) =>\n layer.visual && (layer.kind === 'drawer' || layer.kind === 'dialog'),\n );\n const scrim = (activeModal ?? visualModal)?.id === id;\n\n return {\n id,\n interactive,\n scrim,\n topmost,\n zIndex:\n 100 +\n Math.max(\n 0,\n ordered.findIndex((layer) => layer.id === id),\n ) *\n 2,\n };\n}\n","import {\n createContext,\n type ReactNode,\n useContext,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria/PortalProvider';\nimport { useLocale } from 'react-aria-components/I18nProvider';\nimport { createOverlayStack, OverlayStackContext } from './OverlayStack';\n\nconst PortalContext = createContext<HTMLElement | null>(null);\nconst portalBoundaryError =\n 'BreezeProvider portalContainer must belong to the current document and light DOM.';\n\n/** A dedicated host keeps locale and scoped styles on every portalled surface. */\nexport function OverlayProvider({\n children,\n portalContainer,\n locale,\n}: Readonly<{\n children: ReactNode;\n portalContainer?: HTMLElement;\n locale: string;\n}>) {\n const { direction } = useLocale();\n const [stack] = useState(createOverlayStack);\n const [host, setHost] = useState<HTMLElement | null>(null);\n\n useLayoutEffect(() => {\n const container = portalContainer ?? document.body;\n if (\n container.ownerDocument !== document ||\n container.getRootNode() !== document\n ) {\n throw new Error(portalBoundaryError);\n }\n const element = container.ownerDocument.createElement('div');\n element.dataset.breezeRoot = '';\n element.dataset.breezePortal = '';\n container.append(element);\n setHost(element);\n return () => element.remove();\n }, [portalContainer]);\n\n useLayoutEffect(() => {\n if (host) {\n host.lang = locale;\n host.dir = direction;\n }\n }, [direction, host, locale]);\n\n return (\n <PortalProvider getContainer={() => host}>\n <OverlayStackContext value={stack}>\n <PortalContext value={host}>{children}</PortalContext>\n </OverlayStackContext>\n </PortalProvider>\n );\n}\n\nexport function useOverlayPortal() {\n return useContext(PortalContext);\n}\n","import type { ReactNode, RefObject } from 'react';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { Popover as AriaPopover } from 'react-aria-components/Popover';\nimport { useOverlayPortal } from '../../overlays/OverlayProvider';\nimport {\n ParentOverlayContext,\n useOverlayLayer,\n} from '../../overlays/OverlayStack';\n\nconst triggerBoundaryError =\n 'Breeze overlay triggers and portal containers must belong to the current document and light DOM.';\n\nfunction isNode(value: EventTarget | null): value is Node {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).contains === 'function'\n );\n}\n\ninterface CollectionPopoverProps {\n children: ReactNode;\n className: string;\n /** Minimum viewport edge margin used while positioning the surface. */\n containerPadding?: number;\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n triggerRef: RefObject<Element | null>;\n}\n\n/**\n * The collection popover bridge keeps listbox surfaces inside Breeze's portal\n * and overlay stack while React Aria owns positioning, focus and dismissal.\n */\nexport default function CollectionPopover({\n children,\n className,\n containerPadding,\n isOpen: requestedOpen,\n onOpenChange,\n triggerRef,\n}: Readonly<CollectionPopoverProps>) {\n const host = useOverlayPortal();\n const parent = useContext(ParentOverlayContext);\n const parentOpen = parent?.open ?? true;\n const [portalReady, setPortalReady] = useState(parent === null);\n const [surfaceMounted, setSurfaceMounted] = useState(false);\n const parentCloseReportedRef = useRef(false);\n const surfaceRef = useRef<Element | null>(null);\n const pointerDownTargetRef = useRef<Node | null>(null);\n const pointerDismissTargetRef = useRef<Node | null>(null);\n const open = requestedOpen && parentOpen;\n const layer = useOverlayLayer(\n 'popover',\n open && portalReady && host !== null,\n open || surfaceMounted,\n );\n const handleSurfaceRef = useCallback((element: Element | null) => {\n surfaceRef.current = element;\n setSurfaceMounted(element !== null);\n }, []);\n\n useLayoutEffect(() => {\n if (\n host &&\n triggerRef.current &&\n (triggerRef.current.ownerDocument !== document ||\n triggerRef.current.getRootNode() !== document ||\n host.ownerDocument !== document ||\n host.getRootNode() !== document)\n ) {\n throw new Error(triggerBoundaryError);\n }\n });\n\n useEffect(() => setPortalReady(true), []);\n useLayoutEffect(() => {\n if (!open || !layer.topmost || !host) return undefined;\n\n const isOutside = (target: Node | null) =>\n isNode(target) &&\n !surfaceRef.current?.contains(target) &&\n !triggerRef.current?.contains(target);\n const sameTarget = (left: Node | null, right: Node | null) =>\n !!left &&\n !!right &&\n (left === right || left.contains(right) || right.contains(left));\n const isPrimaryPointer = (event: PointerEvent) => event.button === 0;\n let pointerDismissExpiry: ReturnType<typeof setTimeout> | null = null;\n const clearPointerDismissExpiry = () => {\n if (pointerDismissExpiry !== null) {\n clearTimeout(pointerDismissExpiry);\n pointerDismissExpiry = null;\n }\n };\n const schedulePointerDismissExpiry = () => {\n clearPointerDismissExpiry();\n pointerDismissExpiry = setTimeout(() => {\n pointerDismissExpiry = null;\n pointerDismissTargetRef.current = null;\n }, 0);\n };\n const onPointerDown = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = isNode(event.target) ? event.target : null;\n pointerDismissTargetRef.current = null;\n };\n const onPointerUp = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n const pointerDownTarget = pointerDownTargetRef.current;\n const pointerUpTarget = isNode(event.target) ? event.target : null;\n if (!isOutside(pointerUpTarget)) {\n pointerDownTargetRef.current = null;\n return;\n }\n\n if (!isOutside(pointerDownTarget)) {\n // A drag that starts in the surface and ends outside must not be\n // reinterpreted as an outside click by the subsequent click event.\n pointerDismissTargetRef.current = pointerUpTarget;\n pointerDownTargetRef.current = null;\n schedulePointerDismissExpiry();\n return;\n }\n\n pointerDismissTargetRef.current = pointerUpTarget;\n onOpenChange(false);\n };\n const onPointerCancel = () => {\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = null;\n pointerDismissTargetRef.current = null;\n };\n const onClick = (event: MouseEvent) => {\n const target = isNode(event.target) ? event.target : null;\n if (\n isOutside(target) &&\n !sameTarget(pointerDismissTargetRef.current, target)\n ) {\n onOpenChange(false);\n }\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = null;\n pointerDismissTargetRef.current = null;\n };\n\n host.ownerDocument.addEventListener('pointerdown', onPointerDown, true);\n host.ownerDocument.addEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.addEventListener('pointercancel', onPointerCancel, true);\n host.ownerDocument.addEventListener('click', onClick, true);\n return () => {\n host.ownerDocument.removeEventListener(\n 'pointerdown',\n onPointerDown,\n true,\n );\n host.ownerDocument.removeEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.removeEventListener(\n 'pointercancel',\n onPointerCancel,\n true,\n );\n host.ownerDocument.removeEventListener('click', onClick, true);\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = null;\n pointerDismissTargetRef.current = null;\n };\n }, [host, layer.topmost, onOpenChange, open, triggerRef]);\n\n useEffect(() => {\n if (parentOpen) {\n parentCloseReportedRef.current = false;\n } else if (requestedOpen && !parentCloseReportedRef.current) {\n parentCloseReportedRef.current = true;\n onOpenChange(false);\n }\n }, [onOpenChange, parentOpen, requestedOpen]);\n\n return (\n <AriaPopover\n className={`${className} breeze-popover`}\n containerPadding={containerPadding}\n data-breeze-interactive={layer.interactive}\n data-breeze-overlay=\"popover\"\n data-breeze-topmost={layer.topmost}\n inert={!layer.interactive}\n isKeyboardDismissDisabled={!layer.topmost}\n isNonModal\n isOpen={open}\n onOpenChange={onOpenChange}\n placement=\"bottom start\"\n // Defer pointer dismissal to Breeze's provider-document policy, while\n // retaining React Aria's keyboard/focus dismissal behavior.\n shouldCloseOnInteractOutside={(element) =>\n pointerDownTargetRef.current === null &&\n layer.topmost &&\n !triggerRef.current?.contains(element)\n }\n style={{ zIndex: layer.zIndex }}\n triggerRef={triggerRef}\n ref={handleSurfaceRef}\n >\n {children}\n </AriaPopover>\n );\n}\n","import { Badge } from '../Badge/Badge';\nimport { Icon } from '../Icon/Icon';\nimport collectionVariants from './collection.styles';\nimport type { ItemDescriptor } from './item.types';\n\ninterface DescriptorContentProps {\n descriptor: ItemDescriptor;\n isSelected: boolean;\n}\n\n/** Renders the closed descriptor content shared by collection controls. */\nexport default function DescriptorContent({\n descriptor,\n isSelected,\n}: Readonly<DescriptorContentProps>) {\n return (\n <>\n {descriptor.icon && <Icon name={descriptor.icon} size=\"sm\" />}\n <span className={collectionVariants.base.content}>\n <span className={collectionVariants.base.label}>\n {descriptor.label}\n </span>\n {descriptor.description && (\n <span className={collectionVariants.base.description}>\n {descriptor.description}\n </span>\n )}\n </span>\n {descriptor.badge && (\n <span className={collectionVariants.base.badge}>\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n </span>\n )}\n <span\n aria-hidden=\"true\"\n className={collectionVariants.base.selectedIndicator}\n >\n {isSelected && <Icon name=\"check\" size=\"sm\" />}\n </span>\n </>\n );\n}\n","import { ListBoxItem as AriaListBoxItem } from 'react-aria-components/ListBox';\nimport collectionVariants from './collection.styles';\nimport DescriptorContent from './DescriptorContent';\nimport type { ItemDescriptor } from './item.types';\n\n/** Renders Breeze's closed descriptor contract inside a React Aria option. */\nfunction DescriptorOption({\n descriptor,\n}: Readonly<{ descriptor: ItemDescriptor }>) {\n return (\n <AriaListBoxItem\n className={collectionVariants.base.item}\n id={descriptor.id}\n isDisabled={descriptor.disabled}\n textValue={descriptor.label}\n >\n {({ isSelected }) => (\n <DescriptorContent descriptor={descriptor} isSelected={isSelected} />\n )}\n </AriaListBoxItem>\n );\n}\n\nexport default DescriptorOption;\n","import type { RefObject } from 'react';\nimport { useContext, useEffect, useId, useMemo, useRef } from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n ComboBox as AriaComboBox,\n ComboBoxStateContext as AriaComboBoxStateContext,\n useFilter,\n} from 'react-aria-components/ComboBox';\nimport { Group as AriaGroup } from 'react-aria-components/Group';\nimport { Input as AriaInput } from 'react-aria-components/Input';\nimport { ListBox as AriaListBox } from 'react-aria-components/ListBox';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport collectionVariants from '../Collection/collection.styles';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport DescriptorOption from '../Collection/DescriptorOption';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n group:\n 'breeze:relative breeze:inline-flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:items-stretch breeze:overflow-hidden breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:has-[input[data-focus-visible]]:outline-2 breeze:has-[input[data-focus-visible]]:outline-solid breeze:has-[input[data-focus-visible]]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:bg-breeze-sunken breeze:data-[invalid]:border-breeze-danger',\n input:\n 'breeze:min-block-breeze-md breeze:min-inline-size-0 breeze:flex-1 breeze:border-0 breeze:bg-transparent breeze:ps-breeze-3 breeze:pe-breeze-2 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-none breeze:placeholder:text-breeze-ink-3 breeze:data-[hovered]:border-transparent breeze:data-[focus-visible]:!outline-none breeze:data-[invalid]:border-transparent breeze:disabled:cursor-not-allowed breeze:read-only:cursor-default',\n popover:\n 'breeze:min-inline-size-[var(--trigger-width)] breeze:max-inline-size-[calc(100vw-24px)] breeze:overflow-auto breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:bg-breeze-surface breeze:p-breeze-1 breeze:shadow-breeze-overlay',\n skeleton:\n 'breeze:pointer-events-none breeze:absolute breeze:[inset-block:0] breeze:[inset-inline:0]',\n trigger:\n 'breeze:inline-grid breeze:shrink-0 breeze:place-items-center breeze:border-0 breeze:bg-transparent breeze:pe-breeze-2 breeze:ps-breeze-2 breeze:text-breeze-ink-2 breeze:outline-none breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:disabled:cursor-not-allowed breeze:disabled:opacity-60 breeze:any-pointer-coarse:min-inline-breeze-tap',\n },\n compound: {},\n size: {},\n state: {\n loadingGroup:\n 'breeze:!bg-transparent breeze:!border-transparent breeze:!opacity-100 breeze:!overflow-visible',\n loadingInput: 'breeze:!opacity-0',\n loadingTrigger: 'breeze:!opacity-0',\n readOnlyGroup: 'breeze:bg-breeze-sunken',\n },\n variant: {},\n} as const;\n\ninterface ComboBoxCommonProps<T> {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the input when the component is mounted. */\n autoFocus?: boolean;\n /** Prevents editing and opening the suggestions. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the input. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the input with a form outside its ancestor tree. */\n form?: string;\n /** Maps an item to the closed descriptor rendered by Breeze. */\n getItem: (item: T) => ItemDescriptor;\n /** Sets the native input id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the field with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Items displayed as suggestions. */\n items: T[];\n /** Sets the submitted name of the input. */\n name?: string;\n /** Temporary text shown while the input is empty. */\n placeholder?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Marks the input as required. Defaults to `false`. */\n required?: boolean;\n}\n\n/** The application value emitted by a ComboBox. */\ntype ComboBoxValue<T> = T | string | null;\n\n/** The optional value accepted while deriving ComboBox state. */\ntype ComboBoxInputValue<T> = ComboBoxValue<T> | undefined;\n\ninterface ControlledComboBoxProps<Value> {\n /** Current selected item or free-text value. */\n value: Value;\n /** Reports the next selected item or free-text value without exposing a DOM event. */\n onChange: (value: Value) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledComboBoxProps<Value> {\n /** Initial selected item or free-text value. */\n defaultValue?: Value;\n /** Reports the next selected item or free-text value without exposing a DOM event. */\n onChange?: (value: Value) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled suggestion entry. */\nexport type ComboBoxProps<T> =\n | (ComboBoxCommonProps<T> & {\n /** Allows a value that is not one of the suggestions. */\n allowsCustomValue: true;\n } & (\n | ControlledComboBoxProps<ComboBoxValue<NoInfer<T>>>\n | UncontrolledComboBoxProps<ComboBoxValue<NoInfer<T>>>\n ))\n | (ComboBoxCommonProps<T> & {\n /** Disallows values that are not one of the suggestions. */\n allowsCustomValue?: false;\n } & (\n | ControlledComboBoxProps<NoInfer<T> | null>\n | UncontrolledComboBoxProps<NoInfer<T> | null>\n ));\n\ninterface ComboBoxItem<T> {\n id: string;\n descriptor: ItemDescriptor;\n item: T;\n}\n\nfunction findItem<T>(\n value: T,\n decoratedItems: ComboBoxItem<T>[],\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n const directItem = decoratedItems.find(({ item }) => item === value);\n if (directItem) return directItem;\n\n if (allowsCustomValue && typeof value === 'string') return undefined;\n\n const { id } = getItem(value);\n return decoratedItems.find((item) => item.descriptor.id === id);\n}\n\nfunction resolveCollectionKey<T>(\n value: ComboBoxInputValue<T>,\n item: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n if (value === undefined) return undefined;\n if (\n value === null ||\n (allowsCustomValue && typeof value === 'string' && !item)\n ) {\n return null;\n }\n\n return item?.id ?? getItem(value as T).id;\n}\n\nfunction resolveControlledInputValue<T>(\n value: ComboBoxInputValue<T>,\n selectedItem: ComboBoxItem<T> | undefined,\n allowsCustomValue: boolean,\n) {\n if (value === undefined || !allowsCustomValue) return undefined;\n if (selectedItem) return selectedItem.descriptor.label;\n return typeof value === 'string' ? value : '';\n}\n\nfunction resolveDefaultCustomValue<T>(\n defaultValue: ComboBoxInputValue<T>,\n defaultItem: ComboBoxItem<T> | undefined,\n allowsCustomValue: boolean,\n) {\n if (!allowsCustomValue || typeof defaultValue !== 'string' || defaultItem) {\n return undefined;\n }\n\n return defaultValue;\n}\n\nfunction ComboBoxListBox<T>({ items }: Readonly<{ items: ComboBoxItem<T>[] }>) {\n return (\n <AriaListBox className={collectionVariants.base.listBox} items={items}>\n {(item: ComboBoxItem<T>) => (\n <DescriptorOption descriptor={item.descriptor} />\n )}\n </AriaListBox>\n );\n}\n\nfunction ComboBoxPopover<T>({\n allowsCustomValue,\n hasSuggestions,\n isDisabled,\n isReadOnly,\n items,\n triggerRef,\n}: Readonly<{\n allowsCustomValue: boolean;\n hasSuggestions: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n items: ComboBoxItem<T>[];\n triggerRef: RefObject<Element | null>;\n}>) {\n const state = useContext(AriaComboBoxStateContext);\n const isBlocked = isDisabled || isReadOnly;\n const isOpen =\n !isBlocked &&\n (hasSuggestions || allowsCustomValue) &&\n (state?.isOpen ?? false);\n\n useEffect(() => {\n if (\n (isBlocked || (!hasSuggestions && !allowsCustomValue)) &&\n state?.isOpen\n ) {\n state.setOpen(false);\n }\n }, [allowsCustomValue, hasSuggestions, isBlocked, state]);\n\n return (\n <CollectionPopover\n className={variants.base.popover}\n isOpen={isOpen}\n onOpenChange={(open) => state?.setOpen(open)}\n triggerRef={triggerRef}\n >\n <ComboBoxListBox items={items} />\n </CollectionPopover>\n );\n}\n\n/**\n * Renders a filtered suggestion field with closed descriptor content and\n * optional application-owned free text.\n *\n * @summary Flat suggestion entry with semantic item or text changes.\n */\nfunction ComboBoxBase<T>({ props }: Readonly<{ props: ComboBoxProps<T> }>) {\n const {\n allowsCustomValue = false,\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n getItem,\n id,\n items,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n readOnly = false,\n required = false,\n value,\n } = props;\n const { messages } = useBreezeContext();\n const { contains } = useFilter({ sensitivity: 'base' });\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const fieldId = useId();\n const descriptionId = `${fieldId}-description`;\n const errorId = `${fieldId}-error`;\n const supportingIds =\n [visibleDescription && descriptionId, visibleError && errorId]\n .filter(Boolean)\n .join(' ') || undefined;\n const groupRef = useRef<HTMLDivElement>(null);\n const decoratedItems = useMemo<ComboBoxItem<T>[]>(\n () =>\n items.map((item) => {\n const descriptor = getItem(item);\n return {\n descriptor,\n id: descriptor.id,\n item,\n };\n }),\n [getItem, items],\n );\n\n const selectedItem =\n value !== undefined && value !== null\n ? findItem(value as T, decoratedItems, getItem, allowsCustomValue)\n : undefined;\n const selectedKey = resolveCollectionKey(\n value as ComboBoxInputValue<T>,\n selectedItem,\n getItem,\n allowsCustomValue,\n );\n const defaultItem =\n defaultValue !== undefined && defaultValue !== null\n ? findItem(defaultValue as T, decoratedItems, getItem, allowsCustomValue)\n : undefined;\n const defaultSelectedKey = resolveCollectionKey(\n defaultValue as ComboBoxInputValue<T>,\n defaultItem,\n getItem,\n allowsCustomValue,\n );\n const controlledInputValue = resolveControlledInputValue(\n value as ComboBoxInputValue<T>,\n selectedItem,\n allowsCustomValue,\n );\n const defaultCustomValue = resolveDefaultCustomValue(\n defaultValue as ComboBoxInputValue<T>,\n defaultItem,\n allowsCustomValue,\n );\n const lastSelectedKeyRef = useRef<string | null>(\n selectedKey == null ? null : String(selectedKey),\n );\n const inputValueRef = useRef(\n controlledInputValue ?? defaultCustomValue ?? '',\n );\n const inputChangeHandledRef = useRef(false);\n const emitChange = onChange as\n | ((nextValue: ComboBoxValue<T>) => void)\n | undefined;\n\n useEffect(() => {\n lastSelectedKeyRef.current =\n selectedKey == null ? null : String(selectedKey);\n }, [selectedKey]);\n\n const handleSelectionChange = (key: string | number | null) => {\n if (key === null) {\n lastSelectedKeyRef.current = null;\n if (allowsCustomValue) {\n const inputChangeHandled = inputChangeHandledRef.current;\n inputChangeHandledRef.current = false;\n if (inputValueRef.current || inputChangeHandled) return;\n }\n emitChange?.(null);\n return;\n }\n\n inputChangeHandledRef.current = false;\n lastSelectedKeyRef.current = String(key);\n const nextItem = decoratedItems.find(\n (item) => item.descriptor.id === String(key),\n );\n inputValueRef.current = nextItem?.descriptor.label ?? '';\n emitChange?.(nextItem?.item ?? null);\n };\n\n const handleInputChange = (inputValue: string) => {\n inputValueRef.current = inputValue;\n inputChangeHandledRef.current = true;\n\n if (!allowsCustomValue) return;\n\n const selected = decoratedItems.find(\n (item) => item.descriptor.id === lastSelectedKeyRef.current,\n );\n if (selected?.descriptor.label === inputValue) return;\n\n emitChange?.(inputValue || null);\n };\n\n const isInvalid = !loading && visibleError !== undefined;\n const submittedName = interactionDisabled ? undefined : name;\n\n return (\n <AriaComboBox<ComboBoxItem<T>>\n allowsCustomValue={allowsCustomValue}\n allowsEmptyCollection={allowsCustomValue}\n aria-label={loading ? label : undefined}\n className={fieldVariants.base.root}\n defaultFilter={contains}\n defaultInputValue={defaultCustomValue}\n defaultItems={decoratedItems}\n defaultValue={defaultSelectedKey}\n form={form}\n id={id}\n inputValue={controlledInputValue}\n isDisabled={interactionDisabled}\n isInvalid={isInvalid}\n isReadOnly={readOnly}\n isRequired={required}\n menuTrigger=\"input\"\n name={submittedName}\n onInputChange={handleInputChange}\n onChange={handleSelectionChange}\n value={selectedKey}\n validationBehavior=\"aria\"\n >\n <FieldLabel label={label} loading={loading} />\n <AriaGroup\n className={joinClassNames(\n variants.base.group,\n loading && variants.state.loadingGroup,\n readOnly && variants.state.readOnlyGroup,\n )}\n isDisabled={interactionDisabled}\n isInvalid={isInvalid}\n isReadOnly={readOnly}\n ref={groupRef}\n >\n <AriaInput\n aria-busy={loading || undefined}\n aria-describedby={supportingIds}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n className={joinClassNames(\n variants.base.input,\n loading && variants.state.loadingInput,\n )}\n form={form}\n placeholder={placeholder}\n readOnly={readOnly || undefined}\n />\n <AriaButton\n aria-describedby={supportingIds}\n className={joinClassNames(\n variants.base.trigger,\n loading && variants.state.loadingTrigger,\n )}\n >\n <Icon name=\"expand\" size=\"sm\" />\n </AriaButton>\n {loading && (\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </AriaGroup>\n <ComboBoxPopover\n allowsCustomValue={allowsCustomValue}\n hasSuggestions={decoratedItems.length > 0}\n isDisabled={interactionDisabled}\n isReadOnly={readOnly}\n items={decoratedItems}\n triggerRef={groupRef}\n />\n <FieldSupportingContent\n description={visibleDescription}\n descriptionId={descriptionId}\n error={visibleError}\n errorId={errorId}\n loading={loading}\n />\n </AriaComboBox>\n );\n}\n\nexport function ComboBox<T>(props: Readonly<ComboBoxProps<T>>) {\n return <ComboBoxBase props={props} />;\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutElement } from '../layout.types';\n\nconst variants = {\n base: {\n container:\n 'breeze:mx-auto breeze:inline-size-full breeze:min-inline-size-0',\n },\n compound: {},\n size: {\n page: 'breeze:max-inline-breeze-page',\n prose: 'breeze:max-inline-breeze-prose',\n read: 'breeze:max-inline-breeze-read',\n },\n state: {\n padded:\n 'breeze:ps-breeze-4 breeze:pe-breeze-4 breeze:breeze-md:ps-breeze-7 breeze:breeze-md:pe-breeze-7',\n },\n variant: {},\n} as const;\n\nexport type ContainerWidth = keyof typeof variants.size;\n\nexport interface ContainerProps {\n /** Names the content boundary when its visible content does not provide a label. */\n 'aria-label'?: string;\n /** Content constrained by the container. */\n children: ReactNode;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Adds responsive inline page gutters. Defaults to `true`. */\n padded?: boolean;\n /** Selects the maximum content measure. Defaults to `page`. */\n width?: ContainerWidth;\n}\n\n/**\n * Centres content within a named Breeze reading or page measure.\n *\n * @summary A responsive, token-constrained content container.\n */\nexport function Container({\n 'aria-label': ariaLabel,\n children,\n element = 'div',\n padded = true,\n width = 'page',\n}: Readonly<ContainerProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.container,\n variants.size[width],\n padded && variants.state.padded,\n ]\n .filter(Boolean)\n .join(' '),\n role,\n },\n children,\n );\n}\n","import { parseDate } from '@internationalized/date';\nimport type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\n\nconst variants = {\n base: {\n text: 'breeze:m-0 breeze:font-breeze-sans',\n },\n compound: {},\n size: {},\n state: {\n aligned: 'breeze:block breeze:inline-size-full',\n inlineLoading: 'breeze:inline-block',\n numeric: 'breeze:tabular-nums breeze:tracking-breeze-tighter',\n truncate:\n 'breeze:block breeze:min-inline-size-0 breeze:inline-size-full breeze:overflow-hidden breeze:text-ellipsis breeze:whitespace-nowrap',\n },\n variant: {\n align: {\n center: 'breeze:text-center',\n end: 'breeze:text-end',\n start: 'breeze:text-start',\n },\n role: {\n body: 'breeze:text-breeze-sm breeze:font-normal breeze:leading-breeze-snug',\n caption:\n 'breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug',\n heading:\n 'breeze:text-breeze-2xl breeze:font-semibold breeze:leading-breeze-tight',\n label:\n 'breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug',\n micro:\n 'breeze:text-breeze-2xs breeze:font-bold breeze:uppercase breeze:leading-breeze-snug breeze:tracking-breeze-caps',\n money:\n 'breeze:text-breeze-4xl breeze:font-semibold breeze:leading-breeze-tight breeze:tracking-breeze-tightest breeze:tabular-nums',\n title:\n 'breeze:text-breeze-md breeze:font-semibold breeze:leading-breeze-snug',\n },\n tone: {\n brand: 'breeze:text-breeze-brand-text',\n danger: 'breeze:text-breeze-danger',\n default: 'breeze:text-breeze-ink',\n muted: 'breeze:text-breeze-ink-3',\n positive: 'breeze:text-breeze-pos',\n secondary: 'breeze:text-breeze-ink-2',\n warning: 'breeze:text-breeze-warn',\n },\n },\n} as const;\n\nexport type TypographyAlign = keyof typeof variants.variant.align;\nexport type TypographyElement =\n | 'div'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'p'\n | 'span';\n/** An ISO 8601 calendar date without a time or time zone. */\nexport type IsoCalendarDate = `${number}-${number}-${number}`;\nexport type TypographyVariant = keyof typeof variants.variant.role;\nexport type TypographyTone = keyof typeof variants.variant.tone;\n\ninterface TypographyBaseProps {\n /** Provides expanded screen-reader text or names rich content. */\n 'aria-label'?: string;\n /** Aligns text along the inline axis. Numeric content defaults to `end`. */\n align?: TypographyAlign;\n /** Overrides the semantic HTML element selected by the text role. */\n element?: TypographyElement;\n /** Sets the rendered element's HTML `id`. */\n id?: string;\n /** Applies tabular numerals, logical end alignment and figure tracking. */\n numeric?: boolean;\n /** Selects the semantic text colour. Defaults to `default`. */\n tone?: TypographyTone;\n /** Truncates a single line with an ellipsis when space is constrained. */\n truncate?: boolean;\n}\n\ninterface CurrencyTypographyContent extends TypographyBaseProps {\n /** Unavailable when displaying a formatted currency value. */\n children?: never;\n /** ISO 4217 currency code used for locale-aware formatting. */\n currency: string;\n /** Unavailable when formatting currency. */\n dateStyle?: never;\n /** Formats `value` as locale-aware currency. */\n format: 'currency';\n /** Controls whether the formatted amount displays its sign. Defaults to `auto`. */\n sign?: 'always' | 'auto' | 'never';\n /** Uses the dedicated money text role required for currency formatting. */\n variant: 'money';\n}\n\ninterface DateTypographyContent extends TypographyBaseProps {\n /** Unavailable when displaying a formatted date value. */\n children?: never;\n /** Unavailable when formatting a date. */\n currency?: never;\n /** Selects the locale-aware date verbosity. Defaults to `long`. */\n dateStyle?: 'full' | 'long' | 'medium' | 'short';\n /** Formats `value` as a locale-aware calendar date. */\n format: 'date';\n /** Unavailable when formatting a date. */\n sign?: never;\n /** Selects the visual and typographic text role. Defaults to `body`. */\n variant?: Exclude<TypographyVariant, 'money'>;\n}\n\ninterface TextTypographyContent extends TypographyBaseProps {\n /** Unavailable when displaying text content. */\n currency?: never;\n /** Unavailable when displaying text content. */\n dateStyle?: never;\n /** Omit to display `children` without value formatting. */\n format?: never;\n /** Unavailable when displaying text content. */\n sign?: never;\n /** Unavailable when displaying text content. */\n value?: never;\n /** Selects the visual and typographic text role. Defaults to `body`. */\n variant?: Exclude<TypographyVariant, 'money'>;\n}\n\nexport type TypographyProps =\n | (CurrencyTypographyContent &\n (\n | {\n /** Replaces the formatted value with a loading placeholder. */\n loading: true;\n /** Numeric amount to format; optional while loading. */\n value?: number;\n }\n | {\n /** Displays the formatted value instead of a loading placeholder. */\n loading?: false;\n /** Numeric amount to format as currency. */\n value: number;\n }\n ))\n | (DateTypographyContent &\n (\n | {\n /** Replaces the formatted value with a loading placeholder. */\n loading: true;\n /** ISO calendar date to format; optional while loading. */\n value?: IsoCalendarDate;\n }\n | {\n /** Displays the formatted value instead of a loading placeholder. */\n loading?: false;\n /** ISO calendar date to format for the provider locale. */\n value: IsoCalendarDate;\n }\n ))\n | (TextTypographyContent &\n (\n | {\n /** Text or inline content; optional while loading. */\n children?: ReactNode;\n /** Replaces the content with a loading placeholder. */\n loading: true;\n }\n | {\n /** Text or inline content to display. */\n children: ReactNode;\n /** Displays the content instead of a loading placeholder. */\n loading?: false;\n }\n ));\n\nfunction getDefaultElement(variant: TypographyVariant): TypographyElement {\n if (variant === 'heading') {\n return 'h2';\n }\n\n if (variant === 'title') {\n return 'h3';\n }\n\n if (variant === 'body') {\n return 'p';\n }\n\n return 'span';\n}\n\nfunction formatCurrency(\n value: number,\n currency: string,\n locale: string,\n sign: CurrencyTypographyContent['sign'],\n): string {\n let parts: Intl.NumberFormatPart[];\n\n try {\n parts = new Intl.NumberFormat(locale, {\n currency,\n signDisplay: sign ?? 'auto',\n style: 'currency',\n }).formatToParts(value);\n } catch (error) {\n if (!(error instanceof RangeError)) {\n throw error;\n }\n\n parts = new Intl.NumberFormat(locale, {\n signDisplay: sign ?? 'auto',\n }).formatToParts(value);\n }\n\n return parts\n .map((part) => (part.type === 'minusSign' ? '−' : part.value))\n .join('');\n}\n\nfunction formatDate(\n value: string,\n locale: string,\n dateStyle: DateTypographyContent['dateStyle'],\n): string {\n let date: Date;\n\n try {\n date = parseDate(value).toDate('UTC');\n } catch {\n return value;\n }\n\n return new Intl.DateTimeFormat(locale, {\n dateStyle: dateStyle ?? 'long',\n timeZone: 'UTC',\n }).format(date);\n}\n\nfunction getTypographyContent(\n props: Readonly<TypographyProps>,\n locale: string,\n loadingMessage: string,\n): ReactNode {\n if (props.loading) {\n return <Skeleton blockSize=\"1lh\" inlineSize=\"8em\" label={loadingMessage} />;\n }\n\n if (props.format === 'currency') {\n return formatCurrency(\n props.value,\n props.currency,\n locale,\n props.sign ?? 'auto',\n );\n }\n\n if (props.format === 'date') {\n return formatDate(props.value, locale, props.dateStyle);\n }\n\n return props.children;\n}\n\n/**\n * Applies Breeze text roles and locale-aware money or calendar-date formatting.\n *\n * @summary Semantic interface text with typography and formatting kept together.\n */\nexport function Typography(props: Readonly<TypographyProps>) {\n const { locale, messages } = useBreezeContext();\n const {\n 'aria-label': ariaLabel,\n align,\n children,\n element: requestedElement,\n format,\n id,\n loading = false,\n numeric = false,\n tone = 'default',\n truncate = false,\n variant = 'body',\n } = props;\n const element = requestedElement ?? getDefaultElement(variant);\n const accessibleLabel = ariaLabel?.trim() || undefined;\n const resolvedAlign =\n align ?? (variant === 'money' || numeric ? 'end' : 'start');\n const needsAlignmentBox =\n align !== undefined || variant === 'money' || numeric;\n let content = getTypographyContent(props, locale, messages.loading);\n\n const canReplaceWithAccessibleLabel =\n format !== undefined ||\n typeof children === 'string' ||\n typeof children === 'number';\n const usesNativeLabel =\n !loading &&\n accessibleLabel !== undefined &&\n !canReplaceWithAccessibleLabel &&\n ['h1', 'h2', 'h3', 'h4'].includes(element);\n const usesLabelledGroup =\n !loading &&\n accessibleLabel !== undefined &&\n !canReplaceWithAccessibleLabel &&\n !usesNativeLabel;\n\n if (\n !loading &&\n accessibleLabel !== undefined &&\n canReplaceWithAccessibleLabel\n ) {\n content = (\n <>\n <span aria-hidden=\"true\">{content}</span>\n <VisuallyHidden>{accessibleLabel}</VisuallyHidden>\n </>\n );\n }\n\n return createElement(\n element,\n {\n 'aria-busy': loading || undefined,\n 'aria-label':\n usesLabelledGroup || usesNativeLabel ? accessibleLabel : undefined,\n className: [\n variants.base.text,\n variants.variant.role[variant],\n variants.variant.tone[tone],\n variants.variant.align[resolvedAlign],\n needsAlignmentBox && variants.state.aligned,\n loading &&\n element === 'span' &&\n !needsAlignmentBox &&\n variants.state.inlineLoading,\n numeric && variant !== 'money' && variants.state.numeric,\n truncate && variants.state.truncate,\n ]\n .filter(Boolean)\n .join(' '),\n id,\n lang: locale,\n role: usesLabelledGroup ? 'group' : undefined,\n },\n content,\n );\n}\n","import type { CalendarDate } from '@internationalized/date';\nimport type { RefObject } from 'react';\nimport {\n createElement,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { Dialog as AriaDialog } from 'react-aria-components/Dialog';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { CalendarSurface, parseCalendarDate } from '../Calendar/Calendar';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport type { IsoCalendarDate } from '../Typography/Typography';\nimport { Typography } from '../Typography/Typography';\n\nconst datePickerVariants = {\n base: {\n popover:\n 'breeze:!inline-size-[360px] breeze:max-inline-size-[calc(100vw_-_24px)] breeze:p-breeze-3 breeze:any-pointer-coarse:!p-0 breeze-date-picker-popover',\n trigger:\n 'breeze:flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:items-center breeze:justify-between breeze:gap-breeze-3 breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[hovered]:border-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[invalid]:border-breeze-danger breeze:disabled:cursor-not-allowed breeze:disabled:bg-breeze-sunken breeze:disabled:opacity-60',\n value: 'breeze:min-inline-size-0 breeze:flex-1 breeze:text-start',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface DatePickerCommonProps {\n /** Focuses the trigger when it first becomes enabled. */\n autoFocus?: boolean;\n /** Prevents opening and selecting. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the trigger. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the submitted value with a form outside its ancestor tree. */\n form?: string;\n /** Sets the trigger id used by the field label. */\n id?: string;\n /** Accessible field label. */\n label: string;\n /** Replaces the field with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Submitted field name. */\n name?: string;\n /** Temporary text shown before a date is selected. */\n placeholder?: string;\n /** Marks the field as required. Defaults to `true`. */\n required?: boolean;\n}\n\ninterface ControlledDatePickerProps {\n /** Current selected ISO calendar date, or `null` when empty. */\n value: IsoCalendarDate | null;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledDatePickerProps {\n /** Initial selected ISO calendar date. */\n defaultValue?: IsoCalendarDate;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange?: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled ISO date selection. */\nexport type DatePickerProps = DatePickerCommonProps &\n (ControlledDatePickerProps | UncontrolledDatePickerProps);\n\nfunction DatePickerTriggerValue({\n placeholder,\n placeholderLocale,\n value,\n valueId,\n}: Readonly<{\n placeholder: string;\n placeholderLocale?: string;\n value?: IsoCalendarDate | null;\n valueId: string;\n}>) {\n return (\n <span className={datePickerVariants.base.value} id={valueId}>\n {value ? (\n <Typography element=\"span\" format=\"date\" value={value} />\n ) : (\n <span lang={placeholderLocale}>{placeholder}</span>\n )}\n </span>\n );\n}\n\nfunction getNextTriggerScrollTop(\n trigger: HTMLElement,\n ancestor: HTMLElement,\n requiredSpace: number,\n viewportBottom: number,\n): number | undefined {\n const triggerTop = trigger.getBoundingClientRect().top;\n const { top: ancestorTop } = ancestor.getBoundingClientRect();\n const contentTop = ancestorTop + ancestor.clientTop;\n const visibleTop = Math.max(contentTop, 0);\n const visibleBottom = Math.min(\n contentTop + ancestor.clientHeight,\n viewportBottom,\n );\n\n if (visibleBottom <= visibleTop) return undefined;\n\n const targetTop = Math.max(visibleTop + 8, visibleBottom - requiredSpace);\n let scrollDelta = 0;\n\n if (triggerTop < visibleTop + 8) {\n scrollDelta = triggerTop - (visibleTop + 8);\n } else if (triggerTop > targetTop) {\n scrollDelta = triggerTop - targetTop;\n }\n\n const maxScrollTop = ancestor.scrollHeight - ancestor.clientHeight;\n const nextScrollTop = Math.round(\n Math.max(0, Math.min(maxScrollTop, ancestor.scrollTop + scrollDelta)),\n );\n\n return nextScrollTop === ancestor.scrollTop ? undefined : nextScrollTop;\n}\n\nfunction scrollTriggerIntoView(trigger: HTMLElement): boolean {\n const requiredSpace = 400;\n const viewportBottom = trigger.ownerDocument.documentElement.clientHeight;\n let didScroll = false;\n\n for (\n let ancestor = trigger.parentElement;\n ancestor !== null;\n ancestor = ancestor.parentElement\n ) {\n const { overflowY } = getComputedStyle(ancestor);\n\n if (\n ['auto', 'scroll'].includes(overflowY) &&\n ancestor.scrollHeight > ancestor.clientHeight\n ) {\n const nextScrollTop = getNextTriggerScrollTop(\n trigger,\n ancestor,\n requiredSpace,\n viewportBottom,\n );\n\n if (nextScrollTop !== undefined) {\n ancestor.scrollTop = nextScrollTop;\n didScroll = true;\n }\n }\n }\n\n return didScroll;\n}\n\nfunction DatePickerPopover({\n calendarKey,\n dialogId,\n disabled,\n isOpen,\n label,\n onChange,\n onOpenChange,\n triggerRef,\n value,\n}: Readonly<{\n calendarKey: number;\n dialogId: string;\n disabled: boolean;\n isOpen: boolean;\n label: string;\n onChange: (date: CalendarDate | null) => void;\n onOpenChange: (open: boolean) => void;\n triggerRef: RefObject<HTMLButtonElement | null>;\n value: IsoCalendarDate | null | undefined;\n}>) {\n const dialogRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!isOpen) return undefined;\n\n const dialog = dialogRef.current;\n const popover = dialog?.closest<HTMLElement>(\n '[data-breeze-overlay=\"popover\"]',\n );\n\n if (!dialog || !popover) return undefined;\n\n const focusRovingDate = () => {\n if (\n popover.hasAttribute('inert') ||\n popover.dataset.breezeInteractive !== 'true'\n ) {\n return false;\n }\n\n const document = dialog.ownerDocument;\n const { activeElement } = document;\n\n if (\n activeElement === triggerRef.current ||\n activeElement === document.body ||\n activeElement === document.documentElement\n ) {\n dialog\n .querySelector<HTMLElement>('[role=\"button\"][tabindex=\"0\"]')\n ?.focus();\n }\n\n return true;\n };\n\n const observer = new MutationObserver(() => {\n if (focusRovingDate()) observer.disconnect();\n });\n\n observer.observe(popover, {\n attributeFilter: ['data-breeze-interactive', 'inert'],\n attributes: true,\n });\n\n if (focusRovingDate()) observer.disconnect();\n\n return () => observer.disconnect();\n }, [isOpen, triggerRef]);\n\n return (\n <CollectionPopover\n className={datePickerVariants.base.popover}\n containerPadding={4}\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n triggerRef={triggerRef}\n >\n <AriaDialog aria-label={label} id={dialogId} ref={dialogRef}>\n <CalendarSurface\n autoFocus={isOpen}\n key={calendarKey}\n disabled={disabled}\n label={label}\n onChange={onChange}\n value={value == null ? null : parseCalendarDate(value)}\n />\n </AriaDialog>\n </CollectionPopover>\n );\n}\n\n/**\n * Renders a required date field with a locale-formatted trigger and calendar.\n *\n * @summary Single-date field with ISO values and a calendar popover.\n */\nexport function DatePicker({\n autoFocus = false,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n required = true,\n value,\n}: Readonly<DatePickerProps>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const placeholderText = placeholder ?? messages.selectDate;\n const placeholderLocale =\n placeholder === undefined ? getMessageLocale('selectDate') : undefined;\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const isInvalid = !loading && visibleError !== undefined;\n const fieldId = useId();\n const labelId = `${fieldId}-label`;\n const valueId = `${fieldId}-value`;\n const dialogId = `${fieldId}-dialog`;\n const descriptionId = visibleDescription\n ? `${fieldId}-description`\n : undefined;\n const errorId = visibleError ? `${fieldId}-error` : undefined;\n const requiredId = required ? `${fieldId}-required` : undefined;\n const triggerId = id ?? `${fieldId}-trigger`;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const hasAutoFocused = useRef(false);\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [isOpen, setIsOpen] = useState(false);\n const [calendarKey, setCalendarKey] = useState(0);\n const [fieldsetDisabled, setFieldsetDisabled] = useState(false);\n const selectedValue = value === undefined ? uncontrolledValue : value;\n const effectiveDisabled = interactionDisabled || fieldsetDisabled;\n const describedBy =\n [descriptionId, !loading ? errorId : undefined, requiredId]\n .filter(Boolean)\n .join(' ') || undefined;\n\n useLayoutEffect(() => {\n const trigger = triggerRef.current;\n if (!trigger) return undefined;\n\n const updateFieldsetDisabled = () => {\n setFieldsetDisabled(!interactionDisabled && trigger.matches(':disabled'));\n };\n\n updateFieldsetDisabled();\n\n const observer = new MutationObserver(updateFieldsetDisabled);\n\n for (\n let ancestor = trigger.parentElement;\n ancestor !== null;\n ancestor = ancestor.parentElement\n ) {\n if (ancestor.tagName === 'FIELDSET') {\n observer.observe(ancestor, {\n attributeFilter: ['disabled'],\n attributes: true,\n });\n }\n }\n\n return () => observer.disconnect();\n }, [interactionDisabled]);\n\n useEffect(() => {\n if (value !== undefined) return undefined;\n\n const handleReset = (event: Event) => {\n const formElement = triggerRef.current?.form;\n\n if (!formElement || event.target !== formElement) return;\n\n queueMicrotask(() => {\n if (!event.defaultPrevented) {\n setUncontrolledValue(defaultValue);\n }\n });\n };\n\n document.addEventListener('reset', handleReset, true);\n\n return () => document.removeEventListener('reset', handleReset, true);\n }, [defaultValue, value]);\n\n useEffect(() => {\n if (effectiveDisabled && isOpen) {\n setIsOpen(false);\n }\n }, [effectiveDisabled, isOpen]);\n\n useEffect(() => {\n if (!autoFocus || effectiveDisabled || hasAutoFocused.current) return;\n\n const trigger = triggerRef.current;\n\n if (!trigger || trigger.matches(':disabled')) return;\n\n trigger.focus();\n hasAutoFocused.current = trigger.ownerDocument.activeElement === trigger;\n }, [autoFocus, effectiveDisabled]);\n\n const visibleOpen = isOpen && !effectiveDisabled;\n const handleOpenChange = (open: boolean) => {\n if (\n open &&\n (effectiveDisabled || triggerRef.current?.matches(':disabled'))\n ) {\n return;\n }\n\n if (open && !isOpen) {\n setCalendarKey((currentKey) => currentKey + 1);\n }\n\n setIsOpen(open);\n };\n\n const handleTriggerPress = () => {\n if (visibleOpen) {\n handleOpenChange(false);\n return;\n }\n\n const trigger = triggerRef.current;\n\n if (!trigger || effectiveDisabled || trigger.matches(':disabled')) {\n return;\n }\n\n if (scrollTriggerIntoView(trigger)) {\n if (typeof requestAnimationFrame === 'undefined') {\n setTimeout(() => handleOpenChange(true), 0);\n } else {\n requestAnimationFrame(() => handleOpenChange(true));\n }\n\n return;\n }\n\n handleOpenChange(true);\n };\n const handleDateChange = (date: CalendarDate | null) => {\n if (\n !date ||\n effectiveDisabled ||\n triggerRef.current?.matches(':disabled')\n ) {\n return;\n }\n\n const nextValue = date.toString() as IsoCalendarDate;\n\n if (value === undefined) {\n setUncontrolledValue(nextValue);\n }\n\n onChange?.(nextValue);\n handleOpenChange(false);\n };\n\n return (\n <div\n className={fieldVariants.base.root}\n data-required={required || undefined}\n >\n <FieldLabel\n htmlFor={triggerId}\n id={labelId}\n label={label}\n loading={loading}\n onClick={() => triggerRef.current?.focus()}\n />\n <span className={fieldVariants.base.control}>\n <AriaButton\n className={joinClassNames(\n datePickerVariants.base.trigger,\n isInvalid && 'breeze:border-breeze-danger',\n loading && 'breeze:!opacity-0',\n )}\n isDisabled={interactionDisabled}\n onPress={handleTriggerPress}\n ref={triggerRef}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n 'aria-controls': visibleOpen ? dialogId : undefined,\n 'aria-describedby': describedBy,\n 'aria-errormessage': !loading ? errorId : undefined,\n 'aria-expanded': visibleOpen,\n 'aria-haspopup': 'dialog',\n 'aria-invalid': isInvalid || undefined,\n 'aria-label': loading ? label : undefined,\n 'aria-labelledby': !loading ? `${labelId} ${valueId}` : undefined,\n 'data-invalid': isInvalid || undefined,\n form,\n id: triggerId,\n type: 'button',\n })\n }\n >\n <DatePickerTriggerValue\n placeholder={placeholderText}\n placeholderLocale={placeholderLocale}\n value={selectedValue}\n valueId={valueId}\n />\n <Icon name=\"calendar\" size=\"sm\" />\n </AriaButton>\n {loading && (\n <span className={fieldVariants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </span>\n {name && (\n <input\n disabled={interactionDisabled}\n form={form}\n name={name}\n type=\"hidden\"\n value={selectedValue ?? ''}\n />\n )}\n {required && (\n <span\n className=\"breeze:sr-only\"\n id={requiredId}\n lang={getMessageLocale('required')}\n >\n {messages.required}\n </span>\n )}\n <DatePickerPopover\n calendarKey={calendarKey}\n dialogId={dialogId}\n disabled={effectiveDisabled}\n isOpen={visibleOpen}\n label={label}\n onChange={handleDateChange}\n onOpenChange={handleOpenChange}\n triggerRef={triggerRef}\n value={selectedValue}\n />\n <FieldSupportingContent\n description={visibleDescription}\n descriptionId={descriptionId}\n loading={loading}\n />\n {visibleError && (\n <p\n aria-hidden={loading || undefined}\n className={fieldVariants.base.error}\n id={errorId}\n >\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n visibleError\n )}\n </p>\n )}\n </div>\n );\n}\n","import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Dialog as AriaDialog } from 'react-aria-components/Dialog';\nimport { Modal, ModalOverlay } from 'react-aria-components/Modal';\nimport { Popover as AriaPopover } from 'react-aria-components/Popover';\nimport { Button } from '../primitives/Button/Button';\nimport { useBreezeContext } from '../provider/BreezeContext';\nimport type { OverlayKind, OverlayProps } from './overlay.types';\nimport { useOverlayPortal } from './OverlayProvider';\nimport { ParentOverlayContext, useOverlayLayer } from './OverlayStack';\n\nconst variants = {\n base: {\n content: 'breeze-overlay-content',\n header: 'breeze-overlay-header',\n title: 'breeze-overlay-title',\n },\n compound: {},\n size: {},\n state: {},\n variant: {\n dialog: 'breeze-dialog',\n drawer: 'breeze-drawer',\n fullscreen: 'breeze-fullscreen',\n popover: 'breeze-popover',\n },\n} as const;\n\nconst triggerBoundaryError =\n 'Breeze overlay triggers and portal containers must belong to the current document and light DOM.';\n\nfunction isNode(value: EventTarget | null): value is Node {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).contains === 'function'\n );\n}\n\nfunction hasOverlayMarker(element: Element) {\n return (\n (element as Element & { dataset?: DOMStringMap }).dataset?.breezeOverlay !==\n undefined\n );\n}\n\nfunction OverlaySurface({\n children,\n defaultOpen = false,\n dismissible = true,\n kind,\n onOpenChange,\n open: controlledOpen,\n placement = 'bottom',\n title,\n trigger,\n}: Readonly<\n Omit<OverlayProps, 'open' | 'defaultOpen' | 'onOpenChange'> & {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n kind: OverlayKind;\n placement?: 'top' | 'bottom' | 'start' | 'end';\n }\n>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const nonModal = kind === 'popover' || kind === 'fullscreen';\n const host = useOverlayPortal();\n const parent = useContext(ParentOverlayContext);\n const [portalReady, setPortalReady] = useState(parent === null);\n // Mount nested portals after the parent's modality effects. Otherwise a\n // default-open parent can aria-hide its already mounted child portal.\n useEffect(() => setPortalReady(true), []);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const requestedOpen = controlledOpen ?? uncontrolledOpen;\n const parentOpen = parent?.open ?? true;\n const open = requestedOpen && parentOpen;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLElement | null>(null);\n const [surfaceMounted, setSurfaceMounted] = useState(false);\n const refocusingRef = useRef(false);\n const refocusTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const pointerDismissTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const pointerDownTargetRef = useRef<Node | null>(null);\n const blurDismissTargetRef = useRef<Node | null>(null);\n const parentCloseReportedRef = useRef(false);\n useLayoutEffect(() => {\n if (\n host &&\n triggerRef.current &&\n (triggerRef.current.ownerDocument !== document ||\n triggerRef.current.getRootNode() !== document ||\n host.ownerDocument !== document ||\n host.getRootNode() !== document)\n ) {\n throw new Error(triggerBoundaryError);\n }\n }, [host]);\n // Full-screen surfaces belong to the viewport, not the sheet's scrollable\n // trigger. Keep the actual trigger separately for focus restoration.\n const positionRef = useMemo(\n () => (kind === 'fullscreen' ? { current: host } : triggerRef),\n [host, kind],\n );\n const layer = useOverlayLayer(\n kind,\n open && portalReady && host !== null,\n open || surfaceMounted,\n );\n const changeOpen = useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && !parentOpen) {\n if (parentCloseReportedRef.current) return;\n if (requestedOpen) parentCloseReportedRef.current = true;\n }\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [controlledOpen, onOpenChange, parentOpen, requestedOpen],\n );\n\n useEffect(() => {\n if (parentOpen) {\n parentCloseReportedRef.current = false;\n } else if (requestedOpen) {\n changeOpen(false);\n }\n }, [changeOpen, parentOpen, requestedOpen]);\n\n useEffect(() => {\n if (kind !== 'popover' || !open || !dismissible || !layer.topmost || !host)\n return undefined;\n // RAC non-modal popovers close on blur, but not on outside clicks. Wait for\n // click when available, falling back after a completed outside pointerup.\n const clearPointerDismissTimer = () => {\n if (pointerDismissTimerRef.current !== null) {\n clearTimeout(pointerDismissTimerRef.current);\n pointerDismissTimerRef.current = null;\n }\n };\n const sameTarget = (left: Node | null, right: Node | null) =>\n !!left &&\n !!right &&\n (left === right || left.contains(right) || right.contains(left));\n const isPrimaryPointer = (event: PointerEvent) => event.button === 0;\n const isOutside = (target: Node | null) =>\n isNode(target) &&\n !popoverRef.current?.contains(target) &&\n !triggerRef.current?.contains(target);\n const onPointerDown = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n // A blur caused by a previous keyboard interaction must not suppress a\n // later pointer dismissal.\n clearPointerDismissTimer();\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = isNode(event.target) ? event.target : null;\n };\n const onPointerUp = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n const pointerDownTarget = pointerDownTargetRef.current;\n const pointerUpTarget = isNode(event.target) ? event.target : null;\n if (!isOutside(pointerDownTarget) || !isOutside(pointerUpTarget)) return;\n clearPointerDismissTimer();\n pointerDismissTimerRef.current = setTimeout(() => {\n pointerDismissTimerRef.current = null;\n const blurTarget = blurDismissTargetRef.current;\n const pointerTarget = pointerDownTargetRef.current;\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n if (\n sameTarget(blurTarget, pointerUpTarget) &&\n sameTarget(blurTarget, pointerTarget)\n ) {\n return;\n }\n changeOpen(false);\n }, 0);\n };\n const onPointerCancel = () => {\n clearPointerDismissTimer();\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n };\n const onOutsideClick = (event: MouseEvent) => {\n const target = isNode(event.target) ? event.target : null;\n clearPointerDismissTimer();\n if (isOutside(target)) {\n const blurTarget = blurDismissTargetRef.current;\n const pointerTarget = pointerDownTargetRef.current;\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n if (\n sameTarget(blurTarget, target) &&\n sameTarget(blurTarget, pointerTarget)\n ) {\n return;\n }\n changeOpen(false);\n }\n };\n host.ownerDocument.addEventListener('pointerdown', onPointerDown, true);\n host.ownerDocument.addEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.addEventListener('pointercancel', onPointerCancel, true);\n host.ownerDocument.addEventListener('click', onOutsideClick, true);\n return () => {\n clearPointerDismissTimer();\n host.ownerDocument.removeEventListener(\n 'pointerdown',\n onPointerDown,\n true,\n );\n host.ownerDocument.removeEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.removeEventListener(\n 'pointercancel',\n onPointerCancel,\n true,\n );\n host.ownerDocument.removeEventListener('click', onOutsideClick, true);\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n };\n }, [changeOpen, dismissible, host, kind, layer.topmost, open]);\n\n const restoreParentFocus = parent?.restoreFocus;\n const parentId = parent?.id;\n const restoreFocus = useCallback(() => {\n const target = triggerRef.current;\n const document = host?.ownerDocument;\n const focused = document?.activeElement;\n if (!document || !host) return;\n const parentSurface = parentId ? document.getElementById(parentId) : null;\n const focusLost =\n focused === document.body ||\n focused === parentSurface ||\n !!focused?.closest('[data-exiting]');\n if (!focusLost) return;\n if (!target?.isConnected) {\n restoreParentFocus?.();\n return;\n }\n const topmost = host.querySelector('[data-breeze-topmost=\"true\"]');\n if (\n (!topmost || topmost.contains(target)) &&\n !target.closest('[inert], [aria-hidden=\"true\"]')\n ) {\n target.focus({ preventScroll: true });\n }\n }, [host, parentId, restoreParentFocus]);\n\n const clearRefocusTimer = useCallback(() => {\n if (refocusTimerRef.current !== null) {\n clearTimeout(refocusTimerRef.current);\n refocusTimerRef.current = null;\n }\n }, []);\n const focusSurface = useCallback(\n (element: HTMLElement) => {\n queueMicrotask(() => {\n if (\n !element.isConnected ||\n element.closest('[inert], [data-exiting]')\n ) {\n return;\n }\n clearRefocusTimer();\n element.focus({ preventScroll: true });\n refocusTimerRef.current = setTimeout(() => {\n const { ownerDocument } = element;\n const { activeElement: focused } = ownerDocument;\n if (\n element.isConnected &&\n !element.closest('[inert], [data-exiting]') &&\n (focused === element || focused === ownerDocument.body)\n ) {\n refocusingRef.current = true;\n element.blur();\n element.focus({ preventScroll: true });\n refocusingRef.current = false;\n }\n refocusTimerRef.current = null;\n }, 500);\n });\n },\n [clearRefocusTimer],\n );\n const previousOpenRef = useRef(open);\n useEffect(() => {\n const wasOpen = previousOpenRef.current;\n previousOpenRef.current = open;\n if (!nonModal || !open || wasOpen || !contentRef.current) return;\n focusSurface(contentRef.current);\n }, [focusSurface, nonModal, open]);\n\n const surfaceRef = useCallback(\n (element: HTMLElement | null) => {\n contentRef.current = element;\n const cleanup = () => {\n clearRefocusTimer();\n contentRef.current = null;\n setSurfaceMounted(false);\n requestAnimationFrame(restoreFocus);\n };\n if (!element) {\n cleanup();\n return undefined;\n }\n setSurfaceMounted(true);\n if (nonModal) focusSurface(element);\n // React Aria restores ordinary closes. Nested simultaneous exits can leave\n // focus on body; repair only that gap after its focus-scope cleanup runs.\n return cleanup;\n },\n [clearRefocusTimer, focusSurface, nonModal, restoreFocus],\n );\n\n const parentContext = useMemo(\n () => ({ id: layer.id, open, restoreFocus }),\n [layer.id, open, restoreFocus],\n );\n const body = (\n <>\n <div className={variants.base.header}>\n <h2 className={variants.base.title}>{title}</h2>\n <span lang={getMessageLocale('close')}>\n <Button onAction={() => changeOpen(false)} variant=\"quiet\">\n {messages.close}\n </Button>\n </span>\n </div>\n {children}\n </>\n );\n const content = (\n <ParentOverlayContext value={parentContext}>\n {nonModal ? (\n <section\n aria-label={title}\n className={variants.base.content}\n id={layer.id}\n onBlur={(event) => {\n if (refocusingRef.current) {\n event.stopPropagation();\n return;\n }\n const { relatedTarget } = event;\n if (\n kind === 'popover' &&\n dismissible &&\n layer.topmost &&\n isNode(relatedTarget) &&\n !event.currentTarget.contains(relatedTarget) &&\n !triggerRef.current?.contains(relatedTarget)\n ) {\n blurDismissTargetRef.current = relatedTarget;\n }\n }}\n ref={surfaceRef}\n role=\"dialog\"\n tabIndex={-1}\n >\n {body}\n </section>\n ) : (\n <AriaDialog\n aria-label={title}\n className={variants.base.content}\n id={layer.id}\n ref={surfaceRef}\n >\n {body}\n </AriaDialog>\n )}\n </ParentOverlayContext>\n );\n\n return (\n <>\n <Button\n aria-controls={open ? layer.id : undefined}\n aria-expanded={open}\n aria-haspopup=\"dialog\"\n onAction={() => changeOpen(nonModal ? !open : true)}\n ref={triggerRef}\n >\n {trigger}\n </Button>\n {host &&\n portalReady &&\n (nonModal ? (\n <AriaPopover\n className={variants.variant[kind]}\n data-breeze-overlay={kind}\n data-breeze-topmost={layer.topmost}\n data-breeze-interactive={layer.interactive}\n inert={!layer.interactive}\n isNonModal\n isOpen={open}\n isKeyboardDismissDisabled={!dismissible || !layer.topmost}\n onOpenChange={changeOpen}\n placement={placement}\n ref={popoverRef}\n // Leave the trigger in the blur scope so its action can toggle the popover.\n shouldCloseOnInteractOutside={(element) =>\n kind === 'popover' &&\n dismissible &&\n layer.topmost &&\n !triggerRef.current?.contains(element)\n }\n style={{ zIndex: layer.zIndex }}\n triggerRef={positionRef}\n >\n {content}\n </AriaPopover>\n ) : (\n <ModalOverlay\n className=\"breeze-overlay-backdrop\"\n data-breeze-overlay={kind}\n data-breeze-scrim={layer.scrim}\n data-breeze-topmost={layer.topmost}\n data-breeze-interactive={layer.interactive}\n inert={!layer.interactive}\n isDismissable={dismissible && layer.topmost}\n isKeyboardDismissDisabled={!dismissible || !layer.topmost}\n isOpen={open}\n onOpenChange={changeOpen}\n shouldCloseOnInteractOutside={(element) =>\n layer.topmost && hasOverlayMarker(element)\n }\n style={{ zIndex: layer.zIndex }}\n >\n <Modal className={variants.variant[kind]}>{content}</Modal>\n </ModalOverlay>\n ))}\n </>\n );\n}\n\nexport default OverlaySurface;\n","import type { OverlayProps } from '../../overlays/overlay.types';\nimport OverlaySurface from '../../overlays/OverlaySurface';\n\nexport type DialogProps = OverlayProps;\n\n/**\n * Opens a labelled dialog with library-owned nesting and motion.\n * @summary A labelled dialog surface with a trigger and close action.\n */\nexport function Dialog({\n children,\n defaultOpen,\n dismissible,\n onOpenChange,\n open,\n title,\n trigger,\n}: Readonly<DialogProps>) {\n return (\n <OverlaySurface\n defaultOpen={defaultOpen}\n dismissible={dismissible}\n onOpenChange={onOpenChange}\n open={open}\n title={title}\n trigger={trigger}\n kind=\"dialog\"\n >\n {children}\n </OverlaySurface>\n );\n}\n","import type { OverlayProps } from '../../overlays/overlay.types';\nimport OverlaySurface from '../../overlays/OverlaySurface';\n\nexport type DrawerProps = OverlayProps;\n\n/**\n * Opens a labelled drawer with library-owned nesting and motion.\n * @summary A labelled drawer surface with a trigger and close action.\n */\nexport function Drawer({\n children,\n defaultOpen,\n dismissible,\n onOpenChange,\n open,\n title,\n trigger,\n}: Readonly<DrawerProps>) {\n return (\n <OverlaySurface\n defaultOpen={defaultOpen}\n dismissible={dismissible}\n onOpenChange={onOpenChange}\n open={open}\n title={title}\n trigger={trigger}\n kind=\"drawer\"\n >\n {children}\n </OverlaySurface>\n );\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutElement, LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n grid: 'breeze:grid breeze:min-inline-size-0',\n },\n compound: {\n columns: {\n 1: {\n lg: 'breeze:grid-cols-1',\n md: 'breeze:grid-cols-1',\n none: 'breeze:grid-cols-1',\n sm: 'breeze:grid-cols-1',\n },\n 2: {\n lg: 'breeze:grid-cols-2 breeze:max-breeze-lg:grid-cols-1',\n md: 'breeze:grid-cols-2 breeze:max-breeze-md:grid-cols-1',\n none: 'breeze:grid-cols-2',\n sm: 'breeze:grid-cols-2 breeze:max-breeze-sm:grid-cols-1',\n },\n 3: {\n lg: 'breeze:grid-cols-3 breeze:max-breeze-lg:grid-cols-1',\n md: 'breeze:grid-cols-3 breeze:max-breeze-md:grid-cols-1',\n none: 'breeze:grid-cols-3',\n sm: 'breeze:grid-cols-3 breeze:max-breeze-sm:grid-cols-1',\n },\n },\n },\n size: {\n 0: 'breeze:gap-0',\n 1: 'breeze:gap-breeze-1',\n 2: 'breeze:gap-breeze-2',\n 3: 'breeze:gap-breeze-3',\n 4: 'breeze:gap-breeze-4',\n 5: 'breeze:gap-breeze-5',\n 6: 'breeze:gap-breeze-6',\n 7: 'breeze:gap-breeze-7',\n 8: 'breeze:gap-breeze-8',\n },\n state: {},\n variant: {},\n} as const;\n\nexport type GridColumns = 1 | 2 | 3;\nexport type GridCollapseBelow = 'lg' | 'md' | 'none' | 'sm';\n\nexport interface GridProps {\n /** Names the grid when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Items arranged in the grid. */\n children: ReactNode;\n /** Breakpoint below which multiple columns collapse to one. Defaults to `md`. */\n collapseBelow?: GridCollapseBelow;\n /** Number of equal-width columns. Defaults to `2`. */\n columns?: GridColumns;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Applies space between items from the Breeze spacing scale. Defaults to `4`. */\n gap?: LayoutGap;\n}\n\n/**\n * Arranges children in equal columns and can collapse at a Breeze breakpoint.\n *\n * @summary A constrained responsive grid primitive.\n */\nexport function Grid({\n 'aria-label': ariaLabel,\n children,\n collapseBelow = 'md',\n columns = 2,\n element = 'div',\n gap = 4,\n}: Readonly<GridProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.grid,\n variants.compound.columns[columns][collapseBelow],\n variants.size[gap],\n ].join(' '),\n role,\n },\n children,\n );\n}\n","import { Icon, type IconName } from '../Icon/Icon';\n\nconst variants = {\n base: {\n tile: 'breeze:inline-flex breeze:shrink-0 breeze:items-center breeze:justify-center',\n },\n compound: {},\n size: {\n lg: 'breeze:block-size-breeze-tap breeze:inline-size-breeze-tap',\n sm: 'breeze:block-size-breeze-7 breeze:inline-size-breeze-7',\n },\n state: {},\n variant: {\n shape: {\n circle: 'breeze:rounded-breeze-full',\n square: 'breeze:rounded-breeze-sm',\n },\n tone: {\n brand: 'breeze:bg-breeze-brand-soft breeze:text-breeze-brand-text',\n danger: 'breeze:bg-breeze-danger/10 breeze:text-breeze-danger',\n neutral: 'breeze:bg-breeze-sunken breeze:text-breeze-ink-2',\n positive: 'breeze:bg-breeze-pos-soft breeze:text-breeze-pos',\n warning: 'breeze:bg-breeze-warn-soft breeze:text-breeze-warn',\n },\n },\n} as const;\n\nexport type IconTileShape = keyof typeof variants.variant.shape;\nexport type IconTileSize = keyof typeof variants.size;\nexport type IconTileTone = keyof typeof variants.variant.tone;\n\nexport interface IconTileProps {\n /** Names meaningful artwork; omit when nearby text already describes it. */\n label?: string;\n /** Selects artwork from the curated Breeze icon set. */\n name: IconName;\n /** Selects a circular or rounded-square tile. Defaults to `square`. */\n shape?: IconTileShape;\n /** Selects the tile dimensions. Defaults to `lg`. */\n size?: IconTileSize;\n /** Selects the semantic colour treatment. Defaults to `brand`. */\n tone?: IconTileTone;\n}\n\n/**\n * Places curated artwork on a semantic colour wash.\n *\n * @summary A compact icon decoration for rows and content states.\n */\nexport function IconTile({\n label,\n name,\n shape = 'square',\n size = 'lg',\n tone = 'brand',\n}: Readonly<IconTileProps>) {\n return (\n <span\n className={[\n variants.base.tile,\n variants.variant.tone[tone],\n variants.variant.shape[shape],\n variants.size[size],\n ].join(' ')}\n >\n <Icon label={label} name={name} size={size === 'lg' ? 'md' : 'sm'} />\n </span>\n );\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutAlign, LayoutElement, LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n inline: 'breeze:flex breeze:min-inline-size-0',\n },\n compound: {},\n size: {\n 0: 'breeze:gap-0',\n 1: 'breeze:gap-breeze-1',\n 2: 'breeze:gap-breeze-2',\n 3: 'breeze:gap-breeze-3',\n 4: 'breeze:gap-breeze-4',\n 5: 'breeze:gap-breeze-5',\n 6: 'breeze:gap-breeze-6',\n 7: 'breeze:gap-breeze-7',\n 8: 'breeze:gap-breeze-8',\n },\n state: {\n wrap: 'breeze:flex-wrap',\n },\n variant: {\n align: {\n center: 'breeze:items-center',\n end: 'breeze:items-end',\n start: 'breeze:items-start',\n stretch: 'breeze:items-stretch',\n },\n justify: {\n between: 'breeze:justify-between',\n center: 'breeze:justify-center',\n end: 'breeze:justify-end',\n start: 'breeze:justify-start',\n },\n },\n} as const;\n\nexport type InlineJustify = keyof typeof variants.variant.justify;\n\nexport interface InlineProps {\n /** Names the row when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Items arranged horizontally. */\n children: ReactNode;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Applies space between items from the Breeze spacing scale. Defaults to `3`. */\n gap?: LayoutGap;\n /** Distributes items along the inline axis. Defaults to `start`. */\n justify?: InlineJustify;\n /** Aligns items along the block axis. Defaults to `center`. */\n verticalAlign?: LayoutAlign;\n /** Allows items to wrap onto additional rows. Defaults to `false`. */\n wrap?: boolean;\n}\n\n/**\n * Arranges children horizontally on the Breeze spacing scale.\n *\n * @summary A constrained horizontal layout primitive.\n */\nexport function Inline({\n 'aria-label': ariaLabel,\n children,\n element = 'div',\n gap = 3,\n justify = 'start',\n verticalAlign = 'center',\n wrap = false,\n}: Readonly<InlineProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.inline,\n variants.variant.align[verticalAlign],\n variants.variant.justify[justify],\n variants.size[gap],\n wrap && variants.state.wrap,\n ]\n .filter(Boolean)\n .join(' '),\n role,\n },\n children,\n );\n}\n","import {\n createElement,\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n MenuTrigger as AriaMenuTrigger,\n} from 'react-aria-components/Menu';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Badge } from '../Badge/Badge';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport type { IconName } from '../Icon/Icon';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n badge: 'breeze:ms-auto',\n content:\n 'breeze:flex breeze:min-inline-size-0 breeze:flex-1 breeze:flex-col breeze:gap-breeze-1',\n description:\n 'breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n icon: 'breeze:block-size-breeze-4 breeze:inline-size-breeze-4 breeze:shrink-0',\n item: 'breeze:flex breeze:min-inline-size-0 breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:items-center breeze:gap-breeze-2 breeze:rounded-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:text-start breeze:outline-offset-[-2px] breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[focused]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken',\n label: 'breeze:font-medium',\n menu: 'breeze:min-inline-size-0 breeze:outline-none',\n popover:\n 'breeze:[min-inline-size:var(--trigger-width)] breeze:max-inline-size-[calc(100vw-24px)] breeze:overflow-auto breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:bg-breeze-surface breeze:p-breeze-1 breeze:shadow-breeze-overlay',\n trigger:\n 'breeze:inline-flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:items-center breeze:gap-breeze-2 breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand',\n triggerLabel:\n 'breeze:inline-grid breeze:min-inline-size-0 breeze:items-center',\n triggerLabelContent: 'breeze:[grid-area:1/1]',\n triggerLabelSkeleton: 'breeze:[grid-area:1/1] breeze:inline-size-full',\n triggerLoadingStatus: 'breeze:sr-only',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface MenuCommonProps<T> {\n /** Returns the display details for an application item. */\n getItem: (item: T) => ItemDescriptor;\n /** Application items displayed as actions. */\n items: T[];\n /** Called with the selected action's ItemDescriptor. */\n onAction?: (descriptor: ItemDescriptor) => void;\n /** Shows a loading bar on the trigger and prevents opening the menu. */\n loading?: boolean;\n /** Icon shown beside the trigger label. */\n triggerIcon?: IconName;\n /** Visible label for the button that opens the menu. */\n trigger: string;\n}\n\ninterface ControlledMenuProps {\n /** Only set when visibility is uncontrolled. */\n defaultOpen?: never;\n /** Called when the menu should open or close. */\n onOpenChange: (open: boolean) => void;\n /** Whether the menu is open. */\n open: boolean;\n}\n\ninterface UncontrolledMenuProps {\n /** Initial visibility. Defaults to `false`. */\n defaultOpen?: boolean;\n /** Called when the menu opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Only set when visibility is controlled. */\n open?: never;\n}\n\n/** Props for a menu with caller-controlled or internal visibility. */\nexport type MenuProps<T> = MenuCommonProps<T> &\n (ControlledMenuProps | UncontrolledMenuProps);\n\ninterface MenuItemContentProps {\n descriptionId: string;\n descriptor: ItemDescriptor;\n}\n\nfunction MenuItemContent({\n descriptionId,\n descriptor,\n}: Readonly<MenuItemContentProps>) {\n return (\n <>\n <span aria-hidden=\"true\" className={variants.base.icon}>\n {descriptor.icon && <Icon name={descriptor.icon} size=\"sm\" />}\n </span>\n <span className={variants.base.content}>\n <span className={variants.base.label}>{descriptor.label}</span>\n {descriptor.description && (\n <span className={variants.base.description} id={descriptionId}>\n {descriptor.description}\n </span>\n )}\n </span>\n {descriptor.badge && (\n <span className={variants.base.badge}>\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n </span>\n )}\n </>\n );\n}\n\nfunction getMenuItemAccessibleName(descriptor: ItemDescriptor) {\n if (!descriptor.badge) return descriptor.label;\n\n const badgeLabel =\n descriptor.badge['aria-label']?.trim() || descriptor.badge.children;\n\n return `${descriptor.label}, ${badgeLabel}`;\n}\n\nfunction MenuLoadingStatus({ loading }: Readonly<{ loading: boolean }>) {\n const { getMessageLocale, messages } = useBreezeContext();\n\n return (\n <>\n {loading && (\n <span className={variants.base.triggerLoadingStatus}>\n <Skeleton label={messages.loading} />\n </span>\n )}\n <output\n aria-live=\"polite\"\n className={variants.base.triggerLoadingStatus}\n lang={getMessageLocale('loading')}\n >\n {loading ? messages.loading : ''}\n </output>\n </>\n );\n}\n\n/**\n * Displays related actions from a labelled trigger button.\n *\n * Set `loading` while the trigger should not open the menu. The loading status\n * is announced while the trigger keeps its accessible name and dimensions.\n *\n * @summary A compact menu for secondary actions.\n */\nexport function Menu<T>({\n defaultOpen,\n getItem,\n items,\n loading = false,\n onAction,\n onOpenChange,\n open: controlledOpen,\n trigger,\n triggerIcon,\n}: Readonly<MenuProps<T>>) {\n useBreezeContext();\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(\n defaultOpen ?? false,\n );\n const open = controlledOpen ?? uncontrolledOpen;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const restoreFocusRef = useRef(false);\n const menuId = useId();\n const descriptors = useMemo(() => items.map(getItem), [getItem, items]);\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n if (loading && nextOpen) return;\n\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [controlledOpen, loading, onOpenChange],\n );\n\n useLayoutEffect(() => {\n if (!open && restoreFocusRef.current) {\n restoreFocusRef.current = false;\n\n requestAnimationFrame(() => {\n const triggerElement = triggerRef.current;\n\n if (\n triggerElement &&\n triggerElement.ownerDocument.activeElement ===\n triggerElement.ownerDocument.body\n ) {\n triggerElement.focus();\n }\n });\n }\n }, [open]);\n\n return (\n <>\n <AriaMenuTrigger isOpen={open} onOpenChange={handleOpenChange}>\n <AriaButton\n aria-haspopup=\"menu\"\n className={variants.base.trigger}\n isPending={loading}\n ref={triggerRef}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n type: 'button',\n })\n }\n >\n {triggerIcon && <Icon name={triggerIcon} size=\"sm\" />}\n <span className={variants.base.triggerLabel}>\n <span\n className={[\n variants.base.triggerLabelContent,\n loading && 'breeze:opacity-0',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {trigger}\n </span>\n {loading && (\n <span\n aria-hidden=\"true\"\n className={variants.base.triggerLabelSkeleton}\n data-breeze-skeleton=\"\"\n >\n <Skeleton />\n </span>\n )}\n </span>\n <Icon name=\"expand\" size=\"sm\" />\n </AriaButton>\n <CollectionPopover\n className={variants.base.popover}\n isOpen={open}\n onOpenChange={handleOpenChange}\n triggerRef={triggerRef}\n >\n <div\n onKeyDownCapture={(event) => {\n if (event.key === 'Escape') restoreFocusRef.current = true;\n }}\n >\n <AriaMenu\n className={variants.base.menu}\n id={menuId}\n onAction={(key) => {\n const descriptor = descriptors.find((item) => item.id === key);\n if (descriptor) {\n restoreFocusRef.current = true;\n onAction?.(descriptor);\n }\n }}\n >\n {descriptors.map((descriptor, index) => {\n const descriptionId = `${menuId}-description-${index}`;\n\n return (\n <AriaMenuItem\n aria-describedby={\n descriptor.description ? descriptionId : undefined\n }\n aria-label={getMenuItemAccessibleName(descriptor)}\n className={variants.base.item}\n id={descriptor.id}\n isDisabled={descriptor.disabled}\n key={descriptor.id}\n textValue={descriptor.label}\n >\n <MenuItemContent\n descriptionId={descriptionId}\n descriptor={descriptor}\n />\n </AriaMenuItem>\n );\n })}\n </AriaMenu>\n </div>\n </CollectionPopover>\n </AriaMenuTrigger>\n <MenuLoadingStatus loading={loading} />\n </>\n );\n}\n","import type { Ref } from 'react';\nimport { createElement } from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { Group as AriaGroup } from 'react-aria-components/Group';\nimport { Input as AriaInput } from 'react-aria-components/Input';\nimport { NumberField as AriaNumberField } from 'react-aria-components/NumberField';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n group:\n 'breeze:relative breeze:inline-flex breeze:min-block-breeze-md breeze:min-inline-size-0 breeze:inline-size-full breeze:items-stretch breeze:overflow-hidden breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:has-[input[data-focus-visible]]:outline-2 breeze:has-[input[data-focus-visible]]:outline-solid breeze:has-[input[data-focus-visible]]:outline-breeze-brand breeze:has-[input[data-invalid]]:border-breeze-danger breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:bg-breeze-sunken',\n input:\n 'breeze:min-block-breeze-md breeze:min-inline-size-0 breeze:flex-1 breeze:border-0 breeze:rounded-none breeze:bg-transparent breeze:tabular-nums breeze:outline-none breeze:placeholder:text-breeze-ink-3 breeze:data-[hovered]:border-transparent breeze:data-[focus-visible]:!outline-none breeze:data-[invalid]:border-transparent breeze:disabled:cursor-not-allowed breeze:read-only:cursor-default',\n skeleton:\n 'breeze:pointer-events-none breeze:absolute breeze:[inset-block:0] breeze:[inset-inline:0]',\n stepButton:\n 'breeze:min-inline-breeze-md breeze:border-0 breeze:bg-transparent breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:font-breeze-sans breeze:text-breeze-md breeze:font-semibold breeze:leading-none breeze:text-breeze-ink breeze:disabled:cursor-not-allowed breeze:disabled:opacity-50 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap breeze:hover:text-breeze-brand breeze:focus-visible:outline-2 breeze:focus-visible:outline-solid breeze:focus-visible:outline-breeze-brand breeze:outline-offset-[-2px]',\n },\n compound: {},\n size: {},\n state: {\n loadingGroup:\n 'breeze:!bg-transparent breeze:!border-transparent breeze:!opacity-100 breeze:!overflow-visible',\n loadingInput: 'breeze:!opacity-0',\n loadingStepButton: 'breeze:!opacity-0',\n readOnlyGroup: 'breeze:!bg-breeze-sunken',\n },\n variant: {},\n} as const;\n\ninterface NumberFieldCommonProps {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the input when the component is mounted. */\n autoFocus?: boolean;\n /** Supporting guidance announced with the input. */\n description?: string;\n /** Prevents editing, stepping, and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the field with a form outside its ancestor tree. */\n form?: string;\n /** Locale-aware formatting options used by React Aria. */\n formatOptions?: Intl.NumberFormatOptions;\n /** Sets the native input id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the input with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Largest permitted value. */\n maxValue?: number;\n /** Smallest permitted value. */\n minValue?: number;\n /** Sets the submitted name of the field's hidden native input. */\n name?: string;\n /** Temporary text shown while the input is empty. */\n placeholder?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native numeric input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the input as required. Defaults to `false`. */\n required?: boolean;\n /** Amount applied by arrow keys and stepper buttons. Defaults to `1`. */\n step?: number;\n}\n\ninterface ControlledNumberFieldProps {\n /** Current number. React Aria reports `NaN` while the input is empty. */\n value: number;\n /** Reports the next number without exposing a DOM event. */\n onChange: (value: number) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledNumberFieldProps {\n /** Initial number. Defaults to an empty numeric input. */\n defaultValue?: number;\n /** Reports the next number without exposing a DOM event. */\n onChange?: (value: number) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled locale-aware numeric entry. */\nexport type NumberFieldProps = NumberFieldCommonProps &\n (ControlledNumberFieldProps | UncontrolledNumberFieldProps);\n\n/**\n * Renders locale-aware numeric entry with React Aria stepper controls,\n * validation, tabular figures, and a closed loading presentation.\n *\n * @summary Flat numeric entry with semantic number changes.\n */\nexport function NumberField({\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n formatOptions,\n id,\n label,\n loading = false,\n maxValue,\n minValue,\n name,\n onChange,\n placeholder,\n readOnly = false,\n ref,\n required = false,\n step,\n value,\n}: Readonly<NumberFieldProps>) {\n const { messages } = useBreezeContext();\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaNumberField\n autoFocus={autoFocus}\n aria-label={loading ? label : undefined}\n className={fieldVariants.base.root}\n defaultValue={defaultValue}\n form={form}\n formatOptions={formatOptions}\n id={id}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={maxValue}\n minValue={minValue}\n name={name}\n onChange={onChange}\n step={step}\n validationBehavior=\"aria\"\n value={value}\n >\n <FieldLabel label={label} loading={loading} />\n <AriaGroup\n className={joinClassNames(\n variants.base.group,\n readOnly && !loading && variants.state.readOnlyGroup,\n loading && variants.state.loadingGroup,\n )}\n >\n <AriaInput\n aria-busy={loading || undefined}\n className={joinClassNames(\n fieldVariants.base.input,\n variants.base.input,\n loading && variants.state.loadingInput,\n )}\n autoComplete={autoComplete}\n placeholder={placeholder}\n form={form}\n ref={ref}\n />\n <AriaButton\n className={joinClassNames(\n variants.base.stepButton,\n loading && variants.state.loadingStepButton,\n )}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-hidden': loading || undefined,\n type: 'button',\n })\n }\n slot=\"decrement\"\n type=\"button\"\n >\n −\n </AriaButton>\n <AriaButton\n className={joinClassNames(\n variants.base.stepButton,\n loading && variants.state.loadingStepButton,\n )}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-hidden': loading || undefined,\n type: 'button',\n })\n }\n slot=\"increment\"\n type=\"button\"\n >\n +\n </AriaButton>\n {loading && (\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </AriaGroup>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaNumberField>\n );\n}\n","import type { OverlayProps } from '../../overlays/overlay.types';\nimport OverlaySurface from '../../overlays/OverlaySurface';\n\nexport type PopoverProps = OverlayProps & {\n /** Preferred logical placement; flips when space is limited. */\n placement?: 'top' | 'bottom' | 'start' | 'end';\n};\n\n/**\n * Opens a labelled popover with library-owned nesting and motion.\n * @summary A labelled popover surface with a trigger and close action.\n */\nexport function Popover({\n children,\n defaultOpen,\n dismissible,\n onOpenChange,\n open,\n title,\n trigger,\n placement,\n}: Readonly<PopoverProps>) {\n return (\n <OverlaySurface\n defaultOpen={defaultOpen}\n dismissible={dismissible}\n onOpenChange={onOpenChange}\n open={open}\n title={title}\n trigger={trigger}\n placement={placement}\n kind=\"popover\"\n >\n {children}\n </OverlaySurface>\n );\n}\n","import type { RefObject } from 'react';\nimport {\n createElement,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n} from 'react-aria-components/ListBox';\nimport {\n Select as AriaSelect,\n SelectStateContext as AriaSelectStateContext,\n SelectValue as AriaSelectValue,\n} from 'react-aria-components/Select';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport collectionVariants from '../Collection/collection.styles';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport DescriptorContent from '../Collection/DescriptorContent';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst selectVariants = {\n base: {\n trigger:\n 'breeze:flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:items-center breeze:justify-between breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[hovered]:border-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[invalid]:border-breeze-danger breeze:disabled:cursor-not-allowed breeze:disabled:bg-breeze-sunken breeze:disabled:opacity-60',\n },\n compound: {},\n size: {},\n state: {\n readOnlyTrigger: 'breeze:cursor-default breeze:bg-breeze-sunken',\n },\n variant: {},\n} as const;\n\ninterface SelectCommonProps<T> {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the control when the component is mounted. */\n autoFocus?: boolean;\n /** Prevents opening and selecting. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the control. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the control with a form outside its ancestor tree. */\n form?: string;\n /** Maps an item to the closed descriptor rendered by Breeze. */\n getItem: (item: T) => ItemDescriptor;\n /** Sets the control id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the control with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Fixed choices displayed in the popover listbox. */\n items: T[];\n /** Sets the submitted name of the control. */\n name?: string;\n /** Temporary text shown when no choice is selected. */\n placeholder?: string;\n /** Prevents changing the choice while retaining focus and form participation. */\n readOnly?: boolean;\n /** Marks the control as required. Defaults to `false`. */\n required?: boolean;\n}\n\ninterface ControlledSelectProps<T> {\n /** Current selected item. */\n value: T | null;\n /** Reports the next selected item without exposing a DOM event. */\n onChange: (value: T | null) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledSelectProps<T> {\n /** Initial selected item. */\n defaultValue?: T | null;\n /** Reports the next selected item without exposing a DOM event. */\n onChange?: (value: T | null) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled fixed-choice selection. */\nexport type SelectProps<T> = SelectCommonProps<T> &\n (ControlledSelectProps<T> | UncontrolledSelectProps<T>);\n\ninterface SelectItem<T> {\n descriptor: ItemDescriptor;\n item: T;\n}\n\nfunction SelectListBox<T>({ items }: Readonly<{ items: SelectItem<T>[] }>) {\n return (\n <AriaListBox className={collectionVariants.base.listBox} items={items}>\n {(item: SelectItem<T>) => (\n <AriaListBoxItem\n className={collectionVariants.base.item}\n id={item.descriptor.id}\n isDisabled={item.descriptor.disabled}\n textValue={item.descriptor.label}\n value={item}\n >\n {({ isSelected }) => (\n <DescriptorContent\n descriptor={item.descriptor}\n isSelected={isSelected}\n />\n )}\n </AriaListBoxItem>\n )}\n </AriaListBox>\n );\n}\n\nfunction SelectReadOnlyFormValue({\n form,\n interactionDisabled,\n name,\n readOnly,\n}: Readonly<{\n form?: string;\n interactionDisabled: boolean;\n name?: string;\n readOnly: boolean;\n}>) {\n const state = useContext(AriaSelectStateContext);\n\n if (!readOnly || interactionDisabled || !name || state === null) return null;\n\n return (\n <input\n form={form}\n name={name}\n type=\"hidden\"\n value={state.value === null ? '' : String(state.value)}\n />\n );\n}\n\nfunction SelectPopover<T>({\n disabled,\n items,\n readOnly,\n triggerRef,\n}: Readonly<{\n disabled: boolean;\n items: SelectItem<T>[];\n readOnly: boolean;\n triggerRef: RefObject<HTMLButtonElement | null>;\n}>) {\n const state = useContext(AriaSelectStateContext);\n const blocked = disabled || readOnly || items.length === 0;\n const isOpen = !blocked && (state?.isOpen ?? false);\n\n useEffect(() => {\n if (blocked && state?.isOpen) {\n state.setOpen(false);\n }\n }, [blocked, state]);\n\n return (\n <CollectionPopover\n className={collectionVariants.base.popover}\n isOpen={isOpen}\n onOpenChange={(open) => state?.setOpen(open)}\n triggerRef={triggerRef}\n >\n <SelectListBox items={items} />\n </CollectionPopover>\n );\n}\n\n/**\n * Renders a fixed-choice popover listbox backed by React Aria Components.\n *\n * @summary Flat fixed-choice selection with semantic item changes.\n */\nexport function Select<T>({\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n getItem,\n id,\n items,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n readOnly = false,\n required = false,\n value,\n}: Readonly<SelectProps<T>>) {\n const { messages } = useBreezeContext();\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const isInvalid = !loading && visibleError !== undefined;\n const fieldId = useId();\n const controlId = id ?? `${fieldId}-control`;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const decoratedItems = useMemo<SelectItem<T>[]>(\n () =>\n items.map((item) => ({\n descriptor: getItem(item),\n item,\n })),\n [getItem, items],\n );\n let selectedKey: string | null | undefined;\n if (value === undefined) {\n selectedKey = undefined;\n } else if (value === null) {\n selectedKey = null;\n } else {\n selectedKey = getItem(value).id;\n }\n const defaultSelectedKey =\n defaultValue === undefined || defaultValue === null\n ? null\n : getItem(defaultValue).id;\n\n return (\n <AriaSelect<SelectItem<T>>\n aria-label={loading ? label : undefined}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n className={fieldVariants.base.root}\n defaultValue={defaultSelectedKey}\n form={form}\n id={controlId}\n isDisabled={interactionDisabled || readOnly}\n isInvalid={isInvalid}\n isRequired={required}\n name={name}\n onChange={(key) => {\n if (readOnly) return;\n\n const nextItem =\n key === null\n ? undefined\n : decoratedItems.find(\n ({ descriptor }) => descriptor.id === String(key),\n );\n onChange?.(nextItem?.item ?? null);\n }}\n placeholder={placeholder}\n validationBehavior=\"aria\"\n value={selectedKey}\n >\n <FieldLabel\n htmlFor={controlId}\n label={label}\n loading={loading}\n onClick={() => triggerRef.current?.focus()}\n />\n <div className={fieldVariants.base.control}>\n <AriaButton\n className={joinClassNames(\n selectVariants.base.trigger,\n readOnly && selectVariants.state.readOnlyTrigger,\n loading && 'breeze:!opacity-0',\n )}\n isDisabled={interactionDisabled}\n ref={triggerRef}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n 'aria-disabled': readOnly || undefined,\n 'aria-invalid': isInvalid || undefined,\n 'data-invalid': isInvalid || undefined,\n type: 'button',\n })\n }\n >\n <AriaSelectValue\n className={joinClassNames(\n collectionVariants.base.content,\n 'breeze:text-start',\n )}\n >\n {({ isPlaceholder, selectedText }) =>\n isPlaceholder ? placeholder ?? '' : selectedText\n }\n </AriaSelectValue>\n <Icon name=\"expand\" size=\"sm\" />\n </AriaButton>\n {loading && (\n <span className={fieldVariants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </div>\n <SelectPopover\n disabled={interactionDisabled}\n items={decoratedItems}\n readOnly={readOnly}\n triggerRef={triggerRef}\n />\n <SelectReadOnlyFormValue\n form={form}\n interactionDisabled={interactionDisabled}\n name={name}\n readOnly={readOnly}\n />\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaSelect>\n );\n}\n","const variants = {\n base: {\n separator:\n 'breeze:m-0 breeze:shrink-0 breeze:border-0 breeze:bg-breeze-line breeze:forced-colors:bg-[CanvasText]',\n },\n compound: {},\n size: {},\n state: {},\n variant: {\n horizontal: 'breeze:block-size-breeze-px breeze:inline-size-full',\n vertical: 'breeze:block-size-full breeze:inline-size-breeze-px',\n },\n} as const;\n\nexport type SeparatorOrientation = keyof typeof variants.variant;\n\nexport interface SeparatorProps {\n /** Sets the divider axis. Defaults to `horizontal`. */\n orientation?: SeparatorOrientation;\n}\n\n/**\n * Separates adjacent regions along a horizontal or vertical axis.\n *\n * @summary A semantic one-token divider.\n */\nexport function Separator({\n orientation = 'horizontal',\n}: Readonly<SeparatorProps>) {\n return (\n <hr\n aria-orientation={orientation}\n className={[variants.base.separator, variants.variant[orientation]].join(\n ' ',\n )}\n />\n );\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutAlign, LayoutElement, LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n stack: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col',\n },\n compound: {},\n size: {\n 0: 'breeze:gap-0',\n 1: 'breeze:gap-breeze-1',\n 2: 'breeze:gap-breeze-2',\n 3: 'breeze:gap-breeze-3',\n 4: 'breeze:gap-breeze-4',\n 5: 'breeze:gap-breeze-5',\n 6: 'breeze:gap-breeze-6',\n 7: 'breeze:gap-breeze-7',\n 8: 'breeze:gap-breeze-8',\n },\n state: {},\n variant: {\n center: 'breeze:items-center',\n end: 'breeze:items-end',\n start: 'breeze:items-start',\n stretch: 'breeze:items-stretch',\n },\n} as const;\n\nexport interface StackProps {\n /** Names the stack when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Items arranged vertically. */\n children: ReactNode;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Applies space between items from the Breeze spacing scale. Defaults to `3`. */\n gap?: LayoutGap;\n /** Aligns items along the inline axis. Defaults to `stretch`. */\n horizontalAlign?: LayoutAlign;\n}\n\n/**\n * Arranges children vertically on the Breeze spacing scale.\n *\n * @summary A constrained vertical layout primitive.\n */\nexport function Stack({\n 'aria-label': ariaLabel,\n children,\n element = 'div',\n gap = 3,\n horizontalAlign = 'stretch',\n}: Readonly<StackProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.stack,\n variants.variant[horizontalAlign],\n variants.size[gap],\n ].join(' '),\n role,\n },\n children,\n );\n}\n","import type { Ref } from 'react';\nimport { Input as AriaInput } from 'react-aria-components/Input';\nimport { TextField as AriaTextField } from 'react-aria-components/TextField';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\ntype TextInputType = 'email' | 'password' | 'search' | 'tel' | 'text' | 'url';\n\ninterface TextFieldCommonProps {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the input when the component is mounted. */\n autoFocus?: boolean;\n /** Prevents editing and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the input. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the input with a form outside its ancestor tree. */\n form?: string;\n /** Sets the native input id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the input with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Sets the submitted name of the input. */\n name?: string;\n /** Temporary text shown while the input is empty. */\n placeholder?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native text input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the input as required. Defaults to `false`. */\n required?: boolean;\n /** Selects the browser input purpose. Defaults to `text`. */\n type?: TextInputType;\n}\n\ninterface ControlledTextFieldProps {\n /** Current text value. */\n value: string;\n /** Reports the next text value without exposing a DOM event. */\n onChange: (value: string) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledTextFieldProps {\n /** Initial text value. Defaults to an empty string. */\n defaultValue?: string;\n /** Reports the next text value without exposing a DOM event. */\n onChange?: (value: string) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled text entry. */\nexport type TextFieldProps = TextFieldCommonProps &\n (ControlledTextFieldProps | UncontrolledTextFieldProps);\n\n/**\n * Renders a labelled, accessible single-line text input with validation and a\n * closed loading presentation.\n *\n * @summary Flat text entry with semantic value changes.\n */\nexport function TextField({\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n readOnly = false,\n ref,\n required = false,\n type = 'text',\n value,\n}: Readonly<TextFieldProps>) {\n const { messages } = useBreezeContext();\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaTextField\n className={fieldVariants.base.root}\n defaultValue={defaultValue}\n aria-label={loading ? label : undefined}\n id={id}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n name={name}\n onChange={onChange}\n type={type}\n validationBehavior=\"aria\"\n value={value}\n >\n <FieldLabel label={label} loading={loading} />\n <span className={fieldVariants.base.control}>\n <AriaInput\n aria-busy={loading || undefined}\n className={joinClassNames(\n fieldVariants.base.input,\n loading && fieldVariants.state.loadingInput,\n )}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n form={form}\n placeholder={placeholder}\n ref={ref}\n />\n {loading && (\n <span className={fieldVariants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </span>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaTextField>\n );\n}\n","import {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useOverlayPortal } from '../../overlays/OverlayProvider';\nimport { useOverlayToastZIndex } from '../../overlays/OverlayStack';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Icon } from '../Icon/Icon';\n\nconst toastLifetime = 2600;\nconst toastLimitError = 'BreezeProvider toastLimit must be a positive integer.';\nconst toastProviderError =\n 'Toast components must be rendered within BreezeProvider.';\n\ninterface ToastItem {\n id: number;\n message: string;\n}\n\ninterface ToastTimer {\n handle: ReturnType<typeof setTimeout> | null;\n remaining: number;\n startedAt: number | null;\n}\n\ninterface ToastContentState {\n message: string | null;\n remember: (message: string) => void;\n}\n\nfunction isToastVisible(entry: IntersectionObserverEntry) {\n return entry.isIntersecting && entry.intersectionRatio >= 1;\n}\n\nfunction handleToastIntersection(\n entry: IntersectionObserverEntry,\n visibleIds: Set<number>,\n scheduleToast: (id: number) => void,\n pauseToastTimer: (id: number) => void,\n) {\n const id = Number((entry.target as HTMLElement).dataset.breezeToastId);\n if (!visibleIds.has(id)) return;\n\n if (isToastVisible(entry)) {\n scheduleToast(id);\n } else {\n pauseToastTimer(id);\n }\n}\n\nexport type ToastEnqueue = (message: string) => void;\n\nconst ToastContext = createContext<ToastEnqueue | null>(null);\nconst ToastAnnouncementContext = createContext(true);\nconst ToastContentContext = createContext<ToastContentState | null>(null);\n\nexport interface ToastProps {\n /** Translated confirmation message. */\n children: string;\n}\n\n/**\n * Displays a positive, non-interactive confirmation.\n *\n * @summary A transient confirmation status.\n */\nexport function Toast({ children }: Readonly<ToastProps>) {\n useBreezeContext();\n const isDocumentVisible = useContext(ToastAnnouncementContext);\n const contentState = useContext(ToastContentContext);\n const [message, setMessage] = useState<string | null>(\n () => contentState?.message ?? null,\n );\n\n useEffect(() => {\n if (\n !isDocumentVisible ||\n (typeof document !== 'undefined' && document.hidden) ||\n message === children\n ) {\n return undefined;\n }\n\n const update = setTimeout(() => {\n setMessage(children);\n contentState?.remember(children);\n }, 0);\n return () => clearTimeout(update);\n }, [children, contentState, isDocumentVisible, message]);\n\n return (\n <div\n aria-atomic=\"true\"\n aria-label={message ?? undefined}\n aria-live=\"polite\"\n className=\"breeze-toast\"\n role=\"status\"\n >\n <Icon name=\"check\" size=\"sm\" />\n <span>{message}</span>\n </div>\n );\n}\n\ninterface ToastProviderBoundaryProps {\n children: ReactNode;\n limit: number;\n}\n\n/** Establishes the queue owned by one BreezeProvider instance. */\nexport function ToastProviderBoundary({\n children,\n limit,\n}: Readonly<ToastProviderBoundaryProps>) {\n const host = useOverlayPortal();\n const zIndex = useOverlayToastZIndex();\n const regionRef = useRef<HTMLDivElement>(null);\n const [isDocumentVisible, setIsDocumentVisible] = useState(\n () => typeof document === 'undefined' || !document.hidden,\n );\n const [queue, setQueue] = useState<ToastItem[]>([]);\n const nextId = useRef(0);\n const timers = useRef(new Map<number, ToastTimer>());\n const renderedToastIds = useRef(new Set<number>());\n const announcementStates = useRef(new Map<number, ToastContentState>());\n\n if (!Number.isInteger(limit) || limit < 1) {\n throw new RangeError(toastLimitError);\n }\n\n const rememberToastMessage = useCallback((id: number, message: string) => {\n const state = announcementStates.current.get(id);\n if (state !== undefined) state.message = message;\n }, []);\n const enqueue = useCallback<ToastEnqueue>(\n (message) => {\n const id = nextId.current;\n nextId.current += 1;\n announcementStates.current.set(id, {\n message: null,\n remember: (nextMessage) => rememberToastMessage(id, nextMessage),\n });\n\n setQueue((current) => [...current, { id, message }]);\n },\n [rememberToastMessage],\n );\n const expireToast = useCallback((id: number) => {\n timers.current.delete(id);\n renderedToastIds.current.delete(id);\n announcementStates.current.delete(id);\n setQueue((current) => current.filter((toast) => toast.id !== id));\n }, []);\n const clearToastTimers = useCallback(() => {\n Array.from(timers.current.values()).forEach(({ handle }) => {\n if (handle !== null) clearTimeout(handle);\n });\n timers.current.clear();\n }, []);\n const pauseToastTimer = useCallback(\n (id: number, now = Date.now()) => {\n const timer = timers.current.get(id);\n if (\n timer?.handle === null ||\n timer?.startedAt === null ||\n timer === undefined\n ) {\n return;\n }\n\n timer.remaining = Math.max(\n 0,\n timer.remaining - Math.max(0, now - timer.startedAt),\n );\n clearTimeout(timer.handle);\n timer.handle = null;\n timer.startedAt = null;\n\n if (timer.remaining === 0) {\n expireToast(id);\n }\n },\n [expireToast],\n );\n const pauseToastTimers = useCallback(() => {\n const now = Date.now();\n Array.from(timers.current.keys()).forEach((id) => {\n pauseToastTimer(id, now);\n });\n }, [pauseToastTimer]);\n const removeToastTimer = useCallback((id: number) => {\n const timer = timers.current.get(id);\n if (timer?.handle !== null && timer?.handle !== undefined) {\n clearTimeout(timer.handle);\n }\n timers.current.delete(id);\n }, []);\n const scheduleToast = useCallback(\n (id: number) => {\n const current = timers.current.get(id);\n if (\n !isDocumentVisible ||\n (typeof document !== 'undefined' && document.hidden) ||\n (current !== undefined && current.handle !== null)\n ) {\n return;\n }\n\n const timer = current ?? {\n handle: null,\n remaining: toastLifetime,\n startedAt: null,\n };\n if (timer.remaining <= 0) {\n expireToast(id);\n return;\n }\n\n timer.startedAt = Date.now();\n timer.handle = setTimeout(() => expireToast(id), timer.remaining);\n timers.current.set(id, timer);\n },\n [expireToast, isDocumentVisible],\n );\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n const visible = !document.hidden;\n if (!visible) pauseToastTimers();\n setIsDocumentVisible(visible);\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n handleVisibilityChange();\n return () =>\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, [pauseToastTimers]);\n\n useLayoutEffect(() => {\n const visible = queue.slice(0, limit);\n const visibleIds = new Set(visible.map(({ id }) => id));\n const queuedIds = new Set(queue.map(({ id }) => id));\n\n visible.forEach(({ id }) => renderedToastIds.current.add(id));\n\n Array.from(timers.current.keys()).forEach((id) => {\n if (!visibleIds.has(id)) {\n if (queuedIds.has(id)) {\n pauseToastTimer(id);\n } else {\n removeToastTimer(id);\n }\n }\n });\n }, [limit, pauseToastTimer, queue, removeToastTimer]);\n\n useEffect(() => {\n const visible = queue.slice(0, limit);\n const visibleIds = new Set(visible.map(({ id }) => id));\n const region = regionRef.current;\n if (host === null || region === null || !isDocumentVisible) {\n return undefined;\n }\n\n if (typeof IntersectionObserver === 'undefined') {\n visible.forEach((toast) => scheduleToast(toast.id));\n return undefined;\n }\n\n let observer: IntersectionObserver | undefined;\n const observe = () => {\n observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) =>\n handleToastIntersection(\n entry,\n visibleIds,\n scheduleToast,\n pauseToastTimer,\n ),\n );\n },\n { threshold: 1 },\n );\n\n Array.from(region.children).forEach((element) => {\n if (\n element instanceof HTMLElement &&\n element.dataset.breezeToastId !== undefined &&\n !element.hidden\n ) {\n observer?.observe(element);\n }\n });\n };\n const observeTask = setTimeout(observe, 0);\n\n return () => {\n clearTimeout(observeTask);\n observer?.disconnect();\n };\n }, [\n host,\n isDocumentVisible,\n limit,\n pauseToastTimer,\n queue,\n removeToastTimer,\n scheduleToast,\n ]);\n\n useEffect(() => clearToastTimers, [clearToastTimers]);\n\n const visible = queue.slice(0, limit);\n const visibleIds = new Set(visible.map(({ id }) => id));\n const rendered = queue.filter(\n ({ id }) => visibleIds.has(id) || renderedToastIds.current.has(id),\n );\n\n return (\n <ToastAnnouncementContext value={isDocumentVisible}>\n <ToastContext value={enqueue}>\n {children}\n {host &&\n createPortal(\n <div\n ref={regionRef}\n className=\"breeze-toast-region\"\n data-breeze-toast-region=\"\"\n data-live-announcer=\"\"\n data-react-aria-top-layer=\"\"\n style={{ zIndex }}\n >\n {rendered.map(({ id, message }) => {\n const demoted = !visibleIds.has(id);\n\n return (\n <div\n key={id}\n aria-hidden={demoted ? 'true' : undefined}\n data-breeze-toast-id={id}\n hidden={demoted}\n >\n <ToastContentContext\n value={announcementStates.current.get(id) ?? null}\n >\n <ToastAnnouncementContext\n value={isDocumentVisible && !demoted}\n >\n <Toast>{message}</Toast>\n </ToastAnnouncementContext>\n </ToastContentContext>\n </div>\n );\n })}\n </div>,\n host,\n )}\n </ToastContext>\n </ToastAnnouncementContext>\n );\n}\n\n/** Enqueues a confirmation in the nearest BreezeProvider. */\nexport function useToast(): ToastEnqueue {\n const enqueue = useContext(ToastContext);\n\n if (enqueue === null) {\n throw new Error(toastProviderError);\n }\n\n return enqueue;\n}\n","import type { ButtonHTMLAttributes, Ref } from 'react';\nimport type { ControlSize } from '../Button/Button';\nimport SelectionControl from '../SelectionControl/SelectionControl';\n\nconst variants = {\n base: {\n toggle:\n 'breeze:inline-grid breeze:items-center breeze:justify-center breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:font-breeze-sans breeze:font-semibold breeze:text-breeze-ink breeze:cursor-pointer breeze:select-none breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n },\n compound: {},\n size: {\n lg: 'breeze:min-block-breeze-lg breeze:ps-breeze-5 breeze:pe-breeze-5 breeze:py-breeze-3 breeze:text-breeze-sm',\n md: 'breeze:min-block-breeze-md breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:text-breeze-sm',\n sm: 'breeze:min-block-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-1 breeze:text-breeze-xs',\n },\n state: {\n pressed:\n 'breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\ninterface ToggleCommonProps {\n /** Provides an accessible name when it differs from the visible label. */\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n /** Identifies elements that provide additional information about the toggle. */\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n /** Identifies elements whose text provides the toggle's accessible name. */\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n /** Visible label and default accessible name. */\n children: string;\n /** Prevents the toggle from being activated. Defaults to `false`. */\n disabled?: boolean;\n /** Sets the rendered button's HTML `id`. */\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Shows a placeholder while a pressed-state change is being saved. */\n loading?: boolean;\n /** Provides access to the rendered button element. */\n ref?: Ref<HTMLButtonElement>;\n /** Selects the toggle's dimensions. Defaults to `md`. */\n size?: ControlSize;\n}\n\ninterface ControlledToggleProps {\n /** Current pressed state. */\n pressed: boolean;\n /** Reports the next pressed state. */\n onChange: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n defaultPressed?: never;\n}\n\ninterface UncontrolledToggleProps {\n /** Initial pressed state. Defaults to `false`. */\n defaultPressed?: boolean;\n /** Reports the next pressed state. */\n onChange?: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n pressed?: never;\n}\n\n/** Props for controlled or uncontrolled button-like pressed state. */\nexport type ToggleProps = ToggleCommonProps &\n (ControlledToggleProps | UncontrolledToggleProps);\n\n/**\n * Renders a button for a binary choice.\n *\n * @summary An on/off choice with a pressed state.\n */\nexport function Toggle({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n defaultPressed,\n disabled = false,\n id,\n loading = false,\n onChange,\n pressed,\n ref,\n size = 'md',\n}: Readonly<ToggleProps>) {\n return (\n <SelectionControl\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={[\n variants.base.toggle,\n variants.size[size],\n variants.state.pressed,\n ].join(' ')}\n defaultPressed={defaultPressed}\n disabled={disabled}\n id={id}\n loading={loading}\n onChange={onChange}\n pressed={pressed}\n ref={ref}\n >\n {children}\n </SelectionControl>\n );\n}\n","import type { HTMLAttributes } from 'react';\nimport { useState } from 'react';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Badge } from '../Badge/Badge';\nimport type { ControlSize } from '../Button/Button';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport { Icon } from '../Icon/Icon';\nimport SelectionControl from '../SelectionControl/SelectionControl';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n description:\n 'breeze:text-breeze-2xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n group:\n 'breeze:inline-flex breeze:items-center breeze:gap-breeze-1 breeze:rounded-breeze-ctl breeze:bg-breeze-sunken breeze:p-breeze-1 breeze:font-breeze-sans',\n item: 'breeze:inline-grid breeze:items-center breeze:justify-center breeze:gap-breeze-2 breeze:rounded-breeze-sm breeze:border breeze:border-solid breeze:border-transparent breeze:font-semibold breeze:text-breeze-ink-2 breeze:cursor-pointer breeze:select-none breeze:outline-offset-[-2px] breeze:data-[hovered]:bg-breeze-raised breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n label: 'breeze:font-medium',\n optionContent: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col',\n optionDetails: 'breeze:inline-flex breeze:items-center breeze:gap-breeze-2',\n },\n compound: {},\n size: {\n lg: 'breeze:min-block-breeze-lg breeze:ps-breeze-4 breeze:pe-breeze-4 breeze:py-breeze-2 breeze:text-breeze-sm',\n md: 'breeze:min-block-breeze-md breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:text-breeze-sm',\n sm: 'breeze:min-block-breeze-sm breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:py-breeze-1 breeze:text-breeze-xs',\n },\n state: {\n selected:\n 'breeze:data-[selected]:border-breeze-line-strong breeze:data-[selected]:bg-breeze-surface breeze:data-[selected]:text-breeze-ink breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\ninterface ToggleGroupCommonProps<T> {\n /** Names the group when it has no visible heading. */\n 'aria-label': HTMLAttributes<HTMLFieldSetElement>['aria-label'];\n /** Identifies elements that provide additional information about the group. */\n 'aria-describedby'?: HTMLAttributes<HTMLFieldSetElement>['aria-describedby'];\n /** Prevents every option in the group from being activated. */\n disabled?: boolean;\n /** Supplies the display details for an option. */\n getItem: (item: T) => ItemDescriptor;\n /** Sets the rendered group's HTML `id`. */\n id?: HTMLAttributes<HTMLFieldSetElement>['id'];\n /** The available options. */\n items: T[];\n /** Shows placeholders while a selection change is being saved. */\n loading?: boolean;\n /** Selects the group's dimensions. Defaults to `md`. */\n size?: ControlSize;\n}\n\ninterface ControlledToggleGroupProps<T> {\n /** Current selected option, or `null` when none is pressed. */\n selected: T | null;\n /** Reports the selected option or `null` when cleared. */\n onChange: (selected: T | null) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n defaultSelected?: never;\n}\n\ninterface UncontrolledToggleGroupProps<T> {\n /** Initial selected option. Defaults to no selection. */\n defaultSelected?: T | null;\n /** Reports the selected option or `null` when cleared. */\n onChange?: (selected: T | null) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n selected?: never;\n}\n\n/** Props for controlled or uncontrolled single-choice segmented selection. */\nexport type ToggleGroupProps<T> = ToggleGroupCommonProps<T> &\n (ControlledToggleGroupProps<T> | UncontrolledToggleGroupProps<T>);\n\ninterface DecoratedItem<T> {\n descriptor: ItemDescriptor;\n item: T;\n}\n\n/**\n * Renders a set of connected options with a single selection.\n *\n * @summary A single selection from connected options.\n */\nexport function ToggleGroup<T>({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n defaultSelected,\n disabled = false,\n getItem,\n id,\n items,\n loading = false,\n onChange,\n selected,\n size = 'md',\n}: Readonly<ToggleGroupProps<T>>) {\n const { getMessageLocale, messages } = useBreezeContext();\n\n const [uncontrolledSelectedKey, setUncontrolledSelectedKey] = useState<\n string | null\n >(() =>\n defaultSelected === undefined || defaultSelected === null\n ? null\n : getItem(defaultSelected).id,\n );\n const decoratedItems: DecoratedItem<T>[] = items.map((item) => ({\n descriptor: getItem(item),\n item,\n }));\n let selectedKey = uncontrolledSelectedKey;\n if (selected !== undefined) {\n selectedKey = selected === null ? null : getItem(selected).id;\n }\n\n return (\n <>\n <fieldset\n aria-describedby={ariaDescribedBy}\n aria-busy={loading || undefined}\n className={`${variants.base.group} breeze:border-0 breeze:m-0 breeze:min-inline-size-0`}\n disabled={disabled}\n id={id}\n >\n <legend className=\"breeze:sr-only\">{ariaLabel}</legend>\n {decoratedItems.map(({ descriptor, item }) => (\n <SelectionControl\n key={descriptor.id}\n announceLoading={false}\n className={[\n variants.base.item,\n variants.size[size],\n variants.state.selected,\n ].join(' ')}\n disabled={disabled || descriptor.disabled === true}\n loading={loading}\n onChange={(pressed) => {\n if (selected === undefined) {\n setUncontrolledSelectedKey(pressed ? descriptor.id : null);\n }\n\n onChange?.(pressed ? item : null);\n }}\n pressed={selectedKey === descriptor.id}\n >\n <span className={variants.base.optionDetails}>\n {descriptor.icon && <Icon name={descriptor.icon} size=\"sm\" />}\n <span className={variants.base.optionContent}>\n <span className={variants.base.label}>{descriptor.label}</span>\n {descriptor.description && (\n <span className={variants.base.description}>\n {descriptor.description}\n </span>\n )}\n </span>\n {descriptor.badge && (\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n )}\n </span>\n </SelectionControl>\n ))}\n </fieldset>\n {loading && (\n <span className=\"breeze:sr-only\">\n <Skeleton label={messages.loading} />\n </span>\n )}\n <output\n aria-live=\"polite\"\n className=\"breeze:sr-only\"\n lang={getMessageLocale('loading')}\n >\n {loading ? messages.loading : ''}\n </output>\n </>\n );\n}\n","const enGB = {\n appearance: 'Appearance',\n appearanceAutomatic: 'Auto',\n appearanceDark: 'Dark',\n appearanceLight: 'Light',\n close: 'Close',\n loading: 'Loading',\n required: 'Required',\n selectDate: 'Select a date',\n};\n\nexport default enGB;\n","import type { ReactNode } from 'react';\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\nimport { I18nProvider, useLocale } from 'react-aria-components/I18nProvider';\nimport { OverlayProvider } from '../overlays/OverlayProvider';\nimport { ToastProviderBoundary } from '../primitives/Toast/Toast';\nimport { type Appearance, BreezeContext } from './BreezeContext';\nimport enGB from './en-GB';\n\ninterface BreezeProviderBaseProps {\n /** Breeze components and application content rendered inside the provider. */\n children: ReactNode;\n /** BCP 47 locale for accessible interactions and content formatting. */\n locale: string;\n /** Accessible messages translated into the provider locale; defaults to English. */\n messages?: Partial<typeof enGB>;\n /**\n * Container for the provider-owned overlay host; defaults to document.body.\n * The container must belong to the same document as the overlay triggers.\n */\n portalContainer?: HTMLElement;\n /** Maximum number of visible confirmations; additional messages wait in FIFO order. */\n toastLimit?: number;\n}\n\ninterface ControlledAppearanceProps {\n /** The application-owned appearance choice. */\n appearance: Appearance;\n /** Unavailable when `appearance` is controlled by the application. */\n defaultAppearance?: never;\n /** Reports a semantic appearance choice so the application can persist it. */\n onAppearanceChange: (appearance: Appearance) => void;\n}\n\ninterface UncontrolledAppearanceProps {\n /** Unavailable when the provider manages its own appearance state. */\n appearance?: never;\n /** The initial appearance choice; defaults to automatic. */\n defaultAppearance?: Appearance;\n /** Reports a semantic appearance choice without persisting it. */\n onAppearanceChange?: (appearance: Appearance) => void;\n}\n\n/** The required locale and appearance boundary for Breeze components. */\nexport type BreezeProviderProps = BreezeProviderBaseProps &\n (ControlledAppearanceProps | UncontrolledAppearanceProps);\n\nfunction resolveAppearance(appearance: Appearance, prefersDark: boolean) {\n if (appearance === 'automatic') {\n return prefersDark ? 'dark' : 'light';\n }\n\n return appearance;\n}\n\nfunction BreezeRoot({\n children,\n}: Readonly<Pick<BreezeProviderProps, 'children'>>) {\n const { direction, locale } = useLocale();\n\n return (\n <div data-breeze-root=\"\" dir={direction} lang={locale}>\n {children}\n </div>\n );\n}\n\n/**\n * Establishes the required locale and styling boundary.\n *\n * @summary Required locale and styling boundary for Breeze components.\n */\nexport function BreezeProvider({\n appearance: controlledAppearance,\n children,\n defaultAppearance = 'automatic',\n locale,\n messages,\n onAppearanceChange,\n portalContainer,\n toastLimit = 3,\n}: Readonly<BreezeProviderProps>) {\n const [preferredColorSchemeQuery] = useState(() =>\n typeof window === 'undefined' || !window.matchMedia\n ? null\n : window.matchMedia('(prefers-color-scheme: dark)'),\n );\n const [prefersDark, setPrefersDark] = useState(\n () => preferredColorSchemeQuery?.matches ?? false,\n );\n const [uncontrolledAppearance, setUncontrolledAppearance] =\n useState(defaultAppearance);\n const appearance = controlledAppearance ?? uncontrolledAppearance;\n const resolvedAppearance = resolveAppearance(appearance, prefersDark);\n\n useEffect(() => {\n if (!preferredColorSchemeQuery) {\n return undefined;\n }\n\n setPrefersDark(preferredColorSchemeQuery.matches);\n\n const handleChange = (event: MediaQueryListEvent) => {\n setPrefersDark(event.matches);\n };\n\n preferredColorSchemeQuery.addEventListener('change', handleChange);\n\n return () =>\n preferredColorSchemeQuery.removeEventListener('change', handleChange);\n }, [preferredColorSchemeQuery]);\n\n useLayoutEffect(() => {\n const { documentElement } = document;\n const previousTheme = documentElement.dataset.theme;\n const previousColorScheme = documentElement.style.colorScheme;\n\n documentElement.dataset.theme = resolvedAppearance;\n documentElement.style.colorScheme = resolvedAppearance;\n\n return () => {\n if (previousTheme === undefined) {\n delete documentElement.dataset.theme;\n } else {\n documentElement.dataset.theme = previousTheme;\n }\n\n documentElement.style.colorScheme = previousColorScheme;\n };\n }, [resolvedAppearance]);\n\n const setAppearance = useCallback(\n (nextAppearance: Appearance) => {\n if (controlledAppearance === undefined) {\n setUncontrolledAppearance(nextAppearance);\n }\n\n onAppearanceChange?.(nextAppearance);\n },\n [controlledAppearance, onAppearanceChange],\n );\n const getMessageLocale = useCallback(\n (message: keyof typeof enGB) =>\n messages?.[message] === undefined ? 'en-GB' : locale,\n [locale, messages],\n );\n\n const context = useMemo(\n () => ({\n appearance,\n getMessageLocale,\n locale,\n messages: {\n appearance: messages?.appearance ?? enGB.appearance,\n appearanceAutomatic:\n messages?.appearanceAutomatic ?? enGB.appearanceAutomatic,\n appearanceDark: messages?.appearanceDark ?? enGB.appearanceDark,\n appearanceLight: messages?.appearanceLight ?? enGB.appearanceLight,\n close: messages?.close ?? enGB.close,\n loading: messages?.loading ?? enGB.loading,\n required: messages?.required ?? enGB.required,\n selectDate: messages?.selectDate ?? enGB.selectDate,\n },\n resolvedAppearance,\n setAppearance,\n }),\n [\n appearance,\n getMessageLocale,\n locale,\n messages,\n resolvedAppearance,\n setAppearance,\n ],\n );\n\n return (\n <I18nProvider locale={locale}>\n <BreezeContext value={context}>\n <OverlayProvider locale={locale} portalContainer={portalContainer}>\n <ToastProviderBoundary limit={toastLimit}>\n <BreezeRoot>{children}</BreezeRoot>\n </ToastProviderBoundary>\n </OverlayProvider>\n </BreezeContext>\n </I18nProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAa,KAAgB,EAAyC,IAAI;AAE1E,SAAgB,IAAuC;CACrD,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KAAA,KAC3B,EAA0B,CAAc,GAG1C,IAAqB,CAAc;CACrC,GACA,CAAC,GAAsB,CAAkB,CAC3C,GACM,IAAmB,GACtB,MACC,IAAW,OAAa,KAAA,IAAY,UAAU,GAChD,CAAC,GAAQ,CAAQ,CACnB;CA+BA,OACE,kBAAC,IAAD;EAAsB;YACpB,kBAAC,IAAD;GAAe,OA/BH,SACP;IACL;IACA;IACA;IACA,UAAU;KACR,YAAY,GAAU,cAAc,GAAK;KACzC,qBACE,GAAU,uBAAuB,GAAK;KACxC,gBAAgB,GAAU,kBAAkB,GAAK;KACjD,iBAAiB,GAAU,mBAAmB,GAAK;KACnD,OAAO,GAAU,SAAS,GAAK;KAC/B,SAAS,GAAU,WAAW,GAAK;KACnC,UAAU,GAAU,YAAY,GAAK;KACrC,YAAY,GAAU,cAAc,GAAK;IAC3C;IACA;IACA;GACF,IACA;IACE;IACA;IACA;IACA;IACA;IACA;GACF,CAKwB;aACpB,kBAAC,IAAD;IAAyB;IAAyB;cAChD,kBAAC,IAAD;KAAuB,OAAO;eAC5B,kBAAC,IAAD,EAAa,YAAqB,CAAA;IACb,CAAA;GACR,CAAA;EACJ,CAAA;CACH,CAAA;AAElB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/provider/BreezeContext.ts","../src/patterns/AppearanceControl/AppearanceControl.tsx","../src/primitives/Skeleton/Skeleton.tsx","../src/primitives/VisuallyHidden/VisuallyHidden.tsx","../src/primitives/Badge/Badge.tsx","../src/primitives/Button/Button.tsx","../src/primitives/Field/field.styles.ts","../src/primitives/Icon/Icon.tsx","../src/primitives/Calendar/Calendar.tsx","../src/primitives/layout.accessibility.ts","../src/primitives/Card/Card.tsx","../src/primitives/Field/field.presentation.tsx","../src/primitives/Checkbox/Checkbox.tsx","../src/primitives/SelectionControl/SelectionControl.tsx","../src/primitives/Chip/Chip.tsx","../src/primitives/Collection/collection.styles.ts","../src/overlays/OverlayStack.ts","../src/overlays/OverlayProvider.tsx","../src/primitives/Collection/CollectionPopover.tsx","../src/primitives/Collection/DescriptorContent.tsx","../src/primitives/Collection/DescriptorOption.tsx","../src/primitives/ComboBox/ComboBox.tsx","../src/primitives/Container/Container.tsx","../src/primitives/Typography/Typography.tsx","../src/primitives/DatePicker/DatePicker.tsx","../src/overlays/OverlaySurface.tsx","../src/primitives/Dialog/Dialog.tsx","../src/primitives/Drawer/Drawer.tsx","../src/primitives/Grid/Grid.tsx","../src/primitives/IconTile/IconTile.tsx","../src/primitives/Inline/Inline.tsx","../src/primitives/Menu/Menu.tsx","../src/primitives/NumberField/NumberField.tsx","../src/primitives/Popover/Popover.tsx","../src/primitives/RowList/RowList.tsx","../src/primitives/Select/Select.tsx","../src/primitives/Separator/Separator.tsx","../src/primitives/Stack/Stack.tsx","../src/primitives/TextField/TextField.tsx","../src/primitives/Toast/Toast.tsx","../src/primitives/Toggle/Toggle.tsx","../src/primitives/ToggleGroup/ToggleGroup.tsx","../src/provider/en-GB.ts","../src/provider/BreezeProvider.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type enGB from './en-GB';\n\nexport type Appearance = 'automatic' | 'dark' | 'light';\nexport type ResolvedAppearance = Exclude<Appearance, 'automatic'>;\n\ninterface BreezeContextValue {\n appearance: Appearance;\n getMessageLocale: (message: keyof typeof enGB) => string;\n locale: string;\n messages: typeof enGB;\n resolvedAppearance: ResolvedAppearance;\n setAppearance: (appearance: Appearance) => void;\n}\n\nexport const BreezeContext = createContext<BreezeContextValue | null>(null);\n\nexport function useBreezeContext(): BreezeContextValue {\n const context = useContext(BreezeContext);\n\n if (context === null) {\n throw new Error(\n 'Breeze components must be rendered within BreezeProvider.',\n );\n }\n\n return context;\n}\n","import { ToggleButton } from 'react-aria-components/ToggleButton';\nimport { ToggleButtonGroup } from 'react-aria-components/ToggleButtonGroup';\nimport {\n type Appearance,\n useBreezeContext,\n} from '../../provider/BreezeContext';\n\nconst variants = {\n base: {\n control:\n 'breeze:flex breeze:items-center breeze:gap-breeze-2 breeze:font-breeze-sans',\n group: 'breeze:flex breeze:items-center breeze:gap-breeze-2',\n label: 'breeze:grow breeze:text-breeze-sm breeze:text-breeze-ink',\n option:\n 'breeze:inline-flex breeze:items-center breeze:min-block-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:rounded-breeze-full breeze:bg-breeze-surface breeze:text-breeze-xs breeze:font-semibold breeze:text-breeze-ink breeze:cursor-pointer breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n },\n compound: {},\n size: {},\n state: {\n selected:\n 'breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\nconst appearanceOptions = [\n {\n message: 'appearanceLight',\n value: 'light',\n },\n {\n message: 'appearanceAutomatic',\n value: 'automatic',\n },\n {\n message: 'appearanceDark',\n value: 'dark',\n },\n] as const;\n\nfunction isAppearance(value: unknown): value is Appearance {\n return appearanceOptions.some((option) => option.value === value);\n}\n\n/**\n * Lets a person choose light, automatic or dark appearance.\n *\n * @summary A three-option appearance control backed by BreezeProvider.\n */\nfunction AppearanceControl() {\n const { appearance, getMessageLocale, messages, setAppearance } =\n useBreezeContext();\n\n return (\n <div className={variants.base.control}>\n <span\n className={variants.base.label}\n lang={getMessageLocale('appearance')}\n >\n {messages.appearance}\n </span>\n <ToggleButtonGroup\n aria-label={messages.appearance}\n className={variants.base.group}\n disallowEmptySelection\n lang={getMessageLocale('appearance')}\n onSelectionChange={(keys) => {\n const [selection] = keys;\n\n if (isAppearance(selection)) {\n setAppearance(selection);\n }\n }}\n selectedKeys={[appearance]}\n selectionMode=\"single\"\n >\n {appearanceOptions.map((option) => (\n <ToggleButton\n className={[variants.base.option, variants.state.selected].join(\n ' ',\n )}\n id={option.value}\n key={option.value}\n lang={getMessageLocale(option.message)}\n >\n {messages[option.message]}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n </div>\n );\n}\n\nexport default AppearanceControl;\n","import type { CSSProperties } from 'react';\nimport { useBreezeContext } from '../../provider/BreezeContext';\n\nconst variants = {\n base: {\n skeleton:\n 'breeze:block breeze:animate-pulse breeze:appearance-none breeze:bg-breeze-ink-3 breeze:pointer-events-none breeze:forced-colors:outline breeze:forced-colors:outline-1 breeze:forced-colors:outline-[CanvasText]',\n },\n compound: {},\n size: {},\n state: {},\n variant: {\n circle: 'breeze:aspect-square breeze:rounded-breeze-full',\n rectangle: 'breeze:rounded-breeze-sm',\n text: 'breeze:block-size-breeze-3 breeze:inline-size-full breeze:rounded-breeze-xs',\n },\n} as const;\n\nexport type SkeletonShape = keyof typeof variants.variant;\n\nexport interface SkeletonProps {\n /** Any CSS length; Skeleton is the deliberate exception to token-only dimensions. */\n blockSize?: number | string;\n /** Any CSS length; Skeleton is the deliberate exception to token-only dimensions. */\n inlineSize?: number | string;\n /** Announces the loading region. Omit when another component owns the announcement. */\n label?: string;\n /** Selects the placeholder geometry. Defaults to `text`. */\n shape?: SkeletonShape;\n}\n\n/**\n * Draws an arbitrary placeholder shaped like the content it will replace.\n *\n * @summary A flexible indeterminate content placeholder.\n */\nexport function Skeleton({\n blockSize,\n inlineSize,\n label,\n shape = 'text',\n}: Readonly<SkeletonProps>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const accessibleLabel = label?.trim() || undefined;\n const circleSize = blockSize ?? inlineSize ?? '0.75rem';\n\n const dimensions: CSSProperties = {\n blockSize: shape === 'circle' ? circleSize : blockSize,\n inlineSize: shape === 'circle' ? circleSize : inlineSize,\n };\n\n return (\n <progress\n aria-hidden={accessibleLabel === undefined ? true : undefined}\n aria-label={accessibleLabel}\n className={[variants.base.skeleton, variants.variant[shape]].join(' ')}\n lang={\n accessibleLabel === messages.loading.trim()\n ? getMessageLocale('loading')\n : undefined\n }\n style={dimensions}\n />\n );\n}\n","import type { ReactNode } from 'react';\n\nconst variants = {\n base: {\n hidden: 'breeze:sr-only',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\nexport interface VisuallyHiddenProps {\n /** Content hidden visually but retained for assistive technology. */\n children: ReactNode;\n}\n\n/**\n * Hides explanatory content visually while preserving it for assistive technology.\n *\n * @summary Accessible content with no visual footprint.\n */\nexport function VisuallyHidden({ children }: Readonly<VisuallyHiddenProps>) {\n return <span className={variants.base.hidden}>{children}</span>;\n}\n","import { useBreezeContext } from '../../provider/BreezeContext';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\n\nconst variants = {\n base: {\n badge:\n 'breeze:inline-grid breeze:shrink-0 breeze:items-center breeze:whitespace-nowrap breeze:rounded-breeze-chip breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:py-breeze-px breeze:text-breeze-2xs breeze:font-bold breeze:leading-breeze-snug breeze:tracking-breeze-wide',\n content: 'breeze:[grid-area:1/1]',\n skeleton:\n 'breeze:[grid-area:1/1] breeze:grid breeze:inline-size-full breeze:items-center',\n },\n compound: {},\n size: {},\n state: {\n contentLoading: 'breeze:opacity-0',\n },\n variant: {\n brand: 'breeze:bg-breeze-brand-soft breeze:text-breeze-brand-text',\n danger: 'breeze:bg-breeze-danger/10 breeze:text-breeze-danger',\n neutral: 'breeze:bg-breeze-sunken breeze:text-breeze-ink-2',\n positive: 'breeze:bg-breeze-pos-soft breeze:text-breeze-pos',\n warning: 'breeze:bg-breeze-warn-soft breeze:text-breeze-warn',\n },\n} as const;\n\n/** Badge-specific status treatments. */\nexport type BadgeVariant = keyof typeof variants.variant;\n\nexport interface BadgeProps {\n /** Provides expanded screen-reader text when the visible badge is abbreviated. */\n 'aria-label'?: string;\n /** Short status text or a numeric count displayed by the badge. */\n children: number | string;\n /** Replaces the status with an accessible placeholder while preserving its size. */\n loading?: boolean;\n /** Selects the semantic colour treatment. Defaults to `neutral`. */\n variant?: BadgeVariant;\n}\n\n/**\n * Marks a short status or count with a Badge-specific treatment.\n *\n * @summary Compact, non-interactive status content.\n */\nexport function Badge({\n 'aria-label': ariaLabel,\n children,\n loading = false,\n variant = 'neutral',\n}: Readonly<BadgeProps>) {\n const { messages } = useBreezeContext();\n const accessibleLabel = ariaLabel?.trim() || undefined;\n let statusContent;\n\n if (loading) {\n statusContent = (\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize={8}\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n );\n } else if (accessibleLabel !== undefined) {\n statusContent = <VisuallyHidden>{accessibleLabel}</VisuallyHidden>;\n }\n\n return (\n <span\n aria-busy={loading || undefined}\n className={[variants.base.badge, variants.variant[variant]].join(' ')}\n >\n <span\n aria-hidden={\n loading || accessibleLabel !== undefined ? true : undefined\n }\n className={[\n variants.base.content,\n loading && variants.state.contentLoading,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </span>\n {statusContent}\n </span>\n );\n}\n","import type { ButtonHTMLAttributes, Ref } from 'react';\nimport { createElement } from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { ProgressBarContext } from 'react-aria-components/ProgressBar';\nimport { useSlottedContext } from 'react-aria-components/slots';\nimport { useBreezeContext } from '../../provider/BreezeContext';\n\nconst variants = {\n base: {\n button:\n 'breeze:relative breeze:inline-grid breeze:items-center breeze:justify-center breeze:gap-breeze-2 breeze:border breeze:border-solid breeze:rounded-breeze-ctl breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:cursor-pointer breeze:select-none breeze:[text-align:center] breeze:outline-offset-2 breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n label: 'breeze:[grid-area:1/1]',\n skeleton:\n 'breeze:[grid-area:1/1] breeze:inline-size-full breeze:block-size-breeze-3 breeze:rounded-breeze-xs',\n },\n compound: {\n loading: {\n danger: 'breeze:bg-breeze-on-brand/35',\n primary: 'breeze:bg-breeze-on-brand/35',\n quiet: 'breeze:bg-breeze-line-strong',\n secondary: 'breeze:bg-breeze-line-strong',\n },\n },\n size: {\n lg: 'breeze:min-block-breeze-lg breeze:ps-breeze-5 breeze:pe-breeze-5 breeze:py-breeze-3',\n md: 'breeze:min-block-breeze-md breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2',\n sm: 'breeze:min-block-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-1',\n },\n state: {\n disabled: 'breeze:cursor-not-allowed breeze:opacity-50',\n loading: 'breeze:cursor-wait',\n loadingLabel: 'breeze:opacity-0',\n loadingStatus: 'breeze:sr-only',\n },\n variant: {\n danger:\n 'breeze:border-transparent breeze:bg-breeze-danger-fill breeze:text-breeze-on-brand breeze:data-[hovered]:bg-breeze-danger-hover breeze:data-[pressed]:bg-breeze-danger-hover',\n primary:\n 'breeze:border-transparent breeze:bg-breeze-brand breeze:text-breeze-on-brand breeze:data-[hovered]:bg-breeze-brand-hover breeze:data-[pressed]:bg-breeze-brand-hover',\n quiet:\n 'breeze:border-transparent breeze:bg-transparent breeze:text-breeze-brand-text breeze:data-[hovered]:bg-breeze-brand-soft breeze:data-[pressed]:bg-breeze-brand-soft',\n secondary:\n 'breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:text-breeze-ink breeze:data-[hovered]:bg-breeze-sunken breeze:data-[pressed]:bg-breeze-sunken',\n },\n} as const;\n\n/** Connect the pending announcement to a phrasing element inside the button. */\nfunction LoadingStatus() {\n const progress = useSlottedContext(ProgressBarContext);\n const { getMessageLocale, messages } = useBreezeContext();\n\n return (\n <progress\n aria-label={messages.loading}\n className={variants.state.loadingStatus}\n id={progress?.id}\n lang={getMessageLocale('loading')}\n />\n );\n}\n\n/** Button-specific visual treatments. */\nexport type ButtonVariant = keyof typeof variants.variant;\n\n/** Shared control sizes: 34, 38 and 52px, with a 44px coarse-pointer floor. */\nexport type ControlSize = 'sm' | 'md' | 'lg';\n\nexport interface ButtonProps {\n /** Identifies the element whose contents or presence this button controls. */\n 'aria-controls'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-controls'];\n /** Identifies elements that provide additional information about the button. */\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n /** Indicates whether the controlled element is currently expanded. */\n 'aria-expanded'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-expanded'];\n /** Indicates the type of interactive popup opened by the button. */\n 'aria-haspopup'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-haspopup'];\n /** Provides an accessible name when it should differ from the visible label. */\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n /** Identifies elements whose text provides the button's accessible name. */\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n /** Visible action label, retained as the accessible name while loading. */\n children: string;\n /** Prevents activation and removes the button from the tab order. */\n disabled?: boolean;\n /** Associates a submit button with a form by its HTML `id`. */\n form?: ButtonHTMLAttributes<HTMLButtonElement>['form'];\n /** Sets the rendered button's HTML `id`. */\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Shows the button's own skeleton and prevents repeat activation. */\n loading?: boolean;\n /** Sets the name submitted with the button's form value. */\n name?: ButtonHTMLAttributes<HTMLButtonElement>['name'];\n /** Reports a semantic activation, without a DOM event. */\n onAction?: () => void;\n /** Provides access to the rendered button element. */\n ref?: Ref<HTMLButtonElement>;\n /** Selects the button's dimensions. Defaults to `md`. */\n size?: ControlSize;\n /** Selects ordinary or form-submission behaviour. Defaults to `button`. */\n type?: 'button' | 'submit';\n /** Sets the value submitted when this button submits a form. */\n value?: string;\n /** Selects the button's visual and semantic treatment. Defaults to `primary`. */\n variant?: ButtonVariant;\n}\n\n/**\n * Performs a semantic action with a visible label and an optional loading skeleton.\n *\n * @summary A closed, labelled action in four treatments and three sizes.\n */\nexport function Button({\n 'aria-controls': ariaControls,\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n disabled = false,\n form,\n id,\n loading = false,\n name,\n onAction,\n ref,\n size = 'md',\n type = 'button',\n value,\n variant = 'primary',\n}: Readonly<ButtonProps>) {\n useBreezeContext();\n\n const className = [\n variants.base.button,\n variants.variant[variant],\n variants.size[size],\n disabled && variants.state.disabled,\n loading && variants.state.loading,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <AriaButton\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel ?? children}\n aria-labelledby={ariaLabelledBy}\n className={className}\n form={form}\n id={id}\n isDisabled={disabled}\n isPending={loading}\n name={name}\n onPress={() => onAction?.()}\n ref={ref}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n // React Aria filters aria-busy; Breeze owns it on the native button.\n 'aria-busy': loading || undefined,\n // Keep the form's default submitter while pending so Enter cannot\n // bypass it through the browser's implicit-submission fallback.\n onClick: loading\n ? (event) => event.preventDefault()\n : buttonProps.onClick,\n type: type === 'submit' ? 'submit' : 'button',\n })\n }\n type={type}\n value={value}\n >\n <span\n className={[variants.base.label, loading && variants.state.loadingLabel]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </span>\n {loading && (\n <>\n <LoadingStatus />\n <span\n aria-hidden=\"true\"\n className={[\n variants.base.skeleton,\n variants.compound.loading[variant],\n ].join(' ')}\n data-breeze-skeleton=\"\"\n />\n </>\n )}\n </AriaButton>\n );\n}\n","/** Shared field chrome used by Breeze's flat field primitives. */\nexport const fieldVariants = {\n base: {\n control:\n 'breeze:relative breeze:inline-grid breeze:min-inline-size-0 breeze:inline-size-full',\n description:\n 'breeze:m-0 breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n error:\n 'breeze:m-0 breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-danger',\n input:\n 'breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-offset-2 breeze:placeholder:text-breeze-ink-3 breeze:data-[hovered]:border-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[invalid]:border-breeze-danger breeze:disabled:cursor-not-allowed breeze:disabled:bg-breeze-sunken breeze:disabled:opacity-60 breeze:read-only:cursor-default breeze:read-only:bg-breeze-sunken',\n label:\n 'breeze:m-0 breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-ink',\n root: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col breeze:gap-breeze-2',\n skeleton:\n 'breeze:pointer-events-none breeze:absolute breeze:[inset-block:0] breeze:[inset-inline:0]',\n },\n compound: {},\n size: {},\n state: {\n loadingInput: 'breeze:!opacity-0',\n },\n variant: {},\n} as const;\n\nexport function joinClassNames(\n ...classNames: Array<string | false | undefined>\n): string {\n return classNames.filter(Boolean).join(' ');\n}\n","import {\n ArrowDownLeft,\n ArrowUpRight,\n Bell,\n Building2,\n CalendarDays,\n Camera,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n Clock3,\n Download,\n Ellipsis,\n FileText,\n House,\n List as ListIcon,\n LockKeyhole,\n LogOut,\n type LucideIcon,\n Plus,\n Settings,\n Trash2,\n TriangleAlert,\n Upload,\n Users,\n X,\n} from 'lucide-react';\n\nconst artwork = {\n add: Plus,\n back: ChevronLeft,\n building: Building2,\n calendar: CalendarDays,\n camera: Camera,\n check: Check,\n clock: Clock3,\n close: X,\n delete: Trash2,\n document: FileText,\n download: Download,\n expand: ChevronDown,\n forward: ChevronRight,\n lock: LockKeyhole,\n money: ListIcon,\n moneyIn: ArrowDownLeft,\n moneyOut: ArrowUpRight,\n more: Ellipsis,\n next: ChevronRight,\n notifications: Bell,\n overview: House,\n people: Users,\n settings: Settings,\n signOut: LogOut,\n upload: Upload,\n warning: TriangleAlert,\n} satisfies Record<string, LucideIcon>;\n\nconst variants = {\n base: {\n icon: 'breeze:block breeze:shrink-0',\n },\n compound: {},\n size: {\n lg: 'breeze:block-size-breeze-6 breeze:inline-size-breeze-6',\n md: 'breeze:block-size-breeze-5 breeze:inline-size-breeze-5',\n sm: 'breeze:block-size-breeze-4 breeze:inline-size-breeze-4',\n },\n state: {\n logicalDirection: 'breeze:rtl:rotate-180',\n },\n variant: {},\n} as const;\n\nconst logicalDirectionIcons = new Set<IconName>(['back', 'forward', 'next']);\n\nexport type IconName = keyof typeof artwork;\nexport type IconSize = keyof typeof variants.size;\n\nexport interface IconProps {\n /** Names meaningful artwork; omit for an icon already described by nearby text. */\n label?: string;\n /** Selects artwork from the curated Breeze icon set. */\n name: IconName;\n /** Selects `sm`, `md`, or `lg` dimensions. Defaults to `md`. */\n size?: IconSize;\n}\n\n/**\n * Renders one curated Lucide glyph under Breeze's semantic artwork names.\n *\n * @summary The single dependency boundary for Breeze icon artwork.\n */\nexport function Icon({ label, name, size = 'md' }: Readonly<IconProps>) {\n const Artwork = artwork[name];\n const accessibleLabel = label?.trim() || undefined;\n\n return (\n <Artwork\n aria-hidden={accessibleLabel === undefined ? true : undefined}\n aria-label={accessibleLabel}\n className={[\n variants.base.icon,\n variants.size[size],\n logicalDirectionIcons.has(name) && variants.state.logicalDirection,\n ]\n .filter(Boolean)\n .join(' ')}\n focusable=\"false\"\n role={accessibleLabel === undefined ? undefined : 'img'}\n strokeWidth={1.75}\n />\n );\n}\n","import type { CalendarDate } from '@internationalized/date';\nimport { parseDate } from '@internationalized/date';\nimport {\n createElement,\n type JSX as ReactJSX,\n type KeyboardEvent as ReactKeyboardEvent,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n Calendar as AriaCalendar,\n CalendarCell as AriaCalendarCell,\n CalendarGrid as AriaCalendarGrid,\n CalendarGridBody as AriaCalendarGridBody,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarHeaderCell as AriaCalendarHeaderCell,\n CalendarHeading as AriaCalendarHeading,\n} from 'react-aria-components/Calendar';\nimport { joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport type { IsoCalendarDate } from '../Typography/Typography';\n\nconst calendarVariants = {\n base: {\n cell: 'breeze:grid breeze:min-block-breeze-8 breeze:min-inline-breeze-8 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap breeze:place-items-center breeze:rounded-breeze-full breeze:font-breeze-sans breeze:text-breeze-sm breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[focused]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[outside-month]:text-breeze-ink-3',\n disabledRoot: 'breeze:pointer-events-none breeze:[&>div:last-child]:hidden',\n grid: 'breeze:w-full breeze:table-fixed breeze:border-separate breeze:border-spacing-1 breeze:any-pointer-coarse:border-spacing-0',\n header:\n 'breeze:mb-breeze-2 breeze:flex breeze:min-block-breeze-tap breeze:items-center breeze:justify-between',\n heading:\n 'breeze:m-0 breeze:font-breeze-sans breeze:text-breeze-sm breeze:font-semibold breeze:text-breeze-ink',\n navButton:\n 'breeze:grid breeze:block-size-breeze-8 breeze:inline-size-breeze-8 breeze:place-items-center breeze:rounded-breeze-full breeze:border-0 breeze:bg-transparent breeze:text-breeze-ink-2 breeze:outline-offset-2 breeze:hover:bg-breeze-sunken breeze:focus-visible:outline-2 breeze:focus-visible:outline-solid breeze:focus-visible:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n root: 'breeze:flex breeze:flex-col breeze:gap-breeze-2 breeze:outline-none',\n selectedCell:\n 'breeze:bg-breeze-brand breeze:text-breeze-on-brand breeze:data-[focused]:data-[selected]:bg-breeze-brand breeze:data-[selected]:data-[hovered]:bg-breeze-brand breeze:data-[outside-month]:data-[selected]:text-breeze-on-brand breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-solid breeze:forced-colors:data-[selected]:outline-offset-2',\n todayCell:\n 'breeze:outline-2 breeze:outline-solid breeze:outline-breeze-brand',\n weekday:\n 'breeze:pb-breeze-1 breeze:text-center breeze:font-breeze-sans breeze:text-breeze-xs breeze:font-medium breeze:text-breeze-ink-3',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface CalendarCommonProps {\n /** Focuses the current date when the calendar mounts. */\n autoFocus?: boolean;\n /** Prevents date changes. Defaults to `false`. */\n disabled?: boolean;\n /** Accessible name for the calendar grid. */\n label: string;\n}\n\ninterface ControlledCalendarProps {\n /** Current selected ISO calendar date. */\n value: IsoCalendarDate;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledCalendarProps {\n /** Initial selected ISO calendar date. */\n defaultValue?: IsoCalendarDate;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange?: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for a controlled or uncontrolled single-date calendar. */\nexport type CalendarProps = CalendarCommonProps &\n (ControlledCalendarProps | UncontrolledCalendarProps);\n\nexport function parseCalendarDate(value: IsoCalendarDate): CalendarDate | null {\n try {\n return parseDate(value);\n } catch {\n return null;\n }\n}\n\ninterface CalendarSurfaceProps {\n autoFocus?: boolean;\n disabled: boolean;\n label: string;\n value?: CalendarDate | null;\n defaultValue?: CalendarDate | null;\n onChange?: (value: CalendarDate | null) => void;\n}\n\nfunction CalendarContent({ disabled }: Readonly<{ disabled: boolean }>) {\n return (\n <>\n <div className={calendarVariants.base.header}>\n <AriaButton\n className={calendarVariants.base.navButton}\n isDisabled={disabled}\n slot=\"previous\"\n >\n <Icon name=\"back\" size=\"sm\" />\n </AriaButton>\n <AriaCalendarHeading className={calendarVariants.base.heading} />\n <AriaButton\n className={calendarVariants.base.navButton}\n isDisabled={disabled}\n slot=\"next\"\n >\n <Icon name=\"next\" size=\"sm\" />\n </AriaButton>\n </div>\n <AriaCalendarGrid\n className={calendarVariants.base.grid}\n weekdayStyle=\"short\"\n >\n <AriaCalendarGridHeader>\n {(day) => (\n <AriaCalendarHeaderCell className={calendarVariants.base.weekday}>\n {day}\n </AriaCalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n <AriaCalendarGridBody>\n {(date) => (\n <AriaCalendarCell\n className={({ isSelected, isToday }) =>\n joinClassNames(\n calendarVariants.base.cell,\n isSelected && calendarVariants.base.selectedCell,\n isToday && !isSelected && calendarVariants.base.todayCell,\n )\n }\n date={date}\n render={(props) =>\n createElement('div', {\n ...props,\n 'aria-disabled': disabled || props['aria-disabled'],\n ...(disabled ? { 'data-disabled': true } : {}),\n tabIndex: disabled ? -1 : props.tabIndex,\n })\n }\n />\n )}\n </AriaCalendarGridBody>\n </AriaCalendarGrid>\n </>\n );\n}\n\nexport function CalendarSurface({\n autoFocus,\n defaultValue,\n disabled,\n label,\n onChange,\n value,\n}: Readonly<CalendarSurfaceProps>) {\n const selectedValueKey = value?.toString();\n const previousSelectedValueKey = useRef(selectedValueKey);\n const [focusedValue, setFocusedValue] = useState(value ?? undefined);\n\n useEffect(() => {\n if (selectedValueKey === previousSelectedValueKey.current) return;\n\n previousSelectedValueKey.current = selectedValueKey;\n\n if (value != null) {\n setFocusedValue(value);\n }\n }, [selectedValueKey, value]);\n\n const currentFocusedValue =\n value != null && selectedValueKey !== previousSelectedValueKey.current\n ? value\n : focusedValue;\n const focusProps =\n value == null\n ? {}\n : {\n focusedValue: currentFocusedValue,\n onFocusChange: setFocusedValue,\n };\n const calendarValue = value === undefined ? {} : { value };\n const calendarDefaultValue =\n defaultValue === undefined ? {} : { defaultValue };\n const calendarOnChange = onChange === undefined ? {} : { onChange };\n const calendarProps = {\n 'aria-label': label,\n autoFocus: autoFocus && !disabled,\n className: joinClassNames(\n calendarVariants.base.root,\n disabled && calendarVariants.base.disabledRoot,\n ),\n firstDayOfWeek: 'mon' as const,\n isReadOnly: disabled,\n render: disabled\n ? (props: ReactJSX.IntrinsicElements['div']) =>\n createElement('div', {\n ...props,\n 'aria-disabled': true,\n onKeyDownCapture: (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n\n event.preventDefault();\n event.stopPropagation();\n },\n })\n : undefined,\n weeksInMonth: 6,\n ...focusProps,\n ...calendarDefaultValue,\n ...calendarOnChange,\n ...calendarValue,\n };\n\n return createElement(\n AriaCalendar<CalendarDate>,\n calendarProps,\n <CalendarContent disabled={disabled} />,\n );\n}\n\n/**\n * Renders an accessible six-week, Monday-first calendar with ISO date values.\n *\n * @summary Single-date calendar selection with semantic ISO values.\n */\nexport function Calendar({\n autoFocus = false,\n defaultValue,\n disabled = false,\n label,\n onChange,\n value,\n}: Readonly<CalendarProps>) {\n const selectedValue =\n value === undefined ? undefined : parseCalendarDate(value);\n const initialValue =\n defaultValue === undefined ? undefined : parseCalendarDate(defaultValue);\n\n const handleChange = (date: CalendarDate | null) => {\n if (date) {\n onChange?.(date.toString() as IsoCalendarDate);\n }\n };\n\n return (\n <CalendarSurface\n autoFocus={autoFocus}\n defaultValue={initialValue}\n disabled={disabled}\n label={label}\n onChange={handleChange}\n value={selectedValue}\n />\n );\n}\n","interface LayoutAccessibility {\n accessibleLabel?: string;\n role?: 'group';\n}\n\nfunction getLayoutAccessibility(\n ariaLabel: string | undefined,\n element: string,\n): LayoutAccessibility {\n const accessibleLabel = ariaLabel?.trim() || undefined;\n\n return {\n accessibleLabel,\n role:\n accessibleLabel !== undefined && element === 'div' ? 'group' : undefined,\n };\n}\n\nexport default getLayoutAccessibility;\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n card: 'breeze:min-inline-size-0 breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:shadow-breeze-panel',\n },\n compound: {},\n size: {\n 0: 'breeze:p-0',\n 1: 'breeze:p-breeze-1',\n 2: 'breeze:p-breeze-2',\n 3: 'breeze:p-breeze-3',\n 4: 'breeze:p-breeze-4',\n 5: 'breeze:p-breeze-5',\n 6: 'breeze:p-breeze-6',\n 7: 'breeze:p-breeze-7',\n 8: 'breeze:p-breeze-8',\n },\n state: {\n clipped: 'breeze:overflow-hidden',\n },\n variant: {\n raised: 'breeze:bg-breeze-raised',\n surface: 'breeze:bg-breeze-surface',\n },\n} as const;\n\nexport type CardVariant = keyof typeof variants.variant;\nexport type CardElement = 'article' | 'aside' | 'div' | 'section';\n\nexport interface CardProps {\n /** Names the card region when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Content displayed inside the card. */\n children: ReactNode;\n /** Clips content to the rounded card boundary. Defaults to `true`. */\n clipped?: boolean;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: CardElement;\n /** Applies padding from the Breeze spacing scale. Defaults to `4`. */\n padding?: LayoutGap;\n /** Selects the card surface treatment. Defaults to `surface`. */\n variant?: CardVariant;\n}\n\n/**\n * Decorates related content as a bordered Breeze panel.\n *\n * @summary A closed surface or raised content card.\n */\nexport function Card({\n 'aria-label': ariaLabel,\n children,\n clipped = true,\n element = 'div',\n padding = 4,\n variant = 'surface',\n}: Readonly<CardProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.card,\n variants.variant[variant],\n variants.size[padding],\n clipped && variants.state.clipped,\n ]\n .filter(Boolean)\n .join(' '),\n role,\n },\n children,\n );\n}\n","import type { MouseEventHandler } from 'react';\nimport { FieldError as AriaFieldError } from 'react-aria-components/FieldError';\nimport { Label as AriaLabel } from 'react-aria-components/Label';\nimport { Text as AriaText } from 'react-aria-components/Text';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { fieldVariants } from './field.styles';\n\ninterface FieldLabelProps {\n htmlFor?: string;\n id?: string;\n label: string;\n loading: boolean;\n onClick?: MouseEventHandler<HTMLLabelElement>;\n}\n\nexport function FieldLabel({\n htmlFor,\n id,\n label,\n loading,\n onClick,\n}: Readonly<FieldLabelProps>) {\n return (\n <AriaLabel\n className={fieldVariants.base.label}\n htmlFor={htmlFor}\n id={id}\n onClick={onClick}\n >\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n label\n )}\n </AriaLabel>\n );\n}\n\ninterface FieldSupportProps {\n description?: string;\n descriptionId?: string;\n error?: string;\n errorId?: string;\n loading: boolean;\n}\n\nexport function FieldSupportingContent({\n description,\n descriptionId,\n error,\n errorId,\n loading,\n}: Readonly<FieldSupportProps>) {\n return (\n <>\n {description && (\n <AriaText\n className={fieldVariants.base.description}\n id={descriptionId}\n slot=\"description\"\n >\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n description\n )}\n </AriaText>\n )}\n {error &&\n (loading ? (\n <span\n aria-hidden=\"true\"\n className={fieldVariants.base.error}\n id={errorId}\n >\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n </span>\n ) : (\n <AriaFieldError className={fieldVariants.base.error} id={errorId}>\n {error}\n </AriaFieldError>\n ))}\n </>\n );\n}\n","import type { Ref } from 'react';\nimport { useObjectRef } from 'react-aria/useObjectRef';\nimport {\n CheckboxButton as AriaCheckboxButton,\n CheckboxField as AriaCheckboxField,\n} from 'react-aria-components/Checkbox';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { FieldSupportingContent } from '../Field/field.presentation';\nimport { fieldVariants } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n control:\n 'breeze:relative breeze:inline-grid breeze:min-block-breeze-tap breeze:grid-flow-col breeze:items-center breeze:gap-breeze-2 breeze:cursor-pointer breeze:select-none breeze:font-breeze-sans breeze:text-breeze-sm breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-ink breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60',\n indicator:\n 'breeze:inline-grid breeze:block-size-breeze-5 breeze:inline-size-breeze-5 breeze:shrink-0 breeze:place-items-center breeze:rounded-breeze-chip breeze:border breeze:border-solid breeze:border-breeze-ink-3 breeze:bg-breeze-surface breeze:text-breeze-on-brand breeze:transition-colors breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand',\n label: 'breeze:[grid-area:1/2]',\n skeleton: 'breeze:pointer-events-none breeze:[grid-area:1/2]',\n skeletonIndicator:\n 'breeze:pointer-events-none breeze:[grid-area:1/1] breeze:block-size-breeze-5 breeze:inline-size-breeze-5',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface CheckboxCommonProps {\n /** Prevents selection and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Associates the checkbox with a form outside its ancestor tree. */\n form?: string;\n /** Sets the native input id. */\n id?: string;\n /** Accessible checkbox label, shown as text outside loading state. */\n label: string;\n /** Replaces the checkbox content with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Sets the submitted name of the checkbox. */\n name?: string;\n /** Supporting guidance announced with the checkbox. */\n description?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native checkbox input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the checkbox as required. Defaults to `false`. */\n required?: boolean;\n /** Visible validation message; any non-empty value marks the checkbox invalid. */\n error?: string;\n /** Native value submitted when the checkbox is selected. */\n value?: string;\n}\n\ninterface ControlledCheckboxProps {\n /** Current selected state. */\n selected: boolean;\n /** Reports the next selected state without exposing a DOM event. */\n onChange: (selected: boolean) => void;\n /** Controlled and uncontrolled selection props are mutually exclusive. */\n defaultSelected?: never;\n}\n\ninterface UncontrolledCheckboxProps {\n /** Initial selected state. Defaults to `false`. */\n defaultSelected?: boolean;\n /** Reports the next selected state without exposing a DOM event. */\n onChange?: (selected: boolean) => void;\n /** Controlled and uncontrolled selection props are mutually exclusive. */\n selected?: never;\n}\n\n/** Props for controlled or uncontrolled boolean selection. */\nexport type CheckboxProps = CheckboxCommonProps &\n (ControlledCheckboxProps | UncontrolledCheckboxProps);\n\n/**\n * Renders an accessible checkbox with a visible label, validation messages,\n * semantic boolean changes, and a closed loading presentation.\n *\n * @summary Flat boolean selection with semantic value changes.\n */\nexport function Checkbox({\n defaultSelected,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n readOnly = false,\n ref,\n required = false,\n selected,\n value,\n}: Readonly<CheckboxProps>) {\n const { messages } = useBreezeContext();\n const inputRef = useObjectRef(ref);\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaCheckboxField\n className={fieldVariants.base.root}\n defaultSelected={defaultSelected}\n form={form}\n id={id}\n inputRef={inputRef}\n aria-label={loading ? label : undefined}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n isSelected={selected}\n name={name}\n onChange={onChange}\n value={value}\n validationBehavior=\"aria\"\n >\n <AriaCheckboxButton className={variants.base.control}>\n {({ isFocusVisible, isSelected }) => (\n <>\n {loading && (\n <>\n <span\n aria-hidden=\"true\"\n className={variants.base.skeletonIndicator}\n >\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n shape=\"rectangle\"\n />\n </span>\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"1lh\"\n inlineSize=\"12em\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n </>\n )}\n {!loading && (\n <>\n <span\n aria-hidden=\"true\"\n className={variants.base.indicator}\n data-focus-visible={isFocusVisible || undefined}\n data-selected={isSelected || undefined}\n >\n {isSelected ? '✓' : ''}\n </span>\n <span className={variants.base.label}>{label}</span>\n </>\n )}\n </>\n )}\n </AriaCheckboxButton>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaCheckboxField>\n );\n}\n","import type { ButtonHTMLAttributes, ReactNode, Ref } from 'react';\nimport { createElement, useState } from 'react';\nimport { ToggleButton as AriaToggleButton } from 'react-aria-components/ToggleButton';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n label: 'breeze:[grid-area:1/1]',\n skeleton:\n 'breeze:[grid-area:1/1] breeze:inline-size-full breeze:block-size-breeze-3',\n status: 'breeze:sr-only',\n },\n state: {\n loading: 'breeze:cursor-wait',\n loadingLabel: 'breeze:opacity-0',\n },\n} as const;\n\ninterface SelectionControlProps {\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n children: ReactNode;\n className: string;\n defaultPressed?: boolean;\n disabled: boolean;\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Lets a containing group provide one loading announcement for all options. */\n announceLoading?: boolean;\n loading: boolean;\n onChange?: (pressed: boolean) => void;\n pressed?: boolean;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/** Renders the shared selected button and its loading presentation. */\nexport default function SelectionControl({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n className,\n defaultPressed,\n disabled,\n id,\n announceLoading = true,\n loading,\n onChange,\n pressed,\n ref,\n}: Readonly<SelectionControlProps>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const [uncontrolledPressed, setUncontrolledPressed] = useState(\n defaultPressed ?? false,\n );\n const isControlled = pressed !== undefined;\n const isPressed = isControlled ? pressed : uncontrolledPressed;\n\n return (\n <>\n <AriaToggleButton\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={[className, loading && variants.state.loading]\n .filter(Boolean)\n .join(' ')}\n id={id}\n isDisabled={disabled}\n isSelected={isPressed}\n onChange={(nextPressed) => {\n if (loading) return;\n\n if (!isControlled) {\n setUncontrolledPressed(nextPressed);\n }\n\n onChange?.(nextPressed);\n }}\n ref={ref}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n 'aria-disabled': disabled || loading || undefined,\n type: 'button',\n })\n }\n >\n <span\n className={[\n variants.base.label,\n loading && variants.state.loadingLabel,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </span>\n {loading && (\n <span\n aria-hidden=\"true\"\n className={variants.base.skeleton}\n data-breeze-skeleton=\"\"\n >\n <Skeleton inlineSize=\"100%\" />\n </span>\n )}\n </AriaToggleButton>\n {loading && announceLoading && (\n <span className={variants.base.status}>\n <Skeleton label={messages.loading} />\n </span>\n )}\n {announceLoading && (\n <output\n aria-live=\"polite\"\n className={variants.base.status}\n lang={getMessageLocale('loading')}\n >\n {loading ? messages.loading : ''}\n </output>\n )}\n </>\n );\n}\n","import type { ButtonHTMLAttributes, Ref } from 'react';\nimport SelectionControl from '../SelectionControl/SelectionControl';\n\nconst variants = {\n base: {\n chip: 'breeze:inline-grid breeze:items-center breeze:justify-center breeze:whitespace-nowrap breeze:rounded-breeze-full breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:font-breeze-sans breeze:text-breeze-xs breeze:font-semibold breeze:text-breeze-ink breeze:cursor-pointer breeze:select-none breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap breeze:min-block-breeze-sm',\n },\n compound: {},\n size: {},\n state: {\n pressed:\n 'breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\ninterface ChipCommonProps {\n /** Provides an accessible name when it differs from the visible label. */\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n /** Identifies elements that provide additional information about the chip. */\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n /** Identifies elements whose text provides the chip's accessible name. */\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n /** Visible filter label and default accessible name. */\n children: string;\n /** Prevents the chip from being activated. Defaults to `false`. */\n disabled?: boolean;\n /** Sets the rendered button's HTML `id`. */\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Shows a placeholder while a pressed-state change is being saved. */\n loading?: boolean;\n /** Provides access to the rendered button element. */\n ref?: Ref<HTMLButtonElement>;\n}\n\ninterface ControlledChipProps {\n /** Current pressed state. */\n pressed: boolean;\n /** Reports the next pressed state. */\n onChange: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n defaultPressed?: never;\n}\n\ninterface UncontrolledChipProps {\n /** Initial pressed state. Defaults to `false`. */\n defaultPressed?: boolean;\n /** Reports the next pressed state. */\n onChange?: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n pressed?: never;\n}\n\n/** Props for controlled or uncontrolled boolean chip state. */\nexport type ChipProps = ChipCommonProps &\n (ControlledChipProps | UncontrolledChipProps);\n\n/**\n * Renders an independently selectable filter chip.\n *\n * @summary A compact filter with a pressed state.\n */\nexport function Chip({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n defaultPressed,\n disabled = false,\n id,\n loading = false,\n onChange,\n pressed,\n ref,\n}: Readonly<ChipProps>) {\n return (\n <SelectionControl\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={[variants.base.chip, variants.state.pressed].join(' ')}\n defaultPressed={defaultPressed}\n disabled={disabled}\n id={id}\n loading={loading}\n onChange={onChange}\n pressed={pressed}\n ref={ref}\n >\n {children}\n </SelectionControl>\n );\n}\n","/** Shared listbox geometry and descriptor treatment for collection controls. */\nconst collectionVariants = {\n base: {\n badge: 'breeze:ms-auto',\n content:\n 'breeze:flex breeze:min-inline-size-0 breeze:flex-1 breeze:flex-col breeze:gap-breeze-1',\n description:\n 'breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n item: 'breeze:flex breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:items-start breeze:gap-breeze-2 breeze:rounded-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-offset-[-2px] breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[focused]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text',\n label: 'breeze:font-medium',\n listBox: 'breeze:min-inline-size-0 breeze:outline-none',\n popover:\n 'breeze:min-inline-size-[var(--trigger-width)] breeze:max-inline-size-[calc(100vw-24px)] breeze:overflow-auto breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:bg-breeze-surface breeze:p-breeze-1 breeze:shadow-breeze-overlay',\n selectedIndicator:\n 'breeze:ms-auto breeze:block-size-breeze-4 breeze:inline-size-breeze-4 breeze:shrink-0 breeze:text-breeze-brand-text',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\nexport default collectionVariants;\n","import {\n createContext,\n useContext,\n useId,\n useLayoutEffect,\n useSyncExternalStore,\n} from 'react';\nimport type { OverlayKind } from './overlay.types';\n\ninterface Layer {\n active: boolean;\n id: string;\n kind: OverlayKind;\n parent?: string;\n visual: boolean;\n}\n\n/** Breeze owns ordering; React Aria still owns modality, focus and animations. */\nexport function createOverlayStack() {\n let layers: Layer[] = [];\n const listeners = new Set<() => void>();\n const publish = () => listeners.forEach((listener) => listener());\n\n return {\n getSnapshot: () => layers,\n remove: (id: string) => {\n layers = layers.filter((layer) => layer.id !== id);\n publish();\n },\n set: (layer: Layer) => {\n const previous = layers.find((entry) => entry.id === layer.id);\n if (\n previous?.active === layer.active &&\n previous.kind === layer.kind &&\n previous.parent === layer.parent &&\n previous.visual === layer.visual\n )\n return;\n // Reopening goes above other siblings, while closing retains exit geometry.\n layers =\n previous && (!layer.active || previous.active)\n ? layers.map((entry) => (entry.id === layer.id ? layer : entry))\n : [...layers.filter((entry) => entry.id !== layer.id), layer];\n publish();\n },\n subscribe: (listener: () => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nexport const OverlayStackContext = createContext<ReturnType<\n typeof createOverlayStack\n> | null>(null);\n\n/** Returns the next layer above every registered overlay for provider-owned UI. */\nexport function useOverlayToastZIndex() {\n const store = useContext(OverlayStackContext);\n if (!store)\n throw new Error(\n 'Breeze components must be rendered within BreezeProvider.',\n );\n const layers = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot,\n );\n\n return 100 + layers.length * 2;\n}\n\nexport const ParentOverlayContext = createContext<{\n id: string;\n open: boolean;\n restoreFocus: () => void;\n} | null>(null);\n\nexport function useOverlayLayer(\n kind: OverlayKind,\n open: boolean,\n visual: boolean,\n) {\n const store = useContext(OverlayStackContext);\n const parent = useContext(ParentOverlayContext);\n const id = useId();\n if (!store)\n throw new Error(\n 'Breeze components must be rendered within BreezeProvider.',\n );\n const layers = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot,\n );\n const parentId = parent?.id;\n\n useLayoutEffect(() => () => store.remove(id), [id, store]);\n useLayoutEffect(() => {\n store.set({ active: open, id, kind, parent: parentId, visual });\n }, [id, kind, open, parentId, store, visual]);\n\n // Effects mount children first. Walk ancestry rather than relying on effect order.\n const ordered: Layer[] = [];\n const append = (layer: Layer) => {\n if (ordered.includes(layer)) return;\n const ancestor = layers.find((entry) => entry.id === layer.parent);\n if (ancestor) append(ancestor);\n ordered.push(layer);\n };\n layers.forEach(append);\n const isActive = (layer: Layer): boolean => {\n const ancestor = layers.find((entry) => entry.id === layer.parent);\n return layer.active && (!ancestor || isActive(ancestor));\n };\n const active = ordered.filter(isActive);\n const activeIndex = active.findIndex((layer) => layer.id === id);\n const interactive =\n open &&\n activeIndex !== -1 &&\n !active.slice(activeIndex + 1).some((layer) => layer.kind !== 'popover');\n const topmost = open && active.at(-1)?.id === id;\n const activeModal = active.findLast(\n (layer) => layer.kind === 'drawer' || layer.kind === 'dialog',\n );\n const visualModal = ordered.findLast(\n (layer) =>\n layer.visual && (layer.kind === 'drawer' || layer.kind === 'dialog'),\n );\n const scrim = (activeModal ?? visualModal)?.id === id;\n\n return {\n id,\n interactive,\n scrim,\n topmost,\n zIndex:\n 100 +\n Math.max(\n 0,\n ordered.findIndex((layer) => layer.id === id),\n ) *\n 2,\n };\n}\n","import {\n createContext,\n type ReactNode,\n useContext,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria/PortalProvider';\nimport { useLocale } from 'react-aria-components/I18nProvider';\nimport { createOverlayStack, OverlayStackContext } from './OverlayStack';\n\nconst PortalContext = createContext<HTMLElement | null>(null);\nconst portalBoundaryError =\n 'BreezeProvider portalContainer must belong to the current document and light DOM.';\n\n/** A dedicated host keeps locale and scoped styles on every portalled surface. */\nexport function OverlayProvider({\n children,\n portalContainer,\n locale,\n}: Readonly<{\n children: ReactNode;\n portalContainer?: HTMLElement;\n locale: string;\n}>) {\n const { direction } = useLocale();\n const [stack] = useState(createOverlayStack);\n const [host, setHost] = useState<HTMLElement | null>(null);\n\n useLayoutEffect(() => {\n const container = portalContainer ?? document.body;\n if (\n container.ownerDocument !== document ||\n container.getRootNode() !== document\n ) {\n throw new Error(portalBoundaryError);\n }\n const element = container.ownerDocument.createElement('div');\n element.dataset.breezeRoot = '';\n element.dataset.breezePortal = '';\n container.append(element);\n setHost(element);\n return () => element.remove();\n }, [portalContainer]);\n\n useLayoutEffect(() => {\n if (host) {\n host.lang = locale;\n host.dir = direction;\n }\n }, [direction, host, locale]);\n\n return (\n <PortalProvider getContainer={() => host}>\n <OverlayStackContext value={stack}>\n <PortalContext value={host}>{children}</PortalContext>\n </OverlayStackContext>\n </PortalProvider>\n );\n}\n\nexport function useOverlayPortal() {\n return useContext(PortalContext);\n}\n","import type { ReactNode, RefObject } from 'react';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { Popover as AriaPopover } from 'react-aria-components/Popover';\nimport { useOverlayPortal } from '../../overlays/OverlayProvider';\nimport {\n ParentOverlayContext,\n useOverlayLayer,\n} from '../../overlays/OverlayStack';\n\nconst triggerBoundaryError =\n 'Breeze overlay triggers and portal containers must belong to the current document and light DOM.';\n\nfunction isNode(value: EventTarget | null): value is Node {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).contains === 'function'\n );\n}\n\ninterface CollectionPopoverProps {\n children: ReactNode;\n className: string;\n /** Minimum viewport edge margin used while positioning the surface. */\n containerPadding?: number;\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n triggerRef: RefObject<Element | null>;\n}\n\n/**\n * The collection popover bridge keeps listbox surfaces inside Breeze's portal\n * and overlay stack while React Aria owns positioning, focus and dismissal.\n */\nexport default function CollectionPopover({\n children,\n className,\n containerPadding,\n isOpen: requestedOpen,\n onOpenChange,\n triggerRef,\n}: Readonly<CollectionPopoverProps>) {\n const host = useOverlayPortal();\n const parent = useContext(ParentOverlayContext);\n const parentOpen = parent?.open ?? true;\n const [portalReady, setPortalReady] = useState(parent === null);\n const [surfaceMounted, setSurfaceMounted] = useState(false);\n const parentCloseReportedRef = useRef(false);\n const surfaceRef = useRef<Element | null>(null);\n const pointerDownTargetRef = useRef<Node | null>(null);\n const pointerDismissTargetRef = useRef<Node | null>(null);\n const open = requestedOpen && parentOpen;\n const layer = useOverlayLayer(\n 'popover',\n open && portalReady && host !== null,\n open || surfaceMounted,\n );\n const handleSurfaceRef = useCallback((element: Element | null) => {\n surfaceRef.current = element;\n setSurfaceMounted(element !== null);\n }, []);\n\n useLayoutEffect(() => {\n if (\n host &&\n triggerRef.current &&\n (triggerRef.current.ownerDocument !== document ||\n triggerRef.current.getRootNode() !== document ||\n host.ownerDocument !== document ||\n host.getRootNode() !== document)\n ) {\n throw new Error(triggerBoundaryError);\n }\n });\n\n useEffect(() => setPortalReady(true), []);\n useLayoutEffect(() => {\n if (!open || !layer.topmost || !host) return undefined;\n\n const isOutside = (target: Node | null) =>\n isNode(target) &&\n !surfaceRef.current?.contains(target) &&\n !triggerRef.current?.contains(target);\n const sameTarget = (left: Node | null, right: Node | null) =>\n !!left &&\n !!right &&\n (left === right || left.contains(right) || right.contains(left));\n const isPrimaryPointer = (event: PointerEvent) => event.button === 0;\n let pointerDismissExpiry: ReturnType<typeof setTimeout> | null = null;\n const clearPointerDismissExpiry = () => {\n if (pointerDismissExpiry !== null) {\n clearTimeout(pointerDismissExpiry);\n pointerDismissExpiry = null;\n }\n };\n const schedulePointerDismissExpiry = () => {\n clearPointerDismissExpiry();\n pointerDismissExpiry = setTimeout(() => {\n pointerDismissExpiry = null;\n pointerDismissTargetRef.current = null;\n }, 0);\n };\n const onPointerDown = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = isNode(event.target) ? event.target : null;\n pointerDismissTargetRef.current = null;\n };\n const onPointerUp = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n const pointerDownTarget = pointerDownTargetRef.current;\n const pointerUpTarget = isNode(event.target) ? event.target : null;\n if (!isOutside(pointerUpTarget)) {\n pointerDownTargetRef.current = null;\n return;\n }\n\n if (!isOutside(pointerDownTarget)) {\n // A drag that starts in the surface and ends outside must not be\n // reinterpreted as an outside click by the subsequent click event.\n pointerDismissTargetRef.current = pointerUpTarget;\n pointerDownTargetRef.current = null;\n schedulePointerDismissExpiry();\n return;\n }\n\n pointerDismissTargetRef.current = pointerUpTarget;\n onOpenChange(false);\n };\n const onPointerCancel = () => {\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = null;\n pointerDismissTargetRef.current = null;\n };\n const onClick = (event: MouseEvent) => {\n const target = isNode(event.target) ? event.target : null;\n if (\n isOutside(target) &&\n !sameTarget(pointerDismissTargetRef.current, target)\n ) {\n onOpenChange(false);\n }\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = null;\n pointerDismissTargetRef.current = null;\n };\n\n host.ownerDocument.addEventListener('pointerdown', onPointerDown, true);\n host.ownerDocument.addEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.addEventListener('pointercancel', onPointerCancel, true);\n host.ownerDocument.addEventListener('click', onClick, true);\n return () => {\n host.ownerDocument.removeEventListener(\n 'pointerdown',\n onPointerDown,\n true,\n );\n host.ownerDocument.removeEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.removeEventListener(\n 'pointercancel',\n onPointerCancel,\n true,\n );\n host.ownerDocument.removeEventListener('click', onClick, true);\n clearPointerDismissExpiry();\n pointerDownTargetRef.current = null;\n pointerDismissTargetRef.current = null;\n };\n }, [host, layer.topmost, onOpenChange, open, triggerRef]);\n\n useEffect(() => {\n if (parentOpen) {\n parentCloseReportedRef.current = false;\n } else if (requestedOpen && !parentCloseReportedRef.current) {\n parentCloseReportedRef.current = true;\n onOpenChange(false);\n }\n }, [onOpenChange, parentOpen, requestedOpen]);\n\n return (\n <AriaPopover\n className={`${className} breeze-popover`}\n containerPadding={containerPadding}\n data-breeze-interactive={layer.interactive}\n data-breeze-overlay=\"popover\"\n data-breeze-topmost={layer.topmost}\n inert={!layer.interactive}\n isKeyboardDismissDisabled={!layer.topmost}\n isNonModal\n isOpen={open}\n onOpenChange={onOpenChange}\n placement=\"bottom start\"\n // Defer pointer dismissal to Breeze's provider-document policy, while\n // retaining React Aria's keyboard/focus dismissal behavior.\n shouldCloseOnInteractOutside={(element) =>\n pointerDownTargetRef.current === null &&\n layer.topmost &&\n !triggerRef.current?.contains(element)\n }\n style={{ zIndex: layer.zIndex }}\n triggerRef={triggerRef}\n ref={handleSurfaceRef}\n >\n {children}\n </AriaPopover>\n );\n}\n","import { Badge } from '../Badge/Badge';\nimport { Icon } from '../Icon/Icon';\nimport collectionVariants from './collection.styles';\nimport type { ItemDescriptor } from './item.types';\n\ninterface DescriptorContentProps {\n descriptor: ItemDescriptor;\n isSelected: boolean;\n}\n\n/** Renders the closed descriptor content shared by collection controls. */\nexport default function DescriptorContent({\n descriptor,\n isSelected,\n}: Readonly<DescriptorContentProps>) {\n return (\n <>\n {descriptor.icon && <Icon name={descriptor.icon} size=\"sm\" />}\n <span className={collectionVariants.base.content}>\n <span className={collectionVariants.base.label}>\n {descriptor.label}\n </span>\n {descriptor.description && (\n <span className={collectionVariants.base.description}>\n {descriptor.description}\n </span>\n )}\n </span>\n {descriptor.badge && (\n <span className={collectionVariants.base.badge}>\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n </span>\n )}\n <span\n aria-hidden=\"true\"\n className={collectionVariants.base.selectedIndicator}\n >\n {isSelected && <Icon name=\"check\" size=\"sm\" />}\n </span>\n </>\n );\n}\n","import { ListBoxItem as AriaListBoxItem } from 'react-aria-components/ListBox';\nimport collectionVariants from './collection.styles';\nimport DescriptorContent from './DescriptorContent';\nimport type { ItemDescriptor } from './item.types';\n\n/** Renders Breeze's closed descriptor contract inside a React Aria option. */\nfunction DescriptorOption({\n descriptor,\n}: Readonly<{ descriptor: ItemDescriptor }>) {\n return (\n <AriaListBoxItem\n className={collectionVariants.base.item}\n id={descriptor.id}\n isDisabled={descriptor.disabled}\n textValue={descriptor.label}\n >\n {({ isSelected }) => (\n <DescriptorContent descriptor={descriptor} isSelected={isSelected} />\n )}\n </AriaListBoxItem>\n );\n}\n\nexport default DescriptorOption;\n","import type { RefObject } from 'react';\nimport { useContext, useEffect, useId, useMemo, useRef } from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n ComboBox as AriaComboBox,\n ComboBoxStateContext as AriaComboBoxStateContext,\n useFilter,\n} from 'react-aria-components/ComboBox';\nimport { Group as AriaGroup } from 'react-aria-components/Group';\nimport { Input as AriaInput } from 'react-aria-components/Input';\nimport { ListBox as AriaListBox } from 'react-aria-components/ListBox';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport collectionVariants from '../Collection/collection.styles';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport DescriptorOption from '../Collection/DescriptorOption';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n group:\n 'breeze:relative breeze:inline-flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:items-stretch breeze:overflow-hidden breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:has-[input[data-focus-visible]]:outline-2 breeze:has-[input[data-focus-visible]]:outline-solid breeze:has-[input[data-focus-visible]]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:bg-breeze-sunken breeze:data-[invalid]:border-breeze-danger',\n input:\n 'breeze:min-block-breeze-md breeze:min-inline-size-0 breeze:flex-1 breeze:border-0 breeze:bg-transparent breeze:ps-breeze-3 breeze:pe-breeze-2 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-none breeze:placeholder:text-breeze-ink-3 breeze:data-[hovered]:border-transparent breeze:data-[focus-visible]:!outline-none breeze:data-[invalid]:border-transparent breeze:disabled:cursor-not-allowed breeze:read-only:cursor-default',\n popover:\n 'breeze:min-inline-size-[var(--trigger-width)] breeze:max-inline-size-[calc(100vw-24px)] breeze:overflow-auto breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:bg-breeze-surface breeze:p-breeze-1 breeze:shadow-breeze-overlay',\n skeleton:\n 'breeze:pointer-events-none breeze:absolute breeze:[inset-block:0] breeze:[inset-inline:0]',\n trigger:\n 'breeze:inline-grid breeze:shrink-0 breeze:place-items-center breeze:border-0 breeze:bg-transparent breeze:pe-breeze-2 breeze:ps-breeze-2 breeze:text-breeze-ink-2 breeze:outline-none breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:disabled:cursor-not-allowed breeze:disabled:opacity-60 breeze:any-pointer-coarse:min-inline-breeze-tap',\n },\n compound: {},\n size: {},\n state: {\n loadingGroup:\n 'breeze:!bg-transparent breeze:!border-transparent breeze:!opacity-100 breeze:!overflow-visible',\n loadingInput: 'breeze:!opacity-0',\n loadingTrigger: 'breeze:!opacity-0',\n readOnlyGroup: 'breeze:bg-breeze-sunken',\n },\n variant: {},\n} as const;\n\ninterface ComboBoxCommonProps<T> {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the input when the component is mounted. */\n autoFocus?: boolean;\n /** Prevents editing and opening the suggestions. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the input. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the input with a form outside its ancestor tree. */\n form?: string;\n /** Maps an item to the closed descriptor rendered by Breeze. */\n getItem: (item: T) => ItemDescriptor;\n /** Sets the native input id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the field with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Items displayed as suggestions. */\n items: T[];\n /** Sets the submitted name of the input. */\n name?: string;\n /** Temporary text shown while the input is empty. */\n placeholder?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Marks the input as required. Defaults to `false`. */\n required?: boolean;\n}\n\n/** The application value emitted by a ComboBox. */\ntype ComboBoxValue<T> = T | string | null;\n\n/** The optional value accepted while deriving ComboBox state. */\ntype ComboBoxInputValue<T> = ComboBoxValue<T> | undefined;\n\ninterface ControlledComboBoxProps<Value> {\n /** Current selected item or free-text value. */\n value: Value;\n /** Reports the next selected item or free-text value without exposing a DOM event. */\n onChange: (value: Value) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledComboBoxProps<Value> {\n /** Initial selected item or free-text value. */\n defaultValue?: Value;\n /** Reports the next selected item or free-text value without exposing a DOM event. */\n onChange?: (value: Value) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled suggestion entry. */\nexport type ComboBoxProps<T> =\n | (ComboBoxCommonProps<T> & {\n /** Allows a value that is not one of the suggestions. */\n allowsCustomValue: true;\n } & (\n | ControlledComboBoxProps<ComboBoxValue<NoInfer<T>>>\n | UncontrolledComboBoxProps<ComboBoxValue<NoInfer<T>>>\n ))\n | (ComboBoxCommonProps<T> & {\n /** Disallows values that are not one of the suggestions. */\n allowsCustomValue?: false;\n } & (\n | ControlledComboBoxProps<NoInfer<T> | null>\n | UncontrolledComboBoxProps<NoInfer<T> | null>\n ));\n\ninterface ComboBoxItem<T> {\n id: string;\n descriptor: ItemDescriptor;\n item: T;\n}\n\nfunction findItem<T>(\n value: T,\n decoratedItems: ComboBoxItem<T>[],\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n const directItem = decoratedItems.find(({ item }) => item === value);\n if (directItem) return directItem;\n\n if (allowsCustomValue && typeof value === 'string') return undefined;\n\n const { id } = getItem(value);\n return decoratedItems.find((item) => item.descriptor.id === id);\n}\n\nfunction resolveCollectionKey<T>(\n value: ComboBoxInputValue<T>,\n item: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n if (value === undefined) return undefined;\n if (\n value === null ||\n (allowsCustomValue && typeof value === 'string' && !item)\n ) {\n return null;\n }\n\n return item?.id ?? getItem(value as T).id;\n}\n\nfunction resolveControlledInputValue<T>(\n value: ComboBoxInputValue<T>,\n selectedItem: ComboBoxItem<T> | undefined,\n allowsCustomValue: boolean,\n) {\n if (value === undefined || !allowsCustomValue) return undefined;\n if (selectedItem) return selectedItem.descriptor.label;\n return typeof value === 'string' ? value : '';\n}\n\nfunction resolveDefaultCustomValue<T>(\n defaultValue: ComboBoxInputValue<T>,\n defaultItem: ComboBoxItem<T> | undefined,\n allowsCustomValue: boolean,\n) {\n if (!allowsCustomValue || typeof defaultValue !== 'string' || defaultItem) {\n return undefined;\n }\n\n return defaultValue;\n}\n\nfunction ComboBoxListBox<T>({ items }: Readonly<{ items: ComboBoxItem<T>[] }>) {\n return (\n <AriaListBox className={collectionVariants.base.listBox} items={items}>\n {(item: ComboBoxItem<T>) => (\n <DescriptorOption descriptor={item.descriptor} />\n )}\n </AriaListBox>\n );\n}\n\nfunction ComboBoxPopover<T>({\n allowsCustomValue,\n hasSuggestions,\n isDisabled,\n isReadOnly,\n items,\n triggerRef,\n}: Readonly<{\n allowsCustomValue: boolean;\n hasSuggestions: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n items: ComboBoxItem<T>[];\n triggerRef: RefObject<Element | null>;\n}>) {\n const state = useContext(AriaComboBoxStateContext);\n const isBlocked = isDisabled || isReadOnly;\n const isOpen =\n !isBlocked &&\n (hasSuggestions || allowsCustomValue) &&\n (state?.isOpen ?? false);\n\n useEffect(() => {\n if (\n (isBlocked || (!hasSuggestions && !allowsCustomValue)) &&\n state?.isOpen\n ) {\n state.setOpen(false);\n }\n }, [allowsCustomValue, hasSuggestions, isBlocked, state]);\n\n return (\n <CollectionPopover\n className={variants.base.popover}\n isOpen={isOpen}\n onOpenChange={(open) => state?.setOpen(open)}\n triggerRef={triggerRef}\n >\n <ComboBoxListBox items={items} />\n </CollectionPopover>\n );\n}\n\n/**\n * Renders a filtered suggestion field with closed descriptor content and\n * optional application-owned free text.\n *\n * @summary Flat suggestion entry with semantic item or text changes.\n */\nfunction ComboBoxBase<T>({ props }: Readonly<{ props: ComboBoxProps<T> }>) {\n const {\n allowsCustomValue = false,\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n getItem,\n id,\n items,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n readOnly = false,\n required = false,\n value,\n } = props;\n const { messages } = useBreezeContext();\n const { contains } = useFilter({ sensitivity: 'base' });\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const fieldId = useId();\n const descriptionId = `${fieldId}-description`;\n const errorId = `${fieldId}-error`;\n const supportingIds =\n [visibleDescription && descriptionId, visibleError && errorId]\n .filter(Boolean)\n .join(' ') || undefined;\n const groupRef = useRef<HTMLDivElement>(null);\n const decoratedItems = useMemo<ComboBoxItem<T>[]>(\n () =>\n items.map((item) => {\n const descriptor = getItem(item);\n return {\n descriptor,\n id: descriptor.id,\n item,\n };\n }),\n [getItem, items],\n );\n\n const selectedItem =\n value !== undefined && value !== null\n ? findItem(value as T, decoratedItems, getItem, allowsCustomValue)\n : undefined;\n const selectedKey = resolveCollectionKey(\n value as ComboBoxInputValue<T>,\n selectedItem,\n getItem,\n allowsCustomValue,\n );\n const defaultItem =\n defaultValue !== undefined && defaultValue !== null\n ? findItem(defaultValue as T, decoratedItems, getItem, allowsCustomValue)\n : undefined;\n const defaultSelectedKey = resolveCollectionKey(\n defaultValue as ComboBoxInputValue<T>,\n defaultItem,\n getItem,\n allowsCustomValue,\n );\n const controlledInputValue = resolveControlledInputValue(\n value as ComboBoxInputValue<T>,\n selectedItem,\n allowsCustomValue,\n );\n const defaultCustomValue = resolveDefaultCustomValue(\n defaultValue as ComboBoxInputValue<T>,\n defaultItem,\n allowsCustomValue,\n );\n const lastSelectedKeyRef = useRef<string | null>(\n selectedKey == null ? null : String(selectedKey),\n );\n const inputValueRef = useRef(\n controlledInputValue ?? defaultCustomValue ?? '',\n );\n const inputChangeHandledRef = useRef(false);\n const emitChange = onChange as\n | ((nextValue: ComboBoxValue<T>) => void)\n | undefined;\n\n useEffect(() => {\n lastSelectedKeyRef.current =\n selectedKey == null ? null : String(selectedKey);\n }, [selectedKey]);\n\n const handleSelectionChange = (key: string | number | null) => {\n if (key === null) {\n lastSelectedKeyRef.current = null;\n if (allowsCustomValue) {\n const inputChangeHandled = inputChangeHandledRef.current;\n inputChangeHandledRef.current = false;\n if (inputValueRef.current || inputChangeHandled) return;\n }\n emitChange?.(null);\n return;\n }\n\n inputChangeHandledRef.current = false;\n lastSelectedKeyRef.current = String(key);\n const nextItem = decoratedItems.find(\n (item) => item.descriptor.id === String(key),\n );\n inputValueRef.current = nextItem?.descriptor.label ?? '';\n emitChange?.(nextItem?.item ?? null);\n };\n\n const handleInputChange = (inputValue: string) => {\n inputValueRef.current = inputValue;\n inputChangeHandledRef.current = true;\n\n if (!allowsCustomValue) return;\n\n const selected = decoratedItems.find(\n (item) => item.descriptor.id === lastSelectedKeyRef.current,\n );\n if (selected?.descriptor.label === inputValue) return;\n\n emitChange?.(inputValue || null);\n };\n\n const isInvalid = !loading && visibleError !== undefined;\n const submittedName = interactionDisabled ? undefined : name;\n\n return (\n <AriaComboBox<ComboBoxItem<T>>\n allowsCustomValue={allowsCustomValue}\n allowsEmptyCollection={allowsCustomValue}\n aria-label={loading ? label : undefined}\n className={fieldVariants.base.root}\n defaultFilter={contains}\n defaultInputValue={defaultCustomValue}\n defaultItems={decoratedItems}\n defaultValue={defaultSelectedKey}\n form={form}\n id={id}\n inputValue={controlledInputValue}\n isDisabled={interactionDisabled}\n isInvalid={isInvalid}\n isReadOnly={readOnly}\n isRequired={required}\n menuTrigger=\"input\"\n name={submittedName}\n onInputChange={handleInputChange}\n onChange={handleSelectionChange}\n value={selectedKey}\n validationBehavior=\"aria\"\n >\n <FieldLabel label={label} loading={loading} />\n <AriaGroup\n className={joinClassNames(\n variants.base.group,\n loading && variants.state.loadingGroup,\n readOnly && variants.state.readOnlyGroup,\n )}\n isDisabled={interactionDisabled}\n isInvalid={isInvalid}\n isReadOnly={readOnly}\n ref={groupRef}\n >\n <AriaInput\n aria-busy={loading || undefined}\n aria-describedby={supportingIds}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n className={joinClassNames(\n variants.base.input,\n loading && variants.state.loadingInput,\n )}\n form={form}\n placeholder={placeholder}\n readOnly={readOnly || undefined}\n />\n <AriaButton\n aria-describedby={supportingIds}\n className={joinClassNames(\n variants.base.trigger,\n loading && variants.state.loadingTrigger,\n )}\n >\n <Icon name=\"expand\" size=\"sm\" />\n </AriaButton>\n {loading && (\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </AriaGroup>\n <ComboBoxPopover\n allowsCustomValue={allowsCustomValue}\n hasSuggestions={decoratedItems.length > 0}\n isDisabled={interactionDisabled}\n isReadOnly={readOnly}\n items={decoratedItems}\n triggerRef={groupRef}\n />\n <FieldSupportingContent\n description={visibleDescription}\n descriptionId={descriptionId}\n error={visibleError}\n errorId={errorId}\n loading={loading}\n />\n </AriaComboBox>\n );\n}\n\nexport function ComboBox<T>(props: Readonly<ComboBoxProps<T>>) {\n return <ComboBoxBase props={props} />;\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutElement } from '../layout.types';\n\nconst variants = {\n base: {\n container:\n 'breeze:mx-auto breeze:inline-size-full breeze:min-inline-size-0',\n },\n compound: {},\n size: {\n page: 'breeze:max-inline-breeze-page',\n prose: 'breeze:max-inline-breeze-prose',\n read: 'breeze:max-inline-breeze-read',\n },\n state: {\n padded:\n 'breeze:ps-breeze-4 breeze:pe-breeze-4 breeze:breeze-md:ps-breeze-7 breeze:breeze-md:pe-breeze-7',\n },\n variant: {},\n} as const;\n\nexport type ContainerWidth = keyof typeof variants.size;\n\nexport interface ContainerProps {\n /** Names the content boundary when its visible content does not provide a label. */\n 'aria-label'?: string;\n /** Content constrained by the container. */\n children: ReactNode;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Adds responsive inline page gutters. Defaults to `true`. */\n padded?: boolean;\n /** Selects the maximum content measure. Defaults to `page`. */\n width?: ContainerWidth;\n}\n\n/**\n * Centres content within a named Breeze reading or page measure.\n *\n * @summary A responsive, token-constrained content container.\n */\nexport function Container({\n 'aria-label': ariaLabel,\n children,\n element = 'div',\n padded = true,\n width = 'page',\n}: Readonly<ContainerProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.container,\n variants.size[width],\n padded && variants.state.padded,\n ]\n .filter(Boolean)\n .join(' '),\n role,\n },\n children,\n );\n}\n","import { parseDate } from '@internationalized/date';\nimport type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\n\nconst variants = {\n base: {\n text: 'breeze:m-0 breeze:font-breeze-sans',\n },\n compound: {},\n size: {},\n state: {\n aligned: 'breeze:block breeze:inline-size-full',\n inlineLoading: 'breeze:inline-block',\n numeric: 'breeze:tabular-nums breeze:tracking-breeze-tighter',\n truncate:\n 'breeze:block breeze:min-inline-size-0 breeze:inline-size-full breeze:overflow-hidden breeze:text-ellipsis breeze:whitespace-nowrap',\n },\n variant: {\n align: {\n center: 'breeze:text-center',\n end: 'breeze:text-end',\n start: 'breeze:text-start',\n },\n role: {\n body: 'breeze:text-breeze-sm breeze:font-normal breeze:leading-breeze-snug',\n caption:\n 'breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug',\n heading:\n 'breeze:text-breeze-2xl breeze:font-semibold breeze:leading-breeze-tight',\n label:\n 'breeze:text-breeze-xs breeze:font-medium breeze:leading-breeze-snug',\n micro:\n 'breeze:text-breeze-2xs breeze:font-bold breeze:uppercase breeze:leading-breeze-snug breeze:tracking-breeze-caps',\n money:\n 'breeze:text-breeze-4xl breeze:font-semibold breeze:leading-breeze-tight breeze:tracking-breeze-tightest breeze:tabular-nums',\n title:\n 'breeze:text-breeze-md breeze:font-semibold breeze:leading-breeze-snug',\n },\n tone: {\n brand: 'breeze:text-breeze-brand-text',\n danger: 'breeze:text-breeze-danger',\n default: 'breeze:text-breeze-ink',\n muted: 'breeze:text-breeze-ink-3',\n positive: 'breeze:text-breeze-pos',\n secondary: 'breeze:text-breeze-ink-2',\n warning: 'breeze:text-breeze-warn',\n },\n },\n} as const;\n\nexport type TypographyAlign = keyof typeof variants.variant.align;\nexport type TypographyElement =\n | 'div'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'p'\n | 'span';\n/** An ISO 8601 calendar date without a time or time zone. */\nexport type IsoCalendarDate = `${number}-${number}-${number}`;\nexport type TypographyVariant = keyof typeof variants.variant.role;\nexport type TypographyTone = keyof typeof variants.variant.tone;\n\ninterface TypographyBaseProps {\n /** Provides expanded screen-reader text or names rich content. */\n 'aria-label'?: string;\n /** Aligns text along the inline axis. Numeric content defaults to `end`. */\n align?: TypographyAlign;\n /** Overrides the semantic HTML element selected by the text role. */\n element?: TypographyElement;\n /** Sets the rendered element's HTML `id`. */\n id?: string;\n /** Applies tabular numerals, logical end alignment and figure tracking. */\n numeric?: boolean;\n /** Selects the semantic text colour. Defaults to `default`. */\n tone?: TypographyTone;\n /** Truncates a single line with an ellipsis when space is constrained. */\n truncate?: boolean;\n}\n\ninterface CurrencyTypographyContent extends TypographyBaseProps {\n /** Unavailable when displaying a formatted currency value. */\n children?: never;\n /** ISO 4217 currency code used for locale-aware formatting. */\n currency: string;\n /** Unavailable when formatting currency. */\n dateStyle?: never;\n /** Formats `value` as locale-aware currency. */\n format: 'currency';\n /** Controls whether the formatted amount displays its sign. Defaults to `auto`. */\n sign?: 'always' | 'auto' | 'never';\n /** Uses the dedicated money text role required for currency formatting. */\n variant: 'money';\n}\n\ninterface DateTypographyContent extends TypographyBaseProps {\n /** Unavailable when displaying a formatted date value. */\n children?: never;\n /** Unavailable when formatting a date. */\n currency?: never;\n /** Selects the locale-aware date verbosity. Defaults to `long`. */\n dateStyle?: 'full' | 'long' | 'medium' | 'short';\n /** Formats `value` as a locale-aware calendar date. */\n format: 'date';\n /** Unavailable when formatting a date. */\n sign?: never;\n /** Selects the visual and typographic text role. Defaults to `body`. */\n variant?: Exclude<TypographyVariant, 'money'>;\n}\n\ninterface TextTypographyContent extends TypographyBaseProps {\n /** Unavailable when displaying text content. */\n currency?: never;\n /** Unavailable when displaying text content. */\n dateStyle?: never;\n /** Omit to display `children` without value formatting. */\n format?: never;\n /** Unavailable when displaying text content. */\n sign?: never;\n /** Unavailable when displaying text content. */\n value?: never;\n /** Selects the visual and typographic text role. Defaults to `body`. */\n variant?: Exclude<TypographyVariant, 'money'>;\n}\n\nexport type TypographyProps =\n | (CurrencyTypographyContent &\n (\n | {\n /** Replaces the formatted value with a loading placeholder. */\n loading: true;\n /** Numeric amount to format; optional while loading. */\n value?: number;\n }\n | {\n /** Displays the formatted value instead of a loading placeholder. */\n loading?: false;\n /** Numeric amount to format as currency. */\n value: number;\n }\n ))\n | (DateTypographyContent &\n (\n | {\n /** Replaces the formatted value with a loading placeholder. */\n loading: true;\n /** ISO calendar date to format; optional while loading. */\n value?: IsoCalendarDate;\n }\n | {\n /** Displays the formatted value instead of a loading placeholder. */\n loading?: false;\n /** ISO calendar date to format for the provider locale. */\n value: IsoCalendarDate;\n }\n ))\n | (TextTypographyContent &\n (\n | {\n /** Text or inline content; optional while loading. */\n children?: ReactNode;\n /** Replaces the content with a loading placeholder. */\n loading: true;\n }\n | {\n /** Text or inline content to display. */\n children: ReactNode;\n /** Displays the content instead of a loading placeholder. */\n loading?: false;\n }\n ));\n\nfunction getDefaultElement(variant: TypographyVariant): TypographyElement {\n if (variant === 'heading') {\n return 'h2';\n }\n\n if (variant === 'title') {\n return 'h3';\n }\n\n if (variant === 'body') {\n return 'p';\n }\n\n return 'span';\n}\n\nfunction formatCurrency(\n value: number,\n currency: string,\n locale: string,\n sign: CurrencyTypographyContent['sign'],\n): string {\n let parts: Intl.NumberFormatPart[];\n\n try {\n parts = new Intl.NumberFormat(locale, {\n currency,\n signDisplay: sign ?? 'auto',\n style: 'currency',\n }).formatToParts(value);\n } catch (error) {\n if (!(error instanceof RangeError)) {\n throw error;\n }\n\n parts = new Intl.NumberFormat(locale, {\n signDisplay: sign ?? 'auto',\n }).formatToParts(value);\n }\n\n return parts\n .map((part) => (part.type === 'minusSign' ? '−' : part.value))\n .join('');\n}\n\nfunction formatDate(\n value: string,\n locale: string,\n dateStyle: DateTypographyContent['dateStyle'],\n): string {\n let date: Date;\n\n try {\n date = parseDate(value).toDate('UTC');\n } catch {\n return value;\n }\n\n return new Intl.DateTimeFormat(locale, {\n dateStyle: dateStyle ?? 'long',\n timeZone: 'UTC',\n }).format(date);\n}\n\nfunction getTypographyContent(\n props: Readonly<TypographyProps>,\n locale: string,\n loadingMessage: string,\n): ReactNode {\n if (props.loading) {\n return <Skeleton blockSize=\"1lh\" inlineSize=\"8em\" label={loadingMessage} />;\n }\n\n if (props.format === 'currency') {\n return formatCurrency(\n props.value,\n props.currency,\n locale,\n props.sign ?? 'auto',\n );\n }\n\n if (props.format === 'date') {\n return formatDate(props.value, locale, props.dateStyle);\n }\n\n return props.children;\n}\n\n/**\n * Applies Breeze text roles and locale-aware money or calendar-date formatting.\n *\n * @summary Semantic interface text with typography and formatting kept together.\n */\nexport function Typography(props: Readonly<TypographyProps>) {\n const { locale, messages } = useBreezeContext();\n const {\n 'aria-label': ariaLabel,\n align,\n children,\n element: requestedElement,\n format,\n id,\n loading = false,\n numeric = false,\n tone = 'default',\n truncate = false,\n variant = 'body',\n } = props;\n const element = requestedElement ?? getDefaultElement(variant);\n const accessibleLabel = ariaLabel?.trim() || undefined;\n const resolvedAlign =\n align ?? (variant === 'money' || numeric ? 'end' : 'start');\n const needsAlignmentBox =\n align !== undefined || variant === 'money' || numeric;\n let content = getTypographyContent(props, locale, messages.loading);\n\n const canReplaceWithAccessibleLabel =\n format !== undefined ||\n typeof children === 'string' ||\n typeof children === 'number';\n const usesNativeLabel =\n !loading &&\n accessibleLabel !== undefined &&\n !canReplaceWithAccessibleLabel &&\n ['h1', 'h2', 'h3', 'h4'].includes(element);\n const usesLabelledGroup =\n !loading &&\n accessibleLabel !== undefined &&\n !canReplaceWithAccessibleLabel &&\n !usesNativeLabel;\n\n if (\n !loading &&\n accessibleLabel !== undefined &&\n canReplaceWithAccessibleLabel\n ) {\n content = (\n <>\n <span aria-hidden=\"true\">{content}</span>\n <VisuallyHidden>{accessibleLabel}</VisuallyHidden>\n </>\n );\n }\n\n return createElement(\n element,\n {\n 'aria-busy': loading || undefined,\n 'aria-label':\n usesLabelledGroup || usesNativeLabel ? accessibleLabel : undefined,\n className: [\n variants.base.text,\n variants.variant.role[variant],\n variants.variant.tone[tone],\n variants.variant.align[resolvedAlign],\n needsAlignmentBox && variants.state.aligned,\n loading &&\n element === 'span' &&\n !needsAlignmentBox &&\n variants.state.inlineLoading,\n numeric && variant !== 'money' && variants.state.numeric,\n truncate && variants.state.truncate,\n ]\n .filter(Boolean)\n .join(' '),\n id,\n lang: locale,\n role: usesLabelledGroup ? 'group' : undefined,\n },\n content,\n );\n}\n","import type { CalendarDate } from '@internationalized/date';\nimport type { RefObject } from 'react';\nimport {\n createElement,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { Dialog as AriaDialog } from 'react-aria-components/Dialog';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { CalendarSurface, parseCalendarDate } from '../Calendar/Calendar';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport type { IsoCalendarDate } from '../Typography/Typography';\nimport { Typography } from '../Typography/Typography';\n\nconst datePickerVariants = {\n base: {\n popover:\n 'breeze:!inline-size-[360px] breeze:max-inline-size-[calc(100vw_-_24px)] breeze:p-breeze-3 breeze:any-pointer-coarse:!p-0 breeze-date-picker-popover',\n trigger:\n 'breeze:flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:items-center breeze:justify-between breeze:gap-breeze-3 breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[hovered]:border-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[invalid]:border-breeze-danger breeze:disabled:cursor-not-allowed breeze:disabled:bg-breeze-sunken breeze:disabled:opacity-60',\n value: 'breeze:min-inline-size-0 breeze:flex-1 breeze:text-start',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface DatePickerCommonProps {\n /** Focuses the trigger when it first becomes enabled. */\n autoFocus?: boolean;\n /** Prevents opening and selecting. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the trigger. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the submitted value with a form outside its ancestor tree. */\n form?: string;\n /** Sets the trigger id used by the field label. */\n id?: string;\n /** Accessible field label. */\n label: string;\n /** Replaces the field with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Submitted field name. */\n name?: string;\n /** Temporary text shown before a date is selected. */\n placeholder?: string;\n /** Marks the field as required. Defaults to `true`. */\n required?: boolean;\n}\n\ninterface ControlledDatePickerProps {\n /** Current selected ISO calendar date, or `null` when empty. */\n value: IsoCalendarDate | null;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledDatePickerProps {\n /** Initial selected ISO calendar date. */\n defaultValue?: IsoCalendarDate;\n /** Reports the selected ISO calendar date without exposing a DOM event. */\n onChange?: (value: IsoCalendarDate) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled ISO date selection. */\nexport type DatePickerProps = DatePickerCommonProps &\n (ControlledDatePickerProps | UncontrolledDatePickerProps);\n\nfunction DatePickerTriggerValue({\n placeholder,\n placeholderLocale,\n value,\n valueId,\n}: Readonly<{\n placeholder: string;\n placeholderLocale?: string;\n value?: IsoCalendarDate | null;\n valueId: string;\n}>) {\n return (\n <span className={datePickerVariants.base.value} id={valueId}>\n {value ? (\n <Typography element=\"span\" format=\"date\" value={value} />\n ) : (\n <span lang={placeholderLocale}>{placeholder}</span>\n )}\n </span>\n );\n}\n\nfunction getNextTriggerScrollTop(\n trigger: HTMLElement,\n ancestor: HTMLElement,\n requiredSpace: number,\n viewportBottom: number,\n): number | undefined {\n const triggerTop = trigger.getBoundingClientRect().top;\n const { top: ancestorTop } = ancestor.getBoundingClientRect();\n const contentTop = ancestorTop + ancestor.clientTop;\n const visibleTop = Math.max(contentTop, 0);\n const visibleBottom = Math.min(\n contentTop + ancestor.clientHeight,\n viewportBottom,\n );\n\n if (visibleBottom <= visibleTop) return undefined;\n\n const targetTop = Math.max(visibleTop + 8, visibleBottom - requiredSpace);\n let scrollDelta = 0;\n\n if (triggerTop < visibleTop + 8) {\n scrollDelta = triggerTop - (visibleTop + 8);\n } else if (triggerTop > targetTop) {\n scrollDelta = triggerTop - targetTop;\n }\n\n const maxScrollTop = ancestor.scrollHeight - ancestor.clientHeight;\n const nextScrollTop = Math.round(\n Math.max(0, Math.min(maxScrollTop, ancestor.scrollTop + scrollDelta)),\n );\n\n return nextScrollTop === ancestor.scrollTop ? undefined : nextScrollTop;\n}\n\nfunction scrollTriggerIntoView(trigger: HTMLElement): boolean {\n const requiredSpace = 400;\n const viewportBottom = trigger.ownerDocument.documentElement.clientHeight;\n let didScroll = false;\n\n for (\n let ancestor = trigger.parentElement;\n ancestor !== null;\n ancestor = ancestor.parentElement\n ) {\n const { overflowY } = getComputedStyle(ancestor);\n\n if (\n ['auto', 'scroll'].includes(overflowY) &&\n ancestor.scrollHeight > ancestor.clientHeight\n ) {\n const nextScrollTop = getNextTriggerScrollTop(\n trigger,\n ancestor,\n requiredSpace,\n viewportBottom,\n );\n\n if (nextScrollTop !== undefined) {\n ancestor.scrollTop = nextScrollTop;\n didScroll = true;\n }\n }\n }\n\n return didScroll;\n}\n\nfunction DatePickerPopover({\n calendarKey,\n dialogId,\n disabled,\n isOpen,\n label,\n onChange,\n onOpenChange,\n triggerRef,\n value,\n}: Readonly<{\n calendarKey: number;\n dialogId: string;\n disabled: boolean;\n isOpen: boolean;\n label: string;\n onChange: (date: CalendarDate | null) => void;\n onOpenChange: (open: boolean) => void;\n triggerRef: RefObject<HTMLButtonElement | null>;\n value: IsoCalendarDate | null | undefined;\n}>) {\n const dialogRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!isOpen) return undefined;\n\n const dialog = dialogRef.current;\n const popover = dialog?.closest<HTMLElement>(\n '[data-breeze-overlay=\"popover\"]',\n );\n\n if (!dialog || !popover) return undefined;\n\n const focusRovingDate = () => {\n if (\n popover.hasAttribute('inert') ||\n popover.dataset.breezeInteractive !== 'true'\n ) {\n return false;\n }\n\n const document = dialog.ownerDocument;\n const { activeElement } = document;\n\n if (\n activeElement === triggerRef.current ||\n activeElement === document.body ||\n activeElement === document.documentElement\n ) {\n dialog\n .querySelector<HTMLElement>('[role=\"button\"][tabindex=\"0\"]')\n ?.focus();\n }\n\n return true;\n };\n\n const observer = new MutationObserver(() => {\n if (focusRovingDate()) observer.disconnect();\n });\n\n observer.observe(popover, {\n attributeFilter: ['data-breeze-interactive', 'inert'],\n attributes: true,\n });\n\n if (focusRovingDate()) observer.disconnect();\n\n return () => observer.disconnect();\n }, [isOpen, triggerRef]);\n\n return (\n <CollectionPopover\n className={datePickerVariants.base.popover}\n containerPadding={4}\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n triggerRef={triggerRef}\n >\n <AriaDialog aria-label={label} id={dialogId} ref={dialogRef}>\n <CalendarSurface\n autoFocus={isOpen}\n key={calendarKey}\n disabled={disabled}\n label={label}\n onChange={onChange}\n value={value == null ? null : parseCalendarDate(value)}\n />\n </AriaDialog>\n </CollectionPopover>\n );\n}\n\n/**\n * Renders a required date field with a locale-formatted trigger and calendar.\n *\n * @summary Single-date field with ISO values and a calendar popover.\n */\nexport function DatePicker({\n autoFocus = false,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n required = true,\n value,\n}: Readonly<DatePickerProps>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const placeholderText = placeholder ?? messages.selectDate;\n const placeholderLocale =\n placeholder === undefined ? getMessageLocale('selectDate') : undefined;\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const isInvalid = !loading && visibleError !== undefined;\n const fieldId = useId();\n const labelId = `${fieldId}-label`;\n const valueId = `${fieldId}-value`;\n const dialogId = `${fieldId}-dialog`;\n const descriptionId = visibleDescription\n ? `${fieldId}-description`\n : undefined;\n const errorId = visibleError ? `${fieldId}-error` : undefined;\n const requiredId = required ? `${fieldId}-required` : undefined;\n const triggerId = id ?? `${fieldId}-trigger`;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const hasAutoFocused = useRef(false);\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [isOpen, setIsOpen] = useState(false);\n const [calendarKey, setCalendarKey] = useState(0);\n const [fieldsetDisabled, setFieldsetDisabled] = useState(false);\n const selectedValue = value === undefined ? uncontrolledValue : value;\n const effectiveDisabled = interactionDisabled || fieldsetDisabled;\n const describedBy =\n [descriptionId, !loading ? errorId : undefined, requiredId]\n .filter(Boolean)\n .join(' ') || undefined;\n\n useLayoutEffect(() => {\n const trigger = triggerRef.current;\n if (!trigger) return undefined;\n\n const updateFieldsetDisabled = () => {\n setFieldsetDisabled(!interactionDisabled && trigger.matches(':disabled'));\n };\n\n updateFieldsetDisabled();\n\n const observer = new MutationObserver(updateFieldsetDisabled);\n\n for (\n let ancestor = trigger.parentElement;\n ancestor !== null;\n ancestor = ancestor.parentElement\n ) {\n if (ancestor.tagName === 'FIELDSET') {\n observer.observe(ancestor, {\n attributeFilter: ['disabled'],\n attributes: true,\n });\n }\n }\n\n return () => observer.disconnect();\n }, [interactionDisabled]);\n\n useEffect(() => {\n if (value !== undefined) return undefined;\n\n const handleReset = (event: Event) => {\n const formElement = triggerRef.current?.form;\n\n if (!formElement || event.target !== formElement) return;\n\n queueMicrotask(() => {\n if (!event.defaultPrevented) {\n setUncontrolledValue(defaultValue);\n }\n });\n };\n\n document.addEventListener('reset', handleReset, true);\n\n return () => document.removeEventListener('reset', handleReset, true);\n }, [defaultValue, value]);\n\n useEffect(() => {\n if (effectiveDisabled && isOpen) {\n setIsOpen(false);\n }\n }, [effectiveDisabled, isOpen]);\n\n useEffect(() => {\n if (!autoFocus || effectiveDisabled || hasAutoFocused.current) return;\n\n const trigger = triggerRef.current;\n\n if (!trigger || trigger.matches(':disabled')) return;\n\n trigger.focus();\n hasAutoFocused.current = trigger.ownerDocument.activeElement === trigger;\n }, [autoFocus, effectiveDisabled]);\n\n const visibleOpen = isOpen && !effectiveDisabled;\n const handleOpenChange = (open: boolean) => {\n if (\n open &&\n (effectiveDisabled || triggerRef.current?.matches(':disabled'))\n ) {\n return;\n }\n\n if (open && !isOpen) {\n setCalendarKey((currentKey) => currentKey + 1);\n }\n\n setIsOpen(open);\n };\n\n const handleTriggerPress = () => {\n if (visibleOpen) {\n handleOpenChange(false);\n return;\n }\n\n const trigger = triggerRef.current;\n\n if (!trigger || effectiveDisabled || trigger.matches(':disabled')) {\n return;\n }\n\n if (scrollTriggerIntoView(trigger)) {\n if (typeof requestAnimationFrame === 'undefined') {\n setTimeout(() => handleOpenChange(true), 0);\n } else {\n requestAnimationFrame(() => handleOpenChange(true));\n }\n\n return;\n }\n\n handleOpenChange(true);\n };\n const handleDateChange = (date: CalendarDate | null) => {\n if (\n !date ||\n effectiveDisabled ||\n triggerRef.current?.matches(':disabled')\n ) {\n return;\n }\n\n const nextValue = date.toString() as IsoCalendarDate;\n\n if (value === undefined) {\n setUncontrolledValue(nextValue);\n }\n\n onChange?.(nextValue);\n handleOpenChange(false);\n };\n\n return (\n <div\n className={fieldVariants.base.root}\n data-required={required || undefined}\n >\n <FieldLabel\n htmlFor={triggerId}\n id={labelId}\n label={label}\n loading={loading}\n onClick={() => triggerRef.current?.focus()}\n />\n <span className={fieldVariants.base.control}>\n <AriaButton\n className={joinClassNames(\n datePickerVariants.base.trigger,\n isInvalid && 'breeze:border-breeze-danger',\n loading && 'breeze:!opacity-0',\n )}\n isDisabled={interactionDisabled}\n onPress={handleTriggerPress}\n ref={triggerRef}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n 'aria-controls': visibleOpen ? dialogId : undefined,\n 'aria-describedby': describedBy,\n 'aria-errormessage': !loading ? errorId : undefined,\n 'aria-expanded': visibleOpen,\n 'aria-haspopup': 'dialog',\n 'aria-invalid': isInvalid || undefined,\n 'aria-label': loading ? label : undefined,\n 'aria-labelledby': !loading ? `${labelId} ${valueId}` : undefined,\n 'data-invalid': isInvalid || undefined,\n form,\n id: triggerId,\n type: 'button',\n })\n }\n >\n <DatePickerTriggerValue\n placeholder={placeholderText}\n placeholderLocale={placeholderLocale}\n value={selectedValue}\n valueId={valueId}\n />\n <Icon name=\"calendar\" size=\"sm\" />\n </AriaButton>\n {loading && (\n <span className={fieldVariants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </span>\n {name && (\n <input\n disabled={interactionDisabled}\n form={form}\n name={name}\n type=\"hidden\"\n value={selectedValue ?? ''}\n />\n )}\n {required && (\n <span\n className=\"breeze:sr-only\"\n id={requiredId}\n lang={getMessageLocale('required')}\n >\n {messages.required}\n </span>\n )}\n <DatePickerPopover\n calendarKey={calendarKey}\n dialogId={dialogId}\n disabled={effectiveDisabled}\n isOpen={visibleOpen}\n label={label}\n onChange={handleDateChange}\n onOpenChange={handleOpenChange}\n triggerRef={triggerRef}\n value={selectedValue}\n />\n <FieldSupportingContent\n description={visibleDescription}\n descriptionId={descriptionId}\n loading={loading}\n />\n {visibleError && (\n <p\n aria-hidden={loading || undefined}\n className={fieldVariants.base.error}\n id={errorId}\n >\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n visibleError\n )}\n </p>\n )}\n </div>\n );\n}\n","import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Dialog as AriaDialog } from 'react-aria-components/Dialog';\nimport { Modal, ModalOverlay } from 'react-aria-components/Modal';\nimport { Popover as AriaPopover } from 'react-aria-components/Popover';\nimport { Button } from '../primitives/Button/Button';\nimport { useBreezeContext } from '../provider/BreezeContext';\nimport type { OverlayKind, OverlayProps } from './overlay.types';\nimport { useOverlayPortal } from './OverlayProvider';\nimport { ParentOverlayContext, useOverlayLayer } from './OverlayStack';\n\nconst variants = {\n base: {\n content: 'breeze-overlay-content',\n header: 'breeze-overlay-header',\n title: 'breeze-overlay-title',\n },\n compound: {},\n size: {},\n state: {},\n variant: {\n dialog: 'breeze-dialog',\n drawer: 'breeze-drawer',\n fullscreen: 'breeze-fullscreen',\n popover: 'breeze-popover',\n },\n} as const;\n\nconst triggerBoundaryError =\n 'Breeze overlay triggers and portal containers must belong to the current document and light DOM.';\n\nfunction isNode(value: EventTarget | null): value is Node {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).contains === 'function'\n );\n}\n\nfunction hasOverlayMarker(element: Element) {\n return (\n (element as Element & { dataset?: DOMStringMap }).dataset?.breezeOverlay !==\n undefined\n );\n}\n\nfunction OverlaySurface({\n children,\n defaultOpen = false,\n dismissible = true,\n kind,\n onOpenChange,\n open: controlledOpen,\n placement = 'bottom',\n title,\n trigger,\n}: Readonly<\n Omit<OverlayProps, 'open' | 'defaultOpen' | 'onOpenChange'> & {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n kind: OverlayKind;\n placement?: 'top' | 'bottom' | 'start' | 'end';\n }\n>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const nonModal = kind === 'popover' || kind === 'fullscreen';\n const host = useOverlayPortal();\n const parent = useContext(ParentOverlayContext);\n const [portalReady, setPortalReady] = useState(parent === null);\n // Mount nested portals after the parent's modality effects. Otherwise a\n // default-open parent can aria-hide its already mounted child portal.\n useEffect(() => setPortalReady(true), []);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const requestedOpen = controlledOpen ?? uncontrolledOpen;\n const parentOpen = parent?.open ?? true;\n const open = requestedOpen && parentOpen;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLElement | null>(null);\n const [surfaceMounted, setSurfaceMounted] = useState(false);\n const refocusingRef = useRef(false);\n const refocusTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const pointerDismissTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const pointerDownTargetRef = useRef<Node | null>(null);\n const blurDismissTargetRef = useRef<Node | null>(null);\n const parentCloseReportedRef = useRef(false);\n useLayoutEffect(() => {\n if (\n host &&\n triggerRef.current &&\n (triggerRef.current.ownerDocument !== document ||\n triggerRef.current.getRootNode() !== document ||\n host.ownerDocument !== document ||\n host.getRootNode() !== document)\n ) {\n throw new Error(triggerBoundaryError);\n }\n }, [host]);\n // Full-screen surfaces belong to the viewport, not the sheet's scrollable\n // trigger. Keep the actual trigger separately for focus restoration.\n const positionRef = useMemo(\n () => (kind === 'fullscreen' ? { current: host } : triggerRef),\n [host, kind],\n );\n const layer = useOverlayLayer(\n kind,\n open && portalReady && host !== null,\n open || surfaceMounted,\n );\n const changeOpen = useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && !parentOpen) {\n if (parentCloseReportedRef.current) return;\n if (requestedOpen) parentCloseReportedRef.current = true;\n }\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [controlledOpen, onOpenChange, parentOpen, requestedOpen],\n );\n\n useEffect(() => {\n if (parentOpen) {\n parentCloseReportedRef.current = false;\n } else if (requestedOpen) {\n changeOpen(false);\n }\n }, [changeOpen, parentOpen, requestedOpen]);\n\n useEffect(() => {\n if (kind !== 'popover' || !open || !dismissible || !layer.topmost || !host)\n return undefined;\n // RAC non-modal popovers close on blur, but not on outside clicks. Wait for\n // click when available, falling back after a completed outside pointerup.\n const clearPointerDismissTimer = () => {\n if (pointerDismissTimerRef.current !== null) {\n clearTimeout(pointerDismissTimerRef.current);\n pointerDismissTimerRef.current = null;\n }\n };\n const sameTarget = (left: Node | null, right: Node | null) =>\n !!left &&\n !!right &&\n (left === right || left.contains(right) || right.contains(left));\n const isPrimaryPointer = (event: PointerEvent) => event.button === 0;\n const isOutside = (target: Node | null) =>\n isNode(target) &&\n !popoverRef.current?.contains(target) &&\n !triggerRef.current?.contains(target);\n const onPointerDown = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n // A blur caused by a previous keyboard interaction must not suppress a\n // later pointer dismissal.\n clearPointerDismissTimer();\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = isNode(event.target) ? event.target : null;\n };\n const onPointerUp = (event: PointerEvent) => {\n if (!isPrimaryPointer(event)) return;\n const pointerDownTarget = pointerDownTargetRef.current;\n const pointerUpTarget = isNode(event.target) ? event.target : null;\n if (!isOutside(pointerDownTarget) || !isOutside(pointerUpTarget)) return;\n clearPointerDismissTimer();\n pointerDismissTimerRef.current = setTimeout(() => {\n pointerDismissTimerRef.current = null;\n const blurTarget = blurDismissTargetRef.current;\n const pointerTarget = pointerDownTargetRef.current;\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n if (\n sameTarget(blurTarget, pointerUpTarget) &&\n sameTarget(blurTarget, pointerTarget)\n ) {\n return;\n }\n changeOpen(false);\n }, 0);\n };\n const onPointerCancel = () => {\n clearPointerDismissTimer();\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n };\n const onOutsideClick = (event: MouseEvent) => {\n const target = isNode(event.target) ? event.target : null;\n clearPointerDismissTimer();\n if (isOutside(target)) {\n const blurTarget = blurDismissTargetRef.current;\n const pointerTarget = pointerDownTargetRef.current;\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n if (\n sameTarget(blurTarget, target) &&\n sameTarget(blurTarget, pointerTarget)\n ) {\n return;\n }\n changeOpen(false);\n }\n };\n host.ownerDocument.addEventListener('pointerdown', onPointerDown, true);\n host.ownerDocument.addEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.addEventListener('pointercancel', onPointerCancel, true);\n host.ownerDocument.addEventListener('click', onOutsideClick, true);\n return () => {\n clearPointerDismissTimer();\n host.ownerDocument.removeEventListener(\n 'pointerdown',\n onPointerDown,\n true,\n );\n host.ownerDocument.removeEventListener('pointerup', onPointerUp, true);\n host.ownerDocument.removeEventListener(\n 'pointercancel',\n onPointerCancel,\n true,\n );\n host.ownerDocument.removeEventListener('click', onOutsideClick, true);\n blurDismissTargetRef.current = null;\n pointerDownTargetRef.current = null;\n };\n }, [changeOpen, dismissible, host, kind, layer.topmost, open]);\n\n const restoreParentFocus = parent?.restoreFocus;\n const parentId = parent?.id;\n const restoreFocus = useCallback(() => {\n const target = triggerRef.current;\n const document = host?.ownerDocument;\n const focused = document?.activeElement;\n if (!document || !host) return;\n const parentSurface = parentId ? document.getElementById(parentId) : null;\n const focusLost =\n focused === document.body ||\n focused === parentSurface ||\n !!focused?.closest('[data-exiting]');\n if (!focusLost) return;\n if (!target?.isConnected) {\n restoreParentFocus?.();\n return;\n }\n const topmost = host.querySelector('[data-breeze-topmost=\"true\"]');\n if (\n (!topmost || topmost.contains(target)) &&\n !target.closest('[inert], [aria-hidden=\"true\"]')\n ) {\n target.focus({ preventScroll: true });\n }\n }, [host, parentId, restoreParentFocus]);\n\n const clearRefocusTimer = useCallback(() => {\n if (refocusTimerRef.current !== null) {\n clearTimeout(refocusTimerRef.current);\n refocusTimerRef.current = null;\n }\n }, []);\n const focusSurface = useCallback(\n (element: HTMLElement) => {\n queueMicrotask(() => {\n if (\n !element.isConnected ||\n element.closest('[inert], [data-exiting]')\n ) {\n return;\n }\n clearRefocusTimer();\n element.focus({ preventScroll: true });\n refocusTimerRef.current = setTimeout(() => {\n const { ownerDocument } = element;\n const { activeElement: focused } = ownerDocument;\n if (\n element.isConnected &&\n !element.closest('[inert], [data-exiting]') &&\n (focused === element || focused === ownerDocument.body)\n ) {\n refocusingRef.current = true;\n element.blur();\n element.focus({ preventScroll: true });\n refocusingRef.current = false;\n }\n refocusTimerRef.current = null;\n }, 500);\n });\n },\n [clearRefocusTimer],\n );\n const previousOpenRef = useRef(open);\n useEffect(() => {\n const wasOpen = previousOpenRef.current;\n previousOpenRef.current = open;\n if (!nonModal || !open || wasOpen || !contentRef.current) return;\n focusSurface(contentRef.current);\n }, [focusSurface, nonModal, open]);\n\n const surfaceRef = useCallback(\n (element: HTMLElement | null) => {\n contentRef.current = element;\n const cleanup = () => {\n clearRefocusTimer();\n contentRef.current = null;\n setSurfaceMounted(false);\n requestAnimationFrame(restoreFocus);\n };\n if (!element) {\n cleanup();\n return undefined;\n }\n setSurfaceMounted(true);\n if (nonModal) focusSurface(element);\n // React Aria restores ordinary closes. Nested simultaneous exits can leave\n // focus on body; repair only that gap after its focus-scope cleanup runs.\n return cleanup;\n },\n [clearRefocusTimer, focusSurface, nonModal, restoreFocus],\n );\n\n const parentContext = useMemo(\n () => ({ id: layer.id, open, restoreFocus }),\n [layer.id, open, restoreFocus],\n );\n const body = (\n <>\n <div className={variants.base.header}>\n <h2 className={variants.base.title}>{title}</h2>\n <span lang={getMessageLocale('close')}>\n <Button onAction={() => changeOpen(false)} variant=\"quiet\">\n {messages.close}\n </Button>\n </span>\n </div>\n {children}\n </>\n );\n const content = (\n <ParentOverlayContext value={parentContext}>\n {nonModal ? (\n <section\n aria-label={title}\n className={variants.base.content}\n id={layer.id}\n onBlur={(event) => {\n if (refocusingRef.current) {\n event.stopPropagation();\n return;\n }\n const { relatedTarget } = event;\n if (\n kind === 'popover' &&\n dismissible &&\n layer.topmost &&\n isNode(relatedTarget) &&\n !event.currentTarget.contains(relatedTarget) &&\n !triggerRef.current?.contains(relatedTarget)\n ) {\n blurDismissTargetRef.current = relatedTarget;\n }\n }}\n ref={surfaceRef}\n role=\"dialog\"\n tabIndex={-1}\n >\n {body}\n </section>\n ) : (\n <AriaDialog\n aria-label={title}\n className={variants.base.content}\n id={layer.id}\n ref={surfaceRef}\n >\n {body}\n </AriaDialog>\n )}\n </ParentOverlayContext>\n );\n\n return (\n <>\n <Button\n aria-controls={open ? layer.id : undefined}\n aria-expanded={open}\n aria-haspopup=\"dialog\"\n onAction={() => changeOpen(nonModal ? !open : true)}\n ref={triggerRef}\n >\n {trigger}\n </Button>\n {host &&\n portalReady &&\n (nonModal ? (\n <AriaPopover\n className={variants.variant[kind]}\n data-breeze-overlay={kind}\n data-breeze-topmost={layer.topmost}\n data-breeze-interactive={layer.interactive}\n inert={!layer.interactive}\n isNonModal\n isOpen={open}\n isKeyboardDismissDisabled={!dismissible || !layer.topmost}\n onOpenChange={changeOpen}\n placement={placement}\n ref={popoverRef}\n // Leave the trigger in the blur scope so its action can toggle the popover.\n shouldCloseOnInteractOutside={(element) =>\n kind === 'popover' &&\n dismissible &&\n layer.topmost &&\n !triggerRef.current?.contains(element)\n }\n style={{ zIndex: layer.zIndex }}\n triggerRef={positionRef}\n >\n {content}\n </AriaPopover>\n ) : (\n <ModalOverlay\n className=\"breeze-overlay-backdrop\"\n data-breeze-overlay={kind}\n data-breeze-scrim={layer.scrim}\n data-breeze-topmost={layer.topmost}\n data-breeze-interactive={layer.interactive}\n inert={!layer.interactive}\n isDismissable={dismissible && layer.topmost}\n isKeyboardDismissDisabled={!dismissible || !layer.topmost}\n isOpen={open}\n onOpenChange={changeOpen}\n shouldCloseOnInteractOutside={(element) =>\n layer.topmost && hasOverlayMarker(element)\n }\n style={{ zIndex: layer.zIndex }}\n >\n <Modal className={variants.variant[kind]}>{content}</Modal>\n </ModalOverlay>\n ))}\n </>\n );\n}\n\nexport default OverlaySurface;\n","import type { OverlayProps } from '../../overlays/overlay.types';\nimport OverlaySurface from '../../overlays/OverlaySurface';\n\nexport type DialogProps = OverlayProps;\n\n/**\n * Opens a labelled dialog with library-owned nesting and motion.\n * @summary A labelled dialog surface with a trigger and close action.\n */\nexport function Dialog({\n children,\n defaultOpen,\n dismissible,\n onOpenChange,\n open,\n title,\n trigger,\n}: Readonly<DialogProps>) {\n return (\n <OverlaySurface\n defaultOpen={defaultOpen}\n dismissible={dismissible}\n onOpenChange={onOpenChange}\n open={open}\n title={title}\n trigger={trigger}\n kind=\"dialog\"\n >\n {children}\n </OverlaySurface>\n );\n}\n","import type { OverlayProps } from '../../overlays/overlay.types';\nimport OverlaySurface from '../../overlays/OverlaySurface';\n\nexport type DrawerProps = OverlayProps;\n\n/**\n * Opens a labelled drawer with library-owned nesting and motion.\n * @summary A labelled drawer surface with a trigger and close action.\n */\nexport function Drawer({\n children,\n defaultOpen,\n dismissible,\n onOpenChange,\n open,\n title,\n trigger,\n}: Readonly<DrawerProps>) {\n return (\n <OverlaySurface\n defaultOpen={defaultOpen}\n dismissible={dismissible}\n onOpenChange={onOpenChange}\n open={open}\n title={title}\n trigger={trigger}\n kind=\"drawer\"\n >\n {children}\n </OverlaySurface>\n );\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutElement, LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n grid: 'breeze:grid breeze:min-inline-size-0',\n },\n compound: {\n columns: {\n 1: {\n lg: 'breeze:grid-cols-1',\n md: 'breeze:grid-cols-1',\n none: 'breeze:grid-cols-1',\n sm: 'breeze:grid-cols-1',\n },\n 2: {\n lg: 'breeze:grid-cols-2 breeze:max-breeze-lg:grid-cols-1',\n md: 'breeze:grid-cols-2 breeze:max-breeze-md:grid-cols-1',\n none: 'breeze:grid-cols-2',\n sm: 'breeze:grid-cols-2 breeze:max-breeze-sm:grid-cols-1',\n },\n 3: {\n lg: 'breeze:grid-cols-3 breeze:max-breeze-lg:grid-cols-1',\n md: 'breeze:grid-cols-3 breeze:max-breeze-md:grid-cols-1',\n none: 'breeze:grid-cols-3',\n sm: 'breeze:grid-cols-3 breeze:max-breeze-sm:grid-cols-1',\n },\n },\n },\n size: {\n 0: 'breeze:gap-0',\n 1: 'breeze:gap-breeze-1',\n 2: 'breeze:gap-breeze-2',\n 3: 'breeze:gap-breeze-3',\n 4: 'breeze:gap-breeze-4',\n 5: 'breeze:gap-breeze-5',\n 6: 'breeze:gap-breeze-6',\n 7: 'breeze:gap-breeze-7',\n 8: 'breeze:gap-breeze-8',\n },\n state: {},\n variant: {},\n} as const;\n\nexport type GridColumns = 1 | 2 | 3;\nexport type GridCollapseBelow = 'lg' | 'md' | 'none' | 'sm';\n\nexport interface GridProps {\n /** Names the grid when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Items arranged in the grid. */\n children: ReactNode;\n /** Breakpoint below which multiple columns collapse to one. Defaults to `md`. */\n collapseBelow?: GridCollapseBelow;\n /** Number of equal-width columns. Defaults to `2`. */\n columns?: GridColumns;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Applies space between items from the Breeze spacing scale. Defaults to `4`. */\n gap?: LayoutGap;\n}\n\n/**\n * Arranges children in equal columns and can collapse at a Breeze breakpoint.\n *\n * @summary A constrained responsive grid primitive.\n */\nexport function Grid({\n 'aria-label': ariaLabel,\n children,\n collapseBelow = 'md',\n columns = 2,\n element = 'div',\n gap = 4,\n}: Readonly<GridProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.grid,\n variants.compound.columns[columns][collapseBelow],\n variants.size[gap],\n ].join(' '),\n role,\n },\n children,\n );\n}\n","import { Icon, type IconName } from '../Icon/Icon';\n\nconst variants = {\n base: {\n tile: 'breeze:inline-flex breeze:shrink-0 breeze:items-center breeze:justify-center',\n },\n compound: {},\n size: {\n lg: 'breeze:block-size-breeze-tap breeze:inline-size-breeze-tap',\n sm: 'breeze:block-size-breeze-7 breeze:inline-size-breeze-7',\n },\n state: {},\n variant: {\n shape: {\n circle: 'breeze:rounded-breeze-full',\n square: 'breeze:rounded-breeze-sm',\n },\n tone: {\n brand: 'breeze:bg-breeze-brand-soft breeze:text-breeze-brand-text',\n danger: 'breeze:bg-breeze-danger/10 breeze:text-breeze-danger',\n neutral: 'breeze:bg-breeze-sunken breeze:text-breeze-ink-2',\n positive: 'breeze:bg-breeze-pos-soft breeze:text-breeze-pos',\n warning: 'breeze:bg-breeze-warn-soft breeze:text-breeze-warn',\n },\n },\n} as const;\n\nexport type IconTileShape = keyof typeof variants.variant.shape;\nexport type IconTileSize = keyof typeof variants.size;\nexport type IconTileTone = keyof typeof variants.variant.tone;\n\nexport interface IconTileProps {\n /** Names meaningful artwork; omit when nearby text already describes it. */\n label?: string;\n /** Selects artwork from the curated Breeze icon set. */\n name: IconName;\n /** Selects a circular or rounded-square tile. Defaults to `square`. */\n shape?: IconTileShape;\n /** Selects the tile dimensions. Defaults to `lg`. */\n size?: IconTileSize;\n /** Selects the semantic colour treatment. Defaults to `brand`. */\n tone?: IconTileTone;\n}\n\n/**\n * Places curated artwork on a semantic colour wash.\n *\n * @summary A compact icon decoration for rows and content states.\n */\nexport function IconTile({\n label,\n name,\n shape = 'square',\n size = 'lg',\n tone = 'brand',\n}: Readonly<IconTileProps>) {\n return (\n <span\n className={[\n variants.base.tile,\n variants.variant.tone[tone],\n variants.variant.shape[shape],\n variants.size[size],\n ].join(' ')}\n >\n <Icon label={label} name={name} size={size === 'lg' ? 'md' : 'sm'} />\n </span>\n );\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutAlign, LayoutElement, LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n inline: 'breeze:flex breeze:min-inline-size-0',\n },\n compound: {},\n size: {\n 0: 'breeze:gap-0',\n 1: 'breeze:gap-breeze-1',\n 2: 'breeze:gap-breeze-2',\n 3: 'breeze:gap-breeze-3',\n 4: 'breeze:gap-breeze-4',\n 5: 'breeze:gap-breeze-5',\n 6: 'breeze:gap-breeze-6',\n 7: 'breeze:gap-breeze-7',\n 8: 'breeze:gap-breeze-8',\n },\n state: {\n wrap: 'breeze:flex-wrap',\n },\n variant: {\n align: {\n center: 'breeze:items-center',\n end: 'breeze:items-end',\n start: 'breeze:items-start',\n stretch: 'breeze:items-stretch',\n },\n justify: {\n between: 'breeze:justify-between',\n center: 'breeze:justify-center',\n end: 'breeze:justify-end',\n start: 'breeze:justify-start',\n },\n },\n} as const;\n\nexport type InlineJustify = keyof typeof variants.variant.justify;\n\nexport interface InlineProps {\n /** Names the row when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Items arranged horizontally. */\n children: ReactNode;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Applies space between items from the Breeze spacing scale. Defaults to `3`. */\n gap?: LayoutGap;\n /** Distributes items along the inline axis. Defaults to `start`. */\n justify?: InlineJustify;\n /** Aligns items along the block axis. Defaults to `center`. */\n verticalAlign?: LayoutAlign;\n /** Allows items to wrap onto additional rows. Defaults to `false`. */\n wrap?: boolean;\n}\n\n/**\n * Arranges children horizontally on the Breeze spacing scale.\n *\n * @summary A constrained horizontal layout primitive.\n */\nexport function Inline({\n 'aria-label': ariaLabel,\n children,\n element = 'div',\n gap = 3,\n justify = 'start',\n verticalAlign = 'center',\n wrap = false,\n}: Readonly<InlineProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.inline,\n variants.variant.align[verticalAlign],\n variants.variant.justify[justify],\n variants.size[gap],\n wrap && variants.state.wrap,\n ]\n .filter(Boolean)\n .join(' '),\n role,\n },\n children,\n );\n}\n","import {\n createElement,\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n MenuTrigger as AriaMenuTrigger,\n} from 'react-aria-components/Menu';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Badge } from '../Badge/Badge';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport type { IconName } from '../Icon/Icon';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n badge: 'breeze:ms-auto',\n content:\n 'breeze:flex breeze:min-inline-size-0 breeze:flex-1 breeze:flex-col breeze:gap-breeze-1',\n description:\n 'breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n icon: 'breeze:block-size-breeze-4 breeze:inline-size-breeze-4 breeze:shrink-0',\n item: 'breeze:flex breeze:min-inline-size-0 breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:items-center breeze:gap-breeze-2 breeze:rounded-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:text-start breeze:outline-offset-[-2px] breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[focused]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken',\n label: 'breeze:font-medium',\n menu: 'breeze:min-inline-size-0 breeze:outline-none',\n popover:\n 'breeze:[min-inline-size:var(--trigger-width)] breeze:max-inline-size-[calc(100vw-24px)] breeze:overflow-auto breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:bg-breeze-surface breeze:p-breeze-1 breeze:shadow-breeze-overlay',\n trigger:\n 'breeze:inline-flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:items-center breeze:gap-breeze-2 breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand',\n triggerLabel:\n 'breeze:inline-grid breeze:min-inline-size-0 breeze:items-center',\n triggerLabelContent: 'breeze:[grid-area:1/1]',\n triggerLabelSkeleton: 'breeze:[grid-area:1/1] breeze:inline-size-full',\n triggerLoadingStatus: 'breeze:sr-only',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface MenuCommonProps<T> {\n /** Returns the display details for an application item. */\n getItem: (item: T) => ItemDescriptor;\n /** Application items displayed as actions. */\n items: T[];\n /** Called with the selected action's ItemDescriptor. */\n onAction?: (descriptor: ItemDescriptor) => void;\n /** Shows a loading bar on the trigger and prevents opening the menu. */\n loading?: boolean;\n /** Icon shown beside the trigger label. */\n triggerIcon?: IconName;\n /** Visible label for the button that opens the menu. */\n trigger: string;\n}\n\ninterface ControlledMenuProps {\n /** Only set when visibility is uncontrolled. */\n defaultOpen?: never;\n /** Called when the menu should open or close. */\n onOpenChange: (open: boolean) => void;\n /** Whether the menu is open. */\n open: boolean;\n}\n\ninterface UncontrolledMenuProps {\n /** Initial visibility. Defaults to `false`. */\n defaultOpen?: boolean;\n /** Called when the menu opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Only set when visibility is controlled. */\n open?: never;\n}\n\n/** Props for a menu with caller-controlled or internal visibility. */\nexport type MenuProps<T> = MenuCommonProps<T> &\n (ControlledMenuProps | UncontrolledMenuProps);\n\ninterface MenuItemContentProps {\n descriptionId: string;\n descriptor: ItemDescriptor;\n}\n\nfunction MenuItemContent({\n descriptionId,\n descriptor,\n}: Readonly<MenuItemContentProps>) {\n return (\n <>\n <span aria-hidden=\"true\" className={variants.base.icon}>\n {descriptor.icon && <Icon name={descriptor.icon} size=\"sm\" />}\n </span>\n <span className={variants.base.content}>\n <span className={variants.base.label}>{descriptor.label}</span>\n {descriptor.description && (\n <span className={variants.base.description} id={descriptionId}>\n {descriptor.description}\n </span>\n )}\n </span>\n {descriptor.badge && (\n <span className={variants.base.badge}>\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n </span>\n )}\n </>\n );\n}\n\nfunction getMenuItemAccessibleName(descriptor: ItemDescriptor) {\n if (!descriptor.badge) return descriptor.label;\n\n const badgeLabel =\n descriptor.badge['aria-label']?.trim() || descriptor.badge.children;\n\n return `${descriptor.label}, ${badgeLabel}`;\n}\n\nfunction MenuLoadingStatus({ loading }: Readonly<{ loading: boolean }>) {\n const { getMessageLocale, messages } = useBreezeContext();\n\n return (\n <>\n {loading && (\n <span className={variants.base.triggerLoadingStatus}>\n <Skeleton label={messages.loading} />\n </span>\n )}\n <output\n aria-live=\"polite\"\n className={variants.base.triggerLoadingStatus}\n lang={getMessageLocale('loading')}\n >\n {loading ? messages.loading : ''}\n </output>\n </>\n );\n}\n\n/**\n * Displays related actions from a labelled trigger button.\n *\n * Set `loading` while the trigger should not open the menu. The loading status\n * is announced while the trigger keeps its accessible name and dimensions.\n *\n * @summary A compact menu for secondary actions.\n */\nexport function Menu<T>({\n defaultOpen,\n getItem,\n items,\n loading = false,\n onAction,\n onOpenChange,\n open: controlledOpen,\n trigger,\n triggerIcon,\n}: Readonly<MenuProps<T>>) {\n useBreezeContext();\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(\n defaultOpen ?? false,\n );\n const open = controlledOpen ?? uncontrolledOpen;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const restoreFocusRef = useRef(false);\n const menuId = useId();\n const descriptors = useMemo(() => items.map(getItem), [getItem, items]);\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n if (loading && nextOpen) return;\n\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [controlledOpen, loading, onOpenChange],\n );\n\n useLayoutEffect(() => {\n if (!open && restoreFocusRef.current) {\n restoreFocusRef.current = false;\n\n requestAnimationFrame(() => {\n const triggerElement = triggerRef.current;\n\n if (\n triggerElement &&\n triggerElement.ownerDocument.activeElement ===\n triggerElement.ownerDocument.body\n ) {\n triggerElement.focus();\n }\n });\n }\n }, [open]);\n\n return (\n <>\n <AriaMenuTrigger isOpen={open} onOpenChange={handleOpenChange}>\n <AriaButton\n aria-haspopup=\"menu\"\n className={variants.base.trigger}\n isPending={loading}\n ref={triggerRef}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n type: 'button',\n })\n }\n >\n {triggerIcon && <Icon name={triggerIcon} size=\"sm\" />}\n <span className={variants.base.triggerLabel}>\n <span\n className={[\n variants.base.triggerLabelContent,\n loading && 'breeze:opacity-0',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {trigger}\n </span>\n {loading && (\n <span\n aria-hidden=\"true\"\n className={variants.base.triggerLabelSkeleton}\n data-breeze-skeleton=\"\"\n >\n <Skeleton />\n </span>\n )}\n </span>\n <Icon name=\"expand\" size=\"sm\" />\n </AriaButton>\n <CollectionPopover\n className={variants.base.popover}\n isOpen={open}\n onOpenChange={handleOpenChange}\n triggerRef={triggerRef}\n >\n <div\n onKeyDownCapture={(event) => {\n if (event.key === 'Escape') restoreFocusRef.current = true;\n }}\n >\n <AriaMenu\n className={variants.base.menu}\n id={menuId}\n onAction={(key) => {\n const descriptor = descriptors.find((item) => item.id === key);\n if (descriptor) {\n restoreFocusRef.current = true;\n onAction?.(descriptor);\n }\n }}\n >\n {descriptors.map((descriptor, index) => {\n const descriptionId = `${menuId}-description-${index}`;\n\n return (\n <AriaMenuItem\n aria-describedby={\n descriptor.description ? descriptionId : undefined\n }\n aria-label={getMenuItemAccessibleName(descriptor)}\n className={variants.base.item}\n id={descriptor.id}\n isDisabled={descriptor.disabled}\n key={descriptor.id}\n textValue={descriptor.label}\n >\n <MenuItemContent\n descriptionId={descriptionId}\n descriptor={descriptor}\n />\n </AriaMenuItem>\n );\n })}\n </AriaMenu>\n </div>\n </CollectionPopover>\n </AriaMenuTrigger>\n <MenuLoadingStatus loading={loading} />\n </>\n );\n}\n","import type { Ref } from 'react';\nimport { createElement } from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { Group as AriaGroup } from 'react-aria-components/Group';\nimport { Input as AriaInput } from 'react-aria-components/Input';\nimport { NumberField as AriaNumberField } from 'react-aria-components/NumberField';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n group:\n 'breeze:relative breeze:inline-flex breeze:min-block-breeze-md breeze:min-inline-size-0 breeze:inline-size-full breeze:items-stretch breeze:overflow-hidden breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:has-[input[data-focus-visible]]:outline-2 breeze:has-[input[data-focus-visible]]:outline-solid breeze:has-[input[data-focus-visible]]:outline-breeze-brand breeze:has-[input[data-invalid]]:border-breeze-danger breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:bg-breeze-sunken',\n input:\n 'breeze:min-block-breeze-md breeze:min-inline-size-0 breeze:flex-1 breeze:border-0 breeze:rounded-none breeze:bg-transparent breeze:tabular-nums breeze:outline-none breeze:placeholder:text-breeze-ink-3 breeze:data-[hovered]:border-transparent breeze:data-[focus-visible]:!outline-none breeze:data-[invalid]:border-transparent breeze:disabled:cursor-not-allowed breeze:read-only:cursor-default',\n skeleton:\n 'breeze:pointer-events-none breeze:absolute breeze:[inset-block:0] breeze:[inset-inline:0]',\n stepButton:\n 'breeze:min-inline-breeze-md breeze:border-0 breeze:bg-transparent breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:font-breeze-sans breeze:text-breeze-md breeze:font-semibold breeze:leading-none breeze:text-breeze-ink breeze:disabled:cursor-not-allowed breeze:disabled:opacity-50 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap breeze:hover:text-breeze-brand breeze:focus-visible:outline-2 breeze:focus-visible:outline-solid breeze:focus-visible:outline-breeze-brand breeze:outline-offset-[-2px]',\n },\n compound: {},\n size: {},\n state: {\n loadingGroup:\n 'breeze:!bg-transparent breeze:!border-transparent breeze:!opacity-100 breeze:!overflow-visible',\n loadingInput: 'breeze:!opacity-0',\n loadingStepButton: 'breeze:!opacity-0',\n readOnlyGroup: 'breeze:!bg-breeze-sunken',\n },\n variant: {},\n} as const;\n\ninterface NumberFieldCommonProps {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the input when the component is mounted. */\n autoFocus?: boolean;\n /** Supporting guidance announced with the input. */\n description?: string;\n /** Prevents editing, stepping, and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the field with a form outside its ancestor tree. */\n form?: string;\n /** Locale-aware formatting options used by React Aria. */\n formatOptions?: Intl.NumberFormatOptions;\n /** Sets the native input id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the input with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Largest permitted value. */\n maxValue?: number;\n /** Smallest permitted value. */\n minValue?: number;\n /** Sets the submitted name of the field's hidden native input. */\n name?: string;\n /** Temporary text shown while the input is empty. */\n placeholder?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native numeric input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the input as required. Defaults to `false`. */\n required?: boolean;\n /** Amount applied by arrow keys and stepper buttons. Defaults to `1`. */\n step?: number;\n}\n\ninterface ControlledNumberFieldProps {\n /** Current number. React Aria reports `NaN` while the input is empty. */\n value: number;\n /** Reports the next number without exposing a DOM event. */\n onChange: (value: number) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledNumberFieldProps {\n /** Initial number. Defaults to an empty numeric input. */\n defaultValue?: number;\n /** Reports the next number without exposing a DOM event. */\n onChange?: (value: number) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled locale-aware numeric entry. */\nexport type NumberFieldProps = NumberFieldCommonProps &\n (ControlledNumberFieldProps | UncontrolledNumberFieldProps);\n\n/**\n * Renders locale-aware numeric entry with React Aria stepper controls,\n * validation, tabular figures, and a closed loading presentation.\n *\n * @summary Flat numeric entry with semantic number changes.\n */\nexport function NumberField({\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n formatOptions,\n id,\n label,\n loading = false,\n maxValue,\n minValue,\n name,\n onChange,\n placeholder,\n readOnly = false,\n ref,\n required = false,\n step,\n value,\n}: Readonly<NumberFieldProps>) {\n const { messages } = useBreezeContext();\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaNumberField\n autoFocus={autoFocus}\n aria-label={loading ? label : undefined}\n className={fieldVariants.base.root}\n defaultValue={defaultValue}\n form={form}\n formatOptions={formatOptions}\n id={id}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={maxValue}\n minValue={minValue}\n name={name}\n onChange={onChange}\n step={step}\n validationBehavior=\"aria\"\n value={value}\n >\n <FieldLabel label={label} loading={loading} />\n <AriaGroup\n className={joinClassNames(\n variants.base.group,\n readOnly && !loading && variants.state.readOnlyGroup,\n loading && variants.state.loadingGroup,\n )}\n >\n <AriaInput\n aria-busy={loading || undefined}\n className={joinClassNames(\n fieldVariants.base.input,\n variants.base.input,\n loading && variants.state.loadingInput,\n )}\n autoComplete={autoComplete}\n placeholder={placeholder}\n form={form}\n ref={ref}\n />\n <AriaButton\n className={joinClassNames(\n variants.base.stepButton,\n loading && variants.state.loadingStepButton,\n )}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-hidden': loading || undefined,\n type: 'button',\n })\n }\n slot=\"decrement\"\n type=\"button\"\n >\n −\n </AriaButton>\n <AriaButton\n className={joinClassNames(\n variants.base.stepButton,\n loading && variants.state.loadingStepButton,\n )}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-hidden': loading || undefined,\n type: 'button',\n })\n }\n slot=\"increment\"\n type=\"button\"\n >\n +\n </AriaButton>\n {loading && (\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </AriaGroup>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaNumberField>\n );\n}\n","import type { OverlayProps } from '../../overlays/overlay.types';\nimport OverlaySurface from '../../overlays/OverlaySurface';\n\nexport type PopoverProps = OverlayProps & {\n /** Preferred logical placement; flips when space is limited. */\n placement?: 'top' | 'bottom' | 'start' | 'end';\n};\n\n/**\n * Opens a labelled popover with library-owned nesting and motion.\n * @summary A labelled popover surface with a trigger and close action.\n */\nexport function Popover({\n children,\n defaultOpen,\n dismissible,\n onOpenChange,\n open,\n title,\n trigger,\n placement,\n}: Readonly<PopoverProps>) {\n return (\n <OverlaySurface\n defaultOpen={defaultOpen}\n dismissible={dismissible}\n onOpenChange={onOpenChange}\n open={open}\n title={title}\n trigger={trigger}\n placement={placement}\n kind=\"popover\"\n >\n {children}\n </OverlaySurface>\n );\n}\n","import {\n GridList as AriaGridList,\n GridListHeader as AriaGridListHeader,\n GridListItem as AriaGridListItem,\n GridListSection as AriaGridListSection,\n} from 'react-aria-components/GridList';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Badge } from '../Badge/Badge';\nimport { Button } from '../Button/Button';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { type IsoCalendarDate, Typography } from '../Typography/Typography';\n\nconst variants = {\n base: {\n badge:\n 'breeze:block breeze:inline-size-full breeze:max-inline-size-full breeze:min-inline-size-0 breeze:overflow-hidden breeze:whitespace-nowrap breeze:[&>span]:max-inline-size-full breeze:[&>span]:min-inline-size-0 breeze:[&>span]:overflow-hidden breeze:[&>span>span:first-child]:min-inline-size-0 breeze:[&>span>span:first-child]:overflow-hidden breeze:[&>span>span:first-child]:text-ellipsis',\n container: 'breeze:min-inline-size-0 breeze:inline-size-full',\n content:\n 'breeze:flex breeze:min-inline-size-0 breeze:flex-1 breeze:flex-col',\n description:\n 'breeze:break-words breeze:text-breeze-xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n emptyMessage:\n 'breeze:box-border breeze:inline-size-full breeze:min-inline-size-0 breeze:px-breeze-3 breeze:py-breeze-3 breeze:text-breeze-sm breeze:text-breeze-ink-2',\n grid: 'breeze:inline-size-full breeze:min-inline-size-0 breeze:flex breeze:flex-col breeze:gap-0',\n header:\n 'breeze:box-border breeze:inline-size-full breeze:min-inline-size-0 breeze:grid breeze:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)] breeze:items-center breeze:gap-breeze-4 breeze:border-breeze-line breeze:border-be breeze:px-breeze-3 breeze:py-breeze-2 breeze:text-breeze-xs breeze:font-medium breeze:text-breeze-ink-2 breeze:max-breeze-md:grid-cols-1 breeze:max-breeze-md:gap-breeze-1',\n headerLabel:\n 'breeze:col-start-1 breeze:min-inline-size-0 breeze:break-words',\n icon: 'breeze:block-size-breeze-4 breeze:inline-size-breeze-4 breeze:shrink-0',\n item: 'breeze:box-border breeze:inline-size-full breeze:min-inline-size-0 breeze:grid breeze:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)] breeze:items-center breeze:gap-breeze-4 breeze:border-breeze-line breeze:border-be breeze:px-breeze-3 breeze:py-breeze-3 breeze:text-start breeze:outline-offset-[-2px] breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-50 breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[hovered]:bg-breeze-sunken breeze:data-[pressed]:bg-breeze-sunken breeze:any-pointer-coarse:min-block-breeze-tap breeze:max-breeze-md:grid-cols-1 breeze:max-breeze-md:gap-breeze-1',\n label: 'breeze:min-inline-size-0 breeze:break-words breeze:font-medium',\n leading:\n 'breeze:col-start-1 breeze:flex breeze:min-inline-size-0 breeze:flex-col breeze:items-start breeze:gap-breeze-2',\n loadMore:\n 'breeze:flex breeze:min-inline-size-0 breeze:justify-center breeze:py-breeze-3',\n loadingLeading:\n 'breeze:flex breeze:min-inline-size-0 breeze:flex-col breeze:gap-breeze-2',\n loadingMoneyPlaceholder:\n 'breeze:flex breeze:justify-end breeze:font-breeze-sans breeze:text-breeze-4xl breeze:font-semibold breeze:leading-breeze-tight breeze:tracking-breeze-tightest breeze:tabular-nums breeze:[&>progress]:[font:inherit]',\n loadingPlaceholder:\n 'breeze:flex breeze:justify-end breeze:max-breeze-md:justify-start',\n loadingRow:\n 'breeze:box-border breeze:inline-size-full breeze:min-inline-size-0 breeze:grid breeze:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)] breeze:items-center breeze:gap-breeze-4 breeze:border-breeze-line breeze:border-be breeze:px-breeze-3 breeze:py-breeze-3 breeze:max-breeze-md:grid-cols-1 breeze:max-breeze-md:gap-breeze-1',\n loadingStatus: 'breeze:sr-only',\n metadata:\n 'breeze:col-start-2 breeze:min-inline-size-0 breeze:break-words breeze:text-end breeze:max-breeze-md:col-start-1 breeze:max-breeze-md:text-start',\n primary:\n 'breeze:flex breeze:inline-size-full breeze:min-inline-size-0 breeze:items-start breeze:gap-breeze-2',\n section: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col',\n skeletonRows: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col',\n value:\n 'breeze:col-start-3 breeze:min-inline-size-0 breeze:break-words breeze:text-end breeze:max-breeze-md:col-start-1 breeze:max-breeze-md:text-start',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\nexport type RowListMetadata =\n | { format: 'date'; value: IsoCalendarDate }\n | { format: 'text'; value: string };\n\nexport type RowListValue =\n | { currency: string; format: 'currency'; value: number }\n | { format: 'text'; value: string };\n\n/** A stable named group rendered as a structural row in the list. */\nexport interface RowListSectionDescriptor {\n id: string;\n label: string;\n}\n\n/** The closed content contract for a row and its aligned regions. */\nexport interface RowListItemDescriptor extends ItemDescriptor {\n /** Shows quiet placeholders for supplied metadata and value regions. */\n loading?: boolean;\n /** Optional middle region, formatted as text or a locale-aware calendar date. */\n metadata?: RowListMetadata;\n /** Groups this row under a structural section header. */\n section?: RowListSectionDescriptor;\n /** Optional trailing region, formatted as text or locale-aware currency. */\n value?: RowListValue;\n}\n\n/** The explicit action that retrieves more rows. */\nexport interface RowListLoadMoreProps {\n /** Visible and accessible name for the load-more button. */\n label: string;\n /** Keeps the action named and marks it busy during retrieval. */\n loading?: boolean;\n /** Called when the load-more button is activated. */\n onAction: () => void;\n}\n\n/** Props for a data-backed, individually actionable row list. */\nexport interface RowListProps<T> {\n /** Names the grid list for assistive technology. */\n 'aria-label': string;\n /** Returns the closed display descriptor for an application value. */\n getItem: (item: T) => RowListItemDescriptor;\n /** Application values displayed as rows. */\n items: T[];\n /** Announces initial or retained-row loading without replacing existing rows. */\n loading?: boolean;\n /** Optional explicit action for retrieving more rows. */\n loadMore?: RowListLoadMoreProps;\n /** Called with the activated row's descriptor. */\n onAction: (descriptor: RowListItemDescriptor) => void;\n}\n\ninterface RowGroup {\n id: string;\n items: RowListItemDescriptor[];\n label: string;\n}\n\ntype ListEntry =\n | { kind: 'row'; descriptor: RowListItemDescriptor }\n | { group: RowGroup; kind: 'section' };\n\nfunction groupRows(descriptors: RowListItemDescriptor[]): ListEntry[] {\n const entries: ListEntry[] = [];\n const sections = new Map<string, RowGroup>();\n\n descriptors.forEach((descriptor) => {\n if (!descriptor.section) {\n entries.push({ descriptor, kind: 'row' });\n return;\n }\n\n const group = sections.get(descriptor.section.id);\n\n if (group) {\n group.items.push(descriptor);\n } else {\n const newGroup = {\n id: descriptor.section.id,\n items: [descriptor],\n label: descriptor.section.label,\n };\n sections.set(newGroup.id, newGroup);\n entries.push({ group: newGroup, kind: 'section' });\n }\n });\n\n return entries;\n}\n\nfunction LoadingPlaceholder() {\n return <Skeleton blockSize=\"1lh\" inlineSize=\"min(100%, 8em)\" />;\n}\n\nconst initialLoadingRows = ['first', 'second', 'third'] as const;\n\nfunction InitialLoadingState() {\n return (\n <div className={variants.base.skeletonRows}>\n {initialLoadingRows.map((row) => (\n <div className={variants.base.loadingRow} key={row}>\n <div className={variants.base.loadingLeading}>\n <Skeleton blockSize=\"1lh\" inlineSize=\"min(100%, 9em)\" />\n <Skeleton blockSize=\"1lh\" inlineSize=\"min(100%, 14em)\" />\n </div>\n <div className={variants.base.metadata}>\n <div className={variants.base.loadingPlaceholder}>\n <Skeleton blockSize=\"1lh\" inlineSize=\"min(100%, 7em)\" />\n </div>\n </div>\n <div className={variants.base.value}>\n <div className={variants.base.loadingPlaceholder}>\n <Skeleton blockSize=\"1lh\" inlineSize=\"min(100%, 5em)\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction MetadataContent({\n descriptor,\n}: Readonly<{ descriptor: RowListItemDescriptor }>) {\n const { metadata } = descriptor;\n\n if (!metadata) return null;\n if (descriptor.loading) {\n return (\n <div className={variants.base.loadingPlaceholder}>\n <LoadingPlaceholder />\n </div>\n );\n }\n\n if (metadata.format === 'date') {\n return (\n <Typography\n element=\"span\"\n format=\"date\"\n dateStyle=\"medium\"\n tone=\"secondary\"\n value={metadata.value}\n variant=\"caption\"\n />\n );\n }\n\n return (\n <Typography element=\"span\" tone=\"secondary\" variant=\"caption\">\n {metadata.value}\n </Typography>\n );\n}\n\nfunction ValueContent({\n descriptor,\n}: Readonly<{ descriptor: RowListItemDescriptor }>) {\n const { value } = descriptor;\n\n if (!value) return null;\n if (descriptor.loading) {\n const placeholderClass =\n value.format === 'currency'\n ? variants.base.loadingMoneyPlaceholder\n : variants.base.loadingPlaceholder;\n\n return (\n <div className={placeholderClass}>\n {value.format === 'currency' ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"min(100%, 4em)\" />\n ) : (\n <LoadingPlaceholder />\n )}\n </div>\n );\n }\n\n if (value.format === 'currency') {\n return (\n <Typography\n element=\"span\"\n format=\"currency\"\n currency={value.currency}\n tone=\"secondary\"\n value={value.value}\n variant=\"money\"\n />\n );\n }\n\n return (\n <Typography element=\"span\" tone=\"secondary\" variant=\"body\">\n {value.value}\n </Typography>\n );\n}\n\nfunction RowContent({\n descriptor,\n}: Readonly<{ descriptor: RowListItemDescriptor }>) {\n return (\n <>\n <div className={variants.base.leading}>\n <div className={variants.base.primary}>\n {descriptor.icon && (\n <span aria-hidden=\"true\" className={variants.base.icon}>\n <Icon name={descriptor.icon} size=\"sm\" />\n </span>\n )}\n <span className={variants.base.content}>\n <span className={variants.base.label}>{descriptor.label}</span>\n {descriptor.description && (\n <span className={variants.base.description}>\n {descriptor.description}\n </span>\n )}\n </span>\n </div>\n {descriptor.badge && (\n <span className={variants.base.badge}>\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n </span>\n )}\n </div>\n {descriptor.metadata && (\n <div className={variants.base.metadata}>\n <MetadataContent descriptor={descriptor} />\n </div>\n )}\n {descriptor.value && (\n <div className={variants.base.value}>\n <ValueContent descriptor={descriptor} />\n </div>\n )}\n </>\n );\n}\n\nfunction renderRow(\n descriptor: RowListItemDescriptor,\n onAction: RowListProps<unknown>['onAction'],\n) {\n return (\n <AriaGridListItem\n className={variants.base.item}\n id={`row:${descriptor.id}`}\n isDisabled={descriptor.disabled}\n key={`row:${descriptor.id}`}\n onAction={() => onAction(descriptor)}\n textValue={descriptor.label}\n >\n <RowContent descriptor={descriptor} />\n </AriaGridListItem>\n );\n}\n\n/**\n * Displays actionable rows with aligned metadata and value regions.\n *\n * @summary A data-backed collection with sections and explicit pagination.\n */\nexport function RowList<T>({\n 'aria-label': ariaLabel,\n getItem,\n items,\n loading = false,\n loadMore,\n onAction,\n}: Readonly<RowListProps<T>>) {\n const { getMessageLocale, messages } = useBreezeContext();\n const descriptors = items.map(getItem);\n const entries = groupRows(descriptors);\n const loadMoreLoading = loadMore?.loading ?? false;\n const isLoading = loading || loadMoreLoading;\n let statusMessage = '';\n\n if (isLoading) {\n statusMessage = messages.loading;\n } else if (items.length === 0) {\n statusMessage = messages.noItemsToDisplay;\n }\n\n return (\n <div className={variants.base.container}>\n <AriaGridList\n aria-busy={loading || undefined}\n aria-label={ariaLabel}\n className={variants.base.grid}\n renderEmptyState={() =>\n isLoading ? (\n <InitialLoadingState />\n ) : (\n <div\n className={variants.base.emptyMessage}\n lang={getMessageLocale('noItemsToDisplay')}\n >\n {messages.noItemsToDisplay}\n </div>\n )\n }\n selectionMode=\"none\"\n >\n {entries.map((entry) => {\n if (entry.kind === 'row') {\n return renderRow(entry.descriptor, onAction);\n }\n\n return (\n <AriaGridListSection\n className={variants.base.section}\n id={`section:${entry.group.id}`}\n key={`section:${entry.group.id}`}\n >\n <AriaGridListHeader className={variants.base.header}>\n <span className={variants.base.headerLabel}>\n {entry.group.label}\n </span>\n </AriaGridListHeader>\n {entry.group.items.map((descriptor) =>\n renderRow(descriptor, onAction),\n )}\n </AriaGridListSection>\n );\n })}\n </AriaGridList>\n <output\n aria-live=\"polite\"\n className={variants.base.loadingStatus}\n lang={getMessageLocale(isLoading ? 'loading' : 'noItemsToDisplay')}\n >\n {statusMessage}\n </output>\n {loadMore && (\n <div className={variants.base.loadMore}>\n <Button\n loading={loadMoreLoading}\n onAction={loadMore.onAction}\n variant=\"quiet\"\n >\n {loadMore.label}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","import type { RefObject } from 'react';\nimport {\n createElement,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n} from 'react';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport {\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n} from 'react-aria-components/ListBox';\nimport {\n Select as AriaSelect,\n SelectStateContext as AriaSelectStateContext,\n SelectValue as AriaSelectValue,\n} from 'react-aria-components/Select';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport collectionVariants from '../Collection/collection.styles';\nimport CollectionPopover from '../Collection/CollectionPopover';\nimport DescriptorContent from '../Collection/DescriptorContent';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Icon } from '../Icon/Icon';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst selectVariants = {\n base: {\n trigger:\n 'breeze:flex breeze:min-block-breeze-md breeze:any-pointer-coarse:min-block-breeze-tap breeze:min-inline-size-0 breeze:inline-size-full breeze:items-center breeze:justify-between breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:font-breeze-sans breeze:text-breeze-sm breeze:text-breeze-ink breeze:outline-offset-2 breeze:data-[hovered]:border-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[invalid]:border-breeze-danger breeze:disabled:cursor-not-allowed breeze:disabled:bg-breeze-sunken breeze:disabled:opacity-60',\n },\n compound: {},\n size: {},\n state: {\n readOnlyTrigger: 'breeze:cursor-default breeze:bg-breeze-sunken',\n },\n variant: {},\n} as const;\n\ninterface SelectCommonProps<T> {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the control when the component is mounted. */\n autoFocus?: boolean;\n /** Prevents opening and selecting. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the control. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the control with a form outside its ancestor tree. */\n form?: string;\n /** Maps an item to the closed descriptor rendered by Breeze. */\n getItem: (item: T) => ItemDescriptor;\n /** Sets the control id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the control with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Fixed choices displayed in the popover listbox. */\n items: T[];\n /** Sets the submitted name of the control. */\n name?: string;\n /** Temporary text shown when no choice is selected. */\n placeholder?: string;\n /** Prevents changing the choice while retaining focus and form participation. */\n readOnly?: boolean;\n /** Marks the control as required. Defaults to `false`. */\n required?: boolean;\n}\n\ninterface ControlledSelectProps<T> {\n /** Current selected item. */\n value: T | null;\n /** Reports the next selected item without exposing a DOM event. */\n onChange: (value: T | null) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledSelectProps<T> {\n /** Initial selected item. */\n defaultValue?: T | null;\n /** Reports the next selected item without exposing a DOM event. */\n onChange?: (value: T | null) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled fixed-choice selection. */\nexport type SelectProps<T> = SelectCommonProps<T> &\n (ControlledSelectProps<T> | UncontrolledSelectProps<T>);\n\ninterface SelectItem<T> {\n descriptor: ItemDescriptor;\n item: T;\n}\n\nfunction SelectListBox<T>({ items }: Readonly<{ items: SelectItem<T>[] }>) {\n return (\n <AriaListBox className={collectionVariants.base.listBox} items={items}>\n {(item: SelectItem<T>) => (\n <AriaListBoxItem\n className={collectionVariants.base.item}\n id={item.descriptor.id}\n isDisabled={item.descriptor.disabled}\n textValue={item.descriptor.label}\n value={item}\n >\n {({ isSelected }) => (\n <DescriptorContent\n descriptor={item.descriptor}\n isSelected={isSelected}\n />\n )}\n </AriaListBoxItem>\n )}\n </AriaListBox>\n );\n}\n\nfunction SelectReadOnlyFormValue({\n form,\n interactionDisabled,\n name,\n readOnly,\n}: Readonly<{\n form?: string;\n interactionDisabled: boolean;\n name?: string;\n readOnly: boolean;\n}>) {\n const state = useContext(AriaSelectStateContext);\n\n if (!readOnly || interactionDisabled || !name || state === null) return null;\n\n return (\n <input\n form={form}\n name={name}\n type=\"hidden\"\n value={state.value === null ? '' : String(state.value)}\n />\n );\n}\n\nfunction SelectPopover<T>({\n disabled,\n items,\n readOnly,\n triggerRef,\n}: Readonly<{\n disabled: boolean;\n items: SelectItem<T>[];\n readOnly: boolean;\n triggerRef: RefObject<HTMLButtonElement | null>;\n}>) {\n const state = useContext(AriaSelectStateContext);\n const blocked = disabled || readOnly || items.length === 0;\n const isOpen = !blocked && (state?.isOpen ?? false);\n\n useEffect(() => {\n if (blocked && state?.isOpen) {\n state.setOpen(false);\n }\n }, [blocked, state]);\n\n return (\n <CollectionPopover\n className={collectionVariants.base.popover}\n isOpen={isOpen}\n onOpenChange={(open) => state?.setOpen(open)}\n triggerRef={triggerRef}\n >\n <SelectListBox items={items} />\n </CollectionPopover>\n );\n}\n\n/**\n * Renders a fixed-choice popover listbox backed by React Aria Components.\n *\n * @summary Flat fixed-choice selection with semantic item changes.\n */\nexport function Select<T>({\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n getItem,\n id,\n items,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n readOnly = false,\n required = false,\n value,\n}: Readonly<SelectProps<T>>) {\n const { messages } = useBreezeContext();\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const isInvalid = !loading && visibleError !== undefined;\n const fieldId = useId();\n const controlId = id ?? `${fieldId}-control`;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const decoratedItems = useMemo<SelectItem<T>[]>(\n () =>\n items.map((item) => ({\n descriptor: getItem(item),\n item,\n })),\n [getItem, items],\n );\n let selectedKey: string | null | undefined;\n if (value === undefined) {\n selectedKey = undefined;\n } else if (value === null) {\n selectedKey = null;\n } else {\n selectedKey = getItem(value).id;\n }\n const defaultSelectedKey =\n defaultValue === undefined || defaultValue === null\n ? null\n : getItem(defaultValue).id;\n\n return (\n <AriaSelect<SelectItem<T>>\n aria-label={loading ? label : undefined}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n className={fieldVariants.base.root}\n defaultValue={defaultSelectedKey}\n form={form}\n id={controlId}\n isDisabled={interactionDisabled || readOnly}\n isInvalid={isInvalid}\n isRequired={required}\n name={name}\n onChange={(key) => {\n if (readOnly) return;\n\n const nextItem =\n key === null\n ? undefined\n : decoratedItems.find(\n ({ descriptor }) => descriptor.id === String(key),\n );\n onChange?.(nextItem?.item ?? null);\n }}\n placeholder={placeholder}\n validationBehavior=\"aria\"\n value={selectedKey}\n >\n <FieldLabel\n htmlFor={controlId}\n label={label}\n loading={loading}\n onClick={() => triggerRef.current?.focus()}\n />\n <div className={fieldVariants.base.control}>\n <AriaButton\n className={joinClassNames(\n selectVariants.base.trigger,\n readOnly && selectVariants.state.readOnlyTrigger,\n loading && 'breeze:!opacity-0',\n )}\n isDisabled={interactionDisabled}\n ref={triggerRef}\n render={(buttonProps) =>\n createElement('button', {\n ...buttonProps,\n 'aria-busy': loading || undefined,\n 'aria-disabled': readOnly || undefined,\n 'aria-invalid': isInvalid || undefined,\n 'data-invalid': isInvalid || undefined,\n type: 'button',\n })\n }\n >\n <AriaSelectValue\n className={joinClassNames(\n collectionVariants.base.content,\n 'breeze:text-start',\n )}\n >\n {({ isPlaceholder, selectedText }) =>\n isPlaceholder ? placeholder ?? '' : selectedText\n }\n </AriaSelectValue>\n <Icon name=\"expand\" size=\"sm\" />\n </AriaButton>\n {loading && (\n <span className={fieldVariants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </div>\n <SelectPopover\n disabled={interactionDisabled}\n items={decoratedItems}\n readOnly={readOnly}\n triggerRef={triggerRef}\n />\n <SelectReadOnlyFormValue\n form={form}\n interactionDisabled={interactionDisabled}\n name={name}\n readOnly={readOnly}\n />\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaSelect>\n );\n}\n","const variants = {\n base: {\n separator:\n 'breeze:m-0 breeze:shrink-0 breeze:border-0 breeze:bg-breeze-line breeze:forced-colors:bg-[CanvasText]',\n },\n compound: {},\n size: {},\n state: {},\n variant: {\n horizontal: 'breeze:block-size-breeze-px breeze:inline-size-full',\n vertical: 'breeze:block-size-full breeze:inline-size-breeze-px',\n },\n} as const;\n\nexport type SeparatorOrientation = keyof typeof variants.variant;\n\nexport interface SeparatorProps {\n /** Sets the divider axis. Defaults to `horizontal`. */\n orientation?: SeparatorOrientation;\n}\n\n/**\n * Separates adjacent regions along a horizontal or vertical axis.\n *\n * @summary A semantic one-token divider.\n */\nexport function Separator({\n orientation = 'horizontal',\n}: Readonly<SeparatorProps>) {\n return (\n <hr\n aria-orientation={orientation}\n className={[variants.base.separator, variants.variant[orientation]].join(\n ' ',\n )}\n />\n );\n}\n","import type { ReactNode } from 'react';\nimport { createElement } from 'react';\nimport getLayoutAccessibility from '../layout.accessibility';\nimport type { LayoutAlign, LayoutElement, LayoutGap } from '../layout.types';\n\nconst variants = {\n base: {\n stack: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col',\n },\n compound: {},\n size: {\n 0: 'breeze:gap-0',\n 1: 'breeze:gap-breeze-1',\n 2: 'breeze:gap-breeze-2',\n 3: 'breeze:gap-breeze-3',\n 4: 'breeze:gap-breeze-4',\n 5: 'breeze:gap-breeze-5',\n 6: 'breeze:gap-breeze-6',\n 7: 'breeze:gap-breeze-7',\n 8: 'breeze:gap-breeze-8',\n },\n state: {},\n variant: {\n center: 'breeze:items-center',\n end: 'breeze:items-end',\n start: 'breeze:items-start',\n stretch: 'breeze:items-stretch',\n },\n} as const;\n\nexport interface StackProps {\n /** Names the stack when its visible content does not provide a suitable label. */\n 'aria-label'?: string;\n /** Items arranged vertically. */\n children: ReactNode;\n /** Selects the semantic HTML element. Defaults to `div`. */\n element?: LayoutElement;\n /** Applies space between items from the Breeze spacing scale. Defaults to `3`. */\n gap?: LayoutGap;\n /** Aligns items along the inline axis. Defaults to `stretch`. */\n horizontalAlign?: LayoutAlign;\n}\n\n/**\n * Arranges children vertically on the Breeze spacing scale.\n *\n * @summary A constrained vertical layout primitive.\n */\nexport function Stack({\n 'aria-label': ariaLabel,\n children,\n element = 'div',\n gap = 3,\n horizontalAlign = 'stretch',\n}: Readonly<StackProps>) {\n const { accessibleLabel, role } = getLayoutAccessibility(ariaLabel, element);\n\n return createElement(\n element,\n {\n 'aria-label': accessibleLabel,\n className: [\n variants.base.stack,\n variants.variant[horizontalAlign],\n variants.size[gap],\n ].join(' '),\n role,\n },\n children,\n );\n}\n","import type { Ref } from 'react';\nimport { Input as AriaInput } from 'react-aria-components/Input';\nimport { TextField as AriaTextField } from 'react-aria-components/TextField';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport {\n FieldLabel,\n FieldSupportingContent,\n} from '../Field/field.presentation';\nimport { fieldVariants, joinClassNames } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\ntype TextInputType = 'email' | 'password' | 'search' | 'tel' | 'text' | 'url';\n\ninterface TextFieldCommonProps {\n /** Hints at the browser's autocomplete behaviour for this field. */\n autoComplete?: string;\n /** Focuses the input when the component is mounted. */\n autoFocus?: boolean;\n /** Prevents editing and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Supporting guidance announced with the input. */\n description?: string;\n /** Visible validation message; any non-empty value marks the field invalid. */\n error?: string;\n /** Associates the input with a form outside its ancestor tree. */\n form?: string;\n /** Sets the native input id used by the field label. */\n id?: string;\n /** Accessible field label, shown as text outside loading state. */\n label: string;\n /** Replaces the input with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Sets the submitted name of the input. */\n name?: string;\n /** Temporary text shown while the input is empty. */\n placeholder?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native text input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the input as required. Defaults to `false`. */\n required?: boolean;\n /** Selects the browser input purpose. Defaults to `text`. */\n type?: TextInputType;\n}\n\ninterface ControlledTextFieldProps {\n /** Current text value. */\n value: string;\n /** Reports the next text value without exposing a DOM event. */\n onChange: (value: string) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n defaultValue?: never;\n}\n\ninterface UncontrolledTextFieldProps {\n /** Initial text value. Defaults to an empty string. */\n defaultValue?: string;\n /** Reports the next text value without exposing a DOM event. */\n onChange?: (value: string) => void;\n /** Controlled and uncontrolled value props are mutually exclusive. */\n value?: never;\n}\n\n/** Props for controlled or uncontrolled text entry. */\nexport type TextFieldProps = TextFieldCommonProps &\n (ControlledTextFieldProps | UncontrolledTextFieldProps);\n\n/**\n * Renders a labelled, accessible single-line text input with validation and a\n * closed loading presentation.\n *\n * @summary Flat text entry with semantic value changes.\n */\nexport function TextField({\n autoComplete,\n autoFocus,\n defaultValue,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n placeholder,\n readOnly = false,\n ref,\n required = false,\n type = 'text',\n value,\n}: Readonly<TextFieldProps>) {\n const { messages } = useBreezeContext();\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaTextField\n className={fieldVariants.base.root}\n defaultValue={defaultValue}\n aria-label={loading ? label : undefined}\n id={id}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n name={name}\n onChange={onChange}\n type={type}\n validationBehavior=\"aria\"\n value={value}\n >\n <FieldLabel label={label} loading={loading} />\n <span className={fieldVariants.base.control}>\n <AriaInput\n aria-busy={loading || undefined}\n className={joinClassNames(\n fieldVariants.base.input,\n loading && fieldVariants.state.loadingInput,\n )}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n form={form}\n placeholder={placeholder}\n ref={ref}\n />\n {loading && (\n <span className={fieldVariants.base.skeleton}>\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n )}\n </span>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaTextField>\n );\n}\n","import {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useOverlayPortal } from '../../overlays/OverlayProvider';\nimport { useOverlayToastZIndex } from '../../overlays/OverlayStack';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Icon } from '../Icon/Icon';\n\nconst toastLifetime = 2600;\nconst toastLimitError = 'BreezeProvider toastLimit must be a positive integer.';\nconst toastProviderError =\n 'Toast components must be rendered within BreezeProvider.';\n\ninterface ToastItem {\n id: number;\n message: string;\n}\n\ninterface ToastTimer {\n handle: ReturnType<typeof setTimeout> | null;\n remaining: number;\n startedAt: number | null;\n}\n\ninterface ToastContentState {\n message: string | null;\n remember: (message: string) => void;\n}\n\nfunction isToastVisible(entry: IntersectionObserverEntry) {\n return entry.isIntersecting && entry.intersectionRatio >= 1;\n}\n\nfunction handleToastIntersection(\n entry: IntersectionObserverEntry,\n visibleIds: Set<number>,\n scheduleToast: (id: number) => void,\n pauseToastTimer: (id: number) => void,\n) {\n const id = Number((entry.target as HTMLElement).dataset.breezeToastId);\n if (!visibleIds.has(id)) return;\n\n if (isToastVisible(entry)) {\n scheduleToast(id);\n } else {\n pauseToastTimer(id);\n }\n}\n\nexport type ToastEnqueue = (message: string) => void;\n\nconst ToastContext = createContext<ToastEnqueue | null>(null);\nconst ToastAnnouncementContext = createContext(true);\nconst ToastContentContext = createContext<ToastContentState | null>(null);\n\nexport interface ToastProps {\n /** Translated confirmation message. */\n children: string;\n}\n\n/**\n * Displays a positive, non-interactive confirmation.\n *\n * @summary A transient confirmation status.\n */\nexport function Toast({ children }: Readonly<ToastProps>) {\n useBreezeContext();\n const isDocumentVisible = useContext(ToastAnnouncementContext);\n const contentState = useContext(ToastContentContext);\n const [message, setMessage] = useState<string | null>(\n () => contentState?.message ?? null,\n );\n\n useEffect(() => {\n if (\n !isDocumentVisible ||\n (typeof document !== 'undefined' && document.hidden) ||\n message === children\n ) {\n return undefined;\n }\n\n const update = setTimeout(() => {\n setMessage(children);\n contentState?.remember(children);\n }, 0);\n return () => clearTimeout(update);\n }, [children, contentState, isDocumentVisible, message]);\n\n return (\n <div\n aria-atomic=\"true\"\n aria-label={message ?? undefined}\n aria-live=\"polite\"\n className=\"breeze-toast\"\n role=\"status\"\n >\n <Icon name=\"check\" size=\"sm\" />\n <span>{message}</span>\n </div>\n );\n}\n\ninterface ToastProviderBoundaryProps {\n children: ReactNode;\n limit: number;\n}\n\n/** Establishes the queue owned by one BreezeProvider instance. */\nexport function ToastProviderBoundary({\n children,\n limit,\n}: Readonly<ToastProviderBoundaryProps>) {\n const host = useOverlayPortal();\n const zIndex = useOverlayToastZIndex();\n const regionRef = useRef<HTMLDivElement>(null);\n const [isDocumentVisible, setIsDocumentVisible] = useState(\n () => typeof document === 'undefined' || !document.hidden,\n );\n const [queue, setQueue] = useState<ToastItem[]>([]);\n const nextId = useRef(0);\n const timers = useRef(new Map<number, ToastTimer>());\n const renderedToastIds = useRef(new Set<number>());\n const announcementStates = useRef(new Map<number, ToastContentState>());\n\n if (!Number.isInteger(limit) || limit < 1) {\n throw new RangeError(toastLimitError);\n }\n\n const rememberToastMessage = useCallback((id: number, message: string) => {\n const state = announcementStates.current.get(id);\n if (state !== undefined) state.message = message;\n }, []);\n const enqueue = useCallback<ToastEnqueue>(\n (message) => {\n const id = nextId.current;\n nextId.current += 1;\n announcementStates.current.set(id, {\n message: null,\n remember: (nextMessage) => rememberToastMessage(id, nextMessage),\n });\n\n setQueue((current) => [...current, { id, message }]);\n },\n [rememberToastMessage],\n );\n const expireToast = useCallback((id: number) => {\n timers.current.delete(id);\n renderedToastIds.current.delete(id);\n announcementStates.current.delete(id);\n setQueue((current) => current.filter((toast) => toast.id !== id));\n }, []);\n const clearToastTimers = useCallback(() => {\n Array.from(timers.current.values()).forEach(({ handle }) => {\n if (handle !== null) clearTimeout(handle);\n });\n timers.current.clear();\n }, []);\n const pauseToastTimer = useCallback(\n (id: number, now = Date.now()) => {\n const timer = timers.current.get(id);\n if (\n timer?.handle === null ||\n timer?.startedAt === null ||\n timer === undefined\n ) {\n return;\n }\n\n timer.remaining = Math.max(\n 0,\n timer.remaining - Math.max(0, now - timer.startedAt),\n );\n clearTimeout(timer.handle);\n timer.handle = null;\n timer.startedAt = null;\n\n if (timer.remaining === 0) {\n expireToast(id);\n }\n },\n [expireToast],\n );\n const pauseToastTimers = useCallback(() => {\n const now = Date.now();\n Array.from(timers.current.keys()).forEach((id) => {\n pauseToastTimer(id, now);\n });\n }, [pauseToastTimer]);\n const removeToastTimer = useCallback((id: number) => {\n const timer = timers.current.get(id);\n if (timer?.handle !== null && timer?.handle !== undefined) {\n clearTimeout(timer.handle);\n }\n timers.current.delete(id);\n }, []);\n const scheduleToast = useCallback(\n (id: number) => {\n const current = timers.current.get(id);\n if (\n !isDocumentVisible ||\n (typeof document !== 'undefined' && document.hidden) ||\n (current !== undefined && current.handle !== null)\n ) {\n return;\n }\n\n const timer = current ?? {\n handle: null,\n remaining: toastLifetime,\n startedAt: null,\n };\n if (timer.remaining <= 0) {\n expireToast(id);\n return;\n }\n\n timer.startedAt = Date.now();\n timer.handle = setTimeout(() => expireToast(id), timer.remaining);\n timers.current.set(id, timer);\n },\n [expireToast, isDocumentVisible],\n );\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n const visible = !document.hidden;\n if (!visible) pauseToastTimers();\n setIsDocumentVisible(visible);\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n handleVisibilityChange();\n return () =>\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, [pauseToastTimers]);\n\n useLayoutEffect(() => {\n const visible = queue.slice(0, limit);\n const visibleIds = new Set(visible.map(({ id }) => id));\n const queuedIds = new Set(queue.map(({ id }) => id));\n\n visible.forEach(({ id }) => renderedToastIds.current.add(id));\n\n Array.from(timers.current.keys()).forEach((id) => {\n if (!visibleIds.has(id)) {\n if (queuedIds.has(id)) {\n pauseToastTimer(id);\n } else {\n removeToastTimer(id);\n }\n }\n });\n }, [limit, pauseToastTimer, queue, removeToastTimer]);\n\n useEffect(() => {\n const visible = queue.slice(0, limit);\n const visibleIds = new Set(visible.map(({ id }) => id));\n const region = regionRef.current;\n if (host === null || region === null || !isDocumentVisible) {\n return undefined;\n }\n\n if (typeof IntersectionObserver === 'undefined') {\n visible.forEach((toast) => scheduleToast(toast.id));\n return undefined;\n }\n\n let observer: IntersectionObserver | undefined;\n const observe = () => {\n observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) =>\n handleToastIntersection(\n entry,\n visibleIds,\n scheduleToast,\n pauseToastTimer,\n ),\n );\n },\n { threshold: 1 },\n );\n\n Array.from(region.children).forEach((element) => {\n if (\n element instanceof HTMLElement &&\n element.dataset.breezeToastId !== undefined &&\n !element.hidden\n ) {\n observer?.observe(element);\n }\n });\n };\n const observeTask = setTimeout(observe, 0);\n\n return () => {\n clearTimeout(observeTask);\n observer?.disconnect();\n };\n }, [\n host,\n isDocumentVisible,\n limit,\n pauseToastTimer,\n queue,\n removeToastTimer,\n scheduleToast,\n ]);\n\n useEffect(() => clearToastTimers, [clearToastTimers]);\n\n const visible = queue.slice(0, limit);\n const visibleIds = new Set(visible.map(({ id }) => id));\n const rendered = queue.filter(\n ({ id }) => visibleIds.has(id) || renderedToastIds.current.has(id),\n );\n\n return (\n <ToastAnnouncementContext value={isDocumentVisible}>\n <ToastContext value={enqueue}>\n {children}\n {host &&\n createPortal(\n <div\n ref={regionRef}\n className=\"breeze-toast-region\"\n data-breeze-toast-region=\"\"\n data-live-announcer=\"\"\n data-react-aria-top-layer=\"\"\n style={{ zIndex }}\n >\n {rendered.map(({ id, message }) => {\n const demoted = !visibleIds.has(id);\n\n return (\n <div\n key={id}\n aria-hidden={demoted ? 'true' : undefined}\n data-breeze-toast-id={id}\n hidden={demoted}\n >\n <ToastContentContext\n value={announcementStates.current.get(id) ?? null}\n >\n <ToastAnnouncementContext\n value={isDocumentVisible && !demoted}\n >\n <Toast>{message}</Toast>\n </ToastAnnouncementContext>\n </ToastContentContext>\n </div>\n );\n })}\n </div>,\n host,\n )}\n </ToastContext>\n </ToastAnnouncementContext>\n );\n}\n\n/** Enqueues a confirmation in the nearest BreezeProvider. */\nexport function useToast(): ToastEnqueue {\n const enqueue = useContext(ToastContext);\n\n if (enqueue === null) {\n throw new Error(toastProviderError);\n }\n\n return enqueue;\n}\n","import type { ButtonHTMLAttributes, Ref } from 'react';\nimport type { ControlSize } from '../Button/Button';\nimport SelectionControl from '../SelectionControl/SelectionControl';\n\nconst variants = {\n base: {\n toggle:\n 'breeze:inline-grid breeze:items-center breeze:justify-center breeze:rounded-breeze-ctl breeze:border breeze:border-solid breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:font-breeze-sans breeze:font-semibold breeze:text-breeze-ink breeze:cursor-pointer breeze:select-none breeze:outline-offset-2 breeze:data-[hovered]:bg-breeze-sunken breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n },\n compound: {},\n size: {\n lg: 'breeze:min-block-breeze-lg breeze:ps-breeze-5 breeze:pe-breeze-5 breeze:py-breeze-3 breeze:text-breeze-sm',\n md: 'breeze:min-block-breeze-md breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:text-breeze-sm',\n sm: 'breeze:min-block-breeze-sm breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-1 breeze:text-breeze-xs',\n },\n state: {\n pressed:\n 'breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\ninterface ToggleCommonProps {\n /** Provides an accessible name when it differs from the visible label. */\n 'aria-label'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-label'];\n /** Identifies elements that provide additional information about the toggle. */\n 'aria-describedby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-describedby'];\n /** Identifies elements whose text provides the toggle's accessible name. */\n 'aria-labelledby'?: ButtonHTMLAttributes<HTMLButtonElement>['aria-labelledby'];\n /** Visible label and default accessible name. */\n children: string;\n /** Prevents the toggle from being activated. Defaults to `false`. */\n disabled?: boolean;\n /** Sets the rendered button's HTML `id`. */\n id?: ButtonHTMLAttributes<HTMLButtonElement>['id'];\n /** Shows a placeholder while a pressed-state change is being saved. */\n loading?: boolean;\n /** Provides access to the rendered button element. */\n ref?: Ref<HTMLButtonElement>;\n /** Selects the toggle's dimensions. Defaults to `md`. */\n size?: ControlSize;\n}\n\ninterface ControlledToggleProps {\n /** Current pressed state. */\n pressed: boolean;\n /** Reports the next pressed state. */\n onChange: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n defaultPressed?: never;\n}\n\ninterface UncontrolledToggleProps {\n /** Initial pressed state. Defaults to `false`. */\n defaultPressed?: boolean;\n /** Reports the next pressed state. */\n onChange?: (pressed: boolean) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n pressed?: never;\n}\n\n/** Props for controlled or uncontrolled button-like pressed state. */\nexport type ToggleProps = ToggleCommonProps &\n (ControlledToggleProps | UncontrolledToggleProps);\n\n/**\n * Renders a button for a binary choice.\n *\n * @summary An on/off choice with a pressed state.\n */\nexport function Toggle({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n defaultPressed,\n disabled = false,\n id,\n loading = false,\n onChange,\n pressed,\n ref,\n size = 'md',\n}: Readonly<ToggleProps>) {\n return (\n <SelectionControl\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={[\n variants.base.toggle,\n variants.size[size],\n variants.state.pressed,\n ].join(' ')}\n defaultPressed={defaultPressed}\n disabled={disabled}\n id={id}\n loading={loading}\n onChange={onChange}\n pressed={pressed}\n ref={ref}\n >\n {children}\n </SelectionControl>\n );\n}\n","import type { HTMLAttributes } from 'react';\nimport { useState } from 'react';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { Badge } from '../Badge/Badge';\nimport type { ControlSize } from '../Button/Button';\nimport type { ItemDescriptor } from '../Collection/item.types';\nimport { Icon } from '../Icon/Icon';\nimport SelectionControl from '../SelectionControl/SelectionControl';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n description:\n 'breeze:text-breeze-2xs breeze:font-normal breeze:leading-breeze-snug breeze:text-breeze-ink-3',\n group:\n 'breeze:inline-flex breeze:items-center breeze:gap-breeze-1 breeze:rounded-breeze-ctl breeze:bg-breeze-sunken breeze:p-breeze-1 breeze:font-breeze-sans',\n item: 'breeze:inline-grid breeze:items-center breeze:justify-center breeze:gap-breeze-2 breeze:rounded-breeze-sm breeze:border breeze:border-solid breeze:border-transparent breeze:font-semibold breeze:text-breeze-ink-2 breeze:cursor-pointer breeze:select-none breeze:outline-offset-[-2px] breeze:data-[hovered]:bg-breeze-raised breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60 breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap',\n label: 'breeze:font-medium',\n optionContent: 'breeze:flex breeze:min-inline-size-0 breeze:flex-col',\n optionDetails: 'breeze:inline-flex breeze:items-center breeze:gap-breeze-2',\n },\n compound: {},\n size: {\n lg: 'breeze:min-block-breeze-lg breeze:ps-breeze-4 breeze:pe-breeze-4 breeze:py-breeze-2 breeze:text-breeze-sm',\n md: 'breeze:min-block-breeze-md breeze:ps-breeze-3 breeze:pe-breeze-3 breeze:py-breeze-2 breeze:text-breeze-sm',\n sm: 'breeze:min-block-breeze-sm breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:py-breeze-1 breeze:text-breeze-xs',\n },\n state: {\n selected:\n 'breeze:data-[selected]:border-breeze-line-strong breeze:data-[selected]:bg-breeze-surface breeze:data-[selected]:text-breeze-ink breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2',\n },\n variant: {},\n} as const;\n\ninterface ToggleGroupCommonProps<T> {\n /** Names the group when it has no visible heading. */\n 'aria-label': HTMLAttributes<HTMLFieldSetElement>['aria-label'];\n /** Identifies elements that provide additional information about the group. */\n 'aria-describedby'?: HTMLAttributes<HTMLFieldSetElement>['aria-describedby'];\n /** Prevents every option in the group from being activated. */\n disabled?: boolean;\n /** Supplies the display details for an option. */\n getItem: (item: T) => ItemDescriptor;\n /** Sets the rendered group's HTML `id`. */\n id?: HTMLAttributes<HTMLFieldSetElement>['id'];\n /** The available options. */\n items: T[];\n /** Shows placeholders while a selection change is being saved. */\n loading?: boolean;\n /** Selects the group's dimensions. Defaults to `md`. */\n size?: ControlSize;\n}\n\ninterface ControlledToggleGroupProps<T> {\n /** Current selected option, or `null` when none is pressed. */\n selected: T | null;\n /** Reports the selected option or `null` when cleared. */\n onChange: (selected: T | null) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n defaultSelected?: never;\n}\n\ninterface UncontrolledToggleGroupProps<T> {\n /** Initial selected option. Defaults to no selection. */\n defaultSelected?: T | null;\n /** Reports the selected option or `null` when cleared. */\n onChange?: (selected: T | null) => void;\n /** Controlled and uncontrolled state props are mutually exclusive. */\n selected?: never;\n}\n\n/** Props for controlled or uncontrolled single-choice segmented selection. */\nexport type ToggleGroupProps<T> = ToggleGroupCommonProps<T> &\n (ControlledToggleGroupProps<T> | UncontrolledToggleGroupProps<T>);\n\ninterface DecoratedItem<T> {\n descriptor: ItemDescriptor;\n item: T;\n}\n\n/**\n * Renders a set of connected options with a single selection.\n *\n * @summary A single selection from connected options.\n */\nexport function ToggleGroup<T>({\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n defaultSelected,\n disabled = false,\n getItem,\n id,\n items,\n loading = false,\n onChange,\n selected,\n size = 'md',\n}: Readonly<ToggleGroupProps<T>>) {\n const { getMessageLocale, messages } = useBreezeContext();\n\n const [uncontrolledSelectedKey, setUncontrolledSelectedKey] = useState<\n string | null\n >(() =>\n defaultSelected === undefined || defaultSelected === null\n ? null\n : getItem(defaultSelected).id,\n );\n const decoratedItems: DecoratedItem<T>[] = items.map((item) => ({\n descriptor: getItem(item),\n item,\n }));\n let selectedKey = uncontrolledSelectedKey;\n if (selected !== undefined) {\n selectedKey = selected === null ? null : getItem(selected).id;\n }\n\n return (\n <>\n <fieldset\n aria-describedby={ariaDescribedBy}\n aria-busy={loading || undefined}\n className={`${variants.base.group} breeze:border-0 breeze:m-0 breeze:min-inline-size-0`}\n disabled={disabled}\n id={id}\n >\n <legend className=\"breeze:sr-only\">{ariaLabel}</legend>\n {decoratedItems.map(({ descriptor, item }) => (\n <SelectionControl\n key={descriptor.id}\n announceLoading={false}\n className={[\n variants.base.item,\n variants.size[size],\n variants.state.selected,\n ].join(' ')}\n disabled={disabled || descriptor.disabled === true}\n loading={loading}\n onChange={(pressed) => {\n if (selected === undefined) {\n setUncontrolledSelectedKey(pressed ? descriptor.id : null);\n }\n\n onChange?.(pressed ? item : null);\n }}\n pressed={selectedKey === descriptor.id}\n >\n <span className={variants.base.optionDetails}>\n {descriptor.icon && <Icon name={descriptor.icon} size=\"sm\" />}\n <span className={variants.base.optionContent}>\n <span className={variants.base.label}>{descriptor.label}</span>\n {descriptor.description && (\n <span className={variants.base.description}>\n {descriptor.description}\n </span>\n )}\n </span>\n {descriptor.badge && (\n <Badge\n aria-label={descriptor.badge['aria-label']}\n variant={descriptor.badge.variant}\n >\n {descriptor.badge.children}\n </Badge>\n )}\n </span>\n </SelectionControl>\n ))}\n </fieldset>\n {loading && (\n <span className=\"breeze:sr-only\">\n <Skeleton label={messages.loading} />\n </span>\n )}\n <output\n aria-live=\"polite\"\n className=\"breeze:sr-only\"\n lang={getMessageLocale('loading')}\n >\n {loading ? messages.loading : ''}\n </output>\n </>\n );\n}\n","const enGB = {\n appearance: 'Appearance',\n appearanceAutomatic: 'Auto',\n appearanceDark: 'Dark',\n appearanceLight: 'Light',\n close: 'Close',\n loading: 'Loading',\n noItemsToDisplay: 'No items to display.',\n required: 'Required',\n selectDate: 'Select a date',\n};\n\nexport default enGB;\n","import type { ReactNode } from 'react';\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\nimport { I18nProvider, useLocale } from 'react-aria-components/I18nProvider';\nimport { OverlayProvider } from '../overlays/OverlayProvider';\nimport { ToastProviderBoundary } from '../primitives/Toast/Toast';\nimport { type Appearance, BreezeContext } from './BreezeContext';\nimport enGB from './en-GB';\n\ninterface BreezeProviderBaseProps {\n /** Breeze components and application content rendered inside the provider. */\n children: ReactNode;\n /** BCP 47 locale for accessible interactions and content formatting. */\n locale: string;\n /** Accessible messages translated into the provider locale; defaults to English. */\n messages?: Partial<typeof enGB>;\n /**\n * Container for the provider-owned overlay host; defaults to document.body.\n * The container must belong to the same document as the overlay triggers.\n */\n portalContainer?: HTMLElement;\n /** Maximum number of visible confirmations; additional messages wait in FIFO order. */\n toastLimit?: number;\n}\n\ninterface ControlledAppearanceProps {\n /** The application-owned appearance choice. */\n appearance: Appearance;\n /** Unavailable when `appearance` is controlled by the application. */\n defaultAppearance?: never;\n /** Reports a semantic appearance choice so the application can persist it. */\n onAppearanceChange: (appearance: Appearance) => void;\n}\n\ninterface UncontrolledAppearanceProps {\n /** Unavailable when the provider manages its own appearance state. */\n appearance?: never;\n /** The initial appearance choice; defaults to automatic. */\n defaultAppearance?: Appearance;\n /** Reports a semantic appearance choice without persisting it. */\n onAppearanceChange?: (appearance: Appearance) => void;\n}\n\n/** The required locale and appearance boundary for Breeze components. */\nexport type BreezeProviderProps = BreezeProviderBaseProps &\n (ControlledAppearanceProps | UncontrolledAppearanceProps);\n\nfunction resolveAppearance(appearance: Appearance, prefersDark: boolean) {\n if (appearance === 'automatic') {\n return prefersDark ? 'dark' : 'light';\n }\n\n return appearance;\n}\n\nfunction BreezeRoot({\n children,\n}: Readonly<Pick<BreezeProviderProps, 'children'>>) {\n const { direction, locale } = useLocale();\n\n return (\n <div data-breeze-root=\"\" dir={direction} lang={locale}>\n {children}\n </div>\n );\n}\n\n/**\n * Establishes the required locale and styling boundary.\n *\n * @summary Required locale and styling boundary for Breeze components.\n */\nexport function BreezeProvider({\n appearance: controlledAppearance,\n children,\n defaultAppearance = 'automatic',\n locale,\n messages,\n onAppearanceChange,\n portalContainer,\n toastLimit = 3,\n}: Readonly<BreezeProviderProps>) {\n const [preferredColorSchemeQuery] = useState(() =>\n typeof window === 'undefined' || !window.matchMedia\n ? null\n : window.matchMedia('(prefers-color-scheme: dark)'),\n );\n const [prefersDark, setPrefersDark] = useState(\n () => preferredColorSchemeQuery?.matches ?? false,\n );\n const [uncontrolledAppearance, setUncontrolledAppearance] =\n useState(defaultAppearance);\n const appearance = controlledAppearance ?? uncontrolledAppearance;\n const resolvedAppearance = resolveAppearance(appearance, prefersDark);\n\n useEffect(() => {\n if (!preferredColorSchemeQuery) {\n return undefined;\n }\n\n setPrefersDark(preferredColorSchemeQuery.matches);\n\n const handleChange = (event: MediaQueryListEvent) => {\n setPrefersDark(event.matches);\n };\n\n preferredColorSchemeQuery.addEventListener('change', handleChange);\n\n return () =>\n preferredColorSchemeQuery.removeEventListener('change', handleChange);\n }, [preferredColorSchemeQuery]);\n\n useLayoutEffect(() => {\n const { documentElement } = document;\n const previousTheme = documentElement.dataset.theme;\n const previousColorScheme = documentElement.style.colorScheme;\n\n documentElement.dataset.theme = resolvedAppearance;\n documentElement.style.colorScheme = resolvedAppearance;\n\n return () => {\n if (previousTheme === undefined) {\n delete documentElement.dataset.theme;\n } else {\n documentElement.dataset.theme = previousTheme;\n }\n\n documentElement.style.colorScheme = previousColorScheme;\n };\n }, [resolvedAppearance]);\n\n const setAppearance = useCallback(\n (nextAppearance: Appearance) => {\n if (controlledAppearance === undefined) {\n setUncontrolledAppearance(nextAppearance);\n }\n\n onAppearanceChange?.(nextAppearance);\n },\n [controlledAppearance, onAppearanceChange],\n );\n const getMessageLocale = useCallback(\n (message: keyof typeof enGB) =>\n messages?.[message] === undefined ? 'en-GB' : locale,\n [locale, messages],\n );\n\n const context = useMemo(\n () => ({\n appearance,\n getMessageLocale,\n locale,\n messages: {\n appearance: messages?.appearance ?? enGB.appearance,\n appearanceAutomatic:\n messages?.appearanceAutomatic ?? enGB.appearanceAutomatic,\n appearanceDark: messages?.appearanceDark ?? enGB.appearanceDark,\n appearanceLight: messages?.appearanceLight ?? enGB.appearanceLight,\n close: messages?.close ?? enGB.close,\n loading: messages?.loading ?? enGB.loading,\n noItemsToDisplay: messages?.noItemsToDisplay ?? enGB.noItemsToDisplay,\n required: messages?.required ?? enGB.required,\n selectDate: messages?.selectDate ?? enGB.selectDate,\n },\n resolvedAppearance,\n setAppearance,\n }),\n [\n appearance,\n getMessageLocale,\n locale,\n messages,\n resolvedAppearance,\n setAppearance,\n ],\n );\n\n return (\n <I18nProvider locale={locale}>\n <BreezeContext value={context}>\n <OverlayProvider locale={locale} portalContainer={portalContainer}>\n <ToastProviderBoundary limit={toastLimit}>\n <BreezeRoot>{children}</BreezeRoot>\n </ToastProviderBoundary>\n </OverlayProvider>\n </BreezeContext>\n </I18nProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAa,KAAgB,EAAyC,IAAI;AAE1E,SAAgB,IAAuC;CACrD,IAAM,IAAU,EAAW,EAAa;CAExC,IAAI,MAAY,MACd,MAAU,MACR,2DACF;CAGF,OAAO;AACT;;;ACpBA,IAAM,KAAW;CACf,MAAM;EACJ,SACE;EACF,OAAO;EACP,OAAO;EACP,QACE;CACJ;CACA,UAAU,CAAC;CACX,MAAM,CAAC;CACP,OAAO,EACL,UACE,4OACJ;CACA,SAAS,CAAC;AACZ,GAEM,KAAoB;CACxB;EACE,SAAS;EACT,OAAO;CACT;CAC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