@wildo-ai/saas-frontend-lib 1.1.12 → 1.1.14
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/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
- package/dist/esm/components/data-display/approval-seal.d.ts +97 -0
- package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -0
- package/dist/esm/components/data-display/approval-seal.js +208 -0
- package/dist/esm/components/data-display/approval-seal.js.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
- package/dist/esm/components/data-display/formatters/display-field-file.d.ts.map +1 -1
- package/dist/esm/components/data-display/formatters/display-field-file.js +16 -2
- package/dist/esm/components/data-display/formatters/display-field-file.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +48 -18
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
- package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
- package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
- package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
- package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
- package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
- package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +5 -1
- package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
- package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
- package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
- package/dist/esm/components/sections/surface.d.ts +12 -0
- package/dist/esm/components/sections/surface.d.ts.map +1 -1
- package/dist/esm/components/sections/surface.js +14 -0
- package/dist/esm/components/sections/surface.js.map +1 -1
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +27 -24
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +27 -33
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts +37 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts.map +1 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js +100 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js.map +1 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts +3 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts.map +1 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js +34 -0
- package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js.map +1 -0
- package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts +47 -0
- package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts.map +1 -0
- package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js +94 -0
- package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js.map +1 -0
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +39 -0
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -0
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js +155 -0
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
- package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
- package/dist/esm/core/branding/useBrandPresentation.js +17 -6
- package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +2 -0
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
- package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
- package/dist/esm/core/i18n/I18nContext.js +8 -2
- package/dist/esm/core/i18n/I18nContext.js.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +71 -6
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.js +60 -17
- package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
- package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.js +31 -0
- package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
- package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
- package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +34 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +41 -0
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
- package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
- package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
- package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
- package/dist/esm/core/runtime/AppRouter.js +18 -1
- package/dist/esm/core/runtime/AppRouter.js.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.js +61 -8
- package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
- package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
- package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
- package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
- package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../../../src/components/sections/surface.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EACL,kCAAkC,EAClC,cAAc,EACd,UAAU,GAIX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACpG,OAAO,EACL,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAwD/G,MAAM,8BAA8B,GAAG,mJAAmJ,CAAC;AAC3L,MAAM,MAAM,GAAG,qBAAqB,CAAC,SAAS,E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IES,\n SurfaceVariant,\n UIBehavior,\n type DeepPartialSurfacePolicy,\n type MaterialProfileRole,\n type SurfacePolicy,\n} from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport {\n computeSurfacePolicyContextValue,\n mergeSurfacePolicy,\n SurfacePolicyContext,\n useSurfacePolicy,\n} from '~wildo-frontend-lib/core/ui/SurfacePolicyContext';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { useMaterialRuntime } from '~wildo-frontend-lib/core/ui/material-runtime';\nimport { SurfaceErrorBoundary } from '~wildo-frontend-lib/core/ui/SurfaceErrorBoundary';\nimport { useSurfaceBodyScrollLock, useSurfaceFocusTrap } from '~wildo-frontend-lib/core/ui/surface-a11y.utils';\n\ntype SurfaceStyle = React.CSSProperties & Record<`--surface-policy-${string}`, string | undefined>;\n\nexport interface SurfaceProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Semantic container role. Surface always composes the active theme's\n * matching `UIBehavior.SURFACE` recipe onto the rendered node; callers only\n * supply local structural classes and must not repeat the theme lookup.\n */\n variant?: SurfaceVariant;\n /**\n * Selects a material profile independently from the semantic surface recipe.\n * Use this when a component's behavior/policy remains one SurfaceVariant but\n * its functional role requires different optics (for example, a raised\n * navigation toolbar versus a raised menu). Theme recipes remain the default.\n */\n materialRoleOverride?: MaterialProfileRole;\n policyOverride?: DeepPartialSurfacePolicy;\n asChild?: boolean;\n /**\n * Suppresses policy-owned CSS variables and selector attributes while\n * retaining the resolved policy in React context for child slots. This does\n * not suppress the visual theme recipe: policy and appearance are separate\n * channels, and the semantic `variant` remains visually authoritative.\n */\n emitPolicyVars?: boolean;\n /**\n * Marks this surface as a modal root for policy slots such as\n * `focusTrap: 'when-modal'` and `scrollContainment: 'lock-body'`.\n */\n modal?: boolean;\n /**\n * Set when the host primitive already owns focus trapping / body scroll lock\n * AND the accessible name/description (for example Radix Dialog Content, which\n * wires `aria-labelledby` from its own `Dialog.Title`). Surface still emits\n * policy context, but contributes NO a11y attribute of its own — see the\n * `a11yAttributes` note below, where passing an `undefined` key was deleting\n * the host's accessible name (#632) — and skips duplicate runtime side effects\n * (focus trap, body scroll lock) plus the `from-header` label-policing\n * warning: the host owns labelling, so a `Surface.Header` is never registered\n * here and the warning would be a guaranteed false positive on every\n * host-managed overlay.\n */\n a11yManagedByHost?: boolean;\n /**\n * The component that names this surface's host, for an `asChild` host whose title is part of its content: a\n * Radix or vaul `Title`. A crash replaces the content, title included, so without this the host points its\n * `aria-labelledby` at nothing and a crashed dialog has no accessible name (#3329). The fallback renders its own\n * heading through this component, visually hidden, because only the primitive's title takes the id the host names.\n */\n errorFallbackTitleAs?: React.ElementType;\n 'data-slot'?: string;\n 'data-surface'?: string;\n}\n\nconst POLICY_DRIVEN_UTILITY_PREFIXES = /(?:^|\\s)(?:p|pt|pr|pb|pl|pe|ps|px|py|gap|gap-x|gap-y|max-h|min-h|max-w|overflow|z|flex|grid|flex-col|flex-row|flex-col-reverse|flex-row-reverse)-/;\nconst logger = LoggerFrontendService.getLogger();\n\nfunction paddingTierToCssValue(value: string | undefined): string | undefined {\n switch (value) {\n case 'none':\n return '0px';\n case 'field':\n return 'var(--sp-field)';\n case 'card-sm':\n return 'var(--spacing-card-sm)';\n case 'card':\n return 'var(--sp-card)';\n case 'container':\n return 'var(--sp-container)';\n default:\n return undefined;\n }\n}\n\nfunction gapTierToCssValue(value: string | undefined): string | undefined {\n switch (value) {\n case 'none':\n return '0px';\n case 'item':\n return 'var(--sp-item)';\n case 'field':\n return 'var(--sp-field)';\n case 'section':\n return 'var(--sp-section)';\n case 'lane':\n return 'var(--sp-region)';\n default:\n return undefined;\n }\n}\n\nfunction textWrapToCssValue(value: SurfacePolicy['content'] extends infer Content ? Content extends { wrapStrategy?: infer Wrap } ? Wrap : never : never): string | undefined {\n switch (value) {\n case 'nowrap':\n return 'nowrap';\n case 'balance':\n return 'balance';\n case 'pretty':\n return 'pretty';\n case 'wrap':\n return 'wrap';\n default:\n return undefined;\n }\n}\n\nfunction numericAlignmentToCssValue(value: SurfacePolicy['content'] extends infer Content ? Content extends { numericAlignment?: infer Numeric } ? Numeric : never : never): string | undefined {\n switch (value) {\n case 'tabular':\n return 'tabular-nums';\n case 'lining':\n return 'lining-nums';\n case 'inherit':\n return 'inherit';\n default:\n return undefined;\n }\n}\n\nfunction overlongTokenStrategyToCssValue(value: SurfacePolicy['content'] extends infer Content ? Content extends { overlongTokenStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'break-word':\n // CSS `overflow-wrap: break-word` (the framework default): emergency\n // character-boundary breaking when a token would otherwise overflow,\n // WITHOUT feeding those break opportunities into min-content sizing.\n // Catches URLs, dev-time i18n keys, hex hashes, file paths, error\n // messages with embedded paths.\n return 'break-word';\n case 'break-anywhere':\n // CSS `overflow-wrap: anywhere` — same emergency breaking as\n // `break-word`, but the break opportunities ALSO shrink the surface's\n // intrinsic min-content width to one character (which collapses\n // intrinsically-sized layouts like stat tiles to one letter per line).\n // Per-surface opt-in only; see `OverlongTokenStrategy` JSDoc.\n return 'anywhere';\n case 'overflow':\n // CSS `overflow-wrap: normal` = browser default. Long tokens\n // visibly overflow the surface. Useful for code blocks that\n // intentionally scroll horizontally, or any surface where the\n // design specifically calls for visible overflow.\n return 'normal';\n case 'inherit':\n return 'inherit';\n default:\n return undefined;\n }\n}\n\nfunction stackingTierToCssValue(value: SurfacePolicy['stacking'] extends infer Stacking ? Stacking extends { stackingTier?: infer Tier } ? Tier : never : never): string | undefined {\n switch (value) {\n case 'content':\n return 'var(--z-content)';\n case 'overlay':\n return 'var(--z-overlay)';\n case 'transient':\n return 'var(--z-transient)';\n case 'guidance':\n return 'var(--z-guidance)';\n case 'critical':\n return 'var(--z-critical)';\n default:\n return undefined;\n }\n}\n\nfunction actionAlignmentToCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { actionAlignment?: infer Alignment } ? Alignment : never : never): string | undefined {\n switch (value) {\n case 'stack':\n return 'column';\n case 'row':\n case 'inherit':\n return value;\n case 'column-reverse-on-mobile':\n return 'row';\n default:\n return undefined;\n }\n}\n\nfunction actionAlignmentToMobileCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { actionAlignment?: infer Alignment } ? Alignment : never : never): string | undefined {\n switch (value) {\n case 'column-reverse-on-mobile':\n return 'column-reverse';\n case 'stack':\n return 'column';\n case 'row':\n case 'inherit':\n return value;\n default:\n return undefined;\n }\n}\n\n/**\n * The CSS `max-inline-size` a {@link ResponsiveMaxWidth} tier resolves to.\n *\n * Exported so the two LAYOUT ROOTS that cap their own content — `DisplayLayout` and `FormLayout` —\n * resolve their measure through the same vocabulary a Surface does, instead of hand-writing the tier's\n * value. They used to carry the literal `max-w-[var(--measure-max-width,42rem)]`, which is byte-for-byte\n * what the `'measure'` tier returns here: the same decision, spelled two ways, with only one of the two\n * spellings reachable by a host that wanted to change it.\n */\nexport function responsiveMaxWidthToCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { responsiveMaxWidth?: infer MaxWidth } ? MaxWidth : never : never): string | undefined {\n switch (value) {\n case 'full':\n return '100%';\n case 'sm':\n return '24rem';\n case 'md':\n return '28rem';\n case 'lg':\n return '32rem';\n case 'xl':\n return '36rem';\n case 'measure':\n // Reading-measure cap for single-column form/field stacks (T4c).\n // Themeable via `--measure-max-width`; defaults to 42rem (~672px).\n return 'var(--measure-max-width, 42rem)';\n case 'centered-readable':\n return '72ch';\n case 'content':\n // Page-content cap for primary content areas. Themeable via the\n // `--content-max-width` CSS variable; defaults to 80rem (~1280px).\n return 'var(--content-max-width, 80rem)';\n case 'none':\n default:\n // `none` is both the explicit tier AND the neutral, for the same reason the\n // margin companion below returns `0px` rather than `undefined`: policy vars\n // inherit, so an omitted cap adopts the nearest ancestor surface's cap. Every\n // tier of the union already returned explicitly, so folding the default in is\n // inert for every reachable value and only closes the inheritance hole.\n return 'none';\n }\n}\n\n/**\n * Centering companion to {@link responsiveMaxWidthToCssValue}: a surface capped\n * to a finite max inline-size is centered in its container via\n * `margin-inline: auto`. `full`/`none`/unset surfaces fill their container and\n * are explicitly RESET to `0px`. Applied by the Tailwind base layer at ≥ 640px\n * alongside the inline-size cap, so the `centered-readable`/`content` tiers\n * actually center (the cap alone would leave the surface flush to the\n * inline-start edge).\n *\n * The uncapped tiers MUST emit `0px` rather than `undefined`. Policy vars are\n * CSS custom properties, so they INHERIT: an omitted value is not \"no\n * centering\", it is \"whatever the nearest ancestor surface asked for\". Since\n * `OVERLAY` is capped (`lg`) and therefore publishes `auto`, every uncapped\n * surface nested inside a dialog silently inherited `margin-inline: auto` — and\n * an auto cross-axis margin in a flex column ALSO suppresses the item's\n * stretch, so those surfaces shrink-wrapped to their content and drifted to the\n * centre. In the settings hub that turned a column of cards into a ragged\n * staircase, each card as wide as its longest sentence. The inline-size\n * companion never showed the defect because its uncapped tier emits an explicit\n * `'none'`; this one returned `undefined` and inherited instead. Same neutral\n * -emission discipline as `--surface-policy-safe-area`, which publishes `0px`\n * rather than omitting itself.\n */\nfunction responsiveMaxWidthToMarginCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { responsiveMaxWidth?: infer MaxWidth } ? MaxWidth : never : never): string | undefined {\n switch (value) {\n case 'sm':\n case 'md':\n case 'lg':\n case 'xl':\n case 'measure':\n case 'centered-readable':\n case 'content':\n return 'auto';\n case 'full':\n case 'none':\n default:\n // Explicit reset, never `undefined` — see the note above on inheritance.\n return '0px';\n }\n}\n\nfunction embeddedTablePaddingToCssValue(value: SurfacePolicy['composition'] extends infer Composition ? Composition extends { embeddedTablePadding?: infer Padding } ? Padding : never : never): string | undefined {\n switch (value) {\n case 'strip':\n return '0px';\n case 'preserve':\n default:\n // `preserve` is also the neutral: \"no opinion\" means keep the surface's own\n // inline padding. The Tailwind rule spells the same intent as a fallback\n // (`var(--…-embedded-table-padding-inline, var(--…-padding-inline))`), but a\n // fallback only fires when the var is UNSET — an inherited value that IS set\n // wins over it, so a table-bearing surface nested inside a `strip` ancestor\n // would have inherited `0px`. Emitting it here is what actually shadows that.\n return 'var(--surface-policy-padding-inline)';\n }\n}\n\nfunction framingModeToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { framingMode?: infer Framing } ? Framing : never : never): string | undefined {\n switch (value) {\n case 'always':\n case 'when-orphan':\n case 'never':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction nestedRadiusStrategyToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { nestedRadiusStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'inherit':\n case 'one-tier-tighter':\n case 'fixed':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction firstChildEdgeStrategyToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { firstChildEdgeStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'collapse':\n case 'preserve':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction dividerStrategyToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { dividerStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'border':\n case 'gap':\n case 'rule':\n case 'none':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction nestedRadiusToCssValue(\n strategy: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { nestedRadiusStrategy?: infer Strategy } ? Strategy : never : never,\n isNestedInFramedAncestor: boolean,\n): string | undefined {\n if (!isNestedInFramedAncestor) {\n return undefined;\n }\n\n switch (strategy) {\n case 'inherit':\n return 'inherit';\n case 'one-tier-tighter':\n return 'var(--surface-nested-radius-one-tier-tighter, var(--radius-lg, 0.5rem))';\n case 'fixed':\n default:\n return undefined;\n }\n}\n\nfunction selectableSemanticsToAttribute(value: SurfacePolicy['interactiveState'] extends infer InteractiveState ? InteractiveState extends { selectableSemantics?: infer Semantics } ? Semantics : never : never): string | undefined {\n switch (value) {\n case 'wrap-children':\n case 'self-selectable':\n case 'forbidden':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction gestureOptInToAttribute(value: SurfacePolicy['interactiveState'] extends infer InteractiveState ? InteractiveState extends { gestureOptIn?: infer OptIn } ? OptIn : never : never): string | undefined {\n switch (value) {\n case 'self':\n case 'children':\n case 'none':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction landmarkRoleToAttribute(value: SurfacePolicy['a11y'] extends infer A11y ? A11y extends { landmarkRole?: infer Role } ? Role : never : never): React.AriaRole | undefined {\n switch (value) {\n case 'region':\n case 'dialog':\n case 'alertdialog':\n case 'complementary':\n case 'navigation':\n case 'status':\n case 'main':\n return value;\n case 'none':\n case 'reset':\n default:\n return undefined;\n }\n}\n\nfunction shouldActivateStackLayout(gap: string | undefined): boolean {\n return Boolean(gap && gap !== 'none');\n}\n\n/**\n * Stack-layout channel for `display` / `flex-direction`, on both the surface\n * root (`--surface-policy-display`) and its slots (`--surface-policy-slot-display`).\n *\n * The NON-stacking branch MUST return a concrete value rather than `undefined`,\n * for two independent reasons — the second one shipped as a live defect:\n *\n * 1. Policy vars are CSS custom properties, so they INHERIT. An omitted value is\n * not \"no opinion\", it is \"adopt the nearest ancestor surface's opinion\". A\n * non-stacking surface nested inside a stacking one therefore picked up\n * `display: flex; flex-direction: column` from its ancestor — the same\n * inheritance class as the `--surface-policy-responsive-max-width-margin`\n * defect (see `responsiveMaxWidthToMarginCssValue`).\n * 2. Even with NO ancestor to inherit from, omitting the var does not leave the\n * element alone. `display: var(--surface-policy-display)` with the var unset\n * is invalid at computed-value time, which resolves to `unset` — and `display`\n * is not inherited, so that is its INITIAL value, `inline`. The base-layer\n * declaration still wins the cascade, so it overrides the UA stylesheet's\n * `div { display: block }`. Measured on the running app: the framework's own\n * `PrimaryContentWidthBoundary` (a SHELL surface whose `containment.gap` is\n * flattened to `'none'` precisely so it stays \"a plain block\") computed\n * `display: inline`, which made its `max-inline-size` cap and `margin-inline:\n * auto` centering inert — `max-inline-size` does not apply to non-replaced\n * inline boxes. With a 400px cap forced inside a 976px container the surface\n * measured 976px wide; publishing `block` measured 400px, centered. The entire\n * page-content width cap was silently doing nothing.\n *\n * A CSS-wide keyword cannot express \"no opinion\" here: `revert-layer`, `revert`\n * and `initial` were each measured through this var in the running app and all\n * three behaved exactly like the unset case (`display: inline`), because a\n * CSS-wide keyword arriving via `var()` substitution is not honoured as one. A\n * consumer-side fallback (`var(--x, block)`) does not help either — an inherited\n * value that IS set wins over the fallback, which is the whole of reason 1.\n *\n * `block` / `row` are the initial-ish values a block container wants. Utility\n * classes still win: they live in a later cascade layer than this base rule.\n */\nfunction stackDisplayCssValue(isStacking: boolean): string {\n return isStacking ? 'flex' : 'block';\n}\n\n/** Companion to {@link stackDisplayCssValue} — see its note on explicit neutrals. */\nfunction stackFlexDirectionCssValue(isStacking: boolean): string {\n return isStacking ? 'column' : 'row';\n}\n\n/**\n * Every var below is read by a Tailwind base-layer rule that can match a NESTED\n * surface, so any `undefined` here is not \"neutral\" — it is \"inherit the nearest\n * ancestor surface's value\". The vars were enumerated against that rule set\n * (`src/tailwind/index.ts`) and classified; the residuals are recorded so the next\n * author does not have to re-derive them:\n *\n * - SAFE BY CONSTRUCTION — `safe-area` always emits `0px`/`env()`;\n * `child-adaptive-gap` is gated by the same boolean as the\n * `data-surface-child-adaptive-density` attribute its selector requires, so the\n * read is unreachable when the emission is absent.\n * - BENIGN — `numeric-align`, `text-wrap` and `overflow-wrap` drive CSS properties\n * that are THEMSELVES inherited, so inheriting the var is equivalent to\n * inheriting the property. No shadowing needed.\n * - INERT — `framing-mode`, `nested-radius{,-strategy}`, `first-child-edge-strategy`,\n * `divider-strategy`, `selectable-semantics` and `gesture-opt-in` are republished\n * as `--surface-*` custom properties that NOTHING reads (verified repo-wide);\n * behaviour is driven by the matching `data-surface-*` attributes, which do not\n * inherit.\n * - LATENT — the remaining tier-mapped vars (`padding-*`, `overflow`, `max-height`,\n * `gap`, `z-tier`, the per-slot gaps, `action-alignment{,-mobile}`) can only reach\n * their `undefined` branch through an override that sets the slot explicitly to\n * `undefined`: every variant's framework default populates them, and both `'reset'`\n * and `'inherit'` resolve to a concrete value (`'reset'` additionally logs an error\n * when it cannot). Left as-is rather than changed blind — if one becomes reachable,\n * it belongs in the explicit-neutral treatment above.\n */\nfunction buildSurfacePolicyStyle(policy: SurfacePolicy): SurfaceStyle {\n const containment = policy.containment;\n const nesting = policy.nesting;\n const content = policy.content;\n const interactiveState = policy.interactiveState;\n const geometry = policy.geometry;\n const stacking = policy.stacking;\n const composition = policy.composition;\n const shouldStack = shouldActivateStackLayout(containment?.gap);\n\n return {\n '--surface-policy-display': stackDisplayCssValue(shouldStack),\n '--surface-policy-flex-direction': stackFlexDirectionCssValue(shouldStack),\n '--surface-policy-padding-block': paddingTierToCssValue(containment?.paddingBlock),\n '--surface-policy-padding-inline': paddingTierToCssValue(containment?.paddingInline),\n '--surface-policy-overflow': containment?.overflow,\n '--surface-policy-max-height': containment?.maxHeight === 'none' ? 'none' : containment?.maxHeight,\n '--surface-policy-gap': gapTierToCssValue(containment?.gap),\n '--surface-policy-header-gap': gapTierToCssValue(containment?.slotGap?.header ?? containment?.gap),\n '--surface-policy-body-gap': gapTierToCssValue(containment?.slotGap?.body ?? containment?.gap),\n '--surface-policy-footer-gap': gapTierToCssValue(containment?.slotGap?.footer ?? containment?.gap),\n '--surface-policy-framing-mode': framingModeToAttribute(nesting?.framingMode),\n '--surface-policy-nested-radius-strategy': nestedRadiusStrategyToAttribute(nesting?.nestedRadiusStrategy),\n '--surface-policy-first-child-edge-strategy': firstChildEdgeStrategyToAttribute(nesting?.firstChildEdgeStrategy),\n '--surface-policy-divider-strategy': dividerStrategyToAttribute(nesting?.dividerStrategy),\n '--surface-policy-z-tier': stackingTierToCssValue(stacking?.stackingTier),\n '--surface-policy-numeric-align': numericAlignmentToCssValue(content?.numericAlignment),\n '--surface-policy-text-wrap': textWrapToCssValue(content?.wrapStrategy),\n '--surface-policy-overflow-wrap': overlongTokenStrategyToCssValue(content?.overlongTokenStrategy),\n '--surface-policy-safe-area': geometry?.safeAreaPadding ? 'env(safe-area-inset-bottom)' : '0px',\n '--surface-policy-action-alignment': actionAlignmentToCssValue(geometry?.actionAlignment),\n '--surface-policy-action-alignment-mobile': actionAlignmentToMobileCssValue(geometry?.actionAlignment),\n '--surface-policy-responsive-max-width': responsiveMaxWidthToCssValue(geometry?.responsiveMaxWidth),\n '--surface-policy-responsive-max-width-margin': responsiveMaxWidthToMarginCssValue(geometry?.responsiveMaxWidth),\n '--surface-policy-embedded-table-padding-inline': embeddedTablePaddingToCssValue(composition?.embeddedTablePadding),\n '--surface-policy-child-adaptive-gap': composition?.childAdaptiveDensity ? 'var(--sp-field)' : undefined,\n '--surface-policy-selectable-semantics': selectableSemanticsToAttribute(interactiveState?.selectableSemantics),\n '--surface-policy-gesture-opt-in': gestureOptInToAttribute(interactiveState?.gestureOptIn),\n };\n}\n\n/**\n * Policy families whose values DO produce CSS — `containment` (padding,\n * overflow, max-height, gap), `nesting` (framing mode → frame visibility),\n * `content` (text-wrap, numeric alignment), `geometry` (responsiveMaxWidth →\n * max-inline-size), `stacking` (z-tier). The remaining families (`a11y`,\n * `interactiveState`, `autoRender`, `skeleton`, `composition`) emit only ARIA\n * attributes / behavioral data-attributes / runtime hooks and CANNOT\n * visually conflict with a Tailwind utility class.\n *\n * Restricting the collision check to these families eliminates a noisy\n * false-positive: a Surface that overrides ONLY `a11y.landmarkRole`\n * (e.g., the public shell using `NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE`)\n * combined with an `overflow-auto` Tailwind utility on the same node is NOT\n * a collision — `a11y.landmarkRole` does not emit any CSS property the\n * utility could fight with.\n */\nconst VISUALLY_IMPACTFUL_POLICY_FAMILIES: ReadonlySet<string> = new Set([\n 'containment',\n 'nesting',\n 'content',\n 'geometry',\n 'stacking',\n]);\n\nfunction hasPolicyDrivenOverride(policyOverride: DeepPartialSurfacePolicy | undefined): boolean {\n if (!policyOverride) {\n return false;\n }\n\n return Object.entries(policyOverride).some(([familyName, familyOverride]) => {\n if (!VISUALLY_IMPACTFUL_POLICY_FAMILIES.has(familyName)) {\n return false;\n }\n return familyOverride !== undefined\n && familyOverride !== null\n && typeof familyOverride === 'object'\n && Object.keys(familyOverride).length > 0;\n });\n}\n\nfunction usePolicyChannelCollisionWarning(\n className: string | undefined,\n childClassName: string | undefined,\n policyOverride: DeepPartialSurfacePolicy | undefined,\n emitPolicyVars: boolean,\n): void {\n const warnedRef = React.useRef(false);\n\n // The collision this warns about — a className layout utility (padding / gap /\n // flex / …) visually overriding a policy-driven CSS var while children still\n // read the policy value — can only happen when the policy vars are actually\n // emitted. A surface with `emitPolicyVars={false}` (e.g. ContentSection section\n // chrome, which owns layout via recipe classes and may set only a\n // `nesting.framingMode` override) emits NO vars, so there is nothing for a\n // utility to override. Skipping the check here removes a guaranteed\n // false-positive on every such surface.\n if (!emitPolicyVars) {\n return;\n }\n\n const conflictingClassName = [className, childClassName].filter(Boolean).join(' ');\n\n if (\n process.env.NODE_ENV !== 'production'\n && !warnedRef.current\n && conflictingClassName\n && hasPolicyDrivenOverride(policyOverride)\n && POLICY_DRIVEN_UTILITY_PREFIXES.test(conflictingClassName)\n ) {\n warnedRef.current = true;\n logger.warn('[Surface] className utilities can visually override policyOverride while child policy context still sees the policy value', {\n className: conflictingClassName,\n });\n }\n}\n\nfunction mergeSurfaceStyle(\n policy: SurfacePolicy,\n materialStyle: React.CSSProperties | undefined,\n style: React.CSSProperties | undefined,\n emitPolicyVars: boolean,\n rendersOwnFrame: boolean,\n nestedRadius: string | undefined,\n): SurfaceStyle | React.CSSProperties | undefined {\n if (!emitPolicyVars) {\n return { ...materialStyle, ...style };\n }\n\n return {\n ...buildSurfacePolicyStyle(policy),\n '--surface-policy-nested-radius': nestedRadius,\n borderWidth: rendersOwnFrame ? undefined : '0px',\n boxShadow: rendersOwnFrame ? undefined : 'none',\n borderRadius: nestedRadius ? 'var(--surface-policy-nested-radius)' : undefined,\n ...materialStyle,\n ...style,\n } as SurfaceStyle;\n}\n\nconst SurfaceRoot = React.forwardRef<HTMLDivElement, SurfaceProps>(function SurfaceRoot(\n {\n variant = SurfaceVariant.BASE,\n materialRoleOverride,\n policyOverride,\n asChild = false,\n emitPolicyVars = true,\n modal = false,\n a11yManagedByHost = false,\n errorFallbackTitleAs,\n className,\n style,\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'data-slot': _dataSlot,\n 'data-surface': _dataSurface,\n tabIndex,\n ...props\n },\n ref,\n): React.JSX.Element {\n const {\n getComposedClasses,\n getMaterialProfile,\n getRecipe,\n getSurfacePolicy,\n } = useUI();\n // Optional calls keep the primitive resilient in isolated tests and custom\n // host adapters that provide the legacy minimal UI context surface.\n const visualRecipe = getRecipe?.(UIBehavior.SURFACE, variant);\n const visualRecipeClasses = getComposedClasses?.(UIBehavior.SURFACE, variant);\n const materialProfile = getMaterialProfile?.(materialRoleOverride ?? visualRecipe?.material);\n const parentContext = React.useContext(SurfacePolicyContext);\n const policy = React.useMemo(\n () => getSurfacePolicy\n ? getSurfacePolicy(variant, policyOverride, parentContext?.policy)\n : mergeSurfacePolicy(\n FRAMEWORK_DEFAULT_SURFACE_POLICIES[variant],\n undefined,\n undefined,\n policyOverride,\n {\n variant,\n parentPolicy: parentContext?.policy,\n logger,\n },\n ),\n [getSurfacePolicy, parentContext?.policy, policyOverride, variant],\n );\n const [headerId, setHeaderId] = React.useState<string | undefined>();\n const registerHeaderId = React.useCallback((id: string): void => {\n setHeaderId(id);\n }, []);\n const unregisterHeaderId = React.useCallback((id: string): void => {\n setHeaderId((current) => (current === id ? undefined : current));\n }, []);\n const headerRegistration = React.useMemo(\n () => ({ headerId, registerHeaderId, unregisterHeaderId }),\n [headerId, registerHeaderId, unregisterHeaderId],\n );\n const contextValue = React.useMemo(\n () => computeSurfacePolicyContextValue(variant, policy, parentContext, headerRegistration),\n [headerRegistration, parentContext, policy, variant],\n );\n const isNestedInFramedAncestor = Boolean(parentContext?.isInFramedAncestor);\n const nearestFramedAncestorVariant = isNestedInFramedAncestor\n ? parentContext?.nearestFramedAncestorVariant ?? undefined\n : undefined;\n const nestedRadius = nestedRadiusToCssValue(policy.nesting?.nestedRadiusStrategy, isNestedInFramedAncestor);\n\n const childClassName = asChild && React.isValidElement<{ className?: string }>(children)\n ? children.props.className\n : undefined;\n usePolicyChannelCollisionWarning(className, childClassName, policyOverride, emitPolicyVars);\n const Comp = asChild ? Slot : 'div';\n const surfaceNodeRef = React.useRef<HTMLElement | null>(null);\n const materialRuntime = useMaterialRuntime(materialProfile, surfaceNodeRef);\n const composedRef = React.useCallback((node: HTMLElement | null): void => {\n surfaceNodeRef.current = node;\n\n if (typeof ref === 'function') {\n ref(node as HTMLDivElement | null);\n return;\n }\n\n if (ref) {\n ref.current = node as HTMLDivElement | null;\n }\n }, [ref]);\n const resolvedRole = role ?? landmarkRoleToAttribute(policy.a11y?.landmarkRole);\n const resolvedAriaLabelledBy = ariaLabelledBy\n ?? (policy.a11y?.labelStrategy === 'from-header' ? headerId : undefined);\n\n /*\n * The a11y attributes Surface puts on the merged element — and under `a11yManagedByHost`, the\n * KEYS it must not put there at all.\n *\n * An `asChild` Surface is a Slot: its props are merged into the host primitive's, and the host\n * then spreads that merged object AFTER its own attributes. So a key present with an\n * `undefined` value does not mean \"Surface contributes nothing\" — it means \"delete whatever the\n * host set\". Radix `Dialog.Content` renders\n * `<div role=\"dialog\" aria-labelledby={context.titleId} {...contentProps}>`, so Surface passing\n * `aria-labelledby: undefined` REMOVED the accessible name the host had just wired from its own\n * `Dialog.Title` (#632).\n *\n * Measured on the command palette: `aria-describedby` survived (Surface never emits it) while\n * `aria-labelledby` was absent, with a correctly-rendered `Dialog.Title` sitting inside carrying\n * the very id that should have been referenced. The defect hid behind the common path —\n * `OverlayContainer` passes `aria-labelledby` EXPLICITLY, so its dialogs were named and only\n * overlays relying on the host's own title wiring lost it.\n *\n * Hence: when the host owns a11y, forward only what the CALLER explicitly supplied, as present\n * keys, and omit the rest entirely rather than passing `undefined`. Synthesizing a value is\n * equally wrong here — Surface's own `landmarkRole` would overwrite an `alertdialog` role with\n * `dialog`, which is the same defect one attribute over.\n */\n const hostManagedA11yAttributes = {\n ...(role !== undefined ? { role } : {}),\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),\n ...(ariaLabelledBy !== undefined ? { 'aria-labelledby': ariaLabelledBy } : {}),\n };\n /*\n * Without `a11yManagedByHost`, Surface contributes the role and name IT resolved — but still only the keys\n * it has a VALUE for. The same Slot rule applies here as above: an `undefined` key deletes the host's\n * attribute. Emitting `role: undefined` stripped the role from every wrapped Radix primitive that sets one\n * and was not given the opt-in — dropdown and context menus (`menu`), select (`listbox`), menubar\n * (`menubar`), tabs content (`tabpanel`) — measured on the running app as a dropdown with no `role=\"menu\"`\n * (#1903). A role or name Surface DOES resolve (an explicit prop, a policy landmark) still wins over the\n * host's, exactly as before; only the deletion is gone. Pinned in `Surface.host-role.test.tsx`.\n */\n const a11yAttributes = a11yManagedByHost\n ? hostManagedA11yAttributes\n : {\n ...(resolvedRole !== undefined ? { role: resolvedRole } : {}),\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),\n ...(resolvedAriaLabelledBy !== undefined ? { 'aria-labelledby': resolvedAriaLabelledBy } : {}),\n };\n const shouldActivateFocusTrap = !a11yManagedByHost\n && (policy.a11y?.focusTrap === 'on-mount' || (modal && policy.a11y?.focusTrap === 'when-modal'));\n const shouldActivateScrollContainment = !a11yManagedByHost\n && modal\n && policy.a11y?.scrollContainment === 'lock-body';\n /*\n * `tabIndex` follows the same Slot rule: only a key with a VALUE. Passing `tabIndex={undefined}` deleted the\n * host's own tab stop. Radix's roving-focus group gives its root `tabIndex: 0` (the group's only Tab entry,\n * every item being -1), so a toggle group wrapped in a Surface track was skipped by Tab entirely, and so\n * was the menubar. The value is the caller's, or -1 when the focus trap needs the surface itself focusable.\n */\n const resolvedTabIndex = shouldActivateFocusTrap && tabIndex == null ? -1 : tabIndex;\n const tabIndexAttribute = resolvedTabIndex === undefined ? {} : { tabIndex: resolvedTabIndex };\n\n useSurfaceFocusTrap(surfaceNodeRef, shouldActivateFocusTrap);\n useSurfaceBodyScrollLock(shouldActivateScrollContainment);\n React.useEffect(() => {\n if (\n process.env.NODE_ENV === 'production'\n // When the host primitive owns a11y (Radix Dialog / Drawer / Sheet /\n // AlertDialog), the accessible name comes from the host's own title\n // (e.g. `Dialog.Title` → `aria-labelledby`), NOT from a `Surface.Header`.\n // The `from-header` strategy is structurally inactive here, so this\n // warning would fire for EVERY host-managed overlay regardless of whether\n // it is correctly titled. Defer labelling validation to the host — Radix\n // emits its own (authoritative) warning when the title is genuinely absent.\n || a11yManagedByHost\n || policy.a11y?.labelStrategy !== 'from-header'\n || !resolvedRole\n || ariaLabel\n || ariaLabelledBy\n || headerId\n ) {\n return undefined;\n }\n\n const timeout = window.setTimeout(() => {\n logger.warn('[Surface] labelStrategy \"from-header\" produced an unlabelled landmark surface', {\n variant,\n role: resolvedRole,\n });\n }, 0);\n\n return () => window.clearTimeout(timeout);\n }, [a11yManagedByHost, ariaLabel, ariaLabelledBy, headerId, policy.a11y?.labelStrategy, resolvedRole, variant]);\n const policyStyleAttrs = emitPolicyVars\n ? {\n 'data-slot': 'surface',\n 'data-surface': '',\n /*\n * The width tier this surface applies, announced so the CAP is legible in the DOM.\n *\n * Width is a chain — a zone boundary, a pane, a layout root's reading measure — and until\n * every level said which tier it was applying, diagnosing \"why is this narrow\" meant walking\n * the ancestors reading computed styles, which is how the wrong cap got fixed twice in a row.\n * With this, `document.querySelectorAll('[data-inline-size-tier]')` names every cap in the\n * page and its owner in one call. Absent when no tier is declared, so it marks the elements\n * that actually decide something rather than every surface.\n */\n 'data-inline-size-tier': policy.geometry?.responsiveMaxWidth,\n }\n : {};\n const shouldWrapErrorBoundary = policy.interactiveState?.errorBoundary === 'self';\n const boundedChildren = shouldWrapErrorBoundary ? boundSurfaceContent(children, asChild, errorFallbackTitleAs) : { children, boundsContent: false };\n const surfaceElement = (\n <Comp\n ref={composedRef}\n {...props}\n {...policyStyleAttrs}\n data-material-kind={materialRuntime['data-material-kind']}\n data-material-tier={materialRuntime['data-material-tier']}\n data-material-variant={materialRuntime['data-material-variant']}\n data-material-depth={materialRuntime['data-material-depth']}\n data-material-composition={materialRuntime['data-material-composition']}\n data-material-group={materialRuntime['data-material-group']}\n data-material-refractive-budget={materialRuntime['data-material-refractive-budget']}\n {...tabIndexAttribute}\n data-surface-focus-trap={shouldActivateFocusTrap ? '' : undefined}\n data-surface-scroll-containment={shouldActivateScrollContainment ? '' : undefined}\n data-surface-framing-mode={emitPolicyVars ? framingModeToAttribute(policy.nesting?.framingMode) : undefined}\n data-surface-frame={emitPolicyVars ? (contextValue.rendersOwnFrame ? 'rendered' : 'suppressed') : undefined}\n data-surface-in-framed-ancestor={emitPolicyVars && isNestedInFramedAncestor ? '' : undefined}\n data-surface-nearest-framed-ancestor={emitPolicyVars ? nearestFramedAncestorVariant : undefined}\n data-surface-nested-radius-strategy={emitPolicyVars ? nestedRadiusStrategyToAttribute(policy.nesting?.nestedRadiusStrategy) : undefined}\n data-surface-first-child-edge-strategy={emitPolicyVars ? firstChildEdgeStrategyToAttribute(policy.nesting?.firstChildEdgeStrategy) : undefined}\n data-surface-divider-strategy={emitPolicyVars ? dividerStrategyToAttribute(policy.nesting?.dividerStrategy) : undefined}\n data-surface-selectable-semantics={emitPolicyVars ? selectableSemanticsToAttribute(policy.interactiveState?.selectableSemantics) : undefined}\n data-surface-gesture-opt-in={emitPolicyVars ? gestureOptInToAttribute(policy.interactiveState?.gestureOptIn) : undefined}\n data-surface-child-adaptive-density={emitPolicyVars && policy.composition?.childAdaptiveDensity === true ? '' : undefined}\n data-surface-selection-column-aware={emitPolicyVars && policy.composition?.selectionColumnAware === true ? '' : undefined}\n {...a11yAttributes}\n data-surface-variant={variant}\n className={cn(visualRecipeClasses, className)}\n style={mergeSurfaceStyle(policy, materialRuntime.style, style, emitPolicyVars, contextValue.rendersOwnFrame, nestedRadius)}\n >\n {boundedChildren.children}\n </Comp>\n );\n\n return (\n <SurfacePolicyContext.Provider value={contextValue}>\n {shouldWrapErrorBoundary && !boundedChildren.boundsContent ? (\n <SurfaceErrorBoundary>{surfaceElement}</SurfaceErrorBoundary>\n ) : surfaceElement}\n </SurfacePolicyContext.Provider>\n );\n});\n\n/**\n * Puts a `policy.interactiveState.errorBoundary: 'self'` boundary INSIDE the surface's own element, around its content.\n *\n * The boundary used to wrap the whole surface element, so a crash replaced the FRAME along with the content. For a\n * dialog that frame is the `asChild` host — Radix `Dialog.Content`, which carries the `fixed` centring and the dialog\n * role — so the fallback rendered as a bare block in the portal, behind the still-open backdrop: the page dimmed and\n * nothing appeared (#2003, a custom view whose first hook threw). Bounding the content keeps the frame standing and\n * shows the fallback where the content was.\n *\n * \"Content\" is every child of the host, so a dialog's close button (a child of `Dialog.Content`, rendered beside the\n * body) is replaced with the rest. A plain dialog still closes: Escape and a click outside are handled by\n * `Dialog.Content` itself, which stays mounted. An ALERT dialog ignores a click outside, so a crashed one closes on\n * Escape only, and not at all where its host turns Escape off. Keeping the button outside the boundary would mean\n * moving it out of the host, which positions it and holds it inside the focus trap, so that was not done.\n *\n * - Not `asChild`: the surface's own `div` is the frame, so its children are wrapped directly.\n * - `asChild` with an element whose `children` are nodes: the host element is the frame, so ITS children are wrapped\n * (one level down, through `cloneElement`), and the Slot still merges the surface's props onto the host.\n * - `asChild` with a host whose content is not passed as node children (none, or a render function): the content is\n * produced inside the host's own render, where no wrapper can reach, so the boundary stays around the whole element\n * (`boundsContent: false`) — the previous behaviour, which still isolates the crash, only without the frame.\n */\nfunction boundSurfaceContent(\n children: React.ReactNode,\n asChild: boolean,\n fallbackTitleAs: React.ElementType | undefined,\n): { children: React.ReactNode; boundsContent: boolean } {\n if (!asChild) {\n return { children: <SurfaceErrorBoundary>{children}</SurfaceErrorBoundary>, boundsContent: true };\n }\n if (!React.isValidElement<{ children?: React.ReactNode }>(children)) {\n return { children, boundsContent: false };\n }\n const hostContent = children.props.children;\n if (hostContent === undefined || hostContent === null || typeof hostContent === 'function') {\n return { children, boundsContent: false };\n }\n return {\n children: React.cloneElement(children, undefined, <SurfaceErrorBoundary titleAs={fallbackTitleAs}>{hostContent}</SurfaceErrorBoundary>),\n boundsContent: true,\n };\n}\n\nSurfaceRoot.displayName = 'Surface';\n\nfunction surfaceSlotStyle(\n slot: 'header' | 'body' | 'footer',\n policy: SurfacePolicy,\n style: React.CSSProperties | undefined,\n): React.CSSProperties {\n const gap = policy.containment?.slotGap?.[slot] ?? policy.containment?.gap;\n const shouldStack = shouldActivateStackLayout(gap);\n\n return {\n '--surface-policy-slot-display': stackDisplayCssValue(shouldStack),\n '--surface-policy-slot-flex-direction': stackFlexDirectionCssValue(shouldStack),\n [`--surface-policy-${slot}-gap`]: gapTierToCssValue(gap),\n ...style,\n } as React.CSSProperties;\n}\n\nexport const SurfaceHeader = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceHeader(\n { className, id, style, ...props },\n ref,\n): React.JSX.Element {\n const policy = useSurfacePolicy();\n const surfaceContext = React.useContext(SurfacePolicyContext);\n const registerHeaderId = surfaceContext?.registerHeaderId;\n const unregisterHeaderId = surfaceContext?.unregisterHeaderId;\n const generatedId = React.useId();\n const resolvedId = id ?? generatedId;\n\n React.useEffect(() => {\n registerHeaderId?.(resolvedId);\n return () => unregisterHeaderId?.(resolvedId);\n }, [registerHeaderId, resolvedId, unregisterHeaderId]);\n\n return (\n <div\n ref={ref}\n id={resolvedId}\n data-slot=\"surface-header\"\n className={cn(className)}\n style={surfaceSlotStyle('header', policy, style)}\n {...props}\n />\n );\n});\n\nSurfaceHeader.displayName = 'Surface.Header';\n\nexport const SurfaceBody = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceBody(\n { className, style, ...props },\n ref,\n): React.JSX.Element {\n const policy = useSurfacePolicy();\n\n return (\n <div\n ref={ref}\n data-slot=\"surface-body\"\n className={cn(className)}\n style={surfaceSlotStyle('body', policy, style)}\n {...props}\n />\n );\n});\n\nSurfaceBody.displayName = 'Surface.Body';\n\nexport const SurfaceFooter = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceFooter(\n { className, style, ...props },\n ref,\n): React.JSX.Element {\n const policy = useSurfacePolicy();\n const gap = policy.containment?.slotGap?.footer ?? policy.containment?.gap;\n const shouldStack = shouldActivateStackLayout(gap);\n const shouldAlignActions = Boolean(policy.geometry?.actionAlignment && policy.geometry.actionAlignment !== 'inherit');\n\n return (\n <div\n ref={ref}\n data-slot=\"surface-footer\"\n className={cn(className)}\n style={{\n '--surface-policy-slot-display': stackDisplayCssValue(shouldStack || shouldAlignActions),\n '--surface-policy-slot-flex-direction': stackFlexDirectionCssValue(shouldStack),\n '--surface-policy-footer-gap': gapTierToCssValue(gap),\n '--surface-policy-action-alignment': shouldAlignActions\n ? actionAlignmentToCssValue(policy.geometry?.actionAlignment)\n : undefined,\n '--surface-policy-action-alignment-mobile': shouldAlignActions\n ? actionAlignmentToMobileCssValue(policy.geometry?.actionAlignment)\n : undefined,\n ...style,\n } as React.CSSProperties}\n {...props}\n />\n );\n});\n\nSurfaceFooter.displayName = 'Surface.Footer';\n\nexport const SurfaceAction = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceAction(\n { className, ...props },\n ref,\n): React.JSX.Element {\n return (\n <div\n ref={ref}\n data-slot=\"surface-action\"\n className={cn(className)}\n {...props}\n />\n );\n});\n\nSurfaceAction.displayName = 'Surface.Action';\n\nexport const Surface = Object.assign(SurfaceRoot, {\n Header: SurfaceHeader,\n Body: SurfaceBody,\n Footer: SurfaceFooter,\n Action: SurfaceAction,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../../../src/components/sections/surface.tsx"],"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AM,CAAC,QAAQ,EAAE,eAAe,CAAC;gBAC7D,CAAC,CAAC,SAAS;YACb,0CAA0C,EAAE,kBAAkB;gBAC5D,CAAC,CAAC,+BAA+B,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC;gBACnE,CAAC,CAAC,SAAS;YACb,GAAG,KAAK;SACc,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAAwD,SAAS,aAAa,CACzH,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACvB,GAAG;IAEH,OAAO,CACL,cACE,GAAG,EAAE,GAAG,eACE,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IAChD,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n FRAMEWORK_DEFAULT_SURFACE_POLICIES,\n SurfaceVariant,\n UIBehavior,\n type DeepPartialSurfacePolicy,\n type MaterialProfileRole,\n type SurfacePolicy,\n} from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport {\n computeSurfacePolicyContextValue,\n mergeSurfacePolicy,\n SurfacePolicyContext,\n useSurfacePolicy,\n} from '~wildo-frontend-lib/core/ui/SurfacePolicyContext';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { useMaterialRuntime } from '~wildo-frontend-lib/core/ui/material-runtime';\nimport { SurfaceErrorBoundary } from '~wildo-frontend-lib/core/ui/SurfaceErrorBoundary';\nimport { useSurfaceBodyScrollLock, useSurfaceFocusTrap } from '~wildo-frontend-lib/core/ui/surface-a11y.utils';\n\ntype SurfaceStyle = React.CSSProperties & Record<`--surface-policy-${string}`, string | undefined>;\n\nexport interface SurfaceProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Semantic container role. Surface always composes the active theme's\n * matching `UIBehavior.SURFACE` recipe onto the rendered node; callers only\n * supply local structural classes and must not repeat the theme lookup.\n */\n variant?: SurfaceVariant;\n /**\n * Selects a material profile independently from the semantic surface recipe.\n * Use this when a component's behavior/policy remains one SurfaceVariant but\n * its functional role requires different optics (for example, a raised\n * navigation toolbar versus a raised menu). Theme recipes remain the default.\n */\n materialRoleOverride?: MaterialProfileRole;\n policyOverride?: DeepPartialSurfacePolicy;\n asChild?: boolean;\n /**\n * Suppresses policy-owned CSS variables and selector attributes while\n * retaining the resolved policy in React context for child slots. This does\n * not suppress the visual theme recipe: policy and appearance are separate\n * channels, and the semantic `variant` remains visually authoritative.\n */\n emitPolicyVars?: boolean;\n /**\n * Marks this surface as a modal root for policy slots such as\n * `focusTrap: 'when-modal'` and `scrollContainment: 'lock-body'`.\n */\n modal?: boolean;\n /**\n * Set when the host primitive already owns focus trapping / body scroll lock\n * AND the accessible name/description (for example Radix Dialog Content, which\n * wires `aria-labelledby` from its own `Dialog.Title`). Surface still emits\n * policy context, but contributes NO a11y attribute of its own — see the\n * `a11yAttributes` note below, where passing an `undefined` key was deleting\n * the host's accessible name (#632) — and skips duplicate runtime side effects\n * (focus trap, body scroll lock) plus the `from-header` label-policing\n * warning: the host owns labelling, so a `Surface.Header` is never registered\n * here and the warning would be a guaranteed false positive on every\n * host-managed overlay.\n */\n a11yManagedByHost?: boolean;\n /**\n * The component that names this surface's host, for an `asChild` host whose title is part of its content: a\n * Radix or vaul `Title`. A crash replaces the content, title included, so without this the host points its\n * `aria-labelledby` at nothing and a crashed dialog has no accessible name (#3329). The fallback renders its own\n * heading through this component, visually hidden, because only the primitive's title takes the id the host names.\n */\n errorFallbackTitleAs?: React.ElementType;\n 'data-slot'?: string;\n 'data-surface'?: string;\n}\n\nconst POLICY_DRIVEN_UTILITY_PREFIXES = /(?:^|\\s)(?:p|pt|pr|pb|pl|pe|ps|px|py|gap|gap-x|gap-y|max-h|min-h|max-w|overflow|z|flex|grid|flex-col|flex-row|flex-col-reverse|flex-row-reverse)-/;\nconst logger = LoggerFrontendService.getLogger();\n\nfunction paddingTierToCssValue(value: string | undefined): string | undefined {\n switch (value) {\n case 'none':\n return '0px';\n case 'field':\n return 'var(--sp-field)';\n case 'card-sm':\n return 'var(--spacing-card-sm)';\n case 'card':\n return 'var(--sp-card)';\n case 'container':\n return 'var(--sp-container)';\n default:\n return undefined;\n }\n}\n\nfunction gapTierToCssValue(value: string | undefined): string | undefined {\n switch (value) {\n case 'none':\n return '0px';\n case 'item':\n return 'var(--sp-item)';\n case 'field':\n return 'var(--sp-field)';\n case 'section':\n return 'var(--sp-section)';\n case 'lane':\n return 'var(--sp-region)';\n default:\n return undefined;\n }\n}\n\nfunction textWrapToCssValue(value: SurfacePolicy['content'] extends infer Content ? Content extends { wrapStrategy?: infer Wrap } ? Wrap : never : never): string | undefined {\n switch (value) {\n case 'nowrap':\n return 'nowrap';\n case 'balance':\n return 'balance';\n case 'pretty':\n return 'pretty';\n case 'wrap':\n return 'wrap';\n default:\n return undefined;\n }\n}\n\nfunction numericAlignmentToCssValue(value: SurfacePolicy['content'] extends infer Content ? Content extends { numericAlignment?: infer Numeric } ? Numeric : never : never): string | undefined {\n switch (value) {\n case 'tabular':\n return 'tabular-nums';\n case 'lining':\n return 'lining-nums';\n case 'inherit':\n return 'inherit';\n default:\n return undefined;\n }\n}\n\nfunction overlongTokenStrategyToCssValue(value: SurfacePolicy['content'] extends infer Content ? Content extends { overlongTokenStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'break-word':\n // CSS `overflow-wrap: break-word` (the framework default): emergency\n // character-boundary breaking when a token would otherwise overflow,\n // WITHOUT feeding those break opportunities into min-content sizing.\n // Catches URLs, dev-time i18n keys, hex hashes, file paths, error\n // messages with embedded paths.\n return 'break-word';\n case 'break-anywhere':\n // CSS `overflow-wrap: anywhere` — same emergency breaking as\n // `break-word`, but the break opportunities ALSO shrink the surface's\n // intrinsic min-content width to one character (which collapses\n // intrinsically-sized layouts like stat tiles to one letter per line).\n // Per-surface opt-in only; see `OverlongTokenStrategy` JSDoc.\n return 'anywhere';\n case 'overflow':\n // CSS `overflow-wrap: normal` = browser default. Long tokens\n // visibly overflow the surface. Useful for code blocks that\n // intentionally scroll horizontally, or any surface where the\n // design specifically calls for visible overflow.\n return 'normal';\n case 'inherit':\n return 'inherit';\n default:\n return undefined;\n }\n}\n\nfunction stackingTierToCssValue(value: SurfacePolicy['stacking'] extends infer Stacking ? Stacking extends { stackingTier?: infer Tier } ? Tier : never : never): string | undefined {\n switch (value) {\n case 'content':\n return 'var(--z-content)';\n case 'overlay':\n return 'var(--z-overlay)';\n case 'transient':\n return 'var(--z-transient)';\n case 'guidance':\n return 'var(--z-guidance)';\n case 'critical':\n return 'var(--z-critical)';\n default:\n return undefined;\n }\n}\n\nfunction actionAlignmentToCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { actionAlignment?: infer Alignment } ? Alignment : never : never): string | undefined {\n switch (value) {\n case 'stack':\n return 'column';\n case 'row':\n case 'inherit':\n return value;\n case 'column-reverse-on-mobile':\n return 'row';\n default:\n return undefined;\n }\n}\n\nfunction actionAlignmentToMobileCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { actionAlignment?: infer Alignment } ? Alignment : never : never): string | undefined {\n switch (value) {\n case 'column-reverse-on-mobile':\n return 'column-reverse';\n case 'stack':\n return 'column';\n case 'row':\n case 'inherit':\n return value;\n default:\n return undefined;\n }\n}\n\n/**\n * The CSS `max-inline-size` a {@link ResponsiveMaxWidth} tier resolves to.\n *\n * Exported so the two LAYOUT ROOTS that cap their own content — `DisplayLayout` and `FormLayout` —\n * resolve their measure through the same vocabulary a Surface does, instead of hand-writing the tier's\n * value. They used to carry the literal `max-w-[var(--measure-max-width,42rem)]`, which is byte-for-byte\n * what the `'measure'` tier returns here: the same decision, spelled two ways, with only one of the two\n * spellings reachable by a host that wanted to change it.\n */\nexport function responsiveMaxWidthToCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { responsiveMaxWidth?: infer MaxWidth } ? MaxWidth : never : never): string | undefined {\n switch (value) {\n case 'full':\n return '100%';\n case 'sm':\n return '24rem';\n case 'md':\n return '28rem';\n case 'lg':\n return '32rem';\n case 'xl':\n return '36rem';\n case 'measure':\n // Reading-measure cap for single-column form/field stacks (T4c).\n // Themeable via `--measure-max-width`; defaults to 42rem (~672px).\n return 'var(--measure-max-width, 42rem)';\n case 'centered-readable':\n return '72ch';\n case 'content':\n // Page-content cap for primary content areas. Themeable via the\n // `--content-max-width` CSS variable; defaults to 80rem (~1280px).\n return 'var(--content-max-width, 80rem)';\n case 'none':\n default:\n // `none` is both the explicit tier AND the neutral, for the same reason the\n // margin companion below returns `0px` rather than `undefined`: policy vars\n // inherit, so an omitted cap adopts the nearest ancestor surface's cap. Every\n // tier of the union already returned explicitly, so folding the default in is\n // inert for every reachable value and only closes the inheritance hole.\n return 'none';\n }\n}\n\n/**\n * The inline `style` of a block whose width tier is OPTIONAL: the tier's `max-inline-size` when one is declared, and NO\n * inline style when it is not, so the cap the HOST puts in `className` (or the block's own derived class) decides.\n *\n * `responsiveMaxWidthToCssValue(undefined)` is `'none'`, deliberately, for the Surface policy variable it feeds. As an\n * INLINE style that `'none'` outranks every class, so a block that left its tier unset to let the host decide was\n * uncapped whatever the host said. The record page's danger zone and sharing section were exactly that: the read\n * layout hands them `[max-inline-size:var(--record-body-max-inline-size)]` so they share the record body's edges\n * (060e526ea), and both rendered full width beside a body capped at the reading measure (#3751, measured on a\n * member's page in the Settings Hub: body 672px, danger zone 889px).\n */\nexport function optionalMaxInlineSizeStyle(\n value: Parameters<typeof responsiveMaxWidthToCssValue>[0] | undefined,\n): React.CSSProperties | undefined {\n return value === undefined ? undefined : { maxInlineSize: responsiveMaxWidthToCssValue(value) };\n}\n\n/**\n * Centering companion to {@link responsiveMaxWidthToCssValue}: a surface capped\n * to a finite max inline-size is centered in its container via\n * `margin-inline: auto`. `full`/`none`/unset surfaces fill their container and\n * are explicitly RESET to `0px`. Applied by the Tailwind base layer at ≥ 640px\n * alongside the inline-size cap, so the `centered-readable`/`content` tiers\n * actually center (the cap alone would leave the surface flush to the\n * inline-start edge).\n *\n * The uncapped tiers MUST emit `0px` rather than `undefined`. Policy vars are\n * CSS custom properties, so they INHERIT: an omitted value is not \"no\n * centering\", it is \"whatever the nearest ancestor surface asked for\". Since\n * `OVERLAY` is capped (`lg`) and therefore publishes `auto`, every uncapped\n * surface nested inside a dialog silently inherited `margin-inline: auto` — and\n * an auto cross-axis margin in a flex column ALSO suppresses the item's\n * stretch, so those surfaces shrink-wrapped to their content and drifted to the\n * centre. In the settings hub that turned a column of cards into a ragged\n * staircase, each card as wide as its longest sentence. The inline-size\n * companion never showed the defect because its uncapped tier emits an explicit\n * `'none'`; this one returned `undefined` and inherited instead. Same neutral\n * -emission discipline as `--surface-policy-safe-area`, which publishes `0px`\n * rather than omitting itself.\n */\nfunction responsiveMaxWidthToMarginCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends { responsiveMaxWidth?: infer MaxWidth } ? MaxWidth : never : never): string | undefined {\n switch (value) {\n case 'sm':\n case 'md':\n case 'lg':\n case 'xl':\n case 'measure':\n case 'centered-readable':\n case 'content':\n return 'auto';\n case 'full':\n case 'none':\n default:\n // Explicit reset, never `undefined` — see the note above on inheritance.\n return '0px';\n }\n}\n\nfunction embeddedTablePaddingToCssValue(value: SurfacePolicy['composition'] extends infer Composition ? Composition extends { embeddedTablePadding?: infer Padding } ? Padding : never : never): string | undefined {\n switch (value) {\n case 'strip':\n return '0px';\n case 'preserve':\n default:\n // `preserve` is also the neutral: \"no opinion\" means keep the surface's own\n // inline padding. The Tailwind rule spells the same intent as a fallback\n // (`var(--…-embedded-table-padding-inline, var(--…-padding-inline))`), but a\n // fallback only fires when the var is UNSET — an inherited value that IS set\n // wins over it, so a table-bearing surface nested inside a `strip` ancestor\n // would have inherited `0px`. Emitting it here is what actually shadows that.\n return 'var(--surface-policy-padding-inline)';\n }\n}\n\nfunction framingModeToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { framingMode?: infer Framing } ? Framing : never : never): string | undefined {\n switch (value) {\n case 'always':\n case 'when-orphan':\n case 'never':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction nestedRadiusStrategyToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { nestedRadiusStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'inherit':\n case 'one-tier-tighter':\n case 'fixed':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction firstChildEdgeStrategyToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { firstChildEdgeStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'collapse':\n case 'preserve':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction dividerStrategyToAttribute(value: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { dividerStrategy?: infer Strategy } ? Strategy : never : never): string | undefined {\n switch (value) {\n case 'border':\n case 'gap':\n case 'rule':\n case 'none':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction nestedRadiusToCssValue(\n strategy: SurfacePolicy['nesting'] extends infer Nesting ? Nesting extends { nestedRadiusStrategy?: infer Strategy } ? Strategy : never : never,\n isNestedInFramedAncestor: boolean,\n): string | undefined {\n if (!isNestedInFramedAncestor) {\n return undefined;\n }\n\n switch (strategy) {\n case 'inherit':\n return 'inherit';\n case 'one-tier-tighter':\n return 'var(--surface-nested-radius-one-tier-tighter, var(--radius-lg, 0.5rem))';\n case 'fixed':\n default:\n return undefined;\n }\n}\n\nfunction selectableSemanticsToAttribute(value: SurfacePolicy['interactiveState'] extends infer InteractiveState ? InteractiveState extends { selectableSemantics?: infer Semantics } ? Semantics : never : never): string | undefined {\n switch (value) {\n case 'wrap-children':\n case 'self-selectable':\n case 'forbidden':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction gestureOptInToAttribute(value: SurfacePolicy['interactiveState'] extends infer InteractiveState ? InteractiveState extends { gestureOptIn?: infer OptIn } ? OptIn : never : never): string | undefined {\n switch (value) {\n case 'self':\n case 'children':\n case 'none':\n return value;\n default:\n return undefined;\n }\n}\n\nfunction landmarkRoleToAttribute(value: SurfacePolicy['a11y'] extends infer A11y ? A11y extends { landmarkRole?: infer Role } ? Role : never : never): React.AriaRole | undefined {\n switch (value) {\n case 'region':\n case 'dialog':\n case 'alertdialog':\n case 'complementary':\n case 'navigation':\n case 'status':\n case 'main':\n return value;\n case 'none':\n case 'reset':\n default:\n return undefined;\n }\n}\n\nfunction shouldActivateStackLayout(gap: string | undefined): boolean {\n return Boolean(gap && gap !== 'none');\n}\n\n/**\n * Stack-layout channel for `display` / `flex-direction`, on both the surface\n * root (`--surface-policy-display`) and its slots (`--surface-policy-slot-display`).\n *\n * The NON-stacking branch MUST return a concrete value rather than `undefined`,\n * for two independent reasons — the second one shipped as a live defect:\n *\n * 1. Policy vars are CSS custom properties, so they INHERIT. An omitted value is\n * not \"no opinion\", it is \"adopt the nearest ancestor surface's opinion\". A\n * non-stacking surface nested inside a stacking one therefore picked up\n * `display: flex; flex-direction: column` from its ancestor — the same\n * inheritance class as the `--surface-policy-responsive-max-width-margin`\n * defect (see `responsiveMaxWidthToMarginCssValue`).\n * 2. Even with NO ancestor to inherit from, omitting the var does not leave the\n * element alone. `display: var(--surface-policy-display)` with the var unset\n * is invalid at computed-value time, which resolves to `unset` — and `display`\n * is not inherited, so that is its INITIAL value, `inline`. The base-layer\n * declaration still wins the cascade, so it overrides the UA stylesheet's\n * `div { display: block }`. Measured on the running app: the framework's own\n * `PrimaryContentWidthBoundary` (a SHELL surface whose `containment.gap` is\n * flattened to `'none'` precisely so it stays \"a plain block\") computed\n * `display: inline`, which made its `max-inline-size` cap and `margin-inline:\n * auto` centering inert — `max-inline-size` does not apply to non-replaced\n * inline boxes. With a 400px cap forced inside a 976px container the surface\n * measured 976px wide; publishing `block` measured 400px, centered. The entire\n * page-content width cap was silently doing nothing.\n *\n * A CSS-wide keyword cannot express \"no opinion\" here: `revert-layer`, `revert`\n * and `initial` were each measured through this var in the running app and all\n * three behaved exactly like the unset case (`display: inline`), because a\n * CSS-wide keyword arriving via `var()` substitution is not honoured as one. A\n * consumer-side fallback (`var(--x, block)`) does not help either — an inherited\n * value that IS set wins over the fallback, which is the whole of reason 1.\n *\n * `block` / `row` are the initial-ish values a block container wants. Utility\n * classes still win: they live in a later cascade layer than this base rule.\n */\nfunction stackDisplayCssValue(isStacking: boolean): string {\n return isStacking ? 'flex' : 'block';\n}\n\n/** Companion to {@link stackDisplayCssValue} — see its note on explicit neutrals. */\nfunction stackFlexDirectionCssValue(isStacking: boolean): string {\n return isStacking ? 'column' : 'row';\n}\n\n/**\n * Every var below is read by a Tailwind base-layer rule that can match a NESTED\n * surface, so any `undefined` here is not \"neutral\" — it is \"inherit the nearest\n * ancestor surface's value\". The vars were enumerated against that rule set\n * (`src/tailwind/index.ts`) and classified; the residuals are recorded so the next\n * author does not have to re-derive them:\n *\n * - SAFE BY CONSTRUCTION — `safe-area` always emits `0px`/`env()`;\n * `child-adaptive-gap` is gated by the same boolean as the\n * `data-surface-child-adaptive-density` attribute its selector requires, so the\n * read is unreachable when the emission is absent.\n * - BENIGN — `numeric-align`, `text-wrap` and `overflow-wrap` drive CSS properties\n * that are THEMSELVES inherited, so inheriting the var is equivalent to\n * inheriting the property. No shadowing needed.\n * - INERT — `framing-mode`, `nested-radius{,-strategy}`, `first-child-edge-strategy`,\n * `divider-strategy`, `selectable-semantics` and `gesture-opt-in` are republished\n * as `--surface-*` custom properties that NOTHING reads (verified repo-wide);\n * behaviour is driven by the matching `data-surface-*` attributes, which do not\n * inherit.\n * - LATENT — the remaining tier-mapped vars (`padding-*`, `overflow`, `max-height`,\n * `gap`, `z-tier`, the per-slot gaps, `action-alignment{,-mobile}`) can only reach\n * their `undefined` branch through an override that sets the slot explicitly to\n * `undefined`: every variant's framework default populates them, and both `'reset'`\n * and `'inherit'` resolve to a concrete value (`'reset'` additionally logs an error\n * when it cannot). Left as-is rather than changed blind — if one becomes reachable,\n * it belongs in the explicit-neutral treatment above.\n */\nfunction buildSurfacePolicyStyle(policy: SurfacePolicy): SurfaceStyle {\n const containment = policy.containment;\n const nesting = policy.nesting;\n const content = policy.content;\n const interactiveState = policy.interactiveState;\n const geometry = policy.geometry;\n const stacking = policy.stacking;\n const composition = policy.composition;\n const shouldStack = shouldActivateStackLayout(containment?.gap);\n\n return {\n '--surface-policy-display': stackDisplayCssValue(shouldStack),\n '--surface-policy-flex-direction': stackFlexDirectionCssValue(shouldStack),\n '--surface-policy-padding-block': paddingTierToCssValue(containment?.paddingBlock),\n '--surface-policy-padding-inline': paddingTierToCssValue(containment?.paddingInline),\n '--surface-policy-overflow': containment?.overflow,\n '--surface-policy-max-height': containment?.maxHeight === 'none' ? 'none' : containment?.maxHeight,\n '--surface-policy-gap': gapTierToCssValue(containment?.gap),\n '--surface-policy-header-gap': gapTierToCssValue(containment?.slotGap?.header ?? containment?.gap),\n '--surface-policy-body-gap': gapTierToCssValue(containment?.slotGap?.body ?? containment?.gap),\n '--surface-policy-footer-gap': gapTierToCssValue(containment?.slotGap?.footer ?? containment?.gap),\n '--surface-policy-framing-mode': framingModeToAttribute(nesting?.framingMode),\n '--surface-policy-nested-radius-strategy': nestedRadiusStrategyToAttribute(nesting?.nestedRadiusStrategy),\n '--surface-policy-first-child-edge-strategy': firstChildEdgeStrategyToAttribute(nesting?.firstChildEdgeStrategy),\n '--surface-policy-divider-strategy': dividerStrategyToAttribute(nesting?.dividerStrategy),\n '--surface-policy-z-tier': stackingTierToCssValue(stacking?.stackingTier),\n '--surface-policy-numeric-align': numericAlignmentToCssValue(content?.numericAlignment),\n '--surface-policy-text-wrap': textWrapToCssValue(content?.wrapStrategy),\n '--surface-policy-overflow-wrap': overlongTokenStrategyToCssValue(content?.overlongTokenStrategy),\n '--surface-policy-safe-area': geometry?.safeAreaPadding ? 'env(safe-area-inset-bottom)' : '0px',\n '--surface-policy-action-alignment': actionAlignmentToCssValue(geometry?.actionAlignment),\n '--surface-policy-action-alignment-mobile': actionAlignmentToMobileCssValue(geometry?.actionAlignment),\n '--surface-policy-responsive-max-width': responsiveMaxWidthToCssValue(geometry?.responsiveMaxWidth),\n '--surface-policy-responsive-max-width-margin': responsiveMaxWidthToMarginCssValue(geometry?.responsiveMaxWidth),\n '--surface-policy-embedded-table-padding-inline': embeddedTablePaddingToCssValue(composition?.embeddedTablePadding),\n '--surface-policy-child-adaptive-gap': composition?.childAdaptiveDensity ? 'var(--sp-field)' : undefined,\n '--surface-policy-selectable-semantics': selectableSemanticsToAttribute(interactiveState?.selectableSemantics),\n '--surface-policy-gesture-opt-in': gestureOptInToAttribute(interactiveState?.gestureOptIn),\n };\n}\n\n/**\n * Policy families whose values DO produce CSS — `containment` (padding,\n * overflow, max-height, gap), `nesting` (framing mode → frame visibility),\n * `content` (text-wrap, numeric alignment), `geometry` (responsiveMaxWidth →\n * max-inline-size), `stacking` (z-tier). The remaining families (`a11y`,\n * `interactiveState`, `autoRender`, `skeleton`, `composition`) emit only ARIA\n * attributes / behavioral data-attributes / runtime hooks and CANNOT\n * visually conflict with a Tailwind utility class.\n *\n * Restricting the collision check to these families eliminates a noisy\n * false-positive: a Surface that overrides ONLY `a11y.landmarkRole`\n * (e.g., the public shell using `NON_CANONICAL_SHELL_SURFACE_POLICY_OVERRIDE`)\n * combined with an `overflow-auto` Tailwind utility on the same node is NOT\n * a collision — `a11y.landmarkRole` does not emit any CSS property the\n * utility could fight with.\n */\nconst VISUALLY_IMPACTFUL_POLICY_FAMILIES: ReadonlySet<string> = new Set([\n 'containment',\n 'nesting',\n 'content',\n 'geometry',\n 'stacking',\n]);\n\nfunction hasPolicyDrivenOverride(policyOverride: DeepPartialSurfacePolicy | undefined): boolean {\n if (!policyOverride) {\n return false;\n }\n\n return Object.entries(policyOverride).some(([familyName, familyOverride]) => {\n if (!VISUALLY_IMPACTFUL_POLICY_FAMILIES.has(familyName)) {\n return false;\n }\n return familyOverride !== undefined\n && familyOverride !== null\n && typeof familyOverride === 'object'\n && Object.keys(familyOverride).length > 0;\n });\n}\n\nfunction usePolicyChannelCollisionWarning(\n className: string | undefined,\n childClassName: string | undefined,\n policyOverride: DeepPartialSurfacePolicy | undefined,\n emitPolicyVars: boolean,\n): void {\n const warnedRef = React.useRef(false);\n\n // The collision this warns about — a className layout utility (padding / gap /\n // flex / …) visually overriding a policy-driven CSS var while children still\n // read the policy value — can only happen when the policy vars are actually\n // emitted. A surface with `emitPolicyVars={false}` (e.g. ContentSection section\n // chrome, which owns layout via recipe classes and may set only a\n // `nesting.framingMode` override) emits NO vars, so there is nothing for a\n // utility to override. Skipping the check here removes a guaranteed\n // false-positive on every such surface.\n if (!emitPolicyVars) {\n return;\n }\n\n const conflictingClassName = [className, childClassName].filter(Boolean).join(' ');\n\n if (\n process.env.NODE_ENV !== 'production'\n && !warnedRef.current\n && conflictingClassName\n && hasPolicyDrivenOverride(policyOverride)\n && POLICY_DRIVEN_UTILITY_PREFIXES.test(conflictingClassName)\n ) {\n warnedRef.current = true;\n logger.warn('[Surface] className utilities can visually override policyOverride while child policy context still sees the policy value', {\n className: conflictingClassName,\n });\n }\n}\n\nfunction mergeSurfaceStyle(\n policy: SurfacePolicy,\n materialStyle: React.CSSProperties | undefined,\n style: React.CSSProperties | undefined,\n emitPolicyVars: boolean,\n rendersOwnFrame: boolean,\n nestedRadius: string | undefined,\n): SurfaceStyle | React.CSSProperties | undefined {\n if (!emitPolicyVars) {\n return { ...materialStyle, ...style };\n }\n\n return {\n ...buildSurfacePolicyStyle(policy),\n '--surface-policy-nested-radius': nestedRadius,\n borderWidth: rendersOwnFrame ? undefined : '0px',\n boxShadow: rendersOwnFrame ? undefined : 'none',\n borderRadius: nestedRadius ? 'var(--surface-policy-nested-radius)' : undefined,\n ...materialStyle,\n ...style,\n } as SurfaceStyle;\n}\n\nconst SurfaceRoot = React.forwardRef<HTMLDivElement, SurfaceProps>(function SurfaceRoot(\n {\n variant = SurfaceVariant.BASE,\n materialRoleOverride,\n policyOverride,\n asChild = false,\n emitPolicyVars = true,\n modal = false,\n a11yManagedByHost = false,\n errorFallbackTitleAs,\n className,\n style,\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'data-slot': _dataSlot,\n 'data-surface': _dataSurface,\n tabIndex,\n ...props\n },\n ref,\n): React.JSX.Element {\n const {\n getComposedClasses,\n getMaterialProfile,\n getRecipe,\n getSurfacePolicy,\n } = useUI();\n // Optional calls keep the primitive resilient in isolated tests and custom\n // host adapters that provide the legacy minimal UI context surface.\n const visualRecipe = getRecipe?.(UIBehavior.SURFACE, variant);\n const visualRecipeClasses = getComposedClasses?.(UIBehavior.SURFACE, variant);\n const materialProfile = getMaterialProfile?.(materialRoleOverride ?? visualRecipe?.material);\n const parentContext = React.useContext(SurfacePolicyContext);\n const policy = React.useMemo(\n () => getSurfacePolicy\n ? getSurfacePolicy(variant, policyOverride, parentContext?.policy)\n : mergeSurfacePolicy(\n FRAMEWORK_DEFAULT_SURFACE_POLICIES[variant],\n undefined,\n undefined,\n policyOverride,\n {\n variant,\n parentPolicy: parentContext?.policy,\n logger,\n },\n ),\n [getSurfacePolicy, parentContext?.policy, policyOverride, variant],\n );\n const [headerId, setHeaderId] = React.useState<string | undefined>();\n const registerHeaderId = React.useCallback((id: string): void => {\n setHeaderId(id);\n }, []);\n const unregisterHeaderId = React.useCallback((id: string): void => {\n setHeaderId((current) => (current === id ? undefined : current));\n }, []);\n const headerRegistration = React.useMemo(\n () => ({ headerId, registerHeaderId, unregisterHeaderId }),\n [headerId, registerHeaderId, unregisterHeaderId],\n );\n const contextValue = React.useMemo(\n () => computeSurfacePolicyContextValue(variant, policy, parentContext, headerRegistration),\n [headerRegistration, parentContext, policy, variant],\n );\n const isNestedInFramedAncestor = Boolean(parentContext?.isInFramedAncestor);\n const nearestFramedAncestorVariant = isNestedInFramedAncestor\n ? parentContext?.nearestFramedAncestorVariant ?? undefined\n : undefined;\n const nestedRadius = nestedRadiusToCssValue(policy.nesting?.nestedRadiusStrategy, isNestedInFramedAncestor);\n\n const childClassName = asChild && React.isValidElement<{ className?: string }>(children)\n ? children.props.className\n : undefined;\n usePolicyChannelCollisionWarning(className, childClassName, policyOverride, emitPolicyVars);\n const Comp = asChild ? Slot : 'div';\n const surfaceNodeRef = React.useRef<HTMLElement | null>(null);\n const materialRuntime = useMaterialRuntime(materialProfile, surfaceNodeRef);\n const composedRef = React.useCallback((node: HTMLElement | null): void => {\n surfaceNodeRef.current = node;\n\n if (typeof ref === 'function') {\n ref(node as HTMLDivElement | null);\n return;\n }\n\n if (ref) {\n ref.current = node as HTMLDivElement | null;\n }\n }, [ref]);\n const resolvedRole = role ?? landmarkRoleToAttribute(policy.a11y?.landmarkRole);\n const resolvedAriaLabelledBy = ariaLabelledBy\n ?? (policy.a11y?.labelStrategy === 'from-header' ? headerId : undefined);\n\n /*\n * The a11y attributes Surface puts on the merged element — and under `a11yManagedByHost`, the\n * KEYS it must not put there at all.\n *\n * An `asChild` Surface is a Slot: its props are merged into the host primitive's, and the host\n * then spreads that merged object AFTER its own attributes. So a key present with an\n * `undefined` value does not mean \"Surface contributes nothing\" — it means \"delete whatever the\n * host set\". Radix `Dialog.Content` renders\n * `<div role=\"dialog\" aria-labelledby={context.titleId} {...contentProps}>`, so Surface passing\n * `aria-labelledby: undefined` REMOVED the accessible name the host had just wired from its own\n * `Dialog.Title` (#632).\n *\n * Measured on the command palette: `aria-describedby` survived (Surface never emits it) while\n * `aria-labelledby` was absent, with a correctly-rendered `Dialog.Title` sitting inside carrying\n * the very id that should have been referenced. The defect hid behind the common path —\n * `OverlayContainer` passes `aria-labelledby` EXPLICITLY, so its dialogs were named and only\n * overlays relying on the host's own title wiring lost it.\n *\n * Hence: when the host owns a11y, forward only what the CALLER explicitly supplied, as present\n * keys, and omit the rest entirely rather than passing `undefined`. Synthesizing a value is\n * equally wrong here — Surface's own `landmarkRole` would overwrite an `alertdialog` role with\n * `dialog`, which is the same defect one attribute over.\n */\n const hostManagedA11yAttributes = {\n ...(role !== undefined ? { role } : {}),\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),\n ...(ariaLabelledBy !== undefined ? { 'aria-labelledby': ariaLabelledBy } : {}),\n };\n /*\n * Without `a11yManagedByHost`, Surface contributes the role and name IT resolved — but still only the keys\n * it has a VALUE for. The same Slot rule applies here as above: an `undefined` key deletes the host's\n * attribute. Emitting `role: undefined` stripped the role from every wrapped Radix primitive that sets one\n * and was not given the opt-in — dropdown and context menus (`menu`), select (`listbox`), menubar\n * (`menubar`), tabs content (`tabpanel`) — measured on the running app as a dropdown with no `role=\"menu\"`\n * (#1903). A role or name Surface DOES resolve (an explicit prop, a policy landmark) still wins over the\n * host's, exactly as before; only the deletion is gone. Pinned in `Surface.host-role.test.tsx`.\n */\n const a11yAttributes = a11yManagedByHost\n ? hostManagedA11yAttributes\n : {\n ...(resolvedRole !== undefined ? { role: resolvedRole } : {}),\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),\n ...(resolvedAriaLabelledBy !== undefined ? { 'aria-labelledby': resolvedAriaLabelledBy } : {}),\n };\n const shouldActivateFocusTrap = !a11yManagedByHost\n && (policy.a11y?.focusTrap === 'on-mount' || (modal && policy.a11y?.focusTrap === 'when-modal'));\n const shouldActivateScrollContainment = !a11yManagedByHost\n && modal\n && policy.a11y?.scrollContainment === 'lock-body';\n /*\n * `tabIndex` follows the same Slot rule: only a key with a VALUE. Passing `tabIndex={undefined}` deleted the\n * host's own tab stop. Radix's roving-focus group gives its root `tabIndex: 0` (the group's only Tab entry,\n * every item being -1), so a toggle group wrapped in a Surface track was skipped by Tab entirely, and so\n * was the menubar. The value is the caller's, or -1 when the focus trap needs the surface itself focusable.\n */\n const resolvedTabIndex = shouldActivateFocusTrap && tabIndex == null ? -1 : tabIndex;\n const tabIndexAttribute = resolvedTabIndex === undefined ? {} : { tabIndex: resolvedTabIndex };\n\n useSurfaceFocusTrap(surfaceNodeRef, shouldActivateFocusTrap);\n useSurfaceBodyScrollLock(shouldActivateScrollContainment);\n React.useEffect(() => {\n if (\n process.env.NODE_ENV === 'production'\n // When the host primitive owns a11y (Radix Dialog / Drawer / Sheet /\n // AlertDialog), the accessible name comes from the host's own title\n // (e.g. `Dialog.Title` → `aria-labelledby`), NOT from a `Surface.Header`.\n // The `from-header` strategy is structurally inactive here, so this\n // warning would fire for EVERY host-managed overlay regardless of whether\n // it is correctly titled. Defer labelling validation to the host — Radix\n // emits its own (authoritative) warning when the title is genuinely absent.\n || a11yManagedByHost\n || policy.a11y?.labelStrategy !== 'from-header'\n || !resolvedRole\n || ariaLabel\n || ariaLabelledBy\n || headerId\n ) {\n return undefined;\n }\n\n const timeout = window.setTimeout(() => {\n logger.warn('[Surface] labelStrategy \"from-header\" produced an unlabelled landmark surface', {\n variant,\n role: resolvedRole,\n });\n }, 0);\n\n return () => window.clearTimeout(timeout);\n }, [a11yManagedByHost, ariaLabel, ariaLabelledBy, headerId, policy.a11y?.labelStrategy, resolvedRole, variant]);\n const policyStyleAttrs = emitPolicyVars\n ? {\n 'data-slot': 'surface',\n 'data-surface': '',\n /*\n * The width tier this surface applies, announced so the CAP is legible in the DOM.\n *\n * Width is a chain — a zone boundary, a pane, a layout root's reading measure — and until\n * every level said which tier it was applying, diagnosing \"why is this narrow\" meant walking\n * the ancestors reading computed styles, which is how the wrong cap got fixed twice in a row.\n * With this, `document.querySelectorAll('[data-inline-size-tier]')` names every cap in the\n * page and its owner in one call. Absent when no tier is declared, so it marks the elements\n * that actually decide something rather than every surface.\n */\n 'data-inline-size-tier': policy.geometry?.responsiveMaxWidth,\n }\n : {};\n const shouldWrapErrorBoundary = policy.interactiveState?.errorBoundary === 'self';\n const boundedChildren = shouldWrapErrorBoundary ? boundSurfaceContent(children, asChild, errorFallbackTitleAs) : { children, boundsContent: false };\n const surfaceElement = (\n <Comp\n ref={composedRef}\n {...props}\n {...policyStyleAttrs}\n data-material-kind={materialRuntime['data-material-kind']}\n data-material-tier={materialRuntime['data-material-tier']}\n data-material-variant={materialRuntime['data-material-variant']}\n data-material-depth={materialRuntime['data-material-depth']}\n data-material-composition={materialRuntime['data-material-composition']}\n data-material-group={materialRuntime['data-material-group']}\n data-material-refractive-budget={materialRuntime['data-material-refractive-budget']}\n {...tabIndexAttribute}\n data-surface-focus-trap={shouldActivateFocusTrap ? '' : undefined}\n data-surface-scroll-containment={shouldActivateScrollContainment ? '' : undefined}\n data-surface-framing-mode={emitPolicyVars ? framingModeToAttribute(policy.nesting?.framingMode) : undefined}\n data-surface-frame={emitPolicyVars ? (contextValue.rendersOwnFrame ? 'rendered' : 'suppressed') : undefined}\n data-surface-in-framed-ancestor={emitPolicyVars && isNestedInFramedAncestor ? '' : undefined}\n data-surface-nearest-framed-ancestor={emitPolicyVars ? nearestFramedAncestorVariant : undefined}\n data-surface-nested-radius-strategy={emitPolicyVars ? nestedRadiusStrategyToAttribute(policy.nesting?.nestedRadiusStrategy) : undefined}\n data-surface-first-child-edge-strategy={emitPolicyVars ? firstChildEdgeStrategyToAttribute(policy.nesting?.firstChildEdgeStrategy) : undefined}\n data-surface-divider-strategy={emitPolicyVars ? dividerStrategyToAttribute(policy.nesting?.dividerStrategy) : undefined}\n data-surface-selectable-semantics={emitPolicyVars ? selectableSemanticsToAttribute(policy.interactiveState?.selectableSemantics) : undefined}\n data-surface-gesture-opt-in={emitPolicyVars ? gestureOptInToAttribute(policy.interactiveState?.gestureOptIn) : undefined}\n data-surface-child-adaptive-density={emitPolicyVars && policy.composition?.childAdaptiveDensity === true ? '' : undefined}\n data-surface-selection-column-aware={emitPolicyVars && policy.composition?.selectionColumnAware === true ? '' : undefined}\n {...a11yAttributes}\n data-surface-variant={variant}\n className={cn(visualRecipeClasses, className)}\n style={mergeSurfaceStyle(policy, materialRuntime.style, style, emitPolicyVars, contextValue.rendersOwnFrame, nestedRadius)}\n >\n {boundedChildren.children}\n </Comp>\n );\n\n return (\n <SurfacePolicyContext.Provider value={contextValue}>\n {shouldWrapErrorBoundary && !boundedChildren.boundsContent ? (\n <SurfaceErrorBoundary>{surfaceElement}</SurfaceErrorBoundary>\n ) : surfaceElement}\n </SurfacePolicyContext.Provider>\n );\n});\n\n/**\n * Puts a `policy.interactiveState.errorBoundary: 'self'` boundary INSIDE the surface's own element, around its content.\n *\n * The boundary used to wrap the whole surface element, so a crash replaced the FRAME along with the content. For a\n * dialog that frame is the `asChild` host — Radix `Dialog.Content`, which carries the `fixed` centring and the dialog\n * role — so the fallback rendered as a bare block in the portal, behind the still-open backdrop: the page dimmed and\n * nothing appeared (#2003, a custom view whose first hook threw). Bounding the content keeps the frame standing and\n * shows the fallback where the content was.\n *\n * \"Content\" is every child of the host, so a dialog's close button (a child of `Dialog.Content`, rendered beside the\n * body) is replaced with the rest. A plain dialog still closes: Escape and a click outside are handled by\n * `Dialog.Content` itself, which stays mounted. An ALERT dialog ignores a click outside, so a crashed one closes on\n * Escape only, and not at all where its host turns Escape off. Keeping the button outside the boundary would mean\n * moving it out of the host, which positions it and holds it inside the focus trap, so that was not done.\n *\n * - Not `asChild`: the surface's own `div` is the frame, so its children are wrapped directly.\n * - `asChild` with an element whose `children` are nodes: the host element is the frame, so ITS children are wrapped\n * (one level down, through `cloneElement`), and the Slot still merges the surface's props onto the host.\n * - `asChild` with a host whose content is not passed as node children (none, or a render function): the content is\n * produced inside the host's own render, where no wrapper can reach, so the boundary stays around the whole element\n * (`boundsContent: false`) — the previous behaviour, which still isolates the crash, only without the frame.\n */\nfunction boundSurfaceContent(\n children: React.ReactNode,\n asChild: boolean,\n fallbackTitleAs: React.ElementType | undefined,\n): { children: React.ReactNode; boundsContent: boolean } {\n if (!asChild) {\n return { children: <SurfaceErrorBoundary>{children}</SurfaceErrorBoundary>, boundsContent: true };\n }\n if (!React.isValidElement<{ children?: React.ReactNode }>(children)) {\n return { children, boundsContent: false };\n }\n const hostContent = children.props.children;\n if (hostContent === undefined || hostContent === null || typeof hostContent === 'function') {\n return { children, boundsContent: false };\n }\n return {\n children: React.cloneElement(children, undefined, <SurfaceErrorBoundary titleAs={fallbackTitleAs}>{hostContent}</SurfaceErrorBoundary>),\n boundsContent: true,\n };\n}\n\nSurfaceRoot.displayName = 'Surface';\n\nfunction surfaceSlotStyle(\n slot: 'header' | 'body' | 'footer',\n policy: SurfacePolicy,\n style: React.CSSProperties | undefined,\n): React.CSSProperties {\n const gap = policy.containment?.slotGap?.[slot] ?? policy.containment?.gap;\n const shouldStack = shouldActivateStackLayout(gap);\n\n return {\n '--surface-policy-slot-display': stackDisplayCssValue(shouldStack),\n '--surface-policy-slot-flex-direction': stackFlexDirectionCssValue(shouldStack),\n [`--surface-policy-${slot}-gap`]: gapTierToCssValue(gap),\n ...style,\n } as React.CSSProperties;\n}\n\nexport const SurfaceHeader = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceHeader(\n { className, id, style, ...props },\n ref,\n): React.JSX.Element {\n const policy = useSurfacePolicy();\n const surfaceContext = React.useContext(SurfacePolicyContext);\n const registerHeaderId = surfaceContext?.registerHeaderId;\n const unregisterHeaderId = surfaceContext?.unregisterHeaderId;\n const generatedId = React.useId();\n const resolvedId = id ?? generatedId;\n\n React.useEffect(() => {\n registerHeaderId?.(resolvedId);\n return () => unregisterHeaderId?.(resolvedId);\n }, [registerHeaderId, resolvedId, unregisterHeaderId]);\n\n return (\n <div\n ref={ref}\n id={resolvedId}\n data-slot=\"surface-header\"\n className={cn(className)}\n style={surfaceSlotStyle('header', policy, style)}\n {...props}\n />\n );\n});\n\nSurfaceHeader.displayName = 'Surface.Header';\n\nexport const SurfaceBody = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceBody(\n { className, style, ...props },\n ref,\n): React.JSX.Element {\n const policy = useSurfacePolicy();\n\n return (\n <div\n ref={ref}\n data-slot=\"surface-body\"\n className={cn(className)}\n style={surfaceSlotStyle('body', policy, style)}\n {...props}\n />\n );\n});\n\nSurfaceBody.displayName = 'Surface.Body';\n\nexport const SurfaceFooter = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceFooter(\n { className, style, ...props },\n ref,\n): React.JSX.Element {\n const policy = useSurfacePolicy();\n const gap = policy.containment?.slotGap?.footer ?? policy.containment?.gap;\n const shouldStack = shouldActivateStackLayout(gap);\n const shouldAlignActions = Boolean(policy.geometry?.actionAlignment && policy.geometry.actionAlignment !== 'inherit');\n\n return (\n <div\n ref={ref}\n data-slot=\"surface-footer\"\n className={cn(className)}\n style={{\n '--surface-policy-slot-display': stackDisplayCssValue(shouldStack || shouldAlignActions),\n '--surface-policy-slot-flex-direction': stackFlexDirectionCssValue(shouldStack),\n '--surface-policy-footer-gap': gapTierToCssValue(gap),\n '--surface-policy-action-alignment': shouldAlignActions\n ? actionAlignmentToCssValue(policy.geometry?.actionAlignment)\n : undefined,\n '--surface-policy-action-alignment-mobile': shouldAlignActions\n ? actionAlignmentToMobileCssValue(policy.geometry?.actionAlignment)\n : undefined,\n ...style,\n } as React.CSSProperties}\n {...props}\n />\n );\n});\n\nSurfaceFooter.displayName = 'Surface.Footer';\n\nexport const SurfaceAction = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(function SurfaceAction(\n { className, ...props },\n ref,\n): React.JSX.Element {\n return (\n <div\n ref={ref}\n data-slot=\"surface-action\"\n className={cn(className)}\n {...props}\n />\n );\n});\n\nSurfaceAction.displayName = 'Surface.Action';\n\nexport const Surface = Object.assign(SurfaceRoot, {\n Header: SurfaceHeader,\n Body: SurfaceBody,\n Footer: SurfaceFooter,\n Action: SurfaceAction,\n});\n"]}
|
|
@@ -13,29 +13,16 @@
|
|
|
13
13
|
* A tile may be a FIGURE as well as a drawing: a chart view whose chart is a `ChartType.KPI` (a count, a sum, a rate over
|
|
14
14
|
* the whole scope, its query grouping by nothing) renders as one number (`ChartKpiFigure`). It is declared, fetched,
|
|
15
15
|
* authorized and hidden exactly as a chart tile, because it IS a chart: one resource's declared aggregation (#2299).
|
|
16
|
+
*
|
|
17
|
+
* A dashboard given a `layoutRef` may be ARRANGED per organization (#2299): the organization's administrators reorder,
|
|
18
|
+
* resize and hide its tiles, stored as the organization's `organizationDashboardLayouts` row for that ref, and every
|
|
19
|
+
* member sees the arrangement. The arrangement only rearranges the declared tiles ({@link arrangeChartDashboardTiles}),
|
|
20
|
+
* and the read gate runs after it, so no arrangement shows a chart its viewer may not read.
|
|
16
21
|
*/
|
|
17
22
|
import React from 'react';
|
|
23
|
+
import { ChartDashboardTileRows, ChartDashboardTileSpan } from '@wildo-ai/saas-models';
|
|
18
24
|
import { type CompositeViewAuthoringConfig } from '../../../core/config/composite-view.schemas';
|
|
19
25
|
/** @wildo_source:part:start saas.frontend.chart-dashboard facet:layer:frontend facet:family:view facet:audience:app-developer */
|
|
20
|
-
/** How many grid columns a dashboard tile spans, where the dashboard is wide enough to have them. */
|
|
21
|
-
export declare enum ChartDashboardTileSpan {
|
|
22
|
-
/** One column (the default): a donut, a bar of a few categories. */
|
|
23
|
-
ONE = "one",
|
|
24
|
-
/** Two columns: a trend over time, a bar of many categories. One column where the dashboard has one. */
|
|
25
|
-
TWO = "two",
|
|
26
|
-
/** The whole row: a long timeline, a wide table-like chart. */
|
|
27
|
-
FULL = "full"
|
|
28
|
-
}
|
|
29
|
-
/** How many grid rows a dashboard tile spans, where the dashboard has more than one column. */
|
|
30
|
-
export declare enum ChartDashboardTileRows {
|
|
31
|
-
/** One row (the default). */
|
|
32
|
-
ONE = "one",
|
|
33
|
-
/**
|
|
34
|
-
* Two rows: a large chart beside two smaller ones stacked in the next column. Place it right after the first
|
|
35
|
-
* small tile, so the second small tile flows into the row beneath the first: `[small, large (TWO rows), small]`.
|
|
36
|
-
*/
|
|
37
|
-
TWO = "two"
|
|
38
|
-
}
|
|
39
26
|
/**
|
|
40
27
|
* The most columns a dashboard's grid reaches, as its container widens. Every dashboard is one column in a narrow pane.
|
|
41
28
|
*/
|
|
@@ -59,13 +46,15 @@ export interface ChartDashboardTile {
|
|
|
59
46
|
resourceType: string;
|
|
60
47
|
/** The chart view's `ref` on that resource (`InsertedChartDeclaration.ref`, usually `<chartDefinition>.ref`). */
|
|
61
48
|
chartViewRef: string;
|
|
62
|
-
/** Grid columns the tile spans. Default:
|
|
49
|
+
/** Grid columns the tile spans (`ChartDashboardTileSpan`, `@wildo-ai/saas-models`). Default: `ONE`. */
|
|
63
50
|
span?: ChartDashboardTileSpan;
|
|
64
|
-
/** Grid rows the tile spans. Default:
|
|
51
|
+
/** Grid rows the tile spans (`ChartDashboardTileRows`, `@wildo-ai/saas-models`). Default: `ONE`. */
|
|
65
52
|
rows?: ChartDashboardTileRows;
|
|
66
53
|
/**
|
|
67
|
-
* Chart canvas height in px (the canvas is sized by this, not by the tile). Default:
|
|
68
|
-
*
|
|
54
|
+
* Chart canvas height in px for the tile's declared `rows` (the canvas is sized by this, not by the tile). Default:
|
|
55
|
+
* 280 for a one-row chart, 592 for a two-row one (two rows and the gap between them); a KPI tile takes the height of its
|
|
56
|
+
* figure, and this only sizes its loading placeholder (default 64). When an organization's layout changes the tile's
|
|
57
|
+
* rows, this height is doubled (plus the gap) or halved with them.
|
|
69
58
|
*/
|
|
70
59
|
height?: number;
|
|
71
60
|
}
|
|
@@ -74,6 +63,13 @@ export interface ChartDashboardProps {
|
|
|
74
63
|
tiles: readonly ChartDashboardTile[];
|
|
75
64
|
/** The most columns the grid reaches. Default: {@link ChartDashboardColumns.FOUR}. */
|
|
76
65
|
columns?: ChartDashboardColumns;
|
|
66
|
+
/**
|
|
67
|
+
* The dashboard's name for an organization's stored arrangement of it (`organizationDashboardLayouts.dashboardRef`),
|
|
68
|
+
* unique within the application, e.g. `'home-analytics'`. Given one, the organization's administrators may reorder,
|
|
69
|
+
* resize and hide its tiles for every member, and go back to the declared layout; without one the dashboard is always
|
|
70
|
+
* laid out as declared.
|
|
71
|
+
*/
|
|
72
|
+
layoutRef?: string;
|
|
77
73
|
className?: string;
|
|
78
74
|
}
|
|
79
75
|
/**
|
|
@@ -90,6 +86,11 @@ export interface ChartDashboardProps {
|
|
|
90
86
|
*
|
|
91
87
|
* A KPI tile (a chart view whose chart is `ChartType.KPI`) shows one figure under that title, hidden by the same rule.
|
|
92
88
|
*
|
|
89
|
+
* With a `layoutRef`, the current organization's stored arrangement applies first (order, sizes, hidden tiles); the read
|
|
90
|
+
* gate then applies to what is left. An administrator who may arrange it gets a "customize" button above the grid,
|
|
91
|
+
* opening the layout editor, and keeps it even when every tile is hidden. The grid waits for the arrangement to be read,
|
|
92
|
+
* and a read that fails shows the declared layout.
|
|
93
|
+
*
|
|
93
94
|
* Place it inside a composite view (`CompositeLayout`), or declare a whole view as one with
|
|
94
95
|
* {@link defineChartDashboardView}.
|
|
95
96
|
*
|
|
@@ -104,7 +105,7 @@ export interface ChartDashboardProps {
|
|
|
104
105
|
* />
|
|
105
106
|
* ```
|
|
106
107
|
*/
|
|
107
|
-
export declare function ChartDashboard({ tiles, columns, className }: ChartDashboardProps): React.JSX.Element | null;
|
|
108
|
+
export declare function ChartDashboard({ tiles, columns, layoutRef, className }: ChartDashboardProps): React.JSX.Element | null;
|
|
108
109
|
/** @wildo_source:part:start saas.frontend.chart-dashboard-view facet:layer:frontend facet:family:view facet:audience:app-developer */
|
|
109
110
|
/**
|
|
110
111
|
* A whole composite view that is a chart dashboard, declared as data — register it under the frontend domain module's
|
|
@@ -126,6 +127,8 @@ export declare function ChartDashboard({ tiles, columns, className }: ChartDashb
|
|
|
126
127
|
*/
|
|
127
128
|
export declare function defineChartDashboardView(config: {
|
|
128
129
|
tiles: readonly ChartDashboardTile[];
|
|
130
|
+
columns?: ChartDashboardColumns;
|
|
131
|
+
layoutRef?: string;
|
|
129
132
|
} & Omit<CompositeViewAuthoringConfig, 'viewComponent'>): CompositeViewAuthoringConfig;
|
|
130
133
|
/** @wildo_source:part:end saas.frontend.chart-dashboard-view */
|
|
131
134
|
//# sourceMappingURL=ChartDashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartDashboard.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-dashboard/ChartDashboard.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ChartDashboard.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-dashboard/ChartDashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAa,MAAM,uBAAuB,CAAC;AAMlG,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,wDAAwD,CAAC;AAShE,iIAAiI;AACjI;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,mDAAmD;IACnD,GAAG,QAAQ;IACX;;;OAGG;IACH,KAAK,UAAU;IACf,8FAA8F;IAC9F,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,iHAAiH;IACjH,YAAY,EAAE,MAAM,CAAC;IACrB,uGAAuG;IACvG,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,oGAAoG;IACpG,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,qFAAqF;IACrF,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrC,sFAAsF;IACtF,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAoC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAmCnJ;AAoDD,sIAAsI;AACtI;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE;IAAE,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,4BAA4B,EAAE,eAAe,CAAC,GAC1J,4BAA4B,CAU9B;AACD,gEAAgE"}
|
|
@@ -14,9 +14,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
* A tile may be a FIGURE as well as a drawing: a chart view whose chart is a `ChartType.KPI` (a count, a sum, a rate over
|
|
15
15
|
* the whole scope, its query grouping by nothing) renders as one number (`ChartKpiFigure`). It is declared, fetched,
|
|
16
16
|
* authorized and hidden exactly as a chart tile, because it IS a chart: one resource's declared aggregation (#2299).
|
|
17
|
+
*
|
|
18
|
+
* A dashboard given a `layoutRef` may be ARRANGED per organization (#2299): the organization's administrators reorder,
|
|
19
|
+
* resize and hide its tiles, stored as the organization's `organizationDashboardLayouts` row for that ref, and every
|
|
20
|
+
* member sees the arrangement. The arrangement only rearranges the declared tiles ({@link arrangeChartDashboardTiles}),
|
|
21
|
+
* and the read gate runs after it, so no arrangement shows a chart its viewer may not read.
|
|
17
22
|
*/
|
|
18
23
|
import { useMemo } from 'react';
|
|
19
|
-
import { ChartType } from '@wildo-ai/saas-models';
|
|
24
|
+
import { ChartDashboardTileRows, ChartDashboardTileSpan, ChartType } from '@wildo-ai/saas-models';
|
|
20
25
|
import { NavigationViewLabelFamily, TypographyVariant } from '@wildo-ai/presets-components-models';
|
|
21
26
|
import { cn } from '../../../core/ui/cn.js';
|
|
22
27
|
import { useI18n } from '../../../core/i18n/useI18n.js';
|
|
@@ -27,28 +32,10 @@ import { Text } from '../../../components/typography/text.js';
|
|
|
27
32
|
import { EmbedChart } from '../../../components/resources/embeds/ResourceEmbeds.js';
|
|
28
33
|
import { CompositeLayout } from '../../../components/views/composite-view/CompositeLayout.js';
|
|
29
34
|
import { viewerMayReadChart } from './chart-dashboard.utils.js';
|
|
35
|
+
import { arrangeChartDashboardTiles, defaultChartDashboardTileHeight } from './chart-dashboard-layout.utils.js';
|
|
36
|
+
import { ChartDashboardLayoutReadState, useChartDashboardLayout } from './useChartDashboardLayout.js';
|
|
37
|
+
import { ChartDashboardLayoutControl } from './ChartDashboardLayoutEditor.js';
|
|
30
38
|
/** @wildo_source:part:start saas.frontend.chart-dashboard facet:layer:frontend facet:family:view facet:audience:app-developer */
|
|
31
|
-
/** How many grid columns a dashboard tile spans, where the dashboard is wide enough to have them. */
|
|
32
|
-
export var ChartDashboardTileSpan;
|
|
33
|
-
(function (ChartDashboardTileSpan) {
|
|
34
|
-
/** One column (the default): a donut, a bar of a few categories. */
|
|
35
|
-
ChartDashboardTileSpan["ONE"] = "one";
|
|
36
|
-
/** Two columns: a trend over time, a bar of many categories. One column where the dashboard has one. */
|
|
37
|
-
ChartDashboardTileSpan["TWO"] = "two";
|
|
38
|
-
/** The whole row: a long timeline, a wide table-like chart. */
|
|
39
|
-
ChartDashboardTileSpan["FULL"] = "full";
|
|
40
|
-
})(ChartDashboardTileSpan || (ChartDashboardTileSpan = {}));
|
|
41
|
-
/** How many grid rows a dashboard tile spans, where the dashboard has more than one column. */
|
|
42
|
-
export var ChartDashboardTileRows;
|
|
43
|
-
(function (ChartDashboardTileRows) {
|
|
44
|
-
/** One row (the default). */
|
|
45
|
-
ChartDashboardTileRows["ONE"] = "one";
|
|
46
|
-
/**
|
|
47
|
-
* Two rows: a large chart beside two smaller ones stacked in the next column. Place it right after the first
|
|
48
|
-
* small tile, so the second small tile flows into the row beneath the first: `[small, large (TWO rows), small]`.
|
|
49
|
-
*/
|
|
50
|
-
ChartDashboardTileRows["TWO"] = "two";
|
|
51
|
-
})(ChartDashboardTileRows || (ChartDashboardTileRows = {}));
|
|
52
39
|
/**
|
|
53
40
|
* The most columns a dashboard's grid reaches, as its container widens. Every dashboard is one column in a narrow pane.
|
|
54
41
|
*/
|
|
@@ -78,6 +65,11 @@ export var ChartDashboardColumns;
|
|
|
78
65
|
*
|
|
79
66
|
* A KPI tile (a chart view whose chart is `ChartType.KPI`) shows one figure under that title, hidden by the same rule.
|
|
80
67
|
*
|
|
68
|
+
* With a `layoutRef`, the current organization's stored arrangement applies first (order, sizes, hidden tiles); the read
|
|
69
|
+
* gate then applies to what is left. An administrator who may arrange it gets a "customize" button above the grid,
|
|
70
|
+
* opening the layout editor, and keeps it even when every tile is hidden. The grid waits for the arrangement to be read,
|
|
71
|
+
* and a read that fails shows the declared layout.
|
|
72
|
+
*
|
|
81
73
|
* Place it inside a composite view (`CompositeLayout`), or declare a whole view as one with
|
|
82
74
|
* {@link defineChartDashboardView}.
|
|
83
75
|
*
|
|
@@ -92,21 +84,26 @@ export var ChartDashboardColumns;
|
|
|
92
84
|
* />
|
|
93
85
|
* ```
|
|
94
86
|
*/
|
|
95
|
-
export function ChartDashboard({ tiles, columns = ChartDashboardColumns.FOUR, className }) {
|
|
87
|
+
export function ChartDashboard({ tiles, columns = ChartDashboardColumns.FOUR, layoutRef, className }) {
|
|
96
88
|
const { registry } = useResourceRegistry();
|
|
97
89
|
const viewer = useViewerEffectiveRoles();
|
|
98
|
-
const
|
|
90
|
+
const layout = useChartDashboardLayout(layoutRef, viewer);
|
|
91
|
+
const arrangedTiles = useMemo(() => arrangeChartDashboardTiles(tiles, layout.stored?.tiles).filter((entry) => !entry.hidden).map((entry) => entry.tile), [tiles, layout.stored]);
|
|
92
|
+
const visibleTiles = useMemo(() => arrangedTiles.flatMap((tile) => {
|
|
99
93
|
const chartView = registry.resourceConfigurations[tile.resourceType]?.frontendConfiguration?.chartViews
|
|
100
94
|
?.find((candidate) => candidate.ref === tile.chartViewRef);
|
|
101
95
|
// An unknown chart is an authoring error, and `EmbedChart` throws it with the resource and ref named.
|
|
102
96
|
if (chartView !== undefined && !viewerMayReadChart(chartView.chartDefinition, registry, viewer))
|
|
103
97
|
return [];
|
|
104
98
|
return [{ tile, isFigure: chartView?.chartDefinition.chartType === ChartType.KPI }];
|
|
105
|
-
}), [
|
|
106
|
-
if (
|
|
99
|
+
}), [arrangedTiles, registry, viewer]);
|
|
100
|
+
if (layout.readState === ChartDashboardLayoutReadState.LOADING)
|
|
101
|
+
return null;
|
|
102
|
+
// An administrator keeps the editor even when nothing is left to show: they may have hidden every tile.
|
|
103
|
+
if (visibleTiles.length === 0 && !layout.canEdit)
|
|
107
104
|
return null;
|
|
108
105
|
const grid = GRID_CLASSES[columns];
|
|
109
|
-
return (
|
|
106
|
+
return (_jsxs("div", { className: cn('@container flex w-full flex-col gap-element', className), "data-chart-dashboard": true, children: [layout.canEdit && _jsx(ChartDashboardLayoutControl, { tiles: tiles, layout: layout }), visibleTiles.length > 0 && (_jsx("div", { className: cn('grid grid-cols-1 gap-group', grid.columns), children: visibleTiles.map(({ tile, isFigure }) => (_jsx(ChartDashboardTileCell, { tile: tile, isFigure: isFigure, grid: grid }, `${tile.resourceType}:${tile.chartViewRef}`))) }))] }));
|
|
110
107
|
}
|
|
111
108
|
const GRID_CLASSES = {
|
|
112
109
|
[ChartDashboardColumns.TWO]: { columns: '@2xl:grid-cols-2', spanTwo: '@2xl:col-span-2', rowsTwo: '@2xl:row-span-2' },
|
|
@@ -117,13 +114,10 @@ function tileSpanClasses(tile, grid) {
|
|
|
117
114
|
const span = tile.span ?? ChartDashboardTileSpan.ONE;
|
|
118
115
|
return cn(span === ChartDashboardTileSpan.TWO && grid.spanTwo, span === ChartDashboardTileSpan.FULL && 'col-span-full', tile.rows === ChartDashboardTileRows.TWO && grid.rowsTwo);
|
|
119
116
|
}
|
|
120
|
-
const DEFAULT_TILE_HEIGHT = 280;
|
|
121
|
-
/** A KPI tile's loading placeholder: about one line of the figure, so the tile does not jump when it arrives. */
|
|
122
|
-
const DEFAULT_FIGURE_TILE_HEIGHT = 64;
|
|
123
117
|
function ChartDashboardTileCell({ tile, isFigure, grid }) {
|
|
124
118
|
const { tView } = useI18n();
|
|
125
119
|
const heading = tView(NavigationViewLabelFamily.CHART, `resources.${tile.resourceType}.${tile.chartViewRef}`, 'title');
|
|
126
|
-
return (_jsxs("section", { className: cn('flex min-w-0 flex-col gap-element', tileSpanClasses(tile, grid)), "data-chart-dashboard-tile": `${tile.resourceType}:${tile.chartViewRef}`, "data-chart-dashboard-figure": isFigure ? '' : undefined, children: [heading && (_jsx(Text, { as: "div", typography: TypographyVariant.EYEBROW, children: heading })), _jsx(EmbedChart, { resourceType: tile.resourceType, viewRef: tile.chartViewRef, height: tile.height ?? (isFigure
|
|
120
|
+
return (_jsxs("section", { className: cn('flex min-w-0 flex-col gap-element', tileSpanClasses(tile, grid)), "data-chart-dashboard-tile": `${tile.resourceType}:${tile.chartViewRef}`, "data-chart-dashboard-figure": isFigure ? '' : undefined, children: [heading && (_jsx(Text, { as: "div", typography: TypographyVariant.EYEBROW, children: heading })), _jsx(EmbedChart, { resourceType: tile.resourceType, viewRef: tile.chartViewRef, height: tile.height ?? defaultChartDashboardTileHeight(isFigure, tile.rows) })] }));
|
|
127
121
|
}
|
|
128
122
|
/** @wildo_source:part:start saas.frontend.chart-dashboard-view facet:layer:frontend facet:family:view facet:audience:app-developer */
|
|
129
123
|
/**
|
|
@@ -145,9 +139,9 @@ function ChartDashboardTileCell({ tile, isFigure, grid }) {
|
|
|
145
139
|
* ```
|
|
146
140
|
*/
|
|
147
141
|
export function defineChartDashboardView(config) {
|
|
148
|
-
const { tiles, ...compositeConfig } = config;
|
|
142
|
+
const { tiles, columns, layoutRef, ...compositeConfig } = config;
|
|
149
143
|
function ChartDashboardView() {
|
|
150
|
-
return (_jsx(CompositeLayout, { children: _jsx(ChartDashboard, { tiles: tiles }) }));
|
|
144
|
+
return (_jsx(CompositeLayout, { children: _jsx(ChartDashboard, { tiles: tiles, columns: columns, layoutRef: layoutRef }) }));
|
|
151
145
|
}
|
|
152
146
|
return defineCompositeView(ChartDashboardView, compositeConfig);
|
|
153
147
|
}
|