@procore/core-react 12.47.1 → 12.48.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/AnchorNavigation/AnchorNavigation.styles.js +4 -4
  3. package/dist/Avatar/Avatar.styles.js +5 -5
  4. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  5. package/dist/Badge/Badge.styles.js +2 -2
  6. package/dist/BadgePill/BadgePill.styles.js +4 -4
  7. package/dist/Banner/Banner.styles.js +10 -10
  8. package/dist/Box/Box.styles.js +1 -1
  9. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  10. package/dist/Button/Button.styles.js +5 -5
  11. package/dist/Calendar/Calendar.styles.js +9 -9
  12. package/dist/Card/Card.styles.js +1 -1
  13. package/dist/Checkbox/Checkbox.styles.js +6 -6
  14. package/dist/CheckboxGroup/CheckboxGroup.js +9 -3
  15. package/dist/CheckboxGroup/CheckboxGroup.js.map +1 -1
  16. package/dist/CheckboxGroup/checkboxGroupTileNavigation.d.ts +12 -0
  17. package/dist/CheckboxGroup/checkboxGroupTileNavigation.js +224 -0
  18. package/dist/CheckboxGroup/checkboxGroupTileNavigation.js.map +1 -0
  19. package/dist/ContactItem/ContactItem.styles.js +5 -5
  20. package/dist/Content/Content.styles.js +2 -2
  21. package/dist/DateInput/DateInput.styles.js +6 -6
  22. package/dist/DateSelect/DateSelect.js +5 -4
  23. package/dist/DateSelect/DateSelect.js.map +1 -1
  24. package/dist/DateSelect/DateSelect.types.d.ts +1 -1
  25. package/dist/DateSelect/DateSelect.types.js.map +1 -1
  26. package/dist/DetailPage/DetailPage.styles.js +7 -7
  27. package/dist/Dropdown/Dropdown.styles.js +3 -3
  28. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  29. package/dist/Dropzone/Dropzone.js +1 -1
  30. package/dist/Dropzone/Dropzone.styles.js +9 -9
  31. package/dist/EmptyState/EmptyState.styles.js +6 -6
  32. package/dist/Field/Field.styles.js +3 -3
  33. package/dist/FileList/FileList.js +4 -0
  34. package/dist/FileList/FileList.js.map +1 -1
  35. package/dist/FileList/FileList.styles.js +3 -3
  36. package/dist/FileList/storybook/fileListMockData.js +14 -14
  37. package/dist/FileList/storybook/fileListMockData.js.map +1 -1
  38. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  39. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  40. package/dist/FileSelect/FileSelect.styles.js +2 -2
  41. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  42. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  43. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  44. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  45. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  46. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  47. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  48. package/dist/FileToken/FileToken.styles.js +6 -6
  49. package/dist/FilterToken/FilterToken.styles.js +5 -5
  50. package/dist/FlexList/FlexList.styles.js +1 -1
  51. package/dist/Form/Form.styles.js +13 -13
  52. package/dist/Form/StyledFormikForm.styles.js +2 -2
  53. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  54. package/dist/Grid/Grid.styles.js +2 -2
  55. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  56. package/dist/Input/Input.styles.js +1 -1
  57. package/dist/Link/Link.styles.js +1 -1
  58. package/dist/ListPage/ListPage.styles.js +8 -8
  59. package/dist/Loader/Loader.styles.js +2 -2
  60. package/dist/MenuImperative/MenuImperative.styles.js +11 -11
  61. package/dist/Modal/Modal.styles.js +13 -13
  62. package/dist/MultiSelect/MultiSelect.styles.js +8 -8
  63. package/dist/NextMenu/NextMenu.styles.js +3 -3
  64. package/dist/NextTile/NextTile.d.ts +24 -0
  65. package/dist/NextTile/NextTile.js +275 -90
  66. package/dist/NextTile/NextTile.js.map +1 -1
  67. package/dist/NextTile/NextTile.styles.d.ts +16 -0
  68. package/dist/NextTile/NextTile.styles.js +136 -0
  69. package/dist/NextTile/NextTile.styles.js.map +1 -0
  70. package/dist/NextTile/NextTile.types.d.ts +14 -2
  71. package/dist/NextTile/NextTile.types.js.map +1 -1
  72. package/dist/Notation/Notation.js +1 -1
  73. package/dist/NumberInput/NumberInput.styles.js +7 -7
  74. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  75. package/dist/PageLayout/PageLayout.styles.js +16 -16
  76. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  77. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  78. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  79. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  80. package/dist/Pagination/Pagination.js +2 -1
  81. package/dist/Pagination/Pagination.js.map +1 -1
  82. package/dist/Pagination/Pagination.styles.js +5 -5
  83. package/dist/Pagination/PaginationSelect.js +15 -2
  84. package/dist/Pagination/PaginationSelect.js.map +1 -1
  85. package/dist/Panel/Panel.styles.js +11 -11
  86. package/dist/Pill/Pill.styles.js +3 -3
  87. package/dist/PillSelect/PillSelect.styles.js +4 -4
  88. package/dist/Popover/Popover.js +2 -3
  89. package/dist/Popover/Popover.js.map +1 -1
  90. package/dist/Popover/Popover.styles.js +2 -2
  91. package/dist/Popover/Popover.types.d.ts +4 -3
  92. package/dist/Popover/Popover.types.js.map +1 -1
  93. package/dist/Portal/Portal.styles.js +1 -1
  94. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  95. package/dist/RadioButton/RadioButton.styles.js +3 -3
  96. package/dist/Required/Required.styles.js +3 -3
  97. package/dist/Search/Search.styles.js +5 -5
  98. package/dist/Section/Section.styles.js +7 -7
  99. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  100. package/dist/Select/Select.styles.js +8 -8
  101. package/dist/Semantic/Semantic.styles.js +9 -9
  102. package/dist/Slider/Slider.styles.js +5 -5
  103. package/dist/Spinner/Spinner.styles.js +8 -8
  104. package/dist/Spinner/Spinner.styles.js.map +1 -1
  105. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  106. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  107. package/dist/SuperSelect/SuperSelect.styles.js +40 -40
  108. package/dist/Switch/Switch.styles.js +4 -4
  109. package/dist/Table/Table.styles.js +29 -29
  110. package/dist/TableShelf/TableShelf.styles.js +5 -5
  111. package/dist/Tabs/Tabs.styles.js +16 -16
  112. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  113. package/dist/TextArea/TextArea.styles.js +1 -1
  114. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  115. package/dist/Thumbnail/Thumbnail.hooks.d.ts +13 -7
  116. package/dist/Thumbnail/Thumbnail.hooks.js +15 -5
  117. package/dist/Thumbnail/Thumbnail.hooks.js.map +1 -1
  118. package/dist/Thumbnail/Thumbnail.js +8 -4
  119. package/dist/Thumbnail/Thumbnail.js.map +1 -1
  120. package/dist/Thumbnail/Thumbnail.styles.d.ts +13 -5
  121. package/dist/Thumbnail/Thumbnail.styles.js +42 -24
  122. package/dist/Thumbnail/Thumbnail.styles.js.map +1 -1
  123. package/dist/Thumbnail/Thumbnail.types.d.ts +12 -10
  124. package/dist/Thumbnail/Thumbnail.types.js.map +1 -1
  125. package/dist/Thumbnail/Thumbnail.utils.d.ts +1 -0
  126. package/dist/Thumbnail/Thumbnail.utils.js +7 -0
  127. package/dist/Thumbnail/Thumbnail.utils.js.map +1 -1
  128. package/dist/Thumbnail/ThumbnailCaption.js +85 -40
  129. package/dist/Thumbnail/ThumbnailCaption.js.map +1 -1
  130. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  131. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  132. package/dist/Tile/Tile.styles.js +10 -10
  133. package/dist/Tile/Tile.styles.js.map +1 -1
  134. package/dist/Title/Title.styles.js +7 -7
  135. package/dist/Toast/Toast.styles.js +3 -3
  136. package/dist/ToggleButton/ToggleButton.styles.js +5 -3
  137. package/dist/ToggleButton/ToggleButton.styles.js.map +1 -1
  138. package/dist/Token/Token.styles.js +5 -5
  139. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  140. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  141. package/dist/Tooltip/Tooltip.styles.js +3 -3
  142. package/dist/Tree/Tree.js +1 -1
  143. package/dist/Tree/Tree.styles.js +10 -10
  144. package/dist/Typeahead/Typeahead.styles.js +3 -3
  145. package/dist/Typography/Typography.styles.js +1 -1
  146. package/dist/Typography/Typography.table.story.js +2 -2
  147. package/dist/_hooks/ClickOutside.js +8 -3
  148. package/dist/_hooks/ClickOutside.js.map +1 -1
  149. package/dist/_hooks/I18n.d.ts +2 -0
  150. package/dist/_locales/en.json +1 -0
  151. package/dist/_locales/pseudo.json +1 -0
  152. package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
  153. package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
  154. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +4 -4
  155. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  156. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +25 -25
  157. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  158. package/dist/_typedoc/Banner/Banner.types.json +15 -15
  159. package/dist/_typedoc/Box/Box.types.json +68 -68
  160. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  161. package/dist/_typedoc/Button/Button.types.json +14 -14
  162. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  163. package/dist/_typedoc/Card/Card.types.json +6 -6
  164. package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
  165. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  166. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  167. package/dist/_typedoc/DateSelect/DateSelect.types.json +23 -13
  168. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  169. package/dist/_typedoc/Dropdown/Dropdown.types.json +38 -38
  170. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +31 -31
  171. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  172. package/dist/_typedoc/EmptyState/EmptyState.types.json +18 -18
  173. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  174. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  175. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  176. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  177. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  178. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  179. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  180. package/dist/_typedoc/Form/Form.types.json +780 -760
  181. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  182. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  183. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +54 -54
  184. package/dist/_typedoc/Input/Input.types.json +2 -2
  185. package/dist/_typedoc/Link/Link.types.json +1 -1
  186. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  187. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  188. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +84 -84
  189. package/dist/_typedoc/Modal/Modal.types.json +48 -48
  190. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +33 -33
  191. package/dist/_typedoc/NextTile/NextTile.types.json +42 -32
  192. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  193. package/dist/_typedoc/NumberInput/NumberInput.types.json +48 -48
  194. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +33 -33
  195. package/dist/_typedoc/PageLayout/PageLayout.types.json +28 -28
  196. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  197. package/dist/_typedoc/Panel/Panel.types.json +28 -28
  198. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  199. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  200. package/dist/_typedoc/Popover/Popover.types.json +19 -19
  201. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
  202. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  203. package/dist/_typedoc/Required/Required.types.json +5 -5
  204. package/dist/_typedoc/Search/Search.types.json +18 -18
  205. package/dist/_typedoc/Section/Section.types.json +15 -15
  206. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  207. package/dist/_typedoc/Select/Select.types.json +67 -67
  208. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  209. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  210. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  211. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
  212. package/dist/_typedoc/Table/Table.types.json +114 -104
  213. package/dist/_typedoc/Tabs/Tabs.types.json +21 -21
  214. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  215. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  216. package/dist/_typedoc/TextEditor/TextEditor.types.json +11 -11
  217. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  218. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +23 -23
  219. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +43 -43
  220. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +29 -29
  221. package/dist/_typedoc/Tile/Tile.types.json +8 -8
  222. package/dist/_typedoc/Title/Title.types.json +1 -1
  223. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  224. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  225. package/dist/_typedoc/Token/Token.types.json +7 -7
  226. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  227. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +8 -8
  228. package/dist/_typedoc/Tooltip/Tooltip.types.json +15 -15
  229. package/dist/_typedoc/Tree/Tree.types.json +88 -88
  230. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  231. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  232. package/dist/_typedoc/_utils/types.json +3 -3
  233. package/dist/_typedoc/a11y-tips.json +1 -1
  234. package/dist/index.d.ts +1 -0
  235. package/dist/index.js +1 -0
  236. package/dist/index.js.map +1 -1
  237. package/package.json +16 -16
@@ -12,50 +12,68 @@ var labelFontSize = 12;
12
12
  var tickSize = 24;
13
13
  var rowLayoutCaptionWidth = 288;
14
14
  var multilineCaptionMaxHeight = spacing.lg * 2;
15
- var captionBase = /*#__PURE__*/css(["color:", ";font-size:12px;line-height:16px;letter-spacing:0.4px;font-weight:500;", " ", " ", " ", ""], colors.gray15, function (_ref) {
15
+ var captionStandaloneLayout = /*#__PURE__*/css(["", " ", ""], function (_ref) {
16
16
  var $layout = _ref.$layout;
17
17
  return $layout === 'row' && css(["align-items:center;margin-left:", "px;width:", "px;"], spacing.sm, rowLayoutCaptionWidth);
18
18
  }, function (_ref2) {
19
19
  var $layout = _ref2.$layout;
20
20
  return $layout === 'column' && css(["margin-top:", "px;width:", "px;"], spacing.xs / 2, thumbnailSizeLg);
21
- }, function (_ref3) {
21
+ });
22
+ var captionStandaloneLayoutUnlessError = /*#__PURE__*/css(["", ";"], function (_ref3) {
22
23
  var $error = _ref3.$error;
23
- return $error && css(["color:", ";"], colors.red50);
24
- }, function (_ref4) {
24
+ return !$error && captionStandaloneLayout;
25
+ });
26
+ var captionTextStyles = /*#__PURE__*/css(["color:", ";font-size:12px;line-height:16px;letter-spacing:0.4px;font-weight:500;", ""], colors.gray15, function (_ref4) {
25
27
  var $disabled = _ref4.$disabled;
26
28
  return $disabled && css(["color:", ";"], colors.gray70);
27
29
  });
30
+ export var StyledThumbnailCaptionStack = /*#__PURE__*/styled.div.withConfig({
31
+ displayName: "StyledThumbnailCaptionStack",
32
+ componentId: "core-12_48_1__sc-195f70c-0"
33
+ })(["", ";display:flex;flex-direction:column;align-items:stretch;"], captionStandaloneLayout);
34
+ export var StyledThumbnailErrorRow = /*#__PURE__*/styled.div.withConfig({
35
+ displayName: "StyledThumbnailErrorRow",
36
+ componentId: "core-12_48_1__sc-195f70c-1"
37
+ })(["font-family:inherit;display:flex;align-items:flex-start;gap:", "px;&:not(:first-child){margin-top:", "px;}color:", ";font-size:12px;line-height:16px;letter-spacing:0.25px;font-weight:400;width:100%;min-width:0;"], spacing.xs, spacing.xs, colors.red50);
38
+ export var StyledThumbnailErrorIcon = /*#__PURE__*/styled.span.withConfig({
39
+ displayName: "StyledThumbnailErrorIcon",
40
+ componentId: "core-12_48_1__sc-195f70c-2"
41
+ })(["flex-shrink:0;display:inline-flex;"]);
42
+ export var StyledThumbnailErrorText = /*#__PURE__*/styled.span.withConfig({
43
+ displayName: "StyledThumbnailErrorText",
44
+ componentId: "core-12_48_1__sc-195f70c-3"
45
+ })(["display:flex;flex:1 1 0;min-width:0;max-width:100%;align-items:center;"]);
28
46
  export var StyledMultilineCaption = /*#__PURE__*/styled.div.withConfig({
29
47
  displayName: "StyledMultilineCaption",
30
- componentId: "core-12_47_1__sc-195f70c-0"
31
- })(["", ";display:flex;word-wrap:break-word;overflow-wrap:break-word;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:", "px;"], captionBase, multilineCaptionMaxHeight);
48
+ componentId: "core-12_48_1__sc-195f70c-4"
49
+ })(["", ";", ";display:flex;word-wrap:break-word;overflow-wrap:break-word;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:", "px;"], captionStandaloneLayoutUnlessError, captionTextStyles, multilineCaptionMaxHeight);
32
50
  export var StyledCaptionText = /*#__PURE__*/styled.span.withConfig({
33
51
  displayName: "StyledCaptionText",
34
- componentId: "core-12_47_1__sc-195f70c-1"
52
+ componentId: "core-12_48_1__sc-195f70c-5"
35
53
  })(["width:100%;"]);
36
54
  export var StyledPlaceholderCaption = /*#__PURE__*/styled.div.withConfig({
37
55
  displayName: "StyledPlaceholderCaption",
38
- componentId: "core-12_47_1__sc-195f70c-2"
39
- })(["", ""], captionBase);
56
+ componentId: "core-12_48_1__sc-195f70c-6"
57
+ })(["", ";", ""], captionStandaloneLayoutUnlessError, captionTextStyles);
40
58
  export var StyledSingleLineCaption = /*#__PURE__*/styled.div.withConfig({
41
59
  displayName: "StyledSingleLineCaption",
42
- componentId: "core-12_47_1__sc-195f70c-3"
43
- })(["display:flex;", ""], captionBase);
60
+ componentId: "core-12_48_1__sc-195f70c-7"
61
+ })(["display:flex;", ";", ""], captionStandaloneLayoutUnlessError, captionTextStyles);
44
62
  export var StyledSinglelineCaptionBody = /*#__PURE__*/styled.span.withConfig({
45
63
  displayName: "StyledSinglelineCaptionBody",
46
- componentId: "core-12_47_1__sc-195f70c-4"
64
+ componentId: "core-12_48_1__sc-195f70c-8"
47
65
  })(["", ""], getEllipsis);
48
66
  export var StyledSinglelineCaptionEnding = /*#__PURE__*/styled.span.withConfig({
49
67
  displayName: "StyledSinglelineCaptionEnding",
50
- componentId: "core-12_47_1__sc-195f70c-5"
68
+ componentId: "core-12_48_1__sc-195f70c-9"
51
69
  })(["max-width:50%;white-space:nowrap;flex-shrink:0;"]);
52
70
  export var StyledLabelText = /*#__PURE__*/styled(Typography).withConfig({
53
71
  displayName: "StyledLabelText",
54
- componentId: "core-12_47_1__sc-195f70c-6"
72
+ componentId: "core-12_48_1__sc-195f70c-10"
55
73
  })(["", ""], getEllipsis());
56
74
  export var StyledThumbnailFigCaption = /*#__PURE__*/styled.figcaption.withConfig({
57
75
  displayName: "StyledThumbnailFigCaption",
58
- componentId: "core-12_47_1__sc-195f70c-7"
76
+ componentId: "core-12_48_1__sc-195f70c-11"
59
77
  })(["", " ", " color:", ";font-weight:", ";text-align:center;width:100%;position:absolute;bottom:0;right:0;left:0;opacity:0.85;height:", "px;padding:", "px ", "px;background-color:", ";"], getTypographyIntent('small'), getEllipsis(), function (_ref5) {
60
78
  var _ref5$$color = _ref5.$color,
61
79
  $color = _ref5$$color === void 0 ? 'gray15' : _ref5$$color;
@@ -63,7 +81,7 @@ export var StyledThumbnailFigCaption = /*#__PURE__*/styled.figcaption.withConfig
63
81
  }, typographyWeights.bold, labelHeight, spacing.sm / 2, spacing.sm, colors.white);
64
82
  export var StyledLabel = /*#__PURE__*/styled.div.withConfig({
65
83
  displayName: "StyledLabel",
66
- componentId: "core-12_47_1__sc-195f70c-8"
84
+ componentId: "core-12_48_1__sc-195f70c-12"
67
85
  })(["display:flex;justify-content:center;position:absolute;bottom:0;right:0;left:0;opacity:0.85;height:", "px;padding:", "px ", "px;font-size:", "px;background-color:", ";"], labelHeight, spacing.sm / 2, spacing.sm, labelFontSize, colors.white);
68
86
  var thumbnailBase = /*#__PURE__*/css(["display:flex;justify-content:center;align-items:center;position:relative;overflow:hidden;border:1px solid ", ";border-radius:", "px;margin:0;", " ", " &:focus{", ";}", " ", " ", ""], colors.gray85, borderRadius.md, function (_ref6) {
69
87
  var $clickable = _ref6.$clickable;
@@ -85,7 +103,7 @@ var thumbnailBase = /*#__PURE__*/css(["display:flex;justify-content:center;align
85
103
  });
86
104
  export var StyledTickIcon = /*#__PURE__*/styled.svg.withConfig({
87
105
  displayName: "StyledTickIcon",
88
- componentId: "core-12_47_1__sc-195f70c-9"
106
+ componentId: "core-12_48_1__sc-195f70c-13"
89
107
  })(["position:absolute;top:", "px;right:", "px;width:", "px;height:", "px;opacity:0;transform:scale(0.75);transition:transform 250ms ease-out,opacity 100ms ease-out;", " ", ""], spacing.sm, spacing.sm, tickSize, tickSize, function (_ref1) {
90
108
  var $selected = _ref1.$selected;
91
109
  return $selected && css(["opacity:1;transform:scale(1);"]);
@@ -95,28 +113,28 @@ export var StyledTickIcon = /*#__PURE__*/styled.svg.withConfig({
95
113
  });
96
114
  export var StyledFileIcon = /*#__PURE__*/styled(DocumentIcon).withConfig({
97
115
  displayName: "StyledFileIcon",
98
- componentId: "core-12_47_1__sc-195f70c-10"
116
+ componentId: "core-12_48_1__sc-195f70c-14"
99
117
  })(["width:36.5%;height:auto;"]);
100
118
  export var StyledImageThumbnailPreview = /*#__PURE__*/styled.div.withConfig({
101
119
  displayName: "StyledImageThumbnailPreview",
102
- componentId: "core-12_47_1__sc-195f70c-11"
120
+ componentId: "core-12_48_1__sc-195f70c-15"
103
121
  })(["width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center;", ""], function (_ref11) {
104
122
  var $bgImage = _ref11.$bgImage;
105
123
  return css(["background-image:url(", ");"], $bgImage);
106
124
  });
107
125
  export var StyledImageThumbnailOverlay = /*#__PURE__*/styled.div.withConfig({
108
126
  displayName: "StyledImageThumbnailOverlay",
109
- componentId: "core-12_47_1__sc-195f70c-12"
127
+ componentId: "core-12_48_1__sc-195f70c-16"
110
128
  })(["display:none;position:absolute;top:0;bottom:0;left:0;right:0;"]);
111
129
  var blackOverlay = "\n background-color: ".concat(colors.black, ";\n opacity: 0.2;\n");
112
130
  var whiteOverlay = "\n background-color: ".concat(colors.white, ";\n opacity: 0.5;\n");
113
131
  export var StyledImageThumbnailImage = /*#__PURE__*/styled.img.withConfig({
114
132
  displayName: "StyledImageThumbnailImage",
115
- componentId: "core-12_47_1__sc-195f70c-13"
133
+ componentId: "core-12_48_1__sc-195f70c-17"
116
134
  })([""]);
117
135
  export var StyledImageThumbnail = /*#__PURE__*/styled.div.withConfig({
118
136
  displayName: "StyledImageThumbnail",
119
- componentId: "core-12_47_1__sc-195f70c-14"
137
+ componentId: "core-12_48_1__sc-195f70c-18"
120
138
  })(["", ";flex-direction:column;", " ", " ", " ", " ", " ", ""], thumbnailBase, function (_ref12) {
121
139
  var $disabled = _ref12.$disabled;
122
140
  return $disabled && css(["&,&:hover{", "{display:block;", "}}", ",", ",", "{filter:saturate(0);}", "{filter:saturate(0);z-index:-1;}"], StyledImageThumbnailOverlay, whiteOverlay, StyledImageThumbnailPreview, StyledTickIcon, StyledImageThumbnailImage, StyledFileIcon);
@@ -145,7 +163,7 @@ export var StyledImageThumbnail = /*#__PURE__*/styled.div.withConfig({
145
163
  });
146
164
  export var StyledThumbnailWrapper = /*#__PURE__*/styled.div.withConfig({
147
165
  displayName: "StyledThumbnailWrapper",
148
- componentId: "core-12_47_1__sc-195f70c-15"
166
+ componentId: "core-12_48_1__sc-195f70c-19"
149
167
  })(["display:flex;", " ", ""], function (_ref18) {
150
168
  var $size = _ref18.$size;
151
169
  return $size === 'lg' ? "\n width: ".concat(thumbnailSizeLg, "px;\n ") : '';
@@ -156,7 +174,7 @@ export var StyledThumbnailWrapper = /*#__PURE__*/styled.div.withConfig({
156
174
  });
157
175
  export var StyledPlaceholderThumbnail = /*#__PURE__*/styled.div.withConfig({
158
176
  displayName: "StyledPlaceholderThumbnail",
159
- componentId: "core-12_47_1__sc-195f70c-16"
177
+ componentId: "core-12_48_1__sc-195f70c-20"
160
178
  })(["", " ", " ", " ", " ", ""], thumbnailBase, function (_ref20) {
161
179
  var $clickable = _ref20.$clickable;
162
180
  return $clickable && css(["&:hover{background-color:", ";}"], colors.gray96);
@@ -1 +1 @@
1
- {"version":3,"file":"Thumbnail.styles.js","names":["styled","css","getTypographyIntent","Typography","typographyWeights","borderRadius","colors","getEllipsis","getFocus","spacing","DocumentIcon","thumbnailSizeSm","thumbnailSizeLg","labelHeight","labelFontSize","tickSize","rowLayoutCaptionWidth","multilineCaptionMaxHeight","lg","captionBase","gray15","_ref","$layout","sm","_ref2","xs","_ref3","$error","red50","_ref4","$disabled","gray70","StyledMultilineCaption","div","withConfig","displayName","componentId","StyledCaptionText","span","StyledPlaceholderCaption","StyledSingleLineCaption","StyledSinglelineCaptionBody","StyledSinglelineCaptionEnding","StyledLabelText","StyledThumbnailFigCaption","figcaption","_ref5","_ref5$$color","$color","bold","white","StyledLabel","thumbnailBase","gray85","md","_ref6","$clickable","_ref7","$selected","StyledTickIcon","_ref8","$focused","_ref9","_ref0","$size","sizeInPx","concat","svg","_ref1","_ref10","StyledFileIcon","StyledImageThumbnailPreview","_ref11","$bgImage","StyledImageThumbnailOverlay","blackOverlay","black","whiteOverlay","StyledImageThumbnailImage","img","StyledImageThumbnail","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","StyledThumbnailWrapper","_ref18","_ref19","isRowLayout","StyledPlaceholderThumbnail","_ref20","gray96","_ref21","_ref22","_ref23"],"sources":["../../src/Thumbnail/Thumbnail.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { TypographyProps } from '../Typography'\nimport {\n getTypographyIntent,\n Typography,\n typographyWeights,\n} from '../Typography'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getEllipsis, getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\nimport type { LayoutVariant, SizeVariant } from './Thumbnail.types'\nimport { DocumentIcon } from './ThumbnailDocumentIcon'\n\nconst thumbnailSizeSm = 40\nconst thumbnailSizeLg = 104\nconst labelHeight = 24\nconst labelFontSize = 12\nconst tickSize = 24\nconst rowLayoutCaptionWidth = 288\nconst multilineCaptionMaxHeight = spacing.lg * 2\n\ninterface CaptionProps {\n $layout: LayoutVariant\n $error: boolean\n $disabled: boolean\n}\n\ninterface StyledThumbnailProps {\n $focused: boolean\n $disabled: boolean\n $selected: boolean\n $clickable: boolean\n $size: SizeVariant\n}\n\ninterface StyledTickIconProps {\n $selected: boolean\n $size: SizeVariant\n}\n\nconst captionBase = css<CaptionProps>`\n color: ${colors.gray15};\n font-size: 12px;\n line-height: 16px;\n letter-spacing: 0.4px;\n font-weight: 500;\n ${({ $layout }) =>\n $layout === 'row' &&\n css`\n align-items: center;\n margin-left: ${spacing.sm}px;\n width: ${rowLayoutCaptionWidth}px;\n `}\n\n ${({ $layout }) =>\n $layout === 'column' &&\n css`\n margin-top: ${spacing.xs / 2}px;\n width: ${thumbnailSizeLg}px;\n `}\n\n ${({ $error }) =>\n $error &&\n css`\n color: ${colors.red50};\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n color: ${colors.gray70};\n `}\n`\n\nexport const StyledMultilineCaption = styled.div<CaptionProps>`\n ${captionBase};\n display: flex;\n word-wrap: break-word;\n // for IE11, use word-wrap property\n overflow-wrap: break-word;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n\n // limit height for browsers that do not support line-clamp CSS prop\n max-height: ${multilineCaptionMaxHeight}px;\n`\n\nexport const StyledCaptionText = styled.span`\n // fix word wrap issue in IE\n width: 100%;\n`\n\nexport const StyledPlaceholderCaption = styled.div<CaptionProps>`\n ${captionBase}\n`\n\nexport const StyledSingleLineCaption = styled.div<CaptionProps>`\n display: flex;\n ${captionBase}\n`\n\nexport const StyledSinglelineCaptionBody = styled.span`\n ${getEllipsis}\n`\n\nexport const StyledSinglelineCaptionEnding = styled.span`\n max-width: 50%;\n white-space: nowrap;\n flex-shrink: 0;\n`\n\nexport const StyledLabelText = styled(Typography)`\n ${getEllipsis()}\n`\n\nexport const StyledThumbnailFigCaption = styled.figcaption<{\n $color?: TypographyProps['color']\n}>`\n ${getTypographyIntent('small')}\n ${getEllipsis()}\n color: ${({ $color = 'gray15' }) => colors[$color]};\n font-weight: ${typographyWeights.bold};\n text-align: center;\n width: 100%;\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n opacity: 0.85;\n height: ${labelHeight}px;\n padding: ${spacing.sm / 2}px ${spacing.sm}px;\n background-color: ${colors.white};\n`\n\nexport const StyledLabel = styled.div`\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n opacity: 0.85;\n height: ${labelHeight}px;\n padding: ${spacing.sm / 2}px ${spacing.sm}px;\n font-size: ${labelFontSize}px;\n background-color: ${colors.white};\n`\n\nconst thumbnailBase = css<StyledThumbnailProps>`\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n overflow: hidden;\n border: 1px solid ${colors.gray85};\n border-radius: ${borderRadius.md}px;\n margin: 0;\n\n ${({ $clickable }) =>\n $clickable &&\n css`\n cursor: pointer;\n `}\n\n ${({ $selected }) =>\n $selected &&\n css`\n ${StyledTickIcon} {\n opacity: 1;\n transform: scale(1);\n }\n `}\n\n &:focus {\n ${getFocus()};\n }\n\n ${({ $focused }) => $focused && getFocus()}\n\n ${({ $disabled, $clickable }) =>\n $disabled &&\n $clickable &&\n css`\n cursor: not-allowed;\n `}\n\n ${({ $size }) => {\n const sizeInPx = `${$size === 'lg' ? thumbnailSizeLg : thumbnailSizeSm}px`\n return css`\n width: ${sizeInPx};\n height: ${sizeInPx};\n `\n }}\n`\n\nexport const StyledTickIcon = styled.svg<StyledTickIconProps>`\n position: absolute;\n top: ${spacing.sm}px;\n right: ${spacing.sm}px;\n width: ${tickSize}px;\n height: ${tickSize}px;\n opacity: 0;\n transform: scale(0.75);\n transition: transform 250ms ease-out, opacity 100ms ease-out;\n\n ${({ $selected }) =>\n $selected &&\n css`\n opacity: 1;\n transform: scale(1);\n `}\n\n ${({ $size }) =>\n $size === 'sm' &&\n css`\n top: 50%;\n left: 50%;\n margin-top: ${-tickSize / 2}px;\n margin-left: ${-tickSize / 2}px;\n `}\n`\n\nexport const StyledFileIcon = styled(DocumentIcon)`\n width: 36.5%;\n height: auto;\n`\n\nexport const StyledImageThumbnailPreview = styled.div<{ $bgImage: string }>`\n width: 100%;\n height: 100%;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n ${({ $bgImage }) => css`\n background-image: url(${$bgImage});\n `}\n`\n\nexport const StyledImageThumbnailOverlay = styled.div`\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n`\n\nconst blackOverlay = `\n background-color: ${colors.black};\n opacity: 0.2;\n`\n\nconst whiteOverlay = `\n background-color: ${colors.white};\n opacity: 0.5;\n`\n\nexport const StyledImageThumbnailImage = styled.img``\n\nexport const StyledImageThumbnail = styled.div<StyledThumbnailProps>`\n ${thumbnailBase};\n flex-direction: column;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n &,\n &:hover {\n ${StyledImageThumbnailOverlay} {\n display: block;\n ${whiteOverlay}\n }\n }\n ${StyledImageThumbnailPreview},\n ${StyledTickIcon},\n ${StyledImageThumbnailImage} {\n filter: saturate(0);\n }\n ${StyledFileIcon} {\n filter: saturate(0);\n z-index: -1;\n }\n `}\n\n ${({ $selected, $focused, $disabled }) =>\n $focused &&\n $disabled &&\n css`\n ${StyledTickIcon} {\n z-index: ${$selected ? 0 : 1};\n }\n `}\n\n ${({ $selected, $focused }) =>\n $selected &&\n $focused &&\n css`\n ${StyledTickIcon} {\n z-index: 1;\n }\n `}\n\n ${({ $selected, $focused, $disabled }) =>\n $selected &&\n $focused &&\n $disabled &&\n css`\n ${StyledTickIcon} {\n z-index: 0;\n }\n `}\n\n ${({ $focused, $disabled }) =>\n $focused &&\n !$disabled &&\n css`\n ${StyledImageThumbnailOverlay} {\n display: block;\n }\n `}\n\n ${({ $clickable, $disabled }) =>\n $clickable &&\n !$disabled &&\n css`\n &:hover {\n ${StyledImageThumbnailOverlay} {\n display: block;\n ${blackOverlay}\n }\n }\n `}\n`\n\nexport const StyledThumbnailWrapper = styled.div<{\n $layout: LayoutVariant\n $size: SizeVariant\n}>`\n display: flex;\n ${({ $size }) =>\n $size === 'lg'\n ? `\n width: ${thumbnailSizeLg}px;\n `\n : ''}\n ${({ $layout }) => {\n const isRowLayout = $layout === 'row'\n return isRowLayout\n ? css`\n flex-direction: row;\n align-items: center;\n `\n : css`\n flex-direction: column;\n align-items: flex-start;\n `\n }}\n`\n\nexport const StyledPlaceholderThumbnail = styled.div<StyledThumbnailProps>`\n ${thumbnailBase}\n\n ${({ $clickable }) =>\n $clickable &&\n css`\n &:hover {\n background-color: ${colors.gray96};\n }\n `}\n\n ${({ $selected, $size }) =>\n $selected &&\n $size === 'sm' &&\n css`\n ${StyledFileIcon} {\n display: none;\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n ${StyledFileIcon},\n ${StyledTickIcon} {\n filter: saturate(0);\n opacity: 0.5;\n }\n\n &:hover {\n background-color: inherit;\n }\n `}\n\n ${({ $disabled, $selected }) =>\n $disabled &&\n !$selected &&\n css`\n ${StyledTickIcon} {\n opacity: 0;\n transform: scale(0.75);\n }\n `}\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SACEC,mBAAmB,EACnBC,UAAU,EACVC,iBAAiB,QACZ,eAAe;AACtB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,IAAMC,eAAe,GAAG,EAAE;AAC1B,IAAMC,eAAe,GAAG,GAAG;AAC3B,IAAMC,WAAW,GAAG,EAAE;AACtB,IAAMC,aAAa,GAAG,EAAE;AACxB,IAAMC,QAAQ,GAAG,EAAE;AACnB,IAAMC,qBAAqB,GAAG,GAAG;AACjC,IAAMC,yBAAyB,GAAGR,OAAO,CAACS,EAAE,GAAG,CAAC;AAqBhD,IAAMC,WAAW,gBAAGlB,GAAG,0GACZK,MAAM,CAACc,MAAM,EAKpB,UAAAC,IAAA;EAAA,IAAGC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAAA,OACVA,OAAO,KAAK,KAAK,IACjBrB,GAAG,0DAEcQ,OAAO,CAACc,EAAE,EAChBP,qBAAqB,CAC/B;AAAA,GAED,UAAAQ,KAAA;EAAA,IAAGF,OAAO,GAAAE,KAAA,CAAPF,OAAO;EAAA,OACVA,OAAO,KAAK,QAAQ,IACpBrB,GAAG,sCACaQ,OAAO,CAACgB,EAAE,GAAG,CAAC,EACnBb,eAAe,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,IACTM,KAAK,KAAK,IAAI,IACd/D,GAAG,0BACCqE,cAAc,CAGjB;AAAA,GAED,UAAAyB,MAAA;EAAA,IAAGjE,SAAS,GAAAiE,MAAA,CAATjE,SAAS;EAAA,OACZA,SAAS,IACT7B,GAAG,mFACCqE,cAAc,EACdX,cAAc,CAQjB;AAAA,GAED,UAAAqC,MAAA;EAAA,IAAGlE,SAAS,GAAAkE,MAAA,CAATlE,SAAS;IAAE4B,SAAS,GAAAsC,MAAA,CAATtC,SAAS;EAAA,OACvB5B,SAAS,IACT,CAAC4B,SAAS,IACVzD,GAAG,6CACC0D,cAAc,CAIjB;AAAA,EACJ"}
1
+ {"version":3,"file":"Thumbnail.styles.js","names":["styled","css","getTypographyIntent","Typography","typographyWeights","borderRadius","colors","getEllipsis","getFocus","spacing","DocumentIcon","thumbnailSizeSm","thumbnailSizeLg","labelHeight","labelFontSize","tickSize","rowLayoutCaptionWidth","multilineCaptionMaxHeight","lg","captionStandaloneLayout","_ref","$layout","sm","_ref2","xs","captionStandaloneLayoutUnlessError","_ref3","$error","captionTextStyles","gray15","_ref4","$disabled","gray70","StyledThumbnailCaptionStack","div","withConfig","displayName","componentId","StyledThumbnailErrorRow","red50","StyledThumbnailErrorIcon","span","StyledThumbnailErrorText","StyledMultilineCaption","StyledCaptionText","StyledPlaceholderCaption","StyledSingleLineCaption","StyledSinglelineCaptionBody","StyledSinglelineCaptionEnding","StyledLabelText","StyledThumbnailFigCaption","figcaption","_ref5","_ref5$$color","$color","bold","white","StyledLabel","thumbnailBase","gray85","md","_ref6","$clickable","_ref7","$selected","StyledTickIcon","_ref8","$focused","_ref9","_ref0","$size","sizeInPx","concat","svg","_ref1","_ref10","StyledFileIcon","StyledImageThumbnailPreview","_ref11","$bgImage","StyledImageThumbnailOverlay","blackOverlay","black","whiteOverlay","StyledImageThumbnailImage","img","StyledImageThumbnail","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","StyledThumbnailWrapper","_ref18","_ref19","isRowLayout","StyledPlaceholderThumbnail","_ref20","gray96","_ref21","_ref22","_ref23"],"sources":["../../src/Thumbnail/Thumbnail.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { TypographyProps } from '../Typography'\nimport {\n getTypographyIntent,\n Typography,\n typographyWeights,\n} from '../Typography'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getEllipsis, getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\nimport type { LayoutVariant, SizeVariant } from './Thumbnail.types'\nimport { DocumentIcon } from './ThumbnailDocumentIcon'\n\nconst thumbnailSizeSm = 40\nconst thumbnailSizeLg = 104\nconst labelHeight = 24\nconst labelFontSize = 12\nconst tickSize = 24\nconst rowLayoutCaptionWidth = 288\nconst multilineCaptionMaxHeight = spacing.lg * 2\n\ninterface CaptionTextProps {\n $layout: LayoutVariant\n $disabled: boolean\n}\n\ntype CaptionErrorLayoutProps = CaptionTextProps & { $error?: boolean }\n\nconst captionStandaloneLayout = css<{ $layout: LayoutVariant }>`\n ${({ $layout }) =>\n $layout === 'row' &&\n css`\n align-items: center;\n margin-left: ${spacing.sm}px;\n width: ${rowLayoutCaptionWidth}px;\n `}\n\n ${({ $layout }) =>\n $layout === 'column' &&\n css`\n margin-top: ${spacing.xs / 2}px;\n width: ${thumbnailSizeLg}px;\n `}\n`\n\nconst captionStandaloneLayoutUnlessError = css<CaptionErrorLayoutProps>`\n ${({ $error }) => !$error && captionStandaloneLayout};\n`\n\ninterface StyledThumbnailProps {\n $focused: boolean\n $disabled: boolean\n $selected: boolean\n $clickable: boolean\n $size: SizeVariant\n}\n\ninterface StyledTickIconProps {\n $selected: boolean\n $size: SizeVariant\n}\n\nconst captionTextStyles = css<CaptionTextProps>`\n color: ${colors.gray15};\n font-size: 12px;\n line-height: 16px;\n letter-spacing: 0.4px;\n font-weight: 500;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n color: ${colors.gray70};\n `}\n`\n\nexport const StyledThumbnailCaptionStack = styled.div<{\n $layout: LayoutVariant\n}>`\n ${captionStandaloneLayout};\n display: flex;\n flex-direction: column;\n align-items: stretch;\n`\n\nexport const StyledThumbnailErrorRow = styled.div`\n font-family: inherit;\n display: flex;\n align-items: flex-start;\n gap: ${spacing.xs}px;\n &:not(:first-child) {\n margin-top: ${spacing.xs}px;\n }\n color: ${colors.red50};\n font-size: 12px;\n line-height: 16px;\n letter-spacing: 0.25px;\n font-weight: 400;\n width: 100%;\n min-width: 0;\n`\n\nexport const StyledThumbnailErrorIcon = styled.span`\n flex-shrink: 0;\n display: inline-flex;\n`\n\nexport const StyledThumbnailErrorText = styled.span`\n display: flex;\n flex: 1 1 0;\n min-width: 0;\n max-width: 100%;\n align-items: center;\n`\n\nexport const StyledMultilineCaption = styled.div<CaptionErrorLayoutProps>`\n ${captionStandaloneLayoutUnlessError};\n ${captionTextStyles};\n display: flex;\n word-wrap: break-word;\n // for IE11, use word-wrap property\n overflow-wrap: break-word;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n\n // limit height for browsers that do not support line-clamp CSS prop\n max-height: ${multilineCaptionMaxHeight}px;\n`\n\nexport const StyledCaptionText = styled.span`\n // fix word wrap issue in IE\n width: 100%;\n`\n\nexport const StyledPlaceholderCaption = styled.div<CaptionErrorLayoutProps>`\n ${captionStandaloneLayoutUnlessError};\n ${captionTextStyles}\n`\n\nexport const StyledSingleLineCaption = styled.div<CaptionErrorLayoutProps>`\n display: flex;\n ${captionStandaloneLayoutUnlessError};\n ${captionTextStyles}\n`\n\nexport const StyledSinglelineCaptionBody = styled.span`\n ${getEllipsis}\n`\n\nexport const StyledSinglelineCaptionEnding = styled.span`\n max-width: 50%;\n white-space: nowrap;\n flex-shrink: 0;\n`\n\nexport const StyledLabelText = styled(Typography)`\n ${getEllipsis()}\n`\n\nexport const StyledThumbnailFigCaption = styled.figcaption<{\n $color?: TypographyProps['color']\n}>`\n ${getTypographyIntent('small')}\n ${getEllipsis()}\n color: ${({ $color = 'gray15' }) => colors[$color]};\n font-weight: ${typographyWeights.bold};\n text-align: center;\n width: 100%;\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n opacity: 0.85;\n height: ${labelHeight}px;\n padding: ${spacing.sm / 2}px ${spacing.sm}px;\n background-color: ${colors.white};\n`\n\nexport const StyledLabel = styled.div`\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n opacity: 0.85;\n height: ${labelHeight}px;\n padding: ${spacing.sm / 2}px ${spacing.sm}px;\n font-size: ${labelFontSize}px;\n background-color: ${colors.white};\n`\n\nconst thumbnailBase = css<StyledThumbnailProps>`\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n overflow: hidden;\n border: 1px solid ${colors.gray85};\n border-radius: ${borderRadius.md}px;\n margin: 0;\n\n ${({ $clickable }) =>\n $clickable &&\n css`\n cursor: pointer;\n `}\n\n ${({ $selected }) =>\n $selected &&\n css`\n ${StyledTickIcon} {\n opacity: 1;\n transform: scale(1);\n }\n `}\n\n &:focus {\n ${getFocus()};\n }\n\n ${({ $focused }) => $focused && getFocus()}\n\n ${({ $disabled, $clickable }) =>\n $disabled &&\n $clickable &&\n css`\n cursor: not-allowed;\n `}\n\n ${({ $size }) => {\n const sizeInPx = `${$size === 'lg' ? thumbnailSizeLg : thumbnailSizeSm}px`\n return css`\n width: ${sizeInPx};\n height: ${sizeInPx};\n `\n }}\n`\n\nexport const StyledTickIcon = styled.svg<StyledTickIconProps>`\n position: absolute;\n top: ${spacing.sm}px;\n right: ${spacing.sm}px;\n width: ${tickSize}px;\n height: ${tickSize}px;\n opacity: 0;\n transform: scale(0.75);\n transition: transform 250ms ease-out, opacity 100ms ease-out;\n\n ${({ $selected }) =>\n $selected &&\n css`\n opacity: 1;\n transform: scale(1);\n `}\n\n ${({ $size }) =>\n $size === 'sm' &&\n css`\n top: 50%;\n left: 50%;\n margin-top: ${-tickSize / 2}px;\n margin-left: ${-tickSize / 2}px;\n `}\n`\n\nexport const StyledFileIcon = styled(DocumentIcon)`\n width: 36.5%;\n height: auto;\n`\n\nexport const StyledImageThumbnailPreview = styled.div<{ $bgImage: string }>`\n width: 100%;\n height: 100%;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n ${({ $bgImage }) => css`\n background-image: url(${$bgImage});\n `}\n`\n\nexport const StyledImageThumbnailOverlay = styled.div`\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n`\n\nconst blackOverlay = `\n background-color: ${colors.black};\n opacity: 0.2;\n`\n\nconst whiteOverlay = `\n background-color: ${colors.white};\n opacity: 0.5;\n`\n\nexport const StyledImageThumbnailImage = styled.img``\n\nexport const StyledImageThumbnail = styled.div<StyledThumbnailProps>`\n ${thumbnailBase};\n flex-direction: column;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n &,\n &:hover {\n ${StyledImageThumbnailOverlay} {\n display: block;\n ${whiteOverlay}\n }\n }\n ${StyledImageThumbnailPreview},\n ${StyledTickIcon},\n ${StyledImageThumbnailImage} {\n filter: saturate(0);\n }\n ${StyledFileIcon} {\n filter: saturate(0);\n z-index: -1;\n }\n `}\n\n ${({ $selected, $focused, $disabled }) =>\n $focused &&\n $disabled &&\n css`\n ${StyledTickIcon} {\n z-index: ${$selected ? 0 : 1};\n }\n `}\n\n ${({ $selected, $focused }) =>\n $selected &&\n $focused &&\n css`\n ${StyledTickIcon} {\n z-index: 1;\n }\n `}\n\n ${({ $selected, $focused, $disabled }) =>\n $selected &&\n $focused &&\n $disabled &&\n css`\n ${StyledTickIcon} {\n z-index: 0;\n }\n `}\n\n ${({ $focused, $disabled }) =>\n $focused &&\n !$disabled &&\n css`\n ${StyledImageThumbnailOverlay} {\n display: block;\n }\n `}\n\n ${({ $clickable, $disabled }) =>\n $clickable &&\n !$disabled &&\n css`\n &:hover {\n ${StyledImageThumbnailOverlay} {\n display: block;\n ${blackOverlay}\n }\n }\n `}\n`\n\nexport const StyledThumbnailWrapper = styled.div<{\n $layout: LayoutVariant\n $size: SizeVariant\n}>`\n display: flex;\n ${({ $size }) =>\n $size === 'lg'\n ? `\n width: ${thumbnailSizeLg}px;\n `\n : ''}\n ${({ $layout }) => {\n const isRowLayout = $layout === 'row'\n return isRowLayout\n ? css`\n flex-direction: row;\n align-items: center;\n `\n : css`\n flex-direction: column;\n align-items: flex-start;\n `\n }}\n`\n\nexport const StyledPlaceholderThumbnail = styled.div<StyledThumbnailProps>`\n ${thumbnailBase}\n\n ${({ $clickable }) =>\n $clickable &&\n css`\n &:hover {\n background-color: ${colors.gray96};\n }\n `}\n\n ${({ $selected, $size }) =>\n $selected &&\n $size === 'sm' &&\n css`\n ${StyledFileIcon} {\n display: none;\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n ${StyledFileIcon},\n ${StyledTickIcon} {\n filter: saturate(0);\n opacity: 0.5;\n }\n\n &:hover {\n background-color: inherit;\n }\n `}\n\n ${({ $disabled, $selected }) =>\n $disabled &&\n !$selected &&\n css`\n ${StyledTickIcon} {\n opacity: 0;\n transform: scale(0.75);\n }\n `}\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SACEC,mBAAmB,EACnBC,UAAU,EACVC,iBAAiB,QACZ,eAAe;AACtB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,IAAMC,eAAe,GAAG,EAAE;AAC1B,IAAMC,eAAe,GAAG,GAAG;AAC3B,IAAMC,WAAW,GAAG,EAAE;AACtB,IAAMC,aAAa,GAAG,EAAE;AACxB,IAAMC,QAAQ,GAAG,EAAE;AACnB,IAAMC,qBAAqB,GAAG,GAAG;AACjC,IAAMC,yBAAyB,GAAGR,OAAO,CAAC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,GAAG,mFACC2E,cAAc,EACdX,cAAc,CAQjB;AAAA,GAED,UAAAqC,MAAA;EAAA,IAAGvE,SAAS,GAAAuE,MAAA,CAATvE,SAAS;IAAEiC,SAAS,GAAAsC,MAAA,CAATtC,SAAS;EAAA,OACvBjC,SAAS,IACT,CAACiC,SAAS,IACV/D,GAAG,6CACCgE,cAAc,CAIjB;AAAA,EACJ"}
@@ -60,9 +60,11 @@ export interface BaseThumbnailProps extends Props {
60
60
  */
61
61
  disabled?: boolean;
62
62
  /**
63
+ * When true, Thumbnail shows the default error label.
64
+ * When a string is provided, it is shown as custom error text.
63
65
  * @since 10.19.0
64
66
  */
65
- error?: boolean;
67
+ error?: boolean | string;
66
68
  /**
67
69
  * @since 10.19.0
68
70
  */
@@ -148,10 +150,6 @@ export interface MultilineCaptionProps {
148
150
  * @since 10.19.0
149
151
  */
150
152
  caption: string;
151
- /**
152
- * @since 10.19.0
153
- */
154
- error: boolean;
155
153
  /**
156
154
  * @since 10.19.0
157
155
  */
@@ -164,6 +162,10 @@ export interface MultilineCaptionProps {
164
162
  * Called when the caption overflow state changes (e.g. when it becomes truncated).
165
163
  */
166
164
  onCaptionOverflowChange?: (isOverflowing: boolean) => void;
165
+ /**
166
+ * When true, the caption is shown in the error stack (with the error row) and omits standalone caption margins.
167
+ */
168
+ error?: boolean;
167
169
  }
168
170
  export interface SinglelineCaptionProps {
169
171
  /**
@@ -178,10 +180,6 @@ export interface SinglelineCaptionProps {
178
180
  * @since 10.19.0
179
181
  */
180
182
  disabled: boolean;
181
- /**
182
- * @since 10.19.0
183
- */
184
- error: boolean;
185
183
  /**
186
184
  * @since 10.19.0
187
185
  */
@@ -194,6 +192,10 @@ export interface SinglelineCaptionProps {
194
192
  * Called when the caption overflow state changes (e.g. when it becomes truncated).
195
193
  */
196
194
  onCaptionOverflowChange?: (isOverflowing: boolean) => void;
195
+ /**
196
+ * When true, the caption is shown in the error stack (with the error row) and omits standalone caption margins.
197
+ */
198
+ error?: boolean;
197
199
  }
198
200
  export interface CaptionTooltipProps {
199
201
  /**
@@ -229,7 +231,7 @@ export interface CaptionProps {
229
231
  /**
230
232
  * @since 10.19.0
231
233
  */
232
- error?: boolean;
234
+ error?: boolean | string;
233
235
  /**
234
236
  * @since 10.19.0
235
237
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Thumbnail.types.js","names":[],"sources":["../../src/Thumbnail/Thumbnail.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { ReactNode } from 'react'\nimport type { Polymorphic } from '../_utils/polymorphic'\nimport type { AriaLabelled, Props } from '../_utils/types'\nimport type { ThumbnailDocumentIconVariant } from './ThumbnailDocumentIcon'\n\nexport type SizeVariant = 'sm' | 'lg'\n\nexport type LayoutVariant = 'row' | 'column'\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n caption?: string\n}\n\n/**\n * @since 11.6.0\n */\nexport type ThumbnailRoleType = 'checkbox' | 'figure'\n\nexport type ThumbnailRoles = ThumbnailRoleType | undefined\n\nexport interface ThumbnailPolyMap\n extends Record<ThumbnailRoleType, React.ElementType> {\n figure: 'figure'\n checkbox: 'input'\n}\n\n/**\n * @since 11.6.0\n */\nexport type ThumbnailRef<Role extends ThumbnailRoles = undefined> =\n Role extends ThumbnailRoleType\n ? Polymorphic.Ref<ThumbnailPolyMap, Role>\n : React.ComponentPropsWithRef<'div'>['ref']\n\nexport interface BaseThumbnailProps extends Props {\n /**\n * Alt text for the Thumbnail image\n * @since 11.6.0\n */\n alt?: string\n\n /**\n * An image URL or a `File` to generate a preview for\n * @since 10.19.0\n */\n src?: File | string | null\n\n /**\n * Thumbnail size\n * @default 'lg'\n * @since 10.19.0\n */\n size?: SizeVariant\n\n /**\n * Use \"focused\" view\n * @default false\n * @since 10.19.0\n */\n focused?: boolean\n\n /**\n * Use \"selected\" view\n * @default false\n * @since 10.19.0\n */\n selected?: boolean\n\n /**\n * Use \"disabled\" view\n * @default false\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean\n /**\n * @since 10.19.0\n */\n clickable?: boolean\n\n /**\n * Thumbnail caption\n * @default ''\n * @since 10.19.0\n */\n caption?: string\n\n /**\n * Show placeholder for caption if it is empty\n * @default false\n * @since 10.19.0\n */\n hasCaptionPlaceholder?: boolean\n\n /**\n * Unless variant is provided, filename is used\n * to choose a placeholder icon based on extension.\n * E.g. for 'filename=\"panda.png\"', image variant will be used\n * @since 11.7.0\n * */\n filename?: string\n\n /**\n * @since 11.7.0\n */\n variant?: ThumbnailDocumentIconVariant\n\n /**\n * Thumbnail label\n * @default ''\n * @since 10.19.0\n */\n label?: string\n\n /**\n * @since 11.6.0\n */\n tabIndex?: number\n\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n\n /**\n * @since 11.6.0\n */\n onClick?: (e: React.MouseEvent) => void\n}\n\ntype DecorativeThumbnailProps<Role extends ThumbnailRoles = undefined> = {\n role?: Role\n} & BaseThumbnailProps\n\nexport type ThumbnailProps<Role extends ThumbnailRoles = undefined> =\n Role extends 'figure'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'figure',\n never,\n BaseThumbnailProps\n >\n : Role extends 'checkbox'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'checkbox',\n never,\n BaseThumbnailProps & {\n /** onChange from React Aria is fired before onClick */\n onChange?: (isSelected: boolean) => void\n }\n >\n : DecorativeThumbnailProps & { ref?: ThumbnailRef<undefined> }\n\nexport interface FilePreviewProps {\n /**\n * @since 10.19.0\n */\n file: File\n}\nexport interface BasePlaceholderProps extends Omit<BaseThumbnailProps, 'src'> {}\n\ntype DecorativePlaceholderProps<Role extends ThumbnailRoles = undefined> = {\n role?: Role\n} & BasePlaceholderProps\n\nexport type PlaceholderProps<Role extends ThumbnailRoles = undefined> =\n Role extends 'figure'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'figure',\n never,\n AriaLabelled<BasePlaceholderProps>\n >\n : Role extends 'checkbox'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'checkbox',\n never,\n AriaLabelled<BasePlaceholderProps> & {\n /** onChange from React Aria is fired before onClick */\n onChange?: (isSelected: boolean) => void\n }\n >\n : DecorativePlaceholderProps & { ref?: ThumbnailRef<undefined> }\n\nexport interface MultilineCaptionProps {\n /**\n * When true, hides this caption subtree from assistive technology (e.g. checkbox Thumbnail).\n */\n ariaHidden?: boolean\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n caption: string\n /**\n * @since 10.19.0\n */\n error: boolean\n /**\n * @since 10.19.0\n */\n layout: 'row' | 'column'\n /**\n * @since 10.19.0\n */\n qa: string\n /**\n * Called when the caption overflow state changes (e.g. when it becomes truncated).\n */\n onCaptionOverflowChange?: (isOverflowing: boolean) => void\n}\n\nexport interface SinglelineCaptionProps {\n /**\n * When true, hides this caption subtree from assistive technology (e.g. checkbox Thumbnail).\n */\n ariaHidden?: boolean\n /**\n * @since 10.19.0\n */\n caption: string\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n error: boolean\n /**\n * @since 10.19.0\n */\n layout: 'row' | 'column'\n /**\n * @since 10.19.0\n */\n qa: string\n /**\n * Called when the caption overflow state changes (e.g. when it becomes truncated).\n */\n onCaptionOverflowChange?: (isOverflowing: boolean) => void\n}\n\nexport interface CaptionTooltipProps {\n /**\n * @since 10.19.0\n */\n overlay: string\n /**\n * @since 10.19.0\n */\n isVisible: boolean\n /**\n * @since 10.19.0\n */\n children: ReactNode\n}\n\nexport interface CaptionProps {\n /**\n * When true, hides this caption subtree from assistive technology (e.g. checkbox Thumbnail).\n */\n ariaHidden?: boolean\n /**\n * @since 10.19.0\n */\n layout: LayoutVariant\n /**\n * @since 10.19.0\n */\n caption: string\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean\n /**\n * @since 10.19.0\n */\n hasCaptionPlaceholder: boolean\n /**\n * @since 10.19.0\n */\n multiline: boolean\n /**\n * @since 10.19.0\n */\n qa?: string\n /**\n * Called when the caption overflow state changes (e.g. when it becomes truncated).\n */\n onCaptionOverflowChange?: (isOverflowing: boolean) => void\n}\n\nexport interface LabelProps {\n /**\n * @since 11.6.0\n */\n id?: string\n /**\n * @since 10.19.0\n */\n label: string\n /**\n * @since 10.19.0\n */\n disabled: boolean\n}\n\nexport interface TickIconProps {\n /**\n * @since 10.19.0\n */\n size: SizeVariant\n /**\n * @since 10.19.0\n */\n selected: boolean\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Thumbnail.types.js","names":[],"sources":["../../src/Thumbnail/Thumbnail.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { ReactNode } from 'react'\nimport type { Polymorphic } from '../_utils/polymorphic'\nimport type { AriaLabelled, Props } from '../_utils/types'\nimport type { ThumbnailDocumentIconVariant } from './ThumbnailDocumentIcon'\n\nexport type SizeVariant = 'sm' | 'lg'\n\nexport type LayoutVariant = 'row' | 'column'\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n caption?: string\n}\n\n/**\n * @since 11.6.0\n */\nexport type ThumbnailRoleType = 'checkbox' | 'figure'\n\nexport type ThumbnailRoles = ThumbnailRoleType | undefined\n\nexport interface ThumbnailPolyMap\n extends Record<ThumbnailRoleType, React.ElementType> {\n figure: 'figure'\n checkbox: 'input'\n}\n\n/**\n * @since 11.6.0\n */\nexport type ThumbnailRef<Role extends ThumbnailRoles = undefined> =\n Role extends ThumbnailRoleType\n ? Polymorphic.Ref<ThumbnailPolyMap, Role>\n : React.ComponentPropsWithRef<'div'>['ref']\n\nexport interface BaseThumbnailProps extends Props {\n /**\n * Alt text for the Thumbnail image\n * @since 11.6.0\n */\n alt?: string\n\n /**\n * An image URL or a `File` to generate a preview for\n * @since 10.19.0\n */\n src?: File | string | null\n\n /**\n * Thumbnail size\n * @default 'lg'\n * @since 10.19.0\n */\n size?: SizeVariant\n\n /**\n * Use \"focused\" view\n * @default false\n * @since 10.19.0\n */\n focused?: boolean\n\n /**\n * Use \"selected\" view\n * @default false\n * @since 10.19.0\n */\n selected?: boolean\n\n /**\n * Use \"disabled\" view\n * @default false\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * When true, Thumbnail shows the default error label.\n * When a string is provided, it is shown as custom error text.\n * @since 10.19.0\n */\n error?: boolean | string\n /**\n * @since 10.19.0\n */\n clickable?: boolean\n\n /**\n * Thumbnail caption\n * @default ''\n * @since 10.19.0\n */\n caption?: string\n\n /**\n * Show placeholder for caption if it is empty\n * @default false\n * @since 10.19.0\n */\n hasCaptionPlaceholder?: boolean\n\n /**\n * Unless variant is provided, filename is used\n * to choose a placeholder icon based on extension.\n * E.g. for 'filename=\"panda.png\"', image variant will be used\n * @since 11.7.0\n * */\n filename?: string\n\n /**\n * @since 11.7.0\n */\n variant?: ThumbnailDocumentIconVariant\n\n /**\n * Thumbnail label\n * @default ''\n * @since 10.19.0\n */\n label?: string\n\n /**\n * @since 11.6.0\n */\n tabIndex?: number\n\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n\n /**\n * @since 11.6.0\n */\n onClick?: (e: React.MouseEvent) => void\n}\n\ntype DecorativeThumbnailProps<Role extends ThumbnailRoles = undefined> = {\n role?: Role\n} & BaseThumbnailProps\n\nexport type ThumbnailProps<Role extends ThumbnailRoles = undefined> =\n Role extends 'figure'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'figure',\n never,\n BaseThumbnailProps\n >\n : Role extends 'checkbox'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'checkbox',\n never,\n BaseThumbnailProps & {\n /** onChange from React Aria is fired before onClick */\n onChange?: (isSelected: boolean) => void\n }\n >\n : DecorativeThumbnailProps & { ref?: ThumbnailRef<undefined> }\n\nexport interface FilePreviewProps {\n /**\n * @since 10.19.0\n */\n file: File\n}\nexport interface BasePlaceholderProps extends Omit<BaseThumbnailProps, 'src'> {}\n\ntype DecorativePlaceholderProps<Role extends ThumbnailRoles = undefined> = {\n role?: Role\n} & BasePlaceholderProps\n\nexport type PlaceholderProps<Role extends ThumbnailRoles = undefined> =\n Role extends 'figure'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'figure',\n never,\n AriaLabelled<BasePlaceholderProps>\n >\n : Role extends 'checkbox'\n ? Polymorphic.ComponentPropsWithRef<\n ThumbnailPolyMap,\n 'checkbox',\n never,\n AriaLabelled<BasePlaceholderProps> & {\n /** onChange from React Aria is fired before onClick */\n onChange?: (isSelected: boolean) => void\n }\n >\n : DecorativePlaceholderProps & { ref?: ThumbnailRef<undefined> }\n\nexport interface MultilineCaptionProps {\n /**\n * When true, hides this caption subtree from assistive technology (e.g. checkbox Thumbnail).\n */\n ariaHidden?: boolean\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n caption: string\n /**\n * @since 10.19.0\n */\n layout: 'row' | 'column'\n /**\n * @since 10.19.0\n */\n qa: string\n /**\n * Called when the caption overflow state changes (e.g. when it becomes truncated).\n */\n onCaptionOverflowChange?: (isOverflowing: boolean) => void\n /**\n * When true, the caption is shown in the error stack (with the error row) and omits standalone caption margins.\n */\n error?: boolean\n}\n\nexport interface SinglelineCaptionProps {\n /**\n * When true, hides this caption subtree from assistive technology (e.g. checkbox Thumbnail).\n */\n ariaHidden?: boolean\n /**\n * @since 10.19.0\n */\n caption: string\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n layout: 'row' | 'column'\n /**\n * @since 10.19.0\n */\n qa: string\n /**\n * Called when the caption overflow state changes (e.g. when it becomes truncated).\n */\n onCaptionOverflowChange?: (isOverflowing: boolean) => void\n /**\n * When true, the caption is shown in the error stack (with the error row) and omits standalone caption margins.\n */\n error?: boolean\n}\n\nexport interface CaptionTooltipProps {\n /**\n * @since 10.19.0\n */\n overlay: string\n /**\n * @since 10.19.0\n */\n isVisible: boolean\n /**\n * @since 10.19.0\n */\n children: ReactNode\n}\n\nexport interface CaptionProps {\n /**\n * When true, hides this caption subtree from assistive technology (e.g. checkbox Thumbnail).\n */\n ariaHidden?: boolean\n /**\n * @since 10.19.0\n */\n layout: LayoutVariant\n /**\n * @since 10.19.0\n */\n caption: string\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean | string\n /**\n * @since 10.19.0\n */\n hasCaptionPlaceholder: boolean\n /**\n * @since 10.19.0\n */\n multiline: boolean\n /**\n * @since 10.19.0\n */\n qa?: string\n /**\n * Called when the caption overflow state changes (e.g. when it becomes truncated).\n */\n onCaptionOverflowChange?: (isOverflowing: boolean) => void\n}\n\nexport interface LabelProps {\n /**\n * @since 11.6.0\n */\n id?: string\n /**\n * @since 10.19.0\n */\n label: string\n /**\n * @since 10.19.0\n */\n disabled: boolean\n}\n\nexport interface TickIconProps {\n /**\n * @since 10.19.0\n */\n size: SizeVariant\n /**\n * @since 10.19.0\n */\n selected: boolean\n}\n"],"mappings":""}
@@ -2,4 +2,5 @@ import type { I18njs } from '@procore/core-i18n-js';
2
2
  import type { ThumbnailDocumentIconVariant } from './ThumbnailDocumentIcon';
3
3
  export declare function getIsFilePreviewableAsImage(src: File | string | null | undefined): boolean;
4
4
  export declare function getThumbnailVariantForFilename(filename: string): ThumbnailDocumentIconVariant;
5
+ export declare function resolveThumbnailErrorLabel(i18n: I18njs, error?: boolean | string): string;
5
6
  export declare function getThumbnailAriaLabel(i18n: I18njs, label?: string, caption?: string): string | undefined;
@@ -49,6 +49,13 @@ export function getThumbnailVariantForFilename(filename) {
49
49
  return defaultUnknownName;
50
50
  }
51
51
  }
52
+ export function resolveThumbnailErrorLabel(i18n, error) {
53
+ var trimmed = typeof error === 'string' ? error.trim() : undefined;
54
+ if (trimmed) {
55
+ return trimmed;
56
+ }
57
+ return i18n.t('core.thumbnail.error');
58
+ }
52
59
  export function getThumbnailAriaLabel(i18n, label, caption) {
53
60
  var parts = [];
54
61
  if (label) parts.push("".concat(i18n.t('core.thumbnail.aria-label.label'), ": ").concat(label));
@@ -1 +1 @@
1
- {"version":3,"file":"Thumbnail.utils.js","names":["getFileExtension","getIsFilePreviewableAsImage","src","File","type","startsWith","extensions","_defineProperty","image","drawing","email","gantt","zip","xml","word","ini","mov","pdf","powerpoint","excel","extensionsByVariant","Object","entries","variantByExtension","reduce","acc","_ref","_ref2","_slicedToArray","exts","forEach","ext","getThumbnailVariantForFilename","filename","defaultUnknownName","_unused","getThumbnailAriaLabel","i18n","label","caption","parts","push","concat","t","length","join","undefined"],"sources":["../../src/Thumbnail/Thumbnail.utils.ts"],"sourcesContent":["import type { I18njs } from '@procore/core-i18n-js'\nimport { getFileExtension } from '../_utils/filename'\nimport type { ThumbnailDocumentIconVariant } from './ThumbnailDocumentIcon'\n\nexport function getIsFilePreviewableAsImage(\n src: File | string | null | undefined\n) {\n return (\n src instanceof File &&\n src.type.startsWith('image/') &&\n // not allow previewing vendor image mime types, such as \"image/vnd.adobe.photoshop\"\n !src.type.startsWith('image/vnd.') &&\n // not allow previewing .tiff images, as a not browser-compatible format\n src.type !== 'image/tiff'\n )\n}\n\nconst extensions: { [k in ThumbnailDocumentIconVariant]?: string[] } = {\n image: ['png', 'jpg', 'jpeg', 'gif', 'psd', 'tiff', 'tif', 'bmp'],\n drawing: ['cad', 'dwg', 'dwf', 'dwfx'],\n email: ['msg', 'eml'],\n gantt: ['mpp', 'p6', 'xer'],\n zip: ['zip', 'rar', '7zip'],\n xml: ['rtf', 'txt'],\n word: ['doc', 'docx'],\n ini: ['ini', 'xml', 'exe'],\n mov: ['mov', 'avi'],\n pdf: ['pdf'],\n powerpoint: ['ppt', 'pptx'],\n excel: ['csv', 'xls', 'xlsx'],\n ['3d']: [\n 'stl',\n 'obj',\n 'ma',\n 'fbx',\n 'dae',\n '3ds',\n 'iges',\n 'step',\n 'wrl',\n 'rvt',\n 'ifc',\n 'nwc',\n 'nwd',\n 'nwf',\n ],\n unknown: [],\n}\n\nconst extensionsByVariant = Object.entries(extensions) as [\n ThumbnailDocumentIconVariant,\n string[]\n][]\n\nconst variantByExtension = extensionsByVariant.reduce((acc, [type, exts]) => {\n exts.forEach((ext) => {\n acc[ext] = type\n })\n return acc\n}, {} as Record<string, ThumbnailDocumentIconVariant>)\n\nexport function getThumbnailVariantForFilename(\n filename: string\n): ThumbnailDocumentIconVariant {\n const defaultUnknownName = 'unknown'\n\n try {\n const ext = getFileExtension(filename)\n return ext\n ? variantByExtension[ext] || defaultUnknownName\n : defaultUnknownName\n } catch {\n return defaultUnknownName\n }\n}\n\nexport function getThumbnailAriaLabel(\n i18n: I18njs,\n label?: string,\n caption?: string\n): string | undefined {\n const parts: string[] = []\n if (label)\n parts.push(`${i18n.t('core.thumbnail.aria-label.label')}: ${label}`)\n if (caption)\n parts.push(`${i18n.t('core.thumbnail.aria-label.caption')}: ${caption}`)\n return parts.length > 0 ? parts.join('. ') : undefined\n}\n"],"mappings":";;;;;;;;;;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AAGrD,OAAO,SAASC,2BAA2BA,CACzCC,GAAqC,EACrC;EACA,OACEA,GAAG,YAAYC,IAAI,IACnBD,GAAG,CAACE,IAAI,CAACC,UAAU,CAAC,QAAQ,CAAC;EAC7B;EACA,CAACH,GAAG,CAACE,IAAI,CAACC,UAAU,CAAC,YAAY,CAAC;EAClC;EACAH,GAAG,CAACE,IAAI,KAAK,YAAY;AAE7B;AAEA,IAAME,UAA8D,GAAAC,eAAA,CAAAA,eAAA;EAClEC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;EACjEC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;EACtCC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;EACrBC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;EAC3B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GAAG,CAAC,IAAIG,kBAAkB,GAC7CA,kBAAkB;EACxB,CAAC,CAAC,OAAAC,OAAA,EAAM;IACN,OAAOD,kBAAkB;EAC3B;AACF;AAEA,OAAO,SAASE,qBAAqBA,CACnCC,IAAY,EACZC,KAAc,EACdC,OAAgB,EACI;EACpB,IAAMC,KAAe,GAAG,EAAE;EAC1B,IAAIF,KAAK,EACPE,KAAK,CAACC,IAAI,IAAAC,MAAA,CAAIL,IAAI,CAACM,CAAC,CAAC,iCAAiC,CAAC,QAAAD,MAAA,CAAKJ,KAAK,CAAE,CAAC;EACtE,IAAIC,OAAO,EACTC,KAAK,CAACC,IAAI,IAAAC,MAAA,CAAIL,IAAI,CAACM,CAAC,CAAC,mCAAmC,CAAC,QAAAD,MAAA,CAAKH,OAAO,CAAE,CAAC;EAC1E,OAAOC,KAAK,CAACI,MAAM,GAAG,CAAC,GAAGJ,KAAK,CAACK,IAAI,CAAC,IAAI,CAAC,GAAGC,SAAS;AACxD"}
1
+ {"version":3,"file":"Thumbnail.utils.js","names":["getFileExtension","getIsFilePreviewableAsImage","src","File","type","startsWith","extensions","_defineProperty","image","drawing","email","gantt","zip","xml","word","ini","mov","pdf","powerpoint","excel","extensionsByVariant","Object","entries","variantByExtension","reduce","acc","_ref","_ref2","_slicedToArray","exts","forEach","ext","getThumbnailVariantForFilename","filename","defaultUnknownName","_unused","resolveThumbnailErrorLabel","i18n","error","trimmed","trim","undefined","t","getThumbnailAriaLabel","label","caption","parts","push","concat","length","join"],"sources":["../../src/Thumbnail/Thumbnail.utils.ts"],"sourcesContent":["import type { I18njs } from '@procore/core-i18n-js'\nimport { getFileExtension } from '../_utils/filename'\nimport type { ThumbnailDocumentIconVariant } from './ThumbnailDocumentIcon'\n\nexport function getIsFilePreviewableAsImage(\n src: File | string | null | undefined\n) {\n return (\n src instanceof File &&\n src.type.startsWith('image/') &&\n // not allow previewing vendor image mime types, such as \"image/vnd.adobe.photoshop\"\n !src.type.startsWith('image/vnd.') &&\n // not allow previewing .tiff images, as a not browser-compatible format\n src.type !== 'image/tiff'\n )\n}\n\nconst extensions: { [k in ThumbnailDocumentIconVariant]?: string[] } = {\n image: ['png', 'jpg', 'jpeg', 'gif', 'psd', 'tiff', 'tif', 'bmp'],\n drawing: ['cad', 'dwg', 'dwf', 'dwfx'],\n email: ['msg', 'eml'],\n gantt: ['mpp', 'p6', 'xer'],\n zip: ['zip', 'rar', '7zip'],\n xml: ['rtf', 'txt'],\n word: ['doc', 'docx'],\n ini: ['ini', 'xml', 'exe'],\n mov: ['mov', 'avi'],\n pdf: ['pdf'],\n powerpoint: ['ppt', 'pptx'],\n excel: ['csv', 'xls', 'xlsx'],\n ['3d']: [\n 'stl',\n 'obj',\n 'ma',\n 'fbx',\n 'dae',\n '3ds',\n 'iges',\n 'step',\n 'wrl',\n 'rvt',\n 'ifc',\n 'nwc',\n 'nwd',\n 'nwf',\n ],\n unknown: [],\n}\n\nconst extensionsByVariant = Object.entries(extensions) as [\n ThumbnailDocumentIconVariant,\n string[]\n][]\n\nconst variantByExtension = extensionsByVariant.reduce((acc, [type, exts]) => {\n exts.forEach((ext) => {\n acc[ext] = type\n })\n return acc\n}, {} as Record<string, ThumbnailDocumentIconVariant>)\n\nexport function getThumbnailVariantForFilename(\n filename: string\n): ThumbnailDocumentIconVariant {\n const defaultUnknownName = 'unknown'\n\n try {\n const ext = getFileExtension(filename)\n return ext\n ? variantByExtension[ext] || defaultUnknownName\n : defaultUnknownName\n } catch {\n return defaultUnknownName\n }\n}\n\nexport function resolveThumbnailErrorLabel(\n i18n: I18njs,\n error?: boolean | string\n): string {\n const trimmed = typeof error === 'string' ? error.trim() : undefined\n if (trimmed) {\n return trimmed\n }\n return i18n.t('core.thumbnail.error')\n}\n\nexport function getThumbnailAriaLabel(\n i18n: I18njs,\n label?: string,\n caption?: string\n): string | undefined {\n const parts: string[] = []\n if (label)\n parts.push(`${i18n.t('core.thumbnail.aria-label.label')}: ${label}`)\n if (caption)\n parts.push(`${i18n.t('core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,EACPE,KAAK,CAACC,IAAI,IAAAC,MAAA,CAAIX,IAAI,CAACK,CAAC,CAAC,iCAAiC,CAAC,QAAAM,MAAA,CAAKJ,KAAK,CAAE,CAAC;EACtE,IAAIC,OAAO,EACTC,KAAK,CAACC,IAAI,IAAAC,MAAA,CAAIX,IAAI,CAACK,CAAC,CAAC,mCAAmC,CAAC,QAAAM,MAAA,CAAKH,OAAO,CAAE,CAAC;EAC1E,OAAOC,KAAK,CAACG,MAAM,GAAG,CAAC,GAAGH,KAAK,CAACI,IAAI,CAAC,IAAI,CAAC,GAAGT,SAAS;AACxD"}
@@ -1,22 +1,37 @@
1
- var _excluded = ["ariaHidden", "disabled", "caption", "error", "layout", "qa", "onCaptionOverflowChange"],
2
- _excluded2 = ["ariaHidden", "caption", "error", "disabled", "layout", "qa", "onCaptionOverflowChange"],
1
+ var _excluded = ["ariaHidden", "disabled", "caption", "layout", "qa", "onCaptionOverflowChange", "error"],
2
+ _excluded2 = ["ariaHidden", "caption", "disabled", "layout", "qa", "onCaptionOverflowChange", "error"],
3
3
  _excluded3 = ["ariaHidden", "layout", "disabled", "error", "caption", "hasCaptionPlaceholder", "multiline", "qa"];
4
4
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5
5
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
6
6
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
7
+ import { Error as ErrorIcon } from '@procore/core-icons';
7
8
  import React, { useEffect } from 'react';
9
+ import { useI18nContext } from '../_hooks/I18n';
8
10
  import { useOverflowObserver } from '../_hooks/OverflowObserver';
11
+ import { colors } from '../_styles/colors';
9
12
  import { parseFilename } from '../_utils/filename';
10
- import { StyledCaptionText, StyledMultilineCaption, StyledPlaceholderCaption, StyledSingleLineCaption, StyledSinglelineCaptionBody, StyledSinglelineCaptionEnding } from './Thumbnail.styles';
11
- function MultilineCaption(_ref) {
12
- var ariaHidden = _ref.ariaHidden,
13
- disabled = _ref.disabled,
14
- caption = _ref.caption,
15
- error = _ref.error,
16
- layout = _ref.layout,
17
- qa = _ref.qa,
18
- onCaptionOverflowChange = _ref.onCaptionOverflowChange,
19
- props = _objectWithoutProperties(_ref, _excluded);
13
+ import { StyledCaptionText, StyledMultilineCaption, StyledPlaceholderCaption, StyledSingleLineCaption, StyledSinglelineCaptionBody, StyledSinglelineCaptionEnding, StyledThumbnailCaptionStack, StyledThumbnailErrorIcon, StyledThumbnailErrorRow, StyledThumbnailErrorText } from './Thumbnail.styles';
14
+ import { resolveThumbnailErrorLabel } from './Thumbnail.utils';
15
+ function ThumbnailErrorRow(_ref) {
16
+ var label = _ref.label;
17
+ return /*#__PURE__*/React.createElement(StyledThumbnailErrorRow, null, /*#__PURE__*/React.createElement(StyledThumbnailErrorIcon, {
18
+ "aria-hidden": true
19
+ }, /*#__PURE__*/React.createElement(ErrorIcon, {
20
+ size: "sm",
21
+ style: {
22
+ color: colors.red50
23
+ }
24
+ })), /*#__PURE__*/React.createElement(StyledThumbnailErrorText, null, label));
25
+ }
26
+ function MultilineCaption(_ref2) {
27
+ var ariaHidden = _ref2.ariaHidden,
28
+ disabled = _ref2.disabled,
29
+ caption = _ref2.caption,
30
+ layout = _ref2.layout,
31
+ qa = _ref2.qa,
32
+ onCaptionOverflowChange = _ref2.onCaptionOverflowChange,
33
+ error = _ref2.error,
34
+ props = _objectWithoutProperties(_ref2, _excluded);
20
35
  var _useOverflowObserver = useOverflowObserver(),
21
36
  ref = _useOverflowObserver.ref,
22
37
  isOverflowing = _useOverflowObserver.isOverflowing;
@@ -29,19 +44,19 @@ function MultilineCaption(_ref) {
29
44
  }, /*#__PURE__*/React.createElement(StyledMultilineCaption, _extends({
30
45
  ref: ref,
31
46
  $disabled: disabled,
32
- $error: error,
33
- $layout: layout
47
+ $layout: layout,
48
+ $error: Boolean(error)
34
49
  }, props), /*#__PURE__*/React.createElement(StyledCaptionText, null, caption)));
35
50
  }
36
- function SinglelineCaption(_ref2) {
37
- var ariaHidden = _ref2.ariaHidden,
38
- caption = _ref2.caption,
39
- error = _ref2.error,
40
- disabled = _ref2.disabled,
41
- layout = _ref2.layout,
42
- qa = _ref2.qa,
43
- onCaptionOverflowChange = _ref2.onCaptionOverflowChange,
44
- props = _objectWithoutProperties(_ref2, _excluded2);
51
+ function SinglelineCaption(_ref3) {
52
+ var ariaHidden = _ref3.ariaHidden,
53
+ caption = _ref3.caption,
54
+ disabled = _ref3.disabled,
55
+ layout = _ref3.layout,
56
+ qa = _ref3.qa,
57
+ onCaptionOverflowChange = _ref3.onCaptionOverflowChange,
58
+ error = _ref3.error,
59
+ props = _objectWithoutProperties(_ref3, _excluded2);
45
60
  var _useOverflowObserver2 = useOverflowObserver(),
46
61
  ref = _useOverflowObserver2.ref,
47
62
  isOverflowing = _useOverflowObserver2.isOverflowing;
@@ -54,34 +69,66 @@ function SinglelineCaption(_ref2) {
54
69
  }, [isOverflowing, onCaptionOverflowChange]);
55
70
  return /*#__PURE__*/React.createElement(StyledSingleLineCaption, _extends({
56
71
  "aria-hidden": ariaHidden ? true : undefined,
57
- $error: error,
58
72
  $disabled: disabled,
59
73
  $layout: layout,
74
+ $error: Boolean(error),
60
75
  "data-qa": qa
61
76
  }, props), /*#__PURE__*/React.createElement(StyledSinglelineCaptionBody, {
62
77
  ref: ref
63
78
  }, isFilename ? "".concat(filename, ".") : caption), isFilename && /*#__PURE__*/React.createElement(StyledSinglelineCaptionEnding, null, extension));
64
79
  }
65
- export function ThumbnailCaption(_ref3) {
66
- var ariaHidden = _ref3.ariaHidden,
67
- layout = _ref3.layout,
68
- _ref3$disabled = _ref3.disabled,
69
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
70
- _ref3$error = _ref3.error,
71
- error = _ref3$error === void 0 ? false : _ref3$error,
72
- caption = _ref3.caption,
73
- hasCaptionPlaceholder = _ref3.hasCaptionPlaceholder,
74
- multiline = _ref3.multiline,
75
- _ref3$qa = _ref3.qa,
76
- qa = _ref3$qa === void 0 ? '' : _ref3$qa,
77
- props = _objectWithoutProperties(_ref3, _excluded3);
80
+ export function ThumbnailCaption(_ref4) {
81
+ var ariaHidden = _ref4.ariaHidden,
82
+ layout = _ref4.layout,
83
+ _ref4$disabled = _ref4.disabled,
84
+ disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
85
+ _ref4$error = _ref4.error,
86
+ error = _ref4$error === void 0 ? false : _ref4$error,
87
+ caption = _ref4.caption,
88
+ hasCaptionPlaceholder = _ref4.hasCaptionPlaceholder,
89
+ multiline = _ref4.multiline,
90
+ _ref4$qa = _ref4.qa,
91
+ qa = _ref4$qa === void 0 ? '' : _ref4$qa,
92
+ props = _objectWithoutProperties(_ref4, _excluded3);
93
+ var i18n = useI18nContext();
94
+ if (error) {
95
+ var resolvedErrorLabel = resolveThumbnailErrorLabel(i18n, error);
96
+ var errorRow = /*#__PURE__*/React.createElement(ThumbnailErrorRow, {
97
+ label: resolvedErrorLabel
98
+ });
99
+ if (!caption) {
100
+ return /*#__PURE__*/React.createElement(StyledThumbnailCaptionStack, {
101
+ $layout: layout,
102
+ "data-qa": qa
103
+ }, errorRow);
104
+ }
105
+ return /*#__PURE__*/React.createElement(StyledThumbnailCaptionStack, {
106
+ $layout: layout,
107
+ "data-qa": qa
108
+ }, multiline ? /*#__PURE__*/React.createElement(MultilineCaption, _extends({
109
+ ariaHidden: ariaHidden,
110
+ disabled: disabled,
111
+ caption: caption,
112
+ layout: layout,
113
+ qa: qa,
114
+ error: true,
115
+ onCaptionOverflowChange: props.onCaptionOverflowChange
116
+ }, props)) : /*#__PURE__*/React.createElement(SinglelineCaption, _extends({
117
+ ariaHidden: ariaHidden,
118
+ caption: caption,
119
+ disabled: disabled,
120
+ layout: layout,
121
+ qa: qa,
122
+ error: true,
123
+ onCaptionOverflowChange: props.onCaptionOverflowChange
124
+ }, props)), errorRow);
125
+ }
78
126
  if (!caption) {
79
127
  var captionPlaceholder = hasCaptionPlaceholder && '- -';
80
128
  if (captionPlaceholder) {
81
129
  return /*#__PURE__*/React.createElement(StyledPlaceholderCaption, {
82
130
  "aria-hidden": ariaHidden ? true : undefined,
83
131
  $disabled: disabled,
84
- $error: error,
85
132
  $layout: layout,
86
133
  "data-qa": qa
87
134
  }, /*#__PURE__*/React.createElement(StyledCaptionText, null, captionPlaceholder));
@@ -93,7 +140,6 @@ export function ThumbnailCaption(_ref3) {
93
140
  ariaHidden: ariaHidden,
94
141
  disabled: disabled,
95
142
  caption: caption,
96
- error: error,
97
143
  layout: layout,
98
144
  qa: qa,
99
145
  onCaptionOverflowChange: props.onCaptionOverflowChange
@@ -103,7 +149,6 @@ export function ThumbnailCaption(_ref3) {
103
149
  ariaHidden: ariaHidden,
104
150
  caption: caption,
105
151
  disabled: disabled,
106
- error: error,
107
152
  layout: layout,
108
153
  qa: qa,
109
154
  onCaptionOverflowChange: props.onCaptionOverflowChange