@epilot/zenith-react 0.2.0 → 0.3.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +278 -0
- package/codemods/README.md +5 -3
- package/codemods/migrate/volt/field-combobox.ts +37 -0
- package/codemods/migrate/volt/index.ts +2 -0
- package/codemods/migrate/volt/same-name.ts +2 -17
- package/codemods/radix-to-base-ui.ts +4 -1
- package/dist/_virtual/_zenith-runtime-family_autocomplete.js +7 -0
- package/dist/_virtual/_zenith-runtime-family_autocomplete.js.map +1 -0
- package/dist/components/callout/callout.js +0 -1
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/command/command.js +263 -179
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/field/field-combobox.js +213 -177
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +281 -247
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list-sortable.js +86 -72
- package/dist/components/list/list-sortable.js.map +1 -1
- package/dist/components/list/list.js +206 -205
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +10 -11
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +91 -256
- package/dist/index.js +120 -119
- package/dist/renderer/runtime-contract.generated.js +4 -4
- package/dist/renderer/runtime-contract.generated.js.map +1 -1
- package/package.json +39 -4
- package/dist/vendor/.bun/@radix-ui_primitive@1.1.3/vendor/@radix-ui/primitive/dist/index.js +0 -10
- package/dist/vendor/.bun/@radix-ui_primitive@1.1.3/vendor/@radix-ui/primitive/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-compose-refs@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-compose-refs/dist/index.js +0 -30
- package/dist/vendor/.bun/@radix-ui_react-compose-refs@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-compose-refs/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-context@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-context/dist/index.js +0 -71
- package/dist/vendor/.bun/@radix-ui_react-context@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-context/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js +0 -258
- package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-dismissable-layer@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/vendor/.bun/@radix-ui_react-dismissable-layer@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-dismissable-layer/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-focus-guards@1.1.3_0ac650c021fb1b59/vendor/@radix-ui/react-focus-guards/dist/index.js +0 -18
- package/dist/vendor/.bun/@radix-ui_react-focus-guards@1.1.3_0ac650c021fb1b59/vendor/@radix-ui/react-focus-guards/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-focus-scope@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-focus-scope/dist/index.js +0 -138
- package/dist/vendor/.bun/@radix-ui_react-focus-scope@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-focus-scope/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-id@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-id/dist/index.js +0 -14
- package/dist/vendor/.bun/@radix-ui_react-id@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-id/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-portal@1.1.9_2b23df507bdda662/vendor/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/vendor/.bun/@radix-ui_react-portal@1.1.9_2b23df507bdda662/vendor/@radix-ui/react-portal/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-presence@1.1.5_2b23df507bdda662/vendor/@radix-ui/react-presence/dist/index.js +0 -72
- package/dist/vendor/.bun/@radix-ui_react-presence@1.1.5_2b23df507bdda662/vendor/@radix-ui/react-presence/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-primitive@2.1.3_2b23df507bdda662/vendor/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/vendor/.bun/@radix-ui_react-primitive@2.1.3_2b23df507bdda662/vendor/@radix-ui/react-primitive/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js +0 -51
- package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-callback-ref@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-callback-ref/dist/index.js +0 -14
- package/dist/vendor/.bun/@radix-ui_react-use-callback-ref@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-callback-ref/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-controllable-state@1.2.2_0ac650c021fb1b59/vendor/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/vendor/.bun/@radix-ui_react-use-controllable-state@1.2.2_0ac650c021fb1b59/vendor/@radix-ui/react-use-controllable-state/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-escape-keydown@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-escape-keydown/dist/index.js +0 -15
- package/dist/vendor/.bun/@radix-ui_react-use-escape-keydown@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-escape-keydown/dist/index.js.map +0 -1
- package/dist/vendor/.bun/@radix-ui_react-use-layout-effect@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
- package/dist/vendor/.bun/@radix-ui_react-use-layout-effect@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-layout-effect/dist/index.js.map +0 -1
- package/dist/vendor/.bun/aria-hidden@1.2.6/vendor/aria-hidden/dist/es2015/index.js +0 -53
- package/dist/vendor/.bun/aria-hidden@1.2.6/vendor/aria-hidden/dist/es2015/index.js.map +0 -1
- package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/chunk-NZJY6EH4.js +0 -18
- package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/chunk-NZJY6EH4.js.map +0 -1
- package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/index.js +0 -313
- package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/index.js.map +0 -1
- package/dist/vendor/.bun/get-nonce@1.0.1/vendor/get-nonce/dist/es2015/index.js +0 -8
- package/dist/vendor/.bun/get-nonce@1.0.1/vendor/get-nonce/dist/es2015/index.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/component.js +0 -72
- package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/component.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/constants.js +0 -8
- package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/constants.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/utils.js +0 -26
- package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/utils.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/Combination.js +0 -12
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/Combination.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/SideEffect.js +0 -116
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/SideEffect.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/UI.js +0 -32
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/UI.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -17
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/handleScroll.js +0 -69
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/handleScroll.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/medium.js +0 -6
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/medium.js.map +0 -1
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/sidecar.js +0 -8
- package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/sidecar.js.map +0 -1
- package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/component.js +0 -12
- package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/component.js.map +0 -1
- package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/hook.js +0 -16
- package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/hook.js.map +0 -1
- package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/singleton.js +0 -31
- package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/singleton.js.map +0 -1
- package/dist/vendor/.bun/tslib@2.8.1/vendor/tslib/tslib.es6.js +0 -28
- package/dist/vendor/.bun/tslib@2.8.1/vendor/tslib/tslib.es6.js.map +0 -1
- package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/assignRef.js +0 -7
- package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/assignRef.js.map +0 -1
- package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useMergeRef.js +0 -27
- package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useMergeRef.js.map +0 -1
- package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useRef.js +0 -26
- package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useRef.js.map +0 -1
- package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/exports.js +0 -19
- package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/exports.js.map +0 -1
- package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/medium.js +0 -68
- package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/medium.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../../src/components/list/list.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * `relaxed` is a permanent compatibility alias for `normal` (DENSITY-SPEC.md §4.2,\n * WP9B2A-ACCEPTANCE-LIST) — identical geometry, forever, not deprecated.\n */\nexport type ListDensity = \"compact\" | \"normal\" | \"comfortable\" | \"relaxed\"\nexport type ListItemStatus = \"default\" | \"error\" | \"warning\" | \"success\"\n\n// ── Icons ──────────────────────────────────────────────────────────────────\n\nconst GripVerticalIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n {...props}\n >\n <circle cx=\"9\" cy=\"5\" r=\"1.5\" />\n <circle cx=\"15\" cy=\"5\" r=\"1.5\" />\n <circle cx=\"9\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"15\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"9\" cy=\"19\" r=\"1.5\" />\n <circle cx=\"15\" cy=\"19\" r=\"1.5\" />\n </svg>\n)\n\nconst WarningIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z\" />\n <line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\" />\n <line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\" />\n </svg>\n)\n\nconst CheckCircleIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\" />\n <polyline points=\"22 4 12 14.01 9 11.01\" />\n </svg>\n)\n\nconst ChevronRightIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n)\n\n// ── Styles ─────────────────────────────────────────────────────────────────\n\nexport const useListStyles = makeZenithStyles({\n list: {\n ...boxModel,\n display: \"flex\",\n width: \"100%\",\n listStyleType: \"none\",\n flexDirection: \"column\",\n ...shorthands.gap(0),\n ...shorthands.padding(0),\n ...shorthands.margin(0),\n },\n\n // ListItem base — density-bound (DENSITY-SPEC.md §2.2, WP9B2A-ACCEPTANCE-LIST).\n item: {\n ...boxModel,\n position: \"relative\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n ...shorthands.borderRadius(tokens.radiusMd),\n color: tokens.grayA12,\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n minHeight: tokens.listItemMinHeight,\n ...shorthands.gap(tokens.listItemGap),\n ...shorthands.padding(tokens.listItemPaddingY, tokens.listItemPaddingX),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n \"& > svg\": {\n flexShrink: 0,\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n\n // Status variants\n statusDefault: {},\n statusError: {\n backgroundColor: tokens.errorSoft,\n color: tokens.errorDefault,\n },\n statusWarning: {\n backgroundColor: tokens.warningSoft,\n color: tokens.warningDefault,\n },\n statusSuccess: {\n backgroundColor: tokens.successSoft,\n color: tokens.successDefault,\n },\n\n // Striped variant (only neutral rows)\n stripedEven: {\n \"&:nth-child(even)\": {\n backgroundColor: tokens.grayA2,\n },\n },\n\n // Interactive hovers\n interactiveDefault: {\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n },\n interactiveError: {\n \":hover\": {\n backgroundColor: tokens.errorSoftHover,\n },\n },\n interactiveWarning: {\n \":hover\": {\n backgroundColor: tokens.warningSoftHover,\n },\n },\n interactiveSuccess: {\n \":hover\": {\n backgroundColor: tokens.successSoftHover,\n },\n },\n\n // Sortable modifiers\n sortableItem: {\n cursor: \"grab\",\n touchAction: \"none\",\n \":active\": {\n cursor: \"grabbing\",\n },\n },\n itemDragging: {\n opacity: 0.4,\n },\n\n // Index gutter — density-bound.\n indexBase: {\n ...boxModel,\n display: \"flex\",\n flexShrink: 0,\n userSelect: \"none\",\n alignItems: \"center\",\n justifyContent: \"center\",\n alignSelf: \"stretch\",\n borderTopLeftRadius: tokens.radiusMd,\n borderBottomLeftRadius: tokens.radiusMd,\n backgroundColor: tokens.grayA2,\n textAlign: \"center\",\n color: tokens.grayA11,\n fontVariantNumeric: \"tabular-nums\",\n minWidth: tokens.listIndexMinWidth,\n marginTop: `calc(-1 * ${tokens.listItemPaddingY})`,\n marginBottom: `calc(-1 * ${tokens.listItemPaddingY})`,\n marginLeft: `calc(-1 * ${tokens.listItemPaddingX})`,\n paddingLeft: tokens.listIndexPaddingX,\n paddingRight: tokens.listIndexPaddingX,\n },\n\n // Content\n content: {\n ...boxModel,\n display: \"flex\",\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n \"& > svg\": {\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n },\n },\n\n // Actions\n actions: {\n position: \"relative\",\n zIndex: 10,\n display: \"flex\",\n flexShrink: 0,\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement1),\n },\n\n // Text\n text: {\n ...boxModel,\n display: \"flex\",\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n flexDirection: \"column\",\n ...shorthands.gap(\"0.125rem\"),\n },\n\n // Description\n description: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n color: tokens.grayA11,\n },\n\n // Drag handle button\n dragHandle: {\n ...boxModel,\n position: \"relative\",\n zIndex: 10,\n display: \"inline-flex\",\n flexShrink: 0,\n cursor: \"grab\",\n alignItems: \"center\",\n color: tokens.grayA8,\n backgroundColor: \"transparent\",\n ...shorthands.border(\"0\"),\n ...shorthands.padding(0),\n \":hover\": {\n color: tokens.grayA11,\n },\n \":active\": {\n cursor: \"grabbing\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n \"& svg\": {\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n\n // Drop indicator line\n dropIndicator: {\n ...boxModel,\n pointerEvents: \"none\",\n position: \"absolute\",\n left: 0,\n right: 0,\n zIndex: 10,\n height: \"0.125rem\",\n transformOrigin: \"center\",\n ...shorthands.borderRadius(\"9999px\"),\n backgroundColor: tokens.accentSolid,\n animationName: {\n from: {\n transform: \"scaleX(0)\",\n opacity: 0,\n },\n to: {\n transform: \"scaleX(1)\",\n opacity: 1,\n },\n },\n animationDuration: \"160ms\",\n animationTimingFunction: \"ease-out\",\n },\n dropIndicatorTop: {\n top: \"-0.125rem\",\n },\n dropIndicatorBottom: {\n bottom: \"-0.125rem\",\n },\n\n // DragOverlay ghost\n dragOverlayItem: {\n ...boxModel,\n transformOrigin: \"center\",\n transform: \"scale(0.95)\",\n cursor: \"grabbing\",\n ...shorthands.border(\"1px\", \"solid\", tokens.grayA5),\n backgroundColor: \"rgb(255 255 255 / 55%)\",\n boxShadow: \"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a\",\n backdropFilter: \"blur(12px)\",\n animationName: {\n from: { transform: \"scale(1)\" },\n to: { transform: \"scale(0.95)\" },\n },\n animationDuration: \"160ms\",\n animationTimingFunction: \"ease-out\",\n \":hover\": {\n backgroundColor: \"rgb(255 255 255 / 55%)\",\n },\n },\n\n // Group\n group: {\n listStyleType: \"none\",\n },\n groupTrigger: {\n ...boxModel,\n cursor: \"pointer\",\n textAlign: \"left\",\n fontWeight: tokens.fontWeightMedium,\n backgroundColor: \"transparent\",\n ...shorthands.border(\"0\"),\n },\n groupChevron: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.grayA10,\n transitionProperty: \"transform\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n },\n groupChevronOpen: {\n transform: \"rotate(90deg)\",\n },\n groupTriggerText: {\n ...boxModel,\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n standaloneGroupLabel: {\n ...boxModel,\n marginTop: tokens.spacingGroup2,\n display: \"block\",\n listStyleType: \"none\",\n ...shorthands.padding(\"0.375rem\", tokens.spacingElement3),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayA12,\n \"&:first-child\": {\n marginTop: 0,\n },\n },\n groupContentList: {\n ...boxModel,\n paddingLeft: tokens.spacingGroup2,\n },\n collapseWrapper: {\n display: \"grid\",\n gridTemplateRows: \"0fr\",\n transitionProperty: \"grid-template-rows\",\n transitionDuration: \"200ms\",\n transitionTimingFunction: \"cubic-bezier(0, 0, 0.2, 1)\",\n \"&[data-state='open']\": {\n gridTemplateRows: \"1fr\",\n },\n },\n collapseWrapperOpen: {\n gridTemplateRows: \"1fr\",\n },\n collapseInner: {\n ...boxModel,\n minHeight: 0,\n overflow: \"hidden\",\n },\n\n // Status icons\n statusIconError: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.errorLight,\n },\n statusIconWarning: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.warningLight,\n },\n statusIconSuccess: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.successLight,\n },\n})\n\n// ── Status Icons Helper ────────────────────────────────────────────────────\n\nconst StatusIcon = ({ status }: { status: ListItemStatus }) => {\n const styles = useListStyles()\n if (status === \"error\") {\n return <WarningIcon className={styles.statusIconError} />\n }\n if (status === \"warning\") {\n return <WarningIcon className={styles.statusIconWarning} />\n }\n if (status === \"success\") {\n return <CheckCircleIcon className={styles.statusIconSuccess} />\n }\n return null\n}\n\n// ── Context ────────────────────────────────────────────────────────────────\n\n/**\n * `density` is deliberately NOT here — every downstream consumer (`ListItemBody`,\n * `ListGroupLabel`'s collapsible-trigger branch) now reads geometry from CSS custom properties via\n * `[data-density]` inheritance, not from this context.\n */\nexport type ListContextValue = {\n striped: boolean\n showIndex: boolean\n /** Set only by `SortableList` (`@epilot/zenith-react/list/sortable`). */\n sortable: boolean\n /**\n * The drag-aware row `SortableList` supplies. The root entry never imports dnd-kit, so `ListItem`\n * cannot name it; it renders whatever the surrounding `SortableList` put here.\n */\n SortableItem?: React.ForwardRefExoticComponent<\n ListItemProps & React.RefAttributes<HTMLLIElement>\n >\n}\n\n/** Internal: shared with `list-sortable.tsx`, deliberately not exported from the package index. */\nexport const listContext = React.createContext<ListContextValue>({\n striped: false,\n showIndex: false,\n sortable: false,\n})\n\nconst useListContext = () => React.useContext(listContext)\n\n/**\n * `undefined` (density omitted) stays `undefined` — no implicit normal stamp, so the `<ol>`\n * inherits ambient CSS density through ordinary DOM inheritance.\n */\nexport const canonicalDomDensity = (\n density: ListDensity | undefined\n): \"compact\" | \"normal\" | \"comfortable\" | undefined =>\n density === undefined ? undefined : density === \"relaxed\" ? \"normal\" : density\n\n// ── List ───────────────────────────────────────────────────────────────────\n\nexport type ListProps = React.ComponentProps<\"ol\"> & {\n /**\n * Row density. Omitted inherits the ambient shell `[data-density]` (no stamp is written).\n * `\"relaxed\"` is a permanent alias for `\"normal\"` — identical geometry, normalized to\n * `data-density=\"normal\"` in the DOM. An explicit value (including `\"relaxed\"`) creates a\n * canonical density boundary for this list's subtree and its `DragOverlay`.\n */\n density?: ListDensity\n /** Alternating background on neutral rows. Default: false */\n striped?: boolean\n /** Show a 1-based position number on each item. Default: false */\n showIndex?: boolean\n}\n\n/**\n * Internal: the `<ol>` itself, with the index injected into each `ListItem`. Shared by `List` and\n * `SortableList` so both render identical markup; the context provider stays with the caller.\n */\nexport const ListRoot = React.forwardRef<\n HTMLOListElement,\n Omit<ListProps, \"striped\" | \"showIndex\">\n>(function ListRoot({ className, density, children, ...props }, ref) {\n const styles = useListStyles()\n const domDensity = canonicalDomDensity(density)\n\n const indexedItems = React.Children.toArray(children)\n .filter(React.isValidElement)\n .map((child, index) =>\n child.type === ListItem\n ? React.cloneElement(child as React.ReactElement<ListItemProps>, {\n index,\n })\n : child\n )\n\n return (\n <ol\n ref={ref}\n data-slot=\"list\"\n {...{ [SLOT_ATTR]: \"list\" }}\n {...(domDensity !== undefined ? { \"data-density\": domDensity } : {})}\n className={mergeClasses(styles.list, className)}\n {...props}\n >\n {indexedItems}\n </ol>\n )\n})\n\nexport const List = React.forwardRef<HTMLOListElement, ListProps>(function List(\n { striped = false, showIndex = false, ...props },\n ref\n) {\n return (\n <listContext.Provider value={{ striped, showIndex, sortable: false }}>\n <ListRoot ref={ref} {...props} />\n </listContext.Provider>\n )\n})\n\n// ── ListItemActions ────────────────────────────────────────────────────────\n\nexport type ListItemActionsProps = React.ComponentProps<\"span\">\n\nexport const ListItemActions = React.forwardRef<\n HTMLSpanElement,\n ListItemActionsProps\n>(function ListItemActions({ className, children, ...props }, ref) {\n const styles = useListStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"list-item-actions\"\n {...{ [SLOT_ATTR]: \"list-item-actions\" }}\n onPointerDown={(e) => e.stopPropagation()}\n className={mergeClasses(styles.actions, className)}\n {...props}\n >\n {children}\n </span>\n )\n})\n\n// ── ListItemText ───────────────────────────────────────────────────────────\n\nexport type ListItemTextProps = React.ComponentProps<\"span\">\n\nexport const ListItemText = React.forwardRef<\n HTMLSpanElement,\n ListItemTextProps\n>(function ListItemText({ className, ...props }, ref) {\n const styles = useListStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"list-item-text\"\n {...{ [SLOT_ATTR]: \"list-item-text\" }}\n className={mergeClasses(styles.text, className)}\n {...props}\n />\n )\n})\n\n// ── ListItemDescription ────────────────────────────────────────────────────\n\nexport type ListItemDescriptionProps = React.ComponentProps<\"span\">\n\nexport const ListItemDescription = React.forwardRef<\n HTMLSpanElement,\n ListItemDescriptionProps\n>(function ListItemDescription({ className, ...props }, ref) {\n const styles = useListStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"list-item-description\"\n {...{ [SLOT_ATTR]: \"list-item-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n />\n )\n})\n\n// ── ListItemBody ───────────────────────────────────────────────────────────\n\nexport type ListItemProps = React.ComponentProps<\"li\"> & {\n /** Stable id used for drag-and-drop. Required on every item of a `SortableList`. */\n value?: string\n /** System status. Tints the row and shows a trailing status icon. */\n status?: ListItemStatus\n /** Injected by `List` — the 0-based position. */\n index?: number\n}\n\n/** The slice of dnd-kit's activator listeners a row uses; typed here so this module stays dnd-free. */\nexport type ListItemDragListeners = {\n onPointerDown?: React.PointerEventHandler<HTMLLIElement>\n onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>\n}\n\nexport type ListItemBodyProps = ListItemProps & {\n setNodeRef?: (node: HTMLElement | null) => void\n setActivatorNodeRef?: (node: HTMLElement | null) => void\n style?: React.CSSProperties\n isDragging?: boolean\n /** Insertion indicator edge while another item is dragged over this one. */\n dropEdge?: \"top\" | \"bottom\" | null\n /** dnd-kit listeners — pointer activation goes on the row, keyboard on the handle. */\n listeners?: ListItemDragListeners\n /** dnd-kit a11y attributes for the keyboard drag handle. */\n attributes?: React.ButtonHTMLAttributes<HTMLButtonElement>\n}\n\nexport const ListItemBody = React.forwardRef<HTMLLIElement, ListItemBodyProps>(\n function ListItemBody(\n {\n className,\n value,\n status = \"default\",\n index,\n children,\n setNodeRef,\n setActivatorNodeRef,\n style,\n isDragging,\n dropEdge,\n listeners,\n attributes,\n ...props\n },\n forwardedRef\n ) {\n const styles = useListStyles()\n const { striped, showIndex, sortable } = useListContext()\n const interactive = sortable && !isDragging\n\n const childArray = React.Children.toArray(children)\n const actionsSlot = childArray.find(\n (child): child is React.ReactElement =>\n React.isValidElement(child) && child.type === ListItemActions\n )\n const contentChildren = childArray.filter((child) => child !== actionsSlot)\n\n // Combined ref for dnd-kit setNodeRef + caller's forwardedRef\n const handleRef = React.useCallback(\n (node: HTMLLIElement | null) => {\n setNodeRef?.(node)\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n ;(\n forwardedRef as React.MutableRefObject<HTMLLIElement | null>\n ).current = node\n }\n },\n [setNodeRef, forwardedRef]\n )\n\n const statusStyle =\n status === \"error\"\n ? styles.statusError\n : status === \"warning\"\n ? styles.statusWarning\n : status === \"success\"\n ? styles.statusSuccess\n : styles.statusDefault\n\n const interactiveStyle = interactive\n ? status === \"error\"\n ? styles.interactiveError\n : status === \"warning\"\n ? styles.interactiveWarning\n : status === \"success\"\n ? styles.interactiveSuccess\n : styles.interactiveDefault\n : undefined\n\n return (\n <li\n ref={handleRef}\n style={style}\n data-slot=\"list-item\"\n {...{ [SLOT_ATTR]: \"list-item\" }}\n data-status={status}\n data-value={value}\n onPointerDown={sortable ? listeners?.onPointerDown : undefined}\n className={mergeClasses(\n styles.item,\n statusStyle,\n striped && status === \"default\" && styles.stripedEven,\n interactiveStyle,\n sortable && styles.sortableItem,\n isDragging && styles.itemDragging,\n className\n )}\n {...props}\n >\n {dropEdge && (\n <span\n data-slot=\"list-drop-indicator\"\n {...{ [SLOT_ATTR]: \"list-drop-indicator\" }}\n aria-hidden=\"true\"\n className={mergeClasses(\n styles.dropIndicator,\n dropEdge === \"top\"\n ? styles.dropIndicatorTop\n : styles.dropIndicatorBottom\n )}\n />\n )}\n\n {showIndex && (\n <span\n data-slot=\"list-item-index\"\n {...{ [SLOT_ATTR]: \"list-item-index\" }}\n aria-hidden=\"true\"\n className={styles.indexBase}\n >\n {(index ?? 0) + 1}\n </span>\n )}\n\n <span\n data-slot=\"list-item-content\"\n {...{ [SLOT_ATTR]: \"list-item-content\" }}\n className={styles.content}\n >\n {contentChildren}\n </span>\n\n <StatusIcon status={status} />\n\n {actionsSlot}\n\n {sortable && (\n <button\n ref={setActivatorNodeRef}\n type=\"button\"\n aria-label={`Drag to reorder ${value ?? \"item\"}`}\n className={styles.dragHandle}\n {...attributes}\n onKeyDown={listeners?.onKeyDown}\n >\n <GripVerticalIcon />\n </button>\n )}\n </li>\n )\n }\n)\n\n// ── ListItem ───────────────────────────────────────────────────────────────\n\nexport const ListItem = React.forwardRef<HTMLLIElement, ListItemProps>(\n function ListItem(props, ref) {\n const { SortableItem } = useListContext()\n\n if (SortableItem) {\n return <SortableItem ref={ref} {...props} />\n }\n\n return <ListItemBody ref={ref} {...props} />\n }\n)\n\n// ── ListGroup ──────────────────────────────────────────────────────────────\n\ntype ListGroupContextValue = {\n open: boolean\n setOpen: (open: boolean) => void\n contentId: string\n}\n\nconst ListGroupContext = React.createContext<ListGroupContextValue | null>(null)\n\nexport type ListGroupProps = Omit<React.ComponentProps<\"li\">, \"onChange\"> & {\n /** Controlled open state of the collapsible group. */\n open?: boolean\n /** Initial open state when uncontrolled. Default: false */\n defaultOpen?: boolean\n /** Called when the group is expanded or collapsed. */\n onOpenChange?: (open: boolean) => void\n}\n\nexport const ListGroup = React.forwardRef<HTMLLIElement, ListGroupProps>(\n function ListGroup(\n {\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n className,\n children,\n ...props\n },\n ref\n ) {\n const styles = useListStyles()\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolledOpen\n const contentId = React.useId()\n\n const setOpen = (next: boolean) => {\n if (openProp === undefined) setUncontrolledOpen(next)\n onOpenChange?.(next)\n }\n\n return (\n <ListGroupContext.Provider value={{ open, setOpen, contentId }}>\n <li\n ref={ref}\n data-slot=\"list-group\"\n {...{ [SLOT_ATTR]: \"list-group\" }}\n data-state={open ? \"open\" : \"closed\"}\n className={mergeClasses(styles.group, className)}\n {...props}\n >\n {children}\n </li>\n </ListGroupContext.Provider>\n )\n }\n)\n\n// ── ListGroupLabel ─────────────────────────────────────────────────────────\n\nexport type ListGroupLabelProps = React.ComponentProps<\"button\"> & {\n asListItem?: boolean\n}\n\nexport const ListGroupLabel = React.forwardRef<\n HTMLElement,\n ListGroupLabelProps\n>(function ListGroupLabel({ className, children, ...props }, ref) {\n const styles = useListStyles()\n const group = React.useContext(ListGroupContext)\n\n if (group) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n data-slot=\"list-group-trigger\"\n {...{ [SLOT_ATTR]: \"list-group-trigger\" }}\n aria-expanded={group.open}\n aria-controls={group.contentId}\n onClick={() => group.setOpen(!group.open)}\n className={mergeClasses(\n styles.item,\n styles.interactiveDefault,\n styles.groupTrigger,\n className\n )}\n {...props}\n >\n <ChevronRightIcon\n className={mergeClasses(\n styles.groupChevron,\n group.open && styles.groupChevronOpen\n )}\n />\n <span className={styles.groupTriggerText}>{children}</span>\n </button>\n )\n }\n\n return (\n <li\n ref={ref as React.Ref<HTMLLIElement>}\n data-slot=\"list-group-label\"\n {...{ [SLOT_ATTR]: \"list-group-label\" }}\n className={mergeClasses(styles.standaloneGroupLabel, className)}\n >\n {children}\n </li>\n )\n})\n\n// ── ListGroupContent ───────────────────────────────────────────────────────\n\nexport type ListGroupContentProps = React.ComponentProps<\"ul\">\n\nexport const ListGroupContent = React.forwardRef<\n HTMLUListElement,\n ListGroupContentProps\n>(function ListGroupContent({ className, children, ...props }, ref) {\n const styles = useListStyles()\n const group = React.useContext(ListGroupContext)\n\n const items = (\n <ul\n ref={ref}\n data-slot=\"list-group-content\"\n {...{ [SLOT_ATTR]: \"list-group-content\" }}\n className={mergeClasses(styles.list, styles.groupContentList, className)}\n {...props}\n >\n {children}\n </ul>\n )\n\n if (!group) return items\n\n return (\n <div\n id={group.contentId}\n data-state={group.open ? \"open\" : \"closed\"}\n className={mergeClasses(\n styles.collapseWrapper,\n group.open && styles.collapseWrapperOpen\n )}\n >\n <div className={styles.collapseInner}>{items}</div>\n </div>\n )\n})\n"],"names":["GripVerticalIcon","props","jsxs","jsx","WarningIcon","CheckCircleIcon","ChevronRightIcon","useListStyles","makeZenithStyles","boxModel","shorthands","tokens.radiusMd","tokens.grayA12","tokens.listItemMinHeight","tokens.listItemGap","tokens.listItemPaddingY","tokens.listItemPaddingX","tokens.textSm","tokens.leadingSm","tokens.errorSoft","tokens.errorDefault","tokens.warningSoft","tokens.warningDefault","tokens.successSoft","tokens.successDefault","tokens.grayA2","tokens.accentSoft","tokens.errorSoftHover","tokens.warningSoftHover","tokens.successSoftHover","tokens.grayA11","tokens.listIndexMinWidth","tokens.listIndexPaddingX","tokens.spacingElement2","tokens.spacingElement1","tokens.textXs","tokens.leadingXs","tokens.grayA8","tokens.accentA8","tokens.accentSolid","tokens.grayA5","tokens.fontWeightMedium","tokens.grayA10","tokens.spacingGroup2","tokens.spacingElement3","tokens.fontWeightSemibold","tokens.errorLight","tokens.warningLight","tokens.successLight","StatusIcon","status","styles","listContext","React","useListContext","canonicalDomDensity","density","ListRoot","className","children","ref","domDensity","indexedItems","child","index","ListItem","SLOT_ATTR","mergeClasses","List","striped","showIndex","ListItemActions","e","ListItemText","ListItemDescription","ListItemBody","value","setNodeRef","setActivatorNodeRef","style","isDragging","dropEdge","listeners","attributes","forwardedRef","sortable","interactive","childArray","actionsSlot","contentChildren","handleRef","node","statusStyle","interactiveStyle","SortableItem","ListGroupContext","ListGroup","openProp","defaultOpen","onOpenChange","uncontrolledOpen","setUncontrolledOpen","open","contentId","setOpen","next","ListGroupLabel","group","ListGroupContent","items"],"mappings":";;;;;;AAiBA,MAAMA,KAAmB,CAACC,MACxB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,eAAY;AAAA,IACX,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM;AAAA,wBAC7B,UAAA,EAAO,IAAG,MAAK,IAAG,KAAI,GAAE,OAAM;AAAA,wBAC9B,UAAA,EAAO,IAAG,KAAI,IAAG,MAAK,GAAE,OAAM;AAAA,wBAC9B,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,OAAM;AAAA,wBAC/B,UAAA,EAAO,IAAG,KAAI,IAAG,MAAK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,aAAU;AAAA,MACJ,CAACM,CAAS,GAAG;AAAA,MACnB,WAAWC,EAAahB,EAAO,MAAMA,EAAO,kBAAkBO,CAAS;AAAA,MACtE,GAAGzD;AAAA,MAEH,UAAA0D;AAAA,IAAA;AAAA,EAAA;AAIL,SAAKgD,IAGH,gBAAAxG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAIwG,EAAM;AAAA,MACV,cAAYA,EAAM,OAAO,SAAS;AAAA,MAClC,WAAWxC;AAAA,QACThB,EAAO;AAAA,QACPwD,EAAM,QAAQxD,EAAO;AAAA,MAAA;AAAA,MAGvB,UAAA,gBAAAhD,EAAC,OAAA,EAAI,WAAWgD,EAAO,eAAgB,UAAA0D,EAAA,CAAM;AAAA,IAAA;AAAA,EAAA,IAX9BA;AAcrB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"list.js","sources":["../../../src/components/list/list.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * `relaxed` is a permanent compatibility alias for `normal` (DENSITY-SPEC.md §4.2,\n * WP9B2A-ACCEPTANCE-LIST) — identical geometry, forever, not deprecated.\n */\nexport type ListDensity = \"compact\" | \"normal\" | \"comfortable\" | \"relaxed\"\nexport type ListItemStatus = \"default\" | \"error\" | \"warning\" | \"success\"\n\n// ── Icons ──────────────────────────────────────────────────────────────────\n\nconst GripVerticalIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n {...props}\n >\n <circle cx=\"9\" cy=\"5\" r=\"1.5\" />\n <circle cx=\"15\" cy=\"5\" r=\"1.5\" />\n <circle cx=\"9\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"15\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"9\" cy=\"19\" r=\"1.5\" />\n <circle cx=\"15\" cy=\"19\" r=\"1.5\" />\n </svg>\n)\n\nconst WarningIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z\" />\n <line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\" />\n <line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\" />\n </svg>\n)\n\nconst CheckCircleIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\" />\n <polyline points=\"22 4 12 14.01 9 11.01\" />\n </svg>\n)\n\nconst ChevronRightIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n)\n\n// ── Styles ─────────────────────────────────────────────────────────────────\n\nexport const useListStyles = makeZenithStyles({\n list: {\n ...boxModel,\n display: \"flex\",\n width: \"100%\",\n listStyleType: \"none\",\n flexDirection: \"column\",\n ...shorthands.gap(0),\n ...shorthands.padding(0),\n ...shorthands.margin(0),\n },\n\n // ListItem base — density-bound (DENSITY-SPEC.md §2.2, WP9B2A-ACCEPTANCE-LIST).\n item: {\n ...boxModel,\n position: \"relative\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n ...shorthands.borderRadius(tokens.radiusMd),\n color: tokens.grayA12,\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n minHeight: tokens.listItemMinHeight,\n ...shorthands.gap(tokens.listItemGap),\n ...shorthands.padding(tokens.listItemPaddingY, tokens.listItemPaddingX),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n \"& > svg\": {\n flexShrink: 0,\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n\n // Status variants\n statusDefault: {},\n statusError: {\n backgroundColor: tokens.errorSoft,\n color: tokens.errorDefault,\n },\n statusWarning: {\n backgroundColor: tokens.warningSoft,\n color: tokens.warningDefault,\n },\n statusSuccess: {\n backgroundColor: tokens.successSoft,\n color: tokens.successDefault,\n },\n\n // Striped variant (only neutral rows)\n stripedEven: {\n \"&:nth-child(even)\": {\n backgroundColor: tokens.grayA2,\n },\n },\n\n // Interactive hovers\n interactiveDefault: {\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n },\n interactiveError: {\n \":hover\": {\n backgroundColor: tokens.errorSoftHover,\n },\n },\n interactiveWarning: {\n \":hover\": {\n backgroundColor: tokens.warningSoftHover,\n },\n },\n interactiveSuccess: {\n \":hover\": {\n backgroundColor: tokens.successSoftHover,\n },\n },\n\n // Sortable modifiers\n sortableItem: {\n cursor: \"grab\",\n touchAction: \"none\",\n \":active\": {\n cursor: \"grabbing\",\n },\n },\n itemDragging: {\n opacity: 0.4,\n },\n\n // Index gutter — density-bound.\n indexBase: {\n ...boxModel,\n display: \"flex\",\n flexShrink: 0,\n userSelect: \"none\",\n alignItems: \"center\",\n justifyContent: \"center\",\n alignSelf: \"stretch\",\n borderTopLeftRadius: tokens.radiusMd,\n borderBottomLeftRadius: tokens.radiusMd,\n backgroundColor: tokens.grayA2,\n textAlign: \"center\",\n color: tokens.grayA11,\n fontVariantNumeric: \"tabular-nums\",\n minWidth: tokens.listIndexMinWidth,\n marginTop: `calc(-1 * ${tokens.listItemPaddingY})`,\n marginBottom: `calc(-1 * ${tokens.listItemPaddingY})`,\n marginLeft: `calc(-1 * ${tokens.listItemPaddingX})`,\n paddingLeft: tokens.listIndexPaddingX,\n paddingRight: tokens.listIndexPaddingX,\n },\n\n // Content\n content: {\n ...boxModel,\n display: \"flex\",\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n \"& > svg\": {\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n },\n },\n\n // Actions\n actions: {\n position: \"relative\",\n zIndex: 10,\n display: \"flex\",\n flexShrink: 0,\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement1),\n },\n\n // Text\n text: {\n ...boxModel,\n display: \"flex\",\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n flexDirection: \"column\",\n ...shorthands.gap(\"0.125rem\"),\n },\n\n // Description\n description: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n color: tokens.grayA11,\n },\n\n // Drag handle button\n dragHandle: {\n ...boxModel,\n position: \"relative\",\n zIndex: 10,\n display: \"inline-flex\",\n flexShrink: 0,\n cursor: \"grab\",\n alignItems: \"center\",\n color: tokens.grayA8,\n backgroundColor: \"transparent\",\n ...shorthands.border(\"0\"),\n ...shorthands.padding(0),\n \":hover\": {\n color: tokens.grayA11,\n },\n \":active\": {\n cursor: \"grabbing\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n \"& svg\": {\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n\n // Drop indicator line\n dropIndicator: {\n ...boxModel,\n pointerEvents: \"none\",\n position: \"absolute\",\n left: 0,\n right: 0,\n zIndex: 10,\n height: \"0.125rem\",\n transformOrigin: \"center\",\n ...shorthands.borderRadius(\"9999px\"),\n backgroundColor: tokens.accentSolid,\n animationName: {\n from: {\n transform: \"scaleX(0)\",\n opacity: 0,\n },\n to: {\n transform: \"scaleX(1)\",\n opacity: 1,\n },\n },\n animationDuration: \"160ms\",\n animationTimingFunction: \"ease-out\",\n },\n dropIndicatorTop: {\n top: \"-0.125rem\",\n },\n dropIndicatorBottom: {\n bottom: \"-0.125rem\",\n },\n\n // DragOverlay ghost\n dragOverlayItem: {\n ...boxModel,\n transformOrigin: \"center\",\n transform: \"scale(0.95)\",\n cursor: \"grabbing\",\n ...shorthands.border(\"1px\", \"solid\", tokens.grayA5),\n backgroundColor: \"rgb(255 255 255 / 55%)\",\n boxShadow: \"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a\",\n backdropFilter: \"blur(12px)\",\n animationName: {\n from: { transform: \"scale(1)\" },\n to: { transform: \"scale(0.95)\" },\n },\n animationDuration: \"160ms\",\n animationTimingFunction: \"ease-out\",\n \":hover\": {\n backgroundColor: \"rgb(255 255 255 / 55%)\",\n },\n },\n\n // Group\n group: {\n listStyleType: \"none\",\n },\n groupTrigger: {\n ...boxModel,\n cursor: \"pointer\",\n textAlign: \"left\",\n fontWeight: tokens.fontWeightMedium,\n backgroundColor: \"transparent\",\n ...shorthands.border(\"0\"),\n },\n groupChevron: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.grayA10,\n transitionProperty: \"transform\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n },\n groupChevronOpen: {\n transform: \"rotate(90deg)\",\n },\n groupTriggerText: {\n ...boxModel,\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n standaloneGroupLabel: {\n ...boxModel,\n marginTop: tokens.spacingGroup2,\n display: \"block\",\n listStyleType: \"none\",\n ...shorthands.padding(\"0.375rem\", tokens.spacingElement3),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayA12,\n \"&:first-child\": {\n marginTop: 0,\n },\n },\n groupContentList: {\n ...boxModel,\n paddingLeft: tokens.spacingGroup2,\n },\n collapseWrapper: {\n display: \"grid\",\n gridTemplateRows: \"0fr\",\n transitionProperty: \"grid-template-rows\",\n transitionDuration: \"200ms\",\n transitionTimingFunction: \"cubic-bezier(0, 0, 0.2, 1)\",\n \"&[data-state='open']\": {\n gridTemplateRows: \"1fr\",\n },\n },\n collapseWrapperOpen: {\n gridTemplateRows: \"1fr\",\n },\n collapseInner: {\n ...boxModel,\n minHeight: 0,\n overflow: \"hidden\",\n },\n\n // Status icons\n statusIconError: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.errorLight,\n },\n statusIconWarning: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.warningLight,\n },\n statusIconSuccess: {\n ...boxModel,\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n color: tokens.successLight,\n },\n})\n\n// ── Status Icons Helper ────────────────────────────────────────────────────\n\nconst StatusIcon = ({ status }: { status: ListItemStatus }) => {\n const styles = useListStyles()\n if (status === \"error\") {\n return <WarningIcon className={styles.statusIconError} />\n }\n if (status === \"warning\") {\n return <WarningIcon className={styles.statusIconWarning} />\n }\n if (status === \"success\") {\n return <CheckCircleIcon className={styles.statusIconSuccess} />\n }\n return null\n}\n\n// ── Context ────────────────────────────────────────────────────────────────\n\n/**\n * `density` is deliberately NOT here — every downstream consumer (`ListItemBody`,\n * `ListGroupLabel`'s collapsible-trigger branch) now reads geometry from CSS custom properties via\n * `[data-density]` inheritance, not from this context.\n */\nexport type ListContextValue = {\n striped: boolean\n showIndex: boolean\n /** Set only by `SortableList` (`@epilot/zenith-react/list/sortable`). */\n sortable: boolean\n /**\n * The drag-aware row `SortableList` supplies. The root entry never imports dnd-kit, so `ListItem`\n * cannot name it; it renders whatever the surrounding `SortableList` put here.\n */\n SortableItem?: React.ForwardRefExoticComponent<\n ListItemProps & React.RefAttributes<HTMLLIElement>\n >\n}\n\n/** Internal: shared with `list-sortable.tsx`, deliberately not exported from the package index. */\nexport const listContext = React.createContext<ListContextValue>({\n striped: false,\n showIndex: false,\n sortable: false,\n})\n\nconst useListContext = () => React.useContext(listContext)\n\n/**\n * `undefined` (density omitted) stays `undefined` — no implicit normal stamp, so the `<ol>`\n * inherits ambient CSS density through ordinary DOM inheritance.\n */\nexport const canonicalDomDensity = (\n density: ListDensity | undefined\n): \"compact\" | \"normal\" | \"comfortable\" | undefined =>\n density === undefined ? undefined : density === \"relaxed\" ? \"normal\" : density\n\n// ── List ───────────────────────────────────────────────────────────────────\n\nexport type ListProps = React.ComponentProps<\"ol\"> & {\n /**\n * Row density. Omitted inherits the ambient shell `[data-density]` (no stamp is written).\n * `\"relaxed\"` is a permanent alias for `\"normal\"` — identical geometry, normalized to\n * `data-density=\"normal\"` in the DOM. An explicit value (including `\"relaxed\"`) creates a\n * canonical density boundary for this list's subtree and its `DragOverlay`.\n */\n density?: ListDensity\n /** Alternating background on neutral rows. Default: false */\n striped?: boolean\n /** Show a 1-based position number on each item. Default: false */\n showIndex?: boolean\n}\n\n/**\n * Internal: the `<ol>` itself, with the index injected into each `ListItem`. Shared by `List` and\n * `SortableList` so both render identical markup; the context provider stays with the caller.\n */\nexport const ListRoot = React.forwardRef<\n HTMLOListElement,\n Omit<ListProps, \"striped\" | \"showIndex\">\n>(function ListRoot({ className, density, children, ...props }, ref) {\n const styles = useListStyles()\n const domDensity = canonicalDomDensity(density)\n\n const indexedItems = React.Children.toArray(children)\n .filter(React.isValidElement)\n .map((child, index) =>\n child.type === ListItem\n ? React.cloneElement(child as React.ReactElement<ListItemProps>, {\n index,\n })\n : child\n )\n\n return (\n <ol\n ref={ref}\n data-slot=\"list\"\n {...{ [SLOT_ATTR]: \"list\" }}\n {...(domDensity !== undefined ? { \"data-density\": domDensity } : {})}\n className={mergeClasses(styles.list, className)}\n {...props}\n >\n {indexedItems}\n </ol>\n )\n})\n\nexport const List = React.forwardRef<HTMLOListElement, ListProps>(function List(\n { striped = false, showIndex = false, ...props },\n ref\n) {\n return (\n <listContext.Provider value={{ striped, showIndex, sortable: false }}>\n <ListRoot ref={ref} {...props} />\n </listContext.Provider>\n )\n})\n\n// ── ListItemActions ────────────────────────────────────────────────────────\n\nexport type ListItemActionsProps = React.ComponentProps<\"span\">\n\nexport const ListItemActions = React.forwardRef<\n HTMLSpanElement,\n ListItemActionsProps\n>(function ListItemActions({ className, children, ...props }, ref) {\n const styles = useListStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"list-item-actions\"\n {...{ [SLOT_ATTR]: \"list-item-actions\" }}\n onPointerDown={(e) => e.stopPropagation()}\n className={mergeClasses(styles.actions, className)}\n {...props}\n >\n {children}\n </span>\n )\n})\n\n// ── ListItemText ───────────────────────────────────────────────────────────\n\nexport type ListItemTextProps = React.ComponentProps<\"span\">\n\nexport const ListItemText = React.forwardRef<\n HTMLSpanElement,\n ListItemTextProps\n>(function ListItemText({ className, ...props }, ref) {\n const styles = useListStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"list-item-text\"\n {...{ [SLOT_ATTR]: \"list-item-text\" }}\n className={mergeClasses(styles.text, className)}\n {...props}\n />\n )\n})\n\n// ── ListItemDescription ────────────────────────────────────────────────────\n\nexport type ListItemDescriptionProps = React.ComponentProps<\"span\">\n\nexport const ListItemDescription = React.forwardRef<\n HTMLSpanElement,\n ListItemDescriptionProps\n>(function ListItemDescription({ className, ...props }, ref) {\n const styles = useListStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"list-item-description\"\n {...{ [SLOT_ATTR]: \"list-item-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n />\n )\n})\n\n// ── ListItemBody ───────────────────────────────────────────────────────────\n\n/**\n * The row's own text, leaving out its description line and anything hidden from assistive technology.\n */\nconst getPrimaryText = (node: React.ReactNode): string =>\n React.Children.toArray(node)\n .map((child) => {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return String(child)\n }\n if (\n !React.isValidElement<{\n children?: React.ReactNode\n \"aria-hidden\"?: React.AriaAttributes[\"aria-hidden\"]\n }>(child) ||\n child.type === ListItemDescription ||\n child.props[\"aria-hidden\"] === true ||\n child.props[\"aria-hidden\"] === \"true\"\n ) {\n return \"\"\n }\n return getPrimaryText(child.props.children)\n })\n .join(\" \")\n .replace(/\\s+/g, \" \")\n .trim()\n\nexport type ListItemProps = React.ComponentProps<\"li\"> & {\n /** Stable id used for drag-and-drop. Required on every item of a `SortableList`. */\n value?: string\n /** Names the row for assistive technology, such as its drag handle. Default: the row's text, then its `value`. */\n textValue?: string\n /** System status. Tints the row and shows a trailing status icon. */\n status?: ListItemStatus\n /** Injected by `List` — the 0-based position. */\n index?: number\n}\n\n/** The slice of dnd-kit's activator listeners a row uses; typed here so this module stays dnd-free. */\nexport type ListItemDragListeners = {\n onPointerDown?: React.PointerEventHandler<HTMLLIElement>\n onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>\n}\n\nexport type ListItemBodyProps = ListItemProps & {\n setNodeRef?: (node: HTMLElement | null) => void\n setActivatorNodeRef?: (node: HTMLElement | null) => void\n style?: React.CSSProperties\n isDragging?: boolean\n /** Insertion indicator edge while another item is dragged over this one. */\n dropEdge?: \"top\" | \"bottom\" | null\n /** dnd-kit listeners — pointer activation goes on the row, keyboard on the handle. */\n listeners?: ListItemDragListeners\n /** dnd-kit a11y attributes for the keyboard drag handle. */\n attributes?: React.ButtonHTMLAttributes<HTMLButtonElement>\n}\n\nexport const ListItemBody = React.forwardRef<HTMLLIElement, ListItemBodyProps>(\n function ListItemBody(\n {\n className,\n value,\n textValue,\n status = \"default\",\n index,\n children,\n setNodeRef,\n setActivatorNodeRef,\n style,\n isDragging,\n dropEdge,\n listeners,\n attributes,\n ...props\n },\n forwardedRef\n ) {\n const styles = useListStyles()\n const { striped, showIndex, sortable } = useListContext()\n const interactive = sortable && !isDragging\n\n const childArray = React.Children.toArray(children)\n const actionsSlot = childArray.find(\n (child): child is React.ReactElement =>\n React.isValidElement(child) && child.type === ListItemActions\n )\n const contentChildren = childArray.filter((child) => child !== actionsSlot)\n const name =\n textValue ?? (getPrimaryText(contentChildren) || value || \"item\")\n\n // Combined ref for dnd-kit setNodeRef + caller's forwardedRef\n const handleRef = React.useCallback(\n (node: HTMLLIElement | null) => {\n setNodeRef?.(node)\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n ;(\n forwardedRef as React.MutableRefObject<HTMLLIElement | null>\n ).current = node\n }\n },\n [setNodeRef, forwardedRef]\n )\n\n const statusStyle =\n status === \"error\"\n ? styles.statusError\n : status === \"warning\"\n ? styles.statusWarning\n : status === \"success\"\n ? styles.statusSuccess\n : styles.statusDefault\n\n const interactiveStyle = interactive\n ? status === \"error\"\n ? styles.interactiveError\n : status === \"warning\"\n ? styles.interactiveWarning\n : status === \"success\"\n ? styles.interactiveSuccess\n : styles.interactiveDefault\n : undefined\n\n return (\n <li\n ref={handleRef}\n style={style}\n data-slot=\"list-item\"\n {...{ [SLOT_ATTR]: \"list-item\" }}\n data-status={status}\n data-value={value}\n onPointerDown={sortable ? listeners?.onPointerDown : undefined}\n className={mergeClasses(\n styles.item,\n statusStyle,\n striped && status === \"default\" && styles.stripedEven,\n interactiveStyle,\n sortable && styles.sortableItem,\n isDragging && styles.itemDragging,\n className\n )}\n {...props}\n >\n {dropEdge && (\n <span\n data-slot=\"list-drop-indicator\"\n {...{ [SLOT_ATTR]: \"list-drop-indicator\" }}\n aria-hidden=\"true\"\n className={mergeClasses(\n styles.dropIndicator,\n dropEdge === \"top\"\n ? styles.dropIndicatorTop\n : styles.dropIndicatorBottom\n )}\n />\n )}\n\n {showIndex && (\n <span\n data-slot=\"list-item-index\"\n {...{ [SLOT_ATTR]: \"list-item-index\" }}\n aria-hidden=\"true\"\n className={styles.indexBase}\n >\n {(index ?? 0) + 1}\n </span>\n )}\n\n <span\n data-slot=\"list-item-content\"\n {...{ [SLOT_ATTR]: \"list-item-content\" }}\n className={styles.content}\n >\n {contentChildren}\n </span>\n\n <StatusIcon status={status} />\n\n {actionsSlot}\n\n {sortable && (\n <button\n ref={setActivatorNodeRef}\n type=\"button\"\n aria-label={`Drag to reorder ${name}`}\n className={styles.dragHandle}\n {...attributes}\n onKeyDown={listeners?.onKeyDown}\n >\n <GripVerticalIcon />\n </button>\n )}\n </li>\n )\n }\n)\n\n// ── ListItem ───────────────────────────────────────────────────────────────\n\nexport const ListItem = React.forwardRef<HTMLLIElement, ListItemProps>(\n function ListItem(props, ref) {\n const { SortableItem } = useListContext()\n\n if (SortableItem) {\n return <SortableItem ref={ref} {...props} />\n }\n\n return <ListItemBody ref={ref} {...props} />\n }\n)\n\n// ── ListGroup ──────────────────────────────────────────────────────────────\n\ntype ListGroupContextValue = {\n open: boolean\n setOpen: (open: boolean) => void\n contentId: string\n}\n\nconst ListGroupContext = React.createContext<ListGroupContextValue | null>(null)\n\nexport type ListGroupProps = Omit<React.ComponentProps<\"li\">, \"onChange\"> & {\n /** Controlled open state of the collapsible group. */\n open?: boolean\n /** Initial open state when uncontrolled. Default: false */\n defaultOpen?: boolean\n /** Called when the group is expanded or collapsed. */\n onOpenChange?: (open: boolean) => void\n}\n\nexport const ListGroup = React.forwardRef<HTMLLIElement, ListGroupProps>(\n function ListGroup(\n {\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n className,\n children,\n ...props\n },\n ref\n ) {\n const styles = useListStyles()\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolledOpen\n const contentId = React.useId()\n\n const setOpen = (next: boolean) => {\n if (openProp === undefined) setUncontrolledOpen(next)\n onOpenChange?.(next)\n }\n\n return (\n <ListGroupContext.Provider value={{ open, setOpen, contentId }}>\n <li\n ref={ref}\n data-slot=\"list-group\"\n {...{ [SLOT_ATTR]: \"list-group\" }}\n data-state={open ? \"open\" : \"closed\"}\n className={mergeClasses(styles.group, className)}\n {...props}\n >\n {children}\n </li>\n </ListGroupContext.Provider>\n )\n }\n)\n\n// ── ListGroupLabel ─────────────────────────────────────────────────────────\n\nexport type ListGroupLabelProps = React.ComponentProps<\"button\"> & {\n asListItem?: boolean\n}\n\nexport const ListGroupLabel = React.forwardRef<\n HTMLElement,\n ListGroupLabelProps\n>(function ListGroupLabel({ className, children, ...props }, ref) {\n const styles = useListStyles()\n const group = React.useContext(ListGroupContext)\n\n if (group) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n data-slot=\"list-group-trigger\"\n {...{ [SLOT_ATTR]: \"list-group-trigger\" }}\n aria-expanded={group.open}\n aria-controls={group.contentId}\n onClick={() => group.setOpen(!group.open)}\n className={mergeClasses(\n styles.item,\n styles.interactiveDefault,\n styles.groupTrigger,\n className\n )}\n {...props}\n >\n <ChevronRightIcon\n className={mergeClasses(\n styles.groupChevron,\n group.open && styles.groupChevronOpen\n )}\n />\n <span className={styles.groupTriggerText}>{children}</span>\n </button>\n )\n }\n\n return (\n <li\n ref={ref as React.Ref<HTMLLIElement>}\n data-slot=\"list-group-label\"\n {...{ [SLOT_ATTR]: \"list-group-label\" }}\n className={mergeClasses(styles.standaloneGroupLabel, className)}\n >\n {children}\n </li>\n )\n})\n\n// ── ListGroupContent ───────────────────────────────────────────────────────\n\nexport type ListGroupContentProps = React.ComponentProps<\"ul\">\n\nexport const ListGroupContent = React.forwardRef<\n HTMLUListElement,\n ListGroupContentProps\n>(function ListGroupContent({ className, children, ...props }, ref) {\n const styles = useListStyles()\n const group = React.useContext(ListGroupContext)\n\n const items = (\n <ul\n ref={ref}\n data-slot=\"list-group-content\"\n {...{ [SLOT_ATTR]: \"list-group-content\" }}\n className={mergeClasses(styles.list, styles.groupContentList, className)}\n {...props}\n >\n {children}\n </ul>\n )\n\n if (!group) return items\n\n return (\n <div\n id={group.contentId}\n data-state={group.open ? \"open\" : \"closed\"}\n className={mergeClasses(\n styles.collapseWrapper,\n group.open && styles.collapseWrapperOpen\n )}\n >\n <div className={styles.collapseInner}>{items}</div>\n </div>\n )\n})\n"],"names":["GripVerticalIcon","props","jsxs","jsx","WarningIcon","CheckCircleIcon","ChevronRightIcon","useListStyles","makeZenithStyles","boxModel","shorthands","tokens.radiusMd","tokens.grayA12","tokens.listItemMinHeight","tokens.listItemGap","tokens.listItemPaddingY","tokens.listItemPaddingX","tokens.textSm","tokens.leadingSm","tokens.errorSoft","tokens.errorDefault","tokens.warningSoft","tokens.warningDefault","tokens.successSoft","tokens.successDefault","tokens.grayA2","tokens.accentSoft","tokens.errorSoftHover","tokens.warningSoftHover","tokens.successSoftHover","tokens.grayA11","tokens.listIndexMinWidth","tokens.listIndexPaddingX","tokens.spacingElement2","tokens.spacingElement1","tokens.textXs","tokens.leadingXs","tokens.grayA8","tokens.accentA8","tokens.accentSolid","tokens.grayA5","tokens.fontWeightMedium","tokens.grayA10","tokens.spacingGroup2","tokens.spacingElement3","tokens.fontWeightSemibold","tokens.errorLight","tokens.warningLight","tokens.successLight","StatusIcon","status","styles","listContext","React","useListContext","canonicalDomDensity","density","ListRoot","className","children","ref","domDensity","indexedItems","child","index","ListItem","SLOT_ATTR","mergeClasses","List","striped","showIndex","ListItemActions","e","ListItemText","ListItemDescription","getPrimaryText","node","ListItemBody","value","textValue","setNodeRef","setActivatorNodeRef","style","isDragging","dropEdge","listeners","attributes","forwardedRef","sortable","interactive","childArray","actionsSlot","contentChildren","name","handleRef","statusStyle","interactiveStyle","SortableItem","ListGroupContext","ListGroup","openProp","defaultOpen","onOpenChange","uncontrolledOpen","setUncontrolledOpen","open","contentId","setOpen","next","ListGroupLabel","group","ListGroupContent","items"],"mappings":";;;;;;AAiBA,MAAMA,KAAmB,CAACC,MACxB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,eAAY;AAAA,IACX,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM;AAAA,wBAC7B,UAAA,EAAO,IAAG,MAAK,IAAG,KAAI,GAAE,OAAM;AAAA,wBAC9B,UAAA,EAAO,IAAG,KAAI,IAAG,MAAK,GAAE,OAAM;AAAA,wBAC9B,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,OAAM;AAAA,wBAC/B,UAAA,EAAO,IAAG,KAAI,IAAG,MAAK,GAAE,OAAM;AAAA,wBAC9B,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,MAAA,CAAM;AAAA,IAAA;AAAA,EAAA;AAClC,GAGIC,IAAc,CAACH,MACnB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,eAAY;AAAA,IACX,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,2FAAA,CAA2F;AAAA,MACnG,gBAAAA,EAAC,UAAK,IAAG,MAAK,IAAG,KAAI,IAAG,MAAK,IAAG,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AAO,MAAMA,EAAO,kBAAkBO,CAAS;AAAA,MACtE,GAAGzD;AAAA,MAEH,UAAA0D;AAAA,IAAA;AAAA,EAAA;AAIL,SAAKmD,IAGH,gBAAA3G;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI2G,EAAM;AAAA,MACV,cAAYA,EAAM,OAAO,SAAS;AAAA,MAClC,WAAW3C;AAAA,QACThB,EAAO;AAAA,QACP2D,EAAM,QAAQ3D,EAAO;AAAA,MAAA;AAAA,MAGvB,UAAA,gBAAAhD,EAAC,OAAA,EAAI,WAAWgD,EAAO,eAAgB,UAAA6D,EAAA,CAAM;AAAA,IAAA;AAAA,EAAA,IAX9BA;AAcrB,CAAC;"}
|
|
@@ -37,7 +37,6 @@ const B = ft({
|
|
|
37
37
|
fontSize: Pt,
|
|
38
38
|
// v1 leading-none; no line-height token exists.
|
|
39
39
|
lineHeight: "1",
|
|
40
|
-
textWrap: "balance",
|
|
41
40
|
zIndex: J,
|
|
42
41
|
"&[data-variant='default']": {
|
|
43
42
|
backgroundColor: Q,
|
|
@@ -252,7 +251,7 @@ const Ut = t.forwardRef(function({ asChild: e = !1, children: n, className: r, .
|
|
|
252
251
|
id: k,
|
|
253
252
|
...P
|
|
254
253
|
}, g) {
|
|
255
|
-
const s = B(), f = rt("TooltipContent"), w = t.useContext(nt), V = ut(), it = pt(), X = t.useRef(null), [A, at] = t.useState(null), st = yt(g, at), { open: H, closeOnEscape:
|
|
254
|
+
const s = B(), f = rt("TooltipContent"), w = t.useContext(nt), V = ut(), it = pt(), X = t.useRef(null), [A, at] = t.useState(null), st = yt(g, at), { open: H, closeOnEscape: Y } = f;
|
|
256
255
|
t.useEffect(() => {
|
|
257
256
|
if (!H || !A) return;
|
|
258
257
|
const l = A;
|
|
@@ -261,15 +260,15 @@ const Ut = t.forwardRef(function({ asChild: e = !1, children: n, className: r, .
|
|
|
261
260
|
function K(m) {
|
|
262
261
|
if (m.key !== "Escape" || m.defaultPrevented || m.isComposing || T[T.length - 1] !== l) return;
|
|
263
262
|
const M = m.target;
|
|
264
|
-
!(M instanceof Node) || l.contains(M) || !(l.compareDocumentPosition(M) & Node.DOCUMENT_POSITION_PRECEDING) || (m.preventDefault(),
|
|
263
|
+
!(M instanceof Node) || l.contains(M) || !(l.compareDocumentPosition(M) & Node.DOCUMENT_POSITION_PRECEDING) || (m.preventDefault(), Y(m));
|
|
265
264
|
}
|
|
266
265
|
return F.addEventListener("keydown", K, !0), () => {
|
|
267
266
|
F.removeEventListener("keydown", K, !0), T.splice(T.indexOf(l), 1);
|
|
268
267
|
};
|
|
269
|
-
}, [H, A,
|
|
270
|
-
const N = k ?? f.generatedId, L = P["aria-label"],
|
|
271
|
-
t.useEffect(() => (_(
|
|
272
|
-
const
|
|
268
|
+
}, [H, A, Y]);
|
|
269
|
+
const N = k ?? f.generatedId, L = P["aria-label"], $ = `${N}-label`, j = L ? $ : N, { setDescriptionId: _ } = f;
|
|
270
|
+
t.useEffect(() => (_(j), () => _(void 0)), [j, _]);
|
|
271
|
+
const G = L && /* @__PURE__ */ i("span", { id: $, hidden: !0, children: L }), W = !a && /* @__PURE__ */ i(
|
|
273
272
|
c.Arrow,
|
|
274
273
|
{
|
|
275
274
|
ref: X,
|
|
@@ -283,14 +282,14 @@ const Ut = t.forwardRef(function({ asChild: e = !1, children: n, className: r, .
|
|
|
283
282
|
D,
|
|
284
283
|
void 0,
|
|
285
284
|
D.props.children,
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
G,
|
|
286
|
+
W
|
|
288
287
|
)
|
|
289
288
|
} : {
|
|
290
289
|
children: /* @__PURE__ */ ct(dt, { children: [
|
|
291
290
|
r,
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
G,
|
|
292
|
+
W
|
|
294
293
|
] })
|
|
295
294
|
}, Z = /* @__PURE__ */ i(
|
|
296
295
|
c.Positioner,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n nativeTrigger: {\n ...nativeControl,\n },\n positioner: {\n zIndex: OVERLAY_Z_INDEX,\n },\n // Radix's `hideWhenDetached`: hide the content once its trigger is scrolled out of view.\n hideWhenDetached: {\n \"&[data-anchor-hidden]\": {\n visibility: \"hidden\",\n pointerEvents: \"none\",\n },\n },\n // No enter or exit motion: the Radix version keyed its keyframes on `data-state='open'`, a value\n // Radix's tooltip never sets (it sets `delayed-open` or `instant-open`), so it never animated.\n popup: {\n ...boxModel,\n width: \"fit-content\",\n transformOrigin: \"var(--transform-origin)\",\n ...shorthands.borderRadius(tokens.radiusLg),\n ...shorthands.padding(tokens.spacingElement2),\n // v1 shadow-md; elevation has no token in this package.\n boxShadow: \"0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a\",\n fontSize: tokens.textXs,\n // v1 leading-none; no line-height token exists.\n lineHeight: \"1\",\n textWrap: \"balance\",\n zIndex: OVERLAY_Z_INDEX,\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n color: tokens.gray1,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.errorA12,\n color: tokens.error1,\n },\n },\n // Base UI places the arrow on the cross axis only; the anchored edge is set per side here. The\n // diamond's centre sits 2px inside the content's edge, where Radix's arrow wrapper put it.\n arrow: {\n ...boxModel,\n zIndex: 50,\n width: \"0.625rem\",\n height: \"0.625rem\",\n ...shorthands.borderRadius(\"2px\"),\n \"&[data-side='top']\": {\n top: \"100%\",\n transform: \"translateY(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='bottom']\": {\n top: 0,\n transform: \"translateY(calc(-50% + 2px)) rotate(45deg)\",\n },\n \"&[data-side='left']\": {\n left: \"100%\",\n transform: \"translateX(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='right']\": {\n left: 0,\n transform: \"translateX(calc(-50% + 2px)) rotate(45deg)\",\n },\n // Radix hid the arrow when it could not point at the trigger's centre.\n \"&[data-uncentered]\": {\n visibility: \"hidden\",\n },\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.error12,\n },\n },\n})\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\nfunction useMergedRef<T>(a: React.Ref<T> | undefined, b: React.Ref<T>) {\n return React.useCallback(\n (node: T | null) => {\n for (const ref of [a, b]) {\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.MutableRefObject<T | null>).current = node\n }\n },\n [a, b]\n )\n}\n\n/**\n * What `onOpenChange` receives as its second argument: Base UI's change details, declared in\n * Zenith. Base UI's own type would put its internals in the published declarations, which\n * TypeScript 4 consumers cannot parse. `event` narrows with `reason`, as it does in Base UI.\n */\ntype TooltipOpenChangeDetails = (\n | { reason: \"trigger-hover\"; event: MouseEvent }\n | { reason: \"trigger-focus\"; event: FocusEvent }\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"disabled\"; event: Event }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the tooltip in its current state. */\n cancel: () => void\n /** Lets the event propagate where the tooltip would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the tooltip's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\n/** Base UI's details of the imperative close, reported as the Escape that caused it. */\nfunction escapeDetails(\n details: TooltipOpenChangeDetails,\n event: KeyboardEvent\n): TooltipOpenChangeDetails {\n return {\n reason: \"escape-key\",\n event,\n cancel: () => details.cancel(),\n allowPropagation: () => details.allowPropagation(),\n get isCanceled() {\n return details.isCanceled\n },\n get isPropagationAllowed() {\n return details.isPropagationAllowed\n },\n trigger: details.trigger,\n preventUnmountOnClose: () => details.preventUnmountOnClose(),\n }\n}\n\n// The open tooltips' popups, in the order they opened. Escape goes to the last one, as it went to\n// Radix's topmost layer.\nconst openPopups: HTMLElement[] = []\n\n// Radix's provider-level `disableHoverableContent`, which Base UI only takes per tooltip, and the\n// skip delay a tooltip with its own `delayDuration` carries into its own Base UI provider.\nconst TooltipProviderContext = React.createContext<{\n skipDelayDuration?: number\n disableHoverableContent?: boolean\n}>({})\n\nexport type TooltipProviderProps = {\n children: React.ReactNode\n /** How long the pointer rests on a trigger before its tooltip opens, in ms. Defaults to 0. */\n delayDuration?: number\n /** How soon after one tooltip closes the next one opens without a delay, in ms. Defaults to 300. */\n skipDelayDuration?: number\n /** Closes tooltips as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const TooltipProvider = React.forwardRef<\n HTMLElement,\n TooltipProviderProps\n>(function TooltipProvider(\n {\n children,\n delayDuration = 0,\n skipDelayDuration = 300,\n disableHoverableContent,\n },\n _ref\n) {\n const value = React.useMemo(\n () => ({ skipDelayDuration, disableHoverableContent }),\n [skipDelayDuration, disableHoverableContent]\n )\n\n return (\n <TooltipProviderContext.Provider value={value}>\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delayDuration}\n timeout={skipDelayDuration}\n >\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n )\n})\n\n// What the trigger and the content share through the root: the open state, the id of the element\n// that describes the trigger (the content, or its label) for `aria-describedby`, and the close the\n// content's Escape listener calls.\ntype TooltipContextValue = {\n open: boolean\n generatedId: string\n descriptionId: string\n setDescriptionId: (id: string | undefined) => void\n closeOnEscape: (event: KeyboardEvent) => void\n}\n\nconst TooltipContext = React.createContext<TooltipContextValue | null>(null)\n\nexport type TooltipProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the tooltip opens or closes. `eventDetails.reason` says why (`trigger-hover`,\n * `trigger-focus`, `trigger-press`, `escape-key`, `outside-press`) and `eventDetails.cancel()`\n * keeps the tooltip in its current state.\n */\n onOpenChange?: (open: boolean, eventDetails: TooltipOpenChangeDetails) => void\n /** This tooltip's hover delay in ms, overriding the provider's. */\n delayDuration?: number\n /** Closes this tooltip as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(\n function Tooltip(\n {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n },\n _ref\n ) {\n const provider = React.useContext(TooltipProviderContext)\n // Base UI is always controlled from here, so the trigger's `aria-describedby` follows the\n // same open state Base UI renders.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolledOpen\n const generatedId = React.useId()\n const [descriptionId, setDescriptionId] = React.useState<string>()\n const actionsRef = React.useRef<TooltipPrimitive.Root.Actions>(null)\n // Set while the content's Escape listener closes the tooltip, so `onOpenChange` reports it.\n const escapeRef = React.useRef<KeyboardEvent | null>(null)\n const closeOnEscape = React.useCallback((event: KeyboardEvent) => {\n escapeRef.current = event\n try {\n actionsRef.current?.close()\n } finally {\n escapeRef.current = null\n }\n }, [])\n\n const context = React.useMemo(\n () => ({\n open,\n generatedId,\n descriptionId: descriptionId ?? generatedId,\n setDescriptionId,\n closeOnEscape,\n }),\n [open, generatedId, descriptionId, closeOnEscape]\n )\n\n const root = (\n <TooltipContext.Provider value={context}>\n <TooltipPrimitive.Root\n data-slot=\"tooltip\"\n open={open}\n actionsRef={actionsRef}\n onOpenChange={(nextOpen, baseDetails) => {\n const escape = escapeRef.current\n const eventDetails = escape\n ? escapeDetails(baseDetails, escape)\n : baseDetails\n // An Escape that arrives prevented was taken already: by this tooltip's own listener,\n // or by a layer above it. Base UI dismisses regardless, so one Escape would close two.\n if (\n !escape &&\n eventDetails.reason === \"escape-key\" &&\n eventDetails.event.defaultPrevented\n ) {\n baseDetails.cancel()\n return\n }\n onOpenChange?.(nextOpen, eventDetails)\n if (!baseDetails.isCanceled) setUncontrolledOpen(nextOpen)\n }}\n disableHoverablePopup={\n disableHoverableContent ?? provider.disableHoverableContent\n }\n >\n {children}\n </TooltipPrimitive.Root>\n </TooltipContext.Provider>\n )\n\n // Base UI ignores a trigger's own delay while its provider's is 0, and Zenith's provider\n // defaults to 0, so a tooltip with its own delay gets a provider of its own. It leaves the\n // surrounding provider's skip-delay group, which Radix kept it in.\n return delayDuration === undefined ? (\n root\n ) : (\n <TooltipPrimitive.Provider\n delay={delayDuration}\n timeout={provider.skipDelayDuration ?? 300}\n >\n {root}\n </TooltipPrimitive.Provider>\n )\n }\n)\n\nfunction useTooltipContext(part: string) {\n const context = React.useContext(TooltipContext)\n if (!context) throw new Error(`\\`${part}\\` must be used within \\`Tooltip\\``)\n return context\n}\n\nexport type TooltipTriggerProps = NativePartProps<\"button\">\n\nexport const TooltipTrigger = React.forwardRef<\n HTMLButtonElement,\n TooltipTriggerProps\n>(function TooltipTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipTrigger\")\n\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n data-slot=\"tooltip-trigger\"\n {...{ [SLOT_ATTR]: \"tooltip-trigger\" }}\n // Base UI links nothing; Radix described the trigger by the content while it was open.\n aria-describedby={tooltip.open ? tooltip.descriptionId : undefined}\n className={mergeClasses(!asChild && styles.nativeTrigger, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets TooltipContent supply Base UI's required Portal itself when no TooltipPortal wraps it, as\n// Radix rendered content without one.\nconst TooltipPortalPresenceContext = React.createContext(false)\n\nexport type TooltipPortalProps = {\n children?: React.ReactNode\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the tooltip is closed. */\n forceMount?: true\n}\n\nexport const TooltipPortal = React.forwardRef<HTMLElement, TooltipPortalProps>(\n function TooltipPortal({ container, forceMount, ...props }, ref) {\n return (\n <TooltipPortalPresenceContext.Provider value={true}>\n <TooltipPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"tooltip-portal\"\n {...{ [SLOT_ATTR]: \"tooltip-portal\" }}\n // Radix took any Element or DocumentFragment, null meaning the body. Base UI hands a\n // node straight to createPortal, which takes either, but reads null as \"wait for one\".\n container={(container ?? undefined) as HTMLElement | undefined}\n keepMounted={forceMount}\n {...props}\n />\n </TooltipPortalPresenceContext.Provider>\n )\n }\n)\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\"\n\nexport type TooltipContentProps = NativePartProps<\"div\"> & {\n /** The side of the trigger the content opens on. Flips when it would not fit. Defaults to top. */\n side?: Side\n /** Distance from the trigger in px, on top of the arrow's own height. Defaults to 0. */\n sideOffset?: number\n /** Alignment against the trigger. Defaults to center. */\n align?: \"start\" | \"center\" | \"end\"\n /** Offset from the `start` or `end` alignment in px. Defaults to 0. */\n alignOffset?: number\n /** Distance between the arrow and the content's corners in px. Defaults to 0. */\n arrowPadding?: number\n /** Flips and shifts the content to keep it in view. Defaults to true. */\n avoidCollisions?: boolean\n /** Elements the content must stay inside, besides the viewport. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Distance in px from the boundary edges before the content avoids them. Defaults to 0. */\n collisionPadding?: number | Partial<Record<Side, number>>\n /** `partial` keeps the content attached to its trigger; `always` keeps it in the boundary. */\n sticky?: \"partial\" | \"always\"\n /** Hides the content once its trigger is scrolled out of view. */\n hideWhenDetached?: boolean\n /** Accepted for compatibility; the position follows layout changes either way. */\n updatePositionStrategy?: \"optimized\" | \"always\"\n /**\n * Keeps the content mounted while the tooltip is closed. Inside TooltipPortal, the portal's\n * `forceMount` decides.\n */\n forceMount?: true\n /** Hides the arrow that points at the trigger. */\n hideArrow?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\n// Radix's collision handling: flip to the opposite side or alignment, never to the other axis.\nconst AVOID_COLLISIONS = {\n side: \"flip\",\n align: \"flip\",\n fallbackAxisSide: \"none\",\n} as const\nconst IGNORE_COLLISIONS = {\n side: \"none\",\n align: \"none\",\n fallbackAxisSide: \"none\",\n} as const\n\nexport const TooltipContent = React.forwardRef<\n HTMLDivElement,\n TooltipContentProps\n>(function TooltipContent(\n {\n asChild = false,\n className,\n children,\n hideArrow = false,\n variant = \"default\",\n side = \"top\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy: _updatePositionStrategy,\n forceMount,\n id: idProp,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipContent\")\n const hasPortal = React.useContext(TooltipPortalPresenceContext)\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment. Tooltip\n // content rarely nests density-consuming children, but the mechanism is applied uniformly across\n // every portal-content component rather than special-cased per component.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n const arrowRef = React.useRef<HTMLDivElement>(null)\n const [popup, setPopup] = React.useState<HTMLDivElement | null>(null)\n const popupRef = useMergedRef(ref, setPopup)\n\n // Radix's tooltip was the topmost layer while open, so Escape closed it before anything under it:\n // a Dialog or a Radix menu it sits in, or a control. Base UI's listens later, after a Dialog has\n // taken the key. Taking it on the window in the capture phase, before Radix's layers and Zenith's\n // Base UI roots see it, and preventing it makes them leave it alone.\n const { open, closeOnEscape } = tooltip\n React.useEffect(() => {\n if (!open || !popup) return\n const element = popup\n openPopups.push(element)\n const view = element.ownerDocument.defaultView ?? window\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return\n if (openPopups[openPopups.length - 1] !== element) return\n // Only an Escape from under the tooltip, earlier in the document. From inside it (a layer\n // nested in the content, or the content itself) Base UI's own handler runs first; from later\n // in the document, a layer opened over the tooltip takes its own.\n const target = event.target\n if (\n !(target instanceof Node) ||\n element.contains(target) ||\n !(\n element.compareDocumentPosition(target) &\n Node.DOCUMENT_POSITION_PRECEDING\n )\n )\n return\n event.preventDefault()\n closeOnEscape(event)\n }\n view.addEventListener(\"keydown\", onKeyDown, true)\n return () => {\n view.removeEventListener(\"keydown\", onKeyDown, true)\n openPopups.splice(openPopups.indexOf(element), 1)\n }\n }, [open, popup, closeOnEscape])\n\n // The trigger's `aria-describedby` points here, so a caller's own id has to reach it. Radix\n // described the trigger by `aria-label` when one was given; a hidden node carries it, because\n // not every accessibility engine reads the `aria-label` of a describing element.\n const popupId = idProp ?? tooltip.generatedId\n const ariaLabel = props[\"aria-label\"]\n const labelId = `${popupId}-label`\n const descriptionId = ariaLabel ? labelId : popupId\n const { setDescriptionId } = tooltip\n React.useEffect(() => {\n setDescriptionId(descriptionId)\n return () => setDescriptionId(undefined)\n }, [descriptionId, setDescriptionId])\n\n const label = ariaLabel && (\n <span id={labelId} hidden>\n {ariaLabel}\n </span>\n )\n\n const arrow = !hideArrow && (\n <TooltipPrimitive.Arrow\n ref={arrowRef}\n data-slot=\"tooltip-arrow\"\n {...{ [SLOT_ATTR]: \"tooltip-arrow\" }}\n data-variant={variant}\n className={styles.arrow}\n />\n )\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the label and the arrow join them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n label,\n arrow\n ),\n }\n : {\n children: (\n <>\n {children}\n {label}\n {arrow}\n </>\n ),\n }\n\n const positioner = (\n <TooltipPrimitive.Positioner\n className={mergeClasses(\n styles.positioner,\n hideWhenDetached && styles.hideWhenDetached\n )}\n positionMethod=\"fixed\"\n side={side}\n // Radix moved the content away by the arrow's own height on top of `sideOffset`.\n sideOffset={() => sideOffset + (arrowRef.current?.offsetHeight ?? 0)}\n align={align}\n // Radix applied the offset to `start` and `end` only; Base UI also shifts centred content.\n alignOffset={align === \"center\" ? 0 : alignOffset}\n arrowPadding={arrowPadding}\n // Radix's default is the viewport alone, not every clipping ancestor.\n collisionBoundary={\n Array.isArray(collisionBoundary)\n ? collisionBoundary.filter((boundary) => boundary !== null)\n : collisionBoundary === null\n ? []\n : collisionBoundary\n }\n collisionPadding={collisionPadding}\n sticky={sticky === \"always\"}\n collisionAvoidance={\n avoidCollisions ? AVOID_COLLISIONS : IGNORE_COLLISIONS\n }\n >\n <TooltipPrimitive.Popup\n ref={popupRef}\n id={popupId}\n // Base UI renders no role; Radix exposed the content as role=\"tooltip\".\n role=\"tooltip\"\n data-slot=\"tooltip-content\"\n {...{ [SLOT_ATTR]: \"tooltip-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n data-variant={variant}\n className={mergeClasses(styles.popup, className)}\n {...props}\n {...content}\n />\n </TooltipPrimitive.Positioner>\n )\n\n // Base UI's Positioner requires a Portal ancestor; Radix rendered inline without one.\n return hasPortal ? (\n positioner\n ) : (\n <TooltipPrimitive.Portal keepMounted={forceMount}>\n {positioner}\n </TooltipPrimitive.Portal>\n )\n})\n"],"names":["useStyles","makeZenithStyles","nativeControl","OVERLAY_Z_INDEX","boxModel","shorthands","tokens.radiusLg","tokens.spacingElement2","tokens.textXs","tokens.gray12","tokens.gray1","tokens.errorA12","tokens.error1","tokens.error12","onlySlotChild","children","elements","React","slotProps","asChild","child","useMergedRef","a","b","node","ref","escapeDetails","details","event","openPopups","TooltipProviderContext","TooltipProvider","delayDuration","skipDelayDuration","disableHoverableContent","_ref","value","jsx","TooltipPrimitive","TooltipContext","Tooltip","openProp","defaultOpen","onOpenChange","provider","uncontrolledOpen","setUncontrolledOpen","open","generatedId","descriptionId","setDescriptionId","actionsRef","escapeRef","closeOnEscape","_a","context","root","nextOpen","baseDetails","escape","eventDetails","useTooltipContext","part","TooltipTrigger","className","props","styles","tooltip","SLOT_ATTR","mergeClasses","TooltipPortalPresenceContext","TooltipPortal","container","forceMount","AVOID_COLLISIONS","IGNORE_COLLISIONS","TooltipContent","hideArrow","variant","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","_updatePositionStrategy","idProp","hasPortal","override","useDensity","appearance","useAppearanceAttributes","arrowRef","popup","setPopup","popupRef","element","view","onKeyDown","target","popupId","ariaLabel","labelId","label","arrow","content","jsxs","Fragment","positioner","boundary"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAYC,GAAiB;AAAA;AAAA;AAAA,EAGjC,eAAe;AAAA,IACb,GAAGC;AAAA,EAAA;AAAA,EAEL,YAAY;AAAA,IACV,QAAQC;AAAA,EAAA;AAAA;AAAA,EAGV,kBAAkB;AAAA,IAChB,yBAAyB;AAAA,MACvB,YAAY;AAAA,MACZ,eAAe;AAAA,IAAA;AAAA,EACjB;AAAA;AAAA;AAAA,EAIF,OAAO;AAAA,IACL,GAAGC;AAAA,IACH,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,GAAGC,EAAW,aAAaC,EAAe;AAAA,IAC1C,GAAGD,EAAW,QAAQE,EAAsB;AAAA;AAAA,IAE5C,WAAW;AAAA,IACX,UAAUC;AAAAA;AAAAA,IAEV,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,QAAQL;AAAA,IACR,6BAA6B;AAAA,MAC3B,iBAAiBM;AAAAA,MACjB,OAAOC;AAAAA,IAAO;AAAA,IAEhB,iCAAiC;AAAA,MAC/B,iBAAiBC;AAAAA,MACjB,OAAOC;AAAAA,IAAO;AAAA,EAChB;AAAA;AAAA;AAAA,EAIF,OAAO;AAAA,IACL,GAAGR;AAAA,IACH,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAGC,EAAW,aAAa,KAAK;AAAA,IAChC,sBAAsB;AAAA,MACpB,KAAK;AAAA,MACL,WAAW;AAAA,IAAA;AAAA,IAEb,yBAAyB;AAAA,MACvB,KAAK;AAAA,MACL,WAAW;AAAA,IAAA;AAAA,IAEb,uBAAuB;AAAA,MACrB,MAAM;AAAA,MACN,WAAW;AAAA,IAAA;AAAA,IAEb,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;AAAA,MACtC,cAAAC;AAAA,MAEA,mBACE,MAAM,QAAQE,CAAiB,IAC3BA,EAAkB,OAAO,CAAC4B,MAAaA,MAAa,IAAI,IACxD5B,MAAsB,OACpB,CAAA,IACAA;AAAA,MAER,kBAAAC;AAAA,MACA,QAAQC,MAAW;AAAA,MACnB,oBACEH,IAAkBV,KAAmBC;AAAA,MAGvC,UAAA,gBAAAtC;AAAA,QAACC,EAAiB;AAAA,QAAjB;AAAA,UACC,KAAK6D;AAAA,UACL,IAAIK;AAAA,UAEJ,MAAK;AAAA,UACL,aAAU;AAAA,UACJ,CAACpC,CAAS,GAAG;AAAA,UAClB,GAAIwB,MAAa,SAAY,EAAE,gBAAgBA,EAAA,IAAa,CAAA;AAAA,UAC5D,GAAGE;AAAA,UACJ,gBAAchB;AAAA,UACd,WAAWT,EAAaH,EAAO,OAAOF,CAAS;AAAA,UAC9C,GAAGC;AAAA,UACH,GAAG4C;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAKJ,SAAOlB,IACLqB,IAEA,gBAAA3E,EAACC,EAAiB,QAAjB,EAAwB,aAAamC,GACnC,UAAAuC,GACH;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n nativeTrigger: {\n ...nativeControl,\n },\n positioner: {\n zIndex: OVERLAY_Z_INDEX,\n },\n // Radix's `hideWhenDetached`: hide the content once its trigger is scrolled out of view.\n hideWhenDetached: {\n \"&[data-anchor-hidden]\": {\n visibility: \"hidden\",\n pointerEvents: \"none\",\n },\n },\n // No enter or exit motion: the Radix version keyed its keyframes on `data-state='open'`, a value\n // Radix's tooltip never sets (it sets `delayed-open` or `instant-open`), so it never animated.\n popup: {\n ...boxModel,\n width: \"fit-content\",\n transformOrigin: \"var(--transform-origin)\",\n ...shorthands.borderRadius(tokens.radiusLg),\n ...shorthands.padding(tokens.spacingElement2),\n // v1 shadow-md; elevation has no token in this package.\n boxShadow: \"0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a\",\n fontSize: tokens.textXs,\n // v1 leading-none; no line-height token exists.\n lineHeight: \"1\",\n zIndex: OVERLAY_Z_INDEX,\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n color: tokens.gray1,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.errorA12,\n color: tokens.error1,\n },\n },\n // Base UI places the arrow on the cross axis only; the anchored edge is set per side here. The\n // diamond's centre sits 2px inside the content's edge, where Radix's arrow wrapper put it.\n arrow: {\n ...boxModel,\n zIndex: 50,\n width: \"0.625rem\",\n height: \"0.625rem\",\n ...shorthands.borderRadius(\"2px\"),\n \"&[data-side='top']\": {\n top: \"100%\",\n transform: \"translateY(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='bottom']\": {\n top: 0,\n transform: \"translateY(calc(-50% + 2px)) rotate(45deg)\",\n },\n \"&[data-side='left']\": {\n left: \"100%\",\n transform: \"translateX(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='right']\": {\n left: 0,\n transform: \"translateX(calc(-50% + 2px)) rotate(45deg)\",\n },\n // Radix hid the arrow when it could not point at the trigger's centre.\n \"&[data-uncentered]\": {\n visibility: \"hidden\",\n },\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.error12,\n },\n },\n})\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\nfunction useMergedRef<T>(a: React.Ref<T> | undefined, b: React.Ref<T>) {\n return React.useCallback(\n (node: T | null) => {\n for (const ref of [a, b]) {\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.MutableRefObject<T | null>).current = node\n }\n },\n [a, b]\n )\n}\n\n/**\n * What `onOpenChange` receives as its second argument: Base UI's change details, declared in\n * Zenith. Base UI's own type would put its internals in the published declarations, which\n * TypeScript 4 consumers cannot parse. `event` narrows with `reason`, as it does in Base UI.\n */\ntype TooltipOpenChangeDetails = (\n | { reason: \"trigger-hover\"; event: MouseEvent }\n | { reason: \"trigger-focus\"; event: FocusEvent }\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"disabled\"; event: Event }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the tooltip in its current state. */\n cancel: () => void\n /** Lets the event propagate where the tooltip would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the tooltip's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\n/** Base UI's details of the imperative close, reported as the Escape that caused it. */\nfunction escapeDetails(\n details: TooltipOpenChangeDetails,\n event: KeyboardEvent\n): TooltipOpenChangeDetails {\n return {\n reason: \"escape-key\",\n event,\n cancel: () => details.cancel(),\n allowPropagation: () => details.allowPropagation(),\n get isCanceled() {\n return details.isCanceled\n },\n get isPropagationAllowed() {\n return details.isPropagationAllowed\n },\n trigger: details.trigger,\n preventUnmountOnClose: () => details.preventUnmountOnClose(),\n }\n}\n\n// The open tooltips' popups, in the order they opened. Escape goes to the last one, as it went to\n// Radix's topmost layer.\nconst openPopups: HTMLElement[] = []\n\n// Radix's provider-level `disableHoverableContent`, which Base UI only takes per tooltip, and the\n// skip delay a tooltip with its own `delayDuration` carries into its own Base UI provider.\nconst TooltipProviderContext = React.createContext<{\n skipDelayDuration?: number\n disableHoverableContent?: boolean\n}>({})\n\nexport type TooltipProviderProps = {\n children: React.ReactNode\n /** How long the pointer rests on a trigger before its tooltip opens, in ms. Defaults to 0. */\n delayDuration?: number\n /** How soon after one tooltip closes the next one opens without a delay, in ms. Defaults to 300. */\n skipDelayDuration?: number\n /** Closes tooltips as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const TooltipProvider = React.forwardRef<\n HTMLElement,\n TooltipProviderProps\n>(function TooltipProvider(\n {\n children,\n delayDuration = 0,\n skipDelayDuration = 300,\n disableHoverableContent,\n },\n _ref\n) {\n const value = React.useMemo(\n () => ({ skipDelayDuration, disableHoverableContent }),\n [skipDelayDuration, disableHoverableContent]\n )\n\n return (\n <TooltipProviderContext.Provider value={value}>\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delayDuration}\n timeout={skipDelayDuration}\n >\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n )\n})\n\n// What the trigger and the content share through the root: the open state, the id of the element\n// that describes the trigger (the content, or its label) for `aria-describedby`, and the close the\n// content's Escape listener calls.\ntype TooltipContextValue = {\n open: boolean\n generatedId: string\n descriptionId: string\n setDescriptionId: (id: string | undefined) => void\n closeOnEscape: (event: KeyboardEvent) => void\n}\n\nconst TooltipContext = React.createContext<TooltipContextValue | null>(null)\n\nexport type TooltipProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the tooltip opens or closes. `eventDetails.reason` says why (`trigger-hover`,\n * `trigger-focus`, `trigger-press`, `escape-key`, `outside-press`) and `eventDetails.cancel()`\n * keeps the tooltip in its current state.\n */\n onOpenChange?: (open: boolean, eventDetails: TooltipOpenChangeDetails) => void\n /** This tooltip's hover delay in ms, overriding the provider's. */\n delayDuration?: number\n /** Closes this tooltip as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(\n function Tooltip(\n {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n },\n _ref\n ) {\n const provider = React.useContext(TooltipProviderContext)\n // Base UI is always controlled from here, so the trigger's `aria-describedby` follows the\n // same open state Base UI renders.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolledOpen\n const generatedId = React.useId()\n const [descriptionId, setDescriptionId] = React.useState<string>()\n const actionsRef = React.useRef<TooltipPrimitive.Root.Actions>(null)\n // Set while the content's Escape listener closes the tooltip, so `onOpenChange` reports it.\n const escapeRef = React.useRef<KeyboardEvent | null>(null)\n const closeOnEscape = React.useCallback((event: KeyboardEvent) => {\n escapeRef.current = event\n try {\n actionsRef.current?.close()\n } finally {\n escapeRef.current = null\n }\n }, [])\n\n const context = React.useMemo(\n () => ({\n open,\n generatedId,\n descriptionId: descriptionId ?? generatedId,\n setDescriptionId,\n closeOnEscape,\n }),\n [open, generatedId, descriptionId, closeOnEscape]\n )\n\n const root = (\n <TooltipContext.Provider value={context}>\n <TooltipPrimitive.Root\n data-slot=\"tooltip\"\n open={open}\n actionsRef={actionsRef}\n onOpenChange={(nextOpen, baseDetails) => {\n const escape = escapeRef.current\n const eventDetails = escape\n ? escapeDetails(baseDetails, escape)\n : baseDetails\n // An Escape that arrives prevented was taken already: by this tooltip's own listener,\n // or by a layer above it. Base UI dismisses regardless, so one Escape would close two.\n if (\n !escape &&\n eventDetails.reason === \"escape-key\" &&\n eventDetails.event.defaultPrevented\n ) {\n baseDetails.cancel()\n return\n }\n onOpenChange?.(nextOpen, eventDetails)\n if (!baseDetails.isCanceled) setUncontrolledOpen(nextOpen)\n }}\n disableHoverablePopup={\n disableHoverableContent ?? provider.disableHoverableContent\n }\n >\n {children}\n </TooltipPrimitive.Root>\n </TooltipContext.Provider>\n )\n\n // Base UI ignores a trigger's own delay while its provider's is 0, and Zenith's provider\n // defaults to 0, so a tooltip with its own delay gets a provider of its own. It leaves the\n // surrounding provider's skip-delay group, which Radix kept it in.\n return delayDuration === undefined ? (\n root\n ) : (\n <TooltipPrimitive.Provider\n delay={delayDuration}\n timeout={provider.skipDelayDuration ?? 300}\n >\n {root}\n </TooltipPrimitive.Provider>\n )\n }\n)\n\nfunction useTooltipContext(part: string) {\n const context = React.useContext(TooltipContext)\n if (!context) throw new Error(`\\`${part}\\` must be used within \\`Tooltip\\``)\n return context\n}\n\nexport type TooltipTriggerProps = NativePartProps<\"button\">\n\nexport const TooltipTrigger = React.forwardRef<\n HTMLButtonElement,\n TooltipTriggerProps\n>(function TooltipTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipTrigger\")\n\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n data-slot=\"tooltip-trigger\"\n {...{ [SLOT_ATTR]: \"tooltip-trigger\" }}\n // Base UI links nothing; Radix described the trigger by the content while it was open.\n aria-describedby={tooltip.open ? tooltip.descriptionId : undefined}\n className={mergeClasses(!asChild && styles.nativeTrigger, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets TooltipContent supply Base UI's required Portal itself when no TooltipPortal wraps it, as\n// Radix rendered content without one.\nconst TooltipPortalPresenceContext = React.createContext(false)\n\nexport type TooltipPortalProps = {\n children?: React.ReactNode\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the tooltip is closed. */\n forceMount?: true\n}\n\nexport const TooltipPortal = React.forwardRef<HTMLElement, TooltipPortalProps>(\n function TooltipPortal({ container, forceMount, ...props }, ref) {\n return (\n <TooltipPortalPresenceContext.Provider value={true}>\n <TooltipPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"tooltip-portal\"\n {...{ [SLOT_ATTR]: \"tooltip-portal\" }}\n // Radix took any Element or DocumentFragment, null meaning the body. Base UI hands a\n // node straight to createPortal, which takes either, but reads null as \"wait for one\".\n container={(container ?? undefined) as HTMLElement | undefined}\n keepMounted={forceMount}\n {...props}\n />\n </TooltipPortalPresenceContext.Provider>\n )\n }\n)\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\"\n\nexport type TooltipContentProps = NativePartProps<\"div\"> & {\n /** The side of the trigger the content opens on. Flips when it would not fit. Defaults to top. */\n side?: Side\n /** Distance from the trigger in px, on top of the arrow's own height. Defaults to 0. */\n sideOffset?: number\n /** Alignment against the trigger. Defaults to center. */\n align?: \"start\" | \"center\" | \"end\"\n /** Offset from the `start` or `end` alignment in px. Defaults to 0. */\n alignOffset?: number\n /** Distance between the arrow and the content's corners in px. Defaults to 0. */\n arrowPadding?: number\n /** Flips and shifts the content to keep it in view. Defaults to true. */\n avoidCollisions?: boolean\n /** Elements the content must stay inside, besides the viewport. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Distance in px from the boundary edges before the content avoids them. Defaults to 0. */\n collisionPadding?: number | Partial<Record<Side, number>>\n /** `partial` keeps the content attached to its trigger; `always` keeps it in the boundary. */\n sticky?: \"partial\" | \"always\"\n /** Hides the content once its trigger is scrolled out of view. */\n hideWhenDetached?: boolean\n /** Accepted for compatibility; the position follows layout changes either way. */\n updatePositionStrategy?: \"optimized\" | \"always\"\n /**\n * Keeps the content mounted while the tooltip is closed. Inside TooltipPortal, the portal's\n * `forceMount` decides.\n */\n forceMount?: true\n /** Hides the arrow that points at the trigger. */\n hideArrow?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\n// Radix's collision handling: flip to the opposite side or alignment, never to the other axis.\nconst AVOID_COLLISIONS = {\n side: \"flip\",\n align: \"flip\",\n fallbackAxisSide: \"none\",\n} as const\nconst IGNORE_COLLISIONS = {\n side: \"none\",\n align: \"none\",\n fallbackAxisSide: \"none\",\n} as const\n\nexport const TooltipContent = React.forwardRef<\n HTMLDivElement,\n TooltipContentProps\n>(function TooltipContent(\n {\n asChild = false,\n className,\n children,\n hideArrow = false,\n variant = \"default\",\n side = \"top\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy: _updatePositionStrategy,\n forceMount,\n id: idProp,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipContent\")\n const hasPortal = React.useContext(TooltipPortalPresenceContext)\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment. Tooltip\n // content rarely nests density-consuming children, but the mechanism is applied uniformly across\n // every portal-content component rather than special-cased per component.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n const arrowRef = React.useRef<HTMLDivElement>(null)\n const [popup, setPopup] = React.useState<HTMLDivElement | null>(null)\n const popupRef = useMergedRef(ref, setPopup)\n\n // Radix's tooltip was the topmost layer while open, so Escape closed it before anything under it:\n // a Dialog or a Radix menu it sits in, or a control. Base UI's listens later, after a Dialog has\n // taken the key. Taking it on the window in the capture phase, before Radix's layers and Zenith's\n // Base UI roots see it, and preventing it makes them leave it alone.\n const { open, closeOnEscape } = tooltip\n React.useEffect(() => {\n if (!open || !popup) return\n const element = popup\n openPopups.push(element)\n const view = element.ownerDocument.defaultView ?? window\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return\n if (openPopups[openPopups.length - 1] !== element) return\n // Only an Escape from under the tooltip, earlier in the document. From inside it (a layer\n // nested in the content, or the content itself) Base UI's own handler runs first; from later\n // in the document, a layer opened over the tooltip takes its own.\n const target = event.target\n if (\n !(target instanceof Node) ||\n element.contains(target) ||\n !(\n element.compareDocumentPosition(target) &\n Node.DOCUMENT_POSITION_PRECEDING\n )\n )\n return\n event.preventDefault()\n closeOnEscape(event)\n }\n view.addEventListener(\"keydown\", onKeyDown, true)\n return () => {\n view.removeEventListener(\"keydown\", onKeyDown, true)\n openPopups.splice(openPopups.indexOf(element), 1)\n }\n }, [open, popup, closeOnEscape])\n\n // The trigger's `aria-describedby` points here, so a caller's own id has to reach it. Radix\n // described the trigger by `aria-label` when one was given; a hidden node carries it, because\n // not every accessibility engine reads the `aria-label` of a describing element.\n const popupId = idProp ?? tooltip.generatedId\n const ariaLabel = props[\"aria-label\"]\n const labelId = `${popupId}-label`\n const descriptionId = ariaLabel ? labelId : popupId\n const { setDescriptionId } = tooltip\n React.useEffect(() => {\n setDescriptionId(descriptionId)\n return () => setDescriptionId(undefined)\n }, [descriptionId, setDescriptionId])\n\n const label = ariaLabel && (\n <span id={labelId} hidden>\n {ariaLabel}\n </span>\n )\n\n const arrow = !hideArrow && (\n <TooltipPrimitive.Arrow\n ref={arrowRef}\n data-slot=\"tooltip-arrow\"\n {...{ [SLOT_ATTR]: \"tooltip-arrow\" }}\n data-variant={variant}\n className={styles.arrow}\n />\n )\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the label and the arrow join them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n label,\n arrow\n ),\n }\n : {\n children: (\n <>\n {children}\n {label}\n {arrow}\n </>\n ),\n }\n\n const positioner = (\n <TooltipPrimitive.Positioner\n className={mergeClasses(\n styles.positioner,\n hideWhenDetached && styles.hideWhenDetached\n )}\n positionMethod=\"fixed\"\n side={side}\n // Radix moved the content away by the arrow's own height on top of `sideOffset`.\n sideOffset={() => sideOffset + (arrowRef.current?.offsetHeight ?? 0)}\n align={align}\n // Radix applied the offset to `start` and `end` only; Base UI also shifts centred content.\n alignOffset={align === \"center\" ? 0 : alignOffset}\n arrowPadding={arrowPadding}\n // Radix's default is the viewport alone, not every clipping ancestor.\n collisionBoundary={\n Array.isArray(collisionBoundary)\n ? collisionBoundary.filter((boundary) => boundary !== null)\n : collisionBoundary === null\n ? []\n : collisionBoundary\n }\n collisionPadding={collisionPadding}\n sticky={sticky === \"always\"}\n collisionAvoidance={\n avoidCollisions ? AVOID_COLLISIONS : IGNORE_COLLISIONS\n }\n >\n <TooltipPrimitive.Popup\n ref={popupRef}\n id={popupId}\n // Base UI renders no role; Radix exposed the content as role=\"tooltip\".\n role=\"tooltip\"\n data-slot=\"tooltip-content\"\n {...{ [SLOT_ATTR]: \"tooltip-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n data-variant={variant}\n className={mergeClasses(styles.popup, className)}\n {...props}\n {...content}\n />\n </TooltipPrimitive.Positioner>\n )\n\n // Base UI's Positioner requires a Portal ancestor; Radix rendered inline without one.\n return hasPortal ? (\n positioner\n ) : (\n <TooltipPrimitive.Portal keepMounted={forceMount}>\n {positioner}\n </TooltipPrimitive.Portal>\n )\n})\n"],"names":["useStyles","makeZenithStyles","nativeControl","OVERLAY_Z_INDEX","boxModel","shorthands","tokens.radiusLg","tokens.spacingElement2","tokens.textXs","tokens.gray12","tokens.gray1","tokens.errorA12","tokens.error1","tokens.error12","onlySlotChild","children","elements","React","slotProps","asChild","child","useMergedRef","a","b","node","ref","escapeDetails","details","event","openPopups","TooltipProviderContext","TooltipProvider","delayDuration","skipDelayDuration","disableHoverableContent","_ref","value","jsx","TooltipPrimitive","TooltipContext","Tooltip","openProp","defaultOpen","onOpenChange","provider","uncontrolledOpen","setUncontrolledOpen","open","generatedId","descriptionId","setDescriptionId","actionsRef","escapeRef","closeOnEscape","_a","context","root","nextOpen","baseDetails","escape","eventDetails","useTooltipContext","part","TooltipTrigger","className","props","styles","tooltip","SLOT_ATTR","mergeClasses","TooltipPortalPresenceContext","TooltipPortal","container","forceMount","AVOID_COLLISIONS","IGNORE_COLLISIONS","TooltipContent","hideArrow","variant","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","_updatePositionStrategy","idProp","hasPortal","override","useDensity","appearance","useAppearanceAttributes","arrowRef","popup","setPopup","popupRef","element","view","onKeyDown","target","popupId","ariaLabel","labelId","label","arrow","content","jsxs","Fragment","positioner","boundary"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAYC,GAAiB;AAAA;AAAA;AAAA,EAGjC,eAAe;AAAA,IACb,GAAGC;AAAA,EAAA;AAAA,EAEL,YAAY;AAAA,IACV,QAAQC;AAAA,EAAA;AAAA;AAAA,EAGV,kBAAkB;AAAA,IAChB,yBAAyB;AAAA,MACvB,YAAY;AAAA,MACZ,eAAe;AAAA,IAAA;AAAA,EACjB;AAAA;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