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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +34 -0
  2. package/build/data/Alert/Alert.js.map +1 -1
  3. package/build/data/Alert/Alert.styled.js.map +1 -1
  4. package/build/data/Badge/Badge.js.map +1 -1
  5. package/build/data/Badge/Badge.styled.js.map +1 -1
  6. package/build/data/Popover/Popover.js.map +1 -1
  7. package/build/data/Popover/Popover.styled.js.map +1 -1
  8. package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
  9. package/build/data/Tab/Tab.js.map +1 -1
  10. package/build/data/Tab/Tab.styled.js.map +1 -1
  11. package/build/data/Tabs/Tabs.js.map +1 -1
  12. package/build/data/Tabs/Tabs.styled.js.map +1 -1
  13. package/build/data/Tooltip/Tooltip.js.map +1 -1
  14. package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
  15. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
  16. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
  17. package/build/data/_shared/FloatingArrow.styled.js.map +1 -1
  18. package/build/hooks/useEventListner.js.map +1 -1
  19. package/build/hooks/useFloatingPopover.js.map +1 -1
  20. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  21. package/build/hooks/useOnClickOutside.js.map +1 -1
  22. package/build/hooks/useTooltipAutoShow.js.map +1 -1
  23. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  24. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  25. package/build/inputs/Button/Button.js.map +1 -1
  26. package/build/inputs/Button/Button.styled.js.map +1 -1
  27. package/build/inputs/Checkbox/Checkbox.js.map +1 -1
  28. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
  29. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
  30. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
  31. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
  32. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
  33. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  34. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  35. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
  36. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
  37. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
  38. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
  39. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
  40. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  41. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  42. package/build/inputs/Radio/Radio.js.map +1 -1
  43. package/build/inputs/Radio/Radio.styled.js.map +1 -1
  44. package/build/inputs/Switch/Switch.styled.js.map +1 -1
  45. package/build/inputs/TextArea/TextArea.js.map +1 -1
  46. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  47. package/build/inputs/TextInput/TextInput.js.map +1 -1
  48. package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
  49. package/build/layout/InputGroup/InputGroup.js.map +1 -1
  50. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
  51. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
  52. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
  53. package/build/styles/utils/colors-export.d.ts +6 -25
  54. package/build/utils/dateTime.js.map +1 -1
  55. package/build/utils/defaultTheme.js.map +1 -1
  56. package/build/utils/getElementRef.js.map +1 -1
  57. package/build/utils/parseTrigger.js.map +1 -1
  58. package/build/widgets/AssetAction/AssetAction.js.map +1 -1
  59. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
  60. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
  61. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
  62. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
  63. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
  64. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
  65. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  66. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  67. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  68. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  69. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
  70. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
  71. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
  72. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
  73. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
  74. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
  75. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
  76. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
  77. package/build/widgets/InfoCard/InfoCard.js.map +1 -1
  78. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
  79. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
  80. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
  81. package/build/widgets/Instructions/Instructions.js.map +1 -1
  82. package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
  83. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
  84. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
  85. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
  86. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
  87. package/package.json +8 -1
  88. package/styles/utils/colors-export.d.ts +6 -25
  89. package/types/components/data/Alert/Alert.styled.d.ts +6 -37
  90. package/types/components/data/Badge/Badge.d.ts +1 -9
  91. package/types/components/data/Badge/Badge.styled.d.ts +0 -99
  92. package/types/components/data/Popover/Popover.d.ts +11 -100
  93. package/types/components/data/Tab/Tab.d.ts +1 -14
  94. package/types/components/data/Tabs/Tabs.styled.d.ts +1 -17
  95. package/types/components/data/Tooltip/Tooltip.d.ts +4 -50
  96. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +3 -22
  97. package/types/components/data/_shared/FloatingArrow.styled.d.ts +1 -101
  98. package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +2 -20
  99. package/types/components/inputs/Button/Button.styled.d.ts +0 -42
  100. package/types/components/inputs/Checkbox/Checkbox.d.ts +0 -9
  101. package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +6 -10
  102. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +4 -57
  103. package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +3 -55
  104. package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +4 -32
  105. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +2 -10
  106. package/types/components/inputs/MultiLevelCheckbox/types.d.ts +3 -46
  107. package/types/components/inputs/MultiSelect/MultiSelect.d.ts +0 -57
  108. package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +0 -65
  109. package/types/components/inputs/Radio/Radio.styled.d.ts +3 -3
  110. package/types/components/inputs/Switch/Switch.styled.d.ts +3 -7
  111. package/types/components/inputs/TextArea/TextArea.d.ts +0 -4
  112. package/types/components/inputs/TextArea/TextArea.styled.d.ts +5 -7
  113. package/types/components/inputs/TextInput/TextInput.styled.d.ts +1 -1
  114. package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +2 -9
  115. package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +2 -7
  116. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +0 -12
  117. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +7 -55
  118. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +7 -43
  119. package/types/components/widgets/AssetGallery/asset.types.d.ts +31 -148
  120. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +6 -20
  121. package/types/components/widgets/ContextMenu/ContextMenu.d.ts +1 -17
  122. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +5 -13
  123. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +0 -18
  124. package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +2 -19
  125. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +9 -19
  126. package/types/components/widgets/Instructions/Instructions.styled.d.ts +2 -14
  127. package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +6 -43
  128. package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +7 -46
  129. package/types/hooks/useElementSize.d.ts +3 -14
  130. package/types/hooks/useEventListner.d.ts +6 -38
  131. package/types/hooks/useFloatingPopover.d.ts +9 -90
  132. package/types/hooks/useIsomorphicLayoutEffect.d.ts +0 -23
  133. package/types/hooks/useOnClickOutside.d.ts +5 -23
  134. package/types/hooks/useTooltipAutoShow.d.ts +8 -57
  135. package/types/styles/utils/colors-export.d.ts +6 -25
  136. package/types/utils/dateTime.d.ts +2 -7
  137. package/types/utils/defaultTheme.d.ts +13 -92
  138. package/types/utils/getElementRef.d.ts +0 -19
  139. package/types/utils/parseTrigger.d.ts +8 -78
@@ -1 +1 @@
1
- {"version":3,"file":"AssetGalleryGridCard.js","sources":["../../../../../src/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.tsx"],"sourcesContent":["import { get, isEmpty, isFunction, mapKeys, omit } from 'lodash';\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport {\n LazyLoadComponent,\n LazyLoadImage,\n trackWindowScroll\n} from 'react-lazy-load-image-component';\nimport { HeadsetIcon, LayersIcon, PlayIcon } from '../../../../../icons';\nimport { convertMsToHMS } from '../../../../../utils/dateTime';\nimport { Badge, Popover, Tooltip } from '../../../../data';\nimport { ActionButton, Checkbox } from '../../../../inputs';\nimport ContextMenu from '../../../ContextMenu/ContextMenu';\nimport ContextMenuItem from '../../../ContextMenu/ContextMenuItem/ContextMenuItem';\nimport type { AssetWithLayout } from '../../asset.types';\nimport type { AssetAction, AssetSubAction } from '../../asset.types';\nimport * as S from './AssetGalleryGridCard.styled';\nimport InstructionSeverityDisplay from '../../../InstructionSeverityDisplay';\n\n/**\n >>> Section 1: renderThumbnail():\n┌─────────────────────────────────────────┐ ← S.AssetGalleryGridCard (Root)\n│[renderversionsBadge] [severityIcon]│ ← S.HorizontalBar (Top)\n├─────────────────────────────────────────┤\n│ │ │ │\n│ (spacer) │ [renderPreview]│ [action]│ ← S.ThumbnailRow (Inc. ComputedActionButton)\n│ │ │ [action]│ ← S.ActionsContainer\n│ │ │ │\n├─────────────────────────────────────────┤\n│ [renderMediaBadge] │ ← S.HorizontalBar (Bottom)\n├─────────────────────────────────────────┤\n│ | >>> Section 2: renderDetails():\n│ [asset.title] │ ← S.CardTitle\n│ [asset.description] │ ← S.CardDescription\n├─────────────────────────────────────────┤\n│ [InstructionSeverityDisplay] │ ← S.InstructionsWrapper\n| |\n| | >>> Section 3:renderConsentSummaryInfo():\n├─────────────────────────────────────────┤ ← S.CardDivider\n│ [footerLeft] [footerRight] │ ← S.CardFooter\n├─────────────────────────────────────────┤ ← S.CardDivider\n| |\n│ | >>> Section 4:renderCheckboxRow():\n│ [CheckRectangleIcon / Outline] │ ← S.CheckboxRow\n└─────────────────────────────────────────┘\n Approx Height: 536px (Updated severity card takes more space than XD Design)\n Note: Every block renders ALWAYS to maintain same height+alignment in gallery\n */\n\n// eslint-disable-next-line react/prop-types\nconst ComputedRootComponent = ({ component, asset, ...props }) => {\n // Omit props we don't need\n const newProps = mapKeys(\n omit(props, [\n 'theme',\n 'extendedSelectMode',\n 'softSelected',\n '$softSelected',\n 'customSelectedBorder',\n '$customSelectedBorder',\n 'isCardHovered',\n '$isCardHovered',\n 'completed',\n '$hasError'\n ]),\n (_, key) => (key === 'innerRef' ? 'ref' : key)\n );\n\n if (component) {\n if (!isFunction(component)) throw Error('Expected a function in component-prop');\n\n if (React.isValidElement(component(asset, newProps.children))) {\n return React.cloneElement(component(asset, newProps.children), omit(newProps, ['children']));\n }\n }\n\n const { ref, ...rest } = newProps;\n return <div ref={ref} {...rest} />;\n};\n\n/*\n * HAND-WRITTEN, because no codemod could produce it: this component never had\n * propTypes at all (hence the `eslint-disable react/prop-types` below), so\n * `reactPropsPlugin` had nothing to read and left the props `{}` — which under\n * `@types/react` 19 is 11 x TS2339 plus a TS2322 at the one call site.\n *\n * The shape is NOT invented. Every member is read out of `asset.actions[]` at the call\n * site ~380 lines below, so the source of truth is `AssetAction` in `asset.types.ts` and\n * these members are its members. `icon` and `onClick` are deliberately left on the rest\n * object rather than destructured, because the body reads them as `newProps.icon` /\n * `newProps.onClick` and forwards the remainder; declaring them keeps that legal without\n * changing which props flow where.\n */\ntype ComputedActionButtonProps = {\n /** `AssetAction.component` — an escape hatch that replaces the rendered button. */\n component?: AssetAction['component'];\n className?: AssetAction['className'];\n /** Non-empty turns the button into a `Popover` of `ContextMenuItem`s. */\n subActions?: AssetSubAction[];\n /** Controls the sublevel `Popover`'s `visible`; owned by the parent card. */\n isSubActionsOpened?: boolean;\n /** Told when the sublevel `Popover` closes itself; required because it is controlled. */\n onSubActionsClose?: () => void;\n icon?: AssetAction['icon'];\n /** Wrapped by the card as `event => onActionClick(event, action, index)`. */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n actionWidthHeight?: AssetAction['actionWidthHeight'];\n children?: React.ReactNode;\n};\n\nconst ComputedActionButton = React.forwardRef<unknown, ComputedActionButtonProps>(\n function ComputedActionButton(\n { component, className, subActions = [], isSubActionsOpened, onSubActionsClose, ...props },\n forwardedRef\n ) {\n const newProps = props;\n if (!isEmpty(subActions)) {\n const contextMenuItems = subActions.map((subAction, key) => {\n const { onClick, title, icon } = subAction;\n return <ContextMenuItem key={key} onClickEffect={onClick} title={title} icon={icon} />;\n });\n const contextMenu = <ContextMenu>{contextMenuItems}</ContextMenu>;\n newProps.children = (\n /*\n * `onHide` is load-bearing: `visible` makes this controlled, so the popover cannot\n * close itself — `setOpen` only reports through `onOpenChange`. Without this,\n * clicking a `ContextMenuItem` ran its `onClickEffect` and left the menu on screen.\n * tippy closed it imperatively via `_tippy.hide()`, which controlled mode cannot do.\n */\n <Popover\n contextMenu={true}\n content={contextMenu}\n placement={'bottom-end'}\n visible={isSubActionsOpened}\n onHide={onSubActionsClose}\n zIndex={10001}\n offset={[0, -8]}\n >\n <ActionButton\n useShadow={false}\n active={true}\n ref={forwardedRef}\n className={className}\n icon={newProps.icon}\n backgroundColors={['black', 'white']}\n onClick={newProps.onClick}\n actionWidthHeight={[40, 40]}\n />\n </Popover>\n );\n } else {\n newProps.children = (\n <ActionButton\n useShadow={false}\n active={true}\n ref={forwardedRef}\n className={className}\n icon={newProps.icon}\n onClick={newProps.onClick}\n backgroundColors={['black', 'white']}\n actionWidthHeight={[40, 40]}\n />\n );\n }\n\n if (component) {\n if (!isFunction(component)) throw Error('Expected a function in component-prop');\n\n if (React.isValidElement(component())) {\n return React.cloneElement(component(), { ...omit(newProps, 'icon') });\n }\n }\n\n return <React.Fragment>{newProps.children}</React.Fragment>;\n }\n);\n\ntype AssetGalleryGridCardProps = {\n /**\n * An array of assets to display in the gallery.\n */\n asset: AssetWithLayout;\n /**\n * Whether or not the asset gallery should have selectable asset cards\n */\n selectable?: boolean;\n /**\n * Is the asset selected\n */\n selected?: boolean;\n /**\n * Whether or not the asset gallery should have custom borders on selected asset\n */\n customSelectedBorder?: string[];\n /**\n * Makes the whole asset card into a selectable area\n */\n extendedSelectMode?: boolean;\n /**\n * The callback function when an asset is selected - returns the selected asset key\n */\n onAssetSelected: (...args: any[]) => any;\n /**\n * The callback function when an asset is unselected - returns the unselected asset key\n */\n onAssetUnselected: (...args: any[]) => any;\n /**\n * Is the asset soft selected\n */\n softSelected: boolean;\n /**\n * A function that returns a custom component to use for the card in the gallery - The function provides\n * `asset` as its first argument\n */\n component?: (...args: any[]) => any;\n /**\n * Internal prop used by the gallery to determine if the card is in the viewport - This prop is\n * not intended to be used by consumers\n */\n scrollPosition?: number;\n /**\n * When true, hides the consent summary footer (CardFooter + CardDivider). Default: false.\n */\n hideConsentSummary?: boolean;\n};\n\nconst AssetGalleryGridCard = (props: AssetGalleryGridCardProps) => {\n const {\n asset,\n selectable,\n selected,\n customSelectedBorder,\n extendedSelectMode,\n onAssetSelected,\n onAssetUnselected,\n softSelected,\n component,\n scrollPosition,\n hideConsentSummary\n } = props;\n\n const [isCardHovered, setIsCardHovered] = React.useState(false);\n const [openedSubActions, updateOpenedSubActions] = React.useState([]);\n useEffect(() => {\n const newOpenedSubActions = (asset?.actions ?? []).map(() => false);\n updateOpenedSubActions(newOpenedSubActions);\n }, [asset]);\n\n useEffect(() => {\n if (!isCardHovered && openedSubActions?.length) {\n updateOpenedSubActions(openedSubActions.map(() => false));\n }\n }, [isCardHovered]);\n\n const mouseHasEnteredCard = useCallback(() => {\n setIsCardHovered(true);\n }, []);\n\n const mouseHasLeftCard = useCallback(() => {\n setIsCardHovered(false);\n }, []);\n\n const onSubActionsViewToggle = useCallback(\n actionIndex => {\n const newOpenedSubActions = openedSubActions.map((isOpened, index) => {\n if (index !== actionIndex) {\n return false;\n }\n return !isOpened;\n });\n updateOpenedSubActions(newOpenedSubActions);\n },\n [openedSubActions]\n );\n\n /*\n * The counterpart to `onSubActionsViewToggle`: the controlled popover reporting that it\n * closed itself (item click, Escape, outside press), turned back into state. Functional\n * update so the callback does not depend on `openedSubActions`.\n */\n const onSubActionsClose = useCallback(actionIndex => {\n updateOpenedSubActions(current =>\n current.map((isOpened, index) => (index === actionIndex ? false : isOpened))\n );\n }, []);\n\n const videoPlayerRef = useRef(undefined);\n const cardRef = useRef(undefined);\n const dragRef = useRef(null);\n\n function onMouseEnter(event) {\n if (videoPlayerRef.current) {\n const playPromise = videoPlayerRef.current.play();\n if (playPromise !== undefined) {\n playPromise\n .then(() => {\n // Playback started!\n })\n .catch(() => {\n // Play was prevented - silently swallow play errors\n });\n }\n }\n\n if (isFunction(asset.onMouseEnter)) {\n asset.onMouseEnter(event, asset);\n }\n\n mouseHasEnteredCard();\n }\n\n function onMouseLeave() {\n if (videoPlayerRef.current) {\n videoPlayerRef.current.pause();\n }\n\n mouseHasLeftCard();\n }\n\n function onClick(event) {\n if (extendedSelectMode) {\n return onSelectClick(event);\n }\n\n if (isFunction(asset.onClick)) {\n asset.onClick(event, asset);\n }\n }\n\n function onSelectClick(event) {\n event.preventDefault();\n event.stopPropagation();\n\n if (selected) {\n return onAssetUnselected(asset.key);\n }\n\n return onAssetSelected(asset.key);\n }\n\n const onActionClick = useCallback(\n (event, action, index) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (isFunction(action?.onClick)) {\n action.onClick(asset);\n }\n\n if (!isEmpty(action?.subActions)) {\n onSubActionsViewToggle(index);\n }\n },\n [onSubActionsViewToggle]\n );\n\n const shouldOpenSubActions = useCallback(\n actionIndex => openedSubActions[actionIndex],\n [openedSubActions]\n );\n\n function onContextMenu(event) {\n event.preventDefault();\n asset.onContextMenu(event);\n }\n\n function renderPreview(asset) {\n let previewContent = null;\n\n if (asset.fileType?.toLowerCase() === 'video') {\n previewContent = (\n <LazyLoadComponent scrollPosition={scrollPosition}>\n <video ref={videoPlayerRef} loop muted>\n <source src={asset.previewUrl} type=\"video/mp4\" />\n </video>\n </LazyLoadComponent>\n );\n } else if (asset.fileType?.toLowerCase() === 'audio') {\n previewContent = (\n <LazyLoadComponent scrollPosition={scrollPosition}>\n <div className=\"audio\">\n <HeadsetIcon />\n </div>\n </LazyLoadComponent>\n );\n } else {\n previewContent = (\n <LazyLoadImage\n alt={asset.title}\n src={asset.previewUrl}\n height=\"100%\"\n width=\"100%\"\n delayMethod=\"debounce\"\n delayTime={0}\n threshold={1500}\n scrollPosition={scrollPosition}\n />\n );\n }\n\n return previewContent;\n }\n\n useEffect(() => {\n if (isFunction(asset.onContextMenu)) {\n if (cardRef.current) {\n cardRef.current.addEventListener('contextmenu', onContextMenu);\n }\n return () => {\n if (cardRef.current) {\n cardRef.current.removeEventListener('contextmenu', onContextMenu);\n }\n };\n }\n }, []);\n\n function onDragstart(event) {\n asset.onDragstart(event);\n }\n\n useEffect(() => {\n if (isFunction(asset.onDragstart)) {\n if (dragRef.current) {\n dragRef.current.addEventListener('dragstart', onDragstart);\n }\n return () => {\n if (dragRef.current) {\n dragRef.current.removeEventListener('dragstart', onDragstart);\n }\n };\n }\n }, []);\n\n // If this asset is soft selected we will scroll it into the viewport if it's outside\n useEffect(() => {\n if (softSelected) {\n cardRef.current.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }, [softSelected]);\n\n const renderVersionsBadge = useCallback(() => {\n if (!asset?.versions) return null;\n\n return (\n <Badge\n badgeIcon={<LayersIcon />}\n badgeContent={asset.versions}\n backgroundColors={['black', 'black']}\n colors={['#f7f8f9', '#f7f8f9']}\n fontSize={12}\n fontWeight={500}\n lineHeight={16}\n verticalPadding={4}\n horizontalPadding={8}\n />\n );\n }, [asset]);\n\n const renderMediaBadge = useCallback(() => {\n let badgeIcon = null;\n let badgeContent = null;\n\n if (asset?.fileType === 'video') {\n badgeIcon = <PlayIcon />;\n }\n\n if (asset?.duration) {\n badgeContent = convertMsToHMS(asset.duration);\n }\n\n if (!badgeIcon && !badgeContent) return null;\n return (\n <Badge\n badgeIcon={badgeIcon}\n badgeContent={badgeContent}\n backgroundColors={['black', 'black']}\n colors={['#f7f8f9', '#f7f8f9']}\n fontSize={12}\n fontWeight={500}\n lineHeight={16}\n verticalPadding={4}\n horizontalPadding={8}\n minWidth={32}\n height={24}\n />\n );\n }, [asset]);\n\n const renderThumbnail = () => {\n return (\n <S.ThumbnailSection>\n <S.ThumbnailSelectedOverlay selected={selected} />\n {asset.overlay && <S.ConsumerOverlay>{asset.overlay}</S.ConsumerOverlay>}\n {/* Thumbnail Top bar */}\n <S.HorizontalBar>\n <S.HorizontalBarLeft>{renderVersionsBadge()}</S.HorizontalBarLeft>\n <S.HorizontalBarRight>\n {asset.statusIcon && <S.StatusIconCircle>{asset.statusIcon}</S.StatusIconCircle>}\n </S.HorizontalBarRight>\n </S.HorizontalBar>\n <S.ThumbnailRow>\n <S.ThumbnailSpacer />\n {/* Thumbnail */}\n <S.ThumbnailWrapper>\n <S.ThumbnailBox>{renderPreview(asset)}</S.ThumbnailBox>\n </S.ThumbnailWrapper>\n <S.ThumbnailActions>\n <S.ActionsContainer>\n {!extendedSelectMode &&\n (asset.actions ?? []).map((action, index) => (\n <Tooltip key={`${asset.key}-${action.title}`} content={action.title}>\n <S.Action>\n <ComputedActionButton\n component={action.component}\n className={action.className}\n icon={action.icon}\n isSubActionsOpened={shouldOpenSubActions(index)}\n onSubActionsClose={() => onSubActionsClose(index)}\n onClick={event => onActionClick(event, action, index)}\n subActions={action?.subActions}\n actionWidthHeight={action.actionWidthHeight}\n />\n </S.Action>\n </Tooltip>\n ))}\n </S.ActionsContainer>\n </S.ThumbnailActions>\n </S.ThumbnailRow>\n {/* Thumbnail Bottom bar */}\n <S.HorizontalBar>\n <S.HorizontalBarLeft></S.HorizontalBarLeft>\n <S.HorizontalBarRight>{renderMediaBadge()}</S.HorizontalBarRight>\n </S.HorizontalBar>\n </S.ThumbnailSection>\n );\n };\n\n const renderDetails = () => {\n return (\n <S.CardBody>\n <S.CardTitle title={asset.title || ''}>{asset.title || ''}</S.CardTitle>\n <S.CardDescription title={asset.description || ''}>\n {asset.description || ''}\n </S.CardDescription>\n <S.InstructionsWrapper $hasContent={Boolean(asset.imageRights?.toString().trim())}>\n {asset.imageRights && (\n <InstructionSeverityDisplay\n labels={asset.instructionLabels}\n instructionText={asset.imageRights}\n severity={asset.instructionSeverity}\n showCard={false}\n padding=\"16px\"\n detailsFontSize=\"12px\"\n bgLight=\"transparent\"\n bgDark=\"transparent\"\n maxLines={2}\n />\n )}\n </S.InstructionsWrapper>\n </S.CardBody>\n );\n };\n\n const renderConsentSummaryInfo = () => {\n if (hideConsentSummary) {\n return <S.CardDivider />;\n }\n return (\n <>\n <S.CardFooter>\n <S.CardFooterLeft>{asset.summary?.footerLeft || null}</S.CardFooterLeft>\n <S.CardFooterRight>{asset.summary?.footerRight || null}</S.CardFooterRight>\n </S.CardFooter>\n <S.CardDivider />\n </>\n );\n };\n\n const renderCheckboxRow = () => {\n return (\n <S.CheckboxRow>\n {selectable && (\n <div onClick={onSelectClick}>\n <Checkbox\n variant=\"black\"\n checked={selected}\n onChange={event => {\n if (event.target.checked) {\n onAssetSelected(asset.key);\n } else {\n onAssetUnselected(asset.key);\n }\n }}\n />\n </div>\n )}\n </S.CheckboxRow>\n );\n };\n\n return (\n <S.AssetGalleryWrapper disabled={asset.disabled} ref={cardRef}>\n <S.AssetGalleryGridCard\n as={ComputedRootComponent}\n component={component}\n asset={asset}\n disabled={asset.disabled}\n onClick={onClick}\n extendedSelectMode={extendedSelectMode}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n draggable={asset.draggable}\n innerRef={dragRef}\n selected={selected}\n $softSelected={softSelected}\n completed={asset?.completed}\n $hasError={asset?.hasError}\n $customSelectedBorder={customSelectedBorder}\n >\n {renderThumbnail()}\n {renderDetails()}\n {renderConsentSummaryInfo()}\n {renderCheckboxRow()}\n </S.AssetGalleryGridCard>\n </S.AssetGalleryWrapper>\n );\n};\n\nexport default trackWindowScroll(\n React.memo(AssetGalleryGridCard, (prevProps, nextProps) => {\n // The asset card will only re-render if any of the following props change.\n const reactiveProps = [\n 'selectable',\n 'selected',\n 'extendedSelectMode',\n 'softSelected',\n 'asset.previewUrl',\n 'asset.overlay',\n 'asset.statusIcon',\n 'asset.layout',\n 'asset.imageRights',\n 'asset.instructionSeverity',\n 'asset.description',\n 'asset.title'\n ];\n\n return reactiveProps.every(propKey => get(prevProps, propKey) === get(nextProps, propKey));\n })\n);\n"],"names":["ComputedRootComponent","component","asset","props","newProps","mapKeys","omit","_","key","isFunction","Error","React","isValidElement","children","cloneElement","ref","rest","_jsx","ComputedActionButton","forwardRef","className","subActions","isSubActionsOpened","onSubActionsClose","forwardedRef","isEmpty","contextMenuItems","map","subAction","onClick","title","icon","ContextMenuItem","onClickEffect","contextMenu","ContextMenu","Popover","content","placement","visible","onHide","zIndex","offset","ActionButton","useShadow","active","backgroundColors","actionWidthHeight","Fragment","AssetGalleryGridCard","selectable","selected","customSelectedBorder","extendedSelectMode","onAssetSelected","onAssetUnselected","softSelected","scrollPosition","hideConsentSummary","isCardHovered","setIsCardHovered","useState","openedSubActions","updateOpenedSubActions","useEffect","newOpenedSubActions","actions","length","mouseHasEnteredCard","useCallback","mouseHasLeftCard","onSubActionsViewToggle","actionIndex","isOpened","index","current","videoPlayerRef","useRef","undefined","cardRef","dragRef","onMouseEnter","event","playPromise","play","then","catch","onMouseLeave","pause","onSelectClick","preventDefault","stopPropagation","onActionClick","action","shouldOpenSubActions","onContextMenu","renderPreview","previewContent","fileType","toLowerCase","LazyLoadComponent","loop","muted","src","previewUrl","type","HeadsetIcon","LazyLoadImage","alt","height","width","delayMethod","delayTime","threshold","addEventListener","removeEventListener","onDragstart","scrollIntoView","behavior","block","renderVersionsBadge","versions","Badge","badgeIcon","LayersIcon","badgeContent","colors","fontSize","fontWeight","lineHeight","verticalPadding","horizontalPadding","renderMediaBadge","PlayIcon","duration","convertMsToHMS","minWidth","renderThumbnail","_jsxs","S","overlay","statusIcon","Tooltip","renderDetails","description","$hasContent","Boolean","imageRights","toString","trim","InstructionSeverityDisplay","labels","instructionLabels","instructionText","severity","instructionSeverity","showCard","padding","detailsFontSize","bgLight","bgDark","maxLines","renderConsentSummaryInfo","_Fragment","summary","footerLeft","footerRight","renderCheckboxRow","Checkbox","variant","checked","onChange","target","disabled","as","draggable","innerRef","$softSelected","completed","$hasError","hasError","$customSelectedBorder","trackWindowScroll","memo","prevProps","nextProps","reactiveProps","every","propKey","get"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAMA,qBAAqB,GAAGA,CAAC;EAAEC,SAAS;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;AAEhE,EAAA,MAAMC,QAAQ,GAAGC,OAAO,CACtBC,IAAI,CAACH,KAAK,EAAE,CACV,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,CACZ,CAAC,EACF,CAACI,CAAC,EAAEC,GAAG,KAAMA,GAAG,KAAK,UAAU,GAAG,KAAK,GAAGA,GAC5C,CAAC;AAED,EAAA,IAAIP,SAAS,EAAE;IACb,IAAI,CAACQ,UAAU,CAACR,SAAS,CAAC,EAAE,MAAMS,KAAK,CAAC,uCAAuC,CAAC;AAEhF,IAAA,IAAIC,cAAK,CAACC,cAAc,CAACX,SAAS,CAACC,KAAK,EAAEE,QAAQ,CAACS,QAAQ,CAAC,CAAC,EAAE;MAC7D,OAAOF,cAAK,CAACG,YAAY,CAACb,SAAS,CAACC,KAAK,EAAEE,QAAQ,CAACS,QAAQ,CAAC,E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ACpB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,CACd;AAED,EAAA,OAAOA,aAAa,CAACC,KAAK,CAACC,OAAO,IAAIC,GAAG,CAACL,SAAS,EAAEI,OAAO,CAAC,KAAKC,GAAG,CAACJ,SAAS,EAAEG,OAAO,CAAC,CAAC;AAC5F,CAAC,CACH,CAAC;;;;"}
1
+ {"version":3,"file":"AssetGalleryGridCard.js","sources":["../../../../../src/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.tsx"],"sourcesContent":["import { get, isEmpty, isFunction, mapKeys, omit } from 'lodash';\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport {\n LazyLoadComponent,\n LazyLoadImage,\n trackWindowScroll\n} from 'react-lazy-load-image-component';\nimport { HeadsetIcon, LayersIcon, PlayIcon } from '../../../../../icons';\nimport { convertMsToHMS } from '../../../../../utils/dateTime';\nimport { Badge, Popover, Tooltip } from '../../../../data';\nimport { ActionButton, Checkbox } from '../../../../inputs';\nimport ContextMenu from '../../../ContextMenu/ContextMenu';\nimport ContextMenuItem from '../../../ContextMenu/ContextMenuItem/ContextMenuItem';\nimport type { AssetWithLayout } from '../../asset.types';\nimport type { AssetAction, AssetSubAction } from '../../asset.types';\nimport * as S from './AssetGalleryGridCard.styled';\nimport InstructionSeverityDisplay from '../../../InstructionSeverityDisplay';\n\n// eslint-disable-next-line react/prop-types\nconst ComputedRootComponent = ({ component, asset, ...props }) => {\n // Omit props we don't need\n const newProps = mapKeys(\n omit(props, [\n 'theme',\n 'extendedSelectMode',\n 'softSelected',\n '$softSelected',\n 'customSelectedBorder',\n '$customSelectedBorder',\n 'isCardHovered',\n '$isCardHovered',\n 'completed',\n '$hasError'\n ]),\n (_, key) => (key === 'innerRef' ? 'ref' : key)\n );\n\n if (component) {\n if (!isFunction(component)) throw Error('Expected a function in component-prop');\n\n if (React.isValidElement(component(asset, newProps.children))) {\n return React.cloneElement(component(asset, newProps.children), omit(newProps, ['children']));\n }\n }\n\n const { ref, ...rest } = newProps;\n return <div ref={ref} {...rest} />;\n};\n\n/* Shape mirrors AssetAction; icon and onClick stay on the rest object for forwarding. */\ntype ComputedActionButtonProps = {\n /** `AssetAction.component` — an escape hatch that replaces the rendered button. */\n component?: AssetAction['component'];\n className?: AssetAction['className'];\n /** Non-empty turns the button into a `Popover` of `ContextMenuItem`s. */\n subActions?: AssetSubAction[];\n /** Controls the sublevel `Popover`'s `visible`; owned by the parent card. */\n isSubActionsOpened?: boolean;\n /** Told when the sublevel `Popover` closes itself; required because it is controlled. */\n onSubActionsClose?: () => void;\n icon?: AssetAction['icon'];\n /** Wrapped by the card as `event => onActionClick(event, action, index)`. */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n actionWidthHeight?: AssetAction['actionWidthHeight'];\n children?: React.ReactNode;\n};\n\nconst ComputedActionButton = React.forwardRef<unknown, ComputedActionButtonProps>(\n function ComputedActionButton(\n { component, className, subActions = [], isSubActionsOpened, onSubActionsClose, ...props },\n forwardedRef\n ) {\n const newProps = props;\n if (!isEmpty(subActions)) {\n const contextMenuItems = subActions.map((subAction, key) => {\n const { onClick, title, icon } = subAction;\n return <ContextMenuItem key={key} onClickEffect={onClick} title={title} icon={icon} />;\n });\n const contextMenu = <ContextMenu>{contextMenuItems}</ContextMenu>;\n newProps.children = (\n /* `onHide` closes the controlled Popover; without it, clicks would leave the menu on screen. */\n <Popover\n contextMenu={true}\n content={contextMenu}\n placement={'bottom-end'}\n visible={isSubActionsOpened}\n onHide={onSubActionsClose}\n zIndex={10001}\n offset={[0, -8]}\n >\n <ActionButton\n useShadow={false}\n active={true}\n ref={forwardedRef}\n className={className}\n icon={newProps.icon}\n backgroundColors={['black', 'white']}\n onClick={newProps.onClick}\n actionWidthHeight={[40, 40]}\n />\n </Popover>\n );\n } else {\n newProps.children = (\n <ActionButton\n useShadow={false}\n active={true}\n ref={forwardedRef}\n className={className}\n icon={newProps.icon}\n onClick={newProps.onClick}\n backgroundColors={['black', 'white']}\n actionWidthHeight={[40, 40]}\n />\n );\n }\n\n if (component) {\n if (!isFunction(component)) throw Error('Expected a function in component-prop');\n\n if (React.isValidElement(component())) {\n return React.cloneElement(component(), { ...omit(newProps, 'icon') });\n }\n }\n\n return <React.Fragment>{newProps.children}</React.Fragment>;\n }\n);\n\ntype AssetGalleryGridCardProps = {\n /**\n * An array of assets to display in the gallery.\n */\n asset: AssetWithLayout;\n /**\n * Whether or not the asset gallery should have selectable asset cards\n */\n selectable?: boolean;\n /**\n * Is the asset selected\n */\n selected?: boolean;\n /**\n * Whether or not the asset gallery should have custom borders on selected asset\n */\n customSelectedBorder?: string[];\n /**\n * Makes the whole asset card into a selectable area\n */\n extendedSelectMode?: boolean;\n /**\n * The callback function when an asset is selected - returns the selected asset key\n */\n onAssetSelected: (...args: any[]) => any;\n /**\n * The callback function when an asset is unselected - returns the unselected asset key\n */\n onAssetUnselected: (...args: any[]) => any;\n /**\n * Is the asset soft selected\n */\n softSelected: boolean;\n /**\n * A function that returns a custom component to use for the card in the gallery - The function provides\n * `asset` as its first argument\n */\n component?: (...args: any[]) => any;\n /**\n * Internal prop used by the gallery to determine if the card is in the viewport - This prop is\n * not intended to be used by consumers\n */\n scrollPosition?: number;\n /**\n * When true, hides the consent summary footer (CardFooter + CardDivider). Default: false.\n */\n hideConsentSummary?: boolean;\n};\n\nconst AssetGalleryGridCard = (props: AssetGalleryGridCardProps) => {\n const {\n asset,\n selectable,\n selected,\n customSelectedBorder,\n extendedSelectMode,\n onAssetSelected,\n onAssetUnselected,\n softSelected,\n component,\n scrollPosition,\n hideConsentSummary\n } = props;\n\n const [isCardHovered, setIsCardHovered] = React.useState(false);\n const [openedSubActions, updateOpenedSubActions] = React.useState([]);\n useEffect(() => {\n const newOpenedSubActions = (asset?.actions ?? []).map(() => false);\n updateOpenedSubActions(newOpenedSubActions);\n }, [asset]);\n\n useEffect(() => {\n if (!isCardHovered && openedSubActions?.length) {\n updateOpenedSubActions(openedSubActions.map(() => false));\n }\n }, [isCardHovered]);\n\n const mouseHasEnteredCard = useCallback(() => {\n setIsCardHovered(true);\n }, []);\n\n const mouseHasLeftCard = useCallback(() => {\n setIsCardHovered(false);\n }, []);\n\n const onSubActionsViewToggle = useCallback(\n actionIndex => {\n const newOpenedSubActions = openedSubActions.map((isOpened, index) => {\n if (index !== actionIndex) {\n return false;\n }\n return !isOpened;\n });\n updateOpenedSubActions(newOpenedSubActions);\n },\n [openedSubActions]\n );\n\n /*\n * The counterpart to `onSubActionsViewToggle`: the controlled popover reporting that it\n * closed itself (item click, Escape, outside press), turned back into state. Functional\n * update so the callback does not depend on `openedSubActions`.\n */\n const onSubActionsClose = useCallback(actionIndex => {\n updateOpenedSubActions(current =>\n current.map((isOpened, index) => (index === actionIndex ? false : isOpened))\n );\n }, []);\n\n const videoPlayerRef = useRef(undefined);\n const cardRef = useRef(undefined);\n const dragRef = useRef(null);\n\n function onMouseEnter(event) {\n if (videoPlayerRef.current) {\n const playPromise = videoPlayerRef.current.play();\n if (playPromise !== undefined) {\n playPromise\n .then(() => {\n // Playback started!\n })\n .catch(() => {\n // Play was prevented - silently swallow play errors\n });\n }\n }\n\n if (isFunction(asset.onMouseEnter)) {\n asset.onMouseEnter(event, asset);\n }\n\n mouseHasEnteredCard();\n }\n\n function onMouseLeave() {\n if (videoPlayerRef.current) {\n videoPlayerRef.current.pause();\n }\n\n mouseHasLeftCard();\n }\n\n function onClick(event) {\n if (extendedSelectMode) {\n return onSelectClick(event);\n }\n\n if (isFunction(asset.onClick)) {\n asset.onClick(event, asset);\n }\n }\n\n function onSelectClick(event) {\n event.preventDefault();\n event.stopPropagation();\n\n if (selected) {\n return onAssetUnselected(asset.key);\n }\n\n return onAssetSelected(asset.key);\n }\n\n const onActionClick = useCallback(\n (event, action, index) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (isFunction(action?.onClick)) {\n action.onClick(asset);\n }\n\n if (!isEmpty(action?.subActions)) {\n onSubActionsViewToggle(index);\n }\n },\n [onSubActionsViewToggle]\n );\n\n const shouldOpenSubActions = useCallback(\n actionIndex => openedSubActions[actionIndex],\n [openedSubActions]\n );\n\n function onContextMenu(event) {\n event.preventDefault();\n asset.onContextMenu(event);\n }\n\n function renderPreview(asset) {\n let previewContent = null;\n\n if (asset.fileType?.toLowerCase() === 'video') {\n previewContent = (\n <LazyLoadComponent scrollPosition={scrollPosition}>\n <video ref={videoPlayerRef} loop muted>\n <source src={asset.previewUrl} type=\"video/mp4\" />\n </video>\n </LazyLoadComponent>\n );\n } else if (asset.fileType?.toLowerCase() === 'audio') {\n previewContent = (\n <LazyLoadComponent scrollPosition={scrollPosition}>\n <div className=\"audio\">\n <HeadsetIcon />\n </div>\n </LazyLoadComponent>\n );\n } else {\n previewContent = (\n <LazyLoadImage\n alt={asset.title}\n src={asset.previewUrl}\n height=\"100%\"\n width=\"100%\"\n delayMethod=\"debounce\"\n delayTime={0}\n threshold={1500}\n scrollPosition={scrollPosition}\n />\n );\n }\n\n return previewContent;\n }\n\n useEffect(() => {\n if (isFunction(asset.onContextMenu)) {\n if (cardRef.current) {\n cardRef.current.addEventListener('contextmenu', onContextMenu);\n }\n return () => {\n if (cardRef.current) {\n cardRef.current.removeEventListener('contextmenu', onContextMenu);\n }\n };\n }\n }, []);\n\n function onDragstart(event) {\n asset.onDragstart(event);\n }\n\n useEffect(() => {\n if (isFunction(asset.onDragstart)) {\n if (dragRef.current) {\n dragRef.current.addEventListener('dragstart', onDragstart);\n }\n return () => {\n if (dragRef.current) {\n dragRef.current.removeEventListener('dragstart', onDragstart);\n }\n };\n }\n }, []);\n\n // If this asset is soft selected we will scroll it into the viewport if it's outside\n useEffect(() => {\n if (softSelected) {\n cardRef.current.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }, [softSelected]);\n\n const renderVersionsBadge = useCallback(() => {\n if (!asset?.versions) return null;\n\n return (\n <Badge\n badgeIcon={<LayersIcon />}\n badgeContent={asset.versions}\n backgroundColors={['black', 'black']}\n colors={['#f7f8f9', '#f7f8f9']}\n fontSize={12}\n fontWeight={500}\n lineHeight={16}\n verticalPadding={4}\n horizontalPadding={8}\n />\n );\n }, [asset]);\n\n const renderMediaBadge = useCallback(() => {\n let badgeIcon = null;\n let badgeContent = null;\n\n if (asset?.fileType === 'video') {\n badgeIcon = <PlayIcon />;\n }\n\n if (asset?.duration) {\n badgeContent = convertMsToHMS(asset.duration);\n }\n\n if (!badgeIcon && !badgeContent) return null;\n return (\n <Badge\n badgeIcon={badgeIcon}\n badgeContent={badgeContent}\n backgroundColors={['black', 'black']}\n colors={['#f7f8f9', '#f7f8f9']}\n fontSize={12}\n fontWeight={500}\n lineHeight={16}\n verticalPadding={4}\n horizontalPadding={8}\n minWidth={32}\n height={24}\n />\n );\n }, [asset]);\n\n const renderThumbnail = () => {\n return (\n <S.ThumbnailSection>\n <S.ThumbnailSelectedOverlay selected={selected} />\n {asset.overlay && <S.ConsumerOverlay>{asset.overlay}</S.ConsumerOverlay>}\n {/* Thumbnail Top bar */}\n <S.HorizontalBar>\n <S.HorizontalBarLeft>{renderVersionsBadge()}</S.HorizontalBarLeft>\n <S.HorizontalBarRight>\n {asset.statusIcon && <S.StatusIconCircle>{asset.statusIcon}</S.StatusIconCircle>}\n </S.HorizontalBarRight>\n </S.HorizontalBar>\n <S.ThumbnailRow>\n <S.ThumbnailSpacer />\n {/* Thumbnail */}\n <S.ThumbnailWrapper>\n <S.ThumbnailBox>{renderPreview(asset)}</S.ThumbnailBox>\n </S.ThumbnailWrapper>\n <S.ThumbnailActions>\n <S.ActionsContainer>\n {!extendedSelectMode &&\n (asset.actions ?? []).map((action, index) => (\n <Tooltip key={`${asset.key}-${action.title}`} content={action.title}>\n <S.Action>\n <ComputedActionButton\n component={action.component}\n className={action.className}\n icon={action.icon}\n isSubActionsOpened={shouldOpenSubActions(index)}\n onSubActionsClose={() => onSubActionsClose(index)}\n onClick={event => onActionClick(event, action, index)}\n subActions={action?.subActions}\n actionWidthHeight={action.actionWidthHeight}\n />\n </S.Action>\n </Tooltip>\n ))}\n </S.ActionsContainer>\n </S.ThumbnailActions>\n </S.ThumbnailRow>\n {/* Thumbnail Bottom bar */}\n <S.HorizontalBar>\n <S.HorizontalBarLeft></S.HorizontalBarLeft>\n <S.HorizontalBarRight>{renderMediaBadge()}</S.HorizontalBarRight>\n </S.HorizontalBar>\n </S.ThumbnailSection>\n );\n };\n\n const renderDetails = () => {\n return (\n <S.CardBody>\n <S.CardTitle title={asset.title || ''}>{asset.title || ''}</S.CardTitle>\n <S.CardDescription title={asset.description || ''}>\n {asset.description || ''}\n </S.CardDescription>\n <S.InstructionsWrapper $hasContent={Boolean(asset.imageRights?.toString().trim())}>\n {asset.imageRights && (\n <InstructionSeverityDisplay\n labels={asset.instructionLabels}\n instructionText={asset.imageRights}\n severity={asset.instructionSeverity}\n showCard={false}\n padding=\"16px\"\n detailsFontSize=\"12px\"\n bgLight=\"transparent\"\n bgDark=\"transparent\"\n maxLines={2}\n />\n )}\n </S.InstructionsWrapper>\n </S.CardBody>\n );\n };\n\n const renderConsentSummaryInfo = () => {\n if (hideConsentSummary) {\n return <S.CardDivider />;\n }\n return (\n <>\n <S.CardFooter>\n <S.CardFooterLeft>{asset.summary?.footerLeft || null}</S.CardFooterLeft>\n <S.CardFooterRight>{asset.summary?.footerRight || null}</S.CardFooterRight>\n </S.CardFooter>\n <S.CardDivider />\n </>\n );\n };\n\n const renderCheckboxRow = () => {\n return (\n <S.CheckboxRow>\n {selectable && (\n <div onClick={onSelectClick}>\n <Checkbox\n variant=\"black\"\n checked={selected}\n onChange={event => {\n if (event.target.checked) {\n onAssetSelected(asset.key);\n } else {\n onAssetUnselected(asset.key);\n }\n }}\n />\n </div>\n )}\n </S.CheckboxRow>\n );\n };\n\n return (\n <S.AssetGalleryWrapper disabled={asset.disabled} ref={cardRef}>\n <S.AssetGalleryGridCard\n as={ComputedRootComponent}\n component={component}\n asset={asset}\n disabled={asset.disabled}\n onClick={onClick}\n extendedSelectMode={extendedSelectMode}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n draggable={asset.draggable}\n innerRef={dragRef}\n selected={selected}\n $softSelected={softSelected}\n completed={asset?.completed}\n $hasError={asset?.hasError}\n $customSelectedBorder={customSelectedBorder}\n >\n {renderThumbnail()}\n {renderDetails()}\n {renderConsentSummaryInfo()}\n {renderCheckboxRow()}\n </S.AssetGalleryGridCard>\n </S.AssetGalleryWrapper>\n );\n};\n\nexport default trackWindowScroll(\n React.memo(AssetGalleryGridCard, (prevProps, nextProps) => {\n // The asset card will only re-render if any of the following props change.\n const reactiveProps = [\n 'selectable',\n 'selected',\n 'extendedSelectMode',\n 'softSelected',\n 'asset.previewUrl',\n 'asset.overlay',\n 'asset.statusIcon',\n 'asset.layout',\n 'asset.imageRights',\n 'asset.instructionSeverity',\n 'asset.description',\n 'asset.title'\n ];\n\n return reactiveProps.every(propKey => get(prevProps, propKey) === get(nextProps, propKey));\n })\n);\n"],"names":["ComputedRootComponent","component","asset","props","newProps","mapKeys","omit","_","key","isFunction","Error","React","isValidElement","children","cloneElement","ref","rest","_jsx","ComputedActionButton","forwardRef","className","subActions","isSubActionsOpened","onSubActionsClose","forwardedRef","isEmpty","contextMenuItems","map","subAction","onClick","title","icon","ContextMenuItem","onClickEffect","contextMenu","ContextMenu","Popover","content","placement","visible","onHide","zIndex","offset","ActionButton","useShadow","active","backgroundColors","actionWidthHeight","Fragment","AssetGalleryGridCard","selectable","selected","customSelectedBorder","extendedSelectMode","onAssetSelected","onAssetUnselected","softSelected","scrollPosition","hideConsentSummary","isCardHovered","setIsCardHovered","useState","openedSubActions","updateOpenedSubActions","useEffect","newOpenedSubActions","actions","length","mouseHasEnteredCard","useCallback","mouseHasLeftCard","onSubActionsViewToggle","actionIndex","isOpened","index","current","videoPlayerRef","useRef","undefined","cardRef","dragRef","onMouseEnter","event","playPromise","play","then","catch","onMouseLeave","pause","onSelectClick","preventDefault","stopPropagation","onActionClick","action","shouldOpenSubActions","onContextMenu","renderPreview","previewContent","fileType","toLowerCase","LazyLoadComponent","loop","muted","src","previewUrl","type","HeadsetIcon","LazyLoadImage","alt","height","width","delayMethod","delayTime","threshold","addEventListener","removeEventListener","onDragstart","scrollIntoView","behavior","block","renderVersionsBadge","versions","Badge","badgeIcon","LayersIcon","badgeContent","colors","fontSize","fontWeight","lineHeight","verticalPadding","horizontalPadding","renderMediaBadge","PlayIcon","duration","convertMsToHMS","minWidth","renderThumbnail","_jsxs","S","overlay","statusIcon","Tooltip","renderDetails","description","$hasContent","Boolean","imageRights","toString","trim","InstructionSeverityDisplay","labels","instructionLabels","instructionText","severity","instructionSeverity","showCard","padding","detailsFontSize","bgLight","bgDark","maxLines","renderConsentSummaryInfo","_Fragment","summary","footerLeft","footerRight","renderCheckboxRow","Checkbox","variant","checked","onChange","target","disabled","as","draggable","innerRef","$softSelected","completed","$hasError","hasError","$customSelectedBorder","trackWindowScroll","memo","prevProps","nextProps","reactiveProps","every","propKey","get"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,qBAAqB,GAAGA,CAAC;EAAEC,SAAS;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;AAEhE,EAAA,MAAMC,QAAQ,GAAGC,OAAO,CACtBC,IAAI,CAACH,KAAK,EAAE,CACV,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,CACZ,CAAC,EACF,CAACI,CAAC,EAAEC,GAAG,KAAMA,GAAG,KAAK,UAAU,GAAG,KAAK,GAAGA,GAC5C,CAAC;AAED,EAAA,IAAIP,SAAS,EAAE;IACb,IAAI,CAACQ,UAAU,CAACR,SAAS,CAAC,EAAE,MAAMS,KAAK,CAAC,uCAAuC,CAAC;AAEhF,IAAA,IAAIC,cAAK,CAACC,c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,6BAAee,iBAAiB,CAC9B3K,cAAK,CAAC4K,IAAI,CAACtI,oBAAoB,EAAE,CAACuI,SAAS,EAAEC,SAAS,KAAK;EAEzD,MAAMC,aAAa,GAAG,CACpB,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,CACd;AAED,EAAA,OAAOA,aAAa,CAACC,KAAK,CAACC,OAAO,IAAIC,GAAG,CAACL,SAAS,EAAEI,OAAO,CAAC,KAAKC,GAAG,CAACJ,SAAS,EAAEG,OAAO,CAAC,CAAC;AAC5F,CAAC,CACH,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssetGalleryGridCard.styled.js","sources":["../../../../../src/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.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 * TWO THINGS MAKE THIS FILE DIFFERENT FROM ITS COMPACT SIBLING:\n *\n * 1. `AssetGalleryGridCard` is an `.attrs(props => …)` CALLBACK with no `.withConfig()`\n * at all, so the generic MUST go on `.attrs<P>()`. Measured (§J.2): supplying it on\n * the tagged-template call instead leaves the callback parameter\n * `FastOmit<…, never>`, where the reads inside the callback have no fix but a\n * suppression. Five props are read in there, three of them through `ringState`.\n * 2. `ringState` is a module-scope FUNCTION, not a `css` helper — a fourth kind of\n * props-reading site. Unannotated its parameter is an implicit `any`, and because\n * `noImplicitAny` is off that is SILENT: the file would report zero errors while\n * five prop reads stayed unchecked. It gets an explicit parameter type and a closed\n * return union, which is what ties the six `&[data-ring=…]` selectors below to the\n * six values that can actually be produced.\n */\nimport { rgba } from 'polished';\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../../utils/defaultTheme';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\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 *\n * NOTE that `AssetGalleryGridCard` itself does NOT use this predicate — it has no\n * `.withConfig()` at all. Its prop filtering is styled-components v6 defaults plus\n * `ComputedRootComponent`'s own `omit` list, which is why the leak analysis on\n * `AssetGalleryGridCardStyleProps` above differs key by key.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nconst darkBorderColor = '#52525B';\nconst darkBgColor = '#27272A';\nconst darkHoverBgColor = '#3F3F46';\nconst lightHoverBgColor = '#E4E4E7';\n\nexport const AssetGalleryWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<Pick<AssetGalleryGridCardStyleProps, 'disabled'>>(applyDefaultTheme)`\n width: 100%;\n height: 100%;\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `};\n`;\n\n/**\n * The six values `ringState` can return, and therefore the six `data-ring` attribute\n * values the selectors below match. Closed on purpose: `&[data-ring='typo']` is not a type\n * error (it is inside a template string) but `ringState` returning one is, so the union is\n * where the two halves are kept honest.\n */\ntype AssetGalleryGridCardRingState = 'custom' | 'selected' | 'soft' | 'completed' | 'error' | 'idle';\n\n/**\n * What `ringState` reads. Also the reason the card root needs a generic at all: three of\n * these five are only ever read HERE, inside the `.attrs()` callback, not in the template.\n */\ninterface AssetGalleryGridCardRingProps {\n /**\n * `selected` — `PropTypes.bool`.\n *\n * NO `$`, AND THAT IS A DEFECT — but NOT a DOM leak. `ComputedRootComponent` spreads it\n * onto a plain `<div>` and React DROPS a boolean `selected` on any element that is not\n * an `<option>`, silently; `selected=` occurs zero times in\n * `scripts/r19-harness/baseline.json`. Prefixing it is still a behaviour change to\n * review on its own (C10, §E.4) — it just would not move the baseline.\n */\n selected?: boolean;\n /**\n * `asset.completed` — `PropTypes.bool`.\n *\n * NO `$`, AND THAT IS A DEFECT — and again not a DOM leak, for a different reason:\n * `ComputedRootComponent` explicitly `omit`s `completed`, and React would drop it\n * anyway (\"Received `true` for a non-boolean attribute `completed`\"). Measured both ways.\n */\n completed?: boolean;\n /** `softSelected` — `PropTypes.bool.isRequired` on the COMPONENT, optional here per §J.5. */\n $softSelected?: boolean;\n /** `asset.hasError` — `PropTypes.bool`. */\n $hasError?: boolean;\n /** `customSelectedBorder` — `PropTypes.arrayOf(PropTypes.string)`, read as\n * `[darkModeColor, lightModeColor]` and written into the `--ring-dark` / `--ring-light`\n * custom properties by the `.attrs()` callback. */\n $customSelectedBorder?: string[];\n}\n\n/**\n * The card root's props: everything `ringState` reads, plus the two the TEMPLATE reads.\n */\ninterface AssetGalleryGridCardStyleProps extends AssetGalleryGridCardRingProps {\n /**\n * `asset.disabled` — `PropTypes.bool`.\n *\n * NO `$`, AND THIS IS THE ONE THAT REALLY REACHES THE DOM. React recognises\n * `disabled` and renders it as a bare boolean attribute even on a `<div>`, so\n * `disabled=\"\"` is on both the wrapper and the card root in\n * `widgets/AssetGalleryGridCard#disabled` in the recorded baseline. Renaming it\n * `$disabled` REMOVES that attribute and therefore MOVES the baseline — C10, §E.4.\n */\n disabled?: boolean;\n /**\n * `extendedSelectMode` — `PropTypes.bool`. Makes the whole card a selectable area.\n *\n * NO `$`, AND THAT IS A DEFECT — not a DOM leak twice over: `ComputedRootComponent`\n * `omit`s it, and React drops an unrecognised camelCase prop whose value is `true`.\n */\n extendedSelectMode?: boolean;\n}\n\nconst ringState = (props: AssetGalleryGridCardRingProps): AssetGalleryGridCardRingState => {\n if (props.selected) return props.$customSelectedBorder ? 'custom' : 'selected';\n if (props.$softSelected) return 'soft';\n if (props.completed) return 'completed';\n if (props.$hasError) return 'error';\n return 'idle';\n};\n\nexport const AssetGalleryGridCard = styled.div.attrs<AssetGalleryGridCardStyleProps>(props => ({\n ...applyDefaultTheme(props),\n 'data-ring': ringState(props),\n style: {\n ...(props.style || {}),\n ...(props.$customSelectedBorder && props.selected\n ? {\n '--ring-dark': props.$customSelectedBorder[0],\n '--ring-light': props.$customSelectedBorder[1]\n }\n : {})\n }\n}))`\n display: block;\n position: relative;\n height: 100%;\n margin: 0;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n transition: box-shadow 220ms;\n overflow: hidden;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-700')\n )}\n\n ${props =>\n props.disabled &&\n css`\n pointer-events: none;\n opacity: 0.4;\n `};\n\n ${props =>\n props.extendedSelectMode &&\n css`\n cursor: pointer;\n `}\n\n &:hover {\n box-shadow: 0px 3px 6px #00000029;\n }\n\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 10;\n border-style: solid;\n border-width: 1px;\n }\n &[data-ring='soft']::after,\n &[data-ring='selected']::after,\n &[data-ring='custom']::after,\n &[data-ring='completed']::after,\n &[data-ring='error']::after {\n border-width: 3px;\n }\n\n ${props => {\n const gray100 = props.theme.getColor('gray-100');\n const gray300 = props.theme.getColor('gray-300');\n const gray700 = props.theme.getColor('gray-700');\n const emerald = props.theme.getColor('emerald-500');\n const red500 = props.theme.getColor('red-500');\n const red600 = props.theme.getColor('red-600');\n return css`\n &[data-ring='idle']::after {\n border-color: ${gray300};\n }\n &[data-ring='soft']::after {\n border-color: ${rgba(gray700, 0.5)};\n }\n &[data-ring='selected']::after {\n border-color: ${darkBorderColor};\n }\n &[data-ring='custom']::after {\n border-color: var(--ring-light);\n }\n &[data-ring='completed']::after {\n border-color: ${rgba(emerald, 0.7)};\n }\n &[data-ring='error']::after {\n border-color: ${rgba(red500, 0.7)};\n }\n\n @media (prefers-color-scheme: dark) {\n &[data-ring='idle']::after {\n border-color: ${darkBorderColor};\n }\n &[data-ring='soft']::after {\n border-color: ${rgba(gray100, 0.5)};\n }\n &[data-ring='selected']::after {\n border-color: ${gray100};\n }\n &[data-ring='custom']::after {\n border-color: var(--ring-dark);\n }\n &[data-ring='completed']::after {\n border-color: ${emerald};\n }\n &[data-ring='error']::after {\n border-color: ${red600};\n }\n }\n body.light-theme &[data-ring='idle']::after {\n border-color: ${gray300};\n }\n body.light-theme &[data-ring='soft']::after {\n border-color: ${rgba(gray700, 0.5)};\n }\n body.light-theme &[data-ring='selected']::after {\n border-color: ${darkBorderColor};\n }\n body.light-theme &[data-ring='custom']::after {\n border-color: var(--ring-light);\n }\n body.light-theme &[data-ring='completed']::after {\n border-color: ${rgba(emerald, 0.7)};\n }\n body.light-theme &[data-ring='error']::after {\n border-color: ${rgba(red500, 0.7)};\n }\n body.dark-theme &[data-ring='idle']::after {\n border-color: ${darkBorderColor};\n }\n body.dark-theme &[data-ring='soft']::after {\n border-color: ${rgba(gray100, 0.5)};\n }\n body.dark-theme &[data-ring='selected']::after {\n border-color: ${gray100};\n }\n body.dark-theme &[data-ring='custom']::after {\n border-color: var(--ring-dark);\n }\n body.dark-theme &[data-ring='completed']::after {\n border-color: ${emerald};\n }\n body.dark-theme &[data-ring='error']::after {\n border-color: ${red600};\n }\n `;\n }};\n`;\n\nexport const ThumbnailSection = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n overflow: hidden;\n transition: background 220ms;\n ${props => props.theme.themeProp('background', darkBgColor, props.theme.getColor('gray-50'))}\n ${AssetGalleryGridCard}:hover & {\n ${props => props.theme.themeProp('background', darkHoverBgColor, lightHoverBgColor, 1)}\n }\n`;\n\n// ── Top bar ──────────────────────────────────────────────────────────────────\n\nexport const HorizontalBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px;\n height: 40px;\n box-sizing: border-box;\n flex-shrink: 0;\n position: relative;\n z-index: 2;\n`;\n\nexport const HorizontalBarLeft = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const HorizontalBarRight = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const StatusIconCircle = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n pointer-events: none;\n svg {\n width: 100%;\n height: 100%;\n }\n`;\n\n// ── Thumbnail ─────────────────────────────────────────────────────────────────\n\nexport const ThumbnailRow = styled.div`\n position: relative;\n display: flex;\n width: 100%;\n`;\n\nexport const ThumbnailSpacer = styled.div`\n flex: 1;\n`;\n\nexport const ThumbnailWrapper = styled.div`\n width: max(66%, 268px);\n flex-shrink: 0;\n`;\n\nexport const ThumbnailBox = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n height: 168px;\n\n flex-shrink: 0;\n overflow: hidden;\n\n img,\n video {\n width: 100%;\n height: 100%;\n object-fit: contain;\n display: block;\n }\n\n .audio {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n svg {\n width: 35%;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-400')\n )}\n }\n }\n`;\n\nexport const ThumbnailSelectedOverlay = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<Pick<AssetGalleryGridCardStyleProps, 'selected'>>(applyDefaultTheme)`\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: ${props => (props.selected ? 0.6 : 0)};\n background-color: #accef7;\n transition: opacity 220ms;\n z-index: 1;\n`;\n\nexport const ThumbnailActions = styled.div`\n flex: 1;\n`;\n\nexport const ActionsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: end;\n flex-direction: column;\n gap: 8px;\n opacity: 0;\n transition: opacity 220ms;\n z-index: 1;\n position: absolute;\n right: 8px;\n ${AssetGalleryGridCard}:hover & {\n opacity: 1;\n }\n\n ${AssetGalleryGridCard}:focus-within & {\n opacity: 1;\n }\n`;\n\nexport const Action = styled.div`\n margin: 0;\n\n button {\n box-shadow: 0px 3px 6px #00000033;\n }\n svg {\n width: 16px;\n height: 16px;\n max-height: unset;\n max-width: unset;\n }\n`;\n\nexport const ConsumerOverlay = styled.div`\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n`;\n\n// ── Card body ─────────────────────────────────────────────────────────────────\n\nexport const CardBody = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n flex: 1;\n padding: 16px 0px 0px 0px;\n`;\n\nexport const CardTitle = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0px 16px;\n font: normal normal 500 14px/19px Roboto;\n letter-spacing: 0.28px;\n height: 19px;\n box-sizing: border-box;\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))}\n`;\n\nexport const CardDescription = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 6px 16px;\n font: normal normal normal 12px/1.286em Roboto;\n letter-spacing: 0.24px;\n height: 52px;\n box-sizing: border-box;\n overflow-wrap: break-word;\n word-break: break-word;\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))}\n`;\n\n/* `$hasContent` — `Boolean(asset.imageRights?.toString().trim())`, so genuinely boolean\n * and not `imageRights`'s `string`. */\nexport const InstructionsWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $hasContent?: boolean }>(applyDefaultTheme)`\n min-height: 96px;\n margin-top: 16px;\n box-sizing: border-box;\n flex-shrink: 0;\n transition: background 220ms;\n opacity: 0;\n ${props =>\n props.$hasContent &&\n css`\n opacity: 1;\n border-top: 0.56px solid;\n border-bottom: 0.56px solid;\n ${props.theme.themeProp('border-color', darkBorderColor, props.theme.getColor('gray-300'))}\n `}\n\n ${props =>\n props.$hasContent &&\n css`\n opacity: 1;\n ${props.theme.themeProp('background', darkBgColor, props.theme.getColor('gray-50'))}\n ${AssetGalleryGridCard}:hover & {\n ${props.theme.themeProp('background', darkHoverBgColor, lightHoverBgColor, 1)}\n }\n `}\n`;\n\nexport const CardFooter = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0px 16px;\n min-height: 52px;\n box-sizing: border-box;\n`;\n\nexport const CardFooterLeft = styled.div`\n display: flex;\n align-items: center;\n > * {\n margin-right: 4px;\n }\n`;\n\nexport const CardFooterRight = styled.div`\n display: flex;\n align-items: center;\n > * {\n margin-left: 4px;\n }\n`;\n\n/*\n * `invisible` IS READ AND NEVER PASSED — DECLARED, NOT FIXED.\n *\n * `AssetGalleryGridCard.tsx` renders `<S.CardDivider />` twice, both times with no props\n * at all, and nothing else in `src` constructs this component. So `props.invisible` is\n * always `undefined` and the `opacity` below is unconditionally `1` — the invisible\n * divider is an unimplemented state, the same shape of defect as `TextArea.styled.ts`'s\n * `$fadeIn` (playbook §E.3).\n *\n * It also has NO `$`, so if it ever were passed it would additionally be handed to React,\n * which drops a boolean-valued unknown attribute with a warning (\"Received `true` for a\n * non-boolean attribute `invisible`\") — measured. `invisible` occurs zero times in the\n * recorded baseline.\n *\n * Declared `boolean` rather than `undefined` because, unlike a run-together typo, this\n * key has a real intended meaning; wiring it up is a feature, not a rename.\n */\nexport const CardDivider = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ invisible?: boolean }>(applyDefaultTheme)`\n height: 1px;\n flex-shrink: 0;\n opacity: ${props => (props.invisible ? 0 : 1)};\n ${props => props.theme.themeProp('background', darkBorderColor, props.theme.getColor('gray-300'))}\n`;\n\nexport const CheckboxRow = styled.div`\n display: flex;\n padding: 0px 16px;\n align-items: center;\n height: 56px;\n box-sizing: border-box;\n flex-shrink: 0;\n`;\n\nexport const CheckboxButton = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n flex-shrink: 0;\n cursor: pointer;\n transition: opacity 220ms;\n ${props => props.theme.themeProp('color', 'white', 'black')}\n > svg {\n width: 23px;\n height: 100%;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","darkBorderColor","darkBgColor","darkHoverBgColor","lightHoverBgColor","AssetGalleryWrapper","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","disabled","css","ringState","selected","$customSelectedBorder","$softSelected","completed","$hasError","AssetGalleryGridCard","style","theme","themeProp","getColor","extendedSelectMode","gray100","gray300","gray700","emerald","red500","red600","rgba","ThumbnailSection","HorizontalBar","HorizontalBarLeft","HorizontalBarRight","StatusIconCircle","span","ThumbnailRow","ThumbnailSpacer","ThumbnailWrapper","ThumbnailBox","ThumbnailSelectedOverlay","ThumbnailActions","ActionsContainer","Action","ConsumerOverlay","CardBody","CardTitle","CardDescription","InstructionsWrapper","$hasContent","CardFooter","CardFooterLeft","CardFooterRight","CardDivider","invisible","CheckboxRow"],"mappings":";;;;AAiCA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAED,MAAMC,eAAe,GAAG,SAAS;AACjC,MAAMC,WAAW,GAAG,SAAS;AAC7B,MAAMC,gBAAgB,GAAG,SAAS;AAClC,MAAMC,iBAAiB,GAAG,SAAS;AAE5B,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,GAAG,CAC1CC,UAAU,CAAC;AACVV,EAAAA;AACF,CAAC,CAAC,CACDW,KAAK,CAAmDC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,iDAAA;EAAAC,WAAA,EA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,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,yCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,mCAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAGvCC,KAAK,IAAKA,KAAK,CAAC8C,SAAS,GAAG,CAAC,GAAG,CAAE,EAC3C9C,KAAK,IAAIA,KAAK,CAACW,KAAK,CAACC,SAAS,CAAC,YAAY,EAAExB,eAAe,EAAEY,KAAK,CAACW,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,CAAC;MAGtFkC,WAAW,GAAGtD,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAG,WAAA,EAAA,yCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,mGAAA,CAAA;AASPN,MAAM,CAACC,GAAG,CACrCC,UAAU,CAAC;AACVV,EAAAA;AACF,CAAC,CAAC,CACDW,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,4CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kEAAA,EAAA,iCAAA,CAAA,EAKvBC,KAAK,IAAIA,KAAK,CAACW,KAAK,CAACC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;;;;"}
1
+ {"version":3,"file":"AssetGalleryGridCard.styled.js","sources":["../../../../../src/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.ts"],"sourcesContent":["/* Generic must go on .attrs<P>(), not template, because no .withConfig(). ringState is a module-scope function needing explicit type. */\nimport { rgba } from 'polished';\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../../utils/defaultTheme';\n\n/* `prop` needs annotation because withConfig takes it by reference (no contextual typing). Note: GridCard doesn't use this predicate. */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nconst darkBorderColor = '#52525B';\nconst darkBgColor = '#27272A';\nconst darkHoverBgColor = '#3F3F46';\nconst lightHoverBgColor = '#E4E4E7';\n\nexport const AssetGalleryWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<Pick<AssetGalleryGridCardStyleProps, 'disabled'>>(applyDefaultTheme)`\n width: 100%;\n height: 100%;\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `};\n`;\n\n/** Six possible `data-ring` attribute values. Closed to keep code and selectors honest. */\ntype AssetGalleryGridCardRingState = 'custom' | 'selected' | 'soft' | 'completed' | 'error' | 'idle';\n\n/** Props that ringState reads. Reason card root needs a generic at all. */\ninterface AssetGalleryGridCardRingProps {\n /** NO `$` is a defect but not a DOM leak: React drops boolean `selected` on non-`<option>` elements. Deferred to C10. */\n selected?: boolean;\n /** NO `$` is a defect but not a DOM leak: ComputedRootComponent explicitly omits it. Deferred to C10. */\n completed?: boolean;\n $softSelected?: boolean;\n $hasError?: boolean;\n /** Read as `[darkModeColor, lightModeColor]` and written to `--ring-dark` / `--ring-light` custom properties. */\n $customSelectedBorder?: string[];\n}\n\n/** Card root props: everything ringState reads, plus what the template reads. */\ninterface AssetGalleryGridCardStyleProps extends AssetGalleryGridCardRingProps {\n /** NO `$` reaches the DOM; defect deferred to C10. Baseline shows `disabled=\"\"` on wrapper and card root. */\n disabled?: boolean;\n /** NO `$` is a defect but not a DOM leak: ComputedRootComponent omits it and React drops unrecognised camelCase props. */\n extendedSelectMode?: boolean;\n}\n\nconst ringState = (props: AssetGalleryGridCardRingProps): AssetGalleryGridCardRingState => {\n if (props.selected) return props.$customSelectedBorder ? 'custom' : 'selected';\n if (props.$softSelected) return 'soft';\n if (props.completed) return 'completed';\n if (props.$hasError) return 'error';\n return 'idle';\n};\n\nexport const AssetGalleryGridCard = styled.div.attrs<AssetGalleryGridCardStyleProps>(props => ({\n ...applyDefaultTheme(props),\n 'data-ring': ringState(props),\n style: {\n ...(props.style || {}),\n ...(props.$customSelectedBorder && props.selected\n ? {\n '--ring-dark': props.$customSelectedBorder[0],\n '--ring-light': props.$customSelectedBorder[1]\n }\n : {})\n }\n}))`\n display: block;\n position: relative;\n height: 100%;\n margin: 0;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n transition: box-shadow 220ms;\n overflow: hidden;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-700')\n )}\n\n ${props =>\n props.disabled &&\n css`\n pointer-events: none;\n opacity: 0.4;\n `};\n\n ${props =>\n props.extendedSelectMode &&\n css`\n cursor: pointer;\n `}\n\n &:hover {\n box-shadow: 0px 3px 6px #00000029;\n }\n\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 10;\n border-style: solid;\n border-width: 1px;\n }\n &[data-ring='soft']::after,\n &[data-ring='selected']::after,\n &[data-ring='custom']::after,\n &[data-ring='completed']::after,\n &[data-ring='error']::after {\n border-width: 3px;\n }\n\n ${props => {\n const gray100 = props.theme.getColor('gray-100');\n const gray300 = props.theme.getColor('gray-300');\n const gray700 = props.theme.getColor('gray-700');\n const emerald = props.theme.getColor('emerald-500');\n const red500 = props.theme.getColor('red-500');\n const red600 = props.theme.getColor('red-600');\n return css`\n &[data-ring='idle']::after {\n border-color: ${gray300};\n }\n &[data-ring='soft']::after {\n border-color: ${rgba(gray700, 0.5)};\n }\n &[data-ring='selected']::after {\n border-color: ${darkBorderColor};\n }\n &[data-ring='custom']::after {\n border-color: var(--ring-light);\n }\n &[data-ring='completed']::after {\n border-color: ${rgba(emerald, 0.7)};\n }\n &[data-ring='error']::after {\n border-color: ${rgba(red500, 0.7)};\n }\n\n @media (prefers-color-scheme: dark) {\n &[data-ring='idle']::after {\n border-color: ${darkBorderColor};\n }\n &[data-ring='soft']::after {\n border-color: ${rgba(gray100, 0.5)};\n }\n &[data-ring='selected']::after {\n border-color: ${gray100};\n }\n &[data-ring='custom']::after {\n border-color: var(--ring-dark);\n }\n &[data-ring='completed']::after {\n border-color: ${emerald};\n }\n &[data-ring='error']::after {\n border-color: ${red600};\n }\n }\n body.light-theme &[data-ring='idle']::after {\n border-color: ${gray300};\n }\n body.light-theme &[data-ring='soft']::after {\n border-color: ${rgba(gray700, 0.5)};\n }\n body.light-theme &[data-ring='selected']::after {\n border-color: ${darkBorderColor};\n }\n body.light-theme &[data-ring='custom']::after {\n border-color: var(--ring-light);\n }\n body.light-theme &[data-ring='completed']::after {\n border-color: ${rgba(emerald, 0.7)};\n }\n body.light-theme &[data-ring='error']::after {\n border-color: ${rgba(red500, 0.7)};\n }\n body.dark-theme &[data-ring='idle']::after {\n border-color: ${darkBorderColor};\n }\n body.dark-theme &[data-ring='soft']::after {\n border-color: ${rgba(gray100, 0.5)};\n }\n body.dark-theme &[data-ring='selected']::after {\n border-color: ${gray100};\n }\n body.dark-theme &[data-ring='custom']::after {\n border-color: var(--ring-dark);\n }\n body.dark-theme &[data-ring='completed']::after {\n border-color: ${emerald};\n }\n body.dark-theme &[data-ring='error']::after {\n border-color: ${red600};\n }\n `;\n }};\n`;\n\nexport const ThumbnailSection = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n overflow: hidden;\n transition: background 220ms;\n ${props => props.theme.themeProp('background', darkBgColor, props.theme.getColor('gray-50'))}\n ${AssetGalleryGridCard}:hover & {\n ${props => props.theme.themeProp('background', darkHoverBgColor, lightHoverBgColor, 1)}\n }\n`;\n\n// ── Top bar ──────────────────────────────────────────────────────────────────\n\nexport const HorizontalBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px;\n height: 40px;\n box-sizing: border-box;\n flex-shrink: 0;\n position: relative;\n z-index: 2;\n`;\n\nexport const HorizontalBarLeft = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const HorizontalBarRight = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const StatusIconCircle = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n pointer-events: none;\n svg {\n width: 100%;\n height: 100%;\n }\n`;\n\n// ── Thumbnail ─────────────────────────────────────────────────────────────────\n\nexport const ThumbnailRow = styled.div`\n position: relative;\n display: flex;\n width: 100%;\n`;\n\nexport const ThumbnailSpacer = styled.div`\n flex: 1;\n`;\n\nexport const ThumbnailWrapper = styled.div`\n width: max(66%, 268px);\n flex-shrink: 0;\n`;\n\nexport const ThumbnailBox = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n height: 168px;\n\n flex-shrink: 0;\n overflow: hidden;\n\n img,\n video {\n width: 100%;\n height: 100%;\n object-fit: contain;\n display: block;\n }\n\n .audio {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n svg {\n width: 35%;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-400')\n )}\n }\n }\n`;\n\nexport const ThumbnailSelectedOverlay = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<Pick<AssetGalleryGridCardStyleProps, 'selected'>>(applyDefaultTheme)`\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: ${props => (props.selected ? 0.6 : 0)};\n background-color: #accef7;\n transition: opacity 220ms;\n z-index: 1;\n`;\n\nexport const ThumbnailActions = styled.div`\n flex: 1;\n`;\n\nexport const ActionsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: end;\n flex-direction: column;\n gap: 8px;\n opacity: 0;\n transition: opacity 220ms;\n z-index: 1;\n position: absolute;\n right: 8px;\n ${AssetGalleryGridCard}:hover & {\n opacity: 1;\n }\n\n ${AssetGalleryGridCard}:focus-within & {\n opacity: 1;\n }\n`;\n\nexport const Action = styled.div`\n margin: 0;\n\n button {\n box-shadow: 0px 3px 6px #00000033;\n }\n svg {\n width: 16px;\n height: 16px;\n max-height: unset;\n max-width: unset;\n }\n`;\n\nexport const ConsumerOverlay = styled.div`\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n`;\n\n// ── Card body ─────────────────────────────────────────────────────────────────\n\nexport const CardBody = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n flex: 1;\n padding: 16px 0px 0px 0px;\n`;\n\nexport const CardTitle = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0px 16px;\n font: normal normal 500 14px/19px Roboto;\n letter-spacing: 0.28px;\n height: 19px;\n box-sizing: border-box;\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))}\n`;\n\nexport const CardDescription = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 6px 16px;\n font: normal normal normal 12px/1.286em Roboto;\n letter-spacing: 0.24px;\n height: 52px;\n box-sizing: border-box;\n overflow-wrap: break-word;\n word-break: break-word;\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))}\n`;\n\n/* `$hasContent` — `Boolean(asset.imageRights?.toString().trim())`, so genuinely boolean\n * and not `imageRights`'s `string`. */\nexport const InstructionsWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $hasContent?: boolean }>(applyDefaultTheme)`\n min-height: 96px;\n margin-top: 16px;\n box-sizing: border-box;\n flex-shrink: 0;\n transition: background 220ms;\n opacity: 0;\n ${props =>\n props.$hasContent &&\n css`\n opacity: 1;\n border-top: 0.56px solid;\n border-bottom: 0.56px solid;\n ${props.theme.themeProp('border-color', darkBorderColor, props.theme.getColor('gray-300'))}\n `}\n\n ${props =>\n props.$hasContent &&\n css`\n opacity: 1;\n ${props.theme.themeProp('background', darkBgColor, props.theme.getColor('gray-50'))}\n ${AssetGalleryGridCard}:hover & {\n ${props.theme.themeProp('background', darkHoverBgColor, lightHoverBgColor, 1)}\n }\n `}\n`;\n\nexport const CardFooter = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0px 16px;\n min-height: 52px;\n box-sizing: border-box;\n`;\n\nexport const CardFooterLeft = styled.div`\n display: flex;\n align-items: center;\n > * {\n margin-right: 4px;\n }\n`;\n\nexport const CardFooterRight = styled.div`\n display: flex;\n align-items: center;\n > * {\n margin-left: 4px;\n }\n`;\n\n/*\n * `invisible` is read but never passed, so opacity is always 1 — an unimplemented state,\n * left declared rather than fixed because wiring it up is a feature. It also lacks the `$`\n * prefix, so passing it would leak the attribute to React.\n */\nexport const CardDivider = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ invisible?: boolean }>(applyDefaultTheme)`\n height: 1px;\n flex-shrink: 0;\n opacity: ${props => (props.invisible ? 0 : 1)};\n ${props => props.theme.themeProp('background', darkBorderColor, props.theme.getColor('gray-300'))}\n`;\n\nexport const CheckboxRow = styled.div`\n display: flex;\n padding: 0px 16px;\n align-items: center;\n height: 56px;\n box-sizing: border-box;\n flex-shrink: 0;\n`;\n\nexport const CheckboxButton = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n opacity: 1;\n flex-shrink: 0;\n cursor: pointer;\n transition: opacity 220ms;\n ${props => props.theme.themeProp('color', 'white', 'black')}\n > svg {\n width: 23px;\n height: 100%;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","darkBorderColor","darkBgColor","darkHoverBgColor","lightHoverBgColor","AssetGalleryWrapper","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","disabled","css","ringState","selected","$customSelectedBorder","$softSelected","completed","$hasError","AssetGalleryGridCard","style","theme","themeProp","getColor","extendedSelectMode","gray100","gray300","gray700","emerald","red500","red600","rgba","ThumbnailSection","HorizontalBar","HorizontalBarLeft","HorizontalBarRight","StatusIconCircle","span","ThumbnailRow","ThumbnailSpacer","ThumbnailWrapper","ThumbnailBox","ThumbnailSelectedOverlay","ThumbnailActions","ActionsContainer","Action","ConsumerOverlay","CardBody","CardTitle","CardDescription","InstructionsWrapper","$hasContent","CardFooter","CardFooterLeft","CardFooterRight","CardDivider","invisible","CheckboxRow"],"mappings":";;;;AAMA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAED,MAAMC,eAAe,GAAG,SAAS;AACjC,MAAMC,WAAW,GAAG,SAAS;AAC7B,MAAMC,gBAAgB,GAAG,SAAS;AAClC,MAAMC,iBAAiB,GAAG,SAAS;AAE5B,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,GAAG,CAC1CC,UAAU,CAAC;AACVV,EAAAA;AACF,CAAC,CAAC,CACDW,KAAK,CAAmDC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,iDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,yBAAA,EAAA,GAAA,CAAA,EAGzEC,KAAK,IACLA,KAAK,CAACC,QAAQ,IACdC,GAAG,yBAEF;AA0BL,MAAMC,SAAS,GAAIH,KAAoC,IAAoC;EACzF,IAAIA,KAAK,CAACI,QAAQ,EAAE,OAAOJ,KAAK,CAACK,qBAAqB,GAAG,QAAQ,GAAG,UAAU;AAC9E,EAAA,IAAIL,KAAK,CAACM,aAAa,EAAE,OAAO,MAAM;AACtC,EAAA,IAAIN,KAAK,CAACO,SAAS,EAAE,OAAO,WAAW;AACvC,EAAA,IAAIP,KAAK,CAACQ,S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,CAAA;EAAAG,WAAA,EAAA,yCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,mGAAA,CAAA;AASPN,MAAM,CAACC,GAAG,CACrCC,UAAU,CAAC;AACVV,EAAAA;AACF,CAAC,CAAC,CACDW,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,4CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kEAAA,EAAA,iCAAA,CAAA,EAKvBC,KAAK,IAAIA,KAAK,CAACW,KAAK,CAACC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssetPreviewTopBar.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './AssetPreviewTopBar.styled';\n\nimport { ReactComponent as IconArrowBack } from '../../../../icons/arrow-back.svg';\nimport { ReactComponent as IconClose } from '../../../../icons/close.svg';\n\ntype AssetPreviewTopBarOwnProps = {\n /**\n * On-click function for the back button\n */\n onBackButtonClick: (...args: any[]) => any;\n /**\n * Translatable text for the back button\n */\n backButtonText: string;\n /**\n * Disable the back button\n */\n disabled?: boolean;\n /**\n * Display the back button as an X instead of an arrow\n */\n backButtonAsClose?: boolean;\n /**\n * Text to be displayed grayed out after the \"Back\" text – e.g. \"Asset selected\" in gallery\n */\n leftText?: string;\n /**\n * Add a shadow on the bottom border of the top bar – e.g. in gallery view\n */\n shadow?: boolean;\n /**\n * Add a border on the bottom of the top bar\n */\n border?: boolean;\n /**\n * `Array` of buttons to be placed on the right side of the top bar\n */\n buttons?: React.ReactNode[];\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.AssetPreviewTopBar`, 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 AssetPreviewTopBarOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.AssetPreviewTopBar>,\n keyof AssetPreviewTopBarOwnProps\n> &\n AssetPreviewTopBarOwnProps;\n\n/**\n * Top bar for asset preview.\n *\n * ### Import\n *\n * ``` js\n * import { AssetPreviewTopBar } from '@ntbjs/react-components/widgets'\n * // or\n * import AssetPreviewTopBar from '@ntbjs/react-components/AssetPreview/AssetPreviewTopBar'\n * ```\n * \n * ### Usage example\n * \n * ``` js\nconst button1 = <ActionButton key=\"btn1\"icon={<IconAddCircle />} />;\nconst button2 = <Button key=\"btn2\" secondary={true}>Edit</Button>;\nconst button3 = <Button key=\"btn3\" secondary={true}>Share</Button>;\nconst button4 = <Button key=\"btn4\">Download</Button>;\n\nconst topBar = <AssetPreviewTopBar backButtonText={t{\"Back\"}} onBackButtonClick={() => {}} buttons={[button1, button2, button3, button4]} />;\n * ```\n */\nconst AssetPreviewTopBar = React.forwardRef<any, Props>(function AssetPreviewTopBar(\n {\n onBackButtonClick,\n backButtonText,\n backButtonAsClose,\n leftText,\n buttons,\n shadow,\n border,\n disabled,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.AssetPreviewTopBar\n ref={forwardedRef}\n $shadow={shadow}\n $border={border}\n disabled={disabled}\n {...props}\n >\n <S.BackButtonContainer onClick={onBackButtonClick} disabled={disabled}>\n {backButtonAsClose ? (\n <>\n <IconClose />\n {backButtonText}\n </>\n ) : (\n <S.BackHoverEffect>\n <IconArrowBack />\n {backButtonText}\n </S.BackHoverEffect>\n )}\n </S.BackButtonContainer>\n {leftText && <S.LeftText>{leftText}</S.LeftText>}\n {Array.isArray(buttons) && (\n <S.ButtonsContainer>\n {buttons.map((button, index) => (\n <span key={'topBarButton-' + index}>{button}</span>\n ))}\n </S.ButtonsContainer>\n )}\n </S.AssetPreviewTopBar>\n );\n});\n\nexport default AssetPreviewTopBar;\n"],"names":["AssetPreviewTopBar","React","forwardRef","onBackButtonClick","backButtonText","backButtonAsClose","leftText","buttons","shadow","border","disabled","props","forwardedRef","_jsxs","S","ref","$shadow","$border","children","_jsx","onClick","_Fragment","IconClose","IconArrowBack","Array","isArray","map","button","index"],"mappings":";;;;;;AA4EA,MAAMA,kBAAkB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,kBAAkBA,CACjF;EACEG,iBAAiB;EACjBC,cAAc;EACdC,iBAAiB;EACjBC,QAAQ;EACRC,OAAO;EACPC,MAAM;EACNC,MAAM;EACNC,QAAQ;EACR,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,IAAA,CAACC,oBAAoB,EAAA;AACnBC,IAAAA,GAAG,EAAEH,YAAa;AAClBI,IAAAA,OAAO,EAAER,MAAO;AAChBS,IAAAA,OAAO,EAAER,MAAO;AAChBC,IAAAA,QAAQ,EAAEA,QAAS;AAAA,IAAA,GACfC,KAAK;AAAAO,IAAAA,QAAA,EAAA,CAETC,GAAA,CAACL,mBAAqB,EAAA;AAACM,MAAAA,OAAO,EAAEjB,iBAAkB;AAACO,MAAAA,QAAQ,EAAEA,QAAS;AAAAQ,MAAAA,QAAA,EACnEb,iBAAiB,GAChBQ,IAAA,CAAAQ,QAAA,EAAA;AAAAH,QAAAA,QAAA,GACEC,GAAA,CAACG,QAAS,EAAA,EAAE,CAAC,EACZlB,cAAc;AAAA,OACf,CAAC,GAEHS,IAAA,CAACC,eAAiB,EAAA;AAAAI,QAAAA,QAAA,GAChBC,GAAA,CAACI,YAAa,EAAA,EAAE,CAAC,EAChBnB,cAAc;OACE;KAEA,CAAC,EACvBE,QAAQ,IAAIa,GAAA,CAACL,QAAU,EAAA;AAAAI,MAAAA,QAAA,EAAEZ;AAAQ,KAAa,CAAC,EAC/CkB,KAAK,CAACC,OAAO,CAAClB,OAAO,CAAC,IACrBY,GAAA,CAACL,gBAAkB,EAAA;MAAAI,QAAA,EAChBX,OAAO,CAACmB,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,KACzBT,GAAA,CAAA,MAAA,EAAA;AAAAD,QAAAA,QAAA,EAAqCS;OAAM,EAAhC,eAAe,GAAGC,KAAqB,CACnD;AAAC,KACgB,CACrB;AAAA,GACmB,CAAC;AAE3B,CAAC;;;;"}
1
+ {"version":3,"file":"AssetPreviewTopBar.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './AssetPreviewTopBar.styled';\n\nimport { ReactComponent as IconArrowBack } from '../../../../icons/arrow-back.svg';\nimport { ReactComponent as IconClose } from '../../../../icons/close.svg';\n\ntype AssetPreviewTopBarOwnProps = {\n /**\n * On-click function for the back button\n */\n onBackButtonClick: (...args: any[]) => any;\n /**\n * Translatable text for the back button\n */\n backButtonText: string;\n /**\n * Disable the back button\n */\n disabled?: boolean;\n /**\n * Display the back button as an X instead of an arrow\n */\n backButtonAsClose?: boolean;\n /**\n * Text to be displayed grayed out after the \"Back\" text – e.g. \"Asset selected\" in gallery\n */\n leftText?: string;\n /**\n * Add a shadow on the bottom border of the top bar – e.g. in gallery view\n */\n shadow?: boolean;\n /**\n * Add a border on the bottom of the top bar\n */\n border?: boolean;\n /**\n * `Array` of buttons to be placed on the right side of the top bar\n */\n buttons?: React.ReactNode[];\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.AssetPreviewTopBar>,\n keyof AssetPreviewTopBarOwnProps\n> &\n AssetPreviewTopBarOwnProps;\n\n/**\n * Top bar for asset preview.\n *\n * ### Import\n *\n * ``` js\n * import { AssetPreviewTopBar } from '@ntbjs/react-components/widgets'\n * // or\n * import AssetPreviewTopBar from '@ntbjs/react-components/AssetPreview/AssetPreviewTopBar'\n * ```\n * \n * ### Usage example\n * \n * ``` js\nconst button1 = <ActionButton key=\"btn1\"icon={<IconAddCircle />} />;\nconst button2 = <Button key=\"btn2\" secondary={true}>Edit</Button>;\nconst button3 = <Button key=\"btn3\" secondary={true}>Share</Button>;\nconst button4 = <Button key=\"btn4\">Download</Button>;\n\nconst topBar = <AssetPreviewTopBar backButtonText={t{\"Back\"}} onBackButtonClick={() => {}} buttons={[button1, button2, button3, button4]} />;\n * ```\n */\nconst AssetPreviewTopBar = React.forwardRef<any, Props>(function AssetPreviewTopBar(\n {\n onBackButtonClick,\n backButtonText,\n backButtonAsClose,\n leftText,\n buttons,\n shadow,\n border,\n disabled,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.AssetPreviewTopBar\n ref={forwardedRef}\n $shadow={shadow}\n $border={border}\n disabled={disabled}\n {...props}\n >\n <S.BackButtonContainer onClick={onBackButtonClick} disabled={disabled}>\n {backButtonAsClose ? (\n <>\n <IconClose />\n {backButtonText}\n </>\n ) : (\n <S.BackHoverEffect>\n <IconArrowBack />\n {backButtonText}\n </S.BackHoverEffect>\n )}\n </S.BackButtonContainer>\n {leftText && <S.LeftText>{leftText}</S.LeftText>}\n {Array.isArray(buttons) && (\n <S.ButtonsContainer>\n {buttons.map((button, index) => (\n <span key={'topBarButton-' + index}>{button}</span>\n ))}\n </S.ButtonsContainer>\n )}\n </S.AssetPreviewTopBar>\n );\n});\n\nexport default AssetPreviewTopBar;\n"],"names":["AssetPreviewTopBar","React","forwardRef","onBackButtonClick","backButtonText","backButtonAsClose","leftText","buttons","shadow","border","disabled","props","forwardedRef","_jsxs","S","ref","$shadow","$border","children","_jsx","onClick","_Fragment","IconClose","IconArrowBack","Array","isArray","map","button","index"],"mappings":";;;;;;AAsEA,MAAMA,kBAAkB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,kBAAkBA,CACjF;EACEG,iBAAiB;EACjBC,cAAc;EACdC,iBAAiB;EACjBC,QAAQ;EACRC,OAAO;EACPC,MAAM;EACNC,MAAM;EACNC,QAAQ;EACR,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,IAAA,CAACC,oBAAoB,EAAA;AACnBC,IAAAA,GAAG,EAAEH,YAAa;AAClBI,IAAAA,OAAO,EAAER,MAAO;AAChBS,IAAAA,OAAO,EAAER,MAAO;AAChBC,IAAAA,QAAQ,EAAEA,QAAS;AAAA,IAAA,GACfC,KAAK;AAAAO,IAAAA,QAAA,EAAA,CAETC,GAAA,CAACL,mBAAqB,EAAA;AAACM,MAAAA,OAAO,EAAEjB,iBAAkB;AAACO,MAAAA,QAAQ,EAAEA,QAAS;AAAAQ,MAAAA,QAAA,EACnEb,iBAAiB,GAChBQ,IAAA,CAAAQ,QAAA,EAAA;AAAAH,QAAAA,QAAA,GACEC,GAAA,CAACG,QAAS,EAAA,EAAE,CAAC,EACZlB,cAAc;AAAA,OACf,CAAC,GAEHS,IAAA,CAACC,eAAiB,EAAA;AAAAI,QAAAA,QAAA,GAChBC,GAAA,CAACI,YAAa,EAAA,EAAE,CAAC,EAChBnB,cAAc;OACE;KAEA,CAAC,EACvBE,QAAQ,IAAIa,GAAA,CAACL,QAAU,EAAA;AAAAI,MAAAA,QAAA,EAAEZ;AAAQ,KAAa,CAAC,EAC/CkB,KAAK,CAACC,OAAO,CAAClB,OAAO,CAAC,IACrBY,GAAA,CAACL,gBAAkB,EAAA;MAAAI,QAAA,EAChBX,OAAO,CAACmB,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,KACzBT,GAAA,CAAA,MAAA,EAAA;AAAAD,QAAAA,QAAA,EAAqCS;OAAM,EAAhC,eAAe,GAAGC,KAAqB,CACnD;AAAC,KACgB,CACrB;AAAA,GACmB,CAAC;AAE3B,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssetPreviewTopBar.styled.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.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 */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\n/**\n * `disabled` — `PropTypes.bool`, greys out the back button.\n *\n * NO `$`, AND THAT IS A DEFECT THAT IS ALREADY IN THE RENDER BASELINE. React recognises\n * `disabled` and renders it as a bare boolean attribute on any element, so\n * `widgets/AssetPreviewTopBar#disabled` in `scripts/r19-harness/baseline.json` records\n * `<div disabled=\"\">` AND `<a disabled=\"\">`. Renaming it `$disabled` removes both\n * attributes and therefore MOVES the baseline — C10 work, §E.4.\n *\n * Note it also has to be DECLARED to be read at all: `disabled` is a member of neither\n * `HTMLAttributes<HTMLDivElement>` nor `AnchorHTMLAttributes<HTMLAnchorElement>`. That is\n * the same asymmetry §J.9 records for `CompactTextInput` — there the identical read on an\n * `<input>` needs no declaration, because `InputHTMLAttributes` really does have it.\n *\n * Hosts: `AssetPreviewTopBar` and `BackButtonContainer`.\n */\ninterface AssetPreviewTopBarDisabledStyleProps {\n disabled?: boolean;\n}\n\n/** The top bar root, i.e. what `AssetPreviewTopBar.tsx` passes to it. */\nexport interface AssetPreviewTopBarStyleProps extends AssetPreviewTopBarDisabledStyleProps {\n /** `border` — `PropTypes.bool`; swaps `border-bottom` between `1px solid` and `none`. */\n $border?: boolean;\n /** `shadow` — `PropTypes.bool`. Read as `props.$shadow && props.theme.themeProp(…)`,\n * which evaluates to `false | RuleSet` — a valid `Interpolation`. A BARE\n * `${props => props.$shadow}` would not be: `Interpolation` accepts `Falsy` but not\n * `true`, so it would be TS2345 even with the prop correctly typed `boolean`. §J.5. */\n $shadow?: boolean;\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. §J.4. `prop` needs the annotation\n * because `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const AssetPreviewTopBar = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetPreviewTopBarStyleProps>(applyDefaultTheme)`\n box-sizing: border-box;\n align-items: center;\n border-bottom: ${props => (props.$border ? `1px solid` : `none`)};\n color: inherit;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-weight: 400;\n min-height: 72px;\n padding: 0 24px;\n width: 100%;\n\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-200')\n )}\n\n ${props =>\n props.$shadow &&\n props.theme.themeProp('box-shadow', '0 -2px 12px #505050', '0 -3px 12px #b0b6b9')}\n\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const BackButtonContainer = styled.a\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetPreviewTopBarDisabledStyleProps>(applyDefaultTheme)`\n align-items: center;\n display: flex;\n font-size: 1.125rem;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n }\n`;\n\nexport const BackHoverEffect = styled.div`\n display: inline-flex;\n align-items: center;\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n transition: transform 0.3s ease-in-out;\n }\n\n &:hover > svg {\n transform: translateX(-2px);\n }\n`;\n\nexport const LeftText = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.125rem;\n margin-left: 16px;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-400')\n )};\n`;\n\nexport const ButtonsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n margin-left: auto;\n\n > span {\n margin-left: 16px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","AssetPreviewTopBar","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$border","theme","primaryFontFamily","themeProp","getColor","$shadow","disabled","css","BackButtonContainer","a","BackHoverEffect","LeftText","span","ButtonsContainer"],"mappings":";;;AA4CA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CACzCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA+BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,yDAAA,EAAA,0CAAA,EAAA,6DAAA,EAAA,GAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAGtCC,KAAK,IAAKA,KAAK,CAACC,OAAO,GAAG,CAAA,SAAA,CAAW,GAAG,CAAA,IAAA,CAAO,EAGjDD,KAAK,IAAIA,KAAK,CAACE,KAAK,CAACC,iBAAiB,EAMnDH,KAAK,IACLA,KAAK,CAACE,KAAK,CAACE,SAAS,CACnB,cAAc,EACdJ,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CACjC,CAAC,EAEDL,KAAK,IACLA,KAAK,CAACM,OAAO,IACbN,KAAK,CAACE,KAAK,CAACE,SAAS,CAAC,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,EAE7EJ,KAAK,IACLA,KAAK,CAACO,QAAQ,IACdC,GAAG,yBAEF;AAGF,MAAMC,mBAAmB,GAAGhB,MAAM,CAACiB,CAAC,CACxCf,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KA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{"version":3,"file":"AssetPreviewTopBar.styled.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.ts"],"sourcesContent":["// $-prefixed props are transient and never reach the DOM.\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\n/**\n * `disabled` — greys out the back button. Not transient; present in baseline as bare boolean attribute.\n */\ninterface AssetPreviewTopBarDisabledStyleProps {\n disabled?: boolean;\n}\n\n/**\n * Props passed by `AssetPreviewTopBar.tsx` to `<S.AssetPreviewTopBar>`.\n */\nexport interface AssetPreviewTopBarStyleProps extends AssetPreviewTopBarDisabledStyleProps {\n /** Swaps `border-bottom` between `1px solid` and `none`. */\n $border?: boolean;\n /** Shadow; evaluated as `props.$shadow && props.theme.themeProp(…)` to produce valid Interpolation. */\n $shadow?: boolean;\n}\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const AssetPreviewTopBar = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetPreviewTopBarStyleProps>(applyDefaultTheme)`\n box-sizing: border-box;\n align-items: center;\n border-bottom: ${props => (props.$border ? `1px solid` : `none`)};\n color: inherit;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-weight: 400;\n min-height: 72px;\n padding: 0 24px;\n width: 100%;\n\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-200')\n )}\n\n ${props =>\n props.$shadow &&\n props.theme.themeProp('box-shadow', '0 -2px 12px #505050', '0 -3px 12px #b0b6b9')}\n\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const BackButtonContainer = styled.a\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetPreviewTopBarDisabledStyleProps>(applyDefaultTheme)`\n align-items: center;\n display: flex;\n font-size: 1.125rem;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n }\n`;\n\nexport const BackHoverEffect = styled.div`\n display: inline-flex;\n align-items: center;\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n transition: transform 0.3s ease-in-out;\n }\n\n &:hover > svg {\n transform: translateX(-2px);\n }\n`;\n\nexport const LeftText = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.125rem;\n margin-left: 16px;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-400')\n )};\n`;\n\nexport const ButtonsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n margin-left: auto;\n\n > span {\n margin-left: 16px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","AssetPreviewTopBar","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$border","theme","primaryFontFamily","themeProp","getColor","$shadow","disabled","css","BackButtonContainer","a","BackHoverEffect","LeftText","span","ButtonsContainer"],"mappings":";;;AAsBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CACzCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA+BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,yDAAA,E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C,MAAMa,QAAQ,GAAGnB,MAAM,CAACoB,IAAI,CAChClB,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,sCAAA,EAAA,GAAA,CAAA,EAIvBC,KAAK,IACLA,KAAK,CAACE,KAAK,CAACE,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CACjC,CAAC;AAGE,MAAMS,gBAAgB,GAAGrB,MAAM,CAACC,GAAG,CACvCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,4CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,4EAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingTree, useFloatingTree } from '@floating-ui/react';\n\nimport * as S from './ContextMenu.styled';\n\ntype ContextMenuOwnProps = {\n /**\n * An array containing nodes of the `ContextMenuItem` component\n */\n children?: any;\n /**\n * Marks this menu as the sublevel/submenu of another context menu.\n *\n * NOT DECLARED BY THE OLD propTypes, so the codemod could not emit it; the widening\n * pass reported it as a `(dynamic key)` undeclared read but cannot type it, because\n * `S.ContextMenu` is a `styled.div` and `sublevel` is not an HTML attribute. Declared\n * by hand so the documented usage in this file's own JSDoc and in\n * `ContextMenu.stories.tsx:103` keeps compiling.\n *\n * PRE-EXISTING FINDING, DELIBERATELY NOT FIXED HERE: nothing reads it. The component\n * strips it out of the spread —\n * `Object.entries(props).filter(([key]) => key !== 'sublevel')` — so it reaches\n * neither the DOM nor `ContextMenu.styled.ts`, which reads no prop at all. The\n * sublevel placement it appears to request is actually driven by the *`Popover`*'s\n * `contextMenuSublevel`, which the stories set on the same element. So this is a\n * documented public prop that is a no-op. Removing it is an API break and belongs in\n * its own commit with its own decision; keeping the declaration records the API as it\n * is published today rather than as we wish it were.\n */\n sublevel?: boolean;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.ContextMenu`, 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 ContextMenuOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.ContextMenu>, keyof ContextMenuOwnProps> &\n ContextMenuOwnProps;\n\n/**\n * This component wraps around an array of `ContextMenuItems` to display a context menu.\n *\n * In most use-cases, the `ContextMenu` will be wrapped in a `Popover` to provide the functionality for opening/closing and placing the menu.\n * In such cases, send the `ContextMenu` to the `Popover` as its `content` prop.\n *\n * The context menu and sublevels will automatically adjust their placement in relation to the element that opens it\n * based on available space if the provided placement doesn't work. See the `Popover` documentation for further instructions on placement.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenu } from '@ntbjs/react-components/widgets'\n * // or\n * import ContextMenu from '@ntbjs/react-components/widgets/ContextMenu'\n * ```\n * \n * ### Usage examples \n * #### Plain context menu\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with grouped items\n * Use the `ContextMenuItemsGroup` component to group menu items together. Grouped items will not show borders\n * between themselves, indicating that their actions are related.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\nconst groupItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-1\" />:\nconst groupItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-2\" />;\nconst groupItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-3\" />;\n\nconst itemGroup1 = <ContextMenuItemsGroup key=\"item-group-1\">{[groupItem1, groupItem2, groupItem3]}</ContextMenuItemsGroup>;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with sublevels\n * Wrap a `ContextMenuItem` in a `Popover` and pass it a `ContextMenu` as child to create a sublevel/submenu. \n * A sublevel will by default be placed adjacent and aligned with the `ContextMenuItem` which opens it,\n * and adjust automatically based on available space.\n * \n * Set the `contextMenu` and `contextMenuSublevel` props of the `Popover` containing the sublevel to `true`.\n * \n * Set the `opensSublevel` prop of the `ContextMenuItem` containing the sublevel to `true`.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} hoverBackgroundColors={['#fbeae6', '#fbeae6']} key=\"item-2\" />;\n\nconst subItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-1\" />\nconst subItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-2\" />\nconst subItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-3\" />\n\nconst itemWithSublevel = (\n <Popover\n content={\n <ContextMenu sublevel={true}>\n {[subItem1, subItem2, subItem3, subItem4, subItem5]}\n </ContextMenu>\n }\n contextMenu={true}\n contextMenuSublevel={true}\n key=\"item-3\"\n >\n <ContextMenuItem title=\"Open level 2\" opensSublevel={true} />\n </Popover>\n);\n\n<Popover content={<ContextMenu {...args}>{[item1, item2, itemWithSublevel]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * \n * #### Context menu from a dropdown button\n * When used with a dropdown button, the `Button` component takes care of wrapping the menu items in a `Popover`.\n * Just pass the array of `ContextMenuItems` directly into the `Button` as its children.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-2\" />;\nconst item3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-3\" />;\n\n<Button onClick={onClickEffect} dropdownItems={<ContextMenu {...args}>{[item1, item2, item3, item4, item5]}</ContextMenu>}>\n Button text\n</Button>\n```\n *\n */\nconst ContextMenu = React.forwardRef<any, Props>(function ContextMenu(\n { children, ...props },\n forwardedRef\n) {\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => key !== 'sublevel')\n );\n\n /*\n * NMB-3998, plan C5: WHERE THE `FloatingTree` PROVIDER LIVES.\n *\n * C5 settles it as \"at the nesting site, not inside `Popover`\", so that a standalone\n * `Popover` needs no tree — and `useFloatingPopover` renders no provider, which is what\n * makes that possible. This is the nesting site: a submenu is a `Popover` wrapped around a\n * `ContextMenuItem` INSIDE a `ContextMenu` (see this component's own JSDoc, \"Context menu\n * with sublevels\").\n *\n * ONLY THE ROOT MENU CREATES ONE. `useFloatingTree()` returns the nearest provider or\n * `null`, so a submenu's own `ContextMenu` reuses its ancestor's tree instead of starting a\n * second one. Without that check every level would get a private tree, each containing a\n * single node, and `getChildren()` would be empty everywhere — which is to say the check is\n * the entire mechanism, not a micro-optimisation.\n *\n * WHAT IT BUYS, STATED HONESTLY, BECAUSE IT IS LESS THAN C5 ASSUMED:\n *\n * - With THREE or more levels it is load-bearing. `useDismiss` consults\n * `getChildren(tree, nodeId)` and refuses to dismiss a menu whose child is still open, so\n * a press inside a third-level menu no longer closes the second-level menu that owns it.\n * - With TWO levels — every case that exists in this library and in both consumers today —\n * it is INERT, because the second level has no children of its own.\n * - It can NEVER link the outermost `Popover` to its submenus, and no placement inside this\n * component could. This provider is rendered by the menu, which is the `Popover`'s\n * `content`, i.e. BELOW it in the React tree; the outer `Popover`'s `useFloatingTree()`\n * is therefore `null` and it never registers a node. That is a real limit of C5's\n * placement, not an implementation shortcut. The two behaviours that would otherwise have\n * needed it are both delivered another way and both depend on plan C4's INLINE default:\n * * the parent staying open while its submenu is used — the submenu's floating element\n * is a DOM descendant of the parent's, so `useDismiss`'s\n * `isEventTargetWithin(event, elements.floating)` already covers it;\n * * the whole chain closing when a leaf item is clicked — the click bubbles from the\n * submenu into the parent's own delegated handler (`handleContextMenuClick` in\n * `Popover.tsx`, where this is written out).\n * If sublevels are ever portalled, both stop working and the fix is to hoist a\n * `FloatingTree` above the outermost `Popover` — which means either `Popover`\n * self-wrapping when it has no parent node, or a consumer-visible wrapper. That is a\n * decision, and re-opening C5 is the right way to take it.\n *\n * It renders no DOM — `FloatingTree` is a context provider and nothing else — so neither\n * the markup nor the CSS in `baseline.json` moves because of this, and the standalone\n * `Popover` path is untouched.\n */\n const hasTree = useFloatingTree() !== null;\n\n const menu = (\n <S.ContextMenu ref={forwardedRef} {...filteredProps} role=\"menu\">\n {children}\n </S.ContextMenu>\n );\n\n return hasTree ? menu : <FloatingTree>{menu}</FloatingTree>;\n});\n\nexport default ContextMenu;\n"],"names":["ContextMenu","React","forwardRef","children","props","forwardedRef","filteredProps","Object","fromEntries","entries","filter","key","hasTree","useFloatingTree","menu","_jsx","S","ref","role","FloatingTree"],"mappings":";;;;;AAoJA,MAAMA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,WAAWA,CACnE;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;EACA,MAAMC,aAAa,GAAGC,MAAM,CAACC,WAAW,CACtCD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,KAAKA,GAAG,KAAK,UAAU,CAC5D,CAAC;AA6CD,EAAA,MAAMC,OAAO,GAAGC,eAAe,EAAE,KAAK,IAAI;AAE1C,EAAA,MAAMC,IAAI,GACRC,GAAA,CAACC,aAAa,EAAA;AAACC,IAAAA,GAAG,EAAEZ,YAAa;AAAA,IAAA,GAAKC,aAAa;AAAEY,IAAAA,IAAI,EAAC,MAAM;AAAAf,IAAAA,QAAA,EAC7DA;AAAQ,GACI,CAChB;AAED,EAAA,OAAOS,OAAO,GAAGE,IAAI,GAAGC,GAAA,CAACI,YAAY,EAAA;AAAAhB,IAAAA,QAAA,EAAEW;AAAI,GAAe,CAAC;AAC7D,CAAC;;;;"}
1
+ {"version":3,"file":"ContextMenu.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingTree, useFloatingTree } from '@floating-ui/react';\n\nimport * as S from './ContextMenu.styled';\n\ntype ContextMenuOwnProps = {\n /**\n * An array containing nodes of the `ContextMenuItem` component\n */\n children?: any;\n /**\n * Marks this menu as the sublevel/submenu of another context menu. This is a documented public prop that is currently a no-op; removing it is an API break.\n */\n sublevel?: boolean;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.ContextMenu>, keyof ContextMenuOwnProps> &\n ContextMenuOwnProps;\n\n/**\n * This component wraps around an array of `ContextMenuItems` to display a context menu.\n *\n * In most use-cases, the `ContextMenu` will be wrapped in a `Popover` to provide the functionality for opening/closing and placing the menu.\n * In such cases, send the `ContextMenu` to the `Popover` as its `content` prop.\n *\n * The context menu and sublevels will automatically adjust their placement in relation to the element that opens it\n * based on available space if the provided placement doesn't work. See the `Popover` documentation for further instructions on placement.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenu } from '@ntbjs/react-components/widgets'\n * // or\n * import ContextMenu from '@ntbjs/react-components/widgets/ContextMenu'\n * ```\n * \n * ### Usage examples \n * #### Plain context menu\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with grouped items\n * Use the `ContextMenuItemsGroup` component to group menu items together. Grouped items will not show borders\n * between themselves, indicating that their actions are related.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\nconst groupItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-1\" />:\nconst groupItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-2\" />;\nconst groupItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-3\" />;\n\nconst itemGroup1 = <ContextMenuItemsGroup key=\"item-group-1\">{[groupItem1, groupItem2, groupItem3]}</ContextMenuItemsGroup>;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with sublevels\n * Wrap a `ContextMenuItem` in a `Popover` and pass it a `ContextMenu` as child to create a sublevel/submenu. \n * A sublevel will by default be placed adjacent and aligned with the `ContextMenuItem` which opens it,\n * and adjust automatically based on available space.\n * \n * Set the `contextMenu` and `contextMenuSublevel` props of the `Popover` containing the sublevel to `true`.\n * \n * Set the `opensSublevel` prop of the `ContextMenuItem` containing the sublevel to `true`.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} hoverBackgroundColors={['#fbeae6', '#fbeae6']} key=\"item-2\" />;\n\nconst subItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-1\" />\nconst subItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-2\" />\nconst subItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-3\" />\n\nconst itemWithSublevel = (\n <Popover\n content={\n <ContextMenu sublevel={true}>\n {[subItem1, subItem2, subItem3, subItem4, subItem5]}\n </ContextMenu>\n }\n contextMenu={true}\n contextMenuSublevel={true}\n key=\"item-3\"\n >\n <ContextMenuItem title=\"Open level 2\" opensSublevel={true} />\n </Popover>\n);\n\n<Popover content={<ContextMenu {...args}>{[item1, item2, itemWithSublevel]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * \n * #### Context menu from a dropdown button\n * When used with a dropdown button, the `Button` component takes care of wrapping the menu items in a `Popover`.\n * Just pass the array of `ContextMenuItems` directly into the `Button` as its children.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-2\" />;\nconst item3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-3\" />;\n\n<Button onClick={onClickEffect} dropdownItems={<ContextMenu {...args}>{[item1, item2, item3, item4, item5]}</ContextMenu>}>\n Button text\n</Button>\n```\n *\n */\nconst ContextMenu = React.forwardRef<any, Props>(function ContextMenu(\n { children, ...props },\n forwardedRef\n) {\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => key !== 'sublevel')\n );\n\n // Only root menu creates FloatingTree; submenus reuse ancestor's tree. With 3+ levels it prevents closing submenu children; with 2 levels (all current usage) it's inert.\n const hasTree = useFloatingTree() !== null;\n\n const menu = (\n <S.ContextMenu ref={forwardedRef} {...filteredProps} role=\"menu\">\n {children}\n </S.ContextMenu>\n );\n\n return hasTree ? menu : <FloatingTree>{menu}</FloatingTree>;\n});\n\nexport default ContextMenu;\n"],"names":["ContextMenu","React","forwardRef","children","props","forwardedRef","filteredProps","Object","fromEntries","entries","filter","key","hasTree","useFloatingTree","menu","_jsx","S","ref","role","FloatingTree"],"mappings":";;;;;AA8HA,MAAMA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,WAAWA,CACnE;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;EACA,MAAMC,aAAa,GAAGC,MAAM,CAACC,WAAW,CACtCD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,KAAKA,GAAG,KAAK,UAAU,CAC5D,CAAC;AAGD,EAAA,MAAMC,OAAO,GAAGC,eAAe,EAAE,KAAK,IAAI;AAE1C,EAAA,MAAMC,IAAI,GACRC,GAAA,CAACC,aAAa,EAAA;AAACC,IAAAA,GAAG,EAAEZ,YAAa;AAAA,IAAA,GAAKC,aAAa;AAAEY,IAAAA,IAAI,EAAC,MAAM;AAAAf,IAAAA,QAAA,EAC7DA;AAAQ,GACI,CAChB;AAED,EAAA,OAAOS,OAAO,GAAGE,IAAI,GAAGC,GAAA,CAACI,YAAY,EAAA;AAAAhB,IAAAA,QAAA,EAAEW;AAAI,GAAe,CAAC;AAC7D,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.styled.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * NO COMPONENT IN THIS FILE READS A PROP, so there is no transient-prop type to declare —\n * rule 2, declare only what is actually passed and read. It reported ZERO errors before\n * this commit, and the one thing left to do is the predicate below.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter (v6 `elementToBeCreated`, v5.1\n * `defaultValidatorFn`). A one-parameter function is assignable to both. §J.4.\n *\n * `prop` NEEDS THE ANNOTATION EVEN THOUGH ITS ABSENCE REPORTED NO ERROR. `withConfig`\n * receives this by reference, so it gets no contextual typing and `prop` was an implicit\n * `any` — silent, because `noImplicitAny` is off (+474 errors, see `tsconfig.json`). With\n * `any` there, `prop.startsWith` is unchecked: a typo in the method name would have been a\n * runtime TypeError in the prop filter of every component in the file. A file at zero\n * errors is not the same as a file that is checked.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenu = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n padding: 3px 0;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenu","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily"],"mappings":";;;AAwBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,gCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,cAAA,EAAA,iBAAA,CAAA,EACVC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB;;;;"}
1
+ {"version":3,"file":"ContextMenu.styled.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.styled.ts"],"sourcesContent":["// No components read props, so no transient-prop types to declare.\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenu = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n padding: 3px 0;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenu","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily"],"mappings":";;;AAKA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,gCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,cAAA,EAAA,iBAAA,CAAA,EACVC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItem.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItem.styled';\n\nimport { ReactComponent as TriangleRightIcon } from '../../../../icons/triangle-right.svg';\n\ntype ContextMenuItemOwnProps = {\n /**\n * Menu item text\n */\n title: string;\n /**\n * Optional icon (left side)\n */\n icon?: React.ReactElement<any>;\n /**\n * Function to trigger when the item is clicked\n */\n onClickEffect?: (...args: any[]) => any;\n /**\n * Whether the `ContextMenuItem` opens another `ContextMenu`\n */\n opensSublevel?: boolean;\n /**\n * Array of custom hover text/icon color in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverColors?: string[];\n /**\n * Array of custom hover background colors in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverBackgroundColors?: string[];\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.ContextMenuItem`, 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 ContextMenuItemOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.ContextMenuItem>,\n keyof ContextMenuItemOwnProps\n> &\n ContextMenuItemOwnProps;\n\n/**\n * Single context menu item.\n *\n * See the documentation for `ContextMenu` for usage examples.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItem } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItem from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItem'\n * ```\n */\nconst ContextMenuItem = React.forwardRef<any, Props>(function ContextMenuItem(\n {\n title,\n icon = undefined,\n onClickEffect,\n opensSublevel = false,\n hoverColors = undefined,\n hoverBackgroundColors = undefined,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.ContextMenuItem\n ref={forwardedRef}\n $icon={icon}\n onClick={onClickEffect}\n $hoverColors={hoverColors}\n $hoverBackgroundColors={hoverBackgroundColors}\n $openssublevel={opensSublevel}\n className={opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item'}\n {...props}\n role=\"menuitem\"\n >\n {icon && <S.IconContainer>{icon}</S.IconContainer>}\n <S.Label>{title}</S.Label>\n {opensSublevel && (\n <S.SublevelIconContainer>\n <TriangleRightIcon />\n </S.SublevelIconContainer>\n )}\n </S.ContextMenuItem>\n );\n});\n\nexport default ContextMenuItem;\n"],"names":["ContextMenuItem","React","forwardRef","title","icon","undefined","onClickEffect","opensSublevel","hoverColors","hoverBackgroundColors","props","forwardedRef","_jsxs","S","ref","$icon","onClick","$hoverColors","$hoverBackgroundColors","$openssublevel","className","role","children","_jsx","TriangleRightIcon"],"mappings":";;;;;AA4DA,MAAMA,eAAe,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,eAAeA,CAC3E;EACEG,KAAK;AACLC,EAAAA,IAAI,GAAGC,SAAS;EAChBC,aAAa;AACbC,EAAAA,aAAa,GAAG,KAAK;AACrBC,EAAAA,WAAW,GAAGH,SAAS;AACvBI,EAAAA,qBAAqB,GAAGJ,SAAS;EACjC,GAAGK;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,IAAA,CAACC,iBAAiB,EAAA;AAChBC,IAAAA,GAAG,EAAEH,YAAa;AAClBI,IAAAA,KAAK,EAAEX,IAAK;AACZY,IAAAA,OAAO,EAAEV,aAAc;AACvBW,IAAAA,YAAY,EAAET,WAAY;AAC1BU,IAAAA,sBAAsB,EAAET,qBAAsB;AAC9CU,IAAAA,cAAc,EAAEZ,aAAc;AAC9Ba,IAAAA,SAAS,EAAEb,aAAa,GAAG,kCAAkC,GAAG,mBAAoB;AAAA,IAAA,GAChFG,KAAK;AACTW,IAAAA,IAAI,EAAC,UAAU;AAAAC,IAAAA,QAAA,GAEdlB,IAAI,IAAImB,GAAA,CAACV,aAAe,EAAA;AAAAS,MAAAA,QAAA,EAAElB;AAAI,KAAkB,CAAC,EAClDmB,GAAA,CAACV,KAAO,EAAA;AAAAS,MAAAA,QAAA,EAAEnB;KAAe,CAAC,EACzBI,aAAa,IACZgB,GAAA,CAACV,qBAAuB,EAAA;AAAAS,MAAAA,QAAA,EACtBC,GAAA,CAACC,gBAAiB,EAAA,EAAE;AAAC,KACE,CAC1B;AAAA,GACgB,CAAC;AAExB,CAAC;;;;"}
1
+ {"version":3,"file":"ContextMenuItem.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItem.styled';\n\nimport { ReactComponent as TriangleRightIcon } from '../../../../icons/triangle-right.svg';\n\ntype ContextMenuItemOwnProps = {\n /**\n * Menu item text\n */\n title: string;\n /**\n * Optional icon (left side)\n */\n icon?: React.ReactElement<any>;\n /**\n * Function to trigger when the item is clicked\n */\n onClickEffect?: (...args: any[]) => any;\n /**\n * Whether the `ContextMenuItem` opens another `ContextMenu`\n */\n opensSublevel?: boolean;\n /**\n * Array of custom hover text/icon color in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverColors?: string[];\n /**\n * Array of custom hover background colors in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverBackgroundColors?: string[];\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.ContextMenuItem>,\n keyof ContextMenuItemOwnProps\n> &\n ContextMenuItemOwnProps;\n\n/**\n * Single context menu item.\n *\n * See the documentation for `ContextMenu` for usage examples.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItem } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItem from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItem'\n * ```\n */\nconst ContextMenuItem = React.forwardRef<any, Props>(function ContextMenuItem(\n {\n title,\n icon = undefined,\n onClickEffect,\n opensSublevel = false,\n hoverColors = undefined,\n hoverBackgroundColors = undefined,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.ContextMenuItem\n ref={forwardedRef}\n $icon={icon}\n onClick={onClickEffect}\n $hoverColors={hoverColors}\n $hoverBackgroundColors={hoverBackgroundColors}\n $openssublevel={opensSublevel}\n className={opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item'}\n {...props}\n role=\"menuitem\"\n >\n {icon && <S.IconContainer>{icon}</S.IconContainer>}\n <S.Label>{title}</S.Label>\n {opensSublevel && (\n <S.SublevelIconContainer>\n <TriangleRightIcon />\n </S.SublevelIconContainer>\n )}\n </S.ContextMenuItem>\n );\n});\n\nexport default ContextMenuItem;\n"],"names":["ContextMenuItem","React","forwardRef","title","icon","undefined","onClickEffect","opensSublevel","hoverColors","hoverBackgroundColors","props","forwardedRef","_jsxs","S","ref","$icon","onClick","$hoverColors","$hoverBackgroundColors","$openssublevel","className","role","children","_jsx","TriangleRightIcon"],"mappings":";;;;;AAsDA,MAAMA,eAAe,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,eAAeA,CAC3E;EACEG,KAAK;AACLC,EAAAA,IAAI,GAAGC,SAAS;EAChBC,aAAa;AACbC,EAAAA,aAAa,GAAG,KAAK;AACrBC,EAAAA,WAAW,GAAGH,SAAS;AACvBI,EAAAA,qBAAqB,GAAGJ,SAAS;EACjC,GAAGK;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,IAAA,CAACC,iBAAiB,EAAA;AAChBC,IAAAA,GAAG,EAAEH,YAAa;AAClBI,IAAAA,KAAK,EAAEX,IAAK;AACZY,IAAAA,OAAO,EAAEV,aAAc;AACvBW,IAAAA,YAAY,EAAET,WAAY;AAC1BU,IAAAA,sBAAsB,EAAET,qBAAsB;AAC9CU,IAAAA,cAAc,EAAEZ,aAAc;AAC9Ba,IAAAA,SAAS,EAAEb,aAAa,GAAG,kCAAkC,GAAG,mBAAoB;AAAA,IAAA,GAChFG,KAAK;AACTW,IAAAA,IAAI,EAAC,UAAU;AAAAC,IAAAA,QAAA,GAEdlB,IAAI,IAAImB,GAAA,CAACV,aAAe,EAAA;AAAAS,MAAAA,QAAA,EAAElB;AAAI,KAAkB,CAAC,EAClDmB,GAAA,CAACV,KAAO,EAAA;AAAAS,MAAAA,QAAA,EAAEnB;KAAe,CAAC,EACzBI,aAAa,IACZgB,GAAA,CAACV,qBAAuB,EAAA;AAAAS,MAAAA,QAAA,EACtBC,GAAA,CAACC,gBAAiB,EAAA,EAAE;AAAC,KACE,CAC1B;AAAA,GACgB,CAAC;AAExB,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItem.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * The two stacked defects this file used to carry in its first `&&:hover` block are FIXED,\n * together, because fixing either alone throws: the guard read the run-together\n * `$openssublevelhoverColors` and the rule inside it read `props.hoverColors` with no `$`.\n * Both now read `$hoverColors`, and the guard tests the array's presence before indexing\n * it, exactly like the `$hoverBackgroundColors` block below. That activates a rule that has\n * never been emitted, so it moves the render baseline (§E.3/§J.8); the re-record is a\n * separate, reviewed commit.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\nimport type { ReactElement } from 'react';\n\n/**\n * `ContextMenuItem`'s props, i.e. what `ContextMenuItem.tsx` passes to\n * `<S.ContextMenuItem>`: `$icon`, `$hoverColors`, `$hoverBackgroundColors` and\n * `$openssublevel`. Value types from that file's propTypes; all optional per §J.5.\n */\nexport interface ContextMenuItemStyleProps {\n /** `icon` — `PropTypes.element`, so a React element and not a `ReactNode`. Read only\n * as `!props.$icon`, i.e. for presence. */\n $icon?: ReactElement<any>;\n /** `opensSublevel` — `PropTypes.bool`. Selects the right-hand padding, since a\n * sublevel item has its own chevron in that space. Lower-case by existing convention\n * at both ends; renaming it would be a two-file change for no type benefit. */\n $openssublevel?: boolean;\n /** `hoverColors` — `PropTypes.arrayOf(PropTypes.string)`, documented as exactly\n * `[darkModeColor, lightModeColor]` hex strings. `string[]` and not\n * `[string, string]`: the propTypes say an array of any length, which is why the\n * template guards the array's presence and then `[0]` and `[1]` individually. */\n $hoverColors?: string[];\n /** `hoverBackgroundColors` — same shape as `$hoverColors`. */\n $hoverBackgroundColors?: string[];\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. §J.4. `prop` needs the annotation\n * because `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenuItem = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<ContextMenuItemStyleProps>(applyDefaultTheme)`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n font-weight: normal;\n height: 31px;\n min-width: 160px;\n padding: ${props => (props.$openssublevel ? '0 8px' : '0 28px 0 8px')};\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n\n ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}\n\n ${props =>\n !props.$icon &&\n css`\n padding-left: 28px;\n `}\n\n\n :last-of-type {\n height: 32px;\n }\n\n &:hover {\n cursor: pointer;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-200')\n )}\n }\n\n ${props =>\n props.$hoverColors &&\n props.$hoverColors[0] &&\n props.$hoverColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverColors'>>`\n &&:hover {\n ${props => props.theme.themeProp('color', props.$hoverColors[0], props.$hoverColors[1])}\n }\n `}\n\n ${props =>\n props.$hoverBackgroundColors &&\n props.$hoverBackgroundColors[0] &&\n props.$hoverBackgroundColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverBackgroundColors'>>`\n &&:hover {\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.$hoverBackgroundColors[0],\n props.$hoverBackgroundColors[1]\n )}\n }\n `}\n`;\n\nexport const IconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-right: 8px;\n\n svg {\n height: 12px;\n }\n`;\n\nexport const SublevelIconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-left: auto;\n margin-right: 8px;\n padding-left: 24px;\n\n svg {\n height: 6px;\n width: 6px;\n }\n`;\n\nexport const Label = styled.span`\n align-items: center;\n display: flex;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItem","styled","span","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","$openssublevel","themeProp","getColor","$icon","css","$hoverColors","$hoverBackgroundColors","IconContainer","SublevelIconContainer","Label"],"mappings":";;;AA6CA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,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ContextMenuItem/ContextMenuItem.styled.ts"],"sourcesContent":["// Fixed defect: guard and rule both now read $hoverColors (was run-together $openssublevelhoverColors and props.hoverColors).\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\nimport type { ReactElement } from 'react';\n\n/**\n * Props passed by `ContextMenuItem.tsx` to `<S.ContextMenuItem>`.\n */\nexport interface ContextMenuItemStyleProps {\n /** React element, read for presence only. */\n $icon?: ReactElement<any>;\n /** Selects right-hand padding (sublevel items have their own chevron). */\n $openssublevel?: boolean;\n /** `[darkModeColor, lightModeColor]` hex strings. */\n $hoverColors?: string[];\n /** Same shape as `$hoverColors`. */\n $hoverBackgroundColors?: string[];\n}\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenuItem = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<ContextMenuItemStyleProps>(applyDefaultTheme)`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n font-weight: normal;\n height: 31px;\n min-width: 160px;\n padding: ${props => (props.$openssublevel ? '0 8px' : '0 28px 0 8px')};\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n\n ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}\n\n ${props =>\n !props.$icon &&\n css`\n padding-left: 28px;\n `}\n\n\n :last-of-type {\n height: 32px;\n }\n\n &:hover {\n cursor: pointer;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-200')\n )}\n }\n\n ${props =>\n props.$hoverColors &&\n props.$hoverColors[0] &&\n props.$hoverColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverColors'>>`\n &&:hover {\n ${props => props.theme.themeProp('color', props.$hoverColors[0], props.$hoverColors[1])}\n }\n `}\n\n ${props =>\n props.$hoverBackgroundColors &&\n props.$hoverBackgroundColors[0] &&\n props.$hoverBackgroundColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverBackgroundColors'>>`\n &&:hover {\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.$hoverBackgroundColors[0],\n props.$hoverBackgroundColors[1]\n )}\n }\n `}\n`;\n\nexport const IconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-right: 8px;\n\n svg {\n height: 12px;\n }\n`;\n\nexport const SublevelIconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-left: auto;\n margin-right: 8px;\n padding-left: 24px;\n\n svg {\n height: 6px;\n width: 6px;\n }\n`;\n\nexport const Label = styled.span`\n align-items: center;\n display: flex;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItem","styled","span","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","$openssublevel","themeProp","getColor","$icon","css","$hoverColors","$hoverBackgroundColors","IconContainer","SublevelIconContainer","Label"],"mappings":";;;AAqBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,eAAe,GAAGC,MAAM,CAACC,IAAI,CACvCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA4BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,wCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,6DAAA,EAAA,6EAAA,EAAA,GAAA,EAA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ACS,sBAAsB,CAAC,CAAC,CAAC,IAC/BF,GAAG,CAAA,CAAA,WAAA,EAAA,GAAA,CAAA,EAEGP,KAAK,IACLA,KAAK,CAACC,KAAK,CAACG,SAAS,CACnB,kBAAkB,EAClBJ,KAAK,CAACS,sBAAsB,CAAC,CAAC,CAAC,EAC/BT,KAAK,CAACS,sBAAsB,CAAC,CAAC,CAChC,CAAC,CAEN;AAGE,MAAMC,aAAa,GAAGjB,MAAM,CAACC,IAAI,CACrCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,sCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,sGAAA,CAAA;AAYpB,MAAMY,qBAAqB,GAAGlB,MAAM,CAACC,IAAI,CAC7CC,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,kJAAA,CAAA;MAeda,KAAK,GAAGnB,MAAM,CAACC,IAAI,CAAAC,UAAA,CAAA;EAAAG,WAAA,EAAA,8BAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kCAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItemsGroup.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItemsGroup.styled';\n\ntype ContextMenuItemsGroupOwnProps = {\n /**\n * Nodes of the `ContextMenuItem` component — one, or an array.\n *\n * DEFECT FIXED, NOT TRANSCRIBED. The propTypes said\n * `children: PropTypes.arrayOf(PropTypes.node)`, and the codemod faithfully rendered\n * that as `React.ReactNode[]` — which REJECTS A SINGLE JSX CHILD, because React does not\n * wrap one child in an array:\n *\n * <ContextMenuItemsGroup><ContextMenuItem title=\"Edit\" /></ContextMenuItemsGroup>\n *\n * gives `children` as one element. On React 16 this was a dev-time propTypes warning\n * only, which is how it survived — the React 16 gate is what surfaced it. Under the\n * generated closed type it became a hard COMPILE error at every such call site, in the\n * consumer as well as here, so faithfully reproducing the propTypes would have shipped a\n * type that forbids the component's most obvious usage.\n *\n * `React.ReactNode` is the accurate type and it still admits the array form, since\n * `ReactNode` includes `Iterable<ReactNode>`. The component only forwards `children` to\n * `S.ContextMenuItemsGroup`, so nothing here depends on it being an array. Zero runtime\n * change: the propTypes this replaces were already deleted by the codemod.\n */\n children?: React.ReactNode;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.ContextMenuItemsGroup`, 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 ContextMenuItemsGroupOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n */\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.ContextMenuItemsGroup>,\n keyof ContextMenuItemsGroupOwnProps\n> &\n ContextMenuItemsGroupOwnProps;\n\n/**\n * Simple wrapper for a group of context menu items. These will be displayed without a border between each item.\n *\n * See the documentation for `ContextMenu` for an example.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItemsGroup } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItemsGroup from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItemsGroup'\n * ```\n *\n */\nconst ContextMenuItemsGroup = React.forwardRef<any, Props>(function ContextMenuItemsGroup(\n { children, ...props },\n forwardedRef\n) {\n return (\n <S.ContextMenuItemsGroup ref={forwardedRef} {...props} role=\"group\">\n {children}\n </S.ContextMenuItemsGroup>\n );\n});\n\nexport default ContextMenuItemsGroup;\n"],"names":["ContextMenuItemsGroup","React","forwardRef","children","props","forwardedRef","_jsx","S","ref","role"],"mappings":";;;;AAuDA,MAAMA,qBAAqB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,qBAAqBA,CACvF;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAuB,EAAA;AAACC,IAAAA,GAAG,EAAEH,YAAa;AAAA,IAAA,GAAKD,KAAK;AAAEK,IAAAA,IAAI,EAAC,OAAO;AAAAN,IAAAA,QAAA,EAChEA;AAAQ,GACc,CAAC;AAE9B,CAAC;;;;"}
1
+ {"version":3,"file":"ContextMenuItemsGroup.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItemsGroup.styled';\n\ntype ContextMenuItemsGroupOwnProps = {\n /**\n * Nodes of the `ContextMenuItem` component — one, or an array.\n */\n children?: React.ReactNode;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.ContextMenuItemsGroup>,\n keyof ContextMenuItemsGroupOwnProps\n> &\n ContextMenuItemsGroupOwnProps;\n\n/**\n * Simple wrapper for a group of context menu items. These will be displayed without a border between each item.\n *\n * See the documentation for `ContextMenu` for an example.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItemsGroup } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItemsGroup from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItemsGroup'\n * ```\n *\n */\nconst ContextMenuItemsGroup = React.forwardRef<any, Props>(function ContextMenuItemsGroup(\n { children, ...props },\n forwardedRef\n) {\n return (\n <S.ContextMenuItemsGroup ref={forwardedRef} {...props} role=\"group\">\n {children}\n </S.ContextMenuItemsGroup>\n );\n});\n\nexport default ContextMenuItemsGroup;\n"],"names":["ContextMenuItemsGroup","React","forwardRef","children","props","forwardedRef","_jsx","S","ref","role"],"mappings":";;;;AA+BA,MAAMA,qBAAqB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,qBAAqBA,CACvF;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAuB,EAAA;AAACC,IAAAA,GAAG,EAAEH,YAAa;AAAA,IAAA,GAAKD,KAAK;AAAEK,IAAAA,IAAI,EAAC,OAAO;AAAAN,IAAAA,QAAA,EAChEA;AAAQ,GACc,CAAC;AAE9B,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItemsGroup.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * NO COMPONENT IN THIS FILE READS A PROP, so there is no transient-prop type to declare —\n * rule 2, declare only what is actually passed and read. It reported ZERO errors before\n * this commit, and the one thing left to do is the predicate below.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter (v6 `elementToBeCreated`, v5.1\n * `defaultValidatorFn`). A one-parameter function is assignable to both. §J.4.\n *\n * `prop` NEEDS THE ANNOTATION EVEN THOUGH ITS ABSENCE REPORTED NO ERROR. `withConfig`\n * receives this by reference, so it gets no contextual typing and `prop` was an implicit\n * `any` — silent, because `noImplicitAny` is off (+474 errors, see `tsconfig.json`). With\n * `any` there, `prop.startsWith` is unchecked: a typo in the method name would have been a\n * runtime TypeError in the prop filter of every component in the file. A file at zero\n * errors is not the same as a file that is checked.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenuItemsGroup = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n\n\n > * {\n border-bottom: none !important;\n }\n\n > *:not(:last-child) {\n height: 32px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItemsGroup","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId"],"mappings":";;;AAwBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,qBAAqB,GAAGC,MAAM,CAACC,GAAG,CAC5CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,oDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uEAAA,CAAA;;;;"}
1
+ {"version":3,"file":"ContextMenuItemsGroup.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.ts"],"sourcesContent":["// No components read props, so no transient-prop types to declare.\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenuItemsGroup = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n\n\n > * {\n border-bottom: none !important;\n }\n\n > *:not(:last-child) {\n height: 32px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItemsGroup","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId"],"mappings":";;;AAKA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,qBAAqB,GAAGC,MAAM,CAACC,GAAG,CAC5CC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,oDAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uEAAA,CAAA;;;;"}