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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/dist/cjs/components/avatar/index.cjs +1 -1
  2. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  3. package/dist/cjs/components/breadcrumb/index.cjs +1 -1
  4. package/dist/cjs/components/breadcrumb/index.cjs.map +1 -1
  5. package/dist/cjs/components/button/index.cjs +1 -1
  6. package/dist/cjs/components/button/index.cjs.map +1 -1
  7. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  8. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  9. package/dist/cjs/components/carousel/index.cjs +1 -1
  10. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  11. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  12. package/dist/cjs/components/checkbox/index.cjs +1 -1
  13. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  14. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  15. package/dist/cjs/components/combobox/add-subheadings.cjs +1 -1
  16. package/dist/cjs/components/combobox/add-subheadings.cjs.map +1 -1
  17. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  18. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  19. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  20. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  21. package/dist/cjs/components/combobox/filter.cjs +1 -1
  22. package/dist/cjs/components/combobox/filter.cjs.map +1 -1
  23. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  24. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  25. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  26. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  27. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  28. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  29. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  30. package/dist/cjs/components/index.cjs +1 -1
  31. package/dist/cjs/components/input/check-props.cjs +1 -1
  32. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  33. package/dist/cjs/components/input/search.cjs +1 -1
  34. package/dist/cjs/components/input/search.cjs.map +1 -1
  35. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  36. package/dist/cjs/components/menu-dropdown/check-props.cjs +1 -1
  37. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  38. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  39. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  40. package/dist/cjs/components/modal/index.cjs +1 -1
  41. package/dist/cjs/components/modal/index.cjs.map +1 -1
  42. package/dist/cjs/components/pill-container/check-props.cjs +2 -0
  43. package/dist/cjs/components/pill-container/check-props.cjs.map +1 -0
  44. package/dist/cjs/components/pill-container/component.cjs +2 -0
  45. package/dist/cjs/components/pill-container/component.cjs.map +1 -0
  46. package/dist/cjs/components/pill-container/index.cjs +1 -1
  47. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  48. package/dist/cjs/components/popover/index.cjs.map +1 -1
  49. package/dist/cjs/components/popover/popover.cjs +1 -1
  50. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  51. package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
  52. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  53. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  54. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  55. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  56. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  57. package/dist/cjs/components/spinner/index.cjs +1 -1
  58. package/dist/cjs/components/spinner/index.cjs.map +1 -1
  59. package/dist/cjs/components/split-view/check-props.cjs +2 -0
  60. package/dist/cjs/components/split-view/check-props.cjs.map +1 -0
  61. package/dist/cjs/components/split-view/component.cjs +2 -0
  62. package/dist/cjs/components/split-view/component.cjs.map +1 -0
  63. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  64. package/dist/cjs/components/split-view/index.cjs +1 -1
  65. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  66. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  67. package/dist/cjs/components/tabs/index.cjs +1 -1
  68. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  69. package/dist/cjs/components/textarea/check-props.cjs +2 -0
  70. package/dist/cjs/components/textarea/check-props.cjs.map +1 -0
  71. package/dist/cjs/components/textarea/component.cjs +2 -0
  72. package/dist/cjs/components/textarea/component.cjs.map +1 -0
  73. package/dist/cjs/components/textarea/index.cjs +1 -1
  74. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  75. package/dist/cjs/components/toast/index.cjs +1 -1
  76. package/dist/cjs/components/toast/index.cjs.map +1 -1
  77. package/dist/cjs/components/tooltip/check-props.cjs +1 -1
  78. package/dist/cjs/components/tooltip/check-props.cjs.map +1 -1
  79. package/dist/cjs/components/tooltip/index.cjs +2 -2
  80. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  81. package/dist/cjs/components/tree/check-props.cjs +1 -1
  82. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  83. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  84. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  85. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  86. package/dist/cjs/components/tree/private/render-initial-branch.cjs +1 -1
  87. package/dist/cjs/components/tree/private/render-initial-branch.cjs.map +1 -1
  88. package/dist/cjs/components/tree/tree.cjs +1 -1
  89. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  90. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  91. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  92. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  93. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  94. package/dist/cjs/components/vertical-navigation/private/item.cjs.map +1 -1
  95. package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
  96. package/dist/cjs/utilities/constants.cjs +1 -1
  97. package/dist/cjs/utilities/constants.cjs.map +1 -1
  98. package/dist/es/components/avatar/index.js +1 -1
  99. package/dist/es/components/avatar/index.js.map +1 -1
  100. package/dist/es/components/breadcrumb/index.js +1 -1
  101. package/dist/es/components/breadcrumb/index.js.map +1 -1
  102. package/dist/es/components/button/index.js +1 -1
  103. package/dist/es/components/button/index.js.map +1 -1
  104. package/dist/es/components/button-stateful/index.js +1 -1
  105. package/dist/es/components/button-stateful/index.js.map +1 -1
  106. package/dist/es/components/carousel/index.js +8 -12
  107. package/dist/es/components/carousel/index.js.map +1 -1
  108. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  109. package/dist/es/components/checkbox/index.js +17 -17
  110. package/dist/es/components/checkbox/index.js.map +1 -1
  111. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  112. package/dist/es/components/combobox/add-subheadings.js +2 -1
  113. package/dist/es/components/combobox/add-subheadings.js.map +1 -1
  114. package/dist/es/components/combobox/check-props.js +15 -5
  115. package/dist/es/components/combobox/check-props.js.map +1 -1
  116. package/dist/es/components/combobox/combobox.js +193 -186
  117. package/dist/es/components/combobox/combobox.js.map +1 -1
  118. package/dist/es/components/combobox/filter.js +1 -1
  119. package/dist/es/components/combobox/filter.js.map +1 -1
  120. package/dist/es/components/combobox/index.js.map +1 -1
  121. package/dist/es/components/combobox/private/menu.js +2 -0
  122. package/dist/es/components/combobox/private/menu.js.map +1 -1
  123. package/dist/es/components/date-picker/check-props.js +4 -4
  124. package/dist/es/components/date-picker/date-picker.js +149 -142
  125. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  126. package/dist/es/components/date-picker/index.js.map +1 -1
  127. package/dist/es/components/index.js +41 -43
  128. package/dist/es/components/input/check-props.js +17 -18
  129. package/dist/es/components/input/check-props.js.map +1 -1
  130. package/dist/es/components/input/search.js +1 -1
  131. package/dist/es/components/input/search.js.map +1 -1
  132. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  133. package/dist/es/components/menu-dropdown/check-props.js +6 -6
  134. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  135. package/dist/es/components/menu-dropdown/menu-dropdown.js +247 -250
  136. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  137. package/dist/es/components/modal/index.js +104 -132
  138. package/dist/es/components/modal/index.js.map +1 -1
  139. package/dist/es/components/pill-container/check-props.js +13 -0
  140. package/dist/es/components/pill-container/check-props.js.map +1 -0
  141. package/dist/es/components/pill-container/component.js +31 -0
  142. package/dist/es/components/pill-container/component.js.map +1 -0
  143. package/dist/es/components/pill-container/index.js +65 -56
  144. package/dist/es/components/pill-container/index.js.map +1 -1
  145. package/dist/es/components/popover/index.js.map +1 -1
  146. package/dist/es/components/popover/popover.js +63 -62
  147. package/dist/es/components/popover/popover.js.map +1 -1
  148. package/dist/es/components/setup-assistant/index.js.map +1 -1
  149. package/dist/es/components/setup-assistant/step.js +1 -1
  150. package/dist/es/components/setup-assistant/step.js.map +1 -1
  151. package/dist/es/components/simple-data-table/check-props.js +4 -4
  152. package/dist/es/components/simple-data-table/row-actions.js +2 -2
  153. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  154. package/dist/es/components/spinner/index.js +1 -1
  155. package/dist/es/components/spinner/index.js.map +1 -1
  156. package/dist/es/components/split-view/check-props.js +13 -0
  157. package/dist/es/components/split-view/check-props.js.map +1 -0
  158. package/dist/es/components/split-view/component.js +46 -0
  159. package/dist/es/components/split-view/component.js.map +1 -0
  160. package/dist/es/components/split-view/header.js.map +1 -1
  161. package/dist/es/components/split-view/index.js +40 -34
  162. package/dist/es/components/split-view/index.js.map +1 -1
  163. package/dist/es/components/split-view/listbox.js.map +1 -1
  164. package/dist/es/components/tabs/index.js +64 -64
  165. package/dist/es/components/tabs/index.js.map +1 -1
  166. package/dist/es/components/textarea/check-props.js +17 -0
  167. package/dist/es/components/textarea/check-props.js.map +1 -0
  168. package/dist/es/components/textarea/component.js +27 -0
  169. package/dist/es/components/textarea/component.js.map +1 -0
  170. package/dist/es/components/textarea/index.js +50 -46
  171. package/dist/es/components/textarea/index.js.map +1 -1
  172. package/dist/es/components/toast/index.js +18 -12
  173. package/dist/es/components/toast/index.js.map +1 -1
  174. package/dist/es/components/tooltip/check-props.js +9 -23
  175. package/dist/es/components/tooltip/check-props.js.map +1 -1
  176. package/dist/es/components/tooltip/index.js +70 -70
  177. package/dist/es/components/tooltip/index.js.map +1 -1
  178. package/dist/es/components/tree/check-props.js +6 -6
  179. package/dist/es/components/tree/check-props.js.map +1 -1
  180. package/dist/es/components/tree/private/branch.js.map +1 -1
  181. package/dist/es/components/tree/private/item.js.map +1 -1
  182. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  183. package/dist/es/components/tree/private/render-initial-branch.js +5 -2
  184. package/dist/es/components/tree/private/render-initial-branch.js.map +1 -1
  185. package/dist/es/components/tree/tree.js +60 -35
  186. package/dist/es/components/tree/tree.js.map +1 -1
  187. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  188. package/dist/es/components/utilities/menu-list/item.js +1 -1
  189. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  190. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  191. package/dist/es/components/vertical-navigation/private/item.js.map +1 -1
  192. package/dist/es/components/welcome-mat/index.js.map +1 -1
  193. package/dist/es/utilities/constants.js +2 -2
  194. package/dist/es/utilities/constants.js.map +1 -1
  195. package/dist/types/components/avatar/index.d.ts +1 -1
  196. package/dist/types/components/avatar/index.d.ts.map +1 -1
  197. package/dist/types/components/breadcrumb/index.d.ts +1 -1
  198. package/dist/types/components/breadcrumb/index.d.ts.map +1 -1
  199. package/dist/types/components/button/check-props.d.ts.map +1 -1
  200. package/dist/types/components/button/index.d.ts +1 -1
  201. package/dist/types/components/button/index.d.ts.map +1 -1
  202. package/dist/types/components/button-stateful/index.d.ts +1 -1
  203. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  204. package/dist/types/components/carousel/index.d.ts +34 -7
  205. package/dist/types/components/carousel/index.d.ts.map +1 -1
  206. package/dist/types/components/carousel/private/carousel-item.d.ts +3 -3
  207. package/dist/types/components/carousel/private/carousel-item.d.ts.map +1 -1
  208. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  209. package/dist/types/components/checkbox/index.d.ts +1 -6
  210. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  211. package/dist/types/components/color-picker/color-picker.d.ts +25 -7
  212. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  213. package/dist/types/components/color-picker/index.d.ts +1 -1
  214. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  215. package/dist/types/components/combobox/add-subheadings.d.ts +1 -1
  216. package/dist/types/components/combobox/add-subheadings.d.ts.map +1 -1
  217. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  218. package/dist/types/components/combobox/combobox.d.ts +57 -24
  219. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  220. package/dist/types/components/combobox/filter.d.ts.map +1 -1
  221. package/dist/types/components/combobox/index.d.ts +2 -2
  222. package/dist/types/components/combobox/index.d.ts.map +1 -1
  223. package/dist/types/components/combobox/private/menu.d.ts +65 -4
  224. package/dist/types/components/combobox/private/menu.d.ts.map +1 -1
  225. package/dist/types/components/date-picker/date-picker.d.ts +52 -6
  226. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  227. package/dist/types/components/date-picker/index.d.ts +1 -1
  228. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  229. package/dist/types/components/index.d.ts +0 -4
  230. package/dist/types/components/index.d.ts.map +1 -1
  231. package/dist/types/components/input/check-props.d.ts.map +1 -1
  232. package/dist/types/components/input/search.d.ts +1 -1
  233. package/dist/types/components/input/search.d.ts.map +1 -1
  234. package/dist/types/components/menu-dropdown/button-trigger.d.ts +1 -1
  235. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  236. package/dist/types/components/menu-dropdown/index.d.ts +2 -2
  237. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  238. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +95 -24
  239. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  240. package/dist/types/components/modal/index.d.ts +26 -3
  241. package/dist/types/components/modal/index.d.ts.map +1 -1
  242. package/dist/types/components/pill-container/check-props.d.ts.map +1 -0
  243. package/dist/types/components/pill-container/index.d.ts +24 -3
  244. package/dist/types/components/pill-container/index.d.ts.map +1 -1
  245. package/dist/types/components/popover/index.d.ts +1 -1
  246. package/dist/types/components/popover/index.d.ts.map +1 -1
  247. package/dist/types/components/popover/popover.d.ts +41 -12
  248. package/dist/types/components/popover/popover.d.ts.map +1 -1
  249. package/dist/types/components/setup-assistant/index.d.ts +7 -3
  250. package/dist/types/components/setup-assistant/index.d.ts.map +1 -1
  251. package/dist/types/components/setup-assistant/step.d.ts +7 -1
  252. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  253. package/dist/types/components/simple-data-table/row-actions.d.ts.map +1 -1
  254. package/dist/types/components/spinner/index.d.ts +1 -1
  255. package/dist/types/components/spinner/index.d.ts.map +1 -1
  256. package/dist/types/components/split-view/check-props.d.ts.map +1 -0
  257. package/dist/types/components/split-view/header.d.ts +3 -3
  258. package/dist/types/components/split-view/header.d.ts.map +1 -1
  259. package/dist/types/components/split-view/index.d.ts +25 -3
  260. package/dist/types/components/split-view/index.d.ts.map +1 -1
  261. package/dist/types/components/split-view/listbox.d.ts +27 -24
  262. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  263. package/dist/types/components/tabs/index.d.ts +16 -3
  264. package/dist/types/components/tabs/index.d.ts.map +1 -1
  265. package/dist/types/components/textarea/index.d.ts +2 -2
  266. package/dist/types/components/textarea/index.d.ts.map +1 -1
  267. package/dist/types/components/toast/index.d.ts +17 -2
  268. package/dist/types/components/toast/index.d.ts.map +1 -1
  269. package/dist/types/components/tooltip/check-props.d.ts.map +1 -1
  270. package/dist/types/components/tooltip/index.d.ts +1 -5
  271. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  272. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  273. package/dist/types/components/tree/index.d.ts +1 -1
  274. package/dist/types/components/tree/index.d.ts.map +1 -1
  275. package/dist/types/components/tree/private/branch.d.ts +2 -4
  276. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  277. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  278. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  279. package/dist/types/components/tree/private/render-initial-branch.d.ts +2 -3
  280. package/dist/types/components/tree/private/render-initial-branch.d.ts.map +1 -1
  281. package/dist/types/components/tree/tree.d.ts +27 -6
  282. package/dist/types/components/tree/tree.d.ts.map +1 -1
  283. package/dist/types/components/tree/types.d.ts +55 -8
  284. package/dist/types/components/tree/types.d.ts.map +1 -1
  285. package/dist/types/components/utilities/menu-list/index.d.ts +1 -1
  286. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  287. package/dist/types/components/utilities/menu-list/item.d.ts +1 -1
  288. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  289. package/dist/types/components/vertical-navigation/index.d.ts +7 -3
  290. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  291. package/dist/types/components/vertical-navigation/private/item.d.ts +1 -1
  292. package/dist/types/components/vertical-navigation/private/item.d.ts.map +1 -1
  293. package/dist/types/components/welcome-mat/index.d.ts +62 -13
  294. package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
  295. package/dist/types/utilities/constants.d.ts +0 -1
  296. package/dist/types/utilities/constants.d.ts.map +1 -1
  297. package/package.json +2 -2
  298. package/dist/cjs/components/forms/input/inline-check-props.cjs +0 -2
  299. package/dist/cjs/components/forms/input/inline-check-props.cjs.map +0 -1
  300. package/dist/cjs/components/forms/input/inline.cjs +0 -2
  301. package/dist/cjs/components/forms/input/inline.cjs.map +0 -1
  302. package/dist/cjs/components/modal/check-props.cjs +0 -2
  303. package/dist/cjs/components/modal/check-props.cjs.map +0 -1
  304. package/dist/cjs/components/modal/component.cjs +0 -2
  305. package/dist/cjs/components/modal/component.cjs.map +0 -1
  306. package/dist/cjs/components/modal/trigger.cjs +0 -2
  307. package/dist/cjs/components/modal/trigger.cjs.map +0 -1
  308. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +0 -2
  309. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +0 -1
  310. package/dist/es/components/forms/input/inline-check-props.js +0 -11
  311. package/dist/es/components/forms/input/inline-check-props.js.map +0 -1
  312. package/dist/es/components/forms/input/inline.js +0 -95
  313. package/dist/es/components/forms/input/inline.js.map +0 -1
  314. package/dist/es/components/modal/check-props.js +0 -13
  315. package/dist/es/components/modal/check-props.js.map +0 -1
  316. package/dist/es/components/modal/component.js +0 -35
  317. package/dist/es/components/modal/component.js.map +0 -1
  318. package/dist/es/components/modal/trigger.js +0 -22
  319. package/dist/es/components/modal/trigger.js.map +0 -1
  320. package/dist/es/utilities/warning/deprecated-property-value.js +0 -18
  321. package/dist/es/utilities/warning/deprecated-property-value.js.map +0 -1
  322. package/dist/types/components/avatar/check-props.d.ts.map +0 -1
  323. package/dist/types/components/breadcrumb/check-props.d.ts.map +0 -1
  324. package/dist/types/components/button-stateful/check-props.d.ts +0 -3
  325. package/dist/types/components/button-stateful/check-props.d.ts.map +0 -1
  326. package/dist/types/components/forms/checkbox/index.d.ts +0 -4
  327. package/dist/types/components/forms/checkbox/index.d.ts.map +0 -1
  328. package/dist/types/components/forms/checkbox.d.ts +0 -2
  329. package/dist/types/components/forms/input/inline-check-props.d.ts +0 -3
  330. package/dist/types/components/forms/input/inline-check-props.d.ts.map +0 -1
  331. package/dist/types/components/forms/input/inline.d.ts +0 -88
  332. package/dist/types/components/forms/input/inline.d.ts.map +0 -1
  333. package/dist/types/components/modal/check-props.d.ts +0 -3
  334. package/dist/types/components/modal/check-props.d.ts.map +0 -1
  335. package/dist/types/components/modal/trigger.d.ts +0 -14
  336. package/dist/types/components/modal/trigger.d.ts.map +0 -1
  337. package/dist/types/components/spinner/check-props.d.ts +0 -3
  338. package/dist/types/components/spinner/check-props.d.ts.map +0 -1
  339. package/dist/types/components/tabs/pane.d.ts +0 -3
  340. package/dist/types/components/tabs/pane.d.ts.map +0 -1
  341. package/dist/types/utilities/warning/deprecated-event-parameter.d.ts +0 -3
  342. package/dist/types/utilities/warning/deprecated-event-parameter.d.ts.map +0 -1
  343. /package/dist/types/components/{avatar → pill-container}/check-props.d.ts +0 -0
  344. /package/dist/types/components/{breadcrumb → split-view}/check-props.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/toast/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useState, useEffect, useRef, useCallback, type ReactNode, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport EventUtil from '../../utilities/event';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { TOAST } from '../../utilities/constants';\nimport DOMElementFocus from '../../utilities/dom-element-focus';\n\n/**\n * Toast variant types\n */\nexport type ToastVariant = 'error' | 'info' | 'success' | 'warning';\n\n/**\n * Assistive text for Toast\n */\nexport interface ToastAssistiveText {\n\t/** Close button assistive text */\n\tcloseButton?: ReactNode;\n\t/** Error variant label */\n\terror?: string;\n\t/** Info variant label */\n\tinfo?: string;\n\t/** Success variant label */\n\tsuccess?: string;\n\t/** Warning variant label */\n\twarning?: string;\n}\n\n/**\n * Labels for Toast\n */\nexport interface ToastLabels {\n\t/** Secondary text below heading */\n\tdetails?: ReactNode;\n\t/** Main heading content */\n\theading?: ReactNode;\n\t/** Link text in heading */\n\theadingLink?: ReactNode;\n}\n\n/**\n * Props for the Toast component\n */\nexport interface ToastProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ToastAssistiveText;\n\t/** CSS classes for the toast */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Auto-dismiss duration in milliseconds */\n\tduration?: number;\n\t/** Custom icon (defaults to variant-specific icon) */\n\ticon?: ReactNode;\n\t/** Text labels */\n\tlabels?: ToastLabels;\n\t/** Callback when heading link is clicked */\n\tonClickHeadingLink?: (event: React.MouseEvent) => void;\n\t/** Callback when close button is clicked or duration expires */\n\tonRequestClose?: () => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Toast type/severity */\n\tvariant: ToastVariant;\n}\n\nconst defaultAssistiveText: ToastAssistiveText = {\n\tcloseButton: 'Close',\n\terror: 'error',\n\tinfo: 'info',\n\tsuccess: 'success',\n\twarning: 'warning',\n};\n\nconst defaultLabels: ToastLabels = {};\n\nconst defaultIcons: Record<ToastVariant, ReactNode> = {\n\tinfo: <Icon category=\"utility\" name=\"info\" />,\n\tsuccess: <Icon category=\"utility\" name=\"success\" />,\n\twarning: <Icon category=\"utility\" name=\"warning\" />,\n\terror: <Icon category=\"utility\" name=\"error\" />,\n};\n\n/**\n * Toast serves as a feedback & confirmation mechanism after the user takes an action.\n */\nconst Toast = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tduration,\n\ticon: propIcon,\n\tlabels: propLabels,\n\tonClickHeadingLink,\n\tonRequestClose,\n\tstyle,\n\tvariant = 'info',\n}: ToastProps): React.ReactElement => {\n\tconst [isInitialRender, setIsInitialRender] = useState(true);\n\tconst toastRef = useRef<HTMLDivElement | null>(null);\n\tconst timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst clearTimeoutRef = useCallback(() => {\n\t\tif (timeoutRef.current) {\n\t\t\tclearTimeout(timeoutRef.current);\n\t\t\ttimeoutRef.current = null;\n\t\t}\n\t}, []);\n\n\tconst handleClose = useCallback(() => {\n\t\tclearTimeoutRef();\n\t\tonRequestClose?.();\n\t}, [clearTimeoutRef, onRequestClose]);\n\n\t// Set up auto-dismiss timer\n\tuseEffect(() => {\n\t\tif (duration) {\n\t\t\ttimeoutRef.current = setTimeout(handleClose, duration);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeoutRef();\n\t\t\tDOMElementFocus.returnFocusToStoredElement();\n\t\t};\n\t}, [duration, handleClose, clearTimeoutRef]);\n\n\t// Handle initial focus\n\tconst saveToastRef = useCallback((element: HTMLDivElement | null) => {\n\t\ttoastRef.current = element;\n\t\tif (isInitialRender && element) {\n\t\t\tDOMElementFocus.storeActiveElement();\n\t\t\telement.focus();\n\t\t\tsetIsInitialRender(false);\n\t\t}\n\t}, [isInitialRender]);\n\n\t// Get the icon to display\n\tconst icon = propIcon || defaultIcons[variant];\n\n\tconst clonedIcon = React.isValidElement(icon)\n\t\t? React.cloneElement(icon as React.ReactElement<{ containerClassName?: string; inverse?: boolean; size?: string }>, {\n\t\t\t\tcontainerClassName: 'slds-m-right_small slds-no-flex slds-align-top',\n\t\t\t\tinverse: true,\n\t\t\t\tsize: 'small',\n\t\t })\n\t\t: icon;\n\n\tconst assistiveTextVariant: Record<ToastVariant, string | undefined> = {\n\t\tinfo: assistiveText.info,\n\t\tsuccess: assistiveText.success,\n\t\twarning: assistiveText.warning,\n\t\terror: assistiveText.error,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-notify slds-notify_toast',\n\t\t\t\t{\n\t\t\t\t\t'slds-theme_info': variant === 'info',\n\t\t\t\t\t'slds-theme_success': variant === 'success',\n\t\t\t\t\t'slds-theme_warning': variant === 'warning',\n\t\t\t\t\t'slds-theme_error': variant === 'error',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tref={saveToastRef}\n\t\t\trole=\"status\"\n\t\t\tstyle={style}\n\t\t\ttabIndex={0}\n\t\t>\n\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t{assistiveTextVariant[variant]}\n\t\t\t</span>\n\t\t\t{clonedIcon}\n\t\t\t<div className=\"slds-notify__content\">\n\t\t\t\t<h2 className=\"slds-text-heading_small\">\n\t\t\t\t\t{labels.heading}{' '}\n\t\t\t\t\t{labels.headingLink && (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tonClick={EventUtil.trappedHandler(onClickHeadingLink)}\n\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{labels.headingLink}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t)}\n\t\t\t\t</h2>\n\t\t\t\t{labels.details && <p>{labels.details}</p>}\n\t\t\t</div>\n\t\t\t<Button\n\t\t\t\tassistiveText={{ icon: assistiveText.closeButton as string }}\n\t\t\t\tclassName=\"slds-notify__close\"\n\t\t\t\ticonCategory=\"utility\"\n\t\t\t\ticonName=\"close\"\n\t\t\t\ticonSize=\"medium\"\n\t\t\t\tinverse\n\t\t\t\tonClick={onRequestClose}\n\t\t\t\ttitle={assistiveText.closeButton as string}\n\t\t\t\tvariant=\"icon\"\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nToast.displayName = TOAST;\n\nexport default Toast;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":";;;;;;;;;AAoEA,IAAM,IAA2C;CAChD,aAAa;CACb,OAAO;CACP,MAAM;CACN,SAAS;CACT,SAAS;AACV,GAEM,IAA6B,CAAC,GAE9B,IAAgD;CACrD,MAAM,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAQ,CAAA;CAC5C,SAAS,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAW,CAAA;CAClD,SAAS,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAW,CAAA;CAClD,OAAO,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAS,CAAA;AAC/C,GAKM,KAAS,EACd,eAAe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D;IAAK,WAAU;IAAf,UAAA,CACC,kBAAC,MAAD;KAAI,WAAU;KAAd,UAAA;MACE,EAAO;MAAS;MAChB,EAAO,eACP,kBAAC,KAAD;OACC,SAAS,EAAU,eAAe,CAAkB;OACpD,MAAK;OAEJ,UAAA,EAAO;MACN,CAAA;KAED;IACH,CAAA,GAAA,EAAO,WAAW,kBAAC,KAAD,EAAA,UAAI,EAAO,QAAW,CAAA,CACrC;;GACL,kBAAC,GAAD;IACC,eAAe,EAAE,MAAM,EAAc,YAAsB;IAC3D,WAAU;IACV,cAAa;IACb,UAAS;IACT,UAAS;IACT,SAAA;IACA,SAAS;IACT,OAAO,EAAc;IACrB,SAAQ;GACR,CAAA;EACG;;AAEP;AAEA,EAAM,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/toast/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\ttype ReactNode,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from '../../utilities/class-names';\nimport EventUtil from '../../utilities/event';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { TOAST } from '../../utilities/constants';\nimport DOMElementFocus from '../../utilities/dom-element-focus';\n\n/**\n * Toast variant types\n */\nexport type ToastVariant = 'error' | 'info' | 'success' | 'warning';\n\n/**\n * Assistive text for Toast\n */\nexport interface ToastAssistiveText {\n\t/** Close button assistive text */\n\tcloseButton?: ReactNode;\n\t/** Error variant label */\n\terror?: string;\n\t/** Info variant label */\n\tinfo?: string;\n\t/** Success variant label */\n\tsuccess?: string;\n\t/** Warning variant label */\n\twarning?: string;\n}\n\n/**\n * Labels for Toast\n */\nexport interface ToastLabels {\n\t/** Secondary text below heading */\n\tdetails?: ReactNode;\n\t/** Main heading content */\n\theading?: ReactNode;\n\t/** Link text in heading */\n\theadingLink?: ReactNode;\n}\n\n/**\n * What caused a Toast close request\n */\nexport type ToastRequestCloseTrigger = 'timeout' | 'close-button';\n\n/**\n * Data passed to `onRequestClose`\n */\nexport interface ToastRequestCloseData {\n\t/** What caused the request: the close button was clicked, or `duration` elapsed */\n\ttrigger: ToastRequestCloseTrigger;\n}\n\n/**\n * Props for the Toast component\n */\nexport interface ToastProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ToastAssistiveText;\n\t/** CSS classes for the toast */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Auto-dismiss duration in milliseconds */\n\tduration?: number;\n\t/** Custom icon (defaults to variant-specific icon) */\n\ticon?: ReactNode;\n\t/** Text labels */\n\tlabels?: ToastLabels;\n\t/** Callback when heading link is clicked */\n\tonClickHeadingLink?: (event: React.MouseEvent) => void;\n\t/**\n\t * Callback when close button is clicked or duration expires. `event` is the close\n\t * button click, or `undefined` when the `duration` timer fires. `data.trigger` is\n\t * `'close-button'` or `'timeout'`.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.MouseEvent<HTMLButtonElement> | undefined,\n\t\tdata: ToastRequestCloseData\n\t) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Toast type/severity */\n\tvariant: ToastVariant;\n}\n\nconst defaultAssistiveText: ToastAssistiveText = {\n\tcloseButton: 'Close',\n\terror: 'error',\n\tinfo: 'info',\n\tsuccess: 'success',\n\twarning: 'warning',\n};\n\nconst defaultLabels: ToastLabels = {};\n\nconst defaultIcons: Record<ToastVariant, ReactNode> = {\n\tinfo: <Icon category=\"utility\" name=\"info\" />,\n\tsuccess: <Icon category=\"utility\" name=\"success\" />,\n\twarning: <Icon category=\"utility\" name=\"warning\" />,\n\terror: <Icon category=\"utility\" name=\"error\" />,\n};\n\n/**\n * Toast serves as a feedback & confirmation mechanism after the user takes an action.\n */\nconst Toast = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tduration,\n\ticon: propIcon,\n\tlabels: propLabels,\n\tonClickHeadingLink,\n\tonRequestClose,\n\tstyle,\n\tvariant = 'info',\n}: ToastProps): React.ReactElement => {\n\tconst [isInitialRender, setIsInitialRender] = useState(true);\n\tconst toastRef = useRef<HTMLDivElement | null>(null);\n\tconst timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst clearTimeoutRef = useCallback(() => {\n\t\tif (timeoutRef.current) {\n\t\t\tclearTimeout(timeoutRef.current);\n\t\t\ttimeoutRef.current = null;\n\t\t}\n\t}, []);\n\n\t// Keep the latest callback in a ref so a new (e.g. inline) `onRequestClose`\n\t// on each parent render does not restart the auto-dismiss timer.\n\tconst onRequestCloseRef = useRef(onRequestClose);\n\tuseEffect(() => {\n\t\tonRequestCloseRef.current = onRequestClose;\n\t}, [onRequestClose]);\n\n\tconst handleTimeout = useCallback(() => {\n\t\tclearTimeoutRef();\n\t\tonRequestCloseRef.current?.(undefined, { trigger: 'timeout' });\n\t}, [clearTimeoutRef]);\n\n\tconst handleCloseButtonClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonRequestClose?.(event, { trigger: 'close-button' });\n\t\t},\n\t\t[onRequestClose]\n\t);\n\n\t// Set up auto-dismiss timer\n\tuseEffect(() => {\n\t\tif (duration) {\n\t\t\ttimeoutRef.current = setTimeout(handleTimeout, duration);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeoutRef();\n\t\t\tDOMElementFocus.returnFocusToStoredElement();\n\t\t};\n\t}, [duration, handleTimeout, clearTimeoutRef]);\n\n\t// Handle initial focus\n\tconst saveToastRef = useCallback(\n\t\t(element: HTMLDivElement | null) => {\n\t\t\ttoastRef.current = element;\n\t\t\tif (isInitialRender && element) {\n\t\t\t\tDOMElementFocus.storeActiveElement();\n\t\t\t\telement.focus();\n\t\t\t\tsetIsInitialRender(false);\n\t\t\t}\n\t\t},\n\t\t[isInitialRender]\n\t);\n\n\t// Get the icon to display\n\tconst icon = propIcon || defaultIcons[variant];\n\n\tconst clonedIcon = React.isValidElement(icon)\n\t\t? React.cloneElement(\n\t\t\t\ticon as React.ReactElement<{\n\t\t\t\t\tcontainerClassName?: string;\n\t\t\t\t\tinverse?: boolean;\n\t\t\t\t\tsize?: string;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tcontainerClassName: 'slds-m-right_small slds-no-flex slds-align-top',\n\t\t\t\t\tinverse: true,\n\t\t\t\t\tsize: 'small',\n\t\t\t\t}\n\t\t\t)\n\t\t: icon;\n\n\tconst assistiveTextVariant: Record<ToastVariant, string | undefined> = {\n\t\tinfo: assistiveText.info,\n\t\tsuccess: assistiveText.success,\n\t\twarning: assistiveText.warning,\n\t\terror: assistiveText.error,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-notify slds-notify_toast',\n\t\t\t\t{\n\t\t\t\t\t'slds-theme_info': variant === 'info',\n\t\t\t\t\t'slds-theme_success': variant === 'success',\n\t\t\t\t\t'slds-theme_warning': variant === 'warning',\n\t\t\t\t\t'slds-theme_error': variant === 'error',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tref={saveToastRef}\n\t\t\trole=\"status\"\n\t\t\tstyle={style}\n\t\t\ttabIndex={0}\n\t\t>\n\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t{assistiveTextVariant[variant]}\n\t\t\t</span>\n\t\t\t{clonedIcon}\n\t\t\t<div className=\"slds-notify__content\">\n\t\t\t\t<h2 className=\"slds-text-heading_small\">\n\t\t\t\t\t{labels.heading}{' '}\n\t\t\t\t\t{labels.headingLink && (\n\t\t\t\t\t\t<a onClick={EventUtil.trappedHandler(onClickHeadingLink)} href=\"#\">\n\t\t\t\t\t\t\t{labels.headingLink}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t)}\n\t\t\t\t</h2>\n\t\t\t\t{labels.details && <p>{labels.details}</p>}\n\t\t\t</div>\n\t\t\t<Button\n\t\t\t\tassistiveText={{ icon: assistiveText.closeButton as string }}\n\t\t\t\tclassName=\"slds-notify__close\"\n\t\t\t\ticonCategory=\"utility\"\n\t\t\t\ticonName=\"close\"\n\t\t\t\ticonSize=\"medium\"\n\t\t\t\tinverse\n\t\t\t\tonClick={handleCloseButtonClick}\n\t\t\t\ttitle={assistiveText.closeButton as string}\n\t\t\t\tvariant=\"icon\"\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nToast.displayName = TOAST;\n\nexport default Toast;\n"],"mappings":";;;;;;;;;AA+FA,IAAM,IAA2C;CAChD,aAAa;CACb,OAAO;CACP,MAAM;CACN,SAAS;CACT,SAAS;AACV,GAEM,IAA6B,CAAC,GAE9B,IAAgD;CACrD,MAAM,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAQ,CAAA;CAC5C,SAAS,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAW,CAAA;CAClD,SAAS,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAW,CAAA;CAClD,OAAO,kBAAC,GAAD;EAAM,UAAS;EAAU,MAAK;CAAS,CAAA;AAC/C,GAKM,KAAS,EACd,eAAe,GACf,cACA,aACA,MAAM,GACN,QAAQ,GACR,uBACA,mBACA,UACA,aAAU,aAC2B;CACrC,IAAM,CAAC,GAAiB,KAAsB,EAAS,EAAI,GACrD,IAAW,EAA8B,IAAI,GAC7C,IAAa,EAA6C,IAAI,GAE9D,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAChE,IAAS;EAAE,GAAG;EAAe,GAAG;CAAW,GAE3C,IAAkB,QAAkB;EACzC,AAEC,EAAW,aADX,aAAa,EAAW,OAAO,GACV;CAEvB,GAAG,CAAC,CAAC,GAIC,IAAoB,EAAO,CAAc;CAC/C,QAAgB;EACf,EAAkB,UAAU;CAC7B,GAAG,CAAC,CAAc,CAAC;CAEnB,IAAM,IAAgB,QAAkB;EAEvC,AAD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AI,EAAO,QAAW,CAAA,CACrC;;GACL,kBAAC,GAAD;IACC,eAAe,EAAE,MAAM,EAAc,YAAsB;IAC3D,WAAU;IACV,cAAa;IACb,UAAS;IACT,UAAS;IACT,SAAA;IACA,SAAS;IACT,OAAO,EAAc;IACrB,SAAQ;GACR,CAAA;EACG;;AAEP;AAEA,EAAM,cAAc"}
@@ -1,28 +1,14 @@
1
- import e from "../../utilities/warning/deprecated-property.js";
2
- import t from "../../utilities/warning/deprecated-property-value.js";
3
- import n from "../../utilities/warning/is-trigger-tabbable.js";
4
- import r from "../../utilities/get-component-doc.js";
5
- import i from "react";
1
+ import e from "../../utilities/warning/is-trigger-tabbable.js";
2
+ import t from "../../utilities/get-component-doc.js";
3
+ import n from "react";
6
4
  //#region components/tooltip/check-props.js
7
- var a = function() {};
8
- process.env.NODE_ENV !== "production" && (a = function(a, o, s) {
9
- let c = r(s);
10
- o.variant === "base" && i.Children.count(o.children) !== 0 && n(a, o.children, c(), o.silenceTriggerTabbableWarning), t(a, {
11
- propAsString: "variant",
12
- propValue: o.variant,
13
- deprecatedPropValue: "info",
14
- replacementPropAsString: "theme",
15
- replacementPropAsValue: "info"
16
- }, c("theme")), t(a, {
17
- propAsString: "variant",
18
- propValue: o.variant,
19
- deprecatedPropValue: "error",
20
- replacementPropAsString: "theme",
21
- replacementPropAsValue: "error"
22
- }, c("theme")), e(a, o.openByDefault, "openByDefault", "isOpen", c("isOpen")), e(a, o.target, "target", void 0, `A new positioning library is being implmented under the hood. Please trigger tooltips to appear on their triggers with \`isOpen\` and not on other DOM elements. ${c("isOpen")}`), e(a, o.isInline, "isInline", "position=\"relative\"", c("position"));
5
+ var r = function() {};
6
+ process.env.NODE_ENV !== "production" && (r = function(r, i, a) {
7
+ let o = t(a);
8
+ i.variant === "base" && n.Children.count(i.children) !== 0 && e(r, i.children, o(), i.silenceTriggerTabbableWarning);
23
9
  });
24
- var o = a;
10
+ var i = r;
25
11
  //#endregion
26
- export { o as default };
12
+ export { i as default };
27
13
 
28
14
  //# sourceMappingURL=check-props.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tooltip/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport React from 'react';\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport deprecatedPropertyValue from '../../utilities/warning/deprecated-property-value';\nimport isTriggerTabbable from '../../utilities/warning/is-trigger-tabbable';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tif (\n\t\t\tprops.variant === 'base' &&\n\t\t\tReact.Children.count(props.children) !== 0\n\t\t) {\n\t\t\tisTriggerTabbable(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.children,\n\t\t\t\tcreateDocUrl(),\n\t\t\t\tprops.silenceTriggerTabbableWarning\n\t\t\t);\n\t\t}\n\n\t\t// Deprecated and changed to another property\n\t\tdeprecatedPropertyValue(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\tpropAsString: 'variant',\n\t\t\t\tpropValue: props.variant,\n\t\t\t\tdeprecatedPropValue: 'info',\n\t\t\t\treplacementPropAsString: 'theme',\n\t\t\t\treplacementPropAsValue: 'info',\n\t\t\t},\n\t\t\tcreateDocUrl('theme')\n\t\t);\n\t\tdeprecatedPropertyValue(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\tpropAsString: 'variant',\n\t\t\t\tpropValue: props.variant,\n\t\t\t\tdeprecatedPropValue: 'error',\n\t\t\t\treplacementPropAsString: 'theme',\n\t\t\t\treplacementPropAsValue: 'error',\n\t\t\t},\n\t\t\tcreateDocUrl('theme')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.openByDefault,\n\t\t\t'openByDefault',\n\t\t\t'isOpen',\n\t\t\tcreateDocUrl('isOpen')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.target,\n\t\t\t'target',\n\t\t\tundefined,\n\t\t\t`A new positioning library is being implmented under the hood. Please trigger tooltips to appear on their triggers with \\`isOpen\\` and not on other DOM elements. ${createDocUrl(\n\t\t\t\t'isOpen'\n\t\t\t)}` // eslint-disable-line max-len\n\t\t);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInline,\n\t\t\t'isInline',\n\t\t\t'position=\"relative\"',\n\t\t\tcreateDocUrl('position')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;;AAWA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAsD9C,AAnDC,EAAM,YAAY,UAClB,EAAM,SAAS,MAAM,EAAM,QAAQ,MAAM,KAEzC,EACC,GACA,EAAM,UACN,EAAa,GACb,EAAM,6BACP,GAID,EACC,GACA;EACC,cAAc;EACd,WAAW,EAAM;EACjB,qBAAqB;EACrB,yBAAyB;EACzB,wBAAwB;CACzB,GACA,EAAa,OAAO,CACrB,GACA,EACC,GACA;EACC,cAAc;EACd,WAAW,EAAM;EACjB,qBAAqB;EACrB,yBAAyB;EACzB,wBAAwB;CACzB,GACA,EAAa,OAAO,CACrB,GACA,EACC,GACA,EAAM,eACN,iBACA,UACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAM,QACN,UACA,KAAA,GACA,oKAAoK,EACnK,QACD,GACD,GAEA,EACC,GACA,EAAM,UACN,YACA,yBACA,EAAa,UAAU,CACxB;AACD;AAGD,IAAA,IAAe"}
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tooltip/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport React from 'react';\n\nimport isTriggerTabbable from '../../utilities/warning/is-trigger-tabbable';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tif (\n\t\t\tprops.variant === 'base' &&\n\t\t\tReact.Children.count(props.children) !== 0\n\t\t) {\n\t\t\tisTriggerTabbable(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.children,\n\t\t\t\tcreateDocUrl(),\n\t\t\t\tprops.silenceTriggerTabbableWarning\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AASA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAE9C,AACC,EAAM,YAAY,UAClB,EAAM,SAAS,MAAM,EAAM,QAAQ,MAAM,KAEzC,EACC,GACA,EAAM,UACN,EAAa,GACb,EAAM,6BACP;AAEF;AAGD,IAAA,IAAe"}
@@ -4,73 +4,73 @@ import n from "../../utilities/event.js";
4
4
  import r from "../../utilities/generate-id.js";
5
5
  import i from "../utilities/dialog/index.js";
6
6
  import a from "../icon/index.js";
7
- import o from "./check-props.js";
8
- import s from "./component.js";
9
- import ee from "../button/index.js";
10
- import c, { useCallback as l, useContext as te, useEffect as u, useRef as d, useState as f } from "react";
11
- import p from "classnames";
12
- import { Fragment as ne, jsx as m, jsxs as h } from "react/jsx-runtime";
7
+ import ee from "./check-props.js";
8
+ import o from "./component.js";
9
+ import te from "../button/index.js";
10
+ import s, { useCallback as c, useContext as ne, useEffect as l, useRef as u, useState as d } from "react";
11
+ import f from "classnames";
12
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
13
  //#region components/tooltip/index.tsx
14
14
  var g = {
15
15
  tooltipTipLearnMoreIcon: "this link",
16
16
  triggerLearnMoreIcon: "Help"
17
- }, re = {
17
+ }, _ = {
18
18
  learnMoreAfter: "to learn more.",
19
19
  learnMoreBefore: "Click"
20
- }, _ = ({ align: _ = "top", assistiveText: ie, children: v, content: y = /* @__PURE__ */ m("span", { children: "Tooltip" }), dialogClassName: b, hasAnchoredNubbin: x = !1, hasStaticAlignment: S = !1, hoverCloseDelay: C = 50, hoverOpenDelay: w = 0, iconVariant: T = "bare", id: E, labels: D, isOpen: O, onRequestTargetElement: k, onClickTrigger: A, triggerClassName: j, position: M = "absolute", triggerStyle: N, theme: P = "info", target: F, variant: I = "base" }) => {
20
+ }, v = ({ align: v = "top", assistiveText: y, children: b, content: x = /* @__PURE__ */ m("span", { children: "Tooltip" }), dialogClassName: S, hasAnchoredNubbin: C = !1, hasStaticAlignment: w = !1, hoverCloseDelay: T = 50, hoverOpenDelay: E = 0, iconVariant: D = "bare", id: O, labels: re, isOpen: k, onRequestTargetElement: A, onClickTrigger: j, triggerClassName: M, position: N = "absolute", triggerStyle: P, theme: F = "info", variant: I = "base" }) => {
21
21
  let L = {
22
22
  ...g,
23
- ...ie
23
+ ...y
24
24
  }, R = {
25
- ...re,
26
- ...D
27
- }, z = te(t), [B, V] = f(!1), [H, U] = f(!1), W = d(null), G = d(null), K = d(r()), q = d(!1);
28
- u(() => {
29
- o(e, {
30
- align: _,
25
+ ..._,
26
+ ...re
27
+ }, z = ne(t), [B, V] = d(!1), [H, U] = d(!1), W = u(null), G = u(null), K = u(r()), q = u(!1);
28
+ l(() => {
29
+ ee(e, {
30
+ align: v,
31
31
  assistiveText: L,
32
- children: v,
33
- content: y,
34
- dialogClassName: b,
35
- hasAnchoredNubbin: x,
36
- hasStaticAlignment: S,
37
- hoverCloseDelay: C,
38
- hoverOpenDelay: w,
39
- iconVariant: T,
40
- id: E,
32
+ children: b,
33
+ content: x,
34
+ dialogClassName: S,
35
+ hasAnchoredNubbin: C,
36
+ hasStaticAlignment: w,
37
+ hoverCloseDelay: T,
38
+ hoverOpenDelay: E,
39
+ iconVariant: D,
40
+ id: O,
41
41
  labels: R,
42
- isOpen: O,
43
- onRequestTargetElement: k,
44
- onClickTrigger: A,
45
- triggerClassName: j,
46
- position: M,
47
- triggerStyle: N,
48
- theme: P,
42
+ isOpen: k,
43
+ onRequestTargetElement: A,
44
+ onClickTrigger: j,
45
+ triggerClassName: M,
46
+ position: N,
47
+ triggerStyle: P,
48
+ theme: F,
49
49
  variant: I
50
- }, s);
51
- }, []), u(() => () => {
50
+ }, o);
51
+ }, []), l(() => () => {
52
52
  q.current = !0, G.current && clearTimeout(G.current);
53
53
  }, []);
54
- let J = l(() => E || K.current, [E]), Y = l(() => O === void 0 ? B : O, [O, B]), ae = l(() => k ? k() : F || W.current, [k, F]), X = l(() => {
54
+ let J = c(() => O || K.current, [O]), Y = c(() => k === void 0 ? B : k, [k, B]), ie = c(() => A ? A() : W.current, [A]), X = c(() => {
55
55
  G.current && clearTimeout(G.current), V(!1);
56
- }, []), Z = l(() => {
56
+ }, []), Z = c(() => {
57
57
  G.current && clearTimeout(G.current), G.current = setTimeout(() => {
58
58
  q.current || V(!0);
59
- }, w);
60
- }, [w]), Q = l((e) => {
59
+ }, E);
60
+ }, [E]), Q = c((e) => {
61
61
  e.stopPropagation(), G.current && clearTimeout(G.current), G.current = setTimeout(() => {
62
62
  let t = e.relatedTarget, n = t?.classList?.contains("slds-popover_tooltip") || t?.classList?.contains("slds-popover__body");
63
63
  !q.current && !n && V(!1);
64
- }, C);
65
- }, [C]), $ = l((e) => {
64
+ }, T);
65
+ }, [T]), $ = c((e) => {
66
66
  e.stopPropagation(), G.current = setTimeout(() => {
67
67
  !q.current && e.key === "Escape" && V(!1);
68
- }, C);
69
- }, [C]), oe = l((e) => {
68
+ }, T);
69
+ }, [T]), ae = c((e) => {
70
70
  e && W.current !== e && (W.current = e, H || U(!0));
71
- }, [H]), se = () => {
72
- if (!x) return null;
73
- let e = _.split(" ")[0], t = {
71
+ }, [H]), oe = () => {
72
+ if (!C) return null;
73
+ let e = v.split(" ")[0], t = {
74
74
  height: "0",
75
75
  position: "relative",
76
76
  width: "0"
@@ -97,17 +97,17 @@ var g = {
97
97
  break;
98
98
  default: t.left = `${r.width / 2}px`, t.top = "0", n.left = "-8px", n.top = "-19px";
99
99
  }
100
- return /* @__PURE__ */ h(ne, { children: [/* @__PURE__ */ m("style", { children: `#${J()}:after, #${J()}:before {
100
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("style", { children: `#${J()}:after, #${J()}:before {
101
101
  display: none;
102
102
  }` }), Y() ? /* @__PURE__ */ m("div", {
103
103
  style: t,
104
104
  children: /* @__PURE__ */ m("div", { style: n })
105
105
  }) : null] });
106
- }, ce = () => {
107
- let e, t = c.Children.count(v) === 0, r = T === "inverse", i = T === "error" || T === "warning" ? T : void 0;
108
- return e = t && A ? /* @__PURE__ */ m("a", {
106
+ }, se = () => {
107
+ let e, t = s.Children.count(b) === 0, r = D === "inverse", i = D === "error" || D === "warning" ? D : void 0;
108
+ return e = t && j ? /* @__PURE__ */ m("a", {
109
109
  href: "#",
110
- onClick: n.trappedHandler(A),
110
+ onClick: n.trappedHandler(j),
111
111
  children: /* @__PURE__ */ m(a, {
112
112
  category: "utility",
113
113
  colorVariant: i,
@@ -116,7 +116,7 @@ var g = {
116
116
  assistiveText: { label: L.triggerLearnMoreIcon },
117
117
  size: "x-small"
118
118
  })
119
- }) : t ? /* @__PURE__ */ m(ee, {
119
+ }) : t ? /* @__PURE__ */ m(te, {
120
120
  "aria-disabled": !0,
121
121
  assistiveText: { icon: L.triggerLearnMoreIcon },
122
122
  iconCategory: "utility",
@@ -125,7 +125,7 @@ var g = {
125
125
  iconVariant: r ? "bare" : void 0,
126
126
  inverse: r,
127
127
  variant: "icon"
128
- }) : v, c.Children.map(e, (e, t) => c.isValidElement(e) ? c.cloneElement(e, {
128
+ }) : b, s.Children.map(e, (e, t) => s.isValidElement(e) ? s.cloneElement(e, {
129
129
  key: t,
130
130
  "aria-describedby": Y() ? J() : void 0,
131
131
  onBlur: Q,
@@ -134,9 +134,9 @@ var g = {
134
134
  onMouseLeave: Q,
135
135
  onKeyDown: $
136
136
  }) : e);
137
- }, le = () => /* @__PURE__ */ h("div", {
138
- className: p("slds-popover__body", { "slds-text-color_inverse": P === "error" || I === "error" }),
139
- children: [y, I === "learnMore" && A ? /* @__PURE__ */ h("div", {
137
+ }, ce = () => /* @__PURE__ */ h("div", {
138
+ className: f("slds-popover__body", { "slds-text-color_inverse": F === "error" }),
139
+ children: [x, I === "learnMore" && j ? /* @__PURE__ */ h("div", {
140
140
  className: "slds-m-top_x-small",
141
141
  "aria-hidden": "true",
142
142
  children: [
@@ -154,38 +154,38 @@ var g = {
154
154
  " "
155
155
  ]
156
156
  }) : null]
157
- }), ue = () => Y() ? /* @__PURE__ */ m(i, {
157
+ }), le = () => Y() ? /* @__PURE__ */ m(i, {
158
158
  closeOnTabKey: !0,
159
159
  hasNubbin: !0,
160
- contentsClassName: p("slds-popover", "slds-popover_tooltip", { "slds-theme_error": P === "error" || I === "error" }, b),
161
- align: _,
160
+ contentsClassName: f("slds-popover", "slds-popover_tooltip", { "slds-theme_error": F === "error" }, S),
161
+ align: v,
162
162
  context: z,
163
- hasStaticAlignment: S,
163
+ hasStaticAlignment: w,
164
164
  onClose: X,
165
- onRequestTargetElement: ae,
165
+ onRequestTargetElement: ie,
166
166
  onMouseLeave: X,
167
- position: M,
167
+ position: N,
168
168
  variant: "tooltip",
169
169
  containerProps: { id: J() },
170
- children: le()
171
- }) : /* @__PURE__ */ m("span", {}), de = {
170
+ children: ce()
171
+ }) : /* @__PURE__ */ m("span", {}), ue = {
172
172
  display: "inline-block",
173
173
  lineHeight: "1",
174
- ...N
174
+ ...P
175
175
  };
176
176
  return /* @__PURE__ */ h("div", {
177
- className: p("slds-tooltip-trigger", j),
178
- style: de,
179
- ref: oe,
177
+ className: f("slds-tooltip-trigger", M),
178
+ style: ue,
179
+ ref: ae,
180
180
  children: [
181
+ oe(),
181
182
  se(),
182
- ce(),
183
- ue()
183
+ le()
184
184
  ]
185
185
  });
186
186
  };
187
- _.displayName = e;
187
+ v.displayName = e;
188
188
  //#endregion
189
- export { _ as default };
189
+ export { v as default };
190
190
 
191
191
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/tooltip/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// # Tooltip\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseContext,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport EventUtil from '../../utilities/event';\nimport { POPOVER_TOOLTIP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport Dialog from '../utilities/dialog';\nimport Icon from '../icon';\n// eslint-disable-next-line import/no-cycle\nimport Button from '../button';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ### Types\n\nexport type TooltipAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\nexport type TooltipTheme = 'info' | 'error';\n\nexport type TooltipIconVariant = 'bare' | 'error' | 'inverse' | 'warning';\n\nexport type TooltipVariant = 'base' | 'learnMore' | 'list-item';\n\nexport interface TooltipAssistiveText {\n\t/** This text is inside the info icon within the tooltip content and exists to \"complete the sentence\" for assistive tech users. */\n\ttooltipTipLearnMoreIcon?: string;\n\t/** This text is inside the info icon that triggers the tooltip in order to have text within the link. */\n\ttriggerLearnMoreIcon?: string;\n}\n\nexport interface TooltipLabels {\n\t/** This label appears in the tooltip after the info icon. */\n\tlearnMoreAfter?: string;\n\t/** This label appears in the tooltip before the info icon. */\n\tlearnMoreBefore?: string;\n}\n\nexport interface TooltipProps {\n\t/**\n\t * Alignment of the Tooltip relative to the element that triggers it.\n\t */\n\talign?: TooltipAlign;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t */\n\tassistiveText?: TooltipAssistiveText;\n\t/**\n\t * Pass the one element that triggers the Tooltip as a child. It must be an element with `tabIndex` or an element that already has a `tabIndex` set such as an anchor or a button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Content inside Tooltip.\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * CSS classes to be added to the popover dialog. That is the element with `.slds-popover` on it.\n\t */\n\tdialogClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Enabling this hides the default nubbin, replacing it with one attached directly to the tooltip trigger.\n\t */\n\thasAnchoredNubbin?: boolean;\n\t/**\n\t * By default, dialogs will flip their alignment if they extend beyond a boundary element.\n\t * `hasStaticAlignment` disables this behavior.\n\t */\n\thasStaticAlignment?: boolean;\n\t/**\n\t * Styles the default info icon trigger that renders when no children are passed. Matches `icon-variant` on `lightning-helptext`.\n\t * * `bare` - (default) Default icon color.\n\t * * `error` - Red icon, to call out an error.\n\t * * `inverse` - White icon, for dark backgrounds.\n\t * * `warning` - Yellow icon, to advise caution.\n\t */\n\ticonVariant?: TooltipIconVariant;\n\t/**\n\t * Delay on Tooltip closing in milliseconds. Defaults to 50\n\t */\n\thoverCloseDelay?: number;\n\t/**\n\t * Delay on Tooltip opening in milliseconds. Defaults to 0\n\t */\n\thoverOpenDelay?: number;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering element.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t */\n\tlabels?: TooltipLabels;\n\t/**\n\t * Forces tooltip to be open. A value of `false` will disable any interaction with the tooltip.\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Callback that returns an element or React `ref` to align the Tooltip with.\n\t */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * Callback when the info icon in learn more variant is clicked\n\t */\n\tonClickTrigger?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t/**\n\t * CSS classes to be added to tag with `slds-tooltip-trigger`.\n\t */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents.\n\t * * `relative` - No styling or portals will be used.\n\t */\n\tposition?: TooltipPosition;\n\t/**\n\t * Custom styles to be added to wrapping triggering `div`.\n\t */\n\ttriggerStyle?: CSSProperties;\n\t/**\n\t * Determines the theme of tooltip: for informative purpose (blue background) or warning purpose (red background).\n\t */\n\ttheme?: TooltipTheme;\n\t/**\n\t * @deprecated Use onRequestTargetElement instead\n\t */\n\ttarget?: HTMLElement | null;\n\t/**\n\t * Determines the type of the tooltip.\n\t */\n\tvariant?: TooltipVariant;\n}\n\nconst defaultAssistiveText: TooltipAssistiveText = {\n\ttooltipTipLearnMoreIcon: 'this link',\n\ttriggerLearnMoreIcon: 'Help',\n};\n\nconst defaultLabels: TooltipLabels = {\n\tlearnMoreAfter: 'to learn more.',\n\tlearnMoreBefore: 'Click',\n};\n\n/**\n * The PopoverTooltip component is variant of the Lightning Design System Popover component.\n * This component wraps an element that triggers it to open. It must be a focusable child element\n * (either a button or an anchor), so that keyboard users can navigate to it.\n */\nconst Tooltip = ({\n\talign = 'top',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tcontent = <span>Tooltip</span>,\n\tdialogClassName,\n\thasAnchoredNubbin = false,\n\thasStaticAlignment = false,\n\thoverCloseDelay = 50,\n\thoverOpenDelay = 0,\n\ticonVariant = 'bare',\n\tid: idProp,\n\tlabels: labelsProp,\n\tisOpen: isOpenProp,\n\tonRequestTargetElement,\n\tonClickTrigger,\n\ttriggerClassName,\n\tposition = 'absolute',\n\ttriggerStyle,\n\ttheme = 'info',\n\ttarget: deprecatedTarget,\n\tvariant = 'base',\n}: TooltipProps): React.ReactElement => {\n\t// Merge assistive text and labels with defaults\n\tconst assistiveText = { ...defaultAssistiveText, ...assistiveTextProp };\n\tconst labels = { ...defaultLabels, ...labelsProp };\n\n\t// Context\n\tconst iconSettings = useContext(IconSettingsContext);\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst tooltipTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst generatedIdRef = useRef(generateId());\n\tconst isUnmountingRef = useRef(false);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPOPOVER_TOOLTIP,\n\t\t\t{\n\t\t\t\talign,\n\t\t\t\tassistiveText,\n\t\t\t\tchildren,\n\t\t\t\tcontent,\n\t\t\t\tdialogClassName,\n\t\t\t\thasAnchoredNubbin,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thoverCloseDelay,\n\t\t\t\thoverOpenDelay,\n\t\t\t\ticonVariant,\n\t\t\t\tid: idProp,\n\t\t\t\tlabels,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tonRequestTargetElement,\n\t\t\t\tonClickTrigger,\n\t\t\t\ttriggerClassName,\n\t\t\t\tposition,\n\t\t\t\ttriggerStyle,\n\t\t\t\ttheme,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Get computed values\n\tconst getId = useCallback(() => {\n\t\treturn idProp || generatedIdRef.current;\n\t}, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn isOpenProp === undefined ? isOpenState : isOpenProp;\n\t}, [isOpenProp, isOpenState]);\n\n\tconst getTooltipTarget = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\treturn onRequestTargetElement();\n\t\t}\n\n\t\t// for backwards compatibility\n\t\tif (deprecatedTarget) {\n\t\t\treturn deprecatedTarget;\n\t\t}\n\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement, deprecatedTarget]);\n\n\t// Event handlers\n\tconst handleCancel = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\tsetIsOpenState(false);\n\t}, []);\n\n\tconst handleMouseEnter = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\tif (!isUnmountingRef.current) {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t}, hoverOpenDelay);\n\t}, [hoverOpenDelay]);\n\n\tconst handleMouseLeave = useCallback(\n\t\t(e: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tconst relatedTarget = (e as MouseEvent<HTMLElement>)\n\t\t\t\t\t.relatedTarget as HTMLElement | null;\n\t\t\t\tconst isHoveringTooltip =\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover_tooltip') ||\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover__body');\n\n\t\t\t\tif (!isUnmountingRef.current && !isHoveringTooltip) {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tif (!isUnmountingRef.current && e.key === 'Escape') {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\t// Save trigger ref and trigger re-render once mounted\n\tconst saveTriggerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\tif (component && triggerRef.current !== component) {\n\t\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\tcomponent;\n\t\t\t\t// Dialog/Popper.js cannot place the popover until\n\t\t\t\t// the trigger/target DOM node is mounted.\n\t\t\t\tif (!triggerRendered) {\n\t\t\t\t\tsetTriggerRendered(true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[triggerRendered]\n\t);\n\n\t// Render helpers\n\tconst getAnchoredNubbinStyles = () => {\n\t\tif (!hasAnchoredNubbin) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst alignment = align.split(' ')[0] as\n\t\t\t'top' | 'bottom' | 'left' | 'right';\n\t\tconst nubbinContainerStyles: CSSProperties = {\n\t\t\theight: '0',\n\t\t\tposition: 'relative',\n\t\t\twidth: '0',\n\t\t};\n\t\tconst nubbinStyles: CSSProperties = {\n\t\t\tbackgroundColor: '#16325c',\n\t\t\tcontent: '\"\"',\n\t\t\theight: '1rem',\n\t\t\tposition: 'absolute',\n\t\t\ttransform: 'rotate(45deg)',\n\t\t\twidth: '1rem',\n\t\t};\n\t\tconst triggerDimensions = {\n\t\t\theight: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().height\n\t\t\t\t: 0,\n\t\t\twidth: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().width\n\t\t\t\t: 0,\n\t\t};\n\n\t\tswitch (alignment) {\n\t\t\tcase 'bottom': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height}px`;\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '3px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'left': {\n\t\t\t\tnubbinContainerStyles.left = '0';\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '-19px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'right': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '3px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// top\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = '0';\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '-19px';\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{`#${getId()}:after, #${getId()}:before {\n\tdisplay: none;\n}`}</style>\n\t\t\t\t{getIsOpen() ? (\n\t\t\t\t\t<div style={nubbinContainerStyles}>\n\t\t\t\t\t\t<div style={nubbinStyles} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst getContent = () => {\n\t\tlet childrenToRender: ReactNode;\n\t\tconst noChildrenProvided = React.Children.count(children) === 0;\n\t\tconst isInverseIcon = iconVariant === 'inverse';\n\t\tconst iconColorVariant =\n\t\t\ticonVariant === 'error' || iconVariant === 'warning'\n\t\t\t\t? iconVariant\n\t\t\t\t: undefined;\n\n\t\tif (noChildrenProvided && onClickTrigger) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#\"\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tEventUtil.trappedHandler(\n\t\t\t\t\t\t\tonClickTrigger\n\t\t\t\t\t\t) as React.MouseEventHandler<HTMLAnchorElement>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tcolorVariant={iconColorVariant}\n\t\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\tlabel: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t);\n\t\t} else if (noChildrenProvided) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<Button\n\t\t\t\t\taria-disabled\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t}}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName={\n\t\t\t\t\t\ticonColorVariant && `slds-icon-text-${iconColorVariant}`\n\t\t\t\t\t}\n\t\t\t\t\ticonName=\"info\"\n\t\t\t\t\t// `bare` keeps `slds-button_icon`, which Button drops for `inverse` alone\n\t\t\t\t\ticonVariant={isInverseIcon ? 'bare' : undefined}\n\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenToRender = children;\n\t\t}\n\n\t\treturn React.Children.map(childrenToRender, (child, i) => {\n\t\t\tif (!React.isValidElement(child)) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\treturn React.cloneElement(\n\t\t\t\tchild as React.ReactElement<{\n\t\t\t\t\tkey?: React.Key;\n\t\t\t\t\t'aria-describedby'?: string;\n\t\t\t\t\tonBlur?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonFocus?: () => void;\n\t\t\t\t\tonMouseEnter?: () => void;\n\t\t\t\t\tonMouseLeave?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tkey: i,\n\t\t\t\t\t'aria-describedby': getIsOpen() ? getId() : undefined,\n\t\t\t\t\tonBlur: handleMouseLeave,\n\t\t\t\t\tonFocus: handleMouseEnter,\n\t\t\t\t\tonMouseEnter: handleMouseEnter,\n\t\t\t\t\tonMouseLeave: handleMouseLeave,\n\t\t\t\t\tonKeyDown: handleKeyDown,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t};\n\n\tconst getTooltipContent = () => {\n\t\t// REMOVE AT NEXT BREAKING CHANGE (v1.0 or v0.9)\n\t\t// Support deprecated 'error' variant value (now use theme='error')\n\t\tconst isErrorTheme = theme === 'error' || (variant as string) === 'error';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-popover__body', {\n\t\t\t\t\t// Ensure text contrast on error theme (red background needs white text)\n\t\t\t\t\t'slds-text-color_inverse': isErrorTheme,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t\t{variant === 'learnMore' && onClickTrigger ? (\n\t\t\t\t\t<div className=\"slds-m-top_x-small\" aria-hidden=\"true\">\n\t\t\t\t\t\t{labels.learnMoreBefore}{' '}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.tooltipTipLearnMoreIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>{' '}\n\t\t\t\t\t\t{labels.learnMoreAfter}{' '}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst getTooltip = () => {\n\t\tconst isOpen = getIsOpen();\n\n\t\t// REMOVE AT NEXT BREAKING CHANGE (v1.0 or v0.9)\n\t\t// Support deprecated 'error' variant value (now use theme='error')\n\t\tconst deprecatedWay = (variant as string) === 'error';\n\n\t\treturn isOpen ? (\n\t\t\t<Dialog\n\t\t\t\tcloseOnTabKey\n\t\t\t\thasNubbin\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t'slds-popover_tooltip',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-theme_error': theme === 'error' || deprecatedWay,\n\t\t\t\t\t},\n\t\t\t\t\tdialogClassName\n\t\t\t\t)}\n\t\t\t\talign={align}\n\t\t\t\tcontext={iconSettings}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleCancel}\n\t\t\t\tonRequestTargetElement={getTooltipTarget}\n\t\t\t\tonMouseLeave={handleCancel}\n\t\t\t\tposition={position}\n\t\t\t\tvariant=\"tooltip\"\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: getId(),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{getTooltipContent()}\n\t\t\t</Dialog>\n\t\t) : (\n\t\t\t<span />\n\t\t);\n\t};\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: 'inline-block',\n\t\tlineHeight: '1',\n\t\t...triggerStyle,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-tooltip-trigger', triggerClassName)}\n\t\t\tstyle={containerStyles}\n\t\t\tref={saveTriggerRef}\n\t\t>\n\t\t\t{getAnchoredNubbinStyles()}\n\t\t\t{getContent()}\n\t\t\t{getTooltip()}\n\t\t</div>\n\t);\n};\n\nTooltip.displayName = POPOVER_TOOLTIP;\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;;;;;;AAwKA,IAAM,IAA6C;CAClD,yBAAyB;CACzB,sBAAsB;AACvB,GAEM,KAA+B;CACpC,gBAAgB;CAChB,iBAAiB;AAClB,GAOM,KAAW,EAChB,WAAQ,OACR,eAAe,IACf,aACA,aAAU,kBAAC,QAAD,EAAA,UAAM,UAAa,CAAA,GAC7B,oBACA,uBAAoB,IACpB,wBAAqB,IACrB,qBAAkB,IAClB,oBAAiB,GACjB,iBAAc,QACd,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,2BACA,mBACA,qBACA,cAAW,YACX,iBACA,WAAQ,QACR,QAAQ,GACR,aAAU,aAC6B;CAEvC,IAAM,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAChE,IAAS;EAAE,GAAG;EAAe,GAAG;CAAW,GAG3C,IAAe,GAAW,CAAmB,GAG7C,CAAC,GAAa,KAAkB,EAAS,EAAK,GAC9C,CAAC,GAAiB,KAAsB,EAAS,EAAK,GAGtD,IAAa,EAAuB,IAAI,GACxC,IAAoB,EAA6C,IAAI,GACrE,IAAiB,EAAO,EAAW,CAAC,GACpC,IAAkB,EAAO,EAAK;CAiCpC,AA9BA,QAAgB;EACf,EACC,GACA;GACC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,IAAI;GACJ;GACA,QAAQ;GACR;GACA;GACA;GACA;GACA;GACA;GACA;EACD,GACA,CACD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,wBACA,EACC,oBAAoB,MAAU,WAVX,MAAuB,QAW3C,GACA,CACD;EACO;EACP,SAAS;EACW;EACpB,SAAS;EACT,wBAAwB;EACxB,cAAc;EACJ;EACV,SAAQ;EACR,gBAAgB,EACf,IAAI,EAAM,EACX;EAEC,UAAA,GAAkB;CACZ,CAAA,IAER,kBAAC,QAAD,CAAO,CAAA,GAIH,KAAiC;EACtC,SAAS;EACT,YAAY;EACZ,GAAG;CACJ;CAEA,OACC,kBAAC,OAAD;EACC,WAAW,EAAW,wBAAwB,CAAgB;EAC9D,OAAO;EACP,KAAK;EAHN,UAAA;GAKE,GAAwB;GACxB,GAAW;GACX,GAAW;EACR;;AAEP;AAEA,EAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/tooltip/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// # Tooltip\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseContext,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport EventUtil from '../../utilities/event';\nimport { POPOVER_TOOLTIP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport Dialog from '../utilities/dialog';\nimport Icon from '../icon';\n// eslint-disable-next-line import/no-cycle\nimport Button from '../button';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ### Types\n\nexport type TooltipAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\nexport type TooltipTheme = 'info' | 'error';\n\nexport type TooltipIconVariant = 'bare' | 'error' | 'inverse' | 'warning';\n\nexport type TooltipVariant = 'base' | 'learnMore' | 'list-item';\n\nexport interface TooltipAssistiveText {\n\t/** This text is inside the info icon within the tooltip content and exists to \"complete the sentence\" for assistive tech users. */\n\ttooltipTipLearnMoreIcon?: string;\n\t/** This text is inside the info icon that triggers the tooltip in order to have text within the link. */\n\ttriggerLearnMoreIcon?: string;\n}\n\nexport interface TooltipLabels {\n\t/** This label appears in the tooltip after the info icon. */\n\tlearnMoreAfter?: string;\n\t/** This label appears in the tooltip before the info icon. */\n\tlearnMoreBefore?: string;\n}\n\nexport interface TooltipProps {\n\t/**\n\t * Alignment of the Tooltip relative to the element that triggers it.\n\t */\n\talign?: TooltipAlign;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t */\n\tassistiveText?: TooltipAssistiveText;\n\t/**\n\t * Pass the one element that triggers the Tooltip as a child. It must be an element with `tabIndex` or an element that already has a `tabIndex` set such as an anchor or a button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Content inside Tooltip.\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * CSS classes to be added to the popover dialog. That is the element with `.slds-popover` on it.\n\t */\n\tdialogClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Enabling this hides the default nubbin, replacing it with one attached directly to the tooltip trigger.\n\t */\n\thasAnchoredNubbin?: boolean;\n\t/**\n\t * By default, dialogs will flip their alignment if they extend beyond a boundary element.\n\t * `hasStaticAlignment` disables this behavior.\n\t */\n\thasStaticAlignment?: boolean;\n\t/**\n\t * Styles the default info icon trigger that renders when no children are passed. Matches `icon-variant` on `lightning-helptext`.\n\t * * `bare` - (default) Default icon color.\n\t * * `error` - Red icon, to call out an error.\n\t * * `inverse` - White icon, for dark backgrounds.\n\t * * `warning` - Yellow icon, to advise caution.\n\t */\n\ticonVariant?: TooltipIconVariant;\n\t/**\n\t * Delay on Tooltip closing in milliseconds. Defaults to 50\n\t */\n\thoverCloseDelay?: number;\n\t/**\n\t * Delay on Tooltip opening in milliseconds. Defaults to 0\n\t */\n\thoverOpenDelay?: number;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering element.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t */\n\tlabels?: TooltipLabels;\n\t/**\n\t * Forces tooltip to be open. A value of `false` will disable any interaction with the tooltip.\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Callback that returns an element or React `ref` to align the Tooltip with.\n\t */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * Callback when the info icon in learn more variant is clicked\n\t */\n\tonClickTrigger?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t/**\n\t * CSS classes to be added to tag with `slds-tooltip-trigger`.\n\t */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents.\n\t * * `relative` - No styling or portals will be used.\n\t */\n\tposition?: TooltipPosition;\n\t/**\n\t * Custom styles to be added to wrapping triggering `div`.\n\t */\n\ttriggerStyle?: CSSProperties;\n\t/**\n\t * Determines the theme of tooltip: for informative purpose (blue background) or warning purpose (red background).\n\t */\n\ttheme?: TooltipTheme;\n\t/**\n\t * Determines the type of the tooltip.\n\t */\n\tvariant?: TooltipVariant;\n}\n\nconst defaultAssistiveText: TooltipAssistiveText = {\n\ttooltipTipLearnMoreIcon: 'this link',\n\ttriggerLearnMoreIcon: 'Help',\n};\n\nconst defaultLabels: TooltipLabels = {\n\tlearnMoreAfter: 'to learn more.',\n\tlearnMoreBefore: 'Click',\n};\n\n/**\n * The PopoverTooltip component is variant of the Lightning Design System Popover component.\n * This component wraps an element that triggers it to open. It must be a focusable child element\n * (either a button or an anchor), so that keyboard users can navigate to it.\n */\nconst Tooltip = ({\n\talign = 'top',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tcontent = <span>Tooltip</span>,\n\tdialogClassName,\n\thasAnchoredNubbin = false,\n\thasStaticAlignment = false,\n\thoverCloseDelay = 50,\n\thoverOpenDelay = 0,\n\ticonVariant = 'bare',\n\tid: idProp,\n\tlabels: labelsProp,\n\tisOpen: isOpenProp,\n\tonRequestTargetElement,\n\tonClickTrigger,\n\ttriggerClassName,\n\tposition = 'absolute',\n\ttriggerStyle,\n\ttheme = 'info',\n\tvariant = 'base',\n}: TooltipProps): React.ReactElement => {\n\t// Merge assistive text and labels with defaults\n\tconst assistiveText = { ...defaultAssistiveText, ...assistiveTextProp };\n\tconst labels = { ...defaultLabels, ...labelsProp };\n\n\t// Context\n\tconst iconSettings = useContext(IconSettingsContext);\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst tooltipTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst generatedIdRef = useRef(generateId());\n\tconst isUnmountingRef = useRef(false);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPOPOVER_TOOLTIP,\n\t\t\t{\n\t\t\t\talign,\n\t\t\t\tassistiveText,\n\t\t\t\tchildren,\n\t\t\t\tcontent,\n\t\t\t\tdialogClassName,\n\t\t\t\thasAnchoredNubbin,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thoverCloseDelay,\n\t\t\t\thoverOpenDelay,\n\t\t\t\ticonVariant,\n\t\t\t\tid: idProp,\n\t\t\t\tlabels,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tonRequestTargetElement,\n\t\t\t\tonClickTrigger,\n\t\t\t\ttriggerClassName,\n\t\t\t\tposition,\n\t\t\t\ttriggerStyle,\n\t\t\t\ttheme,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Get computed values\n\tconst getId = useCallback(() => {\n\t\treturn idProp || generatedIdRef.current;\n\t}, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn isOpenProp === undefined ? isOpenState : isOpenProp;\n\t}, [isOpenProp, isOpenState]);\n\n\tconst getTooltipTarget = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\treturn onRequestTargetElement();\n\t\t}\n\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Event handlers\n\tconst handleCancel = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\tsetIsOpenState(false);\n\t}, []);\n\n\tconst handleMouseEnter = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\tif (!isUnmountingRef.current) {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t}, hoverOpenDelay);\n\t}, [hoverOpenDelay]);\n\n\tconst handleMouseLeave = useCallback(\n\t\t(e: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tconst relatedTarget = (e as MouseEvent<HTMLElement>)\n\t\t\t\t\t.relatedTarget as HTMLElement | null;\n\t\t\t\tconst isHoveringTooltip =\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover_tooltip') ||\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover__body');\n\n\t\t\t\tif (!isUnmountingRef.current && !isHoveringTooltip) {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tif (!isUnmountingRef.current && e.key === 'Escape') {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\t// Save trigger ref and trigger re-render once mounted\n\tconst saveTriggerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\tif (component && triggerRef.current !== component) {\n\t\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\tcomponent;\n\t\t\t\t// Dialog/Popper.js cannot place the popover until\n\t\t\t\t// the trigger/target DOM node is mounted.\n\t\t\t\tif (!triggerRendered) {\n\t\t\t\t\tsetTriggerRendered(true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[triggerRendered]\n\t);\n\n\t// Render helpers\n\tconst getAnchoredNubbinStyles = () => {\n\t\tif (!hasAnchoredNubbin) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst alignment = align.split(' ')[0] as\n\t\t\t'top' | 'bottom' | 'left' | 'right';\n\t\tconst nubbinContainerStyles: CSSProperties = {\n\t\t\theight: '0',\n\t\t\tposition: 'relative',\n\t\t\twidth: '0',\n\t\t};\n\t\tconst nubbinStyles: CSSProperties = {\n\t\t\tbackgroundColor: '#16325c',\n\t\t\tcontent: '\"\"',\n\t\t\theight: '1rem',\n\t\t\tposition: 'absolute',\n\t\t\ttransform: 'rotate(45deg)',\n\t\t\twidth: '1rem',\n\t\t};\n\t\tconst triggerDimensions = {\n\t\t\theight: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().height\n\t\t\t\t: 0,\n\t\t\twidth: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().width\n\t\t\t\t: 0,\n\t\t};\n\n\t\tswitch (alignment) {\n\t\t\tcase 'bottom': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height}px`;\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '3px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'left': {\n\t\t\t\tnubbinContainerStyles.left = '0';\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '-19px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'right': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '3px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// top\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = '0';\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '-19px';\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{`#${getId()}:after, #${getId()}:before {\n\tdisplay: none;\n}`}</style>\n\t\t\t\t{getIsOpen() ? (\n\t\t\t\t\t<div style={nubbinContainerStyles}>\n\t\t\t\t\t\t<div style={nubbinStyles} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst getContent = () => {\n\t\tlet childrenToRender: ReactNode;\n\t\tconst noChildrenProvided = React.Children.count(children) === 0;\n\t\tconst isInverseIcon = iconVariant === 'inverse';\n\t\tconst iconColorVariant =\n\t\t\ticonVariant === 'error' || iconVariant === 'warning'\n\t\t\t\t? iconVariant\n\t\t\t\t: undefined;\n\n\t\tif (noChildrenProvided && onClickTrigger) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#\"\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tEventUtil.trappedHandler(\n\t\t\t\t\t\t\tonClickTrigger\n\t\t\t\t\t\t) as React.MouseEventHandler<HTMLAnchorElement>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tcolorVariant={iconColorVariant}\n\t\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\tlabel: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t);\n\t\t} else if (noChildrenProvided) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<Button\n\t\t\t\t\taria-disabled\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t}}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName={\n\t\t\t\t\t\ticonColorVariant && `slds-icon-text-${iconColorVariant}`\n\t\t\t\t\t}\n\t\t\t\t\ticonName=\"info\"\n\t\t\t\t\t// `bare` keeps `slds-button_icon`, which Button drops for `inverse` alone\n\t\t\t\t\ticonVariant={isInverseIcon ? 'bare' : undefined}\n\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenToRender = children;\n\t\t}\n\n\t\treturn React.Children.map(childrenToRender, (child, i) => {\n\t\t\tif (!React.isValidElement(child)) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\treturn React.cloneElement(\n\t\t\t\tchild as React.ReactElement<{\n\t\t\t\t\tkey?: React.Key;\n\t\t\t\t\t'aria-describedby'?: string;\n\t\t\t\t\tonBlur?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonFocus?: () => void;\n\t\t\t\t\tonMouseEnter?: () => void;\n\t\t\t\t\tonMouseLeave?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tkey: i,\n\t\t\t\t\t'aria-describedby': getIsOpen() ? getId() : undefined,\n\t\t\t\t\tonBlur: handleMouseLeave,\n\t\t\t\t\tonFocus: handleMouseEnter,\n\t\t\t\t\tonMouseEnter: handleMouseEnter,\n\t\t\t\t\tonMouseLeave: handleMouseLeave,\n\t\t\t\t\tonKeyDown: handleKeyDown,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t};\n\n\tconst getTooltipContent = () => {\n\t\tconst isErrorTheme = theme === 'error';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-popover__body', {\n\t\t\t\t\t// Ensure text contrast on error theme (red background needs white text)\n\t\t\t\t\t'slds-text-color_inverse': isErrorTheme,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t\t{variant === 'learnMore' && onClickTrigger ? (\n\t\t\t\t\t<div className=\"slds-m-top_x-small\" aria-hidden=\"true\">\n\t\t\t\t\t\t{labels.learnMoreBefore}{' '}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.tooltipTipLearnMoreIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>{' '}\n\t\t\t\t\t\t{labels.learnMoreAfter}{' '}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst getTooltip = () => {\n\t\tconst isOpen = getIsOpen();\n\n\t\treturn isOpen ? (\n\t\t\t<Dialog\n\t\t\t\tcloseOnTabKey\n\t\t\t\thasNubbin\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t'slds-popover_tooltip',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-theme_error': theme === 'error',\n\t\t\t\t\t},\n\t\t\t\t\tdialogClassName\n\t\t\t\t)}\n\t\t\t\talign={align}\n\t\t\t\tcontext={iconSettings}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleCancel}\n\t\t\t\tonRequestTargetElement={getTooltipTarget}\n\t\t\t\tonMouseLeave={handleCancel}\n\t\t\t\tposition={position}\n\t\t\t\tvariant=\"tooltip\"\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: getId(),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{getTooltipContent()}\n\t\t\t</Dialog>\n\t\t) : (\n\t\t\t<span />\n\t\t);\n\t};\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: 'inline-block',\n\t\tlineHeight: '1',\n\t\t...triggerStyle,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-tooltip-trigger', triggerClassName)}\n\t\t\tstyle={containerStyles}\n\t\t\tref={saveTriggerRef}\n\t\t>\n\t\t\t{getAnchoredNubbinStyles()}\n\t\t\t{getContent()}\n\t\t\t{getTooltip()}\n\t\t</div>\n\t);\n};\n\nTooltip.displayName = POPO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GAKE,GAAwB;GACxB,GAAW;GACX,GAAW;EACR;;AAEP;AAEA,EAAQ,cAAc"}
@@ -1,14 +1,14 @@
1
- import e from "../../utilities/warning/sunset-property.js";
2
- import t from "../../utilities/get-component-doc.js";
3
- import n from "../../utilities/warning/one-of-required-property.js";
1
+ import e from "../../utilities/get-component-doc.js";
2
+ import t from "../../utilities/warning/one-of-required-property.js";
3
+ import n from "../../utilities/warning/deprecated-property.js";
4
4
  //#region components/tree/check-props.js
5
5
  var r = function() {};
6
6
  process.env.NODE_ENV !== "production" && (r = function(r, i, a) {
7
- let o = t(a);
8
- n(r, {
7
+ let o = e(a);
8
+ t(r, {
9
9
  assistiveText: i.assistiveText,
10
10
  heading: i.heading
11
- }, o()), typeof i.assistiveText == "string" && e(r, i.assistiveText, "assistiveText", `\`assistiveText\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \`assistiveText.label\` instead. ${o("assistiveText")}`);
11
+ }, o()), n(r, i.onClick, "onClick", "onSelect", "`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state."), n(r, i.onExpandClick, "onExpandClick", "onRequestToggle", "`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead.");
12
12
  });
13
13
  var i = r;
14
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tree/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t/* eslint-disable max-len */\n\t\toneOfRequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\tassistiveText: props.assistiveText,\n\t\t\t\theading: props.heading,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\t\t/* eslint-enable max-len */\n\n\t\tif (typeof props.assistiveText === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText,\n\t\t\t\t'assistiveText',\n\t\t\t\t`\\`assistiveText\\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \\`assistiveText.label\\` instead. ${createDocUrl(\n\t\t\t\t\t'assistiveText'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAQA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAa9C,AAVA,EACC,GACA;EACC,eAAe,EAAM;EACrB,SAAS,EAAM;CAChB,GACA,EAAa,CACd,GAGI,OAAO,EAAM,iBAAkB,YAClC,EACC,GACA,EAAM,eACN,iBACA,mKAAmK,EAClK,eACD,GACD;AAEF;AAGD,IAAA,IAAe"}
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tree/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t/* eslint-disable max-len */\n\t\toneOfRequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\tassistiveText: props.assistiveText,\n\t\t\t\theading: props.heading,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\t// Deprecated and changed to another property\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick,\n\t\t\t'onClick',\n\t\t\t'onSelect',\n\t\t\t'`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onExpandClick,\n\t\t\t'onExpandClick',\n\t\t\t'onRequestToggle',\n\t\t\t'`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead.'\n\t\t);\n\t\t/* eslint-enable max-len */\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAQA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAoB9C,AAjBA,EACC,GACA;EACC,eAAe,EAAM;EACrB,SAAS,EAAM;CAChB,GACA,EAAa,CACd,GAGA,EACC,GACA,EAAM,SACN,WACA,YACA,2GACD,GACA,EACC,GACA,EAAM,eACN,iBACA,mBACA,0MACD;AAED;AAGD,IAAA,IAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"branch.js","names":[],"sources":["../../../../../components/tree/private/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';\n\nimport Item from './item';\nimport RenderInitialBranch from './render-initial-branch';\nimport RenderBranch from './render-branch';\n\nimport { TREE_BRANCH } from '../../../utilities/constants';\nimport generateId from '../../../utilities/generate-id';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface BranchProps {\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\thtmlId: string | number;\n\tindex?: number;\n\tinitial?: boolean;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode | { nodes?: TreeNode[] };\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\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\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: { percentage: number }\n\t) => void;\n\tsearchTerm?: string;\n\ttreeId: 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\tnodes?: TreeNode[];\n}\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A Tree Branch is an expandable node in a hierarchical list.\n */\nconst Branch: React.FC<BranchProps> = ({\n\tlevel = 0,\n\tlabel = '',\n\ttreeIndex = '',\n\tselectedNodeIndexes = [],\n\tgetNodes = defaultGetNodes,\n\t...rest\n}) => {\n\tconst props = {\n\t\tlevel,\n\t\tlabel,\n\t\ttreeIndex,\n\t\tselectedNodeIndexes,\n\t\tgetNodes,\n\t\t...rest,\n\t};\n\n\tconst { treeId, onExpand, searchTerm, node } = props;\n\tlet resolvedTreeIndex = '';\n\tlet children: ReactNode = null;\n\n\tconst nodeChildren = getNodes(node);\n\tif (Array.isArray(nodeChildren)) {\n\t\tchildren = nodeChildren.map((childNode, index) => {\n\t\t\tlet child: ReactNode;\n\t\t\tconst htmlId = `${treeId}-${childNode.id}`;\n\t\t\tresolvedTreeIndex = `${index}`;\n\t\t\tif (treeIndex) {\n\t\t\t\tresolvedTreeIndex = `${treeIndex}-${resolvedTreeIndex}`;\n\t\t\t}\n\n\t\t\tif (childNode.type === 'branch') {\n\t\t\t\tchild = (\n\t\t\t\t\t<Branch\n\t\t\t\t\t\tgetNodes={getNodes}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={childNode.id}\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tnodes={childNode.nodes}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchild = (\n\t\t\t\t\t<Item\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={generateId()}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}\n\n\tconst branch =\n\t\tlevel === 0\n\t\t\t? RenderInitialBranch(children, props)\n\t\t\t: RenderBranch(children, {\n\t\t\t\t\t...props,\n\t\t\t\t\tnode: node as TreeNode,\n\t\t\t\t\ttreeIndex,\n\t\t\t\t});\n\n\treturn branch;\n};\n\nBranch.displayName = TREE_BRANCH;\n\nexport default Branch;\n\n\n\n"],"mappings":";;;;;;;;AA0DA,IAAM,KAAmB,MAAiC,EAAK,OAKzD,KAAiC,EACtC,WAAQ,GACR,WAAQ,IACR,eAAY,IACZ,yBAAsB,CAAC,GACvB,cAAW,GACX,GAAG,QACE;CACL,IAAM,IAAQ;EACb;EACA;EACA;EACA;EACA;EACA,GAAG;CACJ,GAEM,EAAE,WAAQ,aAAU,eAAY,YAAS,GAC3C,IAAoB,IACpB,IAAsB,MAEpB,IAAe,EAAS,CAAI;CAoElC,OAnEI,MAAM,QAAQ,CAAY,MAC7B,IAAW,EAAa,KAAK,GAAW,MAAU;EACjD,IAAI,GACE,IAAS,GAAG,EAAO,GAAG,EAAU;EAmDtC,OAlDA,IAAoB,GAAG,KACnB,MACH,IAAoB,GAAG,EAAU,GAAG,MAGrC,AAwBC,IAxBG,EAAU,SAAS,WAErB,kBAAC,GAAD;GACW;GACF;GAER,OAAO,EAAU;GACjB,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACD;GACrB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,OAAO,EAAU;GACjB,UAAU,EAAM;GACN;GACE;GACJ;GACR,WAAW;GACX,QAAQ;EACR,GAhBK,EAAU,EAgBf,IAID,kBAAC,GAAD;GACC,OAAO,EAAU;GACT;GAER,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACD;GACrB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,UAAU,EAAM;GACN;GACE;GACZ,WAAW;GACH;GACR,QAAQ;EACR,GAdK,EAAW,CAchB,GAGI;CACR,CAAC,IAID,MAAU,IACP,EAAoB,GAAU,CAAK,IACnC,EAAa,GAAU;EACvB,GAAG;EACG;EACN;CACD,CAAC;AAGL;AAEA,EAAO,cAAc"}
1
+ {"version":3,"file":"branch.js","names":[],"sources":["../../../../../components/tree/private/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';\n\nimport Item from './item';\nimport RenderInitialBranch from './render-initial-branch';\nimport RenderBranch from './render-branch';\n\nimport { TREE_BRANCH } from '../../../utilities/constants';\nimport generateId from '../../../utilities/generate-id';\nimport { TreeNode, FlattenedNode, TreeScrollData } from '../types';\n\nexport interface BranchProps {\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\thtmlId: string | number;\n\tindex?: number;\n\tinitial?: boolean;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode | { nodes?: TreeNode[] };\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\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\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\tsearchTerm?: string;\n\ttreeId: 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\tnodes?: TreeNode[];\n}\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A Tree Branch is an expandable node in a hierarchical list.\n */\nconst Branch: React.FC<BranchProps> = ({\n\tlevel = 0,\n\tlabel = '',\n\ttreeIndex = '',\n\tselectedNodeIndexes = [],\n\tgetNodes = defaultGetNodes,\n\t...rest\n}) => {\n\tconst props = {\n\t\tlevel,\n\t\tlabel,\n\t\ttreeIndex,\n\t\tselectedNodeIndexes,\n\t\tgetNodes,\n\t\t...rest,\n\t};\n\n\tconst { treeId, onExpand, searchTerm, node } = props;\n\tlet resolvedTreeIndex = '';\n\tlet children: ReactNode = null;\n\n\tconst nodeChildren = getNodes(node);\n\tif (Array.isArray(nodeChildren)) {\n\t\tchildren = nodeChildren.map((childNode, index) => {\n\t\t\tlet child: ReactNode;\n\t\t\tconst htmlId = `${treeId}-${childNode.id}`;\n\t\t\tresolvedTreeIndex = `${index}`;\n\t\t\tif (treeIndex) {\n\t\t\t\tresolvedTreeIndex = `${treeIndex}-${resolvedTreeIndex}`;\n\t\t\t}\n\n\t\t\tif (childNode.type === 'branch') {\n\t\t\t\tchild = (\n\t\t\t\t\t<Branch\n\t\t\t\t\t\tgetNodes={getNodes}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={childNode.id}\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tnodes={childNode.nodes}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchild = (\n\t\t\t\t\t<Item\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={generateId()}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}\n\n\tconst branch =\n\t\tlevel === 0\n\t\t\t? RenderInitialBranch(children, props)\n\t\t\t: RenderBranch(children, {\n\t\t\t\t\t...props,\n\t\t\t\t\tnode: node as TreeNode,\n\t\t\t\t\ttreeIndex,\n\t\t\t\t});\n\n\treturn branch;\n};\n\nBranch.displayName = TREE_BRANCH;\n\nexport default Branch;\n"],"mappings":";;;;;;;;AA0DA,IAAM,KAAmB,MAAiC,EAAK,OAKzD,KAAiC,EACtC,WAAQ,GACR,WAAQ,IACR,eAAY,IACZ,yBAAsB,CAAC,GACvB,cAAW,GACX,GAAG,QACE;CACL,IAAM,IAAQ;EACb;EACA;EACA;EACA;EACA;EACA,GAAG;CACJ,GAEM,EAAE,WAAQ,aAAU,eAAY,YAAS,GAC3C,IAAoB,IACpB,IAAsB,MAEpB,IAAe,EAAS,CAAI;CAoElC,OAnEI,MAAM,QAAQ,CAAY,MAC7B,IAAW,EAAa,KAAK,GAAW,MAAU;EACjD,IAAI,GACE,IAAS,GAAG,EAAO,GAAG,EAAU;EAmDtC,OAlDA,IAAoB,GAAG,KACnB,MACH,IAAoB,GAAG,EAAU,GAAG,MAGrC,AAwBC,IAxBG,EAAU,SAAS,WAErB,kBAAC,GAAD;GACW;GACF;GAER,OAAO,EAAU;GACjB,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACD;GACrB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,OAAO,EAAU;GACjB,UAAU,EAAM;GACN;GACE;GACJ;GACR,WAAW;GACX,QAAQ;EACR,GAhBK,EAAU,EAgBf,IAID,kBAAC,GAAD;GACC,OAAO,EAAU;GACT;GAER,OAAO,IAAQ;GACf,MAAM;GACN,gBAAgB,EAAM;GACD;GACrB,kBAAkB,EAAM;GACxB,cAAc,EAAM;GACpB,YAAY,EAAM;GAClB,UAAU,EAAM;GACN;GACE;GACZ,WAAW;GACH;GACR,QAAQ;EACR,GAdK,EAAW,CAchB,GAGI;CACR,CAAC,IAID,MAAU,IACP,EAAoB,GAAU,CAAK,IACnC,EAAa,GAAU;EACvB,GAAG;EACG;EACN;CACD,CAAC;AAGL;AAEA,EAAO,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","names":[],"sources":["../../../../../components/tree/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, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\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 { TREE_ITEM } from '../../../utilities/constants';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface ItemProps {\n\thtmlId: string;\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\tselect?: boolean;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\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\ttreeId?: 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}\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: ItemProps;\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: ItemProps) => {\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: ItemProps) => {\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 handleKeyDownLeft = (event: React.KeyboardEvent, props: ItemProps) => {\n\tconst nodes = props.flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst parent = props.parent as TreeNode;\n\tconst index = findIndex(nodes, { id: parent?.id });\n\tif (index !== -1) {\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: parent,\n\t\t\t\tselect: true,\n\t\t\t\texpand: !parent.expanded,\n\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleKeyDownEnter = (event: React.KeyboardEvent, props: ItemProps) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (event: React.KeyboardEvent, props: ItemProps) => {\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.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: ItemProps) => {\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 });\n\t}\n};\n\nconst getTabIndex = (props: ItemProps): 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 * A Tree Item is a non-branching node in a hierarchical list.\n */\nconst Item: React.FC<ItemProps> = (props) => {\n\tconst isSelected = props.node.selected;\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\n\treturn (\n\t\t<li\n\t\t\tid={`${props.treeId}-${props.node.id}`}\n\t\t\trole=\"treeitem\"\n\t\t\taria-level={props.level}\n\t\t\taria-selected={isSelected ? 'true' : 'false'}\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\ttabIndex={-1}\n\t\t\t\t\tassistiveText={{ icon: '' }}\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 slds-is-disabled\"\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\">\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</li>\n\t);\n};\n\nItem.displayName = TREE_ITEM;\n\nexport default Item;\n\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAM,KAAgB,EACrB,UACA,UACA,mBAKK;CAEL,AADA,EAAU,KAAK,CAAK,GAChB,EAAW,EAAM,QAAQ,KAC5B,EAAM,SAAS;EACd;EACA,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;IAAO;GAAM,CAAC;GAJlD,UAAA,CAMC,kBAAC,GAAD;IACC,UAAU;IACV,eAAe,EAAE,MAAM,GAAG;IAC1B,cAAa;IACb,UAAS;IACT,UAAS;IACT,SAAQ;IACR,WAAU;IACV,UAAA;GACA,CAAA,GACD,kBAAC,QAAD;IAAM,WAAU;IACf,UAAA,kBAAC,GAAD;KACC,QAAQ,EAAM;KACd,WAAU;KAET,UAAA,EAAM;IACK,CAAA;GACR,CAAA,CACF;;CACF,CAAA;AAEN;AAEA,EAAK,cAAc"}
1
+ {"version":3,"file":"item.js","names":[],"sources":["../../../../../components/tree/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, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\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 { TREE_ITEM } from '../../../utilities/constants';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface ItemProps {\n\thtmlId: string;\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\tselect?: boolean;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\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\ttreeId?: 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}\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: ItemProps;\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: ItemProps) => {\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: ItemProps) => {\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 handleKeyDownLeft = (event: React.KeyboardEvent, props: ItemProps) => {\n\tconst nodes = props.flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst parent = props.parent as TreeNode;\n\tconst index = findIndex(nodes, { id: parent?.id });\n\tif (index !== -1) {\n\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: parent,\n\t\t\t\tselect: true,\n\t\t\t\texpand: !parent.expanded,\n\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleKeyDownEnter = (event: React.KeyboardEvent, props: ItemProps) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (event: React.KeyboardEvent, props: ItemProps) => {\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.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: ItemProps) => {\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 });\n\t}\n};\n\nconst getTabIndex = (props: ItemProps): 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 * A Tree Item is a non-branching node in a hierarchical list.\n */\nconst Item: React.FC<ItemProps> = (props) => {\n\tconst isSelected = props.node.selected;\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\n\treturn (\n\t\t<li\n\t\t\tid={`${props.treeId}-${props.node.id}`}\n\t\t\trole=\"treeitem\"\n\t\t\taria-level={props.level}\n\t\t\taria-selected={isSelected ? 'true' : 'false'}\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\ttabIndex={-1}\n\t\t\t\t\tassistiveText={{ icon: '' }}\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 slds-is-disabled\"\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\">\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</li>\n\t);\n};\n\nItem.displayName = TREE_ITEM;\n\nexport default Item;\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAM,KAAgB,EACrB,UACA,UACA,mBAKK;CAEL,AADA,EAAU,KAAK,CAAK,GAChB,EAAW,EAAM,QAAQ,KAC5B,EAAM,SAAS;EACd;EACA,MAAM;GACL,MAAM,EAAM;GACZ,QAAQ,CAAC,EAAM,KAAK;GACpB,WAAW,EAAM;EAClB;EACA;CACD,CAAC;AAEH,GAEM,KAAgB,GAAiC,MAAmB;CACzE,IAAM,IAAQ,EAAe,KAAK,MAAkB,EAAc,IAAI;CAEtE,OAAO,GADO,EAAU,GAAO,EAAE,IAAI,EAAK,GAAG,CACtB,IAAQ,KAAK,EAAe;AACpD,GAEM,KAAoB,GAAiC,MAAmB;CAC7E,IAAM,IAAQ,EAAe,KAAK,MAAkB,EAAc,IAAI,GAClE,IAAQ,EAAU,GAAO,EAAE,IAAI,EAAK,GAAG,CAAC,IAAI;CAIhD,OAHI,IAAQ,MACX,KAAS,EAAe,SAElB,EAAe;AACvB,GAEM,KAAqB,GAA4B,MAAqB;CAC3E,IAAI,EAAM,qBAAqB,EAAM,WAAW;EAC/C,IAAM,IAAgB,EAAa,EAAM,gBAAgB,EAAM,IAAI;EACnE,EAAM,WAAW;GAChB;GACA,MAAM;IACL,MAAM,EAAc;IACpB,QAAQ;IACR,WAAW,EAAc;GAC1B;GACA,oBAAoB;EACrB,CAAC;CACF;AACD,GAEM,KAAmB,GAA4B,MAAqB;CACzE,IAAI,EAAM,qBAAqB,EAAM,WAAW;EAC/C,IAAM,IAAgB,EAAiB,EAAM,gBAAgB,EAAM,IAAI;EACvE,EAAM,WAAW;GAChB;GACA,MAAM;IACL,MAAM,EAAc;IACpB,QAAQ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