@salesforce/design-system-react 11.0.0-rc.0 → 11.0.0-rc.2

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 (552) hide show
  1. package/README.md +27 -1
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/accordion/panel.cjs.map +1 -1
  5. package/dist/cjs/components/alert/index.cjs +1 -1
  6. package/dist/cjs/components/alert/index.cjs.map +1 -1
  7. package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
  8. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  9. package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
  10. package/dist/cjs/components/button/check-props.cjs +1 -1
  11. package/dist/cjs/components/button/check-props.cjs.map +1 -1
  12. package/dist/cjs/components/button/index.cjs +1 -1
  13. package/dist/cjs/components/button/index.cjs.map +1 -1
  14. package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
  15. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
  16. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  17. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  18. package/dist/cjs/components/carousel/index.cjs +1 -1
  19. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  20. package/dist/cjs/components/carousel/private/carousel-indicators.cjs.map +1 -1
  21. package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
  22. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  24. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  25. package/dist/cjs/components/checkbox/index.cjs +1 -1
  26. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  27. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  28. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  29. package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
  30. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  31. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  32. package/dist/cjs/components/color-picker/private/swatch-option.cjs +1 -1
  33. package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
  34. package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
  35. package/dist/cjs/components/color-picker/private/swatch.cjs.map +1 -1
  36. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  37. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  38. package/dist/cjs/components/combobox/index.cjs +1 -1
  39. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  40. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  41. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  42. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  43. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  44. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  45. package/dist/cjs/components/date-picker/private/calendar.cjs.map +1 -1
  46. package/dist/cjs/components/date-picker/private/day.cjs +1 -1
  47. package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
  48. package/dist/cjs/components/files/file.cjs +1 -8
  49. package/dist/cjs/components/files/file.cjs.map +1 -1
  50. package/dist/cjs/components/files/private/file-actions.cjs +1 -1
  51. package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
  52. package/dist/cjs/components/files/private/file-figure.cjs +1 -1
  53. package/dist/cjs/components/files/private/file-figure.cjs.map +1 -1
  54. package/dist/cjs/components/filter/filter.cjs +1 -1
  55. package/dist/cjs/components/filter/filter.cjs.map +1 -1
  56. package/dist/cjs/components/icon/check-props.cjs +1 -1
  57. package/dist/cjs/components/icon/check-props.cjs.map +1 -1
  58. package/dist/cjs/components/icon/index.cjs +1 -1
  59. package/dist/cjs/components/icon/index.cjs.map +1 -1
  60. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  61. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  62. package/dist/cjs/components/input/check-props.cjs +1 -1
  63. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  64. package/dist/cjs/components/input/index.cjs.map +1 -1
  65. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  66. package/dist/cjs/components/input/search.cjs.map +1 -1
  67. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  68. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  69. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  70. package/dist/cjs/components/modal/index.cjs +1 -1
  71. package/dist/cjs/components/modal/index.cjs.map +1 -1
  72. package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
  73. package/dist/cjs/components/pill/index.cjs.map +1 -1
  74. package/dist/cjs/components/pill-container/index.cjs +1 -1
  75. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  76. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  77. package/dist/cjs/components/popover/index.cjs.map +1 -1
  78. package/dist/cjs/components/popover/popover.cjs +1 -1
  79. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  80. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  81. package/dist/cjs/components/progress-indicator/private/step.cjs.map +1 -1
  82. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  83. package/dist/cjs/components/radio/index.cjs +1 -1
  84. package/dist/cjs/components/radio/index.cjs.map +1 -1
  85. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
  86. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  87. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  88. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  89. package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
  90. package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -1
  91. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  92. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  93. package/dist/cjs/components/simple-data-table/interactive-element.cjs +1 -1
  94. package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
  95. package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
  96. package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
  97. package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
  98. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  99. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  100. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  101. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  102. package/dist/cjs/components/simple-data-table/private/link.cjs +1 -1
  103. package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -1
  104. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  105. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  106. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  107. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  108. package/dist/cjs/components/slider/index.cjs.map +1 -1
  109. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  110. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  111. package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
  112. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  113. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  114. package/dist/cjs/components/tabs/private/tab.cjs +1 -1
  115. package/dist/cjs/components/tabs/private/tab.cjs.map +1 -1
  116. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  117. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  118. package/dist/cjs/components/textarea/index.cjs +1 -1
  119. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  120. package/dist/cjs/components/toast/index.cjs.map +1 -1
  121. package/dist/cjs/components/tooltip/index.cjs +1 -3
  122. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  123. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  124. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  125. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  126. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  127. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  128. package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
  129. package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
  130. package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
  131. package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
  132. package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
  133. package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
  134. package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
  135. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  136. package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
  137. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  138. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  139. package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
  140. package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
  141. package/dist/cjs/utilities/color.cjs +1 -1
  142. package/dist/cjs/utilities/color.cjs.map +1 -1
  143. package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
  144. package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
  145. package/dist/cjs/utilities/get-aria-props.cjs +1 -1
  146. package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
  147. package/dist/cjs/utilities/get-component-doc.cjs +1 -1
  148. package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
  149. package/dist/cjs/utilities/get-data-props.cjs +1 -1
  150. package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
  151. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
  152. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
  153. package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
  154. package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
  155. package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
  156. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  157. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  158. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  159. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  160. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  161. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  162. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
  163. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
  164. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
  165. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
  166. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
  167. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
  168. package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
  169. package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
  170. package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
  171. package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
  172. package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
  173. package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
  174. package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
  175. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
  176. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
  177. package/dist/cjs/utilities/warning/required-property.cjs +1 -1
  178. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
  179. package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
  180. package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
  181. package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
  182. package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
  183. package/dist/es/components/accordion/index.js +7 -3
  184. package/dist/es/components/accordion/index.js.map +1 -1
  185. package/dist/es/components/accordion/panel.js.map +1 -1
  186. package/dist/es/components/alert/index.js +4 -5
  187. package/dist/es/components/alert/index.js.map +1 -1
  188. package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
  189. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  190. package/dist/es/components/builder-header/toolbar.js.map +1 -1
  191. package/dist/es/components/button/check-props.js +1 -1
  192. package/dist/es/components/button/check-props.js.map +1 -1
  193. package/dist/es/components/button/index.js +50 -50
  194. package/dist/es/components/button/index.js.map +1 -1
  195. package/dist/es/components/button-stateful/check-props.js +1 -1
  196. package/dist/es/components/button-stateful/check-props.js.map +1 -1
  197. package/dist/es/components/button-stateful/index.js +3 -2
  198. package/dist/es/components/button-stateful/index.js.map +1 -1
  199. package/dist/es/components/carousel/index.js +155 -129
  200. package/dist/es/components/carousel/index.js.map +1 -1
  201. package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
  202. package/dist/es/components/carousel/private/carousel-item.js +1 -1
  203. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  204. package/dist/es/components/checkbox/check-props.js +1 -1
  205. package/dist/es/components/checkbox/check-props.js.map +1 -1
  206. package/dist/es/components/checkbox/index.js +102 -100
  207. package/dist/es/components/checkbox/index.js.map +1 -1
  208. package/dist/es/components/color-picker/color-picker.js +150 -151
  209. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  210. package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
  211. package/dist/es/components/color-picker/private/hsv-color.js +16 -20
  212. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  213. package/dist/es/components/color-picker/private/swatch-option.js +2 -2
  214. package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
  215. package/dist/es/components/color-picker/private/swatch.js +1 -1
  216. package/dist/es/components/color-picker/private/swatch.js.map +1 -1
  217. package/dist/es/components/combobox/combobox.js +569 -582
  218. package/dist/es/components/combobox/combobox.js.map +1 -1
  219. package/dist/es/components/combobox/index.js +6 -19
  220. package/dist/es/components/combobox/index.js.map +1 -1
  221. package/dist/es/components/combobox/private/menu.js +3 -3
  222. package/dist/es/components/combobox/private/menu.js.map +1 -1
  223. package/dist/es/components/date-picker/date-picker.js +101 -102
  224. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  225. package/dist/es/components/date-picker/index.js.map +1 -1
  226. package/dist/es/components/date-picker/private/calendar.js.map +1 -1
  227. package/dist/es/components/date-picker/private/day.js +1 -1
  228. package/dist/es/components/date-picker/private/day.js.map +1 -1
  229. package/dist/es/components/files/file.js +5 -6
  230. package/dist/es/components/files/file.js.map +1 -1
  231. package/dist/es/components/files/private/file-actions.js +2 -2
  232. package/dist/es/components/files/private/file-actions.js.map +1 -1
  233. package/dist/es/components/files/private/file-figure.js +1 -1
  234. package/dist/es/components/files/private/file-figure.js.map +1 -1
  235. package/dist/es/components/filter/filter.js +5 -1
  236. package/dist/es/components/filter/filter.js.map +1 -1
  237. package/dist/es/components/icon/check-props.js +9 -7
  238. package/dist/es/components/icon/check-props.js.map +1 -1
  239. package/dist/es/components/icon/index.js +13 -10
  240. package/dist/es/components/icon/index.js.map +1 -1
  241. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  242. package/dist/es/components/icon-settings/index.js.map +1 -1
  243. package/dist/es/components/input/check-props.js +14 -13
  244. package/dist/es/components/input/check-props.js.map +1 -1
  245. package/dist/es/components/input/index.js.map +1 -1
  246. package/dist/es/components/input/private/inner-input.js.map +1 -1
  247. package/dist/es/components/input/search.js.map +1 -1
  248. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  249. package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
  250. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  251. package/dist/es/components/modal/index.js +1 -2
  252. package/dist/es/components/modal/index.js.map +1 -1
  253. package/dist/es/components/panel/filtering/group.js.map +1 -1
  254. package/dist/es/components/pill/index.js.map +1 -1
  255. package/dist/es/components/pill-container/index.js +10 -6
  256. package/dist/es/components/pill-container/index.js.map +1 -1
  257. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  258. package/dist/es/components/popover/index.js.map +1 -1
  259. package/dist/es/components/popover/popover.js +181 -177
  260. package/dist/es/components/popover/popover.js.map +1 -1
  261. package/dist/es/components/progress-indicator/index.js.map +1 -1
  262. package/dist/es/components/progress-indicator/private/step.js.map +1 -1
  263. package/dist/es/components/progress-ring/index.js.map +1 -1
  264. package/dist/es/components/radio/index.js +1 -1
  265. package/dist/es/components/radio/index.js.map +1 -1
  266. package/dist/es/components/radio-group/check-props.js.map +1 -1
  267. package/dist/es/components/radio-group/index.js.map +1 -1
  268. package/dist/es/components/scoped-notification/index.js.map +1 -1
  269. package/dist/es/components/setup-assistant/step.js.map +1 -1
  270. package/dist/es/components/simple-data-table/cell.js +8 -5
  271. package/dist/es/components/simple-data-table/cell.js.map +1 -1
  272. package/dist/es/components/simple-data-table/index.js +97 -91
  273. package/dist/es/components/simple-data-table/index.js.map +1 -1
  274. package/dist/es/components/simple-data-table/interactive-element.js +31 -28
  275. package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
  276. package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
  277. package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
  278. package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
  279. package/dist/es/components/simple-data-table/private/head.js +65 -42
  280. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  281. package/dist/es/components/simple-data-table/private/header-cell.js +2 -1
  282. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  283. package/dist/es/components/simple-data-table/private/link.js.map +1 -1
  284. package/dist/es/components/simple-data-table/private/row.js +96 -60
  285. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  286. package/dist/es/components/simple-data-table/row-actions.js +4 -1
  287. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  288. package/dist/es/components/slider/index.js.map +1 -1
  289. package/dist/es/components/split-view/header.js.map +1 -1
  290. package/dist/es/components/split-view/listbox.js.map +1 -1
  291. package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
  292. package/dist/es/components/tabs/index.js.map +1 -1
  293. package/dist/es/components/tabs/panel.js.map +1 -1
  294. package/dist/es/components/tabs/private/tab.js +1 -1
  295. package/dist/es/components/tabs/private/tab.js.map +1 -1
  296. package/dist/es/components/textarea/check-props.js +1 -1
  297. package/dist/es/components/textarea/check-props.js.map +1 -1
  298. package/dist/es/components/textarea/index.js +29 -42
  299. package/dist/es/components/textarea/index.js.map +1 -1
  300. package/dist/es/components/toast/index.js.map +1 -1
  301. package/dist/es/components/tooltip/index.js +107 -88
  302. package/dist/es/components/tooltip/index.js.map +1 -1
  303. package/dist/es/components/tree/private/branch.js.map +1 -1
  304. package/dist/es/components/tree/private/item.js.map +1 -1
  305. package/dist/es/components/tree/private/render-branch.js +14 -19
  306. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  307. package/dist/es/components/tree/tree.js.map +1 -1
  308. package/dist/es/components/trial-bar/button.js.map +1 -1
  309. package/dist/es/components/trial-bar/dropdown.js.map +1 -1
  310. package/dist/es/components/utilities/dialog/index.js +2 -1
  311. package/dist/es/components/utilities/dialog/index.js.map +1 -1
  312. package/dist/es/components/utilities/dialog/portal.js +5 -3
  313. package/dist/es/components/utilities/dialog/portal.js.map +1 -1
  314. package/dist/es/components/utilities/menu-list/index.js +6 -6
  315. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  316. package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
  317. package/dist/es/components/utilities/menu-list/item.js +42 -18
  318. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  319. package/dist/es/components/utilities/utility-icon/index.js +32 -52
  320. package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
  321. package/dist/es/utilities/color.js +1 -1
  322. package/dist/es/utilities/color.js.map +1 -1
  323. package/dist/es/utilities/dom-element-focus.js.map +1 -1
  324. package/dist/es/utilities/execution-environment.js.map +1 -1
  325. package/dist/es/utilities/get-aria-props.js +1 -1
  326. package/dist/es/utilities/get-aria-props.js.map +1 -1
  327. package/dist/es/utilities/get-component-doc.js +6 -6
  328. package/dist/es/utilities/get-component-doc.js.map +1 -1
  329. package/dist/es/utilities/get-data-props.js +1 -1
  330. package/dist/es/utilities/get-data-props.js.map +1 -1
  331. package/dist/es/utilities/keyboard-navigable-dialog.js +7 -7
  332. package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
  333. package/dist/es/utilities/keyboard-navigate.js +1 -1
  334. package/dist/es/utilities/keyboard-navigate.js.map +1 -1
  335. package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
  336. package/dist/es/utilities/warning/children-as-trigger.js +10 -8
  337. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  338. package/dist/es/utilities/warning/deprecated-property-value.js +12 -10
  339. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  340. package/dist/es/utilities/warning/deprecated-property.js +10 -8
  341. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  342. package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
  343. package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
  344. package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
  345. package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
  346. package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
  347. package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
  348. package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
  349. package/dist/es/utilities/warning/one-of-required-property.js +11 -10
  350. package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
  351. package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
  352. package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
  353. package/dist/es/utilities/warning/removal-version.js +6 -0
  354. package/dist/es/utilities/warning/removal-version.js.map +1 -0
  355. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
  356. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
  357. package/dist/es/utilities/warning/required-property.js +8 -7
  358. package/dist/es/utilities/warning/required-property.js.map +1 -1
  359. package/dist/es/utilities/warning/sunset-property.js +8 -7
  360. package/dist/es/utilities/warning/sunset-property.js.map +1 -1
  361. package/dist/es/utilities/warning/warned-registry.js +10 -0
  362. package/dist/es/utilities/warning/warned-registry.js.map +1 -0
  363. package/dist/llms/components/accordion.md +267 -0
  364. package/dist/llms/components/alert.md +228 -0
  365. package/dist/llms/components/avatar.md +167 -0
  366. package/dist/llms/components/badge.md +153 -0
  367. package/dist/llms/components/breadcrumb.md +148 -0
  368. package/dist/llms/components/builder-header.examples.md +239 -0
  369. package/dist/llms/components/builder-header.md +736 -0
  370. package/dist/llms/components/button-group.md +167 -0
  371. package/dist/llms/components/button-stateful.md +246 -0
  372. package/dist/llms/components/button.md +661 -0
  373. package/dist/llms/components/card.md +368 -0
  374. package/dist/llms/components/carousel.md +365 -0
  375. package/dist/llms/components/checkbox.md +887 -0
  376. package/dist/llms/components/color-picker.md +591 -0
  377. package/dist/llms/components/combobox.examples.md +802 -0
  378. package/dist/llms/components/combobox.md +929 -0
  379. package/dist/llms/components/date-picker.md +546 -0
  380. package/dist/llms/components/docked-composer.md +173 -0
  381. package/dist/llms/components/dynamic-icon.md +226 -0
  382. package/dist/llms/components/expandable-section.md +198 -0
  383. package/dist/llms/components/files.md +337 -0
  384. package/dist/llms/components/filter.md +775 -0
  385. package/dist/llms/components/icon-settings.md +301 -0
  386. package/dist/llms/components/icon.md +1040 -0
  387. package/dist/llms/components/input.md +746 -0
  388. package/dist/llms/components/media-object.md +125 -0
  389. package/dist/llms/components/menu-dropdown.md +732 -0
  390. package/dist/llms/components/modal.md +504 -0
  391. package/dist/llms/components/page-header.md +282 -0
  392. package/dist/llms/components/panel.md +256 -0
  393. package/dist/llms/components/pill-container.md +218 -0
  394. package/dist/llms/components/pill.md +266 -0
  395. package/dist/llms/components/popover.md +600 -0
  396. package/dist/llms/components/portal-settings.md +371 -0
  397. package/dist/llms/components/progress-bar.md +175 -0
  398. package/dist/llms/components/progress-indicator.md +399 -0
  399. package/dist/llms/components/progress-ring.md +146 -0
  400. package/dist/llms/components/radio-button-group.md +285 -0
  401. package/dist/llms/components/radio-group.md +242 -0
  402. package/dist/llms/components/radio.md +269 -0
  403. package/dist/llms/components/scoped-notification.md +156 -0
  404. package/dist/llms/components/setup-assistant.md +398 -0
  405. package/dist/llms/components/simple-data-table.examples.md +2773 -0
  406. package/dist/llms/components/simple-data-table.md +919 -0
  407. package/dist/llms/components/slider.md +217 -0
  408. package/dist/llms/components/spinner.md +232 -0
  409. package/dist/llms/components/split-view.md +350 -0
  410. package/dist/llms/components/tabs.md +311 -0
  411. package/dist/llms/components/textarea.md +331 -0
  412. package/dist/llms/components/toast.md +267 -0
  413. package/dist/llms/components/tooltip.md +470 -0
  414. package/dist/llms/components/tree.md +1011 -0
  415. package/dist/llms/components/trial-bar.md +383 -0
  416. package/dist/llms/components/vertical-navigation.md +196 -0
  417. package/dist/llms/components/visual-picker.md +362 -0
  418. package/dist/llms/components/welcome-mat.md +885 -0
  419. package/dist/llms/docs/migration-v11.md +471 -0
  420. package/dist/llms/llms-full.txt +6874 -0
  421. package/dist/llms/llms.txt +133 -0
  422. package/dist/llms/rules.md +36 -0
  423. package/dist/types/components/accordion/index.d.ts.map +1 -1
  424. package/dist/types/components/accordion/panel.d.ts +7 -7
  425. package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
  426. package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
  427. package/dist/types/components/builder-header/nav-link.d.ts +0 -1
  428. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  429. package/dist/types/components/builder-header/toolbar.d.ts +0 -1
  430. package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
  431. package/dist/types/components/button/index.d.ts +19 -6
  432. package/dist/types/components/button/index.d.ts.map +1 -1
  433. package/dist/types/components/button-stateful/index.d.ts +8 -2
  434. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  435. package/dist/types/components/carousel/index.d.ts +7 -1
  436. package/dist/types/components/carousel/index.d.ts.map +1 -1
  437. package/dist/types/components/checkbox/index.d.ts +22 -5
  438. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  439. package/dist/types/components/color-picker/color-picker.d.ts +6 -4
  440. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  441. package/dist/types/components/color-picker/types.d.ts +2 -2
  442. package/dist/types/components/combobox/combobox.d.ts +22 -0
  443. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  444. package/dist/types/components/combobox/index.d.ts +1 -1
  445. package/dist/types/components/combobox/index.d.ts.map +1 -1
  446. package/dist/types/components/date-picker/date-picker.d.ts +16 -4
  447. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  448. package/dist/types/components/date-picker/index.d.ts +2 -6
  449. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  450. package/dist/types/components/files/file.d.ts +5 -0
  451. package/dist/types/components/files/file.d.ts.map +1 -1
  452. package/dist/types/components/icon/index.d.ts +8 -1
  453. package/dist/types/components/icon/index.d.ts.map +1 -1
  454. package/dist/types/components/icon/input-icon/index.d.ts +3 -0
  455. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  456. package/dist/types/components/icon-settings/index.d.ts.map +1 -1
  457. package/dist/types/components/input/index.d.ts +10 -6
  458. package/dist/types/components/input/index.d.ts.map +1 -1
  459. package/dist/types/components/input/search.d.ts.map +1 -1
  460. package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
  461. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  462. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +13 -3
  463. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  464. package/dist/types/components/modal/index.d.ts +5 -5
  465. package/dist/types/components/modal/index.d.ts.map +1 -1
  466. package/dist/types/components/page-header/types.d.ts +3 -0
  467. package/dist/types/components/page-header/types.d.ts.map +1 -1
  468. package/dist/types/components/panel/filtering/group.d.ts +2 -0
  469. package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
  470. package/dist/types/components/pill/index.d.ts +1 -0
  471. package/dist/types/components/pill/index.d.ts.map +1 -1
  472. package/dist/types/components/popover/edit-dialog.d.ts +1 -3
  473. package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
  474. package/dist/types/components/popover/index.d.ts.map +1 -1
  475. package/dist/types/components/popover/popover.d.ts +1 -0
  476. package/dist/types/components/popover/popover.d.ts.map +1 -1
  477. package/dist/types/components/progress-indicator/index.d.ts +1 -0
  478. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  479. package/dist/types/components/progress-ring/index.d.ts +1 -0
  480. package/dist/types/components/progress-ring/index.d.ts.map +1 -1
  481. package/dist/types/components/radio/index.d.ts +11 -4
  482. package/dist/types/components/radio/index.d.ts.map +1 -1
  483. package/dist/types/components/radio-group/index.d.ts +5 -3
  484. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  485. package/dist/types/components/scoped-notification/index.d.ts +1 -0
  486. package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
  487. package/dist/types/components/setup-assistant/step.d.ts +0 -1
  488. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  489. package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
  490. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  491. package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
  492. package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
  493. package/dist/types/components/simple-data-table/types.d.ts +11 -2
  494. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  495. package/dist/types/components/slider/index.d.ts +6 -4
  496. package/dist/types/components/slider/index.d.ts.map +1 -1
  497. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  498. package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
  499. package/dist/types/components/tabs/index.d.ts +1 -0
  500. package/dist/types/components/tabs/index.d.ts.map +1 -1
  501. package/dist/types/components/tabs/panel.d.ts +2 -1
  502. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  503. package/dist/types/components/textarea/index.d.ts +12 -40
  504. package/dist/types/components/textarea/index.d.ts.map +1 -1
  505. package/dist/types/components/toast/index.d.ts.map +1 -1
  506. package/dist/types/components/tooltip/index.d.ts +5 -0
  507. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  508. package/dist/types/components/tree/tree.d.ts +5 -0
  509. package/dist/types/components/tree/tree.d.ts.map +1 -1
  510. package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
  511. package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
  512. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  513. package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
  514. package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
  515. package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
  516. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  517. package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
  518. package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
  519. package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
  520. package/dist/types/types/common.d.ts.map +1 -1
  521. package/dist/types/types/components.d.ts.map +1 -1
  522. package/package.json +9 -7
  523. package/dist/cjs/icons/action/index.cjs +0 -2
  524. package/dist/cjs/icons/action/index.cjs.map +0 -1
  525. package/dist/cjs/icons/custom/index.cjs +0 -2
  526. package/dist/cjs/icons/custom/index.cjs.map +0 -1
  527. package/dist/cjs/icons/doctype/index.cjs +0 -2
  528. package/dist/cjs/icons/doctype/index.cjs.map +0 -1
  529. package/dist/cjs/icons/standard/index.cjs +0 -2
  530. package/dist/cjs/icons/standard/index.cjs.map +0 -1
  531. package/dist/cjs/icons/utility/index.cjs +0 -2
  532. package/dist/cjs/icons/utility/index.cjs.map +0 -1
  533. package/dist/es/icons/action/index.js +0 -6
  534. package/dist/es/icons/action/index.js.map +0 -1
  535. package/dist/es/icons/custom/index.js +0 -6
  536. package/dist/es/icons/custom/index.js.map +0 -1
  537. package/dist/es/icons/doctype/index.js +0 -6
  538. package/dist/es/icons/doctype/index.js.map +0 -1
  539. package/dist/es/icons/standard/index.js +0 -6
  540. package/dist/es/icons/standard/index.js.map +0 -1
  541. package/dist/es/icons/utility/index.js +0 -6
  542. package/dist/es/icons/utility/index.js.map +0 -1
  543. package/dist/types/icons/action/index.d.ts +0 -3
  544. package/dist/types/icons/action/index.d.ts.map +0 -1
  545. package/dist/types/icons/custom/index.d.ts +0 -3
  546. package/dist/types/icons/custom/index.d.ts.map +0 -1
  547. package/dist/types/icons/doctype/index.d.ts +0 -3
  548. package/dist/types/icons/doctype/index.d.ts.map +0 -1
  549. package/dist/types/icons/standard/index.d.ts +0 -3
  550. package/dist/types/icons/standard/index.d.ts.map +0 -1
  551. package/dist/types/icons/utility/index.d.ts +0 -3
  552. package/dist/types/icons/utility/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"group.cjs","names":[],"sources":["../../../../../components/panel/filtering/group.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// # Panel Filter Group\n\n// Implements the Filter part of [Panel design pattern](https://www.lightningdesignsystem.com/components/panels) in React.\n// Based on SLDS v2.2.0-rc.1\n\n// ## Dependencies\n\n// ### React\nimport React, { type ReactNode, type MouseEvent } from 'react';\n\nimport checkProps from './check-props';\n\nimport PanelFilteringFooter from './private/panel-footer';\nimport PanelHeader from './private/panel-header';\n\n// ## Constants\nimport { PANEL_FILTER_GROUP } from '../../../utilities/constants';\n\nexport interface PanelFilterGroupAssistiveText {\n\t/** Localized description of the close button for the panel for screen readers */\n\tcloseButton?: string;\n}\n\ninterface PanelFilterGroupBaseProps {\n\t/**\n\t * **Assistive text for accessibility.**\n\t * This object is merged with the default props object on every render.\n\t * * `closeButton`: Localized description of the close button for the panel for screen readers\n\t */\n\tassistiveText?: PanelFilterGroupAssistiveText;\n\t/**\n\t * Localized description of the \"Add Filter\" button in the footer\n\t */\n\taddFilterLabel?: ReactNode;\n\t/**\n\t * Label for button that cancels modified filters\n\t */\n\tcancelLabel?: string;\n\t/**\n\t * Pass in `FilterList`'s of `Filters`:\n\t *\n\t * ```\n\t * <FilterGroup\n\t * variant=\"panel\"\n\t * >\n\t * <FilterList>\n\t * <Filter\n\t * property=\"Show Me\"\n\t * predicate=\"All Wackamoles\"\n\t * >\n\t * {popoverContents}\n\t * </Filter>\n\t * </FilterList>\n\t * </FilterGroup>\n\t * ```\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Label for the error message at the top of the panel.\n\t */\n\terrorLabel?: string;\n\t/**\n\t * The heading within the header of the filtering panel\n\t */\n\theading?: ReactNode | string;\n\t/**\n\t * Localized description of the \"Remove All\" button in the footer\n\t */\n\tremoveAllLabel?: ReactNode;\n\t/**\n\t * Label for button that saves modified filters\n\t */\n\tsaveLabel?: string;\n}\n\n/** Panel-only callbacks and state, used by the built-in header and footer. */\ninterface PanelFilterGroupPanelProps {\n\t/**\n\t * Adds in default Panel header and footer\n\t */\n\tvariant: 'panel';\n\t/**\n\t * Shows confirmation heading. Please see `onRequestCancel` and `onRequestSave`.\n\t */\n\tmodified?: boolean;\n\t/**\n\t * Callback triggered when \"Add Filter\" is clicked. Recieves an `event`.\n\t */\n\tonClickAdd?: (event: MouseEvent) => void;\n\t/**\n\t * Callback triggered when \"Remove All\" is clicked. Recieves an `event`.\n\t */\n\tonClickRemoveAll?: (event: MouseEvent) => void;\n\t/**\n\t * When the panel's cancel button is clicked in order to reset filter panel to previous state.\n\t */\n\tonRequestCancel?: (event: MouseEvent) => void;\n\t/**\n\t * When the panel's close button is clicked. Please place Panel within another element to control position and visibility.\n\t */\n\tonRequestClose?: (event: MouseEvent) => void;\n\t/**\n\t * When the panel's save button is clicked in order to confirm filter panel state.\n\t */\n\tonRequestSave?: (event: MouseEvent) => void;\n\theader?: never;\n\tfooter?: never;\n}\n\n/** A filter group outside a panel: bring your own `header` and `footer`. */\ninterface PanelFilterGroupSlotProps {\n\tvariant?: undefined;\n\t/**\n\t * Allows for customization of header. This will be added before any `FilterList`'s in the DOM. If using Panel Filter Group outside of a panel, do not set the variant to `panel` and header and footer will be removed.\n\t */\n\theader?: ReactNode;\n\t/**\n\t * Allows for customization of footer. This will be added after any `FilterList`'s in the DOM. If using Panel Filter Group outside of a panel, do not set the variant to `panel` and header and footer will be removed.\n\t */\n\tfooter?: ReactNode;\n\tmodified?: never;\n\tonClickAdd?: never;\n\tonClickRemoveAll?: never;\n\tonRequestCancel?: never;\n\tonRequestClose?: never;\n\tonRequestSave?: never;\n}\n\n/**\n * Props for PanelFilterGroup: `variant=\"panel\"` renders the default header and\n * footer (and their callbacks); without it, pass `header` and `footer`.\n */\nexport type PanelFilterGroupProps = PanelFilterGroupBaseProps &\n\t(PanelFilterGroupPanelProps | PanelFilterGroupSlotProps);\n\nconst defaultProps = {\n\taddFilterLabel: 'Add Filter',\n\tcancelLabel: 'Cancel',\n\tassistiveText: {\n\t\tcloseButton: 'Close Filter Panel',\n\t},\n\theading: 'Filter',\n\tsaveLabel: 'Save',\n\tremoveAllLabel: 'Remove All',\n};\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported by `checkProps`.\n */\ninterface PanelFilterGroupRemovedProps {\n\tassistiveTextCloseFilterPanel?: unknown;\n}\n\n/**\n * A filtering panel contextual filtering options.\n */\nconst PanelFilterGroup = ({\n\tchildren,\n\terrorLabel,\n\tfooter,\n\theader,\n\tvariant,\n\taddFilterLabel = defaultProps.addFilterLabel,\n\tonClickAdd,\n\tonClickRemoveAll,\n\tremoveAllLabel = defaultProps.removeAllLabel,\n\tcancelLabel = defaultProps.cancelLabel,\n\theading = defaultProps.heading,\n\tmodified,\n\tonRequestCancel,\n\tonRequestClose,\n\tonRequestSave,\n\tsaveLabel = defaultProps.saveLabel,\n\tassistiveText = defaultProps.assistiveText,\n\tassistiveTextCloseFilterPanel,\n}: PanelFilterGroupProps &\n\tPanelFilterGroupRemovedProps): React.ReactElement => {\n\t(checkProps as (name: string, props: unknown, doc?: unknown) => void)(\n\t\tPANEL_FILTER_GROUP,\n\t\t{\n\t\t\tchildren,\n\t\t\terrorLabel,\n\t\t\tfooter,\n\t\t\theader,\n\t\t\tvariant,\n\t\t\taddFilterLabel,\n\t\t\tonClickAdd,\n\t\t\tonClickRemoveAll,\n\t\t\tremoveAllLabel,\n\t\t\tcancelLabel,\n\t\t\theading,\n\t\t\tmodified,\n\t\t\tonRequestCancel,\n\t\t\tonRequestClose,\n\t\t\tonRequestSave,\n\t\t\tsaveLabel,\n\t\t\tassistiveText,\n\t\t\tassistiveTextCloseFilterPanel,\n\t\t}\n\t);\n\n\tconst mergedAssistiveText: PanelFilterGroupAssistiveText = {\n\t\t...defaultProps.assistiveText,\n\t\t...assistiveText,\n\t};\n\treturn (\n\t\t<div className=\"slds-filters\">\n\t\t\t{variant === 'panel' ? (\n\t\t\t\t<PanelHeader\n\t\t\t\t\tassistiveText={mergedAssistiveText}\n\t\t\t\t\tcancelLabel={cancelLabel}\n\t\t\t\t\theading={heading}\n\t\t\t\t\tmodified={modified}\n\t\t\t\t\tonRequestCancel={onRequestCancel}\n\t\t\t\t\tonRequestClose={onRequestClose}\n\t\t\t\t\tonRequestSave={onRequestSave}\n\t\t\t\t\tsaveLabel={saveLabel}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\theader || null\n\t\t\t)}\n\t\t\t<div className=\"slds-filters__body\">\n\t\t\t\t{errorLabel ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"slds-text-color_error slds-m-bottom_x-small\"\n\t\t\t\t\t\trole=\"alert\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{errorLabel}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{variant === 'panel' ? (\n\t\t\t\t<PanelFilteringFooter\n\t\t\t\t\taddFilterLabel={addFilterLabel}\n\t\t\t\t\tonClickAdd={onClickAdd as (event: MouseEvent) => void}\n\t\t\t\t\tonClickRemoveAll={onClickRemoveAll as (event: MouseEvent) => void}\n\t\t\t\t\tremoveAllLabel={removeAllLabel}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\tfooter || null\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nPanelFilterGroup.displayName = PANEL_FILTER_GROUP;\n\nexport default PanelFilterGroup;\n"],"mappings":"mSA0IA,IAAM,EAAe,CACpB,eAAgB,aAChB,YAAa,SACb,cAAe,CACd,YAAa,oBACd,EACA,QAAS,SACT,UAAW,OACX,eAAgB,YACjB,EAaM,GAAoB,CACzB,WACA,aACA,SACA,SACA,UACA,iBAAiB,EAAa,eAC9B,aACA,mBACA,iBAAiB,EAAa,eAC9B,cAAc,EAAa,YAC3B,UAAU,EAAa,QACvB,WACA,kBACA,iBACA,gBACA,YAAY,EAAa,UACzB,gBAAgB,EAAa,cAC7B,mCAEqD,CACrD,EAAA,QACC,EAAA,mBACA,CACC,WACA,aACA,SACA,SACA,UACA,iBACA,aACA,mBACA,iBACA,cACA,UACA,WACA,kBACA,iBACA,gBACA,YACA,gBACA,+BACD,CACD,EAEA,IAAM,EAAqD,CAC1D,GAAG,EAAa,cAChB,GAAG,CACJ,EACA,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,eAAf,SAAA,CACE,IAAY,SACZ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,EACF,cACJ,UACC,WACO,kBACD,iBACD,gBACJ,WACX,CAAA,EAED,GAAU,MAEX,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,qBAAf,SAAA,CACE,GACA,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,UAAU,8CACV,KAAK,QAEJ,SAAA,CACG,CAAA,EACF,KACH,CACG,IACJ,IAAY,SACZ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACiB,iBACJ,aACM,mBACF,gBAChB,CAAA,EAED,GAAU,IAEP,GAEP,EAEA,EAAiB,YAAc,EAAA"}
1
+ {"version":3,"file":"group.cjs","names":[],"sources":["../../../../../components/panel/filtering/group.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// # Panel Filter Group\n\n// Implements the Filter part of [Panel design pattern](https://www.lightningdesignsystem.com/components/panels) in React.\n// Based on SLDS v2.2.0-rc.1\n\n// ## Dependencies\n\n// ### React\nimport React, { type ReactNode, type MouseEvent } from 'react';\n\nimport checkProps from './check-props';\n\nimport PanelFilteringFooter from './private/panel-footer';\nimport PanelHeader from './private/panel-header';\n\n// ## Constants\nimport { PANEL_FILTER_GROUP } from '../../../utilities/constants';\n\nexport interface PanelFilterGroupAssistiveText {\n\t/** Localized description of the close button for the panel for screen readers */\n\tcloseButton?: string;\n}\n\ninterface PanelFilterGroupBaseProps {\n\t/**\n\t * **Assistive text for accessibility.**\n\t * This object is merged with the default props object on every render.\n\t * * `closeButton`: Localized description of the close button for the panel for screen readers\n\t */\n\tassistiveText?: PanelFilterGroupAssistiveText;\n\t/**\n\t * Localized description of the \"Add Filter\" button in the footer\n\t */\n\taddFilterLabel?: ReactNode;\n\t/**\n\t * Label for button that cancels modified filters\n\t */\n\tcancelLabel?: string;\n\t/**\n\t * Pass in `FilterList`'s of `Filters`:\n\t *\n\t * ```\n\t * <FilterGroup\n\t * variant=\"panel\"\n\t * >\n\t * <FilterList>\n\t * <Filter\n\t * property=\"Show Me\"\n\t * predicate=\"All Wackamoles\"\n\t * >\n\t * {popoverContents}\n\t * </Filter>\n\t * </FilterList>\n\t * </FilterGroup>\n\t * ```\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Label for the error message at the top of the panel.\n\t */\n\terrorLabel?: string;\n\t/**\n\t * The heading within the header of the filtering panel\n\t */\n\theading?: ReactNode | string;\n\t/**\n\t * Localized description of the \"Remove All\" button in the footer\n\t */\n\tremoveAllLabel?: ReactNode;\n\t/**\n\t * Label for button that saves modified filters\n\t */\n\tsaveLabel?: string;\n}\n\n/** Panel-only callbacks and state, used by the built-in header and footer. */\ninterface PanelFilterGroupPanelProps {\n\t/**\n\t * Adds in default Panel header and footer\n\t */\n\tvariant: 'panel';\n\t/**\n\t * Shows confirmation heading. Please see `onRequestCancel` and `onRequestSave`.\n\t */\n\tmodified?: boolean;\n\t/**\n\t * Callback triggered when \"Add Filter\" is clicked. Recieves an `event`.\n\t */\n\tonClickAdd?: (event: MouseEvent) => void;\n\t/**\n\t * Callback triggered when \"Remove All\" is clicked. Recieves an `event`.\n\t */\n\tonClickRemoveAll?: (event: MouseEvent) => void;\n\t/**\n\t * When the panel's cancel button is clicked in order to reset filter panel to previous state.\n\t */\n\tonRequestCancel?: (event: MouseEvent) => void;\n\t/**\n\t * When the panel's close button is clicked. Please place Panel within another element to control position and visibility.\n\t */\n\tonRequestClose?: (event: MouseEvent) => void;\n\t/**\n\t * When the panel's save button is clicked in order to confirm filter panel state.\n\t */\n\tonRequestSave?: (event: MouseEvent) => void;\n\theader?: never;\n\tfooter?: never;\n}\n\n/** A filter group outside a panel: bring your own `header` and `footer`. */\ninterface PanelFilterGroupSlotProps {\n\t/** Unset outside a panel, so the default header and footer aren't rendered. */\n\tvariant?: undefined;\n\t/**\n\t * Allows for customization of header. This will be added before any `FilterList`'s in the DOM. If using Panel Filter Group outside of a panel, do not set the variant to `panel` and header and footer will be removed.\n\t */\n\theader?: ReactNode;\n\t/**\n\t * Allows for customization of footer. This will be added after any `FilterList`'s in the DOM. If using Panel Filter Group outside of a panel, do not set the variant to `panel` and header and footer will be removed.\n\t */\n\tfooter?: ReactNode;\n\tmodified?: never;\n\tonClickAdd?: never;\n\tonClickRemoveAll?: never;\n\tonRequestCancel?: never;\n\tonRequestClose?: never;\n\tonRequestSave?: never;\n}\n\n/**\n * Props for PanelFilterGroup: `variant=\"panel\"` renders the default header and\n * footer (and their callbacks); without it, pass `header` and `footer`.\n */\nexport type PanelFilterGroupProps = PanelFilterGroupBaseProps &\n\t(PanelFilterGroupPanelProps | PanelFilterGroupSlotProps);\n\nconst defaultProps = {\n\taddFilterLabel: 'Add Filter',\n\tcancelLabel: 'Cancel',\n\tassistiveText: {\n\t\tcloseButton: 'Close Filter Panel',\n\t},\n\theading: 'Filter',\n\tsaveLabel: 'Save',\n\tremoveAllLabel: 'Remove All',\n};\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported by `checkProps`.\n */\ninterface PanelFilterGroupRemovedProps {\n\t/** @deprecated Removed and ignored. Use `assistiveText.closeButton`. */\n\tassistiveTextCloseFilterPanel?: unknown;\n}\n\n/**\n * A filtering panel contextual filtering options.\n */\nconst PanelFilterGroup = ({\n\tchildren,\n\terrorLabel,\n\tfooter,\n\theader,\n\tvariant,\n\taddFilterLabel = defaultProps.addFilterLabel,\n\tonClickAdd,\n\tonClickRemoveAll,\n\tremoveAllLabel = defaultProps.removeAllLabel,\n\tcancelLabel = defaultProps.cancelLabel,\n\theading = defaultProps.heading,\n\tmodified,\n\tonRequestCancel,\n\tonRequestClose,\n\tonRequestSave,\n\tsaveLabel = defaultProps.saveLabel,\n\tassistiveText = defaultProps.assistiveText,\n\tassistiveTextCloseFilterPanel,\n}: PanelFilterGroupProps &\n\tPanelFilterGroupRemovedProps): React.ReactElement => {\n\t(checkProps as (name: string, props: unknown, doc?: unknown) => void)(\n\t\tPANEL_FILTER_GROUP,\n\t\t{\n\t\t\tchildren,\n\t\t\terrorLabel,\n\t\t\tfooter,\n\t\t\theader,\n\t\t\tvariant,\n\t\t\taddFilterLabel,\n\t\t\tonClickAdd,\n\t\t\tonClickRemoveAll,\n\t\t\tremoveAllLabel,\n\t\t\tcancelLabel,\n\t\t\theading,\n\t\t\tmodified,\n\t\t\tonRequestCancel,\n\t\t\tonRequestClose,\n\t\t\tonRequestSave,\n\t\t\tsaveLabel,\n\t\t\tassistiveText,\n\t\t\tassistiveTextCloseFilterPanel,\n\t\t}\n\t);\n\n\tconst mergedAssistiveText: PanelFilterGroupAssistiveText = {\n\t\t...defaultProps.assistiveText,\n\t\t...assistiveText,\n\t};\n\treturn (\n\t\t<div className=\"slds-filters\">\n\t\t\t{variant === 'panel' ? (\n\t\t\t\t<PanelHeader\n\t\t\t\t\tassistiveText={mergedAssistiveText}\n\t\t\t\t\tcancelLabel={cancelLabel}\n\t\t\t\t\theading={heading}\n\t\t\t\t\tmodified={modified}\n\t\t\t\t\tonRequestCancel={onRequestCancel}\n\t\t\t\t\tonRequestClose={onRequestClose}\n\t\t\t\t\tonRequestSave={onRequestSave}\n\t\t\t\t\tsaveLabel={saveLabel}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\theader || null\n\t\t\t)}\n\t\t\t<div className=\"slds-filters__body\">\n\t\t\t\t{errorLabel ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"slds-text-color_error slds-m-bottom_x-small\"\n\t\t\t\t\t\trole=\"alert\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{errorLabel}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{variant === 'panel' ? (\n\t\t\t\t<PanelFilteringFooter\n\t\t\t\t\taddFilterLabel={addFilterLabel}\n\t\t\t\t\tonClickAdd={onClickAdd as (event: MouseEvent) => void}\n\t\t\t\t\tonClickRemoveAll={onClickRemoveAll as (event: MouseEvent) => void}\n\t\t\t\t\tremoveAllLabel={removeAllLabel}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\tfooter || null\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nPanelFilterGroup.displayName = PANEL_FILTER_GROUP;\n\nexport default PanelFilterGroup;\n"],"mappings":"mSA2IA,IAAM,EAAe,CACpB,eAAgB,aAChB,YAAa,SACb,cAAe,CACd,YAAa,oBACd,EACA,QAAS,SACT,UAAW,OACX,eAAgB,YACjB,EAcM,GAAoB,CACzB,WACA,aACA,SACA,SACA,UACA,iBAAiB,EAAa,eAC9B,aACA,mBACA,iBAAiB,EAAa,eAC9B,cAAc,EAAa,YAC3B,UAAU,EAAa,QACvB,WACA,kBACA,iBACA,gBACA,YAAY,EAAa,UACzB,gBAAgB,EAAa,cAC7B,mCAEqD,CACrD,EAAA,QACC,EAAA,mBACA,CACC,WACA,aACA,SACA,SACA,UACA,iBACA,aACA,mBACA,iBACA,cACA,UACA,WACA,kBACA,iBACA,gBACA,YACA,gBACA,+BACD,CACD,EAEA,IAAM,EAAqD,CAC1D,GAAG,EAAa,cAChB,GAAG,CACJ,EACA,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,eAAf,SAAA,CACE,IAAY,SACZ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,EACF,cACJ,UACC,WACO,kBACD,iBACD,gBACJ,WACX,CAAA,EAED,GAAU,MAEX,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,qBAAf,SAAA,CACE,GACA,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,UAAU,8CACV,KAAK,QAEJ,SAAA,CACG,CAAA,EACF,KACH,CACG,IACJ,IAAY,SACZ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACiB,iBACJ,aACM,mBACF,gBAChB,CAAA,EAED,GAAU,IAEP,GAEP,EAEA,EAAiB,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/pill/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 {\n\tuseRef,\n\tuseCallback,\n\tuseImperativeHandle,\n\tforwardRef,\n\ttype ReactNode,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FocusEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport { PILL } from '../../utilities/constants';\nimport UtilityIcon from '../utilities/utility-icon';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Pill variant types\n */\nexport type PillVariant = 'link' | 'option';\n\n/**\n * Assistive text for Pill\n */\nexport interface PillAssistiveText {\n\t/** Remove button assistive text */\n\tremove?: string;\n}\n\n/**\n * Labels for Pill\n */\nexport interface PillLabels {\n\t/** Pill label text */\n\tlabel?: string;\n\t/** Title tooltip */\n\ttitle?: string;\n\t/** Remove icon title */\n\tremoveTitle?: string;\n}\n\n/** Props every Pill takes. */\ninterface PillBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillAssistiveText;\n\t/** Use bare styling */\n\tbare?: boolean;\n\t/** CSS classes for the pill */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Show error styling */\n\thasError?: boolean;\n\t/** Blur callback */\n\tonBlur?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Click callback */\n\tonClick?: (event?: MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void;\n\t/** Focus callback */\n\tonFocus?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Keydown callback */\n\tonKeyDown?: (event: KeyboardEvent<HTMLSpanElement>) => void;\n\t/** Remove callback */\n\tonRemove?: () => void;\n\t/** Tab order index. Applied to the root element so the pill can receive focus (e.g. roving tabindex for pill navigation). */\n\ttabIndex?: number;\n\t/** Marks the pill as selected. Used when the pill acts as a listbox `option`. */\n\t'aria-selected'?: boolean | 'true' | 'false';\n}\n\n/** A link pill, and the default. Only a link takes `href`. */\ninterface PillLinkVariantProps {\n\t/** Pill variant */\n\tvariant?: 'link';\n\t/** URL for the link. Defaults to `#`, which does not navigate. */\n\thref?: string;\n}\n\n/** A listbox option pill. */\ninterface PillOptionVariantProps {\n\t/** Pill variant */\n\tvariant: 'option';\n\thref?: never;\n}\n\n/** A pill shows an icon or an avatar, not both. */\ntype PillFigureProps =\n\t| {\n\t\t\t/** Icon element to display */\n\t\t\ticon?: ReactNode;\n\t\t\tavatar?: never;\n\t }\n\t| {\n\t\t\t/** Avatar element to display */\n\t\t\tavatar?: ReactNode;\n\t\t\ticon?: never;\n\t };\n\n/** A pill shows `labels.label` or custom `children`, not both. */\ntype PillContentProps =\n\t| {\n\t\t\t/** Text labels */\n\t\t\tlabels: PillLabels & { label: string };\n\t\t\tchildren?: never;\n\t }\n\t| {\n\t\t\t/** Text labels */\n\t\t\tlabels?: Omit<PillLabels, 'label'> & { label?: undefined };\n\t\t\t/** Custom content, shown when there is no `labels.label` */\n\t\t\tchildren?: ReactNode;\n\t };\n\n/**\n * Props for the Pill component: `href` is link-only, `icon` and `avatar` are\n * exclusive, and so are `labels.label` and `children`.\n */\nexport type PillProps = PillBaseProps &\n\t(PillLinkVariantProps | PillOptionVariantProps) &\n\tPillFigureProps &\n\tPillContentProps;\n\n/**\n * Ref methods for Pill\n */\nexport interface PillRef {\n\t/** Remove focus from the pill */\n\tblur: () => void;\n\t/** Give focus to the pill */\n\tfocus: () => void;\n}\n\nconst defaultLabels: PillLabels = {};\nconst defaultAssistiveText: PillAssistiveText = {};\n\n/**\n * A pill displays a label that can contain links and can be removed from view.\n */\nconst Pill = forwardRef<PillRef, PillProps>(\n\t(\n\t\t{\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tavatar,\n\t\t\tbare,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\thasError,\n\t\t\thref,\n\t\t\ticon,\n\t\t\tlabels: propLabels,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonRemove,\n\t\t\ttabIndex,\n\t\t\t'aria-selected': ariaSelected,\n\t\t\tvariant = 'link',\n\t\t},\n\t\tref\n\t) => {\n\t\tconst rootRef = useRef<HTMLSpanElement | null>(null);\n\t\tconst labels = { ...defaultLabels, ...propLabels };\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Expose focus/blur methods via ref\n\t\tuseImperativeHandle(ref, () => ({\n\t\t\tblur: () => rootRef.current?.blur(),\n\t\t\tfocus: () => rootRef.current?.focus(),\n\t\t}));\n\n\t\tconst getHref = useCallback(() => {\n\t\t\treturn typeof href === 'string' ? href : '#';\n\t\t}, [href]);\n\n\t\tconst handleKeyDown = useCallback(\n\t\t\t(event: KeyboardEvent<HTMLSpanElement>) => {\n\t\t\t\tonKeyDown?.(event);\n\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\tswitch (event.key) {\n\t\t\t\t\tcase KEYS.ENTER:\n\t\t\t\t\t\tif (onClick) {\n\t\t\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\t\t\tonClick();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KEYS.BACKSPACE:\n\t\t\t\t\tcase KEYS.DELETE:\n\t\t\t\t\t\tif (onRemove) {\n\t\t\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onClick, onKeyDown, onRemove]\n\t\t);\n\n\t\tconst handleLinkClick = useCallback(\n\t\t\t(event: MouseEvent<HTMLAnchorElement>) => {\n\t\t\t\tif (getHref() === '#') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\tonClick?.(event);\n\t\t\t},\n\t\t\t[getHref, onClick]\n\t\t);\n\n\t\t// Render icon or avatar\n\t\tconst renderIcon = () => {\n\t\t\tconst iconElement = icon || avatar;\n\t\t\tif (iconElement) {\n\t\t\t\treturn <span className=\"slds-pill__icon_container\">{iconElement}</span>;\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\n\t\t// Render label or children\n\t\tconst renderLabel = () => {\n\t\t\tif (labels.label) {\n\t\t\t\tif (variant === 'link') {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref={getHref()}\n\t\t\t\t\t\t\tclassName=\"slds-pill__action\"\n\t\t\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t\t\t\tonClick={handleLinkClick}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"slds-pill__label\">{labels.label}</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"slds-pill__label\"\n\t\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t\t>\n\t\t\t\t\t\t{labels.label}\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn children;\n\t\t};\n\n\t\t// Render remove icon\n\t\tconst renderRemoveIcon = () => {\n\t\t\tif (onRemove) {\n\t\t\t\treturn (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"slds-icon_container slds-pill__remove\"\n\t\t\t\t\t\ttitle={labels.removeTitle}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t>\n\t\t\t\t\t\t<UtilityIcon\n\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tclassName=\"slds-icon slds-icon_x-small slds-icon-text-default\"\n\t\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{assistiveText.remove || labels.removeTitle}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\n\t\t// Determine role\n\t\tlet role: string | undefined;\n\t\t// A link pill with `labels.label` renders an `<a>`, which is the interactive element; a\n\t\t// `role=\"button\"` around it would nest one control in another. Without a label there is\n\t\t// no `<a>`, so the pill itself is the button.\n\t\tif (variant === 'link' && !labels.label) {\n\t\t\trole = 'button';\n\t\t} else if (variant === 'option') {\n\t\t\trole = 'option';\n\t\t}\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\tref={rootRef}\n\t\t\t\trole={role}\n\t\t\t\taria-selected={ariaSelected}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-pill',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-pill_link': variant === 'link',\n\t\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t\t'slds-pill_bare': bare,\n\t\t\t\t\t},\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tonClick={!labels.label || variant !== 'link' ? onClick : undefined}\n\t\t\t\tonKeyDown={onRemove ? handleKeyDown : undefined}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tonFocus={onFocus}\n\t\t\t>\n\t\t\t\t{renderIcon()}\n\t\t\t\t{renderLabel()}\n\t\t\t\t{renderRemoveIcon()}\n\t\t\t</span>\n\t\t);\n\t}\n);\n\nPill.displayName = PILL;\n\nexport default Pill;\n"],"mappings":"uaAmIA,IAAM,EAA4B,CAAC,EAC7B,EAA0C,CAAC,EAK3C,GAAA,EAAO,EAAA,WAAA,EAEX,CACC,cAAe,EACf,SACA,OACA,WACA,YACA,WACA,OACA,OACA,OAAQ,EACR,SACA,UACA,UACA,YACA,WACA,WACA,gBAAiB,EACjB,UAAU,QAEX,IACI,CACJ,IAAM,GAAA,EAAU,EAAA,OAAA,CAA+B,IAAI,EAC7C,EAAS,CAAE,GAAG,E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AA,KAAA,CAAC,OAAD,CACC,UAAU,wCACV,MAAO,EAAO,YACd,KAAK,SACL,QAAS,EAJV,SAAA,EAMC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,MAAO,CAAE,OAAQ,SAAU,EAC3B,SAAS,UACT,UAAU,qDACV,KAAK,OACL,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBACd,SAAA,EAAc,QAAU,EAAO,WAC3B,CAAA,CACD,IAGD,KAIJ,EAUJ,OANI,IAAY,QAAU,CAAC,EAAO,MACjC,EAAO,SACG,IAAY,WACtB,EAAO,WAIP,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,IAAK,EACC,OACN,gBAAe,EACL,WACV,WAAA,EAAW,EAAA,QAAA,CACV,YACA,CACC,iBAAkB,IAAY,OAC9B,iBAAkB,EAClB,iBAAkB,CACnB,EACA,CACD,EACA,QAAS,CAAC,EAAO,OAAS,IAAY,OAAS,EAAU,IAAA,GACzD,UAAW,EAAW,EAAgB,IAAA,GAC9B,SACC,UAjBV,SAAA,CAmBE,EAAW,EACX,EAAY,EACZ,EAAiB,CACb,GAER,CACD,EAEA,EAAK,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/pill/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 {\n\tuseRef,\n\tuseCallback,\n\tuseImperativeHandle,\n\tforwardRef,\n\ttype ReactNode,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FocusEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport { PILL } from '../../utilities/constants';\nimport UtilityIcon from '../utilities/utility-icon';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Pill variant types\n */\nexport type PillVariant = 'link' | 'option';\n\n/**\n * Assistive text for Pill\n */\nexport interface PillAssistiveText {\n\t/** Remove button assistive text */\n\tremove?: string;\n}\n\n/**\n * Labels for Pill\n */\nexport interface PillLabels {\n\t/** Pill label text */\n\tlabel?: string;\n\t/** Title tooltip */\n\ttitle?: string;\n\t/** Remove icon title */\n\tremoveTitle?: string;\n}\n\n/** Props every Pill takes. */\ninterface PillBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillAssistiveText;\n\t/** Use bare styling */\n\tbare?: boolean;\n\t/** CSS classes for the pill */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Show error styling */\n\thasError?: boolean;\n\t/** Blur callback */\n\tonBlur?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Click callback */\n\tonClick?: (event?: MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void;\n\t/** Focus callback */\n\tonFocus?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Keydown callback */\n\tonKeyDown?: (event: KeyboardEvent<HTMLSpanElement>) => void;\n\t/** Remove callback */\n\tonRemove?: () => void;\n\t/** Tab order index. Applied to the root element so the pill can receive focus (e.g. roving tabindex for pill navigation). */\n\ttabIndex?: number;\n\t/** Marks the pill as selected. Used when the pill acts as a listbox `option`. */\n\t'aria-selected'?: boolean | 'true' | 'false';\n}\n\n/** A link pill, and the default. Only a link takes `href`. */\ninterface PillLinkVariantProps {\n\t/** Pill variant */\n\tvariant?: 'link';\n\t/** URL for the link. Defaults to `#`, which does not navigate. */\n\thref?: string;\n}\n\n/** A listbox option pill. */\ninterface PillOptionVariantProps {\n\t/** Pill variant */\n\tvariant: 'option';\n\thref?: never;\n}\n\n/** A pill shows an icon or an avatar, not both. */\ntype PillFigureProps =\n\t| {\n\t\t\t/** Icon element to display */\n\t\t\ticon?: ReactNode;\n\t\t\tavatar?: never;\n\t }\n\t| {\n\t\t\t/** Avatar element to display */\n\t\t\tavatar?: ReactNode;\n\t\t\ticon?: never;\n\t };\n\n/** A pill shows `labels.label` or custom `children`, not both. */\ntype PillContentProps =\n\t| {\n\t\t\t/** Text labels */\n\t\t\tlabels: PillLabels & { label: string };\n\t\t\tchildren?: never;\n\t }\n\t| {\n\t\t\t/** Text labels */\n\t\t\tlabels?: Omit<PillLabels, 'label'> & {\n\t\t\t\t/** Unset when the pill shows `children`. */\n\t\t\t\tlabel?: undefined;\n\t\t\t};\n\t\t\t/** Custom content, shown when there is no `labels.label` */\n\t\t\tchildren?: ReactNode;\n\t };\n\n/**\n * Props for the Pill component: `href` is link-only, `icon` and `avatar` are\n * exclusive, and so are `labels.label` and `children`.\n */\nexport type PillProps = PillBaseProps &\n\t(PillLinkVariantProps | PillOptionVariantProps) &\n\tPillFigureProps &\n\tPillContentProps;\n\n/**\n * Ref methods for Pill\n */\nexport interface PillRef {\n\t/** Remove focus from the pill */\n\tblur: () => void;\n\t/** Give focus to the pill */\n\tfocus: () => void;\n}\n\nconst defaultLabels: PillLabels = {};\nconst defaultAssistiveText: PillAssistiveText = {};\n\n/**\n * A pill displays a label that can contain links and can be removed from view.\n */\nconst Pill = forwardRef<PillRef, PillProps>(\n\t(\n\t\t{\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tavatar,\n\t\t\tbare,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\thasError,\n\t\t\thref,\n\t\t\ticon,\n\t\t\tlabels: propLabels,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonRemove,\n\t\t\ttabIndex,\n\t\t\t'aria-selected': ariaSelected,\n\t\t\tvariant = 'link',\n\t\t},\n\t\tref\n\t) => {\n\t\tconst rootRef = useRef<HTMLSpanElement | null>(null);\n\t\tconst labels = { ...defaultLabels, ...propLabels };\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Expose focus/blur methods via ref\n\t\tuseImperativeHandle(ref, () => ({\n\t\t\tblur: () => rootRef.current?.blur(),\n\t\t\tfocus: () => rootRef.current?.focus(),\n\t\t}));\n\n\t\tconst getHref = useCallback(() => {\n\t\t\treturn typeof href === 'string' ? href : '#';\n\t\t}, [href]);\n\n\t\tconst handleKeyDown = useCallback(\n\t\t\t(event: KeyboardEvent<HTMLSpanElement>) => {\n\t\t\t\tonKeyDown?.(event);\n\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\tswitch (event.key) {\n\t\t\t\t\tcase KEYS.ENTER:\n\t\t\t\t\t\tif (onClick) {\n\t\t\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\t\t\tonClick();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KEYS.BACKSPACE:\n\t\t\t\t\tcase KEYS.DELETE:\n\t\t\t\t\t\tif (onRemove) {\n\t\t\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onClick, onKeyDown, onRemove]\n\t\t);\n\n\t\tconst handleLinkClick = useCallback(\n\t\t\t(event: MouseEvent<HTMLAnchorElement>) => {\n\t\t\t\tif (getHref() === '#') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\tonClick?.(event);\n\t\t\t},\n\t\t\t[getHref, onClick]\n\t\t);\n\n\t\t// Render icon or avatar\n\t\tconst renderIcon = () => {\n\t\t\tconst iconElement = icon || avatar;\n\t\t\tif (iconElement) {\n\t\t\t\treturn <span className=\"slds-pill__icon_container\">{iconElement}</span>;\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\n\t\t// Render label or children\n\t\tconst renderLabel = () => {\n\t\t\tif (labels.label) {\n\t\t\t\tif (variant === 'link') {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref={getHref()}\n\t\t\t\t\t\t\tclassName=\"slds-pill__action\"\n\t\t\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t\t\t\tonClick={handleLinkClick}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"slds-pill__label\">{labels.label}</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"slds-pill__label\"\n\t\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t\t>\n\t\t\t\t\t\t{labels.label}\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn children;\n\t\t};\n\n\t\t// Render remove icon\n\t\tconst renderRemoveIcon = () => {\n\t\t\tif (onRemove) {\n\t\t\t\treturn (\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus -- SLDS pill markup; keyboard removal is Backspace/Delete on the focusable pill\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"slds-icon_container slds-pill__remove\"\n\t\t\t\t\t\ttitle={labels.removeTitle}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t>\n\t\t\t\t\t\t<UtilityIcon\n\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tclassName=\"slds-icon slds-icon_x-small slds-icon-text-default\"\n\t\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{assistiveText.remove || labels.removeTitle}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\n\t\t// Determine role\n\t\tlet role: string | undefined;\n\t\t// A link pill with `labels.label` renders an `<a>`, which is the interactive element; a\n\t\t// `role=\"button\"` around it would nest one control in another. Without a label there is\n\t\t// no `<a>`, so the pill itself is the button.\n\t\tif (variant === 'link' && !labels.label) {\n\t\t\trole = 'button';\n\t\t} else if (variant === 'option') {\n\t\t\trole = 'option';\n\t\t}\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\tref={rootRef}\n\t\t\t\trole={role}\n\t\t\t\taria-selected={ariaSelected}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-pill',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-pill_link': variant === 'link',\n\t\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t\t'slds-pill_bare': bare,\n\t\t\t\t\t},\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tonClick={!labels.label || variant !== 'link' ? onClick : undefined}\n\t\t\t\tonKeyDown={onRemove ? handleKeyDown : undefined}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tonFocus={onFocus}\n\t\t\t>\n\t\t\t\t{renderIcon()}\n\t\t\t\t{renderLabel()}\n\t\t\t\t{renderRemoveIcon()}\n\t\t\t</span>\n\t\t);\n\t}\n);\n\nPill.displayName = PILL;\n\nexport default Pill;\n"],"mappings":"uaAsIA,IAAM,EAA4B,CAAC,EAC7B,EAA0C,CAAC,EAK3C,GAAA,EAAO,EAAA,WAAA,EAEX,CACC,cAAe,EACf,SACA,OACA,WACA,YACA,WACA,OACA,OACA,OAAQ,EACR,SACA,UACA,UACA,YACA,WACA,WACA,gBAAiB,EACjB,UAAU,QAEX,IACI,CACJ,IAAM,GAAA,EAAU,EAAA,OAAA,CAA+B,IAAI,EAC7C,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,EAC3C,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,GAGtE,EAAA,EAAA,oBAAA,CAAoB,OAAY,CAC/B,SAAY,EAAQ,SAAS,KAAK,EAClC,UAAa,EAAQ,SAAS,MAAM,CACrC,EAAE,EAEF,IAAM,GAAA,EAAU,EAAA,YAAA,KACR,OAAO,GAAS,SAAW,EAAO,IACvC,CAAC,CAAI,CAAC,EAEH,G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AAO,WAC3B,CAAA,CACD,IAGD,KAIJ,EAUJ,OANI,IAAY,QAAU,CAAC,EAAO,MACjC,EAAO,SACG,IAAY,WACtB,EAAO,WAIP,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,IAAK,EACC,OACN,gBAAe,EACL,WACV,WAAA,EAAW,EAAA,QAAA,CACV,YACA,CACC,iBAAkB,IAAY,OAC9B,iBAAkB,EAClB,iBAAkB,CACnB,EACA,CACD,EACA,QAAS,CAAC,EAAO,OAAS,IAAY,OAAS,EAAU,IAAA,GACzD,UAAW,EAAW,EAAgB,IAAA,GAC9B,SACC,UAjBV,SAAA,CAmBE,EAAW,EACX,EAAY,EACZ,EAAiB,CACb,GAER,CACD,EAEA,EAAK,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/selected-listbox.cjs"),r=require("./check-props.cjs"),i=require("./component.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={listboxLabel:`Selected Options:`,removePill:`Press delete or backspace to remove`},c={removePillTitle:`Remove`},l=({assistiveText:e,className:l,events:u,id:d,labels:f,options:p=[],onClickPill:m,onRequestRemovePill:h,style:g,variant:_})=>{let v=(0,a.useId)(),y=d||v;(0,a.useEffect)(()=>{r.default(t.PILL_CONTAINER,{onClickPill:m,onRequestRemovePill:h},i.default)},[]);let b=u?.onClickPill??m,x=u?.onRequestRemovePill??h,S={...s,...e},C={...c,...f},[w,T]=(0,a.useState)(p[0]||void 0),[E,D]=(0,a.useState)(0),[O,k]=(0,a.useState)(!1),A=(0,a.useRef)(null),j=(0,a.useRef)(!1);(0,a.useEffect)(()=>{(p.length>0&&!p[E]||j.current)&&(M(),j.current=!1)},[p,E]);let M=(0,a.useCallback)(()=>{let e=E;p[e]||(e=p.length>0&&e>=p.length?p.length-1:0),T(p[e]||void 0),D(e),k(!!p[e])},[p,E]),N=(0,a.useCallback)((e,t)=>{let n=e+t;return p.length>n&&n>=0?n:e},[p.length]),P=(0,a.useCallback)(()=>{j.current?j.current=!1:k(!1)},[]),F=(0,a.useCallback)((e,t)=>{b&&b(e,{index:t.index,option:t.option})},[b]),I=(0,a.useCallback)((e,t)=>{O||(T(t.option),D(t.index),k(!0))},[O]),L=(0,a.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=E+1===p.length&&t===`next`,i=E===0&&t===`previous`,a,o;r?(a=0,o=p[0]):i?(a=p.length-1,o=p[p.length-1]):(a=N(E,n[t]),o=p[a]),j.current=!0,T(o),D(a),k(!0)},[E,p,N]),R=(0,a.useCallback)((e,{ref:t})=>{t&&(A.current=t,A.current.focus())},[]),z=(0,a.useCallback)((e,t)=>{x&&(j.current=!0,x(e,{index:t.index,option:t.option}))},[x]);return p.length===0?null:(0,o.jsx)(n.default,{activeOption:w,activeOptionIndex:E,assistiveText:{removePill:S.removePill,selectedListboxLabel:S.listboxLabel},className:l,events:{onBlurPill:P,onClickPill:F,onPillFocus:I,onRequestFocus:R,onRequestFocusOnNextPill:L,onRequestFocusOnPreviousPill:L,onRequestRemove:z},id:`${y}-listbox-of-pill-options`,isBare:_===`bare`,isPillContainer:!0,labels:C,listboxHasFocus:O,multiselectable:!0,renderAtSelectionLength:0,selection:p,style:g})};l.displayName=t.PILL_CONTAINER,exports.default=l;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/selected-listbox.cjs"),r=require("./check-props.cjs"),i=require("./component.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={listboxLabel:`Selected Options:`,removePill:`Press delete or backspace to remove`},c={removePillTitle:`Remove`},l=({assistiveText:e,className:l,events:u,id:d,labels:f,options:p=[],onClickPill:m,onRequestRemovePill:h,style:g,variant:_})=>{let v=(0,a.useId)(),y=d||v;(0,a.useEffect)(()=>{r.default(t.PILL_CONTAINER,{onClickPill:m,onRequestRemovePill:h},i.default)},[]);let b=u?.onClickPill??m,x=u?.onRequestRemovePill??h,S={...s,...e},C={...c,...f},[w,T]=(0,a.useState)(p[0]||void 0),[E,D]=(0,a.useState)(0),[O,k]=(0,a.useState)(!1),A=(0,a.useRef)(null),j=(0,a.useRef)(!1),M=(0,a.useCallback)(()=>{let e=E;p[e]||(e=p.length>0&&e>=p.length?p.length-1:0),T(p[e]||void 0),D(e),k(!!p[e])},[p,E]);(0,a.useEffect)(()=>{(p.length>0&&!p[E]||j.current)&&(M(),j.current=!1)},[p,E,M]);let N=(0,a.useCallback)((e,t)=>{let n=e+t;return p.length>n&&n>=0?n:e},[p.length]),P=(0,a.useCallback)(()=>{j.current?j.current=!1:k(!1)},[]),F=(0,a.useCallback)((e,t)=>{b&&b(e,{index:t.index,option:t.option})},[b]),I=(0,a.useCallback)((e,t)=>{O||(T(t.option),D(t.index),k(!0))},[O]),L=(0,a.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=E+1===p.length&&t===`next`,i=E===0&&t===`previous`,a,o;r?(a=0,o=p[0]):i?(a=p.length-1,o=p[p.length-1]):(a=N(E,n[t]),o=p[a]),j.current=!0,T(o),D(a),k(!0)},[E,p,N]),R=(0,a.useCallback)((e,{ref:t})=>{t&&(A.current=t,A.current.focus())},[]),z=(0,a.useCallback)((e,t)=>{x&&(j.current=!0,x(e,{index:t.index,option:t.option}))},[x]);return p.length===0?null:(0,o.jsx)(n.default,{activeOption:w,activeOptionIndex:E,assistiveText:{removePill:S.removePill,selectedListboxLabel:S.listboxLabel},className:l,events:{onBlurPill:P,onClickPill:F,onPillFocus:I,onRequestFocus:R,onRequestFocusOnNextPill:L,onRequestFocusOnPreviousPill:L,onRequestRemove:z},id:`${y}-listbox-of-pill-options`,isBare:_===`bare`,isPillContainer:!0,labels:C,listboxHasFocus:O,multiselectable:!0,renderAtSelectionLength:0,selection:p,style:g})};l.displayName=t.PILL_CONTAINER,exports.default=l;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/pill-container/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\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n} from 'react';\n\nimport SelectedListBox from './private/selected-listbox';\nimport { PILL_CONTAINER } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport type { IconCategory } from '../../types/common';\nimport componentDoc from './component.json';\n\n/**\n * Pill option structure\n */\nexport interface PillOption {\n\t/** Avatar component or config */\n\tavatar?:\n\t\t| ReactNode\n\t\t| {\n\t\t\t\timgSrc?: string;\n\t\t\t\ttitle?: string;\n\t\t\t\tvariant?: 'user' | 'entity';\n\t\t };\n\t/** Bare style */\n\tbare?: boolean;\n\t/** Error state */\n\terror?: boolean;\n\t/** Icon component or config */\n\ticon?:\n\t\t| ReactNode\n\t\t| {\n\t\t\t\tcategory?: IconCategory;\n\t\t\t\tname?: string;\n\t\t\t\ttitle?: string;\n\t\t };\n\t/** Unique identifier, used as the React key */\n\tid: string;\n\t/** Display label */\n\tlabel?: ReactNode | string;\n\t/** Hover title */\n\ttitle?: string;\n}\n\n/**\n * Assistive text for PillContainer\n */\nexport interface PillContainerAssistiveText {\n\t/** Label for the listbox */\n\tlistboxLabel?: string;\n\t/** Text for remove action */\n\tremovePill?: string;\n}\n\n/**\n * Labels for PillContainer\n */\nexport interface PillContainerLabels {\n\t/** Title for remove button */\n\tremovePillTitle?: string;\n}\n\n/**\n * Pill event data\n */\nexport interface PillEventData {\n\tindex: number;\n\toption: PillOption;\n}\n\n/**\n * Event callbacks for PillContainer\n */\nexport interface PillContainerEvents {\n\t/** Called when a pill is clicked */\n\tonClickPill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n\t/** Called when a pill is requested to be removed via the Delete/Backspace key or the remove icon */\n\tonRequestRemovePill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n}\n\n/**\n * Props for the PillContainer component\n */\nexport interface PillContainerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillContainerAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * **Event callbacks**\n\t * * `onClickPill`: Called when a pill is clicked.\n\t * * `onRequestRemovePill`: Called when a pill is requested to be removed via the Delete/Backspace key or the remove icon.\n\t */\n\tevents?: PillContainerEvents;\n\t/** HTML id */\n\tid?: string;\n\t/** Text labels */\n\tlabels?: PillContainerLabels;\n\t/** Array of pill options */\n\toptions?: PillOption[];\n\t/**\n\t * Pill click handler. Ignored when `events.onClickPill` is provided.\n\t * @deprecated use `events.onClickPill`\n\t */\n\tonClickPill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n\t/**\n\t * Remove request handler. Ignored when `events.onRequestRemovePill` is provided.\n\t * @deprecated use `events.onRequestRemovePill`\n\t */\n\tonRequestRemovePill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Container variant */\n\tvariant?: 'base' | 'bare';\n}\n\nconst defaultAssistiveText: PillContainerAssistiveText = {\n\tlistboxLabel: 'Selected Options:',\n\tremovePill: 'Press delete or backspace to remove',\n};\n\nconst defaultLabels: PillContainerLabels = {\n\tremovePillTitle: 'Remove',\n};\n\n/**\n * A PillContainer is a container that holds one or more pills.\n * Use it for a list of pills in a container that resembles an input form field.\n */\nconst PillContainer = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tevents,\n\tid: propId,\n\tlabels: propLabels,\n\toptions = [],\n\tonClickPill: deprecatedOnClickPill,\n\tonRequestRemovePill: deprecatedOnRequestRemovePill,\n\tstyle,\n\tvariant,\n}: PillContainerProps): React.ReactElement | null => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPILL_CONTAINER,\n\t\t\t{\n\t\t\t\tonClickPill: deprecatedOnClickPill,\n\t\t\t\tonRequestRemovePill: deprecatedOnRequestRemovePill,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Only run on mount\n\n\t// `events.*` takes precedence over the deprecated flat props\n\tconst onClickPill = events?.onClickPill ?? deprecatedOnClickPill;\n\tconst onRequestRemovePill =\n\t\tevents?.onRequestRemovePill ?? deprecatedOnRequestRemovePill;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst [activeSelectedOption, setActiveSelectedOption] = useState<\n\t\tPillOption | undefined\n\t>(options[0] || undefined);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst preserveFocusRef = useRef(false);\n\n\t// Reset active option when options change\n\tuseEffect(() => {\n\t\tif (\n\t\t\t(options.length > 0 && !options[activeSelectedOptionIndex]) ||\n\t\t\tpreserveFocusRef.current\n\t\t) {\n\t\t\tresetActiveSelectedOption();\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, [options, activeSelectedOptionIndex]);\n\n\tconst resetActiveSelectedOption = useCallback(() => {\n\t\tlet newIndex = activeSelectedOptionIndex;\n\n\t\tif (!options[newIndex]) {\n\t\t\tif (options.length > 0 && newIndex >= options.length) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\tsetActiveSelectedOption(options[newIndex] || undefined);\n\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\tsetListboxHasFocus(!!options[newIndex]);\n\t}, [options, activeSelectedOptionIndex]);\n\n\tconst getNewActiveOptionIndex = useCallback(\n\t\t(currentIndex: number, offset: number): number => {\n\t\t\tconst nextIndex = currentIndex + offset;\n\t\t\treturn options.length > nextIndex && nextIndex >= 0\n\t\t\t\t? nextIndex\n\t\t\t\t: currentIndex;\n\t\t},\n\t\t[options.length]\n\t);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tif (!preserveFocusRef.current) {\n\t\t\tsetListboxHasFocus(false);\n\t\t} else {\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, []);\n\n\tconst handleClickPill = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent,\n\t\t\tdata: { index: number; option: PillOption }\n\t\t) => {\n\t\t\tif (onClickPill) {\n\t\t\t\tonClickPill(event, { index: data.index, option: data.option });\n\t\t\t}\n\t\t},\n\t\t[onClickPill]\n\t);\n\n\tconst handlePillFocus = useCallback(\n\t\t(_event: FocusEvent, data: { index: number; option: PillOption }) => {\n\t\t\tif (!listboxHasFocus) {\n\t\t\t\tsetActiveSelectedOption(data.option);\n\t\t\t\tsetActiveSelectedOptionIndex(data.index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[listboxHasFocus]\n\t);\n\n\tconst handleNavigatePillContainer = useCallback(\n\t\t(\n\t\t\t_event: React.SyntheticEvent | React.KeyboardEvent,\n\t\t\t{ direction }: { direction: 'next' | 'previous' }\n\t\t) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst isLastOptionAndRightIsPressed =\n\t\t\t\tactiveSelectedOptionIndex + 1 === options.length &&\n\t\t\t\tdirection === 'next';\n\t\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\t\tlet newIndex: number;\n\t\t\tlet newOption: PillOption;\n\n\t\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\t\tnewIndex = 0;\n\t\t\t\tnewOption = options[0];\n\t\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t\tnewOption = options[options.length - 1];\n\t\t\t} else {\n\t\t\t\tnewIndex = getNewActiveOptionIndex(\n\t\t\t\t\tactiveSelectedOptionIndex,\n\t\t\t\t\toffsets[direction]\n\t\t\t\t);\n\t\t\t\tnewOption = options[newIndex];\n\t\t\t}\n\n\t\t\tpreserveFocusRef.current = true;\n\t\t\tsetActiveSelectedOption(newOption);\n\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\tsetListboxHasFocus(true);\n\t\t},\n\t\t[activeSelectedOptionIndex, options, getNewActiveOptionIndex]\n\t);\n\n\tconst handleRequestFocusPillContainer = useCallback(\n\t\t(_event: unknown, { ref }: { ref: HTMLElement | null }) => {\n\t\t\tif (ref) {\n\t\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tconst handleRequestRemove = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent | React.SyntheticEvent,\n\t\t\tdata: { index: number; option: PillOption }\n\t\t) => {\n\t\t\tif (onRequestRemovePill) {\n\t\t\t\tpreserveFocusRef.current = true;\n\t\t\t\tonRequestRemovePill(event as MouseEvent | KeyboardEvent, {\n\t\t\t\t\tindex: data.index,\n\t\t\t\t\toption: data.option,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[onRequestRemovePill]\n\t);\n\n\tif (options.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedListBox\n\t\t\tactiveOption={activeSelectedOption}\n\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\tassistiveText={{\n\t\t\t\tremovePill: assistiveText.removePill,\n\t\t\t\tselectedListboxLabel: assistiveText.listboxLabel,\n\t\t\t}}\n\t\t\tclassName={className}\n\t\t\tevents={{\n\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\tonClickPill: handleClickPill,\n\t\t\t\tonPillFocus: handlePillFocus,\n\t\t\t\tonRequestFocus: handleRequestFocusPillContainer,\n\t\t\t\tonRequestFocusOnNextPill: handleNavigatePillContainer,\n\t\t\t\tonRequestFocusOnPreviousPill: handleNavigatePillContainer,\n\t\t\t\tonRequestRemove: handleRequestRemove,\n\t\t\t}}\n\t\t\tid={`${id}-listbox-of-pill-options`}\n\t\t\tisBare={variant === 'bare'}\n\t\t\tisPillContainer\n\t\t\tlabels={labels}\n\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\tmultiselectable\n\t\t\trenderAtSelectionLength={0}\n\t\t\tselection={options}\n\t\t\tstyle={style}\n\t\t/>\n\t);\n};\n\nPillContainer.displayName = PILL_CONTAINER;\n\nexport default PillContainer;\n"],"mappings":"qXA0IA,IAAM,EAAmD,CACxD,aAAc,oBACd,WAAY,qCACb,EAEM,EAAqC,CAC1C,gBAAiB,QAClB,EAMM,GAAiB,CACtB,cAAe,EACf,YACA,SACA,GAAI,EACJ,OAAQ,EACR,UAAU,CAAC,EACX,YAAa,EACb,oBAAqB,EACrB,QACA,aACoD,CACpD,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,GAGrB,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QACC,EAAA,eACA,CACC,YAAa,EACb,oBAAqB,CACtB,EACA,EAAA,OACD,CAED,EAAG,CAAC,CAAC,EAGL,IAAM,EAAc,GAAQ,aAAe,EACrC,EACL,GAAQ,qBAAuB,EAE1B,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW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AA,CAEH,EAEA,EAAc,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/pill-container/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\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n} from 'react';\n\nimport SelectedListBox from './private/selected-listbox';\nimport { PILL_CONTAINER } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport type { IconCategory } from '../../types/common';\nimport componentDoc from './component.json';\n\n/**\n * Pill option structure\n */\nexport interface PillOption {\n\t/** Avatar component or config */\n\tavatar?:\n\t\t| ReactNode\n\t\t| {\n\t\t\t\timgSrc?: string;\n\t\t\t\ttitle?: string;\n\t\t\t\tvariant?: 'user' | 'entity';\n\t\t };\n\t/** Bare style */\n\tbare?: boolean;\n\t/** Error state */\n\terror?: boolean;\n\t/** Icon component or config */\n\ticon?:\n\t\t| ReactNode\n\t\t| {\n\t\t\t\tcategory?: IconCategory;\n\t\t\t\tname?: string;\n\t\t\t\ttitle?: string;\n\t\t };\n\t/** Unique identifier, used as the React key */\n\tid: string;\n\t/** Display label */\n\tlabel?: ReactNode | string;\n\t/** Hover title */\n\ttitle?: string;\n}\n\n/**\n * Assistive text for PillContainer\n */\nexport interface PillContainerAssistiveText {\n\t/** Label for the listbox */\n\tlistboxLabel?: string;\n\t/** Text for remove action */\n\tremovePill?: string;\n}\n\n/**\n * Labels for PillContainer\n */\nexport interface PillContainerLabels {\n\t/** Title for remove button */\n\tremovePillTitle?: string;\n}\n\n/**\n * Pill event data\n */\nexport interface PillEventData {\n\tindex: number;\n\toption: PillOption;\n}\n\n/**\n * Event callbacks for PillContainer\n */\nexport interface PillContainerEvents {\n\t/** Called when a pill is clicked */\n\tonClickPill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n\t/** Called when a pill is requested to be removed via the Delete/Backspace key or the remove icon */\n\tonRequestRemovePill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n}\n\n/**\n * Props for the PillContainer component\n */\nexport interface PillContainerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillContainerAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * **Event callbacks**\n\t * * `onClickPill`: Called when a pill is clicked.\n\t * * `onRequestRemovePill`: Called when a pill is requested to be removed via the Delete/Backspace key or the remove icon.\n\t */\n\tevents?: PillContainerEvents;\n\t/** HTML id */\n\tid?: string;\n\t/** Text labels */\n\tlabels?: PillContainerLabels;\n\t/** Array of pill options */\n\toptions?: PillOption[];\n\t/**\n\t * Pill click handler. Ignored when `events.onClickPill` is provided.\n\t * @deprecated use `events.onClickPill`\n\t */\n\tonClickPill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n\t/**\n\t * Remove request handler. Ignored when `events.onRequestRemovePill` is provided.\n\t * @deprecated use `events.onRequestRemovePill`\n\t */\n\tonRequestRemovePill?: (\n\t\tevent: MouseEvent | KeyboardEvent,\n\t\tdata: PillEventData\n\t) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Container variant */\n\tvariant?: 'base' | 'bare';\n}\n\nconst defaultAssistiveText: PillContainerAssistiveText = {\n\tlistboxLabel: 'Selected Options:',\n\tremovePill: 'Press delete or backspace to remove',\n};\n\nconst defaultLabels: PillContainerLabels = {\n\tremovePillTitle: 'Remove',\n};\n\n/**\n * A PillContainer is a container that holds one or more pills.\n * Use it for a list of pills in a container that resembles an input form field.\n */\nconst PillContainer = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tevents,\n\tid: propId,\n\tlabels: propLabels,\n\toptions = [],\n\tonClickPill: deprecatedOnClickPill,\n\tonRequestRemovePill: deprecatedOnRequestRemovePill,\n\tstyle,\n\tvariant,\n}: PillContainerProps): React.ReactElement | null => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPILL_CONTAINER,\n\t\t\t{\n\t\t\t\tonClickPill: deprecatedOnClickPill,\n\t\t\t\tonRequestRemovePill: deprecatedOnRequestRemovePill,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Only run on mount\n\n\t// `events.*` takes precedence over the deprecated flat props\n\tconst onClickPill = events?.onClickPill ?? deprecatedOnClickPill;\n\tconst onRequestRemovePill =\n\t\tevents?.onRequestRemovePill ?? deprecatedOnRequestRemovePill;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst [activeSelectedOption, setActiveSelectedOption] = useState<\n\t\tPillOption | undefined\n\t>(options[0] || undefined);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst preserveFocusRef = useRef(false);\n\n\tconst resetActiveSelectedOption = useCallback(() => {\n\t\tlet newIndex = activeSelectedOptionIndex;\n\n\t\tif (!options[newIndex]) {\n\t\t\tif (options.length > 0 && newIndex >= options.length) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\tsetActiveSelectedOption(options[newIndex] || undefined);\n\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\tsetListboxHasFocus(!!options[newIndex]);\n\t}, [options, activeSelectedOptionIndex]);\n\n\t// Reset active option when options change\n\tuseEffect(() => {\n\t\tif (\n\t\t\t(options.length > 0 && !options[activeSelectedOptionIndex]) ||\n\t\t\tpreserveFocusRef.current\n\t\t) {\n\t\t\tresetActiveSelectedOption();\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, [options, activeSelectedOptionIndex, resetActiveSelectedOption]);\n\n\tconst getNewActiveOptionIndex = useCallback(\n\t\t(currentIndex: number, offset: number): number => {\n\t\t\tconst nextIndex = currentIndex + offset;\n\t\t\treturn options.length > nextIndex && nextIndex >= 0\n\t\t\t\t? nextIndex\n\t\t\t\t: currentIndex;\n\t\t},\n\t\t[options.length]\n\t);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tif (!preserveFocusRef.current) {\n\t\t\tsetListboxHasFocus(false);\n\t\t} else {\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, []);\n\n\tconst handleClickPill = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent,\n\t\t\tdata: { index: number; option: PillOption }\n\t\t) => {\n\t\t\tif (onClickPill) {\n\t\t\t\tonClickPill(event, { index: data.index, option: data.option });\n\t\t\t}\n\t\t},\n\t\t[onClickPill]\n\t);\n\n\tconst handlePillFocus = useCallback(\n\t\t(_event: FocusEvent, data: { index: number; option: PillOption }) => {\n\t\t\tif (!listboxHasFocus) {\n\t\t\t\tsetActiveSelectedOption(data.option);\n\t\t\t\tsetActiveSelectedOptionIndex(data.index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[listboxHasFocus]\n\t);\n\n\tconst handleNavigatePillContainer = useCallback(\n\t\t(\n\t\t\t_event: React.SyntheticEvent | React.KeyboardEvent,\n\t\t\t{ direction }: { direction: 'next' | 'previous' }\n\t\t) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst isLastOptionAndRightIsPressed =\n\t\t\t\tactiveSelectedOptionIndex + 1 === options.length &&\n\t\t\t\tdirection === 'next';\n\t\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\t\tlet newIndex: number;\n\t\t\tlet newOption: PillOption;\n\n\t\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\t\tnewIndex = 0;\n\t\t\t\tnewOption = options[0];\n\t\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t\tnewOption = options[options.length - 1];\n\t\t\t} else {\n\t\t\t\tnewIndex = getNewActiveOptionIndex(\n\t\t\t\t\tactiveSelectedOptionIndex,\n\t\t\t\t\toffsets[direction]\n\t\t\t\t);\n\t\t\t\tnewOption = options[newIndex];\n\t\t\t}\n\n\t\t\tpreserveFocusRef.current = true;\n\t\t\tsetActiveSelectedOption(newOption);\n\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\tsetListboxHasFocus(true);\n\t\t},\n\t\t[activeSelectedOptionIndex, options, getNewActiveOptionIndex]\n\t);\n\n\tconst handleRequestFocusPillContainer = useCallback(\n\t\t(_event: unknown, { ref }: { ref: HTMLElement | null }) => {\n\t\t\tif (ref) {\n\t\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tconst handleRequestRemove = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent | React.SyntheticEvent,\n\t\t\tdata: { index: number; option: PillOption }\n\t\t) => {\n\t\t\tif (onRequestRemovePill) {\n\t\t\t\tpreserveFocusRef.current = true;\n\t\t\t\tonRequestRemovePill(event as MouseEvent | KeyboardEvent, {\n\t\t\t\t\tindex: data.index,\n\t\t\t\t\toption: data.option,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[onRequestRemovePill]\n\t);\n\n\tif (options.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedListBox\n\t\t\tactiveOption={activeSelectedOption}\n\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\tassistiveText={{\n\t\t\t\tremovePill: assistiveText.removePill,\n\t\t\t\tselectedListboxLabel: assistiveText.listboxLabel,\n\t\t\t}}\n\t\t\tclassName={className}\n\t\t\tevents={{\n\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\tonClickPill: handleClickPill,\n\t\t\t\tonPillFocus: handlePillFocus,\n\t\t\t\tonRequestFocus: handleRequestFocusPillContainer,\n\t\t\t\tonRequestFocusOnNextPill: handleNavigatePillContainer,\n\t\t\t\tonRequestFocusOnPreviousPill: handleNavigatePillContainer,\n\t\t\t\tonRequestRemove: handleRequestRemove,\n\t\t\t}}\n\t\t\tid={`${id}-listbox-of-pill-options`}\n\t\t\tisBare={variant === 'bare'}\n\t\t\tisPillContainer\n\t\t\tlabels={labels}\n\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\tmultiselectable\n\t\t\trenderAtSelectionLength={0}\n\t\t\tselection={options}\n\t\t\tstyle={style}\n\t\t/>\n\t);\n};\n\nPillContainer.displayName = PILL_CONTAINER;\n\nexport default PillContainer;\n"],"mappings":"qXA0IA,IAAM,EAAmD,CACxD,aAAc,oBACd,WAAY,qCACb,EAEM,EAAqC,CAC1C,gBAAiB,QAClB,EAMM,GAAiB,CACtB,cAAe,EACf,YACA,SACA,GAAI,EACJ,OAAQ,EACR,UAAU,CAAC,EACX,YAAa,EACb,oBAAqB,EACrB,QACA,aACoD,CACpD,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,GAGrB,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QACC,EAAA,eACA,CACC,YAAa,EACb,oBAAqB,CACtB,EACA,EAAA,OACD,CAED,EAAG,CAAC,CAAC,EAGL,IAAM,EAAc,GAAQ,aAAe,EACrC,EACL,GAAQ,qBAAuB,EAE1B,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,EAE3C,CAAC,EAAsB,IAAA,EAA2B,EAAA,SA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@ -1 +1 @@
1
- {"version":3,"file":"edit-dialog.cjs","names":[],"sources":["../../../../components/popover/edit-dialog.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// # Edit Dialog Popver Component\n\n// ### React\nimport React, { type ReactNode } from 'react';\nimport assign from 'lodash.assign';\n\nimport { POPOVER_EDIT_DIALOG } from '../../utilities/constants';\n\nimport Button from '../button';\nimport Popover, { type PopoverProps } from './index';\nimport type { PopoverBaseProps, PopoverLabelProps } from './popover';\n\nexport interface EditDialogLabels {\n\t/** text for Cancel button */\n\tcancel?: ReactNode;\n\t/** text for Save button */\n\tsave?: ReactNode;\n}\n\ninterface EditDialogOwnProps {\n\t/**\n\t * The trigger element. Defaults to an edit button when not provided.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Disables the edit dialog and prevents clicking it.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Passed to the default trigger button's `onClick`.\n\t */\n\thandleOpen?: (event: React.MouseEvent) => void;\n\t/**\n\t * By default, a unique ID will be created at render to support keyboard navigation, ARIA roles, and connect the popover to the triggering button. This ID will be applied to the triggering element. `${id}-popover`, `${id}-dialog-heading`, `${id}-dialog-body` are also created.\n\t */\n\tid?: string;\n\t/**\n\t * Set to true when inputs within the popover are modified.\n\t */\n\tisModified?: boolean;\n\t/**\n\t * **Text labels for internationalization**\n\t * This object is merged with the default props object on every render.\n\t * * `cancel`: text for Cancel button\n\t * * `save`: text for Save button\n\t *\n\t * _Tested with snapshot testing._\n\t */\n\tlabels?: EditDialogLabels;\n\t/**\n\t * This function is passed onto the cancel `Button`. Triggered when the trigger button is clicked.\n\t */\n\tonCancel?: (event: React.MouseEvent) => void;\n\t/**\n\t * This function is passed onto the save `Button`. Triggered when the trigger button is clicked.\n\t */\n\tonSave?: (event: React.MouseEvent) => void;\n\t/**\n\t * Popover of type `~/components/popover`. This popover will be cloned and additional props appended, if passed in.\n\t */\n\tpopover?: ReactNode;\n}\n\n/**\n * Props for EditDialog: its own props, and the base-variant `Popover` props\n * it passes through. The trigger and id are typed above.\n */\nexport type EditDialogProps = EditDialogOwnProps &\n\tOmit<PopoverBaseProps, 'children' | 'disabled' | 'id' | 'body'> & {\n\t\tbody: PopoverBaseProps['body'];\n\t} & PopoverLabelProps;\n\ninterface EditDialogState {\n\tisOpen: boolean;\n}\n\nconst defaultProps: Pick<EditDialogOwnProps, 'labels'> = {\n\tlabels: {\n\t\tcancel: 'Cancel',\n\t\tsave: 'Save',\n\t},\n};\n\nclass EditDialog extends React.Component<EditDialogProps, EditDialogState> {\n\t// ### Display Name\n\t// Always use the canonical component name as the React display name.\n\tstatic displayName = POPOVER_EDIT_DIALOG;\n\n\tstatic defaultProps = defaultProps;\n\n\tstate: EditDialogState = { isOpen: false };\n\n\t// A consumer's `onOpen`/`onClose`/`onRequestClose` (passed through to Popover) run alongside\n\t// these instead of replacing them.\n\thandleOpen = (...args: Parameters<NonNullable<PopoverProps['onOpen']>>) => {\n\t\tthis.setState({ isOpen: true });\n\t\t(this.props as PopoverProps).onOpen?.(...args);\n\t};\n\n\thandleClose = (...args: Parameters<NonNullable<PopoverProps['onClose']>>) => {\n\t\tthis.setState({ isOpen: false });\n\t\t(this.props as PopoverProps).onClose?.(...args);\n\t};\n\n\thandleRequestClose = (\n\t\t...args: Parameters<NonNullable<PopoverProps['onRequestClose']>>\n\t) => {\n\t\tthis.setState({ isOpen: false });\n\t\t(this.props as PopoverProps).onRequestClose?.(...args);\n\t};\n\n\trender() {\n\t\tconst { onCancel, onSave, ...restProps } = this.props;\n\n\t\t// trigger button will either be passed in children or defaults to an edit button.\n\t\tconst children = this.props.children ? (\n\t\t\tthis.props.children\n\t\t) : (\n\t\t\t<Button\n\t\t\t\tassistiveText={{ icon: 'Edit: Status' }}\n\t\t\t\tclassName=\"slds-button_reset\"\n\t\t\t\tdisabled={this.props.disabled}\n\t\t\t\ticonCategory=\"utility\"\n\t\t\t\ticonClassName=\"slds-button__icon slds-button__icon_hint\"\n\t\t\t\ticonName=\"edit\"\n\t\t\t\tonClick={this.props.handleOpen}\n\t\t\t\tvariant=\"icon\"\n\t\t\t\tstyle={{ verticalAlign: 'middle' }}\n\t\t\t/>\n\t\t);\n\n\t\tconst labels = assign({}, defaultProps.labels, this.props.labels);\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\tclassNameFooter={[\n\t\t\t\t\t'slds-p-top_xxx-small',\n\t\t\t\t\t'slds-p-bottom_xx-small',\n\t\t\t\t\t'slds-p-right_large',\n\t\t\t\t]}\n\t\t\t\tclassNameBody={['slds-p-bottom_xx-small']}\n\t\t\t\tfooter={\n\t\t\t\t\t<div className=\"slds-text-align_right slds-text-align_right slds-p-bottom_x-small slds-p-right_xx-small\">\n\t\t\t\t\t\t<Button label={labels.cancel} onClick={onCancel} />\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tdisabled={!this.props.isModified}\n\t\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t\t\tlabel={labels.save}\n\t\t\t\t\t\t\tonClick={onSave}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\tstyleFooter={{ borderTop: '0px' }}\n\t\t\t\t{...(restProps as unknown as PopoverProps)}\n\t\t\t\tonClose={this.handleClose}\n\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\tonOpen={this.handleOpen}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default EditDialog;\n"],"mappings":"oRA+EA,IAAM,EAAmD,CACxD,OAAQ,CACP,OAAQ,SACR,KAAM,MACP,CACD,EAEM,EAAN,cAAyB,EAAA,QAAM,SAA4C,CAG1E,OAAO,YAAc,EAAA,oBAErB,OAAO,aAAe,EAEtB,MAAyB,CAAE,OAAQ,EAAM,EAIzC,YAAc,GAAG,IAA0D,CAC1E,KAAK,SAAS,CAAE,OAAQ,EAAK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","names":[],"sources":["../../../../components/popover/edit-dialog.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// # Edit Dialog Popver Component\n\n// ### React\nimport React, { type ReactNode } from 'react';\nimport assign from 'lodash.assign';\n\nimport { POPOVER_EDIT_DIALOG } from '../../utilities/constants';\n\nimport Button from '../button';\nimport Popover, { type PopoverProps } from './index';\nimport type { PopoverBaseProps, PopoverLabelProps } from './popover';\n\nexport interface EditDialogLabels {\n\t/** text for Cancel button */\n\tcancel?: ReactNode;\n\t/** text for Save button */\n\tsave?: ReactNode;\n}\n\ninterface EditDialogOwnProps {\n\t/**\n\t * The trigger element. Defaults to an edit button when not provided.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Disables the edit dialog and prevents clicking it.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Passed to the default trigger button's `onClick`.\n\t */\n\thandleOpen?: (event: React.MouseEvent) => void;\n\t/**\n\t * By default, a unique ID will be created at render to support keyboard navigation, ARIA roles, and connect the popover to the triggering button. This ID will be applied to the triggering element. `${id}-popover`, `${id}-dialog-heading`, `${id}-dialog-body` are also created.\n\t */\n\tid?: string;\n\t/**\n\t * Set to true when inputs within the popover are modified.\n\t */\n\tisModified?: boolean;\n\t/**\n\t * **Text labels for internationalization**\n\t * This object is merged with the default props object on every render.\n\t * * `cancel`: text for Cancel button\n\t * * `save`: text for Save button\n\t */\n\tlabels?: EditDialogLabels;\n\t/**\n\t * This function is passed onto the cancel `Button`. Triggered when the trigger button is clicked.\n\t */\n\tonCancel?: (event: React.MouseEvent) => void;\n\t/**\n\t * This function is passed onto the save `Button`. Triggered when the trigger button is clicked.\n\t */\n\tonSave?: (event: React.MouseEvent) => void;\n\t/**\n\t * A `Popover` element. This popover will be cloned and additional props appended, if passed in.\n\t */\n\tpopover?: ReactNode;\n}\n\n/**\n * Props for EditDialog: its own props, and the base-variant `Popover` props\n * it passes through. The trigger and id are typed above.\n */\nexport type EditDialogProps = EditDialogOwnProps &\n\tOmit<PopoverBaseProps, 'children' | 'disabled' | 'id' | 'body'> & {\n\t\tbody: PopoverBaseProps['body'];\n\t} & PopoverLabelProps;\n\ninterface EditDialogState {\n\tisOpen: boolean;\n}\n\nconst defaultProps: Pick<EditDialogOwnProps, 'labels'> = {\n\tlabels: {\n\t\tcancel: 'Cancel',\n\t\tsave: 'Save',\n\t},\n};\n\nclass EditDialog extends React.Component<EditDialogProps, EditDialogState> {\n\t// ### Display Name\n\t// Always use the canonical component name as the React display name.\n\tstatic displayName = POPOVER_EDIT_DIALOG;\n\n\tstatic defaultProps = defaultProps;\n\n\tstate: EditDialogState = { isOpen: false };\n\n\t// A consumer's `onOpen`/`onClose`/`onRequestClose` (passed through to Popover) run alongside\n\t// these instead of replacing them.\n\thandleOpen = (...args: Parameters<NonNullable<PopoverProps['onOpen']>>) => {\n\t\tthis.setState({ isOpen: true });\n\t\t(this.props as PopoverProps).onOpen?.(...args);\n\t};\n\n\thandleClose = (...args: Parameters<NonNullable<PopoverProps['onClose']>>) => {\n\t\tthis.setState({ isOpen: false });\n\t\t(this.props as PopoverProps).onClose?.(...args);\n\t};\n\n\thandleRequestClose = (\n\t\t...args: Parameters<NonNullable<PopoverProps['onRequestClose']>>\n\t) => {\n\t\tthis.setState({ isOpen: false });\n\t\t(this.props as PopoverProps).onRequestClose?.(...args);\n\t};\n\n\trender() {\n\t\tconst { onCancel, onSave, ...restProps } = this.props;\n\n\t\t// trigger button will either be passed in children or defaults to an edit button.\n\t\tconst children = this.props.children ? (\n\t\t\tthis.props.children\n\t\t) : (\n\t\t\t<Button\n\t\t\t\tassistiveText={{ icon: 'Edit: Status' }}\n\t\t\t\tclassName=\"slds-button_reset\"\n\t\t\t\tdisabled={this.props.disabled}\n\t\t\t\ticonCategory=\"utility\"\n\t\t\t\ticonClassName=\"slds-button__icon slds-button__icon_hint\"\n\t\t\t\ticonName=\"edit\"\n\t\t\t\tonClick={this.props.handleOpen}\n\t\t\t\tvariant=\"icon\"\n\t\t\t\tstyle={{ verticalAlign: 'middle' }}\n\t\t\t/>\n\t\t);\n\n\t\tconst labels = assign({}, defaultProps.labels, this.props.labels);\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\tclassNameFooter={[\n\t\t\t\t\t'slds-p-top_xxx-small',\n\t\t\t\t\t'slds-p-bottom_xx-small',\n\t\t\t\t\t'slds-p-right_large',\n\t\t\t\t]}\n\t\t\t\tclassNameBody={['slds-p-bottom_xx-small']}\n\t\t\t\tfooter={\n\t\t\t\t\t<div className=\"slds-text-align_right slds-text-align_right slds-p-bottom_x-small slds-p-right_xx-small\">\n\t\t\t\t\t\t<Button label={labels.cancel} onClick={onCancel} />\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tdisabled={!this.props.isModified}\n\t\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t\t\tlabel={labels.save}\n\t\t\t\t\t\t\tonClick={onSave}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\tstyleFooter={{ borderTop: '0px' }}\n\t\t\t\t{...(restProps as unknown as PopoverProps)}\n\t\t\t\tonClose={this.handleClose}\n\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\tonOpen={this.handleOpen}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default EditDialog;\n"],"mappings":"oRA6EA,IAAM,EAAmD,CACxD,OAAQ,CACP,OAAQ,SACR,KAAM,MACP,CACD,EAEM,EAAN,cAAyB,EAAA,QAAM,SAA4C,CAG1E,OAAO,YAAc,EAAA,oBAErB,OAAO,aAAe,EAEtB,MAAyB,CAAE,OAAQ,EAAM,EAIzC,YAAc,GAAG,IAA0D,CAC1E,KAAK,SAAS,CAAE,OAAQ,EAAK,CAAC,EAC9B,KAAM,MAAuB,SAAS,GAAG,CAAI,CAC9C,EAEA,aAAe,GAAG,IAA2D,CAC5E,KAAK,SAAS,CAAE,OAAQ,EAAM,CAAC,EAC/B,KAAM,MAAuB,UAAU,GAAG,CAAI,CAC/C,EAEA,oBACC,GAAG,IACC,CACJ,KAAK,SAAS,CAAE,OAAQ,EAAM,CAAC,EAC/B,KAAM,MAAuB,iBAAiB,GAAG,CAAI,CACtD,EAEA,QAAS,CACR,GAAM,CAAE,WAAU,SAAQ,GAAG,GAAc,KAAK,MAG1C,EAAW,KAAK,MAAM,SAC3B,KAAK,MAAM,UAEX,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,cAAe,EACtC,UAAU,oBACV,SAAU,KAAK,MAAM,SACrB,aAAa,UACb,cAAc,2CACd,SAAS,OACT,QAAS,KAAK,MAAM,WACpB,QAAQ,OACR,MAAO,CAAE,cAAe,QAAS,CACjC,CAAA,EAGI,GAAA,EAAS,EAAA,QAAA,CAAO,CAAC,EAAG,EAAa,OAAQ,KAAK,MAAM,MAAM,EAEhE,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,gBAAiB,CAChB,uBACA,yBACA,oBACD,EACA,cAAe,CAAC,wBAAwB,EACxC,QACC,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,0FAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAQ,MAAO,EAAO,OAAQ,QAAS,CAAW,CAAA,GAClD,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,SAAU,CAAC,KAAK,MAAM,WACtB,QAAQ,QACR,MAAO,EAAO,KACd,QAAS,CACT,CAAA,CACG,IAEN,YAAa,CAAE,UAAW,KAAM,EAChC,GAAK,EACL,QAAS,KAAK,YACd,eAAgB,KAAK,mBACrB,OAAQ,KAAK,WAEZ,UACO,CAAA,CAEX,CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/popover/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// Note: react-onclickoutside HOC has been removed.\n// Click outside detection is handled by the Dialog utility component.\n// Future work: Consider migrating from Popper.js to @floating-ui/react\n\nimport Popover, { PopoverNubbinPositions } from './popover';\n\nexport type {\n\tPopoverProps,\n\tPopoverAlign,\n\tPopoverPosition,\n\tPopoverVariant,\n\tPopoverAssistiveText,\n\tPopoverRequestCloseTrigger,\n\tPopoverRequestCloseData,\n\tPopoverRequestOpenTrigger,\n\tPopoverRequestOpenData,\n\tPopoverOpenData,\n\tPopoverCloseData,\n} from './popover';\n\nexport { PopoverNubbinPositions };\nexport default Popover;\n"],"mappings":"gIAwBA,IAAA,EAAe,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/popover/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// Popover detects outside clicks itself with `useClickOutside`.\n// Future work: Consider migrating from Popper.js to @floating-ui/react\n\nimport Popover, { PopoverNubbinPositions } from './popover';\n\nexport type {\n\tPopoverProps,\n\tPopoverAlign,\n\tPopoverPosition,\n\tPopoverVariant,\n\tPopoverAssistiveText,\n\tPopoverRequestCloseTrigger,\n\tPopoverRequestCloseData,\n\tPopoverRequestOpenTrigger,\n\tPopoverRequestOpenData,\n\tPopoverOpenData,\n\tPopoverCloseData,\n} from './popover';\n\nexport { PopoverNubbinPositions };\nexport default Popover;\n"],"mappings":"gIAuBA,IAAA,EAAe,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/warning/sunset-property.cjs"),r=require("../icon-settings/index.cjs"),i=require("../../utilities/get-component-doc.cjs"),ee=require("../../utilities/warning/deprecated-property.cjs"),te=require("../button/index.cjs"),a=require("../icon/index.cjs"),ne=require("../../utilities/key-code.cjs"),re=require("../utilities/dialog/index.cjs"),ie=require("../../utilities/merge-props.cjs"),ae=require("../../utilities/hooks/use-controllable-state.cjs"),oe=require("../media-object/index.cjs"),se=require("../../utilities/keyboard-navigable-dialog.cjs"),ce=require("./component.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=typeof document<`u`,u=l?document.createElement(`span`):{style:{}};l&&(u.style.top=`0`,u.style.left=`0`,u.style.width=`100%`,u.style.height=`100%`,u.style.position=`absolute`);var d=null,f=[`top left`,`top`,`top right`,`bottom left`,`bottom`,`bottom right`],le={closeButton:`Close dialog`},p=(0,o.forwardRef)((e,f)=>{let{align:p=`right`,assistiveText:ue,ariaLabelledby:m,children:de,body:h,classNameBody:g,classNameFooter:fe,footerClassName:_,className:pe,classNameDialog:me,contentsClassName:v,disabled:y=!1,footer:he,footerStyle:b,footerWalkthroughActions:x,hasNoCloseButton:ge=!1,hasNoNubbin:_e=!1,hasStaticAlignment:ve=!1,hasNoTriggerStyles:ye=!1,heading:S,icon:be,id:xe,isOpen:Se,defaultIsOpen:Ce=!1,offset:we,onClick:C,onClose:w,onFocus:T,onKeyDown:E,onMouseDown:Te,onMouseEnter:D,onMouseLeave:O,onOpen:k,onRequestOpen:A,onRequestClose:j,onRequestTargetElement:M,openOn:N=`click`,overlay:P,position:Ee=`absolute`,stepText:F,style:De,styleDialog:Oe,styleFooter:ke,triggerClassName:Ae,variant:I=`base`,hoverCloseDelay:L=300,closeButtonAssistiveText:je}=e;(0,o.useEffect)(()=>{if(process.env.NODE_ENV!==`production`){let e=i.default(ce.default);[[`contentsClassName`,v,`classNameDialog`],[`footerClassName`,_,`classNameFooter`],[`footerStyle`,b,`styleFooter`],[`triggerClassName`,Ae,`className`]].forEach(([n,r,i])=>{ee.default(t.POPOVER,r,n,i,e(i))}),[[`closeButtonAssistiveText`,je,"Use `assistiveText={{ closeButton: '...' }}` instead."],[`offset`,we,void 0]].forEach(([e,r,i])=>{n.default(t.POPOVER,r,e,i)})}},[]);let Me=(0,o.useId)(),R=xe||Me,Ne=(0,o.useContext)(r.IconSettingsContext),Pe={...le,...ue},[Fe,z]=ae.useControllableState(Se,Ce),[B,Ie]=(0,o.useState)(!1),V=(0,o.useRef)(null),Le=(0,o.useRef)(null),H=(0,o.useRef)(!1),U=(0,o.useRef)(null),W=(0,o.useRef)(null),Re=(0,o.useRef)(!1),G=!y&&Fe,ze=(0,o.useCallback)(()=>{if(M){let e=M();if(e)return e}return V.current},[M]),Be=(0,o.useCallback)((e,t)=>{let n=t?.componentWillUnmount||!1;d?.getId()===R&&(d=null),w&&w(void 0,{componentWillUnmount:n})},[R,w]),Ve=(0,o.useCallback)((e,t)=>{k&&k(void 0,{portal:t?.portal})},[k]),K=(0,o.useCallback)((e,t)=>{G&&(j&&j(e,t),d?.getId()===R&&(d=null),z(!1),H.current=!1)},[G,R,j,z]),q=(0,o.useRef)(K);(0,o.useEffect)(()=>{q.current=K},[K]);let J=(0,o.useCallback)((e,t)=>{!G&&!y&&(A?.(e,{trigger:t}),d&&d.getId()!==R&&d.handleClose(void 0,{trigger:`newPopover`,id:d.getId()}),d={handleClose:(e,t)=>q.current(e,t),getId:()=>R},z(!0))},[G,y,R,A,z]),Y=(0,o.useCallback)(e=>{K(e,{trigger:`cancel`})},[K]);(0,o.useCallback)(e=>{K(e,{trigger:`clickOutside`})},[K]);let He=(0,o.useCallback)(e=>{H.current=!0,!G&&N===`hover`?J(e,`mouseEnter`):U.current&&clearTimeout(U.current),D&&D(e)},[G,N,J,D]),Ue=(0,o.useCallback)(e=>{G&&(U.current=setTimeout(()=>{K(void 0,{trigger:`mouseLeave`})},L)),O&&O(e)},[G,L,K,O]),X=(0,o.useCallback)((e,t)=>{G?K(e,{trigger:`triggerClick`}):J(e,`triggerClick`),C&&C(e),t&&t(e)},[G,J,K,C]),We=(0,o.useCallback)(e=>{G||J(e,`focus`),T&&T(e)},[G,J,T]),Ge=(0,o.useCallback)(e=>{G&&Y(e)},[G,Y]),Ke=(0,o.useCallback)(e=>{e.key&&(e.key!==ne.default.TAB&&se.default({event:e,isOpen:G,handleClick:e=>X(e),key:e.key,eventTarget:e.target,toggleOpen:()=>Ge(e),trigger:V.current}),E&&E(e))},[G,X,Ge,E]),Z=(0,o.useCallback)(e=>{typeof P==`function`&&l?P(e,u):P&&e&&!W.current&&l?(W.current=u,document.querySelector(`body`)?.appendChild(u)):!e&&W.current?.parentNode&&(W.current.parentNode.removeChild(W.current),W.current=null)},[P]),qe=(0,o.useCallback)(e=>{V.current=e,typeof f==`function`?f(e):f&&(f.current=e),e&&!B&&Ie(!0)},[B,f]),Je=(0,o.useCallback)(e=>{Le.current=e},[]);(0,o.useEffect)(()=>()=>{Re.current=!0,d?.getId()===R&&(d=null),Z(!1)},[R,Z]),(0,o.useEffect)(()=>{Z(G)},[G,Z]);let Ye=()=>{let e=I===`error`||I===`warning`;if(!(S||e)||I===`walkthrough-action`||I===`feature`)return null;let t={error:(0,c.jsx)(a.default,{category:`utility`,name:`error`,size:`x-small`,inverse:!0}),warning:(0,c.jsx)(a.default,{category:`utility`,name:`warning`,size:`x-small`,inverse:!0})};return e?(0,c.jsx)(`header`,{className:`slds-popover__header`,children:(0,c.jsx)(oe.default,{body:(0,c.jsx)(`h2`,{id:m||`${R}-dialog-heading`,className:`slds-truncate slds-text-heading_medium`,title:typeof S==`string`?S:void 0,children:S}),figure:t[I],verticalCenter:!0})}):(0,c.jsx)(`header`,{className:(0,s.default)(`slds-popover__header`,{"slds-p-vertical_medium":I===`walkthrough`}),children:(0,c.jsx)(`h2`,{id:m||`${R}-dialog-heading`,className:(0,s.default)({"slds-text-heading_small":I!==`walkthrough`,"slds-text-heading_medium":I===`walkthrough`}),children:S})})},Xe=()=>I===`error`||I===`warning`?(0,c.jsx)(`div`,{id:`${R}-dialog-body`,className:(0,s.default)(`slds-popover__body`,g),children:h}):I===`walkthrough-action`||I===`feature`?(0,c.jsx)(`div`,{className:(0,s.default)(`slds-popover__body`,g),id:`${R}-dialog-body`,children:(0,c.jsxs)(`div`,{className:`slds-media`,children:[(0,c.jsx)(`div`,{className:`slds-media__figure`,children:I===`walkthrough-action`?(0,c.jsx)(a.default,{category:`utility`,name:`touch_action`,size:`small`,inverse:!0}):be}),(0,c.jsxs)(`div`,{className:`slds-media__body`,children:[S&&(0,c.jsx)(`h2`,{id:m||`${R}-dialog-heading`,className:`slds-text-heading_small`,children:S}),h,F&&(0,c.jsx)(`p`,{className:`slds-m-top_medium slds-text-title`,children:F})]})]})}):(0,c.jsx)(`div`,{id:`${R}-dialog-body`,className:(0,s.default)(`slds-popover__body`,g),children:h}),Ze=()=>{let e=(0,s.default)(`slds-popover__footer`,_,fe),t=b||ke?{...b,...ke}:void 0;return he?(0,c.jsx)(`footer`,{className:e,style:t,children:he}):I!==`walkthrough-action`&&(x||F)?(0,c.jsx)(`footer`,{className:e,style:t,children:(0,c.jsxs)(`div`,{className:`slds-grid slds-grid_vertical-align-center`,children:[F&&(0,c.jsx)(`span`,{className:`slds-text-title`,children:F}),x&&(0,c.jsx)(`div`,{className:`slds-col_bump-left`,style:{display:`inline-block`},children:x})]})}):null},Qe=()=>{if(!G)return null;let e=`ignore-click-${R}`;return(0,c.jsxs)(re.default,{hasNubbin:!_e,align:p,contentsClassName:(0,s.default)(v,`ignore-react-onclickoutside`,`slds-popover`,{"slds-popover_error":I===`error`},{"slds-popover_walkthrough":I===`walkthrough`||I===`walkthrough-action`||I===`feature`},{"slds-popover_walkthrough-alt":I===`walkthrough-action`},{"slds-popover_feature":I===`feature`},{"slds-popover_warning":I===`warning`},me),context:Ne,hasStaticAlignment:ve,onClose:Be,onOpen:Ve,onKeyDown:Ke,onMouseEnter:N===`hover`?He:void 0,onMouseLeave:N===`hover`?Ue:void 0,outsideClickIgnoreClass:e,onRequestTargetElement:ze,position:Ee,style:Oe,variant:`popover`,ref:Je,containerProps:{id:`${R}-popover`,"aria-labelledby":m||`${R}-dialog-heading`,"aria-describedby":`${R}-dialog-body`},children:[!ge&&(0,c.jsx)(te.default,{assistiveText:{icon:Pe.closeButton},iconCategory:`utility`,iconName:`close`,className:(0,s.default)(`slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon`,{"slds-button_icon-inverse":I===`walkthrough`||I===`walkthrough-action`||I===`feature`}),onClick:Y,variant:`icon`,inverse:I===`error`||I===`warning`}),Ye(),Xe(),Ze()]})},Q=[],$=null;o.default.Children.forEach(de,(e,t)=>{if(t===0&&N===`none`)$=e;else if(t===0&&o.default.isValidElement(e)){let t=e.props,n=t.onClick,r=ie.default({"aria-haspopup":`dialog`,id:R,onClick:N===`click`||N===`hybrid`?e=>{X(e,n)}:n,onFocus:N===`hover`?We:void 0,onMouseDown:Te,onMouseEnter:N===`hover`||N===`hybrid`?He:void 0,onMouseLeave:N===`hover`||N===`hybrid`?Ue:void 0,tabIndex:t.tabIndex??0},{onFocus:t.onFocus,onMouseDown:t.onMouseDown,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave});$=o.default.cloneElement(e,r)}else e&&Q.push(e)});let $e={display:ye?void 0:`inline-block`,...De};return(0,c.jsxs)(`div`,{className:(0,s.default)(Ae,pe)||void 0,style:$e,ref:qe,children:[$,Q.length>0?Q:null,Qe()]})});p.displayName=t.POPOVER,exports.PopoverNubbinPositions=f,exports.default=p;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/warning/sunset-property.cjs"),r=require("../icon-settings/index.cjs"),i=require("../../utilities/get-component-doc.cjs"),ee=require("../../utilities/warning/deprecated-property.cjs"),te=require("../button/index.cjs"),a=require("../icon/index.cjs"),ne=require("../../utilities/key-code.cjs"),re=require("../utilities/dialog/index.cjs"),ie=require("../../utilities/merge-props.cjs"),ae=require("../../utilities/hooks/use-controllable-state.cjs"),oe=require("../media-object/index.cjs"),se=require("../../utilities/hooks/use-click-outside.cjs"),ce=require("../../utilities/keyboard-navigable-dialog.cjs"),le=require("./component.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=typeof document<`u`,u=l?document.createElement(`span`):{style:{}};l&&(u.style.top=`0`,u.style.left=`0`,u.style.width=`100%`,u.style.height=`100%`,u.style.position=`absolute`);var d=null,f=[`top left`,`top`,`top right`,`bottom left`,`bottom`,`bottom right`],ue={closeButton:`Close dialog`},p=(0,o.forwardRef)((e,f)=>{let{align:p=`right`,assistiveText:de,ariaLabelledby:m,children:fe,body:h,classNameBody:g,classNameFooter:pe,footerClassName:_,className:me,classNameDialog:he,contentsClassName:v,disabled:y=!1,footer:b,footerStyle:x,footerWalkthroughActions:S,hasNoCloseButton:ge=!1,hasNoNubbin:_e=!1,hasStaticAlignment:ve=!1,hasNoTriggerStyles:ye=!1,heading:C,icon:be,id:xe,isOpen:Se,defaultIsOpen:Ce=!1,offset:we,onClick:w,onClose:T,onFocus:E,onKeyDown:D,onMouseDown:Te,onMouseEnter:O,onMouseLeave:k,onOpen:A,onRequestOpen:j,onRequestClose:M,onRequestTargetElement:N,openOn:P=`click`,overlay:F,position:Ee=`absolute`,stepText:I,style:De,styleDialog:Oe,styleFooter:L,triggerClassName:R,variant:z=`base`,hoverCloseDelay:B=300,closeButtonAssistiveText:ke}=e;(0,o.useEffect)(()=>{if(process.env.NODE_ENV!==`production`){let e=i.default(le.default);[[`contentsClassName`,v,`classNameDialog`],[`footerClassName`,_,`classNameFooter`],[`footerStyle`,x,`styleFooter`],[`triggerClassName`,R,`className`]].forEach(([n,r,i])=>{ee.default(t.POPOVER,r,n,i,e(i))}),[[`closeButtonAssistiveText`,ke,"Use `assistiveText={{ closeButton: '...' }}` instead."],[`offset`,we,void 0]].forEach(([e,r,i])=>{n.default(t.POPOVER,r,e,i)})}},[]);let Ae=(0,o.useId)(),V=xe||Ae,je=(0,o.useContext)(r.IconSettingsContext),Me={...ue,...de},[Ne,H]=ae.useControllableState(Se,Ce),U=(0,o.useRef)(null),Pe=(0,o.useRef)(null),Fe=(0,o.useRef)(!1),W=(0,o.useRef)(null),G=(0,o.useRef)(null),Ie=(0,o.useRef)(!1),K=!y&&Ne,Le=(0,o.useCallback)(()=>{if(N){let e=N();if(e)return e}return U.current},[N]),Re=(0,o.useCallback)((e,t)=>{let n=t?.componentWillUnmount||!1;d?.getId()===V&&(d=null),T&&T(void 0,{componentWillUnmount:n})},[V,T]),ze=(0,o.useCallback)((e,t)=>{A&&A(void 0,{portal:t?.portal})},[A]),q=(0,o.useCallback)((e,t)=>{K&&(M&&M(e,t),d?.getId()===V&&(d=null),H(!1),Fe.current=!1)},[K,V,M,H]),Be=(0,o.useRef)(q);(0,o.useEffect)(()=>{Be.current=q},[q]);let J=(0,o.useCallback)((e,t)=>{!K&&!y&&(j?.(e,{trigger:t}),d&&d.getId()!==V&&d.handleClose(void 0,{trigger:`newPopover`,id:d.getId()}),d={handleClose:(e,t)=>Be.current(e,t),getId:()=>V},H(!0))},[K,y,V,j,H]),Y=(0,o.useCallback)(e=>{q(e,{trigger:`cancel`})},[q]),Ve=(0,o.useCallback)(e=>{q(e,{trigger:`clickOutside`})},[q]);se.default(U,Ve,{enabled:K,ignoreClass:`ignore-click-${V}`});let He=(0,o.useCallback)(e=>{Fe.current=!0,!K&&P===`hover`?J(e,`mouseEnter`):W.current&&clearTimeout(W.current),O&&O(e)},[K,P,J,O]),Ue=(0,o.useCallback)(e=>{K&&(W.current=setTimeout(()=>{q(void 0,{trigger:`mouseLeave`})},B)),k&&k(e)},[K,B,q,k]),X=(0,o.useCallback)((e,t)=>{K?q(e,{trigger:`triggerClick`}):J(e,`triggerClick`),w&&w(e),t&&t(e)},[K,J,q,w]),We=(0,o.useCallback)(e=>{K||J(e,`focus`),E&&E(e)},[K,J,E]),Ge=(0,o.useCallback)(e=>{K&&Y(e)},[K,Y]),Ke=(0,o.useCallback)(e=>{e.key&&(e.key!==ne.default.TAB&&ce.default({event:e,isOpen:K,handleClick:e=>X(e),key:e.key,eventTarget:e.target,toggleOpen:()=>Ge(e),trigger:U.current}),D&&D(e))},[K,X,Ge,D]),Z=(0,o.useCallback)(e=>{typeof F==`function`&&l?F(e,u):F&&e&&!G.current&&l?(G.current=u,document.querySelector(`body`)?.appendChild(u)):!e&&G.current?.parentNode&&(G.current.parentNode.removeChild(G.current),G.current=null)},[F]),qe=(0,o.useCallback)(e=>{U.current=e,typeof f==`function`?f(e):f&&(f.current=e)},[f]),Je=(0,o.useCallback)(e=>{Pe.current=e},[]);(0,o.useEffect)(()=>()=>{Ie.current=!0,d?.getId()===V&&(d=null),Z(!1)},[V,Z]),(0,o.useEffect)(()=>{Z(K)},[K,Z]);let Ye=()=>{let e=z===`error`||z===`warning`;if(!(C||e)||z===`walkthrough-action`||z===`feature`)return null;let t={error:(0,c.jsx)(a.default,{category:`utility`,name:`error`,size:`x-small`,inverse:!0}),warning:(0,c.jsx)(a.default,{category:`utility`,name:`warning`,size:`x-small`,inverse:!0})};return e?(0,c.jsx)(`header`,{className:`slds-popover__header`,children:(0,c.jsx)(oe.default,{body:(0,c.jsx)(`h2`,{id:m||`${V}-dialog-heading`,className:`slds-truncate slds-text-heading_medium`,title:typeof C==`string`?C:void 0,children:C}),figure:t[z],verticalCenter:!0})}):(0,c.jsx)(`header`,{className:(0,s.default)(`slds-popover__header`,{"slds-p-vertical_medium":z===`walkthrough`}),children:(0,c.jsx)(`h2`,{id:m||`${V}-dialog-heading`,className:(0,s.default)({"slds-text-heading_small":z!==`walkthrough`,"slds-text-heading_medium":z===`walkthrough`}),children:C})})},Xe=()=>z===`error`||z===`warning`?(0,c.jsx)(`div`,{id:`${V}-dialog-body`,className:(0,s.default)(`slds-popover__body`,g),children:h}):z===`walkthrough-action`||z===`feature`?(0,c.jsx)(`div`,{className:(0,s.default)(`slds-popover__body`,g),id:`${V}-dialog-body`,children:(0,c.jsxs)(`div`,{className:`slds-media`,children:[(0,c.jsx)(`div`,{className:`slds-media__figure`,children:z===`walkthrough-action`?(0,c.jsx)(a.default,{category:`utility`,name:`touch_action`,size:`small`,inverse:!0}):be}),(0,c.jsxs)(`div`,{className:`slds-media__body`,children:[C&&(0,c.jsx)(`h2`,{id:m||`${V}-dialog-heading`,className:`slds-text-heading_small`,children:C}),h,I&&(0,c.jsx)(`p`,{className:`slds-m-top_medium slds-text-title`,children:I})]})]})}):(0,c.jsx)(`div`,{id:`${V}-dialog-body`,className:(0,s.default)(`slds-popover__body`,g),children:h}),Ze=()=>{let e=(0,s.default)(`slds-popover__footer`,_,pe),t=x||L?{...x,...L}:void 0;return b?(0,c.jsx)(`footer`,{className:e,style:t,children:b}):z!==`walkthrough-action`&&(S||I)?(0,c.jsx)(`footer`,{className:e,style:t,children:(0,c.jsxs)(`div`,{className:`slds-grid slds-grid_vertical-align-center`,children:[I&&(0,c.jsx)(`span`,{className:`slds-text-title`,children:I}),S&&(0,c.jsx)(`div`,{className:`slds-col_bump-left`,style:{display:`inline-block`},children:S})]})}):null},Qe=()=>{if(!K)return null;let e=`ignore-click-${V}`;return(0,c.jsxs)(re.default,{hasNubbin:!_e,align:p,contentsClassName:(0,s.default)(v,`ignore-react-onclickoutside`,`slds-popover`,{"slds-popover_error":z===`error`},{"slds-popover_walkthrough":z===`walkthrough`||z===`walkthrough-action`||z===`feature`},{"slds-popover_walkthrough-alt":z===`walkthrough-action`},{"slds-popover_feature":z===`feature`},{"slds-popover_warning":z===`warning`},he),context:je,hasStaticAlignment:ve,onClose:Re,onOpen:ze,onKeyDown:Ke,onMouseEnter:P===`hover`?He:void 0,onMouseLeave:P===`hover`?Ue:void 0,outsideClickIgnoreClass:e,onRequestTargetElement:Le,position:Ee,style:Oe,variant:`popover`,ref:Je,containerProps:{id:`${V}-popover`,"aria-labelledby":m||`${V}-dialog-heading`,"aria-describedby":`${V}-dialog-body`},children:[!ge&&(0,c.jsx)(te.default,{assistiveText:{icon:Me.closeButton},iconCategory:`utility`,iconName:`close`,className:(0,s.default)(`slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon`,{"slds-button_icon-inverse":z===`walkthrough`||z===`walkthrough-action`||z===`feature`}),onClick:Y,variant:`icon`,inverse:z===`error`||z===`warning`}),Ye(),Xe(),Ze()]})},Q=[],$=null;o.default.Children.forEach(fe,(e,t)=>{if(t===0&&P===`none`)$=e;else if(t===0&&o.default.isValidElement(e)){let t=e.props,n=t.onClick,r=ie.default({"aria-haspopup":`dialog`,id:V,onClick:P===`click`||P===`hybrid`?e=>{X(e,n)}:n,onFocus:P===`hover`?We:void 0,onMouseDown:Te,onMouseEnter:P===`hover`||P===`hybrid`?He:void 0,onMouseLeave:P===`hover`||P===`hybrid`?Ue:void 0,tabIndex:t.tabIndex??0},{onFocus:t.onFocus,onMouseDown:t.onMouseDown,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave});$=o.default.cloneElement(e,r)}else e&&Q.push(e)});let $e={display:ye?void 0:`inline-block`,...De};return(0,c.jsxs)(`div`,{className:(0,s.default)(R,me)||void 0,style:$e,ref:qe,children:[$,Q.length>0?Q:null,Qe()]})});p.displayName=t.POPOVER,exports.PopoverNubbinPositions=f,exports.default=p;
2
2
  //# sourceMappingURL=popover.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover.cjs","names":[],"sources":["../../../../components/popover/popover.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tforwardRef,\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\tuseContext,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport MediaObject from '../media-object';\nimport Icon from '../icon';\nimport Dialog from '../utilities/dialog';\nimport { useControllableState } from '../../utilities/hooks';\nimport keyboardNavigableDialog from '../../utilities/keyboard-navigable-dialog';\nimport KEYS from '../../utilities/key-code';\nimport { POPOVER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport mergeProps from '../../utilities/merge-props';\nimport getComponentDocFn from '../../utilities/get-component-doc';\nimport componentDoc from './component.json';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// Shared overlay element for click-outside detection over iframes\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Track currently open popover for single-popover-at-a-time behavior\nlet currentOpenPopover: {\n\thandleClose: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: PopoverRequestCloseData\n\t) => void;\n\tgetId: () => string;\n} | null = null;\n\n/**\n * Popover alignment options\n */\nexport type PopoverAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\n/**\n * Popover position options\n */\nexport type PopoverPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Popover variant options\n */\nexport type PopoverVariant =\n\t| 'base'\n\t| 'error'\n\t| 'feature'\n\t| 'walkthrough'\n\t| 'walkthrough-action'\n\t| 'warning';\n\n/**\n * Assistive text for Popover\n */\nexport interface PopoverAssistiveText {\n\tcloseButton?: string;\n}\n\n/**\n * What caused `onRequestClose` to fire:\n * * `cancel`: the close button was clicked or Escape was pressed\n * * `clickOutside`: a click landed outside the popover\n * * `mouseLeave`: the mouse left the trigger/popover (`openOn` `hover`/`hybrid`) and `hoverCloseDelay` elapsed\n * * `newPopover`: another Popover opened (only one can be open at a time)\n * * `triggerClick`: the trigger was clicked while the popover was open\n */\nexport type PopoverRequestCloseTrigger =\n\t'cancel' | 'clickOutside' | 'mouseLeave' | 'newPopover' | 'triggerClick';\n\n/**\n * Data passed to `onRequestClose`\n */\nexport interface PopoverRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: PopoverRequestCloseTrigger;\n\t/** HTML id of the popover being closed. Only present when `trigger` is `newPopover`. */\n\tid?: string;\n}\n\n/**\n * What caused `onRequestOpen` to fire:\n * * `focus`: the trigger received focus (`openOn` `hover`)\n * * `mouseEnter`: the mouse entered the trigger (`openOn` `hover`)\n * * `triggerClick`: the trigger was clicked while the popover was closed\n */\nexport type PopoverRequestOpenTrigger = 'focus' | 'mouseEnter' | 'triggerClick';\n\n/**\n * Data passed to `onRequestOpen`\n */\nexport interface PopoverRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: PopoverRequestOpenTrigger;\n}\n\n/**\n * Data passed to `onOpen`\n */\nexport interface PopoverOpenData {\n\t/** The rendered popover dialog element */\n\tportal?: HTMLElement;\n}\n\n/**\n * Data passed to `onClose`\n */\nexport interface PopoverCloseData {\n\t/** `true` when the popover dialog is closing because it is being unmounted */\n\tcomponentWillUnmount: boolean;\n}\n\n/**\n * Props every Popover takes\n */\nexport interface PopoverBaseProps {\n\t/** Alignment relative to trigger */\n\talign?: PopoverAlign;\n\t/** Accessibility labels */\n\tassistiveText?: PopoverAssistiveText;\n\t/**\n\t * The element the popover attaches to (the first child), and optional other children rendered\n\t * beside it. The first child is the trigger: Popover adds `id`, `aria-haspopup`, `tabIndex` and\n\t * its open handlers to it, unless `openOn` is `'none'`, which leaves it as it is.\n\t */\n\tchildren: ReactNode;\n\t/** Popover body content */\n\tbody: ReactNode;\n\t/** CSS classes for the `.slds-popover__body` element */\n\tclassNameBody?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the `.slds-popover__footer` element */\n\tclassNameFooter?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `classNameFooter`. */\n\tfooterClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * CSS classes for the root element: the `div` that wraps the trigger. To style the\n\t * `.slds-popover` dialog (for example `slds-popover_large`), use `classNameDialog`.\n\t */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the `.slds-popover` dialog element */\n\tclassNameDialog?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `classNameDialog`, which lands on the same element. */\n\tcontentsClassName?: string | string[] | Record<string, boolean>;\n\t/** Disable the popover */\n\tdisabled?: boolean;\n\t/** Footer content */\n\tfooter?: ReactNode;\n\t/** @deprecated Use `styleFooter`. */\n\tfooterStyle?: CSSProperties;\n\t/** Walkthrough footer actions */\n\tfooterWalkthroughActions?: ReactNode | ReactNode[];\n\t/** Hide close button */\n\thasNoCloseButton?: boolean;\n\t/** Hide nubbin/arrow */\n\thasNoNubbin?: boolean;\n\t/** Prevent position flipping */\n\thasStaticAlignment?: boolean;\n\t/** Remove trigger inline-block style */\n\thasNoTriggerStyles?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Open state when the popover is controlled. When `isOpen` is set, the popover only opens and closes\n\t * when this prop changes: handle `onRequestOpen` and `onRequestClose` to update it. Leave it\n\t * `undefined` for an uncontrolled popover (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Initial open state of an uncontrolled popover (`isOpen` is `undefined`). Defaults to `false`. */\n\tdefaultIsOpen?: boolean;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent) => void;\n\t/** Called after the popover dialog has closed (unmounted). There is no triggering event, so `event` is `undefined`. */\n\tonClose?: (event: undefined, data: PopoverCloseData) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Mouse leave handler */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/** Called after the popover dialog has opened and rendered. There is no triggering event, so `event` is `undefined`. */\n\tonOpen?: (event: undefined, data: PopoverOpenData) => void;\n\t/**\n\t * Called when the popover requests to open (trigger click, or hover/focus with `openOn` `hover`),\n\t * controlled or not. `data.trigger` says why. A controlled popover opens only if the parent sets\n\t * `isOpen` to `true`.\n\t */\n\tonRequestOpen?: (\n\t\tevent: MouseEvent | FocusEvent,\n\t\tdata: PopoverRequestOpenData\n\t) => void;\n\t/**\n\t * Called when the popover requests to close, controlled or not. `data.trigger` says why. `event` is\n\t * the triggering click or key event, or `undefined` when there is none (`mouseLeave` timer,\n\t * `newPopover`). A controlled popover closes only if the parent sets `isOpen` to `false`.\n\t */\n\tonRequestClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: PopoverRequestCloseData\n\t) => void;\n\t/** Custom target element getter */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * What on the first child opens the popover: `click` (the default), `hover`, or `hybrid` (click\n\t * or hover). `none` makes the first child only an anchor that the popover points at, such as\n\t * the target of a walkthrough step: Popover leaves its markup and handlers alone, and the\n\t * parent opens and closes the popover through `isOpen`.\n\t */\n\topenOn?: 'click' | 'hover' | 'hybrid' | 'none';\n\t/** Overlay for click-outside on iframes */\n\toverlay?:\n\t\tboolean | ((isOpen: boolean, overlayElement: HTMLSpanElement) => void);\n\t/** Positioning strategy */\n\tposition?: PopoverPosition;\n\t/** Walkthrough step text */\n\tstepText?: string;\n\t/** Styles for the root element: the `div` that wraps the trigger. To style the dialog, use `styleDialog`. */\n\tstyle?: CSSProperties;\n\t/** Styles for the `.slds-popover` dialog element */\n\tstyleDialog?: CSSProperties;\n\t/** Styles for the `.slds-popover__footer` element */\n\tstyleFooter?: CSSProperties;\n\t/** @deprecated Use `className`, which lands on the same element. */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Delay before closing on hover (ms) */\n\thoverCloseDelay?: number;\n}\n\n/** The `feature` variant, the only one with an `icon`. */\ninterface PopoverFeatureVariantProps {\n\t/** Popover variant */\n\tvariant: 'feature';\n\t/** Icon for the feature variant */\n\ticon?: ReactNode;\n}\n\n/** Every other variant. */\ninterface PopoverOtherVariantProps {\n\t/** Popover variant */\n\tvariant?: Exclude<PopoverVariant, 'feature'>;\n\ticon?: never;\n}\n\n/**\n * The dialog is named by `heading`, or by the `id` of another element in\n * `ariaLabelledby`, not both.\n */\nexport type PopoverLabelProps =\n\t| {\n\t\t\t/** Popover heading */\n\t\t\theading?: ReactNode;\n\t\t\tariaLabelledby?: never;\n\t }\n\t| {\n\t\t\theading?: never;\n\t\t\t/** HTML id of the heading element that labels the dialog. Use instead of `heading`. */\n\t\t\tariaLabelledby: string;\n\t };\n\n/**\n * Props for the Popover component: `icon` is feature-only, and `heading`\n * and `ariaLabelledby` are exclusive.\n */\nexport type PopoverProps = PopoverBaseProps &\n\t(PopoverFeatureVariantProps | PopoverOtherVariantProps) &\n\tPopoverLabelProps;\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported on mount.\n */\ninterface PopoverRemovedProps {\n\tcloseButtonAssistiveText?: unknown;\n\toffset?: unknown;\n}\n\n// Nubbin positions for export (legacy)\nexport const PopoverNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\nconst defaultAssistiveText: PopoverAssistiveText = {\n\tcloseButton: 'Close dialog',\n};\n\n/**\n * The Popover component is a non-modal dialog. It should be paired with a clickable\n * trigger such as a Button. It traps focus from the page and must be exited if focus\n * needs to be outside the Popover.\n */\nconst Popover = forwardRef<HTMLDivElement, PopoverProps>((props, ref) => {\n\tconst {\n\t\talign = 'right',\n\t\tassistiveText: propAssistiveText,\n\t\tariaLabelledby,\n\t\tchildren,\n\t\tbody,\n\t\tclassNameBody,\n\t\tclassNameFooter,\n\t\tfooterClassName,\n\t\tclassName,\n\t\tclassNameDialog,\n\t\tcontentsClassName,\n\t\tdisabled = false,\n\t\tfooter,\n\t\tfooterStyle,\n\t\tfooterWalkthroughActions,\n\t\thasNoCloseButton = false,\n\t\thasNoNubbin = false,\n\t\thasStaticAlignment = false,\n\t\thasNoTriggerStyles = false,\n\t\theading,\n\t\ticon,\n\t\tid: propId,\n\t\tisOpen: controlledIsOpen,\n\t\tdefaultIsOpen = false,\n\t\toffset,\n\t\tonClick,\n\t\tonClose,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\tonOpen,\n\t\tonRequestOpen,\n\t\tonRequestClose,\n\t\tonRequestTargetElement,\n\t\topenOn = 'click',\n\t\toverlay: overlayProp,\n\t\tposition = 'absolute',\n\t\tstepText,\n\t\tstyle,\n\t\tstyleDialog,\n\t\tstyleFooter,\n\t\ttriggerClassName,\n\t\tvariant = 'base',\n\t\thoverCloseDelay = 300,\n\t\tcloseButtonAssistiveText,\n\t} = props as PopoverBaseProps &\n\t\tPopoverRemovedProps & {\n\t\t\tariaLabelledby?: string;\n\t\t\theading?: ReactNode;\n\t\t\ticon?: ReactNode;\n\t\t\tvariant?: PopoverVariant;\n\t\t};\n\n\t// `check-props.js` is not wired up (its trigger and heading checks predate v11), so the\n\t// renamed and removed props are checked here.\n\tuseEffect(() => {\n\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\tconst createDocUrl = getComponentDocFn(componentDoc);\n\t\t\tconst renamedProps: [string, unknown, string][] = [\n\t\t\t\t['contentsClassName', contentsClassName, 'classNameDialog'],\n\t\t\t\t['footerClassName', footerClassName, 'classNameFooter'],\n\t\t\t\t['footerStyle', footerStyle, 'styleFooter'],\n\t\t\t\t['triggerClassName', triggerClassName, 'className'],\n\t\t\t];\n\t\t\trenamedProps.forEach(([oldProp, value, newProp]) => {\n\t\t\t\tdeprecatedProperty(\n\t\t\t\t\tPOPOVER,\n\t\t\t\t\tvalue,\n\t\t\t\t\toldProp,\n\t\t\t\t\tnewProp,\n\t\t\t\t\tcreateDocUrl(newProp)\n\t\t\t\t);\n\t\t\t});\n\t\t\tconst removedProps: [string, unknown, string | undefined][] = [\n\t\t\t\t[\n\t\t\t\t\t'closeButtonAssistiveText',\n\t\t\t\t\tcloseButtonAssistiveText,\n\t\t\t\t\t\"Use `assistiveText={{ closeButton: '...' }}` instead.\",\n\t\t\t\t],\n\t\t\t\t['offset', offset, undefined],\n\t\t\t];\n\t\t\tremovedProps.forEach(([oldProp, value, comment]) => {\n\t\t\t\tsunsetProperty(POPOVER, value, oldProp, comment);\n\t\t\t});\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Only run on mount\n\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst context = useContext(IconSettingsContext);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t// State\n\tconst [currentIsOpen, setIsOpen] = useControllableState(\n\t\tcontrolledIsOpen,\n\t\tdefaultIsOpen\n\t);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst dialogRef = useRef<HTMLElement>(null);\n\tconst isHoverRef = useRef(false);\n\tconst isClosingRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\tconst isUnmountingRef = useRef(false);\n\n\t// Derived state\n\tconst isOpen = !disabled && currentIsOpen;\n\n\t// Get target element for positioning\n\tconst getTargetElement = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\tconst target = onRequestTargetElement();\n\t\t\tif (target) return target;\n\t\t}\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Handle dialog close (when unmounted)\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\t_event?: React.SyntheticEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tconst componentWillUnmount = data?.componentWillUnmount || false;\n\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\n\t\t\tif (onClose) {\n\t\t\t\tonClose(undefined, { componentWillUnmount });\n\t\t\t}\n\t\t},\n\t\t[id, onClose]\n\t);\n\n\t// Handle dialog open (after it has rendered)\n\tconst handleDialogOpen = useCallback(\n\t\t(_event?: unknown, data?: { portal?: HTMLElement }) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(undefined, { portal: data?.portal });\n\t\t\t}\n\t\t},\n\t\t[onOpen]\n\t);\n\n\t// Handle close\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\t\tdata: PopoverRequestCloseData\n\t\t) => {\n\t\t\tif (isOpen) {\n\t\t\t\tif (onRequestClose) {\n\t\t\t\t\tonRequestClose(event, data);\n\t\t\t\t}\n\n\t\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\t\tcurrentOpenPopover = null;\n\t\t\t\t}\n\n\t\t\t\tsetIsOpen(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[isOpen, id, onRequestClose, setIsOpen]\n\t);\n\n\t// Latest `handleClose`, so the \"close the other open popover\" path does not call a stale\n\t// closure from when this popover opened (whose `isOpen` was still `false`).\n\tconst handleCloseRef = useRef(handleClose);\n\tuseEffect(() => {\n\t\thandleCloseRef.current = handleClose;\n\t}, [handleClose]);\n\n\t// Handle open\n\tconst handleOpen = useCallback(\n\t\t(event: MouseEvent | FocusEvent, trigger: PopoverRequestOpenTrigger) => {\n\t\t\tif (!isOpen && !disabled) {\n\t\t\t\tonRequestOpen?.(event, { trigger });\n\n\t\t\t\t// Close any other open popover\n\t\t\t\tif (currentOpenPopover && currentOpenPopover.getId() !== id) {\n\t\t\t\t\tcurrentOpenPopover.handleClose(undefined, {\n\t\t\t\t\t\ttrigger: 'newPopover',\n\t\t\t\t\t\tid: currentOpenPopover.getId(),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tcurrentOpenPopover = {\n\t\t\t\t\thandleClose: (event, data) => handleCloseRef.current(event, data),\n\t\t\t\t\tgetId: () => id,\n\t\t\t\t};\n\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t},\n\t\t[isOpen, disabled, id, onRequestOpen, setIsOpen]\n\t);\n\n\t// Handle cancel (close button or escape)\n\tconst handleCancel = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent) => {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle click outside\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\thandleClose(event, { trigger: 'clickOutside' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\n\t\t\tif (!isOpen && openOn === 'hover') {\n\t\t\t\thandleOpen(event, 'mouseEnter');\n\t\t\t} else {\n\t\t\t\tif (isClosingRef.current) {\n\t\t\t\t\tclearTimeout(isClosingRef.current);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onMouseEnter) {\n\t\t\t\tonMouseEnter(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\tisClosingRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose(undefined, { trigger: 'mouseLeave' });\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\n\t\t\tif (onMouseLeave) {\n\t\t\t\tonMouseLeave(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent, triggerOnClickCallback?: (e: MouseEvent) => void) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen(event, 'triggerClick');\n\t\t\t} else {\n\t\t\t\thandleClose(event, { trigger: 'triggerClick' });\n\t\t\t}\n\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event);\n\t\t\t}\n\n\t\t\tif (triggerOnClickCallback) {\n\t\t\t\ttriggerOnClickCallback(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, handleClose, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen(event, 'focus');\n\t\t\t}\n\n\t\t\tif (onFocus) {\n\t\t\t\tonFocus(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, onFocus]\n\t);\n\n\t// Toggle from keyboard\n\t// `handleKeyDown` is only attached to the open dialog, so this only ever closes it (Escape).\n\tconst toggleOpenFromKeyboard = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\thandleCancel(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleCancel]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.key) {\n\t\t\t\tif (event.key !== KEYS.TAB) {\n\t\t\t\t\tkeyboardNavigableDialog({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen,\n\t\t\t\t\t\thandleClick: (e: MouseEvent) => handleClick(e),\n\t\t\t\t\t\tkey: event.key,\n\t\t\t\t\t\teventTarget: event.target,\n\t\t\t\t\t\t// keyboardNavigableDialog calls `toggleOpen()` without the event; pass it through\n\t\t\t\t\t\ttoggleOpen: () => toggleOpenFromKeyboard(event),\n\t\t\t\t\t\ttrigger: triggerRef.current,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (onKeyDown) {\n\t\t\t\t\tonKeyDown(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleClick, toggleOpenFromKeyboard, onKeyDown]\n\t);\n\n\t// Render overlay for click-outside detection\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (typeof overlayProp === 'function' && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (\n\t\t\t\toverlayProp &&\n\t\t\t\tshouldShow &&\n\t\t\t\t!overlayRef.current &&\n\t\t\t\tdocumentDefined\n\t\t\t) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Container ref callback\n\tconst setContainerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\tcomponent;\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(component);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = component;\n\t\t\t}\n\t\t\tif (component && !inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered, ref]\n\t);\n\n\t// Dialog ref callback\n\tconst setMenuRef = useCallback((component: HTMLElement | null) => {\n\t\t(dialogRef as React.MutableRefObject<HTMLElement | null>).current =\n\t\t\tcomponent;\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t};\n\t}, [id, renderOverlay]);\n\n\t// Update overlay when isOpen changes\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// Render header\n\tconst renderHeader = () => {\n\t\tconst hasThemedHeader = variant === 'error' || variant === 'warning';\n\t\tconst hasDefinedHeader = heading || hasThemedHeader;\n\n\t\tif (\n\t\t\t!hasDefinedHeader ||\n\t\t\tvariant === 'walkthrough-action' ||\n\t\t\tvariant === 'feature'\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst headerIcon = {\n\t\t\terror: <Icon category=\"utility\" name=\"error\" size=\"x-small\" inverse />,\n\t\t\twarning: (\n\t\t\t\t<Icon category=\"utility\" name=\"warning\" size=\"x-small\" inverse />\n\t\t\t),\n\t\t};\n\n\t\tif (hasThemedHeader) {\n\t\t\treturn (\n\t\t\t\t<header className=\"slds-popover__header\">\n\t\t\t\t\t<MediaObject\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\tclassName=\"slds-truncate slds-text-heading_medium\"\n\t\t\t\t\t\t\t\ttitle={typeof heading === 'string' ? heading : undefined}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfigure={headerIcon[variant as 'error' | 'warning']}\n\t\t\t\t\t\tverticalCenter\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\tclassName={classNames('slds-popover__header', {\n\t\t\t\t\t'slds-p-vertical_medium': variant === 'walkthrough',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<h2\n\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-text-heading_small': variant !== 'walkthrough',\n\t\t\t\t\t\t'slds-text-heading_medium': variant === 'walkthrough',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{heading}\n\t\t\t\t</h2>\n\t\t\t</header>\n\t\t);\n\t};\n\n\t// Render body\n\tconst renderBody = () => {\n\t\tif (variant === 'error' || variant === 'warning') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t>\n\t\t\t\t\t{body}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{variant === 'walkthrough-action' ? (\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\tname=\"touch_action\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\ticon\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t{heading && (\n\t\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-text-heading_small\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{body}\n\t\t\t\t\t\t\t{stepText && (\n\t\t\t\t\t\t\t\t<p className=\"slds-m-top_medium slds-text-title\">{stepText}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Render footer\n\tconst renderFooter = () => {\n\t\tconst footerClassNames = classNames(\n\t\t\t'slds-popover__footer',\n\t\t\tfooterClassName,\n\t\t\tclassNameFooter\n\t\t);\n\t\tconst footerStyles =\n\t\t\tfooterStyle || styleFooter\n\t\t\t\t? { ...footerStyle, ...styleFooter }\n\t\t\t\t: undefined;\n\n\t\tif (footer) {\n\t\t\treturn (\n\t\t\t\t<footer className={footerClassNames} style={footerStyles}>\n\t\t\t\t\t{footer}\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvariant !== 'walkthrough-action' &&\n\t\t\t(footerWalkthroughActions || stepText)\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<footer className={footerClassNames} style={footerStyles}>\n\t\t\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center\">\n\t\t\t\t\t\t{stepText && <span className=\"slds-text-title\">{stepText}</span>}\n\t\t\t\t\t\t{footerWalkthroughActions && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\t\t\t\tstyle={{ display: 'inline-block' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{footerWalkthroughActions}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// Render dialog\n\tconst renderDialog = () => {\n\t\tif (!isOpen) return null;\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${id}`;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\thasNubbin={!hasNoNubbin}\n\t\t\t\talign={align}\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\tcontentsClassName,\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t{ 'slds-popover_error': variant === 'error' },\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough':\n\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough-alt': variant === 'walkthrough-action',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-popover_feature': variant === 'feature' },\n\t\t\t\t\t{ 'slds-popover_warning': variant === 'warning' },\n\t\t\t\t\tclassNameDialog\n\t\t\t\t)}\n\t\t\t\tcontext={context}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonOpen={handleDialogOpen}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonMouseEnter={openOn === 'hover' ? handleMouseEnter : undefined}\n\t\t\t\tonMouseLeave={openOn === 'hover' ? handleMouseLeave : undefined}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tonRequestTargetElement={getTargetElement}\n\t\t\t\tposition={position}\n\t\t\t\tstyle={styleDialog}\n\t\t\t\tvariant=\"popover\"\n\t\t\t\tref={setMenuRef}\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: `${id}-popover`,\n\t\t\t\t\t'aria-labelledby': ariaLabelledby || `${id}-dialog-heading`,\n\t\t\t\t\t'aria-describedby': `${id}-dialog-body`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!hasNoCloseButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: assistiveText.closeButton }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-button_icon-inverse':\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={handleCancel}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\tinverse={variant === 'error' || variant === 'warning'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderBody()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Dialog>\n\t\t);\n\t};\n\n\t// Clone trigger element\n\tconst otherChildren: ReactNode[] = [];\n\tlet clonedTrigger: ReactNode = null;\n\n\tReact.Children.forEach(children, (child, index) => {\n\t\tif (index === 0 && openOn === 'none') {\n\t\t\t// An anchor only: the popover is positioned against it, nothing more\n\t\t\tclonedTrigger = child;\n\t\t} else if (index === 0 && React.isValidElement(child)) {\n\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\t// The trigger's own handlers run alongside the popover's instead of being replaced.\n\t\t\t// `onClick` already calls the trigger's after the popover's (see `handleClick`).\n\t\t\tconst childOnClick = childProps.onClick;\n\t\t\tconst triggerProps = mergeProps(\n\t\t\t\t{\n\t\t\t\t\t'aria-haspopup': 'dialog',\n\t\t\t\t\tid,\n\t\t\t\t\tonClick:\n\t\t\t\t\t\topenOn === 'click' || openOn === 'hybrid'\n\t\t\t\t\t\t\t? (event: MouseEvent) => {\n\t\t\t\t\t\t\t\t\thandleClick(event, childOnClick as (e: MouseEvent) => void);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: childOnClick,\n\t\t\t\t\tonFocus: openOn === 'hover' ? handleFocus : undefined,\n\t\t\t\t\tonMouseDown,\n\t\t\t\t\tonMouseEnter:\n\t\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid'\n\t\t\t\t\t\t\t? handleMouseEnter\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tonMouseLeave:\n\t\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid'\n\t\t\t\t\t\t\t? handleMouseLeave\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t// `??` so a trigger can opt out of the tab order with -1 (or 0 as a string)\n\t\t\t\t\ttabIndex: childProps.tabIndex ?? 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonFocus: childProps.onFocus,\n\t\t\t\t\tonMouseDown: childProps.onMouseDown,\n\t\t\t\t\tonMouseEnter: childProps.onMouseEnter,\n\t\t\t\t\tonMouseLeave: childProps.onMouseLeave,\n\t\t\t\t}\n\t\t\t);\n\t\t\tclonedTrigger = React.cloneElement(child, triggerProps);\n\t\t} else if (child) {\n\t\t\totherChildren.push(child);\n\t\t}\n\t});\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: hasNoTriggerStyles ? undefined : 'inline-block',\n\t\t...style,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(triggerClassName, className) || undefined}\n\t\t\tstyle={containerStyles}\n\t\t\tref={setContainerRef}\n\t\t>\n\t\t\t{clonedTrigger}\n\t\t\t{otherChildren.length > 0 ? otherChildren : null}\n\t\t\t{renderDialog()}\n\t\t</div>\n\t);\n});\n\nPopover.displayName = POPOVER;\n\nexport default Popover;\n"],"mappings":"ozBAmCA,IAAM,EAAkB,OAAO,SAAa,IAGtC,EAAU,EACb,SAAS,cAAc,MAAM,EAC5B,CAAE,MAAO,CAAC,CAAE,EACZ,IACH,EAAQ,MAAM,IAAM,IACpB,EAAQ,MAAM,KAAO,IACrB,EAAQ,MAAM,MAAQ,OACtB,EAAQ,MAAM,OAAS,OACvB,EAAQ,MAAM,SAAW,YAI1B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Q,OACR,QAAS,IAAY,SAAW,IAAY,SAC5C,CAAA,EAED,GAAa,EACb,GAAW,EACX,GAAa,CACP,GAEV,EAGM,EAA6B,CAAC,EAChC,EAA2B,KAE/B,EAAA,QAAM,SAAS,QAAQ,IAAW,EAAO,IAAU,CAClD,GAAI,IAAU,GAAK,IAAW,OAE7B,EAAgB,OACV,GAAI,IAAU,GAAK,EAAA,QAAM,eAAe,CAAK,EAAG,CACtD,IAAM,EAAa,EAAM,MAGnB,EAAe,EAAW,QAC1B,EAAe,GAAA,QACpB,CACC,gBAAiB,SACjB,KACA,QACC,IAAW,SAAW,IAAW,SAC7B,GAAsB,CACvB,EAAY,EAAO,CAAuC,CAC3D,EACC,EACJ,QAAS,IAAW,QAAU,GAAc,IAAA,GAC5C,eACA,aACC,IAAW,SAAW,IAAW,SAC9B,GACA,IAAA,GACJ,aACC,IAAW,SAAW,IAAW,SAC9B,GACA,IAAA,GAEJ,SAAU,EAAW,UAAY,CAClC,EACA,CACC,QAAS,EAAW,QACpB,YAAa,EAAW,YACxB,aAAc,EAAW,aACzB,aAAc,EAAW,YAC1B,CACD,EACA,EAAgB,EAAA,QAAM,aAAa,EAAO,CAAY,CACvD,MAAW,GACV,EAAc,KAAK,CAAK,CAE1B,CAAC,EAED,IAAM,GAAiC,CACtC,QAAS,GAAqB,IAAA,GAAY,eAC1C,GAAG,EACJ,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,GAAkB,EAAS,GAAK,IAAA,GACtD,MAAO,GACP,IAAK,GAHN,SAAA,CAKE,EACA,EAAc,OAAS,EAAI,EAAgB,KAC3C,GAAa,CACV,GAEP,CAAC,EAED,EAAQ,YAAc,EAAA"}
1
+ {"version":3,"file":"popover.cjs","names":[],"sources":["../../../../components/popover/popover.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\tuseContext,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport MediaObject from '../media-object';\nimport Icon from '../icon';\nimport Dialog from '../utilities/dialog';\nimport { useClickOutside, useControllableState } from '../../utilities/hooks';\nimport keyboardNavigableDialog from '../../utilities/keyboard-navigable-dialog';\nimport KEYS from '../../utilities/key-code';\nimport { POPOVER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport mergeProps from '../../utilities/merge-props';\nimport getComponentDocFn from '../../utilities/get-component-doc';\nimport componentDoc from './component.json';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// Shared overlay element for click-outside detection over iframes\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Track currently open popover for single-popover-at-a-time behavior\nlet currentOpenPopover: {\n\thandleClose: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: PopoverRequestCloseData\n\t) => void;\n\tgetId: () => string;\n} | null = null;\n\n/**\n * Popover alignment options\n */\nexport type PopoverAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\n/**\n * Popover position options\n */\nexport type PopoverPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Popover variant options\n */\nexport type PopoverVariant =\n\t| 'base'\n\t| 'error'\n\t| 'feature'\n\t| 'walkthrough'\n\t| 'walkthrough-action'\n\t| 'warning';\n\n/**\n * Assistive text for Popover\n */\nexport interface PopoverAssistiveText {\n\t/** Label of the close button. Defaults to the English text `Close dialog`. */\n\tcloseButton?: string;\n}\n\n/**\n * What caused `onRequestClose` to fire:\n * * `cancel`: the close button was clicked or Escape was pressed\n * * `clickOutside`: a click landed outside the popover\n * * `mouseLeave`: the mouse left the trigger/popover (`openOn` `hover`/`hybrid`) and `hoverCloseDelay` elapsed\n * * `newPopover`: another Popover opened (only one can be open at a time)\n * * `triggerClick`: the trigger was clicked while the popover was open\n */\nexport type PopoverRequestCloseTrigger =\n\t'cancel' | 'clickOutside' | 'mouseLeave' | 'newPopover' | 'triggerClick';\n\n/**\n * Data passed to `onRequestClose`\n */\nexport interface PopoverRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: PopoverRequestCloseTrigger;\n\t/** HTML id of the popover being closed. Only present when `trigger` is `newPopover`. */\n\tid?: string;\n}\n\n/**\n * What caused `onRequestOpen` to fire:\n * * `focus`: the trigger received focus (`openOn` `hover`)\n * * `mouseEnter`: the mouse entered the trigger (`openOn` `hover`)\n * * `triggerClick`: the trigger was clicked while the popover was closed\n */\nexport type PopoverRequestOpenTrigger = 'focus' | 'mouseEnter' | 'triggerClick';\n\n/**\n * Data passed to `onRequestOpen`\n */\nexport interface PopoverRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: PopoverRequestOpenTrigger;\n}\n\n/**\n * Data passed to `onOpen`\n */\nexport interface PopoverOpenData {\n\t/** The rendered popover dialog element */\n\tportal?: HTMLElement;\n}\n\n/**\n * Data passed to `onClose`\n */\nexport interface PopoverCloseData {\n\t/** `true` when the popover dialog is closing because it is being unmounted */\n\tcomponentWillUnmount: boolean;\n}\n\n/**\n * Props every Popover takes\n */\nexport interface PopoverBaseProps {\n\t/** Alignment relative to trigger */\n\talign?: PopoverAlign;\n\t/** Accessibility labels */\n\tassistiveText?: PopoverAssistiveText;\n\t/**\n\t * The element the popover attaches to (the first child), and optional other children rendered\n\t * beside it. The first child is the trigger: Popover adds `id`, `aria-haspopup`, `tabIndex` and\n\t * its open handlers to it, unless `openOn` is `'none'`, which leaves it as it is.\n\t */\n\tchildren: ReactNode;\n\t/** Popover body content */\n\tbody: ReactNode;\n\t/** CSS classes for the `.slds-popover__body` element */\n\tclassNameBody?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the `.slds-popover__footer` element */\n\tclassNameFooter?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `classNameFooter`. */\n\tfooterClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * CSS classes for the root element: the `div` that wraps the trigger. To style the\n\t * `.slds-popover` dialog (for example `slds-popover_large`), use `classNameDialog`.\n\t */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the `.slds-popover` dialog element */\n\tclassNameDialog?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `classNameDialog`, which lands on the same element. */\n\tcontentsClassName?: string | string[] | Record<string, boolean>;\n\t/** Disable the popover */\n\tdisabled?: boolean;\n\t/** Footer content */\n\tfooter?: ReactNode;\n\t/** @deprecated Use `styleFooter`. */\n\tfooterStyle?: CSSProperties;\n\t/** Walkthrough footer actions */\n\tfooterWalkthroughActions?: ReactNode | ReactNode[];\n\t/** Hide close button */\n\thasNoCloseButton?: boolean;\n\t/** Hide nubbin/arrow */\n\thasNoNubbin?: boolean;\n\t/** Prevent position flipping */\n\thasStaticAlignment?: boolean;\n\t/** Remove trigger inline-block style */\n\thasNoTriggerStyles?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Open state when the popover is controlled. When `isOpen` is set, the popover only opens and closes\n\t * when this prop changes: handle `onRequestOpen` and `onRequestClose` to update it. Leave it\n\t * `undefined` for an uncontrolled popover (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Initial open state of an uncontrolled popover (`isOpen` is `undefined`). Defaults to `false`. */\n\tdefaultIsOpen?: boolean;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent) => void;\n\t/** Called after the popover dialog has closed (unmounted). There is no triggering event, so `event` is `undefined`. */\n\tonClose?: (event: undefined, data: PopoverCloseData) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Mouse leave handler */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/** Called after the popover dialog has opened and rendered. There is no triggering event, so `event` is `undefined`. */\n\tonOpen?: (event: undefined, data: PopoverOpenData) => void;\n\t/**\n\t * Called when the popover requests to open (trigger click, or hover/focus with `openOn` `hover`),\n\t * controlled or not. `data.trigger` says why. A controlled popover opens only if the parent sets\n\t * `isOpen` to `true`.\n\t */\n\tonRequestOpen?: (\n\t\tevent: MouseEvent | FocusEvent,\n\t\tdata: PopoverRequestOpenData\n\t) => void;\n\t/**\n\t * Called when the popover requests to close, controlled or not. `data.trigger` says why. `event` is\n\t * the triggering click or key event, or `undefined` when there is none (`mouseLeave` timer,\n\t * `newPopover`). A controlled popover closes only if the parent sets `isOpen` to `false`.\n\t */\n\tonRequestClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: PopoverRequestCloseData\n\t) => void;\n\t/** Custom target element getter */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * What on the first child opens the popover: `click` (the default), `hover`, or `hybrid` (click\n\t * or hover). `none` makes the first child only an anchor that the popover points at, such as\n\t * the target of a walkthrough step: Popover leaves its markup and handlers alone, and the\n\t * parent opens and closes the popover through `isOpen`.\n\t */\n\topenOn?: 'click' | 'hover' | 'hybrid' | 'none';\n\t/** Overlay for click-outside on iframes */\n\toverlay?:\n\t\tboolean | ((isOpen: boolean, overlayElement: HTMLSpanElement) => void);\n\t/** Positioning strategy */\n\tposition?: PopoverPosition;\n\t/** Walkthrough step text */\n\tstepText?: string;\n\t/** Styles for the root element: the `div` that wraps the trigger. To style the dialog, use `styleDialog`. */\n\tstyle?: CSSProperties;\n\t/** Styles for the `.slds-popover` dialog element */\n\tstyleDialog?: CSSProperties;\n\t/** Styles for the `.slds-popover__footer` element */\n\tstyleFooter?: CSSProperties;\n\t/** @deprecated Use `className`, which lands on the same element. */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Delay before closing on hover (ms) */\n\thoverCloseDelay?: number;\n}\n\n/** The `feature` variant, the only one with an `icon`. */\ninterface PopoverFeatureVariantProps {\n\t/** Popover variant */\n\tvariant: 'feature';\n\t/** Icon for the feature variant */\n\ticon?: ReactNode;\n}\n\n/** Every other variant. */\ninterface PopoverOtherVariantProps {\n\t/** Popover variant */\n\tvariant?: Exclude<PopoverVariant, 'feature'>;\n\ticon?: never;\n}\n\n/**\n * The dialog is named by `heading`, or by the `id` of another element in\n * `ariaLabelledby`, not both.\n */\nexport type PopoverLabelProps =\n\t| {\n\t\t\t/** Popover heading */\n\t\t\theading?: ReactNode;\n\t\t\tariaLabelledby?: never;\n\t }\n\t| {\n\t\t\theading?: never;\n\t\t\t/** HTML id of the heading element that labels the dialog. Use instead of `heading`. */\n\t\t\tariaLabelledby: string;\n\t };\n\n/**\n * Props for the Popover component: `icon` is feature-only, and `heading`\n * and `ariaLabelledby` are exclusive.\n */\nexport type PopoverProps = PopoverBaseProps &\n\t(PopoverFeatureVariantProps | PopoverOtherVariantProps) &\n\tPopoverLabelProps;\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported on mount.\n */\ninterface PopoverRemovedProps {\n\tcloseButtonAssistiveText?: unknown;\n\toffset?: unknown;\n}\n\n// Nubbin positions for export (legacy)\nexport const PopoverNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\nconst defaultAssistiveText: PopoverAssistiveText = {\n\tcloseButton: 'Close dialog',\n};\n\n/**\n * The Popover component is a non-modal dialog. It should be paired with a clickable\n * trigger such as a Button. It traps focus from the page and must be exited if focus\n * needs to be outside the Popover.\n */\nconst Popover = forwardRef<HTMLDivElement, PopoverProps>((props, ref) => {\n\tconst {\n\t\talign = 'right',\n\t\tassistiveText: propAssistiveText,\n\t\tariaLabelledby,\n\t\tchildren,\n\t\tbody,\n\t\tclassNameBody,\n\t\tclassNameFooter,\n\t\tfooterClassName,\n\t\tclassName,\n\t\tclassNameDialog,\n\t\tcontentsClassName,\n\t\tdisabled = false,\n\t\tfooter,\n\t\tfooterStyle,\n\t\tfooterWalkthroughActions,\n\t\thasNoCloseButton = false,\n\t\thasNoNubbin = false,\n\t\thasStaticAlignment = false,\n\t\thasNoTriggerStyles = false,\n\t\theading,\n\t\ticon,\n\t\tid: propId,\n\t\tisOpen: controlledIsOpen,\n\t\tdefaultIsOpen = false,\n\t\toffset,\n\t\tonClick,\n\t\tonClose,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\tonOpen,\n\t\tonRequestOpen,\n\t\tonRequestClose,\n\t\tonRequestTargetElement,\n\t\topenOn = 'click',\n\t\toverlay: overlayProp,\n\t\tposition = 'absolute',\n\t\tstepText,\n\t\tstyle,\n\t\tstyleDialog,\n\t\tstyleFooter,\n\t\ttriggerClassName,\n\t\tvariant = 'base',\n\t\thoverCloseDelay = 300,\n\t\tcloseButtonAssistiveText,\n\t} = props as PopoverBaseProps &\n\t\tPopoverRemovedProps & {\n\t\t\tariaLabelledby?: string;\n\t\t\theading?: ReactNode;\n\t\t\ticon?: ReactNode;\n\t\t\tvariant?: PopoverVariant;\n\t\t};\n\n\t// `check-props.js` is not wired up (its trigger and heading checks predate v11), so the\n\t// renamed and removed props are checked here.\n\tuseEffect(() => {\n\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\tconst createDocUrl = getComponentDocFn(componentDoc);\n\t\t\tconst renamedProps: [string, unknown, string][] = [\n\t\t\t\t['contentsClassName', contentsClassName, 'classNameDialog'],\n\t\t\t\t['footerClassName', footerClassName, 'classNameFooter'],\n\t\t\t\t['footerStyle', footerStyle, 'styleFooter'],\n\t\t\t\t['triggerClassName', triggerClassName, 'className'],\n\t\t\t];\n\t\t\trenamedProps.forEach(([oldProp, value, newProp]) => {\n\t\t\t\tdeprecatedProperty(\n\t\t\t\t\tPOPOVER,\n\t\t\t\t\tvalue,\n\t\t\t\t\toldProp,\n\t\t\t\t\tnewProp,\n\t\t\t\t\tcreateDocUrl(newProp)\n\t\t\t\t);\n\t\t\t});\n\t\t\tconst removedProps: [string, unknown, string | undefined][] = [\n\t\t\t\t[\n\t\t\t\t\t'closeButtonAssistiveText',\n\t\t\t\t\tcloseButtonAssistiveText,\n\t\t\t\t\t\"Use `assistiveText={{ closeButton: '...' }}` instead.\",\n\t\t\t\t],\n\t\t\t\t['offset', offset, undefined],\n\t\t\t];\n\t\t\tremovedProps.forEach(([oldProp, value, comment]) => {\n\t\t\t\tsunsetProperty(POPOVER, value, oldProp, comment);\n\t\t\t});\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Only run on mount\n\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst context = useContext(IconSettingsContext);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t// State\n\tconst [currentIsOpen, setIsOpen] = useControllableState(\n\t\tcontrolledIsOpen,\n\t\tdefaultIsOpen\n\t);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst dialogRef = useRef<HTMLElement>(null);\n\tconst isHoverRef = useRef(false);\n\tconst isClosingRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\tconst isUnmountingRef = useRef(false);\n\n\t// Derived state\n\tconst isOpen = !disabled && currentIsOpen;\n\n\t// Get target element for positioning\n\tconst getTargetElement = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\tconst target = onRequestTargetElement();\n\t\t\tif (target) return target;\n\t\t}\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Handle dialog close (when unmounted)\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\t_event?: React.SyntheticEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tconst componentWillUnmount = data?.componentWillUnmount || false;\n\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\n\t\t\tif (onClose) {\n\t\t\t\tonClose(undefined, { componentWillUnmount });\n\t\t\t}\n\t\t},\n\t\t[id, onClose]\n\t);\n\n\t// Handle dialog open (after it has rendered)\n\tconst handleDialogOpen = useCallback(\n\t\t(_event?: unknown, data?: { portal?: HTMLElement }) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(undefined, { portal: data?.portal });\n\t\t\t}\n\t\t},\n\t\t[onOpen]\n\t);\n\n\t// Handle close\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\t\tdata: PopoverRequestCloseData\n\t\t) => {\n\t\t\tif (isOpen) {\n\t\t\t\tif (onRequestClose) {\n\t\t\t\t\tonRequestClose(event, data);\n\t\t\t\t}\n\n\t\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\t\tcurrentOpenPopover = null;\n\t\t\t\t}\n\n\t\t\t\tsetIsOpen(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[isOpen, id, onRequestClose, setIsOpen]\n\t);\n\n\t// Latest `handleClose`, so the \"close the other open popover\" path does not call a stale\n\t// closure from when this popover opened (whose `isOpen` was still `false`).\n\tconst handleCloseRef = useRef(handleClose);\n\tuseEffect(() => {\n\t\thandleCloseRef.current = handleClose;\n\t}, [handleClose]);\n\n\t// Handle open\n\tconst handleOpen = useCallback(\n\t\t(event: MouseEvent | FocusEvent, trigger: PopoverRequestOpenTrigger) => {\n\t\t\tif (!isOpen && !disabled) {\n\t\t\t\tonRequestOpen?.(event, { trigger });\n\n\t\t\t\t// Close any other open popover\n\t\t\t\tif (currentOpenPopover && currentOpenPopover.getId() !== id) {\n\t\t\t\t\tcurrentOpenPopover.handleClose(undefined, {\n\t\t\t\t\t\ttrigger: 'newPopover',\n\t\t\t\t\t\tid: currentOpenPopover.getId(),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tcurrentOpenPopover = {\n\t\t\t\t\thandleClose: (event, data) => handleCloseRef.current(event, data),\n\t\t\t\t\tgetId: () => id,\n\t\t\t\t};\n\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t},\n\t\t[isOpen, disabled, id, onRequestOpen, setIsOpen]\n\t);\n\n\t// Handle cancel (close button or escape)\n\tconst handleCancel = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent) => {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Request a close on a mousedown outside the popover. The container holds the trigger\n\t// and an inline dialog; a dialog in a portal carries the ignore class instead.\n\tconst handleClickOutside = useCallback(\n\t\t(event: globalThis.MouseEvent | TouchEvent) => {\n\t\t\thandleClose(event as unknown as MouseEvent, { trigger: 'clickOutside' });\n\t\t},\n\t\t[handleClose]\n\t);\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: isOpen,\n\t\tignoreClass: `ignore-click-${id}`,\n\t});\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\n\t\t\tif (!isOpen && openOn === 'hover') {\n\t\t\t\thandleOpen(event, 'mouseEnter');\n\t\t\t} else {\n\t\t\t\tif (isClosingRef.current) {\n\t\t\t\t\tclearTimeout(isClosingRef.current);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onMouseEnter) {\n\t\t\t\tonMouseEnter(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\tisClosingRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose(undefined, { trigger: 'mouseLeave' });\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\n\t\t\tif (onMouseLeave) {\n\t\t\t\tonMouseLeave(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent, triggerOnClickCallback?: (e: MouseEvent) => void) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen(event, 'triggerClick');\n\t\t\t} else {\n\t\t\t\thandleClose(event, { trigger: 'triggerClick' });\n\t\t\t}\n\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event);\n\t\t\t}\n\n\t\t\tif (triggerOnClickCallback) {\n\t\t\t\ttriggerOnClickCallback(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, handleClose, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen(event, 'focus');\n\t\t\t}\n\n\t\t\tif (onFocus) {\n\t\t\t\tonFocus(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, onFocus]\n\t);\n\n\t// Toggle from keyboard\n\t// `handleKeyDown` is only attached to the open dialog, so this only ever closes it (Escape).\n\tconst toggleOpenFromKeyboard = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\thandleCancel(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleCancel]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.key) {\n\t\t\t\tif (event.key !== KEYS.TAB) {\n\t\t\t\t\tkeyboardNavigableDialog({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen,\n\t\t\t\t\t\thandleClick: (e: MouseEvent) => handleClick(e),\n\t\t\t\t\t\tkey: event.key,\n\t\t\t\t\t\teventTarget: event.target,\n\t\t\t\t\t\t// keyboardNavigableDialog calls `toggleOpen()` without the event; pass it through\n\t\t\t\t\t\ttoggleOpen: () => toggleOpenFromKeyboard(event),\n\t\t\t\t\t\ttrigger: triggerRef.current,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (onKeyDown) {\n\t\t\t\t\tonKeyDown(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleClick, toggleOpenFromKeyboard, onKeyDown]\n\t);\n\n\t// Render overlay for click-outside detection\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (typeof overlayProp === 'function' && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (\n\t\t\t\toverlayProp &&\n\t\t\t\tshouldShow &&\n\t\t\t\t!overlayRef.current &&\n\t\t\t\tdocumentDefined\n\t\t\t) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Container ref callback\n\tconst setContainerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\t(triggerRef as React.RefObject<HTMLDivElement | null>).current =\n\t\t\t\tcomponent;\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(component);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = component;\n\t\t\t}\n\t\t},\n\t\t[ref]\n\t);\n\n\t// Dialog ref callback\n\tconst setMenuRef = useCallback((component: HTMLElement | null) => {\n\t\t(dialogRef as React.RefObject<HTMLElement | null>).current = component;\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t};\n\t}, [id, renderOverlay]);\n\n\t// Update overlay when isOpen changes\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// Render header\n\tconst renderHeader = () => {\n\t\tconst hasThemedHeader = variant === 'error' || variant === 'warning';\n\t\tconst hasDefinedHeader = heading || hasThemedHeader;\n\n\t\tif (\n\t\t\t!hasDefinedHeader ||\n\t\t\tvariant === 'walkthrough-action' ||\n\t\t\tvariant === 'feature'\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst headerIcon = {\n\t\t\terror: <Icon category=\"utility\" name=\"error\" size=\"x-small\" inverse />,\n\t\t\twarning: (\n\t\t\t\t<Icon category=\"utility\" name=\"warning\" size=\"x-small\" inverse />\n\t\t\t),\n\t\t};\n\n\t\tif (hasThemedHeader) {\n\t\t\treturn (\n\t\t\t\t<header className=\"slds-popover__header\">\n\t\t\t\t\t<MediaObject\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\tclassName=\"slds-truncate slds-text-heading_medium\"\n\t\t\t\t\t\t\t\ttitle={typeof heading === 'string' ? heading : undefined}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfigure={headerIcon[variant as 'error' | 'warning']}\n\t\t\t\t\t\tverticalCenter\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\tclassName={classNames('slds-popover__header', {\n\t\t\t\t\t'slds-p-vertical_medium': variant === 'walkthrough',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<h2\n\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-text-heading_small': variant !== 'walkthrough',\n\t\t\t\t\t\t'slds-text-heading_medium': variant === 'walkthrough',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{heading}\n\t\t\t\t</h2>\n\t\t\t</header>\n\t\t);\n\t};\n\n\t// Render body\n\tconst renderBody = () => {\n\t\tif (variant === 'error' || variant === 'warning') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t>\n\t\t\t\t\t{body}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{variant === 'walkthrough-action' ? (\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\tname=\"touch_action\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\ticon\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t{heading && (\n\t\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-text-heading_small\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{body}\n\t\t\t\t\t\t\t{stepText && (\n\t\t\t\t\t\t\t\t<p className=\"slds-m-top_medium slds-text-title\">{stepText}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Render footer\n\tconst renderFooter = () => {\n\t\tconst footerClassNames = classNames(\n\t\t\t'slds-popover__footer',\n\t\t\tfooterClassName,\n\t\t\tclassNameFooter\n\t\t);\n\t\tconst footerStyles =\n\t\t\tfooterStyle || styleFooter\n\t\t\t\t? { ...footerStyle, ...styleFooter }\n\t\t\t\t: undefined;\n\n\t\tif (footer) {\n\t\t\treturn (\n\t\t\t\t<footer className={footerClassNames} style={footerStyles}>\n\t\t\t\t\t{footer}\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvariant !== 'walkthrough-action' &&\n\t\t\t(footerWalkthroughActions || stepText)\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<footer className={footerClassNames} style={footerStyles}>\n\t\t\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center\">\n\t\t\t\t\t\t{stepText && <span className=\"slds-text-title\">{stepText}</span>}\n\t\t\t\t\t\t{footerWalkthroughActions && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\t\t\t\tstyle={{ display: 'inline-block' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{footerWalkthroughActions}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// Render dialog\n\tconst renderDialog = () => {\n\t\tif (!isOpen) return null;\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${id}`;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\thasNubbin={!hasNoNubbin}\n\t\t\t\talign={align}\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\tcontentsClassName,\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t{ 'slds-popover_error': variant === 'error' },\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough':\n\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough-alt': variant === 'walkthrough-action',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-popover_feature': variant === 'feature' },\n\t\t\t\t\t{ 'slds-popover_warning': variant === 'warning' },\n\t\t\t\t\tclassNameDialog\n\t\t\t\t)}\n\t\t\t\tcontext={context}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonOpen={handleDialogOpen}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonMouseEnter={openOn === 'hover' ? handleMouseEnter : undefined}\n\t\t\t\tonMouseLeave={openOn === 'hover' ? handleMouseLeave : undefined}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tonRequestTargetElement={getTargetElement}\n\t\t\t\tposition={position}\n\t\t\t\tstyle={styleDialog}\n\t\t\t\tvariant=\"popover\"\n\t\t\t\tref={setMenuRef}\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: `${id}-popover`,\n\t\t\t\t\t'aria-labelledby': ariaLabelledby || `${id}-dialog-heading`,\n\t\t\t\t\t'aria-describedby': `${id}-dialog-body`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!hasNoCloseButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: assistiveText.closeButton }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-button_icon-inverse':\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={handleCancel}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\tinverse={variant === 'error' || variant === 'warning'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderBody()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Dialog>\n\t\t);\n\t};\n\n\t// Clone trigger element\n\tconst otherChildren: ReactNode[] = [];\n\tlet clonedTrigger: ReactNode = null;\n\n\tReact.Children.forEach(children, (child, index) => {\n\t\tif (index === 0 && openOn === 'none') {\n\t\t\t// An anchor only: the popover is positioned against it, nothing more\n\t\t\tclonedTrigger = child;\n\t\t} else if (index === 0 && React.isValidElement(child)) {\n\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\t// The trigger's own handlers run alongside the popover's instead of being replaced.\n\t\t\t// `onClick` already calls the trigger's after the popover's (see `handleClick`).\n\t\t\tconst childOnClick = childProps.onClick;\n\t\t\tconst triggerProps = mergeProps(\n\t\t\t\t{\n\t\t\t\t\t'aria-haspopup': 'dialog',\n\t\t\t\t\tid,\n\t\t\t\t\tonClick:\n\t\t\t\t\t\topenOn === 'click' || openOn === 'hybrid'\n\t\t\t\t\t\t\t? (event: MouseEvent) => {\n\t\t\t\t\t\t\t\t\thandleClick(event, childOnClick as (e: MouseEvent) => void);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: childOnClick,\n\t\t\t\t\tonFocus: openOn === 'hover' ? handleFocus : undefined,\n\t\t\t\t\tonMouseDown,\n\t\t\t\t\tonMouseEnter:\n\t\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid'\n\t\t\t\t\t\t\t? handleMouseEnter\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tonMouseLeave:\n\t\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid'\n\t\t\t\t\t\t\t? handleMouseLeave\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t// `??` so a trigger can opt out of the tab order with -1 (or 0 as a string)\n\t\t\t\t\ttabIndex: childProps.tabIndex ?? 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonFocus: childProps.onFocus,\n\t\t\t\t\tonMouseDown: childProps.onMouseDown,\n\t\t\t\t\tonMouseEnter: childProps.onMouseEnter,\n\t\t\t\t\tonMouseLeave: childProps.onMouseLeave,\n\t\t\t\t}\n\t\t\t);\n\t\t\tclonedTrigger = React.cloneElement(child, triggerProps);\n\t\t} else if (child) {\n\t\t\totherChildren.push(child);\n\t\t}\n\t});\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: hasNoTriggerStyles ? undefined : 'inline-block',\n\t\t...style,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(triggerClassName, className) || undefined}\n\t\t\tstyle={containerStyles}\n\t\t\tref={setContainerRef}\n\t\t>\n\t\t\t{clonedTrigger}\n\t\t\t{otherChildren.length > 0 ? otherChildren : null}\n\t\t\t{renderDialog()}\n\t\t</div>\n\t);\n});\n\nPopover.displayName = POPOVER;\n\nexport default Popover;\n"],"mappings":"82BAkCA,IAAM,EAAkB,OAAO,SAAa,IAGtC,EAAU,EACb,SAAS,cAAc,MAAM,EAC5B,CAAE,MAAO,CAAC,CAAE,EACZ,IACH,EAAQ,MAAM,IAAM,IACpB,EAAQ,MAAM,KAAO,IACrB,EAAQ,MAAM,MAAQ,OACtB,EAAQ,MAAM,OAAS,OACvB,EAAQ,MAAM,SAAW,YAI1B,IAAI,EAMO,KAyQE,EAAyB,CACrC,WACA,MACA,YACA,cACA,SACA,cACD,EAEM,GAA6C,CAClD,YAAa,cACd,EAOM,GAAA,EAAU,EAAA,WAAA,EAA0C,EAAO,IAAQ,CACxE,GAAM,CACL,QAAQ,QACR,cAAe,GACf,iBACA,YACA,OACA,gBACA,mBACA,kBACA,aACA,mBACA,oBACA,WAAW,GACX,SACA,cACA,2BACA,oBAAmB,GACnB,eAAc,GACd,sBAAqB,GACrB,sBAAqB,GACrB,UACA,QACA,GAAI,GACJ,OAAQ,GACR,iBAAgB,GAChB,UACA,UACA,UACA,UACA,YACA,eACA,eACA,eACA,SACA,gBACA,iBACA,yBACA,SAAS,QACT,QAAS,EACT,YAAW,WACX,WACA,SACA,eACA,cACA,mBACA,UAAU,OACV,kBAAkB,IAClB,6BACG,GAUJ,EAAA,EAAA,UAAA,KAAgB,CACf,GAAA,QAAA,IAAA,WAA6B,aAAc,CAC1C,IAAM,EAAe,EAAA,QAAkB,GAAA,OAAY,EAOnD,CALC,CAAC,oBAAqB,EAAmB,iBAAiB,EAC1D,CAAC,kBAAmB,EAAiB,iBAAiB,EACtD,CAAC,cAAe,EAAa,aAAa,EAC1C,CAAC,mBAAoB,EAAkB,WAAW,CAEnD,CAAA,CA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