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

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":"CompactAutocompleteSelect.styled.js","sources":["../../../src/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.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 * THIS FILE DOES NOT REACH ZERO, AND THAT IS THE CORRECT OUTCOME. 49 errors -> 5. The 5\n * that remain are defects the type checker is RIGHT about, and every available fix for\n * them changes rendered CSS, so they belong to the C9/C10 group with its baseline\n * re-record and must not ride along in a type-only commit (§E.3, §J.8). Each is marked\n * `DEFERRED DEFECT` at its site:\n *\n * - 4x TS2554 `themeProp()` called with 2 arguments in the `fadeIn`/`fadeOut`\n * keyframes, lines 109, 113, 120 and 124. These are literally §E.3 defects 1-8.\n * - 1x TS2367 `!props.type === 'instructions-warning'` in `Control`, line 485 — the\n * note for it is on `ControlStyleProps`, because backticks cannot appear inside a\n * styled template literal.\n *\n * NEITHER IS A TYPING GAP. `themeProp` has one signature and it takes 3-4 arguments; and\n * `!props.type` is `boolean` for EVERY possible declaration of `type` — even `any` —\n * so no annotation anywhere can remove the TS2367. Adding a suppression is explicitly\n * refused: §E.1 rule 3 and §E.3's \"Do not `@ts-ignore`\".\n *\n * Otherwise this is the react-select case at full size: 18 components, 14 of them\n * `styled(<react-select component>)` needing `SelectThemeProp`, one shared `css` helper\n * subject to the weak-type rule, one nested `css` block, and four non-`$` props of which\n * two leak to the DOM and two are dead — one of the dead pair, `fadeIn`, is now DELETED\n * rather than merely declared; see the note above `SuccessContainer`.\n */\nimport type React from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport Select, { components } from 'react-select';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport { ReactComponent as ExpandMoreIcon } from '../../../icons/expand-more.svg';\n\nimport type { PartialNtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * `CompactAutocompleteSelect.tsx`'s `type` prop, verbatim from its\n * `PropTypes.oneOf(['', 'error', 'warning', 'instructions-warning', 'loading', 'success'])`,\n * carried WITHOUT a `$` to `Control`, `ValueContainer` and `Placeholder` — see\n * `ControlStyleProps` for why that is not a DOM leak here.\n *\n * Closed on purpose (§J.6): the templates below compare against this value 14 times, so a\n * mistyped state name is TS2367 rather than a branch that silently never fires. `''` is a\n * member because the component defaults `type = ''` (tsx line 172).\n */\ntype CompactAutocompleteSelectType =\n | ''\n | 'error'\n | 'warning'\n | 'instructions-warning'\n | 'loading'\n | 'success';\n\n/**\n * The `theme` prop of every `styled(<react-select component>)` in this file — 14 of them.\n *\n * `theme` is the one prop name that both styled-components and react-select claim.\n * react-select types it `ThemeConfig = Theme | ((t: Theme) => Theme)` and its `Theme`\n * REQUIRES `borderRadius`, which `NtbTheme` does not have, so `.attrs(applyDefaultTheme)`\n * — return type `{ theme: NtbTheme }` — was unassignable at all 14 sites, each reporting\n * the same last line:\n *\n * TS2345 … Types of property 'theme' are incompatible.\n * Property 'borderRadius' is missing in type 'NtbTheme' but required in type 'Theme'.\n *\n * Declaring `theme` in the `.attrs<P>()` generic fixes it because the generic is applied\n * as `Substitute<OuterProps, P> = FastOmit<OuterProps, keyof P> & P`, i.e. it REPLACES\n * react-select's declaration rather than intersecting with it. That is the truth about\n * this boundary: react-select's `getTheme()` is `{ ...its defaultTheme, ...props.theme }`,\n * so our `colors`/`spacing` win — which is why `ThemeColors`/`ThemeSpacing` in\n * `utils/defaultTheme.ts` carry react-select's member names — and `borderRadius` falls\n * through to react-select's own `4`. `NtbTheme` is deliberately a PARTIAL override of\n * react-select's theme. Do NOT add `borderRadius` to `NtbTheme` to \"fix\" this: that hands\n * react-select a border radius it does not get today, which is a render change.\n *\n * `MultiSelect.styled.ts` carries the same interface for the same reason.\n */\ninterface SelectThemeProp {\n /** A partial override merged over `defaultTheme` by `applyDefaultTheme`. */\n theme?: PartialNtbTheme;\n}\n\n/*\n * ============================ DEFERRED DEFECT (§E.3 #1-8) ============================\n * THE FOUR `themeProp()` CALLS IN THE NEXT TWO KEYFRAMES TAKE 2 ARGUMENTS, NOT 3.\n *\n * The signature is `(property, darkMode, lightMode, specificity = 2)`, so in\n * `themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')` the CSS PROPERTY NAME is\n * an rgba string and `lightMode` is `undefined`. What these emit is garbage — a nested\n * `body.dark-theme && { rgba(48, 130, 106, 0): … }` ruleset inside a keyframe block — and\n * `keyframes` never receives props at all, so `props.theme` is not even reachable here at\n * runtime.\n *\n * 4 of this file's 5 remaining errors are these, as TS2554 \"Expected 3-4 arguments, but\n * got 2\". THEY ARE LEFT AS ERRORS DELIBERATELY. §E.3 lists them among the twelve defects\n * that must be FIXED and says \"Do not `@ts-ignore`\", and the fix — delete the\n * interpolations or write literal colours — changes the emitted CSS, so it belongs to C9\n * with C10's baseline re-record and not to a type-only commit. The identical four sites\n * exist at `CompactStarRating.styled.ts:7,11,18,22`.\n * =====================================================================================\n */\nconst fadeIn = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n`;\n\nconst fadeOut = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n`;\n\nconst fadeInCheck = keyframes`\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n`;\n\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\n/**\n * The WRITTEN type of the four `styled(<react-select component>)` exports below. Same\n * mechanism, same wording and the same audit as `SelectWrapper` in\n * `src/components/inputs/MultiSelect/MultiSelect.styled.ts` — read that one; it is the\n * canonical note. §G.4.\n *\n * Short version: the INFERRED type is correct and unprintable. Under `--declaration` its\n * printed form expands to react-select's `PublicBaseSelectProps` and\n * `StateManagerAdditionalProps`, which `react-select`'s `exports` map does not serve, so\n * tsc reported 8 x TS2883 here and — because `noEmitOnError` is false — silently declined\n * to write this file's `.d.ts` at all. That in turn erased the props of the PUBLISHED\n * `CompactAutocompleteSelect` declaration down to\n * `ForwardRefExoticComponent<RefAttributes<unknown>>`, a closed props type with zero\n * members: the exact §G.4 poison, arriving from react-select rather than from `allowJs`.\n *\n * tsc prints a generic alias APPLICATION by reference, so `SelectWrapper<typeof Select>`\n * is writeable where the expansion is not. `Omit<ComponentProps<C>, keyof P> & P` is\n * styled-components' own `Substitute<OuterProps, P>`, so no prop is widened or narrowed.\n */\ntype SelectWrapper<C extends React.ComponentType<any>> = React.ComponentType<\n Omit<React.ComponentProps<C>, keyof SelectWrapperStyleProps> & SelectWrapperStyleProps\n>;\n\n/*\n * Spelled out rather than written inline at the export site, and that is not cosmetic:\n * `SelectWrapper<typeof AsyncCreatableSelectPaginate>` pushes the declaration head past\n * `printWidth: 100`, prettier then breaks after the `=` and re-indents the whole styled\n * template by two spaces — which changes the CSS TEXT of a component in a commit that is\n * supposed to be type-only. Proven by transpiling before and after with rollup's own\n * Babel config: with the inline form this file's emitted bytes changed (10096 -> 10118);\n * with the alias they are identical.\n */\ntype AsyncCreatablePaginateWrapper = SelectWrapper<typeof AsyncCreatableSelectPaginate>;\n\n/**\n * A module-scope `css` helper is its own generic slot: unannotated its props are\n * `ExecutionContext & object` and `props.$hasLabel` is TS2339 no matter what the hosting\n * component declares. §J.7.\n *\n * Hosts, for whoever changes this block: the four select wrappers —\n * `AsyncCreatableAutocompleteSelect`, `AsyncAutocompleteSelect`, `AutocompletSelect`,\n * `AutocompletCreatableSelect`. `CompactAutocompleteSelect.tsx` passes\n * `$hasLabel={!isEmpty(label)}` to all four (tsx lines 392, 398, 405, 410).\n *\n * ALL FOUR HOSTS MUST DECLARE `$hasLabel` THEMSELVES, and that is not redundant: this\n * type is all-optional, i.e. a WEAK TYPE, and assignability to a weak type requires at\n * least one member in common. react-select's props have no `$hasLabel`, so without the\n * declaration on the host the interpolation is TS2345 \"has no properties in common with\".\n * §J.7 — the same mechanism as `CompactTextInput`'s `linkColor`/`StyledLink`, except here\n * every host genuinely does pass it.\n */\nconst sharedStyle = css<{ $hasLabel?: boolean }>`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n line-height: 1rem;\n width: 100%;\n display: block;\n box-shadow: 'none';\n flex-basis: ${props => (props.$hasLabel ? '66.66%' : '100%')};\n`;\n\n/**\n * The four select wrappers share this: `$hasLabel` for `sharedStyle`'s sake, `theme` for\n * react-select's sake, and `disabled` — which is a deferred defect, see below.\n */\nexport interface SelectWrapperStyleProps extends SelectThemeProp {\n /** `!isEmpty(label)` — narrows the control to 66.66% so the label gets the other third. */\n $hasLabel?: boolean;\n /*\n * ======================== DEFERRED DEFECT (dead branch, §E.4) =======================\n * `disabled` IS DECLARED BECAUSE THE TEMPLATES READ IT, NOT BECAUSE ANYTHING PASSES IT.\n *\n * `CompactAutocompleteSelect.tsx` builds `sharedSelectProps` with\n * `isDisabled: disabled || readOnly` (tsx line 306) and passes NO `disabled` to any of\n * the four wrappers — which is why tsc's message on the reads was TS2551 \"Did you mean\n * 'isDisabled'?\" rather than a plain TS2339. So `props.disabled` is always `undefined`\n * here and every `opacity: 0.5` / `cursor: not-allowed` block in the four wrappers is\n * DEAD: a disabled autocomplete has never dimmed, at 7 sites.\n *\n * The fix is to repoint the reads to `isDisabled`, which is a real react-select prop and\n * IS passed — so it ACTIVATES seven rules that have never fired. That is a visual change\n * and belongs to C9/C10 with the baseline re-record, not here. §J.8's second forbidden\n * category, verbatim.\n * ===================================================================================\n */\n disabled?: 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\n/*\n * ====================== DEFERRED DEFECT (DOM leak, §E.4 third case) ====================\n * `disabled` HAS NO `$` ON EITHER OF THE NEXT TWO COMPONENTS, AND THAT IS A DEFECT —\n * declared here, not fixed here.\n *\n * `CompactAutocompleteSelect.tsx` passes `<S.CompactAutocompleteSelect disabled={disabled}>`\n * (tsx line 378) and `<S.Label htmlFor={uniqueId} disabled={disabled}>` (tsx line 381).\n * `disabled` is not a member of `HTMLAttributes<HTMLDivElement>` or of\n * `LabelHTMLAttributes`, and `shouldForwardProp` forwards every non-`$` prop, so\n * `disabled=\"\"` is on the rendered `<div>` and `<label>` today and is in the recorded\n * render baseline. Prefixing it `$disabled` at both ends REMOVES two DOM attributes, so it\n * is C10 work with the re-record. `CompactTextInput.styled.ts`'s `Label` carries the\n * identical defect. §J.9.\n * ======================================================================================\n */\ninterface DisabledStyleProps {\n /** `disabled` — dims and blocks the pointer. Also reaches the DOM; see above. */\n disabled?: boolean;\n}\n\nexport const CompactAutocompleteSelect = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<DisabledStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n height: 24px;\n font-family: ${props => props.theme.primaryFontFamily};\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs<DisabledStyleProps>(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 19px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-top: 2px;\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const InputContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n width: 100%;\n height: 19px;\n`;\n\n/*\n * ============ `fadeIn` IS GONE — DEAD BRANCH REMOVED (§E.4 first case) ===============\n * This component read `props.fadeIn` twice:\n *\n * opacity: ${props => (props.fadeIn ? 0 : 1)};\n * animation: ${props => (props.fadeIn ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n *\n * NOTHING HAS EVER PASSED IT — `CompactAutocompleteSelect.tsx` renders\n * `<S.SuccessContainer>` (tsx:512) with no props at all, and `git log --all -S'fadeIn='`\n * finds no commit in the repo's history that writes the prop anywhere in `src`. So\n * `props.fadeIn` was always `undefined`, `opacity` was always the `1` two lines above\n * already sets, and `fadeOutCheck` was unreachable — which is also why it goes with the\n * branch: this file's last other reader of it was that read.\n *\n * It was a MISTYPED `success`, not an unimplemented feature: it entered the repo in\n * `4ed910a` in `CompactTextInput.styled.js` next to a `props.success` read, and\n * `NMB-3183` (`7e46b9d`, `59b0041`) already deleted the identical two lines and the\n * orphaned keyframes from that file. This one was missed.\n *\n * Wiring it up was rejected: this container is mounted unconditionally inside `S.Label`\n * and only swaps its children, so there is no \"success is going away\" transition to hang\n * a fade-out on. Removing the branch also removes the would-be DOM leak — the prop had no\n * `$`, so `shouldForwardProp` would have forwarded `fadeIn=\"\"` onto the `<div>` the day\n * anything passed it.\n *\n * The `animation` is kept, now static, because the branch it always took is the live one.\n * `TextArea.styled.ts`'s `SuccessContainer` carries the full derivation.\n * ====================================================================================\n */\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n animation: ${fadeInCheck} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\nexport const AsyncCreatableAutocompleteSelect: AsyncCreatablePaginateWrapper = styled(\n AsyncCreatableSelectPaginate\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AsyncAutocompleteSelect: SelectWrapper<typeof AsyncPaginate> = styled(\n AsyncPaginate\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletSelect: SelectWrapper<typeof Select> = styled(\n Select\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletCreatableSelect: SelectWrapper<typeof CreatableSelect> = styled(\n CreatableSelect\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n`;\n\n/**\n * Props of `Control`, the react-select control wrapper.\n *\n * `edit` and `type` HAVE NO `$` AND STILL DO NOT LEAK TO THE DOM, which makes this the one\n * benign member of §E.4's non-`$` list in this file and worth stating so nobody \"fixes\" it\n * blind. There is no `withConfig`/`shouldForwardProp` on a `styled(<component>)` — there is\n * no DOM element to filter for — and react-select's `Control` renders only its\n * `innerProps` onto the `<div>`, ignoring props it does not know. So\n * `<S.Control edit={edit} type={type} …>` (tsx line 193) reaches the template and stops\n * there. Prefixing them would be tidier but is not a bug fix, and it still touches two\n * files for no type benefit.\n *\n * `isFocused` is deliberately ABSENT: it is a real `ControlProps` member, so the template's\n * seven reads of it already typecheck. §J.9's first case.\n *\n * ================== DEFERRED DEFECT in this component's template =====================\n * `!props.type === 'instructions-warning'` (the `isFocused` border-color rule, ~40 lines\n * down; the note has to live here because backticks cannot appear inside the styled\n * template) NEGATES FIRST AND THEN COMPARES A BOOLEAN TO A STRING. It is always false, so\n * that whole `border-color` rule is dead — a FOCUSED control has never received the\n * gray-600 border.\n *\n * That is the 5th and last remaining error in this file, TS2367 \"This comparison appears\n * to be unintentional because the types 'boolean' and 'string' have no overlap\", and NO\n * ANNOTATION CAN REMOVE IT: `!props.type` is `boolean` whatever `type` is declared as,\n * `any` included. It is a defect in the expression, and §E.1 rule 3 says fix the code, not\n * the type. The fix is `props.type !== 'instructions-warning'`, which ACTIVATES a rule that\n * has never fired on the most visible state of the component — C9 for the fix, C10 for the\n * re-record, not this commit. §J.8.\n * ====================================================================================\n */\ninterface ControlStyleProps extends SelectThemeProp {\n /** `edit` (`PropTypes.bool`) — grey \"this is editable\" background. */\n edit?: boolean;\n /** `type` — see `CompactAutocompleteSelectType`. Branched on 11 times below. */\n type?: CompactAutocompleteSelectType;\n}\n\nexport const Control = styled(components.Control).attrs<ControlStyleProps>(applyDefaultTheme)`\n && {\n ${props =>\n props.edit &&\n props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};\n ${props =>\n props.edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n\n height: 22px;\n min-height: 22px;\n box-shadow: none;\n box-sizing: border-box;\n padding: 1px 3px 0 8.7px;\n cursor: pointer;\n border: 1px solid transparent;\n background-color: transparent;\n ${props =>\n props.type &&\n /*\n * A `css` block nested inside an interpolation opens its OWN `${props => …}`, which\n * SHADOWS the outer one, so `ControlStyleProps` from the `.attrs<P>()` above does not\n * reach in here and this block needs its own generic. §J.7, second shape. The\n * weak-type rule is satisfied because the host declares `type` too.\n */\n css<{ type?: CompactAutocompleteSelectType }>`\n animation: ${props => (props.type === 'success' ? fadeIn : fadeOut)} 0.5s ease-in-out;\n `}\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFFDE8')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#7f1b1b', '#FBEAE6')};\n\n ${props =>\n props.isFocused &&\n !props.type === 'instructions-warning' &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-600')\n )}\n ${props =>\n props.type === 'warning' &&\n props.isFocused &&\n props.theme.themeProp('border-color', '#F4E21E', '#F4E21E')}\n ${props =>\n props.type === 'error' &&\n props.isFocused &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('red-500'),\n props.theme.getColor('red-500')\n )}\n }\n\n & .dropdown-indicator {\n display: none;\n }\n\n &:hover .dropdown-indicator {\n display: flex;\n }\n\n &&:hover {\n border-color: transparent;\n ${props =>\n !props.isFocused &&\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#FFFEBF')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#F4E21E')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#901d1d', '#f7d5d0')};\n }\n`;\n\nexport const Option = styled(components.Option).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n min-height: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n padding: 6px;\n cursor: pointer;\n padding: 1px 13px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n ${props =>\n props.isFocused &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n ${props =>\n props.isSelected &&\n css`\n ${props.theme.themeProp('background-color', 'transparent', 'transparent')}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n props.isFocused &&\n props.isSelected &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n }\n svg {\n width: 15px;\n margin: 0 9px 0 0;\n }\n a {\n display: flex;\n text-decoration: none;\n color: inherit;\n }\n`;\n\n/**\n * `CompactAutocompleteSelect.tsx` passes `<S.Placeholder className=\"select-placeholder\"\n * type={type} …>` (tsx line 225). Same non-`$`-but-not-leaking situation as `Control`.\n */\ninterface PlaceholderStyleProps extends SelectThemeProp {\n /** `type` — dims the placeholder for the `error` and `warning` states only. */\n type?: CompactAutocompleteSelectType;\n}\n\nexport const Placeholder = styled(components.Placeholder).attrs<PlaceholderStyleProps>(\n applyDefaultTheme\n)`\n && {\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n css`\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n props.theme.themeProp('opacity', '0.6', '0.6')};\n }\n`;\n\nexport const SingleValue = styled(components.SingleValue).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )};\n }\n`;\n\nexport const Input = styled(components.Input).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n margin: 0;\n padding: 0;\n padding-left: 2px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n }\n`;\n\nexport const Menu = styled(components.Menu).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )};\n }\n`;\n\nexport const ValueContainer = styled(components.ValueContainer).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n padding: 0;\n }\n`;\n\nexport const ClearIndicator = styled(components.ClearIndicator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n cursor: pointer;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n\nexport const DropdownIndicator = styled(components.DropdownIndicator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n width: 18px;\n margin-left: 2px;\n cursor: pointer;\n margin-top: 1px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\nexport const DropdownIndicatorIcon = styled(ExpandMoreIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 12px;\n`;\n\nexport const ClearIndicatorIcon = styled(CloseIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 8px;\n margin-right: 4px;\n ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n stroke-width: 2px;\n`;\n\nexport const IndicatorSeparator = styled(components.IndicatorSeparator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n margin: 4px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n"],"names":["fadeIn","keyframes","props","theme","themeProp","fadeOut","fadeInCheck","AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","sharedStyle","css","primaryFontFamily","$hasLabel","shouldForwardProp","prop","startsWith","CompactAutocompleteSelect","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","disabled","Label","label","getColor","InputContainer","SuccessContainer","AsyncCreatableAutocompleteSelect","AsyncAutocompleteSelect","AsyncPaginate","AutocompletSelect","Select","AutocompletCreatableSelect","Control","components","edit","type","isFocused","Option","isSelected","Placeholder","SingleValue","Input","Menu","ValueContainer","ClearIndicator","DropdownIndicator","DropdownIndicatorIcon","ExpandMoreIcon","ClearIndicatorIcon","CloseIcon","IndicatorSeparator"],"mappings":";;;;;;;;AA2GA,MAAMA,MAAM,GAAGC,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEAC,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAGtDF,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAE7E;AAED,MAAMC,OAAO,GAAGJ,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEDC,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAGtDF,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,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S,CAAC,CAChDlC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,6BAAA,EAAA,oBAAA,CAAA,EAGvBtB,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,QAAQ,EACRF,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CAAC,EAChC1B,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CACjC,CAAC;AAIE,MAAM2B,kBAAkB,GAAGrC,MAAM,CAACoB,UAAU,CAACiB,kBAAkB,CAAC,CAAClC,KAAK,CAC3EC,iBACF,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,aAAA,EAAA,cAAA,EAAA,IAAA,CAAA,EAEctB,KAAK,IAAKA,KAAK,CAACuC,SAAS,GAAG,MAAM,GAAG,MAAO,EAErDvC,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CAAC,EAChC1B,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CACjC,CAAC;;;;"}
1
+ {"version":3,"file":"CompactAutocompleteSelect.styled.js","sources":["../../../src/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.ts"],"sourcesContent":["// 5 deferred defects: 4x themeProp TS2554 and 1x type TS2367 (not suppressed).\nimport type React from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport Select, { components } from 'react-select';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport { ReactComponent as ExpandMoreIcon } from '../../../icons/expand-more.svg';\n\nimport type { PartialNtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * `CompactAutocompleteSelect.tsx`'s `type` prop, verbatim from its\n * `PropTypes.oneOf(['', 'error', 'warning', 'instructions-warning', 'loading', 'success'])`,\n * carried WITHOUT a `$` to `Control`, `ValueContainer` and `Placeholder` — see\n * `ControlStyleProps` for why that is not a DOM leak here.\n *\n * Closed on purpose: the templates below compare against this value 14 times, so a\n * mistyped state name is TS2367 rather than a branch that silently never fires. `''` is a\n * member because the component defaults `type = ''`.\n */\ntype CompactAutocompleteSelectType =\n | ''\n | 'error'\n | 'warning'\n | 'instructions-warning'\n | 'loading'\n | 'success';\n\n/**\n * The `theme` prop of every `styled(<react-select component>)` in this file — 14 of them.\n *\n * `theme` is the one prop name that both styled-components and react-select claim.\n * react-select types it `ThemeConfig = Theme | ((t: Theme) => Theme)` and its `Theme`\n * REQUIRES `borderRadius`, which `NtbTheme` does not have, so `.attrs(applyDefaultTheme)`\n * — return type `{ theme: NtbTheme }` — was unassignable at all 14 sites, each reporting\n * the same last line:\n *\n * TS2345 … Types of property 'theme' are incompatible.\n * Property 'borderRadius' is missing in type 'NtbTheme' but required in type 'Theme'.\n *\n * Declaring `theme` in the `.attrs<P>()` generic fixes it because the generic is applied\n * as `Substitute<OuterProps, P> = FastOmit<OuterProps, keyof P> & P`, i.e. it REPLACES\n * react-select's declaration rather than intersecting with it. That is the truth about\n * this boundary: react-select's `getTheme()` is `{ ...its defaultTheme, ...props.theme }`,\n * so our `colors`/`spacing` win — which is why `ThemeColors`/`ThemeSpacing` in\n * `utils/defaultTheme.ts` carry react-select's member names — and `borderRadius` falls\n * through to react-select's own `4`. `NtbTheme` is deliberately a PARTIAL override of\n * react-select's theme. Do NOT add `borderRadius` to `NtbTheme` to \"fix\" this: that hands\n * react-select a border radius it does not get today, which is a render change.\n *\n * `MultiSelect.styled.ts` carries the same interface for the same reason.\n */\ninterface SelectThemeProp {\n /** A partial override merged over `defaultTheme` by `applyDefaultTheme`. */\n theme?: PartialNtbTheme;\n}\n\n// themeProp() takes 3-4 arguments; these take 2 (deferred defect, changes CSS if fixed).\nconst fadeIn = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n`;\n\nconst fadeOut = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n`;\n\nconst fadeInCheck = keyframes`\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n`;\n\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\n// Written type (inferred is unprintable); read MultiSelect.styled.ts for canonical note.\ntype SelectWrapper<C extends React.ComponentType<any>> = React.ComponentType<\n Omit<React.ComponentProps<C>, keyof SelectWrapperStyleProps> & SelectWrapperStyleProps\n>;\n\n// Spelled out to avoid formatting changes in type-only commit (changes CSS TEXT inline).\ntype AsyncCreatablePaginateWrapper = SelectWrapper<typeof AsyncCreatableSelectPaginate>;\n\n// Module-scope css generic; hosts must declare $hasLabel to satisfy weak-type rule.\nconst sharedStyle = css<{ $hasLabel?: boolean }>`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n line-height: 1rem;\n width: 100%;\n display: block;\n box-shadow: 'none';\n flex-basis: ${props => (props.$hasLabel ? '66.66%' : '100%')};\n`;\n\n// Shared by four wrappers: $hasLabel, theme, disabled (dead prop, never passed).\nexport interface SelectWrapperStyleProps extends SelectThemeProp {\n /** `!isEmpty(label)` — narrows the control to 66.66% so the label gets the other third. */\n $hasLabel?: boolean;\n /** `disabled` — unused; fix (repoint to `isDisabled`) changes rendered CSS. */\n disabled?: boolean;\n}\n\n// Annotated because withConfig takes it by reference, so it gets no contextual typing.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n// disabled leaks to DOM on both components (not fixed; baseline re-record needed).\ninterface DisabledStyleProps {\n /** `disabled` — dims and blocks the pointer. Leaks to DOM. */\n disabled?: boolean;\n}\n\nexport const CompactAutocompleteSelect = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<DisabledStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n height: 24px;\n font-family: ${props => props.theme.primaryFontFamily};\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs<DisabledStyleProps>(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 19px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-top: 2px;\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const InputContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n width: 100%;\n height: 19px;\n`;\n\n/*\n * animation: ${props => (props.fadeIn ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n * Dead fadeIn branch removed; animation now static; see TextArea.styled.ts for full notes.\n */\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n animation: ${fadeInCheck} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\nexport const AsyncCreatableAutocompleteSelect: AsyncCreatablePaginateWrapper = styled(\n AsyncCreatableSelectPaginate\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AsyncAutocompleteSelect: SelectWrapper<typeof AsyncPaginate> = styled(\n AsyncPaginate\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletSelect: SelectWrapper<typeof Select> = styled(\n Select\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n &&:hover:not(:focus) {\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n }\n`;\n\nexport const AutocompletCreatableSelect: SelectWrapper<typeof CreatableSelect> = styled(\n CreatableSelect\n).attrs<SelectWrapperStyleProps>(applyDefaultTheme)`\n ${sharedStyle}\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n`;\n\n// edit/type don't leak (react-select ignores unknown props); TS2367 defect in template, not suppressed.\ninterface ControlStyleProps extends SelectThemeProp {\n /** `edit` (`PropTypes.bool`) — grey \"this is editable\" background. */\n edit?: boolean;\n /** `type` — see `CompactAutocompleteSelectType`. Branched on 11 times below. */\n type?: CompactAutocompleteSelectType;\n}\n\nexport const Control = styled(components.Control).attrs<ControlStyleProps>(applyDefaultTheme)`\n && {\n ${props =>\n props.edit &&\n props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};\n ${props =>\n props.edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n\n height: 22px;\n min-height: 22px;\n box-shadow: none;\n box-sizing: border-box;\n padding: 1px 3px 0 8.7px;\n cursor: pointer;\n border: 1px solid transparent;\n background-color: transparent;\n ${props =>\n props.type &&\n // Nested css opens its own scope; needs own generic for weak-type rule.\n css<{ type?: CompactAutocompleteSelectType }>`\n animation: ${props => (props.type === 'success' ? fadeIn : fadeOut)} 0.5s ease-in-out;\n `}\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFFDE8')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n props.isFocused &&\n props.theme.themeProp('background-color', '#634e01', '#FFF36C')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background-color', '#7f1b1b', '#FBEAE6')};\n\n ${props =>\n props.isFocused &&\n !props.type === 'instructions-warning' &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-600')\n )}\n ${props =>\n props.type === 'warning' &&\n props.isFocused &&\n props.theme.themeProp('border-color', '#F4E21E', '#F4E21E')}\n ${props =>\n props.type === 'error' &&\n props.isFocused &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('red-500'),\n props.theme.getColor('red-500')\n )}\n }\n\n & .dropdown-indicator {\n display: none;\n }\n\n &:hover .dropdown-indicator {\n display: flex;\n }\n\n &&:hover {\n border-color: transparent;\n ${props =>\n !props.isFocused &&\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.type === 'warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#FFFEBF')};\n\n ${props =>\n props.type === 'instructions-warning' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#806403', '#F4E21E')};\n\n ${props =>\n props.type === 'error' &&\n !props.isFocused &&\n props.theme.themeProp('background', '#901d1d', '#f7d5d0')};\n }\n`;\n\nexport const Option = styled(components.Option).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n min-height: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n padding: 6px;\n cursor: pointer;\n padding: 1px 13px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n ${props =>\n props.isFocused &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n ${props =>\n props.isSelected &&\n css`\n ${props.theme.themeProp('background-color', 'transparent', 'transparent')}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n props.isFocused &&\n props.isSelected &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n }\n svg {\n width: 15px;\n margin: 0 9px 0 0;\n }\n a {\n display: flex;\n text-decoration: none;\n color: inherit;\n }\n`;\n\n/**\n * `CompactAutocompleteSelect.tsx` passes `<S.Placeholder className=\"select-placeholder\"\n * type={type} …>` (tsx line 225). Same non-`$`-but-not-leaking situation as `Control`.\n */\ninterface PlaceholderStyleProps extends SelectThemeProp {\n /** `type` — dims the placeholder for the `error` and `warning` states only. */\n type?: CompactAutocompleteSelectType;\n}\n\nexport const Placeholder = styled(components.Placeholder).attrs<PlaceholderStyleProps>(\n applyDefaultTheme\n)`\n && {\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n css`\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n `}\n ${props =>\n (props.type === 'error' || props.type === 'warning') &&\n props.theme.themeProp('opacity', '0.6', '0.6')};\n }\n`;\n\nexport const SingleValue = styled(components.SingleValue).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )};\n }\n`;\n\nexport const Input = styled(components.Input).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n margin: 0;\n padding: 0;\n padding-left: 2px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n }\n`;\n\nexport const Menu = styled(components.Menu).attrs<SelectThemeProp>(applyDefaultTheme)`\n && {\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )};\n }\n`;\n\nexport const ValueContainer = styled(components.ValueContainer).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n padding: 0;\n }\n`;\n\nexport const ClearIndicator = styled(components.ClearIndicator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n cursor: pointer;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n\nexport const DropdownIndicator = styled(components.DropdownIndicator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n padding: 0;\n width: 18px;\n margin-left: 2px;\n cursor: pointer;\n margin-top: 1px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\nexport const DropdownIndicatorIcon = styled(ExpandMoreIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 12px;\n`;\n\nexport const ClearIndicatorIcon = styled(CloseIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n width: 8px;\n margin-right: 4px;\n ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n stroke-width: 2px;\n`;\n\nexport const IndicatorSeparator = styled(components.IndicatorSeparator).attrs<SelectThemeProp>(\n applyDefaultTheme\n)`\n && {\n display: ${props => (props.isFocused ? 'flex' : 'none')};\n margin: 4px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n }\n`;\n"],"names":["fadeIn","keyframes","props","theme","themeProp","fadeOut","fadeInCheck","AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","sharedStyle","css","primaryFontFamily","$hasLabel","shouldForwardProp","prop","startsWith","CompactAutocompleteSelect","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","disabled","Label","label","getColor","InputContainer","SuccessContainer","AsyncCreatableAutocompleteSelect","AsyncAutocompleteSelect","AsyncPaginate","AutocompletSelect","Select","AutocompletCreatableSelect","Control","components","edit","type","isFocused","Option","isSelected","Placeholder","SingleValue","Input","Menu","ValueContainer","ClearIndicator","DropdownIndicator","DropdownIndicatorIcon","ExpandMoreIcon","ClearIndicatorIcon","CloseIcon","IndicatorSeparator"],"mappings":";;;;;;;;AA8DA,MAAMA,MAAM,GAAGC,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEAC,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAGtDF,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAE7E;AAED,MAAMC,OAAO,GAAGJ,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEDC,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAGtDF,KAAK,IACvBA,KA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MAAM6B,kBAAkB,GAAGnC,MAAM,CAACoC,QAAS,CAAC,CAChDlC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,6BAAA,EAAA,oBAAA,CAAA,EAGvBtB,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,QAAQ,EACRF,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CAAC,EAChC1B,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CACjC,CAAC;AAIE,MAAM2B,kBAAkB,GAAGrC,MAAM,CAACoB,UAAU,CAACiB,kBAAkB,CAAC,CAAClC,KAAK,CAC3EC,iBACF,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,aAAA,EAAA,cAAA,EAAA,IAAA,CAAA,EAEctB,KAAK,IAAKA,KAAK,CAACuC,SAAS,GAAG,MAAM,GAAG,MAAO,EAErDvC,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CAAC,EAChC1B,KAAK,CAACC,KAAK,CAACyB,QAAQ,CAAC,UAAU,CACjC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompactStarRating.js","sources":["../../../src/components/inputs/CompactStarRating/CompactStarRating.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, useMemo } from 'react';\nimport { ReactComponent as StarIconFill } from '../../../icons/star-filled.svg';\nimport { ReactComponent as StarIcon } from '../../../icons/star.svg';\nimport { Tooltip } from '../../data';\n\nimport * as S from './CompactStarRating.styled';\n\nconst NOOP = () => {};\nconst DEFAULT_ICON = <StarIcon />;\nconst DEFAULT_ICON_FILL = <StarIconFill />;\n\ntype CompactStarRatingOwnProps = {\n /**\n * Whether the star rating is read-only\n */\n readOnly?: boolean;\n /**\n * Whether the star rating is disabled\n */\n disabled?: boolean;\n /**\n * Displays a grey background to show that the star rating is editable\n */\n edit?: boolean;\n /**\n * Rating value (0-5)\n */\n value?: number;\n /**\n * Define the type based on error, warning, loading and success.\n */\n type?: '' | 'error' | 'warning' | 'loading' | 'success';\n /**\n * Default rating value\n */\n defaultValue?: number;\n /**\n * Compact star rating label\n */\n label?: string;\n /**\n * Name of the text area (used when sending form data)\n */\n name?: string;\n /**\n * Icon element – E.g: `icon={<StarIcon />}`\n */\n icon?: React.ReactElement<any>;\n /**\n * Filled icon element – E.g: `icon={<StarIcon />}`\n */\n iconFill?: React.ReactElement<any>;\n /**\n * Max number of stars: 5\n */\n max?: number;\n /**\n * View Compact Star Rating component when no values have been assigned\n */\n viewEmpty?: boolean;\n /**\n * Optional callback function for `onChange`\n */\n onChange?: (...args: any[]) => any;\n /**\n * Optional callback function for `onBlur`\n */\n onBlur?: (...args: any[]) => any;\n /**\n * Whether the component is hidden or visible.\n */\n hidden?: boolean;\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon?: React.ReactElement<any>;\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon?: React.ReactElement<any>;\n /**\n * Description ToolTip text.\n */\n descriptionToolTip?: string;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.CompactStarRating`, 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 CompactStarRatingOwnProps`);\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 CompactStarRatingProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.CompactStarRating>,\n keyof CompactStarRatingOwnProps\n> &\n CompactStarRatingOwnProps;\n\n/**\n * A compact star rating.\n *\n * To remove a rating (i.e. show 0 stars), click the first star to give a 1-star rating, and then click the first star again.\n *\n * ### Import\n *\n * ``` js\n * import { CompactStarRating } from '@ntbjs/react-components/inputs'\n * // or\n * import CompactStarRating from '@ntbjs/react-components/inputs/CompactStarRating'\n * ```\n * ### Values\n * Pass default value as a prop (`defaultValue`) into the component: 0 or state value.\n * ```\n */\n\nconst CompactStarRating = React.forwardRef<any, CompactStarRatingProps>(function CompactStarRating(\n {\n label = 'Rating',\n icon = DEFAULT_ICON,\n iconFill = DEFAULT_ICON_FILL,\n max = 5,\n defaultValue = 0,\n value = 0,\n name,\n viewEmpty = true,\n onChange = NOOP,\n onBlur,\n type = '',\n descriptionToolTip = '',\n disabled,\n readOnly,\n edit,\n hidden = false,\n loadingIcon,\n successIcon,\n ...props\n },\n forwardedRef\n) {\n const stars = Array.from(Array(max).keys());\n /*\n * NMB-3998: these three are numeric states initialised to `''`. Every write is a number\n * — `value || defaultValue` (both props are `number`, defaulted to 0), `key + 1`, and\n * `0` — so inference from `''` alone made the setters `SetStateAction<string>` and\n * rejected all of them (4 x TS2345, plus TS2367 on `current === 1`).\n *\n * `number | ''` is EXACTLY what the code does today, so this is a pure annotation: the\n * initial value is still `''` and the emitted JavaScript is unchanged. `useState(0)` is\n * what the state *should* probably be, and is deliberately NOT done here — the first\n * render feeds `String(rating)` into the input's value (line ~154), so `''` -> `'0'` is a\n * visible change, and it belongs with the rest of this component in the §D tail rather\n * than in a commit that must not move the baseline.\n */\n const [rating, setRating] = useState<number | ''>('');\n const [hover, setHover] = useState(false);\n const [tempRating, setTempRating] = useState<number | ''>('');\n const [initialRating, setInitialRating] = useState<number | ''>('');\n const inputRef = useRef(undefined);\n\n useEffect(() => {\n setRating(value || defaultValue);\n setInitialRating(value || defaultValue);\n }, [value, defaultValue]);\n\n useEffect(() => {\n inputRef.current.value = String(rating);\n if (rating === initialRating) {\n return undefined;\n } else {\n setInitialRating(rating);\n onChange({ target: inputRef.current });\n }\n }, [rating]);\n\n const memoizedDescriptionToolTip = useMemo(() => {\n return descriptionToolTip;\n }, [descriptionToolTip]);\n\n const starIconRender = key => {\n if (rating > 0 && rating >= key + 1) {\n return (\n <S.StarFill\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n if (key + 1 > 1) {\n return setRating(key + 1);\n } else if (key + 1 == 1) {\n setRating(current => {\n return current === 1 ? 0 : key + 1;\n });\n }\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {iconFill}\n </S.StarFill>\n );\n } else if (viewEmpty) {\n return (\n <S.Star\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n setRating(key + 1);\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {icon}\n </S.Star>\n );\n }\n };\n\n const input = () => {\n return (\n <S.CompactStarRating\n ref={forwardedRef}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChange}\n onBlur={onBlur}\n {...props}\n >\n <S.labelWidth disabled={disabled}>\n {label}\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n </S.labelWidth>\n <S.starsWidth $edit={edit} type={type} readOnly={readOnly}>\n {stars.map(key => {\n return (\n <div key={key}>\n <input type=\"number\" name={name} ref={inputRef} />\n {/*\n * NMB-3998: was `starIconRender(key, value)`. `starIconRender` is declared\n * `key => …` and takes ONE parameter, so `value` was evaluated and\n * discarded — TS2554 \"Expected 1 arguments, but got 2\". Dropping it is\n * behaviour-identical (the callee never had a binding for it, and reads\n * the `value` prop from the enclosing scope anyway), so this emits the\n * same DOM. Passing it looked like it made the star fill track `value`,\n * which is what makes it worth recording rather than quietly deleting.\n */}\n {starIconRender(key)}\n </div>\n );\n })}\n </S.starsWidth>\n </S.CompactStarRating>\n );\n };\n\n if (hidden) return null;\n\n return (\n <>\n {!memoizedDescriptionToolTip && input()}\n {memoizedDescriptionToolTip && (\n <div>\n <Tooltip\n content={memoizedDescriptionToolTip}\n key=\"tooltipTextArea1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n zIndex={999999}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n </>\n );\n});\n\nexport default CompactStarRating;\n"],"names":["NOOP","DEFAULT_ICON","_jsx","StarIcon","DEFAULT_ICON_FILL","StarIconFill","CompactStarRating","React","forwardRef","label","icon","iconFill","max","defaultValue","value","name","viewEmpty","onChange","onBlur","type","descriptionToolTip","disabled","readOnly","edit","hidden","loadingIcon","successIcon","props","forwardedRef","stars","Array","from","keys","rating","setRating","useState","hover","setHover","tempRating","setTempRating","initialRating","setInitialRating","inputRef","useRef","undefined","useEffect","current","String","target","memoizedDescriptionToolTip","useMemo","starIconRender","key","S","onClick","event","preventDefault","onMouseEnter","onMouseLeave","$hover","children","input","_jsxs","ref","$edit","map","_Fragment","Tooltip","content","placement","trigger","zIndex"],"mappings":";;;;;;;;;;;;;;AAOA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AACrB,MAAMC,YAAY,GAAGC,GAAA,CAACC,OAAQ,IAAE,CAAC;AACjC,MAAMC,iBAAiB,GAAGF,GAAA,CAACG,aAAY,IAAE,CAAC;AA2G1C,MAAMC,iBAAiB,GAAGC,cAAK,CAACC,UAAU,CAA8B,SAASF,iBAAiBA,CAChG;AACEG,EAAAA,KAAK,GAAG,QAAQ;AAChBC,EAAAA,IAAI,GAAGT,YAAY;AACnBU,EAAAA,QAAQ,GAAGP,iBAAiB;AAC5BQ,EAAAA,GAAG,GAAG,CAAC;AACPC,EAAAA,YAAY,GAAG,CAAC;AAChBC,EAAAA,KAAK,GAAG,CAAC;EACTC,IAAI;AACJC,EAAAA,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AIO,WAAW;AAAA,SAChB,CAAC;AAAA,OACT,CAAC,EACfxB,GAAA,CAACmD,UAAY,EAAA;AAACW,QAAAA,KAAK,EAAEzC,IAAK;AAACJ,QAAAA,IAAI,EAAEA,IAAK;AAACG,QAAAA,QAAQ,EAAEA,QAAS;AAAAsC,QAAAA,QAAA,EACvD/B,KAAK,CAACoC,GAAG,CAACb,GAAG,IAAI;AAChB,UAAA,OACEU,IAAA,CAAA,KAAA,EAAA;AAAAF,YAAAA,QAAA,GACE1D,GAAA,CAAA,OAAA,EAAA;AAAOiB,cAAAA,IAAI,EAAC,QAAQ;AAACJ,cAAAA,IAAI,EAAEA,IAAK;AAACgD,cAAAA,GAAG,EAAErB;AAAS,aAAE,CAAC,EAUjDS,cAAc,CAACC,GAAG,CAAC;AAAA,WAAA,EAXZA,GAYL,CAAC;QAEV,CAAC;AAAC,OACU,CAAC;AAAA,KACI,CAAC;EAE1B,CAAC;EAED,IAAI5B,MAAM,EAAE,OAAO,IAAI;EAEvB,OACEsC,IAAA,CAAAI,QAAA,EAAA;IAAAN,QAAA,EAAA,CACG,CAACX,0BAA0B,IAAIY,KAAK,EAAE,EACtCZ,0BAA0B,IACzB/C,GAAA,CAAA,KAAA,EAAA;MAAA0D,QAAA,EACE1D,GAAA,CAACiE,OAAO,EAAA;AACNC,QAAAA,OAAO,EAAEnB,0BAA2B;AAEpCoB,QAAAA,SAAS,EAAC,YAAY;AACtBC,QAAAA,OAAO,EAAE,YAAa;AACtBC,QAAAA,MAAM,EAAE,MAAO;QAAAX,QAAA,EAEdC,KAAK;AAAE,OAAA,EALJ,kBAMG;AAAC,KACP,CACN;AAAA,GACD,CAAC;AAEP,CAAC;;;;"}
1
+ {"version":3,"file":"CompactStarRating.js","sources":["../../../src/components/inputs/CompactStarRating/CompactStarRating.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, useMemo } from 'react';\nimport { ReactComponent as StarIconFill } from '../../../icons/star-filled.svg';\nimport { ReactComponent as StarIcon } from '../../../icons/star.svg';\nimport { Tooltip } from '../../data';\n\nimport * as S from './CompactStarRating.styled';\n\nconst NOOP = () => {};\nconst DEFAULT_ICON = <StarIcon />;\nconst DEFAULT_ICON_FILL = <StarIconFill />;\n\ntype CompactStarRatingOwnProps = {\n /**\n * Whether the star rating is read-only\n */\n readOnly?: boolean;\n /**\n * Whether the star rating is disabled\n */\n disabled?: boolean;\n /**\n * Displays a grey background to show that the star rating is editable\n */\n edit?: boolean;\n /**\n * Rating value (0-5)\n */\n value?: number;\n /**\n * Define the type based on error, warning, loading and success.\n */\n type?: '' | 'error' | 'warning' | 'loading' | 'success';\n /**\n * Default rating value\n */\n defaultValue?: number;\n /**\n * Compact star rating label\n */\n label?: string;\n /**\n * Name of the text area (used when sending form data)\n */\n name?: string;\n /**\n * Icon element – E.g: `icon={<StarIcon />}`\n */\n icon?: React.ReactElement<any>;\n /**\n * Filled icon element – E.g: `icon={<StarIcon />}`\n */\n iconFill?: React.ReactElement<any>;\n /**\n * Max number of stars: 5\n */\n max?: number;\n /**\n * View Compact Star Rating component when no values have been assigned\n */\n viewEmpty?: boolean;\n /**\n * Optional callback function for `onChange`\n */\n onChange?: (...args: any[]) => any;\n /**\n * Optional callback function for `onBlur`\n */\n onBlur?: (...args: any[]) => any;\n /**\n * Whether the component is hidden or visible.\n */\n hidden?: boolean;\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon?: React.ReactElement<any>;\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon?: React.ReactElement<any>;\n /**\n * Description ToolTip text.\n */\n descriptionToolTip?: string;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype CompactStarRatingProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.CompactStarRating>,\n keyof CompactStarRatingOwnProps\n> &\n CompactStarRatingOwnProps;\n\n/**\n * A compact star rating.\n *\n * To remove a rating (i.e. show 0 stars), click the first star to give a 1-star rating, and then click the first star again.\n *\n * ### Import\n *\n * ``` js\n * import { CompactStarRating } from '@ntbjs/react-components/inputs'\n * // or\n * import CompactStarRating from '@ntbjs/react-components/inputs/CompactStarRating'\n * ```\n * ### Values\n * Pass default value as a prop (`defaultValue`) into the component: 0 or state value.\n * ```\n */\n\nconst CompactStarRating = React.forwardRef<any, CompactStarRatingProps>(function CompactStarRating(\n {\n label = 'Rating',\n icon = DEFAULT_ICON,\n iconFill = DEFAULT_ICON_FILL,\n max = 5,\n defaultValue = 0,\n value = 0,\n name,\n viewEmpty = true,\n onChange = NOOP,\n onBlur,\n type = '',\n descriptionToolTip = '',\n disabled,\n readOnly,\n edit,\n hidden = false,\n loadingIcon,\n successIcon,\n ...props\n },\n forwardedRef\n) {\n const stars = Array.from(Array(max).keys());\n // Annotation `number | ''` matches code behavior (initial `''` for input, all writes are numbers) — type-only, no JS change.\n const [rating, setRating] = useState<number | ''>('');\n const [hover, setHover] = useState(false);\n const [tempRating, setTempRating] = useState<number | ''>('');\n const [initialRating, setInitialRating] = useState<number | ''>('');\n const inputRef = useRef(undefined);\n\n useEffect(() => {\n setRating(value || defaultValue);\n setInitialRating(value || defaultValue);\n }, [value, defaultValue]);\n\n useEffect(() => {\n inputRef.current.value = String(rating);\n if (rating === initialRating) {\n return undefined;\n } else {\n setInitialRating(rating);\n onChange({ target: inputRef.current });\n }\n }, [rating]);\n\n const memoizedDescriptionToolTip = useMemo(() => {\n return descriptionToolTip;\n }, [descriptionToolTip]);\n\n const starIconRender = key => {\n if (rating > 0 && rating >= key + 1) {\n return (\n <S.StarFill\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n if (key + 1 > 1) {\n return setRating(key + 1);\n } else if (key + 1 == 1) {\n setRating(current => {\n return current === 1 ? 0 : key + 1;\n });\n }\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {iconFill}\n </S.StarFill>\n );\n } else if (viewEmpty) {\n return (\n <S.Star\n readOnly={readOnly}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n setRating(key + 1);\n }}\n onMouseEnter={() => {\n setTempRating(key + 1);\n setHover(true);\n }}\n onMouseLeave={() => {\n setTempRating(0);\n setHover(false);\n }}\n $hover={hover && key + 1 <= tempRating}\n type=\"button\"\n key={key}\n >\n {icon}\n </S.Star>\n );\n }\n };\n\n const input = () => {\n return (\n <S.CompactStarRating\n ref={forwardedRef}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChange}\n onBlur={onBlur}\n {...props}\n >\n <S.labelWidth disabled={disabled}>\n {label}\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n </S.labelWidth>\n <S.starsWidth $edit={edit} type={type} readOnly={readOnly}>\n {stars.map(key => {\n return (\n <div key={key}>\n <input type=\"number\" name={name} ref={inputRef} />\n {/* Was `starIconRender(key, value)` — second arg dropped (callee never bound it, reads from enclosing scope). */}\n {starIconRender(key)}\n </div>\n );\n })}\n </S.starsWidth>\n </S.CompactStarRating>\n );\n };\n\n if (hidden) return null;\n\n return (\n <>\n {!memoizedDescriptionToolTip && input()}\n {memoizedDescriptionToolTip && (\n <div>\n <Tooltip\n content={memoizedDescriptionToolTip}\n key=\"tooltipTextArea1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n zIndex={999999}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n </>\n );\n});\n\nexport default CompactStarRating;\n"],"names":["NOOP","DEFAULT_ICON","_jsx","StarIcon","DEFAULT_ICON_FILL","StarIconFill","CompactStarRating","React","forwardRef","label","icon","iconFill","max","defaultValue","value","name","viewEmpty","onChange","onBlur","type","descriptionToolTip","disabled","readOnly","edit","hidden","loadingIcon","successIcon","props","forwardedRef","stars","Array","from","keys","rating","setRating","useState","hover","setHover","tempRating","setTempRating","initialRating","setInitialRating","inputRef","useRef","undefined","useEffect","current","String","target","memoizedDescriptionToolTip","useMemo","starIconRender","key","S","onClick","event","preventDefault","onMouseEnter","onMouseLeave","$hover","children","input","_jsxs","ref","$edit","map","_Fragment","Tooltip","content","placement","trigger","zIndex"],"mappings":";;;;;;;;;;;;;;AAOA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AACrB,MAAMC,YAAY,GAAGC,GAAA,CAACC,OAAQ,IAAE,CAAC;AACjC,MAAMC,iBAAiB,GAAGF,GAAA,CAACG,aAAY,IAAE,CAAC;AAqG1C,MAAMC,iBAAiB,GAAGC,cAAK,CAACC,UAAU,CAA8B,SAASF,iBAAiBA,CAChG;AACEG,EAAAA,KAAK,GAAG,QAAQ;AAChBC,EAAAA,IAAI,GAAGT,YAAY;AACnBU,EAAAA,QAAQ,GAAGP,iBAAiB;AAC5BQ,EAAAA,GAAG,GAAG,CAAC;AACPC,EAAAA,YAAY,GAAG,CAAC;AAChBC,EAAAA,KAAK,GAAG,CAAC;EACTC,IAAI;AACJC,EAAAA,SAAS,GAAG,IAAI;AAChBC,EAAAA,QAAQ,GAAGjB,IAAI;EACfkB,MAAM;AACNC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,kBAAkB,GAAG,EAAE;EACvBC,QAAQ;EACRC,QAAQ;EACRC,IAAI;AACJC,EAAAA,MAAM,GAAG,KAAK;EACdC,WAAW;EACXC,WAAW;EACX,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACD,KAAK,CAAClB,GAAG,CAAC,CAACoB,IAAI,EAAE,CAAC;EAE3C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,QAAQ,CAAc,EAAE,CAAC;EACrD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAGJ,QAAQ,CAAc,EAAE,CAAC;EAC7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AAI;EAEvB,OACEsC,IAAA,CAAAI,QAAA,EAAA;IAAAN,QAAA,EAAA,CACG,CAACX,0BAA0B,IAAIY,KAAK,EAAE,EACtCZ,0BAA0B,IACzB/C,GAAA,CAAA,KAAA,EAAA;MAAA0D,QAAA,EACE1D,GAAA,CAACiE,OAAO,EAAA;AACNC,QAAAA,OAAO,EAAEnB,0BAA2B;AAEpCoB,QAAAA,SAAS,EAAC,YAAY;AACtBC,QAAAA,OAAO,EAAE,YAAa;AACtBC,QAAAA,MAAM,EAAE,MAAO;QAAAX,QAAA,EAEdC,KAAK;AAAE,OAAA,EALJ,kBAMG;AAAC,KACP,CACN;AAAA,GACD,CAAC;AAEP,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompactStarRating.styled.js","sources":["../../../src/components/inputs/CompactStarRating/CompactStarRating.styled.ts"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst fadeIn = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n`;\n\nconst fadeOut = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n`;\n\nconst fadeInCheck = keyframes`\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n`;\n\nconst fadeOutCheck = keyframes`\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n`;\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`\n * and the two majors disagree on the second parameter. Rules in\n * `layout/SectionSeparator/SectionSeparator.styled.ts`, derivation in\n * `scripts/TS-MIGRATION-PLAYBOOK.md` §J.4. `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\n/**\n * `CompactStarRating.tsx`'s `type` prop, from its\n * `PropTypes.oneOf(['', 'error', 'warning', 'loading', 'success'])`. The component\n * defaults it to `''`, so `''` is a member — this is the propTypes verbatim.\n *\n * Carried WITHOUT a `$` by `starsWidth`, which is a defect in its own right (see\n * there). `Star` / `StarFill` / `CheckIconContainer` also branch on a `type`, but\n * theirs is not this one — see the notes at those three.\n */\ntype CompactStarRatingType = '' | 'error' | 'warning' | 'loading' | 'success';\n\n/*\n * `readOnly` AND `disabled` HAVE NO `$`, AND THAT IS A DEFECT — declared here, not\n * fixed here.\n *\n * `CompactStarRating.tsx` renders `<S.CompactStarRating ref=… readOnly={readOnly}\n * disabled={disabled} …>` on a `styled.div`; neither is a member of\n * `HTMLAttributes<HTMLDivElement>`, and `shouldForwardProp` forwards every non-`$` prop,\n * so `readonly=\"\"` / `disabled=\"\"` are on the rendered wrapper `<div>` today and are in\n * the recorded render baseline. Fix = rename both with a `$`; that removes two DOM\n * attributes, so it belongs to C10 with its baseline re-record. §E.4 third case, §J.9.\n */\nexport const CompactStarRating = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{\n /** `readOnly` — `PropTypes.bool`. Leaks to the DOM; see above. */\n readOnly?: boolean;\n /** `disabled` — `PropTypes.bool`. Leaks to the DOM; see above. */\n disabled?: boolean;\n }>(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n height: 24px;\n width: 100%;\n display: flex;\n\n align-items: center;\n input[type='number'] {\n position: absolute;\n opacity: 0;\n pointer-events: none;\n margin: 0;\n }\n\n ${props =>\n props.readOnly &&\n css`\n pointer-events: none;\n `}\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\n/*\n * `disabled` HAS NO `$` HERE EITHER — `CompactStarRating.tsx` renders\n * `<S.labelWidth disabled={disabled}>` on a `styled.div`, so `disabled=\"\"` is on this\n * `<div>` in the render baseline. Declared, not fixed; same C10 group as the root.\n */\nexport const labelWidth = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ disabled?: boolean }>(applyDefaultTheme)`\n width: 33.33%;\n display: flex;\n align-items: center;\n text-align: left;\n font: normal normal normal 14px/16px Roboto;\n letter-spacing: 0px;\n padding: 0;\n height: 19px;\n cursor: default;\n justify-content: space-between;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\n/*\n * `fadeIn` IS GONE — DEAD BRANCH REMOVED. It was read twice here and passed nowhere:\n *\n * opacity: ${props => (props.fadeIn ? 0 : 1)};\n * animation: ${props => (props.fadeIn ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n *\n * `CompactStarRating.tsx` renders `<S.SuccessContainer>` with NO props at all, and\n * `git log --all -S'fadeIn='` finds no commit in the repo's history that writes the prop\n * anywhere. So `props.fadeIn` was always `undefined`, `opacity` was always the `1` two\n * lines above already sets, and `fadeOutCheck` was unreachable from here.\n *\n * It was a MISTYPED `success`, not an unimplemented feature: `fadeIn` first appears in\n * `4ed910a` in `CompactTextInput.styled.js`, next to a `props.success` read, and the twin\n * block in THIS file's own `CheckIconContainer` reads `props.success` in both lines.\n * `NMB-3183` (`7e46b9d`, `59b0041`) already deleted the identical two lines and the\n * keyframes they orphaned from `CompactTextInput.styled.ts`; this file was missed.\n *\n * Wiring it up was rejected: this container is mounted unconditionally inside\n * `S.labelWidth` and only swaps its children, so it has no \"success is going away\"\n * transition — a fade-out here would fade an empty box.\n *\n * The `animation` is kept, now static, because the branch it always took is the live one.\n * Only the unreachable half is gone. See `TextArea.styled.ts`'s `SuccessContainer` for the\n * full derivation. `fadeOutCheck` stays in this file: `CheckIconContainer` still reads it.\n */\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n animation: ${fadeInCheck} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\ninterface StarsWidthStyleProps {\n /** `edit` — `PropTypes.bool`. Shows the editable-affordance background. */\n $edit?: boolean;\n /**\n * `type` — see `CompactStarRatingType`. HAS NO `$`, AND THAT IS A DEFECT: this is a\n * `styled.div`, `type` is not a member of `HTMLAttributes<HTMLDivElement>`, and\n * `shouldForwardProp` forwards it — so `type=\"error\"` / `type=\"loading\"` etc. is on\n * this `<div>` in the render baseline whenever the prop is non-empty. Fix = rename\n * `$type`; removes a DOM attribute → C10 with its re-record. §E.4 third case.\n */\n type?: CompactStarRatingType;\n /** `readOnly` — `PropTypes.bool`. Leaks to the DOM the same way. */\n readOnly?: boolean;\n /**\n * `success` IS DECLARED BECAUSE THE NESTED `css<{ success?: boolean }>` BLOCK BELOW\n * READS IT, NOT BECAUSE ANYTHING PASSES IT. Nothing does — `CompactStarRating.tsx`\n * renders `<S.starsWidth $edit={edit} type={type} readOnly={readOnly}>` and there is\n * no other importer — so `props.success` is always `undefined` and that block's\n * animation is unconditionally `fadeOut`. The success-fade-IN state of this component\n * is unimplemented. A DIFFERENT DEFECT from the `fadeIn` branch removed from\n * `SuccessContainer` above, and left alone deliberately: `fadeIn` was a mistyped\n * identifier that never existed as a prop, whereas `success` WAS a real\n * `PropTypes.bool` (added by `4ed910a`) that `b5d59e7`/`7e46b9d` deleted from the\n * component while leaving this read behind. Deciding between restoring the prop and\n * deleting the block is its own call, on its own commit.\n *\n * Without this member the interpolation is TS2345, and the reason is the WEAK-TYPE\n * RULE (§J.7): `{ success?: boolean }` is all-optional, assignability to a weak type\n * requires at least one member in common, and the host had none — measured verbatim as\n * \"…has no properties in common with type '{ success?: boolean; }'\". Same shape as\n * `CompactTextInput`'s `StyledLink` / `linkColor`.\n *\n * It also has no `$`, but since nothing passes it, it does not currently leak.\n */\n success?: boolean;\n}\n\nexport const starsWidth = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<StarsWidthStyleProps>(applyDefaultTheme)`\n display: flex;\n width: 66.66%;\n border-radius: 3px;\n height: 24px;\n align-items: center;\n padding-left: 8px;\n box-sizing: border-box;\n border: 1px solid;\n\n ${props =>\n props.readOnly &&\n css`\n border: none;\n `}\n\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )}\n\n ${props =>\n props.type === 'success' &&\n css<{ success?: boolean }>`\n animation: ${props => (props.success ? fadeIn : fadeOut)} 0.5s ease-in-out;\n `}\n\n ${props =>\n props.type === 'error' &&\n css`\n ${props.theme.themeProp('background', '#7F1B1B', '#FBEAE6')};\n ${props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6')}\n `}\n\n ${props =>\n props.type === 'warning' &&\n css`\n ${props.theme.themeProp('background', '#634E01', '#FFFDE8')};\n ${props.theme.themeProp('border-color', '#2F2402 ', '#FFFDE8')}\n `}\n &&:not(:hover):not(:focus) {\n ${props =>\n props.$edit &&\n props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};\n ${props =>\n props.$edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n }\n &&:hover:not(:focus) {\n ${props =>\n props.$edit &&\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )}\n\n ${props =>\n props.$edit &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.type === 'warning' &&\n !props.readOnly &&\n props.theme.themeProp('background', '#806403', '#FFFEBF')};\n\n ${props =>\n props.type === 'error' &&\n !props.readOnly &&\n props.theme.themeProp('background', '#901d1d', '#f7d5d0')};\n }\n`;\n\n/**\n * The props `Star` and `StarFill` share — they are byte-identical templates apart from\n * one `type === 'error'` block, and the JSX passes them the same set.\n *\n * `disabled` is deliberately ABSENT: on a `styled.button` it is a genuine\n * `ButtonHTMLAttributes` member, so the read already typechecks and the attribute\n * belongs on the element (§J.9 first row).\n *\n * `type` IS ALSO DELIBERATELY ABSENT, AND THAT IS WHY FOUR TS2367 ERRORS SURVIVE IN\n * THIS FILE. See the note above `StarFill`.\n */\ninterface StarStyleProps {\n /** `hover && key + 1 <= tempRating` — derived in the component, so `boolean`. */\n $hover?: boolean;\n /**\n * `readOnly` — `PropTypes.bool`. HAS NO `$`, AND THAT IS A DEFECT: `readOnly` is NOT a\n * member of `ButtonHTMLAttributes` (unlike `disabled`), and `shouldForwardProp`\n * forwards it, so `readonly=\"\"` is on every rendered star `<button>` today and is in\n * the recorded render baseline. Fix = rename `$readOnly`; removes a DOM attribute →\n * C10 with its re-record. §E.4 third case.\n */\n readOnly?: boolean;\n}\n\nexport const Star = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs<StarStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n height: 12px;\n padding-left: 4px;\n transition: color 250ms;\n }\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'warning' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'warning' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.$hover &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('orange-500'),\n props.theme.getColor('orange-500')\n )};\n\n ${props =>\n props.readOnly &&\n css`\n pointer-events: none;\n `}\n\n ${props =>\n props.disabled &&\n css`\n button {\n cursor: not-allowed;\n }\n > * {\n cursor: not-allowed;\n }\n `}\n`;\n\n/*\n * ================== FOUR ERRORS ARE LEFT IN THIS FILE ON PURPOSE ==================\n *\n * `Star:238,242` and `StarFill:293,297` (pre-conversion line numbers) compare\n * `props.type` against `'warning'` / `'error'`, and tsc reports\n *\n * TS2367 This comparison appears to be unintentional because the types\n * '\"button\" | \"reset\" | \"submit\"' and '\"warning\"' have no overlap.\n *\n * THAT DIAGNOSTIC IS CORRECT AND THE CODE IS WRONG. `CompactStarRating.tsx` renders\n * `<S.Star … type=\"button\" …>` / `<S.StarFill … type=\"button\" …>` — the HTML button\n * type, the only `type` these two ever receive — while the templates were written\n * expecting the component's rating `type` (`'' | 'error' | 'warning' | …`). All four\n * blocks are therefore DEAD: they have never once applied. (They would have been no-ops\n * anyway — each sets the same `color` the unconditional rule two lines above already\n * sets.) This is the §E.3 dead-branch class, the same failure as `Badge.styled`'s\n * `props.elevated` vs `$elevated`.\n *\n * It is NOT typed around, for the reason §E.3 states as a rule: declaring `type?: string`\n * or `type?: CompactStarRatingType` here would silence TS2367 by widening the type to\n * accommodate a bug — \"when a type would have to be widened to accommodate existing\n * behaviour, check whether the behaviour is a bug first\". The narrow\n * `ButtonHTMLAttributes['type']` that is already in force is the accurate type, and the\n * error is the finding. It is not suppressed either: §E.2 names the non-`$` styled props\n * as a bug list a suppression must not hide.\n *\n * The fix is `$type={type}` at both ends plus `props.$type` here, or deleting the four\n * blocks. Either changes the rendered CSS, so it belongs to C9/C10 with the baseline\n * re-record and cannot ride along in a type-only commit.\n * =================================================================================\n */\nexport const StarFill = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs<StarStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n height: 12px;\n padding-left: 4px;\n transition: color 250ms;\n }\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'error' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'warning' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.$hover &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('orange-500'),\n props.theme.getColor('orange-500')\n )};\n\n ${props =>\n props.readOnly &&\n css`\n pointer-events: none;\n `}\n\n ${props =>\n props.disabled &&\n css`\n button {\n cursor: not-allowed;\n }\n > * {\n cursor: not-allowed;\n }\n `}\n`;\n\n/*\n * `type` IS READ TWICE AND PASSED NOWHERE, because THIS COMPONENT IS NEVER RENDERED.\n * `CompactStarRating.tsx` does not use `S.CheckIconContainer` and nothing else in `src`\n * imports this module — it is exported, so it is public API, but dead in this library.\n * `props.type` is therefore always `undefined`: `opacity` is unconditionally `1` and the\n * animation unconditionally `fadeInCheck`.\n *\n * `CompactStarRatingType` is the honest declaration — the value a caller would pass is\n * the component's rating `type` — and it also has no `$`, so if anything ever did render\n * this, `type=\"success\"` would land on the `<div>`. Declared, not fixed: renaming it, or\n * deleting the component, changes the published surface. §E.4.\n */\nexport const CheckIconContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ type?: CompactStarRatingType }>(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n margin-left: auto;\n opacity: ${props => (props.type === 'success' ? 0 : 1)};\n animation: ${props => (props.type === 'success' ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('emerald-200'),\n props.theme.getColor('emerald-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n"],"names":["fadeIn","keyframes","props","theme","themeProp","fadeOut","fadeInCheck","fadeOutCheck","shouldForwardProp","prop","startsWith","CompactStarRating","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","primaryFontFamily","readOnly","css","disabled","labelWidth","getColor","SuccessContainer","starsWidth","type","success","$edit","Star","button","$hover","StarFill"],"mappings":";;;AAGA,MAAMA,MAAM,GAAGC,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEAC,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAGtDF,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAE7E;AAED,MAAMC,OAAO,GAAGJ,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA,CAAA,EAEDC,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAGtDF,KAAK,IACvBA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAE7E;AAED,MAAME,WAAW,GAAGL,SAAS,CAAA,CAAA,8BAAA,CAAA,CAO5B;AAED,MAAMM,YAAY,GAAGN,SAAS,CAAA,CAAA,8BAAA,CAAA,CAO7B;AASD,MAAMO,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAwBM,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,GAAG,CACxCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAKHC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,4CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,cAAA,EAAA,wKAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EACNhB,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACgB,iBAAiB,EAenDjB,KAAK,IACLA,KAAK,CAACkB,QAAQ,IACdC,GAAG,C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AAA;EAAAG,WAAA,EAAA,6CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,yDAAA,EAAA,aAAA,EAAA,wDAAA,EAAA,qBAAA,CAAA,EAIhDhB,KAAK,IAAKA,KAAK,CAACyB,IAAI,KAAK,SAAS,GAAG,CAAC,GAAG,CAAE,EACzCzB,KAAK,IAAKA,KAAK,CAACyB,IAAI,KAAK,SAAS,GAAGpB,YAAY,GAAGD,WAAY,EAE3EJ,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACqB,QAAQ,CAAC,aAAa,CAAC,EACnCtB,KAAK,CAACC,KAAK,CAACqB,QAAQ,CAAC,aAAa,CACpC,CAAC;;;;"}
1
+ {"version":3,"file":"CompactStarRating.styled.js","sources":["../../../src/components/inputs/CompactStarRating/CompactStarRating.styled.ts"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst fadeIn = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n`;\n\nconst fadeOut = keyframes`\n from {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};\n }\n to {\n background-color: ${props =>\n props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};\n }\n`;\n\nconst fadeInCheck = keyframes`\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n`;\n\nconst fadeOutCheck = keyframes`\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n`;\n\n// Annotated because withConfig takes it by reference, so it gets no contextual typing.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n// Component's rating type (not the HTML button type that Star/StarFill receive).\ntype CompactStarRatingType = '' | 'error' | 'warning' | 'loading' | 'success';\n\n// readOnly and disabled leak to DOM as attributes (not fixed; baseline re-record needed).\nexport const CompactStarRating = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{\n /** `readOnly` — `PropTypes.bool`. Leaks to the DOM; see above. */\n readOnly?: boolean;\n /** `disabled` — `PropTypes.bool`. Leaks to the DOM; see above. */\n disabled?: boolean;\n }>(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n height: 24px;\n width: 100%;\n display: flex;\n\n align-items: center;\n input[type='number'] {\n position: absolute;\n opacity: 0;\n pointer-events: none;\n margin: 0;\n }\n\n ${props =>\n props.readOnly &&\n css`\n pointer-events: none;\n `}\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\n/*\n * `disabled` HAS NO `$` HERE EITHER — `CompactStarRating.tsx` renders\n * `<S.labelWidth disabled={disabled}>` on a `styled.div`, so `disabled=\"\"` is on this\n * `<div>` in the render baseline. Declared, not fixed; same C10 group as the root.\n */\nexport const labelWidth = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ disabled?: boolean }>(applyDefaultTheme)`\n width: 33.33%;\n display: flex;\n align-items: center;\n text-align: left;\n font: normal normal normal 14px/16px Roboto;\n letter-spacing: 0px;\n padding: 0;\n height: 19px;\n cursor: default;\n justify-content: space-between;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\n/*\n * animation: ${props => (props.fadeIn ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n * Dead fadeIn branch removed; see TextArea.styled.ts for full notes.\n */\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n animation: ${fadeInCheck} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\ninterface StarsWidthStyleProps {\n /** `edit` — `PropTypes.bool`. Shows the editable-affordance background. */\n $edit?: boolean;\n /** `type` — see `CompactStarRatingType`. Leaks to DOM; defect not fixed. */\n type?: CompactStarRatingType;\n /** `readOnly` — `PropTypes.bool`. Leaks to the DOM the same way. */\n readOnly?: boolean;\n /** `success` — unused prop, declared for weak-type assignment compatibility. */\n success?: boolean;\n}\n\nexport const starsWidth = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<StarsWidthStyleProps>(applyDefaultTheme)`\n display: flex;\n width: 66.66%;\n border-radius: 3px;\n height: 24px;\n align-items: center;\n padding-left: 8px;\n box-sizing: border-box;\n border: 1px solid;\n\n ${props =>\n props.readOnly &&\n css`\n border: none;\n `}\n\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )}\n\n ${props =>\n props.type === 'success' &&\n css<{ success?: boolean }>`\n animation: ${props => (props.success ? fadeIn : fadeOut)} 0.5s ease-in-out;\n `}\n\n ${props =>\n props.type === 'error' &&\n css`\n ${props.theme.themeProp('background', '#7F1B1B', '#FBEAE6')};\n ${props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6')}\n `}\n\n ${props =>\n props.type === 'warning' &&\n css`\n ${props.theme.themeProp('background', '#634E01', '#FFFDE8')};\n ${props.theme.themeProp('border-color', '#2F2402 ', '#FFFDE8')}\n `}\n &&:not(:hover):not(:focus) {\n ${props =>\n props.$edit &&\n props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};\n ${props =>\n props.$edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n }\n &&:hover:not(:focus) {\n ${props =>\n props.$edit &&\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )}\n\n ${props =>\n props.$edit &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.type === 'warning' &&\n !props.readOnly &&\n props.theme.themeProp('background', '#806403', '#FFFEBF')};\n\n ${props =>\n props.type === 'error' &&\n !props.readOnly &&\n props.theme.themeProp('background', '#901d1d', '#f7d5d0')};\n }\n`;\n\n// Shared by Star and StarFill; type is deliberately absent (why TS2367 errors survive).\ninterface StarStyleProps {\n /** `hover && key + 1 <= tempRating` — derived in the component, so `boolean`. */\n $hover?: boolean;\n /** `readOnly` — `PropTypes.bool`. Leaks to DOM; defect not fixed. */\n readOnly?: boolean;\n}\n\nexport const Star = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs<StarStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n height: 12px;\n padding-left: 4px;\n transition: color 250ms;\n }\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'warning' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'warning' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.$hover &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('orange-500'),\n props.theme.getColor('orange-500')\n )};\n\n ${props =>\n props.readOnly &&\n css`\n pointer-events: none;\n `}\n\n ${props =>\n props.disabled &&\n css`\n button {\n cursor: not-allowed;\n }\n > * {\n cursor: not-allowed;\n }\n `}\n`;\n\n// TS2367: type blocks are dead code, comparing button type to rating type; not suppressed.\nexport const StarFill = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs<StarStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n height: 12px;\n padding-left: 4px;\n transition: color 250ms;\n }\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'error' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.type === 'warning' &&\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('black'))};\n\n ${props =>\n props.$hover &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('orange-500'),\n props.theme.getColor('orange-500')\n )};\n\n ${props =>\n props.readOnly &&\n css`\n pointer-events: none;\n `}\n\n ${props =>\n props.disabled &&\n css`\n button {\n cursor: not-allowed;\n }\n > * {\n cursor: not-allowed;\n }\n `}\n`;\n\n// Component is dead code (never rendered); type prop unused, no $ leak.\nexport const CheckIconContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ type?: CompactStarRatingType }>(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n margin-left: auto;\n opacity: ${props => (props.type === 'success' ? 0 : 1)};\n animation: ${props => (props.type === 'success' ? fadeOutCheck : fadeInCheck)} 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('emerald-200'),\n props.theme.getColor('emerald-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n"],"names":["fadeIn","keyframes","props","theme","themeProp","fadeOut","fadeInCheck","fadeOutCheck","shouldForwardProp","prop","startsWith","CompactStarRating","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","primaryFontFamily","readOnly","css","disabled","labelWidth","getColor","SuccessContainer","starsWidth","type","success","$edit","Star","button","$hover","StarFill"],"mappings":";;;AAGA,MAAMA,MAAM,GAAGC,SAAS,CAAA,CAAA,wBAAA,EAAA,wBAAA,EAAA,IAAA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K,IAAKA,KAAK,CAACyB,IAAI,KAAK,SAAS,GAAG,CAAC,GAAG,CAAE,EACzCzB,KAAK,IAAKA,KAAK,CAACyB,IAAI,KAAK,SAAS,GAAGpB,YAAY,GAAGD,WAAY,EAE3EJ,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACqB,QAAQ,CAAC,aAAa,CAAC,EACnCtB,KAAK,CAACC,KAAK,CAACqB,QAAQ,CAAC,aAAa,CACpC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompactTextInput.js","sources":["../../../src/components/inputs/CompactTextInput/CompactTextInput.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash';\nimport { nanoid } from 'nanoid';\nimport React, { useCallback, useState, useEffect } from 'react';\nimport useTooltipAutoShow from '../../../hooks/useTooltipAutoShow';\nimport { ReactComponent as EditNoteIcon } from '../../../icons/edit-note.svg';\nimport { ReactComponent as LinkIcon } from '../../../icons/link.svg';\nimport { Tooltip, Popover } from '../../data';\nimport * as S from './CompactTextInput.styled';\n\nconst NOOP = () => {};\n\ntype CompactTextInputOwnProps = {\n /**\n * The label of the input field - leave `undefined` to hide the label\n */\n label?: string;\n /**\n * Displays a light green background to show that an action was successful.\n */\n success?: boolean;\n /**\n * The input type - eg. `text`, `number`\n */\n inputType?: string;\n /**\n * The input name\n */\n name?: string;\n /**\n * The default value of the input - creates an uncontrolled input\n */\n defaultValue?: string;\n /**\n * The value of the input - creates a controlled input\n */\n value?: string;\n /**\n * The placeholder of the input\n */\n placeholder?: string;\n /**\n * A URL associated with the input value. Creates a clickable link that accepts full or relative URL\n */\n link?: string;\n /**\n * The target for the link. Only applies when the field is in read-only mode\n */\n linkTarget?: '_self' | '_blank' | '_parent' | '_top';\n /**\n * Whether the link has a onClick event.\n */\n linkHandler?: (...args: any[]) => any;\n /**\n * Whether the handler should preceed the link behavior.\n */\n activeLinkHandler?: boolean;\n /**\n * Whether to auto select the entire value when the input is focused – does also work when the field is in read-only mode\n */\n autoSelect?: boolean;\n /**\n * Whether the value is read only\n */\n readOnly?: boolean;\n /**\n * Whether the value is disabled\n */\n disabled?: boolean;\n /**\n * Displays a grey background to show that value is editable\n */\n edit?: boolean;\n /**\n * There is a warning present.\n */\n warning?: boolean | string;\n /**\n * Whether to bold the input content - Slightly increases the font size and font weight of the input value\n */\n bold?: boolean;\n /**\n * Whether the component is hidden or visible.\n */\n hidden?: boolean;\n /**\n * Callback for `onChange`\n */\n onChange?: (...args: any[]) => any;\n /**\n * Callback for `onFocus`\n */\n onFocus?: (...args: any[]) => any;\n /**\n * Callback for `onBlur`\n */\n onBlur?: (...args: any[]) => any;\n /**\n * Define the type based on error, warning, loading and success.\n */\n type?: '' | 'error' | 'warning' | 'loading' | 'success';\n /**\n * Description ToolTip text.\n */\n descriptionToolTip?: string;\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon?: React.ReactElement<any>;\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon?: React.ReactElement<any>;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.CompactTextInput`, 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 CompactTextInputOwnProps`);\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 CompactTextInputProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.CompactTextInput>,\n keyof CompactTextInputOwnProps\n> &\n CompactTextInputOwnProps;\n\n// const ConditionalWrapper = ({ condition, wrapper, children }) =>\n// condition ? wrapper(children) : children;\n\n/**\n * Compact text inputs let users enter and edit text in the UI in a compact way. They typically appear in forms or displays of metadata.\n *\n * ### Import\n *\n * ``` js\n * import { CompactTextInput } from '@ntbjs/react-components/inputs'\n * // or\n * import CompactTextInput from '@ntbjs/react-components/inputs/CompactTextInput'\n * ```\n */\nconst CompactTextInput = React.forwardRef<any, CompactTextInputProps>(function CompactTextInput(\n {\n label,\n inputType = 'text',\n name,\n defaultValue,\n value,\n placeholder,\n link,\n linkTarget = '_self',\n linkHandler = NOOP,\n activeLinkHandler = false,\n autoSelect = true,\n readOnly = false,\n disabled,\n edit = false,\n type = '',\n descriptionToolTip = '',\n bold = false,\n hidden = false,\n onChange: onChangeProp = NOOP,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n loadingIcon,\n successIcon,\n ...props\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n /*\n * NMB-3998: `useState()` with no argument infers `undefined`, so its setter is typed\n * `(prevState: undefined) => undefined` and rejects the string this component actually\n * stores — TS2345. The generic records what is assigned (`value || defaultValue`, both\n * `string`) while KEEPING the initial value `undefined`, so this is type-only: no\n * argument is added and the first render is unchanged. `useState('')` would have been a\n * behavioural change.\n */\n const [currentValue, setCurrentValue] = useState<string | undefined>();\n const [autoFocus, setAutoFocus] = useState(false);\n\n const { toolTipDisabled, toolTipVisible, toolTipOnMouseLeave, toolTipContent } =\n useTooltipAutoShow(descriptionToolTip);\n\n useEffect(() => {\n setCurrentValue(value || defaultValue);\n setAutoFocus(false);\n }, [value, defaultValue]);\n\n const onChange = useCallback(\n event => {\n setCurrentValue(event.target.value);\n\n if (!autoFocus) {\n setAutoFocus(true);\n }\n if (isFunction(onChangeProp)) {\n onChangeProp(event);\n }\n },\n [onChangeProp]\n );\n\n const onFocus = useCallback(\n event => {\n if (autoSelect) {\n event.target.select();\n }\n\n if (isFunction(onFocusProp)) {\n onFocusProp(event);\n }\n },\n [autoSelect, readOnly, onFocusProp]\n );\n\n const onBlur = useCallback(\n event => {\n if (isFunction(onBlurProp)) {\n onBlurProp(event);\n }\n },\n [onBlurProp]\n );\n\n const input = () => {\n return (\n <S.Input\n ref={forwardedRef}\n id={uniqueId}\n key={uniqueId}\n autoFocus={autoFocus}\n $inputType={inputType}\n name={name}\n readOnly={readOnly}\n disabled={disabled}\n $edit={edit}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value ?? ''}\n $type={type}\n $bold={bold}\n $haslink={!isEmpty(link)}\n onFocus={onFocus}\n onChange={onChange}\n onBlur={onBlur}\n />\n );\n };\n\n if (hidden) return null;\n\n return (\n <S.CompactTextInput {...props}>\n {label && (\n <S.Label htmlFor={uniqueId} $disabled={disabled}>\n {label}\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n </S.Label>\n )}\n <S.InputContainer $hasLabel={!isEmpty(label)}>\n {!link && (\n <div onMouseLeave={toolTipOnMouseLeave}>\n <Tooltip\n content={toolTipContent}\n key=\"tooltip1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n disabled={toolTipDisabled}\n zIndex={999999}\n visible={toolTipVisible}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n {link && !readOnly && (\n <div>\n <Popover\n arrow={false}\n content={\n <S.LinkPopoverContainer>\n {activeLinkHandler ? (\n <S.StyledLink\n href={link}\n target={linkTarget}\n onClick={e => {\n if (activeLinkHandler) {\n e.preventDefault();\n linkHandler();\n } else null;\n }}\n rel=\"noreferrer\"\n >\n <LinkIcon />\n {currentValue}\n </S.StyledLink>\n ) : (\n <S.StyledLink href={link} target={linkTarget} rel=\"noreferrer\">\n <LinkIcon />\n {currentValue}\n </S.StyledLink>\n )}\n </S.LinkPopoverContainer>\n }\n key=\"tooltip2\"\n placement=\"bottom-start\"\n trigger=\"focusin\"\n zIndex={999999}\n interactive={true}\n >\n {input()}\n </Popover>\n </div>\n )}\n {link && readOnly && (\n <S.ReadOnlyLinkContainer>\n <S.StyledLink\n href={link}\n rel=\"noreferrer\"\n style={{ display: 'inline-block' }}\n target={linkTarget}\n >\n {currentValue}\n </S.StyledLink>\n </S.ReadOnlyLinkContainer>\n )}\n {!readOnly && !disabled && (\n <>\n <S.InputIconContainer $type={type}>\n <EditNoteIcon />\n </S.InputIconContainer>\n {isEmpty(label) && (\n <S.InputSuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.InputSuccessContainer>\n )}\n </>\n )}\n </S.InputContainer>\n </S.CompactTextInput>\n );\n});\n\nexport default CompactTextInput;\n"],"names":["NOOP","CompactTextInput","React","forwardRef","label","inputType","name","defaultValue","value","placeholder","link","linkTarget","linkHandler","activeLinkHandler","autoSelect","readOnly","disabled","edit","type","descriptionToolTip","bold","hidden","onChange","onChangeProp","onFocus","onFocusProp","onBlur","onBlurProp","loadingIcon","successIcon","props","forwardedRef","uniqueId","useState","nanoid","currentValue","setCurrentValue","autoFocus","setAutoFocus","toolTipDisabled","toolTipVisible","toolTipOnMouseLeave","toolTipContent","useTooltipAutoShow","useEffect","useCallback","event","target","isFunction","select","input","_jsx","S","ref","id","$inputType","$edit","$type","$bold","$haslink","isEmpty","_jsxs","children","htmlFor","$disabled","$hasLabel","onMouseLeave","Tooltip","content","placement","trigger","zIndex","visible","Popover","arrow","href","onClick","e","preventDefault","rel","LinkIcon","interactive","style","display","_Fragment","EditNoteIcon"],"mappings":";;;;;;;;;;;;;;;;;AASA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AAoIrB,MAAMC,gBAAgB,GAAGC,cAAK,CAACC,UAAU,CAA6B,SAASF,gBAAgBA,CAC7F;EACEG,KAAK;AACLC,EAAAA,SAAS,GAAG,MAAM;EAClBC,IAAI;EACJC,YAAY;EACZC,KAAK;EACLC,WAAW;EACXC,IAAI;AACJC,EAAAA,UAAU,GAAG,OAAO;AACpBC,EAAAA,WAAW,GAAGZ,IAAI;AAClBa,EAAAA,iBAAiB,GAAG,KAAK;AACzBC,EAAAA,UAAU,GAAG,IAAI;AACjBC,EAAAA,QAAQ,GAAG,KAAK;EAChBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,KAAK;AACZC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,kBAAkB,GAAG,EAAE;AACvBC,EAAAA,IAAI,GAAG,KAAK;AACZC,EAA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,IAAA,CAACT,qBAAuB,EAAA;UAAAU,QAAA,EAAA,CACrB5C,IAAI,KAAK,SAAS,IAAIU,WAAW,EACjCV,IAAI,KAAK,SAAS,IAAIW,WAAW;AAAA,SACX,CAC1B;AAAA,OACD,CACH;AAAA,KACe,CAAC;AAAA,GACD,CAAC;AAEzB,CAAC;;;;"}
1
+ {"version":3,"file":"CompactTextInput.js","sources":["../../../src/components/inputs/CompactTextInput/CompactTextInput.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash';\nimport { nanoid } from 'nanoid';\nimport React, { useCallback, useState, useEffect } from 'react';\nimport useTooltipAutoShow from '../../../hooks/useTooltipAutoShow';\nimport { ReactComponent as EditNoteIcon } from '../../../icons/edit-note.svg';\nimport { ReactComponent as LinkIcon } from '../../../icons/link.svg';\nimport { Tooltip, Popover } from '../../data';\nimport * as S from './CompactTextInput.styled';\n\nconst NOOP = () => {};\n\ntype CompactTextInputOwnProps = {\n /**\n * The label of the input field - leave `undefined` to hide the label\n */\n label?: string;\n /**\n * Displays a light green background to show that an action was successful.\n */\n success?: boolean;\n /**\n * The input type - eg. `text`, `number`\n */\n inputType?: string;\n /**\n * The input name\n */\n name?: string;\n /**\n * The default value of the input - creates an uncontrolled input\n */\n defaultValue?: string;\n /**\n * The value of the input - creates a controlled input\n */\n value?: string;\n /**\n * The placeholder of the input\n */\n placeholder?: string;\n /**\n * A URL associated with the input value. Creates a clickable link that accepts full or relative URL\n */\n link?: string;\n /**\n * The target for the link. Only applies when the field is in read-only mode\n */\n linkTarget?: '_self' | '_blank' | '_parent' | '_top';\n /**\n * Whether the link has a onClick event.\n */\n linkHandler?: (...args: any[]) => any;\n /**\n * Whether the handler should preceed the link behavior.\n */\n activeLinkHandler?: boolean;\n /**\n * Whether to auto select the entire value when the input is focused – does also work when the field is in read-only mode\n */\n autoSelect?: boolean;\n /**\n * Whether the value is read only\n */\n readOnly?: boolean;\n /**\n * Whether the value is disabled\n */\n disabled?: boolean;\n /**\n * Displays a grey background to show that value is editable\n */\n edit?: boolean;\n /**\n * There is a warning present.\n */\n warning?: boolean | string;\n /**\n * Whether to bold the input content - Slightly increases the font size and font weight of the input value\n */\n bold?: boolean;\n /**\n * Whether the component is hidden or visible.\n */\n hidden?: boolean;\n /**\n * Callback for `onChange`\n */\n onChange?: (...args: any[]) => any;\n /**\n * Callback for `onFocus`\n */\n onFocus?: (...args: any[]) => any;\n /**\n * Callback for `onBlur`\n */\n onBlur?: (...args: any[]) => any;\n /**\n * Define the type based on error, warning, loading and success.\n */\n type?: '' | 'error' | 'warning' | 'loading' | 'success';\n /**\n * Description ToolTip text.\n */\n descriptionToolTip?: string;\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon?: React.ReactElement<any>;\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon?: React.ReactElement<any>;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype CompactTextInputProps = Omit<\n React.ComponentPropsWithoutRef<typeof S.CompactTextInput>,\n keyof CompactTextInputOwnProps\n> &\n CompactTextInputOwnProps;\n\n// const ConditionalWrapper = ({ condition, wrapper, children }) =>\n// condition ? wrapper(children) : children;\n\n/**\n * Compact text inputs let users enter and edit text in the UI in a compact way. They typically appear in forms or displays of metadata.\n *\n * ### Import\n *\n * ``` js\n * import { CompactTextInput } from '@ntbjs/react-components/inputs'\n * // or\n * import CompactTextInput from '@ntbjs/react-components/inputs/CompactTextInput'\n * ```\n */\nconst CompactTextInput = React.forwardRef<any, CompactTextInputProps>(function CompactTextInput(\n {\n label,\n inputType = 'text',\n name,\n defaultValue,\n value,\n placeholder,\n link,\n linkTarget = '_self',\n linkHandler = NOOP,\n activeLinkHandler = false,\n autoSelect = true,\n readOnly = false,\n disabled,\n edit = false,\n type = '',\n descriptionToolTip = '',\n bold = false,\n hidden = false,\n onChange: onChangeProp = NOOP,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n loadingIcon,\n successIcon,\n ...props\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n // Generic keeps initial undefined but accepts string assignments (type-only: no behavioural change vs useState()).\n const [currentValue, setCurrentValue] = useState<string | undefined>();\n const [autoFocus, setAutoFocus] = useState(false);\n\n const { toolTipDisabled, toolTipVisible, toolTipOnMouseLeave, toolTipContent } =\n useTooltipAutoShow(descriptionToolTip);\n\n useEffect(() => {\n setCurrentValue(value || defaultValue);\n setAutoFocus(false);\n }, [value, defaultValue]);\n\n const onChange = useCallback(\n event => {\n setCurrentValue(event.target.value);\n\n if (!autoFocus) {\n setAutoFocus(true);\n }\n if (isFunction(onChangeProp)) {\n onChangeProp(event);\n }\n },\n [onChangeProp]\n );\n\n const onFocus = useCallback(\n event => {\n if (autoSelect) {\n event.target.select();\n }\n\n if (isFunction(onFocusProp)) {\n onFocusProp(event);\n }\n },\n [autoSelect, readOnly, onFocusProp]\n );\n\n const onBlur = useCallback(\n event => {\n if (isFunction(onBlurProp)) {\n onBlurProp(event);\n }\n },\n [onBlurProp]\n );\n\n const input = () => {\n return (\n <S.Input\n ref={forwardedRef}\n id={uniqueId}\n key={uniqueId}\n autoFocus={autoFocus}\n $inputType={inputType}\n name={name}\n readOnly={readOnly}\n disabled={disabled}\n $edit={edit}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value ?? ''}\n $type={type}\n $bold={bold}\n $haslink={!isEmpty(link)}\n onFocus={onFocus}\n onChange={onChange}\n onBlur={onBlur}\n />\n );\n };\n\n if (hidden) return null;\n\n return (\n <S.CompactTextInput {...props}>\n {label && (\n <S.Label htmlFor={uniqueId} $disabled={disabled}>\n {label}\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n </S.Label>\n )}\n <S.InputContainer $hasLabel={!isEmpty(label)}>\n {!link && (\n <div onMouseLeave={toolTipOnMouseLeave}>\n <Tooltip\n content={toolTipContent}\n key=\"tooltip1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n disabled={toolTipDisabled}\n zIndex={999999}\n visible={toolTipVisible}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n {link && !readOnly && (\n <div>\n <Popover\n arrow={false}\n content={\n <S.LinkPopoverContainer>\n {activeLinkHandler ? (\n <S.StyledLink\n href={link}\n target={linkTarget}\n onClick={e => {\n if (activeLinkHandler) {\n e.preventDefault();\n linkHandler();\n } else null;\n }}\n rel=\"noreferrer\"\n >\n <LinkIcon />\n {currentValue}\n </S.StyledLink>\n ) : (\n <S.StyledLink href={link} target={linkTarget} rel=\"noreferrer\">\n <LinkIcon />\n {currentValue}\n </S.StyledLink>\n )}\n </S.LinkPopoverContainer>\n }\n key=\"tooltip2\"\n placement=\"bottom-start\"\n trigger=\"focusin\"\n zIndex={999999}\n interactive={true}\n >\n {input()}\n </Popover>\n </div>\n )}\n {link && readOnly && (\n <S.ReadOnlyLinkContainer>\n <S.StyledLink\n href={link}\n rel=\"noreferrer\"\n style={{ display: 'inline-block' }}\n target={linkTarget}\n >\n {currentValue}\n </S.StyledLink>\n </S.ReadOnlyLinkContainer>\n )}\n {!readOnly && !disabled && (\n <>\n <S.InputIconContainer $type={type}>\n <EditNoteIcon />\n </S.InputIconContainer>\n {isEmpty(label) && (\n <S.InputSuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.InputSuccessContainer>\n )}\n </>\n )}\n </S.InputContainer>\n </S.CompactTextInput>\n );\n});\n\nexport default CompactTextInput;\n"],"names":["NOOP","CompactTextInput","React","forwardRef","label","inputType","name","defaultValue","value","placeholder","link","linkTarget","linkHandler","activeLinkHandler","autoSelect","readOnly","disabled","edit","type","descriptionToolTip","bold","hidden","onChange","onChangeProp","onFocus","onFocusProp","onBlur","onBlurProp","loadingIcon","successIcon","props","forwardedRef","uniqueId","useState","nanoid","currentValue","setCurrentValue","autoFocus","setAutoFocus","toolTipDisabled","toolTipVisible","toolTipOnMouseLeave","toolTipContent","useTooltipAutoShow","useEffect","useCallback","event","target","isFunction","select","input","_jsx","S","ref","id","$inputType","$edit","$type","$bold","$haslink","isEmpty","_jsxs","children","htmlFor","$disabled","$hasLabel","onMouseLeave","Tooltip","content","placement","trigger","zIndex","visible","Popover","arrow","href","onClick","e","preventDefault","rel","LinkIcon","interactive","style","display","_Fragment","EditNoteIcon"],"mappings":";;;;;;;;;;;;;;;;;AASA,MAAMA,IAAI,GAAGA,MAAM,CAAC,CAAC;AA8HrB,MAAMC,gBAAgB,GAAGC,cAAK,CAACC,UAAU,CAA6B,SAASF,gBAAgBA,CAC7F;EACEG,KAAK;AACLC,EAAAA,SAAS,GAAG,MAAM;EAClBC,IAAI;EACJC,YAAY;EACZC,KAAK;EACLC,WAAW;EACXC,IAAI;AACJC,EAAAA,UAAU,GAAG,OAAO;AACpBC,EAAAA,WAAW,GAAGZ,IAAI;AAClBa,EAAAA,iBAAiB,GAAG,KAAK;AACzBC,EAAAA,UAAU,GAAG,IAAI;AACjBC,EAAAA,QAAQ,GAAG,KAAK;EAChBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,KAAK;AACZC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,kBAAkB,GAAG,EAAE;AACvBC,EAAAA,IAAI,GAAG,KAAK;AACZC,EAAAA,MAAM,GAAG,KAAK;EACdC,QAAQ,EAAEC,YAAY,GAAGvB,IAAI;AAC7BwB,EAAAA,OAAO,EAAEC,WAAW;AACpBC,EAAAA,MAAM,EAAEC,UAAU;EAClBC,WAAW;EACXC,WAAW;EACX,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;EACA,MAAM,CAACC,QAAQ,CAAC,GAAGC,QAAQ,CAACC,MAAM,EAAE,CAAC;EAErC,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGH,QAAQ,EAAsB;EACtE,MAAM,CAACI,SAAS,EAAEC,YAAY,CAAC,GAAGL,QAAQ,CAAC,KAAK,CAAC;EAEjD,MAAM;IAAEM,eAAe;IAAEC,cAAc;IAAEC,mBAAmB;AAAEC,IAAAA;AA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AAA,OAAO,EAAC,SAAS;AACjBC,UAAAA,MAAM,EAAE,MAAO;AACfU,UAAAA,WAAW,EAAE,IAAK;UAAAnB,QAAA,EAEjBZ,KAAK;AAAE,SAAA,EANJ,UAOG;OACN,CACN,EACAxC,IAAI,IAAIK,QAAQ,IACfoC,GAAA,CAACC,qBAAuB,EAAA;AAAAU,QAAAA,QAAA,EACtBX,GAAA,CAACC,UAAY,EAAA;AACXuB,UAAAA,IAAI,EAAEjE,IAAK;AACXqE,UAAAA,GAAG,EAAC,YAAY;AAChBG,UAAAA,KAAK,EAAE;AAAEC,YAAAA,OAAO,EAAE;WAAiB;AACnCpC,UAAAA,MAAM,EAAEpC,UAAW;AAAAmD,UAAAA,QAAA,EAElB3B;SACW;OACS,CAC1B,EACA,CAACpB,QAAQ,IAAI,CAACC,QAAQ,IACrB6C,IAAA,CAAAuB,QAAA,EAAA;AAAAtB,QAAAA,QAAA,EAAA,CACEX,GAAA,CAACC,kBAAoB,EAAA;AAACK,UAAAA,KAAK,EAAEvC,IAAK;AAAA4C,UAAAA,QAAA,EAChCX,GAAA,CAACkC,WAAY,EAAA,EAAE;SACK,CAAC,EACtBzB,OAAO,CAACxD,KAAK,CAAC,IACbyD,IAAA,CAACT,qBAAuB,EAAA;UAAAU,QAAA,EAAA,CACrB5C,IAAI,KAAK,SAAS,IAAIU,WAAW,EACjCV,IAAI,KAAK,SAAS,IAAIW,WAAW;AAAA,SACX,CAC1B;AAAA,OACD,CACH;AAAA,KACe,CAAC;AAAA,GACD,CAAC;AAEzB,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompactTextInput.styled.js","sources":["../../../src/components/inputs/CompactTextInput/CompactTextInput.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 * THIS FILE IS THE WORKED EXAMPLE FOR EVERYTHING THE SIMPLE CASE DOES NOT SHOW:\n *\n * - an `.attrs(props => …)` CALLBACK that reads a prop (`Input`). The generic MUST be\n * on `.attrs<P>()` here and cannot be on the template call: measured, the\n * template-call slot leaves the callback parameter `FastOmit<…, never>`, so P never\n * reaches it and the error has no fix but a suppression. §J.2.\n * - MODULE-SCOPE `css` helpers shared between components (`linkColor`,\n * `readOnlyBackground`), each its own generic slot. §J.7.\n * - `css` blocks NESTED inside an interpolation's argument list\n * (`InputIconContainer`'s two `themeProp()` arguments), whose own `${props => …}`\n * SHADOWS the outer one, so the outer `.attrs<P>()` does not reach them. §J.7.\n * - a closed 5-member union for `$type` derived from the component's propTypes,\n * rather than the `any` the a7bb76d prototype emits. §J.6.\n * - `Input`'s `inputtype`, one of the two non-`$` keys §J.9 recorded as a deferred DOM\n * leak: now FIXED and transient (`$inputType`). It removed `inputtype=\"text\"` from\n * every rendered `<input>`, so it moved the render baseline on purpose. §J.9 / §E.4.\n * - `Label`'s `disabled`, the other one, FIXED the same way (`$disabled`). It removed\n * an attribute that is not even legal on `<label>`.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/**\n * `CompactTextInput.tsx`'s `type` prop, from its\n * `PropTypes.oneOf(['', 'error', 'warning', 'loading', 'success'])`, carried across\n * the `shouldForwardProp` boundary as `$type` by both `Input` and\n * `InputIconContainer`.\n *\n * Closed on purpose, not widened to `string`. The templates below branch on this\n * value 20 times; with a closed union a mistyped state name is TS2367 rather than a\n * branch that silently never fires. `''` is a member because the component defaults\n * `type = ''` — this union is the propTypes verbatim, not a tidied version of it.\n */\ntype CompactTextInputType = '' | 'error' | 'warning' | 'loading' | 'success';\n\n/**\n * A module-scope `css` helper is a SEPARATE generic slot: unannotated, its props are\n * `ExecutionContext & object` and `props.disabled` is TS2339 no matter what the\n * hosting component declares.\n *\n * `disabled` is declared here because of `Input`, which is one of this block's two\n * hosts and does receive it. THE OTHER HOST IS `StyledLink`, WHICH DOES NOT — and that\n * IS checked: `{ disabled?: boolean }` is a weak type, assignability to a weak type\n * needs at least one member in common, and `AnchorHTMLAttributes` has no `disabled`.\n * See the note at `StyledLink` for the resulting declaration and why it is not an\n * invented prop.\n *\n * Hosts, for whoever changes this block: Input (twice, inside the `$haslink` blocks)\n * and StyledLink.\n */\nconst linkColor = css<{ disabled?: boolean }>`\n ${props => props.theme.themeProp('color', '#ACCDC3', props.theme.getColor('emerald-500'))}\n ${props =>\n !props.disabled &&\n css`\n &:hover {\n text-decoration: underline;\n }\n `}\n`;\n\n/* No interpolations at all, so no props and no generic. */\nconst commonAnchorTagStyle = css`\n a,\n && {\n font-size: 0.875rem;\n text-decoration: none;\n }\n`;\n\n/*\n * Reads only `props.theme`, which is on `ExecutionContext` via the C6 `DefaultTheme`\n * augmentation — so this one needs NO generic even though it is the same shape as\n * `linkColor`. §J.7.\n */\nconst readOnlyBackground = css`\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )}\n`;\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`,\n * and the two majors disagree on the second parameter. §J.4. `prop` needs the\n * annotation because `withConfig` takes this by reference, so it gets no contextual\n * typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const CompactTextInput = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n height: 24px;\n font-family: ${props => props.theme.primaryFontFamily};\n`;\n\n/*\n * `$disabled` WAS `disabled`, WITH NO `$`, AND THAT WAS A DOM LEAK — now fixed.\n *\n * `disabled` is not a member of `LabelHTMLAttributes`, which is why the read below used\n * to be TS2339 while the identical read in `Input` is not (there it IS a real\n * `InputHTMLAttributes` member and needs no declaration at all — §J.9). That asymmetry\n * was the whole tell: `CompactTextInput.tsx` passed `disabled={disabled}` to this\n * component, `shouldForwardProp` forwards every non-`$` prop, and so `disabled=\"\"`\n * landed on a `<label>`, where it is not valid HTML. It is in three entries of the\n * committed render baseline (`inputs/CompactTextInput#disabled`, and the same leak from\n * the equivalent code in `inputs/Radio#disabled` and `inputs/TextArea#disabled`, which\n * are other files' to fix).\n *\n * §E.4, third case: the fix is the `$` prefix at both ends, which removes the attribute\n * from the rendered HTML. Purely internal — `CompactTextInput`'s own public `disabled`\n * prop is untouched and still drives this.\n */\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $disabled?: boolean }>(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n justify-content: space-between;\n height: 19px;\n display: flex;\n align-items: center;\n ${props =>\n props.$disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\nexport const InputContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $hasLabel?: boolean }>(applyDefaultTheme)`\n position: relative;\n height: 19px;\n flex-basis: ${props => (props.$hasLabel ? '66.66%' : '100%')};\n`;\n\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\nexport const InputSuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n justify-content: flex-end;\n transition: opacity 0.5s ease-in-out;\n position: relative;\n margin-top: -20px;\n margin-right: 8px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\n/*\n * TWO GENERIC SLOTS IN ONE COMPONENT, and the outer one does not cover the inner ones.\n *\n * The `.attrs<{ $type }>()` below types the template's own interpolations. The two\n * `css`…`` blocks passed as arguments to `themeProp()` each open their OWN\n * `${props => …}`, which shadows the outer `props`, so the outer generic never reaches\n * them — unannotated their props are `ExecutionContext & object` and `props.$type` is\n * TS2339 there regardless of what the component declares. Hence `css<…>` on both.\n * This is C7 rule 3 / §J.7, and it is 4 of this file's 35 errors.\n */\nexport const InputIconContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $type?: CompactTextInputType }>(applyDefaultTheme)`\n opacity: 0;\n pointer-events: none;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n padding: 5px 10px 0 0;\n transition: opacity 250ms;\n ${props =>\n props.theme.themeProp(\n 'background',\n css<{ $type?: CompactTextInputType }>`\n linear-gradient(-90deg,\n ${props =>\n props.$type === 'error'\n ? '#901d1d'\n : props.$type === 'warning'\n ? '#816600'\n : props.theme.getColor('gray-700')} 55%,\n transparent)\n `,\n css<{ $type?: CompactTextInputType }>`\n linear-gradient(-90deg,\n ${props =>\n props.$type === 'error'\n ? '#f7d5d0'\n : props.$type === 'warning'\n ? '#fffebf'\n : props.theme.getColor('gray-100')} 55%,\n transparent)\n `\n )};\n\n display: flex;\n align-items: center;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n color: ${props => props.theme.getColor('gray-400')};\n\n ${props => props.$type === 'warning' && props.theme.themeProp('color', '#C3AF43', '#C3AF43')}\n\n ${props => props.$type === 'error' && props.theme.themeProp('color', '#CB968F', '#CB968F')}\n\n > svg {\n width: 12px;\n transition: opacity 250ms;\n }\n`;\n\n/**\n * Props of `Input`.\n *\n * Every member is transient, so `shouldForwardProp` filters all of them out of the DOM.\n * `$haslink` is lower-case by existing convention at both ends; renaming it would be a\n * two-file change for no type benefit.\n *\n * `$inputType` WAS `inputtype`, WITH NO `$`, AND THAT WAS A DOM LEAK — now fixed.\n * It is a style/behaviour input (the `.attrs()` callback turns it into the real `type`\n * attribute), but without the `$` prefix `shouldForwardProp` forwarded it verbatim too,\n * so `inputtype=\"text\"` was on every rendered `<input>` — visible in seven entries of the\n * recorded render baseline (`inputs/CompactTextInput` and its five variants, plus\n * `layout/InputGroup`). §E.4's third case, and the fix is the `$` prefix.\n *\n * The PUBLIC prop is unaffected: `CompactTextInput.tsx` still takes `inputType` and maps\n * it to this transient prop internally, so no consumer has to react. (Grepped: neither\n * `mb-main-client/src` nor `ntb-dam/client/src` mentions `inputtype` or `inputType` at\n * all, and no stylesheet in `src` selects on `[inputtype]`.)\n *\n * `readOnly` and `disabled` are read by the template too and are deliberately ABSENT\n * from this interface: both are real `InputHTMLAttributes` members, so those reads\n * already typecheck and declaring them would add nothing. §J.9.\n */\ninterface InputStyleProps {\n /** `type` — see `CompactTextInputType`. Branched on 20 times below. */\n $type?: CompactTextInputType;\n /** `edit` — shows the editable-affordance background. */\n $edit?: boolean;\n /** `bold` — larger font-size/weight for the value. */\n $bold?: boolean;\n /** `!isEmpty(link)` — the component derives this, so `boolean`, not `link`'s type. */\n $haslink?: boolean;\n /**\n * `inputType` — the real `<input type>`, defaulted to `'text'` in the callback.\n * `string` because the propTypes say `PropTypes.string` and the value is handed\n * straight to the `type` attribute the callback produces.\n */\n $inputType?: string;\n}\n\n/*\n * THE GENERIC MUST BE ON `.attrs<P>()` HERE. THIS IS THE SITE THAT PROVES IT.\n *\n * `props.$inputType` is read inside the `.attrs()` CALLBACK, and measured (§J.2) the\n * callback parameter is typed `FastOmit<…, keyof P> & P` only when P is supplied to\n * `attrs`; supplying it on the tagged-template call instead leaves the parameter\n * `FastOmit<…, never>`, where no amount of adding members to P will ever fix the read.\n *\n * There was a `@ts-ignore` above this declaration until NMB-3998 C2, which measured as\n * suppressing NOTHING — a directive covers only the following line, that line is\n * `export const Input = styled.input`, and tsc reports no error there. The file's errors\n * started at the callback below and continued through the template: 35 of them at the\n * time this commit was written (102 before the C6 theme augmentation removed the\n * `props.theme` reads). It is not re-added in a legal form either. §E.2 names the\n * styled-generics bucket explicitly as something a suppression must not hide, and the\n * remedy is the line below.\n */\nexport const Input = styled.input\n .withConfig({\n shouldForwardProp\n })\n .attrs<InputStyleProps>(props => ({\n ...applyDefaultTheme(props),\n type: props.$inputType || 'text'\n }))`\n box-sizing: border-box;\n height: 22px;\n width: 100%;\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n font-family: inherit;\n padding: 1px 10px;\n border-radius: 3px;\n border: 1px solid transparent;\n transition: border-color 350ms, background 350ms;\n\n ${props => {\n if (props.$type === 'error') {\n return css`\n ${props.theme.themeProp('background', '#7f1b1b', '#FEE2E2')} !important;\n `;\n } else if (props.$type === 'warning') {\n return css`\n ${props.theme.themeProp('background', '#634E01', '#FFFDE8')} !important;\n `;\n } else {\n return props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n );\n }\n }}\n\n ${props =>\n props.readOnly &&\n css`\n cursor: default;\n `}\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n\n\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n\n ${props =>\n props.$haslink &&\n css`\n &&:not(:focus),\n &&:read-only {\n ${linkColor}\n }\n &&:read-only {\n cursor: default;\n }\n `};\n\n &&:not(:hover):not(:focus) {\n ${props => {\n if (props.$edit) {\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#7f1b1b', '#FEE2E2');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#634E01', '#FFFDE8');\n } else {\n return props.theme.themeProp(\n 'background',\n 'rgba(39,39,42, 0.7)',\n 'rgba(244,244,245, 0.3)'\n );\n }\n }\n }}\n\n ${props =>\n props.$edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n \n ${props =>\n props.$haslink &&\n css`\n &&:not(:focus),\n &&:read-only {\n cursor: default;\n ${linkColor}\n }\n `}\n }\n\n &&:hover:not(:focus) {\n ${props => {\n if (props.readOnly) {\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#7f1b1b', '#FEE2E2');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#634E01', '#FFFDE8');\n }\n return readOnlyBackground;\n }\n\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#901d1d', '#F7D5D0');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#806403', '#FFFEBF');\n } else {\n return props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n );\n }\n }}\n\n ${props =>\n props.$edit &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.$haslink &&\n css`\n cursor: pointer;\n &&:read-only {\n background: none !important;\n cursor: default;\n }\n `}\n \n & + ${InputIconContainer} {\n opacity: 1;\n ${props =>\n props.$type === 'success' &&\n css`\n opacity: 0;\n `}\n }\n\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n \n ${props =>\n props.disabled &&\n props.$haslink &&\n css`\n background: none !important;\n cursor: not-allowed !important;\n `}\n }\n\n &&:focus {\n outline: none;\n\n ${props => {\n if (props.readOnly) {\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#7f1b1b', '#FEE2E2');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#634E01', '#FFFDE8');\n }\n return readOnlyBackground;\n }\n\n if (props.$type === 'error') {\n return css`\n ${props.theme.themeProp('border-color', '#D83018', '#D83018')}\n ${props.theme.themeProp('background', 'white', 'white')}\n ${props.theme.themeProp('color', 'black', 'black')}\n `;\n } else if (props.$type === 'warning') {\n return css`\n ${props.theme.themeProp('border-color', '#F4E21E', '#F4E21E')}\n ${props.theme.themeProp('background', 'white', 'white')}\n ${props.theme.themeProp('color', 'black', 'black')}\n `;\n } else {\n return css`\n border-color: ${props.theme.getColor('gray-600')};\n ${props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )}\n `;\n }\n }}\n }\n\n &&::placeholder {\n color: inherit;\n opacity: 0.6;\n }\n\n &&:hover::placeholder {\n ${props => {\n if (props.$type === 'warning') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n );\n } else if (props.$type === 'error') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n );\n }\n return '';\n }}\n }\n\n &&:focus::placeholder {\n ${props => {\n if (props.$type === 'warning') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-900'),\n props.theme.getColor('gray-900')\n );\n } else if (props.$type === 'error') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('red-600'),\n props.theme.getColor('red-600')\n );\n }\n return '';\n }}\n }\n\n ${props =>\n props.$bold &&\n css`\n font-size: 1rem;\n font-weight: 500;\n line-height: 1.0625;\n padding-top: 3px;\n padding-bottom: 2px;\n `}\n`;\n\nexport const LinkPopoverContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${commonAnchorTagStyle}\n\n padding: 5px 8px;\n\n svg {\n width: 18px;\n margin-right: 8px;\n }\n`;\n\n/*\n * `disabled` IS DECLARED HERE BECAUSE `linkColor` READS IT, NOT BECAUSE ANYTHING PASSES\n * IT. Nothing does: `CompactTextInput.tsx` renders `<S.StyledLink href=… target=…\n * rel=…>` in all three places, so `props.disabled` is always `undefined` here and\n * `linkColor`'s `!props.disabled` branch always takes the true arm — the hover\n * underline is unconditional on this component.\n *\n * Without the declaration this is TS2345, and the reason is worth knowing because it\n * contradicts the obvious guess: `{ disabled?: boolean }` is a WEAK TYPE (every member\n * optional), and assignability to a weak type requires AT LEAST ONE MEMBER IN COMMON.\n * `AnchorHTMLAttributes` has no `disabled`, so the overlap is empty and\n * `RuleSet<{ disabled?: boolean }>` is rejected — \"has no properties in common with\n * type '{ disabled?: boolean; }'\". `Input` needs no such declaration because `disabled`\n * is a genuine `InputHTMLAttributes` member.\n *\n * So a shared `css<A>` helper IS checked against every host, and the host has to be\n * able to supply what the helper reads. Playbook §J.7 said the opposite until this\n * file disproved it.\n */\nexport const StyledLink = styled.a\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ disabled?: boolean }>(applyDefaultTheme)`\n ${commonAnchorTagStyle}\n ${linkColor}\n`;\n\nexport const ReadOnlyLinkContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${readOnlyBackground};\n border: 1px solid transparent;\n border-radius: 3px;\n padding: 0 10px 1px;\n`;\n"],"names":["linkColor","css","props","theme","themeProp","getColor","disabled","commonAnchorTagStyle","readOnlyBackground","shouldForwardProp","prop","startsWith","CompactTextInput","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","primaryFontFamily","Label","label","$disabled","InputContainer","$hasLabel","SuccessContainer","InputSuccessContainer","InputIconContainer","$type","Input","input","type","$inputType","readOnly","$haslink","$edit","$bold","LinkPopoverContainer","StyledLink","a","ReadOnlyLinkContainer"],"mappings":";;;AAuDA,MAAMA,SAAS,GAAGC,GAAG,CAAA,CAAA,EAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EACjBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAEF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,aAAa,CAAC,CAAC,EACvFH,KAAK,IACL,CAACA,KAAK,CAACI,QAAQ,IACfL,GAAG,yCAIF,CACJ;AAGD,MAAMM,oBAAoB,GAAGN,GAAG,CAAA,CAAA,gDAAA,CAAA,CAM/B;AAOD,MAAMO,kBAAkB,GAAGP,GAAG,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,EAC1BC,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,YAAY,EACZF,KAAK,CAACC,K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AC/BH,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,SAAS,CAChC,CAAC;AACH,EAAA;AACA,EAAA,OAAO,EAAE;AACX,CAAC,EAGDH,KAAK,IACLA,KAAK,CAACmC,KAAK,IACXpC,GAAG,CAAA,CAAA,uFAAA,CAAA,CAMF;AAGE,MAAMqC,oBAAoB,GAAGzB,MAAM,CAACC,GAAG,CAC3CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,oDAAA,CAAA,EACvBZ,oBAAoB;AA6BjB,MAAMgC,UAAU,GAAG1B,MAAM,CAAC2B,CAAC,CAC/BzB,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAyBC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAC/CZ,oBAAoB,EACpBP,SAAS;AAGN,MAAMyC,qBAAqB,GAAG5B,MAAM,CAACC,GAAG,CAC5CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,+CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,qEAAA,CAAA,EACvBX,kBAAkB;;;;"}
1
+ {"version":3,"file":"CompactTextInput.styled.js","sources":["../../../src/components/inputs/CompactTextInput/CompactTextInput.styled.ts"],"sourcesContent":["// $-transient-prop pattern with .attrs() callback, module-scope css helpers, nested css blocks, and two DOM leaks fixed ($inputType, $disabled).\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/** Closed union: branches 20 times below, so mistyped state names are TS2367 not silent no-ops. */\ntype CompactTextInputType = '' | 'error' | 'warning' | 'loading' | 'success';\n\n// Module-scope css needs `disabled` annotation; weak-type rule requires one member in common. Hosts: Input and StyledLink.\nconst linkColor = css<{ disabled?: boolean }>`\n ${props => props.theme.themeProp('color', '#ACCDC3', props.theme.getColor('emerald-500'))}\n ${props =>\n !props.disabled &&\n css`\n &:hover {\n text-decoration: underline;\n }\n `}\n`;\n\n/* No interpolations at all, so no props and no generic. */\nconst commonAnchorTagStyle = css`\n a,\n && {\n font-size: 0.875rem;\n text-decoration: none;\n }\n`;\n\n// No generic: reads only props.theme which is on ExecutionContext via DefaultTheme augmentation.\nconst readOnlyBackground = css`\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )}\n`;\n\n// Single-argument: styled-components majors disagree on the second parameter (peer floor >=5.1.0).\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const CompactTextInput = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n height: 24px;\n font-family: ${props => props.theme.primaryFontFamily};\n`;\n\n// DOM leak fixed: `disabled` isn't in LabelHTMLAttributes but is in InputHTMLAttributes — prefix with $ to avoid rendering invalid HTML.\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $disabled?: boolean }>(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n justify-content: space-between;\n height: 19px;\n display: flex;\n align-items: center;\n ${props =>\n props.$disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n `}\n`;\n\nexport const InputContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $hasLabel?: boolean }>(applyDefaultTheme)`\n position: relative;\n height: 19px;\n flex-basis: ${props => (props.$hasLabel ? '66.66%' : '100%')};\n`;\n\nexport const SuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n transition: opacity 0.5s ease-in-out;\n margin-right: 5px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\nexport const InputSuccessContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n pointer-events: none;\n display: flex;\n justify-content: flex-end;\n transition: opacity 0.5s ease-in-out;\n position: relative;\n margin-top: -20px;\n margin-right: 8px;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-500')\n )}\n > svg {\n width: 13px;\n }\n`;\n\n/*\n * TWO GENERIC SLOTS IN ONE COMPONENT, and the outer one does not cover the inner ones.\n *\n * The `.attrs<{ $type }>()` below types the template's own interpolations. The two\n * `css`…`` blocks passed as arguments to `themeProp()` each open their OWN\n * `${props => …}`, which shadows the outer `props`, so the outer generic never reaches\n * them — unannotated their props are `ExecutionContext & object` and `props.$type` is\n * TS2339 there regardless of what the component declares. Hence `css<…>` on both.\n */\nexport const InputIconContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $type?: CompactTextInputType }>(applyDefaultTheme)`\n opacity: 0;\n pointer-events: none;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n padding: 5px 10px 0 0;\n transition: opacity 250ms;\n ${props =>\n props.theme.themeProp(\n 'background',\n css<{ $type?: CompactTextInputType }>`\n linear-gradient(-90deg,\n ${props =>\n props.$type === 'error'\n ? '#901d1d'\n : props.$type === 'warning'\n ? '#816600'\n : props.theme.getColor('gray-700')} 55%,\n transparent)\n `,\n css<{ $type?: CompactTextInputType }>`\n linear-gradient(-90deg,\n ${props =>\n props.$type === 'error'\n ? '#f7d5d0'\n : props.$type === 'warning'\n ? '#fffebf'\n : props.theme.getColor('gray-100')} 55%,\n transparent)\n `\n )};\n\n display: flex;\n align-items: center;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n color: ${props => props.theme.getColor('gray-400')};\n\n ${props => props.$type === 'warning' && props.theme.themeProp('color', '#C3AF43', '#C3AF43')}\n\n ${props => props.$type === 'error' && props.theme.themeProp('color', '#CB968F', '#CB968F')}\n\n > svg {\n width: 12px;\n transition: opacity 250ms;\n }\n`;\n\n/**\n * Props of `Input`. All members transient (filtered by shouldForwardProp).\n * DOM leak fixed: `$inputType` (was `inputtype` without $, on every rendered input).\n * `readOnly` and `disabled` absent intentionally: they're real InputHTMLAttributes members.\n */\ninterface InputStyleProps {\n /** `type` — see `CompactTextInputType`. Branched on 20 times below. */\n $type?: CompactTextInputType;\n /** `edit` — shows the editable-affordance background. */\n $edit?: boolean;\n /** `bold` — larger font-size/weight for the value. */\n $bold?: boolean;\n /** `!isEmpty(link)` — the component derives this, so `boolean`, not `link`'s type. */\n $haslink?: boolean;\n /**\n * `inputType` — the real `<input type>`, defaulted to `'text'` in the callback.\n * `string` because the propTypes say `PropTypes.string` and the value is handed\n * straight to the `type` attribute the callback produces.\n */\n $inputType?: string;\n}\n\n// Generic must be on .attrs<P>() not the template call — callback parameter is FastOmit<…, never> without it (measured).\nexport const Input = styled.input\n .withConfig({\n shouldForwardProp\n })\n .attrs<InputStyleProps>(props => ({\n ...applyDefaultTheme(props),\n type: props.$inputType || 'text'\n }))`\n box-sizing: border-box;\n height: 22px;\n width: 100%;\n display: block;\n font-size: 0.875rem;\n line-height: 1rem;\n font-family: inherit;\n padding: 1px 10px;\n border-radius: 3px;\n border: 1px solid transparent;\n transition: border-color 350ms, background 350ms;\n\n ${props => {\n if (props.$type === 'error') {\n return css`\n ${props.theme.themeProp('background', '#7f1b1b', '#FEE2E2')} !important;\n `;\n } else if (props.$type === 'warning') {\n return css`\n ${props.theme.themeProp('background', '#634E01', '#FFFDE8')} !important;\n `;\n } else {\n return props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n );\n }\n }}\n\n ${props =>\n props.readOnly &&\n css`\n cursor: default;\n `}\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n `}\n\n\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n\n ${props =>\n props.$haslink &&\n css`\n &&:not(:focus),\n &&:read-only {\n ${linkColor}\n }\n &&:read-only {\n cursor: default;\n }\n `};\n\n &&:not(:hover):not(:focus) {\n ${props => {\n if (props.$edit) {\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#7f1b1b', '#FEE2E2');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#634E01', '#FFFDE8');\n } else {\n return props.theme.themeProp(\n 'background',\n 'rgba(39,39,42, 0.7)',\n 'rgba(244,244,245, 0.3)'\n );\n }\n }\n }}\n\n ${props =>\n props.$edit &&\n props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};\n \n ${props =>\n props.$haslink &&\n css`\n &&:not(:focus),\n &&:read-only {\n cursor: default;\n ${linkColor}\n }\n `}\n }\n\n &&:hover:not(:focus) {\n ${props => {\n if (props.readOnly) {\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#7f1b1b', '#FEE2E2');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#634E01', '#FFFDE8');\n }\n return readOnlyBackground;\n }\n\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#901d1d', '#F7D5D0');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#806403', '#FFFEBF');\n } else {\n return props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n );\n }\n }}\n\n ${props =>\n props.$edit &&\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )};\n\n ${props =>\n props.$haslink &&\n css`\n cursor: pointer;\n &&:read-only {\n background: none !important;\n cursor: default;\n }\n `}\n \n & + ${InputIconContainer} {\n opacity: 1;\n ${props =>\n props.$type === 'success' &&\n css`\n opacity: 0;\n `}\n }\n\n ${props =>\n props.disabled &&\n css`\n background: none !important;\n cursor: not-allowed;\n `}\n \n ${props =>\n props.disabled &&\n props.$haslink &&\n css`\n background: none !important;\n cursor: not-allowed !important;\n `}\n }\n\n &&:focus {\n outline: none;\n\n ${props => {\n if (props.readOnly) {\n if (props.$type === 'error') {\n return props.theme.themeProp('background', '#7f1b1b', '#FEE2E2');\n } else if (props.$type === 'warning') {\n return props.theme.themeProp('background', '#634E01', '#FFFDE8');\n }\n return readOnlyBackground;\n }\n\n if (props.$type === 'error') {\n return css`\n ${props.theme.themeProp('border-color', '#D83018', '#D83018')}\n ${props.theme.themeProp('background', 'white', 'white')}\n ${props.theme.themeProp('color', 'black', 'black')}\n `;\n } else if (props.$type === 'warning') {\n return css`\n ${props.theme.themeProp('border-color', '#F4E21E', '#F4E21E')}\n ${props.theme.themeProp('background', 'white', 'white')}\n ${props.theme.themeProp('color', 'black', 'black')}\n `;\n } else {\n return css`\n border-color: ${props.theme.getColor('gray-600')};\n ${props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-100')\n )}\n `;\n }\n }}\n }\n\n &&::placeholder {\n color: inherit;\n opacity: 0.6;\n }\n\n &&:hover::placeholder {\n ${props => {\n if (props.$type === 'warning') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n );\n } else if (props.$type === 'error') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n );\n }\n return '';\n }}\n }\n\n &&:focus::placeholder {\n ${props => {\n if (props.$type === 'warning') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-900'),\n props.theme.getColor('gray-900')\n );\n } else if (props.$type === 'error') {\n return props.theme.themeProp(\n 'color',\n props.theme.getColor('red-600'),\n props.theme.getColor('red-600')\n );\n }\n return '';\n }}\n }\n\n ${props =>\n props.$bold &&\n css`\n font-size: 1rem;\n font-weight: 500;\n line-height: 1.0625;\n padding-top: 3px;\n padding-bottom: 2px;\n `}\n`;\n\nexport const LinkPopoverContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${commonAnchorTagStyle}\n\n padding: 5px 8px;\n\n svg {\n width: 18px;\n margin-right: 8px;\n }\n`;\n\n// `disabled` declared because `linkColor` reads it (weak-type rule: needs ≥1 common member with AnchorHTMLAttributes). Never actually passed.\nexport const StyledLink = styled.a\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ disabled?: boolean }>(applyDefaultTheme)`\n ${commonAnchorTagStyle}\n ${linkColor}\n`;\n\nexport const ReadOnlyLinkContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${readOnlyBackground};\n border: 1px solid transparent;\n border-radius: 3px;\n padding: 0 10px 1px;\n`;\n"],"names":["linkColor","css","props","theme","themeProp","getColor","disabled","commonAnchorTagStyle","readOnlyBackground","shouldForwardProp","prop","startsWith","CompactTextInput","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","primaryFontFamily","Label","label","$disabled","InputContainer","$hasLabel","SuccessContainer","InputSuccessContainer","InputIconContainer","$type","Input","input","type","$inputType","readOnly","$haslink","$edit","$bold","LinkPopoverContainer","StyledLink","a","ReadOnlyLinkContainer"],"mappings":";;;AAQA,MAAMA,SAAS,GAAGC,GAAG,CAAA,CAAA,EAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EACjBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAEF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,a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