@databricks/design-system 1.12.8 → 1.12.10

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 (408) hide show
  1. package/dist/{Typography-e3d5ff23.js → DropdownMenu-e0c3fc1d.js} +860 -159
  2. package/dist/DropdownMenu-e0c3fc1d.js.map +1 -0
  3. package/dist/{common-1fb3eeb9.js → common-31040b66.js} +1 -1
  4. package/dist/{common-1fb3eeb9.js.map → common-31040b66.js.map} +1 -1
  5. package/dist/design-system/AccessibleContainer/index.d.ts +7 -0
  6. package/dist/design-system/AccessibleContainer/index.d.ts.map +1 -0
  7. package/dist/design-system/Alert/Alert.d.ts.map +1 -1
  8. package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts +4 -7
  9. package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts.map +1 -1
  10. package/dist/design-system/DialogCombobox/DialogCombobox.d.ts +3 -1
  11. package/dist/design-system/DialogCombobox/DialogCombobox.d.ts.map +1 -1
  12. package/dist/design-system/DialogCombobox/DialogComboboxAddButton.d.ts +2 -0
  13. package/dist/design-system/DialogCombobox/DialogComboboxAddButton.d.ts.map +1 -0
  14. package/dist/design-system/DialogCombobox/DialogComboboxContent.d.ts +3 -1
  15. package/dist/design-system/DialogCombobox/DialogComboboxContent.d.ts.map +1 -1
  16. package/dist/design-system/DialogCombobox/DialogComboboxFooter.d.ts +2 -0
  17. package/dist/design-system/DialogCombobox/DialogComboboxFooter.d.ts.map +1 -0
  18. package/dist/design-system/DialogCombobox/DialogComboboxHintRow.d.ts +7 -0
  19. package/dist/design-system/DialogCombobox/DialogComboboxHintRow.d.ts.map +1 -0
  20. package/dist/design-system/DialogCombobox/DialogComboboxOptionControlledList.d.ts +2 -1
  21. package/dist/design-system/DialogCombobox/DialogComboboxOptionControlledList.d.ts.map +1 -1
  22. package/dist/design-system/DialogCombobox/DialogComboboxOptionList.d.ts.map +1 -1
  23. package/dist/design-system/DialogCombobox/DialogComboboxOptionListCheckboxItem.d.ts +1 -0
  24. package/dist/design-system/DialogCombobox/DialogComboboxOptionListCheckboxItem.d.ts.map +1 -1
  25. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSearch.d.ts.map +1 -1
  26. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSelectItem.d.ts +1 -0
  27. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSelectItem.d.ts.map +1 -1
  28. package/dist/design-system/DialogCombobox/DialogComboboxTrigger.d.ts +4 -2
  29. package/dist/design-system/DialogCombobox/DialogComboboxTrigger.d.ts.map +1 -1
  30. package/dist/design-system/DialogCombobox/index.d.ts +2 -0
  31. package/dist/design-system/DialogCombobox/index.d.ts.map +1 -1
  32. package/dist/design-system/DialogCombobox/providers/DialogComboboxContext.d.ts +7 -0
  33. package/dist/design-system/DialogCombobox/providers/DialogComboboxContext.d.ts.map +1 -1
  34. package/dist/design-system/DialogCombobox/providers/DialogComboboxOptionListContext.d.ts +2 -2
  35. package/dist/design-system/DialogCombobox/providers/DialogComboboxOptionListContext.d.ts.map +1 -1
  36. package/dist/design-system/DialogCombobox/shared.d.ts +3 -0
  37. package/dist/design-system/DialogCombobox/shared.d.ts.map +1 -1
  38. package/dist/design-system/Drawer/Drawer.d.ts +7 -2
  39. package/dist/design-system/Drawer/Drawer.d.ts.map +1 -1
  40. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts +7 -0
  41. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  42. package/dist/design-system/FormV2/RHFAdapters.d.ts +38 -1
  43. package/dist/design-system/FormV2/RHFAdapters.d.ts.map +1 -1
  44. package/dist/design-system/Header/Header.d.ts.map +1 -1
  45. package/dist/design-system/Icon/__generated/icons/BarGroupedIcon.d.ts +4 -0
  46. package/dist/design-system/Icon/__generated/icons/BarGroupedIcon.d.ts.map +1 -0
  47. package/dist/design-system/Icon/__generated/icons/BarStackedIcon.d.ts +4 -0
  48. package/dist/design-system/Icon/__generated/icons/BarStackedIcon.d.ts.map +1 -0
  49. package/dist/design-system/Icon/__generated/icons/CalendarClockIcon.d.ts +4 -0
  50. package/dist/design-system/Icon/__generated/icons/CalendarClockIcon.d.ts.map +1 -0
  51. package/dist/design-system/Icon/__generated/icons/CatalogOffIcon.d.ts +4 -0
  52. package/dist/design-system/Icon/__generated/icons/CatalogOffIcon.d.ts.map +1 -0
  53. package/dist/design-system/Icon/__generated/icons/CheckboxIcon.d.ts +4 -0
  54. package/dist/design-system/Icon/__generated/icons/CheckboxIcon.d.ts.map +1 -0
  55. package/dist/design-system/Icon/__generated/icons/ColumnsIcon.d.ts +4 -0
  56. package/dist/design-system/Icon/__generated/icons/ColumnsIcon.d.ts.map +1 -0
  57. package/dist/design-system/Icon/__generated/icons/FaceNeutralIcon.d.ts.map +1 -1
  58. package/dist/design-system/Icon/__generated/icons/FloatIcon.d.ts +4 -0
  59. package/dist/design-system/Icon/__generated/icons/FloatIcon.d.ts.map +1 -0
  60. package/dist/design-system/Icon/__generated/icons/FolderCloudFilledIcon.d.ts +4 -0
  61. package/dist/design-system/Icon/__generated/icons/FolderCloudFilledIcon.d.ts.map +1 -0
  62. package/dist/design-system/Icon/__generated/icons/FolderCloudIcon.d.ts +4 -0
  63. package/dist/design-system/Icon/__generated/icons/FolderCloudIcon.d.ts.map +1 -0
  64. package/dist/design-system/Icon/__generated/icons/LibrariesIcon.d.ts +4 -0
  65. package/dist/design-system/Icon/__generated/icons/LibrariesIcon.d.ts.map +1 -0
  66. package/dist/design-system/Icon/__generated/icons/RobotIcon.d.ts +4 -0
  67. package/dist/design-system/Icon/__generated/icons/RobotIcon.d.ts.map +1 -0
  68. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalAscendingIcon.d.ts +4 -0
  69. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalAscendingIcon.d.ts.map +1 -0
  70. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalDescendingIcon.d.ts +4 -0
  71. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalDescendingIcon.d.ts.map +1 -0
  72. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalLeftIcon.d.ts +4 -0
  73. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalLeftIcon.d.ts.map +1 -0
  74. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalRightIcon.d.ts +4 -0
  75. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalRightIcon.d.ts.map +1 -0
  76. package/dist/design-system/Icon/__generated/icons/StopIcon.d.ts.map +1 -1
  77. package/dist/design-system/Icon/__generated/icons/WorkflowsIcon.d.ts +4 -0
  78. package/dist/design-system/Icon/__generated/icons/WorkflowsIcon.d.ts.map +1 -0
  79. package/dist/design-system/Icon/__generated/icons/index.d.ts +16 -1
  80. package/dist/design-system/Icon/__generated/icons/index.d.ts.map +1 -1
  81. package/dist/design-system/Input/Input.d.ts.map +1 -1
  82. package/dist/design-system/Layout/Layout.d.ts +3 -0
  83. package/dist/design-system/Layout/Layout.d.ts.map +1 -1
  84. package/dist/design-system/Radio/Radio.d.ts.map +1 -1
  85. package/dist/{development → design-system}/SelectV2/Select.d.ts +1 -1
  86. package/dist/design-system/SelectV2/Select.d.ts.map +1 -0
  87. package/dist/{development → design-system}/SelectV2/SelectContent.d.ts +1 -1
  88. package/dist/design-system/SelectV2/SelectContent.d.ts.map +1 -0
  89. package/dist/{development → design-system}/SelectV2/SelectOption.d.ts +1 -1
  90. package/dist/design-system/SelectV2/SelectOption.d.ts.map +1 -0
  91. package/dist/design-system/SelectV2/SelectOptionGroup.d.ts.map +1 -0
  92. package/dist/{development → design-system}/SelectV2/SelectTrigger.d.ts +1 -1
  93. package/dist/design-system/SelectV2/SelectTrigger.d.ts.map +1 -0
  94. package/dist/design-system/SelectV2/hooks/useSelectContext.d.ts.map +1 -0
  95. package/dist/design-system/SelectV2/index.d.ts.map +1 -0
  96. package/dist/design-system/SelectV2/providers/SelectContext.d.ts.map +1 -0
  97. package/dist/design-system/Sidebar/Sidebar.d.ts +2 -1
  98. package/dist/design-system/Sidebar/Sidebar.d.ts.map +1 -1
  99. package/dist/design-system/Skeleton/LegacySkeleton.d.ts +16 -0
  100. package/dist/design-system/Skeleton/LegacySkeleton.d.ts.map +1 -0
  101. package/dist/design-system/Skeleton/index.d.ts +1 -1
  102. package/dist/design-system/Skeleton/index.d.ts.map +1 -1
  103. package/dist/design-system/SkeletonV2/GenericSkeleton.d.ts +12 -0
  104. package/dist/design-system/SkeletonV2/GenericSkeleton.d.ts.map +1 -0
  105. package/dist/design-system/SkeletonV2/ParagraphSkeleton.d.ts +15 -0
  106. package/dist/design-system/SkeletonV2/ParagraphSkeleton.d.ts.map +1 -0
  107. package/dist/design-system/{TableUI → SkeletonV2}/TableSkeleton.d.ts +2 -0
  108. package/dist/design-system/SkeletonV2/TableSkeleton.d.ts.map +1 -0
  109. package/dist/design-system/SkeletonV2/TitleSkeleton.d.ts +12 -0
  110. package/dist/design-system/SkeletonV2/TitleSkeleton.d.ts.map +1 -0
  111. package/dist/design-system/SkeletonV2/index.d.ts +5 -0
  112. package/dist/design-system/SkeletonV2/index.d.ts.map +1 -0
  113. package/dist/design-system/SkeletonV2/utils.d.ts +7 -0
  114. package/dist/design-system/SkeletonV2/utils.d.ts.map +1 -0
  115. package/dist/design-system/Spinner/Spinner.d.ts +1 -0
  116. package/dist/design-system/Spinner/Spinner.d.ts.map +1 -1
  117. package/dist/design-system/TableUI/TableCell.d.ts +3 -1
  118. package/dist/design-system/TableUI/TableCell.d.ts.map +1 -1
  119. package/dist/design-system/TableUI/TableHeader.d.ts +3 -1
  120. package/dist/design-system/TableUI/TableHeader.d.ts.map +1 -1
  121. package/dist/design-system/TableUI/TableRowAction.d.ts.map +1 -1
  122. package/dist/design-system/TableUI/index.d.ts +0 -1
  123. package/dist/design-system/TableUI/index.d.ts.map +1 -1
  124. package/dist/design-system/Tag/index.d.ts.map +1 -1
  125. package/dist/design-system/Tooltip/InfoTooltip.d.ts +8 -0
  126. package/dist/design-system/Tooltip/InfoTooltip.d.ts.map +1 -0
  127. package/dist/design-system/Tooltip/index.d.ts +1 -0
  128. package/dist/design-system/Tooltip/index.d.ts.map +1 -1
  129. package/dist/design-system/Tree/Tree.d.ts +2 -2
  130. package/dist/design-system/Tree/Tree.d.ts.map +1 -1
  131. package/dist/design-system/Typography/Hint.d.ts +14 -0
  132. package/dist/design-system/Typography/Hint.d.ts.map +1 -0
  133. package/dist/design-system/Typography/Paragraph.d.ts.map +1 -1
  134. package/dist/design-system/Typography/Text.d.ts +3 -0
  135. package/dist/design-system/Typography/Text.d.ts.map +1 -1
  136. package/dist/design-system/Typography/Title.d.ts.map +1 -1
  137. package/dist/design-system/Typography/Typography.d.ts +2 -0
  138. package/dist/design-system/Typography/Typography.d.ts.map +1 -1
  139. package/dist/design-system/index.d.ts +3 -0
  140. package/dist/design-system/index.d.ts.map +1 -1
  141. package/dist/design-system/utils/index.d.ts +1 -0
  142. package/dist/design-system/utils/index.d.ts.map +1 -1
  143. package/dist/development/ChatUI/ChatInput.d.ts.map +1 -1
  144. package/dist/development/ChatUI/CodeSnippet.d.ts.map +1 -1
  145. package/dist/development/ChatUI/Feedback.d.ts.map +1 -1
  146. package/dist/development/ChatUI/MessageActionButton.d.ts +4 -0
  147. package/dist/development/ChatUI/MessageActionButton.d.ts.map +1 -0
  148. package/dist/development/ChatUI/MessageHeader.d.ts.map +1 -1
  149. package/dist/development/ChatUI/index.d.ts +1 -0
  150. package/dist/development/ChatUI/index.d.ts.map +1 -1
  151. package/dist/development/ContextMenu/ContextMenu.d.ts +58 -0
  152. package/dist/development/ContextMenu/ContextMenu.d.ts.map +1 -0
  153. package/dist/development/ContextMenu/index.d.ts +2 -0
  154. package/dist/development/ContextMenu/index.d.ts.map +1 -0
  155. package/dist/development/index.d.ts +2 -1
  156. package/dist/development/index.d.ts.map +1 -1
  157. package/dist/development.js +394 -135
  158. package/dist/development.js.map +1 -1
  159. package/dist/flags.d.ts +0 -1
  160. package/dist/flags.d.ts.map +1 -1
  161. package/dist/index-dark.css +230 -3520
  162. package/dist/index.css +230 -3520
  163. package/dist/index.js +3334 -2650
  164. package/dist/index.js.map +1 -1
  165. package/dist/rollup/less.d.ts +3 -0
  166. package/dist/rollup/less.d.ts.map +1 -0
  167. package/dist/styles.js +1 -0
  168. package/dist/styles.js.map +1 -0
  169. package/dist/test-utils/enzyme.js +6 -3
  170. package/dist/test-utils/enzyme.js.map +1 -1
  171. package/dist/test-utils/rtl/selectEvent.d.ts.map +1 -1
  172. package/dist/test-utils/rtl.js +55 -13
  173. package/dist/test-utils/rtl.js.map +1 -1
  174. package/dist/theme/colorList.d.ts +10 -0
  175. package/dist/theme/colorList.d.ts.map +1 -1
  176. package/dist/theme/colors.d.ts.map +1 -1
  177. package/package.json +28 -34
  178. package/dist/Spinner-140f57ac.js +0 -2525
  179. package/dist/Spinner-140f57ac.js.map +0 -1
  180. package/dist/Typography-1b037412.js +0 -2074
  181. package/dist/Typography-1b037412.js.map +0 -1
  182. package/dist/Typography-e3d5ff23.js.map +0 -1
  183. package/dist/common-3ab0e300.js +0 -15
  184. package/dist/common-3ab0e300.js.map +0 -1
  185. package/dist/common-819b45d4.js +0 -15
  186. package/dist/common-819b45d4.js.map +0 -1
  187. package/dist/design-system/Button/Button.test.d.ts +0 -2
  188. package/dist/design-system/Button/Button.test.d.ts.map +0 -1
  189. package/dist/design-system/Checkbox/Checkbox.test.d.ts +0 -2
  190. package/dist/design-system/Checkbox/Checkbox.test.d.ts.map +0 -1
  191. package/dist/design-system/DesignSystemProvider/DesignSystemProvider.test.d.ts +0 -2
  192. package/dist/design-system/DesignSystemProvider/DesignSystemProvider.test.d.ts.map +0 -1
  193. package/dist/design-system/DesignSystemProvider/DesignSystemThemeProvider.test.d.ts +0 -2
  194. package/dist/design-system/DesignSystemProvider/DesignSystemThemeProvider.test.d.ts.map +0 -1
  195. package/dist/design-system/DialogCombobox/tests/DialogCombobox.test.d.ts +0 -2
  196. package/dist/design-system/DialogCombobox/tests/DialogCombobox.test.d.ts.map +0 -1
  197. package/dist/design-system/DialogCombobox/tests/DialogComboboxButtonContainer.test.d.ts +0 -2
  198. package/dist/design-system/DialogCombobox/tests/DialogComboboxButtonContainer.test.d.ts.map +0 -1
  199. package/dist/design-system/DialogCombobox/tests/DialogComboboxContent.test.d.ts +0 -2
  200. package/dist/design-system/DialogCombobox/tests/DialogComboboxContent.test.d.ts.map +0 -1
  201. package/dist/design-system/DialogCombobox/tests/DialogComboboxOptionList.test.d.ts +0 -2
  202. package/dist/design-system/DialogCombobox/tests/DialogComboboxOptionList.test.d.ts.map +0 -1
  203. package/dist/design-system/DialogCombobox/tests/DialogComboboxOptionListCheckboxItem.test.d.ts +0 -2
  204. package/dist/design-system/DialogCombobox/tests/DialogComboboxOptionListCheckboxItem.test.d.ts.map +0 -1
  205. package/dist/design-system/DialogCombobox/tests/DialogComboboxOptionListSelectItem.test.d.ts +0 -2
  206. package/dist/design-system/DialogCombobox/tests/DialogComboboxOptionListSelectItem.test.d.ts.map +0 -1
  207. package/dist/design-system/DialogCombobox/tests/DialogComboboxTrigger.test.d.ts +0 -2
  208. package/dist/design-system/DialogCombobox/tests/DialogComboboxTrigger.test.d.ts.map +0 -1
  209. package/dist/design-system/DropdownMenu/DropdownMenu.test.d.ts +0 -2
  210. package/dist/design-system/DropdownMenu/DropdownMenu.test.d.ts.map +0 -1
  211. package/dist/design-system/Icon/__generated/icons/AppIcon.v2.d.ts +0 -4
  212. package/dist/design-system/Icon/__generated/icons/AppIcon.v2.d.ts.map +0 -1
  213. package/dist/design-system/Icon/__generated/icons/BinaryIcon.v2.d.ts +0 -4
  214. package/dist/design-system/Icon/__generated/icons/BinaryIcon.v2.d.ts.map +0 -1
  215. package/dist/design-system/Icon/__generated/icons/BoldIcon.v2.d.ts +0 -4
  216. package/dist/design-system/Icon/__generated/icons/BoldIcon.v2.d.ts.map +0 -1
  217. package/dist/design-system/Icon/__generated/icons/BracketsCurlyIcon.v2.d.ts +0 -4
  218. package/dist/design-system/Icon/__generated/icons/BracketsCurlyIcon.v2.d.ts.map +0 -1
  219. package/dist/design-system/Icon/__generated/icons/BracketsSquareIcon.v2.d.ts +0 -4
  220. package/dist/design-system/Icon/__generated/icons/BracketsSquareIcon.v2.d.ts.map +0 -1
  221. package/dist/design-system/Icon/__generated/icons/BracketsXIcon.v2.d.ts +0 -4
  222. package/dist/design-system/Icon/__generated/icons/BracketsXIcon.v2.d.ts.map +0 -1
  223. package/dist/design-system/Icon/__generated/icons/CatalogIcon.v2.d.ts +0 -4
  224. package/dist/design-system/Icon/__generated/icons/CatalogIcon.v2.d.ts.map +0 -1
  225. package/dist/design-system/Icon/__generated/icons/ChartLineIcon.v2.d.ts +0 -4
  226. package/dist/design-system/Icon/__generated/icons/ChartLineIcon.v2.d.ts.map +0 -1
  227. package/dist/design-system/Icon/__generated/icons/CheckCircleBadgeIcon.v2.d.ts +0 -4
  228. package/dist/design-system/Icon/__generated/icons/CheckCircleBadgeIcon.v2.d.ts.map +0 -1
  229. package/dist/design-system/Icon/__generated/icons/CloudKeyIcon.v2.d.ts +0 -4
  230. package/dist/design-system/Icon/__generated/icons/CloudKeyIcon.v2.d.ts.map +0 -1
  231. package/dist/design-system/Icon/__generated/icons/CloudModelIcon.v2.d.ts +0 -4
  232. package/dist/design-system/Icon/__generated/icons/CloudModelIcon.v2.d.ts.map +0 -1
  233. package/dist/design-system/Icon/__generated/icons/ColorFillIcon.v2.d.ts +0 -4
  234. package/dist/design-system/Icon/__generated/icons/ColorFillIcon.v2.d.ts.map +0 -1
  235. package/dist/design-system/Icon/__generated/icons/ConnectIcon.v2.d.ts +0 -4
  236. package/dist/design-system/Icon/__generated/icons/ConnectIcon.v2.d.ts.map +0 -1
  237. package/dist/design-system/Icon/__generated/icons/CursorIcon.v2.d.ts +0 -4
  238. package/dist/design-system/Icon/__generated/icons/CursorIcon.v2.d.ts.map +0 -1
  239. package/dist/design-system/Icon/__generated/icons/DagIcon.v2.d.ts +0 -4
  240. package/dist/design-system/Icon/__generated/icons/DagIcon.v2.d.ts.map +0 -1
  241. package/dist/design-system/Icon/__generated/icons/DecimalIcon.v2.d.ts +0 -4
  242. package/dist/design-system/Icon/__generated/icons/DecimalIcon.v2.d.ts.map +0 -1
  243. package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.v2.d.ts +0 -4
  244. package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.v2.d.ts.map +0 -1
  245. package/dist/design-system/Icon/__generated/icons/FontIcon.v2.d.ts +0 -4
  246. package/dist/design-system/Icon/__generated/icons/FontIcon.v2.d.ts.map +0 -1
  247. package/dist/design-system/Icon/__generated/icons/FunctionIcon.v2.d.ts +0 -4
  248. package/dist/design-system/Icon/__generated/icons/FunctionIcon.v2.d.ts.map +0 -1
  249. package/dist/design-system/Icon/__generated/icons/GiftIcon.v2.d.ts +0 -4
  250. package/dist/design-system/Icon/__generated/icons/GiftIcon.v2.d.ts.map +0 -1
  251. package/dist/design-system/Icon/__generated/icons/ItalicIcon.v2.d.ts +0 -4
  252. package/dist/design-system/Icon/__generated/icons/ItalicIcon.v2.d.ts.map +0 -1
  253. package/dist/design-system/Icon/__generated/icons/LettersIcon.v2.d.ts +0 -4
  254. package/dist/design-system/Icon/__generated/icons/LettersIcon.v2.d.ts.map +0 -1
  255. package/dist/design-system/Icon/__generated/icons/MenuIcon.v2.d.ts +0 -4
  256. package/dist/design-system/Icon/__generated/icons/MenuIcon.v2.d.ts.map +0 -1
  257. package/dist/design-system/Icon/__generated/icons/NotificationOffIcon.v2.d.ts +0 -4
  258. package/dist/design-system/Icon/__generated/icons/NotificationOffIcon.v2.d.ts.map +0 -1
  259. package/dist/design-system/Icon/__generated/icons/NumbersIcon.v2.d.ts +0 -4
  260. package/dist/design-system/Icon/__generated/icons/NumbersIcon.v2.d.ts.map +0 -1
  261. package/dist/design-system/Icon/__generated/icons/PipelineIcon.v2.d.ts +0 -4
  262. package/dist/design-system/Icon/__generated/icons/PipelineIcon.v2.d.ts.map +0 -1
  263. package/dist/design-system/Icon/__generated/icons/PlugIcon.v2.d.ts +0 -4
  264. package/dist/design-system/Icon/__generated/icons/PlugIcon.v2.d.ts.map +0 -1
  265. package/dist/design-system/Icon/__generated/icons/ReposIcon.d.ts +0 -4
  266. package/dist/design-system/Icon/__generated/icons/ReposIcon.d.ts.map +0 -1
  267. package/dist/design-system/Icon/__generated/icons/SaveIcon.v2.d.ts +0 -4
  268. package/dist/design-system/Icon/__generated/icons/SaveIcon.v2.d.ts.map +0 -1
  269. package/dist/design-system/Icon/__generated/icons/SlidersIcon.v2.d.ts +0 -4
  270. package/dist/design-system/Icon/__generated/icons/SlidersIcon.v2.d.ts.map +0 -1
  271. package/dist/design-system/Icon/__generated/icons/SortAscendingIcon.v2.d.ts +0 -4
  272. package/dist/design-system/Icon/__generated/icons/SortAscendingIcon.v2.d.ts.map +0 -1
  273. package/dist/design-system/Icon/__generated/icons/SortDescendingIcon.v2.d.ts +0 -4
  274. package/dist/design-system/Icon/__generated/icons/SortDescendingIcon.v2.d.ts.map +0 -1
  275. package/dist/design-system/Icon/__generated/icons/SortUnsortedIcon.v2.d.ts +0 -4
  276. package/dist/design-system/Icon/__generated/icons/SortUnsortedIcon.v2.d.ts.map +0 -1
  277. package/dist/design-system/Icon/__generated/icons/StorefrontIcon.v2.d.ts +0 -4
  278. package/dist/design-system/Icon/__generated/icons/StorefrontIcon.v2.d.ts.map +0 -1
  279. package/dist/design-system/Icon/__generated/icons/TextBoxIcon.v2.d.ts +0 -4
  280. package/dist/design-system/Icon/__generated/icons/TextBoxIcon.v2.d.ts.map +0 -1
  281. package/dist/design-system/Icon/__generated/icons/UnderlineIcon.v2.d.ts +0 -4
  282. package/dist/design-system/Icon/__generated/icons/UnderlineIcon.v2.d.ts.map +0 -1
  283. package/dist/design-system/Icon/__generated/icons/VariableIcon.d.ts +0 -4
  284. package/dist/design-system/Icon/__generated/icons/VariableIcon.d.ts.map +0 -1
  285. package/dist/design-system/Icon/__generated/icons/VariableIcon.v2.d.ts +0 -4
  286. package/dist/design-system/Icon/__generated/icons/VariableIcon.v2.d.ts.map +0 -1
  287. package/dist/design-system/Icon/__generated/icons/WorkspacesIcon.v2.d.ts +0 -4
  288. package/dist/design-system/Icon/__generated/icons/WorkspacesIcon.v2.d.ts.map +0 -1
  289. package/dist/design-system/Input/Input.test.d.ts +0 -2
  290. package/dist/design-system/Input/Input.test.d.ts.map +0 -1
  291. package/dist/design-system/LegacyNotification/LegacyNotification.test.d.ts +0 -2
  292. package/dist/design-system/LegacyNotification/LegacyNotification.test.d.ts.map +0 -1
  293. package/dist/design-system/Modal/Modal.test.d.ts +0 -2
  294. package/dist/design-system/Modal/Modal.test.d.ts.map +0 -1
  295. package/dist/design-system/Notification/Notification.test.d.ts +0 -2
  296. package/dist/design-system/Notification/Notification.test.d.ts.map +0 -1
  297. package/dist/design-system/NotificationV2/NotificationV2.d.ts +0 -24
  298. package/dist/design-system/NotificationV2/NotificationV2.d.ts.map +0 -1
  299. package/dist/design-system/NotificationV2/index.d.ts +0 -2
  300. package/dist/design-system/NotificationV2/index.d.ts.map +0 -1
  301. package/dist/design-system/Popover/Popover.test.d.ts +0 -2
  302. package/dist/design-system/Popover/Popover.test.d.ts.map +0 -1
  303. package/dist/design-system/PopoverV2/PopoverV2.d.ts +0 -11
  304. package/dist/design-system/PopoverV2/PopoverV2.d.ts.map +0 -1
  305. package/dist/design-system/PopoverV2/PopoverV2.test.d.ts +0 -2
  306. package/dist/design-system/PopoverV2/PopoverV2.test.d.ts.map +0 -1
  307. package/dist/design-system/PopoverV2/index.d.ts +0 -2
  308. package/dist/design-system/PopoverV2/index.d.ts.map +0 -1
  309. package/dist/design-system/Sidebar/Sidebar.test.d.ts +0 -2
  310. package/dist/design-system/Sidebar/Sidebar.test.d.ts.map +0 -1
  311. package/dist/design-system/Skeleton/Skeleton.d.ts +0 -15
  312. package/dist/design-system/Skeleton/Skeleton.d.ts.map +0 -1
  313. package/dist/design-system/Table/Table.d.ts +0 -17
  314. package/dist/design-system/Table/Table.d.ts.map +0 -1
  315. package/dist/design-system/Table/index.d.ts +0 -2
  316. package/dist/design-system/Table/index.d.ts.map +0 -1
  317. package/dist/design-system/TableUI/TableSkeleton.d.ts.map +0 -1
  318. package/dist/design-system/TableUI/TableUI.test.d.ts +0 -2
  319. package/dist/design-system/TableUI/TableUI.test.d.ts.map +0 -1
  320. package/dist/design-system/utils/accessibility.test.d.ts +0 -2
  321. package/dist/design-system/utils/accessibility.test.d.ts.map +0 -1
  322. package/dist/design-system/utils/safex.test.d.ts +0 -2
  323. package/dist/design-system/utils/safex.test.d.ts.map +0 -1
  324. package/dist/development/Filter/Filter.d.ts +0 -10
  325. package/dist/development/Filter/Filter.d.ts.map +0 -1
  326. package/dist/development/Filter/Filter.test.d.ts +0 -2
  327. package/dist/development/Filter/Filter.test.d.ts.map +0 -1
  328. package/dist/development/Filter/FilterButtonContainer.d.ts +0 -2
  329. package/dist/development/Filter/FilterButtonContainer.d.ts.map +0 -1
  330. package/dist/development/Filter/FilterContent.d.ts +0 -14
  331. package/dist/development/Filter/FilterContent.d.ts.map +0 -1
  332. package/dist/development/Filter/FilterCountBadge.d.ts +0 -2
  333. package/dist/development/Filter/FilterCountBadge.d.ts.map +0 -1
  334. package/dist/development/Filter/FilterLoadingSpinner.d.ts +0 -2
  335. package/dist/development/Filter/FilterLoadingSpinner.d.ts.map +0 -1
  336. package/dist/development/Filter/FilterOptionControlledList.d.ts +0 -9
  337. package/dist/development/Filter/FilterOptionControlledList.d.ts.map +0 -1
  338. package/dist/development/Filter/FilterOptionList.d.ts +0 -10
  339. package/dist/development/Filter/FilterOptionList.d.ts.map +0 -1
  340. package/dist/development/Filter/FilterOptionListCheckboxItem.d.ts +0 -11
  341. package/dist/development/Filter/FilterOptionListCheckboxItem.d.ts.map +0 -1
  342. package/dist/development/Filter/FilterOptionListSearch.d.ts +0 -7
  343. package/dist/development/Filter/FilterOptionListSearch.d.ts.map +0 -1
  344. package/dist/development/Filter/FilterOptionListSelectItem.d.ts +0 -10
  345. package/dist/development/Filter/FilterOptionListSelectItem.d.ts.map +0 -1
  346. package/dist/development/Filter/FilterSectionHeader.d.ts +0 -2
  347. package/dist/development/Filter/FilterSectionHeader.d.ts.map +0 -1
  348. package/dist/development/Filter/FilterSeparator.d.ts +0 -2
  349. package/dist/development/Filter/FilterSeparator.d.ts.map +0 -1
  350. package/dist/development/Filter/FilterTrigger.d.ts +0 -15
  351. package/dist/development/Filter/FilterTrigger.d.ts.map +0 -1
  352. package/dist/development/Filter/hooks/useFilterContext.d.ts +0 -2
  353. package/dist/development/Filter/hooks/useFilterContext.d.ts.map +0 -1
  354. package/dist/development/Filter/hooks/useFilterOptionListContext.d.ts +0 -2
  355. package/dist/development/Filter/hooks/useFilterOptionListContext.d.ts.map +0 -1
  356. package/dist/development/Filter/index.d.ts +0 -14
  357. package/dist/development/Filter/index.d.ts.map +0 -1
  358. package/dist/development/Filter/providers/FilterContext.d.ts +0 -15
  359. package/dist/development/Filter/providers/FilterContext.d.ts.map +0 -1
  360. package/dist/development/Filter/providers/FilterOptionListContext.d.ts +0 -10
  361. package/dist/development/Filter/providers/FilterOptionListContext.d.ts.map +0 -1
  362. package/dist/development/Filter/shared.d.ts +0 -3
  363. package/dist/development/Filter/shared.d.ts.map +0 -1
  364. package/dist/development/ListPagePattern/index.d.ts +0 -1
  365. package/dist/development/ListPagePattern/index.d.ts.map +0 -1
  366. package/dist/development/SelectV2/Select.d.ts.map +0 -1
  367. package/dist/development/SelectV2/SelectContent.d.ts.map +0 -1
  368. package/dist/development/SelectV2/SelectOption.d.ts.map +0 -1
  369. package/dist/development/SelectV2/SelectOptionGroup.d.ts.map +0 -1
  370. package/dist/development/SelectV2/SelectTrigger.d.ts.map +0 -1
  371. package/dist/development/SelectV2/hooks/useSelectContext.d.ts.map +0 -1
  372. package/dist/development/SelectV2/index.d.ts.map +0 -1
  373. package/dist/development/SelectV2/providers/SelectContext.d.ts.map +0 -1
  374. package/dist/development/TableUI/TableUI.test.d.ts +0 -2
  375. package/dist/development/TableUI/TableUI.test.d.ts.map +0 -1
  376. package/dist/development/TableUI/index.d.ts +0 -75
  377. package/dist/development/TableUI/index.d.ts.map +0 -1
  378. package/dist/index-mfe-dark.css +0 -17525
  379. package/dist/index-mfe.css +0 -17184
  380. package/dist/rollup-less-tilde-importer.d.ts +0 -3
  381. package/dist/rollup-less-tilde-importer.d.ts.map +0 -1
  382. package/dist/test-utils/enzyme/selectEvent.test.d.ts +0 -2
  383. package/dist/test-utils/enzyme/selectEvent.test.d.ts.map +0 -1
  384. package/dist/test-utils/enzyme/table.test.d.ts +0 -2
  385. package/dist/test-utils/enzyme/table.test.d.ts.map +0 -1
  386. package/dist/test-utils/rtl/selectEvent.test.d.ts +0 -2
  387. package/dist/test-utils/rtl/selectEvent.test.d.ts.map +0 -1
  388. package/dist/test-utils/rtl/table.test.d.ts +0 -2
  389. package/dist/test-utils/rtl/table.test.d.ts.map +0 -1
  390. package/dist/tsconfig.build.tsbuildinfo +0 -1
  391. package/dist/useDesignSystemTheme-1e16bcf5.js +0 -441
  392. package/dist/useDesignSystemTheme-1e16bcf5.js.map +0 -1
  393. package/dist/useDesignSystemTheme-3d2c1acb.js +0 -440
  394. package/dist/useDesignSystemTheme-3d2c1acb.js.map +0 -1
  395. package/dist/useDesignSystemTheme-6e6f5867.js +0 -441
  396. package/dist/useDesignSystemTheme-6e6f5867.js.map +0 -1
  397. package/dist/useDesignSystemTheme-ac536b0f.js +0 -443
  398. package/dist/useDesignSystemTheme-ac536b0f.js.map +0 -1
  399. package/dist/useDesignSystemTheme-c859571c.js +0 -468
  400. package/dist/useDesignSystemTheme-c859571c.js.map +0 -1
  401. package/dist/useDesignSystemTheme-c867a35d.js +0 -470
  402. package/dist/useDesignSystemTheme-c867a35d.js.map +0 -1
  403. package/dist/useDesignSystemTheme-ef39204e.js +0 -468
  404. package/dist/useDesignSystemTheme-ef39204e.js.map +0 -1
  405. /package/dist/{development → design-system}/SelectV2/SelectOptionGroup.d.ts +0 -0
  406. /package/dist/{development → design-system}/SelectV2/hooks/useSelectContext.d.ts +0 -0
  407. /package/dist/{development → design-system}/SelectV2/index.d.ts +0 -0
  408. /package/dist/{development → design-system}/SelectV2/providers/SelectContext.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ /// <reference types="less" />
2
+ export declare const lessCustomFileManager: Less.Plugin;
3
+ //# sourceMappingURL=less.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"less.d.ts","sourceRoot":"","sources":["../../src/rollup/less.ts"],"names":[],"mappings":";AA4CA,eAAO,MAAM,qBAAqB,EAAE,IAAI,CAAC,MAIxC,CAAC"}
package/dist/styles.js CHANGED
@@ -1 +1,2 @@
1
1
 
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,7 +1,8 @@
1
- import { s as selectClasses, c as createMarkdownTable } from '../common-1fb3eeb9.js';
1
+ import { s as selectClasses, c as createMarkdownTable } from '../common-31040b66.js';
2
2
  import { act } from 'react-dom/test-utils';
3
3
 
4
4
  // eslint-disable-next-line @databricks/no-restricted-imports-regexp
5
+
5
6
  /**
6
7
  * Finds a single element that contains the specified text in the wrapper. If
7
8
  * there are 0 or more than 1 element that contains the specified text, an error
@@ -161,6 +162,7 @@ function findAllByRole(wrapper, role) {
161
162
 
162
163
  // eslint-disable-next-line @databricks/no-restricted-imports-regexp
163
164
 
165
+
164
166
  /**
165
167
  * Clicks on the "Clear" button. In order for this function to work properly,
166
168
  * the `allowClear` prop must be set to `true`.
@@ -257,15 +259,16 @@ var selectEvent = /*#__PURE__*/Object.freeze({
257
259
  __proto__: null,
258
260
  clearAll: clearAll,
259
261
  closeMenu: closeMenu,
262
+ getAllOptions: getAllOptions,
260
263
  getLabelText: getLabelText,
261
264
  multiSelect: multiSelect,
262
- singleSelect: singleSelect,
263
265
  openMenu: openMenu,
264
- getAllOptions: getAllOptions
266
+ singleSelect: singleSelect
265
267
  });
266
268
 
267
269
  // eslint-disable-next-line @databricks/no-restricted-imports-regexp
268
270
 
271
+
269
272
  /**
270
273
  * Returns the table row that contains the specified `cellText`. The `cellText`
271
274
  * must be in the column with name `columnHeaderName` if it is specified. Otherwise,
@@ -1 +1 @@
1
- {"version":3,"file":"enzyme.js","sources":["../../src/test-utils/enzyme/utils.ts","../../src/test-utils/enzyme/selectEvent.ts","../../src/test-utils/enzyme/table.ts","../../src/test-utils/enzyme/index.ts"],"sourcesContent":["// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\nimport { act } from 'react-dom/test-utils';\n\ninterface QueryOptions {\n /** Whether to trim the whitespace from DOM text using `String.prototype.trim` */\n trim?: boolean;\n}\n\n/**\n * Finds a single element that contains the specified text in the wrapper. If\n * there are 0 or more than 1 element that contains the specified text, an error\n * is thrown. Returns the element in an enzyme wrapper.\n */\nexport function findByText<P, S, C>(\n wrapper: ReactWrapper<P, S, C>,\n text: string | RegExp,\n queryOptions?: QueryOptions\n) {\n const newWrappers = findAllByText<P, S, C>(wrapper, text, queryOptions);\n if (newWrappers.length !== 1) {\n throw new Error(\n `Expected to find 1 node but found ${newWrappers.length} nodes for text \"${text}\".\\n${wrapper.debug()}`\n );\n }\n return newWrappers[0];\n}\n\n/**\n * Finds all elements that contain the specified text. To avoid duplicate results,\n * only the parents of text nodes are returned.\n */\nexport function findAllByText<P, S, C>(\n wrapper: ReactWrapper<P, S, C>,\n text: string | RegExp,\n { trim = false }: QueryOptions = {}\n) {\n const textNodes = wrapper.findWhere((n) => {\n if (typeof n.type() !== 'string' || n.getDOMNode().children.length !== 0) {\n return false;\n }\n\n let nodeText = n.text();\n if (trim) {\n nodeText = nodeText.trim();\n }\n\n return typeof text === 'string' ? nodeText === text : text.test(nodeText);\n });\n const newWrappers = textNodes.map((n) => {\n if (n.name() === 'FormattedMessage') {\n // Try not to return FormattedMessage since it breaks `simulate` due to a bug in `enzyme-adapter-react-17`\n // Similar to https://github.com/wojtekmaj/enzyme-adapter-react-17/issues/45\n const formattedMessageParents = n.parents();\n return formattedMessageParents.length > 0 ? formattedMessageParents.first() : n;\n } else {\n return n;\n }\n });\n return newWrappers;\n}\n\n// We need to keep ref to original setTimeout to avoid SinonJS fake timers if enabled\nconst originalSetTimeout = window.setTimeout;\n\n/**\n * This is so the stack trace the developer sees is one that's\n * closer to their code (because async stack traces are hard to follow).\n *\n * The code is taken from\n * https://github.com/testing-library/dom-testing-library/blob/f7b5c33c44632fba\n * 1579cb44f9f175be1ec46087/src/wait-for.js#L15-L19\n */\nfunction copyStackTrace(target: Error, source: Error) {\n // eslint-disable-next-line no-param-reassign\n target.stack = source.stack!.replace(source.message, target.message);\n}\n\ninterface WaitForOptions {\n interval?: number;\n stackTraceError?: Error;\n timeout?: number;\n}\n\n/**\n * Run an expectation until it succeeds or reaches the timeout. The timeout of 1500ms\n * is chosen to be under the default Karma test timeout of 2000ms. This function will\n * not work properly if fake timers are being used (since it expects the real setTimeout).\n *\n * The code is taken from\n * https://github.com/TheBrainFamily/wait-for-expect/blob/master/src/index.ts,\n * with slight modifications to support Karma (instead of Jest).\n *\n *\n * Example\n * The <App /> component does not render the header synchronously.\n * Therefore, we cannot check that the wrapper's text is equal to the string\n * immediately--this assertion will fail and cause the test to fail. To\n * remediate this issue, we can run the expectation until it succeeds:\n *\n * function App() {\n * const [value, setValue] = useState(null);\n * useEffect(() => {\n * const timeoutId = setTimeout(() => setValue(\"some value\"), 100);\n * return () => clearTimeout(timeoutId);\n * }, []);\n * return value === null ? null : <h1>The value is: {value}</h1>;\n * }\n *\n * it('renders value', async () => {\n * const wrapper = mount(<App />);\n * await waitFor(() =>\n * wrapper.update();\n * expect(wrapper.text()).to.equal(\"The value is: some value\")\n * );\n * });\n */\nfunction _waitFor<T>(\n f: () => T | Promise<T>,\n { interval = 50, stackTraceError, timeout = 1500 }: WaitForOptions = {}\n): Promise<T> {\n const maxTries = Math.ceil(timeout / interval);\n let tries = 0;\n return new Promise((resolve, reject) => {\n const rejectOrRerun = (error: Error) => {\n if (tries > maxTries) {\n if (stackTraceError !== undefined) {\n copyStackTrace(error, stackTraceError);\n }\n reject(error);\n return;\n }\n originalSetTimeout(runExpectation, interval);\n };\n\n function runExpectation() {\n tries += 1;\n try {\n Promise.resolve(f()).then(resolve).catch(rejectOrRerun);\n } catch (error) {\n // @ts-expect-error ts-migrate(2571) Object is of type 'unknown'\n rejectOrRerun(error);\n }\n }\n\n originalSetTimeout(runExpectation, 0);\n });\n}\n\n/**\n * Wraps `_waitFor` in React's `act` testing utility. Used when the React component\n * updates during the execution of the callback (either because of indirect effects\n * being run or because of direct requests to update the component, like wrapper.update).\n * Prevents updates related to the callback from being affected by other updates\n * and more closely mimics how React runs in the browser. See\n * https://reactjs.org/docs/test-utils.html#act for more info on `act`.\n */\nexport async function waitFor<T>(callback: () => T | Promise<T>, options?: WaitForOptions): Promise<T> {\n let result: T | Promise<T>;\n // See https://github.com/testing-library/dom-testing-library/blob/f7b5c33c44\n // 632fba1579cb44f9f175be1ec46087/src/wait-for.js#L182-L184\n const stackTraceError = new Error('STACK_TRACE_ERROR');\n\n await act(async () => {\n result = await _waitFor(callback, { stackTraceError, ...options });\n });\n\n // @ts-expect-error: either `waitFor` will throw or `result` will be assigned\n return result;\n}\n\n/**\n * Finds all elements (that are rendered in the DOM) in `wrapper` that have an explicit\n * role of `role` specified. This is similar to `getAllByRole` from @testing-library/react\n * but is much simpler because of the shortcomings of Enzyme's API.\n */\nexport function findAllByRole(wrapper: ReactWrapper, role: string): ReactWrapper[] {\n return wrapper\n .find(`[role=\"${role}\"]`)\n .hostNodes()\n .map((n) => n);\n}\n","// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\n\nimport { selectClasses } from '../common';\nimport { findByText, waitFor } from './utils';\n\n/**\n * Clicks on the \"Clear\" button. In order for this function to work properly,\n * the `allowClear` prop must be set to `true`.\n */\nexport function clearAll(getSelect: () => ReactWrapper): void {\n getSelect().find(`.${selectClasses.clear}`).hostNodes().simulate('mousedown');\n}\n\n/**\n * Closes the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already closed or if the menu is unable to be closed.\n */\nexport async function closeMenu(getSelect: () => ReactWrapper): Promise<void> {\n if (!getSelect().find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select is already closed\\n${getSelect().debug()}`);\n }\n getSelect().find(`.${selectClasses.selector}`).simulate('mousedown');\n await waitFor(() => {\n const select = getSelect();\n if (select.find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select did not close\\n${select.debug()}`);\n }\n });\n}\n\n/**\n * Returns a string concatenating the labels for all selected options.\n */\nexport function getLabelText(getSelect: () => ReactWrapper): string {\n // Trim the text to avoid weird whitespace issues non-label elements being added.\n // For example, the input mirror is an empty span with some whitespace that is\n // nested under the selector but does not show up in the label text.\n return getSelect().find(`.${selectClasses.selector}`).text().trim();\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component with `mode=\"multiple\"`.\n * The provided strings must match the option labels exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function multiSelect(getSelect: () => ReactWrapper, options: string[]): Promise<void> {\n await openMenu(getSelect);\n options.forEach((option) => {\n findByText(getSelect().find(`.${selectClasses.list}`), option).simulate('click');\n });\n // Close the menu to indicate that selection has finished\n await closeMenu(getSelect);\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component without a\n * mode. The provided string must match an option label exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function singleSelect(getSelect: () => ReactWrapper, option: string): Promise<void> {\n await openMenu(getSelect);\n findByText(getSelect().find(`.${selectClasses.list}`), option).simulate('click');\n // Menu automatically closes for a single <Select/> (no mode=\"multiple\")\n}\n\n/**\n * Opens the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already opened or if the menu is unable to be opened.\n */\nexport async function openMenu(getSelect: () => ReactWrapper): Promise<void> {\n if (getSelect().find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select is already open\\n${getSelect().debug()}`);\n }\n getSelect().find(`.${selectClasses.selector}`).simulate('mousedown');\n await waitFor(() => {\n const select = getSelect();\n if (!select.find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select did not open\\n${select.debug()}`);\n }\n });\n}\n\n/**\n * Opens the dropdown menu, finds all of the options in the dropdown, closes\n * the menu, and returns a list of the text of each option in order.\n */\nexport async function getAllOptions(getSelect: () => ReactWrapper): Promise<string[]> {\n await openMenu(getSelect);\n const options = getSelect()\n .find(`.${selectClasses.list}`)\n .find(`.${selectClasses.option}`)\n .map((option) => option.text());\n await closeMenu(getSelect);\n return options;\n}\n","// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\n\nimport type { GetTableRowByCellTextOptions, TableRows } from '../common';\nimport { createMarkdownTable } from '../common';\nimport { findAllByRole, findByText } from './utils';\n\n/**\n * Returns the table row that contains the specified `cellText`. The `cellText`\n * must be in the column with name `columnHeaderName` if it is specified. Otherwise,\n * the `cellText` must be in the first column. Throws an error if either multiple\n * rows or no rows can be found that match the given options. Also throws an error\n * if the column with name `columnHeaderName` cannot be found.\n *\n * @param tableWrapper The ReactWrapper containing the table to query in.\n * @param cellText The cell text that uniquely identifies the row.\n * @param columnHeaderName The name of the column to search the text for. If not provided,\n * the first column will be used.\n */\nexport function getTableRowByCellText(\n tableWrapper: ReactWrapper,\n cellText: string,\n { columnHeaderName }: GetTableRowByCellTextOptions = {}\n): ReactWrapper {\n let columnHeaderIndex: number;\n if (columnHeaderName === undefined) {\n columnHeaderIndex = 0;\n } else {\n const columnHeaders = findAllByRole(tableWrapper, 'columnheader');\n columnHeaderIndex = columnHeaders.findIndex((n) => {\n try {\n findByText(n, columnHeaderName);\n return true;\n } catch {\n return false;\n }\n });\n if (columnHeaderIndex === -1) {\n throw new Error(`Unable to find a column with name \"${columnHeaderName}\"\\n${tableWrapper.debug()}`);\n }\n }\n\n const matchingRows = findAllByRole(tableWrapper, 'row')\n // Skip first row (table header)\n .slice(1)\n .filter((row) => {\n const cells = findAllByRole(row, 'cell');\n const cell = cells[columnHeaderIndex];\n try {\n findByText(cell, cellText);\n return true;\n } catch {\n return false;\n }\n });\n\n if (matchingRows.length === 0) {\n throw new Error(\n `Unable to find a table row with text \"${cellText}\" in the column \"${columnHeaderName}\"\\n${tableWrapper.debug()}`\n );\n }\n\n if (matchingRows.length > 1) {\n throw new Error(\n `Found multiple table rows with text \"${cellText}\" in the column \"${columnHeaderName}\"\\n${tableWrapper.debug()}`\n );\n }\n\n return matchingRows[0].hostNodes();\n}\n\n/**\n * Converts a Du Bois table to a markdown table string. This means that each cell\n * is separated by a pipe (including the edges), the header row is on its own line\n * at the top, each data row is on its own line below, and the header row is separated\n * by a row of dashes from the data rows. This is useful for checking table contents\n * in tests.\n *\n * @param tableWrapper The ReactWrapper containing the table to query in.\n *\n * @example\n * The HTML table:\n * ```jsx\n * <Table>\n * <TableRow isHeader>\n * <TableHeader>Name</TableHeader>\n * <TableHeader>Fruit</TableHeader>\n * </TableRow>\n * <TableRow>\n * <TableCell>Alice</TableCell>\n * <TableCell>Apple</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Brady</TableCell>\n * <TableCell>Banana</TableCell>\n * </TableRow>\n * </Table>\n * ```\n *\n * The Markdown table:\n * ```md\n * | Name | Fruit |\n * | --- | --- |\n * | Alice | Apple |\n * | Brady | Banana |\n * ```\n */\nexport function toMarkdownTable(tableWrapper: ReactWrapper): string {\n const { bodyRows, headerRow } = getTableRows(tableWrapper);\n const columns = findAllByRole(headerRow, 'columnheader').map((column) => column.text());\n const rows = bodyRows.map((row) => findAllByRole(row, 'cell').map((cell) => cell.text()));\n return createMarkdownTable(columns, rows);\n}\n\n/**\n * Returns the header row and all body rows (non-header rows) in order. Assumes that the\n * `tableWrapper` has a single header row (as the first row) and the rest of the rows are\n * body rows.\n *\n * @param tableWrapper The ReactWrapper containing the table to query in.\n */\nexport function getTableRows(tableWrapper: ReactWrapper): TableRows<ReactWrapper> {\n const [firstRow, ...restRows] = findAllByRole(tableWrapper, 'row');\n return {\n bodyRows: restRows,\n headerRow: firstRow,\n };\n}\n","// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\n\nexport * as selectEvent from './selectEvent';\n\nexport * from './table';\n\n/**\n * Open a dropdown menu by simulating a pointerDown event on the dropdown button.\n *\n * @param dropdownButton - The Dropdown Trigger button that opens the menu when clicked.\n */\nexport const openDropdownMenu = (dropdownButton: ReactWrapper) => {\n dropdownButton.hostNodes().simulate('pointerDown', { button: 0, ctrlKey: false });\n};\n"],"names":["findByText","wrapper","text","queryOptions","newWrappers","findAllByText","length","Error","debug","trim","arguments","undefined","textNodes","findWhere","n","type","getDOMNode","children","nodeText","test","map","name","formattedMessageParents","parents","first","originalSetTimeout","window","setTimeout","copyStackTrace","target","source","stack","replace","message","_waitFor","f","interval","stackTraceError","timeout","maxTries","Math","ceil","tries","Promise","resolve","reject","rejectOrRerun","error","runExpectation","then","catch","waitFor","callback","options","result","act","findAllByRole","role","find","hostNodes","clearAll","getSelect","selectClasses","clear","simulate","closeMenu","open","exists","selector","select","getLabelText","multiSelect","openMenu","forEach","option","list","singleSelect","getAllOptions","getTableRowByCellText","tableWrapper","cellText","columnHeaderName","columnHeaderIndex","columnHeaders","findIndex","matchingRows","slice","filter","row","cells","cell","toMarkdownTable","bodyRows","headerRow","getTableRows","columns","column","rows","createMarkdownTable","firstRow","restRows","openDropdownMenu","dropdownButton","button","ctrlKey"],"mappings":";;;AAAA;AASA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAUA,CACxBC,OAA8B,EAC9BC,IAAqB,EACrBC,YAA2B,EAC3B;EACA,MAAMC,WAAW,GAAGC,aAAa,CAAUJ,OAAO,EAAEC,IAAI,EAAEC,YAA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ACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASgC,eAAeA,CAACZ,YAA0B,EAAU;EAClE,MAAM;IAAEa,QAAQ;IAAEC;GAAW,GAAGC,YAAY,CAACf,YAAY,CAAC;EAC1D,MAAMgB,OAAO,GAAGvC,aAAa,CAACqC,SAAS,EAAE,cAAc,CAAC,CAACzE,GAAG,CAAE4E,MAAM,IAAKA,MAAM,CAAC9F,IAAI,EAAE,CAAC;EACvF,MAAM+F,IAAI,GAAGL,QAAQ,CAACxE,GAAG,CAAEoE,GAAG,IAAKhC,aAAa,CAACgC,GAAG,EAAE,MAAM,CAAC,CAACpE,GAAG,CAAEsE,IAAI,IAAKA,IAAI,CAACxF,IAAI,EAAE,CAAC,CAAC;EACzF,OAAOgG,mBAAmB,CAACH,OAAO,EAAEE,IAAI,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASH,YAAYA,CAACf,YAA0B,EAA2B;EAChF,MAAM,CAACoB,QAAQ,EAAE,GAAGC,QAAQ,CAAC,GAAG5C,aAAa,CAACuB,YAAY,EAAE,KAAK,CAAC;EAClE,OAAO;IACLa,QAAQ,EAAEQ,QAAQ;IAClBP,SAAS,EAAEM;GACZ;AACH;;AC/HA;;AAOA;AACA;AACA;AACA;AACA;MACaE,gBAAgB,GAAIC,cAA4B,IAAK;EAChEA,cAAc,CAAC3C,SAAS,EAAE,CAACK,QAAQ,CAAC,aAAa,EAAE;IAAEuC,MAAM,EAAE,CAAC;IAAEC,OAAO,EAAE;GAAO,CAAC;AACnF;;;;"}
1
+ {"version":3,"file":"enzyme.js","sources":["../../src/test-utils/enzyme/utils.ts","../../src/test-utils/enzyme/selectEvent.ts","../../src/test-utils/enzyme/table.ts","../../src/test-utils/enzyme/index.ts"],"sourcesContent":["// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\nimport { act } from 'react-dom/test-utils';\n\ninterface QueryOptions {\n /** Whether to trim the whitespace from DOM text using `String.prototype.trim` */\n trim?: boolean;\n}\n\n/**\n * Finds a single element that contains the specified text in the wrapper. If\n * there are 0 or more than 1 element that contains the specified text, an error\n * is thrown. Returns the element in an enzyme wrapper.\n */\nexport function findByText<P, S, C>(\n wrapper: ReactWrapper<P, S, C>,\n text: string | RegExp,\n queryOptions?: QueryOptions,\n) {\n const newWrappers = findAllByText<P, S, C>(wrapper, text, queryOptions);\n if (newWrappers.length !== 1) {\n throw new Error(\n `Expected to find 1 node but found ${newWrappers.length} nodes for text \"${text}\".\\n${wrapper.debug()}`,\n );\n }\n return newWrappers[0];\n}\n\n/**\n * Finds all elements that contain the specified text. To avoid duplicate results,\n * only the parents of text nodes are returned.\n */\nexport function findAllByText<P, S, C>(\n wrapper: ReactWrapper<P, S, C>,\n text: string | RegExp,\n { trim = false }: QueryOptions = {},\n) {\n const textNodes = wrapper.findWhere((n) => {\n if (typeof n.type() !== 'string' || n.getDOMNode().children.length !== 0) {\n return false;\n }\n\n let nodeText = n.text();\n if (trim) {\n nodeText = nodeText.trim();\n }\n\n return typeof text === 'string' ? nodeText === text : text.test(nodeText);\n });\n const newWrappers = textNodes.map((n) => {\n if (n.name() === 'FormattedMessage') {\n // Try not to return FormattedMessage since it breaks `simulate` due to a bug in `enzyme-adapter-react-17`\n // Similar to https://github.com/wojtekmaj/enzyme-adapter-react-17/issues/45\n const formattedMessageParents = n.parents();\n return formattedMessageParents.length > 0 ? formattedMessageParents.first() : n;\n } else {\n return n;\n }\n });\n return newWrappers;\n}\n\n// We need to keep ref to original setTimeout to avoid SinonJS fake timers if enabled\nconst originalSetTimeout = window.setTimeout;\n\n/**\n * This is so the stack trace the developer sees is one that's\n * closer to their code (because async stack traces are hard to follow).\n *\n * The code is taken from\n * https://github.com/testing-library/dom-testing-library/blob/f7b5c33c44632fba\n * 1579cb44f9f175be1ec46087/src/wait-for.js#L15-L19\n */\nfunction copyStackTrace(target: Error, source: Error) {\n // eslint-disable-next-line no-param-reassign\n target.stack = source.stack!.replace(source.message, target.message);\n}\n\ninterface WaitForOptions {\n interval?: number;\n stackTraceError?: Error;\n timeout?: number;\n}\n\n/**\n * Run an expectation until it succeeds or reaches the timeout. The timeout of 1500ms\n * is chosen to be under the default Karma test timeout of 2000ms. This function will\n * not work properly if fake timers are being used (since it expects the real setTimeout).\n *\n * The code is taken from\n * https://github.com/TheBrainFamily/wait-for-expect/blob/master/src/index.ts,\n * with slight modifications to support Karma (instead of Jest).\n *\n *\n * Example\n * The <App /> component does not render the header synchronously.\n * Therefore, we cannot check that the wrapper's text is equal to the string\n * immediately--this assertion will fail and cause the test to fail. To\n * remediate this issue, we can run the expectation until it succeeds:\n *\n * function App() {\n * const [value, setValue] = useState(null);\n * useEffect(() => {\n * const timeoutId = setTimeout(() => setValue(\"some value\"), 100);\n * return () => clearTimeout(timeoutId);\n * }, []);\n * return value === null ? null : <h1>The value is: {value}</h1>;\n * }\n *\n * it('renders value', async () => {\n * const wrapper = mount(<App />);\n * await waitFor(() =>\n * wrapper.update();\n * expect(wrapper.text()).to.equal(\"The value is: some value\")\n * );\n * });\n */\nfunction _waitFor<T>(\n f: () => T | Promise<T>,\n { interval = 50, stackTraceError, timeout = 1500 }: WaitForOptions = {},\n): Promise<T> {\n const maxTries = Math.ceil(timeout / interval);\n let tries = 0;\n return new Promise((resolve, reject) => {\n const rejectOrRerun = (error: Error) => {\n if (tries > maxTries) {\n if (stackTraceError !== undefined) {\n copyStackTrace(error, stackTraceError);\n }\n reject(error);\n return;\n }\n originalSetTimeout(runExpectation, interval);\n };\n\n function runExpectation() {\n tries += 1;\n try {\n Promise.resolve(f()).then(resolve).catch(rejectOrRerun);\n } catch (error) {\n // @ts-expect-error ts-migrate(2571) Object is of type 'unknown'\n rejectOrRerun(error);\n }\n }\n\n originalSetTimeout(runExpectation, 0);\n });\n}\n\n/**\n * Wraps `_waitFor` in React's `act` testing utility. Used when the React component\n * updates during the execution of the callback (either because of indirect effects\n * being run or because of direct requests to update the component, like wrapper.update).\n * Prevents updates related to the callback from being affected by other updates\n * and more closely mimics how React runs in the browser. See\n * https://reactjs.org/docs/test-utils.html#act for more info on `act`.\n */\nexport async function waitFor<T>(callback: () => T | Promise<T>, options?: WaitForOptions): Promise<T> {\n let result: T | Promise<T>;\n // See https://github.com/testing-library/dom-testing-library/blob/f7b5c33c44\n // 632fba1579cb44f9f175be1ec46087/src/wait-for.js#L182-L184\n const stackTraceError = new Error('STACK_TRACE_ERROR');\n\n await act(async () => {\n result = await _waitFor(callback, { stackTraceError, ...options });\n });\n\n // @ts-expect-error: either `waitFor` will throw or `result` will be assigned\n return result;\n}\n\n/**\n * Finds all elements (that are rendered in the DOM) in `wrapper` that have an explicit\n * role of `role` specified. This is similar to `getAllByRole` from @testing-library/react\n * but is much simpler because of the shortcomings of Enzyme's API.\n */\nexport function findAllByRole(wrapper: ReactWrapper, role: string): ReactWrapper[] {\n return wrapper\n .find(`[role=\"${role}\"]`)\n .hostNodes()\n .map((n) => n);\n}\n","// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\n\nimport { selectClasses } from '../common';\nimport { findByText, waitFor } from './utils';\n\n/**\n * Clicks on the \"Clear\" button. In order for this function to work properly,\n * the `allowClear` prop must be set to `true`.\n */\nexport function clearAll(getSelect: () => ReactWrapper): void {\n getSelect().find(`.${selectClasses.clear}`).hostNodes().simulate('mousedown');\n}\n\n/**\n * Closes the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already closed or if the menu is unable to be closed.\n */\nexport async function closeMenu(getSelect: () => ReactWrapper): Promise<void> {\n if (!getSelect().find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select is already closed\\n${getSelect().debug()}`);\n }\n getSelect().find(`.${selectClasses.selector}`).simulate('mousedown');\n await waitFor(() => {\n const select = getSelect();\n if (select.find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select did not close\\n${select.debug()}`);\n }\n });\n}\n\n/**\n * Returns a string concatenating the labels for all selected options.\n */\nexport function getLabelText(getSelect: () => ReactWrapper): string {\n // Trim the text to avoid weird whitespace issues non-label elements being added.\n // For example, the input mirror is an empty span with some whitespace that is\n // nested under the selector but does not show up in the label text.\n return getSelect().find(`.${selectClasses.selector}`).text().trim();\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component with `mode=\"multiple\"`.\n * The provided strings must match the option labels exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function multiSelect(getSelect: () => ReactWrapper, options: string[]): Promise<void> {\n await openMenu(getSelect);\n options.forEach((option) => {\n findByText(getSelect().find(`.${selectClasses.list}`), option).simulate('click');\n });\n // Close the menu to indicate that selection has finished\n await closeMenu(getSelect);\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component without a\n * mode. The provided string must match an option label exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function singleSelect(getSelect: () => ReactWrapper, option: string): Promise<void> {\n await openMenu(getSelect);\n findByText(getSelect().find(`.${selectClasses.list}`), option).simulate('click');\n // Menu automatically closes for a single <Select/> (no mode=\"multiple\")\n}\n\n/**\n * Opens the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already opened or if the menu is unable to be opened.\n */\nexport async function openMenu(getSelect: () => ReactWrapper): Promise<void> {\n if (getSelect().find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select is already open\\n${getSelect().debug()}`);\n }\n getSelect().find(`.${selectClasses.selector}`).simulate('mousedown');\n await waitFor(() => {\n const select = getSelect();\n if (!select.find(`.${selectClasses.open}`).exists()) {\n throw new Error(`Select did not open\\n${select.debug()}`);\n }\n });\n}\n\n/**\n * Opens the dropdown menu, finds all of the options in the dropdown, closes\n * the menu, and returns a list of the text of each option in order.\n */\nexport async function getAllOptions(getSelect: () => ReactWrapper): Promise<string[]> {\n await openMenu(getSelect);\n const options = getSelect()\n .find(`.${selectClasses.list}`)\n .find(`.${selectClasses.option}`)\n .map((option) => option.text());\n await closeMenu(getSelect);\n return options;\n}\n","// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\n\nimport type { GetTableRowByCellTextOptions, TableRows } from '../common';\nimport { createMarkdownTable } from '../common';\nimport { findAllByRole, findByText } from './utils';\n\n/**\n * Returns the table row that contains the specified `cellText`. The `cellText`\n * must be in the column with name `columnHeaderName` if it is specified. Otherwise,\n * the `cellText` must be in the first column. Throws an error if either multiple\n * rows or no rows can be found that match the given options. Also throws an error\n * if the column with name `columnHeaderName` cannot be found.\n *\n * @param tableWrapper The ReactWrapper containing the table to query in.\n * @param cellText The cell text that uniquely identifies the row.\n * @param columnHeaderName The name of the column to search the text for. If not provided,\n * the first column will be used.\n */\nexport function getTableRowByCellText(\n tableWrapper: ReactWrapper,\n cellText: string,\n { columnHeaderName }: GetTableRowByCellTextOptions = {},\n): ReactWrapper {\n let columnHeaderIndex: number;\n if (columnHeaderName === undefined) {\n columnHeaderIndex = 0;\n } else {\n const columnHeaders = findAllByRole(tableWrapper, 'columnheader');\n columnHeaderIndex = columnHeaders.findIndex((n) => {\n try {\n findByText(n, columnHeaderName);\n return true;\n } catch {\n return false;\n }\n });\n if (columnHeaderIndex === -1) {\n throw new Error(`Unable to find a column with name \"${columnHeaderName}\"\\n${tableWrapper.debug()}`);\n }\n }\n\n const matchingRows = findAllByRole(tableWrapper, 'row')\n // Skip first row (table header)\n .slice(1)\n .filter((row) => {\n const cells = findAllByRole(row, 'cell');\n const cell = cells[columnHeaderIndex];\n try {\n findByText(cell, cellText);\n return true;\n } catch {\n return false;\n }\n });\n\n if (matchingRows.length === 0) {\n throw new Error(\n `Unable to find a table row with text \"${cellText}\" in the column \"${columnHeaderName}\"\\n${tableWrapper.debug()}`,\n );\n }\n\n if (matchingRows.length > 1) {\n throw new Error(\n `Found multiple table rows with text \"${cellText}\" in the column \"${columnHeaderName}\"\\n${tableWrapper.debug()}`,\n );\n }\n\n return matchingRows[0].hostNodes();\n}\n\n/**\n * Converts a Du Bois table to a markdown table string. This means that each cell\n * is separated by a pipe (including the edges), the header row is on its own line\n * at the top, each data row is on its own line below, and the header row is separated\n * by a row of dashes from the data rows. This is useful for checking table contents\n * in tests.\n *\n * @param tableWrapper The ReactWrapper containing the table to query in.\n *\n * @example\n * The HTML table:\n * ```jsx\n * <Table>\n * <TableRow isHeader>\n * <TableHeader>Name</TableHeader>\n * <TableHeader>Fruit</TableHeader>\n * </TableRow>\n * <TableRow>\n * <TableCell>Alice</TableCell>\n * <TableCell>Apple</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Brady</TableCell>\n * <TableCell>Banana</TableCell>\n * </TableRow>\n * </Table>\n * ```\n *\n * The Markdown table:\n * ```md\n * | Name | Fruit |\n * | --- | --- |\n * | Alice | Apple |\n * | Brady | Banana |\n * ```\n */\nexport function toMarkdownTable(tableWrapper: ReactWrapper): string {\n const { bodyRows, headerRow } = getTableRows(tableWrapper);\n const columns = findAllByRole(headerRow, 'columnheader').map((column) => column.text());\n const rows = bodyRows.map((row) => findAllByRole(row, 'cell').map((cell) => cell.text()));\n return createMarkdownTable(columns, rows);\n}\n\n/**\n * Returns the header row and all body rows (non-header rows) in order. Assumes that the\n * `tableWrapper` has a single header row (as the first row) and the rest of the rows are\n * body rows.\n *\n * @param tableWrapper The ReactWrapper containing the table to query in.\n */\nexport function getTableRows(tableWrapper: ReactWrapper): TableRows<ReactWrapper> {\n const [firstRow, ...restRows] = findAllByRole(tableWrapper, 'row');\n return {\n bodyRows: restRows,\n headerRow: firstRow,\n };\n}\n","// eslint-disable-next-line @databricks/no-restricted-imports-regexp\nimport type { ReactWrapper } from 'enzyme';\n\nexport * as selectEvent from './selectEvent';\n\nexport * from './table';\n\n/**\n * Open a dropdown menu by simulating a pointerDown event on the dropdown button.\n *\n * @param dropdownButton - The Dropdown Trigger button that opens the menu when clicked.\n */\nexport const openDropdownMenu = (dropdownButton: ReactWrapper) => {\n dropdownButton.hostNodes().simulate('pointerDown', { button: 0, ctrlKey: false });\n};\n"],"names":["findByText","wrapper","text","queryOptions","newWrappers","findAllByText","length","Error","debug","trim","arguments","undefined","textNodes","findWhere","n","type","getDOMNode","children","nodeText","test","map","name","formattedMessageParents","parents","first","originalSetTimeout","window","setTimeout","copyStackTrace","target","source","stack","replace","message","_waitFor","f","interval","stackTraceError","timeout","maxTries","Math","ceil","tries","Promise","resolve","reject","rejectOrRerun","error","runExpectation","then","catch","waitFor","callback","options","result","act","findAllByRole","role","find","hostNodes","clearAll","getSelect","selectClasses","clear","simulate","closeMenu","open","exists","selector","select","getLabelText","multiSelect","openMenu","forEach","option","list","singleSelect","getAllOptions","getTableRowByCellText","tableWrapper","cellText","columnHeaderName","columnHeaderIndex","columnHeaders","findIndex","matchingRows","slice","filter","row","cells","cell","toMarkdownTable","bodyRows","headerRow","getTableRows","columns","column","rows","createMarkdownTable","firstRow","restRows","openDropdownMenu","dropdownButton","button","ctrlKey"],"mappings":";;;AAAA;;AASA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAUA,CACxBC,OAA8B,EAC9BC,IAAqB,EACrBC,YAA2B,EAC3B;EACA,MAAMC,WAAW,GAAGC,aAAa,CAAUJ,OAAO,EAAEC,IAAI,EAAEC,YAAY,CAAC,CAAA;AACvE,EAAA,IAAIC,WAAW,CAACE,MAAM,KAAK,CAAC,EAAE;AAC5B,IAAA,MAAM,IAAIC,KAAK,CACZ,CAAoCH,kCAAAA,EAAAA,WAAW,CAACE,MAAO,CAAA,iBAAA,EAAmBJ,IAAK,CAAA,IAAA,EAAMD,OAAO,CAACO,KAAK,EAAG,EACxG,CAAC,CAAA;AACH,GAAA;EACA,OAAOJ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YAAY,EAAE,KAAK,CAAC,CAAA;EAClE,OAAO;AACLa,IAAAA,QAAQ,EAAEQ,QAAQ;AAClBP,IAAAA,SAAS,EAAEM,QAAAA;GACZ,CAAA;AACH;;AC/HA;;AAOA;AACA;AACA;AACA;AACA;AACaE,MAAAA,gBAAgB,GAAIC,cAA4B,IAAK;EAChEA,cAAc,CAAC3C,SAAS,EAAE,CAACK,QAAQ,CAAC,aAAa,EAAE;AAAEuC,IAAAA,MAAM,EAAE,CAAC;AAAEC,IAAAA,OAAO,EAAE,KAAA;AAAM,GAAC,CAAC,CAAA;AACnF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"selectEvent.d.ts","sourceRoot":"","sources":["../../../src/test-utils/rtl/selectEvent.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjE;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAclE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CASxD;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASvF;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKrF;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAe1E"}
1
+ {"version":3,"file":"selectEvent.d.ts","sourceRoot":"","sources":["../../../src/test-utils/rtl/selectEvent.ts"],"names":[],"mappings":"AA6CA;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAejE;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAelE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAUxD;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWvF;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOrF;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAOjE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAa1E"}
@@ -1,12 +1,49 @@
1
1
  import userEvent from '@testing-library/user-event';
2
- import { waitFor, screen, within, queryHelpers } from '@testing-library/react';
3
- import { s as selectClasses, c as createMarkdownTable } from '../common-1fb3eeb9.js';
2
+ import { waitFor, within, queryHelpers } from '@testing-library/react';
3
+ import { s as selectClasses, c as createMarkdownTable } from '../common-31040b66.js';
4
+
5
+ /**
6
+ * Allows the helpers in this module to be used when the select element is
7
+ * queried _semantically_ (as if it were a native <select> element) — i.e.
8
+ * `ByRole('combobox', { name: '…' })`, rather than by test ID.
9
+ *
10
+ * Also checks if <DesignSystemProvider> was used, because many of the helpers
11
+ * in this module query by class name starting with "du-bois-", which requires
12
+ * the provider.
13
+ */
14
+ function getRootElement(element) {
15
+ if (element.getAttribute('role') === 'combobox') {
16
+ element = element.closest(`.${selectClasses.selector}`).parentElement;
17
+ }
18
+ if (element.classList.contains('ant-select')) {
19
+ throw new Error('Component must be wrapped by <DesignSystemProvider>');
20
+ }
21
+ return element;
22
+ }
23
+ function getOptionsList(select) {
24
+ const body = select.ownerDocument.body;
25
+ const input = within(select).getByRole('combobox');
26
+ const listId = input.getAttribute('aria-owns') || input.getAttribute('aria-controls');
27
+ if (!listId) {
28
+ throw new Error(`Options listid not found\n${body.innerHTML}`);
29
+ }
30
+ const listbox = select.ownerDocument.getElementById(listId);
31
+ if (!(listbox !== null && listbox !== void 0 && listbox.parentElement)) {
32
+ throw new Error(`Options list not found\n${body.innerHTML}`);
33
+ }
34
+ const optionsList = listbox.parentElement.querySelector(`.${selectClasses.list}`);
35
+ if (!optionsList) {
36
+ throw new Error(`Options list not found\n${body.innerHTML}`);
37
+ }
38
+ return optionsList;
39
+ }
4
40
 
5
41
  /**
6
42
  * Opens the dropdown menu for the <Select/> by clicking. Will throw an error if
7
43
  * the menu is already opened or if the menu is unable to be opened.
8
44
  */
9
45
  async function openMenu(select) {
46
+ select = getRootElement(select);
10
47
  if (select.classList.contains(selectClasses.open)) {
11
48
  throw new Error(`Select is already open\n${select.innerHTML}`);
12
49
  }
@@ -29,6 +66,7 @@ async function openMenu(select) {
29
66
  * the menu is already closed or if the menu is unable to be closed.
30
67
  */
31
68
  async function closeMenu(select) {
69
+ select = getRootElement(select);
32
70
  if (!select.classList.contains(selectClasses.open)) {
33
71
  throw new Error(`Select is already closed\n${select.innerHTML}`);
34
72
  }
@@ -51,6 +89,7 @@ async function closeMenu(select) {
51
89
  */
52
90
  function getLabelText(select) {
53
91
  var _selector$textContent, _selector$textContent2;
92
+ select = getRootElement(select);
54
93
  const selector = select.querySelector(`.${selectClasses.selector}`);
55
94
  if (!selector) {
56
95
  throw new Error(`Selector not found\n${select.innerHTML}`);
@@ -69,10 +108,12 @@ function getLabelText(select) {
69
108
  * you issues, please let #help-frontend know.
70
109
  */
71
110
  async function multiSelect(select, options) {
111
+ select = getRootElement(select);
72
112
  await openMenu(select);
113
+ const optionsList = getOptionsList(select);
73
114
  for (let i = 0; i < options.length; i++) {
74
115
  const option = options[i];
75
- const optionItem = screen.getByTitle(option);
116
+ const optionItem = within(optionsList).getByTitle(option);
76
117
  await userEvent.click(optionItem, {
77
118
  pointerEventsCheck: 0
78
119
  });
@@ -89,9 +130,11 @@ async function multiSelect(select, options) {
89
130
  * you issues, please let #help-frontend know.
90
131
  */
91
132
  async function singleSelect(select, option) {
133
+ select = getRootElement(select);
92
134
  await openMenu(select);
93
- const optionElem = screen.getByTitle(option);
94
- await userEvent.click(optionElem, {
135
+ const optionsList = getOptionsList(select);
136
+ const optionItem = within(optionsList).getByTitle(option);
137
+ await userEvent.click(optionItem, {
95
138
  pointerEventsCheck: 0
96
139
  });
97
140
  // Menu automatically closes for a single <Select/> (no mode="multiple")
@@ -102,6 +145,7 @@ async function singleSelect(select, option) {
102
145
  * the `allowClear` prop must be set to `true`.
103
146
  */
104
147
  async function clearAll(select) {
148
+ select = getRootElement(select);
105
149
  const clearBtn = select.querySelector(`.${selectClasses.clear}`);
106
150
  if (!clearBtn) {
107
151
  throw new Error(`Select not clearable\n${select.innerHTML}`);
@@ -114,11 +158,9 @@ async function clearAll(select) {
114
158
  * the menu, and returns a list of the text of each option in order.
115
159
  */
116
160
  async function getAllOptions(select) {
161
+ select = getRootElement(select);
117
162
  await openMenu(select);
118
- const optionsList = select.ownerDocument.body.querySelector(`.${selectClasses.list}`);
119
- if (optionsList === null) {
120
- throw new Error(`Options list not found\n${select.ownerDocument.body.innerHTML}`);
121
- }
163
+ const optionsList = getOptionsList(select);
122
164
  const options = [];
123
165
  optionsList.querySelectorAll(`.${selectClasses.option}`).forEach(option => {
124
166
  if (option.textContent === null) {
@@ -132,13 +174,13 @@ async function getAllOptions(select) {
132
174
 
133
175
  var selectEvent = /*#__PURE__*/Object.freeze({
134
176
  __proto__: null,
135
- openMenu: openMenu,
177
+ clearAll: clearAll,
136
178
  closeMenu: closeMenu,
179
+ getAllOptions: getAllOptions,
137
180
  getLabelText: getLabelText,
138
181
  multiSelect: multiSelect,
139
- singleSelect: singleSelect,
140
- clearAll: clearAll,
141
- getAllOptions: getAllOptions
182
+ openMenu: openMenu,
183
+ singleSelect: singleSelect
142
184
  });
143
185
 
144
186
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"rtl.js","sources":["../../src/test-utils/rtl/selectEvent.ts","../../src/test-utils/rtl/table.ts","../../src/test-utils/rtl/index.ts"],"sourcesContent":["import { waitFor, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport { selectClasses } from '../common';\n\n/**\n * Opens the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already opened or if the menu is unable to be opened.\n */\nexport async function openMenu(select: HTMLElement): Promise<void> {\n if (select.classList.contains(selectClasses.open)) {\n throw new Error(`Select is already open\\n${select.innerHTML}`);\n }\n const selector = select.querySelector(`.${selectClasses.selector}`);\n if (!selector) {\n throw new Error(`Selector not found\\n${select.innerHTML}`);\n }\n await userEvent.click(selector, { pointerEventsCheck: 0 });\n await waitFor(() => {\n if (!select.classList.contains(selectClasses.open)) {\n throw new Error(`Select did not open\\n${select.innerHTML}`);\n }\n });\n}\n\n/**\n * Closes the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already closed or if the menu is unable to be closed.\n */\nexport async function closeMenu(select: HTMLElement): Promise<void> {\n if (!select.classList.contains(selectClasses.open)) {\n throw new Error(`Select is already closed\\n${select.innerHTML}`);\n }\n const selector = select.querySelector(`.${selectClasses.selector}`);\n if (!selector) {\n throw new Error(`Selector not found\\n${select.innerHTML}`);\n }\n await userEvent.click(selector, { pointerEventsCheck: 0 });\n await waitFor(() => {\n if (select.classList.contains(selectClasses.open)) {\n throw new Error(`Select did not close\\n${select.innerHTML}`);\n }\n });\n}\n\n/**\n * Returns a string concatenating the labels for all selected options.\n */\nexport function getLabelText(select: HTMLElement): string {\n const selector = select.querySelector(`.${selectClasses.selector}`);\n if (!selector) {\n throw new Error(`Selector not found\\n${select.innerHTML}`);\n }\n // Trim the text to avoid weird whitespace issues non-label elements being added.\n // For example, the input mirror is an empty span with some whitespace that is\n // nested under the selector but does not show up in the label text.\n return selector.textContent?.trim() ?? '';\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component with `mode=\"multiple\"`.\n * The provided strings must match the option labels exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function multiSelect(select: HTMLElement, options: string[]): Promise<void> {\n await openMenu(select);\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n const optionItem = screen.getByTitle(option);\n await userEvent.click(optionItem, { pointerEventsCheck: 0 });\n }\n // Close the menu to indicate that selection has finished\n await closeMenu(select);\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component without a\n * mode. The provided string must match an option label exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function singleSelect(select: HTMLElement, option: string): Promise<void> {\n await openMenu(select);\n const optionElem = screen.getByTitle(option);\n await userEvent.click(optionElem, { pointerEventsCheck: 0 });\n // Menu automatically closes for a single <Select/> (no mode=\"multiple\")\n}\n\n/**\n * Clicks on the \"Clear\" button. In order for this function to work properly,\n * the `allowClear` prop must be set to `true`.\n */\nexport async function clearAll(select: HTMLElement): Promise<void> {\n const clearBtn = select.querySelector(`.${selectClasses.clear}`);\n if (!clearBtn) {\n throw new Error(`Select not clearable\\n${select.innerHTML}`);\n }\n await userEvent.click(clearBtn);\n}\n\n/**\n * Opens the dropdown menu, finds all of the options in the dropdown, closes\n * the menu, and returns a list of the text of each option in order.\n */\nexport async function getAllOptions(select: HTMLElement): Promise<string[]> {\n await openMenu(select);\n const optionsList = select.ownerDocument.body.querySelector(`.${selectClasses.list}`);\n if (optionsList === null) {\n throw new Error(`Options list not found\\n${select.ownerDocument.body.innerHTML}`);\n }\n const options: string[] = [];\n optionsList.querySelectorAll(`.${selectClasses.option}`).forEach((option) => {\n if (option.textContent === null) {\n throw new Error(`Option had no text content\\n${option.innerHTML}`);\n }\n options.push(option.textContent);\n });\n await closeMenu(select);\n return options;\n}\n","import { queryHelpers, within } from '@testing-library/react';\n\nimport type { GetTableRowByCellTextOptions, TableRows } from '../common';\nimport { createMarkdownTable } from '../common';\n\n/**\n * Returns the table row that contains the specified `cellText`. The `cellText`\n * must be in the column with name `columnHeaderName` if it is specified. Otherwise,\n * the `cellText` must be in the first column. Throws an error if either multiple\n * rows or no rows can be found that match the given options. Also throws an error\n * if the column with name `columnHeaderName` cannot be found.\n *\n * @param tableElement The HTMLElement representing the table to query in. This is likely\n * a `<div role=\"table\">` element, so it can be queried by `screen.getByRole('table')`.\n * @param cellText The cell text that uniquely identifies the row.\n * @param columnHeaderName The name of the column to search the text for. If not provided,\n * the first column will be used.\n */\nexport function getTableRowByCellText(\n tableElement: HTMLElement,\n cellText: string,\n { columnHeaderName }: GetTableRowByCellTextOptions = {}\n): HTMLElement {\n let columnHeaderIndex: number;\n if (columnHeaderName === undefined) {\n columnHeaderIndex = 0;\n } else {\n const columnHeader = within(tableElement).getByRole('columnheader', { name: columnHeaderName });\n columnHeaderIndex = Array.from(columnHeader.parentElement?.children ?? []).indexOf(columnHeader);\n }\n\n const matchingRows = within(tableElement)\n .getAllByRole('row')\n // Skip first row (table header)\n .slice(1)\n .filter((row) => {\n const cells = within(row).getAllByRole('cell');\n const cell = cells[columnHeaderIndex];\n const cellContainsText = within(cell).queryByText(cellText) !== null;\n return cellContainsText;\n });\n\n if (matchingRows.length === 0) {\n throw queryHelpers.getElementError(\n `Unable to find a table row with text \"${cellText}\" in the column \"${columnHeaderName}\"`,\n tableElement\n );\n }\n\n if (matchingRows.length > 1) {\n throw queryHelpers.getElementError(\n `Found multiple table rows with text \"${cellText}\" in the column \"${columnHeaderName}\"`,\n tableElement\n );\n }\n\n return matchingRows[0];\n}\n\n/**\n * Converts a Du Bois table to a markdown table string. This means that each cell\n * is separated by a pipe (including the edges), the header row is on its own line\n * at the top, each data row is on its own line below, and the header row is separated\n * by a row of dashes from the data rows. This is useful for checking table contents\n * in tests.\n *\n * @param tableElement The HTMLElement representing the table to query in. This is likely\n * a `<div role=\"table\">` element, so it can be queried by `screen.getByRole('table')`.\n *\n * @example\n * The HTML table:\n * ```jsx\n * <Table>\n * <TableRow isHeader>\n * <TableHeader>Name</TableHeader>\n * <TableHeader>Fruit</TableHeader>\n * </TableRow>\n * <TableRow>\n * <TableCell>Alice</TableCell>\n * <TableCell>Apple</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Brady</TableCell>\n * <TableCell>Banana</TableCell>\n * </TableRow>\n * </Table>\n * ```\n *\n * The Markdown table:\n * ```md\n * | Name | Fruit |\n * | --- | --- |\n * | Alice | Apple |\n * | Brady | Banana |\n * ```\n */\nexport function toMarkdownTable(tableElement: HTMLElement): string {\n const { bodyRows, headerRow } = getTableRows(tableElement);\n const columns = within(headerRow)\n .getAllByRole('columnheader')\n .map((column) => column.textContent ?? '');\n const rows = bodyRows.map((row) =>\n within(row)\n .getAllByRole('cell')\n .map((cell) => cell.textContent ?? '')\n );\n return createMarkdownTable(columns, rows);\n}\n\n/**\n * Returns the header row and all body rows (non-header rows) in order. Assumes that the\n * `tableElement` has a single header row (as the first row) and the rest of the rows are\n * body rows.\n *\n * @param tableElement The HTMLElement representing the table to query in. This is likely\n * a `<div role=\"table\">` element, so it can be queried by `screen.getByRole('table')`.\n */\nexport function getTableRows(tableElement: HTMLElement): TableRows<HTMLElement> {\n const [firstRow, ...restRows] = within(tableElement).getAllByRole('row');\n return {\n bodyRows: restRows,\n headerRow: firstRow,\n };\n}\n","import userEvent from '@testing-library/user-event';\n\nexport * as selectEvent from './selectEvent';\n\nexport * from './table';\n\n/**\n * Opens the dropdown menu by clicking on the dropdown button.\n *\n * @param dropdownButton - The Dropdown Trigger button that opens the menu when clicked.\n */\nexport const openDropdownMenu = async (dropdownButton: HTMLElement) => {\n await userEvent.type(dropdownButton, '{arrowdown}');\n};\n"],"names":["openMenu","select","classList","contains","selectClasses","open","Error","innerHTML","selector","querySelector","userEvent","click","pointerEventsCheck","waitFor","closeMenu","getLabelText","_selector$textContent","_selector$textContent2","textContent","trim","multiSelect","options","i","length","option","optionItem","screen","getByTitle","singleSelect","optionElem","clearAll","clearBtn","clear","getAllOptions","optionsList","ownerDocument","body","list","querySelectorAll","forEach","push","getTableRowByCellText","tableElement","cellText","columnHeaderName","arguments","undefined","columnHeaderIndex","_columnHeader$parentE","_columnHeader$parentE2","columnHeader","within","getByRole","name","Array","from","parentElement","children","indexOf","matchingRows","getAllByRole","slice","filter","row","cells","cell","cellContainsText","queryByText","queryHelpers","getElementError","toMarkdownTable","bodyRows","headerRow","getTableRows","columns","map","column","_column$textContent","rows","_cell$textContent","createMarkdownTable","firstRow","restRows","openDropdownMenu","dropdownButton","type"],"mappings":";;;;AAKA;AACA;AACA;AACA;AACO,eAAeA,QAAQA,CAACC,MAAmB,EAAiB;EACjE,IAAIA,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,aAAa,CAACC,IAAI,CAAC,EAAE;IACjD,MAAM,IAAIC,KAAK,CAAE,2BAA0BL,MAAM,CAACM,SAAU,EAAC,CAAC;;EAEhE,MAAMC,QAAQ,GAAGP,MAAM,CAACQ,aAAa,CAAE,IAAGL,aAAa,CAACI,QAAS,EAAC,CAAC;EACnE,IAAI,CAACA,QAAQ,EAAE;IACb,MAAM,IAAIF,KAAK,CAAE,uBAAsBL,MAAM,CAACM,SAAU,EAAC,CAAC;;EAE5D,MAAMG,SAAS,CAACC,KAAK,CAACH,QAAQ,EAAE;IAAEI,kBAAkB,EAAE;GAAG,CAAC;EAC1D,MAAMC,OAAO,CAAC,MAAM;IAClB,IAAI,CAACZ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,aAAa,CAACC,IAAI,CAAC,EAAE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YAAY,CAAC,cAAc,CAAC,CAC5Be,GAAG,CAAEC,MAAM;IAAA,IAAAC,mBAAA;IAAA,QAAAA,mBAAA,GAAKD,MAAM,CAAC1D,WAAW,cAAA2D,mBAAA,cAAAA,mBAAA,GAAI,EAAE;IAAC;EAC5C,MAAMC,IAAI,GAAGP,QAAQ,CAACI,GAAG,CAAEZ,GAAG,IAC5BZ,MAAM,CAACY,GAAG,CAAC,CACRH,YAAY,CAAC,MAAM,CAAC,CACpBe,GAAG,CAAEV,IAAI;IAAA,IAAAc,iBAAA;IAAA,QAAAA,iBAAA,GAAKd,IAAI,CAAC/C,WAAW,cAAA6D,iBAAA,cAAAA,iBAAA,GAAI,EAAE;IAAC,CACzC;EACD,OAAOC,mBAAmB,CAACN,OAAO,EAAEI,IAAI,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASL,YAAYA,CAAC/B,YAAyB,EAA0B;EAC9E,MAAM,CAACuC,QAAQ,EAAE,GAAGC,QAAQ,CAAC,GAAG/B,MAAM,CAACT,YAAY,CAAC,CAACkB,YAAY,CAAC,KAAK,CAAC;EACxE,OAAO;IACLW,QAAQ,EAAEW,QAAQ;IAClBV,SAAS,EAAES;GACZ;AACH;;ACrHA;AACA;AACA;AACA;AACA;MACaE,gBAAgB,GAAG,MAAOC,cAA2B,IAAK;EACrE,MAAM1E,SAAS,CAAC2E,IAAI,CAACD,cAAc,EAAE,aAAa,CAAC;AACrD;;;;"}
1
+ {"version":3,"file":"rtl.js","sources":["../../src/test-utils/rtl/selectEvent.ts","../../src/test-utils/rtl/table.ts","../../src/test-utils/rtl/index.ts"],"sourcesContent":["import { waitFor, within } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport { selectClasses } from '../common';\n\n/**\n * Allows the helpers in this module to be used when the select element is\n * queried _semantically_ (as if it were a native <select> element) — i.e.\n * `ByRole('combobox', { name: '…' })`, rather than by test ID.\n *\n * Also checks if <DesignSystemProvider> was used, because many of the helpers\n * in this module query by class name starting with \"du-bois-\", which requires\n * the provider.\n */\nfunction getRootElement(element: HTMLElement): HTMLElement {\n if (element.getAttribute('role') === 'combobox') {\n element = element.closest(`.${selectClasses.selector}`)!.parentElement!;\n }\n if (element.classList.contains('ant-select')) {\n throw new Error('Component must be wrapped by <DesignSystemProvider>');\n }\n return element;\n}\n\nfunction getOptionsList(select: HTMLElement): HTMLElement {\n const body = select.ownerDocument.body;\n const input = within(select).getByRole('combobox');\n const listId = input.getAttribute('aria-owns') || input.getAttribute('aria-controls');\n if (!listId) {\n throw new Error(`Options listid not found\\n${body.innerHTML}`);\n }\n\n const listbox = select.ownerDocument.getElementById(listId);\n if (!listbox?.parentElement) {\n throw new Error(`Options list not found\\n${body.innerHTML}`);\n }\n\n const optionsList = listbox.parentElement.querySelector<HTMLElement>(`.${selectClasses.list}`);\n if (!optionsList) {\n throw new Error(`Options list not found\\n${body.innerHTML}`);\n }\n\n return optionsList;\n}\n\n/**\n * Opens the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already opened or if the menu is unable to be opened.\n */\nexport async function openMenu(select: HTMLElement): Promise<void> {\n select = getRootElement(select);\n if (select.classList.contains(selectClasses.open)) {\n throw new Error(`Select is already open\\n${select.innerHTML}`);\n }\n const selector = select.querySelector(`.${selectClasses.selector}`);\n if (!selector) {\n throw new Error(`Selector not found\\n${select.innerHTML}`);\n }\n await userEvent.click(selector, { pointerEventsCheck: 0 });\n await waitFor(() => {\n if (!select.classList.contains(selectClasses.open)) {\n throw new Error(`Select did not open\\n${select.innerHTML}`);\n }\n });\n}\n\n/**\n * Closes the dropdown menu for the <Select/> by clicking. Will throw an error if\n * the menu is already closed or if the menu is unable to be closed.\n */\nexport async function closeMenu(select: HTMLElement): Promise<void> {\n select = getRootElement(select);\n if (!select.classList.contains(selectClasses.open)) {\n throw new Error(`Select is already closed\\n${select.innerHTML}`);\n }\n const selector = select.querySelector(`.${selectClasses.selector}`);\n if (!selector) {\n throw new Error(`Selector not found\\n${select.innerHTML}`);\n }\n await userEvent.click(selector, { pointerEventsCheck: 0 });\n await waitFor(() => {\n if (select.classList.contains(selectClasses.open)) {\n throw new Error(`Select did not close\\n${select.innerHTML}`);\n }\n });\n}\n\n/**\n * Returns a string concatenating the labels for all selected options.\n */\nexport function getLabelText(select: HTMLElement): string {\n select = getRootElement(select);\n const selector = select.querySelector(`.${selectClasses.selector}`);\n if (!selector) {\n throw new Error(`Selector not found\\n${select.innerHTML}`);\n }\n // Trim the text to avoid weird whitespace issues non-label elements being added.\n // For example, the input mirror is an empty span with some whitespace that is\n // nested under the selector but does not show up in the label text.\n return selector.textContent?.trim() ?? '';\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component with `mode=\"multiple\"`.\n * The provided strings must match the option labels exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function multiSelect(select: HTMLElement, options: string[]): Promise<void> {\n select = getRootElement(select);\n await openMenu(select);\n const optionsList = getOptionsList(select);\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n const optionItem = within(optionsList).getByTitle(option);\n await userEvent.click(optionItem, { pointerEventsCheck: 0 });\n }\n // Close the menu to indicate that selection has finished\n await closeMenu(select);\n}\n\n/**\n * Selects options from the dropdown menu for a <Select/> component without a\n * mode. The provided string must match an option label exactly. There is a known\n * limitation for lists that are extremely long because AntD virtualizes the\n * options so not all may options may be rendered in the DOM. If this is causing\n * you issues, please let #help-frontend know.\n */\nexport async function singleSelect(select: HTMLElement, option: string): Promise<void> {\n select = getRootElement(select);\n await openMenu(select);\n const optionsList = getOptionsList(select);\n const optionItem = within(optionsList).getByTitle(option);\n await userEvent.click(optionItem, { pointerEventsCheck: 0 });\n // Menu automatically closes for a single <Select/> (no mode=\"multiple\")\n}\n\n/**\n * Clicks on the \"Clear\" button. In order for this function to work properly,\n * the `allowClear` prop must be set to `true`.\n */\nexport async function clearAll(select: HTMLElement): Promise<void> {\n select = getRootElement(select);\n const clearBtn = select.querySelector(`.${selectClasses.clear}`);\n if (!clearBtn) {\n throw new Error(`Select not clearable\\n${select.innerHTML}`);\n }\n await userEvent.click(clearBtn);\n}\n\n/**\n * Opens the dropdown menu, finds all of the options in the dropdown, closes\n * the menu, and returns a list of the text of each option in order.\n */\nexport async function getAllOptions(select: HTMLElement): Promise<string[]> {\n select = getRootElement(select);\n await openMenu(select);\n const optionsList = getOptionsList(select);\n const options: string[] = [];\n optionsList.querySelectorAll(`.${selectClasses.option}`).forEach((option) => {\n if (option.textContent === null) {\n throw new Error(`Option had no text content\\n${option.innerHTML}`);\n }\n options.push(option.textContent);\n });\n await closeMenu(select);\n return options;\n}\n","import { queryHelpers, within } from '@testing-library/react';\n\nimport type { GetTableRowByCellTextOptions, TableRows } from '../common';\nimport { createMarkdownTable } from '../common';\n\n/**\n * Returns the table row that contains the specified `cellText`. The `cellText`\n * must be in the column with name `columnHeaderName` if it is specified. Otherwise,\n * the `cellText` must be in the first column. Throws an error if either multiple\n * rows or no rows can be found that match the given options. Also throws an error\n * if the column with name `columnHeaderName` cannot be found.\n *\n * @param tableElement The HTMLElement representing the table to query in. This is likely\n * a `<div role=\"table\">` element, so it can be queried by `screen.getByRole('table')`.\n * @param cellText The cell text that uniquely identifies the row.\n * @param columnHeaderName The name of the column to search the text for. If not provided,\n * the first column will be used.\n */\nexport function getTableRowByCellText(\n tableElement: HTMLElement,\n cellText: string,\n { columnHeaderName }: GetTableRowByCellTextOptions = {},\n): HTMLElement {\n let columnHeaderIndex: number;\n if (columnHeaderName === undefined) {\n columnHeaderIndex = 0;\n } else {\n const columnHeader = within(tableElement).getByRole('columnheader', { name: columnHeaderName });\n columnHeaderIndex = Array.from(columnHeader.parentElement?.children ?? []).indexOf(columnHeader);\n }\n\n const matchingRows = within(tableElement)\n .getAllByRole('row')\n // Skip first row (table header)\n .slice(1)\n .filter((row) => {\n const cells = within(row).getAllByRole('cell');\n const cell = cells[columnHeaderIndex];\n const cellContainsText = within(cell).queryByText(cellText) !== null;\n return cellContainsText;\n });\n\n if (matchingRows.length === 0) {\n throw queryHelpers.getElementError(\n `Unable to find a table row with text \"${cellText}\" in the column \"${columnHeaderName}\"`,\n tableElement,\n );\n }\n\n if (matchingRows.length > 1) {\n throw queryHelpers.getElementError(\n `Found multiple table rows with text \"${cellText}\" in the column \"${columnHeaderName}\"`,\n tableElement,\n );\n }\n\n return matchingRows[0];\n}\n\n/**\n * Converts a Du Bois table to a markdown table string. This means that each cell\n * is separated by a pipe (including the edges), the header row is on its own line\n * at the top, each data row is on its own line below, and the header row is separated\n * by a row of dashes from the data rows. This is useful for checking table contents\n * in tests.\n *\n * @param tableElement The HTMLElement representing the table to query in. This is likely\n * a `<div role=\"table\">` element, so it can be queried by `screen.getByRole('table')`.\n *\n * @example\n * The HTML table:\n * ```jsx\n * <Table>\n * <TableRow isHeader>\n * <TableHeader>Name</TableHeader>\n * <TableHeader>Fruit</TableHeader>\n * </TableRow>\n * <TableRow>\n * <TableCell>Alice</TableCell>\n * <TableCell>Apple</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Brady</TableCell>\n * <TableCell>Banana</TableCell>\n * </TableRow>\n * </Table>\n * ```\n *\n * The Markdown table:\n * ```md\n * | Name | Fruit |\n * | --- | --- |\n * | Alice | Apple |\n * | Brady | Banana |\n * ```\n */\nexport function toMarkdownTable(tableElement: HTMLElement): string {\n const { bodyRows, headerRow } = getTableRows(tableElement);\n const columns = within(headerRow)\n .getAllByRole('columnheader')\n .map((column) => column.textContent ?? '');\n const rows = bodyRows.map((row) =>\n within(row)\n .getAllByRole('cell')\n .map((cell) => cell.textContent ?? ''),\n );\n return createMarkdownTable(columns, rows);\n}\n\n/**\n * Returns the header row and all body rows (non-header rows) in order. Assumes that the\n * `tableElement` has a single header row (as the first row) and the rest of the rows are\n * body rows.\n *\n * @param tableElement The HTMLElement representing the table to query in. This is likely\n * a `<div role=\"table\">` element, so it can be queried by `screen.getByRole('table')`.\n */\nexport function getTableRows(tableElement: HTMLElement): TableRows<HTMLElement> {\n const [firstRow, ...restRows] = within(tableElement).getAllByRole('row');\n return {\n bodyRows: restRows,\n headerRow: firstRow,\n };\n}\n","import userEvent from '@testing-library/user-event';\n\nexport * as selectEvent from './selectEvent';\n\nexport * from './table';\n\n/**\n * Opens the dropdown menu by clicking on the dropdown button.\n *\n * @param dropdownButton - The Dropdown Trigger button that opens the menu when clicked.\n */\nexport const openDropdownMenu = async (dropdownButton: HTMLElement) => {\n await userEvent.type(dropdownButton, '{arrowdown}');\n};\n"],"names":["getRootElement","element","getAttribute","closest","selectClasses","selector","parentElement","classList","contains","Error","getOptionsList","select","body","ownerDocument","input","within","getByRole","listId","innerHTML","listbox","getElementById","optionsList","querySelector","list","openMenu","open","userEvent","click","pointerEventsCheck","waitFor","closeMenu","getLabelText","_selector$textContent","_selector$textContent2","textContent","trim","multiSelect","options","i","length","option","optionItem","getByTitle","singleSelect","clearAll","clearBtn","clear","getAllOptions","querySelectorAll","forEach","push","getTableRowByCellText","tableElement","cellText","columnHeaderName","arguments","undefined","columnHeaderIndex","_columnHeader$parentE","_columnHeader$parentE2","columnHeader","name","Array","from","children","indexOf","matchingRows","getAllByRole","slice","filter","row","cells","cell","cellContainsText","queryByText","queryHelpers","getElementError","toMarkdownTable","bodyRows","headerRow","getTableRows","columns","map","column","_column$textContent","rows","_cell$textContent","createMarkdownTable","firstRow","restRows","openDropdownMenu","dropdownButton","type"],"mappings":";;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAcA,CAACC,OAAoB,EAAe;EACzD,IAAIA,OAAO,CAACC,YAAY,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE;AAC/CD,IAAAA,OAAO,GAAGA,OAAO,CAACE,OAAO,CAAE,CAAA,CAAA,EAAGC,aAAa,CAACC,QAAS,CAAA,CAAC,CAAC,CAAEC,aAAc,CAAA;AACzE,GAAA;EACA,IAAIL,OAAO,CAACM,S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AA,GAAI,EAAE,CAAA;GAAC,CAAA,CAAA;EAC5C,MAAMC,IAAI,GAAGP,QAAQ,CAACI,GAAG,CAAEZ,GAAG,IAC5BvD,MAAM,CAACuD,GAAG,CAAC,CACRH,YAAY,CAAC,MAAM,CAAC,CACpBe,GAAG,CAAEV,IAAI,IAAA;AAAA,IAAA,IAAAc,iBAAA,CAAA;IAAA,OAAAA,CAAAA,iBAAA,GAAKd,IAAI,CAACtC,WAAW,cAAAoD,iBAAA,KAAA,KAAA,CAAA,GAAAA,iBAAA,GAAI,EAAE,CAAA;AAAA,GAAA,CACzC,CAAC,CAAA;AACD,EAAA,OAAOC,mBAAmB,CAACN,OAAO,EAAEI,IAAI,CAAC,CAAA;AAC3C,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASL,YAAYA,CAAC5B,YAAyB,EAA0B;AAC9E,EAAA,MAAM,CAACoC,QAAQ,EAAE,GAAGC,QAAQ,CAAC,GAAG1E,MAAM,CAACqC,YAAY,CAAC,CAACe,YAAY,CAAC,KAAK,CAAC,CAAA;EACxE,OAAO;AACLW,IAAAA,QAAQ,EAAEW,QAAQ;AAClBV,IAAAA,SAAS,EAAES,QAAAA;GACZ,CAAA;AACH;;ACrHA;AACA;AACA;AACA;AACA;AACaE,MAAAA,gBAAgB,GAAG,MAAOC,cAA2B,IAAK;AACrE,EAAA,MAAMjE,SAAS,CAACkE,IAAI,CAACD,cAAc,EAAE,aAAa,CAAC,CAAA;AACrD;;;;"}
@@ -6,6 +6,16 @@ export type TagColorToken = `tag${Capitalize<SecondaryColorToken>}` | 'tagDefaul
6
6
  type ColorPalettePrimary = Record<PrimaryColorToken, string>;
7
7
  type ColorPaletteSecondary = Record<SecondaryColorToken, string>;
8
8
  export declare const colorPalettePrimary: ColorPalettePrimary;
9
+ export declare const newGreys: {
10
+ grey100: string;
11
+ grey200: string;
12
+ grey300: string;
13
+ grey400: string;
14
+ grey500: string;
15
+ grey600: string;
16
+ grey700: string;
17
+ grey800: string;
18
+ };
9
19
  export declare const colorPaletteSecondary: ColorPaletteSecondary;
10
20
  export declare const lightColorList: {
11
21
  backgroundPrimary: string;
@@ -1 +1 @@
1
- {"version":3,"file":"colorList.d.ts","sourceRoot":"","sources":["../../src/theme/colorList.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,GAAG,SAAS,GAAG,WAAW,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnF,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,OAAO,GACP,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,mBAAmB,CAAC,EAAE,GAAG,YAAY,CAAC;AAEnF,KAAK,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAE7D,KAAK,qBAAqB,GAAG,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAGjE,eAAO,MAAM,mBAAmB,EAAE,mBA2CjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,qBAWnC,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqG1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAAO,cAqGlC,CAAC"}
1
+ {"version":3,"file":"colorList.d.ts","sourceRoot":"","sources":["../../src/theme/colorList.ts"],"names":[],"mappings":"AA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name": "@databricks/design-system",
3
- "version": "1.12.8",
3
+ "version": "1.12.10",
4
4
  "description": "DuBois Design System",
5
5
  "keywords": [],
6
6
  "license": "ISC",
@@ -23,29 +23,26 @@
23
23
  "clean": "rm -rf dist",
24
24
  "prepublish": "./scripts/prepublish",
25
25
  "postpublish": "./scripts/postpublish",
26
- "generate": "npm-run-all generate:icons generate:icons-story prettier",
26
+ "generate": "npm-run-all generate:icons generate:icons-story",
27
27
  "generate:icons": "svgr -d src/design-system/Icon/__generated/icons --typescript --template src/design-system/Icon/generator/iconTemplate.js --icon --replace-attr-values \"#5D7283=currentColor\" src/assets/icons",
28
28
  "generate:icons-story": "node ./src/design-system/Icon/generator/generateIconStory.js",
29
- "build": "rm -f dist/test-utils/rtl.d.ts dist/test-utils/enzyme.d.ts; npm-run-all --parallel build:styles build:js && yarn build:less-colors",
29
+ "build": "rm -rf dist && yarn build:js && yarn build:less-colors",
30
30
  "build:deps": "yarn workspaces foreach -piR --topological-dev --from @databricks/design-system --exclude @databricks/design-system run build",
31
- "build:js:base": "databricks-pkgr build --no-clean",
32
- "build:js": "yarn build:js:base",
33
- "build:less-colors": "./yarnrun.sh less-variables:build",
34
- "build:styles": "npm-run-all --parallel build:styles-default-theme build:styles-dark-theme build:styles:mfe",
35
- "build:styles:mfe": "BUILD_FOR_MFE=true npm-run-all --parallel build:styles-default-theme build:styles-dark-theme",
36
- "build:styles-default-theme": "rollup --configPlugin typescript -c ./src/rollup.styles.config.ts",
37
- "build:styles-dark-theme": "BUILD_DARK_MODE=true rollup --configPlugin typescript -c ./src/rollup.styles.config.ts",
31
+ "build:js": "databricks-pkgr build --no-clean",
32
+ "build:less-colors": "swc-node ./scripts/less_color_vars_generation.ts",
38
33
  "gocx-codegen": "../js/scripts/bin/gocx-codegen",
39
- "watch": "yarn build:js:base --watch",
34
+ "watch": "yarn build:js --watch",
40
35
  "storybook-build": "yarn build:storybook",
41
36
  "build:storybook": "yarn build && TS_NODE_PROJECT=.storybook/tsconfig.json yarn databricks-build-storybook -c storybook",
42
- "storybook": "yarn build:styles && yarn start:storybook",
37
+ "storybook": "yarn start:storybook",
38
+ "storybook:generate-safex-index": "swc-node ./scripts/safex_keys/regenerate.ts",
39
+ "storybook:generate-safex-index-check": "swc-node ./scripts/safex_keys/check.ts",
43
40
  "start:storybook": "TS_NODE_PROJECT=.storybook/tsconfig.json BROWSER=none databricks-start-storybook -p 6006 -c storybook",
44
- "indexes-regenerate": "./yarnrun.sh indexes:regenerate",
45
- "indexes-check": "./yarnrun.sh indexes:check",
41
+ "indexes-regenerate": "swc-node ./scripts/index_regeneration/regenerate.ts",
42
+ "indexes-check": "swc-node ./scripts/index_regeneration/check.ts",
46
43
  "snapshot": "databricks-percy storybook ./storybook-static -c .percy.storybook.yml --verbose -t750",
47
- "prettier:check": "./yarnrun.sh prettier:check",
48
- "prettier": "./yarnrun.sh prettier",
44
+ "prettier:fix": "databricks-prettier . --write",
45
+ "prettier:check": "databricks-prettier . --check",
49
46
  "lint": "databricks-eslint",
50
47
  "lint:fix": "yarn lint --fix",
51
48
  "test": "databricks-jest",
@@ -53,17 +50,18 @@
53
50
  "type-check": "tsc --noEmit --project ./tsconfig.json",
54
51
  "type-check:watch": "yarn type-check --watch",
55
52
  "check-all": "yarn type-check && yarn prettier:check && yarn lint",
56
- "fix-all": "yarn generate && yarn prettier && yarn lint:fix && yarn indexes-regenerate",
53
+ "fix-all": "yarn generate && yarn prettier:fix && yarn indexes-regenerate && yarn lint:fix && yarn type-check",
57
54
  "prep-deps": ": # magic task to allow yarn ensure-deps plugin prepare dependencies of this package"
58
55
  },
59
56
  "devDependencies": {
60
- "@babel/core": "^7.21.3",
61
- "@babel/preset-env": "^7.20.2",
62
- "@babel/preset-react": "^7.18.6",
63
- "@babel/preset-typescript": "^7.21.0",
57
+ "@babel/core": "^7.22.1",
58
+ "@babel/preset-env": "^7.22.4",
59
+ "@babel/preset-react": "^7.22.3",
60
+ "@babel/preset-typescript": "^7.21.5",
64
61
  "@databricks/config-eslint": "1.0.0",
65
62
  "@databricks/config-jest": "1.0.0",
66
63
  "@databricks/config-percy": "0.0.0",
64
+ "@databricks/config-prettier": "1.0.0",
67
65
  "@databricks/config-storybook": "1.0.0",
68
66
  "@databricks/pkgr": "1.0.0",
69
67
  "@emotion/babel-plugin": "^11.3.0",
@@ -72,8 +70,8 @@
72
70
  "@emotion/react": "^11.4.0",
73
71
  "@faker-js/faker": "^6.0.0-alpha.6",
74
72
  "@jest/types": "^29.3.1",
75
- "@percy/cli": "^1.20.0",
76
- "@percy/storybook": "^4.3.5",
73
+ "@percy/cli": "^1.24.2",
74
+ "@percy/storybook": "^4.3.6",
77
75
  "@radix-ui/react-switch": "^1.0.0",
78
76
  "@storybook/addon-actions": "^6.5.5",
79
77
  "@storybook/addon-docs": "^6.5.5",
@@ -85,7 +83,9 @@
85
83
  "@storybook/core-events": "^6.5.5",
86
84
  "@storybook/react": "^6.5.5",
87
85
  "@storybook/theming": "^6.5.5",
88
- "@svgr/cli": "^5.5.0",
86
+ "@svgr/cli": "^8.0.1",
87
+ "@swc/core": "^1.3.61",
88
+ "@swc/register": "^0.1.10",
89
89
  "@tanstack/react-table": "^8.7.3",
90
90
  "@testing-library/jest-dom": "^5.14.1",
91
91
  "@types/chroma-js": "^2.1.3",
@@ -99,17 +99,17 @@
99
99
  "@types/react-dom": "^17.0.17",
100
100
  "@types/react-resizable": "^3.0.3",
101
101
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
102
- "babel-loader": "^8.2.2",
102
+ "babel-loader": "^9.1.2",
103
103
  "babel-plugin-react-require": "^3.1.3",
104
104
  "cross-env": "^7.0.3",
105
105
  "css-loader": "^6.7.2",
106
106
  "dir-compare-cli": "^1.0.1",
107
+ "eslint-import-resolver-typescript": "^3.5.5",
107
108
  "glob": "^8.0.1",
108
109
  "identity-obj-proxy": "^3.0.0",
109
110
  "jscodeshift": "^0.13.0",
110
111
  "less": "^3.9.0",
111
112
  "less-loader": "^4.1.0",
112
- "magic-string": "^0.25.7",
113
113
  "npm-run-all": "^4.1.5",
114
114
  "postcss": "^8.3.5",
115
115
  "postcss-filter-rules": "^0.6.1",
@@ -124,11 +124,8 @@
124
124
  "react-shadow-root": "^6.2.0",
125
125
  "react-virtual": "^2.10.4",
126
126
  "resize-observer-polyfill": "^1.5.1",
127
- "rollup": "^2.61.1",
128
- "rollup-plugin-postcss": "^4.0.0",
129
127
  "storybook-dark-mode": "^1.0.8",
130
128
  "style-loader": "^3.3.1",
131
- "ts-node": "^10.9.1",
132
129
  "tsconfig-paths": "^3.9.0",
133
130
  "typescript": "^5.0.2",
134
131
  "usehooks-ts": "^2.9.1",
@@ -143,15 +140,15 @@
143
140
  },
144
141
  "dependencies": {
145
142
  "@ant-design/icons": "^4.7.0",
146
- "@babel/runtime": "^7.21.0",
143
+ "@babel/runtime": "^7.22.3",
147
144
  "@emotion/unitless": "^0.7.5",
145
+ "@radix-ui/react-context-menu": "^1.0.0",
148
146
  "@radix-ui/react-dialog": "1.0.3",
149
147
  "@radix-ui/react-dropdown-menu": "1.0.0",
150
148
  "@radix-ui/react-popover": "1.0.5",
151
149
  "@radix-ui/react-slider": "1.1.1",
152
150
  "@radix-ui/react-toast": "1.1.3",
153
151
  "@radix-ui/react-toggle": "1.0.2",
154
- "@rollup/plugin-node-resolve": "^13.1.1",
155
152
  "@testing-library/react": "^12.1.2",
156
153
  "@testing-library/user-event": "^14.0.0",
157
154
  "antd": "4.16.8",
@@ -164,8 +161,5 @@
164
161
  "react-resizable": "^3.0.4",
165
162
  "tslib": "^2.5.0"
166
163
  },
167
- "notes": [
168
- "rollup patch: Limit concurrent writes to work around jenkins open file handle limit affecting classic builds (ES-198426)."
169
- ],
170
164
  "stableVersion": "1.7.0"
171
165
  }