@motech-development/breeze-ui 4.6.0 → 4.6.1

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/layout.accessibility.ts","../src/primitives/Card/Card.tsx","../src/primitives/Field/field.styles.ts","../src/primitives/Field/field.presentation.tsx","../src/primitives/Checkbox/Checkbox.tsx","../src/overlays/OverlayStack.ts","../src/overlays/OverlayProvider.tsx","../src/primitives/Collection/CollectionPopover.tsx","../src/primitives/Collection/collection.styles.ts","../src/primitives/Icon/Icon.tsx","../src/primitives/Collection/DescriptorContent.tsx","../src/primitives/Collection/DescriptorOption.tsx","../src/primitives/ComboBox/ComboBox.tsx","../src/primitives/Container/Container.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/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/Typography/Typography.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","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","/** 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 { 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}\n\nexport function FieldLabel({\n htmlFor,\n id,\n label,\n loading,\n}: Readonly<FieldLabelProps>) {\n return (\n <AriaLabel className={fieldVariants.base.label} htmlFor={htmlFor} id={id}>\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 {\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 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 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 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","/** 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 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 { 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, SyntheticEvent } from 'react';\nimport {\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} 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 { flushSync } from 'react-dom';\nimport { useBreezeContext } from '../../provider/BreezeContext';\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\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 descriptor: ItemDescriptor;\n item: T;\n}\n\ninterface ControlledSelection {\n id: string | null;\n label: string;\n}\n\ntype ComboBoxChangeKey = string | number | null;\ntype ComboBoxStateValue =\n | ComboBoxChangeKey\n | readonly ComboBoxChangeKey[]\n | undefined;\n\nfunction isComboBoxKeyArray(\n value: ComboBoxStateValue,\n): value is readonly ComboBoxChangeKey[] {\n return Array.isArray(value);\n}\n\nfunction getComboBoxKey(value: ComboBoxStateValue): ComboBoxChangeKey {\n if (isComboBoxKeyArray(value)) return value[0] ?? null;\n\n return value ?? null;\n}\n\nfunction sameComboBoxKey(left: ComboBoxChangeKey, right: ComboBoxChangeKey) {\n return (\n left === right ||\n (left !== null && right !== null && String(left) === String(right))\n );\n}\n\nfunction itemKey<T>(item: ComboBoxItem<T>) {\n return item.descriptor.id;\n}\n\nfunction resolveComboBoxItem<T>(\n key: ComboBoxChangeKey,\n decoratedItems: ComboBoxItem<T>[],\n initialControlledItem: ComboBoxItem<T> | undefined,\n defaultSelectedItem: ComboBoxItem<T> | undefined,\n) {\n const stringKey = String(key);\n const decoratedItem = decoratedItems.find(\n (item) => itemKey(item) === stringKey,\n );\n\n if (decoratedItem) return decoratedItem;\n if (initialControlledItem?.descriptor.id === stringKey) {\n return initialControlledItem;\n }\n\n if (defaultSelectedItem?.descriptor.id === stringKey) {\n return defaultSelectedItem;\n }\n\n return undefined;\n}\n\nfunction getComboBoxValueForKey<T>(\n key: ComboBoxChangeKey,\n value: ComboBoxValue<T> | undefined,\n selectedKey: string | null,\n decoratedItems: ComboBoxItem<T>[],\n initialControlledItem: ComboBoxItem<T> | undefined,\n defaultSelectedItem: ComboBoxItem<T> | undefined,\n allowsCustomValue: boolean,\n) {\n if (key === null) return null;\n\n if (\n value !== undefined &&\n sameComboBoxKey(key, selectedKey) &&\n !(typeof value === 'string' && allowsCustomValue)\n ) {\n return value as T;\n }\n\n const nextItem = resolveComboBoxItem(\n key,\n decoratedItems,\n initialControlledItem,\n defaultSelectedItem,\n );\n\n if (nextItem) return nextItem.item;\n\n return null;\n}\n\nfunction getSelectedKey<T>(\n value: ComboBoxValue<T> | undefined,\n selectedItem: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n if (selectedItem) return itemKey(selectedItem);\n if (\n value === undefined ||\n value === null ||\n (typeof value === 'string' && allowsCustomValue)\n ) {\n return null;\n }\n\n return getItem(value as T).id;\n}\n\nfunction getControlledTextValue<T>(\n value: ComboBoxValue<T>,\n selectedItem: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n if (value === null) return '';\n if (selectedItem) return selectedItem.descriptor.label;\n if (typeof value === 'string' && allowsCustomValue) return value;\n return getItem(value as T).label;\n}\n\nfunction findItem<T>(\n items: ComboBoxItem<T>[],\n value: ComboBoxValue<T>,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue = false,\n) {\n if (value === null) {\n return undefined;\n }\n\n const directItem = items.find(({ item }) => item === value);\n\n if (directItem) {\n return directItem;\n }\n\n if (typeof value === 'string' && allowsCustomValue) return undefined;\n\n const valueId = getItem(value as T).id;\n\n return items.find(({ descriptor }) => descriptor.id === valueId);\n}\n\nfunction getInitialControlledItem<T>(\n value: ComboBoxValue<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n if (\n value === undefined ||\n value === null ||\n (allowsCustomValue && typeof value === 'string')\n ) {\n return undefined;\n }\n\n return {\n descriptor: getItem(value as T),\n item: value as T,\n };\n}\n\nfunction getInitialResetValue<T>(\n initiallyControlled: boolean,\n initialControlledValue: ComboBoxValue<T> | undefined,\n initialControlledItem: ComboBoxItem<T> | undefined,\n decoratedItems: ComboBoxItem<T>[],\n initialDefaultValue: ComboBoxValue<T> | undefined,\n) {\n if (!initiallyControlled) return initialDefaultValue;\n if (!initialControlledItem) return initialControlledValue;\n\n const refreshedInitialControlledItem = decoratedItems.find(\n ({ descriptor }) => descriptor.id === initialControlledItem.descriptor.id,\n );\n\n return refreshedInitialControlledItem?.item ?? initialControlledValue;\n}\n\ninterface ComboBoxResetValue {\n key: string | null;\n text: string;\n}\n\nfunction getComboBoxResetValue<T>(\n value: ComboBoxValue<T> | undefined,\n decoratedItems: ComboBoxItem<T>[],\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n): ComboBoxResetValue {\n if (value === undefined || value === null) {\n return { key: null, text: '' };\n }\n\n if (allowsCustomValue && typeof value === 'string') {\n return { key: null, text: value };\n }\n\n const selectedItem = findItem(\n decoratedItems,\n value,\n getItem,\n allowsCustomValue,\n );\n const descriptor = selectedItem?.descriptor ?? getItem(value as T);\n\n return {\n key: descriptor.id,\n text: descriptor.label,\n };\n}\n\ninterface ComboBoxPopoverProps<T> {\n allowsCustomValue: boolean;\n getItem: (item: T) => ItemDescriptor;\n hasSuggestions: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n items: T[];\n triggerRef: RefObject<Element | null>;\n}\n\ninterface ComboBoxListBoxProps<T> {\n getItem: (item: T) => ItemDescriptor;\n items: T[];\n}\n\nfunction ComboBoxListBox<T>({\n getItem,\n items,\n}: Readonly<ComboBoxListBoxProps<T>>) {\n return (\n <AriaListBox items={items}>\n {(item: T) => <DescriptorOption descriptor={getItem(item)} />}\n </AriaListBox>\n );\n}\n\nfunction ComboBoxPopover<T>({\n allowsCustomValue,\n getItem,\n hasSuggestions,\n isDisabled,\n isReadOnly,\n items,\n triggerRef,\n}: Readonly<ComboBoxPopoverProps<T>>) {\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 getItem={getItem} items={items} />\n </CollectionPopover>\n );\n}\n\nfunction ComboBoxReadOnlyReset({\n allowsCustomValue,\n currentTextValue,\n isControlled,\n isReadOnly,\n resetTextValue,\n}: Readonly<{\n allowsCustomValue: boolean;\n currentTextValue: string;\n isControlled: boolean;\n isReadOnly: boolean;\n resetTextValue: string;\n}>) {\n const state = useContext(AriaComboBoxStateContext);\n const wasReadOnly = useRef(isReadOnly);\n const committedCustomValue = useRef(resetTextValue);\n const wasFocused = useRef(state?.isFocused ?? false);\n const wasOpen = useRef(state?.isOpen ?? false);\n\n useLayoutEffect(() => {\n const committedOnBlur =\n state !== null && wasFocused.current && !state.isFocused;\n\n if (\n !allowsCustomValue &&\n state &&\n !isControlled &&\n state.value !== null &&\n state.inputValue === '' &&\n state.inputValue !== currentTextValue\n ) {\n state.setInputValue(currentTextValue);\n }\n\n if (allowsCustomValue && state && !isReadOnly && state.value === null) {\n const committedOnClose = wasOpen.current && !state.isOpen;\n\n if (committedOnBlur || committedOnClose) {\n committedCustomValue.current = state.inputValue;\n }\n }\n\n if (\n !allowsCustomValue &&\n state &&\n !state.isFocused &&\n state.value !== null &&\n (committedOnBlur || state.inputValue === '') &&\n state.inputValue !== currentTextValue\n ) {\n state.setInputValue(currentTextValue);\n }\n\n wasFocused.current = state?.isFocused ?? false;\n wasOpen.current = state?.isOpen ?? false;\n }, [allowsCustomValue, currentTextValue, isControlled, isReadOnly, state]);\n\n useLayoutEffect(() => {\n if (isReadOnly && !wasReadOnly.current) {\n if (allowsCustomValue && state?.value === null) {\n let resetValue = committedCustomValue.current;\n if (isControlled) {\n resetValue = currentTextValue;\n } else if (state.isFocused && !state.isOpen) {\n resetValue = state.inputValue;\n }\n state.setInputValue(resetValue);\n } else {\n state?.revert();\n }\n }\n\n wasReadOnly.current = isReadOnly;\n }, [\n allowsCustomValue,\n currentTextValue,\n isControlled,\n isReadOnly,\n resetTextValue,\n state,\n ]);\n\n return null;\n}\n\ninterface ComboBoxInputProps<T> {\n allowsCustomValue: boolean;\n autoComplete?: string;\n autoFocus?: boolean;\n 'aria-describedby'?: string;\n className: string;\n disabled: boolean;\n form?: string;\n beginFormReset: () => void;\n getItem: (item: T) => ItemDescriptor;\n handleFormReset: (event: Event, state: ComboBoxResetState) => void;\n items: T[];\n loading: boolean;\n placeholder?: string;\n readOnly: boolean;\n}\n\ninterface ComboBoxResetState {\n defaultInputValue: string;\n defaultValue: ComboBoxChangeKey;\n isActive: () => boolean;\n isOpen: boolean;\n inputValue: string;\n setInputValue: (value: string) => void;\n setOpen: (isOpen: boolean) => void;\n setValue: (value: ComboBoxChangeKey) => void;\n value: ComboBoxChangeKey;\n}\n\nfunction ComboBoxInput<T>({\n allowsCustomValue,\n autoComplete,\n autoFocus,\n 'aria-describedby': ariaDescribedBy,\n className,\n disabled,\n form,\n beginFormReset,\n getItem,\n handleFormReset,\n items,\n loading,\n placeholder,\n readOnly,\n}: Readonly<ComboBoxInputProps<T>>) {\n const state = useContext(AriaComboBoxStateContext);\n const inputRef = useRef<HTMLInputElement>(null);\n const beginFormResetRef = useRef(beginFormReset);\n const formResetHandlerRef = useRef(handleFormReset);\n const stateRef = useRef(state);\n const handledAutofillEvent = useRef<Event | null>(null);\n\n useLayoutEffect(() => {\n beginFormResetRef.current = beginFormReset;\n formResetHandlerRef.current = handleFormReset;\n stateRef.current = state;\n }, [beginFormReset, handleFormReset, state]);\n\n useLayoutEffect(() => {\n let active = true;\n const getResetState = (event: Event) => {\n const associatedForm = form\n ? document.getElementById(form)\n : inputRef.current?.form;\n const currentState = stateRef.current;\n\n if (\n !(associatedForm instanceof HTMLFormElement) ||\n event.target !== associatedForm ||\n !currentState\n ) {\n return null;\n }\n\n return {\n defaultInputValue: currentState.defaultInputValue,\n defaultValue: getComboBoxKey(currentState.defaultValue),\n inputValue: currentState.inputValue,\n isActive: () => active,\n isOpen: currentState.isOpen,\n setInputValue: (value: string) => currentState.setInputValue(value),\n setOpen: (isOpen: boolean) => currentState.setOpen(isOpen),\n setValue: (value: ComboBoxChangeKey) => currentState.setValue(value),\n value: getComboBoxKey(currentState.value),\n } satisfies ComboBoxResetState;\n };\n const handleReset = (event: Event) => {\n const resetState = getResetState(event);\n if (!resetState) return;\n\n flushSync(() => undefined);\n formResetHandlerRef.current(event, resetState);\n };\n const captureReset = (event: Event) => {\n if (getResetState(event)) {\n beginFormResetRef.current();\n }\n };\n\n document.addEventListener('reset', captureReset, true);\n document.addEventListener('reset', handleReset);\n\n return () => {\n active = false;\n document.removeEventListener('reset', captureReset, true);\n document.removeEventListener('reset', handleReset);\n };\n }, [form]);\n\n const handleBlockedInput = (event: SyntheticEvent<HTMLInputElement>) => {\n if (!disabled && !readOnly) return;\n\n if (state) {\n const { currentTarget } = event;\n currentTarget.value = state.inputValue;\n }\n\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleAutofill = (event: SyntheticEvent<HTMLInputElement>) => {\n if (allowsCustomValue || disabled || readOnly || !state) return;\n\n const { nativeEvent } = event;\n if (handledAutofillEvent.current === nativeEvent) return;\n\n const { inputType } = nativeEvent as InputEvent;\n if (inputType && inputType !== 'insertReplacementText') return;\n\n handledAutofillEvent.current = nativeEvent;\n const input = event.currentTarget;\n\n const matchingItems = items\n .map((item) => ({ descriptor: getItem(item), item }))\n .filter(\n ({ descriptor }) =>\n (descriptor.id === input.value || descriptor.label === input.value) &&\n !descriptor.disabled,\n );\n\n if (matchingItems.length !== 1) return;\n\n const [nextItem] = matchingItems;\n if (state.value === nextItem.descriptor.id) {\n input.value = nextItem.descriptor.label;\n state.setInputValue(nextItem.descriptor.label);\n return;\n }\n\n state.setInputValue(nextItem.descriptor.label);\n state.setValue(nextItem.descriptor.id);\n };\n\n return (\n <AriaInput\n aria-busy={loading || undefined}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n className={className}\n form={form}\n onChange={handleAutofill}\n onChangeCapture={handleBlockedInput}\n onInput={handleAutofill}\n onInputCapture={handleBlockedInput}\n placeholder={placeholder}\n readOnly={readOnly || undefined}\n ref={inputRef}\n />\n );\n}\n\nfunction getDefaultTextValue<T>(\n value: ComboBoxValue<T> | undefined,\n selectedItem: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n) {\n if (value === null || value === undefined) return undefined;\n if (selectedItem) return selectedItem.descriptor.label;\n if (typeof value === 'string' && allowsCustomValue) return value;\n return getItem(value as T).label;\n}\n\nfunction matchesControlledCustomValue<T>(\n value: ComboBoxValue<T> | undefined,\n pendingValue: string | null | undefined,\n) {\n return pendingValue !== undefined && value === pendingValue;\n}\n\nfunction getControlledSelectionDescriptor<T>(\n value: ComboBoxValue<T>,\n selectedItem: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n pendingCustomValue: string | null | undefined,\n) {\n if (typeof value === 'string' && allowsCustomValue) {\n if (matchesControlledCustomValue(value, pendingCustomValue)) {\n return undefined;\n }\n\n return selectedItem?.descriptor;\n }\n\n if (selectedItem || value === null) {\n return selectedItem?.descriptor;\n }\n\n return getItem(value as T);\n}\n\nfunction matchesControlledSelection(\n current: ControlledSelection | null,\n next: ControlledSelection | null,\n) {\n return (\n current !== null &&\n next !== null &&\n current.id === next.id &&\n current.label === next.label\n );\n}\n\nfunction canDraftControlledValue<T>(\n value: ComboBoxValue<T> | undefined,\n selectedItem: ComboBoxItem<T> | undefined,\n allowsCustomValue: boolean,\n) {\n return (\n value !== undefined &&\n (value === null\n ? !allowsCustomValue\n : selectedItem !== undefined ||\n !allowsCustomValue ||\n typeof value !== 'string')\n );\n}\n\ninterface ControlledSelectionUpdate {\n resetLabel?: string;\n selection: ControlledSelection | null;\n}\n\nfunction getControlledSelectionUpdate<T>(\n value: ComboBoxValue<T> | undefined,\n selectedItem: ComboBoxItem<T> | undefined,\n getItem: (item: T) => ItemDescriptor,\n previousSelection: ControlledSelection | null,\n allowsCustomValue: boolean,\n pendingCustomValue: string | null | undefined,\n): ControlledSelectionUpdate {\n if (value === undefined) {\n return { selection: null };\n }\n\n const descriptor = getControlledSelectionDescriptor(\n value,\n selectedItem,\n getItem,\n allowsCustomValue,\n pendingCustomValue,\n );\n const nextSelection = {\n id: descriptor?.id ?? null,\n label: descriptor?.label ?? (typeof value === 'string' ? value : ''),\n };\n\n return {\n resetLabel:\n previousSelection !== null &&\n (previousSelection.id !== nextSelection.id ||\n previousSelection.label !== nextSelection.label)\n ? nextSelection.label\n : undefined,\n selection: nextSelection,\n };\n}\n\nfunction getVisibleItems<T>(\n items: T[],\n decoratedItems: ComboBoxItem<T>[],\n filterText: string,\n contains: (value: string, search: string) => boolean,\n) {\n const query = filterText.trim();\n\n if (!query) return items;\n\n return decoratedItems\n .filter(({ descriptor }) => contains(descriptor.label, query))\n .map(({ item }) => item);\n}\n\nfunction isSelectionResetInput<T>(\n inputValue: string,\n selectionResetLabel: string | null,\n value: ComboBoxValue<T> | undefined,\n selectedItem: ComboBoxItem<T> | undefined,\n) {\n return (\n (selectionResetLabel !== null && inputValue === selectionResetLabel) ||\n (value !== undefined && selectedItem?.descriptor.label === inputValue)\n );\n}\n\ninterface ComboBoxSelection<T> {\n baseControlledTextValue: string | undefined;\n selectedItem: ComboBoxItem<T> | undefined;\n selectedKey: string | null;\n}\n\nfunction getComboBoxSelection<T>(\n value: ComboBoxValue<T> | undefined,\n pendingCustomText: boolean,\n retainedUncontrolledSelectedItem: ComboBoxItem<T> | undefined,\n uncontrolledSelectedKey: string | null,\n decoratedItems: ComboBoxItem<T>[],\n getItem: (item: T) => ItemDescriptor,\n allowsCustomValue: boolean,\n): ComboBoxSelection<T> {\n let selectedItem: ComboBoxItem<T> | undefined;\n if (value === undefined) {\n selectedItem = retainedUncontrolledSelectedItem;\n } else if (pendingCustomText) {\n selectedItem = undefined;\n } else {\n selectedItem = findItem(decoratedItems, value, getItem, allowsCustomValue);\n }\n\n return {\n baseControlledTextValue:\n value === undefined\n ? undefined\n : getControlledTextValue(\n value,\n selectedItem,\n getItem,\n allowsCustomValue,\n ),\n selectedItem,\n selectedKey:\n value === undefined\n ? uncontrolledSelectedKey\n : getSelectedKey(value, selectedItem, getItem, allowsCustomValue),\n };\n}\n\ninterface ComboBoxModel<T> {\n collectionItems: T[];\n controlledTextValue: string | undefined;\n currentTextValue: string;\n defaultSelectedKey: string | undefined;\n defaultTextValue: string | undefined;\n beginFormReset: () => void;\n handleFormReset: (event: Event, state: ComboBoxResetState) => void;\n handleInputChange: (inputValue: string) => void;\n handleOpenChange: (isOpen: boolean) => void;\n handleValueChange: (key: ComboBoxChangeKey) => void;\n matchesFilter: (textValue: string) => boolean;\n selectedKey: string | null;\n}\n\nfunction useComboBoxModel<T>(\n props: Readonly<ComboBoxProps<T>>,\n): ComboBoxModel<T> {\n const {\n allowsCustomValue = false,\n defaultValue,\n getItem,\n items,\n onChange,\n readOnly = false,\n value,\n } = props;\n const [filterText, setFilterText] = useState('');\n const [controlledInputDraft, setControlledInputDraft] = useState<\n string | undefined\n >();\n const [initialControlledItem] = useState<ComboBoxItem<T> | undefined>(() =>\n getInitialControlledItem(value, getItem, allowsCustomValue),\n );\n const [initialControlledValue] = useState<ComboBoxValue<T> | undefined>(\n () => value,\n );\n const [initiallyControlled] = useState(() => value !== undefined);\n const [initialDefaultValue] = useState<ComboBoxValue<T> | undefined>(\n () => defaultValue,\n );\n const controlledSelectionRef = useRef<ControlledSelection | null>(null);\n const controlledDraftSelectionRef = useRef<ControlledSelection | null>(null);\n const pendingCustomValueRef = useRef<string | null | undefined>(undefined);\n const selectionResetLabelRef = useRef<string | null>(null);\n const lastCustomChangeRef = useRef<ComboBoxValue<T> | undefined>(undefined);\n const autoClosedNoResultsRef = useRef(false);\n const suppressFormResetRef = useRef(false);\n const wasReadOnly = useRef(readOnly);\n\n const beginFormReset = () => {\n suppressFormResetRef.current = true;\n setTimeout(() => {\n suppressFormResetRef.current = false;\n }, 0);\n };\n\n useLayoutEffect(() => {\n if (readOnly && !wasReadOnly.current) {\n setFilterText('');\n setControlledInputDraft(undefined);\n controlledDraftSelectionRef.current = null;\n pendingCustomValueRef.current = undefined;\n selectionResetLabelRef.current = null;\n lastCustomChangeRef.current = undefined;\n }\n\n wasReadOnly.current = readOnly;\n }, [readOnly]);\n const decoratedItems = useMemo<ComboBoxItem<T>[]>(\n () =>\n items.map((item) => ({\n descriptor: getItem(item),\n item,\n })),\n [getItem, items],\n );\n const suppliedDefaultSelectedItem = findItem(\n decoratedItems,\n initialDefaultValue ?? null,\n getItem,\n allowsCustomValue,\n );\n const initialDefaultSelectedItem =\n suppliedDefaultSelectedItem ??\n (value === undefined &&\n initialDefaultValue !== undefined &&\n initialDefaultValue !== null &&\n !(allowsCustomValue && typeof initialDefaultValue === 'string')\n ? {\n descriptor: getItem(initialDefaultValue as T),\n item: initialDefaultValue as T,\n }\n : undefined);\n const defaultSelectedKey =\n getSelectedKey(\n initialDefaultValue,\n initialDefaultSelectedItem,\n getItem,\n allowsCustomValue,\n ) ?? undefined;\n const uncontrolledSelectedKeyRef = useRef<string | null>(\n defaultSelectedKey ?? null,\n );\n const uncontrolledSelectedItemRef = useRef<ComboBoxItem<T> | undefined>(\n initialDefaultSelectedItem,\n );\n const currentUncontrolledSelectedItem = decoratedItems.find(\n ({ descriptor }) => descriptor.id === uncontrolledSelectedKeyRef.current,\n );\n const retainedUncontrolledSelectedItem =\n value === undefined && uncontrolledSelectedKeyRef.current !== null\n ? currentUncontrolledSelectedItem ?? uncontrolledSelectedItemRef.current\n : undefined;\n const defaultSelectedItem = initialDefaultSelectedItem;\n\n useLayoutEffect(() => {\n if (value === undefined && currentUncontrolledSelectedItem) {\n uncontrolledSelectedItemRef.current = currentUncontrolledSelectedItem;\n }\n }, [currentUncontrolledSelectedItem, value]);\n const pendingCustomText =\n value !== undefined &&\n allowsCustomValue &&\n typeof value === 'string' &&\n matchesControlledCustomValue(value, pendingCustomValueRef.current);\n const { baseControlledTextValue, selectedItem, selectedKey } =\n getComboBoxSelection(\n value,\n pendingCustomText,\n retainedUncontrolledSelectedItem,\n uncontrolledSelectedKeyRef.current,\n decoratedItems,\n getItem,\n allowsCustomValue,\n );\n const defaultTextValue = getDefaultTextValue(\n initialDefaultValue,\n defaultSelectedItem,\n getItem,\n allowsCustomValue,\n );\n const currentTextValue =\n baseControlledTextValue ??\n selectedItem?.descriptor.label ??\n defaultTextValue ??\n '';\n const controlledSelectionUpdate = getControlledSelectionUpdate(\n value,\n selectedItem,\n getItem,\n controlledSelectionRef.current,\n allowsCustomValue,\n pendingCustomValueRef.current,\n );\n const controlledSelection = controlledSelectionUpdate.selection;\n const isControlledCustomEcho =\n controlledSelectionUpdate.resetLabel !== undefined &&\n allowsCustomValue &&\n matchesControlledCustomValue(value, pendingCustomValueRef.current);\n\n useLayoutEffect(() => {\n controlledSelectionRef.current = controlledSelection;\n }, [controlledSelection]);\n\n useLayoutEffect(() => {\n if (controlledSelectionUpdate.resetLabel === undefined) return;\n\n if (isControlledCustomEcho) {\n // Keep the echoed text marked as custom until an explicit option\n // selection or another controlled value replaces it.\n return;\n }\n\n selectionResetLabelRef.current = controlledSelectionUpdate.resetLabel;\n pendingCustomValueRef.current = undefined;\n }, [\n controlledSelection?.id,\n controlledSelection?.label,\n controlledSelectionUpdate.resetLabel,\n isControlledCustomEcho,\n ]);\n\n const controlledSelectionChanged =\n controlledSelectionUpdate.resetLabel !== undefined &&\n !isControlledCustomEcho;\n const hasControlledInputDraft =\n value !== undefined &&\n controlledInputDraft !== undefined &&\n matchesControlledSelection(\n controlledDraftSelectionRef.current,\n controlledSelection,\n );\n\n useLayoutEffect(() => {\n if (controlledInputDraft !== undefined && !hasControlledInputDraft) {\n controlledDraftSelectionRef.current = null;\n }\n }, [controlledInputDraft, hasControlledInputDraft]);\n\n const { contains } = useFilter({ sensitivity: 'base' });\n const effectiveFilterText = controlledSelectionChanged ? '' : filterText;\n const collectionItems = items;\n const collectionDecoratedItems = decoratedItems;\n const initialResetValue = getInitialResetValue(\n initiallyControlled,\n initialControlledValue,\n initialControlledItem,\n collectionDecoratedItems,\n initialDefaultValue,\n );\n const controlledTextValue = hasControlledInputDraft\n ? controlledInputDraft\n : baseControlledTextValue;\n\n useEffect(() => {\n if (!controlledSelectionChanged) return;\n\n setFilterText('');\n setControlledInputDraft(undefined);\n controlledDraftSelectionRef.current = null;\n }, [\n controlledSelectionChanged,\n controlledSelection?.id,\n controlledSelection?.label,\n ]);\n\n const resetInputDraft = (preserveCustomValue = false) => {\n setFilterText('');\n setControlledInputDraft(undefined);\n controlledDraftSelectionRef.current = null;\n if (!preserveCustomValue) {\n pendingCustomValueRef.current = undefined;\n }\n autoClosedNoResultsRef.current = false;\n };\n\n const handleOpenChange = (isOpen: boolean) => {\n if (isOpen) {\n autoClosedNoResultsRef.current = false;\n return;\n }\n\n if (\n value !== undefined &&\n !allowsCustomValue &&\n autoClosedNoResultsRef.current &&\n controlledInputDraft !== undefined\n ) {\n autoClosedNoResultsRef.current = false;\n return;\n }\n\n resetInputDraft(true);\n };\n\n const emitInputChange = (inputValue: string) => {\n if (props.allowsCustomValue !== true) {\n if (inputValue === '' && value !== undefined) {\n onChange?.(null);\n }\n\n return;\n }\n\n const nextValue = inputValue || null;\n if (value !== undefined) {\n pendingCustomValueRef.current = nextValue;\n }\n lastCustomChangeRef.current = nextValue;\n props.onChange?.(nextValue);\n };\n\n const handleNullValueChange = (shouldEmitChange: boolean) => {\n if (value === undefined) {\n uncontrolledSelectedKeyRef.current = null;\n uncontrolledSelectedItemRef.current = undefined;\n }\n\n if (allowsCustomValue && lastCustomChangeRef.current !== undefined) {\n return;\n }\n\n if (shouldEmitChange && value !== undefined && !allowsCustomValue) {\n resetInputDraft();\n }\n\n if (shouldEmitChange) {\n onChange?.(null);\n }\n };\n\n const handleInputChange = (inputValue: string) => {\n if (suppressFormResetRef.current) return;\n\n if (readOnly) {\n resetInputDraft();\n return;\n }\n\n if (\n isSelectionResetInput(\n inputValue,\n selectionResetLabelRef.current,\n value,\n selectedItem,\n )\n ) {\n selectionResetLabelRef.current = null;\n resetInputDraft();\n return;\n }\n\n selectionResetLabelRef.current = null;\n setFilterText(inputValue);\n\n if (canDraftControlledValue(value, selectedItem, allowsCustomValue)) {\n setControlledInputDraft(inputValue);\n controlledDraftSelectionRef.current = controlledSelection;\n }\n\n autoClosedNoResultsRef.current =\n value !== undefined &&\n !allowsCustomValue &&\n getVisibleItems(items, decoratedItems, inputValue, contains).length === 0;\n\n emitInputChange(inputValue);\n };\n\n const handleValueChange = (\n key: ComboBoxChangeKey,\n shouldEmitChange = true,\n ) => {\n if (suppressFormResetRef.current) return;\n\n const isDraftCommit =\n key !== null &&\n value !== undefined &&\n controlledInputDraft !== undefined &&\n key === selectedKey;\n\n if (isDraftCommit) {\n selectionResetLabelRef.current = selectedItem?.descriptor.label ?? '';\n resetInputDraft();\n return;\n }\n\n if (key === null) {\n handleNullValueChange(shouldEmitChange);\n return;\n }\n\n if (value === undefined) {\n uncontrolledSelectedKeyRef.current = String(key);\n }\n\n const nextItem = resolveComboBoxItem(\n key,\n collectionDecoratedItems,\n initialControlledItem,\n defaultSelectedItem,\n );\n if (value === undefined) {\n uncontrolledSelectedItemRef.current = nextItem;\n }\n const nextValue = getComboBoxValueForKey(\n key,\n value,\n selectedKey,\n collectionDecoratedItems,\n initialControlledItem,\n defaultSelectedItem,\n allowsCustomValue,\n );\n selectionResetLabelRef.current = nextItem?.descriptor.label ?? '';\n lastCustomChangeRef.current = undefined;\n resetInputDraft();\n if (shouldEmitChange) {\n onChange?.(nextValue);\n }\n };\n\n const setFormResetState = (resetState: ComboBoxResetState) => {\n const preservesOffListCustomDefault =\n allowsCustomValue &&\n resetState.defaultValue !== null &&\n defaultSelectedItem !== undefined &&\n !collectionDecoratedItems.some(\n ({ descriptor }) => descriptor.id === resetState.defaultValue,\n ) &&\n resetState.value === null;\n\n if (!preservesOffListCustomDefault) {\n resetState.setValue(resetState.defaultValue);\n }\n resetState.setInputValue(resetState.defaultInputValue);\n };\n\n const handleFormReset = (event: Event, resetState: ComboBoxResetState) => {\n if (!resetState.isActive()) {\n suppressFormResetRef.current = false;\n return;\n }\n if (event.defaultPrevented) {\n resetState.setValue(resetState.value);\n resetState.setInputValue(resetState.inputValue);\n resetState.setOpen(resetState.isOpen);\n suppressFormResetRef.current = false;\n return;\n }\n\n const resetChanged =\n value !== undefined\n ? (() => {\n const currentResetValue = getComboBoxResetValue(\n value,\n collectionDecoratedItems,\n getItem,\n allowsCustomValue,\n );\n const initialResetSignature = getComboBoxResetValue(\n initialResetValue,\n collectionDecoratedItems,\n getItem,\n allowsCustomValue,\n );\n\n return (\n currentResetValue.key !== initialResetSignature.key ||\n currentResetValue.text !== initialResetSignature.text\n );\n })()\n : !sameComboBoxKey(resetState.value, resetState.defaultValue) ||\n (allowsCustomValue &&\n resetState.inputValue !== resetState.defaultInputValue);\n const initialResetChangeValue =\n allowsCustomValue && initialResetValue === '' ? null : initialResetValue;\n const nextValue =\n value !== undefined || allowsCustomValue\n ? initialResetChangeValue ?? null\n : getComboBoxValueForKey(\n resetState.defaultValue,\n undefined,\n selectedKey,\n collectionDecoratedItems,\n initialControlledItem,\n defaultSelectedItem,\n allowsCustomValue,\n );\n\n try {\n flushSync(() => {\n setFormResetState(resetState);\n resetState.setOpen(false);\n lastCustomChangeRef.current = undefined;\n resetInputDraft();\n\n if (value === undefined) {\n uncontrolledSelectedKeyRef.current =\n resetState.defaultValue === null\n ? null\n : String(resetState.defaultValue);\n uncontrolledSelectedItemRef.current = resolveComboBoxItem(\n resetState.defaultValue,\n collectionDecoratedItems,\n initialControlledItem,\n defaultSelectedItem,\n );\n }\n\n if (resetChanged) onChange?.(nextValue as T | null);\n });\n } finally {\n suppressFormResetRef.current = false;\n }\n };\n\n return {\n beginFormReset,\n collectionItems,\n controlledTextValue,\n currentTextValue,\n defaultSelectedKey,\n defaultTextValue,\n handleFormReset,\n handleInputChange,\n handleOpenChange,\n handleValueChange,\n matchesFilter: (textValue) =>\n contains(textValue, effectiveFilterText.trim()),\n selectedKey,\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 description,\n disabled = false,\n error,\n form,\n getItem,\n id,\n items,\n label,\n loading = false,\n name,\n placeholder,\n readOnly = false,\n required = false,\n value,\n } = props;\n const { messages } = useBreezeContext();\n const model = useComboBoxModel(props);\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const groupRef = useRef<HTMLDivElement>(null);\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 submittedName = interactionDisabled ? undefined : name;\n\n return (\n <AriaComboBox\n allowsCustomValue={allowsCustomValue}\n allowsEmptyCollection={allowsCustomValue}\n aria-label={loading ? label : undefined}\n className={fieldVariants.base.root}\n defaultInputValue={model.defaultTextValue}\n defaultFilter={model.matchesFilter}\n defaultValue={model.defaultSelectedKey}\n form={form}\n id={id}\n inputValue={model.controlledTextValue}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n defaultItems={model.collectionItems}\n menuTrigger=\"input\"\n name={submittedName}\n onChange={model.handleValueChange}\n onInputChange={model.handleInputChange}\n onOpenChange={model.handleOpenChange}\n value={value !== undefined ? model.selectedKey : undefined}\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 ref={groupRef}\n >\n <ComboBoxReadOnlyReset\n allowsCustomValue={allowsCustomValue}\n currentTextValue={model.currentTextValue}\n isControlled={value !== undefined}\n isReadOnly={readOnly}\n resetTextValue={model.defaultTextValue ?? ''}\n />\n <ComboBoxInput\n allowsCustomValue={allowsCustomValue}\n aria-describedby={supportingIds}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n className={joinClassNames(\n variants.base.input,\n loading && variants.state.loadingInput,\n )}\n disabled={interactionDisabled}\n form={form}\n beginFormReset={model.beginFormReset}\n getItem={getItem}\n handleFormReset={model.handleFormReset}\n items={items}\n loading={loading}\n placeholder={placeholder}\n readOnly={readOnly}\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 getItem={getItem}\n hasSuggestions={model.collectionItems.length > 0}\n isDisabled={interactionDisabled}\n isReadOnly={readOnly}\n items={model.collectionItems}\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 {\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 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 { ReactNode, RefObject } from 'react';\nimport { useId, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { mergeProps } from 'react-aria/mergeProps';\nimport { useButton } from 'react-aria/useButton';\nimport { useFocusRing } from 'react-aria/useFocusRing';\nimport { useHover } from 'react-aria/useHover';\nimport { useListBox, useOption } from 'react-aria/useListBox';\nimport { useSelect } from 'react-aria/useSelect';\nimport { useVisuallyHidden } from 'react-aria/VisuallyHidden';\nimport { flushSync } from 'react-dom';\n// The low-level Select state is required to avoid RAC's native HiddenSelect.\nimport { type SelectState, useSelectState } from 'react-stately/useSelectState';\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\ntype SelectStateValue = string | number | null;\n\ninterface SelectCollectionNode<T> {\n key: string | number;\n value: SelectItem<T> | null;\n}\n\ninterface SelectCollectionElementProps {\n children: ReactNode;\n id: string;\n item: unknown;\n isDisabled?: boolean;\n textValue: string;\n}\n\ninterface SelectCollectionElementType {\n (props: SelectCollectionElementProps): null;\n getCollectionNode: (props: SelectCollectionElementProps) => Generator<{\n key: string;\n props: SelectCollectionElementProps;\n rendered: ReactNode;\n textValue: string;\n type: 'item';\n value: unknown;\n }>;\n}\n\nconst SelectCollectionElement = (() =>\n null) as unknown as SelectCollectionElementType;\n\nSelectCollectionElement.getCollectionNode = function* getCollectionNode({\n id,\n item,\n ...props\n}) {\n yield {\n key: id,\n props: { ...props, id, item },\n rendered: props.children,\n textValue: props.textValue,\n type: 'item',\n value: item,\n };\n};\n\nfunction findItem<T>(\n items: SelectItem<T>[],\n value: T | null,\n getItem: (item: T) => ItemDescriptor,\n) {\n if (value === null) return undefined;\n\n const valueId = getItem(value).id;\n\n return items.find(\n ({ descriptor, item }) => item === value || descriptor.id === valueId,\n );\n}\n\nfunction findUniqueAutofillItem<T>(items: SelectItem<T>[], value: string) {\n const matches = items.filter(\n ({ descriptor }) =>\n !descriptor.disabled &&\n (descriptor.id === value || descriptor.label === value),\n );\n\n return matches.length === 1 ? matches[0] : undefined;\n}\n\nfunction resolveControlledResetItem<T>(\n initialControlledItem: SelectItem<T> | null | undefined,\n items: SelectItem<T>[],\n loading: boolean,\n) {\n if (initialControlledItem === undefined || initialControlledItem === null) {\n return initialControlledItem;\n }\n\n return (\n items.find(\n ({ descriptor }) => descriptor.id === initialControlledItem.descriptor.id,\n ) ?? (loading ? initialControlledItem : null)\n );\n}\n\nfunction getInitialControlledItem<T>(\n value: T | null | undefined,\n getItem: (item: T) => ItemDescriptor,\n) {\n if (value === undefined) return undefined;\n if (value === null) return null;\n\n return {\n descriptor: getItem(value),\n item: value,\n };\n}\n\nfunction getControlledResetValueKey<T>(\n value: T | null | undefined,\n getItem: (item: T) => ItemDescriptor,\n) {\n if (value === undefined) return undefined;\n if (value === null) return null;\n\n return getItem(value).id;\n}\n\nfunction getTriggerLabelledBy(\n loading: boolean,\n buttonLabelledBy: string | undefined,\n valueId: string | undefined,\n) {\n if (loading) return undefined;\n\n const labelledBy = Array.from(\n new Set(\n [buttonLabelledBy, valueId]\n .filter((value): value is string => Boolean(value))\n .flatMap((value) => value.split(' ')),\n ),\n ).join(' ');\n\n return labelledBy || undefined;\n}\n\nfunction handleSelectAutofill<T>(\n nextValue: string,\n readOnly: boolean,\n items: SelectItem<T>[],\n currentValue: SelectStateValue,\n setValue: (value: string) => void,\n autofillRef: RefObject<HTMLInputElement | null>,\n) {\n const inputRef = autofillRef;\n\n if (readOnly) {\n if (inputRef.current) {\n inputRef.current.value = String(currentValue ?? '');\n }\n\n return;\n }\n\n const nextItem = findUniqueAutofillItem(items, nextValue);\n\n if (!nextItem) {\n if (inputRef.current) {\n inputRef.current.value = String(currentValue ?? '');\n }\n\n return;\n }\n\n const nextKey = nextItem.descriptor.id;\n\n if (currentValue !== nextKey) {\n setValue(nextKey);\n }\n}\n\ninterface SelectCollectionEffectsOptions<T> {\n decoratedItems: SelectItem<T>[];\n initialDefaultValueRef: RefObject<string | null>;\n isControlled: boolean;\n loading: boolean;\n pendingDefaultValueRef: RefObject<string | null>;\n state: SelectState<SelectItem<T>>;\n suppressOnChangeRef: RefObject<boolean>;\n}\n\nfunction useSelectCollectionEffects<T>({\n decoratedItems,\n initialDefaultValueRef,\n isControlled,\n loading,\n pendingDefaultValueRef,\n state,\n suppressOnChangeRef,\n}: Readonly<SelectCollectionEffectsOptions<T>>) {\n const pendingDefaultRef = pendingDefaultValueRef;\n const initialDefaultRef = initialDefaultValueRef;\n const suppressRef = suppressOnChangeRef;\n\n useLayoutEffect(() => {\n const pendingDefaultValue = pendingDefaultRef.current;\n const hasPendingDefault = decoratedItems.some(\n ({ descriptor }) => descriptor.id === pendingDefaultValue,\n );\n\n if (!loading && pendingDefaultValue !== null && !hasPendingDefault) {\n pendingDefaultRef.current = null;\n if (initialDefaultRef.current === pendingDefaultValue) {\n initialDefaultRef.current = null;\n }\n return;\n }\n\n if (\n isControlled ||\n state.value !== null ||\n pendingDefaultValue === null ||\n !hasPendingDefault\n ) {\n return;\n }\n\n pendingDefaultRef.current = null;\n suppressRef.current = true;\n try {\n state.setValue(pendingDefaultValue);\n } finally {\n suppressRef.current = false;\n }\n }, [\n decoratedItems,\n initialDefaultRef,\n isControlled,\n loading,\n pendingDefaultRef,\n state,\n suppressRef,\n ]);\n\n useLayoutEffect(() => {\n if (\n !isControlled &&\n !loading &&\n state.value !== null &&\n !decoratedItems.some(({ descriptor }) => descriptor.id === state.value)\n ) {\n state.setValue(null);\n }\n }, [decoratedItems, isControlled, loading, state]);\n}\n\ninterface SelectFormResetOptions<T> {\n controlledResetItemRef: RefObject<SelectItem<T> | null | undefined>;\n controlledResetValueKeyRef: RefObject<string | null | undefined>;\n form: string | undefined;\n isControlled: boolean;\n onChangeRef: RefObject<((value: T | null) => void) | undefined>;\n resetValueRef: RefObject<string | null>;\n setStateValueRef: RefObject<(nextValue: string | null) => void>;\n suppressOnChangeRef: RefObject<boolean>;\n triggerRef: RefObject<HTMLButtonElement | null>;\n}\n\nfunction useSelectFormReset<T>({\n controlledResetItemRef,\n controlledResetValueKeyRef,\n form,\n isControlled,\n onChangeRef,\n resetValueRef,\n setStateValueRef,\n suppressOnChangeRef,\n triggerRef,\n}: Readonly<SelectFormResetOptions<T>>) {\n const onChangeSuppressionRef = suppressOnChangeRef;\n\n useLayoutEffect(() => {\n let active = true;\n\n const reset = (event: Event) => {\n const associatedForm = form\n ? document.getElementById(form)\n : triggerRef.current?.form;\n\n if (\n !(associatedForm instanceof HTMLFormElement) ||\n event.target !== associatedForm\n ) {\n return;\n }\n\n flushSync(() => undefined);\n if (!active || event.defaultPrevented) return;\n\n flushSync(() => {\n if (isControlled) {\n const resetItem = controlledResetItemRef.current;\n const currentValueKey = controlledResetValueKeyRef.current;\n let resetValueKey: string | null | undefined;\n if (resetItem === undefined) {\n resetValueKey = undefined;\n } else if (resetItem === null) {\n resetValueKey = null;\n } else {\n resetValueKey = resetItem.descriptor.id;\n }\n\n if (currentValueKey !== resetValueKey) {\n onChangeRef.current?.(resetItem?.item ?? null);\n }\n\n return;\n }\n\n onChangeSuppressionRef.current = true;\n try {\n setStateValueRef.current(resetValueRef.current);\n } finally {\n onChangeSuppressionRef.current = false;\n }\n });\n };\n\n document.addEventListener('reset', reset);\n\n return () => {\n active = false;\n document.removeEventListener('reset', reset);\n };\n }, [\n controlledResetItemRef,\n controlledResetValueKeyRef,\n form,\n isControlled,\n onChangeRef,\n resetValueRef,\n setStateValueRef,\n onChangeSuppressionRef,\n triggerRef,\n ]);\n}\n\nfunction SelectOption<T>({\n node,\n state,\n}: Readonly<{\n node: SelectCollectionNode<T>;\n state: Parameters<typeof useListBox>[1];\n}>) {\n const optionRef = useRef<HTMLDivElement>(null);\n const { value } = node;\n const { optionProps, isDisabled, isFocused, isFocusVisible, isSelected } =\n useOption(\n {\n isDisabled: value?.descriptor.disabled,\n key: node.key,\n },\n state,\n optionRef,\n );\n const { hoverProps, isHovered } = useHover({ isDisabled });\n\n if (!value) return null;\n\n return (\n <div\n // React Aria supplies the complete keyboard and accessibility contract.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...mergeProps(optionProps, hoverProps)}\n ref={optionRef}\n className={collectionVariants.base.item}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-hovered={isHovered || undefined}\n data-selected={isSelected || undefined}\n >\n <DescriptorContent\n descriptor={value.descriptor}\n isSelected={isSelected}\n />\n </div>\n );\n}\n\nfunction SelectListBox<T>({\n menuProps,\n state,\n}: Readonly<{\n menuProps: Parameters<typeof useListBox>[0];\n state: Parameters<typeof useListBox>[1];\n}>) {\n const listBoxRef = useRef<HTMLDivElement>(null);\n const { listBoxProps } = useListBox(menuProps, state, listBoxRef);\n const keys = Array.from(state.collection.getKeys());\n\n return (\n <div\n // React Aria supplies the complete keyboard and accessibility contract.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...listBoxProps}\n className={collectionVariants.base.listBox}\n ref={listBoxRef}\n >\n {keys.map((key) => {\n const node = state.collection.getItem(\n key,\n ) as SelectCollectionNode<T> | null;\n\n return node ? (\n <SelectOption key={String(key)} node={node} state={state} />\n ) : null;\n })}\n </div>\n );\n}\n\n/**\n * Renders a fixed-choice popover listbox without a native select element.\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 { visuallyHiddenProps } = useVisuallyHidden({\n style: {\n left: 0,\n position: 'fixed',\n top: 0,\n },\n });\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n const stateDisabled = interactionDisabled || readOnly;\n const fieldId = useId();\n const controlId = id ?? `${fieldId}-control`;\n const labelId = `${fieldId}-label`;\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 triggerRef = useRef<HTMLButtonElement>(null);\n const autofillRef = useRef<HTMLInputElement>(null);\n const decoratedItems = useMemo<SelectItem<T>[]>(\n () =>\n items.map((item) => ({\n descriptor: getItem(item),\n item,\n })),\n [getItem, items],\n );\n const isControlled = value !== undefined;\n const [initialControlledItem] = useState<SelectItem<T> | null | undefined>(\n () => getInitialControlledItem(value, getItem),\n );\n const selectedValueItem = findItem(decoratedItems, value ?? null, getItem);\n const defaultSelectedItem = findItem(\n decoratedItems,\n defaultValue ?? null,\n getItem,\n );\n const pendingDefaultValueRef = useRef(\n loading &&\n defaultValue !== undefined &&\n defaultValue !== null &&\n defaultSelectedItem === undefined\n ? getItem(defaultValue).id\n : null,\n );\n const controlledValueKey = isControlled\n ? selectedValueItem?.descriptor.id ?? null\n : undefined;\n const defaultValueKey = defaultSelectedItem?.descriptor.id ?? null;\n const initialDefaultValueRef = useRef(\n defaultValueKey ?? pendingDefaultValueRef.current,\n );\n const hasInitialDefault = decoratedItems.some(\n ({ descriptor }) => descriptor.id === initialDefaultValueRef.current,\n );\n const resetValue =\n loading || hasInitialDefault ? initialDefaultValueRef.current : null;\n const resetValueRef = useRef(resetValue);\n const controlledResetValueKey = getControlledResetValueKey(value, getItem);\n const controlledResetItem = resolveControlledResetItem(\n initialControlledItem,\n decoratedItems,\n loading,\n );\n const controlledResetValueKeyRef = useRef(controlledResetValueKey);\n const controlledResetItemRef = useRef(controlledResetItem);\n const onChangeRef = useRef(onChange);\n const suppressOnChangeRef = useRef(false);\n const collectionChildren = useMemo(\n () =>\n decoratedItems.map(({ descriptor, item }) => (\n <SelectCollectionElement\n id={descriptor.id}\n item={{ descriptor, item }}\n isDisabled={descriptor.disabled}\n key={descriptor.id}\n textValue={descriptor.label}\n >\n {descriptor.label}\n </SelectCollectionElement>\n )),\n [decoratedItems],\n );\n const state = useSelectState<SelectItem<T>>({\n children: collectionChildren,\n defaultValue: defaultValueKey,\n isDisabled: stateDisabled,\n isInvalid: !loading && visibleError !== undefined,\n isRequired: required,\n items: decoratedItems,\n onChange: (key) => {\n if (suppressOnChangeRef.current) return;\n\n // A real user selection supersedes a default that was waiting for a\n // loading collection to arrive.\n pendingDefaultValueRef.current = null;\n\n if (key === null) {\n onChange?.(null);\n return;\n }\n\n const nextItem = decoratedItems.find(\n (item) => item.descriptor.id === key,\n );\n onChange?.(nextItem?.item ?? null);\n },\n shouldCloseOnSelect: true,\n validationBehavior: 'aria',\n value: controlledValueKey,\n });\n const setStateValueRef = useRef((nextValue: string | null) =>\n state.setValue(nextValue),\n );\n const { menuProps, triggerProps, valueProps } = useSelect(\n {\n 'aria-describedby': supportingIds,\n 'aria-label': loading ? label : undefined,\n 'aria-labelledby': labelId,\n autoComplete,\n form,\n isDisabled: stateDisabled,\n isInvalid: !loading && visibleError !== undefined,\n isRequired: required,\n name,\n validationBehavior: 'aria',\n value: state.value,\n },\n state,\n triggerRef,\n );\n const { buttonProps } = useButton(triggerProps, triggerRef);\n const { focusProps, isFocusVisible } = useFocusRing();\n const { hoverProps, isHovered } = useHover({\n isDisabled: interactionDisabled,\n });\n const isInvalid = !loading && visibleError !== undefined;\n const handleAutofill = (nextValue: string) =>\n handleSelectAutofill(\n nextValue,\n readOnly,\n decoratedItems,\n state.value,\n (nextKey) => state.setValue(nextKey),\n autofillRef,\n );\n const triggerLabelledBy = getTriggerLabelledBy(\n loading,\n buttonProps['aria-labelledby'],\n valueProps.id,\n );\n\n useLayoutEffect(() => {\n resetValueRef.current = resetValue;\n setStateValueRef.current = (nextValue) => state.setValue(nextValue);\n controlledResetValueKeyRef.current = controlledResetValueKey;\n controlledResetItemRef.current = controlledResetItem;\n onChangeRef.current = onChange;\n }, [\n controlledResetItem,\n controlledResetValueKey,\n onChange,\n resetValue,\n state,\n ]);\n\n useLayoutEffect(() => {\n if ((decoratedItems.length === 0 || stateDisabled) && state.isOpen) {\n state.setOpen(false);\n }\n }, [decoratedItems.length, state, stateDisabled]);\n\n useSelectCollectionEffects({\n decoratedItems,\n initialDefaultValueRef,\n isControlled,\n loading,\n pendingDefaultValueRef,\n state,\n suppressOnChangeRef,\n });\n\n useSelectFormReset({\n controlledResetItemRef,\n controlledResetValueKeyRef,\n form,\n isControlled,\n onChangeRef,\n resetValueRef,\n setStateValueRef,\n suppressOnChangeRef,\n triggerRef,\n });\n\n return (\n <div className={fieldVariants.base.root}>\n <FieldLabel\n htmlFor={controlId}\n id={labelId}\n label={label}\n loading={loading}\n />\n <div className={fieldVariants.base.control}>\n {/* React Aria supplies the complete keyboard and accessibility contract. */}\n <button\n type=\"button\"\n // React Aria supplies the complete keyboard and accessibility contract.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n aria-controls={buttonProps['aria-controls']}\n aria-busy={loading || undefined}\n aria-expanded={buttonProps['aria-expanded']}\n aria-labelledby={triggerLabelledBy}\n aria-readonly={readOnly || undefined}\n aria-required={required || undefined}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n className={joinClassNames(\n selectVariants.base.trigger,\n readOnly && selectVariants.state.readOnlyTrigger,\n loading && 'breeze:!opacity-0',\n )}\n data-focus-visible={isFocusVisible || undefined}\n data-hovered={isHovered || undefined}\n data-invalid={isInvalid || undefined}\n disabled={interactionDisabled}\n form={form}\n id={controlId}\n role=\"combobox\"\n ref={triggerRef}\n >\n <span\n // React Aria supplies the selected-value semantics.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...valueProps}\n className={joinClassNames(\n collectionVariants.base.content,\n 'breeze:text-start',\n )}\n >\n {state.selectedItems[0]?.textValue ?? placeholder}\n </span>\n <Icon name=\"expand\" size=\"sm\" />\n </button>\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 {(name !== undefined || autoComplete !== undefined) &&\n !interactionDisabled && (\n <div\n // React Aria's hidden-control pattern keeps autofill and form\n // submission while preventing an aria-hidden control from focus.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...visuallyHiddenProps}\n aria-hidden=\"true\"\n data-a11y-ignore=\"aria-hidden-focus\"\n data-react-aria-prevent-focus\n >\n <label htmlFor={`${controlId}-autofill`}>\n {label}\n <input\n autoComplete={autoComplete}\n form={form}\n id={`${controlId}-autofill`}\n name={name}\n onChange={(event) => handleAutofill(event.currentTarget.value)}\n onInput={(event) => handleAutofill(event.currentTarget.value)}\n readOnly={readOnly || undefined}\n ref={autofillRef}\n tabIndex={-1}\n type=\"text\"\n value={state.value ?? ''}\n />\n </label>\n </div>\n )}\n <CollectionPopover\n className={collectionVariants.base.popover}\n isOpen={state.isOpen && !stateDisabled}\n onOpenChange={(isOpen) => state.setOpen(isOpen)}\n triggerRef={triggerRef}\n >\n <SelectListBox menuProps={menuProps} state={state} />\n </CollectionPopover>\n <FieldSupportingContent\n description={visibleDescription}\n descriptionId={descriptionId}\n error={loading ? visibleError : undefined}\n errorId={errorId}\n loading={loading}\n />\n {visibleError && !loading && (\n <span className={fieldVariants.base.error} id={errorId}>\n {visibleError}\n </span>\n )}\n </div>\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 { 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","const enGB = {\n appearance: 'Appearance',\n appearanceAutomatic: 'Auto',\n appearanceDark: 'Dark',\n appearanceLight: 'Light',\n close: 'Close',\n loading: 'Loading',\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 },\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,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,cAAc;EACtC;CACF,GAAG,CAAC,CAAkB,CAAC;CAEvB,IAAM,IAAgB,GACnB,MAA+B;EAK9B,AAJI,MAAyB,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;CA6BA,OACE,kBAAC,IAAD;EAAsB;YACpB,kBAAC,IAAD;GAAe,OA7BH,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;IACrC;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/layout.accessibility.ts","../src/primitives/Card/Card.tsx","../src/primitives/Field/field.styles.ts","../src/primitives/Field/field.presentation.tsx","../src/primitives/Checkbox/Checkbox.tsx","../src/primitives/Collection/collection.styles.ts","../src/overlays/OverlayStack.ts","../src/overlays/OverlayProvider.tsx","../src/primitives/Collection/CollectionPopover.tsx","../src/primitives/Icon/Icon.tsx","../src/primitives/Collection/DescriptorContent.tsx","../src/primitives/Collection/DescriptorOption.tsx","../src/primitives/ComboBox/ComboBox.tsx","../src/primitives/Container/Container.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/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/Typography/Typography.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","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","/** 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 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","/** 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 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 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 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 {\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 { 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 {\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 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 { 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","const enGB = {\n appearance: 'Appearance',\n appearanceAutomatic: 'Auto',\n appearanceDark: 'Dark',\n appearanceLight: 'Light',\n close: 'Close',\n loading: 'Loading',\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 },\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,IA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