@salesforce/design-system-react 11.0.0-alpha.5 → 11.0.0-alpha.6

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 (344) hide show
  1. package/dist/cjs/components/avatar/index.cjs +1 -1
  2. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  3. package/dist/cjs/components/breadcrumb/index.cjs +1 -1
  4. package/dist/cjs/components/breadcrumb/index.cjs.map +1 -1
  5. package/dist/cjs/components/button/index.cjs +1 -1
  6. package/dist/cjs/components/button/index.cjs.map +1 -1
  7. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  8. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  9. package/dist/cjs/components/carousel/index.cjs +1 -1
  10. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  11. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  12. package/dist/cjs/components/checkbox/index.cjs +1 -1
  13. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  14. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  15. package/dist/cjs/components/combobox/add-subheadings.cjs +1 -1
  16. package/dist/cjs/components/combobox/add-subheadings.cjs.map +1 -1
  17. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  18. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  19. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  20. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  21. package/dist/cjs/components/combobox/filter.cjs +1 -1
  22. package/dist/cjs/components/combobox/filter.cjs.map +1 -1
  23. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  24. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  25. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  26. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  27. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  28. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  29. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  30. package/dist/cjs/components/index.cjs +1 -1
  31. package/dist/cjs/components/input/check-props.cjs +1 -1
  32. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  33. package/dist/cjs/components/input/search.cjs +1 -1
  34. package/dist/cjs/components/input/search.cjs.map +1 -1
  35. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  36. package/dist/cjs/components/menu-dropdown/check-props.cjs +1 -1
  37. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  38. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  39. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  40. package/dist/cjs/components/modal/index.cjs +1 -1
  41. package/dist/cjs/components/modal/index.cjs.map +1 -1
  42. package/dist/cjs/components/pill-container/check-props.cjs +2 -0
  43. package/dist/cjs/components/pill-container/check-props.cjs.map +1 -0
  44. package/dist/cjs/components/pill-container/component.cjs +2 -0
  45. package/dist/cjs/components/pill-container/component.cjs.map +1 -0
  46. package/dist/cjs/components/pill-container/index.cjs +1 -1
  47. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  48. package/dist/cjs/components/popover/index.cjs.map +1 -1
  49. package/dist/cjs/components/popover/popover.cjs +1 -1
  50. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  51. package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
  52. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  53. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  54. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  55. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  56. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  57. package/dist/cjs/components/spinner/index.cjs +1 -1
  58. package/dist/cjs/components/spinner/index.cjs.map +1 -1
  59. package/dist/cjs/components/split-view/check-props.cjs +2 -0
  60. package/dist/cjs/components/split-view/check-props.cjs.map +1 -0
  61. package/dist/cjs/components/split-view/component.cjs +2 -0
  62. package/dist/cjs/components/split-view/component.cjs.map +1 -0
  63. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  64. package/dist/cjs/components/split-view/index.cjs +1 -1
  65. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  66. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  67. package/dist/cjs/components/tabs/index.cjs +1 -1
  68. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  69. package/dist/cjs/components/textarea/check-props.cjs +2 -0
  70. package/dist/cjs/components/textarea/check-props.cjs.map +1 -0
  71. package/dist/cjs/components/textarea/component.cjs +2 -0
  72. package/dist/cjs/components/textarea/component.cjs.map +1 -0
  73. package/dist/cjs/components/textarea/index.cjs +1 -1
  74. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  75. package/dist/cjs/components/toast/index.cjs +1 -1
  76. package/dist/cjs/components/toast/index.cjs.map +1 -1
  77. package/dist/cjs/components/tooltip/check-props.cjs +1 -1
  78. package/dist/cjs/components/tooltip/check-props.cjs.map +1 -1
  79. package/dist/cjs/components/tooltip/index.cjs +2 -2
  80. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  81. package/dist/cjs/components/tree/check-props.cjs +1 -1
  82. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  83. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  84. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  85. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  86. package/dist/cjs/components/tree/private/render-initial-branch.cjs +1 -1
  87. package/dist/cjs/components/tree/private/render-initial-branch.cjs.map +1 -1
  88. package/dist/cjs/components/tree/tree.cjs +1 -1
  89. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  90. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  91. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  92. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  93. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  94. package/dist/cjs/components/vertical-navigation/private/item.cjs.map +1 -1
  95. package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
  96. package/dist/cjs/utilities/constants.cjs +1 -1
  97. package/dist/cjs/utilities/constants.cjs.map +1 -1
  98. package/dist/es/components/avatar/index.js +1 -1
  99. package/dist/es/components/avatar/index.js.map +1 -1
  100. package/dist/es/components/breadcrumb/index.js +1 -1
  101. package/dist/es/components/breadcrumb/index.js.map +1 -1
  102. package/dist/es/components/button/index.js +1 -1
  103. package/dist/es/components/button/index.js.map +1 -1
  104. package/dist/es/components/button-stateful/index.js +1 -1
  105. package/dist/es/components/button-stateful/index.js.map +1 -1
  106. package/dist/es/components/carousel/index.js +8 -12
  107. package/dist/es/components/carousel/index.js.map +1 -1
  108. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  109. package/dist/es/components/checkbox/index.js +17 -17
  110. package/dist/es/components/checkbox/index.js.map +1 -1
  111. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  112. package/dist/es/components/combobox/add-subheadings.js +2 -1
  113. package/dist/es/components/combobox/add-subheadings.js.map +1 -1
  114. package/dist/es/components/combobox/check-props.js +15 -5
  115. package/dist/es/components/combobox/check-props.js.map +1 -1
  116. package/dist/es/components/combobox/combobox.js +193 -186
  117. package/dist/es/components/combobox/combobox.js.map +1 -1
  118. package/dist/es/components/combobox/filter.js +1 -1
  119. package/dist/es/components/combobox/filter.js.map +1 -1
  120. package/dist/es/components/combobox/index.js.map +1 -1
  121. package/dist/es/components/combobox/private/menu.js +2 -0
  122. package/dist/es/components/combobox/private/menu.js.map +1 -1
  123. package/dist/es/components/date-picker/check-props.js +4 -4
  124. package/dist/es/components/date-picker/date-picker.js +149 -142
  125. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  126. package/dist/es/components/date-picker/index.js.map +1 -1
  127. package/dist/es/components/index.js +41 -43
  128. package/dist/es/components/input/check-props.js +17 -18
  129. package/dist/es/components/input/check-props.js.map +1 -1
  130. package/dist/es/components/input/search.js +1 -1
  131. package/dist/es/components/input/search.js.map +1 -1
  132. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  133. package/dist/es/components/menu-dropdown/check-props.js +6 -6
  134. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  135. package/dist/es/components/menu-dropdown/menu-dropdown.js +247 -250
  136. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  137. package/dist/es/components/modal/index.js +104 -132
  138. package/dist/es/components/modal/index.js.map +1 -1
  139. package/dist/es/components/pill-container/check-props.js +13 -0
  140. package/dist/es/components/pill-container/check-props.js.map +1 -0
  141. package/dist/es/components/pill-container/component.js +31 -0
  142. package/dist/es/components/pill-container/component.js.map +1 -0
  143. package/dist/es/components/pill-container/index.js +65 -56
  144. package/dist/es/components/pill-container/index.js.map +1 -1
  145. package/dist/es/components/popover/index.js.map +1 -1
  146. package/dist/es/components/popover/popover.js +63 -62
  147. package/dist/es/components/popover/popover.js.map +1 -1
  148. package/dist/es/components/setup-assistant/index.js.map +1 -1
  149. package/dist/es/components/setup-assistant/step.js +1 -1
  150. package/dist/es/components/setup-assistant/step.js.map +1 -1
  151. package/dist/es/components/simple-data-table/check-props.js +4 -4
  152. package/dist/es/components/simple-data-table/row-actions.js +2 -2
  153. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  154. package/dist/es/components/spinner/index.js +1 -1
  155. package/dist/es/components/spinner/index.js.map +1 -1
  156. package/dist/es/components/split-view/check-props.js +13 -0
  157. package/dist/es/components/split-view/check-props.js.map +1 -0
  158. package/dist/es/components/split-view/component.js +46 -0
  159. package/dist/es/components/split-view/component.js.map +1 -0
  160. package/dist/es/components/split-view/header.js.map +1 -1
  161. package/dist/es/components/split-view/index.js +40 -34
  162. package/dist/es/components/split-view/index.js.map +1 -1
  163. package/dist/es/components/split-view/listbox.js.map +1 -1
  164. package/dist/es/components/tabs/index.js +64 -64
  165. package/dist/es/components/tabs/index.js.map +1 -1
  166. package/dist/es/components/textarea/check-props.js +17 -0
  167. package/dist/es/components/textarea/check-props.js.map +1 -0
  168. package/dist/es/components/textarea/component.js +27 -0
  169. package/dist/es/components/textarea/component.js.map +1 -0
  170. package/dist/es/components/textarea/index.js +50 -46
  171. package/dist/es/components/textarea/index.js.map +1 -1
  172. package/dist/es/components/toast/index.js +18 -12
  173. package/dist/es/components/toast/index.js.map +1 -1
  174. package/dist/es/components/tooltip/check-props.js +9 -23
  175. package/dist/es/components/tooltip/check-props.js.map +1 -1
  176. package/dist/es/components/tooltip/index.js +70 -70
  177. package/dist/es/components/tooltip/index.js.map +1 -1
  178. package/dist/es/components/tree/check-props.js +6 -6
  179. package/dist/es/components/tree/check-props.js.map +1 -1
  180. package/dist/es/components/tree/private/branch.js.map +1 -1
  181. package/dist/es/components/tree/private/item.js.map +1 -1
  182. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  183. package/dist/es/components/tree/private/render-initial-branch.js +5 -2
  184. package/dist/es/components/tree/private/render-initial-branch.js.map +1 -1
  185. package/dist/es/components/tree/tree.js +60 -35
  186. package/dist/es/components/tree/tree.js.map +1 -1
  187. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  188. package/dist/es/components/utilities/menu-list/item.js +1 -1
  189. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  190. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  191. package/dist/es/components/vertical-navigation/private/item.js.map +1 -1
  192. package/dist/es/components/welcome-mat/index.js.map +1 -1
  193. package/dist/es/utilities/constants.js +2 -2
  194. package/dist/es/utilities/constants.js.map +1 -1
  195. package/dist/types/components/avatar/index.d.ts +1 -1
  196. package/dist/types/components/avatar/index.d.ts.map +1 -1
  197. package/dist/types/components/breadcrumb/index.d.ts +1 -1
  198. package/dist/types/components/breadcrumb/index.d.ts.map +1 -1
  199. package/dist/types/components/button/check-props.d.ts.map +1 -1
  200. package/dist/types/components/button/index.d.ts +1 -1
  201. package/dist/types/components/button/index.d.ts.map +1 -1
  202. package/dist/types/components/button-stateful/index.d.ts +1 -1
  203. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  204. package/dist/types/components/carousel/index.d.ts +34 -7
  205. package/dist/types/components/carousel/index.d.ts.map +1 -1
  206. package/dist/types/components/carousel/private/carousel-item.d.ts +3 -3
  207. package/dist/types/components/carousel/private/carousel-item.d.ts.map +1 -1
  208. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  209. package/dist/types/components/checkbox/index.d.ts +1 -6
  210. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  211. package/dist/types/components/color-picker/color-picker.d.ts +25 -7
  212. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  213. package/dist/types/components/color-picker/index.d.ts +1 -1
  214. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  215. package/dist/types/components/combobox/add-subheadings.d.ts +1 -1
  216. package/dist/types/components/combobox/add-subheadings.d.ts.map +1 -1
  217. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  218. package/dist/types/components/combobox/combobox.d.ts +57 -24
  219. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  220. package/dist/types/components/combobox/filter.d.ts.map +1 -1
  221. package/dist/types/components/combobox/index.d.ts +2 -2
  222. package/dist/types/components/combobox/index.d.ts.map +1 -1
  223. package/dist/types/components/combobox/private/menu.d.ts +65 -4
  224. package/dist/types/components/combobox/private/menu.d.ts.map +1 -1
  225. package/dist/types/components/date-picker/date-picker.d.ts +52 -6
  226. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  227. package/dist/types/components/date-picker/index.d.ts +1 -1
  228. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  229. package/dist/types/components/index.d.ts +0 -4
  230. package/dist/types/components/index.d.ts.map +1 -1
  231. package/dist/types/components/input/check-props.d.ts.map +1 -1
  232. package/dist/types/components/input/search.d.ts +1 -1
  233. package/dist/types/components/input/search.d.ts.map +1 -1
  234. package/dist/types/components/menu-dropdown/button-trigger.d.ts +1 -1
  235. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  236. package/dist/types/components/menu-dropdown/index.d.ts +2 -2
  237. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  238. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +95 -24
  239. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  240. package/dist/types/components/modal/index.d.ts +26 -3
  241. package/dist/types/components/modal/index.d.ts.map +1 -1
  242. package/dist/types/components/pill-container/check-props.d.ts.map +1 -0
  243. package/dist/types/components/pill-container/index.d.ts +24 -3
  244. package/dist/types/components/pill-container/index.d.ts.map +1 -1
  245. package/dist/types/components/popover/index.d.ts +1 -1
  246. package/dist/types/components/popover/index.d.ts.map +1 -1
  247. package/dist/types/components/popover/popover.d.ts +41 -12
  248. package/dist/types/components/popover/popover.d.ts.map +1 -1
  249. package/dist/types/components/setup-assistant/index.d.ts +7 -3
  250. package/dist/types/components/setup-assistant/index.d.ts.map +1 -1
  251. package/dist/types/components/setup-assistant/step.d.ts +7 -1
  252. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  253. package/dist/types/components/simple-data-table/row-actions.d.ts.map +1 -1
  254. package/dist/types/components/spinner/index.d.ts +1 -1
  255. package/dist/types/components/spinner/index.d.ts.map +1 -1
  256. package/dist/types/components/split-view/check-props.d.ts.map +1 -0
  257. package/dist/types/components/split-view/header.d.ts +3 -3
  258. package/dist/types/components/split-view/header.d.ts.map +1 -1
  259. package/dist/types/components/split-view/index.d.ts +25 -3
  260. package/dist/types/components/split-view/index.d.ts.map +1 -1
  261. package/dist/types/components/split-view/listbox.d.ts +27 -24
  262. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  263. package/dist/types/components/tabs/index.d.ts +16 -3
  264. package/dist/types/components/tabs/index.d.ts.map +1 -1
  265. package/dist/types/components/textarea/index.d.ts +2 -2
  266. package/dist/types/components/textarea/index.d.ts.map +1 -1
  267. package/dist/types/components/toast/index.d.ts +17 -2
  268. package/dist/types/components/toast/index.d.ts.map +1 -1
  269. package/dist/types/components/tooltip/check-props.d.ts.map +1 -1
  270. package/dist/types/components/tooltip/index.d.ts +1 -5
  271. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  272. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  273. package/dist/types/components/tree/index.d.ts +1 -1
  274. package/dist/types/components/tree/index.d.ts.map +1 -1
  275. package/dist/types/components/tree/private/branch.d.ts +2 -4
  276. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  277. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  278. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  279. package/dist/types/components/tree/private/render-initial-branch.d.ts +2 -3
  280. package/dist/types/components/tree/private/render-initial-branch.d.ts.map +1 -1
  281. package/dist/types/components/tree/tree.d.ts +27 -6
  282. package/dist/types/components/tree/tree.d.ts.map +1 -1
  283. package/dist/types/components/tree/types.d.ts +55 -8
  284. package/dist/types/components/tree/types.d.ts.map +1 -1
  285. package/dist/types/components/utilities/menu-list/index.d.ts +1 -1
  286. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  287. package/dist/types/components/utilities/menu-list/item.d.ts +1 -1
  288. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  289. package/dist/types/components/vertical-navigation/index.d.ts +7 -3
  290. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  291. package/dist/types/components/vertical-navigation/private/item.d.ts +1 -1
  292. package/dist/types/components/vertical-navigation/private/item.d.ts.map +1 -1
  293. package/dist/types/components/welcome-mat/index.d.ts +62 -13
  294. package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
  295. package/dist/types/utilities/constants.d.ts +0 -1
  296. package/dist/types/utilities/constants.d.ts.map +1 -1
  297. package/package.json +2 -2
  298. package/dist/cjs/components/forms/input/inline-check-props.cjs +0 -2
  299. package/dist/cjs/components/forms/input/inline-check-props.cjs.map +0 -1
  300. package/dist/cjs/components/forms/input/inline.cjs +0 -2
  301. package/dist/cjs/components/forms/input/inline.cjs.map +0 -1
  302. package/dist/cjs/components/modal/check-props.cjs +0 -2
  303. package/dist/cjs/components/modal/check-props.cjs.map +0 -1
  304. package/dist/cjs/components/modal/component.cjs +0 -2
  305. package/dist/cjs/components/modal/component.cjs.map +0 -1
  306. package/dist/cjs/components/modal/trigger.cjs +0 -2
  307. package/dist/cjs/components/modal/trigger.cjs.map +0 -1
  308. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +0 -2
  309. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +0 -1
  310. package/dist/es/components/forms/input/inline-check-props.js +0 -11
  311. package/dist/es/components/forms/input/inline-check-props.js.map +0 -1
  312. package/dist/es/components/forms/input/inline.js +0 -95
  313. package/dist/es/components/forms/input/inline.js.map +0 -1
  314. package/dist/es/components/modal/check-props.js +0 -13
  315. package/dist/es/components/modal/check-props.js.map +0 -1
  316. package/dist/es/components/modal/component.js +0 -35
  317. package/dist/es/components/modal/component.js.map +0 -1
  318. package/dist/es/components/modal/trigger.js +0 -22
  319. package/dist/es/components/modal/trigger.js.map +0 -1
  320. package/dist/es/utilities/warning/deprecated-property-value.js +0 -18
  321. package/dist/es/utilities/warning/deprecated-property-value.js.map +0 -1
  322. package/dist/types/components/avatar/check-props.d.ts.map +0 -1
  323. package/dist/types/components/breadcrumb/check-props.d.ts.map +0 -1
  324. package/dist/types/components/button-stateful/check-props.d.ts +0 -3
  325. package/dist/types/components/button-stateful/check-props.d.ts.map +0 -1
  326. package/dist/types/components/forms/checkbox/index.d.ts +0 -4
  327. package/dist/types/components/forms/checkbox/index.d.ts.map +0 -1
  328. package/dist/types/components/forms/checkbox.d.ts +0 -2
  329. package/dist/types/components/forms/input/inline-check-props.d.ts +0 -3
  330. package/dist/types/components/forms/input/inline-check-props.d.ts.map +0 -1
  331. package/dist/types/components/forms/input/inline.d.ts +0 -88
  332. package/dist/types/components/forms/input/inline.d.ts.map +0 -1
  333. package/dist/types/components/modal/check-props.d.ts +0 -3
  334. package/dist/types/components/modal/check-props.d.ts.map +0 -1
  335. package/dist/types/components/modal/trigger.d.ts +0 -14
  336. package/dist/types/components/modal/trigger.d.ts.map +0 -1
  337. package/dist/types/components/spinner/check-props.d.ts +0 -3
  338. package/dist/types/components/spinner/check-props.d.ts.map +0 -1
  339. package/dist/types/components/tabs/pane.d.ts +0 -3
  340. package/dist/types/components/tabs/pane.d.ts.map +0 -1
  341. package/dist/types/utilities/warning/deprecated-event-parameter.d.ts +0 -3
  342. package/dist/types/utilities/warning/deprecated-event-parameter.d.ts.map +0 -1
  343. /package/dist/types/components/{avatar → pill-container}/check-props.d.ts +0 -0
  344. /package/dist/types/components/{breadcrumb → split-view}/check-props.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":[],"sources":["../../../../components/popover/popover.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport MediaObject from '../media-object';\nimport Icon from '../icon';\nimport Dialog from '../utilities/dialog';\nimport keyboardNavigableDialog from '../../utilities/keyboard-navigable-dialog';\nimport KEYS from '../../utilities/key-code';\nimport { POPOVER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// Shared overlay element for click-outside detection over iframes\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Track currently open popover for single-popover-at-a-time behavior\nlet currentOpenPopover: {\n\thandleClose: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { trigger: string; id: string }\n\t) => void;\n\tgetId: () => string;\n} | null = null;\n\n/**\n * Popover alignment options\n */\nexport type PopoverAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\n/**\n * Popover position options\n */\nexport type PopoverPosition = 'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Popover variant options\n */\nexport type PopoverVariant =\n\t| 'base'\n\t| 'error'\n\t| 'feature'\n\t| 'walkthrough'\n\t| 'walkthrough-action'\n\t| 'warning';\n\n/**\n * Assistive text for Popover\n */\nexport interface PopoverAssistiveText {\n\tcloseButton?: string;\n}\n\n/**\n * Props for the Popover component\n */\nexport interface PopoverProps {\n\t/** Alignment relative to trigger */\n\talign?: PopoverAlign;\n\t/** Accessibility labels */\n\tassistiveText?: PopoverAssistiveText;\n\t/** HTML id of heading for aria-labelledby */\n\tariaLabelledby?: string;\n\t/** Trigger element (first child) and optional other children */\n\tchildren: ReactNode;\n\t/** Popover body content */\n\tbody: ReactNode;\n\t/** CSS classes for body */\n\tclassNameBody?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for footer */\n\tclassNameFooter?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use classNameFooter */\n\tfooterClassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for popover container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for contents wrapper */\n\tcontentsClassName?: string | string[] | Record<string, boolean>;\n\t/** Disable the popover */\n\tdisabled?: boolean;\n\t/** Footer content */\n\tfooter?: ReactNode;\n\t/** Footer styles */\n\tfooterStyle?: CSSProperties;\n\t/** Walkthrough footer actions */\n\tfooterWalkthroughActions?: ReactNode | ReactNode[];\n\t/** Hide close button */\n\thasNoCloseButton?: boolean;\n\t/** Hide nubbin/arrow */\n\thasNoNubbin?: boolean;\n\t/** Prevent position flipping */\n\thasStaticAlignment?: boolean;\n\t/** Remove trigger inline-block style */\n\thasNoTriggerStyles?: boolean;\n\t/** Popover heading */\n\theading?: ReactNode;\n\t/** Icon for feature variant */\n\ticon?: ReactNode;\n\t/** HTML id */\n\tid?: string;\n\t/** Controlled open state */\n\tisOpen?: boolean;\n\t/** Offset from target */\n\toffset?: string;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent) => void;\n\t/** Close callback */\n\tonClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { componentWillUnmount?: boolean }\n\t) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Mouse leave handler */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/** Open callback */\n\tonOpen?: (event?: unknown, data?: { portal?: HTMLElement }) => void;\n\t/** Close request callback */\n\tonRequestClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { trigger?: string }\n\t) => void;\n\t/** Custom target element getter */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/** Open trigger type */\n\topenOn?: 'click' | 'hover' | 'hybrid';\n\t/** Overlay for click-outside on iframes */\n\toverlay?: boolean | ((isOpen: boolean, overlayElement: HTMLElement) => void);\n\t/** Positioning strategy */\n\tposition?: PopoverPosition;\n\t/** Walkthrough step text */\n\tstepText?: string;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Popover variant */\n\tvariant?: PopoverVariant;\n\t/** Delay before closing on hover (ms) */\n\thoverCloseDelay?: number;\n\t/** @deprecated Use assistiveText.closeButton */\n\tcloseButtonAssistiveText?: string;\n}\n\n// Nubbin positions for export (legacy)\nexport const PopoverNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\nconst defaultAssistiveText: PopoverAssistiveText = {\n\tcloseButton: 'Close dialog',\n};\n\n/**\n * The Popover component is a non-modal dialog. It should be paired with a clickable\n * trigger such as a Button. It traps focus from the page and must be exited if focus\n * needs to be outside the Popover.\n */\nconst Popover = ({\n\talign = 'right',\n\tassistiveText: propAssistiveText,\n\tariaLabelledby,\n\tchildren,\n\tbody,\n\tclassNameBody,\n\tclassNameFooter,\n\tfooterClassName,\n\tclassName,\n\tcontentsClassName,\n\tdisabled = false,\n\tfooter,\n\tfooterStyle,\n\tfooterWalkthroughActions,\n\thasNoCloseButton = false,\n\thasNoNubbin = false,\n\thasStaticAlignment = false,\n\thasNoTriggerStyles = false,\n\theading,\n\ticon,\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\toffset,\n\tonClick,\n\tonClose,\n\tonFocus,\n\tonKeyDown,\n\tonMouseDown,\n\tonMouseEnter,\n\tonMouseLeave,\n\tonOpen,\n\tonRequestClose,\n\tonRequestTargetElement,\n\topenOn = 'click',\n\toverlay: overlayProp,\n\tposition = 'absolute',\n\tstepText,\n\tstyle,\n\ttriggerClassName,\n\tvariant = 'base',\n\thoverCloseDelay = 300,\n\tcloseButtonAssistiveText,\n}: PopoverProps): ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst context = useContext(IconSettingsContext);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst finalCloseButtonAssistiveText =\n\t\tcloseButtonAssistiveText || assistiveText.closeButton;\n\n\t// State\n\tconst [internalIsOpen, setInternalIsOpen] = useState(false);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst dialogRef = useRef<HTMLElement>(null);\n\tconst isHoverRef = useRef(false);\n\tconst isClosingRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\tconst isUnmountingRef = useRef(false);\n\n\t// Derived state\n\tconst isOpen =\n\t\t!disabled &&\n\t\t(controlledIsOpen !== undefined ? controlledIsOpen : internalIsOpen);\n\n\t// Get target element for positioning\n\tconst getTargetElement = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\tconst target = onRequestTargetElement();\n\t\t\tif (target) return target;\n\t\t}\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Handle dialog close (when unmounted)\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent?: React.MouseEvent | React.KeyboardEvent | MouseEvent | KeyboardEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tconst componentWillUnmount = data?.componentWillUnmount || false;\n\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\n\t\t\tif (onClose) {\n\t\t\t\tonClose(event, { componentWillUnmount });\n\t\t\t}\n\t\t},\n\t\t[id, onClose]\n\t);\n\n\t// Handle close\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent?: MouseEvent | KeyboardEvent,\n\t\t\tdata?: { trigger?: string }\n\t\t) => {\n\t\t\tif (isOpen) {\n\t\t\t\tif (onRequestClose) {\n\t\t\t\t\tonRequestClose(event, data || {});\n\t\t\t\t}\n\n\t\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\t\tcurrentOpenPopover = null;\n\t\t\t\t}\n\n\t\t\t\tsetInternalIsOpen(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[isOpen, id, onRequestClose]\n\t);\n\n\t// Handle open\n\tconst handleOpen = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\t// Close any other open popover\n\t\t\tif (currentOpenPopover && currentOpenPopover.getId() !== id) {\n\t\t\t\tcurrentOpenPopover.handleClose(undefined, {\n\t\t\t\t\ttrigger: 'newPopover',\n\t\t\t\t\tid: currentOpenPopover.getId(),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcurrentOpenPopover = {\n\t\t\t\thandleClose: (event, data) => handleClose(event as MouseEvent | KeyboardEvent, data),\n\t\t\t\tgetId: () => id,\n\t\t\t};\n\n\t\t\tsetInternalIsOpen(true);\n\t\t}\n\t}, [isOpen, id, handleClose]);\n\n\t// Handle cancel (close button or escape)\n\tconst handleCancel = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent) => {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle click outside\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\thandleClose(event, { trigger: 'clickOutside' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\n\t\t\tif (!isOpen && openOn === 'hover') {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\tif (isClosingRef.current) {\n\t\t\t\t\tclearTimeout(isClosingRef.current);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onMouseEnter) {\n\t\t\t\tonMouseEnter(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\tisClosingRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose();\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\n\t\t\tif (onMouseLeave) {\n\t\t\t\tonMouseLeave(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent, triggerOnClickCallback?: (e: MouseEvent) => void) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event);\n\t\t\t}\n\n\t\t\tif (triggerOnClickCallback) {\n\t\t\t\ttriggerOnClickCallback(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, handleClose, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t}\n\n\t\t\tif (onFocus) {\n\t\t\t\tonFocus(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, onFocus]\n\t);\n\n\t// Toggle from keyboard\n\tconst toggleOpenFromKeyboard = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\thandleCancel(event);\n\t\t\t} else {\n\t\t\t\thandleOpen();\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleCancel, handleOpen]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.keyCode) {\n\t\t\t\tif (event.keyCode !== KEYS.TAB) {\n\t\t\t\t\tkeyboardNavigableDialog({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen,\n\t\t\t\t\t\thandleClick: (e: MouseEvent) => handleClick(e),\n\t\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\t\teventTarget: event.target,\n\t\t\t\t\t\ttoggleOpen: toggleOpenFromKeyboard,\n\t\t\t\t\t\ttrigger: triggerRef.current,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (onKeyDown) {\n\t\t\t\t\tonKeyDown(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleClick, toggleOpenFromKeyboard, onKeyDown]\n\t);\n\n\t// Render overlay for click-outside detection\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (typeof overlayProp === 'function' && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (overlayProp && shouldShow && !overlayRef.current && documentDefined) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Container ref callback\n\tconst setContainerRef = useCallback((component: HTMLDivElement | null) => {\n\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current = component;\n\t\tif (component && !inputRendered) {\n\t\t\tsetInputRendered(true);\n\t\t}\n\t}, [inputRendered]);\n\n\t// Dialog ref callback\n\tconst setMenuRef = useCallback((component: HTMLElement | null) => {\n\t\t(dialogRef as React.MutableRefObject<HTMLElement | null>).current = component;\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t};\n\t}, [id, renderOverlay]);\n\n\t// Update overlay when isOpen changes\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// Render header\n\tconst renderHeader = () => {\n\t\tconst hasThemedHeader = variant === 'error' || variant === 'warning';\n\t\tconst hasDefinedHeader = heading || hasThemedHeader;\n\n\t\tif (!hasDefinedHeader || variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst headerIcon = {\n\t\t\terror: <Icon category=\"utility\" name=\"error\" size=\"x-small\" inverse />,\n\t\t\twarning: <Icon category=\"utility\" name=\"warning\" size=\"x-small\" inverse />,\n\t\t};\n\n\t\tif (hasThemedHeader) {\n\t\t\treturn (\n\t\t\t\t<header className=\"slds-popover__header\">\n\t\t\t\t\t<MediaObject\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\tclassName=\"slds-truncate slds-text-heading_medium\"\n\t\t\t\t\t\t\t\ttitle={typeof heading === 'string' ? heading : undefined}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfigure={headerIcon[variant as 'error' | 'warning']}\n\t\t\t\t\t\tverticalCenter\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\tclassName={classNames('slds-popover__header', {\n\t\t\t\t\t'slds-p-vertical_medium': variant === 'walkthrough',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<h2\n\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-text-heading_small': variant !== 'walkthrough',\n\t\t\t\t\t\t'slds-text-heading_medium': variant === 'walkthrough',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{heading}\n\t\t\t\t</h2>\n\t\t\t</header>\n\t\t);\n\t};\n\n\t// Render body\n\tconst renderBody = () => {\n\t\tif (variant === 'error' || variant === 'warning') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t>\n\t\t\t\t\t{body}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{variant === 'walkthrough-action' ? (\n\t\t\t\t\t\t\t\t<Icon category=\"utility\" name=\"touch_action\" size=\"small\" inverse />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\ticon\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t{heading && (\n\t\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-text-heading_small\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{body}\n\t\t\t\t\t\t\t{stepText && (\n\t\t\t\t\t\t\t\t<p className=\"slds-m-top_medium slds-text-title\">{stepText}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Render footer\n\tconst renderFooter = () => {\n\t\tif (footer) {\n\t\t\treturn (\n\t\t\t\t<footer\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-popover__footer',\n\t\t\t\t\t\tclassNameFooter as string,\n\t\t\t\t\t\tfooterClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={footerStyle}\n\t\t\t\t>\n\t\t\t\t\t{footer}\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvariant !== 'walkthrough-action' &&\n\t\t\t(footerWalkthroughActions || stepText)\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<footer className=\"slds-popover__footer\">\n\t\t\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center\">\n\t\t\t\t\t\t{stepText && <span className=\"slds-text-title\">{stepText}</span>}\n\t\t\t\t\t\t{footerWalkthroughActions && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\t\t\t\tstyle={{ display: 'inline-block' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{footerWalkthroughActions}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// Render dialog\n\tconst renderDialog = () => {\n\t\tif (!isOpen) return null;\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${id}`;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\thasNubbin={!hasNoNubbin}\n\t\t\t\talign={align}\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\tcontentsClassName as string,\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t{ 'slds-popover_error': variant === 'error' },\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough':\n\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-popover_walkthrough-alt': variant === 'walkthrough-action' },\n\t\t\t\t\t{ 'slds-popover_feature': variant === 'feature' },\n\t\t\t\t\t{ 'slds-popover_warning': variant === 'warning' },\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tcontext={context}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\toffset={offset}\n\t\t\t\tonCancel={handleClose}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonOpen={onOpen}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonMouseEnter={openOn === 'hover' ? handleMouseEnter : undefined}\n\t\t\t\tonMouseLeave={openOn === 'hover' ? handleMouseLeave : undefined}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tonRequestTargetElement={getTargetElement}\n\t\t\t\tposition={position}\n\t\t\t\tstyle={style}\n\t\t\t\tvariant=\"popover\"\n\t\t\t\tref={setMenuRef}\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: `${id}-popover`,\n\t\t\t\t\t'aria-labelledby': ariaLabelledby || `${id}-dialog-heading`,\n\t\t\t\t\t'aria-describedby': `${id}-dialog-body`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!hasNoCloseButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: finalCloseButtonAssistiveText }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-button_icon-inverse':\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={handleCancel}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\tinverse={variant === 'error' || variant === 'warning'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderBody()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Dialog>\n\t\t);\n\t};\n\n\t// Clone trigger element\n\tconst otherChildren: ReactNode[] = [];\n\tlet clonedTrigger: ReactNode = null;\n\n\tReact.Children.forEach(children, (child, index) => {\n\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\tconst triggerProps: Record<string, unknown> = {\n\t\t\t\t'aria-haspopup': 'dialog',\n\t\t\t\tid,\n\t\t\t\tonClick:\n\t\t\t\t\topenOn === 'click' || openOn === 'hybrid'\n\t\t\t\t\t\t? (event: MouseEvent) => {\n\t\t\t\t\t\t\t\thandleClick(event, childProps.onClick as (e: MouseEvent) => void);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: childProps.onClick,\n\t\t\t\tonFocus: openOn === 'hover' ? handleFocus : undefined,\n\t\t\t\tonMouseDown,\n\t\t\t\tonMouseEnter:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseEnter : undefined,\n\t\t\t\tonMouseLeave:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseLeave : undefined,\n\t\t\t\ttabIndex: (childProps.tabIndex as number) || 0,\n\t\t\t};\n\t\t\tclonedTrigger = React.cloneElement(child, triggerProps);\n\t\t} else if (child) {\n\t\t\totherChildren.push(child);\n\t\t}\n\t});\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: hasNoTriggerStyles ? undefined : 'inline-block',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={triggerClassName as string}\n\t\t\tstyle={containerStyles}\n\t\t\tref={setContainerRef}\n\t\t>\n\t\t\t{clonedTrigger}\n\t\t\t{otherChildren.length > 0 ? otherChildren : null}\n\t\t\t{renderDialog()}\n\t\t</div>\n\t);\n};\n\nPopover.displayName = POPOVER;\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AAK;EAHN,UAAA;GAKE;GACA,EAAc,SAAS,IAAI,IAAgB;GAC3C,GAAa;EACV;;AAEP;AAEA,EAAQ,cAAc"}
1
+ {"version":3,"file":"popover.js","names":[],"sources":["../../../../components/popover/popover.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport MediaObject from '../media-object';\nimport Icon from '../icon';\nimport Dialog from '../utilities/dialog';\nimport keyboardNavigableDialog from '../../utilities/keyboard-navigable-dialog';\nimport KEYS from '../../utilities/key-code';\nimport { POPOVER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// Shared overlay element for click-outside detection over iframes\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Track currently open popover for single-popover-at-a-time behavior\nlet currentOpenPopover: {\n\thandleClose: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: PopoverRequestCloseData\n\t) => void;\n\tgetId: () => string;\n} | null = null;\n\n/**\n * Popover alignment options\n */\nexport type PopoverAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\n/**\n * Popover position options\n */\nexport type PopoverPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Popover variant options\n */\nexport type PopoverVariant =\n\t| 'base'\n\t| 'error'\n\t| 'feature'\n\t| 'walkthrough'\n\t| 'walkthrough-action'\n\t| 'warning';\n\n/**\n * Assistive text for Popover\n */\nexport interface PopoverAssistiveText {\n\tcloseButton?: string;\n}\n\n/**\n * What caused `onRequestClose` to fire:\n * * `cancel`: the close button was clicked or Escape was pressed\n * * `clickOutside`: a click landed outside the popover\n * * `mouseLeave`: the mouse left the trigger/popover (`openOn` `hover`/`hybrid`) and `hoverCloseDelay` elapsed\n * * `newPopover`: another Popover opened (only one can be open at a time)\n * * `triggerClick`: the trigger was clicked while the popover was open\n */\nexport type PopoverRequestCloseTrigger =\n\t'cancel' | 'clickOutside' | 'mouseLeave' | 'newPopover' | 'triggerClick';\n\n/**\n * Data passed to `onRequestClose`\n */\nexport interface PopoverRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: PopoverRequestCloseTrigger;\n\t/** HTML id of the popover being closed. Only present when `trigger` is `newPopover`. */\n\tid?: string;\n}\n\n/**\n * Data passed to `onOpen`\n */\nexport interface PopoverOpenData {\n\t/** The rendered popover dialog element */\n\tportal?: HTMLElement;\n}\n\n/**\n * Data passed to `onClose`\n */\nexport interface PopoverCloseData {\n\t/** `true` when the popover dialog is closing because it is being unmounted */\n\tcomponentWillUnmount: boolean;\n}\n\n/**\n * Props for the Popover component\n */\nexport interface PopoverProps {\n\t/** Alignment relative to trigger */\n\talign?: PopoverAlign;\n\t/** Accessibility labels */\n\tassistiveText?: PopoverAssistiveText;\n\t/** HTML id of heading for aria-labelledby */\n\tariaLabelledby?: string;\n\t/** Trigger element (first child) and optional other children */\n\tchildren: ReactNode;\n\t/** Popover body content */\n\tbody: ReactNode;\n\t/** CSS classes for body */\n\tclassNameBody?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for footer */\n\tclassNameFooter?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use classNameFooter */\n\tfooterClassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for popover container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for contents wrapper */\n\tcontentsClassName?: string | string[] | Record<string, boolean>;\n\t/** Disable the popover */\n\tdisabled?: boolean;\n\t/** Footer content */\n\tfooter?: ReactNode;\n\t/** Footer styles */\n\tfooterStyle?: CSSProperties;\n\t/** Walkthrough footer actions */\n\tfooterWalkthroughActions?: ReactNode | ReactNode[];\n\t/** Hide close button */\n\thasNoCloseButton?: boolean;\n\t/** Hide nubbin/arrow */\n\thasNoNubbin?: boolean;\n\t/** Prevent position flipping */\n\thasStaticAlignment?: boolean;\n\t/** Remove trigger inline-block style */\n\thasNoTriggerStyles?: boolean;\n\t/** Popover heading */\n\theading?: ReactNode;\n\t/** Icon for feature variant */\n\ticon?: ReactNode;\n\t/** HTML id */\n\tid?: string;\n\t/** Controlled open state */\n\tisOpen?: boolean;\n\t/** Offset from target */\n\toffset?: string;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent) => void;\n\t/** Called after the popover dialog has closed (unmounted). There is no triggering event, so `event` is `undefined`. */\n\tonClose?: (event: undefined, data: PopoverCloseData) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Mouse leave handler */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/** Called after the popover dialog has opened and rendered. There is no triggering event, so `event` is `undefined`. */\n\tonOpen?: (event: undefined, data: PopoverOpenData) => void;\n\t/**\n\t * Called when the popover requests to close. `data.trigger` says why. `event` is the triggering\n\t * click or key event, or `undefined` when there is none (`mouseLeave` timer, `newPopover`).\n\t */\n\tonRequestClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: PopoverRequestCloseData\n\t) => void;\n\t/** Custom target element getter */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/** Open trigger type */\n\topenOn?: 'click' | 'hover' | 'hybrid';\n\t/** Overlay for click-outside on iframes */\n\toverlay?: boolean | ((isOpen: boolean, overlayElement: HTMLElement) => void);\n\t/** Positioning strategy */\n\tposition?: PopoverPosition;\n\t/** Walkthrough step text */\n\tstepText?: string;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Popover variant */\n\tvariant?: PopoverVariant;\n\t/** Delay before closing on hover (ms) */\n\thoverCloseDelay?: number;\n\t/** @deprecated Use assistiveText.closeButton */\n\tcloseButtonAssistiveText?: string;\n}\n\n// Nubbin positions for export (legacy)\nexport const PopoverNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\nconst defaultAssistiveText: PopoverAssistiveText = {\n\tcloseButton: 'Close dialog',\n};\n\n/**\n * The Popover component is a non-modal dialog. It should be paired with a clickable\n * trigger such as a Button. It traps focus from the page and must be exited if focus\n * needs to be outside the Popover.\n */\nconst Popover = ({\n\talign = 'right',\n\tassistiveText: propAssistiveText,\n\tariaLabelledby,\n\tchildren,\n\tbody,\n\tclassNameBody,\n\tclassNameFooter,\n\tfooterClassName,\n\tclassName,\n\tcontentsClassName,\n\tdisabled = false,\n\tfooter,\n\tfooterStyle,\n\tfooterWalkthroughActions,\n\thasNoCloseButton = false,\n\thasNoNubbin = false,\n\thasStaticAlignment = false,\n\thasNoTriggerStyles = false,\n\theading,\n\ticon,\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\toffset,\n\tonClick,\n\tonClose,\n\tonFocus,\n\tonKeyDown,\n\tonMouseDown,\n\tonMouseEnter,\n\tonMouseLeave,\n\tonOpen,\n\tonRequestClose,\n\tonRequestTargetElement,\n\topenOn = 'click',\n\toverlay: overlayProp,\n\tposition = 'absolute',\n\tstepText,\n\tstyle,\n\ttriggerClassName,\n\tvariant = 'base',\n\thoverCloseDelay = 300,\n\tcloseButtonAssistiveText,\n}: PopoverProps): ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst context = useContext(IconSettingsContext);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst finalCloseButtonAssistiveText =\n\t\tcloseButtonAssistiveText || assistiveText.closeButton;\n\n\t// State\n\tconst [internalIsOpen, setInternalIsOpen] = useState(false);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst dialogRef = useRef<HTMLElement>(null);\n\tconst isHoverRef = useRef(false);\n\tconst isClosingRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\tconst isUnmountingRef = useRef(false);\n\n\t// Derived state\n\tconst isOpen =\n\t\t!disabled &&\n\t\t(controlledIsOpen !== undefined ? controlledIsOpen : internalIsOpen);\n\n\t// Get target element for positioning\n\tconst getTargetElement = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\tconst target = onRequestTargetElement();\n\t\t\tif (target) return target;\n\t\t}\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Handle dialog close (when unmounted)\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\t_event?: React.SyntheticEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tconst componentWillUnmount = data?.componentWillUnmount || false;\n\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\n\t\t\tif (onClose) {\n\t\t\t\tonClose(undefined, { componentWillUnmount });\n\t\t\t}\n\t\t},\n\t\t[id, onClose]\n\t);\n\n\t// Handle dialog open (after it has rendered)\n\tconst handleDialogOpen = useCallback(\n\t\t(_event?: unknown, data?: { portal?: HTMLElement }) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(undefined, { portal: data?.portal });\n\t\t\t}\n\t\t},\n\t\t[onOpen]\n\t);\n\n\t// Handle close\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\t\tdata: PopoverRequestCloseData\n\t\t) => {\n\t\t\tif (isOpen) {\n\t\t\t\tif (onRequestClose) {\n\t\t\t\t\tonRequestClose(event, data);\n\t\t\t\t}\n\n\t\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\t\tcurrentOpenPopover = null;\n\t\t\t\t}\n\n\t\t\t\tsetInternalIsOpen(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[isOpen, id, onRequestClose]\n\t);\n\n\t// Latest `handleClose`, so the \"close the other open popover\" path does not call a stale\n\t// closure from when this popover opened (whose `isOpen` was still `false`).\n\tconst handleCloseRef = useRef(handleClose);\n\tuseEffect(() => {\n\t\thandleCloseRef.current = handleClose;\n\t}, [handleClose]);\n\n\t// Handle open\n\tconst handleOpen = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\t// Close any other open popover\n\t\t\tif (currentOpenPopover && currentOpenPopover.getId() !== id) {\n\t\t\t\tcurrentOpenPopover.handleClose(undefined, {\n\t\t\t\t\ttrigger: 'newPopover',\n\t\t\t\t\tid: currentOpenPopover.getId(),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcurrentOpenPopover = {\n\t\t\t\thandleClose: (event, data) => handleCloseRef.current(event, data),\n\t\t\t\tgetId: () => id,\n\t\t\t};\n\n\t\t\tsetInternalIsOpen(true);\n\t\t}\n\t}, [isOpen, id]);\n\n\t// Handle cancel (close button or escape)\n\tconst handleCancel = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent) => {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle click outside\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\thandleClose(event, { trigger: 'clickOutside' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\n\t\t\tif (!isOpen && openOn === 'hover') {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\tif (isClosingRef.current) {\n\t\t\t\t\tclearTimeout(isClosingRef.current);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onMouseEnter) {\n\t\t\t\tonMouseEnter(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\tisClosingRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose(undefined, { trigger: 'mouseLeave' });\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\n\t\t\tif (onMouseLeave) {\n\t\t\t\tonMouseLeave(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent, triggerOnClickCallback?: (e: MouseEvent) => void) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\thandleClose(event, { trigger: 'triggerClick' });\n\t\t\t}\n\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event);\n\t\t\t}\n\n\t\t\tif (triggerOnClickCallback) {\n\t\t\t\ttriggerOnClickCallback(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, handleClose, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t}\n\n\t\t\tif (onFocus) {\n\t\t\t\tonFocus(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, onFocus]\n\t);\n\n\t// Toggle from keyboard\n\tconst toggleOpenFromKeyboard = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\thandleCancel(event);\n\t\t\t} else {\n\t\t\t\thandleOpen();\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleCancel, handleOpen]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.keyCode) {\n\t\t\t\tif (event.keyCode !== KEYS.TAB) {\n\t\t\t\t\tkeyboardNavigableDialog({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen,\n\t\t\t\t\t\thandleClick: (e: MouseEvent) => handleClick(e),\n\t\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\t\teventTarget: event.target,\n\t\t\t\t\t\t// keyboardNavigableDialog calls `toggleOpen()` without the event; pass it through\n\t\t\t\t\t\ttoggleOpen: () => toggleOpenFromKeyboard(event),\n\t\t\t\t\t\ttrigger: triggerRef.current,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (onKeyDown) {\n\t\t\t\t\tonKeyDown(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleClick, toggleOpenFromKeyboard, onKeyDown]\n\t);\n\n\t// Render overlay for click-outside detection\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (typeof overlayProp === 'function' && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (\n\t\t\t\toverlayProp &&\n\t\t\t\tshouldShow &&\n\t\t\t\t!overlayRef.current &&\n\t\t\t\tdocumentDefined\n\t\t\t) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Container ref callback\n\tconst setContainerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\tcomponent;\n\t\t\tif (component && !inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// Dialog ref callback\n\tconst setMenuRef = useCallback((component: HTMLElement | null) => {\n\t\t(dialogRef as React.MutableRefObject<HTMLElement | null>).current =\n\t\t\tcomponent;\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t};\n\t}, [id, renderOverlay]);\n\n\t// Update overlay when isOpen changes\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// Render header\n\tconst renderHeader = () => {\n\t\tconst hasThemedHeader = variant === 'error' || variant === 'warning';\n\t\tconst hasDefinedHeader = heading || hasThemedHeader;\n\n\t\tif (\n\t\t\t!hasDefinedHeader ||\n\t\t\tvariant === 'walkthrough-action' ||\n\t\t\tvariant === 'feature'\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst headerIcon = {\n\t\t\terror: <Icon category=\"utility\" name=\"error\" size=\"x-small\" inverse />,\n\t\t\twarning: (\n\t\t\t\t<Icon category=\"utility\" name=\"warning\" size=\"x-small\" inverse />\n\t\t\t),\n\t\t};\n\n\t\tif (hasThemedHeader) {\n\t\t\treturn (\n\t\t\t\t<header className=\"slds-popover__header\">\n\t\t\t\t\t<MediaObject\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\tclassName=\"slds-truncate slds-text-heading_medium\"\n\t\t\t\t\t\t\t\ttitle={typeof heading === 'string' ? heading : undefined}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfigure={headerIcon[variant as 'error' | 'warning']}\n\t\t\t\t\t\tverticalCenter\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\tclassName={classNames('slds-popover__header', {\n\t\t\t\t\t'slds-p-vertical_medium': variant === 'walkthrough',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<h2\n\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-text-heading_small': variant !== 'walkthrough',\n\t\t\t\t\t\t'slds-text-heading_medium': variant === 'walkthrough',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{heading}\n\t\t\t\t</h2>\n\t\t\t</header>\n\t\t);\n\t};\n\n\t// Render body\n\tconst renderBody = () => {\n\t\tif (variant === 'error' || variant === 'warning') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t>\n\t\t\t\t\t{body}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{variant === 'walkthrough-action' ? (\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\tname=\"touch_action\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\ticon\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t{heading && (\n\t\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-text-heading_small\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{body}\n\t\t\t\t\t\t\t{stepText && (\n\t\t\t\t\t\t\t\t<p className=\"slds-m-top_medium slds-text-title\">{stepText}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Render footer\n\tconst renderFooter = () => {\n\t\tif (footer) {\n\t\t\treturn (\n\t\t\t\t<footer\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-popover__footer',\n\t\t\t\t\t\tclassNameFooter as string,\n\t\t\t\t\t\tfooterClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={footerStyle}\n\t\t\t\t>\n\t\t\t\t\t{footer}\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvariant !== 'walkthrough-action' &&\n\t\t\t(footerWalkthroughActions || stepText)\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<footer className=\"slds-popover__footer\">\n\t\t\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center\">\n\t\t\t\t\t\t{stepText && <span className=\"slds-text-title\">{stepText}</span>}\n\t\t\t\t\t\t{footerWalkthroughActions && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\t\t\t\tstyle={{ display: 'inline-block' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{footerWalkthroughActions}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// Render dialog\n\tconst renderDialog = () => {\n\t\tif (!isOpen) return null;\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${id}`;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\thasNubbin={!hasNoNubbin}\n\t\t\t\talign={align}\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\tcontentsClassName as string,\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t{ 'slds-popover_error': variant === 'error' },\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough':\n\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-popover_walkthrough-alt': variant === 'walkthrough-action' },\n\t\t\t\t\t{ 'slds-popover_feature': variant === 'feature' },\n\t\t\t\t\t{ 'slds-popover_warning': variant === 'warning' },\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tcontext={context}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\toffset={offset}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonOpen={handleDialogOpen}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonMouseEnter={openOn === 'hover' ? handleMouseEnter : undefined}\n\t\t\t\tonMouseLeave={openOn === 'hover' ? handleMouseLeave : undefined}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tonRequestTargetElement={getTargetElement}\n\t\t\t\tposition={position}\n\t\t\t\tstyle={style}\n\t\t\t\tvariant=\"popover\"\n\t\t\t\tref={setMenuRef}\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: `${id}-popover`,\n\t\t\t\t\t'aria-labelledby': ariaLabelledby || `${id}-dialog-heading`,\n\t\t\t\t\t'aria-describedby': `${id}-dialog-body`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!hasNoCloseButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: finalCloseButtonAssistiveText }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-button_icon-inverse':\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={handleCancel}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\tinverse={variant === 'error' || variant === 'warning'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderBody()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Dialog>\n\t\t);\n\t};\n\n\t// Clone trigger element\n\tconst otherChildren: ReactNode[] = [];\n\tlet clonedTrigger: ReactNode = null;\n\n\tReact.Children.forEach(children, (child, index) => {\n\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\tconst triggerProps: Record<string, unknown> = {\n\t\t\t\t'aria-haspopup': 'dialog',\n\t\t\t\tid,\n\t\t\t\tonClick:\n\t\t\t\t\topenOn === 'click' || openOn === 'hybrid'\n\t\t\t\t\t\t? (event: MouseEvent) => {\n\t\t\t\t\t\t\t\thandleClick(\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\tchildProps.onClick as (e: MouseEvent) => void\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: childProps.onClick,\n\t\t\t\tonFocus: openOn === 'hover' ? handleFocus : undefined,\n\t\t\t\tonMouseDown,\n\t\t\t\tonMouseEnter:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid'\n\t\t\t\t\t\t? handleMouseEnter\n\t\t\t\t\t\t: undefined,\n\t\t\t\tonMouseLeave:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid'\n\t\t\t\t\t\t? handleMouseLeave\n\t\t\t\t\t\t: undefined,\n\t\t\t\ttabIndex: (childProps.tabIndex as number) || 0,\n\t\t\t};\n\t\t\tclonedTrigger = React.cloneElement(child, triggerProps);\n\t\t} else if (child) {\n\t\t\totherChildren.push(child);\n\t\t}\n\t});\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: hasNoTriggerStyles ? undefined : 'inline-block',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={triggerClassName as string}\n\t\t\tstyle={containerStyles}\n\t\t\tref={setContainerRef}\n\t\t>\n\t\t\t{clonedTrigger}\n\t\t\t{otherChildren.length > 0 ? otherChildren : null}\n\t\t\t{renderDialog()}\n\t\t</div>\n\t);\n};\n\nPopover.displayName = POPOVER;\n\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A;IACJ,cACC,MAAW,WAAW,MAAW,WAC9B,IACA,KAAA;IACJ,UAAW,EAAW,YAAuB;GAC9C;GACA,IAAgB,EAAM,aAAa,GAAO,CAAY;EACvD,OAAO,AAAI,KACV,EAAc,KAAK,CAAK;CAE1B,CAAC,GAOA,kBAAC,OAAD;EACC,WAAW;EACX,OAAO,EANR,SAAS,KAAqB,KAAA,IAAY,eAMlC;EACP,KAAK;EAHN,UAAA;GAKE;GACA,EAAc,SAAS,IAAI,IAAgB;GAC3C,GAAa;EACV;;AAEP;AAEA,EAAQ,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/setup-assistant/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useId, type ReactNode, type ReactElement, type MouseEvent } from 'react';\nimport classNames from 'classnames';\nimport { SETUP_ASSISTANT, SETUP_ASSISTANT_STEP } from '../../utilities/constants';\n\n/**\n * Event data for step toggle\n */\nexport interface StepToggleEventData {\n\tindex: number;\n\tisOpen: boolean;\n\tstep: ReactElement;\n}\n\n/**\n * Props for child steps\n */\nexport interface SetupAssistantStepChildProps {\n\tindex?: number;\n\tonToggleIsOpen?: (event: MouseEvent, data: StepToggleEventData) => void;\n\tstepNumber?: number;\n}\n\n/**\n * Props for the SetupAssistant component\n */\nexport interface SetupAssistantProps {\n\t/** SetupAssistantStep components */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether the assistant has card styling */\n\tisCard?: boolean;\n\t/** Step toggle handler */\n\tonStepToggleIsOpen?: (event: MouseEvent, data: StepToggleEventData) => void;\n\t/** Progress bar component */\n\tprogressBar?: ReactNode;\n}\n\n/**\n * Setup Assistant provides Administrators with a centralized list of tasks for\n * onboarding organizations, clouds, or features within the Salesforce Platform.\n */\nconst SetupAssistant = ({\n\tchildren,\n\tclassName,\n\tid: propId,\n\tisCard = false,\n\tonStepToggleIsOpen,\n\tprogressBar,\n}: SetupAssistantProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst steps = (\n\t\t<ol id={id} className={classNames('slds-setup-assistant', className as string)}>\n\t\t\t{React.Children.map(children, (child, i) => {\n\t\t\t\tif (!React.isValidElement(child)) return null;\n\t\t\t\tif ((child.type as { displayName?: string }).displayName !== SETUP_ASSISTANT_STEP) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst childProps = child.props as SetupAssistantStepChildProps;\n\t\t\t\treturn React.cloneElement(child as ReactElement<SetupAssistantStepChildProps>, {\n\t\t\t\t\tindex: i,\n\t\t\t\t\tonToggleIsOpen: onStepToggleIsOpen,\n\t\t\t\t\tstepNumber: i + 1,\n\t\t\t\t\t...childProps,\n\t\t\t\t});\n\t\t\t})}\n\t\t</ol>\n\t);\n\n\tif (isCard) {\n\t\treturn (\n\t\t\t<section className=\"slds-card\">\n\t\t\t\t<header className=\"slds-theme_shade slds-p-around_medium slds-m-bottom_small\">\n\t\t\t\t\t{progressBar}\n\t\t\t\t</header>\n\t\t\t\t{steps}\n\t\t\t</section>\n\t\t);\n\t}\n\n\treturn <>{steps}</>;\n};\n\nSetupAssistant.displayName = SETUP_ASSISTANT;\n\nexport default SetupAssistant;\n\n"],"mappings":";;;;;AA+CA,IAAM,KAAkB,EACvB,aACA,cACA,IAAI,GACJ,YAAS,IACT,uBACA,qBAC8C;CAC9C,IAAM,IAAc,EAAM,GAGpB,IACL,kBAAC,MAAD;EAAQ,IAHE,KAAU;EAGR,WAAW,EAAW,wBAAwB,CAAmB;EAC3E,UAAA,EAAM,SAAS,IAAI,IAAW,GAAO,MAAM;GAE3C,IADI,CAAC,EAAM,eAAe,CAAK,KAC1B,EAAM,KAAkC,gBAAA,0BAC5C,OAAO;GAER,IAAM,IAAa,EAAM;GACzB,OAAO,EAAM,aAAa,GAAqD;IAC9E,OAAO;IACP,gBAAgB;IAChB,YAAY,IAAI;IAChB,GAAG;GACJ,CAAC;EACF,CAAC;CACE,CAAA;CAcL,OAXI,IAEF,kBAAC,WAAD;EAAS,WAAU;EAAnB,UAAA,CACC,kBAAC,UAAD;GAAQ,WAAU;GAChB,UAAA;EACM,CAAA,GACP,CACO;MAIJ,kBAAA,GAAA,EAAA,UAAG,EAAQ,CAAA;AACnB;AAEA,EAAe,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/setup-assistant/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseId,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport {\n\tSETUP_ASSISTANT,\n\tSETUP_ASSISTANT_STEP,\n} from '../../utilities/constants';\nimport type { StepProps } from './step';\n\n/**\n * Event data for step toggle\n */\nexport interface StepToggleEventData {\n\t/** Index of the toggled step within the Setup Assistant */\n\tindex: number;\n\t/** Requested (next) open state: `true` to expand the step, `false` to collapse it */\n\tisOpen: boolean;\n\t/** Props of the step being toggled */\n\tstep: StepProps;\n}\n\n/**\n * Props for child steps\n */\nexport interface SetupAssistantStepChildProps {\n\tindex?: number;\n\tonToggleIsOpen?: (event: MouseEvent, data: StepToggleEventData) => void;\n\tstepNumber?: number;\n}\n\n/**\n * Props for the SetupAssistant component\n */\nexport interface SetupAssistantProps {\n\t/** SetupAssistantStep components */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether the assistant has card styling */\n\tisCard?: boolean;\n\t/** Called when a step requests to expand / collapse. `data.isOpen` is the requested (next) state. */\n\tonStepToggleIsOpen?: (event: MouseEvent, data: StepToggleEventData) => void;\n\t/** Progress bar component */\n\tprogressBar?: ReactNode;\n}\n\n/**\n * Setup Assistant provides Administrators with a centralized list of tasks for\n * onboarding organizations, clouds, or features within the Salesforce Platform.\n */\nconst SetupAssistant = ({\n\tchildren,\n\tclassName,\n\tid: propId,\n\tisCard = false,\n\tonStepToggleIsOpen,\n\tprogressBar,\n}: SetupAssistantProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst steps = (\n\t\t<ol\n\t\t\tid={id}\n\t\t\tclassName={classNames('slds-setup-assistant', className as string)}\n\t\t>\n\t\t\t{React.Children.map(children, (child, i) => {\n\t\t\t\tif (!React.isValidElement(child)) return null;\n\t\t\t\tif (\n\t\t\t\t\t(child.type as { displayName?: string }).displayName !==\n\t\t\t\t\tSETUP_ASSISTANT_STEP\n\t\t\t\t) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tconst childProps = child.props as SetupAssistantStepChildProps;\n\t\t\t\treturn React.cloneElement(\n\t\t\t\t\tchild as ReactElement<SetupAssistantStepChildProps>,\n\t\t\t\t\t{\n\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\tonToggleIsOpen: onStepToggleIsOpen,\n\t\t\t\t\t\tstepNumber: i + 1,\n\t\t\t\t\t\t...childProps,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t})}\n\t\t</ol>\n\t);\n\n\tif (isCard) {\n\t\treturn (\n\t\t\t<section className=\"slds-card\">\n\t\t\t\t<header className=\"slds-theme_shade slds-p-around_medium slds-m-bottom_small\">\n\t\t\t\t\t{progressBar}\n\t\t\t\t</header>\n\t\t\t\t{steps}\n\t\t\t</section>\n\t\t);\n\t}\n\n\treturn <>{steps}</>;\n};\n\nSetupAssistant.displayName = SETUP_ASSISTANT;\n\nexport default SetupAssistant;\n"],"mappings":";;;;;AA2DA,IAAM,KAAkB,EACvB,aACA,cACA,IAAI,GACJ,YAAS,IACT,uBACA,qBAC8C;CAC9C,IAAM,IAAc,EAAM,GAGpB,IACL,kBAAC,MAAD;EACK,IAJK,KAAU;EAKnB,WAAW,EAAW,wBAAwB,CAAmB;EAEhE,UAAA,EAAM,SAAS,IAAI,IAAW,GAAO,MAAM;GAE3C,IADI,CAAC,EAAM,eAAe,CAAK,KAE7B,EAAM,KAAkC,gBAAA,0BAGzC,OAAO;GAER,IAAM,IAAa,EAAM;GACzB,OAAO,EAAM,aACZ,GACA;IACC,OAAO;IACP,gBAAgB;IAChB,YAAY,IAAI;IAChB,GAAG;GACJ,CACD;EACD,CAAC;CACE,CAAA;CAcL,OAXI,IAEF,kBAAC,WAAD;EAAS,WAAU;EAAnB,UAAA,CACC,kBAAC,UAAD;GAAQ,WAAU;GAChB,UAAA;EACM,CAAA,GACP,CACO;MAIJ,kBAAA,GAAA,EAAA,UAAG,EAAQ,CAAA;AACnB;AAEA,EAAe,cAAc"}
@@ -25,7 +25,7 @@ var d = { assistiveText: { expandStep: "Expand Step" } }, f = class extends o.Co
25
25
  toggleIsOpen = (e) => {
26
26
  this.props.onToggleIsOpen ? this.props.onToggleIsOpen(e, {
27
27
  index: this.props.index,
28
- isOpen: this.getIsOpen(),
28
+ isOpen: !this.getIsOpen(),
29
29
  step: this.props
30
30
  }) : this.setState({ isOpen: !this.getIsOpen() });
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"step.js","names":[],"sources":["../../../../components/setup-assistant/step.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode, type CSSProperties, type SyntheticEvent } from 'react';\nimport classNames from 'classnames';\n\nimport assign from 'lodash.assign';\n\n// This component's `checkProps` which issues warnings to developers about properties\n// when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport Button from '../button';\nimport ProgressRing from '../progress-ring';\n\nimport { ICON, SETUP_ASSISTANT_STEP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nexport interface StepAssistiveText {\n\t/** Button that examples a step */\n\texpandStep?: string;\n}\n\nexport interface StepToggleData {\n\tindex?: number;\n\tisOpen: boolean;\n\tstep: StepProps;\n}\n\nexport interface StepProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `expandStep`: Button that examples a step\n\t * _Tested with snapshot testing._\n\t */\n\tassistiveText?: StepAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Detailed description of the step\n\t */\n\tdescription?: string | ReactNode;\n\t/**\n\t * Estimated time for completing the step\n\t */\n\testimatedTime?: string | ReactNode;\n\t/**\n\t * Heading for the step\n\t */\n\theading?: string | ReactNode;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Index of the step within the step array\n\t */\n\tindex?: number;\n\t/**\n\t * Dictates whether the step can be expanded / collapsed\n\t */\n\tisExpandable?: boolean;\n\t/**\n\t * If `isExpandable` is true, this prop can be used to control the expanded state. If not provided state will be used instead\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Function that is called to render a step's available action(s). Typically returns a Button, Button of variant \"link,\" or Checkbox of variant \"toggle\"\n\t */\n\tonRenderAction?: () => ReactNode;\n\t/**\n\t * Function that is called to render step content. Typically returns a ProgressIndicator and/or ScopedNotification component\n\t */\n\tonRenderContent?: () => ReactNode;\n\t/**\n\t * Function that is called to render content within the media figure. Expects to be returned an Icon or ProgressRing component\n\t */\n\tonRenderFigure?: () => React.ReactElement | null;\n\t/**\n\t * Function to handle requests to expand / collapse the step\n\t */\n\tonToggleIsOpen?: (event: SyntheticEvent, data: StepToggleData) => void;\n\t/**\n\t * Percentage of step completed. No progress indicator will be shown for the step unless this is provided\n\t */\n\tprogress?: number;\n\t/**\n\t * Display number for the step. Only appears if progress indicator is enabled. Determined automatically by parent if not provided.\n\t */\n\tstepNumber?: number;\n}\n\ninterface StepState {\n\tisOpen: boolean;\n}\n\nconst defaultProps: Partial<StepProps> = {\n\tassistiveText: { expandStep: 'Expand Step' },\n};\n\n/**\n * Setup Assistant Step component is used to specify individual items within the Setup Assistant\n * filled with learning and task links along with a recommended sequence that may have progress tracking\n */\nclass Step extends React.Component<StepProps, StepState> {\n\tstatic displayName = SETUP_ASSISTANT_STEP;\n\n\tstatic defaultProps = defaultProps;\n\n\tgeneratedId: string;\n\n\tconstructor(props: StepProps) {\n\t\tsuper(props);\n\t\tthis.generatedId = generateId();\n\t\tthis.state = {\n\t\t\tisOpen: props.isOpen || false,\n\t\t};\n\t\t(checkProps as (name: string, props: unknown, doc?: unknown) => void)(\n\t\t\tSETUP_ASSISTANT_STEP,\n\t\t\tthis.props,\n\t\t\tcomponentDoc\n\t\t);\n\t}\n\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\tgetIsOpen() {\n\t\treturn this.props.isOpen !== undefined\n\t\t\t? this.props.isOpen\n\t\t\t: this.state.isOpen;\n\t}\n\n\ttoggleIsOpen = (event: SyntheticEvent) => {\n\t\tif (this.props.onToggleIsOpen) {\n\t\t\tthis.props.onToggleIsOpen(event, {\n\t\t\t\tindex: this.props.index,\n\t\t\t\tisOpen: this.getIsOpen(),\n\t\t\t\tstep: this.props,\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({ isOpen: !this.getIsOpen() });\n\t\t}\n\t};\n\n\trenderMediaContent() {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<div className=\"slds-setup-assistant__step-summary-content slds-media__body\">\n\t\t\t\t\t<h3 className=\"slds-setup-assistant__step-summary-title slds-text-heading_small\">\n\t\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-button_reset\"\n\t\t\t\t\t\t\t\tlabel={this.props.heading}\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tthis.props.heading\n\t\t\t\t\t\t)}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>{this.props.description}</p>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"slds-media__figure slds-media__figure_reverse\">\n\t\t\t\t\t{this.props.onRenderAction ? this.props.onRenderAction() : null}\n\t\t\t\t\t{this.props.estimatedTime ? (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t'slds-text-align_right',\n\t\t\t\t\t\t\t\t'slds-text-color_weak',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'slds-p-top_medium': this.props.onRenderAction !== undefined,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this.props.estimatedTime}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\n\trenderSummary() {\n\t\tlet figure: ReactNode;\n\t\tlet progressRingTheme: 'active' | 'complete' | undefined;\n\n\t\tif (\n\t\t\tthis.props.progress !== undefined &&\n\t\t\tthis.props.progress > 0 &&\n\t\t\tthis.props.progress < 100\n\t\t) {\n\t\t\tprogressRingTheme = 'active';\n\t\t} else if (this.props.progress === 100) {\n\t\t\tprogressRingTheme = 'complete';\n\t\t}\n\n\t\tif (this.props.onRenderFigure) {\n\t\t\tconst renderedFigure = this.props.onRenderFigure();\n\n\t\t\tif (\n\t\t\t\trenderedFigure &&\n\t\t\t\trenderedFigure.type &&\n\t\t\t\t(renderedFigure.type as { displayName?: string }).displayName === ICON\n\t\t\t) {\n\t\t\t\tconst figureProps = renderedFigure.props as {\n\t\t\t\t\tcontainerStyle?: CSSProperties;\n\t\t\t\t};\n\t\t\t\tlet containerStyle: CSSProperties = {\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\ttop: this.props.isExpandable ? '5px' : '-3px',\n\t\t\t\t};\n\n\t\t\t\tif (figureProps.containerStyle) {\n\t\t\t\t\tcontainerStyle = {\n\t\t\t\t\t\t...containerStyle,\n\t\t\t\t\t\t...figureProps.containerStyle,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst clonedFigure = React.cloneElement(renderedFigure, {\n\t\t\t\t\t...figureProps,\n\t\t\t\t\tcontainerStyle,\n\t\t\t\t\tsize: 'small',\n\t\t\t\t} as Partial<unknown>);\n\t\t\t\tfigure = <div className=\"slds-media__figure\">{clonedFigure}</div>;\n\t\t\t} else {\n\t\t\t\tfigure = renderedFigure;\n\t\t\t}\n\t\t} else if (this.props.progress !== undefined) {\n\t\t\tfigure = (\n\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t<ProgressRing\n\t\t\t\t\t\thasIcon\n\t\t\t\t\t\ticon={this.props.progress === 100 ? null : this.props.stepNumber}\n\t\t\t\t\t\tflowDirection=\"fill\"\n\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\ttheme={progressRingTheme}\n\t\t\t\t\t\tvalue={this.props.progress}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-setup-assistant__step-summary\">\n\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t{figure}\n\t\t\t\t\t{this.props.isExpandable || this.props.progress !== undefined ? (\n\t\t\t\t\t\t<div className=\"slds-media__body slds-m-top_x-small\">\n\t\t\t\t\t\t\t<div className=\"slds-media\">{this.renderMediaContent()}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.renderMediaContent()\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst assistiveText = assign(\n\t\t\t{},\n\t\t\tdefaultProps.assistiveText,\n\t\t\tthis.props.assistiveText\n\t\t);\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-setup-assistant__item',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\tid={this.getId()}\n\t\t\t>\n\t\t\t\t<article className=\"slds-setup-assistant__step\">\n\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames('slds-summary-detail', {\n\t\t\t\t\t\t\t\t'slds-is-open': this.getIsOpen(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tassistiveText={{ icon: assistiveText.expandStep }}\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-m-right_x-small slds-m-top_x-small\"\n\t\t\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\t\t\ticonClassName=\"slds-summary-detail__action-icon\"\n\t\t\t\t\t\t\t\ticonName=\"switch\"\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"slds-container_fluid\">\n\t\t\t\t\t\t\t\t<div className=\"slds-summary-detail__title\">\n\t\t\t\t\t\t\t\t\t{this.renderSummary()}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"slds-summary-detail__content\"\n\t\t\t\t\t\t\t\t\tid={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"slds-setup-assistant__step-detail\">\n\t\t\t\t\t\t\t\t\t\t{this.props.onRenderContent\n\t\t\t\t\t\t\t\t\t\t\t? this.props.onRenderContent()\n\t\t\t\t\t\t\t\t\t\t\t: null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BAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,GACA,KAAK,MAAM,gBAAgB,KAAK,MAAM,aAAa,KAAA,IACnD,kBAAC,OAAD;KAAK,WAAU;KACd,UAAA,kBAAC,OAAD;MAAK,WAAU;MAAc,UAAA,KAAK,mBAAmB;KAAO,CAAA;IACxD,CAAA,IAEL,KAAK,mBAAmB,CAErB;;EACD,CAAA;CAEP;CAEA,SAAS;EACR,IAAM,IAAgB,EACrB,CAAC,GACD,EAAa,eACb,KAAK,MAAM,aACZ;EACA,OACC,kBAAC,MAAD;GACC,WAAW,EACV,8BACA,KAAK,MAAM,SACZ;GACA,IAAI,KAAK,MAAM;GAEf,UAAA,kBAAC,WAAD;IAAS,WAAU;IACjB,UAAA,KAAK,MAAM,eACX,kBAAC,OAAD;KACC,WAAW,EAAW,uBAAuB,EAC5C,gBAAgB,KAAK,UAAU,EAChC,CAAC;KAHF,UAAA,CAKC,kBAAC,GAAD;MACC,eAAe,EAAE,MAAM,EAAc,WAAW;MAChD,iBAAe,GAAG,KAAK,MAAM,EAAE;MAC/B,WAAU;MACV,cAAa;MACb,eAAc;MACd,UAAS;MACT,SAAS,KAAK;MACd,SAAQ;KACR,CAAA,GACD,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACC,kBAAC,OAAD;OAAK,WAAU;OACb,UAAA,KAAK,cAAc;MAChB,CAAA,GACL,kBAAC,OAAD;OACC,WAAU;OACV,IAAI,GAAG,KAAK,MAAM,EAAE;OAEpB,UAAA,kBAAC,OAAD;QAAK,WAAU;QACb,UAAA,KAAK,MAAM,kBACT,KAAK,MAAM,gBAAgB,IAC3B;OACC,CAAA;MACD,CAAA,CACD;KACD,CAAA,CAAA;IAEL,CAAA,IAAA,KAAK,cAAc;GAEZ,CAAA;EACN,CAAA;CAEN;AACD"}
1
+ {"version":3,"file":"step.js","names":[],"sources":["../../../../components/setup-assistant/step.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype SyntheticEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport assign from 'lodash.assign';\n\n// This component's `checkProps` which issues warnings to developers about properties\n// when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport Button from '../button';\nimport ProgressRing from '../progress-ring';\n\nimport { ICON, SETUP_ASSISTANT_STEP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nexport interface StepAssistiveText {\n\t/** Button that examples a step */\n\texpandStep?: string;\n}\n\n/**\n * Data passed to `onToggleIsOpen`\n */\nexport interface StepToggleData {\n\t/** Index of the step within the Setup Assistant (set by the parent `SetupAssistant`) */\n\tindex?: number;\n\t/** Requested (next) open state: `true` to expand the step, `false` to collapse it */\n\tisOpen: boolean;\n\t/** Props of the step being toggled */\n\tstep: StepProps;\n}\n\nexport interface StepProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `expandStep`: Button that examples a step\n\t * _Tested with snapshot testing._\n\t */\n\tassistiveText?: StepAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Detailed description of the step\n\t */\n\tdescription?: string | ReactNode;\n\t/**\n\t * Estimated time for completing the step\n\t */\n\testimatedTime?: string | ReactNode;\n\t/**\n\t * Heading for the step\n\t */\n\theading?: string | ReactNode;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Index of the step within the step array\n\t */\n\tindex?: number;\n\t/**\n\t * Dictates whether the step can be expanded / collapsed\n\t */\n\tisExpandable?: boolean;\n\t/**\n\t * If `isExpandable` is true, this prop can be used to control the expanded state. If not provided state will be used instead\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Function that is called to render a step's available action(s). Typically returns a Button, Button of variant \"link,\" or Checkbox of variant \"toggle\"\n\t */\n\tonRenderAction?: () => ReactNode;\n\t/**\n\t * Function that is called to render step content. Typically returns a ProgressIndicator and/or ScopedNotification component\n\t */\n\tonRenderContent?: () => ReactNode;\n\t/**\n\t * Function that is called to render content within the media figure. Expects to be returned an Icon or ProgressRing component\n\t */\n\tonRenderFigure?: () => React.ReactElement | null;\n\t/**\n\t * Function to handle requests to expand / collapse the step. `data.isOpen` is the requested (next) state.\n\t */\n\tonToggleIsOpen?: (event: SyntheticEvent, data: StepToggleData) => void;\n\t/**\n\t * Percentage of step completed. No progress indicator will be shown for the step unless this is provided\n\t */\n\tprogress?: number;\n\t/**\n\t * Display number for the step. Only appears if progress indicator is enabled. Determined automatically by parent if not provided.\n\t */\n\tstepNumber?: number;\n}\n\ninterface StepState {\n\tisOpen: boolean;\n}\n\nconst defaultProps: Partial<StepProps> = {\n\tassistiveText: { expandStep: 'Expand Step' },\n};\n\n/**\n * Setup Assistant Step component is used to specify individual items within the Setup Assistant\n * filled with learning and task links along with a recommended sequence that may have progress tracking\n */\nclass Step extends React.Component<StepProps, StepState> {\n\tstatic displayName = SETUP_ASSISTANT_STEP;\n\n\tstatic defaultProps = defaultProps;\n\n\tgeneratedId: string;\n\n\tconstructor(props: StepProps) {\n\t\tsuper(props);\n\t\tthis.generatedId = generateId();\n\t\tthis.state = {\n\t\t\tisOpen: props.isOpen || false,\n\t\t};\n\t\t(checkProps as (name: string, props: unknown, doc?: unknown) => void)(\n\t\t\tSETUP_ASSISTANT_STEP,\n\t\t\tthis.props,\n\t\t\tcomponentDoc\n\t\t);\n\t}\n\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\tgetIsOpen() {\n\t\treturn this.props.isOpen !== undefined\n\t\t\t? this.props.isOpen\n\t\t\t: this.state.isOpen;\n\t}\n\n\ttoggleIsOpen = (event: SyntheticEvent) => {\n\t\tif (this.props.onToggleIsOpen) {\n\t\t\tthis.props.onToggleIsOpen(event, {\n\t\t\t\tindex: this.props.index,\n\t\t\t\tisOpen: !this.getIsOpen(),\n\t\t\t\tstep: this.props,\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({ isOpen: !this.getIsOpen() });\n\t\t}\n\t};\n\n\trenderMediaContent() {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<div className=\"slds-setup-assistant__step-summary-content slds-media__body\">\n\t\t\t\t\t<h3 className=\"slds-setup-assistant__step-summary-title slds-text-heading_small\">\n\t\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-button_reset\"\n\t\t\t\t\t\t\t\tlabel={this.props.heading}\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tthis.props.heading\n\t\t\t\t\t\t)}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>{this.props.description}</p>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"slds-media__figure slds-media__figure_reverse\">\n\t\t\t\t\t{this.props.onRenderAction ? this.props.onRenderAction() : null}\n\t\t\t\t\t{this.props.estimatedTime ? (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t'slds-text-align_right',\n\t\t\t\t\t\t\t\t'slds-text-color_weak',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'slds-p-top_medium': this.props.onRenderAction !== undefined,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this.props.estimatedTime}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\n\trenderSummary() {\n\t\tlet figure: ReactNode;\n\t\tlet progressRingTheme: 'active' | 'complete' | undefined;\n\n\t\tif (\n\t\t\tthis.props.progress !== undefined &&\n\t\t\tthis.props.progress > 0 &&\n\t\t\tthis.props.progress < 100\n\t\t) {\n\t\t\tprogressRingTheme = 'active';\n\t\t} else if (this.props.progress === 100) {\n\t\t\tprogressRingTheme = 'complete';\n\t\t}\n\n\t\tif (this.props.onRenderFigure) {\n\t\t\tconst renderedFigure = this.props.onRenderFigure();\n\n\t\t\tif (\n\t\t\t\trenderedFigure &&\n\t\t\t\trenderedFigure.type &&\n\t\t\t\t(renderedFigure.type as { displayName?: string }).displayName === ICON\n\t\t\t) {\n\t\t\t\tconst figureProps = renderedFigure.props as {\n\t\t\t\t\tcontainerStyle?: CSSProperties;\n\t\t\t\t};\n\t\t\t\tlet containerStyle: CSSProperties = {\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\ttop: this.props.isExpandable ? '5px' : '-3px',\n\t\t\t\t};\n\n\t\t\t\tif (figureProps.containerStyle) {\n\t\t\t\t\tcontainerStyle = {\n\t\t\t\t\t\t...containerStyle,\n\t\t\t\t\t\t...figureProps.containerStyle,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst clonedFigure = React.cloneElement(renderedFigure, {\n\t\t\t\t\t...figureProps,\n\t\t\t\t\tcontainerStyle,\n\t\t\t\t\tsize: 'small',\n\t\t\t\t} as Partial<unknown>);\n\t\t\t\tfigure = <div className=\"slds-media__figure\">{clonedFigure}</div>;\n\t\t\t} else {\n\t\t\t\tfigure = renderedFigure;\n\t\t\t}\n\t\t} else if (this.props.progress !== undefined) {\n\t\t\tfigure = (\n\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t<ProgressRing\n\t\t\t\t\t\thasIcon\n\t\t\t\t\t\ticon={this.props.progress === 100 ? null : this.props.stepNumber}\n\t\t\t\t\t\tflowDirection=\"fill\"\n\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\ttheme={progressRingTheme}\n\t\t\t\t\t\tvalue={this.props.progress}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-setup-assistant__step-summary\">\n\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t{figure}\n\t\t\t\t\t{this.props.isExpandable || this.props.progress !== undefined ? (\n\t\t\t\t\t\t<div className=\"slds-media__body slds-m-top_x-small\">\n\t\t\t\t\t\t\t<div className=\"slds-media\">{this.renderMediaContent()}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.renderMediaContent()\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst assistiveText = assign(\n\t\t\t{},\n\t\t\tdefaultProps.assistiveText,\n\t\t\tthis.props.assistiveText\n\t\t);\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-setup-assistant__item',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\tid={this.getId()}\n\t\t\t>\n\t\t\t\t<article className=\"slds-setup-assistant__step\">\n\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames('slds-summary-detail', {\n\t\t\t\t\t\t\t\t'slds-is-open': this.getIsOpen(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tassistiveText={{ icon: assistiveText.expandStep }}\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-m-right_x-small slds-m-top_x-small\"\n\t\t\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\t\t\ticonClassName=\"slds-summary-detail__action-icon\"\n\t\t\t\t\t\t\t\ticonName=\"switch\"\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"slds-container_fluid\">\n\t\t\t\t\t\t\t\t<div className=\"slds-summary-detail__title\">\n\t\t\t\t\t\t\t\t\t{this.renderSummary()}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"slds-summary-detail__content\"\n\t\t\t\t\t\t\t\t\tid={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"slds-setup-assistant__step-detail\">\n\t\t\t\t\t\t\t\t\t\t{this.props.onRenderContent\n\t\t\t\t\t\t\t\t\t\t\t? this.props.onRenderContent()\n\t\t\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.renderSummary()\n\t\t\t\t\t)}\n\t\t\t\t</article>\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nexport default Step;\n"],"mappings":";;;;;;;;;;;AA8GA,IAAM,IAAmC,EACxC,eAAe,EAAE,YAAY,cAAc,EAC5C,GAMM,IAAN,cAAmB,EAAM,UAAgC;CACxD,OAAO,cAAc;CAErB,OAAO,eAAe;CAEtB;CAEA,YAAY,GAAkB;EAM7B,AALA,MAAM,CAAK,GACX,KAAK,cAAc,EAAW,GAC9B,KAAK,QAAQ,EACZ,QAAQ,EAAM,UAAU,GACzB,GACA,EACC,GACA,KAAK,OACL,CACD;CACD;CAEA,QAAQ;EACP,OAAO,KAAK,MAAM,MAAM,KAAK;CAC9B;CAEA,YAAY;EACX,OAAO,KAAK,MAAM,WAAW,KAAA,IAE1B,KAAK,MAAM,SADX,KAAK,MAAM;CAEf;CAEA,gBAAgB,MAA0B;EACzC,AAAI,KAAK,MAAM,iB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S,KAAK;MACd,SAAQ;KACR,CAAA,GACD,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACC,kBAAC,OAAD;OAAK,WAAU;OACb,UAAA,KAAK,cAAc;MAChB,CAAA,GACL,kBAAC,OAAD;OACC,WAAU;OACV,IAAI,GAAG,KAAK,MAAM,EAAE;OAEpB,UAAA,kBAAC,OAAD;QAAK,WAAU;QACb,UAAA,KAAK,MAAM,kBACT,KAAK,MAAM,gBAAgB,IAC3B;OACC,CAAA;MACD,CAAA,CACD;KACD,CAAA,CAAA;IAEL,CAAA,IAAA,KAAK,cAAc;GAEZ,CAAA;EACN,CAAA;CAEN;AACD"}
@@ -1,11 +1,11 @@
1
1
  import e from "../../utilities/warning/sunset-property.js";
2
- import t from "../../utilities/warning/deprecated-property.js";
3
- import n from "../../utilities/get-component-doc.js";
2
+ import t from "../../utilities/get-component-doc.js";
3
+ import n from "../../utilities/warning/deprecated-property.js";
4
4
  //#region components/simple-data-table/check-props.js
5
5
  var r = function() {};
6
6
  process.env.NODE_ENV !== "production" && (r = function(r, i, a) {
7
- let o = n(a);
8
- t(r, i.onChange, "onChange", "onRowChange", "The callback parameters have been changed. `onRowChange` passes in `[event, { selection }` in order to align with other components."), t(r, i.compact, "compact", void 0, `compact has been deprecated as non-compact data tables do not exist in SLDS. ${o()}`), t(r, i.collection, "collection", "items", o("items")), t(r, i.onSelect, "onSelect", "onChange", o("onChange")), t(r, i.onDeselect, "onDeselect", "onChange", o("onChange")), e(r, i.sortable, "sortable", `The table is sortable if one or more of its columns are sortable. ${o()}`), e(r, i.columns, "columns", `Please provide one or more children of the type <Column /> instead. ${o()}`), e(r, i.bordered, "bordered", `All SLDS SimpleDataTables have row borders by default now. If you do not want row borders, please use \`unborderedRow\`. ${o("unborderedRow")}`), t(r, i.assistiveTextForActionsHeader, "assistiveTextForActionsHeader", "assistiveText['actionsHeader']", o("assistiveText")), t(r, i.assistiveTextForColumnSort, "assistiveTextForColumnSort", "assistiveText['columnSort']", o("assistiveText")), t(r, i.assistiveTextForColumnSortedAscending, "assistiveTextForColumnSortedAscending", "assistiveText['columnSortedAscending']", o("assistiveText")), t(r, i.assistiveTextForColumnSortedDescending, "assistiveTextForColumnSortedDescending", "assistiveText['columnSortedDescending']", o("assistiveText")), t(r, i.assistiveTextForSelectAllRows, "assistiveTextForSelectAllRows", "assistiveText['selectAllRows']", o("assistiveText")), t(r, i.assistiveTextForSelectRow, "assistiveTextForSelectRow", "assistiveText['selectRow']", o("assistiveText"));
7
+ let o = t(a);
8
+ n(r, i.onChange, "onChange", "onRowChange", "The callback parameters have been changed. `onRowChange` passes in `[event, { selection }` in order to align with other components."), n(r, i.compact, "compact", void 0, `compact has been deprecated as non-compact data tables do not exist in SLDS. ${o()}`), n(r, i.collection, "collection", "items", o("items")), n(r, i.onSelect, "onSelect", "onChange", o("onChange")), n(r, i.onDeselect, "onDeselect", "onChange", o("onChange")), e(r, i.sortable, "sortable", `The table is sortable if one or more of its columns are sortable. ${o()}`), e(r, i.columns, "columns", `Please provide one or more children of the type <Column /> instead. ${o()}`), e(r, i.bordered, "bordered", `All SLDS SimpleDataTables have row borders by default now. If you do not want row borders, please use \`unborderedRow\`. ${o("unborderedRow")}`), n(r, i.assistiveTextForActionsHeader, "assistiveTextForActionsHeader", "assistiveText['actionsHeader']", o("assistiveText")), n(r, i.assistiveTextForColumnSort, "assistiveTextForColumnSort", "assistiveText['columnSort']", o("assistiveText")), n(r, i.assistiveTextForColumnSortedAscending, "assistiveTextForColumnSortedAscending", "assistiveText['columnSortedAscending']", o("assistiveText")), n(r, i.assistiveTextForColumnSortedDescending, "assistiveTextForColumnSortedDescending", "assistiveText['columnSortedDescending']", o("assistiveText")), n(r, i.assistiveTextForSelectAllRows, "assistiveTextForSelectAllRows", "assistiveText['selectAllRows']", o("assistiveText")), n(r, i.assistiveTextForSelectRow, "assistiveTextForSelectRow", "assistiveText['selectRow']", o("assistiveText"));
9
9
  });
10
10
  var i = r;
11
11
  //#endregion
@@ -13,8 +13,8 @@ import u from "lodash.isfunction";
13
13
  var d = o(n), f = ({ assistiveText: e = { icon: "Actions" }, noHint: n = !1, options: o = [], className: f, id: p, item: m, onAction: h, dropdown: g, fixedLayout: _ }) => {
14
14
  let v = s(i), y = s(r), { tabIndex: b, hasFocus: x, handleFocus: S, handleKeyDown: C } = a(v, y, _), w = (e) => {
15
15
  t.trap(e);
16
- }, T = (e) => {
17
- u(h) && m && h(m, e), g && u(g.props?.onSelect) && g.props.onSelect(e);
16
+ }, T = (e, t) => {
17
+ u(h) && m && h(m, t.option), g && u(g.props?.onSelect) && g.props.onSelect(e, t);
18
18
  }, E = {
19
19
  align: "right",
20
20
  buttonClassName: "slds-button_icon-x-small",
@@ -1 +1 @@
1
- {"version":3,"file":"row-actions.js","names":[],"sources":["../../../../components/simple-data-table/row-actions.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useContext, ReactNode } from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\nimport Dropdown from '../menu-dropdown';\n\nimport EventUtil from '../../utilities/event';\n\nimport InteractiveElement from './interactive-element';\nimport CellContext from './private/cell-context';\nimport TableContext from './private/table-context';\nimport useContextHelper from './private/context-helper';\n\nimport { SIMPLE_DATA_TABLE_ROW_ACTIONS } from '../../utilities/constants';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst InteractiveDropdown = InteractiveElement(\n\tDropdown as any\n) as React.ComponentType<any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport interface SimpleDataTableRowActionsProps {\n\t/** Description of the menu for screenreaders */\n\tassistiveText?: { icon?: string };\n\t/** Class names to be added to the actions menu */\n\tclassName?: string;\n\t/** HTML ID to be added to the actions menu */\n\tid?: string;\n\t/** SimpleDataTable row item */\n\titem?: Record<string, unknown>;\n\t/** Disable hint styling which changes the color of the dropdown svg on hover */\n\tnoHint?: boolean;\n\t/** Triggered when an item is selected */\n\tonAction?: (item: Record<string, unknown>, selection: unknown) => void;\n\t/** Dropdown options. See Dropdown. */\n\toptions?: unknown[];\n\t/** A Dropdown component. Props from this will be merged and override defaults. */\n\tdropdown?: ReactNode;\n\t/** Fixed layout mode */\n\tfixedLayout?: boolean;\n}\n\n/**\n * RowActions provide a mechanism for defining a menu to display alongside\n * each row in the SimpleDataTable.\n */\nconst SimpleDataTableRowActions: React.FC<SimpleDataTableRowActionsProps> = ({\n\tassistiveText = { icon: 'Actions' },\n\tnoHint = false,\n\toptions = [],\n\tclassName,\n\tid,\n\titem,\n\tonAction,\n\tdropdown,\n\tfixedLayout,\n}) => {\n\tconst tableContext = useContext(TableContext);\n\tconst cellContext = useContext(CellContext);\n\tconst { tabIndex, hasFocus, handleFocus, handleKeyDown } = useContextHelper(\n\t\ttableContext,\n\t\tcellContext,\n\t\tfixedLayout\n\t);\n\n\tconst handleClick = (e: React.MouseEvent) => {\n\t\tEventUtil.trap(e);\n\t};\n\n\tconst handleSelect = (selection: unknown) => {\n\t\tif (isFunction(onAction) && item) {\n\t\t\tonAction(item, selection);\n\t\t}\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tif (dropdown && isFunction((dropdown as any).props?.onSelect)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t(dropdown as any).props.onSelect(selection);\n\t\t}\n\t};\n\n\tconst defaultDropdownProps = {\n\t\talign: 'right',\n\t\tbuttonClassName: 'slds-button_icon-x-small',\n\t\tbuttonVariant: 'icon',\n\t\ticonCategory: 'utility',\n\t\ticonName: 'down',\n\t\ticonSize: 'small',\n\t\ticonVariant: 'border-filled',\n\t\tassistiveText,\n\t\tclassName,\n\t\toptions,\n\t\thint: !noHint,\n\t\tid,\n\t};\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tlet dropdownProps: Record<string, any> = dropdown\n\t\t? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t(dropdown as any).props\n\t\t: {};\n\tdropdownProps = {\n\t\t...defaultDropdownProps,\n\t\t...dropdownProps,\n\t\tonSelect: handleSelect,\n\t};\n\n\treturn (\n\t\t<td\n\t\t\tclassName={classNames({ 'slds-has-focus': hasFocus })}\n\t\t\tdata-label=\"Actions\"\n\t\t\tonClick={handleClick}\n\t\t\tstyle={{ width: '3.25rem' }}\n\t\t\tonFocus={handleFocus}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tref={(ref) => {\n\t\t\t\tif (ref && hasFocus) {\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t\trole={fixedLayout ? 'gridcell' : undefined}\n\t\t\ttabIndex={tabIndex}\n\t\t>\n\t\t\t<InteractiveDropdown {...dropdownProps} />\n\t\t</td>\n\t);\n};\n\nSimpleDataTableRowActions.displayName = SIMPLE_DATA_TABLE_ROW_ACTIONS;\n\nexport default SimpleDataTableRowActions;\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAM,IAAsB,EAC3B,CACD,GA4BM,KAAuE,EAC5E,mBAAgB,EAAE,MAAM,UAAU,GAClC,YAAS,IACT,aAAU,CAAC,GACX,cACA,OACA,SACA,aACA,aACA,qBACK;CACL,IAAM,IAAe,EAAW,CAAY,GACtC,IAAc,EAAW,CAAW,GACpC,EAAE,aAAU,aAAU,gBAAa,qBAAkB,EAC1D,GACA,GACA,CACD,GAEM,KAAe,MAAwB;EAC5C,EAAU,KAAK,CAAC;CACjB,GAEM,KAAgB,MAAuB;EAK5C,AAJI,EAAW,CAAQ,KAAK,KAC3B,EAAS,GAAM,CAAS,GAGrB,KAAY,EAAY,EAAiB,OAAO,QAAQ,KAE3D,EAAkB,MAAM,SAAS,CAAS;CAE5C,GAEM,IAAuB;EAC5B,OAAO;EACP,iBAAiB;EACjB,eAAe;EACf,cAAc;EACd,UAAU;EACV,UAAU;EACV,aAAa;EACb;EACA;EACA;EACA,MAAM,CAAC;EACP;CACD,GAGI,IAAqC,IAEtC,EAAiB,QACjB,CAAC;CAOJ,OANA,IAAgB;EACf,GAAG;EACH,GAAG;EACH,UAAU;CACX,GAGC,kBAAC,MAAD;EACC,WAAW,EAAW,EAAE,kBAAkB,EAAS,CAAC;EACpD,cAAW;EACX,SAAS;EACT,OAAO,EAAE,OAAO,UAAU;EAC1B,SAAS;EACT,WAAW;EACX,MAAM,MAAQ;GACb,AAAI,KAAO,KACV,EAAI,MAAM;EAEZ;EACA,MAAM,IAAc,aAAa,KAAA;EACvB;EAEV,UAAA,kBAAC,GAAD,EAAqB,GAAI,EAAgB,CAAA;CACtC,CAAA;AAEN;AAEA,EAA0B,cAAc"}
1
+ {"version":3,"file":"row-actions.js","names":[],"sources":["../../../../components/simple-data-table/row-actions.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useContext, ReactNode } from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\nimport Dropdown, { type MenuDropdownProps } from '../menu-dropdown';\n\nimport EventUtil from '../../utilities/event';\n\nimport InteractiveElement from './interactive-element';\nimport CellContext from './private/cell-context';\nimport TableContext from './private/table-context';\nimport useContextHelper from './private/context-helper';\n\nimport { SIMPLE_DATA_TABLE_ROW_ACTIONS } from '../../utilities/constants';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst InteractiveDropdown = InteractiveElement(\n\tDropdown as any\n) as React.ComponentType<any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport interface SimpleDataTableRowActionsProps {\n\t/** Description of the menu for screenreaders */\n\tassistiveText?: { icon?: string };\n\t/** Class names to be added to the actions menu */\n\tclassName?: string;\n\t/** HTML ID to be added to the actions menu */\n\tid?: string;\n\t/** SimpleDataTable row item */\n\titem?: Record<string, unknown>;\n\t/** Disable hint styling which changes the color of the dropdown svg on hover */\n\tnoHint?: boolean;\n\t/** Triggered when an item is selected */\n\tonAction?: (item: Record<string, unknown>, selection: unknown) => void;\n\t/** Dropdown options. See Dropdown. */\n\toptions?: unknown[];\n\t/** A Dropdown component. Props from this will be merged and override defaults. */\n\tdropdown?: ReactNode;\n\t/** Fixed layout mode */\n\tfixedLayout?: boolean;\n}\n\n/**\n * RowActions provide a mechanism for defining a menu to display alongside\n * each row in the SimpleDataTable.\n */\nconst SimpleDataTableRowActions: React.FC<SimpleDataTableRowActionsProps> = ({\n\tassistiveText = { icon: 'Actions' },\n\tnoHint = false,\n\toptions = [],\n\tclassName,\n\tid,\n\titem,\n\tonAction,\n\tdropdown,\n\tfixedLayout,\n}) => {\n\tconst tableContext = useContext(TableContext);\n\tconst cellContext = useContext(CellContext);\n\tconst { tabIndex, hasFocus, handleFocus, handleKeyDown } = useContextHelper(\n\t\ttableContext,\n\t\tcellContext,\n\t\tfixedLayout\n\t);\n\n\tconst handleClick = (e: React.MouseEvent) => {\n\t\tEventUtil.trap(e);\n\t};\n\n\tconst handleSelect: NonNullable<MenuDropdownProps['onSelect']> = (\n\t\tevent,\n\t\tdata\n\t) => {\n\t\tif (isFunction(onAction) && item) {\n\t\t\tonAction(item, data.option);\n\t\t}\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tif (dropdown && isFunction((dropdown as any).props?.onSelect)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t(dropdown as any).props.onSelect(event, data);\n\t\t}\n\t};\n\n\tconst defaultDropdownProps = {\n\t\talign: 'right',\n\t\tbuttonClassName: 'slds-button_icon-x-small',\n\t\tbuttonVariant: 'icon',\n\t\ticonCategory: 'utility',\n\t\ticonName: 'down',\n\t\ticonSize: 'small',\n\t\ticonVariant: 'border-filled',\n\t\tassistiveText,\n\t\tclassName,\n\t\toptions,\n\t\thint: !noHint,\n\t\tid,\n\t};\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tlet dropdownProps: Record<string, any> = dropdown\n\t\t? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t(dropdown as any).props\n\t\t: {};\n\tdropdownProps = {\n\t\t...defaultDropdownProps,\n\t\t...dropdownProps,\n\t\tonSelect: handleSelect,\n\t};\n\n\treturn (\n\t\t<td\n\t\t\tclassName={classNames({ 'slds-has-focus': hasFocus })}\n\t\t\tdata-label=\"Actions\"\n\t\t\tonClick={handleClick}\n\t\t\tstyle={{ width: '3.25rem' }}\n\t\t\tonFocus={handleFocus}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tref={(ref) => {\n\t\t\t\tif (ref && hasFocus) {\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t\trole={fixedLayout ? 'gridcell' : undefined}\n\t\t\ttabIndex={tabIndex}\n\t\t>\n\t\t\t<InteractiveDropdown {...dropdownProps} />\n\t\t</td>\n\t);\n};\n\nSimpleDataTableRowActions.displayName = SIMPLE_DATA_TABLE_ROW_ACTIONS;\n\nexport default SimpleDataTableRowActions;\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAM,IAAsB,EAC3B,CACD,GA4BM,KAAuE,EAC5E,mBAAgB,EAAE,MAAM,UAAU,GAClC,YAAS,IACT,aAAU,CAAC,GACX,cACA,OACA,SACA,aACA,aACA,qBACK;CACL,IAAM,IAAe,EAAW,CAAY,GACtC,IAAc,EAAW,CAAW,GACpC,EAAE,aAAU,aAAU,gBAAa,qBAAkB,EAC1D,GACA,GACA,CACD,GAEM,KAAe,MAAwB;EAC5C,EAAU,KAAK,CAAC;CACjB,GAEM,KACL,GACA,MACI;EAKJ,AAJI,EAAW,CAAQ,KAAK,KAC3B,EAAS,GAAM,EAAK,MAAM,GAGvB,KAAY,EAAY,EAAiB,OAAO,QAAQ,KAE3D,EAAkB,MAAM,SAAS,GAAO,CAAI;CAE9C,GAEM,IAAuB;EAC5B,OAAO;EACP,iBAAiB;EACjB,eAAe;EACf,cAAc;EACd,UAAU;EACV,UAAU;EACV,aAAa;EACb;EACA;EACA;EACA,MAAM,CAAC;EACP;CACD,GAGI,IAAqC,IAEtC,EAAiB,QACjB,CAAC;CAOJ,OANA,IAAgB;EACf,GAAG;EACH,GAAG;EACH,UAAU;CACX,GAGC,kBAAC,MAAD;EACC,WAAW,EAAW,EAAE,kBAAkB,EAAS,CAAC;EACpD,cAAW;EACX,SAAS;EACT,OAAO,EAAE,OAAO,UAAU;EAC1B,SAAS;EACT,WAAW;EACX,MAAM,MAAQ;GACb,AAAI,KAAO,KACV,EAAI,MAAM;EAEZ;EACA,MAAM,IAAc,aAAa,KAAA;EACvB;EAEV,UAAA,kBAAC,GAAD,EAAqB,GAAI,EAAgB,CAAA;CACtC,CAAA;AAEN;AAEA,EAA0B,cAAc"}
@@ -4,7 +4,7 @@ import t from "classnames";
4
4
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
5
  //#region components/spinner/index.tsx
6
6
  var i = { label: "Loading..." }, a = ({ assistiveText: e = i, containerClassName: a, containerStyle: o, hasContainer: s = !0, id: c, isDelayed: l = !1, isInline: u = !1, isInput: d = !1, size: f = "medium", variant: p = "base" }) => {
7
- let m = typeof e == "string" ? e : {
7
+ let m = {
8
8
  ...i,
9
9
  ...e
10
10
  }.label, h = t("slds-spinner", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/spinner/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { SPINNER } from '../../utilities/constants';\n\n/**\n * Spinner size options\n */\nexport type SpinnerSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Spinner color variant\n */\nexport type SpinnerVariant = 'base' | 'brand' | 'inverse';\n\n/**\n * Assistive text for Spinner\n */\nexport interface SpinnerAssistiveText {\n\t/** Text read by screen readers */\n\tlabel?: string;\n}\n\n/**\n * Props for the Spinner component\n */\nexport interface SpinnerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SpinnerAssistiveText | string;\n\t/** CSS classes for the container */\n\tcontainerClassName?: string;\n\t/** Custom styles for the container */\n\tcontainerStyle?: CSSProperties;\n\t/** Render inside a container div */\n\thasContainer?: boolean;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Add 300ms delay before showing */\n\tisDelayed?: boolean;\n\t/** Inline spinner inside document flow */\n\tisInline?: boolean;\n\t/** Spinner inside an input field */\n\tisInput?: boolean;\n\t/** Size of the spinner */\n\tsize?: SpinnerSize;\n\t/** Color variant */\n\tvariant?: SpinnerVariant;\n}\n\nconst defaultAssistiveText: SpinnerAssistiveText = { label: 'Loading...' };\n\n/**\n * Spinners are CSS loading indicators that should be shown when retrieving data\n * or performing slow computations.\n */\nconst Spinner = ({\n\tassistiveText = defaultAssistiveText,\n\tcontainerClassName,\n\tcontainerStyle,\n\thasContainer = true,\n\tid,\n\tisDelayed = false,\n\tisInline = false,\n\tisInput = false,\n\tsize = 'medium',\n\tvariant = 'base',\n}: SpinnerProps): React.ReactElement => {\n\t// Handle assistiveText as string or object\n\tconst mergedAssistiveText =\n\t\ttypeof assistiveText === 'string'\n\t\t\t? assistiveText\n\t\t\t: {\n\t\t\t\t\t...defaultAssistiveText,\n\t\t\t\t\t...assistiveText,\n\t\t\t }.label;\n\n\tconst spinnerClassName = classNames('slds-spinner', {\n\t\t'slds-spinner_inline': isInline,\n\t\t'slds-input__spinner': isInput,\n\t\t'slds-spinner_brand': variant === 'brand',\n\t\t'slds-spinner_inverse': variant === 'inverse',\n\t\t'slds-spinner_delayed': isDelayed,\n\t\t[`slds-spinner_${size}`]: size,\n\t});\n\n\tconst spinner = (\n\t\t<div aria-hidden=\"false\" className={spinnerClassName} id={id} role=\"status\">\n\t\t\t{mergedAssistiveText && (\n\t\t\t\t<span className=\"slds-assistive-text\">{mergedAssistiveText}</span>\n\t\t\t)}\n\t\t\t<div className=\"slds-spinner__dot-a\" />\n\t\t\t<div className=\"slds-spinner__dot-b\" />\n\t\t</div>\n\t);\n\n\tif (hasContainer) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(containerClassName, 'slds-spinner_container')}\n\t\t\t\tstyle={containerStyle}\n\t\t\t>\n\t\t\t\t{spinner}\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn spinner;\n};\n\nSpinner.displayName = SPINNER;\n\nexport default Spinner;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":";;;;;AAmDA,IAAM,IAA6C,EAAE,OAAO,aAAa,GAMnE,KAAW,EAChB,mBAAgB,GAChB,uBACA,mBACA,kBAAe,IACf,OACA,eAAY,IACZ,cAAW,IACX,aAAU,IACV,UAAO,UACP,aAAU,aAC6B;CAEvC,IAAM,IACL,OAAO,KAAkB,WACtB,IACA;EACA,GAAG;EACH,GAAG;CACH,EAAE,OAEA,IAAmB,EAAW,gBAAgB;EACnD,uBAAuB;EACvB,uBAAuB;EACvB,sBAAsB,MAAY;EAClC,wBAAwB,MAAY;EACpC,wBAAwB;GACvB,gBAAgB,MAAS;CAC3B,CAAC,GAEK,IACL,kBAAC,OAAD;EAAK,eAAY;EAAQ,WAAW;EAAsB;EAAI,MAAK;EAAnE,UAAA;GACE,KACA,kBAAC,QAAD;IAAM,WAAU;IAAuB,UAAA;GAA0B,CAAA;GAElE,kBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA;GACtC,kBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA;EAClC;;CAcN,OAXI,IAEF,kBAAC,OAAD;EACC,WAAW,EAAW,GAAoB,wBAAwB;EAClE,OAAO;EAEN,UAAA;CACG,CAAA,IAIA;AACR;AAEA,EAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/spinner/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { SPINNER } from '../../utilities/constants';\n\n/**\n * Spinner size options\n */\nexport type SpinnerSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Spinner color variant\n */\nexport type SpinnerVariant = 'base' | 'brand' | 'inverse';\n\n/**\n * Assistive text for Spinner\n */\nexport interface SpinnerAssistiveText {\n\t/** Text read by screen readers */\n\tlabel?: string;\n}\n\n/**\n * Props for the Spinner component\n */\nexport interface SpinnerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SpinnerAssistiveText;\n\t/** CSS classes for the container */\n\tcontainerClassName?: string;\n\t/** Custom styles for the container */\n\tcontainerStyle?: CSSProperties;\n\t/** Render inside a container div */\n\thasContainer?: boolean;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Add 300ms delay before showing */\n\tisDelayed?: boolean;\n\t/** Inline spinner inside document flow */\n\tisInline?: boolean;\n\t/** Spinner inside an input field */\n\tisInput?: boolean;\n\t/** Size of the spinner */\n\tsize?: SpinnerSize;\n\t/** Color variant */\n\tvariant?: SpinnerVariant;\n}\n\nconst defaultAssistiveText: SpinnerAssistiveText = { label: 'Loading...' };\n\n/**\n * Spinners are CSS loading indicators that should be shown when retrieving data\n * or performing slow computations.\n */\nconst Spinner = ({\n\tassistiveText = defaultAssistiveText,\n\tcontainerClassName,\n\tcontainerStyle,\n\thasContainer = true,\n\tid,\n\tisDelayed = false,\n\tisInline = false,\n\tisInput = false,\n\tsize = 'medium',\n\tvariant = 'base',\n}: SpinnerProps): React.ReactElement => {\n\tconst mergedAssistiveText = {\n\t\t...defaultAssistiveText,\n\t\t...assistiveText,\n\t}.label;\n\n\tconst spinnerClassName = classNames('slds-spinner', {\n\t\t'slds-spinner_inline': isInline,\n\t\t'slds-input__spinner': isInput,\n\t\t'slds-spinner_brand': variant === 'brand',\n\t\t'slds-spinner_inverse': variant === 'inverse',\n\t\t'slds-spinner_delayed': isDelayed,\n\t\t[`slds-spinner_${size}`]: size,\n\t});\n\n\tconst spinner = (\n\t\t<div aria-hidden=\"false\" className={spinnerClassName} id={id} role=\"status\">\n\t\t\t{mergedAssistiveText && (\n\t\t\t\t<span className=\"slds-assistive-text\">{mergedAssistiveText}</span>\n\t\t\t)}\n\t\t\t<div className=\"slds-spinner__dot-a\" />\n\t\t\t<div className=\"slds-spinner__dot-b\" />\n\t\t</div>\n\t);\n\n\tif (hasContainer) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(containerClassName, 'slds-spinner_container')}\n\t\t\t\tstyle={containerStyle}\n\t\t\t>\n\t\t\t\t{spinner}\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn spinner;\n};\n\nSpinner.displayName = SPINNER;\n\nexport default Spinner;\n"],"mappings":";;;;;AAmDA,IAAM,IAA6C,EAAE,OAAO,aAAa,GAMnE,KAAW,EAChB,mBAAgB,GAChB,uBACA,mBACA,kBAAe,IACf,OACA,eAAY,IACZ,cAAW,IACX,aAAU,IACV,UAAO,UACP,aAAU,aAC6B;CACvC,IAAM,IAAsB;EAC3B,GAAG;EACH,GAAG;CACJ,EAAE,OAEI,IAAmB,EAAW,gBAAgB;EACnD,uBAAuB;EACvB,uBAAuB;EACvB,sBAAsB,MAAY;EAClC,wBAAwB,MAAY;EACpC,wBAAwB;GACvB,gBAAgB,MAAS;CAC3B,CAAC,GAEK,IACL,kBAAC,OAAD;EAAK,eAAY;EAAQ,WAAW;EAAsB;EAAI,MAAK;EAAnE,UAAA;GACE,KACA,kBAAC,QAAD;IAAM,WAAU;IAAuB,UAAA;GAA0B,CAAA;GAElE,kBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA;GACtC,kBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA;EAClC;;CAcN,OAXI,IAEF,kBAAC,OAAD;EACC,WAAW,EAAW,GAAoB,wBAAwB;EAClE,OAAO;EAEN,UAAA;CACG,CAAA,IAIA;AACR;AAEA,EAAQ,cAAc"}
@@ -0,0 +1,13 @@
1
+ import e from "../../utilities/get-component-doc.js";
2
+ import t from "../../utilities/warning/deprecated-property.js";
3
+ //#region components/split-view/check-props.js
4
+ var n = function() {};
5
+ process.env.NODE_ENV !== "production" && (n = function(n, r = {}, i) {
6
+ let a = e(i), o = r.events || {};
7
+ t(n, o.onOpen, "events.onOpen", "events.onToggle", a("events")), t(n, o.onClose, "events.onClose", "events.onToggle", a("events"));
8
+ });
9
+ var r = n;
10
+ //#endregion
11
+ export { r as default };
12
+
13
+ //# sourceMappingURL=check-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/split-view/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props = {}, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\t\tconst events = props.events || {};\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tevents.onOpen,\n\t\t\t'events.onOpen',\n\t\t\t'events.onToggle',\n\t\t\tcreateDocUrl('events')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tevents.onClose,\n\t\t\t'events.onClose',\n\t\t\t'events.onToggle',\n\t\t\tcreateDocUrl('events')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,IAAQ,CAAC,GAAG,GAAS;CACxE,IAAM,IAAe,EAAkB,CAAO,GACxC,IAAS,EAAM,UAAU,CAAC;CAShC,AAPA,EACC,GACA,EAAO,QACP,iBACA,mBACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAO,SACP,kBACA,mBACA,EAAa,QAAQ,CACtB;AACD;AAGD,IAAA,IAAe"}
@@ -0,0 +1,46 @@
1
+ //#region components/split-view/component.json
2
+ var e = "split-view", t = "prod", n = "SplitView", r = [{
3
+ component: "header",
4
+ classKey: "SplitViewHeader"
5
+ }, {
6
+ component: "listbox",
7
+ classKey: "SplitViewListbox"
8
+ }], i = {
9
+ component: e,
10
+ status: t,
11
+ "display-name": "Split View",
12
+ classKey: n,
13
+ "last-accessibility-review": {
14
+ "date-iso-8601": "2018/01/18",
15
+ "commit-sha": "ad6b6c6523ee21cada11be5f7ea4d99abc530726"
16
+ },
17
+ "last-slds-markup-review": {
18
+ "date-iso-8601": "2018/01/18",
19
+ "commit-sha": "ad6b6c6523ee21cada11be5f7ea4d99abc530726"
20
+ },
21
+ "SLDS-component-path": "/components/split-view",
22
+ dependencies: r,
23
+ "site-stories": [
24
+ {
25
+ heading: "Base",
26
+ path: "/__examples__/base.jsx"
27
+ },
28
+ {
29
+ heading: "Multiple",
30
+ path: "/__examples__/base-multiple.jsx"
31
+ },
32
+ {
33
+ heading: "With External State",
34
+ path: "/__examples__/external-state.jsx"
35
+ },
36
+ {
37
+ heading: "Custom Items List",
38
+ path: "/__examples__/custom-items-list.jsx"
39
+ }
40
+ ],
41
+ "url-slug": "split-view"
42
+ };
43
+ //#endregion
44
+ export { n as classKey, e as component, i as default, r as dependencies, t as status };
45
+
46
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","names":[],"sources":["../../../../components/split-view/component.json"],"sourcesContent":["{\n\t\"component\": \"split-view\",\n\t\"status\": \"prod\",\n\t\"display-name\": \"Split View\",\n\t\"classKey\": \"SplitView\",\n\t\"last-accessibility-review\": {\n\t\t\"date-iso-8601\": \"2018/01/18\",\n\t\t\"commit-sha\": \"ad6b6c6523ee21cada11be5f7ea4d99abc530726\"\n\t},\n\t\"last-slds-markup-review\": {\n\t\t\"date-iso-8601\": \"2018/01/18\",\n\t\t\"commit-sha\": \"ad6b6c6523ee21cada11be5f7ea4d99abc530726\"\n\t},\n\t\"SLDS-component-path\": \"/components/split-view\",\n\t\"dependencies\": [\n\t\t{\n\t\t\t\"component\": \"header\",\n\t\t\t\"classKey\": \"SplitViewHeader\"\n\t\t},\n\t\t{\n\t\t\t\"component\": \"listbox\",\n\t\t\t\"classKey\": \"SplitViewListbox\"\n\t\t}\n\t],\n\t\"site-stories\": [\n\t\t{\n\t\t\t\"heading\": \"Base\",\n\t\t\t\"path\": \"/__examples__/base.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"Multiple\",\n\t\t\t\"path\": \"/__examples__/base-multiple.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"With External State\",\n\t\t\t\"path\": \"/__examples__/external-state.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"Custom Items List\",\n\t\t\t\"path\": \"/__examples__/custom-items-list.jsx\"\n\t\t}\n\t],\n\t\"url-slug\": \"split-view\"\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","names":[],"sources":["../../../../components/split-view/header.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React from 'react';\nimport classNames from 'classnames';\nimport PageHeader from '../page-header';\n\nimport { SPLIT_VIEW_HEADER } from '../../utilities/constants';\n\nexport interface SplitViewHeaderProps {\n\t/**\n\t * CSS classes to be added to the wrapping `PageHeader`.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t[key: string]: unknown;\n}\n\n/**\n * The Split View Header takes the same properties as the [PageHeader](https://react.lightningdesignsystem.com/components/page-headers/) component.\n */\nconst SplitViewHeader = ({\n\tclassName,\n\t...rest\n}: SplitViewHeaderProps): React.ReactElement => (\n\t<PageHeader\n\t\tclassName={classNames(\n\t\t\t'slds-split-view__header slds-has-bottom-magnet',\n\t\t\tclassName as string\n\t\t)}\n\t\t{...(rest as React.ComponentProps<typeof PageHeader>)}\n\t/>\n);\n\nSplitViewHeader.displayName = SPLIT_VIEW_HEADER;\n\nexport default SplitViewHeader;\n"],"mappings":";;;;;;AAoBA,IAAM,KAAmB,EACxB,cACA,GAAG,QAEH,kBAAC,GAAD;CACC,WAAW,EACV,kDACA,CACD;CACA,GAAK;AACL,CAAA;AAGF,EAAgB,cAAc"}
1
+ {"version":3,"file":"header.js","names":[],"sources":["../../../../components/split-view/header.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React from 'react';\nimport classNames from 'classnames';\nimport PageHeader, { type PageHeaderProps } from '../page-header';\n\nimport { SPLIT_VIEW_HEADER } from '../../utilities/constants';\n\nexport interface SplitViewHeaderProps extends PageHeaderProps {\n\t/**\n\t * CSS classes to be added to the wrapping `PageHeader`.\n\t */\n\tclassName?: PageHeaderProps['className'];\n}\n\n/**\n * The Split View Header takes the same properties as the [PageHeader](https://react.lightningdesignsystem.com/components/page-headers/) component.\n */\nconst SplitViewHeader = ({\n\tclassName,\n\t...rest\n}: SplitViewHeaderProps): React.ReactElement => (\n\t<PageHeader\n\t\tclassName={classNames(\n\t\t\t'slds-split-view__header slds-has-bottom-magnet',\n\t\t\tclassName\n\t\t)}\n\t\t{...rest}\n\t/>\n);\n\nSplitViewHeader.displayName = SPLIT_VIEW_HEADER;\n\nexport default SplitViewHeader;\n"],"mappings":";;;;;;AAmBA,IAAM,KAAmB,EACxB,cACA,GAAG,QAEH,kBAAC,GAAD;CACC,WAAW,EACV,kDACA,CACD;CACA,GAAI;AACJ,CAAA;AAGF,EAAgB,cAAc"}
@@ -1,55 +1,61 @@
1
1
  import { SPLIT_VIEW as e } from "../../utilities/constants.js";
2
2
  import t, { TOGGLE_BUTTON_WIDTH as n } from "./private/toggle-button.js";
3
- import { useCallback as r, useId as i, useState as a } from "react";
4
- import o from "classnames";
5
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ import r from "./check-props.js";
4
+ import i from "./component.js";
5
+ import { useCallback as a, useEffect as o, useId as s, useState as c } from "react";
6
+ import l from "classnames";
7
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
8
  //#region components/split-view/index.tsx
7
- var l = {
9
+ var f = {
8
10
  toggleButtonOpen: "Close split view",
9
11
  toggleButtonClose: "Open split view"
10
- }, u = ({ assistiveText: e, className: u, detail: d, events: f = {}, id: p, isOpen: m, master: h, masterWidth: g = "20rem" }) => {
11
- let _ = i(), v = p || _, y = {
12
- ...l,
13
- ...e
14
- }, [b, x] = a(typeof m != "boolean" || m), S = typeof m == "boolean" ? m : b, C = `master_view_${v}`, w = r((e) => {
15
- typeof m != "boolean" && x((e) => !e), S && f.onClose ? f.onClose(e) : !S && f.onOpen && f.onOpen(e);
12
+ }, p = ({ assistiveText: p, className: m, detail: h, events: g = {}, id: _, isOpen: v, master: y, masterWidth: b = "20rem" }) => {
13
+ let x = s(), S = _ || x, C = {
14
+ ...f,
15
+ ...p
16
+ };
17
+ o(() => {
18
+ r(e, { events: g }, i);
19
+ }, []);
20
+ let [w, T] = c(typeof v != "boolean" || v), E = typeof v == "boolean" ? v : w, D = `master_view_${S}`, O = a((e) => {
21
+ typeof v != "boolean" && T((e) => !e), g.onToggle ? g.onToggle(e, { isOpen: !E }) : E && g.onClose ? g.onClose(e) : !E && g.onOpen && g.onOpen(e);
16
22
  }, [
17
- m,
18
- S,
19
- f
23
+ v,
24
+ E,
25
+ g
20
26
  ]);
21
- return /* @__PURE__ */ c("div", {
22
- id: v,
23
- className: o("slds-grid", u),
27
+ return /* @__PURE__ */ d("div", {
28
+ id: S,
29
+ className: l("slds-grid", m),
24
30
  style: { height: "100%" },
25
- children: [/* @__PURE__ */ c("div", {
31
+ children: [/* @__PURE__ */ d("div", {
26
32
  style: {
27
- maxWidth: S ? g : "0",
28
- minWidth: S ? g : "0"
33
+ maxWidth: E ? b : "0",
34
+ minWidth: E ? b : "0"
29
35
  },
30
- className: o("slds-split-view_container", {
31
- "slds-is-open": S,
32
- "slds-is-closed": !S
36
+ className: l("slds-split-view_container", {
37
+ "slds-is-open": E,
38
+ "slds-is-closed": !E
33
39
  }),
34
- children: [/* @__PURE__ */ s(t, {
35
- assistiveText: y,
36
- ariaControls: C,
37
- isOpen: S,
38
- events: { onClick: w }
39
- }), /* @__PURE__ */ s("article", {
40
- id: C,
40
+ children: [/* @__PURE__ */ u(t, {
41
+ assistiveText: C,
42
+ ariaControls: D,
43
+ isOpen: E,
44
+ events: { onClick: O }
45
+ }), /* @__PURE__ */ u("article", {
46
+ id: D,
41
47
  className: "slds-split-view slds-grid slds-grid_vertical slds-grow slds-scrollable_none",
42
- children: S ? h : null
48
+ children: E ? y : null
43
49
  })]
44
- }), /* @__PURE__ */ s("div", {
50
+ }), /* @__PURE__ */ u("div", {
45
51
  style: { marginLeft: n },
46
52
  className: "slds-grow slds-scrollable_y",
47
- children: d
53
+ children: h
48
54
  })]
49
55
  });
50
56
  };
51
- u.displayName = e;
57
+ p.displayName = e;
52
58
  //#endregion
53
- export { u as default };
59
+ export { p as default };
54
60
 
55
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/split-view/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useState, useId, useCallback, type ReactElement, type MouseEvent } from 'react';\nimport classNames from 'classnames';\nimport ToggleButton, { TOGGLE_BUTTON_WIDTH } from './private/toggle-button';\nimport { SPLIT_VIEW } from '../../utilities/constants';\n\n/**\n * Assistive text for SplitView\n */\nexport interface SplitViewAssistiveText {\n\t/** Text for open state toggle button */\n\ttoggleButtonOpen?: string;\n\t/** Text for closed state toggle button */\n\ttoggleButtonClose?: string;\n}\n\n/**\n * Event handlers for SplitView\n */\nexport interface SplitViewEvents {\n\t/** Called when the split view closes */\n\tonClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Called when the split view opens */\n\tonOpen?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Props for the SplitView component\n */\nexport interface SplitViewProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SplitViewAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Detail panel content (required) */\n\tdetail: ReactElement | ReactElement[];\n\t/** Event handlers */\n\tevents?: SplitViewEvents;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether the split view is open */\n\tisOpen?: boolean;\n\t/** Master panel content (required) */\n\tmaster: ReactElement | ReactElement[];\n\t/** Width of the master section */\n\tmasterWidth?: string;\n}\n\nconst defaultAssistiveText: SplitViewAssistiveText = {\n\ttoggleButtonOpen: 'Close split view',\n\ttoggleButtonClose: 'Open split view',\n};\n\n/**\n * Split view is used to navigate between records in a list while staying on the same screen.\n */\nconst SplitView = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdetail,\n\tevents = {},\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\tmaster,\n\tmasterWidth = '20rem',\n}: SplitViewProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t// Support both controlled and uncontrolled modes\n\tconst [internalIsOpen, setInternalIsOpen] = useState(\n\t\ttypeof controlledIsOpen === 'boolean' ? controlledIsOpen : true\n\t);\n\n\tconst isOpen = typeof controlledIsOpen === 'boolean' ? controlledIsOpen : internalIsOpen;\n\tconst masterViewId = `master_view_${id}`;\n\n\tconst handleToggle = useCallback(\n\t\t(event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (typeof controlledIsOpen !== 'boolean') {\n\t\t\t\tsetInternalIsOpen((prev) => !prev);\n\t\t\t}\n\n\t\t\tif (isOpen && events.onClose) {\n\t\t\t\tevents.onClose(event);\n\t\t\t} else if (!isOpen && events.onOpen) {\n\t\t\t\tevents.onOpen(event);\n\t\t\t}\n\t\t},\n\t\t[controlledIsOpen, isOpen, events]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames('slds-grid', className as string)}\n\t\t\tstyle={{ height: '100%' }}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tmaxWidth: isOpen ? masterWidth : '0',\n\t\t\t\t\tminWidth: isOpen ? masterWidth : '0',\n\t\t\t\t}}\n\t\t\t\tclassName={classNames('slds-split-view_container', {\n\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t\t'slds-is-closed': !isOpen,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<ToggleButton\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tariaControls={masterViewId}\n\t\t\t\t\tisOpen={isOpen}\n\t\t\t\t\tevents={{\n\t\t\t\t\t\tonClick: handleToggle,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<article\n\t\t\t\t\tid={masterViewId}\n\t\t\t\t\tclassName=\"slds-split-view slds-grid slds-grid_vertical slds-grow slds-scrollable_none\"\n\t\t\t\t>\n\t\t\t\t\t{isOpen ? master : null}\n\t\t\t\t</article>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tstyle={{ marginLeft: TOGGLE_BUTTON_WIDTH }}\n\t\t\t\tclassName=\"slds-grow slds-scrollable_y\"\n\t\t\t>\n\t\t\t\t{detail}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nSplitView.displayName = SPLIT_VIEW;\n\nexport default SplitView;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":";;;;;;AAkDA,IAAM,IAA+C;CACpD,kBAAkB;CAClB,mBAAmB;AACpB,GAKM,KAAa,EAClB,eAAe,GACf,cACA,WACA,YAAS,CAAC,GACV,IAAI,GACJ,QAAQ,GACR,WACA,iBAAc,cAC2B;CACzC,IAAM,IAAc,EAAM,GACpB,IAAK,KAAU,GACf,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAGhE,CAAC,GAAgB,KAAqB,EAC3C,OAAO,KAAqB,aAAY,CACzC,GAEM,IAAS,OAAO,KAAqB,YAAY,IAAmB,GACpE,IAAe,eAAe,KAE9B,IAAe,GACnB,MAAyC;EAKzC,AAJI,OAAO,KAAqB,aAC/B,GAAmB,MAAS,CAAC,CAAI,GAG9B,KAAU,EAAO,UACpB,EAAO,QAAQ,CAAK,IACV,CAAC,KAAU,EAAO,UAC5B,EAAO,OAAO,CAAK;CAErB,GACA;EAAC;EAAkB;EAAQ;CAAM,CAClC;CAEA,OACC,kBAAC,OAAD;EACK;EACJ,WAAW,EAAW,aAAa,CAAmB;EACtD,OAAO,EAAE,QAAQ,OAAO;EAHzB,UAAA,CAKC,kBAAC,OAAD;GACC,OAAO;IACN,UAAU,IAAS,IAAc;IACjC,UAAU,IAAS,IAAc;GAClC;GACA,WAAW,EAAW,6BAA6B;IAClD,gBAAgB;IAChB,kBAAkB,CAAC;GACpB,CAAC;GARF,UAAA,CAUC,kBAAC,GAAD;IACgB;IACf,cAAc;IACN;IACR,QAAQ,EACP,SAAS,EACV;GACA,CAAA,GACD,kBAAC,WAAD;IACC,IAAI;IACJ,WAAU;IAET,UAAA,IAAS,IAAS;GACX,CAAA,CACL;EACL,CAAA,GAAA,kBAAC,OAAD;GACC,OAAO,EAAE,YAAY,EAAoB;GACzC,WAAU;GAET,UAAA;EACG,CAAA,CACD;;AAEP;AAEA,EAAU,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/split-view/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseId,\n\tuseCallback,\n\tuseEffect,\n\ttype ReactElement,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport ToggleButton, { TOGGLE_BUTTON_WIDTH } from './private/toggle-button';\nimport { SPLIT_VIEW } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Assistive text for SplitView\n */\nexport interface SplitViewAssistiveText {\n\t/** Text for open state toggle button */\n\ttoggleButtonOpen?: string;\n\t/** Text for closed state toggle button */\n\ttoggleButtonClose?: string;\n}\n\n/**\n * Data passed to `events.onToggle`\n */\nexport interface SplitViewToggleData {\n\t/** The requested (next) open state: `true` when the toggle asks to open, `false` when it asks to close */\n\tisOpen: boolean;\n}\n\n/**\n * Event handlers for SplitView\n */\nexport interface SplitViewEvents {\n\t/**\n\t * Called when the toggle button is clicked. `data.isOpen` is the requested (next) open state.\n\t * In controlled mode (`isOpen` passed), update `isOpen` from this callback.\n\t */\n\tonToggle?: (\n\t\tevent: MouseEvent<HTMLButtonElement>,\n\t\tdata: SplitViewToggleData\n\t) => void;\n\t/**\n\t * Called when the split view closes. Only called when `events.onToggle` is not provided.\n\t * @deprecated use `events.onToggle`\n\t */\n\tonClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Called when the split view opens. Only called when `events.onToggle` is not provided.\n\t * @deprecated use `events.onToggle`\n\t */\n\tonOpen?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Props for the SplitView component\n */\nexport interface SplitViewProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SplitViewAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Detail panel content (required) */\n\tdetail: ReactElement | ReactElement[];\n\t/**\n\t * **Event handlers**\n\t * * `onToggle`: Called with `(event, { isOpen })` when the toggle button is clicked; `isOpen` is the requested (next) state.\n\t * * `onOpen` / `onClose`: Deprecated, use `onToggle`.\n\t */\n\tevents?: SplitViewEvents;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether the split view is open */\n\tisOpen?: boolean;\n\t/** Master panel content (required) */\n\tmaster: ReactElement | ReactElement[];\n\t/** Width of the master section */\n\tmasterWidth?: string;\n}\n\nconst defaultAssistiveText: SplitViewAssistiveText = {\n\ttoggleButtonOpen: 'Close split view',\n\ttoggleButtonClose: 'Open split view',\n};\n\n/**\n * Split view is used to navigate between records in a list while staying on the same screen.\n */\nconst SplitView = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdetail,\n\tevents = {},\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\tmaster,\n\tmasterWidth = '20rem',\n}: SplitViewProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(SPLIT_VIEW, { events }, componentDoc);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Only run on mount\n\n\t// Support both controlled and uncontrolled modes\n\tconst [internalIsOpen, setInternalIsOpen] = useState(\n\t\ttypeof controlledIsOpen === 'boolean' ? controlledIsOpen : true\n\t);\n\n\tconst isOpen =\n\t\ttypeof controlledIsOpen === 'boolean' ? controlledIsOpen : internalIsOpen;\n\tconst masterViewId = `master_view_${id}`;\n\n\tconst handleToggle = useCallback(\n\t\t(event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (typeof controlledIsOpen !== 'boolean') {\n\t\t\t\tsetInternalIsOpen((prev) => !prev);\n\t\t\t}\n\n\t\t\tif (events.onToggle) {\n\t\t\t\tevents.onToggle(event, { isOpen: !isOpen });\n\t\t\t} else if (isOpen && events.onClose) {\n\t\t\t\tevents.onClose(event);\n\t\t\t} else if (!isOpen && events.onOpen) {\n\t\t\t\tevents.onOpen(event);\n\t\t\t}\n\t\t},\n\t\t[controlledIsOpen, isOpen, events]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames('slds-grid', className as string)}\n\t\t\tstyle={{ height: '100%' }}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tmaxWidth: isOpen ? masterWidth : '0',\n\t\t\t\t\tminWidth: isOpen ? masterWidth : '0',\n\t\t\t\t}}\n\t\t\t\tclassName={classNames('slds-split-view_container', {\n\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t\t'slds-is-closed': !isOpen,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<ToggleButton\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tariaControls={masterViewId}\n\t\t\t\t\tisOpen={isOpen}\n\t\t\t\t\tevents={{\n\t\t\t\t\t\tonClick: handleToggle,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<article\n\t\t\t\t\tid={masterViewId}\n\t\t\t\t\tclassName=\"slds-split-view slds-grid slds-grid_vertical slds-grow slds-scrollable_none\"\n\t\t\t\t>\n\t\t\t\t\t{isOpen ? master : null}\n\t\t\t\t</article>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tstyle={{ marginLeft: TOGGLE_BUTTON_WIDTH }}\n\t\t\t\tclassName=\"slds-grow slds-scrollable_y\"\n\t\t\t>\n\t\t\t\t{detail}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nSplitView.displayName = SPLIT_VIEW;\n\nexport default SplitView;\n"],"mappings":";;;;;;;;AAqFA,IAAM,IAA+C;CACpD,kBAAkB;CAClB,mBAAmB;AACpB,GAKM,KAAa,EAClB,eAAe,GACf,cACA,WACA,YAAS,CAAC,GACV,IAAI,GACJ,QAAQ,GACR,WACA,iBAAc,cAC2B;CACzC,IAAM,IAAc,EAAM,GACpB,IAAK,KAAU,GACf,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB;CAGtE,QAAgB;EACf,EAAW,GAAY,EAAE,UAAO,GAAG,CAAY;CAEhD,GAAG,CAAC,CAAC;CAGL,IAAM,CAAC,GAA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