@salesforce/design-system-react 11.0.0-alpha.4 → 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 (538) hide show
  1. package/README.md +112 -70
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/alert/index.cjs +1 -1
  5. package/dist/cjs/components/alert/index.cjs.map +1 -1
  6. package/dist/cjs/components/avatar/index.cjs +1 -1
  7. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  8. package/dist/cjs/components/badge/index.cjs +1 -1
  9. package/dist/cjs/components/badge/index.cjs.map +1 -1
  10. package/dist/cjs/components/breadcrumb/index.cjs +1 -1
  11. package/dist/cjs/components/breadcrumb/index.cjs.map +1 -1
  12. package/dist/cjs/components/builder-header/index.cjs +1 -1
  13. package/dist/cjs/components/builder-header/index.cjs.map +1 -1
  14. package/dist/cjs/components/button/index.cjs +1 -1
  15. package/dist/cjs/components/button/index.cjs.map +1 -1
  16. package/dist/cjs/components/button-group/index.cjs +1 -1
  17. package/dist/cjs/components/button-group/index.cjs.map +1 -1
  18. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  19. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  20. package/dist/cjs/components/card/index.cjs +1 -1
  21. package/dist/cjs/components/card/index.cjs.map +1 -1
  22. package/dist/cjs/components/carousel/index.cjs +1 -1
  23. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  24. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  25. package/dist/cjs/components/checkbox/index.cjs +1 -1
  26. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  27. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  28. package/dist/cjs/components/color-picker/index.cjs +1 -0
  29. package/dist/cjs/components/color-picker.cjs +1 -0
  30. package/dist/cjs/components/combobox/add-subheadings.cjs +1 -1
  31. package/dist/cjs/components/combobox/add-subheadings.cjs.map +1 -1
  32. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  33. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  35. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  36. package/dist/cjs/components/combobox/filter.cjs +1 -1
  37. package/dist/cjs/components/combobox/filter.cjs.map +1 -1
  38. package/dist/cjs/components/combobox/index.cjs +1 -1
  39. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  40. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  41. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  42. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  43. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  44. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  45. package/dist/cjs/components/date-picker/index.cjs +1 -1
  46. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  47. package/dist/cjs/components/docked-composer/index.cjs +1 -1
  48. package/dist/cjs/components/docked-composer/index.cjs.map +1 -1
  49. package/dist/cjs/components/dynamic-icon/index.cjs +1 -1
  50. package/dist/cjs/components/dynamic-icon/index.cjs.map +1 -1
  51. package/dist/cjs/components/expandable-section/index.cjs +1 -1
  52. package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
  53. package/dist/cjs/components/files/index.cjs +1 -1
  54. package/dist/cjs/components/files/index.cjs.map +1 -1
  55. package/dist/cjs/components/filter/index.cjs +1 -0
  56. package/dist/cjs/components/filter.cjs +1 -0
  57. package/dist/cjs/components/grid/index.cjs +2 -0
  58. package/dist/cjs/components/grid/index.cjs.map +1 -0
  59. package/dist/cjs/components/grid.cjs +1 -0
  60. package/dist/cjs/components/icon/index.cjs +1 -1
  61. package/dist/cjs/components/icon/index.cjs.map +1 -1
  62. package/dist/cjs/components/icon-settings/index.cjs +1 -1
  63. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  64. package/dist/cjs/components/illustration/index.cjs +1 -1
  65. package/dist/cjs/components/illustration/index.cjs.map +1 -1
  66. package/dist/cjs/components/index.cjs +1 -1
  67. package/dist/cjs/components/input/check-props.cjs +1 -1
  68. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  69. package/dist/cjs/components/input/index.cjs +1 -1
  70. package/dist/cjs/components/input/index.cjs.map +1 -1
  71. package/dist/cjs/components/input/search.cjs +1 -1
  72. package/dist/cjs/components/input/search.cjs.map +1 -1
  73. package/dist/cjs/components/media-object/index.cjs +1 -1
  74. package/dist/cjs/components/media-object/index.cjs.map +1 -1
  75. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  76. package/dist/cjs/components/menu-dropdown/check-props.cjs +1 -1
  77. package/dist/cjs/components/menu-dropdown/index.cjs +1 -1
  78. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  79. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  80. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  81. package/dist/cjs/components/modal/index.cjs +1 -1
  82. package/dist/cjs/components/modal/index.cjs.map +1 -1
  83. package/dist/cjs/components/page-header/index.cjs +1 -1
  84. package/dist/cjs/components/page-header/index.cjs.map +1 -1
  85. package/dist/cjs/components/panel/index.cjs +1 -1
  86. package/dist/cjs/components/panel/index.cjs.map +1 -1
  87. package/dist/cjs/components/pill/index.cjs +1 -1
  88. package/dist/cjs/components/pill/index.cjs.map +1 -1
  89. package/dist/cjs/components/pill-container/check-props.cjs +2 -0
  90. package/dist/cjs/components/pill-container/check-props.cjs.map +1 -0
  91. package/dist/cjs/components/pill-container/component.cjs +2 -0
  92. package/dist/cjs/components/pill-container/component.cjs.map +1 -0
  93. package/dist/cjs/components/pill-container/index.cjs +1 -1
  94. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  95. package/dist/cjs/components/popover/index.cjs +1 -1
  96. package/dist/cjs/components/popover/index.cjs.map +1 -1
  97. package/dist/cjs/components/popover/popover.cjs +1 -1
  98. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  99. package/dist/cjs/components/portal-settings/index.cjs +1 -1
  100. package/dist/cjs/components/portal-settings/index.cjs.map +1 -1
  101. package/dist/cjs/components/progress-bar/index.cjs +1 -1
  102. package/dist/cjs/components/progress-bar/index.cjs.map +1 -1
  103. package/dist/cjs/components/progress-indicator/check-props.cjs +2 -0
  104. package/dist/cjs/components/progress-indicator/check-props.cjs.map +1 -0
  105. package/dist/cjs/components/progress-indicator/index.cjs +1 -1
  106. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  107. package/dist/cjs/components/progress-indicator/private/path.cjs +2 -0
  108. package/dist/cjs/components/progress-indicator/private/path.cjs.map +1 -0
  109. package/dist/cjs/components/progress-indicator/private/progress.cjs +1 -1
  110. package/dist/cjs/components/progress-indicator/private/progress.cjs.map +1 -1
  111. package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs +2 -0
  112. package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs.map +1 -0
  113. package/dist/cjs/components/progress-ring/index.cjs +1 -1
  114. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  115. package/dist/cjs/components/radio/index.cjs +1 -1
  116. package/dist/cjs/components/radio/index.cjs.map +1 -1
  117. package/dist/cjs/components/radio-button-group/index.cjs +1 -1
  118. package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
  119. package/dist/cjs/components/radio-group/index.cjs +1 -1
  120. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  121. package/dist/cjs/components/scoped-notification/index.cjs +1 -1
  122. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  123. package/dist/cjs/components/setup-assistant/index.cjs +1 -1
  124. package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
  125. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  126. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  127. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  128. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  129. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  130. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  131. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  132. package/dist/cjs/components/slider/index.cjs +1 -1
  133. package/dist/cjs/components/slider/index.cjs.map +1 -1
  134. package/dist/cjs/components/spinner/index.cjs +1 -1
  135. package/dist/cjs/components/spinner/index.cjs.map +1 -1
  136. package/dist/cjs/components/split-view/check-props.cjs +2 -0
  137. package/dist/cjs/components/split-view/check-props.cjs.map +1 -0
  138. package/dist/cjs/components/split-view/component.cjs +2 -0
  139. package/dist/cjs/components/split-view/component.cjs.map +1 -0
  140. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  141. package/dist/cjs/components/split-view/index.cjs +1 -1
  142. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  143. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  144. package/dist/cjs/components/tabs/index.cjs +1 -1
  145. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  146. package/dist/cjs/components/textarea/check-props.cjs +2 -0
  147. package/dist/cjs/components/textarea/check-props.cjs.map +1 -0
  148. package/dist/cjs/components/textarea/component.cjs +2 -0
  149. package/dist/cjs/components/textarea/component.cjs.map +1 -0
  150. package/dist/cjs/components/textarea/index.cjs +1 -1
  151. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  152. package/dist/cjs/components/toast/index.cjs +1 -1
  153. package/dist/cjs/components/toast/index.cjs.map +1 -1
  154. package/dist/cjs/components/tooltip/check-props.cjs +1 -1
  155. package/dist/cjs/components/tooltip/check-props.cjs.map +1 -1
  156. package/dist/cjs/components/tooltip/index.cjs +2 -2
  157. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  158. package/dist/cjs/components/tree/check-props.cjs +1 -1
  159. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  160. package/dist/cjs/components/tree/index.cjs +1 -0
  161. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  162. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  163. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  164. package/dist/cjs/components/tree/private/render-initial-branch.cjs +1 -1
  165. package/dist/cjs/components/tree/private/render-initial-branch.cjs.map +1 -1
  166. package/dist/cjs/components/tree/tree.cjs +1 -1
  167. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  168. package/dist/cjs/components/tree.cjs +1 -0
  169. package/dist/cjs/components/trial-bar/index.cjs +1 -1
  170. package/dist/cjs/components/trial-bar/index.cjs.map +1 -1
  171. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  172. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  173. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  174. package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
  175. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  176. package/dist/cjs/components/vertical-navigation/private/item.cjs.map +1 -1
  177. package/dist/cjs/components/visual-picker/index.cjs +1 -1
  178. package/dist/cjs/components/visual-picker/index.cjs.map +1 -1
  179. package/dist/cjs/components/welcome-mat/index.cjs +1 -1
  180. package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
  181. package/dist/cjs/utilities/constants.cjs +1 -1
  182. package/dist/cjs/utilities/constants.cjs.map +1 -1
  183. package/dist/cjs/utilities/hooks/index.cjs +1 -0
  184. package/dist/cjs/utilities/hooks.cjs +1 -0
  185. package/dist/cjs/utilities/warning/incompatible-props.cjs +2 -0
  186. package/dist/cjs/utilities/warning/incompatible-props.cjs.map +1 -0
  187. package/dist/es/components/accordion/index.js +28 -24
  188. package/dist/es/components/accordion/index.js.map +1 -1
  189. package/dist/es/components/alert/index.js +14 -14
  190. package/dist/es/components/alert/index.js.map +1 -1
  191. package/dist/es/components/avatar/index.js +1 -1
  192. package/dist/es/components/avatar/index.js.map +1 -1
  193. package/dist/es/components/badge/index.js +1 -0
  194. package/dist/es/components/badge/index.js.map +1 -1
  195. package/dist/es/components/breadcrumb/index.js +1 -1
  196. package/dist/es/components/breadcrumb/index.js.map +1 -1
  197. package/dist/es/components/button/index.js +2 -2
  198. package/dist/es/components/button/index.js.map +1 -1
  199. package/dist/es/components/button-stateful/index.js +4 -3
  200. package/dist/es/components/button-stateful/index.js.map +1 -1
  201. package/dist/es/components/carousel/index.js +8 -12
  202. package/dist/es/components/carousel/index.js.map +1 -1
  203. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  204. package/dist/es/components/checkbox/index.js +17 -17
  205. package/dist/es/components/checkbox/index.js.map +1 -1
  206. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  207. package/dist/es/components/color-picker/index.js +2 -0
  208. package/dist/es/components/color-picker.js +2 -0
  209. package/dist/es/components/combobox/add-subheadings.js +2 -1
  210. package/dist/es/components/combobox/add-subheadings.js.map +1 -1
  211. package/dist/es/components/combobox/check-props.js +15 -5
  212. package/dist/es/components/combobox/check-props.js.map +1 -1
  213. package/dist/es/components/combobox/combobox.js +193 -186
  214. package/dist/es/components/combobox/combobox.js.map +1 -1
  215. package/dist/es/components/combobox/filter.js +1 -1
  216. package/dist/es/components/combobox/filter.js.map +1 -1
  217. package/dist/es/components/combobox/index.js.map +1 -1
  218. package/dist/es/components/combobox/private/menu.js +2 -0
  219. package/dist/es/components/combobox/private/menu.js.map +1 -1
  220. package/dist/es/components/date-picker/check-props.js +4 -4
  221. package/dist/es/components/date-picker/date-picker.js +149 -142
  222. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  223. package/dist/es/components/date-picker/index.js.map +1 -1
  224. package/dist/es/components/filter/index.js +2 -0
  225. package/dist/es/components/filter.js +2 -0
  226. package/dist/es/components/grid/index.js +31 -0
  227. package/dist/es/components/grid/index.js.map +1 -0
  228. package/dist/es/components/grid.js +2 -0
  229. package/dist/es/components/index.js +41 -43
  230. package/dist/es/components/input/check-props.js +17 -18
  231. package/dist/es/components/input/check-props.js.map +1 -1
  232. package/dist/es/components/input/search.js +1 -1
  233. package/dist/es/components/input/search.js.map +1 -1
  234. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  235. package/dist/es/components/menu-dropdown/check-props.js +6 -6
  236. package/dist/es/components/menu-dropdown/index.js +5 -5
  237. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  238. package/dist/es/components/menu-dropdown/menu-dropdown.js +262 -258
  239. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  240. package/dist/es/components/modal/index.js +104 -132
  241. package/dist/es/components/modal/index.js.map +1 -1
  242. package/dist/es/components/page-header/index.js +24 -24
  243. package/dist/es/components/pill-container/check-props.js +13 -0
  244. package/dist/es/components/pill-container/check-props.js.map +1 -0
  245. package/dist/es/components/pill-container/component.js +31 -0
  246. package/dist/es/components/pill-container/component.js.map +1 -0
  247. package/dist/es/components/pill-container/index.js +65 -56
  248. package/dist/es/components/pill-container/index.js.map +1 -1
  249. package/dist/es/components/popover/index.js +3 -3
  250. package/dist/es/components/popover/index.js.map +1 -1
  251. package/dist/es/components/popover/popover.js +72 -64
  252. package/dist/es/components/popover/popover.js.map +1 -1
  253. package/dist/es/components/progress-indicator/check-props.js +24 -0
  254. package/dist/es/components/progress-indicator/check-props.js.map +1 -0
  255. package/dist/es/components/progress-indicator/index.js +80 -38
  256. package/dist/es/components/progress-indicator/index.js.map +1 -1
  257. package/dist/es/components/progress-indicator/private/path.js +95 -0
  258. package/dist/es/components/progress-indicator/private/path.js.map +1 -0
  259. package/dist/es/components/progress-indicator/private/progress.js +1 -1
  260. package/dist/es/components/progress-indicator/private/progress.js.map +1 -1
  261. package/dist/es/components/progress-indicator/private/use-roving-tab-index.js +29 -0
  262. package/dist/es/components/progress-indicator/private/use-roving-tab-index.js.map +1 -0
  263. package/dist/es/components/progress-ring/index.js +8 -8
  264. package/dist/es/components/progress-ring/index.js.map +1 -1
  265. package/dist/es/components/setup-assistant/index.js.map +1 -1
  266. package/dist/es/components/setup-assistant/step.js +1 -1
  267. package/dist/es/components/setup-assistant/step.js.map +1 -1
  268. package/dist/es/components/simple-data-table/check-props.js +4 -4
  269. package/dist/es/components/simple-data-table/index.js +67 -69
  270. package/dist/es/components/simple-data-table/index.js.map +1 -1
  271. package/dist/es/components/simple-data-table/row-actions.js +2 -2
  272. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  273. package/dist/es/components/spinner/index.js +1 -1
  274. package/dist/es/components/spinner/index.js.map +1 -1
  275. package/dist/es/components/split-view/check-props.js +13 -0
  276. package/dist/es/components/split-view/check-props.js.map +1 -0
  277. package/dist/es/components/split-view/component.js +46 -0
  278. package/dist/es/components/split-view/component.js.map +1 -0
  279. package/dist/es/components/split-view/header.js.map +1 -1
  280. package/dist/es/components/split-view/index.js +40 -34
  281. package/dist/es/components/split-view/index.js.map +1 -1
  282. package/dist/es/components/split-view/listbox.js.map +1 -1
  283. package/dist/es/components/tabs/index.js +64 -64
  284. package/dist/es/components/tabs/index.js.map +1 -1
  285. package/dist/es/components/textarea/check-props.js +17 -0
  286. package/dist/es/components/textarea/check-props.js.map +1 -0
  287. package/dist/es/components/textarea/component.js +27 -0
  288. package/dist/es/components/textarea/component.js.map +1 -0
  289. package/dist/es/components/textarea/index.js +50 -46
  290. package/dist/es/components/textarea/index.js.map +1 -1
  291. package/dist/es/components/toast/index.js +18 -12
  292. package/dist/es/components/toast/index.js.map +1 -1
  293. package/dist/es/components/tooltip/check-props.js +9 -23
  294. package/dist/es/components/tooltip/check-props.js.map +1 -1
  295. package/dist/es/components/tooltip/index.js +81 -75
  296. package/dist/es/components/tooltip/index.js.map +1 -1
  297. package/dist/es/components/tree/check-props.js +6 -6
  298. package/dist/es/components/tree/check-props.js.map +1 -1
  299. package/dist/es/components/tree/index.js +2 -0
  300. package/dist/es/components/tree/private/branch.js.map +1 -1
  301. package/dist/es/components/tree/private/item.js.map +1 -1
  302. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  303. package/dist/es/components/tree/private/render-initial-branch.js +5 -2
  304. package/dist/es/components/tree/private/render-initial-branch.js.map +1 -1
  305. package/dist/es/components/tree/tree.js +60 -35
  306. package/dist/es/components/tree/tree.js.map +1 -1
  307. package/dist/es/components/tree.js +2 -0
  308. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  309. package/dist/es/components/utilities/menu-list/item.js +1 -1
  310. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  311. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  312. package/dist/es/components/vertical-navigation/private/item.js.map +1 -1
  313. package/dist/es/components/welcome-mat/index.js.map +1 -1
  314. package/dist/es/utilities/constants.js +2 -2
  315. package/dist/es/utilities/constants.js.map +1 -1
  316. package/dist/es/utilities/hooks/index.js +2 -0
  317. package/dist/es/utilities/hooks.js +1 -0
  318. package/dist/es/utilities/warning/incompatible-props.js +19 -0
  319. package/dist/es/utilities/warning/incompatible-props.js.map +1 -0
  320. package/dist/types/components/accordion/index.d.ts.map +1 -1
  321. package/dist/types/components/alert/index.d.ts.map +1 -1
  322. package/dist/types/components/avatar/index.d.ts +1 -1
  323. package/dist/types/components/avatar/index.d.ts.map +1 -1
  324. package/dist/types/components/badge/index.d.ts +1 -1
  325. package/dist/types/components/badge/index.d.ts.map +1 -1
  326. package/dist/types/components/breadcrumb/index.d.ts +1 -1
  327. package/dist/types/components/breadcrumb/index.d.ts.map +1 -1
  328. package/dist/types/components/button/check-props.d.ts.map +1 -1
  329. package/dist/types/components/button/index.d.ts +6 -3
  330. package/dist/types/components/button/index.d.ts.map +1 -1
  331. package/dist/types/components/button-stateful/index.d.ts +3 -3
  332. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  333. package/dist/types/components/carousel/index.d.ts +34 -7
  334. package/dist/types/components/carousel/index.d.ts.map +1 -1
  335. package/dist/types/components/carousel/private/carousel-item.d.ts +3 -3
  336. package/dist/types/components/carousel/private/carousel-item.d.ts.map +1 -1
  337. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  338. package/dist/types/components/checkbox/index.d.ts +1 -6
  339. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  340. package/dist/types/components/color-picker/color-picker.d.ts +25 -7
  341. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  342. package/dist/types/components/color-picker/index.d.ts +1 -1
  343. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  344. package/dist/types/components/combobox/add-subheadings.d.ts +1 -1
  345. package/dist/types/components/combobox/add-subheadings.d.ts.map +1 -1
  346. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  347. package/dist/types/components/combobox/combobox.d.ts +57 -24
  348. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  349. package/dist/types/components/combobox/filter.d.ts.map +1 -1
  350. package/dist/types/components/combobox/index.d.ts +2 -2
  351. package/dist/types/components/combobox/index.d.ts.map +1 -1
  352. package/dist/types/components/combobox/private/menu.d.ts +65 -4
  353. package/dist/types/components/combobox/private/menu.d.ts.map +1 -1
  354. package/dist/types/components/date-picker/date-picker.d.ts +52 -6
  355. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  356. package/dist/types/components/date-picker/index.d.ts +1 -1
  357. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  358. package/dist/types/components/index.d.ts +0 -4
  359. package/dist/types/components/index.d.ts.map +1 -1
  360. package/dist/types/components/input/check-props.d.ts.map +1 -1
  361. package/dist/types/components/input/search.d.ts +1 -1
  362. package/dist/types/components/input/search.d.ts.map +1 -1
  363. package/dist/types/components/menu-dropdown/button-trigger.d.ts +1 -1
  364. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  365. package/dist/types/components/menu-dropdown/index.d.ts +2 -2
  366. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  367. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +95 -24
  368. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  369. package/dist/types/components/modal/index.d.ts +26 -3
  370. package/dist/types/components/modal/index.d.ts.map +1 -1
  371. package/dist/types/components/pill-container/check-props.d.ts.map +1 -0
  372. package/dist/types/components/pill-container/index.d.ts +24 -3
  373. package/dist/types/components/pill-container/index.d.ts.map +1 -1
  374. package/dist/types/components/popover/index.d.ts +1 -1
  375. package/dist/types/components/popover/index.d.ts.map +1 -1
  376. package/dist/types/components/popover/popover.d.ts +41 -12
  377. package/dist/types/components/popover/popover.d.ts.map +1 -1
  378. package/dist/types/components/progress-indicator/check-props.d.ts.map +1 -0
  379. package/dist/types/components/progress-indicator/index.d.ts +39 -8
  380. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  381. package/dist/types/components/progress-indicator/private/path.d.ts +48 -0
  382. package/dist/types/components/progress-indicator/private/path.d.ts.map +1 -0
  383. package/dist/types/components/progress-indicator/private/progress.d.ts.map +1 -1
  384. package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts +41 -0
  385. package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts.map +1 -0
  386. package/dist/types/components/setup-assistant/index.d.ts +7 -3
  387. package/dist/types/components/setup-assistant/index.d.ts.map +1 -1
  388. package/dist/types/components/setup-assistant/step.d.ts +7 -1
  389. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  390. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  391. package/dist/types/components/simple-data-table/row-actions.d.ts.map +1 -1
  392. package/dist/types/components/spinner/index.d.ts +1 -1
  393. package/dist/types/components/spinner/index.d.ts.map +1 -1
  394. package/dist/types/components/split-view/check-props.d.ts.map +1 -0
  395. package/dist/types/components/split-view/header.d.ts +3 -3
  396. package/dist/types/components/split-view/header.d.ts.map +1 -1
  397. package/dist/types/components/split-view/index.d.ts +25 -3
  398. package/dist/types/components/split-view/index.d.ts.map +1 -1
  399. package/dist/types/components/split-view/listbox.d.ts +27 -24
  400. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  401. package/dist/types/components/tabs/index.d.ts +16 -3
  402. package/dist/types/components/tabs/index.d.ts.map +1 -1
  403. package/dist/types/components/textarea/index.d.ts +2 -2
  404. package/dist/types/components/textarea/index.d.ts.map +1 -1
  405. package/dist/types/components/toast/index.d.ts +17 -2
  406. package/dist/types/components/toast/index.d.ts.map +1 -1
  407. package/dist/types/components/tooltip/check-props.d.ts.map +1 -1
  408. package/dist/types/components/tooltip/index.d.ts +10 -5
  409. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  410. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  411. package/dist/types/components/tree/index.d.ts +1 -1
  412. package/dist/types/components/tree/index.d.ts.map +1 -1
  413. package/dist/types/components/tree/private/branch.d.ts +2 -4
  414. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  415. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  416. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  417. package/dist/types/components/tree/private/render-initial-branch.d.ts +2 -3
  418. package/dist/types/components/tree/private/render-initial-branch.d.ts.map +1 -1
  419. package/dist/types/components/tree/tree.d.ts +27 -6
  420. package/dist/types/components/tree/tree.d.ts.map +1 -1
  421. package/dist/types/components/tree/types.d.ts +55 -8
  422. package/dist/types/components/tree/types.d.ts.map +1 -1
  423. package/dist/types/components/utilities/menu-list/index.d.ts +1 -1
  424. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  425. package/dist/types/components/utilities/menu-list/item.d.ts +1 -1
  426. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  427. package/dist/types/components/vertical-navigation/index.d.ts +7 -3
  428. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  429. package/dist/types/components/vertical-navigation/private/item.d.ts +1 -1
  430. package/dist/types/components/vertical-navigation/private/item.d.ts.map +1 -1
  431. package/dist/types/components/welcome-mat/index.d.ts +62 -13
  432. package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
  433. package/dist/types/utilities/constants.d.ts +1 -1
  434. package/dist/types/utilities/constants.d.ts.map +1 -1
  435. package/dist/types/utilities/hooks/index.d.ts +1 -1
  436. package/dist/types/utilities/hooks/index.d.ts.map +1 -1
  437. package/dist/types/utilities/hooks.d.ts +0 -1
  438. package/dist/types/utilities/sample-data/global-navigation-bar.d.ts +0 -1
  439. package/dist/types/utilities/sample-data/vertical-navigation.d.ts +0 -1
  440. package/dist/types/utilities/warning/incompatible-props.d.ts.map +1 -1
  441. package/package.json +5 -4
  442. package/dist/cjs/components/forms/input/inline-check-props.cjs +0 -2
  443. package/dist/cjs/components/forms/input/inline-check-props.cjs.map +0 -1
  444. package/dist/cjs/components/forms/input/inline.cjs +0 -2
  445. package/dist/cjs/components/forms/input/inline.cjs.map +0 -1
  446. package/dist/cjs/components/modal/check-props.cjs +0 -2
  447. package/dist/cjs/components/modal/check-props.cjs.map +0 -1
  448. package/dist/cjs/components/modal/component.cjs +0 -2
  449. package/dist/cjs/components/modal/component.cjs.map +0 -1
  450. package/dist/cjs/components/modal/trigger.cjs +0 -2
  451. package/dist/cjs/components/modal/trigger.cjs.map +0 -1
  452. package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs +0 -2
  453. package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs.map +0 -1
  454. package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs +0 -2
  455. package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs.map +0 -1
  456. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +0 -2
  457. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +0 -1
  458. package/dist/es/components/forms/input/inline-check-props.js +0 -11
  459. package/dist/es/components/forms/input/inline-check-props.js.map +0 -1
  460. package/dist/es/components/forms/input/inline.js +0 -95
  461. package/dist/es/components/forms/input/inline.js.map +0 -1
  462. package/dist/es/components/modal/check-props.js +0 -13
  463. package/dist/es/components/modal/check-props.js.map +0 -1
  464. package/dist/es/components/modal/component.js +0 -35
  465. package/dist/es/components/modal/component.js.map +0 -1
  466. package/dist/es/components/modal/trigger.js +0 -22
  467. package/dist/es/components/modal/trigger.js.map +0 -1
  468. package/dist/es/utilities/design-tokens/dist/palette-colors.common.js +0 -6
  469. package/dist/es/utilities/design-tokens/dist/palette-colors.common.js.map +0 -1
  470. package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js +0 -286
  471. package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js.map +0 -1
  472. package/dist/es/utilities/warning/deprecated-property-value.js +0 -18
  473. package/dist/es/utilities/warning/deprecated-property-value.js.map +0 -1
  474. package/dist/types/components/avatar/check-props.d.ts.map +0 -1
  475. package/dist/types/components/breadcrumb/check-props.d.ts.map +0 -1
  476. package/dist/types/components/button-stateful/check-props.d.ts.map +0 -1
  477. package/dist/types/components/forms/checkbox/index.d.ts +0 -4
  478. package/dist/types/components/forms/checkbox/index.d.ts.map +0 -1
  479. package/dist/types/components/forms/checkbox.d.ts +0 -2
  480. package/dist/types/components/forms/input/inline-check-props.d.ts +0 -3
  481. package/dist/types/components/forms/input/inline-check-props.d.ts.map +0 -1
  482. package/dist/types/components/forms/input/inline.d.ts +0 -88
  483. package/dist/types/components/forms/input/inline.d.ts.map +0 -1
  484. package/dist/types/components/modal/check-props.d.ts +0 -3
  485. package/dist/types/components/modal/check-props.d.ts.map +0 -1
  486. package/dist/types/components/modal/trigger.d.ts +0 -14
  487. package/dist/types/components/modal/trigger.d.ts.map +0 -1
  488. package/dist/types/components/spinner/check-props.d.ts +0 -3
  489. package/dist/types/components/spinner/check-props.d.ts.map +0 -1
  490. package/dist/types/components/tabs/pane.d.ts +0 -3
  491. package/dist/types/components/tabs/pane.d.ts.map +0 -1
  492. package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts +0 -81
  493. package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts.map +0 -1
  494. package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts +0 -201
  495. package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts.map +0 -1
  496. package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts +0 -117
  497. package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts.map +0 -1
  498. package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts +0 -5
  499. package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts.map +0 -1
  500. package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts +0 -204
  501. package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts.map +0 -1
  502. package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts +0 -3
  503. package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts.map +0 -1
  504. package/dist/types/utilities/design-tokens/dist/components.common.d.ts +0 -249
  505. package/dist/types/utilities/design-tokens/dist/components.common.d.ts.map +0 -1
  506. package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts +0 -9
  507. package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts.map +0 -1
  508. package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts +0 -647
  509. package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts.map +0 -1
  510. package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts +0 -14
  511. package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts.map +0 -1
  512. package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts +0 -10
  513. package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts.map +0 -1
  514. package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts +0 -9
  515. package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts.map +0 -1
  516. package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts +0 -7
  517. package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts.map +0 -1
  518. package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts +0 -12
  519. package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts.map +0 -1
  520. package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts +0 -35
  521. package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts.map +0 -1
  522. package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts +0 -98
  523. package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts.map +0 -1
  524. package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts +0 -15
  525. package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts.map +0 -1
  526. package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts +0 -5
  527. package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts.map +0 -1
  528. package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts +0 -11
  529. package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts.map +0 -1
  530. package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts +0 -21
  531. package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts.map +0 -1
  532. package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts +0 -283
  533. package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts.map +0 -1
  534. package/dist/types/utilities/warning/deprecated-event-parameter.d.ts +0 -3
  535. package/dist/types/utilities/warning/deprecated-event-parameter.d.ts.map +0 -1
  536. /package/dist/types/components/{avatar → pill-container}/check-props.d.ts +0 -0
  537. /package/dist/types/components/{breadcrumb → progress-indicator}/check-props.d.ts +0 -0
  538. /package/dist/types/components/{button-stateful → split-view}/check-props.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"render-branch.cjs","names":[],"sources":["../../../../../components/tree/private/render-branch.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, { ReactNode } from 'react';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\nimport classNames from 'classnames';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface RenderBranchProps {\n\thtmlId: string | number;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tselectedNodeIndexes: string[];\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n}\n\nconst handleExpand = (event: React.SyntheticEvent, props: RenderBranchProps) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onExpand)) {\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\texpand: !props.node.expanded,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: RenderBranchProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.node.selected,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (event: React.KeyboardEvent, props: RenderBranchProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (event: React.KeyboardEvent, props: RenderBranchProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownRight = (event: React.KeyboardEvent, props: RenderBranchProps) => {\n\tif (props.node.expanded) {\n\t\tconst childNodes = props.getNodes?.(props.node);\n\t\tif (childNodes && childNodes.length > 0) {\n\t\t\thandleKeyDownDown(event, props);\n\t\t}\n\t} else {\n\t\thandleExpand(event, props);\n\t}\n};\n\nconst handleKeyDownLeft = (event: React.KeyboardEvent, props: RenderBranchProps) => {\n\tif (props.node.expanded) {\n\t\thandleExpand(event, props);\n\t} else {\n\t\tconst nodes = props.flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\t\tconst parent = props.parent as TreeNode;\n\t\tconst index = findIndex(nodes, { id: parent?.id });\n\t\tif (index !== -1) {\n\t\t\tprops.onExpand({\n\t\t\t\tevent,\n\t\t\t\tdata: {\n\t\t\t\t\tnode: parent,\n\t\t\t\t\tselect: true,\n\t\t\t\t\texpand: !parent.expanded,\n\t\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n};\n\nconst handleKeyDownEnter = (event: React.KeyboardEvent, props: RenderBranchProps) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (event: React.KeyboardEvent, props: RenderBranchProps) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: { callback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props) },\n\t\t\t[KEYS.UP]: { callback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props) },\n\t\t\t[KEYS.RIGHT]: { callback: (evt: React.KeyboardEvent) => handleKeyDownRight(evt, props) },\n\t\t\t[KEYS.LEFT]: { callback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props) },\n\t\t\t[KEYS.ENTER]: { callback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props) },\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: RenderBranchProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props, fromFocus: true });\n\t}\n};\n\nconst getTabIndex = (props: RenderBranchProps): number => {\n\tconst initialFocus =\n\t\tprops.selectedNodeIndexes.length === 0 &&\n\t\tprops.treeIndex === props.flattenedNodes[0]?.treeIndex;\n\treturn props.treeIndex === props.focusedNodeIndex || initialFocus ? 0 : -1;\n};\n\n/**\n * Renders a branch node in the tree.\n */\nconst RenderBranch = (children: ReactNode, props: RenderBranchProps): React.ReactElement => {\n\tconst isExpanded = props.node.expanded;\n\tconst isSelected = props.node.selected;\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\tconst isLoading = props.node.loading;\n\n\tconst loader = (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'block',\n\t\t\t\tpaddingLeft: `${1.5 * props.level + 1.5}rem`,\n\t\t\t\tmarginTop: '.5rem',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '40%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '80%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '60%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t</div>\n\t);\n\n\tconst label =\n\t\tprops.node.assistiveText ||\n\t\t(typeof props.node.label === 'string' ? props.node.label : null);\n\n\t// aria-level and aria-expanded are valid for elements with role=\"treeitem\"\n\tconst ariaProps = {\n\t\t'aria-level': props.level,\n\t\t'aria-expanded': isExpanded ? 'true' as const : 'false' as const,\n\t\t'aria-label': props.node.nodes && props.node.nodes.length > 0 ? label : undefined,\n\t};\n\n\treturn (\n\t\t// @ts-expect-error - aria-level is valid for treeitem role but not in React types\n\t\t<li\n\t\t\tid={String(props.htmlId)}\n\t\t\trole=\"treeitem\"\n\t\t\t{...ariaProps}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: 'Expand Tree Branch' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\tclassName=\"slds-m-right_small\"\n\t\t\t\t\tonClick={(event) => handleExpand(event, props)}\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\" id={`${props.htmlId}__label`}>\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t{isLoading ? loader : null}\n\t\t\t<ul\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t'slds-is-expanded': isExpanded,\n\t\t\t\t\t'slds-is-collapsed': !isExpanded,\n\t\t\t\t})}\n\t\t\t\trole=\"group\"\n\t\t\t\taria-labelledby={`${props.htmlId}__label`}\n\t\t\t>\n\t\t\t\t{isExpanded && !isLoading ? children : null}\n\t\t\t</ul>\n\t\t</li>\n\t);\n};\n\nRenderBranch.displayName = 'Branch';\n\nexport default RenderBranch;\n\n"],"mappings":"sfAmDA,IAAM,GAAgB,EAA6B,IAA6B,CAC/E,EAAA,QAAU,KAAK,CAAK,GACpB,EAAI,EAAA,QAAA,CAAW,EAAM,QAAQ,GAC5B,EAAM,SAAS,CACd,QACA,KAAM,CACL,KAAM,EAAM,KACZ,OAAQ,CAAC,EAAM,KAAK,SACpB,UAAW,EAAM,SAClB,CACD,CAAC,CAEH,EAEM,GAAgB,CACrB,QACA,QACA,eAKK,CACL,EAAA,QAAU,KAAK,CAAK,GACpB,EAAI,EAAA,QAAA,CAAW,EAAM,QAAQ,GAC5B,EAAM,SAAS,CACd,QACA,KAAM,CACL,KAAM,EAAM,KACZ,OAAQ,CAAC,EAAM,KAAK,SACpB,UAAW,EAAM,SAClB,EACA,WACD,CAAC,CAEH,EAEM,GAAgB,EAAiC,IAAmB,CACzE,IAAM,EAAQ,EAAe,IAAK,GAAkB,EAAc,IAAI,EAEtE,OAAO,IAAA,EADO,EAAA,QAAA,CAAU,EAAO,CAAE,GAAI,EAAK,EAAG,CACtB,EAAQ,GAAK,EAAe,OACpD,EAEM,GAAoB,EAAiC,IAAmB,CAC7E,IAAM,EAAQ,EAAe,IAAK,GAAkB,EAAc,IAAI,EAClE,GAAA,EAAQ,EAAA,QAAA,CAAU,EAAO,CAAE,GAAI,EAAK,EAAG,CAAC,EAAI,EAIhD,OAHI,EAAQ,IACX,GAAS,EAAe,QAElB,EAAe,EACvB,EAEM,GAAqB,EAA4B,IAA6B,CACnF,GAAI,EAAM,mBAAqB,EAAM,UAAW,CAC/C,IAAM,EAAgB,EAAa,EAAM,eAAgB,EAAM,IAAI,EACnE,E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CAAA,CACD,GAEN,EAEA,EAAa,YAAc"}
1
+ {"version":3,"file":"render-branch.cjs","names":[],"sources":["../../../../../components/tree/private/render-branch.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, { ReactNode } from 'react';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\nimport classNames from 'classnames';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface RenderBranchProps {\n\thtmlId: string | number;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tselectedNodeIndexes: string[];\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n}\n\nconst handleExpand = (\n\tevent: React.SyntheticEvent,\n\tprops: RenderBranchProps\n) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onExpand)) {\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\texpand: !props.node.expanded,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: RenderBranchProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.node.selected,\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownRight = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.node.expanded) {\n\t\tconst childNodes = props.getNodes?.(props.node);\n\t\tif (childNodes && childNodes.length > 0) {\n\t\t\thandleKeyDownDown(event, props);\n\t\t}\n\t} else {\n\t\thandleExpand(event, props);\n\t}\n};\n\nconst handleKeyDownLeft = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tif (props.node.expanded) {\n\t\thandleExpand(event, props);\n\t} else {\n\t\tconst nodes = props.flattenedNodes.map(\n\t\t\t(flattenedNode) => flattenedNode.node\n\t\t);\n\t\tconst parent = props.parent as TreeNode;\n\t\tconst index = findIndex(nodes, { id: parent?.id });\n\t\tif (index !== -1) {\n\t\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\t\tprops.onExpand({\n\t\t\t\tevent,\n\t\t\t\tdata: {\n\t\t\t\t\tnode: parent,\n\t\t\t\t\tselect: true,\n\t\t\t\t\texpand: !parent.expanded,\n\t\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n};\n\nconst handleKeyDownEnter = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (\n\tevent: React.KeyboardEvent,\n\tprops: RenderBranchProps\n) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props),\n\t\t\t},\n\t\t\t[KEYS.UP]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props),\n\t\t\t},\n\t\t\t[KEYS.RIGHT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownRight(evt, props),\n\t\t\t},\n\t\t\t[KEYS.LEFT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props),\n\t\t\t},\n\t\t\t[KEYS.ENTER]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props),\n\t\t\t},\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: RenderBranchProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props, fromFocus: true });\n\t}\n};\n\nconst getTabIndex = (props: RenderBranchProps): number => {\n\tconst initialFocus =\n\t\tprops.selectedNodeIndexes.length === 0 &&\n\t\tprops.treeIndex === props.flattenedNodes[0]?.treeIndex;\n\treturn props.treeIndex === props.focusedNodeIndex || initialFocus ? 0 : -1;\n};\n\n/**\n * Renders a branch node in the tree.\n */\nconst RenderBranch = (\n\tchildren: ReactNode,\n\tprops: RenderBranchProps\n): React.ReactElement => {\n\tconst isExpanded = props.node.expanded;\n\tconst isSelected = props.node.selected;\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\tconst isLoading = props.node.loading;\n\n\tconst loader = (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'block',\n\t\t\t\tpaddingLeft: `${1.5 * props.level + 1.5}rem`,\n\t\t\t\tmarginTop: '.5rem',\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '40%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '80%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '15rem',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tmarginBottom: '.75rem',\n\t\t\t\t\theight: '.5rem',\n\t\t\t\t\tbackgroundColor: 'rgb(224, 229, 238)',\n\t\t\t\t\twidth: '60%',\n\t\t\t\t}}\n\t\t\t/>\n\t\t</div>\n\t);\n\n\tconst label =\n\t\tprops.node.assistiveText ||\n\t\t(typeof props.node.label === 'string' ? props.node.label : null);\n\n\t// aria-level and aria-expanded are valid for elements with role=\"treeitem\"\n\tconst ariaProps = {\n\t\t'aria-level': props.level,\n\t\t'aria-expanded': isExpanded ? ('true' as const) : ('false' as const),\n\t\t'aria-label':\n\t\t\tprops.node.nodes && props.node.nodes.length > 0 ? label : undefined,\n\t};\n\n\treturn (\n\t\t// @ts-expect-error - aria-level is valid for treeitem role but not in React types\n\t\t<li\n\t\t\tid={String(props.htmlId)}\n\t\t\trole=\"treeitem\"\n\t\t\t{...ariaProps}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: 'Expand Tree Branch' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\tclassName=\"slds-m-right_small\"\n\t\t\t\t\tonClick={(event) => handleExpand(event, props)}\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\" id={`${props.htmlId}__label`}>\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t{isLoading ? loader : null}\n\t\t\t<ul\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t'slds-is-expanded': isExpanded,\n\t\t\t\t\t'slds-is-collapsed': !isExpanded,\n\t\t\t\t})}\n\t\t\t\trole=\"group\"\n\t\t\t\taria-labelledby={`${props.htmlId}__label`}\n\t\t\t>\n\t\t\t\t{isExpanded && !isLoading ? children : null}\n\t\t\t</ul>\n\t\t</li>\n\t);\n};\n\nRenderBranch.displayName = 'Branch';\n\nexport default RenderBranch;\n"],"mappings":"sfAmDA,IAAM,GACL,EACA,IACI,CACJ,EAAA,QAAU,KAAK,CAAK,GACpB,EAAI,EAAA,QAAA,CAAW,EAAM,QAAQ,GAC5B,EAAM,SAAS,CACd,QACA,KAAM,CACL,KAAM,EAAM,KACZ,OAAQ,CAAC,EAAM,KAAK,SACpB,UAAW,EAAM,SAClB,CACD,CAAC,CAEH,EAEM,GAAgB,CACrB,QACA,QACA,eAKK,CACL,EAAA,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AAE,QAAO,OAAM,CAAC,EAJlD,SAAA,EAMC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,oBAAqB,EAC5C,aAAa,UACb,SAAS,eACT,SAAS,QACT,QAAQ,OACR,UAAU,qBACV,QAAU,GAAU,EAAa,EAAO,CAAK,EAC7C,SAAU,EACV,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAmB,GAAI,GAAG,EAAM,OAAO,SACtD,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,OAAQ,EAAM,WACd,UAAU,sCAET,SAAA,EAAM,KACK,CAAA,CACR,CAAA,CACF,IACJ,EAAY,EAAS,MACtB,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,CACrB,mBAAoB,EACpB,oBAAqB,CAAC,CACvB,CAAC,EACD,KAAK,QACL,kBAAiB,GAAG,EAAM,OAAO,SAEhC,SAAA,GAAc,CAAC,EAAY,EAAW,IACpC,CAAA,CACD,GAEN,EAEA,EAAa,YAAc"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../_virtual/_rolldown/runtime.cjs");let t=require("react");t=e.__toESM(t,1);let n=require("classnames");n=e.__toESM(n,1);let r=require("react/jsx-runtime"),i=require("lodash.isfunction");i=e.__toESM(i,1);var a=(e,t)=>{let n=e.target,r=n.scrollTop/(n.scrollHeight-n.clientHeight)*100;(0,i.default)(t.onScroll)&&t.onScroll(e,{percentage:r})},o=(e,t)=>(0,r.jsx)(`ul`,{"aria-labelledby":`${t.htmlId}__heading`,className:(0,n.default)(`slds-tree`,t.initalClassName),onScroll:e=>a(e,t),role:`tree`,style:t.initialStyle,children:e});o.displayName=`TreeInitialNode`,exports.default=o;
1
+ const e=require("../../../_virtual/_rolldown/runtime.cjs");let t=require("react");t=e.__toESM(t,1);let n=require("classnames");n=e.__toESM(n,1);let r=require("react/jsx-runtime"),i=require("lodash.isfunction");i=e.__toESM(i,1);var a=(e,t)=>{let n=e.currentTarget,r=n.scrollHeight-n.clientHeight,a=r>0?Math.min(Math.max(n.scrollTop/r,0),1):0;(0,i.default)(t.onScroll)&&t.onScroll(e,{ratio:a,percentage:a*100})},o=(e,t)=>(0,r.jsx)(`ul`,{"aria-labelledby":`${t.htmlId}__heading`,className:(0,n.default)(`slds-tree`,t.initalClassName),onScroll:e=>a(e,t),role:`tree`,style:t.initialStyle,children:e});o.displayName=`TreeInitialNode`,exports.default=o;
2
2
  //# sourceMappingURL=render-initial-branch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-initial-branch.cjs","names":[],"sources":["../../../../../components/tree/private/render-initial-branch.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, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\nexport interface RenderInitialBranchProps {\n\thtmlId: string | number;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: { percentage: number }\n\t) => void;\n}\n\nconst handleScroll = (\n\tevent: React.UIEvent<HTMLUListElement>,\n\tprops: RenderInitialBranchProps\n) => {\n\tconst target = event.target as HTMLUListElement;\n\tconst percentage =\n\t\t(target.scrollTop / (target.scrollHeight - target.clientHeight)) * 100;\n\n\tif (isFunction(props.onScroll)) {\n\t\tprops.onScroll(event, { percentage });\n\t}\n};\n\nconst RenderInitialBranch = (\n\tchildren: ReactNode,\n\tprops: RenderInitialBranchProps\n): React.ReactElement => (\n\t<ul\n\t\taria-labelledby={`${props.htmlId}__heading`}\n\t\tclassName={classNames('slds-tree', props.initalClassName)}\n\t\tonScroll={(event) => handleScroll(event, props)}\n\t\trole=\"tree\"\n\t\tstyle={props.initialStyle}\n\t>\n\t\t{children}\n\t</ul>\n);\n\nRenderInitialBranch.displayName = 'TreeInitialNode';\n\nexport default RenderInitialBranch;\n\n"],"mappings":"mOAiBA,IAAM,GACL,EACA,IACI,CACJ,IAAM,EAAS,EAAM,OACf,EACJ,EAAO,WAAa,EAAO,aAAe,EAAO,cAAiB,KAEpE,EAAI,EAAA,QAAA,CAAW,EAAM,QAAQ,GAC5B,EAAM,SAAS,EAAO,CAAE,YAAW,CAAC,CAEtC,EAEM,GACL,EACA,KAEA,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,kBAAiB,GAAG,EAAM,OAAO,WACjC,WAAA,EAAW,EAAA,QAAA,CAAW,YAAa,EAAM,eAAe,EACxD,SAAW,GAAU,EAAa,EAAO,CAAK,EAC9C,KAAK,OACL,MAAO,EAAM,aAEZ,UACE,CAAA,EAGL,EAAoB,YAAc"}
1
+ {"version":3,"file":"render-initial-branch.cjs","names":[],"sources":["../../../../../components/tree/private/render-initial-branch.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, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\nimport { TreeScrollData } from '../types';\n\nexport interface RenderInitialBranchProps {\n\thtmlId: string | number;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n}\n\nconst handleScroll = (\n\tevent: React.UIEvent<HTMLUListElement>,\n\tprops: RenderInitialBranchProps\n) => {\n\tconst target = event.currentTarget;\n\tconst maxScrollTop = target.scrollHeight - target.clientHeight;\n\t// 0 when not scrollable, otherwise clamped to 0–1 (overscroll can exceed the range)\n\tconst ratio =\n\t\tmaxScrollTop > 0\n\t\t\t? Math.min(Math.max(target.scrollTop / maxScrollTop, 0), 1)\n\t\t\t: 0;\n\n\tif (isFunction(props.onScroll)) {\n\t\tprops.onScroll(event, { ratio, percentage: ratio * 100 });\n\t}\n};\n\nconst RenderInitialBranch = (\n\tchildren: ReactNode,\n\tprops: RenderInitialBranchProps\n): React.ReactElement => (\n\t<ul\n\t\taria-labelledby={`${props.htmlId}__heading`}\n\t\tclassName={classNames('slds-tree', props.initalClassName)}\n\t\tonScroll={(event) => handleScroll(event, props)}\n\t\trole=\"tree\"\n\t\tstyle={props.initialStyle}\n\t>\n\t\t{children}\n\t</ul>\n);\n\nRenderInitialBranch.displayName = 'TreeInitialNode';\n\nexport default RenderInitialBranch;\n"],"mappings":"mOAmBA,IAAM,GACL,EACA,IACI,CACJ,IAAM,EAAS,EAAM,cACf,EAAe,EAAO,aAAe,EAAO,aAE5C,EACL,EAAe,EACZ,KAAK,IAAI,KAAK,IAAI,EAAO,UAAY,EAAc,CAAC,EAAG,CAAC,EACxD,GAEJ,EAAI,EAAA,QAAA,CAAW,EAAM,QAAQ,GAC5B,EAAM,SAAS,EAAO,CAAE,QAAO,WAAY,EAAQ,GAAI,CAAC,CAE1D,EAEM,GACL,EACA,KAEA,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,kBAAiB,GAAG,EAAM,OAAO,WACjC,WAAA,EAAW,EAAA,QAAA,CAAW,YAAa,EAAM,eAAe,EACxD,SAAW,GAAU,EAAa,EAAO,CAAK,EAC9C,KAAK,OACL,MAAO,EAAM,aAEZ,UACE,CAAA,EAGL,EAAoB,YAAc"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/branch.cjs"),r=require("./check-props.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(e,t,n=``,r=!0)=>{if(!e.nodes)return[{node:e,treeIndex:n}];let i=[{node:e,treeIndex:n}];if(e.expanded)for(let a=0;a<e.nodes.length;a+=1){let o=r?e.nodes[a]:t(e)?.[a];o&&(i=i.concat(s(o,t,n?`${n}-${a}`:`${a}`,!1)))}return i},c=e=>e.nodes,l=({assistiveText:e,className:l,listClassName:u,getNodes:d=c,heading:f,id:p,nodes:m,onClick:h,onExpandClick:g,onScroll:_,searchTerm:v,listStyle:y})=>{let b=typeof e==`string`?e:e?.label,x=(0,i.useRef)(!1),S=(0,i.useCallback)(()=>s({nodes:d({nodes:m}),expanded:!0},d).slice(1),[d,m]),[C,w]=(0,i.useState)(S),[T,E]=(0,i.useState)(()=>{let e=S().find(e=>e.node.selected);return e?[e.treeIndex]:[]}),[D,O]=(0,i.useState)(()=>S().find(e=>e.node.selected)?.treeIndex);(0,i.useEffect)(()=>{r.default(t.TREE,{assistiveText:e,className:l,listClassName:u,getNodes:d,heading:f,id:p,nodes:m,onClick:h,onExpandClick:g,onScroll:_,searchTerm:v,listStyle:y},{})},[]),(0,i.useEffect)(()=>{w(S())},[S,m]);let k=(0,i.useCallback)(({event:e,data:t,clearSelectedNodes:n,fromFocus:r})=>{n&&C.forEach(e=>{e.node.selected&&(e.node.selected=!1)}),r||h(e,t);let i;i=t.select?[...T,t.treeIndex]:T.filter(e=>e!==t.treeIndex),x.current=!0,O(t.treeIndex),E(i)},[C,h,T]),A=(0,i.useCallback)(()=>{x.current=!1},[]),j=(0,i.useCallback)(({event:e,data:t})=>{x.current=!0,g(e,t),t.select&&O(t.treeIndex)},[g]),M=b||f;return(0,o.jsxs)(`div`,{id:p,className:(0,a.default)(`slds-tree_container`,l),children:[(0,o.jsx)(`h4`,{className:(0,a.default)(`slds-tree__group-header`,{"slds-assistive-text":!!b}),id:`${p}__heading`,children:M}),(0,o.jsx)(n.default,{getNodes:d,initalClassName:u,htmlId:p,initialStyle:y,level:0,node:{nodes:m},flattenedNodes:C,selectedNodeIndexes:T,focusedNodeIndex:D,treeHasFocus:x.current,onNodeBlur:A,onSelect:k,onExpand:j,onScroll:_,searchTerm:v,treeId:p})]})};l.displayName=t.TREE,exports.default=l;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/branch.cjs"),r=require("./check-props.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(e,t,n=``,r=!0)=>{if(!e.nodes)return[{node:e,treeIndex:n}];let i=[{node:e,treeIndex:n}];if(e.expanded)for(let a=0;a<e.nodes.length;a+=1){let o=r?e.nodes[a]:t(e)?.[a];o&&(i=i.concat(s(o,t,n?`${n}-${a}`:`${a}`,!1)))}return i},c=e=>e.nodes,l=({assistiveText:e,className:l,listClassName:u,getNodes:d=c,heading:f,id:p,nodes:m,onSelect:h,onClick:g,onRequestToggle:_,onExpandClick:v,onScroll:y,searchTerm:b,listStyle:x})=>{let S=e?.label,C=(0,i.useRef)(!1),w=(0,i.useCallback)(()=>s({nodes:d({nodes:m}),expanded:!0},d).slice(1),[d,m]),[T,E]=(0,i.useState)(w),[D,O]=(0,i.useState)(()=>{let e=w().find(e=>e.node.selected);return e?[e.treeIndex]:[]}),[k,A]=(0,i.useState)(()=>w().find(e=>e.node.selected)?.treeIndex);(0,i.useEffect)(()=>{r.default(t.TREE,{assistiveText:e,className:l,listClassName:u,getNodes:d,heading:f,id:p,nodes:m,onSelect:h,onClick:g,onRequestToggle:_,onExpandClick:v,onScroll:y,searchTerm:b,listStyle:x},{})},[]),(0,i.useEffect)(()=>{E(w())},[w,m]);let j=(0,i.useCallback)(({event:e,data:t,clearSelectedNodes:n,fromFocus:r})=>{n&&T.forEach(e=>{e.node.selected&&(e.node.selected=!1)}),r||(h?h(e,{node:t.node,isSelected:t.select}):g&&g(e,t));let i;i=t.select?[...D,t.treeIndex]:D.filter(e=>e!==t.treeIndex),C.current=!0,A(t.treeIndex),O(i)},[T,h,g,D]),M=(0,i.useCallback)(()=>{C.current=!1},[]),N=(0,i.useCallback)(({event:e,data:t})=>{if(t.select){!_&&v?(C.current=!0,v(e,t),A(t.treeIndex)):j({event:e,data:{node:t.node,select:!0,treeIndex:t.treeIndex},clearSelectedNodes:!0});return}C.current=!0,_?_(e,{node:t.node,isExpanded:t.expand}):v&&v(e,t)},[j,_,v]),P=S||f;return(0,o.jsxs)(`div`,{id:p,className:(0,a.default)(`slds-tree_container`,l),children:[(0,o.jsx)(`h4`,{className:(0,a.default)(`slds-tree__group-header`,{"slds-assistive-text":!!S}),id:`${p}__heading`,children:P}),(0,o.jsx)(n.default,{getNodes:d,initalClassName:u,htmlId:p,initialStyle:x,level:0,node:{nodes:m},flattenedNodes:T,selectedNodeIndexes:D,focusedNodeIndex:k,treeHasFocus:C.current,onNodeBlur:M,onSelect:j,onExpand:N,onScroll:y,searchTerm:b,treeId:p})]})};l.displayName=t.TREE,exports.default=l;
2
2
  //# sourceMappingURL=tree.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree.cjs","names":[],"sources":["../../../../components/tree/tree.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, useCallback, useEffect, useRef } from 'react';\nimport classNames from 'classnames';\n// Using native Array.find instead of lodash for better TypeScript support\n\n// Child components\nimport Branch from './private/branch';\n\n// Similar to React's PropTypes check\nimport checkProps from './check-props';\n\n// Constants\nimport { TREE } from '../../utilities/constants';\n\nimport {\n\tTreeNode,\n\tFlattenedNode,\n\tTreeAssistiveText,\n\tTreeSelectData,\n\tTreeExpandData,\n\tTreeScrollData,\n} from './types';\n\nexport interface TreeProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: TreeAssistiveText;\n\t/** Class names for the container element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Class names for the top-level ul element */\n\tlistClassName?: string | string[] | Record<string, boolean>;\n\t/** Function to get child nodes from a parent node */\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\t/** Tree heading that describes its contents */\n\theading?: ReactNode | string;\n\t/** HTML id of the tree container (required) */\n\tid: string;\n\t/** Array of tree nodes */\n\tnodes: TreeNode[];\n\t/** Callback when an item or branch is selected */\n\tonClick: (event: React.SyntheticEvent, data: TreeSelectData) => void;\n\t/** Callback when expand/collapse icon is clicked */\n\tonExpandClick: (event: React.SyntheticEvent, data: TreeExpandData) => void;\n\t/** Callback when the tree list scrolls */\n\tonScroll?: (event: React.UIEvent<HTMLUListElement>, data: TreeScrollData) => void;\n\t/** Search term to highlight in node labels */\n\tsearchTerm?: string;\n\t/** Styles for the top-level ul element */\n\tlistStyle?: React.CSSProperties;\n}\n\ntype ReactNode = React.ReactNode;\n\n/**\n * Flattens hierarchical tree structure into a flat array.\n * The first item is the whole tree and should be removed with slice(1).\n */\nconst flattenTree = (\n\troot: { nodes?: TreeNode[]; expanded?: boolean },\n\tgetNodes: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined,\n\ttreeIndex = '',\n\tfirstLevel = true\n): FlattenedNode[] => {\n\tif (!root.nodes) {\n\t\treturn [{ node: root as TreeNode, treeIndex }];\n\t}\n\tlet nodes: FlattenedNode[] = [{ node: root as TreeNode, treeIndex }];\n\tif (root.expanded) {\n\t\tfor (let index = 0; index < root.nodes.length; index += 1) {\n\t\t\tconst curNode = firstLevel ? root.nodes[index] : getNodes(root)?.[index];\n\t\t\tif (curNode) {\n\t\t\t\tnodes = nodes.concat(\n\t\t\t\t\tflattenTree(\n\t\t\t\t\t\tcurNode,\n\t\t\t\t\t\tgetNodes,\n\t\t\t\t\t\ttreeIndex ? `${treeIndex}-${index}` : `${index}`,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn nodes;\n};\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A tree is visualization of a structure hierarchy.\n * A branch can be expanded or collapsed.\n * This is a controlled component, since visual state is present in the nodes data.\n */\nconst Tree: React.FC<TreeProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tlistClassName,\n\tgetNodes = defaultGetNodes,\n\theading,\n\tid,\n\tnodes,\n\tonClick,\n\tonExpandClick,\n\tonScroll,\n\tsearchTerm,\n\tlistStyle,\n}) => {\n\t// Merge assistive text with defaults\n\tconst assistiveText =\n\t\ttypeof assistiveTextProp === 'string'\n\t\t\t? assistiveTextProp\n\t\t\t: assistiveTextProp?.label;\n\n\t// Track if tree has focus\n\tconst treeHasFocusRef = useRef(false);\n\n\t// Compute flattened nodes\n\tconst computeFlattenedNodes = useCallback(() => {\n\t\treturn flattenTree(\n\t\t\t{\n\t\t\t\tnodes: getNodes({ nodes }),\n\t\t\t\texpanded: true,\n\t\t\t},\n\t\t\tgetNodes\n\t\t).slice(1);\n\t}, [getNodes, nodes]);\n\n\t// Initialize state\n\tconst [flattenedNodes, setFlattenedNodes] = useState<FlattenedNode[]>(\n\t\tcomputeFlattenedNodes\n\t);\n\tconst [selectedNodeIndexes, setSelectedNodeIndexes] = useState<string[]>(() => {\n\t\tconst flattened = computeFlattenedNodes();\n\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\treturn selectedNode ? [selectedNode.treeIndex] : [];\n\t});\n\tconst [focusedNodeIndex, setFocusedNodeIndex] = useState<string | undefined>(\n\t\t() => {\n\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\treturn selectedNode?.treeIndex;\n\t\t}\n\t);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(checkProps as any)(TREE, {\n\t\t\tassistiveText: assistiveTextProp,\n\t\t\tclassName,\n\t\t\tlistClassName,\n\t\t\tgetNodes,\n\t\t\theading,\n\t\t\tid,\n\t\t\tnodes,\n\t\t\tonClick,\n\t\t\tonExpandClick,\n\t\t\tonScroll,\n\t\t\tsearchTerm,\n\t\t\tlistStyle,\n\t\t}, {});\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Update flattened nodes when nodes prop changes\n\tuseEffect(() => {\n\t\tsetFlattenedNodes(computeFlattenedNodes());\n\t}, [computeFlattenedNodes, nodes]);\n\n\t// Handle node selection\n\tconst handleSelect = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tdata,\n\t\t\tclearSelectedNodes,\n\t\t\tfromFocus,\n\t\t}: {\n\t\t\tevent: React.SyntheticEvent;\n\t\t\tdata: TreeSelectData;\n\t\t\tclearSelectedNodes?: boolean;\n\t\t\tfromFocus?: boolean;\n\t\t}) => {\n\t\t\t// When triggered by a key event, other nodes should be deselected\n\t\t\tif (clearSelectedNodes) {\n\t\t\t\tflattenedNodes.forEach((flattenedNode) => {\n\t\t\t\t\tif (flattenedNode.node.selected) {\n\t\t\t\t\t\tflattenedNode.node.selected = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Prevent firing twice on first click due to focus event\n\t\t\tif (!fromFocus) {\n\t\t\t\tonClick(event, data);\n\t\t\t}\n\n\t\t\t// Update selected and focused nodes\n\t\t\tlet newSelectedNodeIndexes: string[];\n\t\t\tif (data.select) {\n\t\t\t\tnewSelectedNodeIndexes = [...selectedNodeIndexes, data.treeIndex];\n\t\t\t} else {\n\t\t\t\tnewSelectedNodeIndexes = selectedNodeIndexes.filter(\n\t\t\t\t\t(treeIndex) => treeIndex !== data.treeIndex\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttreeHasFocusRef.current = true;\n\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\tsetSelectedNodeIndexes(newSelectedNodeIndexes);\n\t\t},\n\t\t[flattenedNodes, onClick, selectedNodeIndexes]\n\t);\n\n\t// Handle node blur\n\tconst handleNodeBlur = useCallback(() => {\n\t\ttreeHasFocusRef.current = false;\n\t}, []);\n\n\t// Handle expand/collapse\n\tconst handleExpand = useCallback(\n\t\t({ event, data }: { event: React.SyntheticEvent; data: TreeExpandData }) => {\n\t\t\ttreeHasFocusRef.current = true;\n\t\t\tonExpandClick(event, data);\n\n\t\t\tif (data.select) {\n\t\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\t}\n\t\t},\n\t\t[onExpandClick]\n\t);\n\n\t// Determine heading text\n\tconst headingText = assistiveText || heading;\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames('slds-tree_container', className)}\n\t\t>\n\t\t\t<h4\n\t\t\t\tclassName={classNames('slds-tree__group-header', {\n\t\t\t\t\t'slds-assistive-text': !!assistiveText,\n\t\t\t\t})}\n\t\t\t\tid={`${id}__heading`}\n\t\t\t>\n\t\t\t\t{headingText}\n\t\t\t</h4>\n\t\t\t<Branch\n\t\t\t\tgetNodes={getNodes}\n\t\t\t\tinitalClassName={listClassName}\n\t\t\t\thtmlId={id}\n\t\t\t\tinitialStyle={listStyle}\n\t\t\t\tlevel={0}\n\t\t\t\tnode={{ nodes }}\n\t\t\t\tflattenedNodes={flattenedNodes}\n\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\tfocusedNodeIndex={focusedNodeIndex}\n\t\t\t\ttreeHasFocus={treeHasFocusRef.current}\n\t\t\t\tonNodeBlur={handleNodeBlur}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t\tonExpand={handleExpand}\n\t\t\t\tonScroll={onScroll}\n\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\ttreeId={id}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nTree.displayName = TREE;\n\nexport default Tree;\n\n"],"mappings":"4RA0DA,IAAM,GACL,EACA,EACA,EAAY,GACZ,EAAa,KACQ,CACrB,GAAI,CAAC,EAAK,MACT,MAAO,CAAC,CAAE,KAAM,EAAkB,WAAU,CAAC,EAE9C,IAAI,EAAyB,CAAC,CAAE,KAAM,EAAkB,WAAU,CAAC,EACnE,GAAI,EAAK,SACR,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAK,MAAM,OAAQ,GAAS,EAAG,CAC1D,IA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yright (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, useCallback, useEffect, useRef } from 'react';\nimport classNames from 'classnames';\n// Using native Array.find instead of lodash for better TypeScript support\n\n// Child components\nimport Branch from './private/branch';\n\n// Similar to React's PropTypes check\nimport checkProps from './check-props';\n\n// Constants\nimport { TREE } from '../../utilities/constants';\n\nimport {\n\tTreeNode,\n\tFlattenedNode,\n\tTreeAssistiveText,\n\tTreeNodeSelectData,\n\tTreeRequestToggleData,\n\tTreeSelectData,\n\tTreeExpandData,\n\tTreeScrollData,\n} from './types';\n\nexport interface TreeProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: TreeAssistiveText;\n\t/** Class names for the container element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Class names for the top-level ul element */\n\tlistClassName?: string | string[] | Record<string, boolean>;\n\t/** Function to get child nodes from a parent node */\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\t/** Tree heading that describes its contents */\n\theading?: ReactNode | string;\n\t/** HTML id of the tree container (required) */\n\tid: string;\n\t/** Array of tree nodes */\n\tnodes: TreeNode[];\n\t/**\n\t * Called when an item or branch is selected or deselected: by click, by focus, or by keyboard\n\t * (Enter, Up/Down arrows, Right arrow into an expanded branch, Left arrow to the parent node).\n\t * `data.isSelected` is the requested selection state. Update `node.selected` in `nodes` to apply it.\n\t */\n\tonSelect?: (event: React.SyntheticEvent, data: TreeNodeSelectData) => void;\n\t/**\n\t * Called when an item or branch is selected.\n\t * @deprecated Use `onSelect`, which receives `{ node, isSelected }`. Ignored when `onSelect` is passed.\n\t */\n\tonClick?: (event: React.SyntheticEvent, data: TreeSelectData) => void;\n\t/**\n\t * Called when a branch is asked to expand or collapse: by clicking its toggle button, by Right\n\t * arrow on a collapsed branch, or by Left arrow on an expanded branch. `data.isExpanded` is the\n\t * requested expansion state. Update `node.expanded` in `nodes` to apply it.\n\t */\n\tonRequestToggle?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: TreeRequestToggleData\n\t) => void;\n\t/**\n\t * Called when a branch's expand/collapse button is clicked, or when the Left arrow is pressed\n\t * on a collapsed branch or item (with `data.select: true` and `data.node` set to the parent).\n\t * @deprecated Use `onRequestToggle`, which receives `{ node, isExpanded }`. With\n\t * `onRequestToggle`, Left arrow on a collapsed branch or item selects the parent via\n\t * `onSelect` instead. Ignored when `onRequestToggle` is passed.\n\t */\n\tonExpandClick?: (event: React.SyntheticEvent, data: TreeExpandData) => void;\n\t/** Callback when the tree list scrolls. `data.ratio` is the scroll position from `0` to `1`. */\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\t/** Search term to highlight in node labels */\n\tsearchTerm?: string;\n\t/** Styles for the top-level ul element */\n\tlistStyle?: React.CSSProperties;\n}\n\ntype ReactNode = React.ReactNode;\n\n/**\n * Flattens hierarchical tree structure into a flat array.\n * The first item is the whole tree and should be removed with slice(1).\n */\nconst flattenTree = (\n\troot: { nodes?: TreeNode[]; expanded?: boolean },\n\tgetNodes: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined,\n\ttreeIndex = '',\n\tfirstLevel = true\n): FlattenedNode[] => {\n\tif (!root.nodes) {\n\t\treturn [{ node: root as TreeNode, treeIndex }];\n\t}\n\tlet nodes: FlattenedNode[] = [{ node: root as TreeNode, treeIndex }];\n\tif (root.expanded) {\n\t\tfor (let index = 0; index < root.nodes.length; index += 1) {\n\t\t\tconst curNode = firstLevel ? root.nodes[index] : getNodes(root)?.[index];\n\t\t\tif (curNode) {\n\t\t\t\tnodes = nodes.concat(\n\t\t\t\t\tflattenTree(\n\t\t\t\t\t\tcurNode,\n\t\t\t\t\t\tgetNodes,\n\t\t\t\t\t\ttreeIndex ? `${treeIndex}-${index}` : `${index}`,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn nodes;\n};\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A tree is visualization of a structure hierarchy.\n * A branch can be expanded or collapsed.\n * This is a controlled component, since visual state is present in the nodes data.\n */\nconst Tree: React.FC<TreeProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tlistClassName,\n\tgetNodes = defaultGetNodes,\n\theading,\n\tid,\n\tnodes,\n\tonSelect,\n\tonClick,\n\tonRequestToggle,\n\tonExpandClick,\n\tonScroll,\n\tsearchTerm,\n\tlistStyle,\n}) => {\n\tconst assistiveText = assistiveTextProp?.label;\n\n\t// Track if tree has focus\n\tconst treeHasFocusRef = useRef(false);\n\n\t// Compute flattened nodes\n\tconst computeFlattenedNodes = useCallback(() => {\n\t\treturn flattenTree(\n\t\t\t{\n\t\t\t\tnodes: getNodes({ nodes }),\n\t\t\t\texpanded: true,\n\t\t\t},\n\t\t\tgetNodes\n\t\t).slice(1);\n\t}, [getNodes, nodes]);\n\n\t// Initialize state\n\tconst [flattenedNodes, setFlattenedNodes] = useState<FlattenedNode[]>(\n\t\tcomputeFlattenedNodes\n\t);\n\tconst [selectedNodeIndexes, setSelectedNodeIndexes] = useState<string[]>(\n\t\t() => {\n\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\treturn selectedNode ? [selectedNode.treeIndex] : [];\n\t\t}\n\t);\n\tconst [focusedNodeIndex, setFocusedNodeIndex] = useState<string | undefined>(\n\t\t() => {\n\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\treturn selectedNode?.treeIndex;\n\t\t}\n\t);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(checkProps as any)(\n\t\t\tTREE,\n\t\t\t{\n\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\tclassName,\n\t\t\t\tlistClassName,\n\t\t\t\tgetNodes,\n\t\t\t\theading,\n\t\t\t\tid,\n\t\t\t\tnodes,\n\t\t\t\tonSelect,\n\t\t\t\tonClick,\n\t\t\t\tonRequestToggle,\n\t\t\t\tonExpandClick,\n\t\t\t\tonScroll,\n\t\t\t\tsearchTerm,\n\t\t\t\tlistStyle,\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Update flattened nodes when nodes prop changes\n\tuseEffect(() => {\n\t\tsetFlattenedNodes(computeFlattenedNodes());\n\t}, [computeFlattenedNodes, nodes]);\n\n\t// Handle node selection\n\tconst handleSelect = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tdata,\n\t\t\tclearSelectedNodes,\n\t\t\tfromFocus,\n\t\t}: {\n\t\t\tevent: React.SyntheticEvent;\n\t\t\tdata: TreeSelectData;\n\t\t\tclearSelectedNodes?: boolean;\n\t\t\tfromFocus?: boolean;\n\t\t}) => {\n\t\t\t// When triggered by a key event, other nodes should be deselected\n\t\t\tif (clearSelectedNodes) {\n\t\t\t\tflattenedNodes.forEach((flattenedNode) => {\n\t\t\t\t\tif (flattenedNode.node.selected) {\n\t\t\t\t\t\tflattenedNode.node.selected = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Prevent firing twice on first click due to focus event\n\t\t\tif (!fromFocus) {\n\t\t\t\tif (onSelect) {\n\t\t\t\t\tonSelect(event, { node: data.node, isSelected: data.select });\n\t\t\t\t} else if (onClick) {\n\t\t\t\t\tonClick(event, data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update selected and focused nodes\n\t\t\tlet newSelectedNodeIndexes: string[];\n\t\t\tif (data.select) {\n\t\t\t\tnewSelectedNodeIndexes = [...selectedNodeIndexes, data.treeIndex];\n\t\t\t} else {\n\t\t\t\tnewSelectedNodeIndexes = selectedNodeIndexes.filter(\n\t\t\t\t\t(treeIndex) => treeIndex !== data.treeIndex\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttreeHasFocusRef.current = true;\n\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\tsetSelectedNodeIndexes(newSelectedNodeIndexes);\n\t\t},\n\t\t[flattenedNodes, onSelect, onClick, selectedNodeIndexes]\n\t);\n\n\t// Handle node blur\n\tconst handleNodeBlur = useCallback(() => {\n\t\ttreeHasFocusRef.current = false;\n\t}, []);\n\n\t// Handle expand/collapse\n\tconst handleExpand = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tdata,\n\t\t}: {\n\t\t\tevent: React.SyntheticEvent;\n\t\t\tdata: TreeExpandData;\n\t\t}) => {\n\t\t\t// `data.select` marks Left arrow on a collapsed branch or item: move to the parent node.\n\t\t\tif (data.select) {\n\t\t\t\tif (!onRequestToggle && onExpandClick) {\n\t\t\t\t\t// Deprecated behavior: report it to `onExpandClick` with the parent node\n\t\t\t\t\ttreeHasFocusRef.current = true;\n\t\t\t\t\tonExpandClick(event, data);\n\t\t\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\t\t} else {\n\t\t\t\t\t// Not an expand/collapse request: select the parent, like Up/Down arrows do\n\t\t\t\t\thandleSelect({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tdata: { node: data.node, select: true, treeIndex: data.treeIndex },\n\t\t\t\t\t\tclearSelectedNodes: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttreeHasFocusRef.current = true;\n\t\t\tif (onRequestToggle) {\n\t\t\t\tonRequestToggle(event, { node: data.node, isExpanded: data.expand });\n\t\t\t} else if (onExpandClick) {\n\t\t\t\tonExpandClick(event, data);\n\t\t\t}\n\t\t},\n\t\t[handleSelect, onRequestToggle, onExpandClick]\n\t);\n\n\t// Determine heading text\n\tconst headingText = assistiveText || heading;\n\n\treturn (\n\t\t<div id={id} className={classNames('slds-tree_container', className)}>\n\t\t\t<h4\n\t\t\t\tclassName={classNames('slds-tree__group-header', {\n\t\t\t\t\t'slds-assistive-text': !!assistiveText,\n\t\t\t\t})}\n\t\t\t\tid={`${id}__heading`}\n\t\t\t>\n\t\t\t\t{headingText}\n\t\t\t</h4>\n\t\t\t<Branch\n\t\t\t\tgetNodes={getNodes}\n\t\t\t\tinitalClassName={listClassName}\n\t\t\t\thtmlId={id}\n\t\t\t\tinitialStyle={listStyle}\n\t\t\t\tlevel={0}\n\t\t\t\tnode={{ nodes }}\n\t\t\t\tflattenedNodes={flattenedNodes}\n\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\tfocusedNodeIndex={focusedNodeIndex}\n\t\t\t\ttreeHasFocus={treeHasFocusRef.current}\n\t\t\t\tonNodeBlur={handleNodeBlur}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t\tonExpand={handleExpand}\n\t\t\t\tonScroll={onScroll}\n\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\ttreeId={id}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nTree.displayName = TREE;\n\nexport default Tree;\n"],"mappings":"4RAuFA,IAAM,GACL,EACA,EACA,EAAY,GACZ,EAAa,KACQ,CACrB,GAAI,CAAC,EAAK,MACT,MAAO,CAAC,CAAE,KAAM,EAAkB,WAAU,CAAC,EAE9C,IAAI,EAAyB,CAAC,CAAE,KAAM,EAAkB,WAAU,CAAC,EACnE,GAAI,EAAK,SACR,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAK,MAAM,OAAQ,GAAS,EAAG,CAC1D,IAAM,EAAU,EAAa,EAAK,MAAM,GAAS,EAAS,CAAI,CAAC,GAAG,GAC9D,IACH,EAAQ,EAAM,OACb,EACC,EACA,EACA,EAAY,GAAG,EAAU,GAAG,IAAU,GAAG,IACzC,EACD,CACD,EAEF,CAED,OAAO,CACR,EAEM,EAAmB,GAAiC,EAAK,MAOzD,GAA6B,CAClC,cAAe,EACf,YACA,gBACA,WAAW,EACX,UACA,KACA,Q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K,YAAc,EAAA"}
@@ -0,0 +1 @@
1
+ module.exports = require('./tree/index.cjs');
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={timeLeftUnitAfter:`left in trial`},o=({children:e,className:t,labels:n,onRenderActions:o,style:s})=>{let c={...a,...n};return(0,i.jsxs)(`div`,{className:(0,r.default)(`slds-trial-header slds-grid`,t),style:s,children:[(0,i.jsx)(`div`,{className:`slds-grid`,children:e}),(0,i.jsxs)(`div`,{className:`slds-grid slds-grid_vertical-align-center slds-col_bump-left`,children:[(0,i.jsx)(`span`,{className:`slds-box slds-box_xx-small slds-theme_default`,children:c.timeLeft}),(0,i.jsxs)(`span`,{className:`slds-m-horizontal_x-small`,children:[c.timeLeftUnit,c.timeLeftUnitAfter&&` ${c.timeLeftUnitAfter}`]}),o?.()]})]})};o.displayName=t.TRIAL_BAR,exports.default=o;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={timeLeftUnitAfter:`left in trial`},o=({children:e,className:t,labels:n,onRenderActions:o,style:s})=>{let c={...a,...n};return(0,i.jsxs)(`div`,{className:(0,r.default)(`slds-trial-header slds-grid`,t),style:s,children:[(0,i.jsx)(`div`,{className:`slds-grid`,children:e}),(0,i.jsxs)(`div`,{className:`slds-grid slds-grid_vertical-align-center slds-col_bump-left`,children:[(0,i.jsx)(`span`,{className:`slds-box slds-box_xx-small slds-theme_default`,children:c.timeLeft}),(0,i.jsxs)(`span`,{className:`slds-m-horizontal_x-small`,children:[c.timeLeftUnit,c.timeLeftUnitAfter&&` ${c.timeLeftUnitAfter}`]}),o?.()]})]})};o.displayName=t.TRIAL_BAR,exports.default=o;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/trial-bar/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 ReactNode, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { TRIAL_BAR } from '../../utilities/constants';\n\n/**\n * Labels for TrialBar\n */\nexport interface TrialBarLabels {\n\t/** Amount of time left */\n\ttimeLeft?: string;\n\t/** Unit of time */\n\ttimeLeftUnit?: string;\n\t/** Text after time unit */\n\ttimeLeftUnitAfter?: string;\n}\n\n/**\n * Props for the TrialBar component\n */\nexport interface TrialBarProps {\n\t/** TrialBarButton or TrialBarDropdown children */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Text labels */\n\tlabels?: TrialBarLabels;\n\t/** Render function for actions section */\n\tonRenderActions?: () => ReactNode;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\nconst defaultLabels: TrialBarLabels = {\n\ttimeLeftUnitAfter: 'left in trial',\n};\n\n/**\n * Trial bar components are used to provide an interactive and educational\n * prospect experience for setup.\n */\nconst TrialBar = ({\n\tchildren,\n\tclassName,\n\tlabels: propLabels,\n\tonRenderActions,\n\tstyle,\n}: TrialBarProps): React.ReactElement => {\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-trial-header slds-grid', className as string)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t<div className=\"slds-grid\">{children}</div>\n\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center slds-col_bump-left\">\n\t\t\t\t<span className=\"slds-box slds-box_xx-small slds-theme_default\">\n\t\t\t\t\t{labels.timeLeft}\n\t\t\t\t</span>\n\t\t\t\t<span className=\"slds-m-horizontal_x-small\">\n\t\t\t\t\t{labels.timeLeftUnit}\n\t\t\t\t\t{labels.timeLeftUnitAfter && ` ${labels.timeLeftUnitAfter}`}\n\t\t\t\t</span>\n\t\t\t\t{onRenderActions?.()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nTrialBar.displayName = TRIAL_BAR;\n\nexport default TrialBar;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"2NAmCA,IAAM,EAAgC,CACrC,kBAAmB,eACpB,EAMM,GAAY,CACjB,WACA,YACA,OAAQ,EACR,kBACA,WACwC,CACxC,IAAM,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,EAEjD,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,8BAA+B,CAAmB,EACjE,QAFR,SAAA,EAIC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,YAAa,UAAc,CAAA,GAC1C,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,+DAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gDACd,SAAA,EAAO,QACH,CAAA,GACN,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,4BAAhB,SAAA,CACE,EAAO,aACP,EAAO,mBAAqB,IAAI,EAAO,mBACnC,IACL,IAAkB,CACf,CACD,CAAA,CAAA,GAEP,EAEA,EAAS,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/trial-bar/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 ReactNode, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { TRIAL_BAR } from '../../utilities/constants';\n\n/**\n * Labels for TrialBar\n */\nexport interface TrialBarLabels {\n\t/** Amount of time left */\n\ttimeLeft?: string;\n\t/** Unit of time */\n\ttimeLeftUnit?: string;\n\t/** Text after time unit */\n\ttimeLeftUnitAfter?: string;\n}\n\n/**\n * Props for the TrialBar component\n */\nexport interface TrialBarProps {\n\t/** TrialBarButton or TrialBarDropdown children */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Text labels */\n\tlabels?: TrialBarLabels;\n\t/** Render function for actions section */\n\tonRenderActions?: () => ReactNode;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\nconst defaultLabels: TrialBarLabels = {\n\ttimeLeftUnitAfter: 'left in trial',\n};\n\n/**\n * Trial bar components are used to provide an interactive and educational\n * prospect experience for setup.\n */\nconst TrialBar = ({\n\tchildren,\n\tclassName,\n\tlabels: propLabels,\n\tonRenderActions,\n\tstyle,\n}: TrialBarProps): React.ReactElement => {\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-trial-header slds-grid', className as string)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t<div className=\"slds-grid\">{children}</div>\n\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center slds-col_bump-left\">\n\t\t\t\t<span className=\"slds-box slds-box_xx-small slds-theme_default\">\n\t\t\t\t\t{labels.timeLeft}\n\t\t\t\t</span>\n\t\t\t\t<span className=\"slds-m-horizontal_x-small\">\n\t\t\t\t\t{labels.timeLeftUnit}\n\t\t\t\t\t{labels.timeLeftUnitAfter && ` ${labels.timeLeftUnitAfter}`}\n\t\t\t\t</span>\n\t\t\t\t{onRenderActions?.()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nTrialBar.displayName = TRIAL_BAR;\n\nexport default TrialBar;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"0TAmCA,IAAM,EAAgC,CACrC,kBAAmB,eACpB,EAMM,GAAY,CACjB,WACA,YACA,OAAQ,EACR,kBACA,WACwC,CACxC,IAAM,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,EAEjD,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,8BAA+B,CAAmB,EACjE,QAFR,SAAA,EAIC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,YAAa,UAAc,CAAA,GAC1C,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,+DAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gDACd,SAAA,EAAO,QACH,CAAA,GACN,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,4BAAhB,SAAA,CACE,EAAO,aACP,EAAO,mBAAqB,IAAI,EAAO,mBACnC,IACL,IAAkB,CACf,CACD,CAAA,CAAA,GAEP,EAEA,EAAS,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../../components/utilities/menu-list/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\n// # List Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ComponentType, type ReactElement } from 'react';\n\n// ### classNames\nimport classNames from 'classnames';\n\n// ## Children\nimport ListItem, { type ListItemProps } from './item';\nimport { type ListItemLabelProps } from './item-label';\n\n// ## Constants\nimport { LIST } from '../../../utilities/constants';\n\ntype ListOption = { disabled?: boolean; value?: unknown } & Record<\n\tstring,\n\tunknown\n>;\n\nexport interface MenuListProps {\n\t/**\n\t * Determines whether or not to show a checkmark for selected items.\n\t */\n\tcheckmark?: boolean;\n\t/**\n\t * CSS classes to be added to `<ul />`.\n\t */\n\tclassName?: string;\n\t/**\n\t * Used internally to determine the id that will be used for list items.\n\t */\n\tgetListItemId?: (index: number) => string;\n\t/**\n\t * Used internally to pass references to the individual menu items back up for focusing / scrolling.\n\t */\n\titemRefs?: (listItem: HTMLLIElement | null, index: number) => void;\n\t/**\n\t * If provided, this function will be used to render the contents of each menu item.\n\t */\n\titemRenderer?: ComponentType<ListItemLabelProps>;\n\t/**\n\t * Sets the height of the list based on the numeber of items.\n\t */\n\tlength?: null | '5' | '7' | '10' | 5 | 7 | 10;\n\t/**\n\t * Triggered when a list item is selected (via mouse or keyboard).\n\t */\n\tonSelect?: (index: number) => void;\n\t/**\n\t * An array of items to render in the list.\n\t */\n\toptions?: ListOption[];\n\t/**\n\t * The index of the currently selected item in the list.\n\t */\n\tselectedIndex?: number;\n\t/**\n\t * The indices of the currently selected items in the list (multi-select).\n\t */\n\tselectedIndices?: number[];\n\t/**\n\t * Accepts a `Tooltip` component to be used as the template for menu item tooltips that appear via the `tooltipContent` options object attribute\n\t */\n\ttooltipMenuItem?: ReactElement;\n\t/**\n\t * The id of the element which triggered this list (in a menu context).\n\t */\n\ttriggerId?: string;\n}\n\n/**\n * Component description.\n */\nclass List extends React.Component<MenuListProps> {\n\tstatic displayName = LIST;\n\n\tstatic defaultProps: Partial<MenuListProps> = {\n\t\tlength: '5',\n\t\toptions: [],\n\t\tselectedIndex: -1,\n\t};\n\n\trender() {\n\t\tlet lengthClassName;\n\t\tlet list;\n\n\t\tif (this.props.length) {\n\t\t\tlengthClassName = `slds-dropdown_length-${this.props.length}`;\n\t\t}\n\n\t\tlist = (\n\t\t\t<ul\n\t\t\t\taria-labelledby={this.props.triggerId}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'dropdown__list',\n\t\t\t\t\tlengthClassName,\n\t\t\t\t\tthis.props.className\n\t\t\t\t)}\n\t\t\t\trole=\"menu\"\n\t\t\t>\n\t\t\t\t{(this.props.options ?? []).map((option, index) => {\n\t\t\t\t\tconst id = this.props.getListItemId?.(index) ?? `${index}`;\n\t\t\t\t\tconst isSingleSelected = index === this.props.selectedIndex;\n\t\t\t\t\tconst isMultipleSelected =\n\t\t\t\t\t\t!!this.props.selectedIndices &&\n\t\t\t\t\t\tthis.props.selectedIndices.indexOf(index) !== -1;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t{...(option as Partial<ListItemProps>)}\n\t\t\t\t\t\t\taria-disabled={option.disabled}\n\t\t\t\t\t\t\t// show checkmark\n\t\t\t\t\t\t\tcheckmark={\n\t\t\t\t\t\t\t\tthis.props.checkmark && (isSingleSelected || isMultipleSelected)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// show checkmark OR invisible placeholder icon\n\t\t\t\t\t\t\tisCheckmarkVariant={this.props.checkmark}\n\t\t\t\t\t\t\tdata={option}\n\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\tisSelected={isSingleSelected || isMultipleSelected}\n\t\t\t\t\t\t\tkey={`${id}-${option.value}`}\n\t\t\t\t\t\t\tlabelRenderer={this.props.itemRenderer}\n\t\t\t\t\t\t\tonSelect={this.props.onSelect ?? (() => {})}\n\t\t\t\t\t\t\tnodeRef={(listItem) => this.props.itemRefs?.(listItem, index)}\n\t\t\t\t\t\t\ttooltipTemplate={this.props.tooltipMenuItem}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ul>\n\t\t);\n\n\t\tif (this.props.tooltipMenuItem) {\n\t\t\t/* eslint-disable react/no-danger */\n\t\t\tlist = (\n\t\t\t\t<React.Fragment>\n\t\t\t\t\t<style\n\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t__html: `.slds-dropdown__item > .slds-tooltip-trigger > a {\n\tposition: relative;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-ms-flex-pack: justify;\n\tjustify-content: space-between;\n\t-ms-flex-align: center;\n\talign-items: center;\n\tpadding: 0.5rem 0.75rem;\n\tcolor: #080707;\n\twhite-space: nowrap;\n\tcursor: pointer;\n}\n\n.slds-dropdown__item > .slds-tooltip-trigger > a:active {\n text-decoration: none;\n background-color: #ecebea;\n}\n\n.slds-dropdown__item > .slds-tooltip-trigger > a:hover,\n.slds-dropdown__item > .slds-tooltip-trigger > a:focus {\n outline: 0;\n text-decoration: none;\n background-color: #f3f2f2;\n}\n`,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t{list}\n\t\t\t\t</React.Fragment>\n\t\t\t);\n\t\t\t/* eslint-enable react/no-danger */\n\t\t}\n\n\t\treturn list;\n\t}\n}\n\nexport default List;\n"],"mappings":"yPA+EA,IAAM,EAAN,cAAmB,EAAA,QAAM,SAAyB,CACjD,OAAO,YAAc,EAAA,KAErB,OAAO,aAAuC,CAC7C,OAAQ,IACR,QAAS,CAAC,EACV,cAAe,EAChB,EAEA,QAAS,CACR,IAAI,EACA,EAuFJ,OArFI,KAAK,MAAM,SACd,EAAkB,wBAAwB,KAAK,MAAM,UAGtD,GACC,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,kBAAiB,KAAK,MAAM,UAC5B,WAAA,EAAW,EAAA,QAAA,CACV,iBACA,EACA,KAAK,MAAM,SACZ,EACA,KAAK,OAEH,UAAA,KAAK,MAAM,SAAW,CAAC,EAAA,CAAG,KAAK,EAAQ,IAAU,CAClD,IAAM,EAAK,KAAK,MAAM,gBAAgB,CAAK,GAAK,GAAG,IAC7C,EAAmB,IAAU,KAAK,MAAM,cACxC,EACL,CAAC,CAAC,KAAK,MAAM,iBACb,KAAK,MAAM,gBAAgB,QAAQ,CAAK,IAAM,GAC/C,OACC,EAAA,EAAA,cAAA,CAAC,EAAA,QAAD,CACC,GAAK,EACL,gBAAe,EAAO,SAEtB,UACC,KAAK,MAAM,YAAc,GAAoB,GAG9C,mBAAoB,KAAK,MAAM,UAC/B,KAAM,EACF,KACG,QACP,WAAY,GAAoB,EAChC,IAAK,GAAG,EAAG,GAAG,EAAO,QACrB,cAAe,KAAK,MAAM,aAC1B,SAAU,KAAK,MAAM,eAAmB,CAAC,GACzC,QAAU,GAAa,KAAK,MAAM,WAAW,EAAU,CAAK,EAC5D,gBAAiB,KAAK,MAAM,eAC5B,CAAA,CAEH,CAAC,CACE,CAAA,EAGD,KAAK,MAAM,kBAEd,GACC,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,QAAD,CACC,wBAAyB,CACxB,OAAQ;;;;;;;;;;;;;;;;;;;;;;;;;CA0BT,CACA,CAAA,EACA,CACc,CAAA,CAAA,GAKX,CACR,CACD"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../../components/utilities/menu-list/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\n// # List Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ComponentType, type ReactElement } from 'react';\n\n// ### classNames\nimport classNames from 'classnames';\n\n// ## Children\nimport ListItem, { type ListItemProps } from './item';\nimport { type ListItemLabelProps } from './item-label';\n\n// ## Constants\nimport { LIST } from '../../../utilities/constants';\n\ntype ListOption = { disabled?: boolean; value?: unknown } & Record<\n\tstring,\n\tunknown\n>;\n\nexport interface MenuListProps {\n\t/**\n\t * Determines whether or not to show a checkmark for selected items.\n\t */\n\tcheckmark?: boolean;\n\t/**\n\t * CSS classes to be added to `<ul />`.\n\t */\n\tclassName?: string;\n\t/**\n\t * Used internally to determine the id that will be used for list items.\n\t */\n\tgetListItemId?: (index: number) => string;\n\t/**\n\t * Used internally to pass references to the individual menu items back up for focusing / scrolling.\n\t */\n\titemRefs?: (listItem: HTMLLIElement | null, index: number) => void;\n\t/**\n\t * If provided, this function will be used to render the contents of each menu item.\n\t */\n\titemRenderer?: ComponentType<ListItemLabelProps>;\n\t/**\n\t * Sets the height of the list based on the numeber of items.\n\t */\n\tlength?: null | '5' | '7' | '10' | 5 | 7 | 10;\n\t/**\n\t * Triggered when a list item is selected (via mouse or keyboard).\n\t */\n\tonSelect?: (index: number, event?: React.MouseEvent) => void;\n\t/**\n\t * An array of items to render in the list.\n\t */\n\toptions?: ListOption[];\n\t/**\n\t * The index of the currently selected item in the list.\n\t */\n\tselectedIndex?: number;\n\t/**\n\t * The indices of the currently selected items in the list (multi-select).\n\t */\n\tselectedIndices?: number[];\n\t/**\n\t * Accepts a `Tooltip` component to be used as the template for menu item tooltips that appear via the `tooltipContent` options object attribute\n\t */\n\ttooltipMenuItem?: ReactElement;\n\t/**\n\t * The id of the element which triggered this list (in a menu context).\n\t */\n\ttriggerId?: string;\n}\n\n/**\n * Component description.\n */\nclass List extends React.Component<MenuListProps> {\n\tstatic displayName = LIST;\n\n\tstatic defaultProps: Partial<MenuListProps> = {\n\t\tlength: '5',\n\t\toptions: [],\n\t\tselectedIndex: -1,\n\t};\n\n\trender() {\n\t\tlet lengthClassName;\n\t\tlet list;\n\n\t\tif (this.props.length) {\n\t\t\tlengthClassName = `slds-dropdown_length-${this.props.length}`;\n\t\t}\n\n\t\tlist = (\n\t\t\t<ul\n\t\t\t\taria-labelledby={this.props.triggerId}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'dropdown__list',\n\t\t\t\t\tlengthClassName,\n\t\t\t\t\tthis.props.className\n\t\t\t\t)}\n\t\t\t\trole=\"menu\"\n\t\t\t>\n\t\t\t\t{(this.props.options ?? []).map((option, index) => {\n\t\t\t\t\tconst id = this.props.getListItemId?.(index) ?? `${index}`;\n\t\t\t\t\tconst isSingleSelected = index === this.props.selectedIndex;\n\t\t\t\t\tconst isMultipleSelected =\n\t\t\t\t\t\t!!this.props.selectedIndices &&\n\t\t\t\t\t\tthis.props.selectedIndices.indexOf(index) !== -1;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t{...(option as Partial<ListItemProps>)}\n\t\t\t\t\t\t\taria-disabled={option.disabled}\n\t\t\t\t\t\t\t// show checkmark\n\t\t\t\t\t\t\tcheckmark={\n\t\t\t\t\t\t\t\tthis.props.checkmark && (isSingleSelected || isMultipleSelected)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// show checkmark OR invisible placeholder icon\n\t\t\t\t\t\t\tisCheckmarkVariant={this.props.checkmark}\n\t\t\t\t\t\t\tdata={option}\n\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\tisSelected={isSingleSelected || isMultipleSelected}\n\t\t\t\t\t\t\tkey={`${id}-${option.value}`}\n\t\t\t\t\t\t\tlabelRenderer={this.props.itemRenderer}\n\t\t\t\t\t\t\tonSelect={this.props.onSelect ?? (() => {})}\n\t\t\t\t\t\t\tnodeRef={(listItem) => this.props.itemRefs?.(listItem, index)}\n\t\t\t\t\t\t\ttooltipTemplate={this.props.tooltipMenuItem}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ul>\n\t\t);\n\n\t\tif (this.props.tooltipMenuItem) {\n\t\t\t/* eslint-disable react/no-danger */\n\t\t\tlist = (\n\t\t\t\t<React.Fragment>\n\t\t\t\t\t<style\n\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t__html: `.slds-dropdown__item > .slds-tooltip-trigger > a {\n\tposition: relative;\n\tdisplay: -ms-flexbox;\n\tdisplay: flex;\n\t-ms-flex-pack: justify;\n\tjustify-content: space-between;\n\t-ms-flex-align: center;\n\talign-items: center;\n\tpadding: 0.5rem 0.75rem;\n\tcolor: #080707;\n\twhite-space: nowrap;\n\tcursor: pointer;\n}\n\n.slds-dropdown__item > .slds-tooltip-trigger > a:active {\n text-decoration: none;\n background-color: #ecebea;\n}\n\n.slds-dropdown__item > .slds-tooltip-trigger > a:hover,\n.slds-dropdown__item > .slds-tooltip-trigger > a:focus {\n outline: 0;\n text-decoration: none;\n background-color: #f3f2f2;\n}\n`,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t{list}\n\t\t\t\t</React.Fragment>\n\t\t\t);\n\t\t\t/* eslint-enable react/no-danger */\n\t\t}\n\n\t\treturn list;\n\t}\n}\n\nexport default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,CACR,CACD"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../../utilities/event.cjs"),r=require("../../icon/index.cjs"),i=require("./item-label.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=class extends a.default.Component{static displayName=t.LIST_ITEM;static defaultProps={data:{},href:`#`,inverted:!1,isSelected:!1,label:``,labelRenderer:i.default,value:null};getLabel=()=>{let e=this.props.labelRenderer??i.default;return(0,s.jsx)(e,{checkmark:this.props.checkmark,data:this.props.data,icon:this.getIcon(`left`),index:this.props.index,inverted:this.props.inverted,isSelected:this.props.isSelected,label:this.props.label,value:this.props.value})};getIcon=e=>{let t=[`slds-icon-text-default`],n=e===`left`?this.props.leftIcon:this.props.rightIcon;if(e===`left`?(this.props.isCheckmarkVariant&&(t.push(`slds-icon_selected`),n={category:`utility`,name:`check`}),t.push(`slds-m-right_x-small`)):t.push(`slds-m-left_small`),n){let i={className:(0,o.default)(t),position:e,size:`x-small`,...n};return(0,s.jsx)(r.default,{...i})}return null};handleClick=e=>{(this.props.type!==`link`||this.props.href===`javascript:void(0);`||this.props.href===`#`)&&n.default.trapImmediate(e),this.props.onSelect&&!this.props.disabled&&this.props.onSelect(this.props.index)};handleMouseDown=e=>{n.default.trapImmediate(e)};render(){switch(this.props.type){case`header`:return(0,s.jsx)(`li`,{ref:this.props.nodeRef,className:(0,o.default)(`slds-dropdown__header`,{"slds-has-divider_top-space":this.props.divider===`top`,"slds-has-divider_bottom-space":this.props.divider===`bottom`},this.props.className),onMouseDown:this.handleMouseDown,role:`separator`,children:(0,s.jsx)(`span`,{children:this.props.label})});case`divider`:return(0,s.jsx)(`li`,{ref:this.props.nodeRef,className:(0,o.default)(`slds-has-divider`,this.props.className),onMouseDown:this.handleMouseDown,role:`separator`});default:{let e=(0,s.jsxs)(`a`,{"aria-checked":this.props.checkmark&&this.props.isSelected?!0:void 0,"aria-disabled":this.props[`aria-disabled`],href:this.props.href,"data-index":this.props.index,onClick:this.handleClick,role:this.props.checkmark?`menuitemcheckbox`:`menuitem`,tabIndex:-1,children:[this.props.groupedBy&&(0,s.jsx)(`span`,{className:`slds-assistive-text`,children:`-${this.props.groupedBy}`}),this.getLabel(),this.getIcon(`right`)]});if(this.props.tooltipContent&&this.props.tooltipTemplate){let{...t}=this.props.tooltipTemplate.props,n={...t,content:this.props.tooltipContent,id:`${this.props.id}-tooltip`,triggerStyle:{width:`100%`,...t.triggerStyle||{}}};e=a.default.cloneElement(this.props.tooltipTemplate,n,e)}return(0,s.jsx)(`li`,{ref:this.props.nodeRef,"aria-selected":this.props.checkmark===null?this.props.isSelected:void 0,className:(0,o.default)(`slds-dropdown__item`,{"slds-is-selected":this.props.isSelected},this.props.className),id:this.props.id,onMouseDown:this.handleMouseDown,role:`presentation`,children:e})}}}};exports.default=c;
1
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../../utilities/event.cjs"),r=require("../../icon/index.cjs"),i=require("./item-label.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=class extends a.default.Component{static displayName=t.LIST_ITEM;static defaultProps={data:{},href:`#`,inverted:!1,isSelected:!1,label:``,labelRenderer:i.default,value:null};getLabel=()=>{let e=this.props.labelRenderer??i.default;return(0,s.jsx)(e,{checkmark:this.props.checkmark,data:this.props.data,icon:this.getIcon(`left`),index:this.props.index,inverted:this.props.inverted,isSelected:this.props.isSelected,label:this.props.label,value:this.props.value})};getIcon=e=>{let t=[`slds-icon-text-default`],n=e===`left`?this.props.leftIcon:this.props.rightIcon;if(e===`left`?(this.props.isCheckmarkVariant&&(t.push(`slds-icon_selected`),n={category:`utility`,name:`check`}),t.push(`slds-m-right_x-small`)):t.push(`slds-m-left_small`),n){let i={className:(0,o.default)(t),position:e,size:`x-small`,...n};return(0,s.jsx)(r.default,{...i})}return null};handleClick=e=>{(this.props.type!==`link`||this.props.href===`javascript:void(0);`||this.props.href===`#`)&&n.default.trapImmediate(e),this.props.onSelect&&!this.props.disabled&&this.props.onSelect(this.props.index,e)};handleMouseDown=e=>{n.default.trapImmediate(e)};render(){switch(this.props.type){case`header`:return(0,s.jsx)(`li`,{ref:this.props.nodeRef,className:(0,o.default)(`slds-dropdown__header`,{"slds-has-divider_top-space":this.props.divider===`top`,"slds-has-divider_bottom-space":this.props.divider===`bottom`},this.props.className),onMouseDown:this.handleMouseDown,role:`separator`,children:(0,s.jsx)(`span`,{children:this.props.label})});case`divider`:return(0,s.jsx)(`li`,{ref:this.props.nodeRef,className:(0,o.default)(`slds-has-divider`,this.props.className),onMouseDown:this.handleMouseDown,role:`separator`});default:{let e=(0,s.jsxs)(`a`,{"aria-checked":this.props.checkmark&&this.props.isSelected?!0:void 0,"aria-disabled":this.props[`aria-disabled`],href:this.props.href,"data-index":this.props.index,onClick:this.handleClick,role:this.props.checkmark?`menuitemcheckbox`:`menuitem`,tabIndex:-1,children:[this.props.groupedBy&&(0,s.jsx)(`span`,{className:`slds-assistive-text`,children:`-${this.props.groupedBy}`}),this.getLabel(),this.getIcon(`right`)]});if(this.props.tooltipContent&&this.props.tooltipTemplate){let{...t}=this.props.tooltipTemplate.props,n={...t,content:this.props.tooltipContent,id:`${this.props.id}-tooltip`,triggerStyle:{width:`100%`,...t.triggerStyle||{}}};e=a.default.cloneElement(this.props.tooltipTemplate,n,e)}return(0,s.jsx)(`li`,{ref:this.props.nodeRef,"aria-selected":this.props.checkmark===null?this.props.isSelected:void 0,className:(0,o.default)(`slds-dropdown__item`,{"slds-is-selected":this.props.isSelected},this.props.className),id:this.props.id,onMouseDown:this.handleMouseDown,role:`presentation`,children:e})}}}};exports.default=c;
2
2
  //# sourceMappingURL=item.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.cjs","names":[],"sources":["../../../../../components/utilities/menu-list/item.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\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\n// # List Item Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ComponentType, type ReactNode } from 'react';\n\n// ### classNames\nimport classNames from 'classnames';\n\n// ### Icon\nimport Icon from '../../icon';\n\n// ## Children\nimport ListItemLabelRenderer, { type ListItemLabelProps } from './item-label';\n\n// ### Event Helpers\nimport EventUtil from '../../../utilities/event';\n\n// ## Constants\nimport { LIST_ITEM } from '../../../utilities/constants';\n\ninterface MenuListIconConfig {\n\tcategory?: string;\n\tname?: string;\n}\n\nexport interface ListItemProps {\n\t'aria-disabled'?: boolean;\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\tcheckmark?: boolean;\n\tdata?: Record<string, unknown>;\n\tdisabled?: boolean;\n\tdivider?: 'top' | 'bottom';\n\tgroupedBy?: string;\n\thref?: string;\n\tid: string;\n\tindex: number;\n\tinverted?: boolean;\n\tisSelected?: boolean;\n\tisCheckmarkVariant?: boolean;\n\tlabel?: string;\n\tlabelRenderer?: ComponentType<ListItemLabelProps>;\n\tleftIcon?: MenuListIconConfig;\n\t/**\n\t * Callback ref that receives the root `<li>` DOM node (or `null` on\n\t * unmount). Used by parents that need the list item's DOM element for\n\t * keyboard focus/scroll management. A DOM node is forwarded here rather\n\t * than attaching a `ref` to this class component, which would yield the\n\t * component instance instead of an element.\n\t */\n\tnodeRef?: (node: HTMLLIElement | null) => void;\n\tonSelect: (index: number) => void;\n\trightIcon?: MenuListIconConfig;\n\ttooltipContent?: ReactNode | string;\n\ttooltipTemplate?: React.ReactElement;\n\ttype?: string;\n\tvalue?: unknown;\n}\n\n/**\n * Component description.\n */\nclass ListItem extends React.Component<ListItemProps> {\n\tstatic displayName = LIST_ITEM;\n\n\tstatic defaultProps: Partial<ListItemProps> = {\n\t\tdata: {},\n\t\thref: '#',\n\t\tinverted: false,\n\t\tisSelected: false,\n\t\tlabel: '',\n\t\tlabelRenderer: ListItemLabelRenderer,\n\t\tvalue: null,\n\t};\n\n\tgetLabel = () => {\n\t\tconst Label = this.props.labelRenderer ?? ListItemLabelRenderer;\n\t\treturn (\n\t\t\t<Label\n\t\t\t\tcheckmark={this.props.checkmark}\n\t\t\t\tdata={this.props.data}\n\t\t\t\ticon={this.getIcon('left')}\n\t\t\t\tindex={this.props.index}\n\t\t\t\tinverted={this.props.inverted}\n\t\t\t\tisSelected={this.props.isSelected}\n\t\t\t\tlabel={this.props.label}\n\t\t\t\tvalue={this.props.value}\n\t\t\t/>\n\t\t);\n\t};\n\n\tgetIcon = (position: 'left' | 'right') => {\n\t\tconst classnames = ['slds-icon-text-default'];\n\t\tlet iconProps: MenuListIconConfig | undefined =\n\t\t\tposition === 'left' ? this.props.leftIcon : this.props.rightIcon;\n\n\t\tif (position === 'left') {\n\t\t\tif (this.props.isCheckmarkVariant) {\n\t\t\t\tclassnames.push('slds-icon_selected');\n\t\t\t\ticonProps = {\n\t\t\t\t\tcategory: 'utility',\n\t\t\t\t\tname: 'check',\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tclassnames.push('slds-m-right_x-small');\n\t\t} else {\n\t\t\tclassnames.push('slds-m-left_small');\n\t\t}\n\n\t\tif (iconProps) {\n\t\t\t// `position` is not part of Icon's public props but is preserved for\n\t\t\t// backwards-compatible runtime behavior; spread through a permissive cast.\n\t\t\tconst iconElementProps = {\n\t\t\t\tclassName: classNames(classnames),\n\t\t\t\tposition,\n\t\t\t\tsize: 'x-small',\n\t\t\t\t...iconProps,\n\t\t\t} as Record<string, unknown>;\n\t\t\treturn <Icon {...iconElementProps} />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\thandleClick = (event: React.MouseEvent) => {\n\t\tif (\n\t\t\tthis.props.type !== 'link' ||\n\t\t\tthis.props.href === 'javascript:void(0);' || // eslint-disable-line no-script-url\n\t\t\tthis.props.href === '#'\n\t\t) {\n\t\t\tEventUtil.trapImmediate(event);\n\t\t}\n\n\t\tif (this.props.onSelect && !this.props.disabled) {\n\t\t\tthis.props.onSelect(this.props.index);\n\t\t}\n\t};\n\n\thandleMouseDown = (event: React.MouseEvent) => {\n\t\tEventUtil.trapImmediate(event);\n\t};\n\n\trender() {\n\t\tswitch (this.props.type) {\n\t\t\tcase 'header': {\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tref={this.props.nodeRef}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-dropdown__header',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-has-divider_top-space': this.props.divider === 'top',\n\t\t\t\t\t\t\t\t'slds-has-divider_bottom-space':\n\t\t\t\t\t\t\t\t\tthis.props.divider === 'bottom',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonMouseDown={this.handleMouseDown}\n\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>{this.props.label}</span>\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'divider': {\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tref={this.props.nodeRef}\n\t\t\t\t\t\tclassName={classNames('slds-has-divider', this.props.className)}\n\t\t\t\t\t\tonMouseDown={this.handleMouseDown}\n\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'link':\n\t\t\tcase 'item':\n\t\t\tdefault: {\n\t\t\t\t/* eslint-disable jsx-a11y/role-supports-aria-props */\n\t\t\t\tlet itemContents = (\n\t\t\t\t\t<a\n\t\t\t\t\t\taria-checked={\n\t\t\t\t\t\t\tthis.props.checkmark && this.props.isSelected ? true : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-disabled={this.props['aria-disabled']}\n\t\t\t\t\t\thref={this.props.href}\n\t\t\t\t\t\tdata-index={this.props.index}\n\t\t\t\t\t\tonClick={this.handleClick}\n\t\t\t\t\t\trole={this.props.checkmark ? 'menuitemcheckbox' : 'menuitem'}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.props.groupedBy && (\n\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">{`-${this.props.groupedBy}`}</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this.getLabel()}\n\t\t\t\t\t\t{this.getIcon('right')}\n\t\t\t\t\t</a>\n\t\t\t\t);\n\n\t\t\t\tif (this.props.tooltipContent && this.props.tooltipTemplate) {\n\t\t\t\t\tconst { ...tooltipTemplateProps } = this.props.tooltipTemplate\n\t\t\t\t\t\t.props as Record<string, unknown>;\n\t\t\t\t\tconst tooltipProps = {\n\t\t\t\t\t\t...tooltipTemplateProps,\n\t\t\t\t\t\tcontent: this.props.tooltipContent,\n\t\t\t\t\t\tid: `${this.props.id}-tooltip`,\n\t\t\t\t\t\ttriggerStyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t...((tooltipTemplateProps.triggerStyle as Record<\n\t\t\t\t\t\t\t\tstring,\n\t\t\t\t\t\t\t\tunknown\n\t\t\t\t\t\t\t>) || {}),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\titemContents = React.cloneElement(\n\t\t\t\t\t\tthis.props.tooltipTemplate,\n\t\t\t\t\t\ttooltipProps,\n\t\t\t\t\t\titemContents\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t/* eslint-disable jsx-a11y/role-supports-aria-props */\n\t\t\t\t\t// disabled eslint, but using aria-selected on presentation role seems suspicious...\n\t\t\t\t\t<li\n\t\t\t\t\t\tref={this.props.nodeRef}\n\t\t\t\t\t\taria-selected={\n\t\t\t\t\t\t\tthis.props.checkmark === null\n\t\t\t\t\t\t\t\t? this.props.isSelected\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-dropdown__item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-selected': this.props.isSelected,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tid={this.props.id}\n\t\t\t\t\t\tonMouseDown={this.handleMouseDown}\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{itemContents}\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default ListItem;\n"],"mappings":"2UAoEA,IAAM,EAAN,cAAuB,EAAA,QAAM,SAAyB,CACrD,OAAO,YAAc,EAAA,UAErB,OAAO,aAAuC,CAC7C,KAAM,CAAC,EACP,KAAM,IACN,SAAU,GACV,WAAY,GACZ,MAAO,GACP,cAAe,EAAA,QACf,MAAO,IACR,EAEA,aAAiB,CAChB,IAAM,EAAQ,KAAK,MAAM,eAAiB,EAAA,QAC1C,OACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACC,UAAW,KAAK,MAAM,UACtB,KAAM,KAAK,MAAM,KACjB,KAAM,KAAK,QAAQ,MAAM,EACzB,MAAO,KAAK,MAAM,MAClB,SAAU,KAAK,MAAM,SACrB,WAAY,KAAK,MAAM,WACvB,MAAO,KAAK,MAAM,MAClB,MAAO,KAAK,MAAM,KAClB,CAAA,CAEH,EAEA,QAAW,GAA+B,CACzC,IAAM,EAAa,CAAC,wBAAwB,EACxC,EACH,IAAa,OAAS,KAAK,MAAM,SAAW,KAAK,MAAM,UAgBxD,GAdI,IAAa,QACZ,KAAK,MAAM,qBACd,EAAW,KAAK,oBAAoB,EACpC,EAAY,CACX,SAAU,UACV,KAAM,OACP,GAGD,EAAW,KAAK,sBAAsB,GAEtC,EAAW,KAAK,mBAAmB,EAGhC,EAAW,CAGd,IAAM,EAAmB,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,UAAY,mBAAqB,WAClD,SAAU,GATX,SAAA,CAWE,KAAK,MAAM,YACX,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,IAAI,KAAK,MAAM,WAAkB,CAAA,EAExE,KAAK,SAAS,EACd,KAAK,QAAQ,OAAO,CACnB,IAGJ,GAAI,KAAK,MAAM,gBAAkB,KAAK,MAAM,gBAAiB,CAC5D,GAAM,CAAE,GAAG,GAAyB,KAAK,MAAM,gBAC7C,MACI,EAAe,CACpB,GAAG,EACH,QAAS,KAAK,MAAM,eACpB,GAAI,GAAG,KAAK,MAAM,GAAG,UACrB,aAAc,CACb,MAAO,OACP,GAAK,EAAqB,cAGpB,CAAC,CACR,CACD,EACA,EAAe,EAAA,QAAM,aACpB,KAAK,MAAM,gBACX,EACA,CACD,CACD,CAEA,OAGC,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,IAAK,KAAK,MAAM,QAChB,gBACC,KAAK,MAAM,YAAc,KACtB,KAAK,MAAM,WACX,IAAA,GAEJ,WAAA,EAAW,EAAA,QAAA,CACV,sBACA,CACC,mBAAoB,KAAK,MAAM,UAChC,EACA,KAAK,MAAM,SACZ,EACA,GAAI,KAAK,MAAM,GACf,YAAa,KAAK,gBAClB,KAAK,eAEJ,SAAA,CACE,CAAA,CAEN,CACD,CACD,CACD"}
1
+ {"version":3,"file":"item.cjs","names":[],"sources":["../../../../../components/utilities/menu-list/item.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\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\n// # List Item Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ComponentType, type ReactNode } from 'react';\n\n// ### classNames\nimport classNames from 'classnames';\n\n// ### Icon\nimport Icon from '../../icon';\n\n// ## Children\nimport ListItemLabelRenderer, { type ListItemLabelProps } from './item-label';\n\n// ### Event Helpers\nimport EventUtil from '../../../utilities/event';\n\n// ## Constants\nimport { LIST_ITEM } from '../../../utilities/constants';\n\ninterface MenuListIconConfig {\n\tcategory?: string;\n\tname?: string;\n}\n\nexport interface ListItemProps {\n\t'aria-disabled'?: boolean;\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\tcheckmark?: boolean;\n\tdata?: Record<string, unknown>;\n\tdisabled?: boolean;\n\tdivider?: 'top' | 'bottom';\n\tgroupedBy?: string;\n\thref?: string;\n\tid: string;\n\tindex: number;\n\tinverted?: boolean;\n\tisSelected?: boolean;\n\tisCheckmarkVariant?: boolean;\n\tlabel?: string;\n\tlabelRenderer?: ComponentType<ListItemLabelProps>;\n\tleftIcon?: MenuListIconConfig;\n\t/**\n\t * Callback ref that receives the root `<li>` DOM node (or `null` on\n\t * unmount). Used by parents that need the list item's DOM element for\n\t * keyboard focus/scroll management. A DOM node is forwarded here rather\n\t * than attaching a `ref` to this class component, which would yield the\n\t * component instance instead of an element.\n\t */\n\tnodeRef?: (node: HTMLLIElement | null) => void;\n\tonSelect: (index: number, event: React.MouseEvent) => void;\n\trightIcon?: MenuListIconConfig;\n\ttooltipContent?: ReactNode | string;\n\ttooltipTemplate?: React.ReactElement;\n\ttype?: string;\n\tvalue?: unknown;\n}\n\n/**\n * Component description.\n */\nclass ListItem extends React.Component<ListItemProps> {\n\tstatic displayName = LIST_ITEM;\n\n\tstatic defaultProps: Partial<ListItemProps> = {\n\t\tdata: {},\n\t\thref: '#',\n\t\tinverted: false,\n\t\tisSelected: false,\n\t\tlabel: '',\n\t\tlabelRenderer: ListItemLabelRenderer,\n\t\tvalue: null,\n\t};\n\n\tgetLabel = () => {\n\t\tconst Label = this.props.labelRenderer ?? ListItemLabelRenderer;\n\t\treturn (\n\t\t\t<Label\n\t\t\t\tcheckmark={this.props.checkmark}\n\t\t\t\tdata={this.props.data}\n\t\t\t\ticon={this.getIcon('left')}\n\t\t\t\tindex={this.props.index}\n\t\t\t\tinverted={this.props.inverted}\n\t\t\t\tisSelected={this.props.isSelected}\n\t\t\t\tlabel={this.props.label}\n\t\t\t\tvalue={this.props.value}\n\t\t\t/>\n\t\t);\n\t};\n\n\tgetIcon = (position: 'left' | 'right') => {\n\t\tconst classnames = ['slds-icon-text-default'];\n\t\tlet iconProps: MenuListIconConfig | undefined =\n\t\t\tposition === 'left' ? this.props.leftIcon : this.props.rightIcon;\n\n\t\tif (position === 'left') {\n\t\t\tif (this.props.isCheckmarkVariant) {\n\t\t\t\tclassnames.push('slds-icon_selected');\n\t\t\t\ticonProps = {\n\t\t\t\t\tcategory: 'utility',\n\t\t\t\t\tname: 'check',\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tclassnames.push('slds-m-right_x-small');\n\t\t} else {\n\t\t\tclassnames.push('slds-m-left_small');\n\t\t}\n\n\t\tif (iconProps) {\n\t\t\t// `position` is not part of Icon's public props but is preserved for\n\t\t\t// backwards-compatible runtime behavior; spread through a permissive cast.\n\t\t\tconst iconElementProps = {\n\t\t\t\tclassName: classNames(classnames),\n\t\t\t\tposition,\n\t\t\t\tsize: 'x-small',\n\t\t\t\t...iconProps,\n\t\t\t} as Record<string, unknown>;\n\t\t\treturn <Icon {...iconElementProps} />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\thandleClick = (event: React.MouseEvent) => {\n\t\tif (\n\t\t\tthis.props.type !== 'link' ||\n\t\t\tthis.props.href === 'javascript:void(0);' || // eslint-disable-line no-script-url\n\t\t\tthis.props.href === '#'\n\t\t) {\n\t\t\tEventUtil.trapImmediate(event);\n\t\t}\n\n\t\tif (this.props.onSelect && !this.props.disabled) {\n\t\t\tthis.props.onSelect(this.props.index, event);\n\t\t}\n\t};\n\n\thandleMouseDown = (event: React.MouseEvent) => {\n\t\tEventUtil.trapImmediate(event);\n\t};\n\n\trender() {\n\t\tswitch (this.props.type) {\n\t\t\tcase 'header': {\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tref={this.props.nodeRef}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-dropdown__header',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-has-divider_top-space': this.props.divider === 'top',\n\t\t\t\t\t\t\t\t'slds-has-divider_bottom-space':\n\t\t\t\t\t\t\t\t\tthis.props.divider === 'bottom',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonMouseDown={this.handleMouseDown}\n\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>{this.props.label}</span>\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'divider': {\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tref={this.props.nodeRef}\n\t\t\t\t\t\tclassName={classNames('slds-has-divider', this.props.className)}\n\t\t\t\t\t\tonMouseDown={this.handleMouseDown}\n\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'link':\n\t\t\tcase 'item':\n\t\t\tdefault: {\n\t\t\t\t/* eslint-disable jsx-a11y/role-supports-aria-props */\n\t\t\t\tlet itemContents = (\n\t\t\t\t\t<a\n\t\t\t\t\t\taria-checked={\n\t\t\t\t\t\t\tthis.props.checkmark && this.props.isSelected ? true : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-disabled={this.props['aria-disabled']}\n\t\t\t\t\t\thref={this.props.href}\n\t\t\t\t\t\tdata-index={this.props.index}\n\t\t\t\t\t\tonClick={this.handleClick}\n\t\t\t\t\t\trole={this.props.checkmark ? 'menuitemcheckbox' : 'menuitem'}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.props.groupedBy && (\n\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">{`-${this.props.groupedBy}`}</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this.getLabel()}\n\t\t\t\t\t\t{this.getIcon('right')}\n\t\t\t\t\t</a>\n\t\t\t\t);\n\n\t\t\t\tif (this.props.tooltipContent && this.props.tooltipTemplate) {\n\t\t\t\t\tconst { ...tooltipTemplateProps } = this.props.tooltipTemplate\n\t\t\t\t\t\t.props as Record<string, unknown>;\n\t\t\t\t\tconst tooltipProps = {\n\t\t\t\t\t\t...tooltipTemplateProps,\n\t\t\t\t\t\tcontent: this.props.tooltipContent,\n\t\t\t\t\t\tid: `${this.props.id}-tooltip`,\n\t\t\t\t\t\ttriggerStyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t...((tooltipTemplateProps.triggerStyle as Record<\n\t\t\t\t\t\t\t\tstring,\n\t\t\t\t\t\t\t\tunknown\n\t\t\t\t\t\t\t>) || {}),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\titemContents = React.cloneElement(\n\t\t\t\t\t\tthis.props.tooltipTemplate,\n\t\t\t\t\t\ttooltipProps,\n\t\t\t\t\t\titemContents\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t/* eslint-disable jsx-a11y/role-supports-aria-props */\n\t\t\t\t\t// disabled eslint, but using aria-selected on presentation role seems suspicious...\n\t\t\t\t\t<li\n\t\t\t\t\t\tref={this.props.nodeRef}\n\t\t\t\t\t\taria-selected={\n\t\t\t\t\t\t\tthis.props.checkmark === null ? this.props.isSelected : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-dropdown__item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-selected': this.props.isSelected,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tid={this.props.id}\n\t\t\t\t\t\tonMouseDown={this.handleMouseDown}\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{itemContents}\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,MAAM,eACpB,GAAI,GAAG,KAAK,MAAM,GAAG,UACrB,aAAc,CACb,MAAO,OACP,GAAK,EAAqB,cAGpB,CAAC,CACR,CACD,EACA,EAAe,EAAA,QAAM,aACpB,KAAK,MAAM,gBACX,EACA,CACD,CACD,CAEA,OAGC,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,IAAK,KAAK,MAAM,QAChB,gBACC,KAAK,MAAM,YAAc,KAAO,KAAK,MAAM,WAAa,IAAA,GAEzD,WAAA,EAAW,EAAA,QAAA,CACV,sBACA,CACC,mBAAoB,KAAK,MAAM,UAChC,EACA,KAAK,MAAM,SACZ,EACA,GAAI,KAAK,MAAM,GACf,YAAa,KAAK,gBAClB,KAAK,eAEJ,SAAA,CACE,CAAA,CAEN,CACD,CACD,CACD"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/item.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=({categories:e,className:t,id:o,onSelect:s,selectedId:c})=>{let l=(0,r.useId)(),u=o||l,d=(0,r.useMemo)(()=>{if(c)return c;if(e.length>0&&e[0].items?.length>0)return e[0].items[0].id},[c,e]);return(0,a.jsx)(`nav`,{id:u,className:(0,i.default)(`slds-nav-vertical`,t),children:e.map(e=>{let t=`${u}-${e.id}`;return(0,a.jsxs)(`div`,{className:`slds-nav-vertical__section`,children:[(0,a.jsx)(`h2`,{id:t,className:`slds-nav-vertical__title`,children:e.label}),(0,a.jsx)(`ul`,{children:e.items.map(e=>(0,a.jsx)(n.default,{item:e,isSelected:e.id===d,categoryId:t,onSelect:s},e.id))},t)]},`${t}-header`)})})};o.displayName=t.VERTICAL_NAVIGATION,exports.default=o;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/item.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=({categories:e,className:t,id:o,onSelect:s,selectedId:c})=>{let l=(0,r.useId)(),u=o||l,d=(0,r.useMemo)(()=>{if(c)return c;if(e.length>0&&e[0].items?.length>0)return e[0].items[0].id},[c,e]);return(0,a.jsx)(`nav`,{id:u,className:(0,i.default)(`slds-nav-vertical`,t),children:e.map(e=>{let t=`${u}-${e.id}`;return(0,a.jsxs)(`div`,{className:`slds-nav-vertical__section`,children:[(0,a.jsx)(`h2`,{id:t,className:`slds-nav-vertical__title`,children:e.label}),(0,a.jsx)(`ul`,{children:e.items.map(e=>(0,a.jsx)(n.default,{item:e,isSelected:e.id===d,categoryId:t,onSelect:s},e.id))},t)]},`${t}-header`)})})};o.displayName=t.VERTICAL_NAVIGATION,exports.default=o;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/vertical-navigation/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, useMemo, type MouseEvent } from 'react';\nimport classNames from 'classnames';\nimport { VERTICAL_NAVIGATION } from '../../utilities/constants';\nimport Item from './private/item';\n\n/**\n * Navigation item structure\n */\nexport interface NavigationItem {\n\t/** Unique identifier */\n\tid: string;\n\t/** Display label */\n\tlabel: string;\n\t/** URL for the link */\n\turl: string;\n\t/** Additional custom properties */\n\t[key: string]: unknown;\n}\n\n/**\n * Navigation category structure\n */\nexport interface NavigationCategory {\n\t/** Unique identifier */\n\tid: string;\n\t/** Category label */\n\tlabel: string;\n\t/** Items in this category */\n\titems: NavigationItem[];\n}\n\n/**\n * Selection event data\n */\nexport interface NavigationSelectData {\n\titem: NavigationItem;\n}\n\n/**\n * Props for the VerticalNavigation component\n */\nexport interface VerticalNavigationProps {\n\t/** Array of navigation categories */\n\tcategories: NavigationCategory[];\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Selection callback */\n\tonSelect?: (event: MouseEvent<HTMLAnchorElement>, data: NavigationSelectData) => void;\n\t/** Currently selected item ID */\n\tselectedId?: string;\n}\n\n/**\n * Vertical Navigation represents a list of links that either take the user\n * to another page or parts of the page the user is in.\n */\nconst VerticalNavigation = ({\n\tcategories,\n\tclassName,\n\tid: propId,\n\tonSelect,\n\tselectedId: propSelectedId,\n}: VerticalNavigationProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst rootId = propId || generatedId;\n\n\t// Determine selected ID (default to first item if not specified)\n\tconst selectedId = useMemo(() => {\n\t\tif (propSelectedId) {\n\t\t\treturn propSelectedId;\n\t\t}\n\t\tif (categories.length > 0 && categories[0].items?.length > 0) {\n\t\t\treturn categories[0].items[0].id;\n\t\t}\n\t\treturn undefined;\n\t}, [propSelectedId, categories]);\n\n\treturn (\n\t\t<nav\n\t\t\tid={rootId}\n\t\t\tclassName={classNames('slds-nav-vertical', className as string)}\n\t\t>\n\t\t\t{categories.map((category) => {\n\t\t\t\tconst categoryId = `${rootId}-${category.id}`;\n\t\t\t\treturn (\n\t\t\t\t\t<div key={`${categoryId}-header`} className=\"slds-nav-vertical__section\">\n\t\t\t\t\t\t<h2 id={categoryId} className=\"slds-nav-vertical__title\">\n\t\t\t\t\t\t\t{category.label}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<ul key={categoryId}>\n\t\t\t\t\t\t\t{category.items.map((item) => (\n\t\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tisSelected={item.id === selectedId}\n\t\t\t\t\t\t\t\t\tcategoryId={categoryId}\n\t\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t})}\n\t\t</nav>\n\t);\n};\n\nVerticalNavigation.displayName = VERTICAL_NAVIGATION;\n\nexport default VerticalNavigation;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"2PA6DA,IAAM,GAAsB,CAC3B,aACA,YACA,GAAI,EACJ,WACA,WAAY,KACsC,CAClD,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAS,GAAU,EAGnB,GAAA,EAAa,EAAA,QAAA,KAAc,CAChC,GAAI,EACH,OAAO,EAER,GAAI,EAAW,OAAS,GAAK,EAAW,EAAE,CAAC,OAAO,OAAS,EAC1D,OAAO,EAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAGhC,EAAG,CAAC,EAAgB,CAAU,CAAC,EAE/B,OACC,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,GAAI,EACJ,WAAA,EAAW,EAAA,QAAA,CAAW,oBAAqB,CAAmB,EAE7D,SAAA,EAAW,IAAK,GAAa,CAC7B,IAAM,EAAa,GAAG,EAAO,GAAG,EAAS,KACzC,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CAAkC,UAAU,6BAA5C,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,GAAI,EAAY,UAAU,2BAC5B,SAAA,EAAS,KACP,CAAA,GACJ,EAAA,EAAA,IAAA,CAAC,KAAD,CAAA,SACE,EAAS,MAAM,IAAK,IACpB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAEO,OACN,WAAY,EAAK,KAAO,EACZ,aACF,UACV,EALK,EAAK,EAKV,CACD,CACE,EAVK,CAUL,CACA,CAfK,EAAA,GAAG,EAAW,QAenB,CAEP,CAAC,CACG,CAAA,CAEP,EAEA,EAAmB,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/vertical-navigation/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\tuseMemo,\n\ttype MouseEvent,\n\ttype ReactElement,\n} from 'react';\nimport classNames from 'classnames';\nimport { VERTICAL_NAVIGATION } from '../../utilities/constants';\nimport type { BadgeProps } from '../badge';\nimport type { IconProps } from '../icon';\nimport Item from './private/item';\n\n/**\n * Navigation item structure\n */\nexport interface NavigationItem {\n\t/** Unique identifier */\n\tid: string;\n\t/** Display label */\n\tlabel: string;\n\t/** URL for the link */\n\turl: string;\n\t/** `Icon` rendered before the label. Its `size` sets the right margin. */\n\ticon?: ReactElement<IconProps>;\n\t/** `Badge` rendered after the label, aligned right */\n\tnotificationBadge?: ReactElement<BadgeProps>;\n}\n\n/**\n * Navigation category structure\n */\nexport interface NavigationCategory {\n\t/** Unique identifier */\n\tid: string;\n\t/** Category label */\n\tlabel: string;\n\t/** Items in this category */\n\titems: NavigationItem[];\n}\n\n/**\n * Selection event data\n */\nexport interface NavigationSelectData {\n\titem: NavigationItem;\n}\n\n/**\n * Props for the VerticalNavigation component\n */\nexport interface VerticalNavigationProps {\n\t/** Array of navigation categories */\n\tcategories: NavigationCategory[];\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Selection callback */\n\tonSelect?: (\n\t\tevent: MouseEvent<HTMLAnchorElement>,\n\t\tdata: NavigationSelectData\n\t) => void;\n\t/** Currently selected item ID */\n\tselectedId?: string;\n}\n\n/**\n * Vertical Navigation represents a list of links that either take the user\n * to another page or parts of the page the user is in.\n */\nconst VerticalNavigation = ({\n\tcategories,\n\tclassName,\n\tid: propId,\n\tonSelect,\n\tselectedId: propSelectedId,\n}: VerticalNavigationProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst rootId = propId || generatedId;\n\n\t// Determine selected ID (default to first item if not specified)\n\tconst selectedId = useMemo(() => {\n\t\tif (propSelectedId) {\n\t\t\treturn propSelectedId;\n\t\t}\n\t\tif (categories.length > 0 && categories[0].items?.length > 0) {\n\t\t\treturn categories[0].items[0].id;\n\t\t}\n\t\treturn undefined;\n\t}, [propSelectedId, categories]);\n\n\treturn (\n\t\t<nav\n\t\t\tid={rootId}\n\t\t\tclassName={classNames('slds-nav-vertical', className as string)}\n\t\t>\n\t\t\t{categories.map((category) => {\n\t\t\t\tconst categoryId = `${rootId}-${category.id}`;\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={`${categoryId}-header`}\n\t\t\t\t\t\tclassName=\"slds-nav-vertical__section\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<h2 id={categoryId} className=\"slds-nav-vertical__title\">\n\t\t\t\t\t\t\t{category.label}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<ul key={categoryId}>\n\t\t\t\t\t\t\t{category.items.map((item) => (\n\t\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tisSelected={item.id === selectedId}\n\t\t\t\t\t\t\t\t\tcategoryId={categoryId}\n\t\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t})}\n\t\t</nav>\n\t);\n};\n\nVerticalNavigation.displayName = VERTICAL_NAVIGATION;\n\nexport default VerticalNavigation;\n"],"mappings":"0VAyEA,IAAM,GAAsB,CAC3B,aACA,YACA,GAAI,EACJ,WACA,WAAY,KACsC,CAClD,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAS,GAAU,EAGnB,GAAA,EAAa,EAAA,QAAA,KAAc,CAChC,GAAI,EACH,OAAO,EAER,GAAI,EAAW,OAAS,GAAK,EAAW,EAAE,CAAC,OAAO,OAAS,EAC1D,OAAO,EAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAGhC,EAAG,CAAC,EAAgB,CAAU,CAAC,EAE/B,OACC,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,GAAI,EACJ,WAAA,EAAW,EAAA,QAAA,CAAW,oBAAqB,CAAmB,EAE7D,SAAA,EAAW,IAAK,GAAa,CAC7B,IAAM,EAAa,GAAG,EAAO,GAAG,EAAS,KACzC,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CAEC,UAAU,6BAFX,SAAA,EAIC,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,GAAI,EAAY,UAAU,2BAC5B,SAAA,EAAS,KACP,CAAA,GACJ,EAAA,EAAA,IAAA,CAAC,KAAD,CAAA,SACE,EAAS,MAAM,IAAK,IACpB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAEO,OACN,WAAY,EAAK,KAAO,EACZ,aACF,UACV,EALK,EAAK,EAKV,CACD,CACE,EAVK,CAUL,CACA,CAjBC,EAAA,GAAG,EAAW,QAiBf,CAEP,CAAC,CACG,CAAA,CAEP,EAEA,EAAmB,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"item.cjs","names":[],"sources":["../../../../../components/vertical-navigation/private/item.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 ReactElement } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\nimport { VERTICAL_NAVIGATION_ITEM } from '../../../utilities/constants';\nimport { type NavigationItem, type NavigationSelectData } from '../index';\n\nexport interface ItemProps {\n\t/**\n\t * Item to be rendered.\n\t */\n\titem: NavigationItem;\n\t/**\n\t * Whether item is selected or not.\n\t */\n\tisSelected?: boolean;\n\t/**\n\t * ID of the category this item belongs to.\n\t */\n\tcategoryId: string;\n\t/**\n\t * Function that will run whenever an item is selected.\n\t */\n\tonSelect?: (\n\t\tevent: React.MouseEvent<HTMLAnchorElement>,\n\t\tdata: NavigationSelectData\n\t) => void;\n}\n\nconst handleClick = (\n\tevent: React.MouseEvent<HTMLAnchorElement>,\n\t{ item, onSelect }: Pick<ItemProps, 'item' | 'onSelect'>\n) => {\n\tif (!item.url) {\n\t\tevent.preventDefault();\n\t}\n\n\tif (isFunction(onSelect)) {\n\t\tonSelect(event, {\n\t\t\titem,\n\t\t});\n\t}\n};\n\nconst Item = ({ isSelected = false, item, categoryId, onSelect }: ItemProps) => (\n\t<li\n\t\tclassName={classNames('slds-nav-vertical__item', {\n\t\t\t'slds-is-active': isSelected,\n\t\t})}\n\t>\n\t\t<a\n\t\t\tdata-id={item.id}\n\t\t\thref={item.url || '#'}\n\t\t\tclassName=\"slds-nav-vertical__action\"\n\t\t\taria-describedby={categoryId}\n\t\t\taria-current={isSelected ? true : undefined}\n\t\t\tonClick={(event) => {\n\t\t\t\thandleClick(event, { item, onSelect });\n\t\t\t}}\n\t\t>\n\t\t\t{item.icon ? (\n\t\t\t\t<React.Fragment>\n\t\t\t\t\t{React.cloneElement(\n\t\t\t\t\t\titem.icon as ReactElement<{ className?: string; size?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t\t(item.icon as ReactElement<{ className?: string }>).props\n\t\t\t\t\t\t\t\t\t.className,\n\t\t\t\t\t\t\t\t`slds-m-right_${\n\t\t\t\t\t\t\t\t\t(item.icon as ReactElement<{ size?: string }>).props.size ||\n\t\t\t\t\t\t\t\t\t'medium'\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)}\n\t\t\t\t\t{item.label}\n\t\t\t\t</React.Fragment>\n\t\t\t) : (\n\t\t\t\titem.label\n\t\t\t)}\n\t\t\t{item.notificationBadge ? (\n\t\t\t\tReact.cloneElement(\n\t\t\t\t\titem.notificationBadge as ReactElement<{ className?: string }>,\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t(item.notificationBadge as ReactElement<{ className?: string }>)\n\t\t\t\t\t\t\t\t.props.className,\n\t\t\t\t\t\t\t'slds-col_bump-left'\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t) : (\n\t\t\t\t<React.Fragment />\n\t\t\t)}\n\t\t</a>\n\t</li>\n);\n\n// ### Display Name\n// Always use the canonical component name as the React display name.\nItem.displayName = VERTICAL_NAVIGATION_ITEM;\n\nexport default Item;\n"],"mappings":"iRAuCA,IAAM,GACL,EACA,CAAE,OAAM,cACJ,CACC,EAAK,KACT,EAAM,eAAe,GAGtB,EAAI,EAAA,QAAA,CAAW,CAAQ,GACtB,EAAS,EAAO,CACf,MACD,CAAC,CAEH,EAEM,GAAQ,CAAE,aAAa,GAAO,OAAM,aAAY,eACrD,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,0BAA2B,CAChD,iBAAkB,CACnB,CAAC,EAED,UAAA,EAAA,EAAA,KAAA,CAAC,IAAD,CACC,UAAS,EAAK,GACd,KAAM,EAAK,KAAO,IAClB,UAAU,4BACV,mBAAkB,EAClB,eAAc,EAAa,GAAO,IAAA,GAClC,QAAU,GAAU,CACnB,EAAY,EAAO,CAAE,OAAM,UAAS,CAAC,CACtC,EARD,SAAA,CAUE,EAAK,MACL,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,CACE,EAAA,QAAM,aACN,EAAK,KACL,CACC,WAAA,EAAW,EAAA,QAAA,CACT,EAAK,KAA8C,MAClD,UACF,gBACE,EAAK,KAAyC,MAAM,MACrD,UAEF,CACD,CACD,EACC,EAAK,KACS,CAAA,CAAA,EAEhB,EAAK,MAEL,EAAK,kBACL,EAAA,QAAM,aACL,EAAK,kBACL,CACC,WAAA,EAAW,EAAA,QAAA,CACT,EAAK,kBACJ,MAAM,UACR,oBACD,CACD,CACD,GAEA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAM,SAAP,CAAiB,CAAA,CAEhB,GACA,CAAA,EAKL,EAAK,YAAc,EAAA"}
1
+ {"version":3,"file":"item.cjs","names":[],"sources":["../../../../../components/vertical-navigation/private/item.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';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\nimport { VERTICAL_NAVIGATION_ITEM } from '../../../utilities/constants';\nimport { type NavigationItem, type NavigationSelectData } from '../index';\n\nexport interface ItemProps {\n\t/**\n\t * Item to be rendered.\n\t */\n\titem: NavigationItem;\n\t/**\n\t * Whether item is selected or not.\n\t */\n\tisSelected?: boolean;\n\t/**\n\t * ID of the category this item belongs to.\n\t */\n\tcategoryId: string;\n\t/**\n\t * Function that will run whenever an item is selected.\n\t */\n\tonSelect?: (\n\t\tevent: React.MouseEvent<HTMLAnchorElement>,\n\t\tdata: NavigationSelectData\n\t) => void;\n}\n\nconst handleClick = (\n\tevent: React.MouseEvent<HTMLAnchorElement>,\n\t{ item, onSelect }: Pick<ItemProps, 'item' | 'onSelect'>\n) => {\n\tif (!item.url) {\n\t\tevent.preventDefault();\n\t}\n\n\tif (isFunction(onSelect)) {\n\t\tonSelect(event, {\n\t\t\titem,\n\t\t});\n\t}\n};\n\nconst Item = ({\n\tisSelected = false,\n\titem,\n\tcategoryId,\n\tonSelect,\n}: ItemProps) => (\n\t<li\n\t\tclassName={classNames('slds-nav-vertical__item', {\n\t\t\t'slds-is-active': isSelected,\n\t\t})}\n\t>\n\t\t<a\n\t\t\tdata-id={item.id}\n\t\t\thref={item.url || '#'}\n\t\t\tclassName=\"slds-nav-vertical__action\"\n\t\t\taria-describedby={categoryId}\n\t\t\taria-current={isSelected ? true : undefined}\n\t\t\tonClick={(event) => {\n\t\t\t\thandleClick(event, { item, onSelect });\n\t\t\t}}\n\t\t>\n\t\t\t{item.icon ? (\n\t\t\t\t<React.Fragment>\n\t\t\t\t\t{React.cloneElement(item.icon, {\n\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\titem.icon.props.className,\n\t\t\t\t\t\t\t`slds-m-right_${item.icon.props.size || 'medium'}`\n\t\t\t\t\t\t),\n\t\t\t\t\t})}\n\t\t\t\t\t{item.label}\n\t\t\t\t</React.Fragment>\n\t\t\t) : (\n\t\t\t\titem.label\n\t\t\t)}\n\t\t\t{item.notificationBadge ? (\n\t\t\t\tReact.cloneElement(item.notificationBadge, {\n\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\titem.notificationBadge.props.className,\n\t\t\t\t\t\t'slds-col_bump-left'\n\t\t\t\t\t),\n\t\t\t\t})\n\t\t\t) : (\n\t\t\t\t<React.Fragment />\n\t\t\t)}\n\t\t</a>\n\t</li>\n);\n\n// ### Display Name\n// Always use the canonical component name as the React display name.\nItem.displayName = VERTICAL_NAVIGATION_ITEM;\n\nexport default Item;\n"],"mappings":"iRAuCA,IAAM,GACL,EACA,CAAE,OAAM,cACJ,CACC,EAAK,KACT,EAAM,eAAe,GAGtB,EAAI,EAAA,QAAA,CAAW,CAAQ,GACtB,EAAS,EAAO,CACf,MACD,CAAC,CAEH,EAEM,GAAQ,CACb,aAAa,GACb,OACA,aACA,eAEA,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,0BAA2B,CAChD,iBAAkB,CACnB,CAAC,EAED,UAAA,EAAA,EAAA,KAAA,CAAC,IAAD,CACC,UAAS,EAAK,GACd,KAAM,EAAK,KAAO,IAClB,UAAU,4BACV,mBAAkB,EAClB,eAAc,EAAa,GAAO,IAAA,GAClC,QAAU,GAAU,CACnB,EAAY,EAAO,CAAE,OAAM,UAAS,CAAC,CACtC,EARD,SAAA,CAUE,EAAK,MACL,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,CACE,EAAA,QAAM,aAAa,EAAK,KAAM,CAC9B,WAAA,EAAW,EAAA,QAAA,CACV,EAAK,KAAK,MAAM,UAChB,gBAAgB,EAAK,KAAK,MAAM,MAAQ,UACzC,CACD,CAAC,EACA,EAAK,KACS,CAAA,CAAA,EAEhB,EAAK,MAEL,EAAK,kBACL,EAAA,QAAM,aAAa,EAAK,kBAAmB,CAC1C,WAAA,EAAW,EAAA,QAAA,CACV,EAAK,kBAAkB,MAAM,UAC7B,oBACD,CACD,CAAC,GAED,EAAA,EAAA,IAAA,CAAC,EAAA,QAAM,SAAP,CAAiB,CAAA,CAEhB,GACA,CAAA,EAKL,EAAK,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({children:e,className:t,coverable:a,id:o,label:s,links:c=!1,size:l=`medium`,vertical:u=!1})=>{let d=(0,n.useId)(),f=o||d;if(c)return(0,i.jsx)(`div`,{className:`slds-form-element__control`,children:e});let p=(e,t)=>{if(!n.default.isValidElement(e))return e;if(e.type===n.default.Fragment){let r=e.props;return n.default.cloneElement(e,void 0,n.default.Children.map(r.children,(e,n)=>p(e,`${t}-${n}`)))}return n.default.cloneElement(e,{index:`${f}-${t}`,coverable:a,variant:`visual-picker`,name:`${f}_options`,size:l,vertical:!!u})},m=n.default.Children.map(e,(e,t)=>p(e,t));return(0,i.jsxs)(`fieldset`,{id:f,className:(0,r.default)(`slds-form-element`,t),children:[(0,i.jsx)(`legend`,{className:`slds-form-element__legend slds-form-element__label`,children:s}),(0,i.jsx)(`div`,{className:`slds-form-element__control`,children:m})]})};a.displayName=t.VISUAL_PICKER,exports.default=a;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({children:e,className:t,coverable:a,id:o,label:s,links:c=!1,size:l=`medium`,vertical:u=!1})=>{let d=(0,n.useId)(),f=o||d;if(c)return(0,i.jsx)(`div`,{className:`slds-form-element__control`,children:e});let p=(e,t)=>{if(!n.default.isValidElement(e))return e;if(e.type===n.default.Fragment){let r=e.props;return n.default.cloneElement(e,void 0,n.default.Children.map(r.children,(e,n)=>p(e,`${t}-${n}`)))}return n.default.cloneElement(e,{index:`${f}-${t}`,coverable:a,variant:`visual-picker`,name:`${f}_options`,size:l,vertical:!!u})},m=n.default.Children.map(e,(e,t)=>p(e,t));return(0,i.jsxs)(`fieldset`,{id:f,className:(0,r.default)(`slds-form-element`,t),children:[(0,i.jsx)(`legend`,{className:`slds-form-element__legend slds-form-element__label`,children:s}),(0,i.jsx)(`div`,{className:`slds-form-element__control`,children:m})]})};a.displayName=t.VISUAL_PICKER,exports.default=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/visual-picker/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 } from 'react';\nimport classNames from 'classnames';\nimport { VISUAL_PICKER } from '../../utilities/constants';\n\n/**\n * Visual picker size options\n */\nexport type VisualPickerSize = 'medium' | 'large';\n\n/**\n * Props for child elements that can be cloned\n */\nexport interface VisualPickerChildProps {\n\tindex?: string;\n\tcoverable?: boolean;\n\tvariant?: string;\n\tname?: string;\n\tsize?: VisualPickerSize;\n\tvertical?: boolean;\n}\n\n/**\n * Props for the VisualPicker component\n */\nexport interface VisualPickerProps {\n\t/** Visual Picker children (Checkbox, Radio, VisualPickerLink) */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Whether items are coverable on selection */\n\tcoverable?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Label for the visual picker */\n\tlabel?: string;\n\t/** Whether the picker has links as children */\n\tlinks?: boolean;\n\t/** Size of the picker */\n\tsize?: VisualPickerSize;\n\t/** Whether layout is vertical */\n\tvertical?: boolean;\n}\n\n/**\n * Visual Picker allows users to select an option from a set of visual choices.\n */\nconst VisualPicker = ({\n\tchildren,\n\tclassName,\n\tcoverable,\n\tid: propId,\n\tlabel,\n\tlinks = false,\n\tsize = 'medium',\n\tvertical = false,\n}: VisualPickerProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tif (links) {\n\t\treturn <div className=\"slds-form-element__control\">{children}</div>;\n\t}\n\n\t// Clone the picker props onto each real option element. When an option is a\n\t// `React.Fragment` (e.g. children grouped with `<>...</>`), the injected props\n\t// must NOT land on the Fragment — it only accepts `key`/`children` — so recurse\n\t// into its children instead.\n\tconst decorateOption = (\n\t\toption: ReactNode,\n\t\tindex: number | string\n\t): ReactNode => {\n\t\tif (!React.isValidElement(option)) return option;\n\n\t\tif (option.type === React.Fragment) {\n\t\t\tconst fragmentProps = option.props as { children?: ReactNode };\n\t\t\treturn React.cloneElement(\n\t\t\t\toption as ReactElement<{ children?: ReactNode }>,\n\t\t\t\tundefined,\n\t\t\t\tReact.Children.map(fragmentProps.children, (child, childIndex) =>\n\t\t\t\t\tdecorateOption(child, `${index}-${childIndex}`)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn React.cloneElement(option as ReactElement<VisualPickerChildProps>, {\n\t\t\tindex: `${id}-${index}`,\n\t\t\tcoverable,\n\t\t\tvariant: 'visual-picker',\n\t\t\tname: `${id}_options`,\n\t\t\tsize,\n\t\t\tvertical: !!vertical,\n\t\t});\n\t};\n\n\tconst options = React.Children.map(children, (option, index) =>\n\t\tdecorateOption(option, index)\n\t);\n\n\treturn (\n\t\t<fieldset id={id} className={classNames('slds-form-element', className as string)}>\n\t\t\t<legend className=\"slds-form-element__legend slds-form-element__label\">{label}</legend>\n\t\t\t<div className=\"slds-form-element__control\">{options}</div>\n\t\t</fieldset>\n\t);\n};\n\nVisualPicker.displayName = VISUAL_PICKER;\n\nexport default VisualPicker;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"2NAiDA,IAAM,GAAgB,CACrB,WACA,YACA,YACA,GAAI,EACJ,QACA,QAAQ,GACR,OAAO,SACP,WAAW,MACiC,CAC5C,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,EAErB,GAAI,EACH,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BAA8B,UAAc,CAAA,EAOnE,IAAM,GACL,EACA,IACe,CACf,GAAI,CAAC,EAAA,QAAM,eAAe,CAAM,EAAG,OAAO,EAE1C,GAAI,EAAO,OAAS,EAAA,QAAM,SAAU,CACnC,IAAM,EAAgB,EAAO,MAC7B,OAAO,EAAA,QAAM,aACZ,EACA,IAAA,GACA,EAAA,QAAM,SAAS,IAAI,EAAc,UAAW,EAAO,IAClD,EAAe,EAAO,GAAG,EAAM,GAAG,GAAY,CAC/C,CACD,CACD,CAEA,OAAO,EAAA,QAAM,aAAa,EAAgD,CACzE,MAAO,GAAG,EAAG,GAAG,IAChB,YACA,QAAS,gBACT,KAAM,GAAG,EAAG,UACZ,OACA,SAAU,CAAC,CAAC,CACb,CAAC,CACF,EAEM,EAAU,EAAA,QAAM,SAAS,IAAI,GAAW,EAAQ,IACrD,EAAe,EAAQ,CAAK,CAC7B,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,WAAD,CAAc,KAAI,WAAA,EAAW,EAAA,QAAA,CAAW,oBAAqB,CAAmB,EAAhF,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,qDAAsD,SAAA,CAAc,CAAA,GACtF,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BAA8B,SAAA,CAAa,CAAA,CACjD,GAEZ,EAEA,EAAa,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/visual-picker/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 } from 'react';\nimport classNames from 'classnames';\nimport { VISUAL_PICKER } from '../../utilities/constants';\n\n/**\n * Visual picker size options\n */\nexport type VisualPickerSize = 'medium' | 'large';\n\n/**\n * Props for child elements that can be cloned\n */\nexport interface VisualPickerChildProps {\n\tindex?: string;\n\tcoverable?: boolean;\n\tvariant?: string;\n\tname?: string;\n\tsize?: VisualPickerSize;\n\tvertical?: boolean;\n}\n\n/**\n * Props for the VisualPicker component\n */\nexport interface VisualPickerProps {\n\t/** Visual Picker children (Checkbox, Radio, VisualPickerLink) */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Whether items are coverable on selection */\n\tcoverable?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Label for the visual picker */\n\tlabel?: string;\n\t/** Whether the picker has links as children */\n\tlinks?: boolean;\n\t/** Size of the picker */\n\tsize?: VisualPickerSize;\n\t/** Whether layout is vertical */\n\tvertical?: boolean;\n}\n\n/**\n * Visual Picker allows users to select an option from a set of visual choices.\n */\nconst VisualPicker = ({\n\tchildren,\n\tclassName,\n\tcoverable,\n\tid: propId,\n\tlabel,\n\tlinks = false,\n\tsize = 'medium',\n\tvertical = false,\n}: VisualPickerProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tif (links) {\n\t\treturn <div className=\"slds-form-element__control\">{children}</div>;\n\t}\n\n\t// Clone the picker props onto each real option element. When an option is a\n\t// `React.Fragment` (e.g. children grouped with `<>...</>`), the injected props\n\t// must NOT land on the Fragment — it only accepts `key`/`children` — so recurse\n\t// into its children instead.\n\tconst decorateOption = (\n\t\toption: ReactNode,\n\t\tindex: number | string\n\t): ReactNode => {\n\t\tif (!React.isValidElement(option)) return option;\n\n\t\tif (option.type === React.Fragment) {\n\t\t\tconst fragmentProps = option.props as { children?: ReactNode };\n\t\t\treturn React.cloneElement(\n\t\t\t\toption as ReactElement<{ children?: ReactNode }>,\n\t\t\t\tundefined,\n\t\t\t\tReact.Children.map(fragmentProps.children, (child, childIndex) =>\n\t\t\t\t\tdecorateOption(child, `${index}-${childIndex}`)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn React.cloneElement(option as ReactElement<VisualPickerChildProps>, {\n\t\t\tindex: `${id}-${index}`,\n\t\t\tcoverable,\n\t\t\tvariant: 'visual-picker',\n\t\t\tname: `${id}_options`,\n\t\t\tsize,\n\t\t\tvertical: !!vertical,\n\t\t});\n\t};\n\n\tconst options = React.Children.map(children, (option, index) =>\n\t\tdecorateOption(option, index)\n\t);\n\n\treturn (\n\t\t<fieldset id={id} className={classNames('slds-form-element', className as string)}>\n\t\t\t<legend className=\"slds-form-element__legend slds-form-element__label\">{label}</legend>\n\t\t\t<div className=\"slds-form-element__control\">{options}</div>\n\t\t</fieldset>\n\t);\n};\n\nVisualPicker.displayName = VISUAL_PICKER;\n\nexport default VisualPicker;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"0TAiDA,IAAM,GAAgB,CACrB,WACA,YACA,YACA,GAAI,EACJ,QACA,QAAQ,GACR,OAAO,SACP,WAAW,MACiC,CAC5C,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,EAErB,GAAI,EACH,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BAA8B,UAAc,CAAA,EAOnE,IAAM,GACL,EACA,IACe,CACf,GAAI,CAAC,EAAA,QAAM,eAAe,CAAM,EAAG,OAAO,EAE1C,GAAI,EAAO,OAAS,EAAA,QAAM,SAAU,CACnC,IAAM,EAAgB,EAAO,MAC7B,OAAO,EAAA,QAAM,aACZ,EACA,IAAA,GACA,EAAA,QAAM,SAAS,IAAI,EAAc,UAAW,EAAO,IAClD,EAAe,EAAO,GAAG,EAAM,GAAG,GAAY,CAC/C,CACD,CACD,CAEA,OAAO,EAAA,QAAM,aAAa,EAAgD,CACzE,MAAO,GAAG,EAAG,GAAG,IAChB,YACA,QAAS,gBACT,KAAM,GAAG,EAAG,UACZ,OACA,SAAU,CAAC,CAAC,CACb,CAAC,CACF,EAEM,EAAU,EAAA,QAAM,SAAS,IAAI,GAAW,EAAQ,IACrD,EAAe,EAAQ,CAAK,CAC7B,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,WAAD,CAAc,KAAI,WAAA,EAAW,EAAA,QAAA,CAAW,oBAAqB,CAAmB,EAAhF,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,qDAAsD,SAAA,CAAc,CAAA,GACtF,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BAA8B,SAAA,CAAa,CAAA,CACjD,GAEZ,EAEA,EAAa,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../modal/index.cjs"),r=require("../progress-bar/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={unitsCompletedAfter:`units completed`},c=({children:e,className:t,doNotShowAgainCheckbox:c,id:l,infoBadge:u,isOpen:d=!0,labels:f,onRequestClose:p,onRenderInfoActions:m,variant:h=`steps`})=>{let g=(0,i.useId)(),_=l||g,v={...s,...f},{totalSteps:y,completedSteps:b,progress:x}=(0,i.useMemo)(()=>{let t=i.default.Children.count(e),n=i.default.Children.toArray(e).filter(e=>i.default.isValidElement(e)&&e.props.isComplete).length;return{totalSteps:t,completedSteps:n,progress:t>0?n/t*100:0}},[e]),S=(0,o.jsxs)(`div`,{className:(0,a.default)(`slds-welcome-mat__info-content`,t),id:`${_}-content`,children:[(0,o.jsx)(`h2`,{className:`slds-welcome-mat__info-title`,id:`${_}-label`,children:v.title}),(0,o.jsx)(`div`,{className:`slds-welcome-mat__info-description slds-text-longform`,children:(0,o.jsx)(`p`,{children:v.description})}),(h===`info-only`||h===`splash`)&&(0,o.jsxs)(`div`,{className:`slds-welcome-mat__info-actions`,children:[m?.(),c&&(0,o.jsx)(`div`,{className:`slds-m-top_large`,children:c})]}),(h===`steps`||h===`trailhead-connected`)&&e&&(0,o.jsxs)(`div`,{className:(0,a.default)(`slds-welcome-mat__info-progress`,{"slds-welcome-mat__info-progress_complete":b===y}),children:[h===`trailhead-connected`&&i.default.Children.map(u,e=>i.default.isValidElement(e)?i.default.cloneElement(e,{isComplete:b===y||void 0}):e),(b!==y||h!==`trailhead-connected`)&&(0,o.jsxs)(o.Fragment,{children:[h===`trailhead-connected`?(0,o.jsxs)(`p`,{children:[b,`/`,y,` `,v.unitsCompletedAfter]}):(0,o.jsx)(`p`,{children:(0,o.jsxs)(`strong`,{children:[b,`/`,y,` `,v.unitsCompletedAfter]})}),(0,o.jsx)(r.default,{value:x,radius:`circular`})]})]})]});return(0,o.jsx)(n.default,{assistiveText:{dialogLabelledBy:`${_}-label`},isOpen:d,onRequestClose:p,size:`small`,id:`${_}-modal`,children:(0,o.jsx)(`div`,{className:(0,a.default)(`slds-welcome-mat`,{"slds-welcome-mat_info-only":h===`info-only`,"slds-welcome-mat_splash":!e}),id:_,children:(0,o.jsx)(`div`,{className:`slds-welcome-mat__content slds-grid`,children:e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{className:`slds-welcome-mat__info slds-size_1-of-2`,children:S}),(0,o.jsx)(`div`,{className:(0,a.default)(`slds-welcome-mat__tiles`,`slds-size_1-of-2`,{"slds-welcome-mat__tiles_info-only":h===`info-only`}),children:i.default.Children.map(e,e=>i.default.isValidElement(e)?i.default.cloneElement(e,{variant:h}):e)})]}):(0,o.jsx)(`div`,{className:`slds-welcome-mat__info slds-size_1-of-1`,children:S})})})})};c.displayName=t.WELCOME_MAT,exports.default=c;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../modal/index.cjs"),r=require("../progress-bar/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={unitsCompletedAfter:`units completed`},c=({children:e,className:t,doNotShowAgainCheckbox:c,id:l,infoBadge:u,isOpen:d=!0,labels:f,onRequestClose:p,onRenderInfoActions:m,variant:h=`steps`})=>{let g=(0,i.useId)(),_=l||g,v={...s,...f},{totalSteps:y,completedSteps:b,progress:x}=(0,i.useMemo)(()=>{let t=i.default.Children.count(e),n=i.default.Children.toArray(e).filter(e=>i.default.isValidElement(e)&&e.props.isComplete).length;return{totalSteps:t,completedSteps:n,progress:t>0?n/t*100:0}},[e]),S=(0,o.jsxs)(`div`,{className:(0,a.default)(`slds-welcome-mat__info-content`,t),id:`${_}-content`,children:[(0,o.jsx)(`h2`,{className:`slds-welcome-mat__info-title`,id:`${_}-label`,children:v.title}),(0,o.jsx)(`div`,{className:`slds-welcome-mat__info-description slds-text-longform`,children:(0,o.jsx)(`p`,{children:v.description})}),(h===`info-only`||h===`splash`)&&(0,o.jsxs)(`div`,{className:`slds-welcome-mat__info-actions`,children:[m?.(),c&&(0,o.jsx)(`div`,{className:`slds-m-top_large`,children:c})]}),(h===`steps`||h===`trailhead-connected`)&&e&&(0,o.jsxs)(`div`,{className:(0,a.default)(`slds-welcome-mat__info-progress`,{"slds-welcome-mat__info-progress_complete":b===y}),children:[h===`trailhead-connected`&&i.default.Children.map(u,e=>i.default.isValidElement(e)?i.default.cloneElement(e,{isComplete:b===y||void 0}):e),(b!==y||h!==`trailhead-connected`)&&(0,o.jsxs)(o.Fragment,{children:[h===`trailhead-connected`?(0,o.jsxs)(`p`,{children:[b,`/`,y,` `,v.unitsCompletedAfter]}):(0,o.jsx)(`p`,{children:(0,o.jsxs)(`strong`,{children:[b,`/`,y,` `,v.unitsCompletedAfter]})}),(0,o.jsx)(r.default,{value:x,radius:`circular`})]})]})]});return(0,o.jsx)(n.default,{assistiveText:{dialogLabelledBy:`${_}-label`},isOpen:d,onRequestClose:p,size:`small`,id:`${_}-modal`,children:(0,o.jsx)(`div`,{className:(0,a.default)(`slds-welcome-mat`,{"slds-welcome-mat_info-only":h===`info-only`,"slds-welcome-mat_splash":!e}),id:_,children:(0,o.jsx)(`div`,{className:`slds-welcome-mat__content slds-grid`,children:e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{className:`slds-welcome-mat__info slds-size_1-of-2`,children:S}),(0,o.jsx)(`div`,{className:(0,a.default)(`slds-welcome-mat__tiles`,`slds-size_1-of-2`,{"slds-welcome-mat__tiles_info-only":h===`info-only`}),children:i.default.Children.map(e,e=>i.default.isValidElement(e)?i.default.cloneElement(e,{variant:h}):e)})]}):(0,o.jsx)(`div`,{className:`slds-welcome-mat__info slds-size_1-of-1`,children:S})})})})};c.displayName=t.WELCOME_MAT,exports.default=c;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/welcome-mat/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, useMemo, type ReactNode, type ReactElement } from 'react';\nimport classNames from 'classnames';\nimport Modal from '../modal';\nimport ProgressBar from '../progress-bar';\nimport { WELCOME_MAT } from '../../utilities/constants';\n\n/**\n * Welcome mat variant types\n */\nexport type WelcomeMatVariant = 'steps' | 'info-only' | 'splash' | 'trailhead-connected';\n\n/**\n * Labels for WelcomeMat\n */\nexport interface WelcomeMatLabels {\n\t/** Title text */\n\ttitle?: string;\n\t/** Description text */\n\tdescription?: string;\n\t/** Text after units completed number */\n\tunitsCompletedAfter?: string;\n}\n\n/**\n * Props for the WelcomeMat component\n */\nexport interface WelcomeMatProps {\n\t/** WelcomeMatTile children */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Do not show again checkbox element */\n\tdoNotShowAgainCheckbox?: ReactNode;\n\t/** HTML id */\n\tid?: string;\n\t/** Info badge for trailhead variant */\n\tinfoBadge?: ReactNode;\n\t/** Whether modal is open */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: WelcomeMatLabels;\n\t/** Close request handler */\n\tonRequestClose?: () => void;\n\t/** Render function for info actions */\n\tonRenderInfoActions?: () => ReactNode;\n\t/** Component variant */\n\tvariant?: WelcomeMatVariant;\n}\n\nconst defaultLabels: WelcomeMatLabels = {\n\tunitsCompletedAfter: 'units completed',\n};\n\n/**\n * A Welcome Mat provides a series of unordered items a user can click to learn about a thematic topic.\n */\nconst WelcomeMat = ({\n\tchildren,\n\tclassName,\n\tdoNotShowAgainCheckbox,\n\tid: propId,\n\tinfoBadge,\n\tisOpen = true,\n\tlabels: propLabels,\n\tonRequestClose,\n\tonRenderInfoActions,\n\tvariant = 'steps',\n}: WelcomeMatProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\t// Calculate progress from children\n\tconst { totalSteps, completedSteps, progress } = useMemo(() => {\n\t\tconst total = React.Children.count(children);\n\t\tconst completed = React.Children.toArray(children).filter(\n\t\t\t(c) => React.isValidElement(c) && (c.props as { isComplete?: boolean }).isComplete\n\t\t).length;\n\t\treturn {\n\t\t\ttotalSteps: total,\n\t\t\tcompletedSteps: completed,\n\t\t\tprogress: total > 0 ? (completed / total) * 100 : 0,\n\t\t};\n\t}, [children]);\n\n\tconst splash = (\n\t\t<div\n\t\t\tclassName={classNames('slds-welcome-mat__info-content', className as string)}\n\t\t\tid={`${id}-content`}\n\t\t>\n\t\t\t<h2 className=\"slds-welcome-mat__info-title\" id={`${id}-label`}>\n\t\t\t\t{labels.title}\n\t\t\t</h2>\n\t\t\t<div className=\"slds-welcome-mat__info-description slds-text-longform\">\n\t\t\t\t<p>{labels.description}</p>\n\t\t\t</div>\n\t\t\t{(variant === 'info-only' || variant === 'splash') && (\n\t\t\t\t<div className=\"slds-welcome-mat__info-actions\">\n\t\t\t\t\t{onRenderInfoActions?.()}\n\t\t\t\t\t{doNotShowAgainCheckbox && (\n\t\t\t\t\t\t<div className=\"slds-m-top_large\">{doNotShowAgainCheckbox}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{(variant === 'steps' || variant === 'trailhead-connected') && children && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-welcome-mat__info-progress', {\n\t\t\t\t\t\t'slds-welcome-mat__info-progress_complete': completedSteps === totalSteps,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{variant === 'trailhead-connected' &&\n\t\t\t\t\t\tReact.Children.map(infoBadge, (child) =>\n\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t? React.cloneElement(child as ReactElement<{ isComplete?: boolean }>, {\n\t\t\t\t\t\t\t\t\t\tisComplete: completedSteps === totalSteps || undefined,\n\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t)}\n\t\t\t\t\t{(completedSteps !== totalSteps || variant !== 'trailhead-connected') && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{variant === 'trailhead-connected' ? (\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<ProgressBar value={progress} radius=\"circular\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<Modal\n\t\t\tassistiveText={{\n\t\t\t\tdialogLabelledBy: `${id}-label`,\n\t\t\t}}\n\t\t\tisOpen={isOpen}\n\t\t\tonRequestClose={onRequestClose}\n\t\t\tsize=\"small\"\n\t\t\tid={`${id}-modal`}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-welcome-mat',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-welcome-mat_info-only': variant === 'info-only',\n\t\t\t\t\t\t'slds-welcome-mat_splash': !children,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tid={id}\n\t\t\t>\n\t\t\t\t<div className=\"slds-welcome-mat__content slds-grid\">\n\t\t\t\t\t{children ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-2\">{splash}</div>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles',\n\t\t\t\t\t\t\t\t\t'slds-size_1-of-2',\n\t\t\t\t\t\t\t\t\t{ 'slds-welcome-mat__tiles_info-only': variant === 'info-only' }\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\t{React.Children.map(children, (child) =>\n\t\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t\t? React.cloneElement(child as ReactElement<{ variant?: WelcomeMatVariant }>, {\n\t\t\t\t\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-1\">{splash}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n};\n\nWelcomeMat.displayName = WELCOME_MAT;\n\nexport default WelcomeMat;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"kSAoDA,IAAM,EAAkC,CACvC,oBAAqB,iBACtB,EAKM,GAAc,CACnB,WACA,YACA,yBACA,GAAI,EACJ,YACA,SAAS,GACT,OAAQ,EACR,iBACA,sBACA,UAAU,WACgC,CAC1C,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,EACf,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,EAG3C,CAAE,aAAY,iBAAgB,aAAA,EAAa,EAAA,QAAA,KAAc,CAC9D,IAAM,EAAQ,EAAA,QAAM,SAAS,MAAM,CAAQ,EACrC,EAAY,EAAA,QAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,OACjD,GAAM,EAAA,QAAM,eAAe,CAAC,GAAM,EAAE,MAAmC,UACzE,CAAC,CAAC,OACF,MAAO,CACN,WAAY,EACZ,eAAgB,EAChB,SAAU,EAAQ,EAAK,EAAY,EAAS,IAAM,CACnD,CACD,EAAG,CAAC,CAAQ,CAAC,EAEP,GACL,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,iCAAkC,CAAmB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,CAEC,GAEF,IAGN,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CACd,iBAAkB,GAAG,EAAG,OACzB,EACQ,SACQ,iBAChB,KAAK,QACL,GAAI,GAAG,EAAG,QAEV,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,mBACA,CACC,6BAA8B,IAAY,YAC1C,0BAA2B,CAAC,CAC7B,CACD,EACI,KAEJ,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,sCACb,SAAA,GACA,EAAA,EAAA,KAAA,CAAA,EAAA,SAAA,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0CAA2C,SAAA,CAAY,CAAA,GACtE,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,0BACA,mBACA,CAAE,oCAAqC,IAAY,WAAY,CAChE,EAEC,SAAA,EAAA,QAAM,SAAS,IAAI,EAAW,GAC9B,EAAA,QAAM,eAAe,CAAK,EACvB,EAAA,QAAM,aAAa,EAAwD,CAC3E,SACA,CAAC,EACD,CACJ,CACI,CAAA,CACJ,CAAA,CAAA,GAEF,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0CAA2C,SAAA,CAAY,CAAA,CAEnE,CAAA,CACD,CAAA,CACC,CAAA,CAET,EAEA,EAAW,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/welcome-mat/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\tuseMemo,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\nimport classNames from 'classnames';\nimport Modal, {\n\ttype ModalRequestCloseData,\n\ttype ModalRequestCloseEvent,\n\ttype ModalRequestCloseTrigger,\n} from '../modal';\nimport ProgressBar from '../progress-bar';\nimport { WELCOME_MAT } from '../../utilities/constants';\n\n/**\n * Welcome mat variant types\n */\nexport type WelcomeMatVariant =\n\t'steps' | 'info-only' | 'splash' | 'trailhead-connected';\n\n/**\n * Labels for WelcomeMat\n */\nexport interface WelcomeMatLabels {\n\t/** Title text */\n\ttitle?: string;\n\t/** Description text */\n\tdescription?: string;\n\t/** Text after units completed number */\n\tunitsCompletedAfter?: string;\n}\n\n/**\n * What caused a WelcomeMat close request (same as the underlying Modal's)\n */\nexport type WelcomeMatRequestCloseTrigger = ModalRequestCloseTrigger;\n\n/**\n * Data passed to `onRequestClose` (forwarded from the underlying Modal)\n */\nexport type WelcomeMatRequestCloseData = ModalRequestCloseData;\n\n/**\n * Event passed to `onRequestClose` (forwarded from the underlying Modal)\n */\nexport type WelcomeMatRequestCloseEvent = ModalRequestCloseEvent;\n\ninterface WelcomeMatBaseProps {\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether modal is open */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: WelcomeMatLabels;\n\t/**\n\t * Close request handler, forwarded from the underlying Modal. Receives the triggering\n\t * click or keydown event and `data.trigger`: `'close-button'`, `'escape'`, or `'click-outside'`.\n\t */\n\tonRequestClose?: (\n\t\tevent: WelcomeMatRequestCloseEvent,\n\t\tdata: WelcomeMatRequestCloseData\n\t) => void;\n}\n\n/**\n * `variant` decides what the info panel shows. `steps` and\n * `trailhead-connected` show progress through `WelcomeMatTile` children;\n * `info-only` and `splash` show actions instead.\n */\nexport type WelcomeMatVariantProps =\n\t| {\n\t\t\t/** Tiles with a progress bar */\n\t\t\tvariant?: 'steps';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\tdoNotShowAgainCheckbox?: never;\n\t\t\tinfoBadge?: never;\n\t\t\tonRenderInfoActions?: never;\n\t }\n\t| {\n\t\t\t/** Tiles with Trailhead progress and an info badge */\n\t\t\tvariant: 'trailhead-connected';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\tdoNotShowAgainCheckbox?: never;\n\t\t\t/** WelcomeMatInfoBadge shown above the progress */\n\t\t\tinfoBadge?: ReactNode;\n\t\t\tonRenderInfoActions?: never;\n\t }\n\t| {\n\t\t\t/** Tiles with actions instead of progress */\n\t\t\tvariant: 'info-only';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\t/** Do not show again checkbox element */\n\t\t\tdoNotShowAgainCheckbox?: ReactNode;\n\t\t\tinfoBadge?: never;\n\t\t\t/** Render function for info actions */\n\t\t\tonRenderInfoActions?: () => ReactNode;\n\t }\n\t| {\n\t\t\t/** Info panel only, with actions and no tiles */\n\t\t\tvariant: 'splash';\n\t\t\tchildren?: never;\n\t\t\t/** Do not show again checkbox element */\n\t\t\tdoNotShowAgainCheckbox?: ReactNode;\n\t\t\tinfoBadge?: never;\n\t\t\t/** Render function for info actions */\n\t\t\tonRenderInfoActions?: () => ReactNode;\n\t };\n\n/**\n * Props for the WelcomeMat component\n */\nexport type WelcomeMatProps = WelcomeMatBaseProps & WelcomeMatVariantProps;\n\nconst defaultLabels: WelcomeMatLabels = {\n\tunitsCompletedAfter: 'units completed',\n};\n\n/**\n * A Welcome Mat provides a series of unordered items a user can click to learn about a thematic topic.\n */\nconst WelcomeMat = ({\n\tchildren,\n\tclassName,\n\tdoNotShowAgainCheckbox,\n\tid: propId,\n\tinfoBadge,\n\tisOpen = true,\n\tlabels: propLabels,\n\tonRequestClose,\n\tonRenderInfoActions,\n\tvariant = 'steps',\n}: WelcomeMatProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\t// Calculate progress from children\n\tconst { totalSteps, completedSteps, progress } = useMemo(() => {\n\t\tconst total = React.Children.count(children);\n\t\tconst completed = React.Children.toArray(children).filter(\n\t\t\t(c) =>\n\t\t\t\tReact.isValidElement(c) &&\n\t\t\t\t(c.props as { isComplete?: boolean }).isComplete\n\t\t).length;\n\t\treturn {\n\t\t\ttotalSteps: total,\n\t\t\tcompletedSteps: completed,\n\t\t\tprogress: total > 0 ? (completed / total) * 100 : 0,\n\t\t};\n\t}, [children]);\n\n\tconst splash = (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-welcome-mat__info-content',\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tid={`${id}-content`}\n\t\t>\n\t\t\t<h2 className=\"slds-welcome-mat__info-title\" id={`${id}-label`}>\n\t\t\t\t{labels.title}\n\t\t\t</h2>\n\t\t\t<div className=\"slds-welcome-mat__info-description slds-text-longform\">\n\t\t\t\t<p>{labels.description}</p>\n\t\t\t</div>\n\t\t\t{(variant === 'info-only' || variant === 'splash') && (\n\t\t\t\t<div className=\"slds-welcome-mat__info-actions\">\n\t\t\t\t\t{onRenderInfoActions?.()}\n\t\t\t\t\t{doNotShowAgainCheckbox && (\n\t\t\t\t\t\t<div className=\"slds-m-top_large\">{doNotShowAgainCheckbox}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{(variant === 'steps' || variant === 'trailhead-connected') &&\n\t\t\t\tchildren && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames('slds-welcome-mat__info-progress', {\n\t\t\t\t\t\t\t'slds-welcome-mat__info-progress_complete':\n\t\t\t\t\t\t\t\tcompletedSteps === totalSteps,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t{variant === 'trailhead-connected' &&\n\t\t\t\t\t\t\tReact.Children.map(infoBadge, (child) =>\n\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\t\t\t\t\t\tchild as ReactElement<{ isComplete?: boolean }>,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tisComplete: completedSteps === totalSteps || undefined,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t{(completedSteps !== totalSteps ||\n\t\t\t\t\t\t\tvariant !== 'trailhead-connected') && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{variant === 'trailhead-connected' ? (\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<ProgressBar value={progress} radius=\"circular\" />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<Modal\n\t\t\tassistiveText={{\n\t\t\t\tdialogLabelledBy: `${id}-label`,\n\t\t\t}}\n\t\t\tisOpen={isOpen}\n\t\t\tonRequestClose={onRequestClose}\n\t\t\tsize=\"small\"\n\t\t\tid={`${id}-modal`}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-welcome-mat', {\n\t\t\t\t\t'slds-welcome-mat_info-only': variant === 'info-only',\n\t\t\t\t\t'slds-welcome-mat_splash': !children,\n\t\t\t\t})}\n\t\t\t\tid={id}\n\t\t\t>\n\t\t\t\t<div className=\"slds-welcome-mat__content slds-grid\">\n\t\t\t\t\t{children ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-2\">\n\t\t\t\t\t\t\t\t{splash}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles',\n\t\t\t\t\t\t\t\t\t'slds-size_1-of-2',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles_info-only':\n\t\t\t\t\t\t\t\t\t\t\tvariant === 'info-only',\n\t\t\t\t\t\t\t\t\t}\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\t{React.Children.map(children, (child) =>\n\t\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\t\t\t\t\t\t\tchild as ReactElement<{ variant?: WelcomeMatVariant }>,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-1\">\n\t\t\t\t\t\t\t{splash}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n};\n\nWelcomeMat.displayName = WELCOME_MAT;\n\nexport default WelcomeMat;\n"],"mappings":"iYA0HA,IAAM,EAAkC,CACvC,oBAAqB,iBACtB,EAKM,GAAc,CACnB,WACA,YACA,yBACA,GAAI,EACJ,YACA,SAAS,GACT,OAAQ,EACR,iBACA,sBACA,UAAU,WACgC,CAC1C,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,E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AAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0CACb,SAAA,CACG,CAAA,CAEF,CAAA,CACD,CAAA,CACC,CAAA,CAET,EAEA,EAAW,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- var e=`SLDSAccordion`,t=`SLDSAccordionPanel`,n=`SLDSAlert`,r=`SLDSAlertContainer`,i=`SLDSAvatar`,a=`SLDSBadge`,o=`SLDSBreadcrumb`,s=`SLDSBuilderHeader`,c=`SLDSBuilderHeaderMisc`,l=`SLDSBuilderHeaderUtilities`,u=`SLDSBuilderHeaderNav`,d=`SLDSBuilderHeaderNavDropdown`,f=`SLDSBuilderHeaderNavLink`,p=`SLDSBuilderHeaderToolbar`,m=`SLDSButton`,h=`SLDSButtonGroup`,g=`SLDSButtonStateful`,_=`SLDSButtonIcon`,v=`SLDSCard`,y=`SLDSCardBody`,b=`SLDSCardEmpty`,x=`SLDSCardFilter`,S=`SLDSCardFooter`,C=`SLDSCardHeader`,w=`SLDSCarousel`,T=`SLDSCarouselIndicators`,E=`SLDSCarouselItem`,D=`SLDSCarouselNavigators`,O=`SLDSCarouselAutoplayButton`,k=`SLDSColorPicker`,A=`SLDSCombobox`,j=`SLDSSimpleDataTable`,M=`SLDSSimpleDataTableCell`,N=`SLDSSimpleDataTableColumn`,P=`SLDSSimpleDataTableHead`,F=`SLDSSimpleDataTableHeaderCell`,I=`SLDSSimpleDataTableRowActions`,L=`SLDSSimpleDataTableRow`,R=`SLDSDatePicker`,z=`SLDSDynamicIcon`,B=`SLDSDialog`,V=`SLDSFiles`,H=`SLDSFilesFile`,U=`SLDSFilesMore`,W=`SLDSFilesFigure`,G=`SLDSFilesActions`,K=`SLDSExpandableSection`,q=`SLDSFilter`,J=`SLDSCheckbox`,Y=`SLDSInlineEdit`,X=`SLDSInput`,Z=`SLDSTextarea`,Q=`SLDSSearch`,$=`SLDSHighlighter`,ee=`SLDSIcon`,te=`SLDSIconSettings`,ne=`SLDSIconInput`,re=`SLDSIllustration`,ie=`SLDSList`,ae=`SLDSListItem`,oe=`SLDSListItemLabel`,se=`SLDSLookup`,ce=`SLDSMediaObject`,le=`SLDSMenuDropdown`,ue=`SLDSMenuDropdownTrigger`,de=`SLDSModal`,fe=`SLDSPanel`,pe=`SLDSFilterGroup`,me=`SLDSFilterList`,he=`SLDSPanelFilterListHeading`,ge=`SLDSPageHeader`,_e=`SLDSPageHeaderControl`,ve=`SLDSPill`,ye=`SLDSPillContainer`,be=`SLDSPortalSettings`,xe=`SLDSPopover`,Se=`SLDSPopoverEditDialog`,Ce=`SLDSPopoverTooltip`,we=`SLDSProgressIndicator`,Te=`SLDSProgressIndicatorProgress`,Ee=`SLDSProgressIndicatorStep`,De=`SLDSProgressIndicatorStepVertical`,Oe=`SLDSProgressRing`,ke=`SLDSProgressBar`,Ae=`SLDSSetupAssistant`,je=`SLDSSetupAssistantStep`,Me=`SLDSScopedNotification`,Ne=`SLDSSlider`,Pe=`SLDSSpinner`,Fe=`SLDSSplitView`,Ie=`SLDSSplitViewHeader`,Le=`SLDSSplitViewListbox`,Re=`SLDSRadio`,ze=`SLDSRadioGroup`,Be=`SLDSRadioButtonGroup`,Ve=`SLDSTab`,He=`SLDSTabPanel`,Ue=`SLDSTabs`,We=`SLDSTabsList`,Ge=`SLDSTabsPanel`,Ke=`SLDSTimepicker`,qe=`SLDSToast`,Je=`SLDSToastContainer`,Ye=`SLDSTree`,Xe=`SLDSTreeBranch`,Ze=`SLDSTreeItem`,Qe=`SLDSTrialBar`,$e=`SLDSTrialBarDropdown`,et=`SLDSTrialBarButton`,tt=`SLDSVerticalNavigation`,nt=`SLDSVerticalNavigationItem`,rt=`SLDSVisualPicker`,it=`SLDSVisualPickerLink`,at=`SLDSWelcomeMat`,ot=`SLDSWelcomeMatTile`,st=`SLDSWelcomeMatBadge`;exports.ACCORDION=e,exports.ACCORDION_PANEL=t,exports.ALERT=n,exports.ALERT_CONTAINER=r,exports.AVATAR=i,exports.BADGE=a,exports.BREADCRUMB=o,exports.BUILDER_HEADER=s,exports.BUILDER_HEADER_MISC=c,exports.BUILDER_HEADER_NAV=u,exports.BUILDER_HEADER_NAV_DROPDOWN=d,exports.BUILDER_HEADER_NAV_LINK=f,exports.BUILDER_HEADER_TOOLBAR=p,exports.BUILDER_HEADER_UTILITIES=l,exports.BUTTON=m,exports.BUTTON_GROUP=h,exports.BUTTON_ICON=_,exports.BUTTON_STATEFUL=g,exports.CARD=v,exports.CARD_BODY=y,exports.CARD_EMPTY=b,exports.CARD_FILTER=x,exports.CARD_FOOTER=S,exports.CARD_HEADER=C,exports.CAROUSEL=w,exports.CAROUSEL_AUTOPLAY_BUTTON=O,exports.CAROUSEL_INDICATORS=T,exports.CAROUSEL_ITEM=E,exports.CAROUSEL_NAVIGATORS=D,exports.CHECKBOX=J,exports.COLOR_PICKER=k,exports.COMBOBOX=A,exports.DATE_PICKER=R,exports.DIALOG=B,exports.DYNAMIC_ICON=z,exports.EXPANDABLE_SECTION=K,exports.FILES=V,exports.FILES_ACTIONS=G,exports.FILES_FIGURE=W,exports.FILES_FILE=H,exports.FILES_MORE=U,exports.FILTER=q,exports.FORMS_INLINE_EDIT=Y,exports.HIGHLIGHTER=$,exports.ICON=ee,exports.ICON_INPUT=ne,exports.ICON_SETTINGS=te,exports.ILLUSTRATION=re,exports.INPUT=X,exports.LIST=ie,exports.LIST_ITEM=ae,exports.LIST_ITEM_LABEL=oe,exports.LOOKUP=se,exports.MEDIA_OBJECT=ce,exports.MENU_DROPDOWN=le,exports.MENU_DROPDOWN_TRIGGER=ue,exports.MODAL=de,exports.PAGE_HEADER=ge,exports.PAGE_HEADER_CONTROL=_e,exports.PANEL=fe,exports.PANEL_FILTER_GROUP=pe,exports.PANEL_FILTER_LIST=me,exports.PANEL_FILTER_LIST_HEADING=he,exports.PILL=ve,exports.PILL_CONTAINER=ye,exports.POPOVER=xe,exports.POPOVER_EDIT_DIALOG=Se,exports.POPOVER_TOOLTIP=Ce,exports.PORTAL_SETTINGS=be,exports.PROGRESS_BAR=ke,exports.PROGRESS_INDICATOR=we,exports.PROGRESS_INDICATOR_PROGRESS=Te,exports.PROGRESS_INDICATOR_STEP=Ee,exports.PROGRESS_INDICATOR_STEP_VERTICAL=De,exports.PROGRESS_RING=Oe,exports.RADIO=Re,exports.RADIO_BUTTON_GROUP=Be,exports.RADIO_GROUP=ze,exports.SCOPED_NOTIFICATION=Me,exports.SEARCH=Q,exports.SETUP_ASSISTANT=Ae,exports.SETUP_ASSISTANT_STEP=je,exports.SIMPLE_DATA_TABLE=j,exports.SIMPLE_DATA_TABLE_CELL=M,exports.SIMPLE_DATA_TABLE_COLUMN=N,exports.SIMPLE_DATA_TABLE_HEAD=P,exports.SIMPLE_DATA_TABLE_HEADER_CELL=F,exports.SIMPLE_DATA_TABLE_ROW=L,exports.SIMPLE_DATA_TABLE_ROW_ACTIONS=I,exports.SLIDER=Ne,exports.SPINNER=Pe,exports.SPLIT_VIEW=Fe,exports.SPLIT_VIEW_HEADER=Ie,exports.SPLIT_VIEW_LISTBOX=Le,exports.TAB=Ve,exports.TABS=Ue,exports.TABS_LIST=We,exports.TABS_PANEL=Ge,exports.TAB_PANEL=He,exports.TEXTAREA=Z,exports.TIME_PICKER=Ke,exports.TOAST=qe,exports.TOAST_CONTAINER=Je,exports.TREE=Ye,exports.TREE_BRANCH=Xe,exports.TREE_ITEM=Ze,exports.TRIAL_BAR=Qe,exports.TRIAL_BAR_BUTTON=et,exports.TRIAL_BAR_DROPDOWN=$e,exports.VERTICAL_NAVIGATION=tt,exports.VERTICAL_NAVIGATION_ITEM=nt,exports.VISUAL_PICKER=rt,exports.VISUAL_PICKER_LINK=it,exports.WELCOME_MAT=at,exports.WELCOME_MAT_BADGE=st,exports.WELCOME_MAT_TILE=ot;
1
+ var e=`SLDSAccordion`,t=`SLDSAccordionPanel`,n=`SLDSAlert`,r=`SLDSAlertContainer`,i=`SLDSAvatar`,a=`SLDSBadge`,o=`SLDSBreadcrumb`,s=`SLDSBuilderHeader`,c=`SLDSBuilderHeaderMisc`,l=`SLDSBuilderHeaderUtilities`,u=`SLDSBuilderHeaderNav`,d=`SLDSBuilderHeaderNavDropdown`,f=`SLDSBuilderHeaderNavLink`,p=`SLDSBuilderHeaderToolbar`,m=`SLDSButton`,h=`SLDSButtonGroup`,g=`SLDSButtonStateful`,_=`SLDSButtonIcon`,v=`SLDSCard`,y=`SLDSCardBody`,b=`SLDSCardEmpty`,x=`SLDSCardFilter`,S=`SLDSCardFooter`,C=`SLDSCardHeader`,w=`SLDSCarousel`,T=`SLDSCarouselIndicators`,E=`SLDSCarouselItem`,D=`SLDSCarouselNavigators`,O=`SLDSCarouselAutoplayButton`,k=`SLDSColorPicker`,A=`SLDSCombobox`,j=`SLDSSimpleDataTable`,M=`SLDSSimpleDataTableCell`,N=`SLDSSimpleDataTableColumn`,P=`SLDSSimpleDataTableHead`,F=`SLDSSimpleDataTableHeaderCell`,I=`SLDSSimpleDataTableRowActions`,L=`SLDSSimpleDataTableRow`,R=`SLDSDatePicker`,z=`SLDSDynamicIcon`,B=`SLDSDialog`,V=`SLDSFiles`,H=`SLDSFilesFile`,U=`SLDSFilesMore`,W=`SLDSFilesFigure`,G=`SLDSFilesActions`,K=`SLDSExpandableSection`,q=`SLDSFilter`,J=`SLDSCheckbox`,Y=`SLDSInput`,X=`SLDSTextarea`,Z=`SLDSSearch`,Q=`SLDSHighlighter`,$=`SLDSIcon`,ee=`SLDSIconSettings`,te=`SLDSIconInput`,ne=`SLDSIllustration`,re=`SLDSList`,ie=`SLDSListItem`,ae=`SLDSListItemLabel`,oe=`SLDSLookup`,se=`SLDSMediaObject`,ce=`SLDSMenuDropdown`,le=`SLDSMenuDropdownTrigger`,ue=`SLDSModal`,de=`SLDSPanel`,fe=`SLDSFilterGroup`,pe=`SLDSFilterList`,me=`SLDSPanelFilterListHeading`,he=`SLDSPageHeader`,ge=`SLDSPageHeaderControl`,_e=`SLDSPill`,ve=`SLDSPillContainer`,ye=`SLDSPortalSettings`,be=`SLDSPopover`,xe=`SLDSPopoverEditDialog`,Se=`SLDSPopoverTooltip`,Ce=`SLDSProgressIndicator`,we=`SLDSProgressIndicatorPath`,Te=`SLDSProgressIndicatorProgress`,Ee=`SLDSProgressIndicatorStep`,De=`SLDSProgressIndicatorStepVertical`,Oe=`SLDSProgressRing`,ke=`SLDSProgressBar`,Ae=`SLDSSetupAssistant`,je=`SLDSSetupAssistantStep`,Me=`SLDSScopedNotification`,Ne=`SLDSSlider`,Pe=`SLDSSpinner`,Fe=`SLDSSplitView`,Ie=`SLDSSplitViewHeader`,Le=`SLDSSplitViewListbox`,Re=`SLDSRadio`,ze=`SLDSRadioGroup`,Be=`SLDSRadioButtonGroup`,Ve=`SLDSTab`,He=`SLDSTabPanel`,Ue=`SLDSTabs`,We=`SLDSTabsList`,Ge=`SLDSTabsPanel`,Ke=`SLDSTimepicker`,qe=`SLDSToast`,Je=`SLDSToastContainer`,Ye=`SLDSTree`,Xe=`SLDSTreeBranch`,Ze=`SLDSTreeItem`,Qe=`SLDSTrialBar`,$e=`SLDSTrialBarDropdown`,et=`SLDSTrialBarButton`,tt=`SLDSVerticalNavigation`,nt=`SLDSVerticalNavigationItem`,rt=`SLDSVisualPicker`,it=`SLDSVisualPickerLink`,at=`SLDSWelcomeMat`,ot=`SLDSWelcomeMatTile`,st=`SLDSWelcomeMatBadge`;exports.ACCORDION=e,exports.ACCORDION_PANEL=t,exports.ALERT=n,exports.ALERT_CONTAINER=r,exports.AVATAR=i,exports.BADGE=a,exports.BREADCRUMB=o,exports.BUILDER_HEADER=s,exports.BUILDER_HEADER_MISC=c,exports.BUILDER_HEADER_NAV=u,exports.BUILDER_HEADER_NAV_DROPDOWN=d,exports.BUILDER_HEADER_NAV_LINK=f,exports.BUILDER_HEADER_TOOLBAR=p,exports.BUILDER_HEADER_UTILITIES=l,exports.BUTTON=m,exports.BUTTON_GROUP=h,exports.BUTTON_ICON=_,exports.BUTTON_STATEFUL=g,exports.CARD=v,exports.CARD_BODY=y,exports.CARD_EMPTY=b,exports.CARD_FILTER=x,exports.CARD_FOOTER=S,exports.CARD_HEADER=C,exports.CAROUSEL=w,exports.CAROUSEL_AUTOPLAY_BUTTON=O,exports.CAROUSEL_INDICATORS=T,exports.CAROUSEL_ITEM=E,exports.CAROUSEL_NAVIGATORS=D,exports.CHECKBOX=J,exports.COLOR_PICKER=k,exports.COMBOBOX=A,exports.DATE_PICKER=R,exports.DIALOG=B,exports.DYNAMIC_ICON=z,exports.EXPANDABLE_SECTION=K,exports.FILES=V,exports.FILES_ACTIONS=G,exports.FILES_FIGURE=W,exports.FILES_FILE=H,exports.FILES_MORE=U,exports.FILTER=q,exports.HIGHLIGHTER=Q,exports.ICON=$,exports.ICON_INPUT=te,exports.ICON_SETTINGS=ee,exports.ILLUSTRATION=ne,exports.INPUT=Y,exports.LIST=re,exports.LIST_ITEM=ie,exports.LIST_ITEM_LABEL=ae,exports.LOOKUP=oe,exports.MEDIA_OBJECT=se,exports.MENU_DROPDOWN=ce,exports.MENU_DROPDOWN_TRIGGER=le,exports.MODAL=ue,exports.PAGE_HEADER=he,exports.PAGE_HEADER_CONTROL=ge,exports.PANEL=de,exports.PANEL_FILTER_GROUP=fe,exports.PANEL_FILTER_LIST=pe,exports.PANEL_FILTER_LIST_HEADING=me,exports.PILL=_e,exports.PILL_CONTAINER=ve,exports.POPOVER=be,exports.POPOVER_EDIT_DIALOG=xe,exports.POPOVER_TOOLTIP=Se,exports.PORTAL_SETTINGS=ye,exports.PROGRESS_BAR=ke,exports.PROGRESS_INDICATOR=Ce,exports.PROGRESS_INDICATOR_PATH=we,exports.PROGRESS_INDICATOR_PROGRESS=Te,exports.PROGRESS_INDICATOR_STEP=Ee,exports.PROGRESS_INDICATOR_STEP_VERTICAL=De,exports.PROGRESS_RING=Oe,exports.RADIO=Re,exports.RADIO_BUTTON_GROUP=Be,exports.RADIO_GROUP=ze,exports.SCOPED_NOTIFICATION=Me,exports.SEARCH=Z,exports.SETUP_ASSISTANT=Ae,exports.SETUP_ASSISTANT_STEP=je,exports.SIMPLE_DATA_TABLE=j,exports.SIMPLE_DATA_TABLE_CELL=M,exports.SIMPLE_DATA_TABLE_COLUMN=N,exports.SIMPLE_DATA_TABLE_HEAD=P,exports.SIMPLE_DATA_TABLE_HEADER_CELL=F,exports.SIMPLE_DATA_TABLE_ROW=L,exports.SIMPLE_DATA_TABLE_ROW_ACTIONS=I,exports.SLIDER=Ne,exports.SPINNER=Pe,exports.SPLIT_VIEW=Fe,exports.SPLIT_VIEW_HEADER=Ie,exports.SPLIT_VIEW_LISTBOX=Le,exports.TAB=Ve,exports.TABS=Ue,exports.TABS_LIST=We,exports.TABS_PANEL=Ge,exports.TAB_PANEL=He,exports.TEXTAREA=X,exports.TIME_PICKER=Ke,exports.TOAST=qe,exports.TOAST_CONTAINER=Je,exports.TREE=Ye,exports.TREE_BRANCH=Xe,exports.TREE_ITEM=Ze,exports.TRIAL_BAR=Qe,exports.TRIAL_BAR_BUTTON=et,exports.TRIAL_BAR_DROPDOWN=$e,exports.VERTICAL_NAVIGATION=tt,exports.VERTICAL_NAVIGATION_ITEM=nt,exports.VISUAL_PICKER=rt,exports.VISUAL_PICKER_LINK=it,exports.WELCOME_MAT=at,exports.WELCOME_MAT_BADGE=st,exports.WELCOME_MAT_TILE=ot;
2
2
  //# sourceMappingURL=constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","names":[],"sources":["../../../utilities/constants.js"],"sourcesContent":["// ## Components\nexport const ACCORDION = 'SLDSAccordion';\nexport const ACCORDION_PANEL = 'SLDSAccordionPanel';\nexport const ALERT = 'SLDSAlert';\nexport const ALERT_CONTAINER = 'SLDSAlertContainer';\nexport const APP_LAUNCHER = 'SLDSAppLauncher';\nexport const APP_LAUNCHER_EXPANDABLE_SECTION =\n\t'SLDSAppLauncherExpandableSection';\n/* Remove at next breaking change */\nexport const APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection';\nexport const APP_LAUNCHER_LINK = 'SLDSAppLauncherLink';\nexport const APP_LAUNCHER_TILE = 'SLDSAppLauncherTile';\nexport const APP_LAUNCHER_HEADER = 'SLDSAppLauncherHeader';\nexport const AVATAR = 'SLDSAvatar';\nexport const BADGE = 'SLDSBadge';\n\nexport const BRAND_BAND = 'SLDSBrandBand';\n\n/* Remove at next breaking change */\nexport const BREAD_CRUMB = 'SLDSBreadcrumb';\n\nexport const BREADCRUMB = 'SLDSBreadcrumb';\nexport const BUILDER_HEADER = 'SLDSBuilderHeader';\nexport const BUILDER_HEADER_MISC = 'SLDSBuilderHeaderMisc';\nexport const BUILDER_HEADER_UTILITIES = 'SLDSBuilderHeaderUtilities';\nexport const BUILDER_HEADER_NAV = 'SLDSBuilderHeaderNav';\nexport const BUILDER_HEADER_NAV_DROPDOWN = 'SLDSBuilderHeaderNavDropdown';\nexport const BUILDER_HEADER_NAV_LINK = 'SLDSBuilderHeaderNavLink';\nexport const BUILDER_HEADER_TOOLBAR = 'SLDSBuilderHeaderToolbar';\nexport const BUTTON = 'SLDSButton';\nexport const BUTTON_GROUP = 'SLDSButtonGroup';\nexport const BUTTON_STATEFUL = 'SLDSButtonStateful';\nexport const BUTTON_ICON = 'SLDSButtonIcon'; // a non-interctive icon wrapper for SLDSUtilityIcon\nexport const CARD = 'SLDSCard';\nexport const CARD_BODY = 'SLDSCardBody';\nexport const CARD_EMPTY = 'SLDSCardEmpty';\nexport const CARD_FILTER = 'SLDSCardFilter';\nexport const CARD_FOOTER = 'SLDSCardFooter';\nexport const CARD_HEADER = 'SLDSCardHeader';\nexport const CAROUSEL = 'SLDSCarousel';\nexport const CAROUSEL_INDICATORS = 'SLDSCarouselIndicators';\nexport const CAROUSEL_ITEM = 'SLDSCarouselItem';\nexport const CAROUSEL_NAVIGATORS = 'SLDSCarouselNavigators';\nexport const CAROUSEL_AUTOPLAY_BUTTON = 'SLDSCarouselAutoplayButton';\nexport const COLOR_PICKER = 'SLDSColorPicker';\nexport const COMBOBOX = 'SLDSCombobox';\nexport const SIMPLE_DATA_TABLE = 'SLDSSimpleDataTable';\nexport const SIMPLE_DATA_TABLE_CELL = 'SLDSSimpleDataTableCell';\nexport const SIMPLE_DATA_TABLE_COLUMN = 'SLDSSimpleDataTableColumn';\nexport const SIMPLE_DATA_TABLE_HEAD = 'SLDSSimpleDataTableHead';\nexport const SIMPLE_DATA_TABLE_HEADER_CELL = 'SLDSSimpleDataTableHeaderCell';\nexport const SIMPLE_DATA_TABLE_ROW_ACTIONS = 'SLDSSimpleDataTableRowActions';\nexport const SIMPLE_DATA_TABLE_ROW = 'SLDSSimpleDataTableRow';\nexport const DATE_PICKER = 'SLDSDatePicker';\nexport const DEPRECATED_WARNING = 'SLDSDeprecatedWarning';\nexport const DYNAMIC_ICON = 'SLDSDynamicIcon';\nexport const DIALOG = 'SLDSDialog';\nexport const FILES = 'SLDSFiles';\nexport const FILES_FILE = `SLDSFilesFile`;\nexport const FILES_MORE = `SLDSFilesMore`;\nexport const FILES_FIGURE = 'SLDSFilesFigure';\nexport const FILES_ACTIONS = 'SLDSFilesActions';\nexport const EXPANDABLE_SECTION = 'SLDSExpandableSection';\nexport const EXPRESSION = 'SLDSExpression';\nexport const EXPRESSION_GROUP = 'SLDSExpressionGroup';\nexport const EXPRESSION_CONDITION = 'SLDSExpressionCondition';\nexport const EXPRESSION_FORMULA = 'SLDSExpressionFormula';\nexport const FILTER = 'SLDSFilter';\nexport const CHECKBOX = 'SLDSCheckbox';\nexport const FORMS_INLINE_EDIT = 'SLDSInlineEdit';\nexport const INPUT = 'SLDSInput';\nexport const TEXTAREA = 'SLDSTextarea';\nexport const SEARCH = 'SLDSSearch';\nexport const GLOBAL_HEADER = 'SLDSGlobalHeader';\nexport const GLOBAL_HEADER_BUTTON = 'SLDSGlobalHeaderButton';\nexport const GLOBAL_HEADER_DROPDOWN = 'SLDSGlobalHeaderDropdown';\nexport const GLOBAL_HEADER_FAVORITES = 'SLDSGlobalHeaderFavorites';\nexport const GLOBAL_HEADER_HELP = 'SLDSGlobalHeaderHelp';\nexport const GLOBAL_HEADER_NOTIFICATIONS = 'SLDSGlobalHeaderNotifications';\nexport const GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';\nexport const GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';\nexport const GLOBAL_HEADER_SETUP = 'SLDSGlobalHeaderSetup';\nexport const GLOBAL_HEADER_TASK = 'SLDSGlobalHeaderTask';\nexport const GLOBAL_HEADER_TOOL = 'SLDSGlobalHeaderTool';\nexport const GLOBAL_NAVIGATION_BAR = 'SLDSGlobalNavigationBar';\nexport const GLOBAL_NAVIGATION_BAR_BUTTON = 'SLDSGlobalNavigationBarButton';\nexport const GLOBAL_NAVIGATION_BAR_DROPDOWN = 'SLDSGlobalNavigationBarDropdown';\nexport const GLOBAL_NAVIGATION_BAR_LABEL = 'SLDSGlobalNavigationBarLabel';\nexport const GLOBAL_NAVIGATION_BAR_LINK = 'SLDSGlobalNavigationBarLink';\nexport const GLOBAL_NAVIGATION_BAR_REGION = 'SLDSGlobalNavigationBarRegion';\nexport const GLOBAL_NAVIGATION_BAR_APP_LAUNCHER =\n\t'SLDSGlobalNavigationBarAppLauncher';\nexport const GRID = 'SLDSGrid';\nexport const HIGHLIGHTER = 'SLDSHighlighter';\nexport const ICON = 'SLDSIcon';\nexport const ICON_SETTINGS = 'SLDSIconSettings';\nexport const ICON_INPUT = 'SLDSIconInput';\nexport const ILLUSTRATION = 'SLDSIllustration';\nexport const LIST = 'SLDSList';\nexport const LIST_ITEM = 'SLDSListItem';\nexport const LIST_ITEM_LABEL = 'SLDSListItemLabel';\nexport const LISTBOX_OF_PILL_OPTIONS = 'SLDSListboxOfPillOptions';\nexport const LOCATION_MAP = 'SLDSLocationMap';\nexport const LOOKUP = 'SLDSLookup';\nexport const MEDIA_OBJECT = 'SLDSMediaObject';\nexport const MENU_DROPDOWN = 'SLDSMenuDropdown';\nexport const MENU_DROPDOWN_TRIGGER = 'SLDSMenuDropdownTrigger';\nexport const MENU_PICKLIST = 'SLDSMenuPicklist';\nexport const MODAL = 'SLDSModal';\nexport const NOTIFICATION = 'SLDSNotification';\nexport const PANEL = 'SLDSPanel';\nexport const PANEL_FILTER_GROUP = 'SLDSFilterGroup';\nexport const PANEL_FILTER_LIST = 'SLDSFilterList';\nexport const PANEL_FILTER_LIST_HEADING = 'SLDSPanelFilterListHeading';\nexport const PAGE_HEADER = 'SLDSPageHeader';\nexport const PAGE_HEADER_CONTROL = 'SLDSPageHeaderControl';\nexport const PILL = 'SLDSPill';\nexport const PILL_CONTAINER = 'SLDSPillContainer';\nexport const PORTAL_SETTINGS = 'SLDSPortalSettings';\nexport const POPOVER = 'SLDSPopover';\nexport const POPOVER_EDIT_DIALOG = 'SLDSPopoverEditDialog';\nexport const POPOVER_TOOLTIP = 'SLDSPopoverTooltip';\nexport const PROGRESS_INDICATOR = 'SLDSProgressIndicator';\nexport const PROGRESS_INDICATOR_PROGRESS = 'SLDSProgressIndicatorProgress';\nexport const PROGRESS_INDICATOR_STEP = 'SLDSProgressIndicatorStep';\nexport const PROGRESS_INDICATOR_STEP_VERTICAL =\n\t'SLDSProgressIndicatorStepVertical';\nexport const PROGRESS_RING = 'SLDSProgressRing';\nexport const PROGRESS_BAR = 'SLDSProgressBar';\nexport const SETUP_ASSISTANT = 'SLDSSetupAssistant';\nexport const SETUP_ASSISTANT_STEP = 'SLDSSetupAssistantStep';\nexport const SCOPED_NOTIFICATION = 'SLDSScopedNotification';\nexport const SLIDER = 'SLDSSlider';\nexport const SPINNER = 'SLDSSpinner';\nexport const SPLIT_VIEW = 'SLDSSplitView';\nexport const SPLIT_VIEW_HEADER = 'SLDSSplitViewHeader';\nexport const SPLIT_VIEW_LISTBOX = 'SLDSSplitViewListbox';\nexport const RADIO = 'SLDSRadio';\nexport const RADIO_GROUP = 'SLDSRadioGroup';\nexport const RADIO_BUTTON_GROUP = 'SLDSRadioButtonGroup';\nexport const TAB = 'SLDSTab';\nexport const TAB_ITEM = 'SLDSTabItem';\nexport const TAB_PANEL = 'SLDSTabPanel';\nexport const TABS = 'SLDSTabs';\nexport const TABS_LIST = 'SLDSTabsList';\nexport const TABS_PANEL = 'SLDSTabsPanel';\nexport const TIME_PICKER = 'SLDSTimepicker';\nexport const TOAST = 'SLDSToast';\nexport const TOAST_CONTAINER = 'SLDSToastContainer';\nexport const TREE = 'SLDSTree';\nexport const TREE_BRANCH = 'SLDSTreeBranch';\nexport const TREE_ITEM = 'SLDSTreeItem';\nexport const TRIAL_BAR = 'SLDSTrialBar';\nexport const TRIAL_BAR_DROPDOWN = 'SLDSTrialBarDropdown';\nexport const TRIAL_BAR_BUTTON = 'SLDSTrialBarButton';\nexport const VERTICAL_NAVIGATION = 'SLDSVerticalNavigation';\nexport const VERTICAL_NAVIGATION_ITEM = 'SLDSVerticalNavigationItem';\nexport const VISUAL_PICKER = 'SLDSVisualPicker';\nexport const VISUAL_PICKER_LINK = 'SLDSVisualPickerLink';\nexport const WELCOME_MAT = 'SLDSWelcomeMat';\nexport const WELCOME_MAT_TILE = 'SLDSWelcomeMatTile';\nexport const WELCOME_MAT_BADGE = 'SLDSWelcomeMatBadge';\nexport const DOCKED_COMPOSER = 'SLDSDockedComposer';\n"],"mappings":"AACA,IAAa,EAAY,gBACZ,EAAkB,qBAClB,EAAQ,YACR,EAAkB,qBASlB,EAAS,aACT,EAAQ,YAOR,EAAa,iBACb,EAAiB,oBACjB,EAAsB,wBACtB,EAA2B,6BAC3B,EAAqB,uBACrB,EAA8B,+BAC9B,EAA0B,2BAC1B,EAAyB,2BACzB,EAAS,aACT,EAAe,kBACf,EAAkB,qBAClB,EAAc,iBACd,EAAO,WACP,EAAY,eACZ,EAAa,gBACb,EAAc,iBACd,EAAc,iBACd,EAAc,iBACd,EAAW,eACX,EAAsB,yBACtB,EAAgB,mBAChB,EAAsB,yBACtB,EAA2B,6BAC3B,EAAe,kBACf,EAAW,eACX,EAAoB,sBACpB,EAAyB,0BACzB,EAA2B,4BAC3B,EAAyB,0BACzB,EAAgC,gCAChC,EAAgC,gCAChC,EAAwB,yBACxB,EAAc,iBAEd,EAAe,kBACf,EAAS,aACT,EAAQ,YACR,EAAa,gBACb,EAAa,gBACb,EAAe,kBACf,EAAgB,mBAChB,EAAqB,wBAKrB,EAAS,aACT,EAAW,eACX,EAAoB,iBACpB,EAAQ,YACR,EAAW,eACX,EAAS,aAqBT,EAAc,kBACd,GAAO,WACP,GAAgB,mBAChB,GAAa,gBACb,GAAe,mBACf,GAAO,WACP,GAAY,eACZ,GAAkB,oBAGlB,GAAS,aACT,GAAe,kBACf,GAAgB,mBAChB,GAAwB,0BAExB,GAAQ,YAER,GAAQ,YACR,GAAqB,kBACrB,GAAoB,iBACpB,GAA4B,6BAC5B,GAAc,iBACd,GAAsB,wBACtB,GAAO,WACP,GAAiB,oBACjB,GAAkB,qBAClB,GAAU,cACV,GAAsB,wBACtB,GAAkB,qBAClB,GAAqB,wBACrB,GAA8B,gCAC9B,GAA0B,4BAC1B,GACZ,oCACY,GAAgB,mBAChB,GAAe,kBACf,GAAkB,qBAClB,GAAuB,yBACvB,GAAsB,yBACtB,GAAS,aACT,GAAU,cACV,GAAa,gBACb,GAAoB,sBACpB,GAAqB,uBACrB,GAAQ,YACR,GAAc,iBACd,GAAqB,uBACrB,GAAM,UAEN,GAAY,eACZ,GAAO,WACP,GAAY,eACZ,GAAa,gBACb,GAAc,iBACd,GAAQ,YACR,GAAkB,qBAClB,GAAO,WACP,GAAc,iBACd,GAAY,eACZ,GAAY,eACZ,GAAqB,uBACrB,GAAmB,qBACnB,GAAsB,yBACtB,GAA2B,6BAC3B,GAAgB,mBAChB,GAAqB,uBACrB,GAAc,iBACd,GAAmB,qBACnB,GAAoB"}
1
+ {"version":3,"file":"constants.cjs","names":[],"sources":["../../../utilities/constants.js"],"sourcesContent":["// ## Components\nexport const ACCORDION = 'SLDSAccordion';\nexport const ACCORDION_PANEL = 'SLDSAccordionPanel';\nexport const ALERT = 'SLDSAlert';\nexport const ALERT_CONTAINER = 'SLDSAlertContainer';\nexport const APP_LAUNCHER = 'SLDSAppLauncher';\nexport const APP_LAUNCHER_EXPANDABLE_SECTION =\n\t'SLDSAppLauncherExpandableSection';\n/* Remove at next breaking change */\nexport const APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection';\nexport const APP_LAUNCHER_LINK = 'SLDSAppLauncherLink';\nexport const APP_LAUNCHER_TILE = 'SLDSAppLauncherTile';\nexport const APP_LAUNCHER_HEADER = 'SLDSAppLauncherHeader';\nexport const AVATAR = 'SLDSAvatar';\nexport const BADGE = 'SLDSBadge';\n\nexport const BRAND_BAND = 'SLDSBrandBand';\n\n/* Remove at next breaking change */\nexport const BREAD_CRUMB = 'SLDSBreadcrumb';\n\nexport const BREADCRUMB = 'SLDSBreadcrumb';\nexport const BUILDER_HEADER = 'SLDSBuilderHeader';\nexport const BUILDER_HEADER_MISC = 'SLDSBuilderHeaderMisc';\nexport const BUILDER_HEADER_UTILITIES = 'SLDSBuilderHeaderUtilities';\nexport const BUILDER_HEADER_NAV = 'SLDSBuilderHeaderNav';\nexport const BUILDER_HEADER_NAV_DROPDOWN = 'SLDSBuilderHeaderNavDropdown';\nexport const BUILDER_HEADER_NAV_LINK = 'SLDSBuilderHeaderNavLink';\nexport const BUILDER_HEADER_TOOLBAR = 'SLDSBuilderHeaderToolbar';\nexport const BUTTON = 'SLDSButton';\nexport const BUTTON_GROUP = 'SLDSButtonGroup';\nexport const BUTTON_STATEFUL = 'SLDSButtonStateful';\nexport const BUTTON_ICON = 'SLDSButtonIcon'; // a non-interctive icon wrapper for SLDSUtilityIcon\nexport const CARD = 'SLDSCard';\nexport const CARD_BODY = 'SLDSCardBody';\nexport const CARD_EMPTY = 'SLDSCardEmpty';\nexport const CARD_FILTER = 'SLDSCardFilter';\nexport const CARD_FOOTER = 'SLDSCardFooter';\nexport const CARD_HEADER = 'SLDSCardHeader';\nexport const CAROUSEL = 'SLDSCarousel';\nexport const CAROUSEL_INDICATORS = 'SLDSCarouselIndicators';\nexport const CAROUSEL_ITEM = 'SLDSCarouselItem';\nexport const CAROUSEL_NAVIGATORS = 'SLDSCarouselNavigators';\nexport const CAROUSEL_AUTOPLAY_BUTTON = 'SLDSCarouselAutoplayButton';\nexport const COLOR_PICKER = 'SLDSColorPicker';\nexport const COMBOBOX = 'SLDSCombobox';\nexport const SIMPLE_DATA_TABLE = 'SLDSSimpleDataTable';\nexport const SIMPLE_DATA_TABLE_CELL = 'SLDSSimpleDataTableCell';\nexport const SIMPLE_DATA_TABLE_COLUMN = 'SLDSSimpleDataTableColumn';\nexport const SIMPLE_DATA_TABLE_HEAD = 'SLDSSimpleDataTableHead';\nexport const SIMPLE_DATA_TABLE_HEADER_CELL = 'SLDSSimpleDataTableHeaderCell';\nexport const SIMPLE_DATA_TABLE_ROW_ACTIONS = 'SLDSSimpleDataTableRowActions';\nexport const SIMPLE_DATA_TABLE_ROW = 'SLDSSimpleDataTableRow';\nexport const DATE_PICKER = 'SLDSDatePicker';\nexport const DEPRECATED_WARNING = 'SLDSDeprecatedWarning';\nexport const DYNAMIC_ICON = 'SLDSDynamicIcon';\nexport const DIALOG = 'SLDSDialog';\nexport const FILES = 'SLDSFiles';\nexport const FILES_FILE = `SLDSFilesFile`;\nexport const FILES_MORE = `SLDSFilesMore`;\nexport const FILES_FIGURE = 'SLDSFilesFigure';\nexport const FILES_ACTIONS = 'SLDSFilesActions';\nexport const EXPANDABLE_SECTION = 'SLDSExpandableSection';\nexport const EXPRESSION = 'SLDSExpression';\nexport const EXPRESSION_GROUP = 'SLDSExpressionGroup';\nexport const EXPRESSION_CONDITION = 'SLDSExpressionCondition';\nexport const EXPRESSION_FORMULA = 'SLDSExpressionFormula';\nexport const FILTER = 'SLDSFilter';\nexport const CHECKBOX = 'SLDSCheckbox';\nexport const INPUT = 'SLDSInput';\nexport const TEXTAREA = 'SLDSTextarea';\nexport const SEARCH = 'SLDSSearch';\nexport const GLOBAL_HEADER = 'SLDSGlobalHeader';\nexport const GLOBAL_HEADER_BUTTON = 'SLDSGlobalHeaderButton';\nexport const GLOBAL_HEADER_DROPDOWN = 'SLDSGlobalHeaderDropdown';\nexport const GLOBAL_HEADER_FAVORITES = 'SLDSGlobalHeaderFavorites';\nexport const GLOBAL_HEADER_HELP = 'SLDSGlobalHeaderHelp';\nexport const GLOBAL_HEADER_NOTIFICATIONS = 'SLDSGlobalHeaderNotifications';\nexport const GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';\nexport const GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';\nexport const GLOBAL_HEADER_SETUP = 'SLDSGlobalHeaderSetup';\nexport const GLOBAL_HEADER_TASK = 'SLDSGlobalHeaderTask';\nexport const GLOBAL_HEADER_TOOL = 'SLDSGlobalHeaderTool';\nexport const GLOBAL_NAVIGATION_BAR = 'SLDSGlobalNavigationBar';\nexport const GLOBAL_NAVIGATION_BAR_BUTTON = 'SLDSGlobalNavigationBarButton';\nexport const GLOBAL_NAVIGATION_BAR_DROPDOWN = 'SLDSGlobalNavigationBarDropdown';\nexport const GLOBAL_NAVIGATION_BAR_LABEL = 'SLDSGlobalNavigationBarLabel';\nexport const GLOBAL_NAVIGATION_BAR_LINK = 'SLDSGlobalNavigationBarLink';\nexport const GLOBAL_NAVIGATION_BAR_REGION = 'SLDSGlobalNavigationBarRegion';\nexport const GLOBAL_NAVIGATION_BAR_APP_LAUNCHER =\n\t'SLDSGlobalNavigationBarAppLauncher';\nexport const GRID = 'SLDSGrid';\nexport const HIGHLIGHTER = 'SLDSHighlighter';\nexport const ICON = 'SLDSIcon';\nexport const ICON_SETTINGS = 'SLDSIconSettings';\nexport const ICON_INPUT = 'SLDSIconInput';\nexport const ILLUSTRATION = 'SLDSIllustration';\nexport const LIST = 'SLDSList';\nexport const LIST_ITEM = 'SLDSListItem';\nexport const LIST_ITEM_LABEL = 'SLDSListItemLabel';\nexport const LISTBOX_OF_PILL_OPTIONS = 'SLDSListboxOfPillOptions';\nexport const LOCATION_MAP = 'SLDSLocationMap';\nexport const LOOKUP = 'SLDSLookup';\nexport const MEDIA_OBJECT = 'SLDSMediaObject';\nexport const MENU_DROPDOWN = 'SLDSMenuDropdown';\nexport const MENU_DROPDOWN_TRIGGER = 'SLDSMenuDropdownTrigger';\nexport const MENU_PICKLIST = 'SLDSMenuPicklist';\nexport const MODAL = 'SLDSModal';\nexport const NOTIFICATION = 'SLDSNotification';\nexport const PANEL = 'SLDSPanel';\nexport const PANEL_FILTER_GROUP = 'SLDSFilterGroup';\nexport const PANEL_FILTER_LIST = 'SLDSFilterList';\nexport const PANEL_FILTER_LIST_HEADING = 'SLDSPanelFilterListHeading';\nexport const PAGE_HEADER = 'SLDSPageHeader';\nexport const PAGE_HEADER_CONTROL = 'SLDSPageHeaderControl';\nexport const PILL = 'SLDSPill';\nexport const PILL_CONTAINER = 'SLDSPillContainer';\nexport const PORTAL_SETTINGS = 'SLDSPortalSettings';\nexport const POPOVER = 'SLDSPopover';\nexport const POPOVER_EDIT_DIALOG = 'SLDSPopoverEditDialog';\nexport const POPOVER_TOOLTIP = 'SLDSPopoverTooltip';\nexport const PROGRESS_INDICATOR = 'SLDSProgressIndicator';\nexport const PROGRESS_INDICATOR_PATH = 'SLDSProgressIndicatorPath';\nexport const PROGRESS_INDICATOR_PROGRESS = 'SLDSProgressIndicatorProgress';\nexport const PROGRESS_INDICATOR_STEP = 'SLDSProgressIndicatorStep';\nexport const PROGRESS_INDICATOR_STEP_VERTICAL =\n\t'SLDSProgressIndicatorStepVertical';\nexport const PROGRESS_RING = 'SLDSProgressRing';\nexport const PROGRESS_BAR = 'SLDSProgressBar';\nexport const SETUP_ASSISTANT = 'SLDSSetupAssistant';\nexport const SETUP_ASSISTANT_STEP = 'SLDSSetupAssistantStep';\nexport const SCOPED_NOTIFICATION = 'SLDSScopedNotification';\nexport const SLIDER = 'SLDSSlider';\nexport const SPINNER = 'SLDSSpinner';\nexport const SPLIT_VIEW = 'SLDSSplitView';\nexport const SPLIT_VIEW_HEADER = 'SLDSSplitViewHeader';\nexport const SPLIT_VIEW_LISTBOX = 'SLDSSplitViewListbox';\nexport const RADIO = 'SLDSRadio';\nexport const RADIO_GROUP = 'SLDSRadioGroup';\nexport const RADIO_BUTTON_GROUP = 'SLDSRadioButtonGroup';\nexport const TAB = 'SLDSTab';\nexport const TAB_ITEM = 'SLDSTabItem';\nexport const TAB_PANEL = 'SLDSTabPanel';\nexport const TABS = 'SLDSTabs';\nexport const TABS_LIST = 'SLDSTabsList';\nexport const TABS_PANEL = 'SLDSTabsPanel';\nexport const TIME_PICKER = 'SLDSTimepicker';\nexport const TOAST = 'SLDSToast';\nexport const TOAST_CONTAINER = 'SLDSToastContainer';\nexport const TREE = 'SLDSTree';\nexport const TREE_BRANCH = 'SLDSTreeBranch';\nexport const TREE_ITEM = 'SLDSTreeItem';\nexport const TRIAL_BAR = 'SLDSTrialBar';\nexport const TRIAL_BAR_DROPDOWN = 'SLDSTrialBarDropdown';\nexport const TRIAL_BAR_BUTTON = 'SLDSTrialBarButton';\nexport const VERTICAL_NAVIGATION = 'SLDSVerticalNavigation';\nexport const VERTICAL_NAVIGATION_ITEM = 'SLDSVerticalNavigationItem';\nexport const VISUAL_PICKER = 'SLDSVisualPicker';\nexport const VISUAL_PICKER_LINK = 'SLDSVisualPickerLink';\nexport const WELCOME_MAT = 'SLDSWelcomeMat';\nexport const WELCOME_MAT_TILE = 'SLDSWelcomeMatTile';\nexport const WELCOME_MAT_BADGE = 'SLDSWelcomeMatBadge';\nexport const DOCKED_COMPOSER = 'SLDSDockedComposer';\n"],"mappings":"AACA,IAAa,EAAY,gBACZ,EAAkB,qBAClB,EAAQ,YACR,EAAkB,qBASlB,EAAS,aACT,EAAQ,YAOR,EAAa,iBACb,EAAiB,oBACjB,EAAsB,wBACtB,EAA2B,6BAC3B,EAAqB,uBACrB,EAA8B,+BAC9B,EAA0B,2BAC1B,EAAyB,2BACzB,EAAS,aACT,EAAe,kBACf,EAAkB,qBAClB,EAAc,iBACd,EAAO,WACP,EAAY,eACZ,EAAa,gBACb,EAAc,iBACd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@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./use-click-outside.cjs");exports.useClickOutside=e.default;