@motech-development/breeze-ui 4.3.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +768 -318
- package/lib/index.js.map +1 -1
- package/lib/overlays/OverlayStack.d.ts +2 -0
- package/lib/overlays/OverlayStack.d.ts.map +1 -1
- package/lib/primitives/Checkbox/Checkbox.d.ts +54 -0
- package/lib/primitives/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/primitives/Field/field.presentation.d.ts +13 -0
- package/lib/primitives/Field/field.presentation.d.ts.map +1 -0
- package/lib/primitives/Field/field.styles.d.ts +20 -0
- package/lib/primitives/Field/field.styles.d.ts.map +1 -0
- package/lib/primitives/NumberField/NumberField.d.ts +66 -0
- package/lib/primitives/NumberField/NumberField.d.ts.map +1 -0
- package/lib/primitives/TextField/TextField.d.ts +61 -0
- package/lib/primitives/TextField/TextField.d.ts.map +1 -0
- package/lib/primitives/Toast/Toast.d.ts +22 -0
- package/lib/primitives/Toast/Toast.d.ts.map +1 -0
- package/lib/provider/BreezeProvider.d.ts +3 -1
- package/lib/provider/BreezeProvider.d.ts.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +1 -1
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/Container/Container.tsx","../src/overlays/OverlayStack.ts","../src/overlays/OverlayProvider.tsx","../src/overlays/OverlaySurface.tsx","../src/primitives/Dialog/Dialog.tsx","../src/primitives/Drawer/Drawer.tsx","../src/primitives/Grid/Grid.tsx","../src/primitives/Icon/Icon.tsx","../src/primitives/IconTile/IconTile.tsx","../src/primitives/Inline/Inline.tsx","../src/primitives/Popover/Popover.tsx","../src/primitives/Separator/Separator.tsx","../src/primitives/Stack/Stack.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","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 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);\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 {\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 {\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 { 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 { 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","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 { 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 { 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}\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}: 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 <BreezeRoot>{children}</BreezeRoot>\n </OverlayProvider>\n </BreezeContext>\n </I18nProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAa,IAAgB,EAAyC,IAAI;AAE1E,SAAgB,IAAuC;CACrD,IAAM,IAAU,EAAW,CAAa;CAExC,IAAI,MAAY,MACd,MAAU,MACR,2DACF;CAGF,OAAO;AACT;;;ACpBA,IAAM,IAAW;CACf,MAAM;EACJ,SACE;EACF,OAAO;EACP,OAAO;EACP,QACE;CACJ;CACA,UAAU,CAAC;CACX,MAAM,CAAC;CACP,OAAO,EACL,UACE,4OACJ;CACA,SAAS,CAAC;AACZ,GAEM,IAAoB;CACxB;EACE,SAAS;EACT,OAAO;CACT;CACA;EACE,SAAS;EACT,OAAO;CACT;CACA;EACE,SAAS;EACT,OAAO;CACT;AACF;AAEA,SAAS,GAAa,GAAqC;CACzD,OAAO,EAAkB,MAAM,MAAW,EAAO,UAAU,CAAK;AAClE;AAOA,SAAS,KAAoB;CAC3B,IAAM,EAAE,eAAY,qBAAkB,aAAU,qBAC9C,EAAiB;CAEnB,OACE,kBAAC,OAAD;EAAK,WAAW,EAAS,KAAK;YAA9B,CACE,kBAAC,QAAD;GACE,WAAW,EAAS,KAAK;GACzB,MAAM,EAAiB,YAAY;aAElC,EAAS;EACN,CAAA,GACN,kBAAC,GAAD;GACE,cAAY,EAAS;GACrB,WAAW,EAAS,KAAK;GACzB,wBAAA;GACA,MAAM,EAAiB,YAAY;GACnC,oBAAoB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3C,GACM,IAAmB,GACtB,MACC,IAAW,OAAa,KAAA,IAAY,UAAU,GAChD,CAAC,GAAQ,CAAQ,CACnB;CA6BA,OACE,kBAAC,IAAD;EAAsB;YACpB,kBAAC,GAAD;GAAe,OA7BH,SACP;IACL;IACA;IACA;IACA,UAAU;KACR,YAAY,GAAU,cAAc,EAAK;KACzC,qBACE,GAAU,uBAAuB,EAAK;KACxC,gBAAgB,GAAU,kBAAkB,EAAK;KACjD,iBAAiB,GAAU,mBAAmB,EAAK;KACnD,OAAO,GAAU,SAAS,EAAK;KAC/B,SAAS,GAAU,WAAW,EAAK;IACrC;IACA;IACA;GACF,IACA;IACE;IACA;IACA;IACA;IACA;IACA;GACF,CAKwB;aACpB,kBAAC,IAAD;IAAyB;IAAyB;cAChD,kBAAC,IAAD,EAAa,YAAqB,CAAA;GACnB,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/Container/Container.tsx","../src/overlays/OverlayStack.ts","../src/overlays/OverlayProvider.tsx","../src/overlays/OverlaySurface.tsx","../src/primitives/Dialog/Dialog.tsx","../src/primitives/Drawer/Drawer.tsx","../src/primitives/Grid/Grid.tsx","../src/primitives/Icon/Icon.tsx","../src/primitives/IconTile/IconTile.tsx","../src/primitives/Inline/Inline.tsx","../src/primitives/NumberField/NumberField.tsx","../src/primitives/Popover/Popover.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 label: string;\n loading: boolean;\n}\n\nexport function FieldLabel({ label, loading }: Readonly<FieldLabelProps>) {\n return (\n <AriaLabel className={fieldVariants.base.label}>\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 error?: string;\n loading: boolean;\n}\n\nexport function FieldSupportingContent({\n description,\n error,\n loading,\n}: Readonly<FieldSupportProps>) {\n return (\n <>\n {description && (\n <AriaText className={fieldVariants.base.description} slot=\"description\">\n {loading ? (\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n ) : (\n description\n )}\n </AriaText>\n )}\n {error &&\n (loading ? (\n <span aria-hidden=\"true\" className={fieldVariants.base.error}>\n <Skeleton blockSize=\"1lh\" inlineSize=\"12em\" shape=\"rectangle\" />\n </span>\n ) : (\n <AriaFieldError className={fieldVariants.base.error}>\n {error}\n </AriaFieldError>\n ))}\n </>\n );\n}\n","import type { Ref } from 'react';\nimport { useObjectRef } from 'react-aria/useObjectRef';\nimport {\n CheckboxButton as AriaCheckboxButton,\n CheckboxField as AriaCheckboxField,\n} from 'react-aria-components/Checkbox';\nimport { useBreezeContext } from '../../provider/BreezeContext';\nimport { FieldSupportingContent } from '../Field/field.presentation';\nimport { fieldVariants } from '../Field/field.styles';\nimport { Skeleton } from '../Skeleton/Skeleton';\n\nconst variants = {\n base: {\n control:\n 'breeze:relative breeze:inline-grid breeze:min-block-breeze-tap breeze:grid-flow-col breeze:items-center breeze:gap-breeze-2 breeze:cursor-pointer breeze:select-none breeze:font-breeze-sans breeze:text-breeze-sm breeze:font-medium breeze:leading-breeze-snug breeze:text-breeze-ink breeze:data-[disabled]:cursor-not-allowed breeze:data-[disabled]:opacity-60',\n indicator:\n 'breeze:inline-grid breeze:block-size-breeze-5 breeze:inline-size-breeze-5 breeze:shrink-0 breeze:place-items-center breeze:rounded-breeze-chip breeze:border breeze:border-solid breeze:border-breeze-ink-3 breeze:bg-breeze-surface breeze:text-breeze-on-brand breeze:transition-colors breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand',\n label: 'breeze:[grid-area:1/2]',\n skeleton: 'breeze:pointer-events-none breeze:[grid-area:1/2]',\n skeletonIndicator:\n 'breeze:pointer-events-none breeze:[grid-area:1/1] breeze:block-size-breeze-5 breeze:inline-size-breeze-5',\n },\n compound: {},\n size: {},\n state: {},\n variant: {},\n} as const;\n\ninterface CheckboxCommonProps {\n /** Prevents selection and focus. Defaults to `false`. */\n disabled?: boolean;\n /** Associates the checkbox with a form outside its ancestor tree. */\n form?: string;\n /** Sets the native input id. */\n id?: string;\n /** Accessible checkbox label, shown as text outside loading state. */\n label: string;\n /** Replaces the checkbox content with a shape-preserving loading presentation. */\n loading?: boolean;\n /** Sets the submitted name of the checkbox. */\n name?: string;\n /** Supporting guidance announced with the checkbox. */\n description?: string;\n /** Prevents editing while retaining focus and form participation. */\n readOnly?: boolean;\n /** Ref to the native checkbox input. */\n ref?: Ref<HTMLInputElement>;\n /** Marks the checkbox as required. Defaults to `false`. */\n required?: boolean;\n /** Visible validation message; any non-empty value marks the checkbox invalid. */\n error?: string;\n /** Native value submitted when the checkbox is selected. */\n value?: string;\n}\n\ninterface ControlledCheckboxProps {\n /** Current selected state. */\n selected: boolean;\n /** Reports the next selected state without exposing a DOM event. */\n onChange: (selected: boolean) => void;\n /** Controlled and uncontrolled selection props are mutually exclusive. */\n defaultSelected?: never;\n}\n\ninterface UncontrolledCheckboxProps {\n /** Initial selected state. Defaults to `false`. */\n defaultSelected?: boolean;\n /** Reports the next selected state without exposing a DOM event. */\n onChange?: (selected: boolean) => void;\n /** Controlled and uncontrolled selection props are mutually exclusive. */\n selected?: never;\n}\n\n/** Props for controlled or uncontrolled boolean selection. */\nexport type CheckboxProps = CheckboxCommonProps &\n (ControlledCheckboxProps | UncontrolledCheckboxProps);\n\n/**\n * Renders an accessible checkbox with a visible label, validation messages,\n * semantic boolean changes, and a closed loading presentation.\n *\n * @summary Flat boolean selection with semantic value changes.\n */\nexport function Checkbox({\n defaultSelected,\n description,\n disabled = false,\n error,\n form,\n id,\n label,\n loading = false,\n name,\n onChange,\n readOnly = false,\n ref,\n required = false,\n selected,\n value,\n}: Readonly<CheckboxProps>) {\n const { messages } = useBreezeContext();\n const inputRef = useObjectRef(ref);\n const visibleDescription = description?.trim() || undefined;\n const visibleError = error?.trim() || undefined;\n const interactionDisabled = disabled || loading;\n\n return (\n <AriaCheckboxField\n className={fieldVariants.base.root}\n defaultSelected={defaultSelected}\n form={form}\n id={id}\n inputRef={inputRef}\n aria-label={loading ? label : undefined}\n isDisabled={interactionDisabled}\n isInvalid={!loading && visibleError !== undefined}\n isReadOnly={readOnly}\n isRequired={required}\n isSelected={selected}\n name={name}\n onChange={onChange}\n value={value}\n validationBehavior=\"aria\"\n >\n <AriaCheckboxButton className={variants.base.control}>\n {({ isFocusVisible, isSelected }) => (\n <>\n {loading && (\n <>\n <span\n aria-hidden=\"true\"\n className={variants.base.skeletonIndicator}\n >\n <Skeleton\n blockSize=\"100%\"\n inlineSize=\"100%\"\n shape=\"rectangle\"\n />\n </span>\n <span className={variants.base.skeleton}>\n <Skeleton\n blockSize=\"1lh\"\n inlineSize=\"12em\"\n label={messages.loading}\n shape=\"rectangle\"\n />\n </span>\n </>\n )}\n {!loading && (\n <>\n <span\n aria-hidden=\"true\"\n className={variants.base.indicator}\n data-focus-visible={isFocusVisible || undefined}\n data-selected={isSelected || undefined}\n >\n {isSelected ? '✓' : ''}\n </span>\n <span className={variants.base.label}>{label}</span>\n </>\n )}\n </>\n )}\n </AriaCheckboxButton>\n <FieldSupportingContent\n description={visibleDescription}\n error={visibleError}\n loading={loading}\n />\n </AriaCheckboxField>\n );\n}\n","import type { 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 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 {\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 {\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 { 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","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,IAAM,IAAW;CACf,MAAM;EACJ,SACE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