@ntbjs/react-components 3.0.0-rc.1 → 3.0.0-rc.3

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.
Files changed (139) hide show
  1. package/README.md +34 -0
  2. package/build/data/Alert/Alert.js.map +1 -1
  3. package/build/data/Alert/Alert.styled.js.map +1 -1
  4. package/build/data/Badge/Badge.js.map +1 -1
  5. package/build/data/Badge/Badge.styled.js.map +1 -1
  6. package/build/data/Popover/Popover.js.map +1 -1
  7. package/build/data/Popover/Popover.styled.js.map +1 -1
  8. package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
  9. package/build/data/Tab/Tab.js.map +1 -1
  10. package/build/data/Tab/Tab.styled.js.map +1 -1
  11. package/build/data/Tabs/Tabs.js.map +1 -1
  12. package/build/data/Tabs/Tabs.styled.js.map +1 -1
  13. package/build/data/Tooltip/Tooltip.js.map +1 -1
  14. package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
  15. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
  16. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
  17. package/build/data/_shared/FloatingArrow.styled.js.map +1 -1
  18. package/build/hooks/useEventListner.js.map +1 -1
  19. package/build/hooks/useFloatingPopover.js.map +1 -1
  20. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  21. package/build/hooks/useOnClickOutside.js.map +1 -1
  22. package/build/hooks/useTooltipAutoShow.js.map +1 -1
  23. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  24. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  25. package/build/inputs/Button/Button.js.map +1 -1
  26. package/build/inputs/Button/Button.styled.js.map +1 -1
  27. package/build/inputs/Checkbox/Checkbox.js.map +1 -1
  28. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
  29. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
  30. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
  31. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
  32. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
  33. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  34. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  35. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
  36. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
  37. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
  38. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
  39. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
  40. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  41. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  42. package/build/inputs/Radio/Radio.js.map +1 -1
  43. package/build/inputs/Radio/Radio.styled.js.map +1 -1
  44. package/build/inputs/Switch/Switch.styled.js.map +1 -1
  45. package/build/inputs/TextArea/TextArea.js.map +1 -1
  46. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  47. package/build/inputs/TextInput/TextInput.js.map +1 -1
  48. package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
  49. package/build/layout/InputGroup/InputGroup.js.map +1 -1
  50. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
  51. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
  52. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
  53. package/build/styles/utils/colors-export.d.ts +6 -25
  54. package/build/utils/dateTime.js.map +1 -1
  55. package/build/utils/defaultTheme.js.map +1 -1
  56. package/build/utils/getElementRef.js.map +1 -1
  57. package/build/utils/parseTrigger.js.map +1 -1
  58. package/build/widgets/AssetAction/AssetAction.js.map +1 -1
  59. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
  60. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
  61. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
  62. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
  63. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
  64. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
  65. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  66. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  67. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  68. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  69. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
  70. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
  71. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
  72. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
  73. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
  74. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
  75. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
  76. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
  77. package/build/widgets/InfoCard/InfoCard.js.map +1 -1
  78. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
  79. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
  80. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
  81. package/build/widgets/Instructions/Instructions.js.map +1 -1
  82. package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
  83. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
  84. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
  85. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
  86. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
  87. package/package.json +8 -1
  88. package/styles/utils/colors-export.d.ts +6 -25
  89. package/types/components/data/Alert/Alert.styled.d.ts +6 -37
  90. package/types/components/data/Badge/Badge.d.ts +1 -9
  91. package/types/components/data/Badge/Badge.styled.d.ts +0 -99
  92. package/types/components/data/Popover/Popover.d.ts +11 -100
  93. package/types/components/data/Tab/Tab.d.ts +1 -14
  94. package/types/components/data/Tabs/Tabs.styled.d.ts +1 -17
  95. package/types/components/data/Tooltip/Tooltip.d.ts +4 -50
  96. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +3 -22
  97. package/types/components/data/_shared/FloatingArrow.styled.d.ts +1 -101
  98. package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +2 -20
  99. package/types/components/inputs/Button/Button.styled.d.ts +0 -42
  100. package/types/components/inputs/Checkbox/Checkbox.d.ts +0 -9
  101. package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +6 -10
  102. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +4 -57
  103. package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +3 -55
  104. package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +4 -32
  105. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +2 -10
  106. package/types/components/inputs/MultiLevelCheckbox/types.d.ts +3 -46
  107. package/types/components/inputs/MultiSelect/MultiSelect.d.ts +0 -57
  108. package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +0 -65
  109. package/types/components/inputs/Radio/Radio.styled.d.ts +3 -3
  110. package/types/components/inputs/Switch/Switch.styled.d.ts +3 -7
  111. package/types/components/inputs/TextArea/TextArea.d.ts +0 -4
  112. package/types/components/inputs/TextArea/TextArea.styled.d.ts +5 -7
  113. package/types/components/inputs/TextInput/TextInput.styled.d.ts +1 -1
  114. package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +2 -9
  115. package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +2 -7
  116. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +0 -12
  117. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +7 -55
  118. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +7 -43
  119. package/types/components/widgets/AssetGallery/asset.types.d.ts +31 -148
  120. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +6 -20
  121. package/types/components/widgets/ContextMenu/ContextMenu.d.ts +1 -17
  122. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +5 -13
  123. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +0 -18
  124. package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +2 -19
  125. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +9 -19
  126. package/types/components/widgets/Instructions/Instructions.styled.d.ts +2 -14
  127. package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +6 -43
  128. package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +7 -46
  129. package/types/hooks/useElementSize.d.ts +3 -14
  130. package/types/hooks/useEventListner.d.ts +6 -38
  131. package/types/hooks/useFloatingPopover.d.ts +9 -90
  132. package/types/hooks/useIsomorphicLayoutEffect.d.ts +0 -23
  133. package/types/hooks/useOnClickOutside.d.ts +5 -23
  134. package/types/hooks/useTooltipAutoShow.d.ts +8 -57
  135. package/types/styles/utils/colors-export.d.ts +6 -25
  136. package/types/utils/dateTime.d.ts +2 -7
  137. package/types/utils/defaultTheme.d.ts +13 -92
  138. package/types/utils/getElementRef.d.ts +0 -19
  139. package/types/utils/parseTrigger.d.ts +8 -78
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.styled.js","sources":["../../../src/components/data/Tabs/Tabs.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * `Tabs` is not independent of `Tab`: `Tabs.tsx` identifies its children with\n * `child.type === Tab`, so the two files are one unit for any change to either's props.\n *\n * ONE DEFERRED DEFECT, DECLARED NOT FIXED, and it is the only one in this file:\n * `custompadding` has no `$`, so it is in the rendered HTML. It is CONFIRMED in the\n * recorded baseline rather than inferred — `scripts/r19-harness/baseline.json` contains\n * `<ul custompadding=\"40px\" …>` for `data/Tabs`. See `TabPaddingStyleProps`.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/** Props of the `Tabs` root, i.e. what `Tabs.tsx` passes to `S.Tabs`. */\nexport interface TabsStyleProps {\n /** `backgroundColor` — `PropTypes.string`, a CSS colour, interpolated raw. */\n $backgroundColor?: string;\n}\n\n/**\n * Shared by `TabHeaders` and `TabHeaderBorder`, the two components `Tabs.tsx` hands\n * `custompadding` to. One interface rather than two because the key, the value and the\n * defect are the same at both sites; a change here is a change to both, which is the\n * point of naming them together.\n *\n * DEFECT, DECLARED NOT FIXED: `custompadding` HAS NO `$`, so `shouldForwardProp` forwards\n * it and it lands on the rendered `<ul>` and `<div>`. This is not inferred — it is in\n * `scripts/r19-harness/baseline.json` as `<ul custompadding=\"40px\" …>`. The fix is to\n * rename it `$customPadding` at both ends, which REMOVES a DOM attribute and so belongs to\n * C10 with its baseline re-record. §E.4's third case.\n *\n * `number | string`, not the `PropTypes.string` the propTypes claim: `Tabs.tsx` DEFAULTS\n * `customPadding` to the NUMBER `0`, and that default is what reaches these templates in\n * the common case. It is falsy, so the `!props.custompadding` arm wins and the padding\n * shorthand is emitted as `padding: 0` / `margin: -2px 0` — correct by accident. A\n * caller-supplied number would emit a unitless `padding: 0 8`, which is why the union is\n * worth stating rather than tidying away.\n */\ninterface TabPaddingStyleProps {\n /** `customPadding` — see the interface JSDoc; both the leak and the union are there. */\n custompadding?: number | string;\n}\n\n/** Props of `TabHeader`, one `<li>` per tab. */\ninterface TabHeaderStyleProps {\n /**\n * `tab.key === activeTab`, derived in the component, so genuinely `boolean`. Read both\n * in the `$active &&` block and inside the two `themeProp()` callbacks below.\n */\n $active?: boolean;\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. §J.4. `prop` needs the annotation\n * because `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const Tabs = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabsStyleProps>(applyDefaultTheme)`\n display: block;\n position: relative;\n ${props =>\n props.$backgroundColor &&\n css`\n background-color: ${props.$backgroundColor};\n `};\n`;\n\nexport const TabHeaders = styled.ul\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabPaddingStyleProps>(applyDefaultTheme)`\n display: flex;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n gap: 24px;\n\n margin: 0;\n ${props =>\n !props.custompadding &&\n css`\n padding: 0;\n `};\n ${props =>\n props.custompadding &&\n css`\n padding: 0 ${props.custompadding};\n `};\n`;\n\nexport const TabHeader = styled.li\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabHeaderStyleProps>(applyDefaultTheme)`\n font-family: ${props => props.theme.secondaryFontFamily};\n text-transform: uppercase;\n font-weight: 600;\n font-size: 0.875rem;\n display: flex;\n padding-bottom: 8px;\n letter-spacing: 0.6px;\n cursor: pointer;\n border-bottom: 1px solid;\n border-color: transparent;\n margin-bottom: 1px;\n\n ${props =>\n props.$active &&\n css`\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-700')\n )}\n `};\n &&:hover:not(:focus) {\n ${props =>\n props.theme.themeProp(\n 'border-color',\n () => {\n if (props.$active) {\n return props.theme.getColor('gray-400');\n } else {\n return props.theme.getColor('gray-400');\n }\n },\n () => {\n if (props.$active) {\n return props.theme.getColor('gray-700');\n } else {\n return props.theme.getColor('gray-700');\n }\n }\n )};\n }\n`;\n\nexport const TabContent = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: block;\n`;\n\nexport const TabHeaderBorder = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabPaddingStyleProps>(applyDefaultTheme)`\n border-top: 1px solid;\n\n ${props => props.theme.themeProp('border-color', props.theme.getColor('gray-600'), '#F0F2F5')};\n ${props =>\n !props.custompadding &&\n css`\n margin: -2px 0;\n `};\n ${props =>\n props.custompadding &&\n css`\n margin: -2px ${props.custompadding};\n `};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Tabs","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$backgroundColor","css","TabHeaders","ul","custompadding","TabHeader","li","theme","secondaryFontFamily","$active","themeProp","getColor","TabContent","TabHeaderBorder"],"mappings":";;;AA4DA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,IAAI,GAAGC,MAAM,CAACC,GAAG,CAC3BC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAiBC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,kBAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,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A,CAEF,EACDF,KAAK,IACLA,KAAK,CAACK,aAAa,IACnBH,GAAG,CAAA,CAAA,cAAA,EAAA,GAAA,CAAA,EACcF,KAAK,CAACK,aAAa,CACnC;;;;"}
1
+ {"version":3,"file":"Tabs.styled.js","sources":["../../../src/components/data/Tabs/Tabs.styled.ts"],"sourcesContent":["/*\n * One deferred defect: `custompadding` has no `$`, so it leaks to rendered HTML. Tabs and Tab are coupled.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/** Props of the `Tabs` root, i.e. what `Tabs.tsx` passes to `S.Tabs`. */\nexport interface TabsStyleProps {\n /** `backgroundColor` — `PropTypes.string`, a CSS colour, interpolated raw. */\n $backgroundColor?: string;\n}\n\n/**\n * Shared by `TabHeaders` and `TabHeaderBorder`. Defect: `custompadding` has no `$`, leaks to DOM. Typed as `number | string` to match component default of 0.\n */\ninterface TabPaddingStyleProps {\n /** `customPadding` — see the interface JSDoc; both the leak and the union are there. */\n custompadding?: number | string;\n}\n\n/** Props of `TabHeader`, one `<li>` per tab. */\ninterface TabHeaderStyleProps {\n /**\n * `tab.key === activeTab`, derived in the component, so genuinely `boolean`. Read both\n * in the `$active &&` block and inside the two `themeProp()` callbacks below.\n */\n $active?: boolean;\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. `prop` needs the annotation because\n * `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const Tabs = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabsStyleProps>(applyDefaultTheme)`\n display: block;\n position: relative;\n ${props =>\n props.$backgroundColor &&\n css`\n background-color: ${props.$backgroundColor};\n `};\n`;\n\nexport const TabHeaders = styled.ul\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabPaddingStyleProps>(applyDefaultTheme)`\n display: flex;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n gap: 24px;\n\n margin: 0;\n ${props =>\n !props.custompadding &&\n css`\n padding: 0;\n `};\n ${props =>\n props.custompadding &&\n css`\n padding: 0 ${props.custompadding};\n `};\n`;\n\nexport const TabHeader = styled.li\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabHeaderStyleProps>(applyDefaultTheme)`\n font-family: ${props => props.theme.secondaryFontFamily};\n text-transform: uppercase;\n font-weight: 600;\n font-size: 0.875rem;\n display: flex;\n padding-bottom: 8px;\n letter-spacing: 0.6px;\n cursor: pointer;\n border-bottom: 1px solid;\n border-color: transparent;\n margin-bottom: 1px;\n\n ${props =>\n props.$active &&\n css`\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-700')\n )}\n `};\n &&:hover:not(:focus) {\n ${props =>\n props.theme.themeProp(\n 'border-color',\n () => {\n if (props.$active) {\n return props.theme.getColor('gray-400');\n } else {\n return props.theme.getColor('gray-400');\n }\n },\n () => {\n if (props.$active) {\n return props.theme.getColor('gray-700');\n } else {\n return props.theme.getColor('gray-700');\n }\n }\n )};\n }\n`;\n\nexport const TabContent = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: block;\n`;\n\nexport const TabHeaderBorder = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<TabPaddingStyleProps>(applyDefaultTheme)`\n border-top: 1px solid;\n\n ${props => props.theme.themeProp('border-color', props.theme.getColor('gray-600'), '#F0F2F5')};\n ${props =>\n !props.custompadding &&\n css`\n margin: -2px 0;\n `};\n ${props =>\n props.custompadding &&\n css`\n margin: -2px ${props.custompadding};\n `};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Tabs","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$backgroundColor","css","TabHeaders","ul","custompadding","TabHeader","li","theme","secondaryFontFamily","$active","themeProp","getColor","TabContent","TabHeaderBorder"],"mappings":";;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,CAAA;EAAAG,WAAA,EAAA,6BAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uBAAA,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,CAAA,EAG7CC,KAAK,IAAIA,KAAK,CAACQ,KAAK,CAACG,SAAS,CAAC,cAAc,EAAEX,KAAK,CAACQ,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,EAC3FZ,KAAK,IACL,CAACA,KAAK,CAACK,aAAa,IACpBH,GAAG,CAAA,CAAA,gBAAA,CAAA,CAEF,EACDF,KAAK,IACLA,KAAK,CAACK,aAAa,IACnBH,GAAG,CAAA,CAAA,cAAA,EAAA,GAAA,CAAA,EACcF,KAAK,CAACK,aAAa,CACnC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../../src/components/data/Tooltip/Tooltip.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingPortal, useMergeRefs } from '@floating-ui/react';\n\nimport useFloatingPopover from '../../../hooks/useFloatingPopover';\nimport { getElementRef } from '../../../utils/getElementRef';\nimport { SharedFloatingArrow, TOOLTIP_ARROW } from '../_shared/FloatingArrow.styled';\nimport * as S from './Tooltip.styled';\n\nimport type { OpenChangeReason } from '@floating-ui/react';\nimport type { PopoverPlacement, PopperOffset } from '../../../hooks/useFloatingPopover';\n\n/**\n * tippy's own defaults for the three props it applied unconditionally and this component\n * never mentioned. All three are OBSERVABLE — they were on every tooltip in both consumers\n * — so they are reproduced rather than dropped. Measured in `tippy.js/dist/tippy.cjs.js`:\n *\n * ```js\n * var renderProps = { …, arrow: true, maxWidth: 350, zIndex: 9999, … };\n * var defaultProps = Object.assign({ …, offset: [0, 10], trigger: 'mouseenter focus', … });\n * ```\n *\n * and applied as\n *\n * ```js\n * box.style.maxWidth = maxWidth + 'px'; // on the box\n * popper.style.zIndex = String(zIndex); // on the positioner\n * popper.style.pointerEvents = interactive ? '' : 'none';\n * ```\n *\n * `maxWidth` is the one most likely to be mistaken for dead. Plan C6 lists it among the\n * props with \"no consumer usage\", which is true of the PROP and false of its EFFECT: tippy\n * wrote `max-width: 350px` onto every box it ever rendered, so it decides where tooltip text\n * wraps. Accepting-but-ignoring it — C6's remedy for `modifiers` and `popperOptions` — would\n * have unwrapped every multi-line tooltip in both apps. It is implemented instead.\n */\nconst TIPPY_DEFAULT_ARROW = true;\nconst TIPPY_DEFAULT_MAX_WIDTH = 350;\nconst TIPPY_DEFAULT_Z_INDEX = 9999;\n\n/**\n * THE OFFSET, AND WHY `Tooltip` PASSES `arrowHeight: 0` WHILE `Popover` PASSES 15.\n *\n * `useFloatingPopover` documents its `offset` as `[skidding, tipGap]` and adds the arrow\n * height back, so that `Popover` can delete the `errorOffset = arrow ? 15 : 0` memo it\n * carried. That convention is correct FOR `Popover` and wrong here, and the difference is\n * not a matter of taste — it is what the two components actually did:\n *\n * - `Popover.tsx` computed `offset={[offset[0], offset[1] + errorOffset]}` and handed the\n * SUM to tippy. Its public `offset` was therefore a tip gap, and the hook absorbing the\n * `+15` keeps that prop meaning what it has always meant.\n * - `Tooltip.tsx` passed NOTHING. tippy's raw default `[0, 10]` applied, and Popper's\n * `offset` modifier is a distance from the reference to the FLOATING BOX with no arrow\n * term anywhere in it. So this component's offset has always been a BOX distance.\n *\n * Feeding a box distance to a hook that adds an arrow height would push every tooltip 7px\n * further out, and — worse — it would move the 6 consumer call sites that pass\n * `arrow={false}` by a DIFFERENT amount from the ones that do not, because tippy's box\n * distance does not depend on whether an arrow is drawn. `arrowHeight: 0` makes the hook's\n * main axis equal `offset[1]` exactly, for both.\n *\n * The result is that both the box and the arrow tip land where they do today: box 10px from\n * the reference, arrow 7px of protrusion (see `TOOLTIP_ARROW`), tip 3px from the reference\n * — which is exactly tippy's 10 − 7 = 3. `arrowHeight` only feeds the offset maths; passing\n * 0 does not stop the arrow being rendered or measured.\n */\nconst TOOLTIP_OFFSET: PopperOffset = [0, 10];\nconst TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY = 0;\n\n/**\n * `max-width: calc(100vw - 10px)`, which `tippy.css` applied through `[data-tippy-root]` —\n * i.e. to the positioner, on top of the box's own 350px. It only binds on a viewport\n * narrower than the tooltip, which is precisely the case it exists for, so it is carried\n * over rather than dropped as unobservable.\n */\nconst POSITIONER_MAX_WIDTH = 'calc(100vw - 10px)';\n\n/**\n * tippy's `appendTo`. `'parent'` and an implicit-parent case are real tippy behaviours, not\n * inventions — measured in `tippy.js/dist/tippy.cjs.js`:\n *\n * ```js\n * if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {\n * parentNode = node.parentNode;\n * } else {\n * parentNode = invokeWithArgsOrReturn(appendTo, [node]);\n * }\n * ```\n *\n * ⚠️ THIS IS A CORRECTION TO PLAN §A3, WHICH RESOLVED C4 ON HALF THE EVIDENCE. §A3 quotes\n * `TIPPY_DEFAULT_APPEND_TO = () => document.body` and concludes that portalling by default\n * is behaviour-preserving. The line above is the other half: when `interactive` is true AND\n * `appendTo` is left at its default, tippy does NOT use that default — it renders INLINE,\n * into the reference's parent. So \"portal by default\" is behaviour-preserving only for\n * non-interactive instances. It is safe for `Tooltip`, whose `interactive` defaults to\n * `false` and which no consumer passes it to (measured across both apps), and it is a rule\n * `Popover` will have to honour, since `Popover` does have interactive call sites.\n */\nexport type TooltipAppendTo = 'parent' | Element | ((reference: Element) => Element);\n\ntype TooltipOwnProps = {\n /**\n * The content of the `Tooltip`.\n *\n * **NB!** If the content is a `string`, it should be wrapped in a tag, e.g.\n * `<span>{content}</span>`. The requirement outlived its original cause — it was a\n * `@tippyjs/react` quirk — but it is kept because consumers have written to it.\n */\n content: string | React.ReactElement<any>;\n /**\n * Determines if the tooltip has interactive content inside of it, so that it can be\n * hovered over and clicked inside without hiding.\n */\n interactive?: boolean;\n /**\n * The preferred placement of the tooltip. Note that the flip middleware can change this\n * to the opposite placement if it has more space.\n */\n placement?: PopoverPlacement;\n /**\n * Duration in ms of the transition animation.\n */\n duration?: number;\n /**\n * Determines the events that cause the tooltip to show. Multiple event names are separated\n * by spaces.\n *\n * *Example events:*\n *\n * `trigger: 'click'`\n *\n * `trigger: 'focusin'`\n *\n * `trigger: 'mouseenter click'`\n *\n * `trigger: 'mouseenter'`\n *\n * Omitting it means `'mouseenter focus'`, and `''` means no triggers at all — both are\n * relied on by consumer code. See `parseTrigger`.\n *\n * --\n */\n trigger?: 'mouseenter' | 'mouseenter focus' | 'click' | 'focusin' | 'mouseenter click' | '';\n /**\n * Determines if the tooltip is visible without trigger.\n *\n * Passing a boolean — **including `false`** — switches the tooltip to CONTROLLED mode and\n * its own triggers stop firing. `undefined` leaves it uncontrolled. `useTooltipAutoShow`\n * depends on that distinction and its `toolTipVisible` is `true | undefined` for exactly\n * this reason.\n */\n visible?: boolean;\n /**\n * Whether the arrow is rendered. Defaults to `true`, which is tippy's default and was\n * therefore already the behaviour; 6 consumer call sites pass `false`.\n */\n arrow?: boolean;\n /**\n * `z-index` of the positioned element. Defaults to 9999, tippy's default. 30 consumer call\n * sites pass this, which is why it is declared here even though it was never in the old\n * prop type — it used to typecheck only because the published `Props` widened to\n * `TippyProps`, and that widening disappears with tippy.\n */\n zIndex?: number;\n /**\n * A disabled tooltip can never open, even under a controlled `visible={true}` — tippy's\n * semantics, and what `useTooltipAutoShow`'s `toolTipDisabled` relies on.\n */\n disabled?: boolean;\n /**\n * `[skidding, distance]`, Popper's convention, where `distance` is the gap between the\n * reference and the tooltip BOX. Defaults to tippy's `[0, 10]`.\n */\n offset?: PopperOffset;\n /**\n * Cap on the box's width, in px. Defaults to 350 — tippy's default, and applied to every\n * tooltip today, so it decides where text wraps.\n */\n maxWidth?: number;\n /**\n * Where the tooltip is rendered. Defaults to `document.body`. See `TooltipAppendTo`.\n */\n appendTo?: TooltipAppendTo;\n /** Fired when a press lands outside both the reference and the tooltip. */\n onClickOutside?: (event?: Event) => void;\n /**\n * @deprecated Accepted and IGNORED. This was a Popper `modifiers` array; Floating UI has\n * middleware instead and the two are not translatable prop-for-prop. Kept so that no\n * existing call site throws — plan C6.\n */\n modifiers?: unknown;\n /**\n * @deprecated Accepted and IGNORED, for the same reason as `modifiers`.\n */\n popperOptions?: unknown;\n children?: React.ReactNode;\n};\n\n/*\n * NMB-3998 §C.2: the rest of `props` is spread onto `S.Tooltip`, so the published type has\n * to admit that target's props too — a closed type here is worse than `any` for the 125\n * consumer files. Declared members win over the base (`Omit` by `keyof TooltipOwnProps`); a\n * bare `&` would INTERSECT a colliding member instead of overriding it, which narrows it or\n * empties it to `never`.\n *\n * THE BASE MOVED, AND THAT IS WHY THE PROP TYPE ABOVE GREW. It used to be\n * `styled(Tippy)`, so this widening admitted every tippy option — which is how `zIndex`,\n * `arrow`, `disabled` and `maxWidth` typechecked at 40 consumer call sites while appearing\n * nowhere in the prop type. `S.Tooltip` is now a `styled.div`, so those four would have\n * become type errors the moment the library starts publishing `.d.ts` (playbook §G.4).\n * Declaring them explicitly is what keeps that promise; the set was taken from a grep of\n * both consumers, per plan §A6's warning not to trust the old prop types.\n */\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.Tooltip>, keyof TooltipOwnProps> &\n TooltipOwnProps;\n\n/**\n * Props that are accepted and then deliberately dropped, in two groups.\n *\n * `onClick` / `onChange` / `onSubmit` — this filter predates the migration and it used to be\n * redundant: `@tippyjs/react` destructures the props it knows and drops the rest, so an\n * `onClick` passed to a `Tooltip` has never fired. It is LOAD-BEARING NOW. The rest of\n * `props` lands on a real element in this implementation, so removing the filter would\n * silently activate handlers that have been dead at every call site that passes one.\n *\n * `modifiers` / `popperOptions` — plan C6. Popper concepts with no Floating UI translation\n * and no consumer usage, kept accepted-but-ignored so that no existing call site throws.\n * They are filtered here rather than destructured above because destructuring them would\n * bind names nothing reads, which is a lint error, and because \"the list of props that never\n * reach the DOM\" is worth having in exactly one place.\n */\nconst PROPS_NEVER_FORWARDED = ['onClick', 'onChange', 'onSubmit', 'modifiers', 'popperOptions'];\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n *\n * ### Import\n *\n * ``` js\n * import { Tooltip } from '@ntbjs/react-components/data'\n * // or\n * import Tooltip from '@ntbjs/react-components/data/Tooltip'\n * ```\n */\nconst Tooltip = React.forwardRef<any, Props>(function Tooltip(\n {\n content = 'Tooltip',\n interactive = false,\n placement = 'top',\n duration = 350,\n trigger,\n visible,\n children,\n arrow: hasArrow = TIPPY_DEFAULT_ARROW,\n zIndex = TIPPY_DEFAULT_Z_INDEX,\n disabled = false,\n offset = TOOLTIP_OFFSET,\n maxWidth = TIPPY_DEFAULT_MAX_WIDTH,\n appendTo,\n onClickOutside,\n ...props\n },\n ref\n) {\n const onOpenChange = React.useCallback(\n (open: boolean, event?: Event, reason?: OpenChangeReason) => {\n if (!open && reason === 'outside-press') {\n onClickOutside?.(event);\n }\n },\n [onClickOutside]\n );\n\n const {\n refs,\n floatingStyles,\n context,\n getReferenceProps,\n getFloatingProps,\n isMounted,\n transitionStyles,\n arrowRef,\n placement: resolvedPlacement,\n pointerEvents\n } = useFloatingPopover({\n placement,\n open: visible,\n onOpenChange,\n trigger,\n offset,\n arrow: hasArrow,\n arrowHeight: TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY,\n interactive,\n disabled,\n duration\n });\n\n /*\n * The reference is the CHILD, not the wrapper `<div>`, and that is a compatibility\n * requirement rather than a preference. `@tippyjs/react` does\n * `cloneElement(children, { ref })` and attaches its listeners to the resulting node, so\n * every tooltip in both consumers is positioned against the child's box. The wrapper is a\n * plain block `<div>`, which in most layouts is far wider than the child — anchoring to it\n * would re-centre every tooltip that is not in a flex row.\n *\n * The ref is merged three ways: this component's own forwarded `ref`, the child's existing\n * `ref`, and `refs.setReference`. `useMergeRefs` returns `null` when every input is\n * nullish, which `cloneElement` treats as \"no ref\" — the case that matters for a child\n * that cannot take one.\n *\n * `ref` GOES SOMEWHERE REAL FOR THE FIRST TIME. It used to be handed to `styled(Tippy)`,\n * and `Tippy` is a plain function component, so React had nowhere to put it. Plan risk #9\n * asks for `forwardRef` onto the reference and this is it; no consumer passes `ref` to a\n * `Tooltip` (measured over both apps), so nothing observable changes.\n *\n * The CHILD's ref is a different measurement, and it is live: `inputs/CompactTextInput`\n * renders `<S.Input ref={forwardedRef}>` as this tooltip's child on the `!link` branch, and\n * `ntb-dam/client` passes react-hook-form's `field.ref` that way on React 16.14. Reading\n * it as `children.props.ref` yields `undefined` before React 19, so the `cloneElement`\n * below overwrote it — see `getElementRef`. tippy merged it via `preserveRef`.\n */\n const childRef = React.isValidElement(children) ? getElementRef(children) : null;\n const referenceRef = useMergeRefs([ref, childRef, refs.setReference]);\n\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => !PROPS_NEVER_FORWARDED.includes(key))\n );\n\n /*\n * `getReferenceProps(children.props)` and not `getReferenceProps()`: Floating UI COMPOSES\n * the handlers it needs with the ones already on the element, so a child that has its own\n * `onMouseEnter` keeps it. tippy did not need this — it attached native listeners straight\n * to the DOM node and never touched the child's props — so passing the child's props\n * through is what reproduces \"the child's own handlers still work\".\n */\n const reference = React.isValidElement(children)\n ? React.cloneElement(\n children as React.ReactElement<Record<string, unknown>>,\n {\n ...getReferenceProps((children as React.ReactElement<Record<string, unknown>>).props),\n ref: referenceRef\n } as never\n )\n : children;\n\n /*\n * tippy's appendTo resolution, reproduced. `'parent'`, and `interactive` with no explicit\n * `appendTo`, render INLINE; everything else portals. See `TooltipAppendTo` for the\n * measurement and for what it corrects in plan §A3.\n */\n const renderInline = appendTo === 'parent' || (interactive && appendTo === undefined);\n\n /*\n * Deliberately NOT memoised. The function form of `appendTo` is resolved against the\n * reference node, which is populated by a callback ref and is therefore `null` on the\n * first render; a `useMemo` keyed on `refs.reference.current` would be reading a ref\n * during render to decide whether to recompute, which is the one thing a memo cannot do\n * correctly. Recomputing every render costs a comparison and is always right.\n *\n * ⚠️ `undefined` AND `null` ARE NOT INTERCHANGEABLE HERE, AND GETTING IT WRONG SILENTLY\n * DELETES THE TOOLTIP. `FloatingPortal`'s `root` is typed `HTMLElement | null | ref`,\n * which reads as though `null` were the \"no root given\" value. It is not — measured in\n * `useFloatingPortalNode`:\n *\n * ```js\n * // Wait for the root to exist before creating the portal node.\n * if (root === null) return;\n * …\n * container = container || document.body;\n * ```\n *\n * `null` means \"the root does not exist YET, do not create the portal node\", and the\n * effect simply returns. Only `undefined` falls through to the `|| document.body`\n * default. Returning `null` for the ordinary no-`appendTo` case therefore produced a\n * tooltip that mounted its positioner into nothing and never appeared — caught by the\n * visual gate as the `Visible` story rendering its trigger and no tooltip, and NOT caught\n * by the render gate, whose fixture reaches the inline path instead.\n *\n * The one place `null` is right is the genuine \"not resolvable yet\" case below: a\n * function `appendTo` cannot be called until the reference exists, and `null` correctly\n * defers the portal until it does rather than briefly portalling to the wrong parent.\n */\n const resolvePortalRoot = (): HTMLElement | null | undefined => {\n if (renderInline || appendTo === undefined) return undefined;\n if (typeof appendTo === 'function') {\n const node = refs.reference.current;\n return node instanceof Element ? (appendTo(node) as HTMLElement) : null;\n }\n return appendTo as HTMLElement;\n };\n\n const floating = isMounted ? (\n <div\n ref={refs.setFloating}\n style={{ ...floatingStyles, zIndex, pointerEvents, maxWidth: POSITIONER_MAX_WIDTH }}\n {...getFloatingProps()}\n >\n {/*\n * `{...filteredProps}` FIRST and the explicit attributes after, so that a colliding\n * `style` or `className` cannot displace the transition styles or the placement\n * attribute. Under tippy those collisions resolved by being dropped entirely; keeping\n * this element's own values winning is the closest equivalent, and it still lets\n * `data-*` / `aria-*` through to the box, which is where tippy put `className` too.\n */}\n <S.Tooltip\n {...filteredProps}\n data-placement={resolvedPlacement}\n role=\"tooltip\"\n tabIndex={-1}\n style={{ ...transitionStyles, maxWidth }}\n >\n <div className=\"tippy-content\">{content}</div>\n {hasArrow && (\n <SharedFloatingArrow\n ref={arrowRef}\n context={context}\n data-arrow-surface=\"tooltip\"\n {...TOOLTIP_ARROW}\n />\n )}\n </S.Tooltip>\n </div>\n ) : null;\n\n /*\n * The bare wrapper `<div>` is preserved verbatim — plan risk #9. It carries no props and\n * no styling, and it is load-bearing for consumers only in that `TextArea` and\n * `CompactTextInput` hang an `onMouseLeave` on a div of their own immediately outside it.\n */\n return (\n <div>\n {reference}\n {renderInline ? (\n floating\n ) : (\n <FloatingPortal root={resolvePortalRoot()}>{floating}</FloatingPortal>\n )}\n </div>\n );\n});\n\nexport default Tooltip;\n"],"names":["TIPPY_DEFAULT_ARROW","TIPPY_DEFAULT_MAX_WIDTH","TIPPY_DEFAULT_Z_INDEX","TOOLTIP_OFFSET","TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY","POSITIONER_MAX_WIDTH","PROPS_NEVER_FORWARDED","Tooltip","React","forwardRef","content","interactive","placement","duration","trigger","visible","children","arrow","hasArrow","zIndex","disabled","offset","maxWidth","appendTo","onClickOutside","props","ref","onOpenChange","useCallback","open","event","reason","refs","floatingStyles","context","getReferenceProps","getFloatingProps","isMounted","transitionStyles","arrowRef","resolvedPlacement","pointerEvents","useFloatingPopover","arrowHeight","childRef","isValidElement","getElementRef","referenceRef","useMergeRefs","setReference","filteredProps","Object","fromEntries","entries","filter","key","includes","reference","cloneElement","renderInline","undefined","resolvePortalRoot","node","current","Element","floating","_jsx","setFloating","style","_jsxs","S","role","tabIndex","className","SharedFloatingArrow","TOOLTIP_ARROW","FloatingPortal","root"],"mappings":";;;;;;;;AAoCA,MAAMA,mBAAmB,GAAG,IAAI;AAChC,MAAMC,uBAAuB,GAAG,GAAG;AACnC,MAAMC,qBAAqB,GAAG,IAAI;AA4BlC,MAAMC,cAA4B,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AAC5C,MAAMC,6CAA6C,GAAG,CAAC;AAQvD,MAAMC,oBAAoB,GAAG,oBAAoB;AA4JjD,MAAMC,qBAAqB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,CAAC;AAa/F,MAAMC,OAAO,GAAGC,cAAK,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sB,aAAa;AAAEnB,MAAAA,QAAQ,EAAEjB;KAAuB;IAAA,GAChF+B,gBAAgB,EAAE;AAAApB,IAAAA,QAAA,EAStBqD,IAAA,CAACC,SAAS,EAAA;AAAA,MAAA,GACJpB,aAAa;AACjB,MAAA,gBAAA,EAAgBV,iBAAkB;AAClC+B,MAAAA,IAAI,EAAC,SAAS;MACdC,QAAQ,EAAE,EAAG;AACbJ,MAAAA,KAAK,EAAE;AAAE,QAAA,GAAG9B,gBAAgB;AAAEhB,QAAAA;OAAW;AAAAN,MAAAA,QAAA,GAEzCkD,GAAA,CAAA,KAAA,EAAA;AAAKO,QAAAA,SAAS,EAAC,eAAe;AAAAzD,QAAAA,QAAA,EAAEN;AAAO,OAAM,CAAC,EAC7CQ,QAAQ,IACPgD,GAAA,CAACQ,mBAAmB,EAAA;AAClBhD,QAAAA,GAAG,EAAEa,QAAS;AACdL,QAAAA,OAAO,EAAEA,OAAQ;AACjB,QAAA,oBAAA,EAAmB,SAAS;QAAA,GACxByC;AAAa,OAClB,CACF;KACQ;GACR,CAAC,GACJ,IAAI;AAOR,EAAA,OACEN,IAAA,CAAA,KAAA,EAAA;IAAArD,QAAA,EAAA,CACGyC,SAAS,EACTE,YAAY,GACXM,QAAQ,GAERC,GAAA,CAACU,cAAc,EAAA;MAACC,IAAI,EAAEhB,iBAAiB,EAAG;AAAA7C,MAAAA,QAAA,EAAEiD;AAAQ,KAAiB,CACtE;AAAA,GACE,CAAC;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../src/components/data/Tooltip/Tooltip.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingPortal, useMergeRefs } from '@floating-ui/react';\n\nimport useFloatingPopover from '../../../hooks/useFloatingPopover';\nimport { getElementRef } from '../../../utils/getElementRef';\nimport { SharedFloatingArrow, TOOLTIP_ARROW } from '../_shared/FloatingArrow.styled';\nimport * as S from './Tooltip.styled';\n\nimport type { OpenChangeReason } from '@floating-ui/react';\nimport type { PopoverPlacement, PopperOffset } from '../../../hooks/useFloatingPopover';\n\n// tippy's observable defaults: arrow=true, maxWidth=350 (decides wrap), zIndex=9999. All reproduced, not dropped.\nconst TIPPY_DEFAULT_ARROW = true;\nconst TIPPY_DEFAULT_MAX_WIDTH = 350;\nconst TIPPY_DEFAULT_Z_INDEX = 9999;\n\n// Tooltip offset is box distance (not tip gap like Popover); arrowHeight: 0 keeps hook's axis equal to offset[1] exactly.\nconst TOOLTIP_OFFSET: PopperOffset = [0, 10];\nconst TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY = 0;\n\n// tippy.css applied this viewport cap through [data-tippy-root] (the positioner), carried over.\nconst POSITIONER_MAX_WIDTH = 'calc(100vw - 10px)';\n\n// tippy's three-way appendTo: given value portals, absent+interactive=true renders INLINE, absent+interactive=false portals to body. Safe for Tooltip (interactive defaults false).\nexport type TooltipAppendTo = 'parent' | Element | ((reference: Element) => Element);\n\ntype TooltipOwnProps = {\n /**\n * The content of the `Tooltip`.\n *\n * **NB!** If the content is a `string`, it should be wrapped in a tag, e.g.\n * `<span>{content}</span>`. The requirement outlived its original cause — it was a\n * `@tippyjs/react` quirk — but it is kept because consumers have written to it.\n */\n content: string | React.ReactElement<any>;\n /**\n * Determines if the tooltip has interactive content inside of it, so that it can be\n * hovered over and clicked inside without hiding.\n */\n interactive?: boolean;\n /**\n * The preferred placement of the tooltip. Note that the flip middleware can change this\n * to the opposite placement if it has more space.\n */\n placement?: PopoverPlacement;\n /**\n * Duration in ms of the transition animation.\n */\n duration?: number;\n /**\n * Events that cause the tooltip to show (space-separated). Defaults to `'mouseenter focus'`, `''` means no triggers.\n */\n trigger?: 'mouseenter' | 'mouseenter focus' | 'click' | 'focusin' | 'mouseenter click' | '';\n /**\n * Pass a boolean to control visibility; both `true` and `false` disable native triggers. `undefined` leaves uncontrolled.\n */\n visible?: boolean;\n /**\n * Whether the arrow is rendered. Defaults to `true`, which is tippy's default and was\n * therefore already the behaviour; 6 consumer call sites pass `false`.\n */\n arrow?: boolean;\n /**\n * `z-index` of the positioned element (default: 9999, tippy's default).\n */\n zIndex?: number;\n /**\n * Disabled tooltip can never open, even under controlled `visible={true}` (tippy semantics).\n */\n disabled?: boolean;\n /**\n * `[skidding, distance]`, Popper's convention, where `distance` is the gap between the\n * reference and the tooltip BOX. Defaults to tippy's `[0, 10]`.\n */\n offset?: PopperOffset;\n /**\n * Cap on the box's width, in px. Defaults to 350 — tippy's default, and applied to every\n * tooltip today, so it decides where text wraps.\n */\n maxWidth?: number;\n /**\n * Where the tooltip is rendered. Defaults to `document.body`. See `TooltipAppendTo`.\n */\n appendTo?: TooltipAppendTo;\n /** Fired when a press lands outside both the reference and the tooltip. */\n onClickOutside?: (event?: Event) => void;\n /**\n * @deprecated Accepted and IGNORED. This was a Popper `modifiers` array; Floating UI has\n * middleware instead and the two are not translatable prop-for-prop. Kept so that no\n * existing call site throws — plan C6.\n */\n modifiers?: unknown;\n /**\n * @deprecated Accepted and IGNORED, for the same reason as `modifiers`.\n */\n popperOptions?: unknown;\n children?: React.ReactNode;\n};\n\n// Props spreads onto S.Tooltip, so published type must admit its props. Base moved from styled(Tippy) to styled.div, requiring explicit declaration of zIndex, arrow, disabled, maxWidth.\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.Tooltip>, keyof TooltipOwnProps> &\n TooltipOwnProps;\n\n// Props accepted-but-ignored: onClick/onChange/onSubmit filter is load-bearing (would activate dead handlers); modifiers/popperOptions are plan C6 deprecations.\nconst PROPS_NEVER_FORWARDED = ['onClick', 'onChange', 'onSubmit', 'modifiers', 'popperOptions'];\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n *\n * ### Import\n *\n * ``` js\n * import { Tooltip } from '@ntbjs/react-components/data'\n * // or\n * import Tooltip from '@ntbjs/react-components/data/Tooltip'\n * ```\n */\nconst Tooltip = React.forwardRef<any, Props>(function Tooltip(\n {\n content = 'Tooltip',\n interactive = false,\n placement = 'top',\n duration = 350,\n trigger,\n visible,\n children,\n arrow: hasArrow = TIPPY_DEFAULT_ARROW,\n zIndex = TIPPY_DEFAULT_Z_INDEX,\n disabled = false,\n offset = TOOLTIP_OFFSET,\n maxWidth = TIPPY_DEFAULT_MAX_WIDTH,\n appendTo,\n onClickOutside,\n ...props\n },\n ref\n) {\n const onOpenChange = React.useCallback(\n (open: boolean, event?: Event, reason?: OpenChangeReason) => {\n if (!open && reason === 'outside-press') {\n onClickOutside?.(event);\n }\n },\n [onClickOutside]\n );\n\n const {\n refs,\n floatingStyles,\n context,\n getReferenceProps,\n getFloatingProps,\n isMounted,\n transitionStyles,\n arrowRef,\n placement: resolvedPlacement,\n pointerEvents\n } = useFloatingPopover({\n placement,\n open: visible,\n onOpenChange,\n trigger,\n offset,\n arrow: hasArrow,\n arrowHeight: TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY,\n interactive,\n disabled,\n duration\n });\n\n // Reference is the CHILD (not wrapper) for positioning compat; ref merges forwarded ref, child's ref, and setReference.\n const childRef = React.isValidElement(children) ? getElementRef(children) : null;\n const referenceRef = useMergeRefs([ref, childRef, refs.setReference]);\n\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => !PROPS_NEVER_FORWARDED.includes(key))\n );\n\n // Floating UI composes handlers with existing ones, so child's own handlers still work.\n const reference = React.isValidElement(children)\n ? React.cloneElement(\n children as React.ReactElement<Record<string, unknown>>,\n {\n ...getReferenceProps((children as React.ReactElement<Record<string, unknown>>).props),\n ref: referenceRef\n } as never\n )\n : children;\n\n // Inline rendering: 'parent' or (interactive && no explicit appendTo).\n const renderInline = appendTo === 'parent' || (interactive && appendTo === undefined);\n\n // null/undefined NOT interchangeable: undefined→document.body default, null→defer until reference exists.\n const resolvePortalRoot = (): HTMLElement | null | undefined => {\n if (renderInline || appendTo === undefined) return undefined;\n if (typeof appendTo === 'function') {\n const node = refs.reference.current;\n return node instanceof Element ? (appendTo(node) as HTMLElement) : null;\n }\n return appendTo as HTMLElement;\n };\n\n const floating = isMounted ? (\n <div\n ref={refs.setFloating}\n style={{ ...floatingStyles, zIndex, pointerEvents, maxWidth: POSITIONER_MAX_WIDTH }}\n {...getFloatingProps()}\n >\n {/*\n * filteredProps first so explicit attrs can't override transition/placement styles.\n */}\n <S.Tooltip\n {...filteredProps}\n data-placement={resolvedPlacement}\n role=\"tooltip\"\n tabIndex={-1}\n style={{ ...transitionStyles, maxWidth }}\n >\n <div className=\"tippy-content\">{content}</div>\n {hasArrow && (\n <SharedFloatingArrow\n ref={arrowRef}\n context={context}\n data-arrow-surface=\"tooltip\"\n {...TOOLTIP_ARROW}\n />\n )}\n </S.Tooltip>\n </div>\n ) : null;\n\n // Bare wrapper preserved for compat; load-bearing for TextArea/CompactTextInput onMouseLeave.\n return (\n <div>\n {reference}\n {renderInline ? (\n floating\n ) : (\n <FloatingPortal root={resolvePortalRoot()}>{floating}</FloatingPortal>\n )}\n </div>\n );\n});\n\nexport default Tooltip;\n"],"names":["TIPPY_DEFAULT_ARROW","TIPPY_DEFAULT_MAX_WIDTH","TIPPY_DEFAULT_Z_INDEX","TOOLTIP_OFFSET","TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY","POSITIONER_MAX_WIDTH","PROPS_NEVER_FORWARDED","Tooltip","React","forwardRef","content","interactive","placement","duration","trigger","visible","children","arrow","hasArrow","zIndex","disabled","offset","maxWidth","appendTo","onClickOutside","props","ref","onOpenChange","useCallback","open","event","reason","refs","floatingStyles","context","getReferenceProps","getFloatingProps","isMounted","transitionStyles","arrowRef","resolvedPlacement","pointerEvents","useFloatingPopover","arrowHeight","childRef","isValidElement","getElementRef","referenceRef","useMergeRefs","setReference","filteredProps","Object","fromEntries","entries","filter","key","includes","reference","cloneElement","renderInline","undefined","resolvePortalRoot","node","current","Element","floating","_jsx","setFloating","style","_jsxs","S","role","tabIndex","className","SharedFloatingArrow","TOOLTIP_ARROW","FloatingPortal","root"],"mappings":";;;;;;;;AAaA,MAAMA,mBAAmB,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,GACE,CAAC;AAEV,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.styled.js","sources":["../../../src/components/data/Tooltip/Tooltip.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * NO TRANSIENT PROP IS READ HERE — every interpolation reads only `props.theme`, which\n * `ExecutionContext` already supplies via the C6 `DefaultTheme` augmentation.\n *\n * ================== WHAT REPLACED WHAT, AND THE TWO THINGS THAT CAME BACK ==================\n *\n * This file used to be `styled(Tippy)`, so the class it generated landed on tippy's\n * `.tippy-box` and the rules below were only ever the OVERRIDES — the base came from\n * `tippy.js/dist/tippy.css`, which this file imported. Dropping tippy therefore drops a\n * base stylesheet nobody had written down, and two of its declarations were load-bearing:\n *\n * .tippy-box { position: relative; background-color: #333; color: #fff;\n * border-radius: 4px; font-size: 14px; line-height: 1.4;\n * white-space: normal; outline: 0; transition-property: ... }\n *\n * - `color: #fff` is where the tooltip's WHITE TEXT came from. Nothing in the old version\n * of this file set a colour; had it been dropped silently the text would have fallen back\n * to inherited, i.e. near-black on `gray-700` in the light theme. `white` is `#ffffff`\n * in `colors-export.js`, the same colour, so it is written as the token.\n * - `position: relative` is the ARROW'S CONTAINING BLOCK. `FloatingArrow` positions its\n * `<svg>` at `[side]: 100%`, which resolves against the nearest positioned ancestor; with\n * a static box the arrow would escape to the viewport.\n *\n * `line-height: 1.4`, `white-space: normal` and `outline: 0` are carried over for the same\n * reason — they were in force and are not defaults. The three declarations that were\n * genuinely overridden (`background-color`, `border-radius`, `font-size`) keep the\n * overriding values and tippy's are simply gone.\n *\n * WHAT WAS DELIBERATELY NOT CARRIED OVER, so the next reader does not \"restore\" it:\n *\n * - `pointer-events: default !important`. `default` is not a value of `pointer-events`\n * (the valid set is auto | none | visiblePainted | visibleFill | visibleStroke | visible\n * | painted | fill | stroke | all | inherit), so the declaration was invalid and the\n * browser dropped it. It has never had any effect. The real mechanism is tippy's\n * `popper.style.pointerEvents = interactive ? '' : 'none'`, which now lives on the\n * positioner in `Tooltip.tsx` where the hook reports it.\n * - `transition-property`. `useTransitionStyles` emits its own transition shorthand inline\n * on this element, so a stylesheet declaration would be overridden on every render.\n * - `.tippy-arrow { color: … }`. tippy drew the arrow as a CSS border triangle, and\n * `border-*-color: initial` resolves to `currentColor` — which is why the arrow colour\n * was set through `color`. The arrow is now an SVG and is filled by\n * `FloatingArrow.styled.ts`'s `tooltip` surface, with the same `gray-700`.\n *\n * ================== WHY `.tippy-content` IS STILL CALLED `.tippy-content` ==================\n *\n * It is a deliberate compatibility shim, not a leftover. `src/sass/components/popover.scss`\n * in BOTH consumers targets that class name, so renaming it needs coordinated PRs in two\n * repos — plan C2/§A4. `Tooltip.tsx` renders exactly one such element.\n *\n * It keeps `position: relative` and `z-index: 1` as well as the padding, because\n * `tippy.css`'s own `.tippy-content` rule supplied those and that stylesheet is still in\n * the bundle (`Popover.styled.ts` imports it until Popover migrates too). Declaring them\n * here means this component does not silently change the day that import goes away.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and the\n * two majors disagree on the second parameter. §J.4.\n *\n * IT IS ALSO NOW MANDATORY RATHER THAN OPTIONAL, WHICH FIXES A DECLARED DEFECT. The old\n * version of this file was one of only two of the 36 styled files with no\n * `shouldForwardProp`, and its header recorded the consequence: nothing filtered props, so\n * the `theme` OBJECT that `.attrs(applyDefaultTheme)` injects was handed to\n * `@tippyjs/react`, which did `box.setAttribute('data-theme', theme)` for any truthy theme\n * and put `data-theme=\"[object Object]\"` on the live box. The root here is a plain\n * `styled.div`, so without this predicate that same object would be written to the DOM as\n * `theme=\"[object Object]\"` — `theme` is all-lowercase, so React 19 does NOT drop it the\n * way it drops unknown camelCase props. The fix the old header asked for is therefore not a\n * follow-up; it is a precondition of this rewrite.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * The tooltip box — what `.tippy-box` was.\n *\n * `Tooltip.tsx` puts the transition styles and the `max-width` on this element inline and\n * the POSITION on its parent, matching the split tippy used (animated box inside a\n * Popper-positioned root) and the one the three existing Floating UI sites use.\n */\nexport const Tooltip = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n outline: 0;\n white-space: normal;\n line-height: 1.4;\n color: ${props => props.theme.getColor('white')};\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 400;\n background: ${props => props.theme.getColor('gray-700')};\n border-radius: 3px;\n\n .tippy-content {\n position: relative;\n z-index: 1;\n padding: 9px 12px;\n }\n\n a {\n color: inherit;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Tooltip","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","getColor","primaryFontFamily"],"mappings":";;;AA4EA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AASM,MAAMC,OAAO,GAAGC,MAAM,CAACC,GAAG,CAC9BC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,wBAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uEAAA,EAAA,eAAA,EAAA,6CAAA,EAAA,mGAAA,CAAA,EAKhBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAChCF,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACE,iBAAiB,EAGvCH,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC;;;;"}
1
+ {"version":3,"file":"Tooltip.styled.js","sources":["../../../src/components/data/Tooltip/Tooltip.styled.ts"],"sourcesContent":["// Carries two load-bearing styles from tippy.css: color:white and position:relative (arrow container). Also line-height, white-space, outline. Arrow CSS replaced by SVG (FloatingArrow.styled.ts).\n\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n// Mandatory (not optional) to filter theme object from DOM; fixes declared defect where theme was written as `data-theme=\"[object Object]\"`.\n\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * The tooltip box — what `.tippy-box` was.\n *\n * `Tooltip.tsx` puts the transition styles and the `max-width` on this element inline and\n * the POSITION on its parent, matching the split tippy used (animated box inside a\n * Popper-positioned root) and the one the three existing Floating UI sites use.\n */\nexport const Tooltip = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n outline: 0;\n white-space: normal;\n line-height: 1.4;\n color: ${props => props.theme.getColor('white')};\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 400;\n background: ${props => props.theme.getColor('gray-700')};\n border-radius: 3px;\n\n .tippy-content {\n position: relative;\n z-index: 1;\n padding: 9px 12px;\n }\n\n a {\n color: inherit;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Tooltip","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","getColor","primaryFontFamily"],"mappings":";;;AAOA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AASM,MAAMC,OAAO,GAAGC,MAAM,CAACC,GAAG,CAC9BC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,wBAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uEAAA,EAAA,eAAA,EAAA,6CAAA,EAAA,mGAAA,CAAA,EAKhBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAChCF,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACE,iBAAiB,EAGvCH,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerificationStatusIcon.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './VerificationStatusIcon.styled';\nimport { VerificationIcon } from '../../../icons';\n\ntype VerificationStatusIconOwnProps = {\n /**\n * Status of the verification\n */\n status: 'verified' | 'pending' | 'rejected' | 'mixed';\n /**\n * Custom height of the icon\n */\n iconHeight?: number;\n /**\n * If Icon has background\n */\n background?: boolean;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.VerificationStatusIcon`, so the published type\n * has to admit that target's props too — a closed type here is worse than `any` for the\n * 125 consumer files. Declared members win over the base (`Omit` by `keyof VerificationStatusIconOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.VerificationStatusIcon>,\n keyof VerificationStatusIconOwnProps\n> &\n VerificationStatusIconOwnProps;\n\n/**\n * A compact icon showing verification status with color coding.\n *\n * ### Import\n *\n * ``` js\n * import { VerificationStatusIcon } from '@ntbjs/react-components/data'\n * // or\n * import VerificationStatusIcon from '@ntbjs/react-components/data/VerificationStatusIcon'\n * ```\n *\n * ### Props\n * ```\n * Pass one of \"verified\", \"pending\" or \"rejected\" to `status` to display the correct verification status.\n * Pass `iconHeight={15}` to set the height of the icon in pixel\n * ```\n */\nconst VerificationStatusIcon = React.forwardRef<any, Props>(function VerificationStatusIcon(\n { status, iconHeight = 15, background = false, ...props },\n forwardedRef\n) {\n return (\n <S.VerificationIconWrapper $background={background}>\n <S.VerificationStatusIcon\n $iconHeight={iconHeight}\n $background={background}\n ref={forwardedRef}\n {...props}\n >\n <VerificationIcon />\n <S.VerificationStatusColor\n $iconHeight={iconHeight}\n $status={status}\n $background={background}\n />\n </S.VerificationStatusIcon>\n </S.VerificationIconWrapper>\n );\n});\n\nexport default VerificationStatusIcon;\n"],"names":["VerificationStatusIcon","React","forwardRef","status","iconHeight","background","props","forwardedRef","_jsx","S","$background","children","_jsxs","$iconHeight","ref","VerificationIcon","$status"],"mappings":";;;;;AAiDA,MAAMA,sBAAsB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,sBAAsBA,CACzF;EAAEG,MAAM;AAAEC,EAAAA,UAAU,GAAG,EAAE;AAAEC,EAAAA,UAAU,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EACzDC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAyB,EAAA;AAACC,IAAAA,WAAW,EAAEL,UAAW;AAAAM,IAAAA,QAAA,EACjDC,IAAA,CAACH,wBAAwB,EAAA;AACvBI,MAAAA,WAAW,EAAET,UAAW;AACxBM,MAAAA,WAAW,EAAEL,UAAW;AACxBS,MAAAA,GAAG,EAAEP,YAAa;AAAA,MAAA,GACdD,KAAK;MAAAK,QAAA,EAAA,CAETH,GAAA,CAACO,eAAgB,EAAA,EAAE,CAAC,EACpBP,GAAA,CAACC,uBAAyB,EAAA;AACxBI,QAAAA,WAAW,EAAET,UAAW;AACxBY,QAAAA,OAAO,EAAEb,MAAO;AAChBO,QAAAA,WAAW,EAAEL;AAAW,OACzB,CAAC;KACsB;AAAC,GACF,CAAC;AAEhC,CAAC;;;;"}
1
+ {"version":3,"file":"VerificationStatusIcon.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './VerificationStatusIcon.styled';\nimport { VerificationIcon } from '../../../icons';\n\ntype VerificationStatusIconOwnProps = {\n /**\n * Status of the verification\n */\n status: 'verified' | 'pending' | 'rejected' | 'mixed';\n /**\n * Custom height of the icon\n */\n iconHeight?: number;\n /**\n * If Icon has background\n */\n background?: boolean;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.VerificationStatusIcon>,\n keyof VerificationStatusIconOwnProps\n> &\n VerificationStatusIconOwnProps;\n\n/**\n * A compact icon showing verification status with color coding.\n *\n * ### Import\n *\n * ``` js\n * import { VerificationStatusIcon } from '@ntbjs/react-components/data'\n * // or\n * import VerificationStatusIcon from '@ntbjs/react-components/data/VerificationStatusIcon'\n * ```\n *\n * ### Props\n * ```\n * Pass one of \"verified\", \"pending\" or \"rejected\" to `status` to display the correct verification status.\n * Pass `iconHeight={15}` to set the height of the icon in pixel\n * ```\n */\nconst VerificationStatusIcon = React.forwardRef<any, Props>(function VerificationStatusIcon(\n { status, iconHeight = 15, background = false, ...props },\n forwardedRef\n) {\n return (\n <S.VerificationIconWrapper $background={background}>\n <S.VerificationStatusIcon\n $iconHeight={iconHeight}\n $background={background}\n ref={forwardedRef}\n {...props}\n >\n <VerificationIcon />\n <S.VerificationStatusColor\n $iconHeight={iconHeight}\n $status={status}\n $background={background}\n />\n </S.VerificationStatusIcon>\n </S.VerificationIconWrapper>\n );\n});\n\nexport default VerificationStatusIcon;\n"],"names":["VerificationStatusIcon","React","forwardRef","status","iconHeight","background","props","forwardedRef","_jsx","S","$background","children","_jsxs","$iconHeight","ref","VerificationIcon","$status"],"mappings":";;;;;AA2CA,MAAMA,sBAAsB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,sBAAsBA,CACzF;EAAEG,MAAM;AAAEC,EAAAA,UAAU,GAAG,EAAE;AAAEC,EAAAA,UAAU,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EACzDC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAyB,EAAA;AAACC,IAAAA,WAAW,EAAEL,UAAW;AAAAM,IAAAA,QAAA,EACjDC,IAAA,CAACH,wBAAwB,EAAA;AACvBI,MAAAA,WAAW,EAAET,UAAW;AACxBM,MAAAA,WAAW,EAAEL,UAAW;AACxBS,MAAAA,GAAG,EAAEP,YAAa;AAAA,MAAA,GACdD,KAAK;MAAAK,QAAA,EAAA,CAETH,GAAA,CAACO,eAAgB,EAAA,EAAE,CAAC,EACpBP,GAAA,CAACC,uBAAyB,EAAA;AACxBI,QAAAA,WAAW,EAAET,UAAW;AACxBY,QAAAA,OAAO,EAAEb,MAAO;AAChBO,QAAAA,WAAW,EAAEL;AAAW,OACzB,CAAC;KACsB;AAAC,GACF,CAAC;AAEhC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerificationStatusIcon.styled.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * ONE DEFERRED DEFECT AND ONE COSMETIC ODDITY, NEITHER FIXED HERE:\n *\n * - `VerificationStatusIcon` reads `props.iconHeight` for its `svg` height, but the\n * component passes `$iconHeight`. See `VerificationStatusIconStyleProps`.\n * - `VerificationIconWrapper`'s interpolated block below contains a STRAY `}` on its\n * own line, after `border-radius: 15px;`. It is a typo, it is in the recorded\n * baseline, and removing it changes the emitted css text — so it belongs to a commit\n * that re-records, not to a type-only one.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/**\n * Shared by all three components: `VerificationStatusIcon.tsx` passes `$background` to\n * every one of them. Only `VerificationIconWrapper` and `VerificationStatusIcon` read it;\n * on `VerificationStatusColor` it is passed and never read, which is harmless because the\n * `$` means `shouldForwardProp` filters it before both the CSS and the DOM.\n */\ninterface VerificationBackgroundStyleProps {\n /** `background` — `PropTypes.bool`; swaps in the black pill and the light icon colour. */\n $background?: boolean;\n}\n\n/**\n * Props of the `VerificationStatusIcon` element.\n *\n * DEFECT, DECLARED NOT FIXED: `iconHeight` in its non-`$` form is what the `svg` rule\n * below reads, and NOTHING PASSES IT — `VerificationStatusIcon.tsx` passes `$iconHeight`,\n * which this component never reads. So the `?? 15` fallback is unconditional and the icon\n * is 15px tall no matter what a caller asks for, WHILE `VerificationStatusColor` does read\n * `$iconHeight` and scales correctly. Pass `iconHeight={30}` today and the status dot grows\n * but the icon it sits on does not.\n *\n * The fix is to repoint the read to `props.$iconHeight`, which ACTIVATES A BRANCH THAT HAS\n * NEVER FIRED and changes the emitted height for every non-default `iconHeight`. §J.8 puts\n * that in C10 with its baseline re-record.\n */\nexport interface VerificationStatusIconStyleProps extends VerificationBackgroundStyleProps {\n /** `iconHeight` — `PropTypes.number`, px. Read, never passed; see the JSDoc above. */\n iconHeight?: number;\n}\n\n/** Props of `VerificationStatusColor`, the small status dot. */\ninterface VerificationStatusColorStyleProps extends VerificationBackgroundStyleProps {\n /** `iconHeight` — `PropTypes.number`, px. This site reads the `$` form, correctly. */\n $iconHeight?: number;\n /**\n * `status` — `PropTypes.oneOf(['verified', 'pending', 'rejected', 'mixed'])`, and\n * `.isRequired` on the component but still OPTIONAL here per §J.5.\n *\n * Closed on purpose rather than widened to `string`: the block below compares this value\n * four times, and with a closed union a mistyped status name is TS2367 instead of a\n * branch that silently never fires. §J.6.\n */\n $status?: 'verified' | 'pending' | 'rejected' | 'mixed';\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. §J.4. `prop` needs the annotation\n * because `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const VerificationIconWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationBackgroundStyleProps>(applyDefaultTheme)`\n ${props =>\n props.$background &&\n css`\n background-color: #000 !important;\n width: fit-content;\n padding: 6px 14px 6px 9px;\n border-radius: 15px;\n}\n `};\n`;\n\nexport const VerificationStatusIcon = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationStatusIconStyleProps>(applyDefaultTheme)`\n display: flex;\n position: relative;\n font: normal normal normal 12px/16px Roboto;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-700')\n )};\n\n ${props =>\n props.$background &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-100')\n )};\n\n svg {\n height: ${props => props.iconHeight ?? 15}px;\n }\n`;\n\nexport const VerificationStatusColor = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationStatusColorStyleProps>(applyDefaultTheme)`\n position: absolute;\n bottom: 0;\n left: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n width: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n height: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n border-radius: 50%;\n ${props => {\n let darkThemeColor = props.theme.getColor('gray-100');\n let lightThemeColor = props.theme.getColor('gray-500');\n\n if (props.$status === 'verified') {\n darkThemeColor = props.theme.getColor('emerald-500');\n lightThemeColor = props.theme.getColor('emerald-500');\n } else if (props.$status === 'pending') {\n darkThemeColor = props.theme.getColor('signal-yellow-500');\n lightThemeColor = props.theme.getColor('signal-yellow-500');\n } else if (props.$status === 'rejected') {\n darkThemeColor = props.theme.getColor('red-600');\n lightThemeColor = props.theme.getColor('red-600');\n } else if (props.$status === 'mixed') {\n darkThemeColor = '#008CDB';\n lightThemeColor = '#008CDB';\n }\n\n return props.theme.themeProp('background-color', darkThemeColor, lightThemeColor);\n }};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","VerificationIconWrapper","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$background","css","VerificationStatusIcon","theme","themeProp","getColor","iconHeight","VerificationStatusColor","$iconHeight","darkThemeColor","lightThemeColor","$status"],"mappings":";;;AAmEA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,uBAAuB,GAAGC,MAAM,CAACC,GAAG,CAC9CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAmCC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,uDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,GAAA,CAAA,EACzDC,KAAK,IACLA,KAAK,CAACC,WAAW,IACjBC,GAAG,sGAMF;AAGE,MAAMC,sBAAsB,GAAGV,MAAM,CAACC,GAAG,CAC7CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAmCC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,sDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,4EAAA,EAAA,GAAA,EAAA,cAAA,EAAA,MAAA,CAAA,EAIzDC,KAAK,IACLA,KAAK,CAACI,KAAK,CAACC,SAAS,CACnB,OAAO,EACPL,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAChCN,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,EAEDN,KAAK,IACLA,KAAK,CAACC,WAAW,IACjBD,KAAK,CAACI,KAAK,CAACC,SAAS,CACnB,OAAO,EACPL,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAChCN,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,EAGSN,KAAK,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AAGV,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,SAAS,CAAC;IAChDK,eAAe,GAAGX,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,SAAS,CAAC;AACnD,EAAA,CAAC,MAAM,IAAIN,KAAK,CAACY,OAAO,KAAK,OAAO,EAAE;AACpCF,IAAAA,cAAc,GAAG,SAAS;AAC1BC,IAAAA,eAAe,GAAG,SAAS;AAC7B,EAAA;EAEA,OAAOX,KAAK,CAACI,KAAK,CAACC,SAAS,CAAC,kBAAkB,EAAEK,cAAc,EAAEC,eAAe,CAAC;AACnF,CAAC;;;;"}
1
+ {"version":3,"file":"VerificationStatusIcon.styled.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.ts"],"sourcesContent":["/*\n * Two deferred issues: iconHeight read/passed mismatch; stray `}` typo in VerificationIconWrapper baseline.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/**\n * Shared by all three components. Only `VerificationIconWrapper` and `VerificationStatusIcon` read it; on `VerificationStatusColor` it's passed and never read (harmless due to `$`).\n */\ninterface VerificationBackgroundStyleProps {\n /** `background` — `PropTypes.bool`; swaps in the black pill and the light icon colour. */\n $background?: boolean;\n}\n\n/**\n * Defect: reads `iconHeight` (never passed); component passes `$iconHeight` which is never read. Icon always 15px, dot scales correctly.\n */\nexport interface VerificationStatusIconStyleProps extends VerificationBackgroundStyleProps {\n /** `iconHeight` — `PropTypes.number`, px. Read, never passed; see the JSDoc above. */\n iconHeight?: number;\n}\n\n/** Props of `VerificationStatusColor`, the small status dot. */\ninterface VerificationStatusColorStyleProps extends VerificationBackgroundStyleProps {\n /** `iconHeight` — `PropTypes.number`, px. This site reads the `$` form, correctly. */\n $iconHeight?: number;\n /**\n * `status` — closed union to catch mistyped names as TS2367 rather than silent branch misfire.\n */\n $status?: 'verified' | 'pending' | 'rejected' | 'mixed';\n}\n\n// `prop` needs annotation because withConfig takes it by reference; no contextual typing otherwise.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const VerificationIconWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationBackgroundStyleProps>(applyDefaultTheme)`\n ${props =>\n props.$background &&\n css`\n background-color: #000 !important;\n width: fit-content;\n padding: 6px 14px 6px 9px;\n border-radius: 15px;\n}\n `};\n`;\n\nexport const VerificationStatusIcon = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationStatusIconStyleProps>(applyDefaultTheme)`\n display: flex;\n position: relative;\n font: normal normal normal 12px/16px Roboto;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-700')\n )};\n\n ${props =>\n props.$background &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-100')\n )};\n\n svg {\n height: ${props => props.iconHeight ?? 15}px;\n }\n`;\n\nexport const VerificationStatusColor = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationStatusColorStyleProps>(applyDefaultTheme)`\n position: absolute;\n bottom: 0;\n left: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n width: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n height: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n border-radius: 50%;\n ${props => {\n let darkThemeColor = props.theme.getColor('gray-100');\n let lightThemeColor = props.theme.getColor('gray-500');\n\n if (props.$status === 'verified') {\n darkThemeColor = props.theme.getColor('emerald-500');\n lightThemeColor = props.theme.getColor('emerald-500');\n } else if (props.$status === 'pending') {\n darkThemeColor = props.theme.getColor('signal-yellow-500');\n lightThemeColor = props.theme.getColor('signal-yellow-500');\n } else if (props.$status === 'rejected') {\n darkThemeColor = props.theme.getColor('red-600');\n lightThemeColor = props.theme.getColor('red-600');\n } else if (props.$status === 'mixed') {\n darkThemeColor = '#008CDB';\n lightThemeColor = '#008CDB';\n }\n\n return props.theme.themeProp('background-color', darkThemeColor, lightThemeColor);\n }};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","VerificationIconWrapper","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$background","css","VerificationStatusIcon","theme","themeProp","getColor","iconHeight","VerificationStatusColor","$iconHeight","darkThemeColor","lightThemeColor","$status"],"mappings":";;;AAiCA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,uBAAuB,GAAGC,MAAM,CAACC,GAAG,CAC9CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAmCC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,uDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,GAAA,CAAA,EACzDC,KAAK,IACLA,KAAK,CAACC,WAAW,IACjBC,GAAG,sGAMF;AAGE,MAAMC,sBAAsB,GAAGV,MAAM,CAACC,GAAG,CAC7CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAmCC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,sDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,4EAAA,EAAA,GAAA,EAAA,cAAA,EAAA,MAAA,CAAA,EAIzDC,KAAK,IACLA,KAAK,CAACI,KAAK,CAACC,SAAS,CACnB,OAAO,EACPL,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAChCN,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,EAEDN,KAAK,IACLA,KAAK,CAACC,WAAW,IACjBD,KAAK,CAACI,KAAK,CAACC,SAAS,CACnB,OAAO,EACPL,KAAK,CAACI,KAAK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AQ,CAAC,mBAAmB,CAAC;AAC7D,EAAA,CAAC,MAAM,IAAIN,KAAK,CAACY,OAAO,KAAK,UAAU,EAAE;IACvCF,cAAc,GAAGV,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,SAAS,CAAC;IAChDK,eAAe,GAAGX,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,SAAS,CAAC;AACnD,EAAA,CAAC,MAAM,IAAIN,KAAK,CAACY,OAAO,KAAK,OAAO,EAAE;AACpCF,IAAAA,cAAc,GAAG,SAAS;AAC1BC,IAAAA,eAAe,GAAG,SAAS;AAC7B,EAAA;EAEA,OAAOX,KAAK,CAACI,KAAK,CAACC,SAAS,CAAC,kBAAkB,EAAEK,cAAc,EAAEC,eAAe,CAAC;AACnF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingArrow.styled.js","sources":["../../../src/components/data/_shared/FloatingArrow.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * THE ONE THEMED ARROW. It replaces four things:\n *\n * 1. `Popover.styled.ts`'s eight `.tippy-arrow::before` / `::after` blocks — a CSS\n * border-triangle drawn twice per side (an outline layer and a fill layer) for each\n * of the four sides, 8 rules and 4 `themeProp()` calls.\n * 2. `Tooltip.styled.ts`'s `.tippy-arrow { color: … }` — tippy drove the arrow colour\n * through `color`, because its triangle was a border and `border-*-color: initial`\n * resolves to `currentColor`.\n * 3. `SummaryCard.styled.ts`'s `StyledFloatingArrow`.\n * 4. `AssetAction.styled.ts`'s `StyledFloatingArrow`.\n *\n * (3) and (4) still exist: consolidating those three Floating UI sites onto this file and\n * onto `useFloatingPopover` is a DEFERRED pass. This file is written to serve them — its\n * `popover` surface is `SummaryCard`'s exact colour pair — but it does not touch them.\n *\n * ================== WHY NO `themeProp()` AND NO INTERPOLATED `css` BLOCK ==================\n *\n * Two repo conventions decide the whole shape of the template below, both recorded in\n * `ThemeProp`'s JSDoc in `src/utils/defaultTheme.ts`:\n *\n * - `themeProp()` emits `body.dark-theme && { … }`, a SELECTOR. Nesting it inside another\n * selector block (`&[data-arrow-surface='tooltip'] { ${themeProp(…)} }`) produces\n * `&[data-arrow-surface='tooltip'] body.dark-theme && { … }` — a descendant selector that\n * matches nothing. So the two surfaces cannot each carry a `themeProp()`, and the theme\n * branches are written out by hand instead. `body:not(.light-theme):not(.dark-theme)` +\n * `prefers-color-scheme` is included because that is `themeProp`'s third branch and\n * Storybook's neither-class state is a real state (see `scripts/VERIFY.md`, \"How the\n * theme is driven\").\n * - Per-instance state goes on a STATIC attribute selector, not a `${props => css…}` rule,\n * because interpolated rules share the component's `componentId` and two instances in\n * different states collide. `data-arrow-surface` is that attribute.\n *\n * A side effect worth having: because nothing here is a shared `css<A>` helper, §J.7's\n * weak-type rule never engages. The plan's addendum §A1 predicted a shared arrow would hit\n * it (\"A single shared `FloatingArrow.styled.ts` used by four call sites will hit this\");\n * it does not, and the reason is that the surfaces are static rule text rather than an\n * interpolated helper the hosts have to satisfy.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport { FloatingArrow } from '@floating-ui/react';\nimport { DEFAULT_ARROW_HEIGHT } from '../../../hooks/useFloatingPopover';\n\nimport type { NtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * Which surface the arrow is pointing away from, i.e. which fill/border pair it uses.\n *\n * - `popover` — the `Popover` box and the summary-card overlay: `gray-700` on dark,\n * `white` on light, with a 1px border that continues the box's own.\n * - `tooltip` — the `Tooltip` box: `gray-700` in BOTH themes and no border, because\n * `Tooltip.styled.ts` sets `background: gray-700` unconditionally and has no border.\n */\nexport type FloatingArrowSurface = 'popover' | 'tooltip';\n\n/**\n * THE ARROW'S GEOMETRY, PER SURFACE — and the numbers are derived, not chosen.\n *\n * `height` is how far the arrow protrudes from the floating element, because\n * `FloatingArrow` positions its `<svg>` at `[side]: '100%'`. It is therefore the term\n * `useFloatingPopover` adds to the main-axis offset, which is why the popover height is\n * IMPORTED from there rather than written twice: the offset maths and the rendered\n * triangle must be the same number or the arrow sits at the wrong gap.\n *\n * `popover` — from `Popover.styled.ts`'s override, `border-width: 15px 13px 0`: a triangle\n * 15px tall on a 13+13 = **26px** base. The full derivation, including why the `+15` in\n * `Popover.tsx` was never a fudge, is on `DEFAULT_ARROW_HEIGHT`.\n *\n * `tooltip` — `Tooltip.styled.ts` never overrode the geometry, so the numbers come from\n * `tippy.js/dist/tippy.css`, and they are the **VISIBLE** triangle rather than the declared\n * one. THE ONE PIXEL THE FIRST DRAFT OF THIS COMMENT CALLED UNAVOIDABLE IS NOT: it\n * disappears once the hidden part of tippy's triangle is subtracted instead of being\n * carried. The measurement, from the four rules that describe a top-placed tooltip arrow:\n *\n * .tippy-arrow { width: 16px; height: 16px }\n * .tippy-box[data-placement^=top] > .tippy-arrow { bottom: 0 }\n * .tippy-box[data-placement^=top] > .tippy-arrow:before {\n * bottom: -7px; border-width: 8px 8px 0 }\n *\n * 1. The 16x16 arrow box sits with its bottom edge ON the box's bottom edge.\n * 2. The `:before` border-triangle is 8px tall on a 16px base, positioned `bottom: -7px`,\n * so its apex is 7px OUTSIDE the box and its 16px-wide base is 1px INSIDE it.\n * 3. Therefore only 7 of the 8px are ever visible, and at the box edge — 1px down from a\n * 16px base on an 8px triangle — the triangle has already narrowed to\n * 16 x (1 - 1/8) = **14px**.\n * 4. So the triangle a user sees is **14px wide at the box edge and 7px tall**, which is\n * `FloatingArrow`'s own default geometry, and `FloatingArrow` overlapping nothing is\n * exactly right: there is nothing to overlap. The 1px tippy hides is the same\n * `gray-700` as the box behind it (this surface has no border), so it was never\n * contributing a pixel.\n *\n * The offset that goes with it is tippy's own default `[0, 10]` passed straight through,\n * with `arrowHeight: 0` handed to `useFloatingPopover` — see the block comment at\n * `TOOLTIP_OFFSET` in `Tooltip.tsx`, which is where the reason that `Tooltip` does NOT add\n * the arrow height while `Popover` does is written down. Box 10px out, tip 3px out, in both\n * implementations.\n *\n * `strokeWidth` is `FloatingArrow`'s border width in px. `0` means the outline `<path>` is\n * not rendered at all, which is why the `tooltip` surface needs no `stroke` rule.\n */\nexport const POPOVER_ARROW = {\n width: 26,\n height: DEFAULT_ARROW_HEIGHT,\n strokeWidth: 1\n} as const;\n\n/**\n * See `POPOVER_ARROW` — same derivation, from tippy's unmodified default geometry, reduced\n * to the part of it that is visible. 14x7 and not 16x8; the numbers coincide with\n * `FloatingArrow`'s own defaults, which is a result rather than a shortcut and is why they\n * are written out anyway.\n */\nexport const TOOLTIP_ARROW = {\n width: 14,\n height: 7,\n strokeWidth: 0\n} as const;\n\n/**\n * Props of `SharedFloatingArrow`, i.e. what this file's `.attrs()` callback reads and what\n * a call site may set. Both optional per §J.5 — every wrapper spreads `{...props}` onto its\n * styled root, and a required transient prop manufactures TS2769 there.\n */\ninterface FloatingArrowStyleProps {\n /**\n * styled-components' theme. Declared for the same reason `Popover.styled.ts` declares\n * it — this is `styled(ThirdPartyComponent)`, so the outer props are\n * `FloatingArrowProps extends React.ComponentPropsWithRef<'svg'>` and nothing in there\n * is `theme`. `.attrs(applyDefaultTheme)` fills it in for the interpolations below.\n */\n theme?: NtbTheme;\n /**\n * Which colour pair to use. NOT `$`-prefixed on purpose: it has to REACH THE DOM,\n * because the rules below select on it. `shouldForwardProp` forwards it precisely\n * because it does not start with `$`.\n *\n * Hyphenated, so a call site could pass it without this declaration — TypeScript does\n * not excess-property-check JSX attribute names that are not valid identifiers. It is\n * declared anyway because the `.attrs()` callback READS it, and a read does need the\n * declaration.\n */\n 'data-arrow-surface'?: FloatingArrowSurface;\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and the\n * two majors disagree on the second parameter. §J.4.\n *\n * This is also the fix for the leak `AssetAction.styled.ts` has: its `StyledFloatingArrow`\n * has no `shouldForwardProp`, so `.attrs(applyDefaultTheme)`'s `theme` OBJECT is handed to\n * `FloatingArrow`, which spreads `...rest` onto the `<svg>` — `theme=\"[object Object]\"` on\n * an SVG element. Filtering it here means the shared arrow never had that defect.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * The themed arrow. Render it inside the floating element with `context`, `ref` and the\n * geometry from `POPOVER_ARROW` / `TOOLTIP_ARROW`:\n *\n * ```tsx\n * <S.SharedFloatingArrow ref={arrowRef} context={context} {...POPOVER_ARROW} />\n * ```\n *\n * `ref` IS REQUIRED BY `FloatingArrow` ITSELF — it warns in development without one and\n * the `arrow()` middleware has nothing to measure. `useFloatingPopover` returns the\n * matching `arrowRef`.\n *\n * ================== THE THREE-PATH STRUCTURE, WHICH THE CSS DEPENDS ON ==================\n *\n * `FloatingArrow` renders, in order (measured in\n * `@floating-ui/react/dist/floating-ui.react.esm.js`):\n *\n * 1. an OUTLINE `<path>`, ONLY when `strokeWidth > 0`, with `fill=\"none\"` and\n * `stroke-width: strokeWidth * 2 + 1`;\n * 2. the FILL `<path>`, whose `stroke` attribute it sets to the value of the `fill`\n * PROP — its way of covering the inner half of (1)'s stroke so a `strokeWidth: 1`\n * renders as a 1px border rather than 1.5px;\n * 3. a `<clipPath>`, which is not a `<path>`.\n *\n * We colour by CSS rather than by the `fill`/`stroke` PROPS because the theme is chosen by\n * a `body` class at runtime and a prop would have to be computed in JS, which cannot see\n * which class is set. That leaves (2)'s `stroke` attribute unset, so the rules below set it\n * explicitly — `& > path:last-of-type`, which is (2) whether or not (1) is present.\n * Without that rule (2) would INHERIT the CSS `stroke` and the border would read ~1.5px\n * instead of the 1px it replaces.\n */\nexport const SharedFloatingArrow = styled(FloatingArrow)\n .withConfig({\n shouldForwardProp\n })\n /*\n * A CALLBACK, so the generic on `.attrs<P>()` is MANDATORY (§J.2): the callback\n * parameter only gains `P` in this slot, so `props['data-arrow-surface']` has no legal\n * annotation position anywhere else.\n *\n * It must be a callback rather than a static object for a runtime reason too: `.attrs()`\n * merges its result OVER the incoming props, so `.attrs({ 'data-arrow-surface': 'popover' })`\n * would beat the call site's `data-arrow-surface=\"tooltip\"`. `?? 'popover'` is what makes\n * it a DEFAULT instead of an override.\n */\n .attrs<FloatingArrowStyleProps>(props => ({\n ...applyDefaultTheme(props),\n 'data-arrow-surface': props['data-arrow-surface'] ?? 'popover'\n }))`\n /* ---------------------------------------------------------------- popover surface ----\n * NO BACKTICKS ANYWHERE BELOW: this is the inside of a tagged template literal, so a\n * backtick in a comment ends the template and the file stops parsing (measured: 17\n * TS1005/TS1443 errors from two prose backticks).\n *\n * SummaryCard.styled.ts's pair for the fill (gray-700 dark / white light), and\n * Popover.styled.ts's .tippy-arrow::before pair for the border (gray-800 dark /\n * gray-300 light) — the same pair as the popover box's own 1px border, which is the\n * point: the arrow continues it.\n */\n body.dark-theme &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: ${props => props.theme.getColor('gray-800')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n\n body.light-theme &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('white')};\n stroke: ${props => props.theme.getColor('gray-300')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('white')};\n }\n }\n\n body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('white')};\n stroke: ${props => props.theme.getColor('gray-300')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('white')};\n }\n\n @media (prefers-color-scheme: dark) {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: ${props => props.theme.getColor('gray-800')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n }\n\n /* ---------------------------------------------------------------- tooltip surface ----\n * gray-700 in both themes, matching Tooltip.styled.ts's unconditional\n * \"background: gray-700\". It is still written under the three theme selectors rather\n * than as one bare rule, so that it cannot lose a specificity contest with the popover\n * branches above: a themed selector carries one type + three class simple selectors,\n * while a bare &[data-arrow-surface=...] carries two, and the bare form would be\n * overridden if the two surfaces ever overlapped.\n *\n * \"stroke: none\" is belt-and-braces — TOOLTIP_ARROW.strokeWidth is 0, so FloatingArrow\n * does not render the outline path at all.\n */\n body.dark-theme &[data-arrow-surface='tooltip'],\n body.light-theme &[data-arrow-surface='tooltip'],\n body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='tooltip'] {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: none;\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n`;\n\nexport default SharedFloatingArrow;\n"],"names":["POPOVER_ARROW","width","height","DEFAULT_ARROW_HEIGHT","strokeWidth","TOOLTIP_ARROW","shouldForwardProp","prop","startsWith","SharedFloatingArrow","styled","FloatingArrow","withConfig","attrs","props","applyDefaultTheme","displayName","componentId","theme","getColor"],"mappings":";;;;;AA0GO,MAAMA,aAAa,GAAG;AAC3BC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAEC,oBAAoB;AAC5BC,EAAAA,WAAW,EAAE;AACf;AAQO,MAAMC,aAAa,GAAG;AAC3BJ,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,CAAC;AACTE,EAAAA,WAAW,EAAE;AACf;AAqCA,MAAME,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAiCM,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,aAAa,CAAC,CACrDC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CAWDO,KAAK,CAA0BC,KAAK,KAAK;EACxC,GAAGC,iBAAiB,CAACD,KAAK,CAAC;AAC3B,EAAA,oBAAoB,EAAEA,KAAK,CAAC,oBAAoB,CAAC,IAAI;AACvD,CAAC,CAAC,CAAC,CAAAF,UAAA,CAAA;EAAAI,W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AAC,UAAU,CAAC;;;;"}
1
+ {"version":3,"file":"FloatingArrow.styled.js","sources":["../../../src/components/data/_shared/FloatingArrow.styled.ts"],"sourcesContent":["// Consolidates Popover's 8 border-triangle blocks, Tooltip's arrow colour, SummaryCard/AssetAction arrows. Uses static attribute selectors (not interpolated css) to avoid componentId collisions; theme branches written by hand (not themeProp()) to work inside nested selector blocks.\n\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport { FloatingArrow } from '@floating-ui/react';\nimport { DEFAULT_ARROW_HEIGHT } from '../../../hooks/useFloatingPopover';\n\nimport type { NtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * Which surface the arrow is pointing away from, i.e. which fill/border pair it uses.\n *\n * - `popover` — the `Popover` box and the summary-card overlay: `gray-700` on dark,\n * `white` on light, with a 1px border that continues the box's own.\n * - `tooltip` — the `Tooltip` box: `gray-700` in BOTH themes and no border, because\n * `Tooltip.styled.ts` sets `background: gray-700` unconditionally and has no border.\n */\nexport type FloatingArrowSurface = 'popover' | 'tooltip';\n\n// Popover: 15px tall (offset-driven), 26px base (from border-width: 15px 13px 0). Tooltip: 7px tall/14px wide (visible part of tippy's 8px tall/16px base). strokeWidth: 1 for popover border, 0 for tooltip.\nexport const POPOVER_ARROW = {\n width: 26,\n height: DEFAULT_ARROW_HEIGHT,\n strokeWidth: 1\n} as const;\n\nexport const TOOLTIP_ARROW = {\n width: 14,\n height: 7,\n strokeWidth: 0\n} as const;\n\n/**\n * Props of `SharedFloatingArrow`. data-arrow-surface reaches DOM (rules select on it); theme is declared for .attrs() callback.\n */\ninterface FloatingArrowStyleProps {\n theme?: NtbTheme;\n 'data-arrow-surface'?: FloatingArrowSurface;\n}\n\n// Filters theme object from DOM; fixes defect where AssetAction.styled.ts puts theme=\"[object Object]\" on SVG.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n// Themed arrow; ref required by FloatingArrow (middleware has nothing to measure). Renders outline path (if strokeWidth > 0), fill path, clipPath. Colour by CSS, not props (theme known at runtime). Set fill/stroke on & > path:last-of-type (the fill path).\n\nexport const SharedFloatingArrow = styled(FloatingArrow)\n .withConfig({\n shouldForwardProp\n })\n // Callback (not static) so .attrs() merges under incoming props; ?? 'popover' makes it default not override.\n .attrs<FloatingArrowStyleProps>(props => ({\n ...applyDefaultTheme(props),\n 'data-arrow-surface': props['data-arrow-surface'] ?? 'popover'\n }))`\n /* popover surface: gray-700/white fill, gray-800/gray-300 border (continues box's own 1px border). NO BACKTICKS IN COMMENTS */\n\n body.dark-theme &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: ${props => props.theme.getColor('gray-800')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n\n body.light-theme &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('white')};\n stroke: ${props => props.theme.getColor('gray-300')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('white')};\n }\n }\n\n body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('white')};\n stroke: ${props => props.theme.getColor('gray-300')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('white')};\n }\n\n @media (prefers-color-scheme: dark) {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: ${props => props.theme.getColor('gray-800')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n }\n\n /* tooltip surface: gray-700 both themes (matches Tooltip.styled.ts background). stroke: none belt-and-braces (TOOLTIP_ARROW.strokeWidth=0). */\n\n body.dark-theme &[data-arrow-surface='tooltip'],\n body.light-theme &[data-arrow-surface='tooltip'],\n body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='tooltip'] {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: none;\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n`;\n\nexport default SharedFloatingArrow;\n"],"names":["POPOVER_ARROW","width","height","DEFAULT_ARROW_HEIGHT","strokeWidth","TOOLTIP_ARROW","shouldForwardProp","prop","startsWith","SharedFloatingArrow","styled","FloatingArrow","withConfig","attrs","props","applyDefaultTheme","displayName","componentId","theme","getColor"],"mappings":";;;;;AAqBO,MAAMA,aAAa,GAAG;AAC3BC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAEC,oBAAoB;AAC5BC,EAAAA,WAAW,EAAE;AACf;AAEO,MAAMC,aAAa,GAAG;AAC3BJ,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,CAAC;AACTE,EAAAA,WAAW,EAAE;AACf;AAWA,MAAME,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAIM,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,aAAa,CAAC,CACrDC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CAEDO,KAAK,CAA0BC,KAAK,KAAK;EACxC,GAAGC,iBAAiB,CAACD,KAAK,CAAC;AAC3B,EAAA,oBAAoB,EAAEA,KAAK,CAAC,oBAAoB,CAAC,IAAI;AACvD,CAAC,CAAC,CAAC,CAAAF,UAAA,CAAA;EAAAI,WAAA,EAAA,0CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uDAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,2DAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,kFAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,4CAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,oLAAA,EAAA,4CAAA,EAAA,KAAA,CAAA,EAIOH,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EACvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAK7CL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EACpCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAK1CL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EACpCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAIxCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EACvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAU/CL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAIrCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEventListner.js","sources":["../../src/hooks/useEventListner.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\n\nimport type { RefObject } from 'react';\n\n/**\n * Every event name this hook accepts, mapped to the event object the handler\n * actually receives.\n *\n * AN INTERSECTION, NOT `interface DomEventMap extends WindowEventMap,\n * HTMLElementEventMap, DocumentEventMap {}`. The three lib.dom maps share keys\n * through `GlobalEventHandlersEventMap`, and an interface extending all three is\n * a TS2320 candidate (\"named property 'X' of types … are not identical\") as soon\n * as two of them declare a shared key with types that are equivalent rather than\n * identical — a lib.dom detail that changes between TypeScript releases. An\n * intersection has no such rule: overlapping keys become `MouseEvent &\n * MouseEvent`, `keyof` is still the union of all three key sets, and lib.dom\n * stays the single source of truth for which event class each name carries. Do\n * not \"tidy\" this into an interface.\n *\n * All three maps are needed because the target is chosen at runtime:\n * `element?.current ?? window`.\n */\nexport type DomEventMap = WindowEventMap & HTMLElementEventMap & DocumentEventMap;\n\n/** Any DOM event name this hook accepts — `keyof DomEventMap`. */\nexport type DomEventName = keyof DomEventMap;\n\n/**\n * Subscribes to a DOM event for the lifetime of the component, always calling\n * the latest `handler` without re-subscribing when it changes identity.\n *\n * `element` AND `options` ARE OPTIONAL, AND THAT IS THE ENTIRE FIX FOR THE\n * TS2554 ARITY ERRORS IN THIS DIRECTORY. In JavaScript a missing argument is\n * `undefined`; in TypeScript a parameter with neither `?` nor a default is\n * REQUIRED. Annotating the original four parameters without marking the last two\n * optional is what made every existing 2- and 3-argument call site a hard error\n * (`useOnClickOutside.ts:4`, `useElementSize.ts:22`,\n * `MultiLevelCheckboxSelect.tsx:65-67`). `element` really is optional — the hook\n * falls back to `window` — and `options` really is optional, so the declaration\n * below records what this function has always done. The body is unchanged.\n *\n * @param eventName any DOM event name; it selects the handler's event type\n * @param handler receives the event. Stored in a ref, so it may be a fresh\n * closure on every render without rebinding the listener\n * @param element ref to the target. Omit it — or pass a ref whose `current` is\n * still `null` — to listen on `window`\n * @param options forwarded verbatim to `addEventListener` and\n * `removeEventListener`\n */\nfunction useEventListener<K extends DomEventName, T extends EventTarget = HTMLElement>(\n eventName: K,\n handler: (event: DomEventMap[K]) => void,\n element?: RefObject<T | null> | null,\n options?: boolean | AddEventListenerOptions\n): void {\n // Create a ref that stores handler\n const savedHandler = useRef(handler);\n\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n /*\n * Define the listening target.\n *\n * Typed as the `EventTarget` base rather than `T | Window` deliberately: the\n * only members this hook touches are `addEventListener` /\n * `removeEventListener`, and `EventTarget` declares exactly those two with a\n * `type: string` signature. The `HTMLElement` and `Window` overloads are\n * keyed on their OWN narrower event maps, so a union target combined with a\n * `K` spanning all three maps makes overload resolution fail for every name\n * that is valid on one target but not the other. Precision belongs at the\n * public boundary above, where it is checked; here the base interface is the\n * honest description of what is used.\n */\n const targetElement: EventTarget = element?.current ?? window;\n\n if (!(targetElement && targetElement.addEventListener)) return;\n\n /*\n * Create event listener that calls handler function stored in ref.\n *\n * The cast is the inverse of the boundary check: `EventListener` hands us a\n * bare `Event` because it is the untyped base signature, while `K` — checked\n * at the call site — is what says which subclass actually arrives.\n */\n const listener: EventListener = event => savedHandler.current(event as DomEventMap[K]);\n\n targetElement.addEventListener(eventName, listener, options);\n\n // Remove event listener on cleanup\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\nexport { useEventListener };\n"],"names":["useEventListener","eventName","handler","element","options","savedHandler","useRef","useIsomorphicLayoutEffect","current","useEffect","targetElement","window","addEventListener","listener","event","removeEventListener"],"mappings":";;;AAkDA,SAASA,gBAAgBA,CACvBC,SAAY,EACZC,OAAwC,EACxCC,OAAoC,EACpCC,OAA2C,EACrC;AAEN,EAAA,MAAMC,YAAY,GAAGC,MAAM,CAACJ,OAAO,CAAC;AAEpCK,EAAAA,yBAAyB,CAAC,MAAM;IAC9BF,YAAY,CAACG,OAAO,GAAGN,OAAO;AAChC,EAAA,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AAEbO,EAAAA,SAAS,CAAC,MAAM;AAcd,IAAA,MAAMC,aAA0B,GAAGP,OAAO,EAAEK,OAAO,IAAIG,MAAM;AAE7D,IAAA,IAAI,EAAED,aAAa,IAAIA,aAAa,CAACE,gBAAgB,CAAC,EAAE;IASxD,MAAMC,QAAuB,GAAGC,KAAK,IAAIT,YAAY,CAACG,OAAO,CAACM,KAAuB,CAAC;IAEtFJ,aAAa,CAACE,gBAAgB,CAACX,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC;AAG5D,IAAA,OAAO,MAAM;MACXM,aAAa,CAACK,mBAAmB,CAACd,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC;IACjE,CAAC;EACH,CAAC,EAAE,CAACH,SAAS,EAAEE,OAAO,EAAEC,OAAO,CAAC,CAAC;AACnC;;;;"}
1
+ {"version":3,"file":"useEventListner.js","sources":["../../src/hooks/useEventListner.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\n\nimport type { RefObject } from 'react';\n\n// Intersection, not interface extending all three — avoids lib.dom type incompatibilities\n// across TypeScript versions. All three maps are needed: target is runtime-chosen.\nexport type DomEventMap = WindowEventMap & HTMLElementEventMap & DocumentEventMap;\n\nexport type DomEventName = keyof DomEventMap;\n\n/**\n * Subscribes to a DOM event for the component lifetime, always calling the latest handler.\n * Element and options are optional (fall back to window and no options).\n *\n * @param eventName any DOM event name; selects the handler's event type\n * @param handler received event; stored in a ref so closures don't rebind the listener\n * @param element target ref; omit to listen on `window`\n * @param options forwarded to addEventListener and removeEventListener\n */\nfunction useEventListener<K extends DomEventName, T extends EventTarget = HTMLElement>(\n eventName: K,\n handler: (event: DomEventMap[K]) => void,\n element?: RefObject<T | null> | null,\n options?: boolean | AddEventListenerOptions\n): void {\n const savedHandler = useRef(handler);\n\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n // Typed as EventTarget base — union of HTMLElement | Window would break overload\n // resolution for names valid on one but not the other. Precision belongs at the call site.\n const targetElement: EventTarget = element?.current ?? window;\n\n if (!(targetElement && targetElement.addEventListener)) return;\n\n // Cast event to DomEventMap[K] — EventListener signature is bare Event,\n // but K checked at call site guarantees which subclass arrives.\n const listener: EventListener = event => savedHandler.current(event as DomEventMap[K]);\n\n targetElement.addEventListener(eventName, listener, options);\n\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\nexport { useEventListener };\n"],"names":["useEventListener","eventName","handler","element","options","savedHandler","useRef","useIsomorphicLayoutEffect","current","useEffect","targetElement","window","addEventListener","listener","event","removeEventListener"],"mappings":";;;AAoBA,SAASA,gBAAgBA,CACvBC,SAAY,EACZC,OAAwC,EACxCC,OAAoC,EACpCC,OAA2C,EACrC;AACN,EAAA,MAAMC,YAAY,GAAGC,MAAM,CAACJ,OAAO,CAAC;AAEpCK,EAAAA,yBAAyB,CAAC,MAAM;IAC9BF,YAAY,CAACG,OAAO,GAAGN,OAAO;AAChC,EAAA,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AAEbO,EAAAA,SAAS,CAAC,MAAM;AAGd,IAAA,MAAMC,aAA0B,GAAGP,OAAO,EAAEK,OAAO,IAAIG,MAAM;AAE7D,IAAA,IAAI,EAAED,aAAa,IAAIA,aAAa,CAACE,gBAAgB,CAAC,EAAE;IAIxD,MAAMC,QAAuB,GAAGC,KAAK,IAAIT,YAAY,CAACG,OAAO,CAACM,KAAuB,CAAC;IAEtFJ,aAAa,CAACE,gBAAgB,CAACX,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC;AAE5D,IAAA,OAAO,MAAM;MACXM,aAAa,CAACK,mBAAmB,CAACd,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC;IACjE,CAAC;EACH,CAAC,EAAE,CAACH,SAAS,EAAEE,OAAO,EAAEC,OAAO,CAAC,CAAC;AACnC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFloatingPopover.js","sources":["../../src/hooks/useFloatingPopover.ts"],"sourcesContent":["/**\n * The one Floating UI wiring in this library.\n *\n * Replaces the `@tippyjs/react` instance that `Popover` and `Tooltip` render, and\n * is shaped to also absorb the three hand-rolled `useFloating` blocks that\n * already exist (`SummaryCard`, `AssetAction`, `AssetGalleryCompactCard`) in a\n * later pass — see \"SHAPED FOR THE DEFERRED CONSOLIDATION\" at the bottom of this\n * comment.\n *\n * Migration plan and the 19-prop compatibility table:\n * `scripts/TIPPY-TO-FLOATING-UI-PLAN.md`.\n *\n * ================== WHAT THIS HOOK IS RESPONSIBLE FOR ==================\n *\n * Everything about POSITION and INTERACTION, and nothing about MARKUP. It returns\n * refs, styles and prop-getters; the caller renders the elements, the\n * `.tippy-content` compatibility wrapper, the portal and the arrow. That split is\n * deliberate: `Popover` needs a `.tippy-content` shim and a context-menu variant,\n * `Tooltip` needs neither, and the summary-card sites need a different arrow — so\n * a hook that also rendered would immediately need a `variant` prop and stop\n * being a hook.\n *\n * ================== THE FOUR NON-OBVIOUS COMPATIBILITY RULES ==================\n *\n * 1. **CONTROLLED MODE DISABLES TRIGGERS BUT NOT DISMISS.** tippy treats\n * `visible` as the switch between uncontrolled and controlled: any boolean —\n * including `false` — takes the instance off its own `trigger` handlers\n * permanently (see `useTooltipAutoShow.ts`, whose `toolTipVisible` is\n * `true | undefined` for exactly this reason). But tippy still fires\n * `onClickOutside` for a controlled instance, and `Popover` consumers pair\n * `visible` with `onClickOutside` to close it. So `useDismiss` stays enabled\n * while `useClick`/`useHover`/`useFocus` are gated off, and the\n * outside-press arrives as `onOpenChange(false, event, 'outside-press')`.\n *\n * 2. **`disabled` MEANS \"CANNOT OPEN\", NOT \"IGNORE TRIGGERS\".** A `disabled`\n * tippy instance stays hidden even under a controlled `visible={true}`, so the\n * resolved open state is forced to `false` rather than merely leaving the\n * Hooks off.\n *\n * 3. **`offset[1]` IS THE ARROW-TIP GAP, NOT THE BOX DISTANCE** — see\n * `DEFAULT_ARROW_HEIGHT` for the derivation. The hook adds the arrow height\n * back, which is what lets `Popover.tsx` delete its `errorOffset` memo without\n * changing its public `offset` prop.\n *\n * 4. **ESCAPE IS OFF BY DEFAULT, ON PURPOSE.** Floating UI's `useDismiss`\n * defaults `escapeKey` to `true`; tippy v6 core has NO escape handling at all\n * (grep `ESCAPE` in `tippy.js/dist/tippy.cjs.js` — zero hits; `hideOnEsc` is\n * a userland plugin the library never installed). Defaulting to `true` here\n * would add a dismiss path to 62 consumer call sites under cover of a\n * \"dependency swap\". It is very likely a change worth making — closing on\n * Escape is a WAI-ARIA expectation — but it is a behaviour decision with a\n * consumer-visible effect, so it gets its own commit and its own conversation.\n * Pass `dismiss={{ escapeKey: true }}` to opt in.\n *\n * ================== SHAPED FOR THE DEFERRED CONSOLIDATION ==================\n *\n * `AssetGalleryCompactCard.tsx` renders its floating block TWICE (lines 553–586\n * at the time of writing: two identical `isOpen && … && <div ref={refs.setFloating}\n * …>` blocks, so two elements race for the same `refs.setFloating` and the same\n * `arrowRef`). That is not fixed here — consolidating those three sites onto this\n * hook is a separate, later pass — but this hook is why the fix will be a\n * deletion rather than a rewrite: it owns `arrowRef` and the open state, so the\n * duplicate block has nothing of its own left to preserve.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport {\n arrow,\n autoPlacement,\n autoUpdate,\n flip,\n offset,\n safePolygon,\n shift,\n size,\n useClick,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useTransitionStyles\n} from '@floating-ui/react';\n\nimport { parseTrigger } from '../utils/parseTrigger';\n\nimport type {\n Middleware,\n OpenChangeReason,\n Placement,\n Side,\n UseClickProps,\n UseDismissProps,\n UseFloatingReturn,\n UseFocusProps,\n UseHoverProps,\n UseTransitionStylesProps\n} from '@floating-ui/react';\n\n/**\n * THE ARROW HEIGHT, RE-DERIVED — AND THE `+15` IN `Popover.tsx` WAS NEVER A FUDGE.\n *\n * `Popover.tsx` computes `const errorOffset = useMemo(() => (arrow ? 15 : 0), [arrow])`\n * and passes `offset={[offset[0], offset[1] + errorOffset]}`. The name says the\n * 15 is a correction for a mistake. It is not: it is the arrow's height, and here\n * is the measurement chain.\n *\n * 1. `Popover.styled.ts` OVERRIDES tippy's default arrow geometry. For a top\n * placement it writes `border-width: 15px 13px 0` on both `.tippy-arrow::before`\n * and `::after` — a CSS border triangle **15px tall on a 26px base**\n * (13px + 13px). The same 15/13 pair appears on all four sides.\n * 2. The FILL layer, `& > .tippy-arrow:after`, is positioned `bottom: -15px`. The\n * `.tippy-arrow` box's bottom edge is the `.tippy-box` edge, so all 15px of\n * that triangle sit OUTSIDE the box: **the arrow protrudes exactly 15px.**\n * (The outline layer, `::before`, is at `-16px` — 1px further out. That 1px is\n * the popover's border continued around the arrow, not extra arrow.)\n * 3. So with `offset={[0, 8]}` (the `Popover` default) plus 15, tippy puts the BOX\n * 23px from the reference and the arrow TIP 23 − 15 = **8px** from it. The\n * public `offset` prop has therefore always meant \"gap between the arrow tip\n * and the reference\", and `15` is the term that makes it mean that.\n * 4. Floating UI's `FloatingArrow` positions its `<svg>` at `[side]: '100%'` —\n * flush against the outside edge of the floating element — so the full\n * `height` prop protrudes, exactly like tippy's fill layer. Therefore\n * `mainAxis = distance + height` reproduces today's geometry when, and only\n * when, `height === 15`.\n *\n * Get this wrong and it is immediately visible: leaving Floating UI's own default\n * `height = 7` would put a 7px arrow in a 23px gap (16px of daylight between tip\n * and reference), and dropping the term would put the box 8px out with a 15px\n * arrow, i.e. the tip 7px INSIDE the reference.\n *\n * One sub-pixel inconsistency does not survive: tippy's bottom-placement fill\n * layer is at `top: -14.5px`, half a pixel less than the other three sides. 15 is\n * used uniformly here.\n *\n * The `Tooltip` arrow is a different size — it never overrode tippy's default\n * geometry — and its number is derived at `TOOLTIP_ARROW` in\n * `src/components/data/_shared/FloatingArrow.styled.ts`, which also re-exports\n * this constant as the popover arrow's height so the offset maths and the rendered\n * `<svg>` cannot disagree.\n */\nexport const DEFAULT_ARROW_HEIGHT = 15;\n\n/**\n * `padding` for the `size()` middleware, carried over verbatim from the\n * `popper-max-size-modifier` options `Popover.tsx` passes today\n * (`{ boundary: 'viewport', rootBoundary: 'viewport', padding: 10 }`).\n */\nconst DEFAULT_MAX_HEIGHT_PADDING = 10;\n\n/** `padding` for `flip()` / `shift()`, matching the three existing call sites. */\nconst DEFAULT_COLLISION_PADDING = 5;\n\n/**\n * How far `shift-away-subtle` moves the box, in px. Measured from\n * `tippy.js/animations/shift-away-subtle.css`, whose hidden state is\n * `translateY(5px)` for a top placement, `translateY(-5px)` for bottom,\n * `translateX(5px)` for left and `translateX(-5px)` for right — i.e. 5px TOWARDS\n * the reference, on whichever axis the placement uses.\n */\nconst SHIFT_AWAY_SUBTLE_DISTANCE = 5;\n\n/**\n * The placement vocabulary of our public props: Floating UI's `Placement` plus\n * Popper's three `auto` values.\n *\n * The 12 concrete names are identical in both libraries (`bottom-end`,\n * `right-start`, …) so they need no translation. `auto*` has no Floating UI\n * equivalent — it is a different middleware — which is handled in\n * `buildMiddleware` below.\n */\nexport type PopoverPlacement = Placement | AutoPlacement;\n\n/** Popper's three `auto` values, which Floating UI has no string for. */\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\n\n/** Popper's `offset` modifier shape: `[skidding, distance]`. */\nexport type PopperOffset = readonly [skidding: number, distance: number];\n\n/**\n * `true` when the placement is one of Popper's `auto` values, i.e. when\n * `autoPlacement()` replaces `flip()`.\n *\n * A TYPE PREDICATE AND NOT A `boolean`, and the difference is load-bearing rather\n * than cosmetic: `useFloating`'s `placement` is the closed `Placement` union, so\n * `isAutoPlacement(p) ? undefined : p` has to leave `p` narrowed to\n * `Exclude<PopoverPlacement, AutoPlacement>` in the false branch. With a plain\n * `boolean` return it does not — measured as\n *\n * TS2322: Type 'PopoverPlacement' is not assignable to type 'Placement'.\n * Type '\"auto\"' is not assignable to type 'Placement'.\n *\n * and the alternative fix would have been a cast, which would have asserted\n * something the compiler can check for itself.\n */\nfunction isAutoPlacement(placement: PopoverPlacement): placement is AutoPlacement {\n return placement === 'auto' || placement === 'auto-start' || placement === 'auto-end';\n}\n\n/**\n * The `initial`/`close` transition styles that reproduce tippy's hardcoded\n * `animation=\"shift-away-subtle\"`.\n *\n * `useTransitionStyles` falls back to `initial` for the close phase when `close`\n * is not given (measured in `floating-ui.react.esm.js`:\n * `const styles = closeStyles || initialStyles`), which matches tippy: the\n * animation stylesheet describes one `[data-state=hidden]` state used on the way\n * in and on the way out.\n *\n * The function form is what makes it placement-aware — Floating UI hands it the\n * RESOLVED `side`, so a popover that has flipped from `bottom` to `top` animates\n * from the correct direction, the same way tippy's `[data-placement^=…]`\n * selectors did.\n */\nconst shiftAwaySubtle = ({ side }: { side: Side }) => {\n const transform = {\n top: `translateY(${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,\n bottom: `translateY(-${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,\n left: `translateX(${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,\n right: `translateX(-${SHIFT_AWAY_SUBTLE_DISTANCE}px)`\n }[side];\n\n return { opacity: 0, transform };\n};\n\n/** What `useFloatingPopover` accepts. Every member is optional. */\nexport interface UseFloatingPopoverOptions {\n /**\n * Preferred placement, in the shared Popper/Floating UI vocabulary. `auto`,\n * `auto-start` and `auto-end` swap `flip()` for `autoPlacement()`.\n *\n * @default 'bottom'\n */\n placement?: PopoverPlacement;\n /**\n * Controlled open state — our `visible` prop. `undefined` (the default) means\n * UNCONTROLLED: the hook owns the state and the parsed `trigger` drives it. Any\n * boolean, INCLUDING `false`, means controlled and turns the trigger Hooks off;\n * see rule 1 in the file header.\n */\n open?: boolean;\n /**\n * Called on every open-state change, controlled or not, with Floating UI's\n * `reason`. `reason === 'outside-press'` is what `Popover`'s `onClickOutside`\n * prop maps onto.\n */\n onOpenChange?: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;\n /**\n * tippy's `trigger` space-string, e.g. `'click focus'`, `'mouseenter'`, `''`.\n * `undefined` means tippy's default (`'mouseenter focus'`) and `''` means no\n * triggers at all — `parseTrigger` owns both rules and documents where `''` is\n * used in the consumers.\n */\n trigger?: string | null;\n /**\n * Popper's `[skidding, distance]`, where `distance` is the gap between the\n * ARROW TIP and the reference (rule 3 in the file header). `skidding` maps to\n * Floating UI's `crossAxis` and NOT `alignmentAxis`: Popper applies skidding as\n * a plain shift along the cross axis with no sign flip for `-end` placements\n * (`distanceAndSkiddingToXY` in `@popperjs/core`), which is `crossAxis`'s\n * behaviour, whereas `alignmentAxis` inverts on `end`. Every consumer offset\n * measured so far is `[0, n]`, so the distinction is currently unobservable —\n * which is exactly why it is written down rather than discovered later.\n *\n * @default [0, 0]\n */\n offset?: PopperOffset;\n /**\n * Whether an arrow is rendered. The hook does not render it — it only adds the\n * `arrow()` middleware, exposes `arrowRef`, and adds `arrowHeight` to the\n * main-axis offset.\n *\n * @default false\n */\n arrow?: boolean;\n /**\n * Height in px of the arrow the caller renders, i.e. how far it protrudes from\n * the floating element. Only read when `arrow` is `true`.\n *\n * @default DEFAULT_ARROW_HEIGHT (15 — the popover arrow; see its derivation)\n */\n arrowHeight?: number;\n /**\n * tippy's `interactive`: the pointer may travel from the reference into the\n * floating element without closing it. Implemented as\n * `useHover(context, { handleClose: safePolygon() })`, which is only\n * meaningful for a hover trigger — a click-triggered popover is \"interactive\"\n * by construction.\n *\n * Also decides `pointerEvents` in the return value, because tippy sets\n * `pointer-events: none` on its popper root for a non-interactive instance.\n *\n * @default false\n */\n interactive?: boolean;\n /**\n * tippy's `disabled`: can never open. Forces the resolved open state to `false`\n * and disables every interaction Hook (rule 2 in the file header).\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Transition duration in ms — our `duration` prop, fed to\n * `useTransitionStyles`. tippy's own default is the asymmetric `[300, 250]`;\n * both our components default it to `350`, so there is no default here and the\n * caller states it.\n */\n duration?: UseTransitionStylesProps['duration'];\n /**\n * Overrides for the transition. `initial` defaults to a placement-aware\n * reproduction of tippy's `animation=\"shift-away-subtle\"`, which both\n * components hardcode.\n */\n transition?: Omit<UseTransitionStylesProps, 'duration'>;\n /**\n * `useDismiss` overrides. The hook's own defaults are tippy's behaviour:\n * `outsidePress: true` (tippy's `hideOnClick` default), `referencePress: false`\n * (tippy explicitly does NOT hide when a hover-triggered reference is pressed)\n * and `escapeKey: false` (rule 4 in the file header).\n *\n * `enabled` is NOT overridable — it is `!disabled`, because a disabled instance\n * has nothing to dismiss.\n */\n dismiss?: Omit<UseDismissProps, 'enabled'>;\n /** `useHover` overrides, e.g. `restMs`. `enabled` and `handleClose` are owned here. */\n hover?: Omit<UseHoverProps, 'enabled' | 'handleClose'>;\n /** `useClick` overrides. `enabled` is owned here. */\n click?: Omit<UseClickProps, 'enabled'>;\n /**\n * `useFocus` overrides. `enabled` is owned here, and `visibleOnly` DEFAULTS TO\n * `false` rather than Floating UI's `true`: tippy's `focus`/`focusin` triggers\n * attach a plain `focusin` listener with no `:focus-visible` test, so leaving\n * `visibleOnly` at `true` would stop every `trigger=\"mouseenter focus\"` tooltip\n * from opening on a mouse-driven focus. 6 consumer call sites pass\n * `\"mouseenter focus\"`.\n */\n focus?: Omit<UseFocusProps, 'enabled'>;\n /**\n * Cap the floating element's height to the space available, replacing the\n * `popper-max-size-modifier` + `applyMaxSize` pair in `Popover.tsx`.\n *\n * OPT-IN, because only `Popover` has it today. Turning it on for `Tooltip`\n * would add a `max-height` to every tooltip in both consumers.\n *\n * @default false\n */\n constrainHeight?: boolean;\n /** `padding` for the height cap. @default 10, from the modifier it replaces */\n maxHeightPadding?: number;\n /** `padding` for `flip()` / `shift()`. @default 5 */\n collisionPadding?: number;\n /**\n * `FloatingTree` node id, for nested context-menu submenus. Passed straight to\n * `useFloating`; unused until the `contextMenuSublevel` work (plan C5).\n */\n nodeId?: string;\n /** Extra middleware, appended last. */\n middleware?: Middleware[];\n}\n\n/** What `useFloatingPopover` returns. */\nexport interface UseFloatingPopoverReturn {\n /** `refs.setReference` / `refs.setFloating`, straight from `useFloating`. */\n refs: UseFloatingReturn['refs'];\n /** Absolute-position styles for the floating element. */\n floatingStyles: UseFloatingReturn['floatingStyles'];\n /** The Floating UI context — needed by `FloatingArrow`, `FloatingPortal`, `FloatingTree`. */\n context: UseFloatingReturn['context'];\n /** Spread onto the reference element. */\n getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];\n /** Spread onto the floating element. */\n getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];\n /** `true` while the element should be in the DOM, including during the close transition. */\n isMounted: boolean;\n /**\n * The transition styles for the current phase. Named `transitionStyles` and not\n * `styles` so a call site cannot confuse it with `floatingStyles` — the two are\n * applied to different elements (position on the outer, transition on the\n * inner) in all three existing implementations.\n */\n transitionStyles: ReturnType<typeof useTransitionStyles>['styles'];\n /** Attach to the rendered arrow. Already wired into the `arrow()` middleware. */\n arrowRef: React.MutableRefObject<SVGSVGElement | null>;\n /** The resolved open state, after `disabled` and controlled/uncontrolled resolution. */\n isOpen: boolean;\n /**\n * Imperative open/close, honouring controlled mode by reporting through\n * `onOpenChange`. This is what replaces the `_tippy.hide()` + `[data-tippy-root]`\n * DOM sweep in `Popover.tsx`'s `handleContextMenuItemClick`.\n */\n setOpen: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;\n /** The placement actually used after `flip()` / `autoPlacement()` resolved it. */\n placement: Placement;\n /**\n * `'none'` when `interactive` is `false`, otherwise `undefined`. tippy sets\n * `pointer-events: none` on the popper root of a non-interactive instance; the\n * hook reports the value rather than applying it, because which element carries\n * it differs per call site.\n */\n pointerEvents: 'none' | undefined;\n}\n\n/**\n * Builds the middleware array.\n *\n * ORDER IS PART OF THE CONTRACT, not a style: `offset` first (it shifts the\n * reference rect every later middleware measures against), then exactly one of\n * `flip`/`autoPlacement`, then `shift`, then `arrow`, then `size` last. Floating\n * UI's `size` docs are explicit that it must come AFTER `flip` for `flip`'s\n * `bestFit` fallback to see the constrained size, and that both should share the\n * same `padding`.\n *\n * `flip()` and `autoPlacement()` are mutually exclusive — they both write\n * `placement` and would fight — which is why this is an `if/else` and not two\n * pushes.\n */\nfunction buildMiddleware(options: {\n placement: PopoverPlacement;\n mainAxis: number;\n crossAxis: number;\n arrow: boolean;\n arrowRef: React.MutableRefObject<SVGSVGElement | null>;\n constrainHeight: boolean;\n maxHeightPadding: number;\n collisionPadding: number;\n extra?: Middleware[];\n}): Middleware[] {\n const middleware: Middleware[] = [\n offset({ mainAxis: options.mainAxis, crossAxis: options.crossAxis })\n ];\n\n if (isAutoPlacement(options.placement)) {\n /*\n * Popper's `auto-start` / `auto-end` mean \"pick the best base placement but\n * keep this alignment\", so `autoAlignment` is switched off — left on, Floating\n * UI would also consider the opposite alignment and the `-start`/`-end` in the\n * prop would stop being a constraint.\n *\n * No consumer passes an `auto*` placement today; both components' prop types\n * allow it, so it has to work.\n */\n const alignment =\n options.placement === 'auto-start'\n ? ('start' as const)\n : options.placement === 'auto-end'\n ? ('end' as const)\n : undefined;\n\n middleware.push(\n autoPlacement({\n padding: options.collisionPadding,\n ...(alignment ? { alignment, autoAlignment: false } : {})\n })\n );\n } else {\n middleware.push(flip({ padding: options.collisionPadding }));\n }\n\n middleware.push(shift({ padding: options.collisionPadding }));\n\n if (options.arrow) {\n middleware.push(arrow({ element: options.arrowRef }));\n }\n\n if (options.constrainHeight) {\n middleware.push(\n size({\n padding: options.maxHeightPadding,\n /*\n * THE CLEAR-WHEN-IT-FITS BRANCH IS THE POINT, not a refinement.\n * `popper-max-size-modifier` + the `applyMaxSize` block in `Popover.tsx`\n * set `maxHeight` unconditionally, on every reposition, so a 3-item\n * context menu also got a `max-height` — and any `overflow: auto` inside\n * it then showed a scrollbar for content that fits. Floating UI's own\n * `size()` troubleshooting prescribes exactly this:\n *\n * elements.floating.style.maxHeight =\n * availableHeight >= elements.floating.scrollHeight ? '' : `${availableHeight}px`;\n *\n * with one addition — the cap is cleared BEFORE `scrollHeight` is read.\n * Reading it while a previous run's `max-height` is still applied measures\n * the clamped box on any element that scrolls, so the cap would latch on\n * and never clear. `apply` already runs inside the positioning pass, so\n * the write → read → write is one style recalculation, and\n * `availableHeight` is a property of the reference and the boundary rather\n * than of the floating element, so clearing does not change it.\n *\n * `boundary` is left at Floating UI's default (`'clippingAncestors'`)\n * where `Popover.tsx` passed Popper `boundary: 'viewport'`. Floating UI\n * has no `'viewport'` boundary, and it does not need one here: the\n * floating element is portalled to `document.body` by default (plan C4),\n * so its only clipping ancestor IS the viewport.\n */\n apply({ availableHeight, elements }) {\n elements.floating.style.maxHeight = '';\n\n const fits = elements.floating.scrollHeight <= availableHeight;\n\n elements.floating.style.maxHeight = fits ? '' : `${Math.max(0, availableHeight)}px`;\n }\n })\n );\n }\n\n if (options.extra?.length) {\n middleware.push(...options.extra);\n }\n\n return middleware;\n}\n\n/**\n * Positions and drives one floating element.\n *\n * @param options see `UseFloatingPopoverOptions`; every member is optional\n */\nexport function useFloatingPopover(\n options: UseFloatingPopoverOptions = {}\n): UseFloatingPopoverReturn {\n const {\n placement = 'bottom',\n open,\n onOpenChange,\n trigger,\n offset: offsetProp = [0, 0],\n arrow: hasArrow = false,\n arrowHeight = DEFAULT_ARROW_HEIGHT,\n interactive = false,\n disabled = false,\n duration,\n transition,\n dismiss: dismissProps,\n hover: hoverProps,\n click: clickProps,\n focus: focusProps,\n constrainHeight = false,\n maxHeightPadding = DEFAULT_MAX_HEIGHT_PADDING,\n collisionPadding = DEFAULT_COLLISION_PADDING,\n nodeId,\n middleware: extraMiddleware\n } = options;\n\n const arrowRef = useRef<SVGSVGElement | null>(null);\n\n /*\n * `typeof open === 'boolean'` and not `open !== undefined`: `isBoolean` from\n * lodash is what `Popover.tsx` uses for the same test today, and `null` has to\n * read as uncontrolled — a consumer computing `visible={someRef.current && …}`\n * can produce `null`, and treating that as \"controlled and closed\" would freeze\n * the popover shut.\n */\n const isControlled = typeof open === 'boolean';\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const isOpen = disabled ? false : isControlled ? open : uncontrolledOpen;\n\n /*\n * `disabled` must CLEAR the uncontrolled state, not just mask it in `isOpen`. tippy's\n * `disable()` hid the instance and `enable()` never re-showed it. Masking alone inverts\n * that: `triggersEnabled` below also goes false, so the mouseleave or second click that\n * would reset `uncontrolledOpen` never arrives, and the stale `true` re-opens the popover\n * as soon as `disabled` goes back to false.\n *\n * Reachable only from an UNCONTROLLED popover — `TextArea` and `CompactTextInput` pair\n * `disabled` with `visible`, so they are controlled at that moment.\n */\n useEffect(() => {\n if (disabled) {\n setUncontrolledOpen(false);\n }\n }, [disabled]);\n\n const setOpen = useCallback(\n (next: boolean, event?: Event, reason?: OpenChangeReason) => {\n if (!isControlled) {\n setUncontrolledOpen(next);\n }\n\n onOpenChange?.(next, event, reason);\n },\n [isControlled, onOpenChange]\n );\n\n const [skidding, distance] = offsetProp;\n\n const middleware = useMemo(\n () =>\n buildMiddleware({\n placement,\n mainAxis: distance + (hasArrow ? arrowHeight : 0),\n crossAxis: skidding,\n arrow: hasArrow,\n arrowRef,\n constrainHeight,\n maxHeightPadding,\n collisionPadding,\n extra: extraMiddleware\n }),\n [\n placement,\n distance,\n skidding,\n hasArrow,\n arrowHeight,\n constrainHeight,\n maxHeightPadding,\n collisionPadding,\n extraMiddleware\n ]\n );\n\n const {\n refs,\n floatingStyles,\n context,\n placement: resolvedPlacement\n } = useFloating({\n /*\n * `undefined` for an `auto*` placement: `autoPlacement()` overwrites\n * `placement` on every run, so passing one of Popper's `auto` strings here\n * would be a type error for a value that is then discarded anyway.\n */\n placement: isAutoPlacement(placement) ? undefined : placement,\n open: isOpen,\n onOpenChange: setOpen,\n whileElementsMounted: autoUpdate,\n middleware,\n nodeId\n });\n\n const triggers = useMemo(() => parseTrigger(trigger), [trigger]);\n\n /*\n * Controlled mode takes the triggers off; `disabled` takes everything off. Both\n * are tippy's semantics — file header rules 1 and 2.\n */\n const triggersEnabled = !disabled && !isControlled;\n\n /*\n * Memoised because `safePolygon()` returns a NEW function every call and\n * `useHover` keeps `handleClose` in its effect dependencies — an inline call\n * would tear down and re-attach the traversal handlers on every render.\n */\n const handleClose = useMemo(() => (interactive ? safePolygon() : null), [interactive]);\n\n const click = useClick(context, { ...clickProps, enabled: triggersEnabled && triggers.click });\n const hover = useHover(context, {\n ...hoverProps,\n enabled: triggersEnabled && triggers.hover,\n handleClose\n });\n const focus = useFocus(context, {\n visibleOnly: false,\n ...focusProps,\n enabled: triggersEnabled && triggers.focus\n });\n const dismiss = useDismiss(context, {\n escapeKey: false,\n outsidePress: true,\n referencePress: false,\n ...dismissProps,\n enabled: !disabled\n });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([click, hover, focus, dismiss]);\n\n const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {\n initial: shiftAwaySubtle,\n ...transition,\n duration\n });\n\n return {\n refs,\n floatingStyles,\n context,\n getReferenceProps,\n getFloatingProps,\n isMounted,\n transitionStyles,\n arrowRef,\n isOpen,\n setOpen,\n placement: resolvedPlacement,\n pointerEvents: interactive ? undefined : 'none'\n };\n}\n\nexport default useFloatingPopover;\n"],"names":["DEFAULT_ARROW_HEIGHT","DEFAULT_MAX_HEIGHT_PADDING","DEFAULT_COLLISION_PADDING","SHIFT_AWAY_SUBTLE_DISTANCE","isAutoPlacement","placement","shiftAwaySubtle","side","transform","top","bottom","left","right","opacity","buildMiddleware","options","middleware","offset","mainAxis","crossAxis","alignment","undefined","push","autoPlacement","padding","collisionPadding","autoAlignment","flip","shift","arrow","element","arrowRef","constrainHeight","size","maxHeightPadding","apply","availableHeight","elements","floating","style","maxHeight","fits","scrollHeight","Math","max","extra","length","useFloatingPopover","open","onOpenChange","trigger","offsetProp","hasArrow","arrowHeight","interactive","disabled","duration","transition","dismiss","dismissProps","hover","hoverProps","click","clickProps","focus","focusProps","nodeId","extraMiddleware","useRef","isControlled","uncontrolledOpen","setUncontrolledOpen","useState","isOpen","useEffect","setOpen","useCallback","next","event","reason","skidding","distance","useMemo","refs","floatingStyles","context","resolvedPlacement","useFloating","whileElementsMounted","autoUpdate","triggers","parseTrigger","triggersEnabled","handleClose","safePolygon","useClick","enabled","useHover","useFocus","visibleOnly","useDismiss","escapeKey","outsidePress","referencePress","getReferenceProps","getFloatingProps","useInteractions","isMounted","styles","transitionStyles","useTransitionStyles","initial","pointerEvents"],"mappings":";;;;AA6IO,MAAMA,oBAAoB,GAAG;AAOpC,MAAMC,0BAA0B,GAAG,EAAE;AAGrC,MAAMC,yBAAyB,GAAG,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iB;IACjBC,gBAAgB;IAChBE,SAAS;IACTE,gBAAgB;IAChB9E,QAAQ;IACR0C,MAAM;IACNE,OAAO;AACPtE,IAAAA,SAAS,EAAEiF,iBAAiB;AAC5B0B,IAAAA,aAAa,EAAE1D,WAAW,GAAGjC,SAAS,GAAG;GAC1C;AACH;;;;"}
1
+ {"version":3,"file":"useFloatingPopover.js","sources":["../../src/hooks/useFloatingPopover.ts"],"sourcesContent":["/**\n * Positions and drives one floating element, replacing `@tippyjs/react`.\n *\n * This hook handles POSITION and INTERACTION; the caller renders elements,\n * wrappers, portal, and arrow. That separation is intentional — different\n * consumers need different markup (`.tippy-content` shim for `Popover`,\n * context-menu variant for menus, different arrows for summary cards).\n *\n * Four non-obvious compatibility rules are documented in the impl: controlled\n * mode disables triggers but not dismiss; `disabled` means \"cannot open\";\n * `offset[1]` is arrow-tip gap not box distance (see `DEFAULT_ARROW_HEIGHT`);\n * escape is off by default (WAI-ARIA change, requires explicit opt-in).\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport {\n arrow,\n autoPlacement,\n autoUpdate,\n flip,\n offset,\n safePolygon,\n shift,\n size,\n useClick,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useTransitionStyles\n} from '@floating-ui/react';\n\nimport { parseTrigger } from '../utils/parseTrigger';\n\nimport type {\n Middleware,\n OpenChangeReason,\n Placement,\n Side,\n UseClickProps,\n UseDismissProps,\n UseFloatingReturn,\n UseFocusProps,\n UseHoverProps,\n UseTransitionStylesProps\n} from '@floating-ui/react';\n\n// Arrow height in px. The `Popover` offset prop means \"gap between arrow tip and reference\",\n// not box distance, so `mainAxis = distance + height` must use this value — see\n// `Popover.styled.ts` and `FloatingArrow.styled.ts` for the full measurement chain.\nexport const DEFAULT_ARROW_HEIGHT = 15;\n\nconst DEFAULT_MAX_HEIGHT_PADDING = 10;\nconst DEFAULT_COLLISION_PADDING = 5;\n\n// From tippy's shift-away-subtle animation — matches the `translate` distance in its CSS.\nconst SHIFT_AWAY_SUBTLE_DISTANCE = 5;\n\n// Floating UI Placement plus Popper's auto values (handled by autoPlacement middleware).\nexport type PopoverPlacement = Placement | AutoPlacement;\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\n\nexport type PopperOffset = readonly [skidding: number, distance: number];\n\n// Type predicate (not just boolean) so placement narrows to Exclude<PopoverPlacement, AutoPlacement>.\nfunction isAutoPlacement(placement: PopoverPlacement): placement is AutoPlacement {\n return placement === 'auto' || placement === 'auto-start' || placement === 'auto-end';\n}\n\n// Placement-aware transition matching tippy's shift-away-subtle animation.\n// Function form lets useTransitionStyles hand us the resolved side after flip.\nconst shiftAwaySubtle = ({ side }: { side: Side }) => {\n const transform = {\n top: `translateY(${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,\n bottom: `translateY(-${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,\n left: `translateX(${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,\n right: `translateX(-${SHIFT_AWAY_SUBTLE_DISTANCE}px)`\n }[side];\n\n return { opacity: 0, transform };\n};\n\n/** What `useFloatingPopover` accepts. Every member is optional. */\nexport interface UseFloatingPopoverOptions {\n /**\n * Preferred placement, in the shared Popper/Floating UI vocabulary. `auto`,\n * `auto-start` and `auto-end` swap `flip()` for `autoPlacement()`.\n *\n * @default 'bottom'\n */\n placement?: PopoverPlacement;\n /**\n * Controlled open state — our `visible` prop. `undefined` (the default) means\n * UNCONTROLLED: the hook owns the state and the parsed `trigger` drives it. Any\n * boolean, INCLUDING `false`, means controlled and turns the trigger Hooks off;\n * see rule 1 in the file header.\n */\n open?: boolean;\n /**\n * Called on every open-state change, controlled or not, with Floating UI's\n * `reason`. `reason === 'outside-press'` is what `Popover`'s `onClickOutside`\n * prop maps onto.\n */\n onOpenChange?: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;\n /**\n * tippy's `trigger` space-string, e.g. `'click focus'`, `'mouseenter'`, `''`.\n * `undefined` means tippy's default (`'mouseenter focus'`) and `''` means no\n * triggers at all — `parseTrigger` owns both rules and documents where `''` is\n * used in the consumers.\n */\n trigger?: string | null;\n /**\n * `[skidding, distance]` where distance is the arrow-tip gap (see `DEFAULT_ARROW_HEIGHT`).\n * Skidding maps to Floating UI's `crossAxis` (no sign flip for `-end` placements).\n * @default [0, 0]\n */\n offset?: PopperOffset;\n /**\n * Whether an arrow is rendered. The hook does not render it — it only adds the\n * `arrow()` middleware, exposes `arrowRef`, and adds `arrowHeight` to the\n * main-axis offset.\n *\n * @default false\n */\n arrow?: boolean;\n /**\n * Height in px of the arrow the caller renders, i.e. how far it protrudes from\n * the floating element. Only read when `arrow` is `true`.\n *\n * @default DEFAULT_ARROW_HEIGHT (15 — the popover arrow; see its derivation)\n */\n arrowHeight?: number;\n /**\n * Pointer can travel from reference to floating element without closing.\n * Also determines `pointerEvents` in the return value.\n * @default false\n */\n interactive?: boolean;\n /**\n * tippy's `disabled`: can never open. Forces the resolved open state to `false`\n * and disables every interaction Hook (rule 2 in the file header).\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Transition duration in ms — our `duration` prop, fed to\n * `useTransitionStyles`. tippy's own default is the asymmetric `[300, 250]`;\n * both our components default it to `350`, so there is no default here and the\n * caller states it.\n */\n duration?: UseTransitionStylesProps['duration'];\n /**\n * Overrides for the transition. `initial` defaults to a placement-aware\n * reproduction of tippy's `animation=\"shift-away-subtle\"`, which both\n * components hardcode.\n */\n transition?: Omit<UseTransitionStylesProps, 'duration'>;\n /**\n * `useDismiss` overrides. Defaults match tippy: `outsidePress: true`,\n * `referencePress: false`, `escapeKey: false`. `enabled` is `!disabled`.\n */\n dismiss?: Omit<UseDismissProps, 'enabled'>;\n /** `useHover` overrides, e.g. `restMs`. `enabled` and `handleClose` are owned here. */\n hover?: Omit<UseHoverProps, 'enabled' | 'handleClose'>;\n /** `useClick` overrides. `enabled` is owned here. */\n click?: Omit<UseClickProps, 'enabled'>;\n /**\n * `useFocus` overrides. `visibleOnly` defaults to `false` (not Floating UI's `true`)\n * to match tippy's plain focusin listener without :focus-visible test.\n */\n focus?: Omit<UseFocusProps, 'enabled'>;\n /**\n * Cap floating element height to available space. Opt-in; only Popover uses it.\n * @default false\n */\n constrainHeight?: boolean;\n /** `padding` for the height cap. @default 10, from the modifier it replaces */\n maxHeightPadding?: number;\n /** `padding` for `flip()` / `shift()`. @default 5 */\n collisionPadding?: number;\n /**\n * `FloatingTree` node id, for nested context-menu submenus. Passed straight to\n * `useFloating`; unused until the `contextMenuSublevel` work (plan C5).\n */\n nodeId?: string;\n /** Extra middleware, appended last. */\n middleware?: Middleware[];\n}\n\n/** What `useFloatingPopover` returns. */\nexport interface UseFloatingPopoverReturn {\n /** `refs.setReference` / `refs.setFloating`, straight from `useFloating`. */\n refs: UseFloatingReturn['refs'];\n /** Absolute-position styles for the floating element. */\n floatingStyles: UseFloatingReturn['floatingStyles'];\n /** The Floating UI context — needed by `FloatingArrow`, `FloatingPortal`, `FloatingTree`. */\n context: UseFloatingReturn['context'];\n /** Spread onto the reference element. */\n getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];\n /** Spread onto the floating element. */\n getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];\n /** `true` while the element should be in the DOM, including during the close transition. */\n isMounted: boolean;\n /**\n * The transition styles for the current phase. Named `transitionStyles` and not\n * `styles` so a call site cannot confuse it with `floatingStyles` — the two are\n * applied to different elements (position on the outer, transition on the\n * inner) in all three existing implementations.\n */\n transitionStyles: ReturnType<typeof useTransitionStyles>['styles'];\n /** Attach to the rendered arrow. Already wired into the `arrow()` middleware. */\n arrowRef: React.MutableRefObject<SVGSVGElement | null>;\n /** The resolved open state, after `disabled` and controlled/uncontrolled resolution. */\n isOpen: boolean;\n /**\n * Imperative open/close, honouring controlled mode by reporting through\n * `onOpenChange`. This is what replaces the `_tippy.hide()` + `[data-tippy-root]`\n * DOM sweep in `Popover.tsx`'s `handleContextMenuItemClick`.\n */\n setOpen: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;\n /** The placement actually used after `flip()` / `autoPlacement()` resolved it. */\n placement: Placement;\n /**\n * `'none'` when `interactive` is `false`, otherwise `undefined`. tippy sets\n * `pointer-events: none` on the popper root of a non-interactive instance; the\n * hook reports the value rather than applying it, because which element carries\n * it differs per call site.\n */\n pointerEvents: 'none' | undefined;\n}\n\n// Middleware order is part of the contract: offset, flip/autoPlacement (mutually exclusive),\n// shift, arrow, then size last (must come after flip for bestFit to see constrained size).\nfunction buildMiddleware(options: {\n placement: PopoverPlacement;\n mainAxis: number;\n crossAxis: number;\n arrow: boolean;\n arrowRef: React.MutableRefObject<SVGSVGElement | null>;\n constrainHeight: boolean;\n maxHeightPadding: number;\n collisionPadding: number;\n extra?: Middleware[];\n}): Middleware[] {\n const middleware: Middleware[] = [\n offset({ mainAxis: options.mainAxis, crossAxis: options.crossAxis })\n ];\n\n if (isAutoPlacement(options.placement)) {\n // auto-start/auto-end mean \"best base placement, keep alignment\", so autoAlignment: false.\n // No consumer uses it today, but both components' types allow it.\n const alignment =\n options.placement === 'auto-start'\n ? ('start' as const)\n : options.placement === 'auto-end'\n ? ('end' as const)\n : undefined;\n\n middleware.push(\n autoPlacement({\n padding: options.collisionPadding,\n ...(alignment ? { alignment, autoAlignment: false } : {})\n })\n );\n } else {\n middleware.push(flip({ padding: options.collisionPadding }));\n }\n\n middleware.push(shift({ padding: options.collisionPadding }));\n\n if (options.arrow) {\n middleware.push(arrow({ element: options.arrowRef }));\n }\n\n if (options.constrainHeight) {\n middleware.push(\n size({\n padding: options.maxHeightPadding,\n // Clear max-height before reading scrollHeight to avoid latching on clamped measurements.\n // Avoids spurious scrollbars in content that fits (like 3-item context menus).\n apply({ availableHeight, elements }) {\n elements.floating.style.maxHeight = '';\n\n const fits = elements.floating.scrollHeight <= availableHeight;\n\n elements.floating.style.maxHeight = fits ? '' : `${Math.max(0, availableHeight)}px`;\n }\n })\n );\n }\n\n if (options.extra?.length) {\n middleware.push(...options.extra);\n }\n\n return middleware;\n}\n\n/**\n * Positions and drives one floating element.\n *\n * @param options see `UseFloatingPopoverOptions`; every member is optional\n */\nexport function useFloatingPopover(\n options: UseFloatingPopoverOptions = {}\n): UseFloatingPopoverReturn {\n const {\n placement = 'bottom',\n open,\n onOpenChange,\n trigger,\n offset: offsetProp = [0, 0],\n arrow: hasArrow = false,\n arrowHeight = DEFAULT_ARROW_HEIGHT,\n interactive = false,\n disabled = false,\n duration,\n transition,\n dismiss: dismissProps,\n hover: hoverProps,\n click: clickProps,\n focus: focusProps,\n constrainHeight = false,\n maxHeightPadding = DEFAULT_MAX_HEIGHT_PADDING,\n collisionPadding = DEFAULT_COLLISION_PADDING,\n nodeId,\n middleware: extraMiddleware\n } = options;\n\n const arrowRef = useRef<SVGSVGElement | null>(null);\n\n // Use typeof, not !== undefined: null (from computed refs) must mean uncontrolled.\n const isControlled = typeof open === 'boolean';\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const isOpen = disabled ? false : isControlled ? open : uncontrolledOpen;\n\n // Clear uncontrolled state when disabled, not just mask in isOpen — otherwise stale true reopens it.\n useEffect(() => {\n if (disabled) {\n setUncontrolledOpen(false);\n }\n }, [disabled]);\n\n const setOpen = useCallback(\n (next: boolean, event?: Event, reason?: OpenChangeReason) => {\n if (!isControlled) {\n setUncontrolledOpen(next);\n }\n\n onOpenChange?.(next, event, reason);\n },\n [isControlled, onOpenChange]\n );\n\n const [skidding, distance] = offsetProp;\n\n const middleware = useMemo(\n () =>\n buildMiddleware({\n placement,\n mainAxis: distance + (hasArrow ? arrowHeight : 0),\n crossAxis: skidding,\n arrow: hasArrow,\n arrowRef,\n constrainHeight,\n maxHeightPadding,\n collisionPadding,\n extra: extraMiddleware\n }),\n [\n placement,\n distance,\n skidding,\n hasArrow,\n arrowHeight,\n constrainHeight,\n maxHeightPadding,\n collisionPadding,\n extraMiddleware\n ]\n );\n\n const {\n refs,\n floatingStyles,\n context,\n placement: resolvedPlacement\n } = useFloating({\n // Undefined for auto* placements: autoPlacement() overwrites it anyway.\n placement: isAutoPlacement(placement) ? undefined : placement,\n open: isOpen,\n onOpenChange: setOpen,\n whileElementsMounted: autoUpdate,\n middleware,\n nodeId\n });\n\n const triggers = useMemo(() => parseTrigger(trigger), [trigger]);\n\n // Controlled mode and disabled both turn off triggers (tippy semantics).\n const triggersEnabled = !disabled && !isControlled;\n\n // Memoized so useHover doesn't re-attach handlers when safePolygon() is called.\n const handleClose = useMemo(() => (interactive ? safePolygon() : null), [interactive]);\n\n const click = useClick(context, { ...clickProps, enabled: triggersEnabled && triggers.click });\n const hover = useHover(context, {\n ...hoverProps,\n enabled: triggersEnabled && triggers.hover,\n handleClose\n });\n const focus = useFocus(context, {\n visibleOnly: false,\n ...focusProps,\n enabled: triggersEnabled && triggers.focus\n });\n const dismiss = useDismiss(context, {\n escapeKey: false,\n outsidePress: true,\n referencePress: false,\n ...dismissProps,\n enabled: !disabled\n });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([click, hover, focus, dismiss]);\n\n const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {\n initial: shiftAwaySubtle,\n ...transition,\n duration\n });\n\n return {\n refs,\n floatingStyles,\n context,\n getReferenceProps,\n getFloatingProps,\n isMounted,\n transitionStyles,\n arrowRef,\n isOpen,\n setOpen,\n placement: resolvedPlacement,\n pointerEvents: interactive ? undefined : 'none'\n };\n}\n\nexport default useFloatingPopover;\n"],"names":["DEFAULT_ARROW_HEIGHT","DEFAULT_MAX_HEIGHT_PADDING","DEFAULT_COLLISION_PADDING","SHIFT_AWAY_SUBTLE_DISTANCE","isAutoPlacement","placement","shiftAwaySubtle","side","transform","top","bottom","left","right","opacity","buildMiddleware","options","middleware","offset","mainAxis","crossAxis","alignment","undefined","push","autoPlacement","padding","collisionPadding","autoAlignment","flip","shift","arrow","element","arrowRef","constrainHeight","size","maxHeightPadding","apply","availableHeight","elements","floating","style","maxHeight","fits","scrollHeight","Math","max","extra","length","useFloatingPopover","open","onOpenChange","trigger","offsetProp","hasArrow","arrowHeight","interactive","disabled","duration","transition","dismiss","dismissProps","hover","hoverProps","click","clickProps","focus","focusProps","nodeId","extraMiddleware","useRef","isControlled","uncontrolledOpen","setUncontrolledOpen","useState","isOpen","useEffect","setOpen","useCallback","next","event","reason","skidding","distance","useMemo","refs","floatingStyles","context","resolvedPlacement","useFloating","whileElementsMounted","autoUpdate","triggers","parseTrigger","triggersEnabled","handleClose","safePolygon","useClick","enabled","useHover","useFocus","visibleOnly","useDismiss","escapeKey","outsidePress","referencePress","getReferenceProps","getFloatingProps","useInteractions","isMounted","styles","transitionStyles","useTransitionStyles","initial","pointerEvents"],"mappings":";;;;AAmDO,MAAMA,oBAAoB,GAAG;AAEpC,MAAMC,0BAA0B,GAAG,EAAE;AACrC,MAAMC,yBAAyB,GAAG,CAAC;AAGnC,MAAMC,0BAA0B,GAAG,CAAC;AASpC,SAASC,eAAeA,CAACC,SAA2B,EAA8B;EAChF,OAAOA,SAAS,KAAK,MAAM,IAAIA,SAAS,KAAK,YAAY,IAAIA,SAAS,KAAK,UAAU;AACvF;AAIA,MAAMC,eAAe,GAAGA,CAAC;AAAEC,EAAAA;AAAqB,CAAC,KAAK;AACpD,EAAA,MAAMC,SAAS,GAAG;IAChBC,GAAG,EAAE,CAAA,WAAA,EAAcN,0BAA0B,CAAA,GAAA,CAAK;IAClDO,MAAM,EAAE,CAAA,YAAA,EAAeP,0BAA0B,CAAA,GAAA,CAAK;IACtDQ,IAAI,EAAE,CAAA,WAAA,EAAcR,0BAA0B,CAAA,GAAA,CAAK;IACnDS,KAAK,EAAE,eAAeT,0BAA0B,CAAA,GAAA;GACjD,CAACI,IAAI,CAAC;EAEP,OAAO;AAAEM,IAAAA,OAAO,EAAE,CAAC;AAAEL,IAAAA;GAAW;AAClC,CAAC;AA0JD,SAASM,eAAeA,CAACC,OAUxB,EAAgB;AACf,EAAA,MAAMC,UAAwB,GAAG,CAC/BC,MAAM,CAAC;IAAEC,QAAQ,EAAEH,OAAO,CAACG,QAAQ;IAA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AK;AACrB,IAAA,GAAG5C,YAAY;AACfqC,IAAAA,OAAO,EAAE,CAACzC;AACZ,GAAC,CAAC;EAEF,MAAM;IAAEiD,iBAAiB;AAAEC,IAAAA;AAAiB,GAAC,GAAGC,eAAe,CAAC,CAAC5C,KAAK,EAAEF,KAAK,EAAEI,KAAK,EAAEN,OAAO,CAAC,CAAC;EAE/F,MAAM;IAAEiD,SAAS;AAAEC,IAAAA,MAAM,EAAEC;AAAiB,GAAC,GAAGC,mBAAmB,CAACzB,OAAO,EAAE;AAC3E0B,IAAAA,OAAO,EAAEzG,eAAe;AACxB,IAAA,GAAGmD,UAAU;AACbD,IAAAA;AACF,GAAC,CAAC;EAEF,OAAO;IACL2B,IAAI;IACJC,cAAc;IACdC,OAAO;IACPmB,iBAAiB;IACjBC,gBAAgB;IAChBE,SAAS;IACTE,gBAAgB;IAChB9E,QAAQ;IACR0C,MAAM;IACNE,OAAO;AACPtE,IAAAA,SAAS,EAAEiF,iBAAiB;AAC5B0B,IAAAA,aAAa,EAAE1D,WAAW,GAAGjC,SAAS,GAAG;GAC1C;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIsomorphicLayoutEffect.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nimport type { DependencyList, EffectCallback } from 'react';\n\n/**\n * `useLayoutEffect` in the browser, `useEffect` on the server.\n *\n * WHY THE ANNOTATION IS EXPLICIT RATHER THAN INFERRED. The two hooks have\n * identical signatures, so the inferred type of the ternary is a UNION of two\n * call signatures — and a union of signatures is only callable through their\n * intersection, which is a worse thing to hand 1 call site and every future one\n * than the single signature they agree on. Naming that signature is also what\n * the deleted `@type` JSDoc was clumsily trying to say by listing the same\n * signature twice.\n *\n * WHY THE RUNTIME TERNARY MUST STAY A RUNTIME TERNARY. The two hooks are\n * interchangeable to the type system and NOT interchangeable to React:\n * `useLayoutEffect` logs \"useLayoutEffect does nothing on the server\" under\n * `renderToStaticMarkup` — which the render gate captures as a warning with its\n * own exit code — and it runs before paint rather than after it. So this file\n * cannot be simplified into a plain re-export, and no type here can protect\n * that. Hence this comment.\n *\n * `typeof window !== 'undefined'` is evaluated ONCE, at module scope, on\n * purpose: the choice must not vary between renders or React sees a different\n * hook in the same slot.\n */\nconst useIsomorphicLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n"],"names":["useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect"],"mappings":";;AA2BA,MAAMA,yBAAkF,GACtF,OAAOC,MAAM,KAAK,WAAW,GAAGC,eAAe,GAAGC;;;;"}
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nimport type { DependencyList, EffectCallback } from 'react';\n\n// useLayoutEffect in the browser, useEffect on the server.\n// Explicit annotation (not inferred union) to hand a single signature.\n// The ternary must be runtime (not a re-export) — useLayoutEffect has side effects\n// under renderToStaticMarkup and runs before paint. Evaluated once at module scope.\nconst useIsomorphicLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n"],"names":["useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect"],"mappings":";;AAQA,MAAMA,yBAAkF,GACtF,OAAOC,MAAM,KAAK,WAAW,GAAGC,eAAe,GAAGC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOnClickOutside.js","sources":["../../src/hooks/useOnClickOutside.ts"],"sourcesContent":["import { useEventListener } from './useEventListner';\n\nimport type { DomEventMap } from './useEventListner';\nimport type { RefObject } from 'react';\n\n/**\n * The event names this hook can watch for. Narrower than `DomEventName` on\n * purpose — the parameter is called `mouseEvent`, and a non-pointer event name\n * here would silently never fire the outside-click check.\n */\nexport type OutsideClickEventName = 'mousedown' | 'mouseup' | 'click';\n\n/**\n * What the handler receives. DERIVED from `DomEventMap` rather than written as\n * `MouseEvent`, so it follows lib.dom if a future TypeScript retypes any of\n * these three names (`click` has already moved between `MouseEvent` and\n * `PointerEvent` upstream).\n */\nexport type OutsideClickEvent = DomEventMap[OutsideClickEventName];\n\n/**\n * Calls `handler` when the chosen pointer event happens anywhere outside `ref`'s\n * element and its descendants.\n *\n * `ref` IS TYPED AS NULLABLE BECAUSE THE BODY READS `ref?.current`. That is not\n * defensiveness copied from elsewhere — it is the existing runtime contract, so\n * the type records it. Contrast `useElementSize`, whose body reads `ref.current`\n * and whose `ref` is therefore required.\n *\n * @param ref the \"inside\" element. A click on it or on any descendant is\n * ignored\n * @param handler called with the originating event for outside clicks only\n * @param mouseEvent which event to listen for; defaults to `'mousedown'` so the\n * callback fires before a click can move focus\n */\nexport function useOnClickOutside<T extends Node = HTMLElement>(\n ref: RefObject<T | null> | null | undefined,\n handler: (event: OutsideClickEvent) => void,\n mouseEvent: OutsideClickEventName = 'mousedown'\n): void {\n useEventListener(mouseEvent, (event: OutsideClickEvent) => {\n const el = ref?.current;\n\n /*\n * Do nothing if clicking ref's element or descendent elements.\n *\n * `event.target` is `EventTarget | null` — `EventTarget` has no `contains`\n * and is not a `Node`, so the cast is what says \"in this DOM listener the\n * target is a node\". `Node.contains` already accepts `null`, so no runtime\n * guard is added or removed here.\n */\n if (!el || el.contains(event.target as Node | null)) {\n return;\n }\n\n handler(event);\n });\n}\n"],"names":["useOnClickOutside","ref","handler","mouseEvent","useEventListener","event","el","current","contains","target"],"mappings":";;AAmCO,SAASA,iBAAiBA,CAC/BC,GAA2C,EAC3CC,OAA2C,EAC3CC,UAAiC,GAAG,WAAW,EACzC;AACNC,EAAAA,gBAAgB,CAACD,UAAU,EAAGE,KAAwB,IAAK;AACzD,IAAA,MAAMC,EAAE,GAAGL,GAAG,EAAEM,OAAO;IAUvB,IAAI,CAACD,EAAE,IAAIA,EAAE,CAACE,QAAQ,CAACH,KAAK,CAACI,MAAqB,CAAC,EAAE;AACnD,MAAA;AACF,IAAA;IAEAP,OAAO,CAACG,KAAK,CAAC;AAChB,EAAA,CAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"useOnClickOutside.js","sources":["../../src/hooks/useOnClickOutside.ts"],"sourcesContent":["import { useEventListener } from './useEventListner';\n\nimport type { DomEventMap } from './useEventListner';\nimport type { RefObject } from 'react';\n\n// Narrower than DomEventName — parameter is called mouseEvent for safety.\nexport type OutsideClickEventName = 'mousedown' | 'mouseup' | 'click';\n\n// Derived from DomEventMap, not hardcoded as MouseEvent, to follow lib.dom retyping.\nexport type OutsideClickEvent = DomEventMap[OutsideClickEventName];\n\n/**\n * Fires handler on pointer events outside ref (and its descendants).\n * Ref is nullable — the runtime contract checks ref?.current.\n *\n * @param ref the \"inside\" element; clicks on it or descendants are ignored\n * @param handler called only for outside clicks\n * @param mouseEvent event to listen for; defaults to `'mousedown'` (before focus moves)\n */\nexport function useOnClickOutside<T extends Node = HTMLElement>(\n ref: RefObject<T | null> | null | undefined,\n handler: (event: OutsideClickEvent) => void,\n mouseEvent: OutsideClickEventName = 'mousedown'\n): void {\n useEventListener(mouseEvent, (event: OutsideClickEvent) => {\n const el = ref?.current;\n\n // Cast event.target to Node — EventTarget has no contains. Node.contains already accepts null.\n if (!el || el.contains(event.target as Node | null)) {\n return;\n }\n\n handler(event);\n });\n}\n"],"names":["useOnClickOutside","ref","handler","mouseEvent","useEventListener","event","el","current","contains","target"],"mappings":";;AAmBO,SAASA,iBAAiBA,CAC/BC,GAA2C,EAC3CC,OAA2C,EAC3CC,UAAiC,GAAG,WAAW,EACzC;AACNC,EAAAA,gBAAgB,CAACD,UAAU,EAAGE,KAAwB,IAAK;AACzD,IAAA,MAAMC,EAAE,GAAGL,GAAG,EAAEM,OAAO;IAGvB,IAAI,CAACD,EAAE,IAAIA,EAAE,CAACE,QAAQ,CAACH,KAAK,CAACI,MAAqB,CAAC,EAAE;AACnD,MAAA;AACF,IAAA;IAEAP,OAAO,CAACG,KAAK,CAAC;AAChB,EAAA,CAAC,CAAC;AACJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltipAutoShow.js","sources":["../../src/hooks/useTooltipAutoShow.ts"],"sourcesContent":["import { useRef, useState, useEffect } from 'react';\n\n/**\n * What `useTooltipAutoShow` returns. Spread straight onto a `Tooltip` by\n * `TextArea` and `CompactTextInput`.\n */\nexport interface TooltipAutoShow {\n /** Clears the forced-visible state. Wire to the trigger's `onMouseLeave`. */\n toolTipOnMouseLeave: () => void;\n /**\n * The last non-empty content. Sticky on purpose, so the tooltip can animate\n * out with its text intact instead of emptying mid-transition.\n */\n toolTipContent: string;\n /** `true` while there is no content, which suppresses the tooltip entirely. */\n toolTipDisabled: boolean;\n /**\n * `true` | `undefined` — NEVER `false`, AND THE `undefined` IS LOAD-BEARING.\n * `Tooltip` treats `visible` as the switch between UNCONTROLLED and CONTROLLED\n * mode: `undefined` leaves the tooltip under its own `trigger` prop\n * (hover/focus), while any boolean — including `false` — hands control to us\n * permanently and the tooltip stops responding to hover for the rest of its\n * life. So this type is `true | undefined` rather than the `boolean` it looks\n * like it wants to be. DO NOT \"SIMPLIFY\" IT: widening to `boolean` compiles\n * fine and silently breaks every hover tooltip in `TextArea` and\n * `CompactTextInput`.\n *\n * That rule was tippy's and is now the library's own: `useFloatingPopover`\n * decides controlled-ness with `typeof open === 'boolean'`, so this contract\n * survived the Floating UI migration unchanged and deliberately.\n *\n * ONE SEMANTIC DIFFERENCE, RECORDED BECAUSE IT IS REAL EVEN THOUGH THE\n * OBSERVABLE OUTCOME IS THE SAME. Going from `true` back to `undefined` used\n * to leave the tippy instance SHOWN — `@tippyjs/react` only issues an\n * imperative `show()`/`hide()` while `visible !== undefined`, so dropping out\n * of controlled mode issued nothing and the tooltip stayed up until the\n * reference's own `mouseleave` hid it. `useFloatingPopover` instead resolves\n * to its uncontrolled state, which is closed. Both end with the tooltip\n * hidden, because the caller drives this from `onMouseLeave` and that same\n * pointer exit is what used to hide it; the new path just does not depend on a\n * second event arriving.\n */\n toolTipVisible: true | undefined;\n}\n\n/**\n * Tracks a tooltip's content and automatically forces it to be visible when the\n * content transitions from empty → non-empty, then defaults to trigger prop.\n *\n * ================== PLAN C8, DECIDED: THIS STAYS A SEPARATE HOOK ==================\n *\n * The plan asks whether `useFloatingPopover` should absorb this. It should not,\n * and the premise of the question turned out to be wrong.\n *\n * 1. **It does not read tippy's imperative instance API.** The plan describes it\n * as doing so, but measured — `grep -i tippy` over this file — the only match\n * is prose. There is no `_tippy`, no instance handle, no `show()`/`hide()`,\n * and no tippy import. Whatever was true when the plan was written, the\n * TypeScript migration left a hook that is pure React: two refs, one\n * `useState`, one `useEffect`.\n * 2. **What it depends on is a CONTRACT, not an implementation**, namely the\n * `undefined`-means-uncontrolled rule documented on `toolTipVisible`.\n * `useFloatingPopover` preserves that rule exactly, so this file needed no\n * behavioural change to survive the migration — and did not get one.\n * 3. **Merging it would put the wrong responsibility in the wrong place.** This\n * is a content-change detector: it compares the previous `content` string with\n * the current one and force-shows on the empty → non-empty edge.\n * `useFloatingPopover` owns position and interaction and never reads `content`\n * at all. Absorbing this would mean giving the positioning hook a `content`\n * parameter and a sticky-previous-value state machine for the benefit of the\n * two call sites that want it, out of the five it is meant to serve — three of\n * which (`SummaryCard`, `AssetAction`, `AssetGalleryCompactCard`) have no\n * content prop to diff.\n *\n * So the change here is documentation only: the JSDoc used to attribute the\n * controlled-mode rule to tippy, and tippy is going away.\n *\n * @param content the tooltip text. `string`, because both call sites declare\n * `descriptionToolTip: PropTypes.string` with a `''` default —\n * the sticky `displayContent` ref would not survive a `ReactNode`\n */\nfunction useTooltipAutoShow(content?: string): TooltipAutoShow {\n const displayContent = useRef(content || '');\n const prevContentRef = useRef(content);\n const [forceVisible, setForceVisible] = useState(false);\n\n const toolTipDisabled = !content;\n const toolTipVisible = forceVisible ? true : undefined;\n\n useEffect(() => {\n if (content) {\n displayContent.current = content;\n }\n\n return () => {};\n }, [content]);\n\n if (prevContentRef.current !== content) {\n const appeared = content && !prevContentRef.current;\n const disappeared = !content;\n\n if (appeared) setForceVisible(true);\n else if (disappeared) setForceVisible(false);\n\n prevContentRef.current = content;\n }\n\n return {\n toolTipOnMouseLeave: () => setForceVisible(false),\n toolTipContent: displayContent.current,\n toolTipDisabled,\n toolTipVisible\n };\n}\n\nexport default useTooltipAutoShow;\n"],"names":["useTooltipAutoShow","content","displayContent","useRef","prevContentRef","forceVisible","setForceVisible","useState","toolTipDisabled","toolTipVisible","undefined","useEffect","current","appeared","disappeared","toolTipOnMouseLeave","toolTipContent"],"mappings":";;AAiFA,SAASA,kBAAkBA,CAACC,OAAgB,EAAmB;AAC7D,EAAA,MAAMC,cAAc,GAAGC,MAAM,CAACF,OAAO,IAAI,EAAE,CAAC;AAC5C,EAAA,MAAMG,cAAc,GAAGD,MAAM,CAACF,OAAO,CAAC;EACtC,MAAM,CAACI,YAAY,EAAEC,eAAe,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EAEvD,MAAMC,eAAe,GAAG,CAACP,OAAO;AAChC,EAAA,MAAMQ,cAAc,GAAGJ,YAAY,GAAG,IAAI,GAAGK,SAAS;AAEtDC,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIV,OAAO,EAAE;MACXC,cAAc,CAACU,OAAO,GAAGX,OAAO;AAClC,IAAA;IAEA,OAAO,MAAM,CAAC,CAAC;AACjB,EAAA,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AAEb,EAAA,IAAIG,cAAc,CAACQ,OAAO,KAAKX,OAAO,EAAE;AACtC,IAAA,MAAMY,QAAQ,GAAGZ,OAAO,IAAI,CAACG,cAAc,CAACQ,OAAO;IACnD,MAAME,WAAW,GAAG,CAACb,OAAO;AAE5B,IAAA,IAAIY,QAAQ,EAAEP,eAAe,CAAC,IAAI,CAAC,CAAC,KAC/B,IAAIQ,WAAW,EAAER,eAAe,CAAC,KAAK,CAAC;IAE5CF,cAAc,CAACQ,OAAO,GAAGX,OAAO;AAClC,EAAA;EAEA,OAAO;AACLc,IAAAA,mBAAmB,EAAEA,MAAMT,eAAe,CAAC,KAAK,CAAC;IACjDU,cAAc,EAAEd,cAAc,CAACU,OAAO;IACtCJ,eAAe;AACfC,IAAAA;GACD;AACH;;;;"}
1
+ {"version":3,"file":"useTooltipAutoShow.js","sources":["../../src/hooks/useTooltipAutoShow.ts"],"sourcesContent":["import { useRef, useState, useEffect } from 'react';\n\n/**\n * What `useTooltipAutoShow` returns. Spread straight onto a `Tooltip` by\n * `TextArea` and `CompactTextInput`.\n */\nexport interface TooltipAutoShow {\n /** Clears the forced-visible state. Wire to the trigger's `onMouseLeave`. */\n toolTipOnMouseLeave: () => void;\n /**\n * The last non-empty content. Sticky on purpose, so the tooltip can animate\n * out with its text intact instead of emptying mid-transition.\n */\n toolTipContent: string;\n /** `true` while there is no content, which suppresses the tooltip entirely. */\n toolTipDisabled: boolean;\n /**\n * `true | undefined`, never `false`. Any boolean (including `false`) switches\n * to controlled mode and disables hover triggering. `undefined` means uncontrolled;\n * `true` means force-visible. This contract is checked by `useFloatingPopover`\n * with `typeof open === 'boolean'`.\n */\n toolTipVisible: true | undefined;\n}\n\n/**\n * Tracks tooltip content and forces visibility when content transitions from\n * empty → non-empty, then defaults to trigger prop.\n *\n * @param content the tooltip text. `string`, not `ReactNode`, because both call sites\n * use it with an empty-string default.\n */\nfunction useTooltipAutoShow(content?: string): TooltipAutoShow {\n const displayContent = useRef(content || '');\n const prevContentRef = useRef(content);\n const [forceVisible, setForceVisible] = useState(false);\n\n const toolTipDisabled = !content;\n const toolTipVisible = forceVisible ? true : undefined;\n\n useEffect(() => {\n if (content) {\n displayContent.current = content;\n }\n\n return () => {};\n }, [content]);\n\n if (prevContentRef.current !== content) {\n const appeared = content && !prevContentRef.current;\n const disappeared = !content;\n\n if (appeared) setForceVisible(true);\n else if (disappeared) setForceVisible(false);\n\n prevContentRef.current = content;\n }\n\n return {\n toolTipOnMouseLeave: () => setForceVisible(false),\n toolTipContent: displayContent.current,\n toolTipDisabled,\n toolTipVisible\n };\n}\n\nexport default useTooltipAutoShow;\n"],"names":["useTooltipAutoShow","content","displayContent","useRef","prevContentRef","forceVisible","setForceVisible","useState","toolTipDisabled","toolTipVisible","undefined","useEffect","current","appeared","disappeared","toolTipOnMouseLeave","toolTipContent"],"mappings":";;AAgCA,SAASA,kBAAkBA,CAACC,OAAgB,EAAmB;AAC7D,EAAA,MAAMC,cAAc,GAAGC,MAAM,CAACF,OAAO,IAAI,EAAE,CAAC;AAC5C,EAAA,MAAMG,cAAc,GAAGD,MAAM,CAACF,OAAO,CAAC;EACtC,MAAM,CAACI,YAAY,EAAEC,eAAe,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EAEvD,MAAMC,eAAe,GAAG,CAACP,OAAO;AAChC,EAAA,MAAMQ,cAAc,GAAGJ,YAAY,GAAG,IAAI,GAAGK,SAAS;AAEtDC,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIV,OAAO,EAAE;MACXC,cAAc,CAACU,OAAO,GAAGX,OAAO;AAClC,IAAA;IAEA,OAAO,MAAM,CAAC,CAAC;AACjB,EAAA,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AAEb,EAAA,IAAIG,cAAc,CAACQ,OAAO,KAAKX,OAAO,EAAE;AACtC,IAAA,MAAMY,QAAQ,GAAGZ,OAAO,IAAI,CAACG,cAAc,CAACQ,OAAO;IACnD,MAAME,WAAW,GAAG,CAACb,OAAO;AAE5B,IAAA,IAAIY,QAAQ,EAAEP,eAAe,CAAC,IAAI,CAAC,CAAC,KAC/B,IAAIQ,WAAW,EAAER,eAAe,CAAC,KAAK,CAAC;IAE5CF,cAAc,CAACQ,OAAO,GAAGX,OAAO;AAClC,EAAA;EAEA,OAAO;AACLc,IAAAA,mBAAmB,EAAEA,MAAMT,eAAe,CAAC,KAAK,CAAC;IACjDU,cAAc,EAAEd,cAAc,CAACU,OAAO;IACtCJ,eAAe;AACfC,IAAAA;GACD;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.js","sources":["../../../src/components/inputs/ActionButton/ActionButton.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ActionButton.styled';\n\nconst NOOP = () => {};\nconst DEFAULT_ACTION_SIZE = [40, 40];\n\ntype ActionButtonOwnProps = {\n /**\n * Icon element – e.g: `icon={<SvgAddCircle />}`\n */\n icon: React.ReactElement<any>;\n /**\n * Disable the action button\n */\n disabled?: boolean;\n /**\n * Locks the hover state of the `ActionButton` – this prop only affects the visual appearance of the\n * `ActionButton`\n */\n active?: boolean;\n /**\n * On-click effect for the action button\n */\n onClick?: (...args: any[]) => any;\n /**\n * Color of the button background as an array of [darkThemeColor, lightThemeColor]\n */\n backgroundColors?: string[];\n /**\n * Width and Height of the Action Button [50, 50]\n */\n actionWidthHeight?: any[];\n /**\n *Use shadow for the action button\n */\n useShadow?: boolean;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.ActionButton`, so the published type\n * has to admit that target's props too — a closed type here is worse than `any` for the\n * 125 consumer files. Declared members win over the base (`Omit` by `keyof ActionButtonOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\ntype ActionButtonProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.ActionButton>,\n keyof ActionButtonOwnProps\n> &\n ActionButtonOwnProps;\n\n/**\n * An action button.\n *\n * ### Import\n *\n * ``` js\n * import { ActionButton } from '@ntbjs/react-components/inputs'\n * // or\n * import ActionButton from '@ntbjs/react-components/inputs/ActionButton'\n * ```\n *\n * ### Props\n * ```\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `disabled={true}` to disable the button.\n * Pass `active={true}` to lock the hover state of the button.\n * Pass `onClick={() => {}}` to add an on-click effect.\n * Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the button\n * ```\n */\nconst ActionButton = React.forwardRef<any, ActionButtonProps>(function ActionButton(\n {\n icon,\n disabled,\n active,\n onClick = NOOP,\n actionWidthHeight = DEFAULT_ACTION_SIZE,\n useShadow = false,\n backgroundColors,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.ActionButton\n ref={forwardedRef}\n disabled={disabled}\n $active={active}\n onClick={onClick}\n $actionWidthHeight={actionWidthHeight}\n $backgroundColors={backgroundColors}\n $useShadow={useShadow}\n {...props}\n >\n {icon}\n </S.ActionButton>\n );\n});\n\nexport default ActionButton;\n"],"names":["NOOP","DEFAULT_ACTION_SIZE","ActionButton","React","forwardRef","icon","disabled","active","onClick","actionWidthHeight","useShadow","backgroundColors","props","forwardedRef","_jsx","S","ref","$active","$actionWidthHeight","$backgroundColors","$useShadow","children"],"mappings":";;;;AAGA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AACrB,MAAMC,mBAAmB,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;AAmEpC,MAAMC,YAAY,GAAGC,cAAK,CAACC,UAAU,CAAyB,SAASF,YAAYA,CACjF;EACEG,IAAI;EACJC,QAAQ;EACRC,MAAM;AACNC,EAAAA,OAAO,GAAGR,IAAI;AACdS,EAAAA,iBAAiB,GAAGR,mBAAmB;AACvCS,EAAAA,SAAS,GAAG,KAAK;EACjBC,gBAAgB;EAChB,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,cAAc,EAAA;AACbC,IAAAA,GAAG,EAAEH,YAAa;AAClBP,IAAAA,QAAQ,EAAEA,QAAS;AACnBW,IAAAA,OAAO,EAAEV,MAAO;AAChBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBU,IAAAA,kBAAkB,EAAET,iBAAkB;AACtCU,IAAAA,iBAAiB,EAAER,gBAAiB;AACpCS,IAAAA,UAAU,EAAEV,SAAU;AAAA,IAAA,GAClBE,KAAK;AAAAS,IAAAA,QAAA,EAERhB;AAAI,GACS,CAAC;AAErB,CAAC;;;;"}
1
+ {"version":3,"file":"ActionButton.js","sources":["../../../src/components/inputs/ActionButton/ActionButton.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ActionButton.styled';\n\nconst NOOP = () => {};\nconst DEFAULT_ACTION_SIZE = [40, 40];\n\ntype ActionButtonOwnProps = {\n /**\n * Icon element – e.g: `icon={<SvgAddCircle />}`\n */\n icon: React.ReactElement<any>;\n /**\n * Disable the action button\n */\n disabled?: boolean;\n /**\n * Locks the hover state of the `ActionButton` – this prop only affects the visual appearance of the\n * `ActionButton`\n */\n active?: boolean;\n /**\n * On-click effect for the action button\n */\n onClick?: (...args: any[]) => any;\n /**\n * Color of the button background as an array of [darkThemeColor, lightThemeColor]\n */\n backgroundColors?: string[];\n /**\n * Width and Height of the Action Button [50, 50]\n */\n actionWidthHeight?: any[];\n /**\n *Use shadow for the action button\n */\n useShadow?: boolean;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype ActionButtonProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.ActionButton>,\n keyof ActionButtonOwnProps\n> &\n ActionButtonOwnProps;\n\n/**\n * An action button.\n *\n * ### Import\n *\n * ``` js\n * import { ActionButton } from '@ntbjs/react-components/inputs'\n * // or\n * import ActionButton from '@ntbjs/react-components/inputs/ActionButton'\n * ```\n *\n * ### Props\n * ```\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `disabled={true}` to disable the button.\n * Pass `active={true}` to lock the hover state of the button.\n * Pass `onClick={() => {}}` to add an on-click effect.\n * Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the button\n * ```\n */\nconst ActionButton = React.forwardRef<any, ActionButtonProps>(function ActionButton(\n {\n icon,\n disabled,\n active,\n onClick = NOOP,\n actionWidthHeight = DEFAULT_ACTION_SIZE,\n useShadow = false,\n backgroundColors,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.ActionButton\n ref={forwardedRef}\n disabled={disabled}\n $active={active}\n onClick={onClick}\n $actionWidthHeight={actionWidthHeight}\n $backgroundColors={backgroundColors}\n $useShadow={useShadow}\n {...props}\n >\n {icon}\n </S.ActionButton>\n );\n});\n\nexport default ActionButton;\n"],"names":["NOOP","DEFAULT_ACTION_SIZE","ActionButton","React","forwardRef","icon","disabled","active","onClick","actionWidthHeight","useShadow","backgroundColors","props","forwardedRef","_jsx","S","ref","$active","$actionWidthHeight","$backgroundColors","$useShadow","children"],"mappings":";;;;AAGA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AACrB,MAAMC,mBAAmB,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;AA6DpC,MAAMC,YAAY,GAAGC,cAAK,CAACC,UAAU,CAAyB,SAASF,YAAYA,CACjF;EACEG,IAAI;EACJC,QAAQ;EACRC,MAAM;AACNC,EAAAA,OAAO,GAAGR,IAAI;AACdS,EAAAA,iBAAiB,GAAGR,mBAAmB;AACvCS,EAAAA,SAAS,GAAG,KAAK;EACjBC,gBAAgB;EAChB,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,cAAc,EAAA;AACbC,IAAAA,GAAG,EAAEH,YAAa;AAClBP,IAAAA,QAAQ,EAAEA,QAAS;AACnBW,IAAAA,OAAO,EAAEV,MAAO;AAChBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBU,IAAAA,kBAAkB,EAAET,iBAAkB;AACtCU,IAAAA,iBAAiB,EAAER,gBAAiB;AACpCS,IAAAA,UAAU,EAAEV,SAAU;AAAA,IAAA,GAClBE,KAAK;AAAAS,IAAAA,QAAA,EAERhB;AAAI,GACS,CAAC;AAErB,CAAC;;;;"}