@databricks/design-system 1.12.14 → 1.12.15

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 (426) hide show
  1. package/dist/{Stepper-839336b1.js → Stepper-a0fb4d9b.js} +1302 -1172
  2. package/dist/Stepper-a0fb4d9b.js.map +1 -0
  3. package/dist/design-system/Avatar/Avatar.d.ts +40 -0
  4. package/dist/design-system/Avatar/Avatar.d.ts.map +1 -0
  5. package/dist/design-system/Avatar/SvgDatabricksIcon.d.ts +3 -0
  6. package/dist/design-system/Avatar/SvgDatabricksIcon.d.ts.map +1 -0
  7. package/dist/design-system/Avatar/SvgSparkleIcon.d.ts +3 -0
  8. package/dist/design-system/Avatar/SvgSparkleIcon.d.ts.map +1 -0
  9. package/dist/design-system/Avatar/SvgUserIcon.d.ts +3 -0
  10. package/dist/design-system/Avatar/SvgUserIcon.d.ts.map +1 -0
  11. package/dist/design-system/Avatar/index.d.ts +2 -0
  12. package/dist/design-system/Avatar/index.d.ts.map +1 -0
  13. package/dist/design-system/Button/Button.d.ts +2 -13
  14. package/dist/design-system/Button/Button.d.ts.map +1 -1
  15. package/dist/design-system/ContextMenu/ContextMenu.d.ts +28 -23
  16. package/dist/design-system/ContextMenu/ContextMenu.d.ts.map +1 -1
  17. package/dist/design-system/DatePicker/DatePicker.d.ts +25 -15
  18. package/dist/design-system/DatePicker/DatePicker.d.ts.map +1 -1
  19. package/dist/design-system/DesignSystemEventProvider/DesignSystemEventProvider.d.ts +2 -1
  20. package/dist/design-system/DesignSystemEventProvider/DesignSystemEventProvider.d.ts.map +1 -1
  21. package/dist/design-system/DialogCombobox/DialogComboboxContent.d.ts.map +1 -1
  22. package/dist/design-system/DialogCombobox/index.d.ts +1 -0
  23. package/dist/design-system/DialogCombobox/index.d.ts.map +1 -1
  24. package/dist/design-system/DialogCombobox/shared.d.ts.map +1 -1
  25. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts +2 -2
  26. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  27. package/dist/design-system/FormV2/RHFAdapters.d.ts +17 -10
  28. package/dist/design-system/FormV2/RHFAdapters.d.ts.map +1 -1
  29. package/dist/design-system/Icon/Icon.d.ts +1 -1
  30. package/dist/design-system/Icon/__generated/icons/AlignCenterIcon.d.ts +1 -1
  31. package/dist/design-system/Icon/__generated/icons/AlignLeftIcon.d.ts +1 -1
  32. package/dist/design-system/Icon/__generated/icons/AlignRightIcon.d.ts +1 -1
  33. package/dist/design-system/Icon/__generated/icons/AppIcon.d.ts +1 -1
  34. package/dist/design-system/Icon/__generated/icons/ArrowDownIcon.d.ts +1 -1
  35. package/dist/design-system/Icon/__generated/icons/ArrowInIcon.d.ts +1 -1
  36. package/dist/design-system/Icon/__generated/icons/ArrowLeftIcon.d.ts +1 -1
  37. package/dist/design-system/Icon/__generated/icons/ArrowRightIcon.d.ts +1 -1
  38. package/dist/design-system/Icon/__generated/icons/ArrowUpIcon.d.ts +1 -1
  39. package/dist/design-system/Icon/__generated/icons/ArrowsUpDownIcon.d.ts +1 -1
  40. package/dist/design-system/Icon/__generated/icons/AssistantIcon.d.ts +1 -1
  41. package/dist/design-system/Icon/__generated/icons/BadgeCodeIcon.d.ts +1 -1
  42. package/dist/design-system/Icon/__generated/icons/BadgeCodeOffIcon.d.ts +1 -1
  43. package/dist/design-system/Icon/__generated/icons/BarChartIcon.d.ts +1 -1
  44. package/dist/design-system/Icon/__generated/icons/BarGroupedIcon.d.ts +1 -1
  45. package/dist/design-system/Icon/__generated/icons/BarStackedIcon.d.ts +1 -1
  46. package/dist/design-system/Icon/__generated/icons/BarStackedPercentageIcon.d.ts +1 -1
  47. package/dist/design-system/Icon/__generated/icons/BeakerIcon.d.ts +1 -1
  48. package/dist/design-system/Icon/__generated/icons/BinaryIcon.d.ts +1 -1
  49. package/dist/design-system/Icon/__generated/icons/BoldIcon.d.ts +1 -1
  50. package/dist/design-system/Icon/__generated/icons/BookIcon.d.ts +1 -1
  51. package/dist/design-system/Icon/__generated/icons/BookmarkFillIcon.d.ts +1 -1
  52. package/dist/design-system/Icon/__generated/icons/BookmarkIcon.d.ts +1 -1
  53. package/dist/design-system/Icon/__generated/icons/BooksIcon.d.ts +1 -1
  54. package/dist/design-system/Icon/__generated/icons/BracketsCurlyIcon.d.ts +1 -1
  55. package/dist/design-system/Icon/__generated/icons/BracketsSquareIcon.d.ts +1 -1
  56. package/dist/design-system/Icon/__generated/icons/BracketsXIcon.d.ts +1 -1
  57. package/dist/design-system/Icon/__generated/icons/BranchIcon.d.ts +1 -1
  58. package/dist/design-system/Icon/__generated/icons/BriefcaseFillIcon.d.ts +1 -1
  59. package/dist/design-system/Icon/__generated/icons/BriefcaseIcon.d.ts +1 -1
  60. package/dist/design-system/Icon/__generated/icons/CalendarClockIcon.d.ts +1 -1
  61. package/dist/design-system/Icon/__generated/icons/CalendarEventIcon.d.ts +1 -1
  62. package/dist/design-system/Icon/__generated/icons/CalendarIcon.d.ts +1 -1
  63. package/dist/design-system/Icon/__generated/icons/CaretDownSquareIcon.d.ts +1 -1
  64. package/dist/design-system/Icon/__generated/icons/CaretUpSquareIcon.d.ts +1 -1
  65. package/dist/design-system/Icon/__generated/icons/CatalogCloudIcon.d.ts +1 -1
  66. package/dist/design-system/Icon/__generated/icons/CatalogIcon.d.ts +1 -1
  67. package/dist/design-system/Icon/__generated/icons/CatalogOffIcon.d.ts +1 -1
  68. package/dist/design-system/Icon/__generated/icons/ChartLineIcon.d.ts +1 -1
  69. package/dist/design-system/Icon/__generated/icons/CheckCircleBadgeIcon.d.ts +1 -1
  70. package/dist/design-system/Icon/__generated/icons/CheckCircleFillIcon.d.ts +1 -1
  71. package/dist/design-system/Icon/__generated/icons/CheckCircleIcon.d.ts +1 -1
  72. package/dist/design-system/Icon/__generated/icons/CheckIcon.d.ts +1 -1
  73. package/dist/design-system/Icon/__generated/icons/CheckLineIcon.d.ts +1 -1
  74. package/dist/design-system/Icon/__generated/icons/CheckboxIcon.d.ts +1 -1
  75. package/dist/design-system/Icon/__generated/icons/ChecklistIcon.d.ts +1 -1
  76. package/dist/design-system/Icon/__generated/icons/ChevronDoubleDownIcon.d.ts +1 -1
  77. package/dist/design-system/Icon/__generated/icons/ChevronDoubleLeftIcon.d.ts +1 -1
  78. package/dist/design-system/Icon/__generated/icons/ChevronDoubleRightIcon.d.ts +1 -1
  79. package/dist/design-system/Icon/__generated/icons/ChevronDoubleUpIcon.d.ts +1 -1
  80. package/dist/design-system/Icon/__generated/icons/ChevronDownIcon.d.ts +1 -1
  81. package/dist/design-system/Icon/__generated/icons/ChevronLeftIcon.d.ts +1 -1
  82. package/dist/design-system/Icon/__generated/icons/ChevronRightIcon.d.ts +1 -1
  83. package/dist/design-system/Icon/__generated/icons/ChevronUpIcon.d.ts +1 -1
  84. package/dist/design-system/Icon/__generated/icons/CircleIcon.d.ts +1 -1
  85. package/dist/design-system/Icon/__generated/icons/ClipboardIcon.d.ts +1 -1
  86. package/dist/design-system/Icon/__generated/icons/ClockIcon.d.ts +1 -1
  87. package/dist/design-system/Icon/__generated/icons/ClockKeyIcon.d.ts +1 -1
  88. package/dist/design-system/Icon/__generated/icons/CloseIcon.d.ts +1 -1
  89. package/dist/design-system/Icon/__generated/icons/CloudDownloadIcon.d.ts +1 -1
  90. package/dist/design-system/Icon/__generated/icons/CloudIcon.d.ts +1 -1
  91. package/dist/design-system/Icon/__generated/icons/CloudKeyIcon.d.ts +1 -1
  92. package/dist/design-system/Icon/__generated/icons/CloudModelIcon.d.ts +1 -1
  93. package/dist/design-system/Icon/__generated/icons/CloudOffIcon.d.ts +1 -1
  94. package/dist/design-system/Icon/__generated/icons/CloudUploadIcon.d.ts +1 -1
  95. package/dist/design-system/Icon/__generated/icons/CodeIcon.d.ts +1 -1
  96. package/dist/design-system/Icon/__generated/icons/ColorFillIcon.d.ts +1 -1
  97. package/dist/design-system/Icon/__generated/icons/ColumnIcon.d.ts +1 -1
  98. package/dist/design-system/Icon/__generated/icons/ColumnsIcon.d.ts +1 -1
  99. package/dist/design-system/Icon/__generated/icons/ConnectIcon.d.ts +1 -1
  100. package/dist/design-system/Icon/__generated/icons/CopyIcon.d.ts +1 -1
  101. package/dist/design-system/Icon/__generated/icons/CursorIcon.d.ts +1 -1
  102. package/dist/design-system/Icon/__generated/icons/CursorTypeIcon.d.ts +1 -1
  103. package/dist/design-system/Icon/__generated/icons/DIcon.d.ts +1 -1
  104. package/dist/design-system/Icon/__generated/icons/DagIcon.d.ts +1 -1
  105. package/dist/design-system/Icon/__generated/icons/DangerFillIcon.d.ts +1 -1
  106. package/dist/design-system/Icon/__generated/icons/DangerIcon.d.ts +1 -1
  107. package/dist/design-system/Icon/__generated/icons/DashIcon.d.ts +1 -1
  108. package/dist/design-system/Icon/__generated/icons/DashboardIcon.d.ts +1 -1
  109. package/dist/design-system/Icon/__generated/icons/DataIcon.d.ts +1 -1
  110. package/dist/design-system/Icon/__generated/icons/DatabaseIcon.d.ts +1 -1
  111. package/dist/design-system/Icon/__generated/icons/DecimalIcon.d.ts +1 -1
  112. package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.d.ts +1 -1
  113. package/dist/design-system/Icon/__generated/icons/DownloadIcon.d.ts +1 -1
  114. package/dist/design-system/Icon/__generated/icons/DragIcon.d.ts +1 -1
  115. package/dist/design-system/Icon/__generated/icons/ErdIcon.d.ts +1 -1
  116. package/dist/design-system/Icon/__generated/icons/ExpandLessIcon.d.ts +1 -1
  117. package/dist/design-system/Icon/__generated/icons/ExpandMoreIcon.d.ts +1 -1
  118. package/dist/design-system/Icon/__generated/icons/FaceFrownIcon.d.ts +1 -1
  119. package/dist/design-system/Icon/__generated/icons/FaceNeutralIcon.d.ts +1 -1
  120. package/dist/design-system/Icon/__generated/icons/FaceSmileIcon.d.ts +1 -1
  121. package/dist/design-system/Icon/__generated/icons/FileCodeIcon.d.ts +1 -1
  122. package/dist/design-system/Icon/__generated/icons/FileDocumentIcon.d.ts +1 -1
  123. package/dist/design-system/Icon/__generated/icons/FileIcon.d.ts +1 -1
  124. package/dist/design-system/Icon/__generated/icons/FileImageIcon.d.ts +1 -1
  125. package/dist/design-system/Icon/__generated/icons/FileModelIcon.d.ts +1 -1
  126. package/dist/design-system/Icon/__generated/icons/FilterIcon.d.ts +1 -1
  127. package/dist/design-system/Icon/__generated/icons/FloatIcon.d.ts +1 -1
  128. package/dist/design-system/Icon/__generated/icons/FolderBranchIcon.d.ts +1 -1
  129. package/dist/design-system/Icon/__generated/icons/FolderCloudFilledIcon.d.ts +1 -1
  130. package/dist/design-system/Icon/__generated/icons/FolderCloudIcon.d.ts +1 -1
  131. package/dist/design-system/Icon/__generated/icons/FolderFillIcon.d.ts +1 -1
  132. package/dist/design-system/Icon/__generated/icons/FolderIcon.d.ts +1 -1
  133. package/dist/design-system/Icon/__generated/icons/FontIcon.d.ts +1 -1
  134. package/dist/design-system/Icon/__generated/icons/ForkIcon.d.ts +1 -1
  135. package/dist/design-system/Icon/__generated/icons/FullscreenExitIcon.d.ts +1 -1
  136. package/dist/design-system/Icon/__generated/icons/FullscreenIcon.d.ts +1 -1
  137. package/dist/design-system/Icon/__generated/icons/FunctionIcon.d.ts +1 -1
  138. package/dist/design-system/Icon/__generated/icons/GearFillIcon.d.ts +1 -1
  139. package/dist/design-system/Icon/__generated/icons/GearIcon.d.ts +1 -1
  140. package/dist/design-system/Icon/__generated/icons/GiftIcon.d.ts +1 -1
  141. package/dist/design-system/Icon/__generated/icons/GitCommitIcon.d.ts +1 -1
  142. package/dist/design-system/Icon/__generated/icons/GlobeIcon.d.ts +1 -1
  143. package/dist/design-system/Icon/__generated/icons/GridDashIcon.d.ts +1 -1
  144. package/dist/design-system/Icon/__generated/icons/GridIcon.d.ts +1 -1
  145. package/dist/design-system/Icon/__generated/icons/H1Icon.d.ts +1 -1
  146. package/dist/design-system/Icon/__generated/icons/H2Icon.d.ts +1 -1
  147. package/dist/design-system/Icon/__generated/icons/H3Icon.d.ts +1 -1
  148. package/dist/design-system/Icon/__generated/icons/HistoryIcon.d.ts +1 -1
  149. package/dist/design-system/Icon/__generated/icons/HomeIcon.d.ts +1 -1
  150. package/dist/design-system/Icon/__generated/icons/ImageIcon.d.ts +1 -1
  151. package/dist/design-system/Icon/__generated/icons/IndentDecreaseIcon.d.ts +1 -1
  152. package/dist/design-system/Icon/__generated/icons/IndentIncreaseIcon.d.ts +1 -1
  153. package/dist/design-system/Icon/__generated/icons/InfinityIcon.d.ts +1 -1
  154. package/dist/design-system/Icon/__generated/icons/InfoFillIcon.d.ts +1 -1
  155. package/dist/design-system/Icon/__generated/icons/InfoIcon.d.ts +1 -1
  156. package/dist/design-system/Icon/__generated/icons/IngestionIcon.d.ts +1 -1
  157. package/dist/design-system/Icon/__generated/icons/ItalicIcon.d.ts +1 -1
  158. package/dist/design-system/Icon/__generated/icons/KeyIcon.d.ts +1 -1
  159. package/dist/design-system/Icon/__generated/icons/KeyboardIcon.d.ts +1 -1
  160. package/dist/design-system/Icon/__generated/icons/LayerGraphIcon.d.ts +1 -1
  161. package/dist/design-system/Icon/__generated/icons/LayerIcon.d.ts +1 -1
  162. package/dist/design-system/Icon/__generated/icons/LettersIcon.d.ts +1 -1
  163. package/dist/design-system/Icon/__generated/icons/LibrariesIcon.d.ts +1 -1
  164. package/dist/design-system/Icon/__generated/icons/LightningIcon.d.ts +1 -1
  165. package/dist/design-system/Icon/__generated/icons/LinkIcon.d.ts +1 -1
  166. package/dist/design-system/Icon/__generated/icons/LinkOffIcon.d.ts +1 -1
  167. package/dist/design-system/Icon/__generated/icons/ListBorderIcon.d.ts +1 -1
  168. package/dist/design-system/Icon/__generated/icons/ListClearIcon.d.ts +1 -1
  169. package/dist/design-system/Icon/__generated/icons/ListIcon.d.ts +1 -1
  170. package/dist/design-system/Icon/__generated/icons/LoadingIcon.d.ts +1 -1
  171. package/dist/design-system/Icon/__generated/icons/LockFillIcon.d.ts +1 -1
  172. package/dist/design-system/Icon/__generated/icons/LockIcon.d.ts +1 -1
  173. package/dist/design-system/Icon/__generated/icons/LockUnlockedIcon.d.ts +1 -1
  174. package/dist/design-system/Icon/__generated/icons/MIcon.d.ts +1 -1
  175. package/dist/design-system/Icon/__generated/icons/MailIcon.d.ts +1 -1
  176. package/dist/design-system/Icon/__generated/icons/MegaphoneIcon.d.ts +1 -1
  177. package/dist/design-system/Icon/__generated/icons/MenuIcon.d.ts +1 -1
  178. package/dist/design-system/Icon/__generated/icons/MinusBoxIcon.d.ts +1 -1
  179. package/dist/design-system/Icon/__generated/icons/MinusCircleFillIcon.d.ts +1 -1
  180. package/dist/design-system/Icon/__generated/icons/MinusCircleIcon.d.ts +1 -1
  181. package/dist/design-system/Icon/__generated/icons/ModelsIcon.d.ts +1 -1
  182. package/dist/design-system/Icon/__generated/icons/NewWindowIcon.d.ts +1 -1
  183. package/dist/design-system/Icon/__generated/icons/NoIcon.d.ts +1 -1
  184. package/dist/design-system/Icon/__generated/icons/NotebookIcon.d.ts +1 -1
  185. package/dist/design-system/Icon/__generated/icons/NotificationIcon.d.ts +1 -1
  186. package/dist/design-system/Icon/__generated/icons/NotificationOffIcon.d.ts +1 -1
  187. package/dist/design-system/Icon/__generated/icons/NumbersIcon.d.ts +1 -1
  188. package/dist/design-system/Icon/__generated/icons/OfficeIcon.d.ts +1 -1
  189. package/dist/design-system/Icon/__generated/icons/OverflowIcon.d.ts +1 -1
  190. package/dist/design-system/Icon/__generated/icons/PageBottomIcon.d.ts +1 -1
  191. package/dist/design-system/Icon/__generated/icons/PageFirstIcon.d.ts +1 -1
  192. package/dist/design-system/Icon/__generated/icons/PageLastIcon.d.ts +1 -1
  193. package/dist/design-system/Icon/__generated/icons/PageTopIcon.d.ts +1 -1
  194. package/dist/design-system/Icon/__generated/icons/PauseIcon.d.ts +1 -1
  195. package/dist/design-system/Icon/__generated/icons/PencilIcon.d.ts +1 -1
  196. package/dist/design-system/Icon/__generated/icons/PinCancelIcon.d.ts +1 -1
  197. package/dist/design-system/Icon/__generated/icons/PinFillIcon.d.ts +1 -1
  198. package/dist/design-system/Icon/__generated/icons/PinIcon.d.ts +1 -1
  199. package/dist/design-system/Icon/__generated/icons/PipelineIcon.d.ts +1 -1
  200. package/dist/design-system/Icon/__generated/icons/PlayCircleFillIcon.d.ts +1 -1
  201. package/dist/design-system/Icon/__generated/icons/PlayCircleIcon.d.ts +1 -1
  202. package/dist/design-system/Icon/__generated/icons/PlayIcon.d.ts +1 -1
  203. package/dist/design-system/Icon/__generated/icons/PlugIcon.d.ts +1 -1
  204. package/dist/design-system/Icon/__generated/icons/PlusCircleFillIcon.d.ts +1 -1
  205. package/dist/design-system/Icon/__generated/icons/PlusCircleIcon.d.ts +1 -1
  206. package/dist/design-system/Icon/__generated/icons/PlusIcon.d.ts +1 -1
  207. package/dist/design-system/Icon/__generated/icons/PlusSquareIcon.d.ts +1 -1
  208. package/dist/design-system/Icon/__generated/icons/QueryEditorIcon.d.ts +1 -1
  209. package/dist/design-system/Icon/__generated/icons/QueryIcon.d.ts +1 -1
  210. package/dist/design-system/Icon/__generated/icons/QuestionMarkFillIcon.d.ts +1 -1
  211. package/dist/design-system/Icon/__generated/icons/QuestionMarkIcon.d.ts +1 -1
  212. package/dist/design-system/Icon/__generated/icons/QuestionMarkSpeechBubbleIcon.d.ts +1 -1
  213. package/dist/design-system/Icon/__generated/icons/ReaderModeIcon.d.ts +1 -1
  214. package/dist/design-system/Icon/__generated/icons/RedoIcon.d.ts +1 -1
  215. package/dist/design-system/Icon/__generated/icons/RefreshIcon.d.ts +1 -1
  216. package/dist/design-system/Icon/__generated/icons/RobotIcon.d.ts +1 -1
  217. package/dist/design-system/Icon/__generated/icons/RunningIcon.d.ts +5 -0
  218. package/dist/design-system/Icon/__generated/icons/RunningIcon.d.ts.map +1 -0
  219. package/dist/design-system/Icon/__generated/icons/SaveIcon.d.ts +1 -1
  220. package/dist/design-system/Icon/__generated/icons/SchemaIcon.d.ts +5 -0
  221. package/dist/design-system/Icon/__generated/icons/SchemaIcon.d.ts.map +1 -0
  222. package/dist/design-system/Icon/__generated/icons/SchoolIcon.d.ts +1 -1
  223. package/dist/design-system/Icon/__generated/icons/SearchIcon.d.ts +1 -1
  224. package/dist/design-system/Icon/__generated/icons/SecurityIcon.d.ts +1 -1
  225. package/dist/design-system/Icon/__generated/icons/SendIcon.d.ts +1 -1
  226. package/dist/design-system/Icon/__generated/icons/ShareIcon.d.ts +1 -1
  227. package/dist/design-system/Icon/__generated/icons/SidebarAutoIcon.d.ts +1 -1
  228. package/dist/design-system/Icon/__generated/icons/SidebarCollapseIcon.d.ts +1 -1
  229. package/dist/design-system/Icon/__generated/icons/SidebarExpandIcon.d.ts +1 -1
  230. package/dist/design-system/Icon/__generated/icons/SidebarIcon.d.ts +1 -1
  231. package/dist/design-system/Icon/__generated/icons/SlidersIcon.d.ts +1 -1
  232. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalAscendingIcon.d.ts +1 -1
  233. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalDescendingIcon.d.ts +1 -1
  234. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalLeftIcon.d.ts +1 -1
  235. package/dist/design-system/Icon/__generated/icons/SortAlphabeticalRightIcon.d.ts +1 -1
  236. package/dist/design-system/Icon/__generated/icons/SortAscendingIcon.d.ts +1 -1
  237. package/dist/design-system/Icon/__generated/icons/SortDescendingIcon.d.ts +1 -1
  238. package/dist/design-system/Icon/__generated/icons/SortUnsortedIcon.d.ts +1 -1
  239. package/dist/design-system/Icon/__generated/icons/SparkleIcon.d.ts +1 -1
  240. package/dist/design-system/Icon/__generated/icons/SpeechBubbleIcon.d.ts +1 -1
  241. package/dist/design-system/Icon/__generated/icons/SpeechBubblePlusIcon.d.ts +1 -1
  242. package/dist/design-system/Icon/__generated/icons/SpeechBubbleQuestionMarkIcon.d.ts +1 -1
  243. package/dist/design-system/Icon/__generated/icons/StarFillIcon.d.ts +1 -1
  244. package/dist/design-system/Icon/__generated/icons/StarIcon.d.ts +1 -1
  245. package/dist/design-system/Icon/__generated/icons/StepIntoIcon.d.ts +1 -1
  246. package/dist/design-system/Icon/__generated/icons/StepOutIcon.d.ts +1 -1
  247. package/dist/design-system/Icon/__generated/icons/StepOverIcon.d.ts +1 -1
  248. package/dist/design-system/Icon/__generated/icons/StopCircleFillIcon.d.ts +1 -1
  249. package/dist/design-system/Icon/__generated/icons/StopCircleIcon.d.ts +1 -1
  250. package/dist/design-system/Icon/__generated/icons/StopIcon.d.ts +1 -1
  251. package/dist/design-system/Icon/__generated/icons/StorefrontIcon.d.ts +1 -1
  252. package/dist/design-system/Icon/__generated/icons/StreamIcon.d.ts +1 -1
  253. package/dist/design-system/Icon/__generated/icons/SyncIcon.d.ts +1 -1
  254. package/dist/design-system/Icon/__generated/icons/TableGlassesIcon.d.ts +1 -1
  255. package/dist/design-system/Icon/__generated/icons/TableIcon.d.ts +1 -1
  256. package/dist/design-system/Icon/__generated/icons/TableLightningIcon.d.ts +1 -1
  257. package/dist/design-system/Icon/__generated/icons/TableOnlineViewIcon.d.ts +1 -1
  258. package/dist/design-system/Icon/__generated/icons/TableStreamIcon.d.ts +1 -1
  259. package/dist/design-system/Icon/__generated/icons/TableVectorIcon.d.ts +1 -1
  260. package/dist/design-system/Icon/__generated/icons/TableViewIcon.d.ts +1 -1
  261. package/dist/design-system/Icon/__generated/icons/TagIcon.d.ts +5 -0
  262. package/dist/design-system/Icon/__generated/icons/TagIcon.d.ts.map +1 -0
  263. package/dist/design-system/Icon/__generated/icons/TargetIcon.d.ts +1 -1
  264. package/dist/design-system/Icon/__generated/icons/TextBoxIcon.d.ts +1 -1
  265. package/dist/design-system/Icon/__generated/icons/ThumbsDownIcon.d.ts +1 -1
  266. package/dist/design-system/Icon/__generated/icons/ThumbsUpIcon.d.ts +1 -1
  267. package/dist/design-system/Icon/__generated/icons/TrashIcon.d.ts +1 -1
  268. package/dist/design-system/Icon/__generated/icons/TreeIcon.d.ts +1 -1
  269. package/dist/design-system/Icon/__generated/icons/UnderlineIcon.d.ts +1 -1
  270. package/dist/design-system/Icon/__generated/icons/UndoIcon.d.ts +1 -1
  271. package/dist/design-system/Icon/__generated/icons/UploadIcon.d.ts +1 -1
  272. package/dist/design-system/Icon/__generated/icons/UsbIcon.d.ts +1 -1
  273. package/dist/design-system/Icon/__generated/icons/UserBadgeIcon.d.ts +1 -1
  274. package/dist/design-system/Icon/__generated/icons/UserCircleIcon.d.ts +1 -1
  275. package/dist/design-system/Icon/__generated/icons/UserGroupIcon.d.ts +1 -1
  276. package/dist/design-system/Icon/__generated/icons/UserIcon.d.ts +1 -1
  277. package/dist/design-system/Icon/__generated/icons/VectorTableIcon.d.ts +1 -1
  278. package/dist/design-system/Icon/__generated/icons/VisibleIcon.d.ts +1 -1
  279. package/dist/design-system/Icon/__generated/icons/VisibleOffIcon.d.ts +1 -1
  280. package/dist/design-system/Icon/__generated/icons/WarningFillIcon.d.ts +1 -1
  281. package/dist/design-system/Icon/__generated/icons/WarningIcon.d.ts +1 -1
  282. package/dist/design-system/Icon/__generated/icons/WorkflowsIcon.d.ts +1 -1
  283. package/dist/design-system/Icon/__generated/icons/WorkspacesIcon.d.ts +1 -1
  284. package/dist/design-system/Icon/__generated/icons/XCircleFillIcon.d.ts +1 -1
  285. package/dist/design-system/Icon/__generated/icons/XCircleIcon.d.ts +1 -1
  286. package/dist/design-system/Icon/__generated/icons/ZoomInIcon.d.ts +1 -1
  287. package/dist/design-system/Icon/__generated/icons/ZoomMarqueeSelection.d.ts +1 -1
  288. package/dist/design-system/Icon/__generated/icons/ZoomOutIcon.d.ts +1 -1
  289. package/dist/design-system/Icon/__generated/icons/index.d.ts +3 -0
  290. package/dist/design-system/Icon/__generated/icons/index.d.ts.map +1 -1
  291. package/dist/design-system/Input/Group.d.ts.map +1 -1
  292. package/dist/design-system/Input/Input.d.ts.map +1 -1
  293. package/dist/design-system/Input/common.d.ts +3 -2
  294. package/dist/design-system/Input/common.d.ts.map +1 -1
  295. package/dist/design-system/LegacySelect/LegacySelect.d.ts +66 -0
  296. package/dist/design-system/LegacySelect/LegacySelect.d.ts.map +1 -0
  297. package/dist/design-system/LegacySelect/index.d.ts +2 -0
  298. package/dist/design-system/LegacySelect/index.d.ts.map +1 -0
  299. package/dist/design-system/Modal/Modal.d.ts +4 -3
  300. package/dist/design-system/Modal/Modal.d.ts.map +1 -1
  301. package/dist/design-system/Radio/Radio.d.ts +2 -1
  302. package/dist/design-system/Radio/Radio.d.ts.map +1 -1
  303. package/dist/design-system/SegmentedControl/SegmentedControl.d.ts +1 -0
  304. package/dist/design-system/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  305. package/dist/design-system/Select/Select.d.ts +7 -59
  306. package/dist/design-system/Select/Select.d.ts.map +1 -1
  307. package/dist/design-system/Select/SelectContent.d.ts +10 -0
  308. package/dist/design-system/Select/SelectContent.d.ts.map +1 -0
  309. package/dist/design-system/Select/SelectOption.d.ts +10 -0
  310. package/dist/design-system/Select/SelectOption.d.ts.map +1 -0
  311. package/dist/design-system/Select/SelectOptionGroup.d.ts +11 -0
  312. package/dist/design-system/Select/SelectOptionGroup.d.ts.map +1 -0
  313. package/dist/design-system/Select/SelectTrigger.d.ts +10 -0
  314. package/dist/design-system/Select/SelectTrigger.d.ts.map +1 -0
  315. package/dist/design-system/Select/SimpleSelect.d.ts +33 -0
  316. package/dist/design-system/Select/SimpleSelect.d.ts.map +1 -0
  317. package/dist/design-system/Select/hooks/useSelectContext.d.ts.map +1 -0
  318. package/dist/design-system/Select/index.d.ts +5 -0
  319. package/dist/design-system/Select/index.d.ts.map +1 -1
  320. package/dist/design-system/Select/providers/SelectContext.d.ts.map +1 -0
  321. package/dist/design-system/Sidebar/Sidebar.d.ts +6 -2
  322. package/dist/design-system/Sidebar/Sidebar.d.ts.map +1 -1
  323. package/dist/design-system/TableUI/Table.d.ts.map +1 -1
  324. package/dist/design-system/Tooltip/Tooltip.d.ts.map +1 -1
  325. package/dist/design-system/TypeaheadCombobox/TypeaheadComboboxControls.d.ts +1 -0
  326. package/dist/design-system/TypeaheadCombobox/TypeaheadComboboxControls.d.ts.map +1 -1
  327. package/dist/design-system/TypeaheadCombobox/TypeaheadComboboxInput.d.ts +1 -0
  328. package/dist/design-system/TypeaheadCombobox/TypeaheadComboboxInput.d.ts.map +1 -1
  329. package/dist/design-system/TypeaheadCombobox/hooks/downshiftHookWrappers.d.ts +2 -0
  330. package/dist/design-system/TypeaheadCombobox/hooks/downshiftHookWrappers.d.ts.map +1 -1
  331. package/dist/design-system/Typography/Hint.d.ts +2 -2
  332. package/dist/design-system/Typography/Hint.d.ts.map +1 -1
  333. package/dist/design-system/Typography/Link.d.ts +2 -2
  334. package/dist/design-system/Typography/Link.d.ts.map +1 -1
  335. package/dist/design-system/Typography/Paragraph.d.ts +2 -2
  336. package/dist/design-system/Typography/Paragraph.d.ts.map +1 -1
  337. package/dist/design-system/Typography/Text.d.ts +2 -2
  338. package/dist/design-system/Typography/Text.d.ts.map +1 -1
  339. package/dist/design-system/Typography/Title.d.ts +2 -2
  340. package/dist/design-system/Typography/Title.d.ts.map +1 -1
  341. package/dist/design-system/Typography/Typography.d.ts +1 -1
  342. package/dist/design-system/Typography/index.d.ts +5 -0
  343. package/dist/design-system/Typography/index.d.ts.map +1 -1
  344. package/dist/design-system/Wizard/Wizard.d.ts +24 -4
  345. package/dist/design-system/Wizard/Wizard.d.ts.map +1 -1
  346. package/dist/design-system/Wizard/WizardFooter.d.ts +3 -2
  347. package/dist/design-system/Wizard/WizardFooter.d.ts.map +1 -1
  348. package/dist/design-system/Wizard/WizardModal.d.ts.map +1 -1
  349. package/dist/design-system/Wizard/WizardStep.d.ts +2 -2
  350. package/dist/design-system/Wizard/WizardStep.d.ts.map +1 -1
  351. package/dist/design-system/Wizard/WizardStepsContent.d.ts +2 -1
  352. package/dist/design-system/Wizard/WizardStepsContent.d.ts.map +1 -1
  353. package/dist/design-system/_shared_/Menu/index.d.ts +5 -0
  354. package/dist/design-system/_shared_/Menu/index.d.ts.map +1 -0
  355. package/dist/design-system/index.d.ts +2 -1
  356. package/dist/design-system/index.d.ts.map +1 -1
  357. package/dist/design-system/types.d.ts +27 -0
  358. package/dist/design-system/types.d.ts.map +1 -1
  359. package/dist/design-system/utils/debug.d.ts +8 -0
  360. package/dist/design-system/utils/debug.d.ts.map +1 -0
  361. package/dist/design-system/utils/index.d.ts +1 -0
  362. package/dist/design-system/utils/index.d.ts.map +1 -1
  363. package/dist/design-system/utils/useCallbackOnceUntilReset.d.ts +20 -0
  364. package/dist/design-system/utils/useCallbackOnceUntilReset.d.ts.map +1 -0
  365. package/dist/design-system/utils/useIsomorphicLayoutEffect.d.ts +16 -0
  366. package/dist/design-system/utils/useIsomorphicLayoutEffect.d.ts.map +1 -0
  367. package/dist/design-system/utils/useMediaQuery.d.ts +31 -0
  368. package/dist/design-system/utils/useMediaQuery.d.ts.map +1 -0
  369. package/dist/development/Banner/Banner.d.ts +3 -13
  370. package/dist/development/Banner/Banner.d.ts.map +1 -1
  371. package/dist/development/PillControl/PillControl.d.ts +13 -0
  372. package/dist/development/PillControl/PillControl.d.ts.map +1 -0
  373. package/dist/development/PillControl/index.d.ts +2 -0
  374. package/dist/development/PillControl/index.d.ts.map +1 -0
  375. package/dist/development/PreviewCard/PreviewCard.d.ts +14 -0
  376. package/dist/development/PreviewCard/PreviewCard.d.ts.map +1 -0
  377. package/dist/development/PreviewCard/index.d.ts +2 -0
  378. package/dist/development/PreviewCard/index.d.ts.map +1 -0
  379. package/dist/development/Progress/Progress.d.ts +10 -0
  380. package/dist/development/Progress/Progress.d.ts.map +1 -0
  381. package/dist/development/Progress/hooks/useProgressContext.d.ts +2 -0
  382. package/dist/development/Progress/hooks/useProgressContext.d.ts.map +1 -0
  383. package/dist/development/Progress/index.d.ts +2 -0
  384. package/dist/development/Progress/index.d.ts.map +1 -0
  385. package/dist/development/Progress/providers/ProgressContex.d.ts +10 -0
  386. package/dist/development/Progress/providers/ProgressContex.d.ts.map +1 -0
  387. package/dist/development/Stepper/Stepper.d.ts +2 -2
  388. package/dist/development/Stepper/Stepper.d.ts.map +1 -1
  389. package/dist/development/index.d.ts +2 -0
  390. package/dist/development/index.d.ts.map +1 -1
  391. package/dist/development.js +314 -82
  392. package/dist/development.js.map +1 -1
  393. package/dist/dubois-colors.less +7 -3
  394. package/dist/index-dark.css +8 -0
  395. package/dist/index.css +44 -39
  396. package/dist/index.js +1973 -1066
  397. package/dist/index.js.map +1 -1
  398. package/dist/test-utils/enzyme/selectEvent.d.ts +2 -2
  399. package/dist/test-utils/enzyme/selectEvent.d.ts.map +1 -1
  400. package/dist/test-utils/enzyme.js.map +1 -1
  401. package/dist/test-utils/rtl/selectEvent.d.ts +2 -2
  402. package/dist/test-utils/rtl/selectEvent.d.ts.map +1 -1
  403. package/dist/test-utils/rtl.js +3 -3
  404. package/dist/test-utils/rtl.js.map +1 -1
  405. package/dist/theme/_generated/SemanticColors-Dark.d.ts.map +1 -1
  406. package/dist/theme/_generated/SemanticColors-Light.d.ts.map +1 -1
  407. package/dist/theme/_generated/ValidSemanticColors.d.ts +2 -0
  408. package/dist/theme/_generated/ValidSemanticColors.d.ts.map +1 -1
  409. package/package.json +9 -7
  410. package/dist/Stepper-839336b1.js.map +0 -1
  411. package/dist/design-system/SelectV2/Select.d.ts +0 -7
  412. package/dist/design-system/SelectV2/Select.d.ts.map +0 -1
  413. package/dist/design-system/SelectV2/SelectContent.d.ts +0 -6
  414. package/dist/design-system/SelectV2/SelectContent.d.ts.map +0 -1
  415. package/dist/design-system/SelectV2/SelectOption.d.ts +0 -6
  416. package/dist/design-system/SelectV2/SelectOption.d.ts.map +0 -1
  417. package/dist/design-system/SelectV2/SelectOptionGroup.d.ts +0 -7
  418. package/dist/design-system/SelectV2/SelectOptionGroup.d.ts.map +0 -1
  419. package/dist/design-system/SelectV2/SelectTrigger.d.ts +0 -6
  420. package/dist/design-system/SelectV2/SelectTrigger.d.ts.map +0 -1
  421. package/dist/design-system/SelectV2/hooks/useSelectContext.d.ts.map +0 -1
  422. package/dist/design-system/SelectV2/index.d.ts +0 -6
  423. package/dist/design-system/SelectV2/index.d.ts.map +0 -1
  424. package/dist/design-system/SelectV2/providers/SelectContext.d.ts.map +0 -1
  425. /package/dist/design-system/{SelectV2 → Select}/hooks/useSelectContext.d.ts +0 -0
  426. /package/dist/design-system/{SelectV2 → Select}/providers/SelectContext.d.ts +0 -0
@@ -1,7 +1,7 @@
1
- import React__default, { createContext, useContext, useMemo, useEffect, useState, forwardRef, useRef, useLayoutEffect, useImperativeHandle } from 'react';
1
+ import React__default, { useRef, useEffect, createContext, useContext, useMemo, useState, forwardRef, useLayoutEffect, useImperativeHandle, useCallback } from 'react';
2
2
  import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
3
3
  import { useTheme, ThemeProvider, css, keyframes } from '@emotion/react';
4
- import { notification, ConfigProvider, Button as Button$1, Typography as Typography$1, Input as Input$2 } from 'antd';
4
+ import { notification, ConfigProvider, Typography as Typography$1, Button as Button$1, Input as Input$2 } from 'antd';
5
5
  import AntDIcon from '@ant-design/icons';
6
6
  import _isNil from 'lodash/isNil';
7
7
  import _endsWith from 'lodash/endsWith';
@@ -190,6 +190,8 @@ let ValidSemanticColors = /*#__PURE__*/function (ValidSemanticColors) {
190
190
  ValidSemanticColors["BorderWarning"] = "borderWarning";
191
191
  ValidSemanticColors["CodeBackground"] = "codeBackground";
192
192
  ValidSemanticColors["OverlayOverlay"] = "overlayOverlay";
193
+ ValidSemanticColors["ProgressFill"] = "progressFill";
194
+ ValidSemanticColors["ProgressTrack"] = "progressTrack";
193
195
  ValidSemanticColors["Skeleton"] = "skeleton";
194
196
  ValidSemanticColors["TableBackgroundSelectedDefault"] = "tableBackgroundSelectedDefault";
195
197
  ValidSemanticColors["TableBackgroundSelectedHover"] = "tableBackgroundSelectedHover";
@@ -397,6 +399,72 @@ const getBottomOnlyShadowScrollStyles = function getBottomOnlyShadowScrollStyles
397
399
  return getBottomOnlyShadowScrollStylesMemoized(theme, backgroundColor);
398
400
  };
399
401
 
402
+ // Define a module-global observer and a WeakMap on elements to hold callbacks
403
+ let sharedObserver = null;
404
+ const entryCallbackMap = new WeakMap();
405
+ const ensureSharedObserverExists = () => {
406
+ if (!sharedObserver) {
407
+ sharedObserver = new IntersectionObserver(entries => {
408
+ entries.forEach(entry => {
409
+ if (entry.isIntersecting) {
410
+ const entryCallback = entryCallbackMap.get(entry.target);
411
+ if (entryCallback) {
412
+ entryCallback();
413
+ entryCallbackMap.delete(entry.target);
414
+ }
415
+ }
416
+ });
417
+ });
418
+ }
419
+ };
420
+ function observeElement(element, callback) {
421
+ var _sharedObserver;
422
+ ensureSharedObserverExists();
423
+ entryCallbackMap.set(element, callback);
424
+ (_sharedObserver = sharedObserver) === null || _sharedObserver === void 0 || _sharedObserver.observe(element);
425
+ return () => {
426
+ if (element) {
427
+ var _sharedObserver2;
428
+ (_sharedObserver2 = sharedObserver) === null || _sharedObserver2 === void 0 || _sharedObserver2.unobserve(element);
429
+ entryCallbackMap.delete(element);
430
+ }
431
+ };
432
+ }
433
+ /**
434
+ * Checks if the element was viewed and calls the onView callback.
435
+ * NOTE: This hook only triggers the onView callback once for the element.
436
+ * @param onView - callback to be called when the element is viewed
437
+ * @typeParam T - extends Element to specify the type of element being observed
438
+ */
439
+ const useNotifyOnFirstView = _ref => {
440
+ let {
441
+ onView
442
+ } = _ref;
443
+ const isViewedRef = useRef(false);
444
+ const elementRef = useRef(null);
445
+ useEffect(() => {
446
+ const element = elementRef.current;
447
+ // If already viewed or element is not available, do nothing
448
+ if (!element || isViewedRef.current) {
449
+ return;
450
+ }
451
+ const callback = () => {
452
+ isViewedRef.current = true;
453
+ onView();
454
+ };
455
+
456
+ // If IntersectionObserver is not available, assume that the element is visible
457
+ if (!window.IntersectionObserver) {
458
+ callback();
459
+ return;
460
+ }
461
+ return observeElement(element, callback);
462
+ }, [onView]);
463
+ return {
464
+ elementRef
465
+ };
466
+ };
467
+
400
468
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
401
469
  var _ref2 = process.env.NODE_ENV === "production" ? {
402
470
  name: "g8zzui",
@@ -593,6 +661,8 @@ const darkColorList = {
593
661
  borderWarning: primitiveColors.yellow500,
594
662
  codeBackground: primitiveColors.grey650,
595
663
  overlayOverlay: 'rgba(31, 38, 45, 0.7200)',
664
+ progressFill: primitiveColors.grey600,
665
+ progressTrack: primitiveColors.grey700,
596
666
  skeleton: 'rgba(144, 164, 181, 0.1600)',
597
667
  tableBackgroundSelectedDefault: 'rgba(189, 205, 219, 0.0800)',
598
668
  tableBackgroundSelectedHover: 'rgba(189, 205, 219, 0.1200)',
@@ -607,7 +677,7 @@ const darkColorList = {
607
677
  tagIconHover: primitiveColors.grey350,
608
678
  tagIconPress: primitiveColors.grey350,
609
679
  tagIndigo: 'rgba(67, 74, 147, 0.8600)',
610
- tagInverse: primitiveColors.grey100,
680
+ tagInverse: primitiveColors.grey800,
611
681
  tagLemon: 'rgba(250, 203, 102, 0.8600)',
612
682
  tagLime: 'rgba(48, 134, 19, 0.8600)',
613
683
  tagPink: 'rgba(180, 80, 145, 0.8600)',
@@ -693,6 +763,8 @@ const lightColorList = {
693
763
  borderWarning: primitiveColors.yellow300,
694
764
  codeBackground: 'rgba(68, 83, 95, 0.0800)',
695
765
  overlayOverlay: 'rgba(64, 63, 63, 0.7200)',
766
+ progressFill: primitiveColors.grey300,
767
+ progressTrack: primitiveColors.grey100,
696
768
  skeleton: 'rgba(144, 164, 181, 0.1600)',
697
769
  tableBackgroundSelectedDefault: 'rgba(68, 83, 95, 0.0800)',
698
770
  tableBackgroundSelectedHover: 'rgba(68, 83, 95, 0.1200)',
@@ -718,7 +790,7 @@ const lightColorList = {
718
790
  tagTurquoise: primitiveColors.turquoise,
719
791
  textPlaceholder: primitiveColors.grey400,
720
792
  textPrimary: primitiveColors.grey800,
721
- textSecondary: primitiveColors.grey600,
793
+ textSecondary: primitiveColors.grey500,
722
794
  textValidationDanger: primitiveColors.red600,
723
795
  textValidationSuccess: primitiveColors.green600,
724
796
  textValidationWarning: primitiveColors.yellow600,
@@ -1310,7 +1382,6 @@ function SvgCursorIcon(props) {
1310
1382
  })
1311
1383
  }), jsx("defs", {
1312
1384
  children: jsx("clipPath", {
1313
- id: "CursorIcon_svg__a",
1314
1385
  children: jsx("path", {
1315
1386
  fill: "#fff",
1316
1387
  d: "M16 0H0v16h16z"
@@ -1378,7 +1449,6 @@ function SvgFaceFrownIcon(props) {
1378
1449
  })]
1379
1450
  }), jsx("defs", {
1380
1451
  children: jsx("clipPath", {
1381
- id: "FaceFrownIcon_svg__a",
1382
1452
  children: jsx("path", {
1383
1453
  fill: "#fff",
1384
1454
  d: "M0 0h16v16H0z"
@@ -1417,7 +1487,6 @@ function SvgFaceNeutralIcon(props) {
1417
1487
  })]
1418
1488
  }), jsx("defs", {
1419
1489
  children: jsx("clipPath", {
1420
- id: "FaceNeutralIcon_svg__a",
1421
1490
  children: jsx("path", {
1422
1491
  fill: "#fff",
1423
1492
  d: "M0 0h16v16H0z"
@@ -1460,7 +1529,6 @@ function SvgFaceSmileIcon(props) {
1460
1529
  })]
1461
1530
  }), jsx("defs", {
1462
1531
  children: jsx("clipPath", {
1463
- id: "FaceSmileIcon_svg__a",
1464
1532
  children: jsx("path", {
1465
1533
  fill: "#fff",
1466
1534
  d: "M0 0h16v16H0z"
@@ -1587,1248 +1655,1256 @@ const WarningIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
1587
1655
  WarningIcon.displayName = 'WarningIcon';
1588
1656
  var WarningIcon$1 = WarningIcon;
1589
1657
 
1590
- function getDefaultStyles(theme) {
1591
- let loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1592
- const defaultStyles = {
1593
- backgroundColor: theme.colors.actionDefaultBackgroundDefault,
1594
- borderColor: theme.colors.actionDefaultBorderDefault,
1595
- color: theme.colors.actionDefaultTextDefault
1596
- };
1597
- return {
1598
- ...defaultStyles,
1599
- lineHeight: theme.typography.lineHeightBase,
1600
- textDecoration: 'none',
1601
- '&:hover': {
1602
- backgroundColor: theme.colors.actionDefaultBackgroundHover,
1603
- borderColor: theme.colors.actionDefaultBorderHover,
1604
- color: theme.colors.actionDefaultTextHover
1605
- },
1606
- '&:active': {
1607
- backgroundColor: loading ? theme.colors.actionDefaultBackgroundDefault : theme.colors.actionDefaultBackgroundPress,
1608
- borderColor: theme.colors.actionDefaultBorderPress,
1609
- color: theme.colors.actionDefaultTextPress
1658
+ const {
1659
+ Text: AntDText$1
1660
+ } = Typography$1;
1661
+ function getTextEmotionStyles$1(theme, props) {
1662
+ return /*#__PURE__*/css({
1663
+ '&&': {
1664
+ display: 'block',
1665
+ fontSize: theme.typography.fontSizeSm,
1666
+ lineHeight: theme.typography.lineHeightSm,
1667
+ color: theme.colors.textSecondary,
1668
+ ...(props.withoutMargins && {
1669
+ '&&': {
1670
+ marginTop: 0,
1671
+ marginBottom: 0
1672
+ }
1673
+ })
1610
1674
  }
1611
- };
1675
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getTextEmotionStyles;");
1612
1676
  }
1613
- function getPrimaryStyles(theme) {
1614
- const defaultStyles = {
1615
- backgroundColor: theme.colors.actionPrimaryBackgroundDefault,
1616
- borderColor: 'transparent',
1617
- color: theme.colors.actionPrimaryTextDefault
1618
- };
1619
- return {
1620
- ...defaultStyles,
1621
- textShadow: 'none',
1622
- '&:hover': {
1623
- backgroundColor: theme.colors.actionPrimaryBackgroundHover,
1624
- borderColor: 'transparent',
1625
- color: theme.colors.actionPrimaryTextHover
1626
- },
1627
- '&:active': {
1628
- backgroundColor: theme.colors.actionPrimaryBackgroundPress,
1629
- borderColor: 'transparent',
1630
- color: theme.colors.actionPrimaryTextPress
1631
- }
1632
- };
1677
+ function Hint(userProps) {
1678
+ const {
1679
+ dangerouslySetAntdProps,
1680
+ bold,
1681
+ withoutMargins,
1682
+ color,
1683
+ ...props
1684
+ } = userProps;
1685
+ const {
1686
+ theme
1687
+ } = useDesignSystemTheme();
1688
+ return jsx(DesignSystemAntDConfigProvider, {
1689
+ children: jsx(AntDText$1, {
1690
+ ...props,
1691
+ css: getTextEmotionStyles$1(theme, userProps),
1692
+ ...dangerouslySetAntdProps
1693
+ })
1694
+ });
1633
1695
  }
1634
- function getLinkStyles$1(theme) {
1635
- const defaultStyles = {
1636
- backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
1637
- borderColor: theme.colors.actionTertiaryBackgroundDefault,
1638
- color: theme.colors.actionTertiaryTextDefault
1639
- };
1640
- return {
1641
- ...defaultStyles,
1642
- '&:hover': {
1643
- backgroundColor: theme.colors.actionTertiaryBackgroundHover,
1644
- borderColor: 'transparent',
1645
- color: theme.colors.actionTertiaryTextHover
1696
+
1697
+ const getLinkStyles$1 = (theme, clsPrefix) => {
1698
+ const classTypography = `.${clsPrefix}-typography`;
1699
+ const styles = {
1700
+ [`&${classTypography}, &${classTypography}:focus`]: {
1701
+ color: theme.colors.actionTertiaryTextDefault
1646
1702
  },
1647
- '&:active': {
1648
- backgroundColor: theme.colors.actionTertiaryBackgroundPress,
1649
- borderColor: 'transparent',
1650
- color: theme.colors.actionTertiaryTextPress
1703
+ [`&${classTypography}:hover, &${classTypography}:hover .anticon`]: {
1704
+ color: theme.colors.actionTertiaryTextHover,
1705
+ textDecoration: 'underline'
1651
1706
  },
1652
- '&[disabled]:hover': {
1653
- background: 'none',
1654
- color: theme.colors.actionDisabledText
1655
- }
1656
- };
1657
- }
1658
- function getPrimaryDangerStyles(theme) {
1659
- const defaultStyles = {
1660
- backgroundColor: theme.colors.actionDangerPrimaryBackgroundDefault,
1661
- borderColor: 'transparent',
1662
- color: theme.colors.actionPrimaryTextDefault
1663
- };
1664
- return {
1665
- ...defaultStyles,
1666
- '&:hover': {
1667
- backgroundColor: theme.colors.actionDangerPrimaryBackgroundHover,
1668
- borderColor: 'transparent',
1669
- color: theme.colors.actionPrimaryTextHover
1707
+ [`&${classTypography}:active, &${classTypography}:active .anticon`]: {
1708
+ color: theme.colors.actionTertiaryTextPress,
1709
+ textDecoration: 'underline'
1670
1710
  },
1671
- '&:active': {
1672
- backgroundColor: theme.colors.actionDangerPrimaryBackgroundPress,
1673
- borderColor: 'transparent',
1674
- color: theme.colors.actionPrimaryTextPress
1711
+ [`&${classTypography}:focus-visible`]: {
1712
+ textDecoration: 'underline'
1675
1713
  },
1676
- '&:focus-visible': {
1677
- outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault
1714
+ '.anticon': {
1715
+ fontSize: 12,
1716
+ verticalAlign: 'baseline'
1678
1717
  }
1679
1718
  };
1680
- }
1681
- function getSecondaryDangerStyles(theme) {
1682
- const defaultStyles = {
1683
- backgroundColor: theme.colors.actionDangerDefaultBackgroundDefault,
1684
- borderColor: theme.colors.actionDangerDefaultBorderDefault,
1685
- color: theme.colors.actionDangerDefaultTextDefault
1719
+ return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getLinkStyles;");
1720
+ };
1721
+ const getEllipsisNewTabLinkStyles = () => {
1722
+ const styles = {
1723
+ paddingRight: 'calc(2px + 1em)',
1724
+ // 1em for icon
1725
+ position: 'relative'
1686
1726
  };
1687
- return {
1688
- ...defaultStyles,
1689
- '&:hover': {
1690
- backgroundColor: theme.colors.actionDangerDefaultBackgroundHover,
1691
- borderColor: theme.colors.actionDangerDefaultBorderHover,
1692
- color: theme.colors.actionDangerDefaultTextHover
1693
- },
1694
- '&:active': {
1695
- backgroundColor: theme.colors.actionDangerDefaultBackgroundPress,
1696
- borderColor: theme.colors.actionDangerDefaultBorderPress,
1697
- color: theme.colors.actionDangerDefaultTextPress
1698
- },
1699
- '&:focus-visible': {
1700
- outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault
1701
- }
1727
+ return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getEllipsisNewTabLinkStyles;");
1728
+ };
1729
+ const getIconStyles = theme => {
1730
+ const styles = {
1731
+ marginLeft: 2,
1732
+ color: theme.colors.actionTertiaryTextDefault
1702
1733
  };
1703
- }
1704
- function getDisabledStyles(theme) {
1705
- const defaultStyles = {
1706
- backgroundColor: theme.colors.actionDisabledBackground,
1707
- borderColor: 'transparent',
1708
- color: theme.colors.actionDisabledText
1734
+ return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getIconStyles;");
1735
+ };
1736
+ const getEllipsisIconStyles = useNewIcons => {
1737
+ const styles = {
1738
+ position: 'absolute',
1739
+ right: 0,
1740
+ bottom: 0,
1741
+ top: 0,
1742
+ display: 'flex',
1743
+ alignItems: 'center',
1744
+ ...(useNewIcons && {
1745
+ fontSize: 12
1746
+ })
1709
1747
  };
1710
- return {
1711
- ...defaultStyles,
1712
- '&:hover': {
1713
- backgroundColor: theme.colors.actionDisabledBackground,
1714
- borderColor: 'transparent',
1715
- color: theme.colors.actionDisabledText
1716
- },
1717
- '&:active': {
1718
- backgroundColor: theme.colors.actionDisabledBackground,
1719
- borderColor: 'transparent',
1720
- color: theme.colors.actionDisabledText
1721
- }
1748
+ return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getEllipsisIconStyles;");
1749
+ };
1750
+ const Link = /*#__PURE__*/forwardRef(function Link(_ref, ref) {
1751
+ let {
1752
+ dangerouslySetAntdProps,
1753
+ ...props
1754
+ } = _ref;
1755
+ const {
1756
+ children,
1757
+ openInNewTab,
1758
+ ...restProps
1759
+ } = props;
1760
+ const {
1761
+ theme,
1762
+ classNamePrefix
1763
+ } = useDesignSystemTheme();
1764
+ const newTabProps = {
1765
+ rel: 'noopener noreferrer',
1766
+ target: '_blank'
1722
1767
  };
1723
- }
1724
- function getDisabledTertiaryStyles(theme) {
1725
- const defaultStyles = {
1726
- backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
1727
- borderColor: 'transparent',
1728
- color: theme.colors.actionDisabledText
1768
+ const linkProps = openInNewTab ? {
1769
+ ...restProps,
1770
+ ...newTabProps
1771
+ } : {
1772
+ ...restProps
1729
1773
  };
1730
- return {
1731
- ...defaultStyles,
1732
- '&:hover': {
1733
- backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
1734
- borderColor: 'transparent',
1735
- color: theme.colors.actionDisabledText
1774
+ const linkStyles = props.ellipsis && openInNewTab ? [getLinkStyles$1(theme, classNamePrefix), getEllipsisNewTabLinkStyles()] : getLinkStyles$1(theme, classNamePrefix);
1775
+ const iconStyles = props.ellipsis ? [getIconStyles(theme), getEllipsisIconStyles()] : getIconStyles(theme);
1776
+ return jsx(DesignSystemAntDConfigProvider, {
1777
+ children: jsxs(Typography$1.Link, {
1778
+ "aria-disabled": linkProps.disabled,
1779
+ css: linkStyles,
1780
+ ref: ref,
1781
+ ...linkProps,
1782
+ ...dangerouslySetAntdProps,
1783
+ children: [children, openInNewTab ? jsx(NewWindowIcon$1, {
1784
+ css: iconStyles,
1785
+ ...newTabProps
1786
+ }) : null]
1787
+ })
1788
+ });
1789
+ });
1790
+
1791
+ const {
1792
+ Paragraph: AntDParagraph
1793
+ } = Typography$1;
1794
+ function getParagraphEmotionStyles(theme, props) {
1795
+ return /*#__PURE__*/css({
1796
+ '&&': {
1797
+ fontSize: theme.typography.fontSizeBase,
1798
+ fontWeight: theme.typography.typographyRegularFontWeight,
1799
+ lineHeight: theme.typography.lineHeightBase,
1800
+ color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
1736
1801
  },
1737
- '&:active': {
1738
- backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
1739
- borderColor: 'transparent',
1802
+ '& .anticon': {
1803
+ verticalAlign: 'text-bottom'
1804
+ }
1805
+ }, props.disabled && {
1806
+ '&&': {
1740
1807
  color: theme.colors.actionDisabledText
1741
1808
  }
1742
- };
1743
- }
1744
-
1745
- let DesignSystemEventProviderComponentTypes = /*#__PURE__*/function (DesignSystemEventProviderComponentTypes) {
1746
- DesignSystemEventProviderComponentTypes["Banner"] = "banner";
1747
- DesignSystemEventProviderComponentTypes["Button"] = "button";
1748
- DesignSystemEventProviderComponentTypes["Input"] = "input";
1749
- return DesignSystemEventProviderComponentTypes;
1750
- }({});
1751
- let DesignSystemEventProviderAnalyticsEventTypes = /*#__PURE__*/function (DesignSystemEventProviderAnalyticsEventTypes) {
1752
- DesignSystemEventProviderAnalyticsEventTypes["OnClick"] = "onClick";
1753
- DesignSystemEventProviderAnalyticsEventTypes["OnView"] = "onView";
1754
- DesignSystemEventProviderAnalyticsEventTypes["OnValueChange"] = "onValueChange";
1755
- return DesignSystemEventProviderAnalyticsEventTypes;
1756
- }({});
1757
- const shouldTriggerCallback = (eventType, analyticsEvents) => {
1758
- return analyticsEvents.includes(eventType);
1759
- };
1760
- const DefaultEmptyCallbacks = {
1761
- callback: () => {}
1762
- };
1763
- const DesignSystemEventProviderContext = /*#__PURE__*/React__default.createContext(DefaultEmptyCallbacks);
1764
-
1765
- /**
1766
- * This gets the event provider, which is used to pass callbacks to the design system for events such as onClick, onView, and onValueChange.
1767
- * If the value is undefined, then the expected behavior is to not emit any events.
1768
- *
1769
- * @returns DesignSystemEventProviderContextType
1770
- */
1771
- const useDesignSystemEventProviderContext = () => {
1772
- return useContext(DesignSystemEventProviderContext);
1773
- };
1774
-
1775
- /**
1776
- * NOTE: This is not suggested for direct usage from engineers, and should emit your own events.
1777
- * See https://databricks.atlassian.net/wiki/spaces/UN/pages/2533556277/Usage+Logging+in+UI#Send-usage-logging-from-UI for more details.
1778
- *
1779
- * This gets the event provider component event type callbacks.
1780
- * If context & componentId are not undefined, then it will check if the event is in analyticsEvents or the default analyticsEvents for that component.
1781
- * If the context or componentId are undefined, then the expected behavior is to not emit any events.
1782
- *
1783
- * @returns Object of event callbacks
1784
- */
1785
- const useDesignSystemEventComponentCallbacks = _ref => {
1786
- let {
1787
- componentType,
1788
- componentId,
1789
- analyticsEvents
1790
- } = _ref;
1791
- const context = useDesignSystemEventProviderContext();
1792
- const callbacks = useMemo(() => {
1793
- if (context === DefaultEmptyCallbacks || componentId === undefined) {
1794
- return {
1795
- onClick: () => {},
1796
- onValueChange: () => {},
1797
- onView: () => {}
1798
- };
1809
+ }, props.withoutMargins && {
1810
+ '&&': {
1811
+ marginTop: 0,
1812
+ marginBottom: 0
1799
1813
  }
1800
- return {
1801
- onClick: () => {
1802
- if (shouldTriggerCallback(DesignSystemEventProviderAnalyticsEventTypes.OnClick, analyticsEvents)) {
1803
- context.callback(DesignSystemEventProviderAnalyticsEventTypes.OnClick, componentType, componentId);
1804
- }
1805
- },
1806
- onValueChange: () => {
1807
- if (shouldTriggerCallback(DesignSystemEventProviderAnalyticsEventTypes.OnValueChange, analyticsEvents)) {
1808
- context.callback(DesignSystemEventProviderAnalyticsEventTypes.OnValueChange, componentType, componentId);
1809
- }
1810
- },
1811
- onView: () => {
1812
- if (shouldTriggerCallback(DesignSystemEventProviderAnalyticsEventTypes.OnView, analyticsEvents)) {
1813
- context.callback(DesignSystemEventProviderAnalyticsEventTypes.OnView, componentType, componentId);
1814
- }
1815
- }
1816
- };
1817
- }, [context, componentType, componentId, analyticsEvents]);
1818
- return callbacks;
1819
- };
1820
-
1821
- /**
1822
- * NOTE: This is not suggested for direct usage from engineers, and should use RecordEventContext instead.
1823
- * See https://databricks.atlassian.net/wiki/spaces/UN/pages/2533556277/Usage+Logging+in+UI#Send-usage-logging-from-UI for more details.
1824
- *
1825
- * This is the Design System Event Context Provider, and is only used to pass callbacks to the design system for events such as onClick, onView, and onValueChange.
1826
- *
1827
- * @param children Children react elements
1828
- * @param callback The event callback function
1829
- * @returns Design System Event Context Provider with the children inside
1830
- */
1831
- function DesignSystemEventProvider(_ref2) {
1832
- let {
1833
- children,
1834
- callback
1835
- } = _ref2;
1836
- const contextValue = useMemo(() => {
1837
- return {
1838
- callback
1839
- };
1840
- }, [callback]);
1841
- return jsx(DesignSystemEventProviderContext.Provider, {
1842
- value: contextValue,
1843
- children: children
1844
- });
1845
- }
1846
-
1847
- // Use Symbol to correctly handled null/undefined as stable values
1848
- const NOT_INITIALIZED = Symbol('NOT_INITIALIZED');
1849
-
1850
- /**
1851
- * Use to keep a stable value on the first mount of a component
1852
- * that cannot change.
1853
- */
1854
- function useStable(valueCallback) {
1855
- const ref = useRef(NOT_INITIALIZED);
1856
- if (ref.current === NOT_INITIALIZED) {
1857
- const val = valueCallback();
1858
- ref.current = val;
1859
- return val;
1860
- }
1861
- return ref.current;
1862
- }
1863
- let sequentialCounter = 0;
1864
- function useStableUid() {
1865
- return useStable(() => sequentialCounter++);
1814
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getParagraphEmotionStyles;");
1866
1815
  }
1867
-
1868
- /** Props for UI components that support a "loading" state. */
1869
-
1870
- /**
1871
- * A handler for integrating UI components with external latency instrumentation.
1872
- * If provided via `LoadingStateContext`, hooks will be called whenever child
1873
- * components in a "loading" state are mounted and unmounted.
1874
- */
1875
-
1876
- const LoadingStateContext = /*#__PURE__*/createContext(null);
1877
- /**
1878
- * Indicates that the containing component is in a "loading" state, i.e. that the UI
1879
- * displayed to the user is semantically equivalent to them seeing a spinner or a
1880
- * loading indicator. This means that the UI is not in its final settled state yet.
1881
- *
1882
- * All components that are in a "loading" state should render a `<LoadingState>`
1883
- * component, preferrably with an appropriate description.
1884
- *
1885
- * By itself, `<LoadingState>` doesn't do anything, but if used within `LoadingStateContext`,
1886
- * it will call the provided `startLoading()`/`endLoading()` hooks when the component
1887
- * is mounted/unmounted, which can be used to integrate existing latency instrumentation.
1888
- */
1889
- const LoadingState = _ref => {
1890
- let {
1891
- description = 'Generic UI loading state'
1892
- } = _ref;
1893
- const uid = useStableUid();
1894
- const loadingStateContext = useContext(LoadingStateContext);
1895
- useLayoutEffect(() => {
1896
- // mount
1897
- if (loadingStateContext) {
1898
- loadingStateContext.startLoading(uid, description);
1899
- }
1900
- return () => {
1901
- // unmount
1902
- if (loadingStateContext) {
1903
- loadingStateContext.endLoading(uid);
1904
- }
1905
- };
1906
- }, [uid, description, loadingStateContext]);
1907
- return null;
1908
- };
1909
-
1910
- const rotate = keyframes({
1911
- '0%': {
1912
- transform: 'rotate(0deg) translate3d(0, 0, 0)'
1913
- },
1914
- '100%': {
1915
- transform: 'rotate(360deg) translate3d(0, 0, 0)'
1916
- }
1917
- });
1918
- const cssSpinner = function (theme) {
1919
- let frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
1920
- let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1921
- let animationDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
1922
- let inheritColor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1923
- const styles = {
1924
- animation: `${rotate} ${animationDuration}s steps(${frameRate}, end) infinite`,
1925
- ...(inheritColor ? {
1926
- color: 'inherit'
1927
- } : {
1928
- color: theme.colors.textSecondary
1929
- }),
1930
- animationDelay: `${delay}s`,
1931
- '@media only percy': {
1932
- animation: 'none'
1933
- }
1934
- };
1935
- return /*#__PURE__*/css(importantify(styles), process.env.NODE_ENV === "production" ? "" : ";label:cssSpinner;");
1936
- };
1937
- const Spinner = _ref => {
1938
- let {
1939
- frameRate,
1940
- size = 'default',
1941
- delay,
1942
- className: propClass,
1943
- label,
1944
- animationDuration,
1945
- inheritColor,
1946
- loading = true,
1947
- loadingDescription = 'Spinner',
1816
+ function Paragraph(userProps) {
1817
+ const {
1818
+ dangerouslySetAntdProps,
1819
+ withoutMargins,
1820
+ color,
1948
1821
  ...props
1949
- } = _ref;
1822
+ } = userProps;
1950
1823
  const {
1951
- classNamePrefix,
1952
1824
  theme
1953
1825
  } = useDesignSystemTheme();
1954
-
1955
- // We use Antd classes to keep styling unchanged
1956
- // TODO(FEINF-1407): We want to move away from Antd classes and use Emotion for styling in the future
1957
- const sizeSuffix = size === 'small' ? '-sm' : size === 'large' ? '-lg' : '';
1958
- const sizeClass = sizeSuffix ? `${classNamePrefix}-spin${sizeSuffix}` : '';
1959
- const wrapperClass = `${propClass || ''} ${classNamePrefix}-spin ${sizeClass} ${classNamePrefix}-spin-spinning ${DU_BOIS_ENABLE_ANIMATION_CLASSNAME}`.trim();
1960
- const className = `${classNamePrefix}-spin-dot ${DU_BOIS_ENABLE_ANIMATION_CLASSNAME}`.trim();
1961
- return (
1962
- // className has to follow {...props}, otherwise is `css` prop is passed down it will overwrite our className
1963
- jsxs("div", {
1826
+ return jsx(DesignSystemAntDConfigProvider, {
1827
+ children: jsx(AntDParagraph, {
1964
1828
  ...props,
1965
- className: wrapperClass,
1966
- children: [loading && jsx(LoadingState, {
1967
- description: loadingDescription
1968
- }), jsx(AccessibleContainer, {
1969
- label: label,
1970
- children: jsx(LoadingIcon$1, {
1971
- "aria-hidden": "false",
1972
- css: cssSpinner(theme, frameRate, delay, animationDuration, inheritColor),
1973
- className: className
1974
- })
1975
- })]
1829
+ className: props.className,
1830
+ css: getParagraphEmotionStyles(theme, userProps),
1831
+ ...dangerouslySetAntdProps
1976
1832
  })
1977
- );
1978
- };
1833
+ });
1834
+ }
1979
1835
 
1980
- /**
1981
- * Provides access to http://go/safex flags from the frontend. Note that this is a temporary
1982
- * workaround until direct `safex` imports are available.
1983
- * @param flag The name of the flag to check
1984
- * @param defaultValue The default value to return if the flag is not set
1985
- * @returns
1986
- */
1987
- const safex = (flag, defaultValue) => {
1988
- // Catching errors here, because we don't have type-safety to ensure
1989
- // that `__debug__safex`'s API hasn't changed.
1990
- try {
1991
- const globalSafex = window.__debug__safex;
1992
- return globalSafex ? globalSafex(flag, defaultValue) : defaultValue;
1993
- } catch (e) {
1994
- return defaultValue;
1995
- }
1996
- };
1836
+ const {
1837
+ Text: AntDText
1838
+ } = Typography$1;
1839
+ function getTextEmotionStyles(theme, props) {
1840
+ return /*#__PURE__*/css({
1841
+ '&&': {
1842
+ fontSize: theme.typography.fontSizeBase,
1843
+ fontWeight: theme.typography.typographyRegularFontWeight,
1844
+ lineHeight: theme.typography.lineHeightBase,
1845
+ color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
1846
+ }
1847
+ }, props.disabled && {
1848
+ '&&': {
1849
+ color: theme.colors.actionDisabledText
1850
+ }
1851
+ }, props.hint && {
1852
+ '&&': {
1853
+ fontSize: theme.typography.fontSizeSm,
1854
+ lineHeight: theme.typography.lineHeightSm
1855
+ }
1856
+ }, props.bold && {
1857
+ '&&': {
1858
+ fontSize: theme.typography.fontSizeBase,
1859
+ fontWeight: theme.typography.typographyBoldFontWeight,
1860
+ lineHeight: theme.typography.lineHeightBase
1861
+ }
1862
+ }, props.code && {
1863
+ '&& > code': {
1864
+ color: theme.colors.textPrimary,
1865
+ fontSize: theme.typography.fontSizeBase,
1866
+ lineHeight: theme.typography.lineHeightBase,
1867
+ background: theme.colors.typographyCodeBg,
1868
+ fontFamily: 'monospace',
1869
+ borderRadius: theme.borders.borderRadiusMd,
1870
+ padding: '2px 4px',
1871
+ border: 'unset',
1872
+ margin: 0
1873
+ }
1874
+ }, props.size && {
1875
+ '&&': (() => {
1876
+ switch (props.size) {
1877
+ case 'xxl':
1878
+ return {
1879
+ fontSize: theme.typography.fontSizeXxl,
1880
+ lineHeight: theme.typography.lineHeightXxl,
1881
+ '& .anticon': {
1882
+ lineHeight: theme.typography.lineHeightXxl,
1883
+ verticalAlign: 'middle'
1884
+ }
1885
+ };
1886
+ case 'xl':
1887
+ return {
1888
+ fontSize: theme.typography.fontSizeXl,
1889
+ lineHeight: theme.typography.lineHeightXl,
1890
+ '& .anticon': {
1891
+ lineHeight: theme.typography.lineHeightXl,
1892
+ verticalAlign: 'middle'
1893
+ }
1894
+ };
1895
+ case 'lg':
1896
+ return {
1897
+ fontSize: theme.typography.fontSizeLg,
1898
+ lineHeight: theme.typography.lineHeightLg,
1899
+ '& .anticon': {
1900
+ lineHeight: theme.typography.lineHeightLg,
1901
+ verticalAlign: 'middle'
1902
+ }
1903
+ };
1904
+ case 'sm':
1905
+ return {
1906
+ fontSize: theme.typography.fontSizeSm,
1907
+ lineHeight: theme.typography.lineHeightSm,
1908
+ '& .anticon': {
1909
+ verticalAlign: '-0.219em'
1910
+ }
1911
+ };
1912
+ default:
1913
+ return {};
1914
+ }
1915
+ })()
1916
+ }, props.withoutMargins && {
1917
+ '&&': {
1918
+ marginTop: 0,
1919
+ marginBottom: 0
1920
+ }
1921
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getTextEmotionStyles;");
1922
+ }
1923
+ function Text(userProps) {
1924
+ // Omit props that are not supported by `antd`
1925
+ const {
1926
+ dangerouslySetAntdProps,
1927
+ bold,
1928
+ hint,
1929
+ withoutMargins,
1930
+ color,
1931
+ ...props
1932
+ } = userProps;
1933
+ const {
1934
+ theme
1935
+ } = useDesignSystemTheme();
1936
+ return jsx(DesignSystemAntDConfigProvider, {
1937
+ children: jsx(AntDText, {
1938
+ ...props,
1939
+ className: props.className,
1940
+ css: getTextEmotionStyles(theme, userProps),
1941
+ ...dangerouslySetAntdProps
1942
+ })
1943
+ });
1944
+ }
1997
1945
 
1998
- function getEndIconClsName(theme) {
1999
- return `${theme.general.iconfontCssPrefix}-btn-end-icon`;
1946
+ const {
1947
+ Title: AntDTitle
1948
+ } = Typography$1;
1949
+ function getLevelStyles(theme, props) {
1950
+ switch (props.level) {
1951
+ case 1:
1952
+ return /*#__PURE__*/css({
1953
+ '&&': {
1954
+ fontSize: theme.typography.fontSizeXxl,
1955
+ lineHeight: theme.typography.lineHeightXxl,
1956
+ fontWeight: theme.typography.typographyBoldFontWeight
1957
+ },
1958
+ '& > .anticon': {
1959
+ lineHeight: theme.typography.lineHeightXxl
1960
+ }
1961
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
1962
+ case 2:
1963
+ return /*#__PURE__*/css({
1964
+ '&&': {
1965
+ fontSize: theme.typography.fontSizeXl,
1966
+ lineHeight: theme.typography.lineHeightXl,
1967
+ fontWeight: theme.typography.typographyBoldFontWeight
1968
+ },
1969
+ '& > .anticon': {
1970
+ lineHeight: theme.typography.lineHeightXl
1971
+ }
1972
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
1973
+ case 3:
1974
+ return /*#__PURE__*/css({
1975
+ '&&': {
1976
+ fontSize: theme.typography.fontSizeLg,
1977
+ lineHeight: theme.typography.lineHeightLg,
1978
+ fontWeight: theme.typography.typographyBoldFontWeight
1979
+ },
1980
+ '& > .anticon': {
1981
+ lineHeight: theme.typography.lineHeightLg
1982
+ }
1983
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
1984
+ case 4:
1985
+ default:
1986
+ return /*#__PURE__*/css({
1987
+ '&&': {
1988
+ fontSize: theme.typography.fontSizeMd,
1989
+ lineHeight: theme.typography.lineHeightMd,
1990
+ fontWeight: theme.typography.typographyBoldFontWeight
1991
+ },
1992
+ '& > .anticon': {
1993
+ lineHeight: theme.typography.lineHeightMd
1994
+ }
1995
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
1996
+ }
2000
1997
  }
2001
- const getButtonEmotionStyles = _ref => {
2002
- let {
2003
- theme,
2004
- classNamePrefix,
2005
- loading,
2006
- withIcon,
2007
- onlyIcon,
2008
- isAnchor,
2009
- enableAnimation,
2010
- size,
2011
- type,
2012
- isFlex,
2013
- useFocusPseudoClass,
2014
- forceIconStyles,
2015
- danger
2016
- } = _ref;
2017
- const clsIcon = `.${theme.general.iconfontCssPrefix}`;
2018
- const clsEndIcon = `.${getEndIconClsName(theme)}`;
2019
- const clsLoadingIcon = `.${classNamePrefix}-btn-loading-icon`;
2020
- const clsIconOnly = `.${classNamePrefix}-btn-icon-only`;
2021
- const classPrimary = `.${classNamePrefix}-btn-primary`;
2022
- const classLink = `.${classNamePrefix}-btn-link`;
2023
- const classDangerous = `.${classNamePrefix}-btn-dangerous`;
2024
- const SMALL_BUTTON_HEIGHT = 24;
2025
- const tertiaryColors = {
2026
- background: theme.colors.actionTertiaryBackgroundDefault,
2027
- color: theme.colors.actionTertiaryTextDefault,
2028
- '&:hover': {
2029
- background: theme.colors.actionTertiaryBackgroundHover,
2030
- color: theme.colors.actionTertiaryTextHover
1998
+ function getTitleEmotionStyles(theme, props) {
1999
+ return /*#__PURE__*/css(getLevelStyles(theme, props), {
2000
+ '&&': {
2001
+ color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
2031
2002
  },
2032
- '&:active': {
2033
- background: theme.colors.actionTertiaryBackgroundPress,
2034
- color: theme.colors.actionTertiaryTextPress
2003
+ '& > .anticon': {
2004
+ verticalAlign: 'middle'
2035
2005
  }
2036
- };
2037
- const iconCss = {
2038
- fontSize: theme.general.iconFontSize,
2039
- ...(!isFlex && {
2040
- // verticalAlign used by AntD to move icon and label to center
2041
- // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
2042
- // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
2043
- verticalAlign: -4,
2044
- ...(onlyIcon && {
2045
- verticalAlign: -3
2046
- }),
2047
- // verticalAlign used by AntD to move icon and label to center
2048
- // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
2049
- // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
2050
- // Need to make sure not to apply this to regular buttons as it will offset the icons
2051
- ...(!onlyIcon && {
2052
- verticalAlign: -3
2053
- })
2054
- }),
2055
- lineHeight: 0,
2056
- ...(size === 'small' && {
2057
- lineHeight: theme.typography.lineHeightSm,
2058
- ...((onlyIcon || forceIconStyles) && {
2059
- fontSize: 16,
2060
- ...(isFlex && {
2061
- height: 16
2062
- })
2063
- })
2006
+ }, props.withoutMargins && {
2007
+ '&&': {
2008
+ marginTop: '0 !important',
2009
+ // override general styling
2010
+ marginBottom: '0 !important' // override general styling
2011
+ }
2012
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getTitleEmotionStyles;");
2013
+ }
2014
+ function Title(userProps) {
2015
+ const {
2016
+ dangerouslySetAntdProps,
2017
+ withoutMargins,
2018
+ color,
2019
+ ...props
2020
+ } = userProps;
2021
+ const {
2022
+ theme
2023
+ } = useDesignSystemTheme();
2024
+ return jsx(DesignSystemAntDConfigProvider, {
2025
+ children: jsx(AntDTitle, {
2026
+ ...props,
2027
+ className: props.className,
2028
+ css: getTitleEmotionStyles(theme, userProps),
2029
+ ...dangerouslySetAntdProps
2064
2030
  })
2031
+ });
2032
+ }
2033
+
2034
+ const Typography = /* #__PURE__ */(() => {
2035
+ function Typography(_ref) {
2036
+ let {
2037
+ dangerouslySetAntdProps,
2038
+ ...props
2039
+ } = _ref;
2040
+ return jsx(DesignSystemAntDConfigProvider, {
2041
+ children: jsx(Typography$1, {
2042
+ ...props,
2043
+ ...dangerouslySetAntdProps
2044
+ })
2045
+ });
2046
+ }
2047
+ Typography.Text = Text;
2048
+ Typography.Title = Title;
2049
+ Typography.Paragraph = Paragraph;
2050
+ Typography.Link = Link;
2051
+ Typography.Hint = Hint;
2052
+ return Typography;
2053
+ })();
2054
+
2055
+ function getDefaultStyles(theme) {
2056
+ let loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2057
+ const defaultStyles = {
2058
+ backgroundColor: theme.colors.actionDefaultBackgroundDefault,
2059
+ borderColor: theme.colors.actionDefaultBorderDefault,
2060
+ color: theme.colors.actionDefaultTextDefault
2065
2061
  };
2066
- const inactiveIconCss = {
2067
- color: theme.colors.textSecondary
2068
- };
2069
- const endIconCssSelector = `span > ${clsEndIcon} > ${clsIcon}`;
2070
- const styles = {
2062
+ return {
2063
+ ...defaultStyles,
2071
2064
  lineHeight: theme.typography.lineHeightBase,
2072
- boxShadow: 'none',
2073
- height: theme.general.heightSm,
2074
- ...(isFlex && {
2075
- display: 'inline-flex',
2076
- alignItems: 'center',
2077
- justifyContent: 'center',
2078
- verticalAlign: 'middle'
2079
- }),
2080
- ...(!onlyIcon && !forceIconStyles && {
2081
- '&&': {
2082
- padding: '4px 12px',
2083
- ...(size === 'small' && {
2084
- padding: '0 8px'
2085
- })
2086
- }
2087
- }),
2088
- ...((onlyIcon || forceIconStyles) && {
2089
- width: theme.general.heightSm
2090
- }),
2091
- ...(size === 'small' && {
2092
- height: SMALL_BUTTON_HEIGHT,
2093
- lineHeight: theme.typography.lineHeightBase,
2094
- ...((onlyIcon || forceIconStyles) && {
2095
- width: SMALL_BUTTON_HEIGHT,
2096
- paddingTop: 0,
2097
- paddingBottom: 0,
2098
- verticalAlign: 'middle'
2099
- })
2100
- }),
2101
- '&:focus-visible': {
2102
- outlineStyle: 'solid',
2103
- outlineWidth: '2px',
2104
- outlineOffset: '1px',
2105
- outlineColor: theme.isDarkMode ? theme.colors.actionDefaultBorderFocus : theme.colors.primary
2065
+ textDecoration: 'none',
2066
+ '&:hover': {
2067
+ backgroundColor: theme.colors.actionDefaultBackgroundHover,
2068
+ borderColor: theme.colors.actionDefaultBorderHover,
2069
+ color: theme.colors.actionDefaultTextHover
2106
2070
  },
2107
- ...getDefaultStyles(theme, loading),
2108
- [`&${classPrimary}`]: {
2109
- ...getPrimaryStyles(theme)
2071
+ '&:active': {
2072
+ backgroundColor: loading ? theme.colors.actionDefaultBackgroundDefault : theme.colors.actionDefaultBackgroundPress,
2073
+ borderColor: theme.colors.actionDefaultBorderPress,
2074
+ color: theme.colors.actionDefaultTextPress
2075
+ }
2076
+ };
2077
+ }
2078
+ function getPrimaryStyles(theme) {
2079
+ const defaultStyles = {
2080
+ backgroundColor: theme.colors.actionPrimaryBackgroundDefault,
2081
+ borderColor: 'transparent',
2082
+ color: theme.colors.actionPrimaryTextDefault
2083
+ };
2084
+ return {
2085
+ ...defaultStyles,
2086
+ textShadow: 'none',
2087
+ '&:hover': {
2088
+ backgroundColor: theme.colors.actionPrimaryBackgroundHover,
2089
+ borderColor: 'transparent',
2090
+ color: theme.colors.actionPrimaryTextHover
2110
2091
  },
2111
- [`&${classLink}`]: {
2112
- ...getLinkStyles$1(theme),
2113
- ...(type === 'link' && {
2114
- padding: 'unset',
2115
- height: 'auto',
2116
- border: 'none',
2117
- boxShadow: 'none',
2118
- '&[disabled],&:hover': {
2119
- background: 'none'
2120
- }
2121
- })
2092
+ '&:active': {
2093
+ backgroundColor: theme.colors.actionPrimaryBackgroundPress,
2094
+ borderColor: 'transparent',
2095
+ color: theme.colors.actionPrimaryTextPress
2096
+ }
2097
+ };
2098
+ }
2099
+ function getLinkStyles(theme) {
2100
+ const defaultStyles = {
2101
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
2102
+ borderColor: theme.colors.actionTertiaryBackgroundDefault,
2103
+ color: theme.colors.actionTertiaryTextDefault
2104
+ };
2105
+ return {
2106
+ ...defaultStyles,
2107
+ '&:hover': {
2108
+ backgroundColor: theme.colors.actionTertiaryBackgroundHover,
2109
+ borderColor: 'transparent',
2110
+ color: theme.colors.actionTertiaryTextHover
2122
2111
  },
2123
- [`&${classDangerous}${classPrimary}`]: {
2124
- ...getPrimaryDangerStyles(theme)
2112
+ '&:active': {
2113
+ backgroundColor: theme.colors.actionTertiaryBackgroundPress,
2114
+ borderColor: 'transparent',
2115
+ color: theme.colors.actionTertiaryTextPress
2125
2116
  },
2126
- [`&${classDangerous}`]: {
2127
- ...getSecondaryDangerStyles(theme)
2117
+ '&[disabled]:hover': {
2118
+ background: 'none',
2119
+ color: theme.colors.actionDisabledText
2120
+ }
2121
+ };
2122
+ }
2123
+ function getPrimaryDangerStyles(theme) {
2124
+ const defaultStyles = {
2125
+ backgroundColor: theme.colors.actionDangerPrimaryBackgroundDefault,
2126
+ borderColor: 'transparent',
2127
+ color: theme.colors.actionPrimaryTextDefault
2128
+ };
2129
+ return {
2130
+ ...defaultStyles,
2131
+ '&:hover': {
2132
+ backgroundColor: theme.colors.actionDangerPrimaryBackgroundHover,
2133
+ borderColor: 'transparent',
2134
+ color: theme.colors.actionPrimaryTextHover
2128
2135
  },
2129
- [`&[disabled], &${classDangerous}:disabled`]: {
2130
- ...getDisabledStyles(theme),
2131
- ...((onlyIcon || forceIconStyles) && {
2132
- backgroundColor: 'transparent',
2133
- '&:hover': {
2134
- backgroundColor: 'transparent'
2135
- },
2136
- '&:active': {
2137
- backgroundColor: 'transparent'
2138
- }
2139
- })
2136
+ '&:active': {
2137
+ backgroundColor: theme.colors.actionDangerPrimaryBackgroundPress,
2138
+ borderColor: 'transparent',
2139
+ color: theme.colors.actionPrimaryTextPress
2140
2140
  },
2141
- [clsLoadingIcon]: {
2142
- display: 'none'
2141
+ '&:focus-visible': {
2142
+ outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault
2143
+ }
2144
+ };
2145
+ }
2146
+ function getSecondaryDangerStyles(theme) {
2147
+ const defaultStyles = {
2148
+ backgroundColor: theme.colors.actionDangerDefaultBackgroundDefault,
2149
+ borderColor: theme.colors.actionDangerDefaultBorderDefault,
2150
+ color: theme.colors.actionDangerDefaultTextDefault
2151
+ };
2152
+ return {
2153
+ ...defaultStyles,
2154
+ '&:hover': {
2155
+ backgroundColor: theme.colors.actionDangerDefaultBackgroundHover,
2156
+ borderColor: theme.colors.actionDangerDefaultBorderHover,
2157
+ color: theme.colors.actionDangerDefaultTextHover
2143
2158
  },
2144
- // Loading styles
2145
- ...(loading && {
2146
- '::before': {
2147
- opacity: 0
2148
- },
2149
- cursor: 'default',
2150
- [`${clsLoadingIcon}`]: {
2151
- ...(onlyIcon ? {
2152
- // In case of only icon, the icon is already centered but vertically not aligned, this fixes that
2153
- verticalAlign: 'middle'
2154
- } : {
2155
- // Position loading indicator in center
2156
- // This would break vertical centering of loading circle when onlyIcon is true
2157
- position: 'absolute'
2158
- }),
2159
- ...(!isFlex && !forceIconStyles && {
2160
- // Normally we'd do `transform: translateX(-50%)` but `antd` crushes that with injected inline `style`.
2161
- left: 'calc(50% - 7px)'
2162
- }),
2163
- // Re-enable animation for the loading spinner, since it can be disabled by the global animation CSS.
2164
- svg: {
2165
- animationDuration: '1s !important'
2166
- }
2167
- },
2168
- [`& > ${clsLoadingIcon} .anticon`]: {
2169
- paddingRight: 0 // to horizontally center icon
2170
- },
2171
-
2172
- [`> :not(${clsLoadingIcon})`]: {
2173
- // Hide all content except loading icon
2174
- opacity: 0,
2175
- visibility: 'hidden',
2176
- // Add horizontal space for icon
2177
- ...(withIcon && {
2178
- paddingLeft: theme.general.iconFontSize + theme.spacing.xs
2179
- })
2180
- }
2181
- }),
2182
- // Icon styles
2183
- [`> ${clsIcon} + span, > span + ${clsIcon}`]: {
2184
- marginRight: 0,
2185
- marginLeft: theme.spacing.xs
2159
+ '&:active': {
2160
+ backgroundColor: theme.colors.actionDangerDefaultBackgroundPress,
2161
+ borderColor: theme.colors.actionDangerDefaultBorderPress,
2162
+ color: theme.colors.actionDangerDefaultTextPress
2186
2163
  },
2187
- [`> ${clsIcon}`]: iconCss,
2188
- [`> ${endIconCssSelector}`]: {
2189
- ...iconCss,
2190
- marginLeft: theme.spacing.sm
2164
+ '&:focus-visible': {
2165
+ outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault
2166
+ }
2167
+ };
2168
+ }
2169
+ function getDisabledStyles(theme) {
2170
+ const defaultStyles = {
2171
+ backgroundColor: theme.colors.actionDisabledBackground,
2172
+ borderColor: 'transparent',
2173
+ color: theme.colors.actionDisabledText
2174
+ };
2175
+ return {
2176
+ ...defaultStyles,
2177
+ '&:hover': {
2178
+ backgroundColor: theme.colors.actionDisabledBackground,
2179
+ borderColor: 'transparent',
2180
+ color: theme.colors.actionDisabledText
2191
2181
  },
2192
- ...(!type && !danger && {
2193
- [`&:enabled:not(:hover):not(:active) > ${clsIcon}`]: inactiveIconCss
2194
- }),
2195
- ...(!type && !danger && {
2196
- [`&:enabled:not(:hover):not(:active) > ${endIconCssSelector}`]: inactiveIconCss
2197
- }),
2198
- // Disable animations
2199
- [`&[${classNamePrefix}-click-animating-without-extra-node='true']::after`]: {
2200
- display: 'none'
2182
+ '&:active': {
2183
+ backgroundColor: theme.colors.actionDisabledBackground,
2184
+ borderColor: 'transparent',
2185
+ color: theme.colors.actionDisabledText
2186
+ }
2187
+ };
2188
+ }
2189
+ function getDisabledTertiaryStyles(theme) {
2190
+ const defaultStyles = {
2191
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
2192
+ borderColor: 'transparent',
2193
+ color: theme.colors.actionDisabledText
2194
+ };
2195
+ return {
2196
+ ...defaultStyles,
2197
+ '&:hover': {
2198
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
2199
+ borderColor: 'transparent',
2200
+ color: theme.colors.actionDisabledText
2201
2201
  },
2202
- [`&${clsIconOnly}`]: {
2203
- border: 'none',
2204
- [`&:enabled:not(${classLink})`]: {
2205
- ...tertiaryColors,
2206
- color: theme.colors.textSecondary,
2207
- '&:hover > .anticon': {
2208
- color: tertiaryColors['&:hover'].color,
2209
- ...(danger && {
2210
- color: theme.colors.actionDangerDefaultTextHover
2211
- })
2212
- },
2213
- '&:active > .anticon': {
2214
- color: tertiaryColors['&:active'].color,
2215
- ...(danger && {
2216
- color: theme.colors.actionDangerDefaultTextPress
2217
- })
2218
- },
2219
- ...(loading && {
2220
- '&&, &:hover, &:active': {
2221
- backgroundColor: 'transparent'
2222
- }
2223
- })
2224
- },
2225
- [`&:enabled:not(${classLink}) > .anticon`]: {
2226
- color: theme.colors.textSecondary,
2227
- ...(danger && {
2228
- color: theme.colors.actionDangerDefaultTextDefault
2229
- })
2230
- },
2231
- ...(isAnchor && {
2232
- lineHeight: `${theme.general.heightSm}px`,
2233
- ...getLinkStyles$1(theme),
2234
- '&:disabled': {
2235
- color: theme.colors.actionDisabledText
2236
- }
2237
- }),
2238
- ...(loading && {
2239
- '&&, &:hover, &:active': {
2240
- backgroundColor: 'transparent'
2202
+ '&:active': {
2203
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
2204
+ borderColor: 'transparent',
2205
+ color: theme.colors.actionDisabledText
2206
+ }
2207
+ };
2208
+ }
2209
+
2210
+ let DesignSystemEventProviderComponentTypes = /*#__PURE__*/function (DesignSystemEventProviderComponentTypes) {
2211
+ DesignSystemEventProviderComponentTypes["Banner"] = "banner";
2212
+ DesignSystemEventProviderComponentTypes["Button"] = "button";
2213
+ DesignSystemEventProviderComponentTypes["Input"] = "input";
2214
+ DesignSystemEventProviderComponentTypes["Modal"] = "modal";
2215
+ return DesignSystemEventProviderComponentTypes;
2216
+ }({});
2217
+ let DesignSystemEventProviderAnalyticsEventTypes = /*#__PURE__*/function (DesignSystemEventProviderAnalyticsEventTypes) {
2218
+ DesignSystemEventProviderAnalyticsEventTypes["OnClick"] = "onClick";
2219
+ DesignSystemEventProviderAnalyticsEventTypes["OnView"] = "onView";
2220
+ DesignSystemEventProviderAnalyticsEventTypes["OnValueChange"] = "onValueChange";
2221
+ return DesignSystemEventProviderAnalyticsEventTypes;
2222
+ }({});
2223
+ const shouldTriggerCallback = (eventType, analyticsEvents) => {
2224
+ return analyticsEvents.includes(eventType);
2225
+ };
2226
+ const DefaultEmptyCallbacks = {
2227
+ callback: () => {}
2228
+ };
2229
+ const DesignSystemEventProviderContext = /*#__PURE__*/React__default.createContext(DefaultEmptyCallbacks);
2230
+
2231
+ /**
2232
+ * This gets the event provider, which is used to pass callbacks to the design system for events such as onClick, onView, and onValueChange.
2233
+ * If the value is undefined, then the expected behavior is to not emit any events.
2234
+ *
2235
+ * @returns DesignSystemEventProviderContextType
2236
+ */
2237
+ const useDesignSystemEventProviderContext = () => {
2238
+ return useContext(DesignSystemEventProviderContext);
2239
+ };
2240
+
2241
+ /**
2242
+ * NOTE: This is not suggested for direct usage from engineers, and should emit your own events.
2243
+ * See https://databricks.atlassian.net/wiki/spaces/UN/pages/2533556277/Usage+Logging+in+UI#Send-usage-logging-from-UI for more details.
2244
+ *
2245
+ * This gets the event provider component event type callbacks.
2246
+ * If context & componentId are not undefined, then it will check if the event is in analyticsEvents or the default analyticsEvents for that component.
2247
+ * If the context or componentId are undefined, then the expected behavior is to not emit any events.
2248
+ *
2249
+ * @returns Object of event callbacks
2250
+ */
2251
+ const useDesignSystemEventComponentCallbacks = _ref => {
2252
+ let {
2253
+ componentType,
2254
+ componentId,
2255
+ analyticsEvents
2256
+ } = _ref;
2257
+ const context = useDesignSystemEventProviderContext();
2258
+ const callbacks = useMemo(() => {
2259
+ if (context === DefaultEmptyCallbacks || componentId === undefined) {
2260
+ return {
2261
+ onClick: () => {},
2262
+ onValueChange: () => {},
2263
+ onView: () => {}
2264
+ };
2265
+ }
2266
+ return {
2267
+ onClick: () => {
2268
+ if (shouldTriggerCallback(DesignSystemEventProviderAnalyticsEventTypes.OnClick, analyticsEvents)) {
2269
+ context.callback(DesignSystemEventProviderAnalyticsEventTypes.OnClick, componentType, componentId);
2241
2270
  }
2242
- }),
2243
- '&[disabled]:hover': {
2244
- backgroundColor: 'transparent'
2245
- }
2246
- },
2247
- [`&:focus`]: {
2248
- ...(useFocusPseudoClass && {
2249
- outlineStyle: 'solid',
2250
- outlineWidth: '2px',
2251
- outlineOffset: '1px',
2252
- outlineColor: theme.isDarkMode ? theme.colors.actionDefaultBorderFocus : theme.colors.primary
2253
- }),
2254
- [`${clsLoadingIcon}`]: {
2255
- ...(onlyIcon && {
2256
- // Mitigate wrong left offset for loading state with onlyIcon
2257
- left: 0
2258
- })
2259
- }
2260
- },
2261
- ...(forceIconStyles && {
2262
- padding: '0 6px',
2263
- lineHeight: theme.typography.lineHeightSm,
2264
- color: theme.colors.textSecondary,
2265
- ...(loading && {
2266
- '&&, &:hover, &:active': {
2267
- backgroundColor: 'transparent',
2268
- borderColor: theme.colors.actionDefaultBorderDefault
2269
- },
2270
- '&[disabled], &[disabled]:hover, &[disabled]:active': {
2271
- backgroundColor: 'transparent',
2272
- borderColor: 'transparent'
2271
+ },
2272
+ onValueChange: () => {
2273
+ if (shouldTriggerCallback(DesignSystemEventProviderAnalyticsEventTypes.OnValueChange, analyticsEvents)) {
2274
+ context.callback(DesignSystemEventProviderAnalyticsEventTypes.OnValueChange, componentType, componentId);
2273
2275
  }
2274
- }),
2275
- '& > span': {
2276
- verticalAlign: -1,
2277
- height: theme.general.heightSm / 2,
2278
- width: theme.general.heightSm / 2
2279
2276
  },
2280
- [`& > ${clsLoadingIcon} .anticon`]: {
2281
- // left: `calc(50% - 6px)!important`,
2282
- height: theme.general.heightSm / 2,
2283
- width: theme.general.heightSm / 2,
2284
- padding: 0
2285
- }
2286
- }),
2287
- ...getAnimationCss(enableAnimation)
2288
- };
2289
-
2290
- // Moved outside main style object because state & selector matching in the already existing object keys can create bugs and unwanted overwrites
2291
- const typeStyles = {
2292
- ...(type === 'tertiary' && {
2293
- [`&:enabled:not(${clsIconOnly})`]: tertiaryColors,
2294
- [`&${classLink}[disabled]`]: {
2295
- ...getDisabledTertiaryStyles(theme)
2277
+ onView: () => {
2278
+ if (shouldTriggerCallback(DesignSystemEventProviderAnalyticsEventTypes.OnView, analyticsEvents)) {
2279
+ context.callback(DesignSystemEventProviderAnalyticsEventTypes.OnView, componentType, componentId);
2280
+ }
2296
2281
  }
2297
- })
2298
- };
2299
- const importantStyles = importantify(styles);
2300
- const importantTypeStyles = importantify(typeStyles);
2301
- return /*#__PURE__*/css(importantStyles, importantTypeStyles, process.env.NODE_ENV === "production" ? "" : ";label:getButtonEmotionStyles;");
2282
+ };
2283
+ }, [context, componentType, componentId, analyticsEvents]);
2284
+ return callbacks;
2302
2285
  };
2303
- const Button = /* #__PURE__ */(() => {
2304
- const Button = /*#__PURE__*/forwardRef(function Button( // Keep size out of props passed to AntD to make deprecation and eventual removal have 0 impact
2305
- _ref2, ref) {
2306
- let {
2307
- dangerouslySetAntdProps,
2308
- children,
2309
- size,
2310
- type,
2311
- loading,
2312
- loadingDescription = 'Button',
2313
- endIcon,
2314
- onClick,
2315
- dangerouslySetForceIconStyles,
2316
- dangerouslyUseFocusPseudoClass,
2317
- dangerouslyAppendWrapperCss,
2318
- componentId,
2319
- analyticsEvents,
2320
- ...props
2321
- } = _ref2;
2322
- const {
2323
- theme,
2324
- classNamePrefix
2325
- } = useDesignSystemTheme();
2326
- const {
2327
- USE_FLEX_BUTTON: flexOverride
2328
- } = useDesignSystemFlags();
2329
- const eventContext = useDesignSystemEventComponentCallbacks({
2330
- componentType: DesignSystemEventProviderComponentTypes.Button,
2331
- componentId,
2332
- analyticsEvents: analyticsEvents !== null && analyticsEvents !== void 0 ? analyticsEvents : [DesignSystemEventProviderAnalyticsEventTypes.OnClick]
2333
- });
2334
- const flexSafex = safex('databricks.fe.designsystem.useFlexButtonStyles', false);
2335
- const isFlex = flexOverride || flexSafex;
2336
- const clsEndIcon = getEndIconClsName(theme);
2337
- const loadingCls = `${classNamePrefix}-btn-loading-icon`;
2338
- const buttonRef = useRef(null);
2339
- useImperativeHandle(ref, () => buttonRef.current);
2340
2286
 
2341
- // Needed to keep backwards compatibility and support existing unit tests
2342
- useEffect(() => {
2343
- if (buttonRef.current) {
2344
- if (loading) {
2345
- buttonRef.current.setAttribute('loading', 'true');
2346
- buttonRef.current.classList.add(`${classNamePrefix}-btn-loading`);
2347
- } else {
2348
- buttonRef.current.setAttribute('loading', 'false');
2349
- buttonRef.current.classList.remove(`${classNamePrefix}-btn-loading`);
2350
- }
2351
- }
2352
- }, [loading, classNamePrefix]);
2353
- const iconOnly = Boolean((props.icon || endIcon) && !children);
2354
- const handleClick = event => {
2355
- if (loading) {
2356
- return;
2357
- }
2358
- eventContext.onClick();
2359
- onClick === null || onClick === void 0 || onClick(event);
2287
+ /**
2288
+ * NOTE: This is not suggested for direct usage from engineers, and should use RecordEventContext instead.
2289
+ * See https://databricks.atlassian.net/wiki/spaces/UN/pages/2533556277/Usage+Logging+in+UI#Send-usage-logging-from-UI for more details.
2290
+ *
2291
+ * This is the Design System Event Context Provider, and is only used to pass callbacks to the design system for events such as onClick, onView, and onValueChange.
2292
+ *
2293
+ * @param children Children react elements
2294
+ * @param callback The event callback function
2295
+ * @returns Design System Event Context Provider with the children inside
2296
+ */
2297
+ function DesignSystemEventProvider(_ref2) {
2298
+ let {
2299
+ children,
2300
+ callback
2301
+ } = _ref2;
2302
+ const contextValue = useMemo(() => {
2303
+ return {
2304
+ callback
2360
2305
  };
2361
- const loadingSpinner = jsx(Spinner, {
2362
- className: loadingCls,
2363
- animationDuration: 8,
2364
- inheritColor: true,
2365
- label: "loading",
2366
- "aria-label": "loading",
2367
- loadingDescription: loadingDescription,
2368
- css: /*#__PURE__*/css({
2369
- color: 'inherit !important',
2370
- pointerEvents: 'none',
2371
- ...(!iconOnly && !dangerouslySetForceIconStyles && {
2372
- '.anticon': {
2373
- verticalAlign: '-0.2em'
2374
- }
2375
- }),
2376
- '[aria-hidden="true"]': {
2377
- display: 'inline'
2378
- }
2379
- }, process.env.NODE_ENV === "production" ? "" : ";label:loadingSpinner;")
2380
- });
2381
- return jsx(DesignSystemAntDConfigProvider, {
2382
- children: jsx(Button$1, {
2383
- ...props,
2384
- css: getButtonEmotionStyles({
2385
- theme,
2386
- classNamePrefix,
2387
- loading: Boolean(loading),
2388
- withIcon: Boolean(props.icon),
2389
- onlyIcon: iconOnly,
2390
- isAnchor: Boolean(props.href && !type),
2391
- danger: Boolean(props.danger),
2392
- enableAnimation: theme.options.enableAnimation,
2393
- size: size || 'middle',
2394
- type,
2395
- isFlex,
2396
- forceIconStyles: Boolean(dangerouslySetForceIconStyles),
2397
- useFocusPseudoClass: Boolean(dangerouslyUseFocusPseudoClass)
2398
- }),
2399
- href: props.disabled ? undefined : props.href,
2400
- ...dangerouslySetAntdProps,
2401
- onClick: handleClick,
2402
- icon: loading ? loadingSpinner : props.icon,
2403
- ref: buttonRef,
2404
- type: type === 'tertiary' ? 'link' : type,
2405
- children: children && jsxs("span", {
2406
- style: {
2407
- visibility: loading ? 'hidden' : 'visible',
2408
- ...(isFlex && {
2409
- display: 'inline-flex',
2410
- alignItems: 'center'
2411
- }),
2412
- ...dangerouslyAppendWrapperCss
2413
- },
2414
- children: [children, endIcon && jsx("span", {
2415
- className: clsEndIcon,
2416
- style: {
2417
- ...(isFlex && {
2418
- display: 'inline-flex',
2419
- alignItems: 'center'
2420
- })
2421
- },
2422
- children: endIcon
2423
- })]
2424
- })
2425
- })
2426
- });
2306
+ }, [callback]);
2307
+ return jsx(DesignSystemEventProviderContext.Provider, {
2308
+ value: contextValue,
2309
+ children: children
2427
2310
  });
2311
+ }
2428
2312
 
2429
- // This is needed for other Ant components that wrap Button, such as Tooltip, to correctly
2430
- // identify it as an Ant button.
2431
- // This should be removed if the component is rewritten to no longer be a wrapper around Ant.
2432
- // See: https://github.com/ant-design/ant-design/blob/6dd39c1f89b4d6632e6ed022ff1bc275ca1e0f1f/components/button/button.tsx#L291
2433
- Button.__ANT_BUTTON = true;
2434
- return Button;
2435
- })();
2313
+ // Use Symbol to correctly handled null/undefined as stable values
2314
+ const NOT_INITIALIZED = Symbol('NOT_INITIALIZED');
2436
2315
 
2437
- const {
2438
- Text: AntDText$1
2439
- } = Typography$1;
2440
- function getTextEmotionStyles$1(theme, props) {
2441
- return /*#__PURE__*/css({
2442
- '&&': {
2443
- display: 'block',
2444
- fontSize: theme.typography.fontSizeSm,
2445
- lineHeight: theme.typography.lineHeightSm,
2446
- color: theme.colors.textSecondary,
2447
- ...(props.withoutMargins && {
2448
- '&&': {
2449
- marginTop: 0,
2450
- marginBottom: 0
2451
- }
2452
- })
2453
- }
2454
- }, process.env.NODE_ENV === "production" ? "" : ";label:getTextEmotionStyles;");
2316
+ /**
2317
+ * Use to keep a stable value on the first mount of a component
2318
+ * that cannot change.
2319
+ */
2320
+ function useStable(valueCallback) {
2321
+ const ref = useRef(NOT_INITIALIZED);
2322
+ if (ref.current === NOT_INITIALIZED) {
2323
+ const val = valueCallback();
2324
+ ref.current = val;
2325
+ return val;
2326
+ }
2327
+ return ref.current;
2455
2328
  }
2456
- function Hint(userProps) {
2457
- const {
2458
- dangerouslySetAntdProps,
2459
- bold,
2460
- withoutMargins,
2461
- color,
2462
- ...props
2463
- } = userProps;
2464
- const {
2465
- theme
2466
- } = useDesignSystemTheme();
2467
- return jsx(DesignSystemAntDConfigProvider, {
2468
- children: jsx(AntDText$1, {
2469
- ...props,
2470
- css: getTextEmotionStyles$1(theme, userProps),
2471
- ...dangerouslySetAntdProps
2472
- })
2473
- });
2329
+ let sequentialCounter = 0;
2330
+ function useStableUid() {
2331
+ return useStable(() => sequentialCounter++);
2474
2332
  }
2475
2333
 
2476
- const getLinkStyles = (theme, clsPrefix) => {
2477
- const classTypography = `.${clsPrefix}-typography`;
2478
- const styles = {
2479
- [`&${classTypography}, &${classTypography}:focus`]: {
2480
- color: theme.colors.actionTertiaryTextDefault
2481
- },
2482
- [`&${classTypography}:hover, &${classTypography}:hover .anticon`]: {
2483
- color: theme.colors.actionTertiaryTextHover,
2484
- textDecoration: 'underline'
2485
- },
2486
- [`&${classTypography}:active, &${classTypography}:active .anticon`]: {
2487
- color: theme.colors.actionTertiaryTextPress,
2488
- textDecoration: 'underline'
2489
- },
2490
- [`&${classTypography}:focus-visible`]: {
2491
- textDecoration: 'underline'
2492
- },
2493
- '.anticon': {
2494
- fontSize: 12,
2495
- verticalAlign: 'baseline'
2334
+ /** Props for UI components that support a "loading" state. */
2335
+
2336
+ /**
2337
+ * A handler for integrating UI components with external latency instrumentation.
2338
+ * If provided via `LoadingStateContext`, hooks will be called whenever child
2339
+ * components in a "loading" state are mounted and unmounted.
2340
+ */
2341
+
2342
+ const LoadingStateContext = /*#__PURE__*/createContext(null);
2343
+ /**
2344
+ * Indicates that the containing component is in a "loading" state, i.e. that the UI
2345
+ * displayed to the user is semantically equivalent to them seeing a spinner or a
2346
+ * loading indicator. This means that the UI is not in its final settled state yet.
2347
+ *
2348
+ * All components that are in a "loading" state should render a `<LoadingState>`
2349
+ * component, preferrably with an appropriate description.
2350
+ *
2351
+ * By itself, `<LoadingState>` doesn't do anything, but if used within `LoadingStateContext`,
2352
+ * it will call the provided `startLoading()`/`endLoading()` hooks when the component
2353
+ * is mounted/unmounted, which can be used to integrate existing latency instrumentation.
2354
+ */
2355
+ const LoadingState = _ref => {
2356
+ let {
2357
+ description = 'Generic UI loading state'
2358
+ } = _ref;
2359
+ const uid = useStableUid();
2360
+ const loadingStateContext = useContext(LoadingStateContext);
2361
+ useLayoutEffect(() => {
2362
+ // mount
2363
+ if (loadingStateContext) {
2364
+ loadingStateContext.startLoading(uid, description);
2496
2365
  }
2497
- };
2498
- return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getLinkStyles;");
2499
- };
2500
- const getEllipsisNewTabLinkStyles = () => {
2501
- const styles = {
2502
- paddingRight: 'calc(2px + 1em)',
2503
- // 1em for icon
2504
- position: 'relative'
2505
- };
2506
- return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getEllipsisNewTabLinkStyles;");
2366
+ return () => {
2367
+ // unmount
2368
+ if (loadingStateContext) {
2369
+ loadingStateContext.endLoading(uid);
2370
+ }
2371
+ };
2372
+ }, [uid, description, loadingStateContext]);
2373
+ return null;
2507
2374
  };
2508
- const getIconStyles = theme => {
2509
- const styles = {
2510
- marginLeft: 2,
2511
- color: theme.colors.actionTertiaryTextDefault
2512
- };
2513
- return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getIconStyles;");
2514
- };
2515
- const getEllipsisIconStyles = useNewIcons => {
2375
+
2376
+ const rotate = keyframes({
2377
+ '0%': {
2378
+ transform: 'rotate(0deg) translate3d(0, 0, 0)'
2379
+ },
2380
+ '100%': {
2381
+ transform: 'rotate(360deg) translate3d(0, 0, 0)'
2382
+ }
2383
+ });
2384
+ const cssSpinner = function (theme) {
2385
+ let frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
2386
+ let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2387
+ let animationDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2388
+ let inheritColor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
2516
2389
  const styles = {
2517
- position: 'absolute',
2518
- right: 0,
2519
- bottom: 0,
2520
- top: 0,
2521
- display: 'flex',
2522
- alignItems: 'center',
2523
- ...(useNewIcons && {
2524
- fontSize: 12
2525
- })
2390
+ animation: `${rotate} ${animationDuration}s steps(${frameRate}, end) infinite`,
2391
+ ...(inheritColor ? {
2392
+ color: 'inherit'
2393
+ } : {
2394
+ color: theme.colors.textSecondary
2395
+ }),
2396
+ animationDelay: `${delay}s`,
2397
+ '@media only percy': {
2398
+ animation: 'none'
2399
+ }
2526
2400
  };
2527
- return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getEllipsisIconStyles;");
2401
+ return /*#__PURE__*/css(importantify(styles), process.env.NODE_ENV === "production" ? "" : ";label:cssSpinner;");
2528
2402
  };
2529
- const Link = /*#__PURE__*/forwardRef(function Link(_ref, ref) {
2403
+ const Spinner = _ref => {
2530
2404
  let {
2531
- dangerouslySetAntdProps,
2405
+ frameRate,
2406
+ size = 'default',
2407
+ delay,
2408
+ className: propClass,
2409
+ label,
2410
+ animationDuration,
2411
+ inheritColor,
2412
+ loading = true,
2413
+ loadingDescription = 'Spinner',
2532
2414
  ...props
2533
2415
  } = _ref;
2534
2416
  const {
2535
- children,
2536
- openInNewTab,
2537
- ...restProps
2538
- } = props;
2539
- const {
2540
- theme,
2541
- classNamePrefix
2542
- } = useDesignSystemTheme();
2543
- const newTabProps = {
2544
- rel: 'noopener noreferrer',
2545
- target: '_blank'
2546
- };
2547
- const linkProps = openInNewTab ? {
2548
- ...restProps,
2549
- ...newTabProps
2550
- } : {
2551
- ...restProps
2552
- };
2553
- const linkStyles = props.ellipsis && openInNewTab ? [getLinkStyles(theme, classNamePrefix), getEllipsisNewTabLinkStyles()] : getLinkStyles(theme, classNamePrefix);
2554
- const iconStyles = props.ellipsis ? [getIconStyles(theme), getEllipsisIconStyles()] : getIconStyles(theme);
2555
- return jsx(DesignSystemAntDConfigProvider, {
2556
- children: jsxs(Typography$1.Link, {
2557
- "aria-disabled": linkProps.disabled,
2558
- css: linkStyles,
2559
- ref: ref,
2560
- ...linkProps,
2561
- ...dangerouslySetAntdProps,
2562
- children: [children, openInNewTab ? jsx(NewWindowIcon$1, {
2563
- css: iconStyles,
2564
- ...newTabProps
2565
- }) : null]
2566
- })
2567
- });
2568
- });
2569
-
2570
- const {
2571
- Paragraph: AntDParagraph
2572
- } = Typography$1;
2573
- function getParagraphEmotionStyles(theme, props) {
2574
- return /*#__PURE__*/css({
2575
- '&&': {
2576
- fontSize: theme.typography.fontSizeBase,
2577
- fontWeight: theme.typography.typographyRegularFontWeight,
2578
- lineHeight: theme.typography.lineHeightBase,
2579
- color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
2580
- },
2581
- '& .anticon': {
2582
- verticalAlign: 'text-bottom'
2583
- }
2584
- }, props.disabled && {
2585
- '&&': {
2586
- color: theme.colors.actionDisabledText
2587
- }
2588
- }, props.withoutMargins && {
2589
- '&&': {
2590
- marginTop: 0,
2591
- marginBottom: 0
2592
- }
2593
- }, process.env.NODE_ENV === "production" ? "" : ";label:getParagraphEmotionStyles;");
2594
- }
2595
- function Paragraph(userProps) {
2596
- const {
2597
- dangerouslySetAntdProps,
2598
- withoutMargins,
2599
- color,
2600
- ...props
2601
- } = userProps;
2602
- const {
2417
+ classNamePrefix,
2603
2418
  theme
2604
2419
  } = useDesignSystemTheme();
2605
- return jsx(DesignSystemAntDConfigProvider, {
2606
- children: jsx(AntDParagraph, {
2420
+
2421
+ // We use Antd classes to keep styling unchanged
2422
+ // TODO(FEINF-1407): We want to move away from Antd classes and use Emotion for styling in the future
2423
+ const sizeSuffix = size === 'small' ? '-sm' : size === 'large' ? '-lg' : '';
2424
+ const sizeClass = sizeSuffix ? `${classNamePrefix}-spin${sizeSuffix}` : '';
2425
+ const wrapperClass = `${propClass || ''} ${classNamePrefix}-spin ${sizeClass} ${classNamePrefix}-spin-spinning ${DU_BOIS_ENABLE_ANIMATION_CLASSNAME}`.trim();
2426
+ const className = `${classNamePrefix}-spin-dot ${DU_BOIS_ENABLE_ANIMATION_CLASSNAME}`.trim();
2427
+ return (
2428
+ // className has to follow {...props}, otherwise is `css` prop is passed down it will overwrite our className
2429
+ jsxs("div", {
2607
2430
  ...props,
2608
- className: props.className,
2609
- css: getParagraphEmotionStyles(theme, userProps),
2610
- ...dangerouslySetAntdProps
2431
+ className: wrapperClass,
2432
+ children: [loading && jsx(LoadingState, {
2433
+ description: loadingDescription
2434
+ }), jsx(AccessibleContainer, {
2435
+ label: label,
2436
+ children: jsx(LoadingIcon$1, {
2437
+ "aria-hidden": "false",
2438
+ css: cssSpinner(theme, frameRate, delay, animationDuration, inheritColor),
2439
+ className: className
2440
+ })
2441
+ })]
2611
2442
  })
2612
- });
2443
+ );
2444
+ };
2445
+
2446
+ /**
2447
+ * Provides access to http://go/safex flags from the frontend. Note that this is a temporary
2448
+ * workaround until direct `safex` imports are available.
2449
+ * @param flag The name of the flag to check
2450
+ * @param defaultValue The default value to return if the flag is not set
2451
+ * @returns
2452
+ */
2453
+ const safex = (flag, defaultValue) => {
2454
+ // Catching errors here, because we don't have type-safety to ensure
2455
+ // that `__debug__safex`'s API hasn't changed.
2456
+ try {
2457
+ const globalSafex = window.__debug__safex;
2458
+ return globalSafex ? globalSafex(flag, defaultValue) : defaultValue;
2459
+ } catch (e) {
2460
+ return defaultValue;
2461
+ }
2462
+ };
2463
+
2464
+ function addDebugOutlineIfEnabled() {
2465
+ return safex('databricks.fe.designsystem.showDebugOutline', false) ? {
2466
+ 'data-dubois-show-outline': true
2467
+ } : {};
2613
2468
  }
2614
2469
 
2615
- const {
2616
- Text: AntDText
2617
- } = Typography$1;
2618
- function getTextEmotionStyles(theme, props) {
2619
- return /*#__PURE__*/css({
2620
- '&&': {
2621
- fontSize: theme.typography.fontSizeBase,
2622
- fontWeight: theme.typography.typographyRegularFontWeight,
2623
- lineHeight: theme.typography.lineHeightBase,
2624
- color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
2625
- }
2626
- }, props.disabled && {
2627
- '&&': {
2628
- color: theme.colors.actionDisabledText
2629
- }
2630
- }, props.hint && {
2631
- '&&': {
2632
- fontSize: theme.typography.fontSizeSm,
2633
- lineHeight: theme.typography.lineHeightSm
2634
- }
2635
- }, props.bold && {
2636
- '&&': {
2637
- fontSize: theme.typography.fontSizeBase,
2638
- fontWeight: theme.typography.typographyBoldFontWeight,
2639
- lineHeight: theme.typography.lineHeightBase
2640
- }
2641
- }, props.code && {
2642
- '&& > code': {
2643
- color: theme.colors.textPrimary,
2644
- fontSize: theme.typography.fontSizeBase,
2645
- lineHeight: theme.typography.lineHeightBase,
2646
- background: theme.colors.typographyCodeBg,
2647
- fontFamily: 'monospace',
2648
- borderRadius: theme.borders.borderRadiusMd,
2649
- padding: '2px 4px',
2650
- border: 'unset',
2651
- margin: 0
2470
+ function getEndIconClsName(theme) {
2471
+ return `${theme.general.iconfontCssPrefix}-btn-end-icon`;
2472
+ }
2473
+ const getButtonEmotionStyles = _ref => {
2474
+ let {
2475
+ theme,
2476
+ classNamePrefix,
2477
+ loading,
2478
+ withIcon,
2479
+ onlyIcon,
2480
+ isAnchor,
2481
+ enableAnimation,
2482
+ size,
2483
+ type,
2484
+ isFlex,
2485
+ useFocusPseudoClass,
2486
+ forceIconStyles,
2487
+ danger
2488
+ } = _ref;
2489
+ const clsIcon = `.${theme.general.iconfontCssPrefix}`;
2490
+ const clsEndIcon = `.${getEndIconClsName(theme)}`;
2491
+ const clsLoadingIcon = `.${classNamePrefix}-btn-loading-icon`;
2492
+ const clsIconOnly = `.${classNamePrefix}-btn-icon-only`;
2493
+ const classPrimary = `.${classNamePrefix}-btn-primary`;
2494
+ const classLink = `.${classNamePrefix}-btn-link`;
2495
+ const classDangerous = `.${classNamePrefix}-btn-dangerous`;
2496
+ const SMALL_BUTTON_HEIGHT = 24;
2497
+ const tertiaryColors = {
2498
+ background: theme.colors.actionTertiaryBackgroundDefault,
2499
+ color: theme.colors.actionTertiaryTextDefault,
2500
+ '&:hover': {
2501
+ background: theme.colors.actionTertiaryBackgroundHover,
2502
+ color: theme.colors.actionTertiaryTextHover
2503
+ },
2504
+ '&:active': {
2505
+ background: theme.colors.actionTertiaryBackgroundPress,
2506
+ color: theme.colors.actionTertiaryTextPress
2652
2507
  }
2653
- }, props.size && {
2654
- '&&': (() => {
2655
- switch (props.size) {
2656
- case 'xxl':
2657
- return {
2658
- fontSize: theme.typography.fontSizeXxl,
2659
- lineHeight: theme.typography.lineHeightXxl,
2660
- '& .anticon': {
2661
- lineHeight: theme.typography.lineHeightXxl,
2662
- verticalAlign: 'middle'
2663
- }
2664
- };
2665
- case 'xl':
2666
- return {
2667
- fontSize: theme.typography.fontSizeXl,
2668
- lineHeight: theme.typography.lineHeightXl,
2669
- '& .anticon': {
2670
- lineHeight: theme.typography.lineHeightXl,
2671
- verticalAlign: 'middle'
2672
- }
2673
- };
2674
- case 'lg':
2675
- return {
2676
- fontSize: theme.typography.fontSizeLg,
2677
- lineHeight: theme.typography.lineHeightLg,
2678
- '& .anticon': {
2679
- lineHeight: theme.typography.lineHeightLg,
2680
- verticalAlign: 'middle'
2681
- }
2682
- };
2683
- case 'sm':
2684
- return {
2685
- fontSize: theme.typography.fontSizeSm,
2686
- lineHeight: theme.typography.lineHeightSm,
2687
- '& .anticon': {
2688
- verticalAlign: '-0.219em'
2689
- }
2690
- };
2691
- default:
2692
- return {};
2693
- }
2694
- })()
2695
- }, props.withoutMargins && {
2696
- '&&': {
2697
- marginTop: 0,
2698
- marginBottom: 0
2699
- }
2700
- }, process.env.NODE_ENV === "production" ? "" : ";label:getTextEmotionStyles;");
2701
- }
2702
- function Text(userProps) {
2703
- // Omit props that are not supported by `antd`
2704
- const {
2705
- dangerouslySetAntdProps,
2706
- bold,
2707
- hint,
2708
- withoutMargins,
2709
- color,
2710
- ...props
2711
- } = userProps;
2712
- const {
2713
- theme
2714
- } = useDesignSystemTheme();
2715
- return jsx(DesignSystemAntDConfigProvider, {
2716
- children: jsx(AntDText, {
2717
- ...props,
2718
- className: props.className,
2719
- css: getTextEmotionStyles(theme, userProps),
2720
- ...dangerouslySetAntdProps
2508
+ };
2509
+ const iconCss = {
2510
+ fontSize: theme.general.iconFontSize,
2511
+ ...(!isFlex && {
2512
+ // verticalAlign used by AntD to move icon and label to center
2513
+ // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
2514
+ // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
2515
+ verticalAlign: -4,
2516
+ ...(onlyIcon && {
2517
+ verticalAlign: -3
2518
+ }),
2519
+ // verticalAlign used by AntD to move icon and label to center
2520
+ // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
2521
+ // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
2522
+ // Need to make sure not to apply this to regular buttons as it will offset the icons
2523
+ ...(!onlyIcon && {
2524
+ verticalAlign: -3
2525
+ })
2526
+ }),
2527
+ lineHeight: 0,
2528
+ ...(size === 'small' && {
2529
+ lineHeight: theme.typography.lineHeightSm,
2530
+ ...((onlyIcon || forceIconStyles) && {
2531
+ fontSize: 16,
2532
+ ...(isFlex && {
2533
+ height: 16
2534
+ })
2535
+ })
2721
2536
  })
2722
- });
2723
- }
2724
-
2725
- const {
2726
- Title: AntDTitle
2727
- } = Typography$1;
2728
- function getLevelStyles(theme, props) {
2729
- switch (props.level) {
2730
- case 1:
2731
- return /*#__PURE__*/css({
2732
- '&&': {
2733
- fontSize: theme.typography.fontSizeXxl,
2734
- lineHeight: theme.typography.lineHeightXxl,
2735
- fontWeight: theme.typography.typographyBoldFontWeight
2736
- },
2737
- '& > .anticon': {
2738
- lineHeight: theme.typography.lineHeightXxl
2537
+ };
2538
+ const inactiveIconCss = {
2539
+ color: theme.colors.textSecondary
2540
+ };
2541
+ const endIconCssSelector = `span > ${clsEndIcon} > ${clsIcon}`;
2542
+ const styles = {
2543
+ lineHeight: theme.typography.lineHeightBase,
2544
+ boxShadow: 'none',
2545
+ height: theme.general.heightSm,
2546
+ ...(isFlex && {
2547
+ display: 'inline-flex',
2548
+ alignItems: 'center',
2549
+ justifyContent: 'center',
2550
+ verticalAlign: 'middle'
2551
+ }),
2552
+ ...(!onlyIcon && !forceIconStyles && {
2553
+ '&&': {
2554
+ padding: '4px 12px',
2555
+ ...(size === 'small' && {
2556
+ padding: '0 8px'
2557
+ })
2558
+ }
2559
+ }),
2560
+ ...((onlyIcon || forceIconStyles) && {
2561
+ width: theme.general.heightSm
2562
+ }),
2563
+ ...(size === 'small' && {
2564
+ height: SMALL_BUTTON_HEIGHT,
2565
+ lineHeight: theme.typography.lineHeightBase,
2566
+ ...((onlyIcon || forceIconStyles) && {
2567
+ width: SMALL_BUTTON_HEIGHT,
2568
+ paddingTop: 0,
2569
+ paddingBottom: 0,
2570
+ verticalAlign: 'middle'
2571
+ })
2572
+ }),
2573
+ '&:focus-visible': {
2574
+ outlineStyle: 'solid',
2575
+ outlineWidth: '2px',
2576
+ outlineOffset: '1px',
2577
+ outlineColor: theme.isDarkMode ? theme.colors.actionDefaultBorderFocus : theme.colors.primary
2578
+ },
2579
+ ...getDefaultStyles(theme, loading),
2580
+ [`&${classPrimary}`]: {
2581
+ ...getPrimaryStyles(theme)
2582
+ },
2583
+ [`&${classLink}`]: {
2584
+ ...getLinkStyles(theme),
2585
+ ...(type === 'link' && {
2586
+ padding: 'unset',
2587
+ height: 'auto',
2588
+ border: 'none',
2589
+ boxShadow: 'none',
2590
+ '&[disabled],&:hover': {
2591
+ background: 'none'
2739
2592
  }
2740
- }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
2741
- case 2:
2742
- return /*#__PURE__*/css({
2743
- '&&': {
2744
- fontSize: theme.typography.fontSizeXl,
2745
- lineHeight: theme.typography.lineHeightXl,
2746
- fontWeight: theme.typography.typographyBoldFontWeight
2593
+ })
2594
+ },
2595
+ [`&${classDangerous}${classPrimary}`]: {
2596
+ ...getPrimaryDangerStyles(theme)
2597
+ },
2598
+ [`&${classDangerous}`]: {
2599
+ ...getSecondaryDangerStyles(theme)
2600
+ },
2601
+ [`&[disabled], &${classDangerous}:disabled`]: {
2602
+ ...getDisabledStyles(theme),
2603
+ ...((onlyIcon || forceIconStyles) && {
2604
+ backgroundColor: 'transparent',
2605
+ '&:hover': {
2606
+ backgroundColor: 'transparent'
2747
2607
  },
2748
- '& > .anticon': {
2749
- lineHeight: theme.typography.lineHeightXl
2608
+ '&:active': {
2609
+ backgroundColor: 'transparent'
2750
2610
  }
2751
- }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
2752
- case 3:
2753
- return /*#__PURE__*/css({
2754
- '&&': {
2755
- fontSize: theme.typography.fontSizeLg,
2756
- lineHeight: theme.typography.lineHeightLg,
2757
- fontWeight: theme.typography.typographyBoldFontWeight
2758
- },
2759
- '& > .anticon': {
2760
- lineHeight: theme.typography.lineHeightLg
2611
+ })
2612
+ },
2613
+ [clsLoadingIcon]: {
2614
+ display: 'none'
2615
+ },
2616
+ // Loading styles
2617
+ ...(loading && {
2618
+ '::before': {
2619
+ opacity: 0
2620
+ },
2621
+ cursor: 'default',
2622
+ [`${clsLoadingIcon}`]: {
2623
+ ...(onlyIcon ? {
2624
+ // In case of only icon, the icon is already centered but vertically not aligned, this fixes that
2625
+ verticalAlign: 'middle'
2626
+ } : {
2627
+ // Position loading indicator in center
2628
+ // This would break vertical centering of loading circle when onlyIcon is true
2629
+ position: 'absolute'
2630
+ }),
2631
+ ...(!isFlex && !forceIconStyles && {
2632
+ // Normally we'd do `transform: translateX(-50%)` but `antd` crushes that with injected inline `style`.
2633
+ left: 'calc(50% - 7px)'
2634
+ }),
2635
+ // Re-enable animation for the loading spinner, since it can be disabled by the global animation CSS.
2636
+ svg: {
2637
+ animationDuration: '1s !important'
2761
2638
  }
2762
- }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
2763
- case 4:
2764
- default:
2765
- return /*#__PURE__*/css({
2766
- '&&': {
2767
- fontSize: theme.typography.fontSizeMd,
2768
- lineHeight: theme.typography.lineHeightMd,
2769
- fontWeight: theme.typography.typographyBoldFontWeight
2639
+ },
2640
+ [`& > ${clsLoadingIcon} .anticon`]: {
2641
+ paddingRight: 0 // to horizontally center icon
2642
+ },
2643
+
2644
+ [`> :not(${clsLoadingIcon})`]: {
2645
+ // Hide all content except loading icon
2646
+ opacity: 0,
2647
+ visibility: 'hidden',
2648
+ // Add horizontal space for icon
2649
+ ...(withIcon && {
2650
+ paddingLeft: theme.general.iconFontSize + theme.spacing.xs
2651
+ })
2652
+ }
2653
+ }),
2654
+ // Icon styles
2655
+ [`> ${clsIcon} + span, > span + ${clsIcon}`]: {
2656
+ marginRight: 0,
2657
+ marginLeft: theme.spacing.xs
2658
+ },
2659
+ [`> ${clsIcon}`]: iconCss,
2660
+ [`> ${endIconCssSelector}`]: {
2661
+ ...iconCss,
2662
+ marginLeft: theme.spacing.sm
2663
+ },
2664
+ ...(!type && !danger && {
2665
+ [`&:enabled:not(:hover):not(:active) > ${clsIcon}`]: inactiveIconCss
2666
+ }),
2667
+ ...(!type && !danger && {
2668
+ [`&:enabled:not(:hover):not(:active) > ${endIconCssSelector}`]: inactiveIconCss
2669
+ }),
2670
+ // Disable animations
2671
+ [`&[${classNamePrefix}-click-animating-without-extra-node='true']::after`]: {
2672
+ display: 'none'
2673
+ },
2674
+ [`&${clsIconOnly}`]: {
2675
+ border: 'none',
2676
+ [`&:enabled:not(${classLink})`]: {
2677
+ ...tertiaryColors,
2678
+ color: theme.colors.textSecondary,
2679
+ '&:hover > .anticon': {
2680
+ color: tertiaryColors['&:hover'].color,
2681
+ ...(danger && {
2682
+ color: theme.colors.actionDangerDefaultTextHover
2683
+ })
2770
2684
  },
2771
- '& > .anticon': {
2772
- lineHeight: theme.typography.lineHeightMd
2685
+ '&:active > .anticon': {
2686
+ color: tertiaryColors['&:active'].color,
2687
+ ...(danger && {
2688
+ color: theme.colors.actionDangerDefaultTextPress
2689
+ })
2690
+ },
2691
+ ...(loading && {
2692
+ '&&, &:hover, &:active': {
2693
+ backgroundColor: 'transparent'
2694
+ }
2695
+ })
2696
+ },
2697
+ [`&:enabled:not(${classLink}) > .anticon`]: {
2698
+ color: theme.colors.textSecondary,
2699
+ ...(danger && {
2700
+ color: theme.colors.actionDangerDefaultTextDefault
2701
+ })
2702
+ },
2703
+ ...(isAnchor && {
2704
+ lineHeight: `${theme.general.heightSm}px`,
2705
+ ...getLinkStyles(theme),
2706
+ '&:disabled': {
2707
+ color: theme.colors.actionDisabledText
2708
+ }
2709
+ }),
2710
+ ...(loading && {
2711
+ '&&, &:hover, &:active': {
2712
+ backgroundColor: 'transparent'
2773
2713
  }
2774
- }, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
2775
- }
2776
- }
2777
- function getTitleEmotionStyles(theme, props) {
2778
- return /*#__PURE__*/css(getLevelStyles(theme, props), {
2779
- '&&': {
2780
- color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
2714
+ }),
2715
+ '&[disabled]:hover': {
2716
+ backgroundColor: 'transparent'
2717
+ }
2781
2718
  },
2782
- '& > .anticon': {
2783
- verticalAlign: 'middle'
2784
- }
2785
- }, props.withoutMargins && {
2786
- '&&': {
2787
- marginTop: '0 !important',
2788
- // override general styling
2789
- marginBottom: '0 !important' // override general styling
2790
- }
2791
- }, process.env.NODE_ENV === "production" ? "" : ";label:getTitleEmotionStyles;");
2792
- }
2793
- function Title(userProps) {
2794
- const {
2795
- dangerouslySetAntdProps,
2796
- withoutMargins,
2797
- color,
2798
- ...props
2799
- } = userProps;
2800
- const {
2801
- theme
2802
- } = useDesignSystemTheme();
2803
- return jsx(DesignSystemAntDConfigProvider, {
2804
- children: jsx(AntDTitle, {
2805
- ...props,
2806
- className: props.className,
2807
- css: getTitleEmotionStyles(theme, userProps),
2808
- ...dangerouslySetAntdProps
2809
- })
2810
- });
2811
- }
2719
+ [`&:focus`]: {
2720
+ ...(useFocusPseudoClass && {
2721
+ outlineStyle: 'solid',
2722
+ outlineWidth: '2px',
2723
+ outlineOffset: '1px',
2724
+ outlineColor: theme.isDarkMode ? theme.colors.actionDefaultBorderFocus : theme.colors.primary
2725
+ }),
2726
+ [`${clsLoadingIcon}`]: {
2727
+ ...(onlyIcon && {
2728
+ // Mitigate wrong left offset for loading state with onlyIcon
2729
+ left: 0
2730
+ })
2731
+ }
2732
+ },
2733
+ ...(forceIconStyles && {
2734
+ padding: '0 6px',
2735
+ lineHeight: theme.typography.lineHeightSm,
2736
+ color: theme.colors.textSecondary,
2737
+ ...(loading && {
2738
+ '&&, &:hover, &:active': {
2739
+ backgroundColor: 'transparent',
2740
+ borderColor: theme.colors.actionDefaultBorderDefault
2741
+ },
2742
+ '&[disabled], &[disabled]:hover, &[disabled]:active': {
2743
+ backgroundColor: 'transparent',
2744
+ borderColor: 'transparent'
2745
+ }
2746
+ }),
2747
+ '& > span': {
2748
+ verticalAlign: -1,
2749
+ height: theme.general.heightSm / 2,
2750
+ width: theme.general.heightSm / 2
2751
+ },
2752
+ [`& > ${clsLoadingIcon} .anticon`]: {
2753
+ // left: `calc(50% - 6px)!important`,
2754
+ height: theme.general.heightSm / 2,
2755
+ width: theme.general.heightSm / 2,
2756
+ padding: 0
2757
+ }
2758
+ }),
2759
+ ...getAnimationCss(enableAnimation)
2760
+ };
2812
2761
 
2813
- const Typography = /* #__PURE__ */(() => {
2814
- function Typography(_ref) {
2762
+ // Moved outside main style object because state & selector matching in the already existing object keys can create bugs and unwanted overwrites
2763
+ const typeStyles = {
2764
+ ...(type === 'tertiary' && {
2765
+ [`&:enabled:not(${clsIconOnly})`]: tertiaryColors,
2766
+ [`&${classLink}[disabled]`]: {
2767
+ ...getDisabledTertiaryStyles(theme)
2768
+ }
2769
+ })
2770
+ };
2771
+ const importantStyles = importantify(styles);
2772
+ const importantTypeStyles = importantify(typeStyles);
2773
+ return /*#__PURE__*/css(importantStyles, importantTypeStyles, process.env.NODE_ENV === "production" ? "" : ";label:getButtonEmotionStyles;");
2774
+ };
2775
+ const Button = /* #__PURE__ */(() => {
2776
+ const Button = /*#__PURE__*/forwardRef(function Button( // Keep size out of props passed to AntD to make deprecation and eventual removal have 0 impact
2777
+ _ref2, ref) {
2815
2778
  let {
2816
2779
  dangerouslySetAntdProps,
2780
+ children,
2781
+ size,
2782
+ type,
2783
+ loading,
2784
+ loadingDescription = 'Button',
2785
+ endIcon,
2786
+ onClick,
2787
+ dangerouslySetForceIconStyles,
2788
+ dangerouslyUseFocusPseudoClass,
2789
+ dangerouslyAppendWrapperCss,
2790
+ componentId,
2791
+ analyticsEvents,
2817
2792
  ...props
2818
- } = _ref;
2793
+ } = _ref2;
2794
+ const {
2795
+ theme,
2796
+ classNamePrefix
2797
+ } = useDesignSystemTheme();
2798
+ const {
2799
+ USE_FLEX_BUTTON: flexOverride
2800
+ } = useDesignSystemFlags();
2801
+ const eventContext = useDesignSystemEventComponentCallbacks({
2802
+ componentType: DesignSystemEventProviderComponentTypes.Button,
2803
+ componentId,
2804
+ analyticsEvents: analyticsEvents !== null && analyticsEvents !== void 0 ? analyticsEvents : [DesignSystemEventProviderAnalyticsEventTypes.OnClick]
2805
+ });
2806
+ const flexSafex = safex('databricks.fe.designsystem.useFlexButtonStyles', false);
2807
+ const isFlex = flexOverride || flexSafex;
2808
+ const clsEndIcon = getEndIconClsName(theme);
2809
+ const loadingCls = `${classNamePrefix}-btn-loading-icon`;
2810
+ const buttonRef = useRef(null);
2811
+ useImperativeHandle(ref, () => buttonRef.current);
2812
+
2813
+ // Needed to keep backwards compatibility and support existing unit tests
2814
+ useEffect(() => {
2815
+ if (buttonRef.current) {
2816
+ if (loading) {
2817
+ buttonRef.current.setAttribute('loading', 'true');
2818
+ buttonRef.current.classList.add(`${classNamePrefix}-btn-loading`);
2819
+ } else {
2820
+ buttonRef.current.setAttribute('loading', 'false');
2821
+ buttonRef.current.classList.remove(`${classNamePrefix}-btn-loading`);
2822
+ }
2823
+ }
2824
+ }, [loading, classNamePrefix]);
2825
+ const iconOnly = Boolean((props.icon || endIcon) && !children);
2826
+ const handleClick = event => {
2827
+ if (loading) {
2828
+ return;
2829
+ }
2830
+ eventContext.onClick();
2831
+ onClick === null || onClick === void 0 || onClick(event);
2832
+ };
2833
+ const loadingSpinner = jsx(Spinner, {
2834
+ className: loadingCls,
2835
+ animationDuration: 8,
2836
+ inheritColor: true,
2837
+ label: "loading",
2838
+ "aria-label": "loading",
2839
+ loadingDescription: loadingDescription,
2840
+ css: /*#__PURE__*/css({
2841
+ color: 'inherit !important',
2842
+ pointerEvents: 'none',
2843
+ ...(!iconOnly && !dangerouslySetForceIconStyles && {
2844
+ '.anticon': {
2845
+ verticalAlign: '-0.2em'
2846
+ }
2847
+ }),
2848
+ '[aria-hidden="true"]': {
2849
+ display: 'inline'
2850
+ }
2851
+ }, process.env.NODE_ENV === "production" ? "" : ";label:loadingSpinner;")
2852
+ });
2819
2853
  return jsx(DesignSystemAntDConfigProvider, {
2820
- children: jsx(Typography$1, {
2854
+ children: jsx(Button$1, {
2855
+ ...addDebugOutlineIfEnabled(),
2821
2856
  ...props,
2822
- ...dangerouslySetAntdProps
2857
+ css: getButtonEmotionStyles({
2858
+ theme,
2859
+ classNamePrefix,
2860
+ loading: Boolean(loading),
2861
+ withIcon: Boolean(props.icon),
2862
+ onlyIcon: iconOnly,
2863
+ isAnchor: Boolean(props.href && !type),
2864
+ danger: Boolean(props.danger),
2865
+ enableAnimation: theme.options.enableAnimation,
2866
+ size: size || 'middle',
2867
+ type,
2868
+ isFlex,
2869
+ forceIconStyles: Boolean(dangerouslySetForceIconStyles),
2870
+ useFocusPseudoClass: Boolean(dangerouslyUseFocusPseudoClass)
2871
+ }),
2872
+ href: props.disabled ? undefined : props.href,
2873
+ ...dangerouslySetAntdProps,
2874
+ onClick: handleClick,
2875
+ icon: loading ? loadingSpinner : props.icon,
2876
+ ref: buttonRef,
2877
+ type: type === 'tertiary' ? 'link' : type,
2878
+ children: children && jsxs("span", {
2879
+ style: {
2880
+ visibility: loading ? 'hidden' : 'visible',
2881
+ ...(isFlex && {
2882
+ display: 'inline-flex',
2883
+ alignItems: 'center'
2884
+ }),
2885
+ ...dangerouslyAppendWrapperCss
2886
+ },
2887
+ children: [children, endIcon && jsx("span", {
2888
+ className: clsEndIcon,
2889
+ style: {
2890
+ ...(isFlex && {
2891
+ display: 'inline-flex',
2892
+ alignItems: 'center'
2893
+ })
2894
+ },
2895
+ children: endIcon
2896
+ })]
2897
+ })
2823
2898
  })
2824
2899
  });
2825
- }
2826
- Typography.Text = Text;
2827
- Typography.Title = Title;
2828
- Typography.Paragraph = Paragraph;
2829
- Typography.Link = Link;
2830
- Typography.Hint = Hint;
2831
- return Typography;
2900
+ });
2901
+
2902
+ // This is needed for other Ant components that wrap Button, such as Tooltip, to correctly
2903
+ // identify it as an Ant button.
2904
+ // This should be removed if the component is rewritten to no longer be a wrapper around Ant.
2905
+ // See: https://github.com/ant-design/ant-design/blob/6dd39c1f89b4d6632e6ed022ff1bc275ca1e0f1f/components/button/button.tsx#L291
2906
+ Button.__ANT_BUTTON = true;
2907
+ return Button;
2832
2908
  })();
2833
2909
 
2834
2910
  const getInputGroupStyling = (clsPrefix, theme) => {
@@ -2844,6 +2920,9 @@ const getInputGroupStyling = (clsPrefix, theme) => {
2844
2920
  '&:hover': {
2845
2921
  borderRight: `1px solid ${theme.colors.actionDisabledText} !important`
2846
2922
  }
2923
+ },
2924
+ '&[data-validation]': {
2925
+ marginRight: 0
2847
2926
  }
2848
2927
  },
2849
2928
  [`& > ${buttonClass} > span`]: {
@@ -2875,6 +2954,37 @@ const Group = _ref => {
2875
2954
  });
2876
2955
  };
2877
2956
 
2957
+ /**
2958
+ * A React custom hook that allows a callback function to be executed exactly once until it is explicitly reset.
2959
+ *
2960
+ * Usage:
2961
+ *
2962
+ * const originalCallback = () => { console.log('originalCallback'); }
2963
+ * const { callbackOnceUntilReset, reset } = useCallbackOnceUntilReset(originalCallback);
2964
+ *
2965
+ * // To execute the callback
2966
+ * callbackOnceUntilReset(); // Prints 'originalCallback'
2967
+ * callbackOnceUntilReset(); // No effect for further calls
2968
+ * reset();
2969
+ * callbackOnceUntilReset(); // Prints 'originalCallback' again
2970
+ */
2971
+ const useCallbackOnceUntilReset = callback => {
2972
+ const canTriggerRef = useRef(true);
2973
+ const reset = useCallback(() => {
2974
+ canTriggerRef.current = true;
2975
+ }, []);
2976
+ const callbackOnceUntilReset = useCallback(() => {
2977
+ if (canTriggerRef.current) {
2978
+ callback();
2979
+ canTriggerRef.current = false;
2980
+ }
2981
+ }, [callback]);
2982
+ return {
2983
+ callbackOnceUntilReset,
2984
+ reset
2985
+ };
2986
+ };
2987
+
2878
2988
  const getInputStyles = (clsPrefix, theme, _ref, _ref2) => {
2879
2989
  let {
2880
2990
  validationState
@@ -2985,6 +3095,9 @@ const Input$1 = /*#__PURE__*/forwardRef(function Input(_ref4, ref) {
2985
3095
  dangerouslyAppendEmotionCSS,
2986
3096
  onChange,
2987
3097
  onClear,
3098
+ onFocus,
3099
+ componentId,
3100
+ analyticsEvents,
2988
3101
  ...props
2989
3102
  } = _ref4;
2990
3103
  const {
@@ -2992,7 +3105,19 @@ const Input$1 = /*#__PURE__*/forwardRef(function Input(_ref4, ref) {
2992
3105
  theme
2993
3106
  } = useDesignSystemTheme();
2994
3107
  const useTransparent = safex('databricks.fe.designsystem.useTransparentInput', false);
3108
+ const eventContext = useDesignSystemEventComponentCallbacks({
3109
+ componentType: DesignSystemEventProviderComponentTypes.Input,
3110
+ componentId,
3111
+ analyticsEvents: analyticsEvents !== null && analyticsEvents !== void 0 ? analyticsEvents : [DesignSystemEventProviderAnalyticsEventTypes.OnValueChange]
3112
+ });
3113
+
3114
+ // Prevents multiple onValueChange triggers until after a focus event resets it.
3115
+ const {
3116
+ callbackOnceUntilReset: sendAnalyticsEventOncePerFocus,
3117
+ reset: resetSendAnalyticsEventOnFocus
3118
+ } = useCallbackOnceUntilReset(eventContext.onValueChange);
2995
3119
  const handleChange = e => {
3120
+ sendAnalyticsEventOncePerFocus();
2996
3121
  // If the input is cleared, call the onClear handler, but only
2997
3122
  // if the event is not an input event -- which is the case when you click the
2998
3123
  // ant-provided (X) button.
@@ -3002,14 +3127,20 @@ const Input$1 = /*#__PURE__*/forwardRef(function Input(_ref4, ref) {
3002
3127
  onChange === null || onChange === void 0 || onChange(e);
3003
3128
  }
3004
3129
  };
3130
+ const handleFocus = e => {
3131
+ resetSendAnalyticsEventOnFocus();
3132
+ onFocus === null || onFocus === void 0 || onFocus(e);
3133
+ };
3005
3134
  return jsx(DesignSystemAntDConfigProvider, {
3006
3135
  children: jsx(Input$2, {
3007
3136
  autoComplete: autoComplete,
3137
+ "data-validation": validationState,
3008
3138
  ref: ref,
3009
3139
  css: [getInputEmotionStyles(classNamePrefix, theme, {
3010
3140
  validationState
3011
3141
  }, useTransparent), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:Input;"],
3012
3142
  onChange: handleChange,
3143
+ onFocus: handleFocus,
3013
3144
  ...props,
3014
3145
  ...dangerouslySetAntdProps
3015
3146
  })
@@ -3121,25 +3252,25 @@ function Stepper(_ref) {
3121
3252
  } = getStepContentStyleFields(theme, isCurrentStep, step.status, StepIcon);
3122
3253
  return jsx("li", {
3123
3254
  "aria-current": isCurrentStep,
3124
- css: /*#__PURE__*/css(getStepItemStyle(theme, isHorizontal, isLastStep)),
3255
+ css: /*#__PURE__*/css(getStepItemStyle(theme, isHorizontal, isLastStep), process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3125
3256
  children: jsxs(StepContentGrid, {
3126
3257
  isHorizontal: isHorizontal,
3127
3258
  isCurrentStep: isCurrentStep,
3128
3259
  children: [jsx("div", {
3129
- css: /*#__PURE__*/css(getStepItemIconParentStyle(theme, isCurrentStep, iconBackgroundColor, hasStepItemIconBorder)),
3260
+ css: /*#__PURE__*/css(getStepItemIconParentStyle(theme, isCurrentStep, iconBackgroundColor, hasStepItemIconBorder), process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3130
3261
  children: StepIcon ? jsx(StepIcon, {
3131
3262
  statusColor: iconTextColor,
3132
3263
  status: step.status
3133
3264
  }) : icon ? jsx("span", {
3134
3265
  css: /*#__PURE__*/css({
3135
3266
  color: iconTextColor
3136
- }),
3267
+ }, process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3137
3268
  children: icon
3138
3269
  }) : jsx(Typography.Title, {
3139
3270
  level: contentTitleLevel,
3140
3271
  css: /*#__PURE__*/css({
3141
3272
  color: `${iconTextColor} !important`
3142
- }),
3273
+ }, process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3143
3274
  withoutMargins: true,
3144
3275
  children: localizeStepNumber(index + 1)
3145
3276
  })
@@ -3149,12 +3280,12 @@ function Stepper(_ref) {
3149
3280
  css: /*#__PURE__*/css({
3150
3281
  flexShrink: 0,
3151
3282
  color: `${titleTextColor} !important`
3152
- }),
3283
+ }, process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3153
3284
  children: step.title
3154
3285
  }), displayEndingDivider && jsx("div", {
3155
- css: /*#__PURE__*/css(getStepEndingDividerStyles(theme, isHorizontal, isCurrentStep))
3286
+ css: /*#__PURE__*/css(getStepEndingDividerStyles(theme, isHorizontal, isCurrentStep), process.env.NODE_ENV === "production" ? "" : ";label:Stepper;")
3156
3287
  }), step.description && jsx(Typography.Text, {
3157
- css: /*#__PURE__*/css(getStepDescriptionStyles(theme, isHorizontal, isLastStep, descriptionTextColor)),
3288
+ css: /*#__PURE__*/css(getStepDescriptionStyles(theme, isHorizontal, isLastStep, descriptionTextColor), process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3158
3289
  withoutMargins: true,
3159
3290
  size: "sm",
3160
3291
  children: step.description
@@ -3338,7 +3469,6 @@ function StepContentGrid(_ref2) {
3338
3469
  alignItems: 'center',
3339
3470
  justifyItems: 'flex-start',
3340
3471
  gridColumnGap: theme.spacing.sm,
3341
- gridRowGap: theme.spacing.sm,
3342
3472
  width: '100%'
3343
3473
  }, process.env.NODE_ENV === "production" ? "" : ";label:StepContentGrid;"),
3344
3474
  children: children
@@ -3400,5 +3530,5 @@ function useResponsiveDirection(_ref3) {
3400
3530
  };
3401
3531
  }
3402
3532
 
3403
- export { getInputStyles as $, ApplyDesignSystemContextOverrides as A, Button as B, CloseIcon$1 as C, DesignSystemAntDConfigProvider as D, DesignSystemEventProviderComponentTypes as E, DesignSystemEventProviderAnalyticsEventTypes as F, useDesignSystemEventComponentCallbacks as G, DesignSystemEventProvider as H, Icon as I, DesignSystemThemeContext as J, DesignSystemContext as K, LoadingState as L, DesignSystemThemeProvider as M, DesignSystemProvider as N, ApplyDesignSystemFlags as O, useAntDConfigProviderContext as P, WithDesignSystemThemeHoc as Q, RestoreAntDDefaultClsPrefix as R, Spinner as S, Typography as T, CursorIcon$1 as U, FaceFrownIcon$1 as V, WarningIcon$1 as W, FaceNeutralIcon$1 as X, FaceSmileIcon$1 as Y, MegaphoneIcon$1 as Z, NewWindowIcon$1 as _, getDarkModePortalStyles as a, LoadingStateContext as a0, getTypographyColor as a1, getBottomOnlyShadowScrollStyles as a2, ColorVars as a3, primitiveColors as a4, ChevronRightIcon$1 as b, useUniqueId as c, useDesignSystemContext as d, CheckIcon$1 as e, Input as f, getAnimationCss as g, getValidationStateColor as h, importantify as i, getShadowScrollStyles as j, DangerIcon$1 as k, LoadingIcon$1 as l, Title as m, AccessibleContainer as n, ChevronLeftIcon$1 as o, DU_BOIS_ENABLE_ANIMATION_CLASSNAME as p, lightColorList as q, getDefaultStyles as r, safex as s, getPrimaryStyles as t, useDesignSystemTheme as u, visuallyHidden as v, getDisabledStyles as w, useDesignSystemFlags as x, Stepper as y, getButtonEmotionStyles as z };
3404
- //# sourceMappingURL=Stepper-839336b1.js.map
3533
+ export { NewWindowIcon$1 as $, ApplyDesignSystemContextOverrides as A, Button as B, CloseIcon$1 as C, DesignSystemAntDConfigProvider as D, getDisabledStyles as E, useDesignSystemFlags as F, Stepper as G, getButtonEmotionStyles as H, Icon as I, DesignSystemEventProvider as J, DesignSystemThemeContext as K, LoadingState as L, DesignSystemContext as M, DesignSystemThemeProvider as N, DesignSystemProvider as O, ApplyDesignSystemFlags as P, useAntDConfigProviderContext as Q, RestoreAntDDefaultClsPrefix as R, Spinner as S, Typography as T, WithDesignSystemThemeHoc as U, CursorIcon$1 as V, WarningIcon$1 as W, FaceFrownIcon$1 as X, FaceNeutralIcon$1 as Y, FaceSmileIcon$1 as Z, MegaphoneIcon$1 as _, getDarkModePortalStyles as a, getInputStyles as a0, LoadingStateContext as a1, getTypographyColor as a2, getBottomOnlyShadowScrollStyles as a3, ColorVars as a4, primitiveColors as a5, ChevronRightIcon$1 as b, useUniqueId as c, useDesignSystemContext as d, CheckIcon$1 as e, Input as f, getAnimationCss as g, getValidationStateColor as h, importantify as i, getShadowScrollStyles as j, DangerIcon$1 as k, LoadingIcon$1 as l, Title as m, AccessibleContainer as n, ChevronLeftIcon$1 as o, useDesignSystemEventComponentCallbacks as p, DesignSystemEventProviderComponentTypes as q, DesignSystemEventProviderAnalyticsEventTypes as r, safex as s, useNotifyOnFirstView as t, useDesignSystemTheme as u, visuallyHidden as v, DU_BOIS_ENABLE_ANIMATION_CLASSNAME as w, lightColorList as x, getDefaultStyles as y, getPrimaryStyles as z };
3534
+ //# sourceMappingURL=Stepper-a0fb4d9b.js.map