@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,31 +1,12 @@
1
1
  /**
2
2
  * Hand-written types for colors-export.js.
3
3
  *
4
- * ============================ WHY BY HAND ================================
5
- * NEVER DERIVE THIS FROM THE .js WITH `keyof typeof`.
6
- *
7
- * It works locally, because the library compiles with `allowJs`. It collapses
8
- * silently in the consumer, which does not: with no `allowJs`, TypeScript cannot
9
- * read colors-export.js at all, `keyof typeof colors` degrades to
10
- * `string | number | symbol` WITH NO DIAGNOSTIC, and `colors[name]` inside a
11
- * template string then emits TS2731 — an error in OUR file, appearing only in
12
- * THEIR build. A hand-written .d.ts resolves under every `moduleResolution` mode
13
- * with or without `allowJs`.
14
- *
15
- * The cost is that this is a THIRD hand-maintained copy of the palette, beside
16
- * src/styles/.config.scss and colors-export.js. That is what
17
- * `npm run verify:palette` (scripts/ts-migration/verify-palette.cjs) is for: it
18
- * makes drift a build failure rather than a silent `undefined` at runtime. Add a
19
- * colour to the .js and this union without the other and the gate names it.
20
- * =========================================================================
21
- *
22
- * src/styles stays .js permanently (playbook §A.1) and rollup copies the whole
23
- * directory verbatim into the published `styles/` and `build/styles/` trees, so
24
- * this file ships NEXT TO its .js and
25
- * `@ntbjs/react-components/styles/utils/colors-export` gains types where it
26
- * previously resolved none. A `.d.ts` is explicitly allowed by
27
- * scripts/assert-no-published-typescript.cjs for exactly this reason; a `.ts`
28
- * there would be raw TypeScript in a published package.
4
+ * Do not derive this from the .js with `keyof typeof`: it works here because the library
5
+ * compiles with `allowJs`, but a consumer without it degrades the key to
6
+ * `string | number | symbol` silently and then emits TS2731 in their build, not ours.
7
+ * The cost is a third hand-maintained copy of the palette beside .config.scss and
8
+ * colors-export.js, so drift is caught by a build gate rather than at runtime.
9
+ * It must stay a `.d.ts` — a `.ts` would ship raw TypeScript in the published package.
29
10
  */
30
11
 
31
12
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Props of the `Alert` root, i.e. what `Alert.tsx` passes to `S.Alert`. Value types come
3
- * from that file's propTypes; all optional per §J.5.
3
+ * from that file's propTypes; all optional.
4
4
  */
5
5
  export interface AlertStyleProps {
6
6
  /** `isWarning` — derived in the component from `type === 'warning'`, so `boolean`. */
@@ -17,43 +17,19 @@ export interface AlertStyleProps {
17
17
  /** `horizontalPadding` — `PropTypes.number`, px, interpolated the same way. */
18
18
  $horizontalPadding?: number;
19
19
  /**
20
- * `alertMessage` — `PropTypes.string`.
21
- *
22
- * DECLARED BECAUSE THE COMPONENT PASSES IT, NOT BECAUSE ANYTHING READS IT. No
23
- * interpolation below mentions `$alertMessage`; the message is rendered as the
24
- * `<span>` child of `AlertRender` instead. `shouldForwardProp` filters it, so it
25
- * reaches neither the CSS nor the DOM — a dead prop, harmless, and dropping it from
26
- * `Alert.tsx` is a separate cleanup.
20
+ * `alertMessage` — `PropTypes.string`. Component passes it; nothing reads it. Harmless; `$` filters it.
27
21
  */
28
22
  $alertMessage?: string;
29
23
  /**
30
- * `align` — `PropTypes.oneOf(['left', 'center'])`.
31
- *
32
- * DEFECT, DECLARED NOT FIXED: this is the prop the component passes, and NOTHING READS
33
- * IT. The `text-align` rule at the bottom of this template reads the non-`$` `align`
34
- * (declared below) instead, and that is never passed — so `align="center"` has never
35
- * had any effect and every Alert renders `text-align: left`.
36
- *
37
- * The fix is to repoint that read from `props.align` to `props.$align`, which ACTIVATES
38
- * A BRANCH THAT HAS NEVER FIRED and so changes rendered CSS. §J.8 lists that as C10
39
- * work with a baseline re-record; it must not ride along in a type-only commit.
24
+ * `align` — `PropTypes.oneOf(['left', 'center'])`. Defect: component passes `$align`; template reads plain `align` instead. No-op; every Alert is left-aligned.
40
25
  */
41
26
  $align?: 'left' | 'center';
42
27
  /**
43
- * `width` — `PropTypes.number`, px.
44
- *
45
- * DEFECT, DECLARED NOT FIXED: no `$`. `Alert.tsx` passes `width={width}` and
46
- * `shouldForwardProp` forwards every non-`$` prop, so whenever a caller sets `width` it
47
- * also lands on the rendered `<div>`, which is not a valid attribute on a `<div>`.
48
- * CONFIRMED, not inferred: `scripts/r19-harness/baseline.json` records
49
- * `<div width="480" …>` for `data/Alert`. The fix is to rename it `$width` at both ends,
50
- * which REMOVES a DOM attribute and so needs C10's re-record. §E.4's third case.
28
+ * `width` — `PropTypes.number`, px. Defect: no `$` means it leaks to DOM as invalid `width="480"` attribute.
51
29
  */
52
30
  width?: number;
53
31
  /**
54
- * `align` again, in its non-`$` form — the key this template actually reads. Same
55
- * defect as `$align` above, stated from the reading end: nothing passes this, so the
56
- * `=== 'center'` comparison is always `false`.
32
+ * `align` in its non-`$` form — read but never passed; comparison always false.
57
33
  */
58
34
  align?: 'left' | 'center';
59
35
  }
@@ -67,14 +43,7 @@ interface AlertRenderStyleProps {
67
43
  */
68
44
  $lineClamp?: number;
69
45
  /**
70
- * `fontSize` — `PropTypes.number`, px.
71
- *
72
- * DEFECT, DECLARED NOT FIXED: no `$`. `Alert.tsx` passes `fontSize={fontSize}`, so
73
- * whenever a caller sets it, it also leaks onto the rendered `<div>` — AS
74
- * `font-size="12"`, NOT `fontSize="12"`: React maps this particular camelCase name to
75
- * its hyphenated attribute form. CONFIRMED, not inferred:
76
- * `scripts/r19-harness/baseline.json` records `<div font-size="12" …>` for every
77
- * `data/Alert` entry. The fix is `$fontSize` at both ends — a DOM change, so C10. §E.4.
46
+ * `fontSize` — `PropTypes.number`, px. Defect: no `$` means it leaks to DOM as `font-size="12"` attribute.
78
47
  */
79
48
  fontSize?: number;
80
49
  }
@@ -7,15 +7,7 @@ type BadgeOwnProps = {
7
7
  badgeIcon?: React.ReactNode;
8
8
  /**
9
9
  * Content to be showed in the badge – e.g. number of results.
10
- *
11
- * NMB-3998: this is `React.ReactNode` and NOT the four-way union the propTypes
12
- * codemod produced from `oneOfType([string, number, func, element])`. The `func`
13
- * member was never a legal value: line 182 renders `{badgeContent}` as a child, and
14
- * React THROWS "Functions are not valid as a React child" for a function. So the
15
- * propTypes documented a value that cannot work, and transcribing them faithfully
16
- * published that mistake as a type — which is what TS2769 on line 182 was reporting.
17
- * The union was also missing `null`, used by `Badge badgeContent={null}` in
18
- * Tabs.stories; that only compiled because `strictNullChecks` is off.
10
+ * ReactNode, not the union — func is never valid, null was missing.
19
11
  */
20
12
  badgeContent?: React.ReactNode;
21
13
  /**
@@ -1,128 +1,29 @@
1
- /** Props of the `Badge` root, i.e. what `Badge.tsx` passes to `S.Badge`. */
2
1
  export interface BadgeStyleProps {
3
- /** `elevated` — `PropTypes.bool`; positions the label on top of the children. */
4
2
  $elevated?: boolean;
5
- /** `Boolean(children)`, derived in the component, so genuinely `boolean`. */
6
3
  $hasChildren?: boolean;
7
4
  }
8
- /**
9
- * Props of `BadgeLabel`. Value types from `Badge.tsx`'s propTypes; all optional per §J.5.
10
- *
11
- * Read the file header before adding to this list: eight of these members exist because
12
- * the template and the component disagree about the key, not because they are wanted.
13
- */
14
5
  interface BadgeLabelStyleProps {
15
- /** `elevated` — drives border-radius, margin, position and transform below. */
16
6
  $elevated?: boolean;
17
- /** `active` — `PropTypes.bool`. */
18
7
  $active?: boolean;
19
- /** `error` — `PropTypes.bool`. Takes priority over `$warning`. */
20
8
  $error?: boolean;
21
- /** `warning` — `PropTypes.bool`. */
22
9
  $warning?: boolean;
23
- /**
24
- * `lineHeight` — `PropTypes.oneOfType([number, string])`.
25
- *
26
- * DEFECT, DECLARED NOT FIXED: `Badge.tsx` DEFAULTS `lineHeight` TO THE STRING
27
- * `'normal'`, and the template emits `${props.$lineHeight}px` whenever the value is
28
- * truthy — so every Badge that does not override it renders the invalid declaration
29
- * `line-height: normalpx`, which browsers drop. The effect happens to match the
30
- * intended `normal`, which is why it has gone unnoticed. Fixing it (default `undefined`,
31
- * or a unit-aware interpolation) changes the emitted CSS text, so it is C10 work.
32
- */
33
10
  $lineHeight?: number | string;
34
- /** `horizontalPadding` — `PropTypes.number`, px. The one padding key that matches. */
35
11
  $horizontalPadding?: number;
36
- /** `minHeight` — `PropTypes.number`, px. */
37
12
  $minHeight?: number;
38
- /** `minWidth` — `PropTypes.number`, px. */
39
13
  $minWidth?: number;
40
- /** `backgroundColors` — `[darkThemeColor, lightThemeColor]`, read by index. */
41
14
  $backgroundColors?: string[];
42
- /** `colors` — font colour as `[darkThemeColor, lightThemeColor]`, read by index. */
43
15
  $colors?: string[];
44
- /** `borderColors` — `[dark, light]`; when set, a 1px solid border is applied. */
45
16
  $borderColors?: string[];
46
- /**
47
- * `verticalPadding` — `PropTypes.number`, px.
48
- *
49
- * DEFECT, DECLARED NOT FIXED, AND IT IS THE §E.3 RUN-TOGETHER-NAME FAMILY.
50
- * `Badge.tsx:85` passes `$elevatedverticalPadding={verticalPadding}` — `$elevated` and
51
- * `verticalPadding` run together — while the template below reads the plain
52
- * `verticalPadding`. Neither name is the other's, so BOTH sides are dead: nothing ever
53
- * supplies the key this reads, and nothing ever reads the key the component supplies.
54
- * `verticalPadding` has therefore never had any effect; every Badge falls through to
55
- * the `$elevated ? '4px' : '6px'` default.
56
- *
57
- * The fix is to make both ends `$verticalPadding`, which ACTIVATES A BRANCH THAT HAS
58
- * NEVER FIRED and so changes rendered padding. C10, with a re-record.
59
- */
60
17
  verticalPadding?: number;
61
- /**
62
- * `$elevatedverticalPadding` — the key `Badge.tsx:85` actually passes. DECLARED BECAUSE
63
- * THE COMPONENT PASSES IT, NOT BECAUSE ANYTHING READS IT; see `verticalPadding` above.
64
- * Harmless in the DOM (the `$` prefix means `shouldForwardProp` still filters it), so
65
- * unlike the four leaks below this one is invisible rather than wrong.
66
- */
67
18
  $elevatedverticalPadding?: number;
68
- /**
69
- * `elevated` in its non-`$` form — read at the `font-size` block below, and NEVER
70
- * PASSED (the component passes `$elevated`).
71
- *
72
- * DEFECT, DECLARED NOT FIXED: the ternary always takes the false arm, so an elevated
73
- * Badge renders `font-size: 0.750rem` instead of the intended `0.625rem`. Fix: read
74
- * `props.$elevated`, which is already declared above — a CSS change, so C10.
75
- */
76
19
  elevated?: boolean;
77
- /**
78
- * `error` in its non-`$` form — read inside the dark-mode `color` callback, and NEVER
79
- * PASSED.
80
- *
81
- * DEFECT, DECLARED NOT FIXED: it makes the second disjunct of
82
- * `(props.$warning && !props.$error) || (props.error && !props.$active)` permanently
83
- * `false`, so an inactive error Badge never gets the `gray-900` text colour in dark
84
- * mode. Fix: `props.$error` — a colour change, so C10.
85
- */
86
20
  error?: boolean;
87
- /**
88
- * `fontSize` — `PropTypes.oneOfType([number, string])`.
89
- *
90
- * DEFECT, DECLARED NOT FIXED: no `$`. `Badge.tsx:79` passes it and
91
- * `shouldForwardProp` forwards every non-`$` prop, so a caller-supplied `fontSize` also
92
- * lands on the rendered `<span>` — AS `font-size="15"`, NOT `fontSize="15"`: React maps
93
- * this particular camelCase name to its hyphenated attribute form. CONFIRMED, not
94
- * inferred: `scripts/r19-harness/baseline.json` records `<span font-size="12" …>` for
95
- * every `data/Badge` entry. Note the `string` half of the propTypes union is also a
96
- * trap: the template emits `${props.fontSize}px`, so `fontSize="15px"` would render
97
- * `15pxpx`. Fix: `$fontSize` at both ends — removes a DOM attribute, so C10. §E.4's
98
- * third case.
99
- */
100
21
  fontSize?: number | string;
101
- /**
102
- * `fontWeight` — `PropTypes.oneOfType([number, string])`, interpolated raw so both
103
- * halves are safe. Same non-`$` DOM leak as `fontSize`, hyphenated the same way, and
104
- * this is the UNCONDITIONAL one: `Badge.tsx:80` passes it and `Badge.tsx:49` defaults it
105
- * to `'normal'`, so `font-weight="normal"` is on EVERY rendered label whether the caller
106
- * sets anything or not. Verified by rendering `<Badge badgeContent={5} />` with no other
107
- * prop. Fix: `$fontWeight` at both ends — C10.
108
- */
109
22
  fontWeight?: number | string;
110
- /**
111
- * `height` — `PropTypes.number`, px. Same non-`$` DOM leak; `Badge.tsx:87` passes it.
112
- * `height` is not a valid attribute on a `<span>`. CONFIRMED: the baseline records
113
- * `<span … height="24" …>` for every `data/Badge` entry. Fix: `$height` — C10.
114
- */
115
23
  height?: number;
116
- /**
117
- * `width` — `PropTypes.number`, px. Same non-`$` DOM leak; `Badge.tsx:89` passes it. No
118
- * baseline fixture sets it, so it is absent there, but rendering the built `Badge` with
119
- * `width={50}` puts `width="50"` on the `<span>`. Fix: `$width` — C10.
120
- */
121
24
  width?: number;
122
25
  }
123
- /** Props of `BadgeIcon`. */
124
26
  interface BadgeIconStyleProps {
125
- /** `!!badgeContent`, derived in the component — adds the gutter between icon and text. */
126
27
  $useGutter?: boolean;
127
28
  }
128
29
  export declare const Badge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, BadgeStyleProps>, never>> & string;
@@ -1,36 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Middleware } from '@floating-ui/react';
3
3
  import type { PopoverPlacement } from '../../../hooks/useFloatingPopover';
4
- /**
5
- * tippy's `appendTo`, and the three-way rule it implies. `'parent'` and an implicit-parent
6
- * case are real tippy behaviours, not inventions — measured in
7
- * `tippy.js/dist/tippy.cjs.js`:
8
- *
9
- * ```js
10
- * if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
11
- * parentNode = node.parentNode; // INLINE, next to the reference
12
- * } else {
13
- * parentNode = invokeWithArgsOrReturn(appendTo, [node]); // portal
14
- * }
15
- * ```
16
- *
17
- * ⚠️ **`Popover` DEFAULTS `interactive` TO `true`, SO ITS DEFAULT IS THE INLINE BRANCH.**
18
- * `appendTo` appears in 6 files per consumer out of 30 `<Popover>` call sites across both,
19
- * so a blanket `FloatingPortal` would relocate the MAJORITY of call sites out of their
20
- * current DOM position — a stacking/`z-index` regression across both apps, not a
21
- * preservation. Plan §A3 originally resolved C4 as "portal by default" on half the evidence
22
- * and was corrected in `0ef5f71`; `Tooltip.tsx:77-97` is where the branch was first found.
23
- *
24
- * | `appendTo` | `interactive` | where it renders |
25
- * | --- | --- | --- |
26
- * | given | any | `FloatingPortal` rooted at `appendTo` |
27
- * | absent | `false` | `FloatingPortal` rooted at `document.body` |
28
- * | absent | `true` *(the default)* | **INLINE**, into the reference's parent |
29
- *
30
- * All 12 `appendTo` sites across both consumers pass `document.body`; the `'parent'` and
31
- * function forms are supported because tippy supported them and the render-gate fixture
32
- * uses `'parent'` to make an open popover capturable.
33
- */
34
4
  export type PopoverAppendTo = 'parent' | Element | ((reference: Element) => Element);
35
5
  type PopoverOwnProps = {
36
6
  /**
@@ -38,21 +8,11 @@ type PopoverOwnProps = {
38
8
  */
39
9
  content: string | React.ReactElement<any>;
40
10
  /**
41
- * Determines if the `Popover` has interactive content inside of it, so that it can be
42
- * hovered over and clicked inside without hiding.
43
- *
44
- * **It also decides where the popover renders** — see `PopoverAppendTo`. It defaults to
45
- * `true`, so a `Popover` renders INLINE unless `appendTo` or `interactive={false}` says
46
- * otherwise.
11
+ * Whether the popover's content is interactive and where it renders (inline by default for interactive popovers).
47
12
  */
48
13
  interactive?: boolean;
49
14
  /**
50
- * The preferred placement of the `Popover`. Note that the flip middleware can change this
51
- * to the opposite placement if it has more space.
52
- *
53
- * The 12 concrete names are spelled identically in Popper and Floating UI, so they need no
54
- * translation. The three `auto*` values have no Floating UI string — they select
55
- * `autoPlacement()` instead of `flip()`; see `useFloatingPopover`.
15
+ * Preferred placement; 12 concrete names need no Popper→Floating UI translation. Three `auto*` values select `autoPlacement()` instead of `flip()`.
56
16
  */
57
17
  placement?: PopoverPlacement;
58
18
  /**
@@ -60,66 +20,27 @@ type PopoverOwnProps = {
60
20
  */
61
21
  duration?: number;
62
22
  /**
63
- * Determines the events that cause the `Popover` to show. Multiple event names are separated by
64
- * spaces.
65
- *
66
- * *Example events:*
67
- *
68
- * `trigger: 'click'`
69
- *
70
- * `trigger: 'focusin'`
71
- *
72
- * `trigger: 'mouseenter click'`
73
- *
74
- * `''` means no triggers at all, and `undefined` means tippy's default
75
- * (`'mouseenter focus'`) — though this component overrides that with its own default of
76
- * `'click focus'`. See `parseTrigger`.
77
- *
78
- * --
23
+ * Events that cause the popover to show (space-separated). `''` means no triggers, `undefined` means `'mouseenter focus'`, component defaults to `'click focus'`.
79
24
  */
80
25
  trigger?: string;
81
26
  /**
82
- * Displaces the popover from its reference element in pixels (skidding and distance).
83
- *
84
- * `[skidding, distance]`
85
- *
86
- * `distance` is the gap between the reference and the ARROW TIP, not the box — which is
87
- * what it has always meant here, because the old implementation handed tippy
88
- * `offset[1] + (arrow ? 15 : 0)`. `useFloatingPopover` adds the arrow height back, so the
89
- * prop keeps its meaning; see `DEFAULT_ARROW_HEIGHT` for the derivation of the 15.
27
+ * `[skidding, distance]`; distance is the gap between reference and arrow tip (not box), absorbing the old `+15` offset.
90
28
  */
91
29
  offset?: number[];
92
30
  /**
93
- * Determines if the popover has an arrow.
94
- *
95
- * ⚠️ It also moves the box even when the arrow is NOT drawn — see the block comment at
96
- * `arrowDrivesTheOffset` in the body. That is the existing behaviour, reproduced.
31
+ * Whether the popover has an arrow; also moves the box even when not drawn (existing behaviour, reproduced).
97
32
  */
98
33
  arrow?: boolean;
99
34
  /**
100
- * Use React's state to fully control the `Popover` instead of relying on the native trigger
101
- * and `hideOnClick` props
102
- *
103
- * Passing a boolean — **including `false`** — switches the popover to CONTROLLED mode and
104
- * its own triggers stop firing. `undefined` leaves it uncontrolled. `onClickOutside` still
105
- * fires in controlled mode, which is how 12 consumer call sites close a controlled
106
- * popover.
35
+ * Pass a boolean to control visibility; both `true` and `false` disable native triggers. `onClickOutside` still fires in controlled mode.
107
36
  */
108
37
  visible?: boolean;
109
38
  /**
110
- * @deprecated Accepted and IGNORED. This was a Popper `modifiers` array, appended to
111
- * `popperOptions.modifiers`; Floating UI has middleware instead and the two are not
112
- * translatable prop-for-prop. Kept so that no existing call site throws — plan C6. No
113
- * consumer passes it. Pass `middleware` instead.
39
+ * @deprecated Accepted and ignored; use `middleware` instead.
114
40
  */
115
41
  modifiers?: any[];
116
42
  /**
117
- * Extra Floating UI middleware, appended after the built-in chain
118
- * (`offset` → `flip`/`autoPlacement` → `shift` → `arrow` → `size`). This is the honest
119
- * replacement for `modifiers`, and it exists because one internal caller genuinely needed
120
- * it: `MultiLevelCheckboxSelect` matched the popover's width to its input with a
121
- * hand-written Popper `sameWidth` modifier, which C6's accept-and-ignore would have
122
- * silently dropped.
43
+ * Extra Floating UI middleware, appended after the built-in chain; one internal caller needed this for width matching.
123
44
  */
124
45
  middleware?: Middleware[];
125
46
  /**
@@ -141,8 +62,7 @@ type PopoverOwnProps = {
141
62
  */
142
63
  contextMenuSublevel?: boolean;
143
64
  /**
144
- * `z-index` of the positioned element. Defaults to 9999, tippy's default. 10 consumer call
145
- * sites pass this.
65
+ * `z-index` of the positioned element (default: 9999, tippy's default).
146
66
  */
147
67
  zIndex?: number;
148
68
  /**
@@ -151,8 +71,7 @@ type PopoverOwnProps = {
151
71
  */
152
72
  disabled?: boolean;
153
73
  /**
154
- * Where the popover is rendered. Omitting it means INLINE for an `interactive` popover
155
- * (the default) and `document.body` otherwise. See `PopoverAppendTo`.
74
+ * Where the popover is rendered (default: inline for interactive popovers, document.body otherwise).
156
75
  */
157
76
  appendTo?: PopoverAppendTo;
158
77
  /** Fired when a press lands outside both the reference and the popover. */
@@ -162,15 +81,7 @@ type PopoverOwnProps = {
162
81
  */
163
82
  onShow?: () => void;
164
83
  /**
165
- * Fired when the popover closes. tippy's `onHide`, minus its instance argument.
166
- *
167
- * ONE INTERNAL CALLER DEPENDS ON IT: `inputs/Button` passes
168
- * `onHide={handleDropdownClose}` to reset its `dropdown-is-active` class, so this is not a
169
- * courtesy re-export. It fires on every close the component decides for itself —
170
- * outside press, a second click on the trigger, a context-menu item click. It does NOT
171
- * fire when a CONTROLLED popover is closed by its owner flipping `visible` to `false`,
172
- * because nothing asks this component to close in that case; tippy did fire there. No
173
- * call site pairs `onHide` with `visible`, so the difference is currently unobservable.
84
+ * Fired when the popover closes; one internal caller (inputs/Button) depends on it to reset dropdown-is-active class.
174
85
  */
175
86
  onHide?: () => void;
176
87
  /**
@@ -3,20 +3,7 @@ type TabOwnProps = {
3
3
  children?: any;
4
4
  hidden?: boolean;
5
5
  /**
6
- * The tab's clickable header, conventionally a `Badge`:
7
- * `<Tab trigger={<Badge>Tab title</Badge>}>`.
8
- *
9
- * NOT DECLARED BY THE OLD propTypes AND NOT READ BY THIS COMPONENT — which is why
10
- * neither the codemod nor the widening pass could produce it, and why it is
11
- * hand-written here. `Tab` is a data carrier: `Tabs.tsx` walks its children with
12
- * `child.type === Tab` and lifts `child.props?.trigger` out, then renders it inside
13
- * `S.TabHeader`. The `<Tab>` element itself is never mounted, so `trigger` never
14
- * reaches the DOM and there is no attribute leak to fix.
15
- *
16
- * `ReactElement`, not `ReactNode`: `Tabs.handleTabClick` reads
17
- * `tab.trigger.props.children` to build the `triggerText` it passes to `onTabClick`.
18
- * A string trigger would compile under `ReactNode` and silently produce an empty
19
- * `triggerText`. All 44 call sites in `src` pass a `<Badge>`.
6
+ * The tab's clickable header, conventionally a `Badge`. Not read by Tab itself; Tabs extracts it.
20
7
  */
21
8
  trigger?: React.ReactElement<any>;
22
9
  };
@@ -4,23 +4,7 @@ export interface TabsStyleProps {
4
4
  $backgroundColor?: string;
5
5
  }
6
6
  /**
7
- * Shared by `TabHeaders` and `TabHeaderBorder`, the two components `Tabs.tsx` hands
8
- * `custompadding` to. One interface rather than two because the key, the value and the
9
- * defect are the same at both sites; a change here is a change to both, which is the
10
- * point of naming them together.
11
- *
12
- * DEFECT, DECLARED NOT FIXED: `custompadding` HAS NO `$`, so `shouldForwardProp` forwards
13
- * it and it lands on the rendered `<ul>` and `<div>`. This is not inferred — it is in
14
- * `scripts/r19-harness/baseline.json` as `<ul custompadding="40px" …>`. The fix is to
15
- * rename it `$customPadding` at both ends, which REMOVES a DOM attribute and so belongs to
16
- * C10 with its baseline re-record. §E.4's third case.
17
- *
18
- * `number | string`, not the `PropTypes.string` the propTypes claim: `Tabs.tsx` DEFAULTS
19
- * `customPadding` to the NUMBER `0`, and that default is what reaches these templates in
20
- * the common case. It is falsy, so the `!props.custompadding` arm wins and the padding
21
- * shorthand is emitted as `padding: 0` / `margin: -2px 0` — correct by accident. A
22
- * caller-supplied number would emit a unitless `padding: 0 8`, which is why the union is
23
- * worth stating rather than tidying away.
7
+ * Shared by `TabHeaders` and `TabHeaderBorder`. Defect: `custompadding` has no `$`, leaks to DOM. Typed as `number | string` to match component default of 0.
24
8
  */
25
9
  interface TabPaddingStyleProps {
26
10
  /** `customPadding` — see the interface JSDoc; both the leak and the union are there. */
@@ -1,26 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { PopoverPlacement, PopperOffset } from '../../../hooks/useFloatingPopover';
3
- /**
4
- * tippy's `appendTo`. `'parent'` and an implicit-parent case are real tippy behaviours, not
5
- * inventions — measured in `tippy.js/dist/tippy.cjs.js`:
6
- *
7
- * ```js
8
- * if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
9
- * parentNode = node.parentNode;
10
- * } else {
11
- * parentNode = invokeWithArgsOrReturn(appendTo, [node]);
12
- * }
13
- * ```
14
- *
15
- * ⚠️ THIS IS A CORRECTION TO PLAN §A3, WHICH RESOLVED C4 ON HALF THE EVIDENCE. §A3 quotes
16
- * `TIPPY_DEFAULT_APPEND_TO = () => document.body` and concludes that portalling by default
17
- * is behaviour-preserving. The line above is the other half: when `interactive` is true AND
18
- * `appendTo` is left at its default, tippy does NOT use that default — it renders INLINE,
19
- * into the reference's parent. So "portal by default" is behaviour-preserving only for
20
- * non-interactive instances. It is safe for `Tooltip`, whose `interactive` defaults to
21
- * `false` and which no consumer passes it to (measured across both apps), and it is a rule
22
- * `Popover` will have to honour, since `Popover` does have interactive call sites.
23
- */
24
3
  export type TooltipAppendTo = 'parent' | Element | ((reference: Element) => Element);
25
4
  type TooltipOwnProps = {
26
5
  /**
@@ -46,32 +25,11 @@ type TooltipOwnProps = {
46
25
  */
47
26
  duration?: number;
48
27
  /**
49
- * Determines the events that cause the tooltip to show. Multiple event names are separated
50
- * by spaces.
51
- *
52
- * *Example events:*
53
- *
54
- * `trigger: 'click'`
55
- *
56
- * `trigger: 'focusin'`
57
- *
58
- * `trigger: 'mouseenter click'`
59
- *
60
- * `trigger: 'mouseenter'`
61
- *
62
- * Omitting it means `'mouseenter focus'`, and `''` means no triggers at all — both are
63
- * relied on by consumer code. See `parseTrigger`.
64
- *
65
- * --
28
+ * Events that cause the tooltip to show (space-separated). Defaults to `'mouseenter focus'`, `''` means no triggers.
66
29
  */
67
30
  trigger?: 'mouseenter' | 'mouseenter focus' | 'click' | 'focusin' | 'mouseenter click' | '';
68
31
  /**
69
- * Determines if the tooltip is visible without trigger.
70
- *
71
- * Passing a boolean — **including `false`** — switches the tooltip to CONTROLLED mode and
72
- * its own triggers stop firing. `undefined` leaves it uncontrolled. `useTooltipAutoShow`
73
- * depends on that distinction and its `toolTipVisible` is `true | undefined` for exactly
74
- * this reason.
32
+ * Pass a boolean to control visibility; both `true` and `false` disable native triggers. `undefined` leaves uncontrolled.
75
33
  */
76
34
  visible?: boolean;
77
35
  /**
@@ -80,15 +38,11 @@ type TooltipOwnProps = {
80
38
  */
81
39
  arrow?: boolean;
82
40
  /**
83
- * `z-index` of the positioned element. Defaults to 9999, tippy's default. 30 consumer call
84
- * sites pass this, which is why it is declared here even though it was never in the old
85
- * prop type — it used to typecheck only because the published `Props` widened to
86
- * `TippyProps`, and that widening disappears with tippy.
41
+ * `z-index` of the positioned element (default: 9999, tippy's default).
87
42
  */
88
43
  zIndex?: number;
89
44
  /**
90
- * A disabled tooltip can never open, even under a controlled `visible={true}` — tippy's
91
- * semantics, and what `useTooltipAutoShow`'s `toolTipDisabled` relies on.
45
+ * Disabled tooltip can never open, even under controlled `visible={true}` (tippy semantics).
92
46
  */
93
47
  disabled?: boolean;
94
48
  /**
@@ -1,26 +1,12 @@
1
1
  /**
2
- * Shared by all three components: `VerificationStatusIcon.tsx` passes `$background` to
3
- * every one of them. Only `VerificationIconWrapper` and `VerificationStatusIcon` read it;
4
- * on `VerificationStatusColor` it is passed and never read, which is harmless because the
5
- * `$` means `shouldForwardProp` filters it before both the CSS and the DOM.
2
+ * Shared by all three components. Only `VerificationIconWrapper` and `VerificationStatusIcon` read it; on `VerificationStatusColor` it's passed and never read (harmless due to `$`).
6
3
  */
7
4
  interface VerificationBackgroundStyleProps {
8
5
  /** `background` — `PropTypes.bool`; swaps in the black pill and the light icon colour. */
9
6
  $background?: boolean;
10
7
  }
11
8
  /**
12
- * Props of the `VerificationStatusIcon` element.
13
- *
14
- * DEFECT, DECLARED NOT FIXED: `iconHeight` in its non-`$` form is what the `svg` rule
15
- * below reads, and NOTHING PASSES IT — `VerificationStatusIcon.tsx` passes `$iconHeight`,
16
- * which this component never reads. So the `?? 15` fallback is unconditional and the icon
17
- * is 15px tall no matter what a caller asks for, WHILE `VerificationStatusColor` does read
18
- * `$iconHeight` and scales correctly. Pass `iconHeight={30}` today and the status dot grows
19
- * but the icon it sits on does not.
20
- *
21
- * The fix is to repoint the read to `props.$iconHeight`, which ACTIVATES A BRANCH THAT HAS
22
- * NEVER FIRED and changes the emitted height for every non-default `iconHeight`. §J.8 puts
23
- * that in C10 with its baseline re-record.
9
+ * Defect: reads `iconHeight` (never passed); component passes `$iconHeight` which is never read. Icon always 15px, dot scales correctly.
24
10
  */
25
11
  export interface VerificationStatusIconStyleProps extends VerificationBackgroundStyleProps {
26
12
  /** `iconHeight` — `PropTypes.number`, px. Read, never passed; see the JSDoc above. */
@@ -31,12 +17,7 @@ interface VerificationStatusColorStyleProps extends VerificationBackgroundStyleP
31
17
  /** `iconHeight` — `PropTypes.number`, px. This site reads the `$` form, correctly. */
32
18
  $iconHeight?: number;
33
19
  /**
34
- * `status` — `PropTypes.oneOf(['verified', 'pending', 'rejected', 'mixed'])`, and
35
- * `.isRequired` on the component but still OPTIONAL here per §J.5.
36
- *
37
- * Closed on purpose rather than widened to `string`: the block below compares this value
38
- * four times, and with a closed union a mistyped status name is TS2367 instead of a
39
- * branch that silently never fires. §J.6.
20
+ * `status` — closed union to catch mistyped names as TS2367 rather than silent branch misfire.
40
21
  */
41
22
  $status?: 'verified' | 'pending' | 'rejected' | 'mixed';
42
23
  }