@pega/cosmos-react-build 8.0.0-build.9.0 → 8.0.0

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 (428) hide show
  1. package/lib/components/AppShell/AppShell.styles.d.ts +1 -1
  2. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.styles.js +1 -46
  4. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  5. package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
  6. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
  7. package/lib/components/AppShell/Header/AppHeader.js +4 -4
  8. package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
  9. package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
  10. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
  11. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
  12. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
  13. package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
  14. package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
  15. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
  16. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
  17. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
  18. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
  19. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
  20. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
  21. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
  22. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
  23. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
  24. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
  25. package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
  26. package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
  27. package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
  28. package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
  29. package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
  30. package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
  31. package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
  32. package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
  33. package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
  34. package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
  35. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
  36. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
  37. package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
  38. package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
  39. package/lib/components/BackgroundPicker/index.d.ts +3 -0
  40. package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
  41. package/lib/components/BackgroundPicker/index.js +2 -0
  42. package/lib/components/BackgroundPicker/index.js.map +1 -0
  43. package/lib/components/BackgroundPicker/utils.d.ts +24 -0
  44. package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
  45. package/lib/components/BackgroundPicker/utils.js +186 -0
  46. package/lib/components/BackgroundPicker/utils.js.map +1 -0
  47. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
  48. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  49. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  50. package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
  51. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
  52. package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
  53. package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
  54. package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
  55. package/lib/components/DynamicInput/DynamicInput.js +33 -33
  56. package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
  57. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
  58. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
  59. package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
  60. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
  61. package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
  62. package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
  63. package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
  64. package/lib/components/Expression/Expression.d.ts +6 -0
  65. package/lib/components/Expression/Expression.d.ts.map +1 -0
  66. package/lib/components/Expression/Expression.js +36 -0
  67. package/lib/components/Expression/Expression.js.map +1 -0
  68. package/lib/components/Expression/Expression.styles.d.ts +7 -0
  69. package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
  70. package/lib/components/Expression/Expression.styles.js +47 -0
  71. package/lib/components/Expression/Expression.styles.js.map +1 -0
  72. package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
  73. package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
  74. package/lib/components/Expression/Expression.test-ids.js +8 -0
  75. package/lib/components/Expression/Expression.test-ids.js.map +1 -0
  76. package/lib/components/Expression/Expression.types.d.ts +53 -0
  77. package/lib/components/Expression/Expression.types.d.ts.map +1 -0
  78. package/lib/components/Expression/Expression.types.js +2 -0
  79. package/lib/components/Expression/Expression.types.js.map +1 -0
  80. package/lib/components/Expression/index.d.ts +3 -0
  81. package/lib/components/Expression/index.d.ts.map +1 -0
  82. package/lib/components/Expression/index.js +2 -0
  83. package/lib/components/Expression/index.js.map +1 -0
  84. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
  85. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  86. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
  87. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  88. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
  89. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  90. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
  91. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  92. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
  93. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
  94. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
  95. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
  96. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
  97. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  98. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  99. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
  100. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
  101. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
  102. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
  103. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
  104. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
  105. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
  106. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
  107. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  108. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  109. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
  110. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  111. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
  112. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  113. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  114. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
  115. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
  116. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
  117. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
  118. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
  119. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
  120. package/lib/components/ExpressionBuilder/index.d.ts +1 -1
  121. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  122. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  123. package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
  124. package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
  125. package/lib/components/FieldReference/FieldReference.styles.js +45 -37
  126. package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
  127. package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
  128. package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
  129. package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
  130. package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
  131. package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
  132. package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
  133. package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
  134. package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
  135. package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
  136. package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
  137. package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
  138. package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
  139. package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
  140. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
  141. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
  142. package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
  143. package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
  144. package/lib/components/FieldReference/index.d.ts +2 -2
  145. package/lib/components/FieldReference/index.d.ts.map +1 -1
  146. package/lib/components/FieldReference/index.js +1 -1
  147. package/lib/components/FieldReference/index.js.map +1 -1
  148. package/lib/components/IconTile/IconTile.d.ts +7 -3
  149. package/lib/components/IconTile/IconTile.d.ts.map +1 -1
  150. package/lib/components/IconTile/IconTile.js +40 -4
  151. package/lib/components/IconTile/IconTile.js.map +1 -1
  152. package/lib/components/IconTile/IconTile.types.d.ts +17 -15
  153. package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
  154. package/lib/components/IconTile/IconTile.types.js.map +1 -1
  155. package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
  156. package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
  157. package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
  158. package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
  159. package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
  160. package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
  161. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
  162. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
  163. package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
  164. package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
  165. package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
  166. package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
  167. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
  168. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
  169. package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
  170. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
  171. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
  172. package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
  173. package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
  174. package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
  175. package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
  176. package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
  177. package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
  178. package/lib/components/IconTile/Tiles/Case.js.map +1 -1
  179. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
  180. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
  181. package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
  182. package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
  183. package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
  184. package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
  185. package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
  186. package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
  187. package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
  188. package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
  189. package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
  190. package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
  191. package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
  192. package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
  193. package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
  194. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
  195. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
  196. package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
  197. package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
  198. package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
  199. package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
  200. package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
  201. package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
  202. package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
  203. package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
  204. package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
  205. package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
  206. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
  207. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
  208. package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
  209. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
  210. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
  211. package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
  212. package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
  213. package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
  214. package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
  215. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
  216. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
  217. package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
  218. package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
  219. package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
  220. package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
  221. package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
  222. package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
  223. package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
  224. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
  225. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
  226. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
  227. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
  228. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
  229. package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
  230. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
  231. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
  232. package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
  233. package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
  234. package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
  235. package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
  236. package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
  237. package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
  238. package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
  239. package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
  240. package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
  241. package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
  242. package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
  243. package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
  244. package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
  245. package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
  246. package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
  247. package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
  248. package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
  249. package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
  250. package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
  251. package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
  252. package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
  253. package/lib/components/IconTile/Tiles/Task.js.map +1 -1
  254. package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
  255. package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
  256. package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
  257. package/lib/components/IconTile/iconUtils.d.ts +11 -0
  258. package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
  259. package/lib/components/IconTile/iconUtils.js +41 -0
  260. package/lib/components/IconTile/iconUtils.js.map +1 -0
  261. package/lib/components/IconTile/index.d.ts +1 -0
  262. package/lib/components/IconTile/index.d.ts.map +1 -1
  263. package/lib/components/IconTile/index.js.map +1 -1
  264. package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
  265. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  266. package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
  267. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  268. package/lib/components/LifeCycle/Category.d.ts +8 -6
  269. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  270. package/lib/components/LifeCycle/Category.js +53 -36
  271. package/lib/components/LifeCycle/Category.js.map +1 -1
  272. package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
  273. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  274. package/lib/components/LifeCycle/LifeCycle.js +113 -19
  275. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  276. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
  277. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
  278. package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
  279. package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
  280. package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
  281. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  282. package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
  283. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  284. package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
  285. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
  286. package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
  287. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
  288. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
  289. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
  290. package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
  291. package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
  292. package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
  293. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  294. package/lib/components/LifeCycle/LifeCycleList.js +20 -30
  295. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  296. package/lib/components/LifeCycle/Stage.d.ts +12 -7
  297. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  298. package/lib/components/LifeCycle/Stage.js +87 -72
  299. package/lib/components/LifeCycle/Stage.js.map +1 -1
  300. package/lib/components/LifeCycle/Step.d.ts +21 -14
  301. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  302. package/lib/components/LifeCycle/Step.js +75 -51
  303. package/lib/components/LifeCycle/Step.js.map +1 -1
  304. package/lib/components/LifeCycle/Task.d.ts +18 -7
  305. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  306. package/lib/components/LifeCycle/Task.js +119 -55
  307. package/lib/components/LifeCycle/Task.js.map +1 -1
  308. package/lib/components/LifeCycle/index.d.ts +2 -1
  309. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  310. package/lib/components/LifeCycle/index.js +1 -0
  311. package/lib/components/LifeCycle/index.js.map +1 -1
  312. package/lib/components/LifeCycle/utils.d.ts +14 -0
  313. package/lib/components/LifeCycle/utils.d.ts.map +1 -0
  314. package/lib/components/LifeCycle/utils.js +250 -0
  315. package/lib/components/LifeCycle/utils.js.map +1 -0
  316. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
  317. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  318. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  319. package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
  320. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  321. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  322. package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
  323. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  324. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  325. package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
  326. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  327. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  328. package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
  329. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
  330. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
  331. package/lib/components/RuleSelect/RuleSelect.js +3 -3
  332. package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
  333. package/lib/components/Workbench/Workbench.d.ts +2 -3
  334. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  335. package/lib/components/Workbench/Workbench.js.map +1 -1
  336. package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
  337. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  338. package/lib/index.d.ts +4 -2
  339. package/lib/index.d.ts.map +1 -1
  340. package/lib/index.js +4 -2
  341. package/lib/index.js.map +1 -1
  342. package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
  343. package/lib/utils/typeIconMapping.d.ts.map +1 -0
  344. package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
  345. package/lib/utils/typeIconMapping.js.map +1 -0
  346. package/package.json +16 -14
  347. package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
  348. package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
  349. package/lib/components/FlowModeller/AddNode.d.ts +0 -18
  350. package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
  351. package/lib/components/FlowModeller/AddNode.js +0 -86
  352. package/lib/components/FlowModeller/AddNode.js.map +0 -1
  353. package/lib/components/FlowModeller/Connector.d.ts +0 -6
  354. package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
  355. package/lib/components/FlowModeller/Connector.js +0 -69
  356. package/lib/components/FlowModeller/Connector.js.map +0 -1
  357. package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
  358. package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
  359. package/lib/components/FlowModeller/DeletePopover.js +0 -136
  360. package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
  361. package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
  362. package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
  363. package/lib/components/FlowModeller/FlowModeller.js +0 -317
  364. package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
  365. package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
  366. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
  367. package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
  368. package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
  369. package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
  370. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
  371. package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
  372. package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
  373. package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
  374. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
  375. package/lib/components/FlowModeller/Node/Node.types.js +0 -27
  376. package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
  377. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
  378. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
  379. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
  380. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
  381. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
  382. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
  383. package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
  384. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
  385. package/lib/components/FlowModeller/Node.d.ts +0 -5
  386. package/lib/components/FlowModeller/Node.d.ts.map +0 -1
  387. package/lib/components/FlowModeller/Node.js +0 -22
  388. package/lib/components/FlowModeller/Node.js.map +0 -1
  389. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
  390. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
  391. package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
  392. package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
  393. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
  394. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
  395. package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
  396. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
  397. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
  398. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
  399. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
  400. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
  401. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
  402. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
  403. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
  404. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
  405. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
  406. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
  407. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
  408. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
  409. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
  410. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
  411. package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
  412. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
  413. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
  414. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
  415. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
  416. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
  417. package/lib/components/FlowModeller/helper.d.ts +0 -39
  418. package/lib/components/FlowModeller/helper.d.ts.map +0 -1
  419. package/lib/components/FlowModeller/helper.js +0 -198
  420. package/lib/components/FlowModeller/helper.js.map +0 -1
  421. package/lib/components/FlowModeller/index.d.ts +0 -20
  422. package/lib/components/FlowModeller/index.d.ts.map +0 -1
  423. package/lib/components/FlowModeller/index.js +0 -12
  424. package/lib/components/FlowModeller/index.js.map +0 -1
  425. package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
  426. package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
  427. package/lib/components/IconTile/IconTile.styles.js +0 -68
  428. package/lib/components/IconTile/IconTile.styles.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  export declare const StyledUtils: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- export declare const StyledAppShellToggleButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledAppShellToggleButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {}, never>;
3
3
  export declare const StyledScrollWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
4
  export declare const StyledMain: import("styled-components").StyledComponent<"main", import("styled-components").DefaultTheme, {
5
5
  navOpen: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,WAAW,yGAStB,CAAC;AAIH,eAAO,MAAM,0BAA0B,qOAiBrC,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAK3B,CAAC;AAIH,eAAO,MAAM,UAAU;aACZ,OAAO;aACP,OAAO;SAoCjB,CAAC;AAIF,eAAO,MAAM,SAAS,yGAkIrB,CAAC;AAIF,eAAO,MAAM,uBAAuB;0BAAwC,OAAO;SAgBjF,CAAC;AAIH,eAAO,MAAM,iBAAiB;qBAAgC,OAAO;SAwEpE,CAAC;AAIF,eAAO,MAAM,aAAa,wGAAc,CAAC"}
1
+ {"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,WAAW,yGAStB,CAAC;AAIH,eAAO,MAAM,0BAA0B,oNAiBrC,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAK3B,CAAC;AAIH,eAAO,MAAM,UAAU;aACZ,OAAO;aACP,OAAO;SAoCjB,CAAC;AAIF,eAAO,MAAM,SAAS,yGAoFrB,CAAC;AAIF,eAAO,MAAM,uBAAuB;0BAAwC,OAAO;SAgBjF,CAAC;AAIH,eAAO,MAAM,iBAAiB;qBAAgC,OAAO;SAwEpE,CAAC;AAIF,eAAO,MAAM,aAAa,wGAAc,CAAC"}
@@ -69,7 +69,7 @@ export const StyledMain = styled.main(({ navOpen, hideNav, theme: { base: { anim
69
69
  `;
70
70
  });
71
71
  StyledMain.defaultProps = defaultThemeProp;
72
- export const StyledNav = styled.nav(({ theme: { base: { breakpoints, colors, palette, animation, spacing, shadow, 'custom-scrollbar': customScrollbar, 'border-radius': borderRadius, 'font-size': fontSize, 'font-scale': fontScale }, components: { 'app-shell': appShell } } }) => {
72
+ export const StyledNav = styled.nav(({ theme: { base: { breakpoints, colors, palette, animation, spacing, shadow, 'custom-scrollbar': customScrollbar, 'font-size': fontSize, 'font-scale': fontScale }, components: { 'app-shell': appShell } } }) => {
73
73
  const { navState } = useContext(AppShellContext);
74
74
  const fontSizes = calculateFontSize(fontSize, fontScale);
75
75
  return css `
@@ -123,53 +123,8 @@ export const StyledNav = styled.nav(({ theme: { base: { breakpoints, colors, pal
123
123
  ${customScrollbar &&
124
124
  css `
125
125
  * {
126
- scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);
127
126
  scrollbar-width: thin;
128
127
  }
129
-
130
- @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {
131
- /* stylelint-disable unit-allowed-list */
132
-
133
- *::-webkit-scrollbar {
134
- width: 12px;
135
- height: 12px;
136
- }
137
-
138
- *::-webkit-scrollbar-track {
139
- background-color: rgba(0, 0, 0, 0.2);
140
- }
141
-
142
- *::-webkit-scrollbar-corner {
143
- background-color: rgba(0, 0, 0, 0.2);
144
- border-bottom-right-radius: inherit;
145
- }
146
-
147
- *::-webkit-scrollbar-thumb {
148
- background-color: transparent;
149
- border: 3px solid transparent;
150
- border-radius: calc(1.125 * ${borderRadius});
151
- box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);
152
- }
153
-
154
- *::-webkit-scrollbar-thumb:hover {
155
- box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);
156
- }
157
-
158
- *::-webkit-scrollbar-track:horizontal {
159
- border-bottom-left-radius: inherit;
160
- }
161
-
162
- *::-webkit-scrollbar-track:vertical {
163
- border-top-right-radius: inherit;
164
- }
165
-
166
- /* stylelint-disable-next-line selector-pseudo-class-no-unknown */
167
- *::-webkit-scrollbar-track:not(:corner-present) {
168
- border-bottom-right-radius: inherit;
169
- }
170
-
171
- /* stylelint-enable unit-allowed-list */
172
- }
173
128
  `}
174
129
 
175
130
  @media (pointer: coarse) {
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AAEzE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,YAAY,GAAG,OAAO,CAAC;AAE7B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAChC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,UAA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GAAG,CAAA;mBACQ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;8BACjB,gBAAgB;SACrC;;UAEC,uBAAuB;;kBAEf,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAC/B,OAAO;QACT,GAAG,CAAA;;WAEF;;qBAEU,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;;;;UAI9B,UAAU;4BACQ,QAAQ;;;;;;iBAMnB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;4BACjB,gBAAgB;;KAEvC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n tryCatch,\n defaultThemeProp,\n Button,\n StyledIcon,\n useDirection,\n calculateFontSize,\n Icon\n} from '@pega/cosmos-react-core';\nimport {\n StyledToggleIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst navWidth = '3rem';\nconst navOpenWidth = '14rem';\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-block: ${theme.base.spacing};\n border-block-start: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n return css`\n height: 100%;\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navOpen: boolean;\n hideNav: boolean;\n}>(\n ({\n navOpen,\n hideNav,\n theme: {\n base: { animation, breakpoints, palette }\n }\n }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 6rem);\n background-color: ${palette['app-background']};\n margin-inline-start: ${navWidth};\n transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};\n\n @media (pointer: coarse) {\n min-height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n min-height: calc(100vh - 3rem);\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${hideNav &&\n css`\n transition-duration: 0s;\n margin-inline-start: 0;\n `}\n `;\n }\n);\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(\n ({\n theme: {\n base: {\n breakpoints,\n colors,\n palette,\n animation,\n spacing,\n shadow,\n 'custom-scrollbar': customScrollbar,\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: { 'app-shell': appShell }\n }\n }) => {\n const { navState } = useContext(AppShellContext);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 6rem);\n background: ${appShell.nav['background-color']};\n width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};\n transition: width ${animation.speed} ${animation.timing.ease};\n display: flex;\n\n ${StyledStandardTree} {\n background-color: ${palette.dark};\n\n ${StyledNodeText}, ${StyledToggleIcon} {\n color: rgba(255, 255, 255, 0.7);\n font-size: ${fontSizes.s};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${spacing});\n padding-block-end: calc(0.5 * ${spacing});\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n\n ${StyledNodeText} {\n color: ${palette.light};\n }\n }\n\n &:focus {\n box-shadow: ${shadow['focus-inset']};\n }\n\n &[aria-current='page'],\n &[aria-current='true'] {\n background: rgba(255, 255, 255, 0.05);\n\n ${StyledNodeText} {\n color: ${colors.blue.light};\n }\n }\n }\n\n &:has(:focus-visible) {\n box-shadow: inset 0 0 0 0.125rem #71c1ff99;\n }\n }\n\n ${customScrollbar &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${borderRadius});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n\n @media (pointer: coarse) {\n height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledNav.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellCaretIcon = styled(Icon)<{ nestedListCollapsed?: boolean }>(({\n nestedListCollapsed,\n theme\n}) => {\n const { rtl } = useDirection();\n\n return css`\n transition-property: transform;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${nestedListCollapsed === false &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n `;\n});\n\nStyledAppShellCaretIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{ activeTreeRoot?: boolean }>(\n ({ activeTreeRoot, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.7);\n cursor: pointer;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n text-decoration: none;\n\n span {\n overflow: hidden;\n color: inherit;\n }\n\n &:hover,\n &:focus {\n color: ${theme.base.palette.light};\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${activeTreeRoot &&\n css`\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n `}\n\n ${StyledAppShellCaretIcon}:last-child {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: opacity;\n }\n\n ${StyledIcon}:first-child {\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child,\n &[aria-current='true'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n }\n);\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n"]}
1
+ {"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AAEzE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,YAAY,GAAG,OAAO,CAAC;AAE7B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAChC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CACpE,CAAC;IAEF,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,OAAO;0CACG,WAAW;GAClD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO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CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n tryCatch,\n defaultThemeProp,\n Button,\n StyledIcon,\n useDirection,\n calculateFontSize,\n Icon\n} from '@pega/cosmos-react-core';\nimport {\n StyledToggleIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst navWidth = '3rem';\nconst navOpenWidth = '14rem';\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-block: ${theme.base.spacing};\n border-block-start: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n return css`\n height: 100%;\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navOpen: boolean;\n hideNav: boolean;\n}>(\n ({\n navOpen,\n hideNav,\n theme: {\n base: { animation, breakpoints, palette }\n }\n }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 6rem);\n background-color: ${palette['app-background']};\n margin-inline-start: ${navWidth};\n transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};\n\n @media (pointer: coarse) {\n min-height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n min-height: calc(100vh - 3rem);\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${hideNav &&\n css`\n transition-duration: 0s;\n margin-inline-start: 0;\n `}\n `;\n }\n);\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(\n ({\n theme: {\n base: {\n breakpoints,\n colors,\n palette,\n animation,\n spacing,\n shadow,\n 'custom-scrollbar': customScrollbar,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: { 'app-shell': appShell }\n }\n }) => {\n const { navState } = useContext(AppShellContext);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 6rem);\n background: ${appShell.nav['background-color']};\n width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};\n transition: width ${animation.speed} ${animation.timing.ease};\n display: flex;\n\n ${StyledStandardTree} {\n background-color: ${palette.dark};\n\n ${StyledNodeText}, ${StyledToggleIcon} {\n color: rgba(255, 255, 255, 0.7);\n font-size: ${fontSizes.s};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${spacing});\n padding-block-end: calc(0.5 * ${spacing});\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n\n ${StyledNodeText} {\n color: ${palette.light};\n }\n }\n\n &:focus {\n box-shadow: ${shadow['focus-inset']};\n }\n\n &[aria-current='page'],\n &[aria-current='true'] {\n background: rgba(255, 255, 255, 0.05);\n\n ${StyledNodeText} {\n color: ${colors.blue.light};\n }\n }\n }\n\n &:has(:focus-visible) {\n box-shadow: inset 0 0 0 0.125rem #71c1ff99;\n }\n }\n\n ${customScrollbar &&\n css`\n * {\n scrollbar-width: thin;\n }\n `}\n\n @media (pointer: coarse) {\n height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledNav.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellCaretIcon = styled(Icon)<{ nestedListCollapsed?: boolean }>(({\n nestedListCollapsed,\n theme\n}) => {\n const { rtl } = useDirection();\n\n return css`\n transition-property: transform;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${nestedListCollapsed === false &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n `;\n});\n\nStyledAppShellCaretIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{ activeTreeRoot?: boolean }>(\n ({ activeTreeRoot, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.7);\n cursor: pointer;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n text-decoration: none;\n\n span {\n overflow: hidden;\n color: inherit;\n }\n\n &:hover,\n &:focus {\n color: ${theme.base.palette.light};\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${activeTreeRoot &&\n css`\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n `}\n\n ${StyledAppShellCaretIcon}:last-child {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: opacity;\n }\n\n ${StyledIcon}:first-child {\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child,\n &[aria-current='true'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n }\n);\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n"]}
@@ -1,6 +1,5 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '@pega/cosmos-react-core';
1
+ import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
3
2
  import type { AppHeaderProps } from './AppHeader.types';
4
- declare const AppHeader: FunctionComponent<AppHeaderProps & ForwardProps>;
3
+ declare const AppHeader: ForwardRefForwardPropsComponent<AppHeaderProps>;
5
4
  export default AppHeader;
6
5
  //# sourceMappingURL=AppHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAmB9E,OAAO,KAAK,EAAE,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAkJ/E,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAiG9D,CAAC;AAEH,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,+BAA+B,EAAoB,MAAM,yBAAyB,CAAC;AAmBjG,OAAO,KAAK,EAAE,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAmJ/E,QAAA,MAAM,SAAS,EAAE,+BAA+B,CAAC,cAAc,CAkG7D,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -22,13 +22,13 @@ const Links = ({ links }) => {
22
22
  const AppHeaderSearch = ({ showSearchButton, setShowSearchButton, ...restProps }) => {
23
23
  const isMediumOrAbove = useBreakpoint('md');
24
24
  const t = useI18n();
25
- const searchInputRef = useCallback(node => {
25
+ const searchInputRef = useCallback((node) => {
26
26
  if (!showSearchButton && node) {
27
27
  node.focus();
28
28
  }
29
29
  }, [showSearchButton]);
30
30
  const focusSearchBtn = useRef(false);
31
- const searchButtonRef = useCallback(node => {
31
+ const searchButtonRef = useCallback((node) => {
32
32
  if (node && focusSearchBtn.current) {
33
33
  node.focus();
34
34
  }
@@ -42,7 +42,7 @@ const Utils = ({ operator, branch, action, appInfo }) => {
42
42
  const isMediumOrAbove = useBreakpoint('md');
43
43
  const isSmallOrAbove = useBreakpoint('sm');
44
44
  const [appInfoEl, setAppInfoEl] = useElement(null);
45
- return (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center' }, md: { container: { justify: 'end' } }, item: { shrink: 1 }, as: StyledUtilsContainer, children: [appInfo && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 0.5 }, item: { shrink: 1 }, ref: setAppInfoEl, children: [_jsx(Flex, { as: StyledAppName, item: { shrink: 1 }, children: appInfo.name }), _jsx(StyledAppVersion, { children: appInfo.version }), _jsx(Tooltip, { target: appInfoEl, hideDelay: 'none', children: `${appInfo.name} ${appInfo.version}` })] })), _jsxs(Flex, { container: { alignItems: 'center' }, children: [branch && _jsx(BranchButton, { ...branch, compact: isSmallOrAbove ? branch.compact : true }), action && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 0.5 }, item: { shrink: 0 }, as: Button, variant: 'secondary', icon: !isMediumOrAbove, label: isMediumOrAbove ? undefined : action.text, onClick: (e) => action.onClick?.(action.id, e), disabled: action.disabled, children: [action.icon && _jsx(Icon, { name: action.icon }), isMediumOrAbove && action.text] }))] }), isMediumOrAbove && (_jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-end' }, children: _jsx(Avatar, { ...operator.avatar }) }))] }));
45
+ return (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center' }, md: { container: { justify: 'end' } }, item: { shrink: 1 }, as: StyledUtilsContainer, children: [appInfo && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 0.5 }, item: { shrink: 1 }, ref: setAppInfoEl, children: [_jsx(Flex, { as: StyledAppName, item: { shrink: 1 }, children: appInfo.name }), _jsx(StyledAppVersion, { children: appInfo.version }), _jsx(Tooltip, { target: appInfoEl, hideDelay: 'none', children: `${appInfo.name} ${appInfo.version}` })] })), _jsxs(Flex, { container: { alignItems: 'center' }, children: [branch && _jsx(BranchButton, { ...branch, compact: isSmallOrAbove ? branch.compact : true }), action && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 0.5 }, item: { shrink: 0 }, as: Button, variant: 'secondary', icon: !isMediumOrAbove, label: isMediumOrAbove ? undefined : action.text, onClick: (e) => action.onClick?.(action.id, e), disabled: action.disabled, children: [action.icon && _jsx(Icon, { name: action.icon }), isMediumOrAbove && action.text] }))] }), isMediumOrAbove && (_jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-end' }, name: operator.name, children: _jsx(Avatar, { ...operator.avatar }) }))] }));
46
46
  };
47
47
  const AppHeader = forwardRef(function AppHeader({ contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {}, brand, utils, links }, ref) {
48
48
  const selectedContext = contexts?.length > 1 ? contexts.find(ctx => ctx.selected) : contexts[0];
@@ -67,7 +67,7 @@ const AppHeader = forwardRef(function AppHeader({ contextSwitcher: { contexts, o
67
67
  gap: 1,
68
68
  justify: 'center',
69
69
  alignItems: 'center'
70
- }, item: { grow: showSearchButton ? 0 : 1 }, md: { item: { grow: showSearchButton ? 1 : 0 } }, children: [utils?.search && (_jsx(AppHeaderSearch, { ...utils.search, showSearchButton: showSearchButton, setShowSearchButton: setShowSearchButton })), showSearchButton && !isMediumOrAbove && utils?.operator && (_jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: utils.operator.actions, popover: { placement: 'bottom-start' }, children: _jsx(Avatar, { ...utils.operator.avatar }) }))] }), utils && _jsx(Utils, { ...utils })] }));
70
+ }, item: { grow: showSearchButton ? 0 : 1 }, md: { item: { grow: showSearchButton ? 1 : 0 } }, children: [utils?.search && (_jsx(AppHeaderSearch, { ...utils.search, showSearchButton: showSearchButton, setShowSearchButton: setShowSearchButton })), showSearchButton && !isMediumOrAbove && utils?.operator && (_jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: utils.operator.actions, popover: { placement: 'bottom-start' }, name: utils.operator.name, children: _jsx(Avatar, { ...utils.operator.avatar }) }))] }), utils && _jsx(Utils, { ...utils })] }));
71
71
  });
72
72
  export default AppHeader;
73
73
  //# sourceMappingURL=AppHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAU7E,OAAO,EACL,eAAe,EACf,IAAI,EACJ,WAAW,EACX,aAAa,EACb,MAAM,EACN,IAAI,EACJ,OAAO,EACP,OAAO,EACP,UAAU,EACV,MAAM,EACP,MAAM,yBAAyB,CAAC;AAEjC,OAAO,gBAAgB,MAAM,0DAA0D,CAAC;AACxF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,kEAAkE,CAAC;AAE1E,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,KAAK,GAA+B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9D,SAAS,CAAC,GAAG,E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ACH,EACA,gBAAgB,IAAI,CAAC,eAAe,IAAI,KAAK,EAAE,QAAQ,IAAI,CAC1D,KAAC,gBAAgB,IACf,EAAE,EAAE,uBAAuB,EAC3B,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,EAC/B,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,YAEtC,KAAC,MAAM,OAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAI,GACpB,CACpB,IACI,EACN,KAAK,IAAI,KAAC,KAAK,OAAK,KAAK,GAAI,IACzB,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useState, useRef } from 'react';\nimport type {\n FunctionComponent,\n MouseEvent,\n FC,\n PropsWithoutRef,\n Dispatch,\n SetStateAction\n} from 'react';\n\nimport {\n ContextSwitcher,\n Flex,\n SearchInput,\n useBreakpoint,\n Button,\n Icon,\n useI18n,\n Tooltip,\n useElement,\n Avatar\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, SearchInputProps } from '@pega/cosmos-react-core';\nimport AppShellOperator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';\nimport {\n StyledAppHeaderSearchForm,\n StyledAppHeaderOperator\n} from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\n\nimport {\n StyledAppHeader,\n StyledTabs,\n StyledUtilsContainer,\n StyledBrandContainer,\n StyledAppHeaderSearch,\n StyledAppName,\n StyledAppVersion,\n StyledBrandButton,\n StyledBrandImage,\n StyledContext\n} from './AppHeader.styles';\nimport type { AppHeaderProps, LinkProps, UtilsProps } from './AppHeader.types';\nimport BranchButton from './BranchButton';\n\nconst Links: FC<{ links: LinkProps[] }> = ({ links }) => {\n const [currentTabId, setCurrentTabId] = useState(links[0].id);\n\n useEffect(() => {\n setCurrentTabId(links[0].id);\n }, [links]);\n\n const handleTabClick = useCallback(\n (id: string, e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const newActiveTab = links.find(item => item.id === id);\n if (newActiveTab) {\n newActiveTab.onClick?.(id, e);\n setCurrentTabId(newActiveTab.id);\n }\n },\n [links]\n );\n\n return <StyledTabs tabs={links} currentTabId={currentTabId} onTabClick={handleTabClick} />;\n};\n\nconst AppHeaderSearch: FC<\n SearchInputProps & {\n showSearchButton: boolean;\n setShowSearchButton: Dispatch<SetStateAction<boolean>>;\n }\n> = ({ showSearchButton, setShowSearchButton, ...restProps }) => {\n const isMediumOrAbove = useBreakpoint('md');\n const t = useI18n();\n\n const searchInputRef = useCallback(\n node => {\n if (!showSearchButton && node) {\n node.focus();\n }\n },\n [showSearchButton]\n );\n const focusSearchBtn = useRef(false);\n const searchButtonRef = useCallback(node => {\n if (node && focusSearchBtn.current) {\n node.focus();\n }\n }, []);\n\n return isMediumOrAbove || !showSearchButton ? (\n <Flex\n as={StyledAppHeaderSearch}\n item={{ shrink: 0, grow: 1 }}\n md={{ item: { grow: 0, shrink: 1 } }}\n container={{ justify: 'between', alignItems: 'center', gap: 1 }}\n >\n <StyledAppHeaderSearchForm\n role='search'\n aria-label={t('sitewide')}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n <SearchInput {...restProps} ref={searchInputRef} />\n </StyledAppHeaderSearchForm>\n <Button\n variant='simple'\n icon\n onClick={() => {\n setShowSearchButton(true);\n focusSearchBtn.current = true;\n }}\n label={t('collapse_search')}\n >\n <Icon name='times' />\n </Button>\n </Flex>\n ) : (\n <Button\n variant='simple'\n icon\n onClick={() => setShowSearchButton(false)}\n ref={searchButtonRef}\n label={t('expand_search')}\n >\n <Icon name='search' />\n </Button>\n );\n};\n\nconst Utils: FC<UtilsProps> = ({ operator, branch, action, appInfo }) => {\n const isMediumOrAbove = useBreakpoint('md');\n const isSmallOrAbove = useBreakpoint('sm');\n const [appInfoEl, setAppInfoEl] = useElement(null);\n\n return (\n <Flex\n container={{ justify: 'between', alignItems: 'center' }}\n md={{ container: { justify: 'end' } }}\n item={{ shrink: 1 }}\n as={StyledUtilsContainer}\n >\n {appInfo && (\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 0.5 }}\n item={{ shrink: 1 }}\n ref={setAppInfoEl}\n >\n <Flex as={StyledAppName} item={{ shrink: 1 }}>\n {appInfo.name}\n </Flex>\n <StyledAppVersion>{appInfo.version}</StyledAppVersion>\n <Tooltip target={appInfoEl} hideDelay='none'>\n {`${appInfo.name} ${appInfo.version}`}\n </Tooltip>\n </Flex>\n )}\n <Flex container={{ alignItems: 'center' }}>\n {branch && <BranchButton {...branch} compact={isSmallOrAbove ? branch.compact : true} />}\n {action && (\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 0.5 }}\n item={{ shrink: 0 }}\n as={Button}\n variant='secondary'\n icon={!isMediumOrAbove}\n label={isMediumOrAbove ? undefined : action.text}\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n disabled={action.disabled}\n >\n {action.icon && <Icon name={action.icon} />}\n {isMediumOrAbove && action.text}\n </Flex>\n )}\n </Flex>\n {isMediumOrAbove && (\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-end' }}\n >\n <Avatar {...operator.avatar} />\n </AppShellOperator>\n )}\n </Flex>\n );\n};\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(function AppHeader(\n {\n contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {},\n brand,\n utils,\n links\n }: PropsWithoutRef<AppHeaderProps>,\n ref: AppHeaderProps['ref']\n) {\n const selectedContext = contexts?.length > 1 ? contexts.find(ctx => ctx.selected)! : contexts[0];\n\n const isMediumOrAbove = useBreakpoint('md');\n const [showSearchButton, setShowSearchButton] = useState(true);\n\n useEffect(() => {\n if (isMediumOrAbove && !showSearchButton) {\n setShowSearchButton(true);\n }\n }, [isMediumOrAbove]);\n\n return (\n <Flex\n as={StyledAppHeader}\n container={{\n justify: 'between',\n alignItems: 'center',\n colGap: 2,\n wrap: 'wrap',\n pad: [0, 1]\n }}\n md={{ container: { wrap: 'nowrap' } }}\n ref={ref}\n >\n {showSearchButton && (\n <Flex\n as={StyledBrandContainer}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 1\n }}\n item={{ shrink: 0, alignSelf: 'stretch' }}\n >\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n />\n )}\n <Flex\n as={brand.onClick || brand.href ? StyledBrandButton : 'div'}\n variant='simple'\n container={{ alignItems: 'center', justify: 'between', gap: 2, pad: 1 }}\n aria-label={`${brand.label} - ${selectedContext.primary}`}\n onClick={brand.onClick}\n href={brand.href}\n >\n <Flex item={{ shrink: 0 }} as={StyledBrandImage} src={brand.logo} alt={brand.label} />\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 1 }}>\n {selectedContext.visual}\n <StyledContext>{selectedContext.primary}</StyledContext>\n </Flex>\n </Flex>\n </Flex>\n )}\n {links && links.length > 0 && <Links links={links} />}\n\n <Flex\n container={{\n gap: 1,\n justify: 'center',\n alignItems: 'center'\n }}\n item={{ grow: showSearchButton ? 0 : 1 }}\n md={{ item: { grow: showSearchButton ? 1 : 0 } }}\n >\n {utils?.search && (\n <AppHeaderSearch\n {...utils.search}\n showSearchButton={showSearchButton}\n setShowSearchButton={setShowSearchButton}\n />\n )}\n {showSearchButton && !isMediumOrAbove && utils?.operator && (\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={utils.operator.actions}\n popover={{ placement: 'bottom-start' }}\n >\n <Avatar {...utils.operator.avatar} />\n </AppShellOperator>\n )}\n </Flex>\n {utils && <Utils {...utils} />}\n </Flex>\n );\n});\n\nexport default AppHeader;\n"]}
1
+ {"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW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","sourcesContent":["import { forwardRef, useCallback, useEffect, useState, useRef } from 'react';\nimport type { MouseEvent, FC, PropsWithoutRef, Dispatch, SetStateAction } from 'react';\n\nimport {\n ContextSwitcher,\n Flex,\n SearchInput,\n useBreakpoint,\n Button,\n Icon,\n useI18n,\n Tooltip,\n useElement,\n Avatar\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, SearchInputProps } from '@pega/cosmos-react-core';\nimport AppShellOperator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';\nimport {\n StyledAppHeaderSearchForm,\n StyledAppHeaderOperator\n} from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\n\nimport {\n StyledAppHeader,\n StyledTabs,\n StyledUtilsContainer,\n StyledBrandContainer,\n StyledAppHeaderSearch,\n StyledAppName,\n StyledAppVersion,\n StyledBrandButton,\n StyledBrandImage,\n StyledContext\n} from './AppHeader.styles';\nimport type { AppHeaderProps, LinkProps, UtilsProps } from './AppHeader.types';\nimport BranchButton from './BranchButton';\n\nconst Links: FC<{ links: LinkProps[] }> = ({ links }) => {\n const [currentTabId, setCurrentTabId] = useState(links[0].id);\n\n useEffect(() => {\n setCurrentTabId(links[0].id);\n }, [links]);\n\n const handleTabClick = useCallback(\n (id: string, e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const newActiveTab = links.find(item => item.id === id);\n if (newActiveTab) {\n newActiveTab.onClick?.(id, e);\n setCurrentTabId(newActiveTab.id);\n }\n },\n [links]\n );\n\n return <StyledTabs tabs={links} currentTabId={currentTabId} onTabClick={handleTabClick} />;\n};\n\nconst AppHeaderSearch: FC<\n SearchInputProps & {\n showSearchButton: boolean;\n setShowSearchButton: Dispatch<SetStateAction<boolean>>;\n }\n> = ({ showSearchButton, setShowSearchButton, ...restProps }) => {\n const isMediumOrAbove = useBreakpoint('md');\n const t = useI18n();\n\n const searchInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n if (!showSearchButton && node) {\n node.focus();\n }\n },\n [showSearchButton]\n );\n const focusSearchBtn = useRef(false);\n const searchButtonRef = useCallback((node: HTMLButtonElement | null) => {\n if (node && focusSearchBtn.current) {\n node.focus();\n }\n }, []);\n\n return isMediumOrAbove || !showSearchButton ? (\n <Flex\n as={StyledAppHeaderSearch}\n item={{ shrink: 0, grow: 1 }}\n md={{ item: { grow: 0, shrink: 1 } }}\n container={{ justify: 'between', alignItems: 'center', gap: 1 }}\n >\n <StyledAppHeaderSearchForm\n role='search'\n aria-label={t('sitewide')}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n <SearchInput {...restProps} ref={searchInputRef} />\n </StyledAppHeaderSearchForm>\n <Button\n variant='simple'\n icon\n onClick={() => {\n setShowSearchButton(true);\n focusSearchBtn.current = true;\n }}\n label={t('collapse_search')}\n >\n <Icon name='times' />\n </Button>\n </Flex>\n ) : (\n <Button\n variant='simple'\n icon\n onClick={() => setShowSearchButton(false)}\n ref={searchButtonRef}\n label={t('expand_search')}\n >\n <Icon name='search' />\n </Button>\n );\n};\n\nconst Utils: FC<UtilsProps> = ({ operator, branch, action, appInfo }) => {\n const isMediumOrAbove = useBreakpoint('md');\n const isSmallOrAbove = useBreakpoint('sm');\n const [appInfoEl, setAppInfoEl] = useElement(null);\n\n return (\n <Flex\n container={{ justify: 'between', alignItems: 'center' }}\n md={{ container: { justify: 'end' } }}\n item={{ shrink: 1 }}\n as={StyledUtilsContainer}\n >\n {appInfo && (\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 0.5 }}\n item={{ shrink: 1 }}\n ref={setAppInfoEl}\n >\n <Flex as={StyledAppName} item={{ shrink: 1 }}>\n {appInfo.name}\n </Flex>\n <StyledAppVersion>{appInfo.version}</StyledAppVersion>\n <Tooltip target={appInfoEl} hideDelay='none'>\n {`${appInfo.name} ${appInfo.version}`}\n </Tooltip>\n </Flex>\n )}\n <Flex container={{ alignItems: 'center' }}>\n {branch && <BranchButton {...branch} compact={isSmallOrAbove ? branch.compact : true} />}\n {action && (\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 0.5 }}\n item={{ shrink: 0 }}\n as={Button}\n variant='secondary'\n icon={!isMediumOrAbove}\n label={isMediumOrAbove ? undefined : action.text}\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n disabled={action.disabled}\n >\n {action.icon && <Icon name={action.icon} />}\n {isMediumOrAbove && action.text}\n </Flex>\n )}\n </Flex>\n {isMediumOrAbove && (\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-end' }}\n name={operator.name}\n >\n <Avatar {...operator.avatar} />\n </AppShellOperator>\n )}\n </Flex>\n );\n};\n\nconst AppHeader: ForwardRefForwardPropsComponent<AppHeaderProps> = forwardRef(function AppHeader(\n {\n contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {},\n brand,\n utils,\n links\n }: PropsWithoutRef<AppHeaderProps>,\n ref: AppHeaderProps['ref']\n) {\n const selectedContext = contexts?.length > 1 ? contexts.find(ctx => ctx.selected)! : contexts[0];\n\n const isMediumOrAbove = useBreakpoint('md');\n const [showSearchButton, setShowSearchButton] = useState(true);\n\n useEffect(() => {\n if (isMediumOrAbove && !showSearchButton) {\n setShowSearchButton(true);\n }\n }, [isMediumOrAbove]);\n\n return (\n <Flex\n as={StyledAppHeader}\n container={{\n justify: 'between',\n alignItems: 'center',\n colGap: 2,\n wrap: 'wrap',\n pad: [0, 1]\n }}\n md={{ container: { wrap: 'nowrap' } }}\n ref={ref}\n >\n {showSearchButton && (\n <Flex\n as={StyledBrandContainer}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 1\n }}\n item={{ shrink: 0, alignSelf: 'stretch' }}\n >\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n />\n )}\n <Flex\n as={brand.onClick || brand.href ? StyledBrandButton : 'div'}\n variant='simple'\n container={{ alignItems: 'center', justify: 'between', gap: 2, pad: 1 }}\n aria-label={`${brand.label} - ${selectedContext.primary}`}\n onClick={brand.onClick}\n href={brand.href}\n >\n <Flex item={{ shrink: 0 }} as={StyledBrandImage} src={brand.logo} alt={brand.label} />\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 1 }}>\n {selectedContext.visual}\n <StyledContext>{selectedContext.primary}</StyledContext>\n </Flex>\n </Flex>\n </Flex>\n )}\n {links && links.length > 0 && <Links links={links} />}\n\n <Flex\n container={{\n gap: 1,\n justify: 'center',\n alignItems: 'center'\n }}\n item={{ grow: showSearchButton ? 0 : 1 }}\n md={{ item: { grow: showSearchButton ? 1 : 0 } }}\n >\n {utils?.search && (\n <AppHeaderSearch\n {...utils.search}\n showSearchButton={showSearchButton}\n setShowSearchButton={setShowSearchButton}\n />\n )}\n {showSearchButton && !isMediumOrAbove && utils?.operator && (\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={utils.operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={utils.operator.name}\n >\n <Avatar {...utils.operator.avatar} />\n </AppShellOperator>\n )}\n </Flex>\n {utils && <Utils {...utils} />}\n </Flex>\n );\n});\n\nexport default AppHeader;\n"]}
@@ -1,8 +1,8 @@
1
1
  import { Text, Tabs } from '@pega/cosmos-react-core';
2
2
  export declare const StyledAppHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
3
3
  export declare const StyledBrandContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
- export declare const StyledBrandButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core/lib/components/Button/BareButton").BareButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
5
- export declare const StyledBrandImage: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ImageProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledBrandButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core/lib/components/Button/BareButton").BareButtonProps>, import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const StyledBrandImage: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ImageProps>, import("styled-components").DefaultTheme, {}, never>;
6
6
  export declare const StyledContext: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
7
7
  export declare const StyledTabs: typeof Tabs;
8
8
  export declare const StyledAppHeaderSearch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,IAAI,EAAE,IAAI,EAAuB,MAAM,yBAAyB,CAAC;AAI5F,eAAO,MAAM,eAAe,4GA8B3B,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAkBhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,0QAa5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,oOAc3B,CAAC;AAEH,eAAO,MAAM,aAAa,0GAIzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,IA4B9B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGA0BjC,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAmBhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,OAAO,IAUjC,CAAC;AAIH,eAAO,MAAM,gBAAgB,EAAE,OAAO,IAKpC,CAAC"}
1
+ {"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,IAAI,EAAE,IAAI,EAAuB,MAAM,yBAAyB,CAAC;AAI5F,eAAO,MAAM,eAAe,4GA8B3B,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAkBhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,yPAa5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,mNAc3B,CAAC;AAEH,eAAO,MAAM,aAAa,0GAIzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,IA4B9B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGA0BjC,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAmBhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,OAAO,IAUjC,CAAC;AAIH,eAAO,MAAM,gBAAgB,EAAE,OAAO,IAKpC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { BackgroundPickerProps } from './BackgroundPicker.types';
2
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<BackgroundPickerProps, "ref"> & import("react").RefAttributes<HTMLInputElement>> & {
3
+ getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["control", "overlay", "swatch-preview", "style", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=BackgroundPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackgroundPicker.d.ts","sourceRoot":"","sources":["../../../src/components/BackgroundPicker/BackgroundPicker.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,0BAA0B,CAAC;;;;AAelC,wBA4ME"}
@@ -0,0 +1,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useRef, useMemo } from 'react';
3
+ import { Flex, FormDialog, FormField, Select, Option, StyledFormControl, Tooltip, useConsolidatedRef, useElement, useI18n, useOuterEvent, useTestIds, useUID, withTestIds, Icon, registerIcon } from '@pega/cosmos-react-core';
4
+ import * as layersIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/layers.icon';
5
+ import { backgroundTypeTranslationKeyMap, positionTranslationKeyMap } from './BackgroundPicker.types';
6
+ import { getBackgroundPickerTestIds } from './BackgroundPicker.test-ids';
7
+ import { ColorSwatchPreview, StyledBackgroundPicker, StyledText } from './BackgroundPicker.styles';
8
+ import GradientConfig from './GradientConfig';
9
+ import ImageConfig from './ImageConfig';
10
+ import SolidColorConfig from './SolidColorConfig';
11
+ import { getBackgroundImageDetails, getBackgroundType, getParsedGradientDetails, supportedBackgroundOptions } from './utils';
12
+ registerIcon(layersIcon);
13
+ export default withTestIds(forwardRef(function BackgroundPicker(props, ref) {
14
+ const uid = useUID();
15
+ const { testId, id = uid, value, label, info, disabled, status, required, readOnly, labelHidden, swatchOnly = false, inline, onBeforeClose, onSubmit, additionalInfo, backgroundOptions, ...restProps } = props;
16
+ const t = useI18n();
17
+ const backgrounds = backgroundOptions ?? supportedBackgroundOptions;
18
+ const bgType = useMemo(() => {
19
+ return getBackgroundType(value, backgrounds) ?? backgrounds[0];
20
+ }, [value, backgrounds]);
21
+ const dialogRef = useConsolidatedRef(ref);
22
+ const swatchRef = useRef(null);
23
+ const [showDialog, setShowDialog] = useState(false);
24
+ const [backgroundType, setBackgroundType] = useState(bgType);
25
+ const testIds = useTestIds(testId, getBackgroundPickerTestIds);
26
+ const solidColorRef = useRef(null);
27
+ const imageRef = useRef(null);
28
+ const gradientRef = useRef(null);
29
+ const [tooltipEl, setTooltipEl] = useElement();
30
+ const hideBackgroundPicker = () => {
31
+ if (showDialog) {
32
+ onBeforeClose?.();
33
+ }
34
+ setShowDialog(false);
35
+ };
36
+ useOuterEvent('mousedown', [dialogRef], hideBackgroundPicker);
37
+ const handleSubmit = () => {
38
+ if (backgroundType === 'solid-color' && solidColorRef.current) {
39
+ onSubmit(solidColorRef.current.getValue());
40
+ }
41
+ else if (backgroundType === 'image' && imageRef.current) {
42
+ onSubmit(imageRef.current.getValue());
43
+ }
44
+ else if (backgroundType.includes('gradient') && gradientRef.current) {
45
+ onSubmit(gradientRef.current.getValue());
46
+ }
47
+ else if (backgroundType === 'transparent') {
48
+ onSubmit('transparent');
49
+ }
50
+ else if (backgroundType === 'automatic') {
51
+ onSubmit('auto');
52
+ }
53
+ };
54
+ const openDialog = () => {
55
+ setShowDialog(true);
56
+ setBackgroundType(bgType);
57
+ };
58
+ const tooltipText = useMemo(() => {
59
+ if (bgType === 'automatic') {
60
+ return `${t('color')}: ${t('automatic')}`;
61
+ }
62
+ if (['transparent', 'solid-color'].includes(bgType)) {
63
+ return `${t('color')}: ${value}`;
64
+ }
65
+ if (bgType === 'image') {
66
+ return `${t('image')}: ${t(positionTranslationKeyMap[getBackgroundImageDetails(value).backgroundPosition])}`;
67
+ }
68
+ if (bgType.includes('gradient')) {
69
+ const stops = getParsedGradientDetails(bgType, value).stops;
70
+ return `${t(backgroundTypeTranslationKeyMap[bgType])}: ${stops[0].color} - ${stops[stops.length - 1].color}`;
71
+ }
72
+ }, [t, value, bgType]);
73
+ return (_jsxs(_Fragment, { children: [_jsx(FormField, { testId: testIds, inline: inline, container: inline ? { justify: 'between' } : undefined, as: StyledBackgroundPicker, id: id, label: label, labelHidden: labelHidden, swatchOnly: swatchOnly, info: info, disabled: disabled, status: status, required: required, additionalInfo: additionalInfo, value: value, children: _jsxs(Flex, { container: { alignItems: 'center' }, item: swatchOnly ? { alignSelf: 'start' } : undefined, as: StyledFormControl, disabled: disabled, status: status, required: required, readOnly: readOnly, ref: swatchRef, onClick: readOnly || disabled ? undefined : openDialog, children: [_jsx("input", { "data-testid": testIds.control, ...restProps, id: id, type: readOnly ? undefined : 'color', value: value, disabled: disabled, required: required, readOnly: readOnly, onClick: e => e.preventDefault(), onChange: () => { } }), _jsx(Flex, { container: { justify: 'center', alignItems: 'center' }, as: ColorSwatchPreview, "data-testid": testIds.swatchPreview, value: value, ref: setTooltipEl, children: bgType === 'automatic' && _jsx(Icon, { name: 'layers' }) }), !swatchOnly && _jsx(StyledText, { children: value })] }) }), swatchRef.current && showDialog && (_jsx(FormDialog, { ref: dialogRef, "data-testid": testIds.overlay, heading: t('edit_background_picker_label', typeof label === 'string' ? [label.toLocaleLowerCase()] : []), target: swatchRef.current, onCancel: hideBackgroundPicker, onSubmit: () => {
74
+ hideBackgroundPicker();
75
+ handleSubmit();
76
+ }, placement: 'auto-end', children: _jsxs(_Fragment, { children: [_jsx(Select, { testId: testIds.style, value: backgroundType, label: t('style'), onChange: e => {
77
+ setBackgroundType(e.target.value);
78
+ }, children: backgrounds.map(option => {
79
+ return (_jsx(Option, { value: option, children: t(backgroundTypeTranslationKeyMap[option]) }, option));
80
+ }) }), backgroundType.includes('gradient') && (_jsx(GradientConfig, { testId: testIds.root, type: backgroundType, value: value, ref: gradientRef })), backgroundType === 'image' && (_jsx(ImageConfig, { testId: testIds.root, value: value, ref: imageRef })), backgroundType === 'solid-color' && (_jsx(SolidColorConfig, { testId: testIds.root, value: value, ref: solidColorRef, disableOpacity: !backgrounds.includes('transparent') }))] }) })), tooltipEl && (_jsx(Tooltip, { target: tooltipEl, showDelay: 'none', hideDelay: 'none', children: tooltipText }))] }));
81
+ }), getBackgroundPickerTestIds);
82
+ //# sourceMappingURL=BackgroundPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackgroundPicker.js","sourceRoot":"","sources":["../../../src/components/BackgroundPicker/BackgroundPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,aAAa,EACb,UAAU,EACV,MAAM,EACN,WAAW,EAEX,IAAI,EACJ,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAE5F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AC,GACK,EACR,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CACtC,KAAC,cAAc,IACb,MAAM,EAAE,OAAO,CAAC,IAAI,EACpB,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,WAAW,GAChB,CACH,EACA,cAAc,KAAK,OAAO,IAAI,CAC7B,KAAC,WAAW,IAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,GAAI,CACnE,EACA,cAAc,KAAK,aAAa,IAAI,CACnC,KAAC,gBAAgB,IACf,MAAM,EAAE,OAAO,CAAC,IAAI,EACpB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,aAAa,EAClB,cAAc,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,GACpD,CACH,IACA,GACQ,CACd,EACA,SAAS,IAAI,CACZ,KAAC,OAAO,IAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YAC1D,WAAW,GACJ,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CACF,EACD,0BAA0B,CAC3B,CAAC","sourcesContent":["import { forwardRef, useState, useRef, useMemo } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Flex,\n FormDialog,\n FormField,\n Select,\n Option,\n StyledFormControl,\n Tooltip,\n useConsolidatedRef,\n useElement,\n useI18n,\n useOuterEvent,\n useTestIds,\n useUID,\n withTestIds,\n type RefElement,\n Icon,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport * as layersIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/layers.icon';\n\nimport {\n backgroundTypeTranslationKeyMap,\n positionTranslationKeyMap\n} from './BackgroundPicker.types';\nimport type {\n BackgroundPickerProps,\n BackgroundType,\n ComputedBackgroundRef\n} from './BackgroundPicker.types';\nimport { getBackgroundPickerTestIds } from './BackgroundPicker.test-ids';\nimport { ColorSwatchPreview, StyledBackgroundPicker, StyledText } from './BackgroundPicker.styles';\nimport GradientConfig from './GradientConfig';\nimport ImageConfig from './ImageConfig';\nimport SolidColorConfig from './SolidColorConfig';\nimport {\n getBackgroundImageDetails,\n getBackgroundType,\n getParsedGradientDetails,\n supportedBackgroundOptions\n} from './utils';\n\nregisterIcon(layersIcon);\n\nexport default withTestIds(\n forwardRef<RefElement<BackgroundPickerProps>, PropsWithoutRef<BackgroundPickerProps>>(\n function BackgroundPicker(props, ref) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n value,\n label,\n info,\n disabled,\n status,\n required,\n readOnly,\n labelHidden,\n swatchOnly = false,\n inline,\n onBeforeClose,\n onSubmit,\n additionalInfo,\n backgroundOptions,\n ...restProps\n } = props;\n\n const t = useI18n();\n const backgrounds: BackgroundType[] = backgroundOptions ?? supportedBackgroundOptions;\n\n const bgType = useMemo(() => {\n return getBackgroundType(value, backgrounds) ?? backgrounds[0];\n }, [value, backgrounds]);\n\n const dialogRef = useConsolidatedRef(ref);\n const swatchRef = useRef(null);\n const [showDialog, setShowDialog] = useState(false);\n const [backgroundType, setBackgroundType] = useState<BackgroundType>(bgType);\n const testIds = useTestIds(testId, getBackgroundPickerTestIds);\n const solidColorRef = useRef<ComputedBackgroundRef>(null);\n const imageRef = useRef<ComputedBackgroundRef>(null);\n const gradientRef = useRef<ComputedBackgroundRef>(null);\n const [tooltipEl, setTooltipEl] = useElement();\n\n const hideBackgroundPicker = () => {\n if (showDialog) {\n onBeforeClose?.();\n }\n\n setShowDialog(false);\n };\n\n useOuterEvent('mousedown', [dialogRef], hideBackgroundPicker);\n\n const handleSubmit = () => {\n if (backgroundType === 'solid-color' && solidColorRef.current) {\n onSubmit(solidColorRef.current.getValue());\n } else if (backgroundType === 'image' && imageRef.current) {\n onSubmit(imageRef.current.getValue());\n } else if (backgroundType.includes('gradient') && gradientRef.current) {\n onSubmit(gradientRef.current.getValue());\n } else if (backgroundType === 'transparent') {\n onSubmit('transparent');\n } else if (backgroundType === 'automatic') {\n onSubmit('auto');\n }\n };\n\n const openDialog = () => {\n setShowDialog(true);\n setBackgroundType(bgType);\n };\n\n const tooltipText = useMemo(() => {\n if (bgType === 'automatic') {\n return `${t('color')}: ${t('automatic')}`;\n }\n if (['transparent', 'solid-color'].includes(bgType)) {\n return `${t('color')}: ${value}`;\n }\n if (bgType === 'image') {\n return `${t('image')}: ${t(positionTranslationKeyMap[getBackgroundImageDetails(value).backgroundPosition])}`;\n }\n if (bgType.includes('gradient')) {\n const stops = getParsedGradientDetails(bgType, value).stops;\n return `${t(backgroundTypeTranslationKeyMap[bgType])}: ${stops[0].color} - ${stops[stops.length - 1].color}`;\n }\n }, [t, value, bgType]);\n\n return (\n <>\n <FormField\n testId={testIds}\n inline={inline}\n container={inline ? { justify: 'between' } : undefined}\n as={StyledBackgroundPicker}\n id={id}\n label={label}\n labelHidden={labelHidden}\n swatchOnly={swatchOnly}\n info={info}\n disabled={disabled}\n status={status}\n required={required}\n additionalInfo={additionalInfo}\n value={value}\n >\n <Flex\n container={{ alignItems: 'center' }}\n item={swatchOnly ? { alignSelf: 'start' } : undefined}\n as={StyledFormControl}\n disabled={disabled}\n status={status}\n required={required}\n readOnly={readOnly}\n ref={swatchRef}\n onClick={readOnly || disabled ? undefined : openDialog}\n >\n <input\n data-testid={testIds.control}\n {...restProps}\n id={id}\n type={readOnly ? undefined : 'color'}\n value={value}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n onClick={e => e.preventDefault()}\n onChange={() => {}}\n />\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={ColorSwatchPreview}\n data-testid={testIds.swatchPreview}\n value={value}\n ref={setTooltipEl}\n >\n {bgType === 'automatic' && <Icon name='layers' />}\n </Flex>\n {!swatchOnly && <StyledText>{value}</StyledText>}\n </Flex>\n </FormField>\n {swatchRef.current && showDialog && (\n <FormDialog\n ref={dialogRef}\n data-testid={testIds.overlay}\n heading={t(\n 'edit_background_picker_label',\n typeof label === 'string' ? [label.toLocaleLowerCase()] : []\n )}\n target={swatchRef.current}\n onCancel={hideBackgroundPicker}\n onSubmit={() => {\n hideBackgroundPicker();\n handleSubmit();\n }}\n placement='auto-end'\n >\n <>\n <Select\n testId={testIds.style}\n value={backgroundType}\n label={t('style')}\n onChange={e => {\n setBackgroundType(e.target.value as BackgroundType);\n }}\n >\n {backgrounds.map(option => {\n return (\n <Option key={option} value={option}>\n {t(backgroundTypeTranslationKeyMap[option])}\n </Option>\n );\n })}\n </Select>\n {backgroundType.includes('gradient') && (\n <GradientConfig\n testId={testIds.root}\n type={backgroundType}\n value={value}\n ref={gradientRef}\n />\n )}\n {backgroundType === 'image' && (\n <ImageConfig testId={testIds.root} value={value} ref={imageRef} />\n )}\n {backgroundType === 'solid-color' && (\n <SolidColorConfig\n testId={testIds.root}\n value={value}\n ref={solidColorRef}\n disableOpacity={!backgrounds.includes('transparent')}\n />\n )}\n </>\n </FormDialog>\n )}\n {tooltipEl && (\n <Tooltip target={tooltipEl} showDelay='none' hideDelay='none'>\n {tooltipText}\n </Tooltip>\n )}\n </>\n );\n }\n ),\n getBackgroundPickerTestIds\n);\n"]}
@@ -0,0 +1,15 @@
1
+ import { type DefaultTheme } from 'styled-components';
2
+ import type { BackgroundPickerPropsWithDefaults } from './BackgroundPicker.types';
3
+ export declare const StyledBackgroundPicker: import("styled-components").StyledComponent<"div", DefaultTheme, Pick<BackgroundPickerPropsWithDefaults, "value" | "swatchOnly">, never>;
4
+ export declare const ColorSwatchPreview: import("styled-components").StyledComponent<"div", DefaultTheme, {
5
+ value: string;
6
+ theme: DefaultTheme;
7
+ }, never>;
8
+ export declare const StyledPreviewContainer: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
9
+ export declare const StyledPreview: import("styled-components").StyledComponent<"div", DefaultTheme, {
10
+ background: string;
11
+ }, never>;
12
+ export declare const StyledFlex: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, DefaultTheme, {}, never>;
13
+ export declare const StyledTableWrapper: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, DefaultTheme, {}, never>;
14
+ export declare const StyledText: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, DefaultTheme, {}, never>;
15
+ //# sourceMappingURL=BackgroundPicker.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackgroundPicker.styles.d.ts","sourceRoot":"","sources":["../../../src/components/BackgroundPicker/BackgroundPicker.styles.ts"],"names":[],"mappings":"AAAA,OAAe,EAAO,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAkBnE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAElF,eAAO,MAAM,sBAAsB,0IAiGlC,CAAC;AAIF,eAAO,MAAM,kBAAkB;WASpB,MAAM;WACN,YAAY;SAiCtB,CAAC;AAIF,eAAO,MAAM,sBAAsB,6EAOjC,CAAC;AAIH,eAAO,MAAM,aAAa;gBAA4B,MAAM;SAM1D,CAAC;AAEH,eAAO,MAAM,UAAU,sLAQtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sLAU7B,CAAC;AAIH,eAAO,MAAM,UAAU,sLAEtB,CAAC"}
@@ -0,0 +1,152 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { hideVisually, parseToRgb } from 'polished';
3
+ import { calculateFontSize, StyledFormControl, defaultThemeProp, Flex, StyledCard, Text, StyledIcon, tryCatch } from '@pega/cosmos-react-core';
4
+ import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
5
+ import StyledInput from '@pega/cosmos-react-core/lib/components/Input/Input.styles';
6
+ import { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';
7
+ export const StyledBackgroundPicker = styled.div(({ theme: { base: { spacing, colors: { purple }, shadow: { focus }, 'font-family': fontFamily, 'font-size': fontSize, 'font-scale': fontScale }, components: { input: { height }, 'form-control': { 'border-width': borderWidth, 'border-color': borderColor } } }, swatchOnly, value }) => {
8
+ const fontSizes = calculateFontSize(fontSize, fontScale);
9
+ return css `
10
+ ${StyledFormControl} {
11
+ overflow: hidden;
12
+ border-width: ${value === 'auto' ? `calc(1.5 * ${borderWidth})` : borderWidth};
13
+ border-style: ${value === 'auto' ? 'dotted' : 'solid'};
14
+
15
+ ${value === 'auto' &&
16
+ css `
17
+ border-color: ${purple.medium};
18
+ `}
19
+
20
+ ${!swatchOnly &&
21
+ css `
22
+ min-width: calc(16 * ${spacing});
23
+ `}
24
+
25
+ ${!swatchOnly &&
26
+ css `
27
+ padding-inline-end: ${spacing};
28
+ `}
29
+
30
+ &:focus-within {
31
+ box-shadow: ${focus};
32
+ border: none;
33
+ }
34
+
35
+ &:hover:not([readonly]):not([disabled]):not(:focus, :focus-within) {
36
+ ${value === 'auto' &&
37
+ css `
38
+ border-color: ${purple.dark};
39
+ `}
40
+ }
41
+
42
+ & > input {
43
+ ${hideVisually}
44
+
45
+ & + div {
46
+ height: calc(${height} - (2 * ${borderWidth}));
47
+
48
+ ${swatchOnly
49
+ ? css `
50
+ width: calc(${height} - (2 * ${borderWidth}));
51
+ `
52
+ : css `
53
+ min-width: calc(${height} - ${borderWidth});
54
+ margin-inline-end: ${spacing};
55
+ border-inline-end: ${borderWidth} solid ${borderColor};
56
+ `}
57
+ }
58
+
59
+ &:focus + div {
60
+ width: ${height};
61
+ height: ${height};
62
+ }
63
+ }
64
+
65
+ & input {
66
+ height: 2rem;
67
+ min-height: 2rem;
68
+ color: #000000;
69
+ background-color: #ffffff;
70
+ font-size: ${fontSizes.s};
71
+ font-family: ${fontFamily};
72
+
73
+ & + label {
74
+ font-weight: 600;
75
+ color: rgba(0, 0, 0, 0.6);
76
+ font-size: ${fontSizes.s};
77
+ font-family: ${fontFamily};
78
+ }
79
+ }
80
+ }
81
+ `;
82
+ });
83
+ StyledBackgroundPicker.defaultProps = defaultThemeProp;
84
+ export const ColorSwatchPreview = styled.div(({ value, theme: { base: { colors: { purple } } } }) => {
85
+ const rgb = tryCatch(() => parseToRgb(value));
86
+ let background = value;
87
+ if (value === 'auto') {
88
+ background = 'transparent';
89
+ }
90
+ else if (value === 'transparent' || (rgb && rgb.alpha === 0)) {
91
+ // Red slash to denote transparent or no color
92
+ background =
93
+ 'linear-gradient(137deg,#ffffff 0%,#ffffff 50%,#ff0000 54%,#ffffff 58%,#ffffff 100%)';
94
+ }
95
+ return css `
96
+ background: repeating-conic-gradient(#dddddd 0% 25%, transparent 0% 50%) 0 0 / 0.5rem 0.5rem;
97
+ position: relative;
98
+
99
+ & ${StyledIcon} {
100
+ width: 50%;
101
+ height: 50%;
102
+ z-index: 1;
103
+ fill: ${purple.dark};
104
+ }
105
+
106
+ &::after {
107
+ content: '';
108
+ position: absolute;
109
+ width: 100%;
110
+ height: 100%;
111
+ background: ${background};
112
+ }
113
+ `;
114
+ });
115
+ ColorSwatchPreview.defaultProps = defaultThemeProp;
116
+ export const StyledPreviewContainer = styled.div(({ theme }) => {
117
+ return css `
118
+ background: repeating-conic-gradient(#dddddd 0% 25%, transparent 0% 50%) 0 0 / 0.5rem 0.5rem;
119
+ height: ${theme.base['content-width'].xs};
120
+ border: 0.0625rem solid ${theme.base.palette['border-line']};
121
+ position: relative;
122
+ `;
123
+ });
124
+ StyledPreviewContainer.defaultProps = defaultThemeProp;
125
+ export const StyledPreview = styled.div(({ background }) => {
126
+ return css `
127
+ background: ${background};
128
+ width: 100%;
129
+ height: 100%;
130
+ `;
131
+ });
132
+ export const StyledFlex = styled(Flex) `
133
+ ${StyledCard} {
134
+ width: 100%;
135
+ }
136
+
137
+ &&& ${StyledCardContent} {
138
+ padding: 0;
139
+ }
140
+ `;
141
+ export const StyledTableWrapper = styled(Flex)(({ theme: { base: { spacing } } }) => {
142
+ return css `
143
+ ${StyledInput} {
144
+ width: calc(6 * ${spacing});
145
+ }
146
+ `;
147
+ });
148
+ StyledTableWrapper.defaultProps = defaultThemeProp;
149
+ export const StyledText = styled(Text) `
150
+ ${ellipsisOverflow}
151
+ `;
152
+ //# sourceMappingURL=BackgroundPicker.styles.js.map