@octaviaflow/core 3.1.0-beta.67 → 3.1.0-beta.68
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/dist/chunk-JMSZOWT2.js +2616 -0
- package/dist/chunk-JMSZOWT2.js.map +1 -0
- package/dist/chunk-KZP2MNBO.js +2516 -0
- package/dist/chunk-KZP2MNBO.js.map +1 -0
- package/dist/chunk-S4LE4BFQ.js +5934 -0
- package/dist/chunk-S4LE4BFQ.js.map +1 -0
- package/dist/chunk-X7YETDK7.js +107 -0
- package/dist/chunk-X7YETDK7.js.map +1 -0
- package/dist/components/WorkflowShowcase/ShowcaseScene.d.ts +20 -0
- package/dist/components/WorkflowShowcase/ShowcaseScene.d.ts.map +1 -0
- package/dist/components/WorkflowShowcase/ShowcaseSignup.d.ts +14 -0
- package/dist/components/WorkflowShowcase/ShowcaseSignup.d.ts.map +1 -0
- package/dist/components/WorkflowShowcase/WorkflowShowcase.d.ts +48 -0
- package/dist/components/WorkflowShowcase/WorkflowShowcase.d.ts.map +1 -0
- package/dist/components/WorkflowShowcase/index.d.ts +3 -0
- package/dist/components/WorkflowShowcase/index.d.ts.map +1 -0
- package/dist/components/WorkflowShowcase/showcaseEngine.d.ts +102 -0
- package/dist/components/WorkflowShowcase/showcaseEngine.d.ts.map +1 -0
- package/dist/index.js +7854 -13331
- package/dist/index.js.map +1 -1
- package/dist/marketing/components/AssistantTranscript/AssistantTranscript.d.ts +15 -0
- package/dist/marketing/components/AssistantTranscript/AssistantTranscript.d.ts.map +1 -0
- package/dist/marketing/components/CtaBanner/CtaBanner.d.ts +16 -0
- package/dist/marketing/components/CtaBanner/CtaBanner.d.ts.map +1 -0
- package/dist/marketing/components/FeatureGrid/FeatureGrid.d.ts +15 -0
- package/dist/marketing/components/FeatureGrid/FeatureGrid.d.ts.map +1 -0
- package/dist/marketing/components/IntegrationsWall/IntegrationsWall.d.ts +19 -0
- package/dist/marketing/components/IntegrationsWall/IntegrationsWall.d.ts.map +1 -0
- package/dist/marketing/components/LiveConsole/LiveConsole.d.ts +21 -0
- package/dist/marketing/components/LiveConsole/LiveConsole.d.ts.map +1 -0
- package/dist/marketing/components/MarketingFooter/MarketingFooter.d.ts +25 -0
- package/dist/marketing/components/MarketingFooter/MarketingFooter.d.ts.map +1 -0
- package/dist/marketing/components/MarketingHero/MarketingHero.d.ts +11 -0
- package/dist/marketing/components/MarketingHero/MarketingHero.d.ts.map +1 -0
- package/dist/marketing/components/MarketingNav/MarketingNav.d.ts +17 -0
- package/dist/marketing/components/MarketingNav/MarketingNav.d.ts.map +1 -0
- package/dist/marketing/components/MarketingSection/MarketingSection.d.ts +15 -0
- package/dist/marketing/components/MarketingSection/MarketingSection.d.ts.map +1 -0
- package/dist/marketing/components/StatBand/StatBand.d.ts +16 -0
- package/dist/marketing/components/StatBand/StatBand.d.ts.map +1 -0
- package/dist/marketing/components/WorkflowShowcase/ShowcaseScene.d.ts +20 -0
- package/dist/marketing/components/WorkflowShowcase/ShowcaseScene.d.ts.map +1 -0
- package/dist/marketing/components/WorkflowShowcase/ShowcaseSignup.d.ts +14 -0
- package/dist/marketing/components/WorkflowShowcase/ShowcaseSignup.d.ts.map +1 -0
- package/dist/marketing/components/WorkflowShowcase/WorkflowShowcase.d.ts +48 -0
- package/dist/marketing/components/WorkflowShowcase/WorkflowShowcase.d.ts.map +1 -0
- package/dist/marketing/components/WorkflowShowcase/index.d.ts +3 -0
- package/dist/marketing/components/WorkflowShowcase/index.d.ts.map +1 -0
- package/dist/marketing/components/WorkflowShowcase/showcaseEngine.d.ts +102 -0
- package/dist/marketing/components/WorkflowShowcase/showcaseEngine.d.ts.map +1 -0
- package/dist/marketing/glyphs.d.ts +20 -0
- package/dist/marketing/glyphs.d.ts.map +1 -0
- package/dist/marketing/index.d.ts +13 -0
- package/dist/marketing/index.d.ts.map +1 -0
- package/dist/marketing.cjs +3985 -0
- package/dist/marketing.cjs.map +1 -0
- package/dist/marketing.js +1669 -0
- package/dist/marketing.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/workflow/components/HttpActionPanel/HttpActionPanel.d.ts +29 -0
- package/dist/workflow/components/HttpActionPanel/HttpActionPanel.d.ts.map +1 -0
- package/dist/workflow/components/HttpActionPanel/httpActionTypes.d.ts +135 -0
- package/dist/workflow/components/HttpActionPanel/httpActionTypes.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +2 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow.cjs +6922 -271
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js +1587 -56
- package/dist/workflow.js.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marketing/index.ts","../src/utils/cn.ts","../src/marketing/components/AssistantTranscript/AssistantTranscript.tsx","../src/components/Button/Button.tsx","../src/utils/a11y.ts","../src/utils/Slot.tsx","../src/utils/composeRefs.ts","../src/marketing/components/CtaBanner/CtaBanner.tsx","../src/marketing/components/FeatureGrid/FeatureGrid.tsx","../src/marketing/glyphs.tsx","../src/marketing/components/IntegrationsWall/IntegrationsWall.tsx","../src/marketing/components/LiveConsole/LiveConsole.tsx","../src/marketing/components/MarketingFooter/MarketingFooter.tsx","../src/marketing/components/MarketingHero/MarketingHero.tsx","../src/marketing/components/MarketingNav/MarketingNav.tsx","../src/marketing/components/MarketingSection/MarketingSection.tsx","../src/marketing/components/StatBand/StatBand.tsx","../src/components/CountUp/CountUp.tsx","../src/marketing/components/WorkflowShowcase/showcaseEngine.ts","../src/marketing/components/WorkflowShowcase/WorkflowShowcase.tsx","../src/marketing/components/WorkflowShowcase/ShowcaseScene.tsx","../src/marketing/components/WorkflowShowcase/ShowcaseSignup.tsx","../src/components/Input/Input.tsx","../src/components/Select/Select.tsx","../../../node_modules/react-stately/dist/private/utils/packages/react-stately/src/utils/useControlledState.ts","../../../node_modules/react-stately/dist/private/form/packages/react-stately/src/form/useFormValidationState.ts","../../../node_modules/react-stately/dist/private/collections/packages/react-stately/src/collections/getChildNodes.ts","../../../node_modules/react-stately/dist/private/list/packages/react-stately/src/list/ListCollection.ts","../../../node_modules/react-stately/dist/private/selection/packages/react-stately/src/selection/Selection.ts","../../../node_modules/react-stately/dist/private/selection/packages/react-stately/src/selection/useMultipleSelectionState.ts","../../../node_modules/react-stately/dist/private/selection/packages/react-stately/src/selection/SelectionManager.ts","../../../node_modules/react-stately/dist/private/collections/packages/react-stately/src/collections/CollectionBuilder.ts","../../../node_modules/react-stately/dist/private/collections/packages/react-stately/src/collections/useCollection.ts","../../../node_modules/react-stately/dist/private/list/packages/react-stately/src/list/useListState.ts","../../../node_modules/react-stately/dist/private/overlays/packages/react-stately/src/overlays/useOverlayTriggerState.ts","../../../node_modules/react-stately/dist/private/collections/packages/react-stately/src/collections/Item.ts","../../../node_modules/react-stately/dist/private/select/packages/react-stately/src/select/useSelectState.ts","../../../node_modules/react-stately/dist/private/tooltip/packages/react-stately/src/tooltip/useTooltipTriggerState.ts","../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* ---------------------------------------------------------------------------\n * @octaviaflow/core/marketing — everything for the marketing site.\n *\n * A dedicated subsystem (like `@octaviaflow/core/workflow`) so marketing\n * surfaces stay clearly separated from product components. Storybook group:\n * `Marketing/`.\n * ------------------------------------------------------------------------- */\n\nexport {\n AssistantTranscript,\n type AssistantTranscriptProps,\n type AssistantTranscriptTurn,\n} from \"./components/AssistantTranscript/AssistantTranscript\";\nexport {\n CtaBanner,\n type CtaBannerAction,\n type CtaBannerProps,\n} from \"./components/CtaBanner/CtaBanner\";\nexport {\n FeatureGrid,\n type FeatureGridItem,\n type FeatureGridProps,\n} from \"./components/FeatureGrid/FeatureGrid\";\nexport {\n IntegrationsWall,\n type IntegrationsWallCategory,\n type IntegrationsWallItem,\n type IntegrationsWallProps,\n} from \"./components/IntegrationsWall/IntegrationsWall\";\nexport {\n LiveConsole,\n type LiveConsoleLine,\n type LiveConsoleProps,\n type LiveConsoleState,\n} from \"./components/LiveConsole/LiveConsole\";\nexport {\n MarketingFooter,\n type MarketingFooterColumn,\n type MarketingFooterLink,\n type MarketingFooterProps,\n} from \"./components/MarketingFooter/MarketingFooter\";\nexport {\n MarketingHero,\n type MarketingHeroProps,\n} from \"./components/MarketingHero/MarketingHero\";\nexport {\n MarketingNav,\n type MarketingNavLink,\n type MarketingNavProps,\n} from \"./components/MarketingNav/MarketingNav\";\nexport {\n MarketingSection,\n type MarketingSectionProps,\n} from \"./components/MarketingSection/MarketingSection\";\nexport {\n StatBand,\n type StatBandItem,\n type StatBandProps,\n} from \"./components/StatBand/StatBand\";\nexport {\n WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS,\n WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES,\n WORKFLOW_SHOWCASE_DEFAULT_METRICS,\n WORKFLOW_SHOWCASE_DEFAULT_TILES,\n WORKFLOW_SHOWCASE_SCHEDULES,\n WorkflowShowcase,\n type WorkflowShowcaseBuildDetail,\n type WorkflowShowcaseConnector,\n type WorkflowShowcaseExample,\n type WorkflowShowcaseMetric,\n type WorkflowShowcasePhase,\n type WorkflowShowcaseProps,\n type WorkflowShowcaseRole,\n type WorkflowShowcaseSignupValues,\n} from \"./components/WorkflowShowcase\";\nexport {\n ActionGlyph,\n BrandMark,\n ConnectorGlyph,\n DestinationGlyph,\n NotifyGlyph,\n roleGlyph,\n SourceGlyph,\n} from \"./glyphs\";\n","import { type ClassValue, clsx } from \"clsx\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return clsx(inputs);\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * AssistantTranscript — a compact \"you → / octavia →\" exchange card showing\n * the natural-language-to-workflow moment in one glance.\n * ------------------------------------------------------------------------- */\n\nexport interface AssistantTranscriptTurn {\n id: string;\n speaker: \"user\" | \"assistant\";\n content: ReactNode;\n}\n\nexport interface AssistantTranscriptProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> {\n /** Header label. Defaults to \"OctaviaFlow AI Assistant\". */\n title?: ReactNode;\n turns: AssistantTranscriptTurn[];\n userLabel?: string;\n assistantLabel?: string;\n}\n\nexport function AssistantTranscript({\n title = \"OctaviaFlow AI Assistant\",\n turns,\n userLabel = \"you\",\n assistantLabel = \"octavia\",\n className,\n ...rest\n}: AssistantTranscriptProps) {\n return (\n <div {...rest} className={cn(\"ods-mkt-transcript\", className)}>\n <div className=\"ods-mkt-transcript__head\">{title}</div>\n <div className=\"ods-mkt-transcript__body\">\n {turns.map((turn) => (\n <div key={turn.id} className=\"ods-mkt-transcript__turn\">\n <span\n className={cn(\n \"ods-mkt-transcript__speaker\",\n `ods-mkt-transcript__speaker--${turn.speaker}`,\n )}\n >\n {turn.speaker === \"user\" ? userLabel : assistantLabel} →\n </span>{\" \"}\n <span className=\"ods-mkt-transcript__content\">{turn.content}</span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","\"use client\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport {\n type ButtonHTMLAttributes,\n type CSSProperties,\n forwardRef,\n type ReactElement,\n type ReactNode,\n type Ref,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { useButton } from \"react-aria\";\nimport { resolveAccessibleName, hasRenderableText } from \"../../utils/a11y\";\nimport { cn } from \"../../utils/cn\";\nimport { Slot } from \"../../utils/Slot\";\n\nexport interface ButtonProps\n extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"onDrag\" | \"onDragStart\" | \"onDragEnd\" | \"onAnimationStart\"\n > {\n variant?: \"primary\" | \"secondary\" | \"ghost\" | \"danger\" | \"icon\";\n size?: \"sm\" | \"md\" | \"lg\";\n loading?: boolean;\n /** Override the rendered label while loading. Useful for action verbs that\n * change form mid-request — e.g. `\"Sign in\"` → `\"Signing in…\"`. */\n loadingText?: ReactNode;\n /** Accessible label for the spinner (announced by AT during loading).\n * Defaults to `\"Loading\"`. Customize for localization or context. */\n loadingLabel?: string;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n fullWidth?: boolean;\n /** Toggle-button state. When defined, the button advertises\n * `aria-pressed` and adds `--pressed` styling. */\n pressed?: boolean;\n children?: ReactNode;\n /**\n * Override the cursor shown on hover. When omitted, the cursor auto-resolves:\n * - `not-allowed` when disabled (CSS handles this — see Button.module.scss)\n * - `progress` when loading (request in flight)\n * - `pointer` when the button has an action (onClick, type=\"submit\",\n * or type=\"reset\"). Anchors (href) get pointer too.\n * - `default` otherwise (decorative / placeholder buttons)\n * Pass an explicit value (e.g. `\"text\"`, `\"grab\"`) to override the\n * auto-resolve for the specific story / use case.\n */\n cursor?: CSSProperties[\"cursor\"];\n /** Render Button's styling onto a custom child element (Radix-style Slot).\n *\n * <Button asChild variant=\"primary\">\n * <NextLink href=\"/checkout\">Continue</NextLink>\n * </Button>\n *\n * When `asChild` is true, Button does NOT render its internal icon /\n * label / spinner slots — the consumer's element fully owns content. Use\n * the regular form (without `asChild`) when you want the built-in\n * slots / loading spinner / size-scaled icons. */\n asChild?: boolean;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"primary\",\n size = \"md\",\n loading = false,\n loadingText,\n loadingLabel = \"Loading\",\n disabled = false,\n leftIcon,\n rightIcon,\n fullWidth = false,\n pressed,\n asChild = false,\n className,\n children,\n type,\n cursor,\n style,\n ...props\n },\n forwardedRef,\n) {\n const ref = useRef<HTMLButtonElement>(null);\n useImperativeHandle(forwardedRef, () => ref.current as HTMLButtonElement);\n const isDisabled = disabled || loading;\n // Respect users who've asked for reduced motion (OS-level a11y setting).\n // When true we skip the whileTap scale animation entirely — Framer's own\n // hook reads `prefers-reduced-motion: reduce` and stays reactive.\n const prefersReducedMotion = useReducedMotion();\n\n // Cursor resolution (centralised in JS so inline-style specificity wins\n // over any CSS cursor rule). Order of precedence:\n // 1. Caller's explicit `cursor` prop.\n // 2. `not-allowed` when disabled (and not also loading — see below).\n // 3. `progress` when loading (button is intentionally non-interactive\n // but the user should see we're working on it).\n // 4. `pointer` when the button has an action.\n // 5. `default` for decorative buttons.\n // Disabled takes precedence over loading when BOTH are set: explicit\n // disabled is a stronger intent than \"currently busy\".\n // Button always renders a native <button>; anchor semantics live on\n // LinkButton. No href branch needed here.\n const hasAction = Boolean(props.onClick) || type === \"submit\" || type === \"reset\";\n const resolvedCursor: string =\n cursor ?? (disabled ? \"not-allowed\" : loading ? \"progress\" : hasAction ? \"pointer\" : \"default\");\n // Forms rely on `type=\"submit\"` to trigger submission. React Aria's useButton\n // defaults type to \"button\" when omitted, so we always pass the caller's type\n // through (defaulting to \"button\" only when truly unspecified).\n const resolvedType: \"button\" | \"submit\" | \"reset\" = type ?? \"button\";\n\n // Buttons get their accessible name from children. Icon-only buttons\n // (variant=\"icon\" or empty children + iconLeft/Right) MUST provide\n // aria-label or aria-labelledby — we resolve it here so react-aria's\n // useButton receives a guaranteed string-or-id, and dev-mode console.error\n // surfaces the missing-name case.\n //\n // `hasVisibleText` counts any renderable TEXT in children — including text\n // inside arrays/fragments/elements (e.g. `{cond && \"Connect\"}` which React\n // passes as an array, or `<span>Save</span>`). SVG/icon-only subtrees carry\n // no readable text, so genuinely icon-only buttons still require an explicit\n // aria-label. (A glyph string like \"×\" counts — announced verbatim.) This\n // must NOT be a bare `typeof children === \"string\"` check: conditional or\n // interpolated text children are arrays, and missing them here forces a\n // bogus `aria-label=\"Unlabeled Button\"` that overrides the real label.\n const hasVisibleText = hasRenderableText(children);\n // In `asChild` mode the consumer's element owns its own accessible name\n // (e.g., the anchor's text content). Suppress Button's own a11y check\n // to avoid false-positive dev warnings.\n const needsAriaName = !hasVisibleText && !asChild;\n const ariaNameProps = needsAriaName\n ? resolveAccessibleName({\n ariaLabel: (props as any)[\"aria-label\"],\n ariaLabelledby: (props as any)[\"aria-labelledby\"],\n componentName: \"Button\",\n })\n : undefined;\n\n const { buttonProps } = useButton(\n {\n isDisabled,\n onPress: props.onClick as any,\n type: resolvedType,\n ...(ariaNameProps ?? {}),\n },\n ref,\n );\n\n // Strip Framer-conflicting props from React Aria output\n const { onDrag, onDragStart, onDragEnd, onAnimationStart, ...safeButtonProps } =\n buttonProps as any;\n\n // Native HTML button attributes the caller passed (form, name, value,\n // aria-*, data-*, etc.) must reach the DOM. We strip the ones React Aria\n // already manages from buttonProps to avoid double-binding event handlers.\n const {\n onClick: _onClick,\n onKeyDown: _onKeyDown,\n onKeyUp: _onKeyUp,\n onMouseDown: _onMouseDown,\n onPointerDown: _onPointerDown,\n onPointerUp: _onPointerUp,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...passthroughProps\n } = props as Record<string, unknown>;\n\n const rootClassName = cn(\n \"ods-btn\",\n `ods-btn--${variant}`,\n `ods-btn--${size}`,\n loading && \"ods-btn--loading\",\n fullWidth && \"ods-btn--full\",\n pressed && \"ods-btn--pressed\",\n className,\n );\n\n // asChild mode — project Button's chrome onto the consumer's element.\n // Internal slots (icons, spinner, label) are NOT rendered — consumer\n // owns the content. react-aria event wiring is also skipped because\n // the consumer's element handles its own activation semantics.\n if (asChild) {\n return (\n <Slot\n {...(passthroughProps as Record<string, unknown>)}\n ref={forwardedRef as unknown as Ref<HTMLElement>}\n className={rootClassName}\n style={{ cursor: resolvedCursor, ...(style as CSSProperties) }}\n aria-pressed={pressed}\n aria-disabled={isDisabled || undefined}\n >\n {children as ReactElement}\n </Slot>\n );\n }\n\n // The visible label — `loadingText` overrides `children` while loading\n // so the in-progress verb form (\"Signing in…\") replaces the idle one.\n const visibleLabel = loading && loadingText !== undefined ? loadingText : children;\n\n return (\n <motion.button\n {...(passthroughProps as any)}\n {...safeButtonProps}\n type={resolvedType}\n ref={ref}\n className={rootClassName}\n // Disabled state CSS rule (cursor: not-allowed) outranks this inline\n // value — see Button.module.scss. So `style.cursor` only applies to\n // idle/loading/active states, exactly what we want.\n style={{ cursor: resolvedCursor, ...(style as any) }}\n data-loading={loading || undefined}\n aria-busy={loading || undefined}\n aria-pressed={pressed}\n whileTap={isDisabled || prefersReducedMotion ? undefined : { scale: 0.97 }}\n transition={{ duration: 0.1 }}\n >\n {/* Content layer. When loading, the leftIcon slot is replaced by an\n inline spinner — both spinner AND label stay visible so the user\n sees the in-progress text (e.g. \"Signing in…\") next to the\n activity indicator. */}\n <span className=\"ods-btn__content\">\n {loading ? (\n <span\n className=\"ods-btn__icon ods-btn__icon--left ods-btn__icon--spinner\"\n role=\"status\"\n aria-label={loadingLabel}\n >\n {/* viewBox is 1em-scaled by CSS (.ods-btn__icon svg → 1em) so\n the spinner tracks the per-size icon scale (12 / 14 / 16 px)\n without needing per-size width attributes. */}\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeDasharray=\"32\"\n strokeDashoffset=\"12\"\n />\n </svg>\n </span>\n ) : (\n leftIcon && <span className=\"ods-btn__icon ods-btn__icon--left\">{leftIcon}</span>\n )}\n {visibleLabel != null && visibleLabel !== false && (\n <span className=\"ods-btn__label\">{visibleLabel}</span>\n )}\n {rightIcon && !loading && (\n <span className=\"ods-btn__icon ods-btn__icon--right\">{rightIcon}</span>\n )}\n </span>\n </motion.button>\n );\n});\n\nButton.displayName = \"Button\";\n","/**\n * a11y — shared helpers for resolving an accessible name from the union of\n * props every form/interactive component accepts.\n *\n * Why this exists:\n * react-aria's hooks (useCheckbox, useSwitch, useRadio, useTextField,\n * useButton, etc.) emit a runtime warning to the browser console when\n * none of the following is present on the underlying element:\n * - aria-label\n * - aria-labelledby\n * - a visible <label> with htmlFor pointing to the element id\n *\n * Many of our components accept `label` as `string | ReactNode`. When\n * `label` is a ReactNode (icon + text, custom JSX), react-aria can't see\n * a text label and the warning fires. This helper centralizes the\n * derivation: it returns a single { 'aria-label' or 'aria-labelledby' }\n * shape that react-aria will accept, and — in development only — it\n * surfaces a focused console.error pointing the developer at the prop\n * they're missing instead of the generic react-aria warning.\n *\n * Usage:\n * const ariaProps = resolveAccessibleName({\n * label,\n * ariaLabel: props['aria-label'],\n * ariaLabelledby: props['aria-labelledby'],\n * componentName: 'Checkbox',\n * });\n * // → { 'aria-label': string } | { 'aria-labelledby': string } | { 'aria-label': string }\n *\n * useCheckbox({ ...otherProps, ...ariaProps }, state, ref);\n */\n\nimport { isValidElement, type ReactNode } from \"react\";\n\n/**\n * True when a ReactNode renders any non-empty, human-readable text.\n *\n * Used by controls whose accessible name comes from their CHILDREN (e.g.\n * Button). Recurses through arrays, fragments, and element children so that\n * conditionally-rendered or wrapped text is detected — e.g.\n * `{cond && \"Save\"}`, `[\"Connect with \", name]`, or `<span>Save</span>`.\n *\n * Returns false for icon/SVG-only subtrees (no string content), so genuinely\n * icon-only controls still trip the missing-accessible-name check. Numbers\n * count (they render as announced text, including 0); booleans / null /\n * undefined do not render and so don't count.\n */\nexport function hasRenderableText(node: ReactNode): boolean {\n if (node === null || node === undefined || typeof node === \"boolean\") return false;\n if (typeof node === \"string\") return node.trim().length > 0;\n if (typeof node === \"number\") return true;\n if (Array.isArray(node)) return node.some(hasRenderableText);\n if (isValidElement(node)) {\n return hasRenderableText((node.props as { children?: ReactNode }).children);\n }\n return false;\n}\n\n/**\n * Extract the concatenated visible text from a ReactNode — used to derive an\n * accessible name when a control accepts a rich `label` (icon + text, custom\n * JSX). Mirrors `hasRenderableText`'s traversal: strings/numbers contribute,\n * arrays/fragments/elements recurse into their children, and\n * booleans/null/undefined contribute nothing. Returns '' when there is no text.\n */\nexport function getRenderableText(node: ReactNode): string {\n if (node === null || node === undefined || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\") return node;\n if (typeof node === \"number\") return String(node);\n if (Array.isArray(node)) return node.map(getRenderableText).join(\"\");\n if (isValidElement(node)) {\n return getRenderableText((node.props as { children?: ReactNode }).children);\n }\n return \"\";\n}\n\nexport interface ResolveAccessibleNameInput {\n /** The visible label, if any. Strings are auto-used as aria-label. */\n label?: ReactNode;\n /** Caller-provided aria-label override. Highest priority when present. */\n ariaLabel?: string;\n /** Caller-provided aria-labelledby. Wins over label-derived values. */\n ariaLabelledby?: string;\n /**\n * Component name used in dev-mode error messages. Helps the developer\n * locate which usage needs a label.\n */\n componentName: string;\n /**\n * Optional secondary fallbacks the component knows about — e.g. a Radio\n * can fall back to its `value` so radios in a group are at least\n * distinguishable. The first non-empty string is used.\n */\n fallbacks?: Array<string | undefined>;\n}\n\nexport type ResolvedAccessibleName = { \"aria-label\": string } | { \"aria-labelledby\": string };\n\n/**\n * Resolve the accessible-name props that should be spread onto the\n * underlying element. Guarantees at least one of aria-label / aria-labelledby\n * is present so react-aria won't warn at runtime.\n *\n * Priority order:\n * 1. aria-labelledby (caller-provided)\n * 2. aria-label (caller-provided)\n * 3. label (when string)\n * 4. fallbacks (when string)\n * 5. component-name placeholder + dev-mode console.error\n */\nexport function resolveAccessibleName(input: ResolveAccessibleNameInput): ResolvedAccessibleName {\n if (input.ariaLabelledby) {\n return { \"aria-labelledby\": input.ariaLabelledby };\n }\n if (input.ariaLabel) {\n return { \"aria-label\": input.ariaLabel };\n }\n if (typeof input.label === \"string\" && input.label.trim().length > 0) {\n return { \"aria-label\": input.label };\n }\n for (const candidate of input.fallbacks ?? []) {\n if (typeof candidate === \"string\" && candidate.trim().length > 0) {\n return { \"aria-label\": candidate };\n }\n }\n\n // Last resort — emit a placeholder so react-aria stays quiet in\n // production, but loudly point at the missing prop in development so the\n // developer fixes the real bug rather than ignoring a global warning.\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.error(\n `[@octaviaflow/core ${input.componentName}] No accessible name. ` +\n `Pass a string \\`label\\`, or \\`aria-label\\`, or \\`aria-labelledby\\` ` +\n `so screen readers can announce this control.`,\n );\n }\n return { \"aria-label\": `Unlabeled ${input.componentName}` };\n}\n","\"use client\";\nimport {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n} from \"react\";\nimport { composeRefs } from \"./composeRefs\";\n\n/* ---------------------------------------------------------------------------\n * Slot — the `asChild` primitive\n *\n * Takes exactly one React element child and clones it, merging the Slot's\n * own props onto the child:\n * - `className` concatenates (slot's classes follow child's)\n * - `style` merges (child's keys win on overlap)\n * - Event handlers chain (slot's handler runs first; if it calls\n * `event.preventDefault()` the child's handler is short-circuited —\n * matching React's own synthetic-event default-handling convention)\n * - Refs compose so both the forwarded ref and the child's own ref point\n * at the rendered DOM node.\n *\n * This is what powers `asChild` across our primitives: it lets consumers\n * swap the rendered element (e.g., to a router Link) without losing the\n * component's styling, accessibility, or behavioural contract.\n * ------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, unknown>;\n\ninterface SlotProps extends HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nexport const Slot = forwardRef<HTMLElement, SlotProps>(function Slot(\n { children, ...slotProps },\n forwardedRef,\n) {\n if (!isValidElement(children)) {\n // Slot requires exactly one React element child. Returning null is\n // safer than throwing — callers that conditionally use `asChild` are\n // common, and we don't want stories / SSR to crash on an empty pass.\n return null;\n }\n const child = Children.only(children) as ReactElement<AnyProps>;\n const childProps = child.props ?? {};\n const childRef = (child as unknown as { ref?: Ref<HTMLElement> }).ref;\n\n return cloneElement(child, {\n ...mergeProps(slotProps as AnyProps, childProps),\n ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n });\n});\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps): AnyProps {\n // Start with the slot's props, then layer the child's on top. We then\n // walk back over the overlapping keys to apply per-key merge rules.\n const merged: AnyProps = { ...slotProps, ...childProps };\n\n for (const key of Object.keys(slotProps)) {\n const slotValue = slotProps[key];\n const childValue = childProps[key];\n\n // Event handlers — chain. Slot's handler runs first; if it invokes\n // event.preventDefault() the child's is skipped, matching the React\n // norm. Both being functions is the trigger.\n if (\n /^on[A-Z]/.test(key) &&\n typeof slotValue === \"function\" &&\n typeof childValue === \"function\"\n ) {\n merged[key] = (...args: unknown[]) => {\n (slotValue as (...a: unknown[]) => void)(...args);\n const event = args[0] as { defaultPrevented?: boolean } | undefined;\n if (event?.defaultPrevented) return;\n (childValue as (...a: unknown[]) => void)(...args);\n };\n continue;\n }\n\n // className — concatenate (slot's classes come first so child's can\n // visually override on direct conflict, which matches authoring intent).\n if (key === \"className\") {\n merged.className = [slotValue, childValue].filter(Boolean).join(\" \");\n continue;\n }\n\n // style — merge; child's keys win on overlap so consumers' inline\n // styles can override our defaults.\n if (key === \"style\") {\n merged.style = {\n ...(slotValue as CSSProperties | undefined),\n ...(childValue as CSSProperties | undefined),\n };\n continue;\n }\n }\n\n return merged;\n}\n","import type { MutableRefObject, Ref, RefCallback } from \"react\";\n\n/** Compose any number of refs (callback or object) into a single ref-callback.\n * Each underlying ref receives the node when React assigns it. Useful for the\n * `asChild` pattern where both the forwarded ref and the child's own ref need\n * to point at the same DOM node. */\nexport function composeRefs<T>(...refs: Array<Ref<T> | undefined | null>): RefCallback<T> {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref != null) {\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { Button } from \"../../../components/Button/Button\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * CtaBanner — the closing conversion band: display headline, lede, primary +\n * secondary calls to action, mono footnote.\n * ------------------------------------------------------------------------- */\n\nexport interface CtaBannerAction {\n label: ReactNode;\n href?: string;\n onClick?: () => void;\n}\n\nexport interface CtaBannerProps extends Omit<ComponentPropsWithoutRef<\"section\">, \"title\"> {\n title: ReactNode;\n lede?: ReactNode;\n primary: CtaBannerAction;\n secondary?: CtaBannerAction;\n /** Mono microcopy under the actions, e.g. beta-review cadence. */\n footnote?: ReactNode;\n}\n\nfunction Action({\n action,\n variant,\n}: {\n action: CtaBannerAction;\n variant: \"primary\" | \"secondary\";\n}) {\n if (action.href) {\n return (\n <a\n className={cn(\"ods-mkt-cta__link\", `ods-mkt-cta__link--${variant}`)}\n href={action.href}\n onClick={action.onClick}\n >\n {action.label}\n </a>\n );\n }\n return (\n <Button variant={variant} onClick={action.onClick}>\n {action.label}\n </Button>\n );\n}\n\nexport function CtaBanner({\n title,\n lede,\n primary,\n secondary,\n footnote,\n className,\n ...rest\n}: CtaBannerProps) {\n return (\n <section {...rest} className={cn(\"ods-mkt-cta\", className)}>\n <h2 className=\"ods-mkt-cta__title\">{title}</h2>\n {lede && <p className=\"ods-mkt-cta__lede\">{lede}</p>}\n <div className=\"ods-mkt-cta__actions\">\n <Action action={primary} variant=\"primary\" />\n {secondary && <Action action={secondary} variant=\"secondary\" />}\n </div>\n {footnote && <p className=\"ods-mkt-cta__footnote\">{footnote}</p>}\n </section>\n );\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * FeatureGrid — hairline-bordered capability grid (the \"Everything you need\"\n * and AI-capability sections). Cells share borders like a table of features.\n * ------------------------------------------------------------------------- */\n\nexport interface FeatureGridItem {\n id: string;\n title: ReactNode;\n body: ReactNode;\n icon?: ReactNode;\n}\n\nexport interface FeatureGridProps extends ComponentPropsWithoutRef<\"div\"> {\n items: FeatureGridItem[];\n columns?: 2 | 3 | 4;\n /** Tighter cells for dense capability lists. */\n dense?: boolean;\n}\n\nexport function FeatureGrid({\n items,\n columns = 3,\n dense = false,\n className,\n ...rest\n}: FeatureGridProps) {\n return (\n <div\n {...rest}\n className={cn(\n \"ods-mkt-features\",\n `ods-mkt-features--${columns}`,\n dense && \"ods-mkt-features--dense\",\n className,\n )}\n >\n {items.map((item) => (\n <article key={item.id} className=\"ods-mkt-features__cell\">\n {item.icon && (\n <span className=\"ods-mkt-features__icon\" aria-hidden=\"true\">\n {item.icon}\n </span>\n )}\n <h3 className=\"ods-mkt-features__title\">{item.title}</h3>\n <p className=\"ods-mkt-features__body\">{item.body}</p>\n </article>\n ))}\n </div>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { WorkflowShowcaseRole } from \"./components/WorkflowShowcase/showcaseEngine\";\n\n/* ---------------------------------------------------------------------------\n * Marketing glyphs — small stroke icons used as default \"app icon\" tiles\n * across the marketing subsystem (showcase cubes/chips, integration walls).\n *\n * Kept lucide-compatible (24×24 viewBox, stroke-based, currentColor) for\n * visual harmony with the rest of the design system. Consumers pass real\n * brand icons via each component's `icon` slot; these are the neutral\n * fallbacks so nothing ever renders as a bare letter pair.\n * ------------------------------------------------------------------------- */\n\ninterface GlyphProps {\n size?: number;\n}\n\nconst base = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n};\n\n/** Database cylinder — data sources. */\nexport function SourceGlyph({ size = 12 }: GlyphProps) {\n return (\n <svg {...base} width={size} height={size} aria-hidden=\"true\">\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5v14a9 3 0 0 0 18 0V5\" />\n <path d=\"M3 12a9 3 0 0 0 18 0\" />\n </svg>\n );\n}\n\n/** Archive box — warehouses / destinations. */\nexport function DestinationGlyph({ size = 12 }: GlyphProps) {\n return (\n <svg {...base} width={size} height={size} aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"5\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\n/** Bolt — downstream actions / triggers. */\nexport function ActionGlyph({ size = 12 }: GlyphProps) {\n return (\n <svg {...base} width={size} height={size} aria-hidden=\"true\">\n <path d=\"M13 2 3 14h9l-1 8 10-12h-9l1-8z\" />\n </svg>\n );\n}\n\n/** Chat bubble — notification targets. */\nexport function NotifyGlyph({ size = 12 }: GlyphProps) {\n return (\n <svg {...base} width={size} height={size} aria-hidden=\"true\">\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n );\n}\n\n/** Plug — generic integration/connector mark (integration walls). */\nexport function ConnectorGlyph({ size = 12 }: GlyphProps) {\n return (\n <svg {...base} width={size} height={size} aria-hidden=\"true\">\n <path d=\"M12 22v-5\" />\n <path d=\"M9 8V2M15 8V2\" />\n <path d=\"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8h12z\" />\n </svg>\n );\n}\n\n/** OctaviaFlow brand mark — square with a forward arrow. */\nexport function BrandMark({ size = 18 }: GlyphProps) {\n return (\n <svg viewBox=\"0 0 18 18\" width={size} height={size} aria-hidden=\"true\">\n <rect width=\"18\" height=\"18\" fill=\"var(--ods-accent)\" />\n <path d=\"M4 9h8.5M9.5 5.5 13 9l-3.5 3.5\" stroke=\"#fff\" strokeWidth=\"1.6\" fill=\"none\" />\n </svg>\n );\n}\n\nexport function roleGlyph(role: WorkflowShowcaseRole, size = 12): ReactNode {\n switch (role) {\n case \"source\":\n return <SourceGlyph size={size} />;\n case \"destination\":\n return <DestinationGlyph size={size} />;\n case \"action\":\n return <ActionGlyph size={size} />;\n case \"notify\":\n return <NotifyGlyph size={size} />;\n }\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { ConnectorGlyph } from \"../../glyphs\";\n\n/* ---------------------------------------------------------------------------\n * IntegrationsWall — categorized connector chips (\"Databases · Warehouses ·\n * CRM …\"). The consuming site passes real names + brand icons; the default\n * chip mark is a neutral connector glyph.\n * ------------------------------------------------------------------------- */\n\nexport interface IntegrationsWallItem {\n name: string;\n icon?: ReactNode;\n}\n\nexport interface IntegrationsWallCategory {\n id: string;\n label: ReactNode;\n items: IntegrationsWallItem[];\n}\n\nexport interface IntegrationsWallProps extends ComponentPropsWithoutRef<\"div\"> {\n categories: IntegrationsWallCategory[];\n /** Mono footnote under the wall. */\n footnote?: ReactNode;\n /** Hide the default glyph on chips without a custom icon. */\n bareChips?: boolean;\n}\n\nexport function IntegrationsWall({\n categories,\n footnote,\n bareChips = false,\n className,\n ...rest\n}: IntegrationsWallProps) {\n return (\n <div {...rest} className={cn(\"ods-mkt-wall\", className)}>\n <div className=\"ods-mkt-wall__grid\">\n {categories.map((category) => (\n <div key={category.id} className=\"ods-mkt-wall__row\">\n <div className=\"ods-mkt-wall__category\">{category.label}</div>\n <div className=\"ods-mkt-wall__chips\">\n {category.items.map((item) => (\n <span key={item.name} className=\"ods-mkt-wall__chip\">\n {(item.icon || !bareChips) && (\n <span className=\"ods-mkt-wall__chip-icon\" aria-hidden=\"true\">\n {item.icon ?? <ConnectorGlyph size={13} />}\n </span>\n )}\n {item.name}\n </span>\n ))}\n </div>\n </div>\n ))}\n </div>\n {footnote && <p className=\"ods-mkt-wall__footnote\">{footnote}</p>}\n </div>\n );\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * LiveConsole — the \"orders_pipeline · production\" terminal card: a mono log\n * of pipeline steps with staggered reveal and per-line state glyphs.\n * ------------------------------------------------------------------------- */\n\nexport type LiveConsoleState = \"done\" | \"running\" | \"queued\" | \"error\";\n\nexport interface LiveConsoleLine {\n id: string;\n /** Step label, e.g. \"warehouse.load\". */\n label: ReactNode;\n /** Trailing detail, e.g. \"— 14,204 rows · 1.2s\". */\n detail?: ReactNode;\n state?: LiveConsoleState;\n}\n\nexport interface LiveConsoleProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> {\n /** Header label, e.g. \"orders_pipeline · production\". */\n title: ReactNode;\n /** Header badge. Defaults to \"LIVE\". Pass null to hide. */\n badge?: ReactNode;\n lines: LiveConsoleLine[];\n /** Staggered line reveal (disabled automatically for reduced motion). */\n animated?: boolean;\n}\n\nconst STATE_GLYPH: Record<LiveConsoleState, string> = {\n done: \"✓\",\n running: \"⟳\",\n queued: \"→\",\n error: \"✕\",\n};\n\nexport function LiveConsole({\n title,\n badge = \"LIVE\",\n lines,\n animated = true,\n className,\n ...rest\n}: LiveConsoleProps) {\n return (\n <div {...rest} className={cn(\"ods-mkt-console\", className)}>\n <div className=\"ods-mkt-console__head\">\n <span className=\"ods-mkt-console__title\">{title}</span>\n {badge != null && (\n <span className=\"ods-mkt-console__badge\">\n <span className=\"ods-mkt-console__dot\" />\n {badge}\n </span>\n )}\n </div>\n <div className=\"ods-mkt-console__body\">\n {lines.map((line, i) => {\n const state = line.state ?? \"done\";\n return (\n <div\n key={line.id}\n className={cn(\"ods-mkt-console__line\", animated && \"ods-mkt-console__line--animated\")}\n style={animated ? { animationDelay: `${0.3 + i * 0.6}s` } : undefined}\n >\n <span\n className={cn(\"ods-mkt-console__glyph\", `ods-mkt-console__glyph--${state}`)}\n aria-hidden=\"true\"\n >\n {STATE_GLYPH[state]}\n </span>{\" \"}\n <span className=\"ods-mkt-console__label\">{line.label}</span>\n {line.detail && (\n <span\n className={cn(\n \"ods-mkt-console__detail\",\n state === \"running\" && \"ods-mkt-console__detail--running\",\n )}\n >\n {\" \"}\n {line.detail}\n </span>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { BrandMark } from \"../../glyphs\";\n\n/* ---------------------------------------------------------------------------\n * MarketingFooter — brand column + link columns + legal bar.\n * ------------------------------------------------------------------------- */\n\nexport interface MarketingFooterLink {\n label: ReactNode;\n href: string;\n}\n\nexport interface MarketingFooterColumn {\n id: string;\n label: ReactNode;\n links: MarketingFooterLink[];\n}\n\nexport interface MarketingFooterProps extends ComponentPropsWithoutRef<\"footer\"> {\n /** Brand slot. Defaults to the OctaviaFlow mark + wordmark. */\n brand?: ReactNode;\n /** Short positioning line under the brand. */\n tagline?: ReactNode;\n /** Extra brand-column content (contact email, status link…). */\n meta?: ReactNode;\n columns?: MarketingFooterColumn[];\n /** Left side of the bottom bar, e.g. \"© 2026 OctaviaFlow\". */\n legal?: ReactNode;\n /** Right side of the bottom bar, e.g. social handles. */\n social?: ReactNode;\n}\n\nexport function MarketingFooter({\n brand,\n tagline,\n meta,\n columns = [],\n legal,\n social,\n className,\n ...rest\n}: MarketingFooterProps) {\n return (\n <footer {...rest} className={cn(\"ods-mkt-footer\", className)}>\n <div className=\"ods-mkt-footer__grid\">\n <div className=\"ods-mkt-footer__brand-col\">\n <div className=\"ods-mkt-footer__brand\">\n {brand ?? (\n <>\n <BrandMark size={16} />\n <span>OctaviaFlow</span>\n </>\n )}\n </div>\n {tagline && <p className=\"ods-mkt-footer__tagline\">{tagline}</p>}\n {meta && <div className=\"ods-mkt-footer__meta\">{meta}</div>}\n </div>\n {columns.map((column) => (\n <nav key={column.id} className=\"ods-mkt-footer__col\" aria-label={String(column.id)}>\n <span className=\"ods-mkt-footer__col-label\">{column.label}</span>\n {column.links.map((link) => (\n <a key={link.href} className=\"ods-mkt-footer__link\" href={link.href}>\n {link.label}\n </a>\n ))}\n </nav>\n ))}\n </div>\n {(legal || social) && (\n <div className=\"ods-mkt-footer__bar\">\n <span>{legal}</span>\n <span>{social}</span>\n </div>\n )}\n </footer>\n );\n}\n","\"use client\";\n\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * MarketingHero — the opening band: kicker, word-by-word animated display\n * headline, lede, then a free slot (typically the WorkflowShowcase).\n * ------------------------------------------------------------------------- */\n\nexport interface MarketingHeroProps extends Omit<ComponentPropsWithoutRef<\"section\">, \"title\"> {\n /** Mono eyebrow, e.g. \"AI-NATIVE PLATFORM — PRIVATE BETA\". */\n kicker?: ReactNode;\n /** Plain-string headline — split into words for the rise animation. */\n title: string;\n lede?: ReactNode;\n align?: \"start\" | \"center\";\n}\n\nexport function MarketingHero({\n kicker,\n title,\n lede,\n align = \"center\",\n className,\n children,\n ...rest\n}: MarketingHeroProps) {\n const reducedMotion = useReducedMotion();\n const words = title.split(/\\s+/).filter(Boolean);\n\n return (\n <section\n {...rest}\n className={cn(\"ods-mkt-hero\", align === \"center\" && \"ods-mkt-hero--center\", className)}\n >\n {kicker && <p className=\"ods-mkt-hero__kicker\">{kicker}</p>}\n <h1 className=\"ods-mkt-hero__title\">\n {words.map((word, i) => (\n <span\n className=\"ods-mkt-hero__word-clip\"\n // biome-ignore lint/suspicious/noArrayIndexKey: words are positional\n key={i}\n >\n <motion.span\n className=\"ods-mkt-hero__word\"\n initial={reducedMotion ? false : { opacity: 0, y: \"100%\" }}\n animate={{ opacity: 1, y: 0 }}\n transition={{\n duration: 0.7,\n delay: 0.05 + i * 0.08,\n ease: [0.2, 0.7, 0.2, 1],\n }}\n >\n {word}\n </motion.span>{\" \"}\n </span>\n ))}\n </h1>\n {lede && (\n <motion.p\n className=\"ods-mkt-hero__lede\"\n initial={reducedMotion ? false : { opacity: 0, y: 12 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.8, delay: 0.6, ease: [0.2, 0.7, 0.2, 1] }}\n >\n {lede}\n </motion.p>\n )}\n {children && (\n <motion.div\n className=\"ods-mkt-hero__body\"\n initial={reducedMotion ? false : { opacity: 0, y: 12 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.8, delay: 0.75, ease: [0.2, 0.7, 0.2, 1] }}\n >\n {children}\n </motion.div>\n )}\n </section>\n );\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { BrandMark } from \"../../glyphs\";\n\n/* ---------------------------------------------------------------------------\n * MarketingNav — sticky top navigation for the marketing site.\n * Brand · links · right-aligned actions (login link, CTA button, …).\n * ------------------------------------------------------------------------- */\n\nexport interface MarketingNavLink {\n label: ReactNode;\n href: string;\n active?: boolean;\n}\n\nexport interface MarketingNavProps extends ComponentPropsWithoutRef<\"header\"> {\n /** Brand slot. Defaults to the OctaviaFlow mark + wordmark. */\n brand?: ReactNode;\n brandHref?: string;\n links?: MarketingNavLink[];\n /** Right side: login links, CTA buttons — consumer-provided. */\n actions?: ReactNode;\n sticky?: boolean;\n}\n\nexport function MarketingNav({\n brand,\n brandHref = \"/\",\n links = [],\n actions,\n sticky = true,\n className,\n ...rest\n}: MarketingNavProps) {\n return (\n <header {...rest} className={cn(\"ods-mkt-nav\", sticky && \"ods-mkt-nav--sticky\", className)}>\n <a className=\"ods-mkt-nav__brand\" href={brandHref}>\n {brand ?? (\n <>\n <BrandMark />\n <span>OctaviaFlow</span>\n </>\n )}\n </a>\n {links.length > 0 && (\n <nav className=\"ods-mkt-nav__links\" aria-label=\"Main\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n className={cn(\"ods-mkt-nav__link\", link.active && \"ods-mkt-nav__link--active\")}\n aria-current={link.active ? \"page\" : undefined}\n >\n {link.label}\n </a>\n ))}\n </nav>\n )}\n {actions && <div className=\"ods-mkt-nav__actions\">{actions}</div>}\n </header>\n );\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * MarketingSection — the page-band primitive every marketing section sits in.\n * Kicker (mono microcopy) → display title → lede, then arbitrary children.\n * ------------------------------------------------------------------------- */\n\nexport interface MarketingSectionProps extends Omit<ComponentPropsWithoutRef<\"section\">, \"title\"> {\n /** Mono eyebrow above the title, e.g. \"PLATFORM\". */\n kicker?: ReactNode;\n title?: ReactNode;\n /** Lede paragraph under the title. */\n lede?: ReactNode;\n align?: \"start\" | \"center\";\n /** \"subtle\" gives the band a muted background. */\n tone?: \"default\" | \"subtle\";\n /** Remove the default top hairline (e.g. for the first section). */\n flushTop?: boolean;\n}\n\nexport function MarketingSection({\n kicker,\n title,\n lede,\n align = \"start\",\n tone = \"default\",\n flushTop = false,\n className,\n children,\n ...rest\n}: MarketingSectionProps) {\n return (\n <section\n {...rest}\n className={cn(\n \"ods-mkt-section\",\n align === \"center\" && \"ods-mkt-section--center\",\n tone === \"subtle\" && \"ods-mkt-section--subtle\",\n flushTop && \"ods-mkt-section--flush\",\n className,\n )}\n >\n {(kicker || title || lede) && (\n <header className=\"ods-mkt-section__head\">\n {kicker && <p className=\"ods-mkt-section__kicker\">{kicker}</p>}\n {title && <h2 className=\"ods-mkt-section__title\">{title}</h2>}\n {lede && <p className=\"ods-mkt-section__lede\">{lede}</p>}\n </header>\n )}\n {children}\n </section>\n );\n}\n","\"use client\";\n\nimport { useReducedMotion } from \"framer-motion\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { CountUp } from \"../../../components/CountUp/CountUp\";\nimport { cn } from \"../../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * StatBand — big proof numbers (\"600+ CONNECTORS · 10× FASTER SETUP …\").\n * Numeric values count up on mount; strings render as-is.\n * ------------------------------------------------------------------------- */\n\nexport interface StatBandItem {\n id: string;\n /** Number → animated count-up; string → rendered verbatim (\"10×\"). */\n value: number | string;\n label: ReactNode;\n prefix?: string;\n suffix?: string;\n}\n\nexport interface StatBandProps extends ComponentPropsWithoutRef<\"div\"> {\n items: StatBandItem[];\n /** \"row\" = horizontal band; \"column\" = stacked rail (default). */\n orientation?: \"column\" | \"row\";\n}\n\nexport function StatBand({ items, orientation = \"column\", className, ...rest }: StatBandProps) {\n const reducedMotion = useReducedMotion();\n return (\n <div\n {...rest}\n className={cn(\"ods-mkt-statband\", `ods-mkt-statband--${orientation}`, className)}\n >\n {items.map((item) => (\n <div key={item.id} className=\"ods-mkt-statband__item\">\n <div className=\"ods-mkt-statband__value\">\n {typeof item.value === \"number\" ? (\n <CountUp\n value={item.value}\n duration={900}\n disableAnimation={Boolean(reducedMotion)}\n prefix={item.prefix}\n suffix={item.suffix}\n formatValue={(v) => Math.round(v).toLocaleString(\"en-US\")}\n />\n ) : (\n <>\n {item.prefix}\n {item.value}\n {item.suffix}\n </>\n )}\n </div>\n <div className=\"ods-mkt-statband__label\">{item.label}</div>\n </div>\n ))}\n </div>\n );\n}\n","\"use client\";\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/* ---------------------------------------------------------------------------\n * CountUp — animated numeric counter.\n *\n * For ETL / orchestration dashboards: rows processed, runs completed,\n * MRR, throughput totals. Pairs naturally with `Sparkline` and `Stat`.\n *\n * The animation is implementation-light — a `requestAnimationFrame` loop\n * with a configurable easing function. Skips entirely when the user has\n * `prefers-reduced-motion` enabled or `disableAnimation` is true.\n *\n * Re-runs the tween whenever `value` changes, starting from the previous\n * displayed value (so consecutive updates flow smoothly without a reset\n * to 0).\n * ------------------------------------------------------------------------- */\n\nexport type Easing = (t: number) => number;\n\nexport interface CountUpProps\n extends Omit<\n ComponentPropsWithoutRef<\"span\">,\n // HTMLSpanElement carries a native `prefix` attribute (string) — omit\n // it so our `ReactNode` prefix slot can coexist.\n \"children\" | \"onChange\" | \"prefix\"\n > {\n /** Target value. */\n value: number;\n /** Starting value on FIRST mount. Default 0. */\n from?: number;\n /** Tween duration in ms. Default 800. */\n duration?: number;\n /** Easing function. Default `easeOutCubic`. */\n easing?: Easing;\n /** Decimal places when no `formatValue` is supplied. Default 0. */\n decimals?: number;\n /** Custom formatter — wins over `decimals`. */\n formatValue?: (value: number) => ReactNode;\n /** Inline content before the number. */\n prefix?: ReactNode;\n /** Inline content after the number (e.g. \"%\"). */\n suffix?: ReactNode;\n /** Delay the tween start in ms. */\n delay?: number;\n /**\n * Skip the animation and render `value` immediately. Reads as a\n * \"static mode\" — useful for SSR snapshots or print views.\n */\n disableAnimation?: boolean;\n /** Fires once when the tween settles on the target value. */\n onComplete?: () => void;\n}\n\n/* ---------------------------------------------------------------------------\n * Easings\n * ------------------------------------------------------------------------- */\n\nexport const easeLinear: Easing = (t) => t;\nexport const easeOutCubic: Easing = (t) => 1 - Math.pow(1 - t, 3);\nexport const easeOutQuart: Easing = (t) => 1 - Math.pow(1 - t, 4);\nexport const easeOutExpo: Easing = (t) =>\n t === 1 ? 1 : 1 - Math.pow(2, -10 * t);\n\n/* ---------------------------------------------------------------------------\n * Component\n * ------------------------------------------------------------------------- */\n\nexport const CountUp = forwardRef<HTMLSpanElement, CountUpProps>(\n function CountUp(\n {\n value,\n from = 0,\n duration = 800,\n easing = easeOutCubic,\n decimals = 0,\n formatValue,\n prefix,\n suffix,\n delay = 0,\n disableAnimation = false,\n onComplete,\n className,\n ...rest\n },\n ref,\n ) {\n // The current rendered number. Initialise to `from` on first mount;\n // subsequent renders tween from the previous displayed value.\n const [n, setN] = useState<number>(disableAnimation ? value : from);\n const lastRendered = useRef<number>(disableAnimation ? value : from);\n\n useEffect(() => {\n // Respect prefers-reduced-motion — snap to target without animation.\n const reduced =\n typeof window !== \"undefined\" &&\n window.matchMedia?.(\"(prefers-reduced-motion: reduce)\")\n .matches;\n\n if (disableAnimation || reduced) {\n setN(value);\n lastRendered.current = value;\n onComplete?.();\n return;\n }\n\n const startValue = lastRendered.current;\n const delta = value - startValue;\n if (delta === 0) return;\n\n let raf: number | null = null;\n let timeoutId: number | null = null;\n let startTime: number | null = null;\n let cancelled = false;\n\n const tick = (ts: number) => {\n if (cancelled) return;\n if (startTime === null) startTime = ts;\n const t = Math.min(1, (ts - startTime) / Math.max(1, duration));\n const eased = easing(t);\n const current = startValue + delta * eased;\n setN(current);\n lastRendered.current = current;\n if (t < 1) {\n raf = requestAnimationFrame(tick);\n } else {\n lastRendered.current = value;\n setN(value);\n onComplete?.();\n }\n };\n\n const start = () => {\n raf = requestAnimationFrame(tick);\n };\n\n if (delay > 0) {\n timeoutId = window.setTimeout(start, delay);\n } else {\n start();\n }\n\n return () => {\n cancelled = true;\n if (raf !== null) cancelAnimationFrame(raf);\n if (timeoutId !== null) window.clearTimeout(timeoutId);\n };\n // We intentionally exclude `easing` from deps — it should be a\n // stable function reference. If the consumer changes easing\n // mid-flight, we just pick it up on the next value change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value, duration, delay, disableAnimation]);\n\n const display = formatValue ? formatValue(n) : n.toFixed(decimals);\n\n return (\n <span\n {...rest}\n ref={ref}\n className={cn(\"ods-count-up\", className)}\n // aria-live so screen readers announce updates without a stale\n // value lingering. Polite (default for \"status\") avoids\n // interrupting other announcements.\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {prefix}\n {display}\n {suffix}\n </span>\n );\n },\n);\n\nCountUp.displayName = \"CountUp\";\n","import type { ReactNode } from \"react\";\n\n/* ---------------------------------------------------------------------------\n * WorkflowShowcase engine — pure data + logic, no React rendering.\n *\n * Everything the marketing funnel needs to \"think\" lives here so it can be\n * unit-tested without mounting the (heavily animated) component tree:\n * connector recognition, schedule inference, plan resolution, activity-rail\n * script and prompt segmentation for the live-highlight overlay.\n * ------------------------------------------------------------------------- */\n\nexport type WorkflowShowcaseRole = \"source\" | \"destination\" | \"action\" | \"notify\";\n\nexport interface WorkflowShowcaseConnector {\n /** Canonical display name — matched case-insensitively inside the prompt. */\n name: string;\n role: WorkflowShowcaseRole;\n /** Extra strings that also count as a mention of this connector. */\n aliases?: string[];\n /** Optional icon tile. Defaults to a two-letter monogram. */\n icon?: ReactNode;\n}\n\nexport interface WorkflowShowcaseExample {\n id: string;\n /** Chip label, e.g. \"Storefront orders → Warehouse, hourly\". */\n label: string;\n /** Prompt inserted (and auto-built) when the chip is clicked. */\n prompt: string;\n}\n\nexport interface WorkflowShowcaseMetric {\n id: string;\n /** Final value once the pipeline reads as live. */\n value: number;\n /** Interim value while the workflow is still assembling. Omit → \"—\". */\n buildingValue?: number;\n decimals?: number;\n /** Small unit text after the value, e.g. \"rows/min\". */\n unit?: string;\n /** Rendered before the number, e.g. \"−\". */\n prefix?: string;\n /** Rendered flush after the number, e.g. \"%\". */\n suffix?: string;\n /** Mono microcopy under the value, e.g. \"THROUGHPUT\". */\n label: string;\n /** \"success\" tints the final value green (savings, wins). */\n tone?: \"default\" | \"success\";\n}\n\nexport type WorkflowShowcasePhase =\n | \"idle\"\n | \"analyzing\"\n | \"building\"\n | \"done\"\n | \"signup\"\n | \"creating\"\n | \"welcome\";\n\n/** Phases in which the generated workflow reads as complete. */\nexport const SETTLED_PHASES: readonly WorkflowShowcasePhase[] = [\n \"done\",\n \"signup\",\n \"creating\",\n \"welcome\",\n];\n\nexport interface WorkflowShowcasePlan {\n /** Sources, in catalog order. */\n left: WorkflowShowcaseConnector[];\n /** Destination → action → notify, in that order. */\n right: WorkflowShowcaseConnector[];\n /** Every connector in the plan (left + right). */\n all: WorkflowShowcaseConnector[];\n /** Total assemble steps: each source + schema map + each right-side node. */\n totalSteps: number;\n}\n\nexport interface WorkflowShowcaseSignupValues {\n name: string;\n email: string;\n company: string;\n teamSize: string;\n}\n\nexport interface ShowcaseActivityLine {\n id: string;\n text: string;\n tone: \"muted\" | \"faint\" | \"active\" | \"done\" | \"plain\";\n}\n\nexport interface ShowcasePromptSegment {\n text: string;\n /** Set when this segment is a recognized connector mention. */\n connector?: WorkflowShowcaseConnector;\n}\n\n/* ---------------------------------------------------------------------------\n * Defaults — deliberately vendor-neutral. The consuming site passes its real\n * connector catalog; the design system itself stays name-free.\n * ------------------------------------------------------------------------- */\n\nexport const WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS: WorkflowShowcaseConnector[] = [\n { name: \"Storefront\", role: \"source\", aliases: [\"store\", \"shop orders\"] },\n { name: \"Payments\", role: \"source\", aliases: [\"payouts\"] },\n { name: \"Orders DB\", role: \"source\", aliases: [\"orders database\"] },\n { name: \"CRM\", role: \"source\", aliases: [\"crm leads\"] },\n { name: \"Warehouse\", role: \"destination\" },\n { name: \"Lakehouse\", role: \"destination\" },\n { name: \"Campaigns\", role: \"action\", aliases: [\"campaign\"] },\n { name: \"Team Chat\", role: \"notify\", aliases: [\"chat\", \"alert the team\"] },\n];\n\nexport const WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES: WorkflowShowcaseExample[] = [\n {\n id: \"hourly-sync\",\n label: \"Storefront orders → Warehouse, hourly\",\n prompt: \"Sync Storefront orders to Warehouse every hour, alert sales in Team Chat\",\n },\n {\n id: \"daily-load\",\n label: \"Payments payouts → Lakehouse, daily\",\n prompt: \"Load Payments payouts into Lakehouse daily\",\n },\n {\n id: \"realtime-stream\",\n label: \"Orders DB changes → Warehouse + Team Chat\",\n prompt: \"Stream Orders DB changes to Warehouse in real-time and notify Team Chat\",\n },\n];\n\nexport const WORKFLOW_SHOWCASE_DEFAULT_METRICS: WorkflowShowcaseMetric[] = [\n { id: \"throughput\", value: 2341, buildingValue: 842, unit: \"rows/min\", label: \"THROUGHPUT\" },\n {\n id: \"latency\",\n value: 0.8,\n buildingValue: 1.1,\n decimals: 1,\n unit: \"s latency\",\n label: \"SYNC SPEED\",\n },\n { id: \"cost\", value: 43, prefix: \"−\", suffix: \"%\", label: \"COST VS BASELINE\", tone: \"success\" },\n];\n\nexport const WORKFLOW_SHOWCASE_SCHEDULES = [\"AUTO\", \"HOURLY\", \"DAILY\", \"REAL-TIME\"] as const;\n\nexport const WORKFLOW_SHOWCASE_DEFAULT_TILES = [\n \"ELT\",\n \"CDC\",\n \"DAG\",\n \"CRON\",\n \"HEAL\",\n \"COST\",\n \"API\",\n \"LOG\",\n] as const;\n\n/* ---------------------------------------------------------------------------\n * Recognition\n * ------------------------------------------------------------------------- */\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\ninterface Mention {\n connector: WorkflowShowcaseConnector;\n pattern: string;\n}\n\n/** Every (connector, matchable-string) pair, longest pattern first so\n * overlapping names (\"Orders DB\" vs \"Orders\") resolve to the longest hit. */\nfunction mentionsOf(catalog: WorkflowShowcaseConnector[]): Mention[] {\n const out: Mention[] = [];\n for (const connector of catalog) {\n out.push({ connector, pattern: connector.name });\n for (const alias of connector.aliases ?? []) out.push({ connector, pattern: alias });\n }\n return out.sort((a, b) => b.pattern.length - a.pattern.length);\n}\n\n/** Connector names mentioned in the prompt, in catalog order, deduped. */\nexport function detectConnectors(prompt: string, catalog: WorkflowShowcaseConnector[]): string[] {\n const lower = prompt.toLowerCase();\n return catalog\n .filter((c) => [c.name, ...(c.aliases ?? [])].some((p) => lower.includes(p.toLowerCase())))\n .map((c) => c.name);\n}\n\n/** Split the prompt into plain / recognized-connector segments, preserving\n * the user's exact text. Powers the live-highlight overlay. */\nexport function segmentPrompt(\n prompt: string,\n catalog: WorkflowShowcaseConnector[],\n): ShowcasePromptSegment[] {\n if (!prompt) return [];\n const mentions = mentionsOf(catalog);\n if (!mentions.length) return [{ text: prompt }];\n const re = new RegExp(`(${mentions.map((m) => escapeRegExp(m.pattern)).join(\"|\")})`, \"gi\");\n const byPattern = new Map(mentions.map((m) => [m.pattern.toLowerCase(), m.connector]));\n return prompt\n .split(re)\n .filter((part) => part !== \"\")\n .map((part) => {\n const connector = byPattern.get(part.toLowerCase());\n return connector ? { text: part, connector } : { text: part };\n });\n}\n\n/** Infer a schedule from natural language; null when nothing matches. */\nexport function scheduleFromPrompt(prompt: string): string | null {\n const t = prompt.toLowerCase();\n if (/stream|real.?time|cdc/.test(t)) return \"REAL-TIME\";\n if (/hour/.test(t)) return \"HOURLY\";\n if (/dail|every day|nightly/.test(t)) return \"DAILY\";\n return null;\n}\n\n/** Two-letter monogram for the default icon tile: \"Team Chat\" → \"TC\". */\nexport function monogram(name: string): string {\n const words = name.trim().split(/\\s+/);\n const raw = words.length >= 2 ? `${words[0][0]}${words[1][0]}` : name.slice(0, 2);\n return raw.toUpperCase();\n}\n\n/* ---------------------------------------------------------------------------\n * Plan resolution\n * ------------------------------------------------------------------------- */\n\nconst RIGHT_ORDER: Record<WorkflowShowcaseRole, number> = {\n source: -1,\n destination: 0,\n action: 1,\n notify: 2,\n};\n\n/**\n * Resolve the workflow plan from explicit picks + prompt mentions. A viable\n * demo always has at least one source and one non-source, so missing sides\n * are backfilled from the catalog (first source / first notify-or-destination).\n */\nexport function resolvePlan(\n selected: string[],\n detected: string[],\n catalog: WorkflowShowcaseConnector[],\n): WorkflowShowcasePlan {\n const byName = new Map(catalog.map((c) => [c.name, c]));\n let names = [...new Set([...selected, ...detected])].filter((n) => byName.has(n));\n if (!names.length) {\n const fallback = [\n catalog.find((c) => c.role === \"source\"),\n catalog.find((c) => c.role === \"destination\"),\n catalog.find((c) => c.role === \"notify\"),\n ].filter((c): c is WorkflowShowcaseConnector => Boolean(c));\n names = fallback.map((c) => c.name);\n }\n const has = (predicate: (c: WorkflowShowcaseConnector) => boolean) =>\n names.some((n) => {\n const c = byName.get(n);\n return Boolean(c && predicate(c));\n });\n if (!has((c) => c.role === \"source\")) {\n const source = catalog.find((c) => c.role === \"source\");\n if (source) names = [source.name, ...names];\n }\n if (!has((c) => c.role !== \"source\")) {\n const sink =\n catalog.find((c) => c.role === \"notify\") ?? catalog.find((c) => c.role !== \"source\");\n if (sink) names = [...names, sink.name];\n }\n const picked = catalog.filter((c) => names.includes(c.name));\n const left = picked.filter((c) => c.role === \"source\");\n const right = picked\n .filter((c) => c.role !== \"source\")\n .sort((a, b) => RIGHT_ORDER[a.role] - RIGHT_ORDER[b.role]);\n const all = [...left, ...right];\n return { left, right, all, totalSteps: all.length + 1 };\n}\n\n/* ---------------------------------------------------------------------------\n * Activity rail script\n * ------------------------------------------------------------------------- */\n\nfunction stepVerb(role: WorkflowShowcaseRole): string {\n if (role === \"notify\") return \"alert\";\n if (role === \"action\") return \"trigger\";\n return \"load\";\n}\n\n/** Ordered assemble steps for the rail + canvas (\"storefront extract\", …). */\nexport function assembleSteps(plan: WorkflowShowcasePlan): string[] {\n return [\n ...plan.left.map((c) => `${c.name.toLowerCase()} extract`),\n \"schema map · 14 fields\",\n ...plan.right.map((c) => `${c.name.toLowerCase()} ${stepVerb(c.role)}`),\n ];\n}\n\n/**\n * Script the \"OCTAVIA IS DOING\" rail for the current moment.\n * `shown` = number of assemble steps already completed while building.\n */\nexport function buildActivity(args: {\n phase: WorkflowShowcasePhase;\n shown: number;\n plan: WorkflowShowcasePlan;\n selected: string[];\n status: string;\n}): ShowcaseActivityLine[] {\n const { phase, shown, plan, selected, status } = args;\n const settled = SETTLED_PHASES.includes(phase);\n const lines: ShowcaseActivityLine[] = [];\n if (phase === \"idle\") {\n if (!selected.length) {\n lines.push({ id: \"wait\", text: \"▸ waiting for instructions…\", tone: \"muted\" });\n lines.push({ id: \"hint\", text: \"· type a request or pick apps\", tone: \"faint\" });\n }\n for (const name of selected.slice(-6)) {\n lines.push({ id: `sel-${name}`, text: `+ ${name.toLowerCase()} connected`, tone: \"plain\" });\n }\n return lines;\n }\n if (phase === \"analyzing\") {\n for (const name of selected.slice(-4)) {\n lines.push({ id: `sel-${name}`, text: `+ ${name.toLowerCase()} connected`, tone: \"muted\" });\n }\n lines.push({ id: \"status\", text: `⟳ ${status}`, tone: \"active\" });\n return lines;\n }\n assembleSteps(plan).forEach((step, i) => {\n if (settled || shown > i) lines.push({ id: `step-${i}`, text: `✓ ${step}`, tone: \"done\" });\n else if (shown === i) lines.push({ id: `step-${i}`, text: `⟳ ${step}…`, tone: \"active\" });\n else lines.push({ id: `step-${i}`, text: `· ${step} queued`, tone: \"muted\" });\n });\n if (settled) lines.push({ id: \"errors\", text: \"✓ error handling attached\", tone: \"done\" });\n return lines.slice(-8);\n}\n\n/* ---------------------------------------------------------------------------\n * Misc\n * ------------------------------------------------------------------------- */\n\n/** \"Acme Inc.\" → \"acme-inc\" (workspace slug preview in the welcome card). */\nexport function slugify(value: string): string {\n return (\n value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-|-$/g, \"\") || \"your-team\"\n );\n}\n\nexport function isValidEmail(value: string): boolean {\n return /^\\S+@\\S+\\.\\S+$/.test(value.trim());\n}\n","\"use client\";\n\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport {\n type ComponentPropsWithoutRef,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Button } from \"../../../components/Button/Button\";\nimport { CountUp } from \"../../../components/CountUp/CountUp\";\nimport { cn } from \"../../../utils/cn\";\nimport { roleGlyph } from \"../../glyphs\";\nimport { ShowcaseScene } from \"./ShowcaseScene\";\nimport { ShowcaseSignup } from \"./ShowcaseSignup\";\nimport {\n buildActivity,\n detectConnectors,\n isValidEmail,\n resolvePlan,\n SETTLED_PHASES,\n scheduleFromPrompt,\n segmentPrompt,\n WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS,\n WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES,\n WORKFLOW_SHOWCASE_DEFAULT_METRICS,\n WORKFLOW_SHOWCASE_DEFAULT_TILES,\n WORKFLOW_SHOWCASE_SCHEDULES,\n type WorkflowShowcaseConnector,\n type WorkflowShowcaseExample,\n type WorkflowShowcaseMetric,\n type WorkflowShowcasePhase,\n type WorkflowShowcasePlan,\n type WorkflowShowcaseSignupValues,\n} from \"./showcaseEngine\";\n\n/* ---------------------------------------------------------------------------\n * WorkflowShowcase — the marketing-site \"prompt → live pipeline → signup\"\n * funnel, as one self-driving composition.\n *\n * A visitor types (or taps an example), watches Octavia recognize connectors\n * live, builds the workflow on an isometric canvas with real-feeling\n * telemetry, and converts through an in-canvas workspace form — without ever\n * leaving the hero. All product copy (connector catalog, examples, metrics)\n * is prop-driven; the defaults are deliberately vendor-neutral.\n * ------------------------------------------------------------------------- */\n\nexport interface WorkflowShowcaseBuildDetail {\n prompt: string;\n connectors: string[];\n schedule: string;\n}\n\nexport interface WorkflowShowcaseProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"onSubmit\"> {\n /** Connector catalog to recognize/pick from. Vendor-neutral by default. */\n connectors?: WorkflowShowcaseConnector[];\n /** \"TRY:\" example chips. */\n examples?: WorkflowShowcaseExample[];\n /** Right-rail metric cards. */\n metrics?: WorkflowShowcaseMetric[];\n /** Pre-filled prompt text. */\n defaultPrompt?: string;\n /** Mono label at the right edge of the toolbar. */\n modelLabel?: string;\n /** Mono label in the canvas header. */\n canvasLabel?: string;\n /** Header of the live activity rail. */\n railLabel?: string;\n /** Labels for the 8 platform tiles in the scene. */\n platformTiles?: readonly string[];\n /** Icon on the core cube. */\n coreIcon?: ReactNode;\n /** Catalog-size figure used in coach copy, e.g. \"600+\". */\n catalogNote?: string;\n /** Team-size choices in the signup form. */\n teamSizes?: string[];\n /** Domain used for the workspace-slug preview in the welcome card. */\n workspaceDomain?: string;\n dashboardHref?: string;\n onboardingHref?: string;\n /** Accessible label for the prompt textarea. */\n promptAriaLabel?: string;\n /** Fires when a build kicks off (analytics hook). */\n onBuild?: (detail: WorkflowShowcaseBuildDetail) => void;\n /** Fires on every phase transition (analytics hook). */\n onPhaseChange?: (phase: WorkflowShowcasePhase) => void;\n /**\n * Real signup handler. Resolve → welcome card; throw → inline error and\n * back to the form. Omit to simulate provisioning (pure demo mode).\n */\n onSignup?: (values: WorkflowShowcaseSignupValues) => Promise<void> | void;\n}\n\ninterface SwapState {\n name: string;\n /** Exact text the visitor typed (may be an alias) — what gets replaced. */\n text: string;\n x: number;\n y: number;\n}\n\nconst EMPTY_PLAN: WorkflowShowcasePlan = { left: [], right: [], all: [], totalSteps: 1 };\n\nfunction ConnectorTile({ connector }: { connector: WorkflowShowcaseConnector }) {\n // Decorative app tile — hidden so button names stay clean for AT.\n // Consumers pass real brand icons via `icon`; the fallback is a role glyph.\n return (\n <span\n aria-hidden=\"true\"\n className={cn(\"ods-showcase__apptile\", `ods-showcase__apptile--${connector.role}`)}\n >\n {connector.icon ?? roleGlyph(connector.role)}\n </span>\n );\n}\n\nexport function WorkflowShowcase({\n connectors = WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS,\n examples = WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES,\n metrics = WORKFLOW_SHOWCASE_DEFAULT_METRICS,\n defaultPrompt = \"\",\n modelLabel = \"octavia-core-1\",\n canvasLabel = \"workflow_canvas\",\n railLabel = \"OCTAVIA IS DOING\",\n platformTiles = WORKFLOW_SHOWCASE_DEFAULT_TILES,\n coreIcon,\n catalogNote = \"600+\",\n teamSizes = [\"1–10\", \"11–50\", \"51–200\", \"200+\"],\n workspaceDomain = \"octaviaflow.com\",\n dashboardHref,\n onboardingHref = \"#\",\n promptAriaLabel = \"Describe your pipeline\",\n onBuild,\n onPhaseChange,\n onSignup,\n className,\n ...rest\n}: WorkflowShowcaseProps) {\n const reducedMotion = useReducedMotion();\n const [prompt, setPrompt] = useState(defaultPrompt);\n const [selected, setSelected] = useState<string[]>([]);\n const [phase, setPhase] = useState<WorkflowShowcasePhase>(\"idle\");\n const [shown, setShown] = useState(0);\n const [status, setStatus] = useState(\"\");\n const [pickerOpen, setPickerOpen] = useState(false);\n const [schedIdx, setSchedIdx] = useState(0);\n const [swap, setSwap] = useState<SwapState | null>(null);\n const [signupError, setSignupError] = useState<string | null>(null);\n\n const cardRef = useRef<HTMLDivElement>(null);\n const timers = useRef<ReturnType<typeof setTimeout>[]>([]);\n const clearTimers = useCallback(() => {\n for (const t of timers.current) clearTimeout(t);\n timers.current = [];\n }, []);\n useEffect(() => clearTimers, [clearTimers]);\n // Compress the choreography (not the content) when the visitor prefers\n // reduced motion — they still see every step, just sooner.\n const tempo = reducedMotion ? 0.35 : 1;\n const at = useCallback(\n (ms: number, fn: () => void) => {\n timers.current.push(setTimeout(fn, ms * tempo));\n },\n [tempo],\n );\n\n const firstPhase = useRef(true);\n useEffect(() => {\n if (firstPhase.current) {\n firstPhase.current = false;\n return;\n }\n onPhaseChange?.(phase);\n }, [phase, onPhaseChange]);\n\n // Render-time mirror of `phase` so callbacks that reset + immediately\n // rebuild (example chips) never read a stale \"building\" and bail out.\n const phaseRef = useRef(phase);\n phaseRef.current = phase;\n\n const byName = useMemo(() => new Map(connectors.map((c) => [c.name, c])), [connectors]);\n const detected = useMemo(() => detectConnectors(prompt, connectors), [prompt, connectors]);\n const union = useMemo(() => [...new Set([...selected, ...detected])], [selected, detected]);\n const settled = SETTLED_PHASES.includes(phase);\n const engaged = phase !== \"idle\";\n const buildingNow = phase === \"analyzing\" || phase === \"building\";\n\n /** Partition currently-selected connectors into scene sides (no backfill). */\n const plan = useMemo<WorkflowShowcasePlan>(() => {\n if (!selected.length) return EMPTY_PLAN;\n return resolvePlan(selected, [], connectors);\n }, [selected, connectors]);\n\n /* ── schedule ──────────────────────────────────────────────────────── */\n const schedules = WORKFLOW_SHOWCASE_SCHEDULES;\n const inferredSchedule = scheduleFromPrompt(prompt);\n const manualSchedule = schedules[schedIdx];\n const scheduleShown = inferredSchedule ?? (manualSchedule === \"AUTO\" ? \"HOURLY\" : manualSchedule);\n\n /* ── build choreography ────────────────────────────────────────────── */\n const startBuild = useCallback(\n (text: string, baseSelected: string[]) => {\n if (phaseRef.current === \"analyzing\" || phaseRef.current === \"building\") return;\n phaseRef.current = \"analyzing\";\n clearTimers();\n const resolved = resolvePlan(baseSelected, detectConnectors(text, connectors), connectors);\n const target = resolved.all.map((c) => c.name);\n const additions = target.filter((n) => !baseSelected.includes(n));\n setPrompt(text);\n setSelected(baseSelected);\n setPhase(\"analyzing\");\n setShown(0);\n setStatus(\"analyzing request · matching connectors\");\n setPickerOpen(false);\n setSwap(null);\n onBuild?.({ prompt: text, connectors: target, schedule: scheduleShown });\n additions.forEach((name, i) => {\n at(250 + i * 200, () => setSelected((s) => (s.includes(name) ? s : [...s, name])));\n });\n const t0 = 250 + additions.length * 200;\n at(t0 + 750, () => setStatus(\"wiring transforms · adding error handling\"));\n at(t0 + 1500, () => {\n setPhase(\"building\");\n setStatus(\"assembling workflow · optimizing plan\");\n });\n for (let i = 0; i < resolved.totalSteps; i++) {\n at(t0 + 1600 + i * 380, () => setShown(i + 1));\n }\n at(t0 + 1600 + resolved.totalSteps * 380 + 350, () => setPhase(\"done\"));\n },\n [clearTimers, connectors, onBuild, scheduleShown, at],\n );\n\n const resetToIdle = useCallback(() => {\n clearTimers();\n phaseRef.current = \"idle\";\n setPhase(\"idle\");\n setShown(0);\n setStatus(\"\");\n setSwap(null);\n }, [clearTimers]);\n\n const toggleConnector = (name: string) => {\n resetToIdle();\n setSelected((s) => (s.includes(name) ? s.filter((n) => n !== name) : [...s, name]));\n };\n\n const runExample = (example: WorkflowShowcaseExample) => {\n resetToIdle();\n startBuild(example.prompt, []);\n };\n\n /* ── swap menu ─────────────────────────────────────────────────────── */\n const openSwap = (name: string, text: string, anchor: HTMLElement) => {\n const card = cardRef.current;\n if (!card) return;\n const r = anchor.getBoundingClientRect();\n const cr = card.getBoundingClientRect();\n const x = Math.max(8, Math.min(r.left - cr.left, cr.width - 264));\n setSwap({ name, text, x, y: r.bottom - cr.top + 6 });\n };\n const doSwap = (current: SwapState, next: string) => {\n resetToIdle();\n const re = new RegExp(current.text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"), \"i\");\n setPrompt((p) => p.replace(re, next));\n setSelected((s) => s.map((n) => (n === current.name ? next : n)));\n };\n const swapRole = swap ? byName.get(swap.name)?.role : undefined;\n const swapItems = swapRole ? connectors.filter((c) => c.role === swapRole) : [];\n\n /* ── coach line ────────────────────────────────────────────────────── */\n const roles = union.map((n) => byName.get(n)?.role);\n const hasSource = roles.includes(\"source\");\n const hasSink = roles.some((r) => r && r !== \"source\");\n const hasNotify = roles.includes(\"notify\");\n let coachLine: string;\n let coachAdds: WorkflowShowcaseConnector[] = [];\n const notIn = (c: WorkflowShowcaseConnector) => !union.includes(c.name);\n if (!union.length) {\n coachLine = prompt\n ? \"LISTENING… CONNECTOR NAMES LIGHT UP AS OCTAVIA RECOGNIZES THEM\"\n : `OCTAVIA MATCHES CONNECTORS LIVE AS YOU TYPE — OR PICK FROM ${catalogNote}`;\n } else if (union.length >= connectors.length) {\n coachLine =\n \"FULL STACK — OCTAVIA SPLITS THIS INTO PARALLEL INGEST → AI TRANSFORM → SEQUENCED ACTIONS\";\n } else if (union.length >= 6) {\n coachLine = `BIG STACK — ${union.length} CONNECTORS FAN OUT ACROSS PARALLEL BRANCHES · COST OPTIMIZER ON`;\n } else if (hasSource && !hasSink) {\n coachLine = \"SOURCES WIRED — WHERE SHOULD THE DATA LAND?\";\n coachAdds = connectors.filter((c) => c.role === \"destination\" && notIn(c)).slice(0, 2);\n } else if (!hasSource && hasSink) {\n coachLine = \"DESTINATION SET — WHAT SHOULD OCTAVIA PULL FROM?\";\n coachAdds = connectors.filter((c) => c.role === \"source\" && notIn(c)).slice(0, 2);\n } else if (!hasNotify) {\n coachLine = `✓ ${union.length} CONNECTORS · ${scheduleShown} · TIP: ALERT YOUR TEAM WHEN RUNS FINISH`;\n coachAdds = connectors.filter((c) => c.role === \"notify\" && notIn(c)).slice(0, 1);\n } else {\n coachLine = `✓ ${union.length} CONNECTORS · ${scheduleShown} · CLICK A HIGHLIGHTED NAME TO SWAP IT`;\n }\n const coachTone = union.length ? (hasSource && hasSink ? \"success\" : \"accent\") : \"muted\";\n\n /* ── canvas derived state ──────────────────────────────────────────── */\n const badge = settled\n ? { label: \"LIVE\", tone: \"success\" as const, pulse: true }\n : buildingNow\n ? {\n label: phase === \"analyzing\" ? \"ANALYZING\" : \"BUILDING\",\n tone: \"accent\" as const,\n pulse: true,\n }\n : { label: \"IDLE\", tone: \"muted\" as const, pulse: false };\n const canvasSub = settled ? \"production\" : buildingNow ? \"generating\" : \"draft\";\n const sceneCaption = settled\n ? \"PIPELINE LIVE · SQUARES = ROWS IN FLIGHT\"\n : phase === \"building\"\n ? \"ASSEMBLING WORKFLOW…\"\n : phase === \"analyzing\"\n ? \"ANALYZING REQUEST…\"\n : \"CLICK THE CORE · CONNECTORS LAND AS CUBES\";\n\n const activity = buildActivity({ phase, shown, plan, selected, status });\n const costMetric = metrics.find((m) => m.tone === \"success\");\n const costLabel = costMetric\n ? `${costMetric.prefix ?? \"\"}${costMetric.value}${costMetric.suffix ?? \"\"}`\n : \"\";\n const railFoot =\n phase === \"idle\"\n ? `${catalogNote} CONNECTORS · FREE IN PRIVATE BETA`\n : settled\n ? `COST PLAN SELECTED · ${costLabel}`\n : \"COST OPTIMIZER RUNNING…\";\n\n const nLeft = plan.left.length;\n const sceneLeft = plan.left.map((c, i) => ({\n connector: c,\n active: engaged && (settled || shown > i),\n }));\n const sceneRight = plan.right.map((c, j) => ({\n connector: c,\n active: engaged && (settled || shown > nLeft + 1 + j),\n }));\n\n const stepCount = (selected.length || 3) + 1;\n const doneNote = costMetric\n ? `${stepCount}-step workflow generated · cost optimizer: ${costMetric.value}% below baseline`\n : `${stepCount}-step workflow generated`;\n\n /* ── signup ────────────────────────────────────────────────────────── */\n const submitSignup = (values: WorkflowShowcaseSignupValues) => {\n if (!values.name.trim() || !isValidEmail(values.email)) {\n setSignupError(\"Please enter your name and a valid work email.\");\n return;\n }\n setSignupError(null);\n setPhase(\"creating\");\n const finish = () => setPhase(\"welcome\");\n const fail = () => {\n setSignupError(\"Something went wrong — please try again.\");\n setPhase(\"signup\");\n };\n if (!onSignup) {\n at(1600, finish);\n return;\n }\n try {\n const result = onSignup(values);\n if (result && typeof (result as Promise<void>).then === \"function\") {\n (result as Promise<void>).then(finish, fail);\n } else {\n finish();\n }\n } catch {\n fail();\n }\n };\n\n /* ── prompt rendering ──────────────────────────────────────────────── */\n const segments = segmentPrompt(prompt, connectors);\n const onPromptKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n startBuild(prompt, selected);\n }\n };\n\n const rise = (delay = 0) =>\n reducedMotion\n ? {}\n : {\n initial: { opacity: 0, y: 10 },\n animate: { opacity: 1, y: 0 },\n transition: { duration: 0.4, delay, ease: [0.2, 0.7, 0.2, 1] as const },\n };\n\n return (\n <section {...rest} className={cn(\"ods-showcase\", className)}>\n {/* ── prompt card ─────────────────────────────────────────────── */}\n <div ref={cardRef} className=\"ods-showcase__card\">\n <div className=\"ods-showcase__prompt\">\n <textarea\n className=\"ods-showcase__prompt-input\"\n value={prompt}\n onChange={(e) => setPrompt(e.target.value)}\n onKeyDown={onPromptKeyDown}\n aria-label={promptAriaLabel}\n spellCheck={false}\n rows={2}\n />\n <div className=\"ods-showcase__prompt-render\" aria-hidden=\"true\">\n {prompt ? (\n segments.map((seg, i) =>\n seg.connector ? (\n <button\n // biome-ignore lint/suspicious/noArrayIndexKey: segments are positional by nature\n key={i}\n type=\"button\"\n tabIndex={-1}\n className={cn(\n \"ods-showcase__token\",\n `ods-showcase__token--${seg.connector.role}`,\n )}\n onClick={(e) => {\n const name = seg.connector?.name;\n if (name) openSwap(name, seg.text, e.currentTarget);\n }}\n >\n {seg.text}\n </button>\n ) : (\n // biome-ignore lint/suspicious/noArrayIndexKey: segments are positional by nature\n <span key={i}>{seg.text}</span>\n ),\n )\n ) : (\n <>\n <span className=\"ods-showcase__placeholder\">Describe your pipeline — e.g. </span>\n <span className=\"ods-showcase__placeholder ods-showcase__placeholder--faint\">\n \"Sync Storefront orders to Warehouse hourly, alert sales in Team Chat\"\n </span>\n </>\n )}\n </div>\n </div>\n\n <div className=\"ods-showcase__coach\">\n <span\n className={cn(\"ods-showcase__coach-line\", `ods-showcase__coach-line--${coachTone}`)}\n >\n {coachLine}\n </span>\n {coachAdds.map((c) => (\n <button\n key={c.name}\n type=\"button\"\n className=\"ods-showcase__coach-add\"\n onClick={() => toggleConnector(c.name)}\n >\n <ConnectorTile connector={c} />+ {c.name}\n </button>\n ))}\n </div>\n\n <AnimatePresence initial={false}>\n {pickerOpen && (\n <motion.div\n className=\"ods-showcase__picker\"\n initial={reducedMotion ? false : { opacity: 0, height: 0 }}\n animate={{ opacity: 1, height: \"auto\" }}\n exit={reducedMotion ? { opacity: 0 } : { opacity: 0, height: 0 }}\n transition={{ duration: 0.22, ease: [0.2, 0.7, 0.2, 1] }}\n >\n <div className=\"ods-showcase__picker-row\">\n <span className=\"ods-showcase__microcopy\">CONNECTORS</span>\n {connectors.map((c) => (\n <button\n key={c.name}\n type=\"button\"\n className={cn(\n \"ods-showcase__pick\",\n selected.includes(c.name) && \"ods-showcase__pick--on\",\n )}\n aria-pressed={selected.includes(c.name)}\n onClick={() => toggleConnector(c.name)}\n >\n <ConnectorTile connector={c} />\n {c.name}\n </button>\n ))}\n <span className=\"ods-showcase__microcopy ods-showcase__microcopy--faint\">\n + {catalogNote} IN THE APP\n </span>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n <div className=\"ods-showcase__toolbar\">\n <button\n type=\"button\"\n className={cn(\n \"ods-showcase__tool\",\n (pickerOpen || selected.length > 0) && \"ods-showcase__tool--on\",\n )}\n aria-expanded={pickerOpen}\n onClick={() => setPickerOpen((o) => !o)}\n >\n + Connectors{selected.length ? ` · ${selected.length}` : \"\"}\n </button>\n <button\n type=\"button\"\n className=\"ods-showcase__tool\"\n onClick={() => setSchedIdx((i) => (i + 1) % schedules.length)}\n >\n ◷ {manualSchedule}\n </button>\n <span className=\"ods-showcase__model\">{modelLabel}</span>\n <Button\n variant=\"primary\"\n onClick={() => startBuild(prompt, selected)}\n disabled={buildingNow}\n >\n {buildingNow ? \"Building…\" : \"Build workflow →\"}\n </Button>\n </div>\n\n {swap && swapRole && (\n <>\n <button\n type=\"button\"\n className=\"ods-showcase__swap-backdrop\"\n aria-label=\"Close swap menu\"\n onClick={() => setSwap(null)}\n />\n <div\n className=\"ods-showcase__swap\"\n role=\"menu\"\n style={{ left: swap.x, top: swap.y }}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") setSwap(null);\n }}\n >\n <div className=\"ods-showcase__swap-head\">\n SWAP {swapRole.toUpperCase()} — {swap.name.toUpperCase()}\n </div>\n {swapItems.map((c) => (\n <button\n key={c.name}\n type=\"button\"\n role=\"menuitem\"\n className=\"ods-showcase__swap-item\"\n onClick={() => doSwap(swap, c.name)}\n >\n <ConnectorTile connector={c} />\n <span className=\"ods-showcase__swap-name\">{c.name}</span>\n {c.name === swap.name && (\n <span className=\"ods-showcase__swap-mark\">● CURRENT</span>\n )}\n </button>\n ))}\n <div className=\"ods-showcase__swap-foot\">{catalogNote} CONNECTORS IN THE APP</div>\n </div>\n </>\n )}\n </div>\n\n {/* ── example chips ───────────────────────────────────────────── */}\n <div className=\"ods-showcase__examples\">\n <span className=\"ods-showcase__microcopy\">TRY:</span>\n {examples.map((ex) => (\n <button\n key={ex.id}\n type=\"button\"\n className=\"ods-showcase__try\"\n onClick={() => runExample(ex)}\n >\n {ex.label}\n </button>\n ))}\n </div>\n\n {/* ── canvas ──────────────────────────────────────────────────── */}\n <div className=\"ods-showcase__canvas\">\n <div className=\"ods-showcase__canvas-head\">\n <span className=\"ods-showcase__microcopy\">\n {canvasLabel} · {canvasSub}\n </span>\n <span className={cn(\"ods-showcase__badge\", `ods-showcase__badge--${badge.tone}`)}>\n <span className={cn(\"ods-showcase__dot\", badge.pulse && \"ods-showcase__dot--pulse\")} />\n {badge.label}\n </span>\n </div>\n <div className=\"ods-showcase__stage\">\n <div className=\"ods-showcase__rail\">\n <div className=\"ods-showcase__rail-head\">\n <span className=\"ods-showcase__microcopy\">{railLabel}</span>\n <span\n className={cn(\"ods-showcase__dot\", badge.pulse && \"ods-showcase__dot--pulse\")}\n />\n </div>\n <div className=\"ods-showcase__rail-body\">\n <AnimatePresence initial={false}>\n {activity.map((line) => (\n <motion.div\n key={line.id}\n className={cn(\"ods-showcase__act\", `ods-showcase__act--${line.tone}`)}\n initial={reducedMotion ? false : { opacity: 0, y: 6 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.25 }}\n >\n {line.text}\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n <div\n className={cn(\n \"ods-showcase__rail-foot\",\n settled && \"ods-showcase__rail-foot--done\",\n buildingNow && \"ods-showcase__rail-foot--active\",\n )}\n >\n {railFoot}\n </div>\n </div>\n\n <ShowcaseScene\n left={sceneLeft}\n right={sceneRight}\n engaged={engaged}\n tiles={platformTiles}\n coreIcon={coreIcon}\n caption={sceneCaption}\n />\n\n <div className=\"ods-showcase__metrics\">\n {metrics.map((m, idx) => {\n const revealed = settled || (phase === \"building\" && shown > idx);\n const interim = m.buildingValue != null && !settled && revealed;\n return (\n <div key={m.id} className=\"ods-showcase__metric\">\n <div\n className={cn(\n \"ods-showcase__metric-value\",\n !revealed && \"ods-showcase__metric-value--empty\",\n m.tone === \"success\" && settled && \"ods-showcase__metric-value--success\",\n )}\n >\n {settled ? (\n <CountUp\n value={m.value}\n from={m.buildingValue ?? 0}\n decimals={m.decimals ?? 0}\n duration={reducedMotion ? 0 : 900}\n disableAnimation={Boolean(reducedMotion)}\n prefix={m.prefix}\n formatValue={\n m.decimals ? undefined : (v) => Math.round(v).toLocaleString(\"en-US\")\n }\n />\n ) : interim ? (\n `${m.prefix ?? \"\"}${m.buildingValue}`\n ) : (\n \"—\"\n )}\n {revealed && m.suffix ? m.suffix : null}\n {revealed && m.unit ? (\n <span className=\"ods-showcase__metric-unit\"> {m.unit}</span>\n ) : null}\n </div>\n <div className=\"ods-showcase__microcopy\">{m.label}</div>\n </div>\n );\n })}\n </div>\n\n <ShowcaseSignup\n phase={phase}\n stepCount={stepCount}\n workspaceDomain={workspaceDomain}\n teamSizes={teamSizes}\n error={signupError}\n onSubmit={submitSignup}\n onBack={() => {\n setSignupError(null);\n setPhase(\"done\");\n }}\n dashboardHref={dashboardHref}\n onboardingHref={onboardingHref}\n />\n </div>\n </div>\n\n {/* ── status / CTA band ───────────────────────────────────────── */}\n <div className=\"ods-showcase__outro\" aria-live=\"polite\">\n {buildingNow && (\n <div className=\"ods-showcase__building\">\n <span className=\"ods-showcase__spin\" aria-hidden=\"true\">\n ⟳\n </span>{\" \"}\n {status}\n </div>\n )}\n {phase === \"done\" && (\n <div className=\"ods-showcase__done\">\n <motion.div className=\"ods-showcase__done-note\" {...rise(0)}>\n ✓ {doneNote}\n </motion.div>\n <motion.div className=\"ods-showcase__cta\" {...rise(0.2)}>\n <span className=\"ods-showcase__cta-copy\">\n Deploy it on your own data — takes 2 minutes.\n </span>\n <Button\n variant=\"primary\"\n onClick={() => {\n setSignupError(null);\n setPhase(\"signup\");\n }}\n >\n Create free account →\n </Button>\n <a className=\"ods-showcase__text-link\" href={onboardingHref}>\n Book onboarding →\n </a>\n </motion.div>\n </div>\n )}\n </div>\n </section>\n );\n}\n","\"use client\";\n\nimport { type CSSProperties, type ReactNode, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { roleGlyph } from \"../../glyphs\";\nimport type { WorkflowShowcaseConnector } from \"./showcaseEngine\";\n\n/* ---------------------------------------------------------------------------\n * ShowcaseScene — the isometric \"workflow assembling itself\" illustration.\n *\n * Pure presentation: an isometric platform of capability tiles with the\n * Octavia core at the center, connector cubes landing on each side, and\n * particles tracing the guide paths (\"squares = rows in flight\"). The whole\n * scene is decorative — it's aria-hidden and every fact it communicates is\n * also present in the activity rail + metrics, which are real DOM text.\n * ------------------------------------------------------------------------- */\n\nexport interface ShowcaseSceneNode {\n connector: WorkflowShowcaseConnector;\n /** Whether this node's step has completed (wires + particles light up). */\n active: boolean;\n}\n\nexport interface ShowcaseSceneProps {\n left: ShowcaseSceneNode[];\n right: ShowcaseSceneNode[];\n /** Any build/run motion is happening (analyzing → welcome). */\n engaged: boolean;\n /** Platform tile labels (8). */\n tiles: readonly string[];\n /** Center-of-platform icon. Defaults to a gradient core glyph. */\n coreIcon?: ReactNode;\n caption: string;\n}\n\n/** Vertical slot centers for n cubes on one side (matches guide geometry). */\nfunction slots(n: number): number[] {\n return Array.from({ length: n }, (_, i) => 208 + (i - (n - 1) / 2) * 80);\n}\n\nconst leftGuide = (cy: number) => `M74 ${cy} H150 V228 H193`;\nconst rightGuide = (cy: number) => `M263 228 H340 V${cy} H388`;\n\ninterface ParticleSpec {\n key: string;\n path: string;\n size: number;\n duration: string;\n delay: string;\n variant: \"lead\" | \"echo\" | \"spark\";\n}\n\nfunction particlesFor(\n side: \"l\" | \"r\",\n index: number,\n path: string,\n active: boolean,\n fast: boolean,\n): ParticleSpec[] {\n const base = index * 0.4 + (side === \"r\" ? 0.5 : 0);\n const duration = fast ? (active ? \"1.1s\" : \"2.6s\") : active ? \"2.2s\" : \"4.8s\";\n const size = active ? 8 : 6;\n const out: ParticleSpec[] = [\n { key: `${side}${index}-a`, path, size, duration, delay: `${base}s`, variant: \"lead\" },\n {\n key: `${side}${index}-b`,\n path,\n size,\n duration,\n delay: `${base + (active ? 1.1 : 2.4)}s`,\n variant: \"echo\",\n },\n ];\n if (active) {\n out.push({\n key: `${side}${index}-c`,\n path,\n size: 6,\n duration,\n delay: `${base + 0.55}s`,\n variant: \"spark\",\n });\n }\n return out;\n}\n\nfunction DefaultCoreGlyph() {\n return (\n <svg viewBox=\"0 0 24 24\" width=\"30\" height=\"30\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"1\" stroke=\"currentColor\" strokeWidth=\"1.6\" />\n <path\n d=\"M7 12h7M11.5 8.5 15 12l-3.5 3.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction CubeFace({ connector }: { connector: WorkflowShowcaseConnector }) {\n return (\n <span\n className={cn(\n \"ods-showcase__apptile\",\n \"ods-showcase__apptile--lg\",\n `ods-showcase__apptile--${connector.role}`,\n )}\n >\n {connector.icon ?? roleGlyph(connector.role, 18)}\n </span>\n );\n}\n\nexport function ShowcaseScene({\n left,\n right,\n engaged,\n tiles,\n coreIcon,\n caption,\n}: ShowcaseSceneProps) {\n // Clicking the core briefly speeds particles up — a tiny reward that makes\n // the scene feel alive without changing any state that matters.\n const [pulse, setPulse] = useState(false);\n const pulseTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (pulseTimer.current) clearTimeout(pulseTimer.current);\n },\n [],\n );\n const firePulse = () => {\n if (pulse) return;\n setPulse(true);\n pulseTimer.current = setTimeout(() => setPulse(false), 1500);\n };\n\n const leftYs = slots(left.length);\n const rightYs = slots(right.length);\n\n const guides: { d: string; on: boolean; delay: string }[] = [];\n const particles: ParticleSpec[] = [];\n left.forEach((node, i) => {\n const d = leftGuide(leftYs[i]);\n const on = engaged && node.active;\n guides.push({ d, on, delay: `${i * 0.2}s` });\n particles.push(...particlesFor(\"l\", i, d, on, pulse));\n });\n right.forEach((node, j) => {\n const d = rightGuide(rightYs[j]);\n const on = engaged && node.active;\n guides.push({ d, on, delay: `${j * 0.2 + 0.3}s` });\n particles.push(...particlesFor(\"r\", j, d, on, pulse));\n });\n if (!left.length) guides.push({ d: leftGuide(208), on: false, delay: \"0s\" });\n if (!right.length) guides.push({ d: rightGuide(208), on: false, delay: \"0s\" });\n\n const pins: { d: string; accent: boolean }[] = [];\n for (let x = 118; x <= 338; x += 20) {\n pins.push({ d: `M${x} 346 L${x} 368`, accent: (x / 20) % 4 === 0 });\n }\n for (let y = 118; y <= 338; y += 20) {\n pins.push({ d: `M346 ${y} L368 ${y}`, accent: (y / 20) % 4 === 1 });\n }\n\n const tilePositions = [\n { left: 8, top: 8 },\n { left: 83, top: 8 },\n { left: 158, top: 8 },\n { left: 8, top: 83 },\n { left: 158, top: 83 },\n { left: 8, top: 158 },\n { left: 83, top: 158 },\n { left: 158, top: 158 },\n ];\n\n return (\n <div className=\"ods-showcase__scene\" aria-hidden=\"true\">\n <div className=\"ods-showcase__scene-stage\">\n <svg className=\"ods-showcase__wires\" width=\"460\" height=\"460\" aria-hidden=\"true\">\n {pins.map((pin) => (\n <path\n key={pin.d}\n d={pin.d}\n className={cn(\"ods-showcase__pin\", pin.accent && \"ods-showcase__pin--accent\")}\n />\n ))}\n {guides.map((guide) => (\n <g key={guide.d}>\n <path d={guide.d} className=\"ods-showcase__guide\" />\n <path\n d={guide.d}\n className={cn(\n \"ods-showcase__guide-trace\",\n guide.on && \"ods-showcase__guide-trace--on\",\n )}\n style={{ animationDelay: guide.delay }}\n />\n </g>\n ))}\n </svg>\n\n {particles.map((p) => (\n <span\n key={p.key}\n className={cn(\"ods-showcase__particle\", `ods-showcase__particle--${p.variant}`)}\n style={\n {\n width: p.size,\n height: p.size,\n offsetPath: `path('${p.path}')`,\n animationDuration: p.duration,\n animationDelay: p.delay,\n } as CSSProperties\n }\n />\n ))}\n\n <div className=\"ods-showcase__platform\">\n <span className=\"ods-showcase__platform-south\" />\n <span className=\"ods-showcase__platform-east\" />\n <span className=\"ods-showcase__platform-top\" />\n {tiles.slice(0, 8).map((label, i) => (\n <span\n key={label}\n className=\"ods-showcase__tile\"\n style={{ left: tilePositions[i].left, top: tilePositions[i].top }}\n >\n {label}\n </span>\n ))}\n {pulse && <span className=\"ods-showcase__core-ring\" />}\n <button type=\"button\" tabIndex={-1} className=\"ods-showcase__core\" onClick={firePulse}>\n <span className=\"ods-showcase__core-south\" />\n <span className=\"ods-showcase__core-east\" />\n <span className=\"ods-showcase__core-top\">{coreIcon ?? <DefaultCoreGlyph />}</span>\n </button>\n </div>\n\n <span className=\"ods-showcase__floater ods-showcase__floater--a\" />\n <span className=\"ods-showcase__floater ods-showcase__floater--b\" />\n <span className=\"ods-showcase__floater ods-showcase__floater--c\" />\n\n {!left.length && (\n <span className=\"ods-showcase__ghost\" style={{ left: 8, top: 178 }}>\n +\n </span>\n )}\n {!right.length && (\n <span className=\"ods-showcase__ghost\" style={{ left: 392, top: 178 }}>\n +\n </span>\n )}\n\n {left.map((node, i) => (\n <span\n key={node.connector.name}\n className={cn(\n \"ods-showcase__cube\",\n node.active && \"ods-showcase__cube--active\",\n i % 2 ? \"ods-showcase__cube--float-b\" : \"ods-showcase__cube--float-a\",\n )}\n style={{ left: 8, top: leftYs[i] - 30, animationDelay: `${i * 0.15}s` }}\n >\n <span className=\"ods-showcase__cube-south\" />\n <span className=\"ods-showcase__cube-east\" />\n <span className=\"ods-showcase__cube-top\">\n <CubeFace connector={node.connector} />\n </span>\n </span>\n ))}\n {right.map((node, j) => (\n <span\n key={node.connector.name}\n className={cn(\n \"ods-showcase__cube\",\n node.active && \"ods-showcase__cube--active\",\n j % 2 ? \"ods-showcase__cube--float-a\" : \"ods-showcase__cube--float-b\",\n )}\n style={{ left: 392, top: rightYs[j] - 30, animationDelay: `${j * 0.15}s` }}\n >\n <span className=\"ods-showcase__cube-south\" />\n <span className=\"ods-showcase__cube-east\" />\n <span className=\"ods-showcase__cube-top\">\n <CubeFace connector={node.connector} />\n </span>\n </span>\n ))}\n </div>\n <span className=\"ods-showcase__scene-caption\">{caption}</span>\n </div>\n );\n}\n","\"use client\";\n\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { type FormEvent, useId, useState } from \"react\";\nimport { FocusScope } from \"react-aria\";\nimport { Button } from \"../../../components/Button/Button\";\nimport { Input } from \"../../../components/Input/Input\";\nimport { Select } from \"../../../components/Select/Select\";\nimport {\n slugify,\n type WorkflowShowcasePhase,\n type WorkflowShowcaseSignupValues,\n} from \"./showcaseEngine\";\n\n/* ---------------------------------------------------------------------------\n * ShowcaseSignup — the conversion overlay that floats over the canvas.\n *\n * Three moments share one glass surface: the workspace form (\"signup\"),\n * the provisioning interstitial (\"creating\") and the welcome card\n * (\"welcome\"). It follows the Dialog accessibility reference: minted ids\n * wired to aria-labelledby/-describedby, focus contained + restored.\n * ------------------------------------------------------------------------- */\n\nexport interface ShowcaseSignupProps {\n phase: WorkflowShowcasePhase;\n stepCount: number;\n workspaceDomain: string;\n teamSizes: string[];\n error: string | null;\n onSubmit: (values: WorkflowShowcaseSignupValues) => void;\n onBack: () => void;\n dashboardHref?: string;\n onboardingHref?: string;\n}\n\nconst OVERLAY_MOTION = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\nexport function ShowcaseSignup({\n phase,\n stepCount,\n workspaceDomain,\n teamSizes,\n error,\n onSubmit,\n onBack,\n dashboardHref = \"#\",\n onboardingHref = \"#\",\n}: ShowcaseSignupProps) {\n const reducedMotion = useReducedMotion();\n const titleId = useId();\n const subtitleId = useId();\n const [values, setValues] = useState<WorkflowShowcaseSignupValues>({\n name: \"\",\n email: \"\",\n company: \"\",\n teamSize: teamSizes[0] ?? \"1–10\",\n });\n\n const open = phase === \"signup\" || phase === \"creating\" || phase === \"welcome\";\n const cardMotion = reducedMotion\n ? OVERLAY_MOTION\n : {\n initial: { opacity: 0, y: 14, scale: 0.985 },\n animate: { opacity: 1, y: 0, scale: 1 },\n exit: { opacity: 0, y: 8, scale: 0.99 },\n };\n\n const handleSubmit = (event: FormEvent) => {\n event.preventDefault();\n onSubmit(values);\n };\n\n const firstName = values.name.trim().split(/\\s+/)[0] || \"\";\n const emailShown = values.email.trim() || \"your inbox\";\n const slug = `${slugify(values.company)}.${workspaceDomain}`;\n\n return (\n <AnimatePresence>\n {open && (\n <motion.div\n className=\"ods-showcase__veil\"\n {...OVERLAY_MOTION}\n transition={{ duration: reducedMotion ? 0 : 0.22 }}\n >\n <FocusScope contain restoreFocus autoFocus>\n {phase === \"signup\" && (\n <motion.form\n key=\"signup\"\n className=\"ods-showcase__glass-card\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={subtitleId}\n onSubmit={handleSubmit}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") onBack();\n }}\n {...cardMotion}\n transition={{ duration: reducedMotion ? 0 : 0.3, ease: [0.2, 0.7, 0.2, 1] }}\n >\n <div className=\"ods-showcase__glass-head\">\n <h3 id={titleId} className=\"ods-showcase__glass-title\">\n Create your workspace\n </h3>\n <p id={subtitleId} className=\"ods-showcase__microcopy\">\n FREE IN PRIVATE BETA · YOUR {stepCount}-STEP WORKFLOW COMES WITH YOU\n </p>\n </div>\n <div className=\"ods-showcase__form-grid\">\n <div className=\"ods-showcase__field\">\n <span className=\"ods-showcase__field-label\">FULL NAME</span>\n <Input\n aria-label=\"Full name\"\n autoComplete=\"name\"\n placeholder=\"Ada Lovelace\"\n value={values.name}\n onChange={(e) => setValues((v) => ({ ...v, name: e.target.value }))}\n />\n </div>\n <div className=\"ods-showcase__field\">\n <span className=\"ods-showcase__field-label\">WORK EMAIL</span>\n <Input\n aria-label=\"Work email\"\n type=\"email\"\n autoComplete=\"email\"\n placeholder=\"ada@company.com\"\n value={values.email}\n onChange={(e) => setValues((v) => ({ ...v, email: e.target.value }))}\n />\n </div>\n <div className=\"ods-showcase__field\">\n <span className=\"ods-showcase__field-label\">COMPANY</span>\n <Input\n aria-label=\"Company\"\n autoComplete=\"organization\"\n placeholder=\"Acme Inc.\"\n value={values.company}\n onChange={(e) => setValues((v) => ({ ...v, company: e.target.value }))}\n />\n </div>\n <div className=\"ods-showcase__field\">\n <span className=\"ods-showcase__field-label\">TEAM SIZE</span>\n <Select\n aria-label=\"Team size\"\n options={teamSizes.map((size) => ({ value: size, label: size }))}\n value={values.teamSize}\n onChange={(teamSize) => setValues((v) => ({ ...v, teamSize }))}\n />\n </div>\n </div>\n {error && (\n <p className=\"ods-showcase__form-error\" role=\"alert\">\n {error}\n </p>\n )}\n <div className=\"ods-showcase__glass-foot\">\n <span className=\"ods-showcase__microcopy\">\n NO CREDIT CARD · SSO & SELF-HOSTING LATER\n </span>\n <div className=\"ods-showcase__glass-actions\">\n <Button type=\"button\" variant=\"secondary\" onClick={onBack}>\n Back\n </Button>\n <Button type=\"submit\" variant=\"primary\">\n Create account & deploy →\n </Button>\n </div>\n </div>\n </motion.form>\n )}\n\n {phase === \"creating\" && (\n <motion.div\n key=\"creating\"\n className=\"ods-showcase__glass-card ods-showcase__glass-card--slim\"\n role=\"status\"\n {...cardMotion}\n transition={{ duration: reducedMotion ? 0 : 0.25 }}\n >\n <span className=\"ods-showcase__spin\" aria-hidden=\"true\">\n ⟳\n </span>\n <span className=\"ods-showcase__creating-line\">\n provisioning workspace · saving draft · inviting {emailShown}\n </span>\n </motion.div>\n )}\n\n {phase === \"welcome\" && (\n <motion.div\n key=\"welcome\"\n className=\"ods-showcase__glass-card ods-showcase__glass-card--welcome\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n {...cardMotion}\n transition={{ duration: reducedMotion ? 0 : 0.3, ease: [0.2, 0.7, 0.2, 1] }}\n >\n <div className=\"ods-showcase__glass-head\">\n <p className=\"ods-showcase__microcopy ods-showcase__microcopy--success\">\n ✓ WORKSPACE READY\n </p>\n <h3 id={titleId} className=\"ods-showcase__glass-title\">\n Welcome to OctaviaFlow{firstName ? `, ${firstName}` : \"\"}.\n </h3>\n <p className=\"ods-showcase__welcome-body\">\n We emailed a sign-in link to <strong>{emailShown}</strong>. Your {stepCount}\n -step workflow is saved as a draft in{\" \"}\n <code className=\"ods-showcase__slug\">{slug}</code> — deploy it from the\n dashboard whenever you're ready.\n </p>\n </div>\n <div className=\"ods-showcase__glass-foot\">\n <div className=\"ods-showcase__glass-actions\">\n <a className=\"ods-showcase__solid-link\" href={dashboardHref}>\n Open dashboard →\n </a>\n <a className=\"ods-showcase__text-link\" href={onboardingHref}>\n Book onboarding →\n </a>\n </div>\n <span className=\"ods-showcase__microcopy ods-showcase__microcopy--right\">\n PRIVATE BETA\n <br />\n ONBOARDING INCLUDED\n </span>\n </div>\n </motion.div>\n )}\n </FocusScope>\n </motion.div>\n )}\n </AnimatePresence>\n );\n}\n","\"use client\";\nimport { CloseIcon } from \"@octaviaflow/icons\";\nimport {\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n useId,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n type?:\n | \"text\"\n | \"email\"\n | \"password\"\n | \"search\"\n | \"number\"\n | \"tel\"\n | \"url\"\n | \"color\"\n | \"date\"\n | \"datetime-local\"\n | \"month\"\n | \"time\"\n | \"week\";\n size?: \"sm\" | \"md\" | \"lg\";\n error?: boolean;\n errorMessage?: string;\n label?: ReactNode;\n helperText?: ReactNode;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n /**\n * Show a clear button on the right while the input has a value.\n * Auto-enabled when `type=\"search\"`; explicitly toggle for other types.\n */\n clearable?: boolean;\n onClear?: () => void;\n /**\n * Right-side keyboard shortcut hint (e.g. \"⌘K\"). Rendered as a kbd-style chip.\n * Hidden while a clear button is showing (clear takes precedence).\n */\n shortcutHint?: ReactNode;\n}\n\nconst CLEAR_GLYPH = <CloseIcon width={12} height={12} aria-hidden=\"true\" />;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n type = \"text\",\n size = \"md\",\n error = false,\n errorMessage,\n label,\n helperText,\n leftIcon,\n rightIcon,\n clearable,\n onClear,\n shortcutHint,\n disabled = false,\n required,\n id,\n className,\n value,\n defaultValue,\n onChange,\n onKeyDown,\n ...props\n },\n forwardedRef,\n ) => {\n const innerRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(forwardedRef, () => innerRef.current as HTMLInputElement);\n\n const reactId = useId();\n const inputId = id ?? `${reactId}-input`;\n const errorId = `${reactId}-err`;\n const helperId = `${reactId}-help`;\n\n const isControlled = value !== undefined;\n const isClearable = (clearable ?? type === \"search\") && !disabled;\n const isSearch = type === \"search\";\n\n const currentValue = isControlled\n ? String(value ?? \"\")\n : (innerRef.current?.value ?? String(defaultValue ?? \"\"));\n const showClear = isClearable && currentValue.length > 0;\n\n const clearValue = () => {\n const el = innerRef.current;\n if (el && !isControlled) {\n const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"value\")?.set;\n setter?.call(el, \"\");\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n }\n onClear?.();\n el?.focus();\n };\n\n const handleClear = (e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n clearValue();\n };\n\n // Esc clears the value for search inputs — standard browser-search UX.\n // Consumer's own onKeyDown still runs first; preventDefault from theirs\n // short-circuits ours.\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented) return;\n if (isClearable && isSearch && e.key === \"Escape\" && currentValue) {\n e.preventDefault();\n clearValue();\n }\n };\n\n const describedBy = error && errorMessage ? errorId : helperText ? helperId : undefined;\n\n return (\n <div\n className={cn(\n \"ods-input\",\n `ods-input--${size}`,\n error && \"ods-input--error\",\n disabled && \"ods-input--disabled\",\n isSearch && \"ods-input--search\",\n className,\n )}\n >\n {label && (\n <label htmlFor={inputId} className=\"ods-input__label\">\n {label}\n {required && (\n <span className=\"ods-input__required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <div className=\"ods-input__wrapper\">\n {leftIcon && (\n <span className=\"ods-input__icon--left\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n <input\n {...props}\n id={inputId}\n ref={innerRef}\n type={type}\n disabled={disabled}\n required={required}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onKeyDown={handleKeyDown}\n className={cn(\n \"ods-input__field\",\n leftIcon && \"ods-input__field--with-left-icon\",\n (rightIcon || showClear || shortcutHint) && \"ods-input__field--with-right-icon\",\n showClear && shortcutHint && \"ods-input__field--with-right-actions\",\n )}\n aria-invalid={error || undefined}\n aria-required={required || undefined}\n aria-describedby={describedBy}\n />\n <span className=\"ods-input__right\">\n {showClear && (\n <button\n type=\"button\"\n className=\"ods-input__clear\"\n onClick={handleClear}\n aria-label=\"Clear\"\n tabIndex={-1}\n >\n {CLEAR_GLYPH}\n </button>\n )}\n {shortcutHint && !showClear && (\n <span className=\"ods-input__kbd\" aria-hidden=\"true\">\n {shortcutHint}\n </span>\n )}\n {rightIcon && !showClear && !shortcutHint && (\n <span className=\"ods-input__icon--right\" aria-hidden=\"true\">\n {rightIcon}\n </span>\n )}\n </span>\n </div>\n {error && errorMessage && (\n <div id={errorId} className=\"ods-input__error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {!error && helperText && (\n <div id={helperId} className=\"ods-input__helper\">\n {helperText}\n </div>\n )}\n </div>\n );\n },\n);\n\nInput.displayName = \"Input\";\n","\"use client\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport {\n forwardRef,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { HiddenSelect, useButton, useListBox, useOption, useSelect } from \"react-aria\";\nimport { createPortal } from \"react-dom\";\nimport { Item, useSelectState } from \"react-stately\";\nimport { CheckmarkIcon, ChevronDownIcon } from \"@octaviaflow/icons\";\nimport { resolveAccessibleName } from \"../../utils/a11y\";\nimport { cn } from \"../../utils/cn\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\n\nexport interface SelectOption {\n value: string;\n label: string;\n icon?: ReactNode;\n description?: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps {\n options: SelectOption[];\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n placeholder?: string;\n searchable?: boolean;\n label?: string;\n error?: boolean;\n errorMessage?: string;\n disabled?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n className?: string;\n /** Name for form submission (forwarded to the HiddenSelect element). */\n name?: string;\n /** Required flag for form submission (forwarded to HiddenSelect). */\n required?: boolean;\n /** Stable id for the trigger button (and the source for label htmlFor). */\n id?: string;\n /** Associate this control with an external <form id=\"...\"> element. */\n form?: string;\n /** Auto-focus the trigger on mount. */\n autoFocus?: boolean;\n /** Optional aria-label when no visible label is provided. */\n \"aria-label\"?: string;\n /** Optional aria-labelledby override. */\n \"aria-labelledby\"?: string;\n /** Optional aria-describedby (e.g. for helper text outside the component). */\n \"aria-describedby\"?: string;\n /** Helper text rendered below the trigger. Suppressed when `error`\n * is set (the error message takes the slot). */\n helperText?: ReactNode;\n /**\n * Render a check-mark glyph next to the currently selected option in\n * the dropdown. Defaults to `false` — the highlighted background is\n * already a strong visual cue, so doubling up reads as visual noise\n * in dense menus. Re-enable when the menu sits in a context where the\n * highlight isn't enough (e.g. extremely tall menus).\n */\n showCheckmark?: boolean;\n /**\n * Close the popover when the user clicks anywhere outside the trigger\n * + menu. Defaults to `true` — set to `false` for cases where the\n * caller manages dismissal explicitly (e.g. a modal that wraps the\n * select and owns its own close logic).\n */\n closeOnOutsideClick?: boolean;\n /** Show our design-system `<Tooltip>` on hover over options whose\n * label may be truncated. Default `false` — opt-in via this flag per\n * the platform's \"chrome stays quiet unless explicitly enabled\"\n * convention. The popover surfaces the full label plus the\n * description on a second line when present. */\n showOverflowTooltips?: boolean;\n /**\n * Floor for the dropdown popover width in pixels. The popover is\n * normally pinned to the trigger's width (visual alignment); pass\n * a number here when the trigger is narrow but option labels are\n * long — e.g. Calendar's compact `size=\"sm\"` month/year caption\n * where the trigger is ~70 px but month names like \"September\"\n * need ~110 px. Defaults to the trigger width (no override).\n */\n dropdownMinWidth?: number;\n}\n\n/* ------------------------------------------------------------------ */\n/* OverflowTooltip helper */\n/* ------------------------------------------------------------------ */\n\n/** Wraps `children` in our design-system Tooltip only when the flag is\n * on AND there's content to surface. Mirrors the MultiSelect pattern\n * so both pickers stay consistent. */\nfunction OverflowTooltip({\n enabled,\n content,\n children,\n}: {\n enabled: boolean;\n content: ReactNode;\n children: React.ReactElement;\n}) {\n if (!enabled || content == null || content === \"\") return children;\n return <Tooltip content={content}>{children}</Tooltip>;\n}\n\n/* ------------------------------------------------------------------ */\n/* Internal ListBox rendered inside the dropdown */\n/* ------------------------------------------------------------------ */\n\nfunction ListBox(props: any) {\n const ref = useRef<HTMLUListElement>(null);\n const {\n listBoxRef = ref,\n state,\n showCheckmark,\n showOverflowTooltips,\n } = props;\n const { listBoxProps } = useListBox(props, state, listBoxRef);\n\n return (\n <ul {...listBoxProps} ref={listBoxRef} className={\"ods-select__options\"}>\n {[...state.collection].map((item: any) => (\n <Option\n key={item.key}\n item={item}\n state={state}\n showCheckmark={showCheckmark}\n showOverflowTooltips={showOverflowTooltips}\n />\n ))}\n </ul>\n );\n}\n\nfunction Option({\n item,\n state,\n showCheckmark,\n showOverflowTooltips,\n}: {\n item: any;\n state: any;\n showCheckmark?: boolean;\n showOverflowTooltips?: boolean;\n}) {\n const ref = useRef<HTMLLIElement>(null);\n const { optionProps, isSelected, isFocused, isDisabled } = useOption(\n { key: item.key },\n state,\n ref,\n );\n\n // item.value is the items-array object; the actual SelectOption is nested inside\n const raw = item.value;\n const option: SelectOption | undefined = raw?.value ?? raw;\n\n // Tooltip content — label by itself, OR label + description on two\n // lines so the popover surfaces everything the row contains.\n const tooltipContent: ReactNode = option?.description ? (\n <>\n <span>{option.label}</span>\n <br />\n <span style={{ opacity: 0.75 }}>{option.description}</span>\n </>\n ) : (\n option?.label\n );\n\n return (\n <OverflowTooltip\n enabled={!!showOverflowTooltips}\n content={tooltipContent}\n >\n <li\n {...optionProps}\n ref={ref}\n className={cn(\n \"ods-select__option\",\n isFocused && \"ods-select__option--highlighted\",\n isSelected && \"ods-select__option--selected\",\n isDisabled && \"ods-select__option--disabled\",\n )}\n >\n {option?.icon && <span className={\"ods-select__option-icon\"}>{option.icon}</span>}\n <span className={\"ods-select__option-text\"}>\n <span className={\"ods-select__option-label\"}>{item.rendered}</span>\n {option?.description && (\n <span className={\"ods-select__option-desc\"}>{option.description}</span>\n )}\n </span>\n {isSelected && showCheckmark && (\n <span className={\"ods-select__check\"} aria-hidden=\"true\">\n <CheckmarkIcon size=\"xs\" tone=\"accent\" />\n </span>\n )}\n </li>\n </OverflowTooltip>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Main Select component */\n/* ------------------------------------------------------------------ */\n\n// Generic default placeholder. A select left on THIS placeholder with no\n// label is a genuine a11y gap (we still warn). But a CUSTOM placeholder\n// (e.g. \"Search channels and people…\") describes the control's purpose, so\n// it's used as the accessible-name fallback — see ariaNameProps below.\nconst DEFAULT_SELECT_PLACEHOLDER = \"Select an option...\";\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onChange,\n placeholder = DEFAULT_SELECT_PLACEHOLDER,\n searchable = false,\n label,\n error = false,\n errorMessage,\n helperText,\n disabled = false,\n size = \"md\",\n className,\n name,\n required,\n id: providedId,\n form,\n autoFocus,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": consumerDescribedBy,\n showCheckmark = false,\n closeOnOutsideClick = true,\n showOverflowTooltips = false,\n dropdownMinWidth,\n },\n forwardedRef,\n) {\n const triggerRef = useRef<HTMLButtonElement>(null);\n const listBoxRef = useRef<HTMLUListElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n const [searchQuery, setSearchQuery] = useState(\"\");\n const [dropdownPos, setDropdownPos] = useState<{\n top?: number;\n bottom?: number;\n left: number;\n width: number;\n maxHeight: number;\n /** \"down\" = popover hangs below the trigger; \"up\" = it stacks above. */\n direction: \"down\" | \"up\";\n }>({ left: 0, width: 0, maxHeight: 240, direction: \"down\" });\n\n // Compose the forwarded ref with our internal trigger ref so consumers\n // can `.focus()` the button while react-aria's internal needs still work.\n const setTriggerRef = (node: HTMLButtonElement | null) => {\n (triggerRef as { current: HTMLButtonElement | null }).current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef)\n (forwardedRef as { current: HTMLButtonElement | null }).current = node;\n };\n\n const reactId = useId();\n const baseId = providedId ?? `ods-select-${reactId}`;\n const hintId = error || helperText ? `${baseId}-hint` : undefined;\n const describedBy =\n [consumerDescribedBy, hintId].filter(Boolean).join(\" \") || undefined;\n\n // Build react-stately items from options, applying search filter\n const filteredOptions = useMemo(() => {\n if (!searchable || !searchQuery) return options;\n const q = searchQuery.toLowerCase();\n return options.filter(\n (o) => o.label.toLowerCase().includes(q) || o.description?.toLowerCase().includes(q),\n );\n }, [options, searchQuery, searchable]);\n\n // Build collection props for useSelectState\n // Resolve accessible name from {label, aria-label, aria-labelledby}. Removes\n // the literal \"Select\" fallback that was masking the real \"no label\" bug.\n // A CUSTOM placeholder is accepted as a last-resort accessible name (a\n // placeholder like \"Search channels and people…\" is a meaningful control\n // description); the generic default placeholder is NOT, so a truly\n // unlabeled select still trips the dev warning.\n const ariaNameProps = useMemo(\n () =>\n resolveAccessibleName({\n label,\n ariaLabel,\n ariaLabelledby: ariaLabelledBy,\n componentName: \"Select\",\n fallbacks: [\n placeholder && placeholder !== DEFAULT_SELECT_PLACEHOLDER ? placeholder : undefined,\n ],\n }),\n [label, ariaLabel, ariaLabelledBy, placeholder],\n );\n\n const ariaProps = useMemo(() => {\n const items = filteredOptions.map((o) => ({\n key: o.value,\n label: o.label,\n value: o,\n isDisabled: o.disabled,\n }));\n\n const props: any = {\n // Visible string label when present; otherwise rely on the aria-*\n // props for screen-reader name.\n label: typeof label === \"string\" ? label : undefined,\n ...ariaNameProps,\n items,\n children: (item: any) => (\n <Item key={item.key} textValue={item.label}>\n {item.label}\n </Item>\n ),\n isDisabled: disabled,\n onSelectionChange: (key: any) => {\n onChange?.(String(key));\n setSearchQuery(\"\");\n },\n };\n\n if (value !== undefined) {\n props.selectedKey = value;\n }\n if (defaultValue !== undefined) {\n props.defaultSelectedKey = defaultValue;\n }\n\n return props;\n }, [filteredOptions, label, disabled, value, defaultValue, onChange, ariaNameProps]);\n\n const state = useSelectState(ariaProps);\n\n const { triggerProps, menuProps } = useSelect(ariaProps, state, triggerRef);\n const { buttonProps } = useButton(triggerProps, triggerRef);\n\n // Position dropdown using getBoundingClientRect (fixed positioning to\n // escape stacking contexts). Now viewport-aware: when the trigger sits\n // near the bottom of the screen we flip the popover upward; either\n // way we cap its height to what's actually available so option lists\n // never spill off-screen (the prior behavior on tall pages).\n const updatePosition = useCallback(() => {\n if (!triggerRef.current) return;\n const rect = triggerRef.current.getBoundingClientRect();\n const viewportH = window.innerHeight;\n const margin = 8; // breathing room at the viewport edge\n const gap = 4; // gap between trigger and popover\n const spaceBelow = viewportH - rect.bottom - gap - margin;\n const spaceAbove = rect.top - gap - margin;\n // Prefer downward; flip up when below is cramped AND above has more\n // room. Falls back to whichever side has more space if both are tight.\n const PREFERRED_MIN = 200;\n const openUp =\n spaceBelow < PREFERRED_MIN && spaceAbove > spaceBelow;\n setDropdownPos({\n ...(openUp\n ? { bottom: viewportH - rect.top + gap }\n : { top: rect.bottom + gap }),\n left: rect.left,\n width: rect.width,\n maxHeight: Math.max(120, openUp ? spaceAbove : spaceBelow),\n direction: openUp ? \"up\" : \"down\",\n });\n }, []);\n\n useEffect(() => {\n if (state.isOpen) {\n updatePosition();\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }\n }, [state.isOpen, updatePosition]);\n\n // Focus search input when dropdown opens\n useEffect(() => {\n if (state.isOpen && searchable && searchRef.current) {\n // Small delay to allow animation frame\n requestAnimationFrame(() => searchRef.current?.focus());\n }\n }, [state.isOpen, searchable]);\n\n // Outside-click + Escape close. react-aria's `useSelect` wires Escape\n // when the trigger keeps focus, but because the dropdown is portaled\n // to <body> and we move focus into the search input on open, the\n // built-in dismiss does not fire on document-level outside clicks.\n // Wire it here ourselves; the `closeOnOutsideClick` prop lets a\n // consumer opt out for modal-managed selects.\n useEffect(() => {\n if (!state.isOpen || !closeOnOutsideClick) return;\n const onPointer = (e: MouseEvent) => {\n const target = e.target as Node;\n if (dropdownRef.current?.contains(target)) return;\n if (triggerRef.current?.contains(target)) return;\n state.close();\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") state.close();\n };\n document.addEventListener(\"mousedown\", onPointer);\n document.addEventListener(\"keydown\", onKey);\n return () => {\n document.removeEventListener(\"mousedown\", onPointer);\n document.removeEventListener(\"keydown\", onKey);\n };\n }, [state.isOpen, state.close, closeOnOutsideClick]);\n\n // Find currently selected option for display\n const selectedOption = options.find((o) => o.value === String(state.selectedKey ?? \"\"));\n\n // ── Close-on-re-click ──────────────────────────────────────────────\n // react-aria's `useSelect` opens on press but does NOT toggle when\n // the trigger is pressed again with the menu open — that's the\n // \"click trigger again\" close pattern users expect from every other\n // select on the web. We restore it here: stash the open state right\n // before the press, and on the trailing click, if it was open AND\n // still is open (meaning react-aria didn't auto-close), force close.\n const wasOpenBeforePressRef = useRef(false);\n const handleTriggerPointerDown = (e: ReactPointerEvent<HTMLButtonElement>) => {\n wasOpenBeforePressRef.current = state.isOpen;\n // Forward to react-aria's own handler if present.\n const baseHandler = (buttonProps as { onPointerDown?: (e: ReactPointerEvent<HTMLButtonElement>) => void }).onPointerDown;\n baseHandler?.(e);\n };\n const handleTriggerClick = (e: ReactMouseEvent<HTMLButtonElement>) => {\n const baseHandler = (buttonProps as { onClick?: (e: ReactMouseEvent<HTMLButtonElement>) => void }).onClick;\n baseHandler?.(e);\n if (wasOpenBeforePressRef.current && state.isOpen) {\n state.close();\n }\n wasOpenBeforePressRef.current = false;\n };\n\n return (\n <div\n className={cn(\n \"ods-select\",\n `ods-select--${size}`,\n error && \"ods-select--error\",\n disabled && \"ods-select--disabled\",\n className,\n )}\n >\n {label && (\n <label className={\"ods-select__label\"} htmlFor={baseId}>\n {label}\n </label>\n )}\n\n <HiddenSelect state={state} triggerRef={triggerRef} label={label} name={name} />\n\n <button\n {...buttonProps}\n onPointerDown={handleTriggerPointerDown}\n onClick={handleTriggerClick}\n ref={setTriggerRef}\n id={baseId}\n form={form}\n autoFocus={autoFocus}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n aria-invalid={error ? true : undefined}\n className={cn(\"ods-select__trigger\", state.isOpen && \"ods-select__trigger--open\")}\n >\n <span className={\"ods-select__value\"}>\n {selectedOption ? (\n <>\n {selectedOption.icon && (\n <span className={\"ods-select__value-icon\"}>{selectedOption.icon}</span>\n )}\n {selectedOption.label}\n </>\n ) : (\n <span className={\"ods-select__placeholder\"}>{placeholder}</span>\n )}\n </span>\n <span\n className={cn(\n \"ods-select__chevron\",\n state.isOpen && \"ods-select__chevron--open\",\n )}\n aria-hidden=\"true\"\n >\n <ChevronDownIcon size=\"xs\" />\n </span>\n </button>\n\n {typeof document !== \"undefined\" &&\n createPortal(\n <AnimatePresence>\n {state.isOpen && (\n <motion.div\n ref={dropdownRef}\n className={\"ods-select__dropdown\"}\n style={{\n position: \"fixed\",\n ...(dropdownPos.top !== undefined && { top: dropdownPos.top }),\n ...(dropdownPos.bottom !== undefined && { bottom: dropdownPos.bottom }),\n left: dropdownPos.left,\n // `minWidth` (not `width`) keeps the popover at\n // least as wide as the trigger — preserves visual\n // alignment — but allows the consumer to widen it\n // explicitly when option labels demand more room\n // (pass `dropdownMinWidth` to set a higher floor).\n // Avoids the previous `max-content` recipe which\n // made the popover grow uncomfortably wide on\n // searchable / long-option menus.\n minWidth: Math.max(dropdownPos.width, dropdownMinWidth ?? 0),\n // Bound the popover to the available viewport edge so\n // it never spills off-screen on tall pages. Pairs with\n // `overflow-y: auto` from the .ods-select__dropdown\n // SCSS so long option lists scroll internally.\n maxHeight: dropdownPos.maxHeight,\n }}\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{ duration: 0.2, ease: [0.16, 1, 0.3, 1] }}\n >\n {searchable && (\n <div className={\"ods-select__search-wrap\"}>\n <input\n ref={searchRef}\n className={\"ods-select__search\"}\n type=\"text\"\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n aria-label=\"Search options\"\n onKeyDown={(e) => {\n // Allow Escape to close the dropdown\n if (e.key === \"Escape\") {\n state.close();\n }\n }}\n />\n </div>\n )}\n <ListBox\n {...menuProps}\n listBoxRef={listBoxRef}\n state={state}\n showCheckmark={showCheckmark}\n showOverflowTooltips={showOverflowTooltips}\n />\n {filteredOptions.length === 0 && (\n <div className={\"ods-select__empty\"}>No results found</div>\n )}\n </motion.div>\n )}\n </AnimatePresence>,\n document.body,\n )}\n\n {error && errorMessage ? (\n <span\n id={hintId}\n className={\"ods-select__error\"}\n role=\"alert\"\n >\n {errorMessage}\n </span>\n ) : helperText ? (\n <span id={hintId} className={\"ods-select__hint\"}>\n {helperText}\n </span>\n ) : null}\n </div>\n );\n});\n\nSelect.displayName = \"Select\";\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {SetStateAction, useCallback, useEffect, useReducer, useRef, useState} from 'react';\n\n// Use the earliest effect possible to reset the ref below.\nconst useEarlyEffect: typeof React.useLayoutEffect = typeof document !== 'undefined'\n ? React['useInsertionEffect'] ?? React.useLayoutEffect\n : () => {};\n\nexport function useControlledState<T, C = T>(value: Exclude<T, undefined>, defaultValue: Exclude<T, undefined> | undefined, onChange?: (v: C, ...args: any[]) => void): [T, (value: SetStateAction<T>, ...args: any[]) => void];\nexport function useControlledState<T, C = T>(value: Exclude<T, undefined> | undefined, defaultValue: Exclude<T, undefined>, onChange?: (v: C, ...args: any[]) => void): [T, (value: SetStateAction<T>, ...args: any[]) => void];\nexport function useControlledState<T, C = T>(value: T, defaultValue: T, onChange?: (v: C, ...args: any[]) => void): [T, (value: SetStateAction<T>, ...args: any[]) => void] {\n // Store the value in both state and a ref. The state value will only be used when uncontrolled.\n // The ref is used to track the most current value, which is passed to the function setState callback.\n let [stateValue, setStateValue] = useState(value || defaultValue);\n let valueRef = useRef(stateValue);\n\n let isControlledRef = useRef(value !== undefined);\n let isControlled = value !== undefined;\n useEffect(() => {\n let wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') {\n console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);\n }\n isControlledRef.current = isControlled;\n }, [isControlled]);\n\n // After each render, update the ref to the current value.\n // This ensures that the setState callback argument is reset.\n // Note: the effect should not have any dependencies so that controlled values always reset.\n let currentValue = isControlled ? value : stateValue;\n useEarlyEffect(() => {\n valueRef.current = currentValue;\n });\n\n let [, forceUpdate] = useReducer(() => ({}), {});\n let setValue = useCallback((value: SetStateAction<T>, ...args: any[]) => {\n // @ts-ignore - TS doesn't know that T cannot be a function.\n let newValue = typeof value === 'function' ? value(valueRef.current) : value;\n if (!Object.is(valueRef.current, newValue)) {\n // Update the ref so that the next setState callback has the most recent value.\n valueRef.current = newValue;\n\n setStateValue(newValue);\n\n // Always trigger a re-render, even when controlled, so that the layout effect above runs to reset the value.\n forceUpdate();\n\n // Trigger onChange. Note that if setState is called multiple times in a single event,\n // onChange will be called for each one instead of only once.\n onChange?.(newValue, ...args);\n }\n }, [onChange]);\n\n return [currentValue, setValue];\n}\n","/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Context, createContext, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {Validation, ValidationErrors, ValidationFunction, ValidationResult} from '@react-types/shared';\n\nexport const VALID_VALIDITY_STATE: ValidityState = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: false,\n valid: true\n};\n\nconst CUSTOM_VALIDITY_STATE: ValidityState = {\n ...VALID_VALIDITY_STATE,\n customError: true,\n valid: false\n};\n\nexport const DEFAULT_VALIDATION_RESULT: ValidationResult = {\n isInvalid: false,\n validationDetails: VALID_VALIDITY_STATE,\n validationErrors: []\n};\n\nexport const FormValidationContext: Context<ValidationErrors> = createContext<ValidationErrors>({});\n\n// Private props that we pass from useFormValidationState to children.\n// Ideally we'd use a Symbol for this, but React doesn't support them: https://github.com/facebook/react/issues/7552\n// This needs to be stable across server and client module evaluation for SSR hydration.\nexport const privateValidationStateProp: string = '__reactAriaFormValidationState';\n\ninterface FormValidationProps<T> extends Validation<T> {\n builtinValidation?: ValidationResult,\n name?: string | string[],\n value: T | null\n}\n\nexport interface FormValidationState {\n /** Realtime validation results, updated as the user edits the value. */\n realtimeValidation: ValidationResult,\n /** Currently displayed validation results, updated when the user commits their changes. */\n displayValidation: ValidationResult,\n /** Updates the current validation result. Not displayed to the user until `commitValidation` is called. */\n updateValidation(result: ValidationResult): void,\n /** Resets the displayed validation state to valid when the user resets the form. */\n resetValidation(): void,\n /** Commits the realtime validation so it is displayed to the user. */\n commitValidation(): void\n}\n\nexport function useFormValidationState<T>(props: FormValidationProps<T>): FormValidationState {\n // Private prop for parent components to pass state to children.\n if (props[privateValidationStateProp]) {\n let {realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation} = props[privateValidationStateProp] as FormValidationState;\n return {realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation};\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useFormValidationStateImpl(props);\n}\n\nfunction useFormValidationStateImpl<T>(props: FormValidationProps<T>): FormValidationState {\n let {isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = 'aria'} = props;\n\n // backward compatibility.\n if (validationState) {\n isInvalid ||= validationState === 'invalid';\n }\n\n // If the isInvalid prop is controlled, update validation result in realtime.\n let controlledError: ValidationResult | null = isInvalid !== undefined ? {\n isInvalid,\n validationErrors: [],\n validationDetails: CUSTOM_VALIDITY_STATE\n } : null;\n\n // Perform custom client side validation.\n let clientError: ValidationResult | null = useMemo(() => {\n if (!validate || value == null) {\n return null;\n }\n let validateErrors = runValidate(validate, value);\n return getValidationResult(validateErrors);\n }, [validate, value]);\n\n if (builtinValidation?.validationDetails.valid) {\n builtinValidation = undefined;\n }\n\n // Get relevant server errors from the form.\n let serverErrors = useContext(FormValidationContext);\n let serverErrorMessages = useMemo(() => {\n if (name) {\n return Array.isArray(name) ? name.flatMap(name => asArray(serverErrors[name])) : asArray(serverErrors[name]);\n }\n return [];\n }, [serverErrors, name]);\n\n // Show server errors when the form gets a new value, and clear when the user changes the value.\n let [lastServerErrors, setLastServerErrors] = useState(serverErrors);\n let [isServerErrorCleared, setServerErrorCleared] = useState(false);\n if (serverErrors !== lastServerErrors) {\n setLastServerErrors(serverErrors);\n setServerErrorCleared(false);\n }\n\n let serverError: ValidationResult | null = useMemo(() =>\n getValidationResult(isServerErrorCleared ? [] : serverErrorMessages),\n [isServerErrorCleared, serverErrorMessages]\n );\n\n // Track the next validation state in a ref until commitValidation is called.\n let nextValidation = useRef(DEFAULT_VALIDATION_RESULT);\n let [currentValidity, setCurrentValidity] = useState(DEFAULT_VALIDATION_RESULT);\n\n let lastError = useRef(DEFAULT_VALIDATION_RESULT);\n let commitValidation = () => {\n if (!commitQueued) {\n return;\n }\n\n setCommitQueued(false);\n let error = clientError || builtinValidation || nextValidation.current;\n if (!isEqualValidation(error, lastError.current)) {\n lastError.current = error;\n setCurrentValidity(error);\n }\n };\n\n let [commitQueued, setCommitQueued] = useState(false);\n useEffect(commitValidation);\n\n // realtimeValidation is used to update the native input element's state based on custom validation logic.\n // displayValidation is the currently displayed validation state that the user sees (e.g. on input change/form submit).\n // With validationBehavior=\"aria\", all errors are displayed in realtime rather than on submit.\n let realtimeValidation = controlledError || serverError || clientError || builtinValidation || DEFAULT_VALIDATION_RESULT;\n let displayValidation = validationBehavior === 'native'\n ? controlledError || serverError || currentValidity\n : controlledError || serverError || clientError || builtinValidation || currentValidity;\n\n return {\n realtimeValidation,\n displayValidation,\n updateValidation(value) {\n // If validationBehavior is 'aria', update in realtime. Otherwise, store in a ref until commit.\n if (validationBehavior === 'aria' && !isEqualValidation(currentValidity, value)) {\n setCurrentValidity(value);\n } else {\n nextValidation.current = value;\n }\n },\n resetValidation() {\n // Update the currently displayed validation state to valid on form reset,\n // even if the native validity says it isn't. It'll show again on the next form submit.\n let error = DEFAULT_VALIDATION_RESULT;\n if (!isEqualValidation(error, lastError.current)) {\n lastError.current = error;\n setCurrentValidity(error);\n }\n\n // Do not commit validation after the next render. This avoids a condition where\n // useSelect calls commitValidation inside an onReset handler.\n if (validationBehavior === 'native') {\n setCommitQueued(false);\n }\n\n setServerErrorCleared(true);\n },\n commitValidation() {\n // Commit validation state so the user sees it on blur/change/submit. Also clear any server errors.\n // Wait until after the next render to commit so that the latest value has been validated.\n if (validationBehavior === 'native') {\n setCommitQueued(true);\n }\n setServerErrorCleared(true);\n }\n };\n}\n\nfunction asArray<T>(v: T | T[]): T[] {\n if (!v) {\n return [];\n }\n\n return Array.isArray(v) ? v : [v];\n}\n\nfunction runValidate<T>(validate: ValidationFunction<T>, value: T): string[] {\n if (typeof validate === 'function') {\n let e = validate(value);\n if (e && typeof e !== 'boolean') {\n return asArray(e);\n }\n }\n\n return [];\n}\n\nfunction getValidationResult(errors: string[]): ValidationResult | null {\n return errors.length ? {\n isInvalid: true,\n validationErrors: errors,\n validationDetails: CUSTOM_VALIDITY_STATE\n } : null;\n}\n\nfunction isEqualValidation(a: ValidationResult | null, b: ValidationResult | null): boolean {\n if (a === b) {\n return true;\n }\n\n return !!a && !!b\n && a.isInvalid === b.isInvalid\n && a.validationErrors.length === b.validationErrors.length\n && a.validationErrors.every((a, i) => a === b.validationErrors[i])\n && Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v);\n}\n\nexport function mergeValidation(...results: ValidationResult[]): ValidationResult {\n let errors = new Set<string>();\n let isInvalid = false;\n let validationDetails = {\n ...VALID_VALIDITY_STATE\n };\n\n for (let v of results) {\n for (let e of v.validationErrors) {\n errors.add(e);\n }\n\n // Only these properties apply for checkboxes.\n isInvalid ||= v.isInvalid;\n for (let key in validationDetails) {\n validationDetails[key] ||= v.validationDetails[key];\n }\n }\n\n validationDetails.valid = !isInvalid;\n return {\n isInvalid,\n validationErrors: [...errors],\n validationDetails\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {Collection, Node} from '@react-types/shared';\n\nexport function getChildNodes<T>(node: Node<T>, collection: Collection<Node<T>>): Iterable<Node<T>> {\n // New API: call collection.getChildren with the node key.\n if (typeof collection.getChildren === 'function') {\n return collection.getChildren(node.key);\n }\n\n // Old API: access childNodes directly.\n return node.childNodes;\n}\n\nexport function getFirstItem<T>(iterable: Iterable<T>): T | undefined {\n return getNthItem(iterable, 0);\n}\n\nexport function getNthItem<T>(iterable: Iterable<T>, index: number): T | undefined {\n if (index < 0) {\n return undefined;\n }\n\n let i = 0;\n for (let item of iterable) {\n if (i === index) {\n return item;\n }\n\n i++;\n }\n}\n\nexport function getLastItem<T>(iterable: Iterable<T>): T | undefined {\n let lastItem: T | undefined = undefined;\n for (let value of iterable) {\n lastItem = value;\n }\n\n return lastItem;\n}\n\nexport function compareNodeOrder<T>(collection: Collection<Node<T>>, a: Node<T>, b: Node<T>): number {\n // If the two nodes have the same parent, compare their indices.\n if (a.parentKey === b.parentKey) {\n return a.index - b.index;\n }\n\n // Otherwise, collect all of the ancestors from each node, and find the first one that doesn't match starting from the root.\n // Include the base nodes in case we are comparing nodes of different levels so that we can compare the higher node to the lower level node's\n // ancestor of the same level\n let aAncestors = [...getAncestors(collection, a), a];\n let bAncestors = [...getAncestors(collection, b), b];\n let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a, i) => a !== bAncestors[i]);\n if (firstNonMatchingAncestor !== -1) {\n // Compare the indices of two children within the common ancestor.\n a = aAncestors[firstNonMatchingAncestor];\n b = bAncestors[firstNonMatchingAncestor];\n return a.index - b.index;\n }\n\n // If there isn't a non matching ancestor, we might be in a case where one of the nodes is the ancestor of the other.\n if (aAncestors.findIndex(node => node === b) >= 0) {\n return 1;\n } else if (bAncestors.findIndex(node => node === a) >= 0) {\n return -1;\n }\n\n // 🤷\n return -1;\n}\n\nfunction getAncestors<T>(collection: Collection<Node<T>>, node: Node<T>): Node<T>[] {\n let parents: Node<T>[] = [];\n\n let currNode: Node<T> | null = node;\n while (currNode?.parentKey != null) {\n currNode = collection.getItem(currNode.parentKey);\n if (currNode) {\n parents.unshift(currNode);\n }\n }\n\n return parents;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Key, Node} from '@react-types/shared';\n\nexport class ListCollection<T> implements Collection<Node<T>> {\n private keyMap: Map<Key, Node<T>> = new Map();\n private iterable: Iterable<Node<T>>;\n private firstKey: Key | null = null;\n private lastKey: Key | null = null;\n private _size: number;\n\n constructor(nodes: Iterable<Node<T>>) {\n this.iterable = nodes;\n\n let visit = (node: Node<T>) => {\n this.keyMap.set(node.key, node);\n\n if (node.childNodes && node.type === 'section') {\n for (let child of node.childNodes) {\n visit(child);\n }\n }\n };\n\n for (let node of nodes) {\n visit(node);\n }\n\n let last: Node<T> | null = null;\n let index = 0;\n let size = 0;\n for (let [key, node] of this.keyMap) {\n if (last) {\n last.nextKey = key;\n node.prevKey = last.key;\n } else {\n this.firstKey = key;\n node.prevKey = undefined;\n }\n\n if (node.type === 'item') {\n node.index = index++;\n }\n\n // Only count sections and items when determining size so that\n // loaders and separators in RAC/S2 don't influence the emptyState determination\n if (node.type === 'section' || node.type === 'item') {\n size++;\n }\n\n last = node;\n\n // Set nextKey as undefined since this might be the last node\n // If it isn't the last node, last.nextKey will properly set at start of new loop\n last.nextKey = undefined;\n }\n this._size = size;\n this.lastKey = last?.key ?? null;\n }\n\n *[Symbol.iterator](): IterableIterator<Node<T>> {\n yield* this.iterable;\n }\n\n get size(): number {\n return this._size;\n }\n\n getKeys(): IterableIterator<Key> {\n return this.keyMap.keys();\n }\n\n getKeyBefore(key: Key): Key | null {\n let node = this.keyMap.get(key);\n return node ? node.prevKey ?? null : null;\n }\n\n getKeyAfter(key: Key): Key | null {\n let node = this.keyMap.get(key);\n return node ? node.nextKey ?? null : null;\n }\n\n getFirstKey(): Key | null {\n return this.firstKey;\n }\n\n getLastKey(): Key | null {\n return this.lastKey;\n }\n\n getItem(key: Key): Node<T> | null {\n return this.keyMap.get(key) ?? null;\n }\n\n at(idx: number): Node<T> | null {\n const keys = [...this.getKeys()];\n return this.getItem(keys[idx]);\n }\n\n getChildren(key: Key): Iterable<Node<T>> {\n let node = this.keyMap.get(key);\n return node?.childNodes || [];\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\n\n/**\n * A Selection is a special Set containing Keys, which also has an anchor\n * and current selected key for use when range selecting.\n */\nexport class Selection extends Set<Key> {\n anchorKey: Key | null;\n currentKey: Key | null;\n\n constructor(keys?: Iterable<Key> | Selection, anchorKey?: Key | null, currentKey?: Key | null) {\n super(keys);\n if (keys instanceof Selection) {\n this.anchorKey = anchorKey ?? keys.anchorKey;\n this.currentKey = currentKey ?? keys.currentKey;\n } else {\n this.anchorKey = anchorKey ?? null;\n this.currentKey = currentKey ?? null;\n }\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DisabledBehavior, FocusStrategy, Key, MultipleSelection, SelectionBehavior, SelectionMode} from '@react-types/shared';\nimport {MultipleSelectionState} from './types';\nimport {Selection} from './Selection';\nimport {useControlledState} from '../utils/useControlledState';\nimport {useEffect, useMemo, useRef, useState} from 'react';\n\nfunction equalSets(setA, setB) {\n if (setA.size !== setB.size) {\n return false;\n }\n\n for (let item of setA) {\n if (!setB.has(item)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport interface MultipleSelectionStateProps extends MultipleSelection {\n /**\n * How multiple selection should behave in the collection.\n * @default 'toggle'\n */\n selectionBehavior?: SelectionBehavior,\n /** Whether onSelectionChange should fire even if the new set of keys is the same as the last. */\n allowDuplicateSelectionEvents?: boolean,\n /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default 'all'\n */\n disabledBehavior?: DisabledBehavior\n}\n\n/**\n * Manages state for multiple selection and focus in a collection.\n */\nexport function useMultipleSelectionState(props: MultipleSelectionStateProps): MultipleSelectionState {\n let {\n selectionMode = 'none' as SelectionMode,\n disallowEmptySelection = false,\n allowDuplicateSelectionEvents,\n selectionBehavior: selectionBehaviorProp = 'toggle',\n disabledBehavior = 'all'\n } = props;\n\n // We want synchronous updates to `isFocused` and `focusedKey` after their setters are called.\n // But we also need to trigger a react re-render. So, we have both a ref (sync) and state (async).\n let isFocusedRef = useRef(false);\n let [, setFocused] = useState(false);\n let focusedKeyRef = useRef<Key | null>(null);\n let childFocusStrategyRef = useRef<FocusStrategy | null>(null);\n let [, setFocusedKey] = useState<Key | null>(null);\n let selectedKeysProp = useMemo(() => convertSelection(props.selectedKeys), [props.selectedKeys]);\n let defaultSelectedKeys = useMemo(() => convertSelection(props.defaultSelectedKeys, new Selection()), [props.defaultSelectedKeys]);\n let [selectedKeys, setSelectedKeys] = useControlledState(\n selectedKeysProp,\n defaultSelectedKeys!,\n props.onSelectionChange\n );\n let disabledKeysProp = useMemo(() =>\n props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()\n , [props.disabledKeys]);\n let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);\n\n // If the selectionBehavior prop is set to replace, but the current state is toggle (e.g. due to long press\n // to enter selection mode on touch), and the selection becomes empty, reset the selection behavior.\n if (selectionBehaviorProp === 'replace' && selectionBehavior === 'toggle' && typeof selectedKeys === 'object' && selectedKeys.size === 0) {\n setSelectionBehavior('replace');\n }\n\n // If the selectionBehavior prop changes, update the state as well.\n let lastSelectionBehavior = useRef(selectionBehaviorProp);\n useEffect(() => {\n if (selectionBehaviorProp !== lastSelectionBehavior.current) {\n setSelectionBehavior(selectionBehaviorProp);\n lastSelectionBehavior.current = selectionBehaviorProp;\n }\n }, [selectionBehaviorProp]);\n\n return {\n selectionMode,\n disallowEmptySelection,\n selectionBehavior,\n setSelectionBehavior,\n get isFocused() {\n return isFocusedRef.current;\n },\n setFocused(f) {\n isFocusedRef.current = f;\n setFocused(f);\n },\n get focusedKey() {\n return focusedKeyRef.current;\n },\n get childFocusStrategy() {\n return childFocusStrategyRef.current;\n },\n setFocusedKey(k, childFocusStrategy = 'first') {\n focusedKeyRef.current = k;\n childFocusStrategyRef.current = childFocusStrategy;\n setFocusedKey(k);\n },\n selectedKeys,\n setSelectedKeys(keys) {\n if (allowDuplicateSelectionEvents || !equalSets(keys, selectedKeys)) {\n setSelectedKeys(keys);\n }\n },\n disabledKeys: disabledKeysProp,\n disabledBehavior\n };\n}\n\nfunction convertSelection(selection: 'all' | Iterable<Key> | null | undefined, defaultValue?: Selection): 'all' | Set<Key> | undefined {\n if (!selection) {\n return defaultValue;\n }\n\n return selection === 'all'\n ? 'all'\n : new Selection(selection);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Collection, DisabledBehavior,\n FocusStrategy,\n Selection as ISelection,\n Key,\n LayoutDelegate,\n LongPressEvent,\n Node,\n PressEvent,\n SelectionBehavior,\n SelectionMode\n} from '@react-types/shared';\nimport {compareNodeOrder, getChildNodes, getFirstItem} from '../collections/getChildNodes';\nimport {MultipleSelectionManager, MultipleSelectionState} from './types';\nimport {Selection} from './Selection';\n\ninterface SelectionManagerOptions {\n allowsCellSelection?: boolean,\n layoutDelegate?: LayoutDelegate,\n fullCollection?: Collection<Node<unknown>>\n}\n\n/**\n * An interface for reading and updating multiple selection state.\n */\nexport class SelectionManager implements MultipleSelectionManager {\n collection: Collection<Node<unknown>>;\n private state: MultipleSelectionState;\n private allowsCellSelection: boolean;\n private _isSelectAll: boolean | null;\n private layoutDelegate: LayoutDelegate | null;\n private fullCollection: Collection<Node<unknown>> | null;\n\n constructor(collection: Collection<Node<unknown>>, state: MultipleSelectionState, options?: SelectionManagerOptions) {\n this.collection = collection;\n this.state = state;\n this.allowsCellSelection = options?.allowsCellSelection ?? false;\n this._isSelectAll = null;\n this.layoutDelegate = options?.layoutDelegate || null;\n this.fullCollection = options?.fullCollection || null;\n }\n\n /**\n * The type of selection that is allowed in the collection.\n */\n get selectionMode(): SelectionMode {\n return this.state.selectionMode;\n }\n\n /**\n * Whether the collection allows empty selection.\n */\n get disallowEmptySelection(): boolean {\n return this.state.disallowEmptySelection;\n }\n\n /**\n * The selection behavior for the collection.\n */\n get selectionBehavior(): SelectionBehavior {\n return this.state.selectionBehavior;\n }\n\n /**\n * Sets the selection behavior for the collection.\n */\n setSelectionBehavior(selectionBehavior: SelectionBehavior): void {\n this.state.setSelectionBehavior(selectionBehavior);\n }\n\n /**\n * Whether the collection is currently focused.\n */\n get isFocused(): boolean {\n return this.state.isFocused;\n }\n\n /**\n * Sets whether the collection is focused.\n */\n setFocused(isFocused: boolean): void {\n this.state.setFocused(isFocused);\n }\n\n /**\n * The current focused key in the collection.\n */\n get focusedKey(): Key | null {\n return this.state.focusedKey;\n }\n\n /** Whether the first or last child of the focused key should receive focus. */\n get childFocusStrategy(): FocusStrategy | null {\n return this.state.childFocusStrategy;\n }\n\n /**\n * Sets the focused key.\n */\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n if (key == null || this.collection.getItem(key)) {\n this.state.setFocusedKey(key, childFocusStrategy);\n }\n }\n\n /**\n * The currently selected keys in the collection.\n */\n get selectedKeys(): Set<Key> {\n return this.state.selectedKeys === 'all'\n ? new Set(this.getSelectAllKeys())\n : this.state.selectedKeys;\n }\n\n /**\n * The raw selection value for the collection.\n * Either 'all' for select all, or a set of keys.\n */\n get rawSelection(): ISelection {\n return this.state.selectedKeys;\n }\n\n /**\n * Returns whether a key is selected.\n */\n isSelected(key: Key): boolean {\n if (this.state.selectionMode === 'none') {\n return false;\n }\n\n let mappedKey = this.getKey(key);\n if (mappedKey == null) {\n return false;\n }\n return this.state.selectedKeys === 'all'\n ? this.canSelectItem(mappedKey)\n : this.state.selectedKeys.has(mappedKey);\n }\n\n /**\n * Whether the selection is empty.\n */\n get isEmpty(): boolean {\n return this.state.selectedKeys !== 'all' && this.state.selectedKeys.size === 0;\n }\n\n /**\n * Whether all items in the collection are selected.\n */\n get isSelectAll(): boolean {\n if (this.isEmpty) {\n return false;\n }\n\n if (this.state.selectedKeys === 'all') {\n return true;\n }\n\n if (this._isSelectAll != null) {\n return this._isSelectAll;\n }\n\n let allKeys = this.getSelectAllKeys();\n let selectedKeys = this.state.selectedKeys;\n this._isSelectAll = allKeys.every(k => selectedKeys.has(k));\n return this._isSelectAll;\n }\n\n get firstSelectedKey(): Key | null {\n let first: Node<unknown> | null = null;\n for (let key of this.state.selectedKeys) {\n let item = this.collection.getItem(key);\n if (!first || (item && compareNodeOrder(this.collection, item, first) < 0)) {\n first = item;\n }\n }\n\n return first?.key ?? null;\n }\n\n get lastSelectedKey(): Key | null {\n let last: Node<unknown> | null = null;\n for (let key of this.state.selectedKeys) {\n let item = this.collection.getItem(key);\n if (!last || (item && compareNodeOrder(this.collection, item, last) > 0)) {\n last = item;\n }\n }\n\n return last?.key ?? null;\n }\n\n get disabledKeys(): Set<Key> {\n return this.state.disabledKeys;\n }\n\n get disabledBehavior(): DisabledBehavior {\n return this.state.disabledBehavior;\n }\n\n /**\n * Extends the selection to the given key.\n */\n extendSelection(toKey: Key): void {\n if (this.selectionMode === 'none') {\n return;\n }\n\n if (this.selectionMode === 'single') {\n this.replaceSelection(toKey);\n return;\n }\n\n let mappedToKey = this.getKey(toKey);\n if (mappedToKey == null) {\n return;\n }\n\n let selection: Selection;\n\n // Only select the one key if coming from a select all.\n if (this.state.selectedKeys === 'all') {\n selection = new Selection([mappedToKey], mappedToKey, mappedToKey);\n } else {\n let selectedKeys = this.state.selectedKeys as Selection;\n let anchorKey = selectedKeys.anchorKey ?? mappedToKey;\n selection = new Selection(selectedKeys, anchorKey, mappedToKey);\n for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey ?? mappedToKey)) {\n selection.delete(key);\n }\n\n for (let key of this.getKeyRange(mappedToKey, anchorKey)) {\n if (this.canSelectItem(key)) {\n selection.add(key);\n }\n }\n }\n\n this.state.setSelectedKeys(selection);\n }\n\n private getKeyRange(from: Key, to: Key) {\n let fromItem = this.collection.getItem(from);\n let toItem = this.collection.getItem(to);\n if (fromItem && toItem) {\n if (compareNodeOrder(this.collection, fromItem, toItem) <= 0) {\n return this.getKeyRangeInternal(from, to);\n }\n\n return this.getKeyRangeInternal(to, from);\n }\n\n return [];\n }\n\n private getKeyRangeInternal(from: Key, to: Key) {\n if (this.layoutDelegate?.getKeyRange) {\n return this.layoutDelegate.getKeyRange(from, to);\n }\n\n let keys: Key[] = [];\n let key: Key | null = from;\n while (key != null) {\n let item = this.collection.getItem(key);\n if (item && (item.type === 'item' || (item.type === 'cell' && this.allowsCellSelection))) {\n keys.push(key);\n }\n\n if (key === to) {\n return keys;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n\n return [];\n }\n\n private getKey(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n // ¯\\_(ツ)_/¯\n return key;\n }\n\n // If cell selection is allowed, just return the key.\n if (item.type === 'cell' && this.allowsCellSelection) {\n return key;\n }\n\n // Find a parent item to select\n while (item && item.type !== 'item' && item.parentKey != null) {\n item = this.collection.getItem(item.parentKey);\n }\n\n if (!item || item.type !== 'item') {\n return null;\n }\n\n return item.key;\n }\n\n /**\n * Toggles whether the given key is selected.\n */\n toggleSelection(key: Key): void {\n if (this.selectionMode === 'none') {\n return;\n }\n\n if (this.selectionMode === 'single' && !this.isSelected(key)) {\n this.replaceSelection(key);\n return;\n }\n\n let mappedKey = this.getKey(key);\n if (mappedKey == null) {\n return;\n }\n\n let keys = new Selection(this.state.selectedKeys === 'all' ? this.getSelectAllKeys() : this.state.selectedKeys);\n if (keys.has(mappedKey)) {\n keys.delete(mappedKey);\n // TODO: move anchor to last selected key...\n // Does `current` need to move here too?\n } else if (this.canSelectItem(mappedKey)) {\n keys.add(mappedKey);\n keys.anchorKey = mappedKey;\n keys.currentKey = mappedKey;\n }\n\n if (this.disallowEmptySelection && keys.size === 0) {\n return;\n }\n\n this.state.setSelectedKeys(keys);\n }\n\n /**\n * Replaces the selection with only the given key.\n */\n replaceSelection(key: Key): void {\n if (this.selectionMode === 'none') {\n return;\n }\n\n let mappedKey = this.getKey(key);\n if (mappedKey == null) {\n return;\n }\n\n let selection = this.canSelectItem(mappedKey)\n ? new Selection([mappedKey], mappedKey, mappedKey)\n : new Selection();\n\n this.state.setSelectedKeys(selection);\n }\n\n /**\n * Replaces the selection with the given keys.\n */\n setSelectedKeys(keys: Iterable<Key>): void {\n if (this.selectionMode === 'none') {\n return;\n }\n\n let selection = new Selection();\n for (let key of keys) {\n let mappedKey = this.getKey(key);\n if (mappedKey != null) {\n selection.add(mappedKey);\n if (this.selectionMode === 'single') {\n break;\n }\n }\n }\n\n this.state.setSelectedKeys(selection);\n }\n\n private getSelectAllKeys() {\n // Use the full (unfiltered) collection when available so that materializing\n // the 'all' selection includes items that are currently filtered out (e.g. by Autocomplete).\n let collection = this.fullCollection ?? this.collection;\n let keys: Key[] = [];\n let addKeys = (key: Key | null) => {\n while (key != null) {\n if (this.canSelectItemIn(key, collection)) {\n let item = collection.getItem(key);\n if (item?.type === 'item') {\n keys.push(key);\n }\n\n // Add child keys. If cell selection is allowed, then include item children too.\n if (item?.hasChildNodes && (this.allowsCellSelection || item.type !== 'item')) {\n addKeys(getFirstItem(getChildNodes(item, collection))?.key ?? null);\n }\n }\n\n key = collection.getKeyAfter(key);\n }\n };\n\n addKeys(collection.getFirstKey());\n return keys;\n }\n\n /**\n * Selects all items in the collection.\n */\n selectAll(): void {\n if (!this.isSelectAll && this.selectionMode === 'multiple') {\n this.state.setSelectedKeys('all');\n }\n }\n\n /**\n * Removes all keys from the selection.\n */\n clearSelection(): void {\n if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) {\n this.state.setSelectedKeys(new Selection());\n }\n }\n\n /**\n * Toggles between select all and an empty selection.\n */\n toggleSelectAll(): void {\n if (this.isSelectAll) {\n this.clearSelection();\n } else {\n this.selectAll();\n }\n }\n\n select(key: Key, e?: PressEvent | LongPressEvent | PointerEvent): void {\n if (this.selectionMode === 'none') {\n return;\n }\n\n if (this.selectionMode === 'single') {\n if (this.isSelected(key) && !this.disallowEmptySelection) {\n this.toggleSelection(key);\n } else {\n this.replaceSelection(key);\n }\n } else if (this.selectionBehavior === 'toggle' || (e && (e.pointerType === 'touch' || e.pointerType === 'virtual'))) {\n // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys\n this.toggleSelection(key);\n } else {\n this.replaceSelection(key);\n }\n }\n\n /**\n * Returns whether the current selection is equal to the given selection.\n */\n isSelectionEqual(selection: Set<Key>): boolean {\n if (selection === this.state.selectedKeys) {\n return true;\n }\n\n // Check if the set of keys match.\n let selectedKeys = this.selectedKeys;\n if (selection.size !== selectedKeys.size) {\n return false;\n }\n\n for (let key of selection) {\n if (!selectedKeys.has(key)) {\n return false;\n }\n }\n\n for (let key of selectedKeys) {\n if (!selection.has(key)) {\n return false;\n }\n }\n\n return true;\n }\n\n canSelectItem(key: Key): boolean {\n return this.canSelectItemIn(key, this.collection);\n }\n\n private canSelectItemIn(key: Key, collection: Collection<Node<unknown>>): boolean {\n if (this.state.selectionMode === 'none' || this.state.disabledKeys.has(key)) {\n return false;\n }\n\n let item = collection.getItem(key);\n if (!item || item?.props?.isDisabled || (item.type === 'cell' && !this.allowsCellSelection)) {\n return false;\n }\n\n return true;\n }\n\n isDisabled(key: Key): boolean {\n return this.state.disabledBehavior === 'all' && (this.state.disabledKeys.has(key) || !!this.collection.getItem(key)?.props?.isDisabled);\n }\n\n isLink(key: Key): boolean {\n return !!this.collection.getItem(key)?.props?.href;\n }\n\n getItemProps(key: Key): any {\n return this.collection.getItem(key)?.props;\n }\n\n withCollection(collection: Collection<Node<unknown>>): SelectionManager {\n return new SelectionManager(collection, this.state, {\n allowsCellSelection: this.allowsCellSelection,\n layoutDelegate: this.layoutDelegate || undefined,\n fullCollection: this.fullCollection ?? this.collection\n });\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CollectionBase, CollectionElement, Key, Node} from '@react-types/shared';\nimport {PartialNode} from './types';\nimport React, {ReactElement} from 'react';\n\ninterface CollectionBuilderState {\n renderer?: (value: any) => ReactElement | null\n}\n\ninterface CollectReactElement<T> extends ReactElement {\n getCollectionNode(props: any, context: any): Generator<PartialNode<T>, void, Node<T>[]>\n}\n\nexport class CollectionBuilder<T extends object> {\n private context?: unknown;\n private cache: WeakMap<T, Node<T>> = new WeakMap();\n\n build(props: Partial<CollectionBase<T>>, context?: unknown): Iterable<Node<T>> {\n this.context = context;\n return iterable(() => this.iterateCollection(props));\n }\n\n private *iterateCollection(props: Partial<CollectionBase<T>>): Generator<Node<T>> {\n let {children, items} = props;\n\n if (React.isValidElement<{children: CollectionElement<T>}>(children) && children.type === React.Fragment) {\n yield* this.iterateCollection({\n children: children.props.children,\n items\n });\n } else if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n let index = 0;\n for (let item of items) {\n yield* this.getFullNode({\n value: item,\n index\n }, {renderer: children});\n index++;\n }\n } else {\n let items: CollectionElement<T>[] = [];\n React.Children.forEach(children, child => {\n if (child) {\n items.push(child);\n }\n });\n\n let index = 0;\n for (let item of items) {\n let nodes = this.getFullNode({\n element: item,\n index: index\n }, {});\n\n for (let node of nodes) {\n index++;\n yield node;\n }\n }\n }\n }\n\n private getKey(item: NonNullable<CollectionElement<T>>, partialNode: PartialNode<T>, state: CollectionBuilderState, parentKey?: Key | null): Key {\n if (item.key != null) {\n return item.key;\n }\n\n if (partialNode.type === 'cell' && partialNode.key != null) {\n return `${parentKey}${partialNode.key}`;\n }\n\n let v = partialNode.value as any;\n if (v != null) {\n let key = v.key ?? v.id;\n if (key == null) {\n throw new Error('No key found for item');\n }\n\n return key;\n }\n\n return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;\n }\n\n private getChildState(state: CollectionBuilderState, partialNode: PartialNode<T>) {\n return {\n renderer: partialNode.renderer || state.renderer\n };\n }\n\n private *getFullNode(partialNode: PartialNode<T> & {index: number}, state: CollectionBuilderState, parentKey?: Key | null, parentNode?: Node<T>): Generator<Node<T>> {\n if (React.isValidElement<{children: CollectionElement<T>}>(partialNode.element) && partialNode.element.type === React.Fragment) {\n let children: CollectionElement<T>[] = [];\n\n React.Children.forEach(partialNode.element.props.children, child => {\n children.push(child);\n });\n\n let index = partialNode.index ?? 0;\n\n for (const child of children) {\n yield* this.getFullNode({\n element: child,\n index: index++\n }, state, parentKey, parentNode);\n }\n\n return;\n }\n\n // If there's a value instead of an element on the node, and a parent renderer function is available,\n // use it to render an element for the value.\n let element = partialNode.element;\n if (!element && partialNode.value && state && state.renderer) {\n let cached = this.cache.get(partialNode.value);\n if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {\n cached.index = partialNode.index;\n cached.parentKey = parentNode ? parentNode.key : null;\n yield cached;\n return;\n }\n\n element = state.renderer(partialNode.value);\n }\n\n // If there's an element with a getCollectionNode function on its type, then it's a supported component.\n // Call this function to get a partial node, and recursively build a full node from there.\n if (React.isValidElement(element)) {\n let type = element.type as unknown as CollectReactElement<T>;\n if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {\n let name = element.type;\n throw new Error(`Unknown element <${name}> in collection.`);\n }\n\n let childNodes = type.getCollectionNode(element.props, this.context) as Generator<PartialNode<T>, void, Node<T>[]>;\n let index = partialNode.index ?? 0;\n let result = childNodes.next();\n while (!result.done && result.value) {\n let childNode = result.value;\n\n partialNode.index = index;\n\n let nodeKey = childNode.key ?? null;\n if (nodeKey == null) {\n nodeKey = childNode.element ? null : this.getKey(element as NonNullable<CollectionElement<T>>, partialNode, state, parentKey);\n }\n\n let nodes = this.getFullNode({\n ...childNode,\n key: nodeKey,\n index,\n wrapper: compose(partialNode.wrapper, childNode.wrapper)\n }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);\n\n let children = [...nodes];\n for (let node of children) {\n // Cache the node based on its value\n node.value = childNode.value ?? partialNode.value ?? null;\n if (node.value) {\n this.cache.set(node.value, node);\n }\n\n // The partial node may have specified a type for the child in order to specify a constraint.\n // Verify that the full node that was built recursively matches this type.\n if (partialNode.type && node.type !== partialNode.type) {\n throw new Error(`Unsupported type <${capitalize(node.type)}> in <${capitalize(parentNode?.type ?? 'unknown parent type')}>. Only <${capitalize(partialNode.type)}> is supported.`);\n }\n\n index++;\n yield node;\n }\n\n result = childNodes.next(children);\n }\n\n return;\n }\n\n // Ignore invalid elements\n if (partialNode.key == null || partialNode.type == null) {\n return;\n }\n\n // Create full node\n let builder = this;\n let node: Node<T> = {\n type: partialNode.type,\n props: partialNode.props,\n key: partialNode.key,\n parentKey: parentNode ? parentNode.key : null,\n value: partialNode.value ?? null,\n level: (parentNode?.level ?? 0) + (parentNode?.type === 'item' ? 1 : 0),\n index: partialNode.index,\n rendered: partialNode.rendered,\n textValue: partialNode.textValue ?? '',\n 'aria-label': partialNode['aria-label'],\n wrapper: partialNode.wrapper,\n shouldInvalidate: partialNode.shouldInvalidate,\n hasChildNodes: partialNode.hasChildNodes || false,\n childNodes: iterable(function *() {\n if (!partialNode.hasChildNodes || !partialNode.childNodes) {\n return;\n }\n\n let index = 0;\n for (let child of partialNode.childNodes()) {\n // Ensure child keys are globally unique by prepending the parent node's key\n if (child.key != null) {\n // TODO: Remove this line entirely and enforce that users always provide unique keys.\n // Currently this line will have issues when a parent has a key `a` and a child with key `bc`\n // but another parent has key `ab` and its child has a key `c`. The combined keys would result in both\n // children having a key of `abc`.\n child.key = `${node.key}${child.key}`;\n }\n\n let nodes = builder.getFullNode({...child, index}, builder.getChildState(state, child), node.key, node);\n for (let node of nodes) {\n index++;\n yield node;\n }\n }\n })\n };\n\n yield node;\n }\n}\n\n// Wraps an iterator function as an iterable object, and caches the results.\nfunction iterable<T>(iterator: () => IterableIterator<Node<T>>): Iterable<Node<T>> {\n let cache: Array<Node<T>> = [];\n let iterable: null | IterableIterator<Node<T>> = null;\n return {\n *[Symbol.iterator]() {\n for (let item of cache) {\n yield item;\n }\n\n if (!iterable) {\n iterable = iterator();\n }\n\n for (let item of iterable) {\n cache.push(item);\n yield item;\n }\n }\n };\n}\n\ntype Wrapper = (element: ReactElement) => ReactElement;\nfunction compose(outer: Wrapper | void, inner: Wrapper | void): Wrapper | undefined {\n if (outer && inner) {\n return (element) => outer(inner(element));\n }\n\n if (outer) {\n return outer;\n }\n\n if (inner) {\n return inner;\n }\n}\n\nfunction capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, Node} from '@react-types/shared';\nimport {CollectionBuilder} from './CollectionBuilder';\nimport {ReactElement, useMemo} from 'react';\n\ninterface CollectionOptions<T, C extends Collection<Node<T>>> extends Omit<CollectionStateBase<T, C>, 'children'> {\n children?: ReactElement<any> | null | (ReactElement<any> | null)[] | ((item: T) => ReactElement<any> | null)\n}\n\ntype CollectionFactory<T, C extends Collection<Node<T>>> = (node: Iterable<Node<T>>) => C;\n\nexport function useCollection<T extends object, C extends Collection<Node<T>> = Collection<Node<T>>>(props: CollectionOptions<T, C>, factory: CollectionFactory<T, C>, context?: unknown): C {\n let builder = useMemo(() => new CollectionBuilder<T>(), []);\n let {children, items, collection} = props;\n let result = useMemo(() => {\n if (collection) {\n return collection;\n }\n let nodes = builder.build({children, items}, context);\n return factory(nodes);\n }, [builder, children, items, collection, context, factory]);\n return result;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, CollectionStateBase, Key, LayoutDelegate, Node} from '@react-types/shared';\nimport {ListCollection} from './ListCollection';\nimport {MultipleSelectionStateProps, useMultipleSelectionState} from '../selection/useMultipleSelectionState';\nimport {SelectionManager} from '../selection/SelectionManager';\nimport {useCallback, useEffect, useMemo, useRef} from 'react';\nimport {useCollection} from '../collections/useCollection';\n\nexport interface ListProps<T> extends CollectionStateBase<T>, MultipleSelectionStateProps {\n /** Filter function to generate a filtered list of nodes. */\n filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>,\n /** @private */\n suppressTextValueWarning?: boolean,\n /**\n * A delegate object that provides layout information for items in the collection.\n * This can be used to override the behavior of shift selection.\n */\n layoutDelegate?: LayoutDelegate\n}\n\nexport interface ListState<T> {\n /** A collection of items in the list. */\n collection: Collection<Node<T>>,\n\n /** A set of items that are disabled. */\n disabledKeys: Set<Key>,\n\n /** A selection manager to read and update multiple selection state. */\n selectionManager: SelectionManager\n}\n\n/**\n * Provides state management for list-like components. Handles building a collection\n * of items from props, and manages multiple selection state.\n */\nexport function useListState<T extends object>(props: ListProps<T>): ListState<T> {\n let {filter, layoutDelegate} = props;\n\n let selectionState = useMultipleSelectionState(props);\n let disabledKeys = useMemo(() =>\n props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()\n , [props.disabledKeys]);\n\n let factory = useCallback(nodes => filter ? new ListCollection(filter(nodes)) : new ListCollection(nodes as Iterable<Node<T>>), [filter]);\n let context = useMemo(() => ({suppressTextValueWarning: props.suppressTextValueWarning}), [props.suppressTextValueWarning]);\n\n let collection = useCollection(props, factory, context);\n\n let selectionManager = useMemo(() =>\n new SelectionManager(collection, selectionState, {layoutDelegate})\n , [collection, selectionState, layoutDelegate]\n );\n\n useFocusedKeyReset(collection, selectionManager);\n\n return {\n collection,\n disabledKeys,\n selectionManager\n };\n}\n\n/**\n * Filters a collection using the provided filter function and returns a new ListState.\n */\nexport function UNSTABLE_useFilteredListState<T extends object>(state: ListState<T>, filterFn: ((nodeValue: string, node: Node<T>) => boolean) | null | undefined): ListState<T> {\n let collection = useMemo(() => filterFn ? state.collection.filter!(filterFn) : state.collection, [state.collection, filterFn]);\n let selectionManager = state.selectionManager.withCollection(collection);\n useFocusedKeyReset(collection, selectionManager);\n return {\n collection,\n selectionManager,\n disabledKeys: state.disabledKeys\n };\n}\n\nfunction useFocusedKeyReset<T>(collection: Collection<Node<T>>, selectionManager: SelectionManager) {\n // Reset focused key if that item is deleted from the collection.\n const cachedCollection = useRef<Collection<Node<T>> | null>(null);\n useEffect(() => {\n if (selectionManager.focusedKey != null && !collection.getItem(selectionManager.focusedKey) && cachedCollection.current) {\n // Walk forward in the old collection to find the next key that still exists in the new collection.\n let key = cachedCollection.current.getKeyAfter(selectionManager.focusedKey);\n let nextFocusedKey: Key | null = null;\n while (key != null) {\n let node = collection.getItem(key);\n if (node && node.type === 'item' && !selectionManager.isDisabled(key)) {\n nextFocusedKey = key;\n break;\n }\n\n key = cachedCollection.current.getKeyAfter(key);\n }\n\n // If no such key exists, walk backward.\n if (nextFocusedKey == null) {\n key = cachedCollection.current.getKeyBefore(selectionManager.focusedKey);\n while (key != null) {\n let node = collection.getItem(key);\n if (node && node.type === 'item' && !selectionManager.isDisabled(key)) {\n nextFocusedKey = key;\n break;\n }\n\n key = cachedCollection.current.getKeyBefore(key);\n }\n }\n\n selectionManager.setFocusedKey(nextFocusedKey);\n }\n cachedCollection.current = collection;\n }, [collection, selectionManager]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback} from 'react';\nimport {useControlledState} from '../utils/useControlledState';\n\nexport interface OverlayTriggerProps {\n /** Whether the overlay is open by default (controlled). */\n isOpen?: boolean,\n /** Whether the overlay is open by default (uncontrolled). */\n defaultOpen?: boolean,\n /** Handler that is called when the overlay's open state changes. */\n onOpenChange?: (isOpen: boolean) => void\n}\n\nexport interface OverlayTriggerState {\n /** Whether the overlay is currently open. */\n readonly isOpen: boolean,\n /** Sets whether the overlay is open. */\n setOpen(isOpen: boolean): void,\n /** Opens the overlay. */\n open(): void,\n /** Closes the overlay. */\n close(): void,\n /** Toggles the overlay's visibility. */\n toggle(): void\n}\n\n/**\n * Manages state for an overlay trigger. Tracks whether the overlay is open, and provides\n * methods to toggle this state.\n */\nexport function useOverlayTriggerState(props: OverlayTriggerProps): OverlayTriggerState {\n let [isOpen, setOpen] = useControlledState(props.isOpen, props.defaultOpen || false, props.onOpenChange);\n\n const open = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [setOpen, isOpen]);\n\n return {\n isOpen,\n setOpen,\n open,\n close,\n toggle\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ItemElement, ItemProps} from '@react-types/shared';\nimport {PartialNode} from './types';\nimport React, {JSX, ReactElement} from 'react';\n\nfunction Item<T>(props: ItemProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nItem.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>, context: any): Generator<PartialNode<T>> {\n let {childItems, title, children} = props;\n\n let rendered = props.title || props.children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';\n\n // suppressTextValueWarning is used in components like Tabs, which don't have type to select support.\n if (!textValue && !context?.suppressTextValueWarning && process.env.NODE_ENV !== 'production') {\n console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');\n }\n\n yield {\n type: 'item',\n props: props,\n rendered,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: hasChildItems(props),\n *childNodes() {\n if (childItems) {\n for (let child of childItems) {\n yield {\n type: 'item',\n value: child\n };\n }\n } else if (title) {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n items.push({\n type: 'item',\n element: child as ItemElement<T>\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\nfunction hasChildItems<T>(props: ItemProps<T>) {\n if (props.hasChildItems != null) {\n return props.hasChildItems;\n }\n\n if (props.childItems) {\n return true;\n }\n\n if (props.title && React.Children.count(props.children) > 0) {\n return true;\n }\n\n return false;\n}\n\n// We don't want getCollectionNode to show up in the type definition\nlet _Item = Item as <T>(props: ItemProps<T>) => JSX.Element;\nexport {_Item as Item};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CollectionBase, CollectionStateBase, FocusableProps, FocusStrategy, HelpTextProps, InputBase, Key, LabelableProps, Node, Selection, TextInputBase, Validation, ValueBase} from '@react-types/shared';\nimport {FormValidationState, useFormValidationState} from '../form/useFormValidationState';\nimport {ListState, useListState} from '../list/useListState';\nimport {OverlayTriggerState, useOverlayTriggerState} from '../overlays/useOverlayTriggerState';\nimport {useControlledState} from '../utils/useControlledState';\nimport {useMemo, useState} from 'react';\n\nexport type SelectionMode = 'single' | 'multiple';\nexport type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : readonly Key[];\nexport type ChangeValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];\ntype ValidationType<M extends SelectionMode> = M extends 'single' ? Key : Key[];\n\nexport interface SelectProps<T, M extends SelectionMode = 'single'> extends CollectionBase<T>, Omit<InputBase, 'isReadOnly'>, ValueBase<ValueType<M>, ChangeValueType<M>>, Validation<ValidationType<M>>, HelpTextProps, LabelableProps, TextInputBase, FocusableProps {\n /**\n * Whether single or multiple selection is enabled.\n * @default 'single'\n */\n selectionMode?: M,\n /**\n * The currently selected key in the collection (controlled).\n * @deprecated\n */\n selectedKey?: Key | null,\n /**\n * The initial selected key in the collection (uncontrolled).\n * @deprecated\n */\n defaultSelectedKey?: Key | null,\n /**\n * Handler that is called when the selection changes.\n * @deprecated\n */\n onSelectionChange?: (key: Key | null) => void,\n /** Sets the open state of the menu. */\n isOpen?: boolean,\n /** Sets the default open state of the menu. */\n defaultOpen?: boolean,\n /** Method that is called when the open state of the menu changes. */\n onOpenChange?: (isOpen: boolean) => void,\n /** Whether the Select should close when an item is selected. Defaults to true if selectionMode is single, false otherwise. */\n shouldCloseOnSelect?: boolean,\n /** Whether the select should be allowed to be open when the collection is empty. */\n allowsEmptyCollection?: boolean\n}\n\nexport interface SelectStateOptions<T, M extends SelectionMode = 'single'> extends Omit<SelectProps<T, M>, 'children'>, CollectionStateBase<T> {}\n\nexport interface SelectState<T, M extends SelectionMode = 'single'> extends ListState<T>, OverlayTriggerState, FormValidationState {\n /**\n * The key for the first selected item.\n * @deprecated\n */\n readonly selectedKey: Key | null,\n\n /**\n * The default selected key.\n * @deprecated\n */\n readonly defaultSelectedKey: Key | null,\n\n /**\n * Sets the selected key.\n * @deprecated\n */\n setSelectedKey(key: Key | null): void,\n\n /** The current select value. */\n readonly value: ValueType<M>,\n\n /** The default select value. */\n readonly defaultValue: ValueType<M>,\n\n /** Sets the select value. */\n setValue(value: Key | readonly Key[] | null): void,\n\n /**\n * The value of the first selected item.\n * @deprecated\n */\n readonly selectedItem: Node<T> | null,\n\n /** The value of the selected items. */\n readonly selectedItems: Node<T>[],\n\n /** Whether the select is currently focused. */\n readonly isFocused: boolean,\n\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void,\n\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy | null,\n\n /** Opens the menu. */\n open(focusStrategy?: FocusStrategy | null): void,\n\n /** Toggles the menu. */\n toggle(focusStrategy?: FocusStrategy | null): void\n}\n\n/**\n * Provides state management for a select component. Handles building a collection\n * of items from props, handles the open state for the popup menu, and manages\n * multiple selection state.\n */\nexport function useSelectState<T extends object, M extends SelectionMode = 'single'>(props: SelectStateOptions<T, M>): SelectState<T, M> {\n let {\n selectionMode = 'single' as M,\n shouldCloseOnSelect = selectionMode === 'single'\n } = props;\n let triggerState = useOverlayTriggerState(props);\n let [focusStrategy, setFocusStrategy] = useState<FocusStrategy | null>(null);\n let defaultValue = useMemo(() => {\n return props.defaultValue !== undefined ? props.defaultValue : (selectionMode === 'single' ? props.defaultSelectedKey ?? null : []) as ValueType<M>;\n }, [props.defaultValue, props.defaultSelectedKey, selectionMode]);\n let value = useMemo(() => {\n return props.value !== undefined ? props.value : (selectionMode === 'single' ? props.selectedKey : undefined) as ValueType<M>;\n }, [props.value, props.selectedKey, selectionMode]);\n let [controlledValue, setControlledValue] = useControlledState<Key | readonly Key[] | null>(value, defaultValue, props.onChange as any);\n // Only display the first selected item if in single selection mode but the value is an array.\n let displayValue = selectionMode === 'single' && Array.isArray(controlledValue) ? controlledValue[0] : controlledValue;\n let setValue = (value: Key | Key[] | null) => {\n if (selectionMode === 'single') {\n let key = Array.isArray(value) ? value[0] ?? null : value;\n setControlledValue(key);\n if (key !== displayValue) {\n props.onSelectionChange?.(key);\n }\n } else {\n let keys: Key[] = [];\n if (Array.isArray(value)) {\n keys = value;\n } else if (value != null) {\n keys = [value];\n }\n\n setControlledValue(keys);\n }\n };\n\n let listState = useListState({\n ...props,\n selectionMode,\n disallowEmptySelection: selectionMode === 'single',\n allowDuplicateSelectionEvents: true,\n selectedKeys: useMemo(() => convertValue(displayValue), [displayValue]),\n onSelectionChange: (keys: Selection) => {\n // impossible, but TS doesn't know that\n if (keys === 'all') {\n return;\n }\n\n if (selectionMode === 'single') {\n let key = keys.values().next().value ?? null;\n setValue(key);\n } else {\n setValue([...keys]);\n }\n if (shouldCloseOnSelect) {\n triggerState.close();\n }\n\n validationState.commitValidation();\n }\n });\n\n let selectedKey = listState.selectionManager.firstSelectedKey;\n let selectedItems = useMemo(() => {\n return [...listState.selectionManager.selectedKeys].map(key => listState.collection.getItem(key)).filter(item => item != null);\n }, [listState.selectionManager.selectedKeys, listState.collection]);\n\n let validationState = useFormValidationState({\n ...props,\n value: Array.isArray(displayValue) && displayValue.length === 0 ? null : displayValue as any\n });\n\n let [isFocused, setFocused] = useState(false);\n let [initialValue] = useState(displayValue);\n\n return {\n ...validationState,\n ...listState,\n ...triggerState,\n value: displayValue as ValueType<M>,\n defaultValue: defaultValue ?? initialValue as ValueType<M>,\n setValue,\n selectedKey,\n setSelectedKey: setValue,\n selectedItem: selectedItems[0] ?? null,\n selectedItems,\n defaultSelectedKey: props.defaultSelectedKey ?? (props.selectionMode === 'single' ? initialValue as Key : null),\n focusStrategy,\n open(focusStrategy: FocusStrategy | null = null) {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0 || props.allowsEmptyCollection) {\n setFocusStrategy(focusStrategy);\n triggerState.open();\n }\n },\n toggle(focusStrategy: FocusStrategy | null = null) {\n if (listState.collection.size !== 0 || props.allowsEmptyCollection) {\n setFocusStrategy(focusStrategy);\n triggerState.toggle();\n }\n },\n isFocused,\n setFocused\n };\n}\n\nfunction convertValue(value: Key | Key[] | null | undefined) {\n if (value === undefined) {\n return undefined;\n }\n if (value === null) {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {OverlayTriggerProps, useOverlayTriggerState} from '../overlays/useOverlayTriggerState';\nimport {useEffect, useMemo, useRef} from 'react';\n\nexport interface TooltipTriggerProps extends OverlayTriggerProps {\n /**\n * Whether the tooltip should be disabled, independent from the trigger.\n */\n isDisabled?: boolean,\n\n /**\n * The delay time for the tooltip to show up. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Immediate-or-delayed-appearance).\n * @default 1500\n */\n delay?: number,\n\n /**\n * The delay time for the tooltip to close. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Warmup-and-cooldown).\n * @default 500\n */\n closeDelay?: number,\n\n /**\n * By default, opens for both focus and hover. Can be made to open only for focus.\n * @default 'hover'\n */\n trigger?: 'hover' | 'focus',\n\n /**\n * Whether the tooltip should close when the trigger is pressed.\n * @default true\n */\n shouldCloseOnPress?: boolean\n}\n\nconst TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design\nconst TOOLTIP_COOLDOWN = 500;\n\nexport interface TooltipTriggerState {\n /** Whether the tooltip is currently showing. */\n isOpen: boolean,\n /**\n * Shows the tooltip. By default, the tooltip becomes visible after a delay\n * depending on a global warmup timer. The `immediate` option shows the\n * tooltip immediately instead.\n */\n open(immediate?: boolean): void,\n /** Hides the tooltip. */\n close(immediate?: boolean): void\n}\n\nlet tooltips = {};\nlet tooltipId = 0;\nlet globalWarmedUp = false;\nlet globalWarmUpTimeout: ReturnType<typeof setTimeout> | null = null;\nlet globalCooldownTimeout: ReturnType<typeof setTimeout> | null = null;\n\n/**\n * Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides\n * methods to toggle this state. Ensures only one tooltip is open at a time and controls\n * the delay for showing a tooltip.\n */\nexport function useTooltipTriggerState(props: TooltipTriggerProps = {}): TooltipTriggerState {\n let {delay = TOOLTIP_DELAY, closeDelay = TOOLTIP_COOLDOWN} = props;\n let {isOpen, open, close} = useOverlayTriggerState(props);\n let id = useMemo(() => `${++tooltipId}`, []);\n let closeTimeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let closeCallback = useRef<() => void>(close);\n\n let ensureTooltipEntry = () => {\n tooltips[id] = hideTooltip;\n };\n\n let closeOpenTooltips = () => {\n for (let hideTooltipId in tooltips) {\n if (hideTooltipId !== id) {\n tooltips[hideTooltipId](true);\n delete tooltips[hideTooltipId];\n }\n }\n };\n\n let showTooltip = () => {\n if (closeTimeout.current) {\n clearTimeout(closeTimeout.current);\n }\n closeTimeout.current = null;\n closeOpenTooltips();\n ensureTooltipEntry();\n globalWarmedUp = true;\n open();\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n globalCooldownTimeout = null;\n }\n };\n\n let hideTooltip = (immediate?: boolean) => {\n if (immediate || closeDelay <= 0) {\n if (closeTimeout.current) {\n clearTimeout(closeTimeout.current);\n }\n closeTimeout.current = null;\n closeCallback.current();\n } else if (!closeTimeout.current) {\n closeTimeout.current = setTimeout(() => {\n closeTimeout.current = null;\n closeCallback.current();\n }, closeDelay);\n }\n\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalWarmedUp) {\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n }\n globalCooldownTimeout = setTimeout(() => {\n delete tooltips[id];\n globalCooldownTimeout = null;\n globalWarmedUp = false;\n }, Math.max(TOOLTIP_COOLDOWN, closeDelay));\n }\n };\n\n let warmupTooltip = () => {\n closeOpenTooltips();\n ensureTooltipEntry();\n if (!isOpen && !globalWarmedUp) {\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n }\n\n globalWarmUpTimeout = setTimeout(() => {\n globalWarmUpTimeout = null;\n globalWarmedUp = true;\n showTooltip();\n }, delay);\n } else if (!isOpen) {\n showTooltip();\n }\n };\n\n useEffect(() => {\n closeCallback.current = close;\n }, [close]);\n\n\n useEffect(() => {\n return () => {\n if (closeTimeout.current) {\n clearTimeout(closeTimeout.current);\n }\n let tooltip = tooltips[id];\n if (tooltip) {\n delete tooltips[id];\n }\n };\n }, [id]);\n\n return {\n isOpen,\n open: (immediate) => {\n if (!immediate && delay > 0 && !closeTimeout.current) {\n warmupTooltip();\n } else {\n showTooltip();\n }\n },\n close: hideTooltip\n };\n}\n","\"use client\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport {\n cloneElement,\n type ComponentPropsWithRef,\n type DOMAttributes,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n type RefObject,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { useTooltip, useTooltipTrigger } from \"react-aria\";\nimport { createPortal } from \"react-dom\";\nimport { useTooltipTriggerState } from \"react-stately\";\nimport { cn } from \"../../utils/cn\";\n\nexport type TooltipPosition = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface TooltipProps {\n content: ReactNode;\n /** Preferred position. May flip to the opposite side if it would overflow. */\n position?: TooltipPosition;\n /** Open-delay in milliseconds (react-aria's warmup). Defaults to 200. */\n delay?: number;\n /** Pixel gap between trigger and tooltip. Defaults to 8. */\n offset?: number;\n /** Suppress the tooltip entirely without removing the trigger from the tree. */\n disabled?: boolean;\n /** Stable id for the tooltip DOM node — useful for aria-describedby tests. */\n id?: string;\n children: ReactElement;\n className?: string;\n}\n\ninterface Coords {\n top: number;\n left: number;\n /** The actual side the tooltip ended up on after any flip. */\n position: TooltipPosition;\n}\n\nconst FLIP: Record<TooltipPosition, TooltipPosition> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n};\n\nfunction placeOn(\n rect: DOMRect,\n tipRect: DOMRect,\n position: TooltipPosition,\n offset: number,\n): { top: number; left: number } {\n const cx = rect.left + rect.width / 2;\n const cy = rect.top + rect.height / 2;\n switch (position) {\n case \"top\":\n return {\n top: rect.top - tipRect.height - offset,\n left: cx - tipRect.width / 2,\n };\n case \"bottom\":\n return { top: rect.bottom + offset, left: cx - tipRect.width / 2 };\n case \"left\":\n return {\n top: cy - tipRect.height / 2,\n left: rect.left - tipRect.width - offset,\n };\n case \"right\":\n return { top: cy - tipRect.height / 2, left: rect.right + offset };\n }\n}\n\n/** Resolve the final placement: flip if the preferred side overflows. */\nfunction computePosition(\n rect: DOMRect,\n tipRect: DOMRect,\n position: TooltipPosition,\n offset: number,\n viewport: { width: number; height: number },\n): Coords {\n const tryAt = (p: TooltipPosition) => {\n const c = placeOn(rect, tipRect, p, offset);\n const fits =\n c.top >= 0 &&\n c.left >= 0 &&\n c.top + tipRect.height <= viewport.height &&\n c.left + tipRect.width <= viewport.width;\n return { ...c, position: p, fits };\n };\n\n const preferred = tryAt(position);\n if (preferred.fits) return preferred;\n const flipped = tryAt(FLIP[position]);\n if (flipped.fits) return flipped;\n\n // Neither fits cleanly — fall back to the preferred side but clamp into\n // the viewport so the arrow target is still close to the trigger.\n const fallback = preferred;\n const clampedLeft = Math.max(\n 4,\n Math.min(fallback.left, viewport.width - tipRect.width - 4),\n );\n const clampedTop = Math.max(\n 4,\n Math.min(fallback.top, viewport.height - tipRect.height - 4),\n );\n return { top: clampedTop, left: clampedLeft, position: fallback.position };\n}\n\n// Framer-motion's `initial` / `animate` accept rich variant types we\n// don't need to spell out — plain objects with `opacity` + `x`/`y` are\n// the documented shorthand and avoid pulling in the library's union.\ntype MotionFrame = Record<string, number | string>;\nconst animVariants: Record<\n TooltipPosition,\n { initial: MotionFrame; animate: MotionFrame }\n> = {\n top: { initial: { opacity: 0, y: 4 }, animate: { opacity: 1, y: 0 } },\n bottom: { initial: { opacity: 0, y: -4 }, animate: { opacity: 1, y: 0 } },\n left: { initial: { opacity: 0, x: 4 }, animate: { opacity: 1, x: 0 } },\n right: { initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 } },\n};\n\ninterface ContentProps {\n state: ReturnType<typeof useTooltipTriggerState>;\n content: ReactNode;\n position: TooltipPosition;\n triggerRef: RefObject<HTMLElement | null>;\n className?: string;\n offset: number;\n tooltipId: string;\n}\n\nfunction TooltipContent({\n state,\n content,\n position,\n triggerRef,\n className,\n offset,\n tooltipId,\n}: ContentProps) {\n const { tooltipProps } = useTooltip({ isOpen: state.isOpen }, state);\n const tipRef = useRef<HTMLDivElement | null>(null);\n const [coords, setCoords] = useState<Coords | null>(null);\n\n const reposition = useCallback(() => {\n if (!triggerRef.current || !tipRef.current) return;\n const trigRect = triggerRef.current.getBoundingClientRect();\n const tipRect = tipRef.current.getBoundingClientRect();\n const viewport = {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight,\n };\n setCoords(computePosition(trigRect, tipRect, position, offset, viewport));\n }, [triggerRef, position, offset]);\n\n // The first measure happens before the tip has rendered its content, so\n // its rect is empty. Measure again on the next frame for accurate placement.\n useLayoutEffect(() => {\n if (!state.isOpen) return;\n reposition();\n const id = requestAnimationFrame(reposition);\n return () => cancelAnimationFrame(id);\n }, [state.isOpen, reposition]);\n\n useEffect(() => {\n if (!state.isOpen) return;\n const handler = () => reposition();\n window.addEventListener(\"scroll\", handler, true);\n window.addEventListener(\"resize\", handler);\n return () => {\n window.removeEventListener(\"scroll\", handler, true);\n window.removeEventListener(\"resize\", handler);\n };\n }, [state.isOpen, reposition]);\n\n const resolvedPos = coords?.position ?? position;\n const variants = animVariants[resolvedPos];\n\n // react-aria's tooltip props include onMouseEnter/onMouseLeave for the\n // tooltip itself plus drag-related handlers that conflict with framer-\n // motion's prop signatures. Strip the ones framer-motion claims so the\n // intersection is type-clean.\n const {\n onDrag: _onDrag,\n onDragStart: _onDragStart,\n onDragEnd: _onDragEnd,\n onAnimationStart: _onAnimationStart,\n ...safeTipProps\n } = tooltipProps as DOMAttributes<HTMLDivElement> & Record<string, unknown>;\n\n const portalContent = (\n <AnimatePresence>\n {state.isOpen && (\n <div\n className=\"ods-tooltip__wrapper\"\n style={{\n position: \"fixed\",\n zIndex: 1500,\n top: coords?.top ?? -9999,\n left: coords?.left ?? -9999,\n visibility: coords ? \"visible\" : \"hidden\",\n pointerEvents: \"none\",\n }}\n >\n <motion.div\n ref={tipRef}\n {...safeTipProps}\n id={tooltipId}\n role=\"tooltip\"\n data-position={resolvedPos}\n className={cn(\"ods-tooltip\", className)}\n initial={variants.initial}\n animate={variants.animate}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15, ease: \"easeOut\" }}\n >\n {content}\n <span className=\"ods-tooltip__arrow\" aria-hidden=\"true\" />\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n );\n\n if (typeof document === \"undefined\") return null;\n return createPortal(portalContent, document.body);\n}\n\n/** Compose two refs into one — preserves the child's existing ref. */\nfunction mergeRefs<T>(...refs: Array<Ref<T> | undefined>): (node: T | null) => void {\n return (node) => {\n for (const r of refs) {\n if (!r) continue;\n if (typeof r === \"function\") r(node);\n else (r as { current: T | null }).current = node;\n }\n };\n}\n\n/** Compose a child handler with one from react-aria — both fire, child first. */\nfunction mergeHandler<E extends React.SyntheticEvent>(\n childHandler: ((e: E) => void) | undefined,\n ariaHandler: ((e: E) => void) | undefined,\n): ((e: E) => void) | undefined {\n if (!childHandler && !ariaHandler) return undefined;\n return (e: E) => {\n childHandler?.(e);\n if (!e.defaultPrevented) ariaHandler?.(e);\n };\n}\n\nexport function Tooltip({\n content,\n position = \"top\",\n delay = 200,\n offset = 8,\n disabled = false,\n id: providedId,\n children,\n className,\n}: TooltipProps) {\n const reactId = useId();\n const tooltipId = providedId ?? `ods-tooltip-${reactId}`;\n const triggerRef = useRef<HTMLElement>(null);\n const state = useTooltipTriggerState({ delay });\n const { triggerProps } = useTooltipTrigger(\n { delay, isDisabled: disabled },\n state,\n triggerRef,\n );\n\n if (!isValidElement(children)) {\n // Bail out gracefully — without a valid element child there's nothing\n // to clone props onto. Render the children as-is so we don't crash\n // consumer trees that pass a string by mistake.\n return <>{children}</>;\n }\n\n // Pull the existing ref + handlers off the child so we can compose them\n // with react-aria's. Without this merge the child loses its ref\n // (e.g. ref forwarding in a wrapped Button) and any user-supplied\n // onMouseEnter / onFocus etc. is silently overwritten.\n const childProps = children.props as ComponentPropsWithRef<\"button\"> &\n Record<string, unknown>;\n // React 19: `ref` is a regular prop on the child's props. We still\n // fall back to the legacy `element.ref` to support intermediates that\n // re-emit the older shape.\n const childRef =\n (childProps as { ref?: Ref<HTMLElement> }).ref ??\n (children as unknown as { ref?: Ref<HTMLElement> }).ref;\n\n // Merge every handler prop from react-aria with whatever the child\n // already had, so a child that passes its own onFocus/onMouseEnter\n // doesn't lose them when we attach the trigger props.\n const merged: Record<string, unknown> = { ...childProps };\n for (const [key, value] of Object.entries(\n triggerProps as Record<string, unknown>,\n )) {\n if (key.startsWith(\"on\") && typeof value === \"function\") {\n merged[key] = mergeHandler(\n childProps[key] as never,\n value as never,\n );\n } else {\n merged[key] = value;\n }\n }\n merged.ref = mergeRefs<HTMLElement>(triggerRef, childRef);\n merged[\"aria-describedby\"] =\n [childProps[\"aria-describedby\"], tooltipId].filter(Boolean).join(\" \");\n\n return (\n <>\n {cloneElement(children, merged)}\n {!disabled && (\n <TooltipContent\n state={state}\n content={content}\n position={position}\n triggerRef={triggerRef}\n offset={offset}\n className={className}\n tooltipId={tooltipId}\n />\n )}\n </>\n );\n}\n\nTooltip.displayName = \"Tooltip\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AAE/B,SAAS,MAAM,QAA8B;AAClD,aAAO,kBAAK,MAAM;AACpB;;;AC8BM;AAVC,SAAS,oBAAoB;AAAA,EAClC,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB;AAAA,EACA,GAAG;AACL,GAA6B;AAC3B,SACE,6CAAC,SAAK,GAAG,MAAM,WAAW,GAAG,sBAAsB,SAAS,GAC1D;AAAA,gDAAC,SAAI,WAAU,4BAA4B,iBAAM;AAAA,IACjD,4CAAC,SAAI,WAAU,4BACZ,gBAAM,IAAI,CAAC,SACV,6C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A,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ,MAAM;AACZ,6BAAe,IAAI;AACnB,uBAAS,MAAM;AAAA,YACjB;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,SACF;AAAA,OACF;AAAA,IAGA,+CAAC,SAAI,WAAU,uBAAsB,aAAU,UAC5C;AAAA,qBACC,+CAAC,SAAI,WAAU,0BACb;AAAA,sDAAC,UAAK,WAAU,sBAAqB,eAAY,QAAO,oBAExD;AAAA,QAAQ;AAAA,QACP;AAAA,SACH;AAAA,MAED,UAAU,UACT,+CAAC,SAAI,WAAU,sBACb;AAAA,uDAAC,6BAAO,KAAP,EAAW,WAAU,2BAA2B,GAAG,KAAK,CAAC,GAAG;AAAA;AAAA,UACxD;AAAA,WACL;AAAA,QACA,+CAAC,6BAAO,KAAP,EAAW,WAAU,qBAAqB,GAAG,KAAK,GAAG,GACpD;AAAA,wDAAC,UAAK,WAAU,0BAAyB,gEAEzC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,SAAS,MAAM;AACb,+BAAe,IAAI;AACnB,yBAAS,QAAQ;AAAA,cACnB;AAAA,cACD;AAAA;AAAA,UAED;AAAA,UACA,8CAAC,OAAE,WAAU,2BAA0B,MAAM,gBAAgB,oCAE7D;AAAA,WACF;AAAA,SACF;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["import_react","import_react","Slot","import_jsx_runtime","Button","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_framer_motion","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_framer_motion","import_react","import_jsx_runtime","CountUp","import_jsx_runtime","import_framer_motion","import_react","import_react","import_jsx_runtime","base","import_framer_motion","import_react","import_react_aria","import_react","import_jsx_runtime","import_framer_motion","import_react","import_react_aria","import_react_dom","$1CcWn$react","$1CcWn$useState","$1CcWn$useRef","$1CcWn$useEffect","$1CcWn$useReducer","$1CcWn$useCallback","value","$8AuPP$createContext","$8AuPP$useMemo","$8AuPP$useContext","name","$8AuPP$useState","$8AuPP$useRef","$8AuPP$useEffect","value","a","a","$7w3VE$useRef","$7w3VE$useState","$7w3VE$useMemo","$7w3VE$useEffect","$jO8i1$react","items","node","$emYU7$useMemo","$3yt54$useMemo","$3yt54$useCallback","$3yt54$useRef","$3yt54$useEffect","$kE40A$useCallback","$dJmKC$react","$5t5rb$useState","$5t5rb$useMemo","value","focusStrategy","$auOuY$useMemo","$auOuY$useRef","$auOuY$useEffect","import_icons","import_framer_motion","import_react","import_react_aria","import_jsx_runtime","import_jsx_runtime","Select","import_jsx_runtime","import_jsx_runtime"]}
|