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

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 (400) hide show
  1. package/README.md +18 -0
  2. package/dist/cjs/components/alert/index.cjs +1 -1
  3. package/dist/cjs/components/alert/index.cjs.map +1 -1
  4. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  5. package/dist/cjs/components/button/check-props.cjs +1 -1
  6. package/dist/cjs/components/button/check-props.cjs.map +1 -1
  7. package/dist/cjs/components/button/index.cjs +1 -1
  8. package/dist/cjs/components/button/index.cjs.map +1 -1
  9. package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
  10. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
  11. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  12. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  13. package/dist/cjs/components/carousel/index.cjs +1 -1
  14. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  15. package/dist/cjs/components/carousel/private/carousel-indicators.cjs.map +1 -1
  16. package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
  17. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  18. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  19. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  20. package/dist/cjs/components/checkbox/index.cjs +1 -1
  21. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  22. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  23. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  24. package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
  25. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  26. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  27. package/dist/cjs/components/color-picker/private/swatch-option.cjs +1 -1
  28. package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
  29. package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
  30. package/dist/cjs/components/color-picker/private/swatch.cjs.map +1 -1
  31. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  32. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  33. package/dist/cjs/components/combobox/index.cjs +1 -1
  34. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  35. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  36. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  37. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  38. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  39. package/dist/cjs/components/date-picker/private/calendar.cjs.map +1 -1
  40. package/dist/cjs/components/date-picker/private/day.cjs +1 -1
  41. package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
  42. package/dist/cjs/components/files/file.cjs +1 -8
  43. package/dist/cjs/components/files/file.cjs.map +1 -1
  44. package/dist/cjs/components/files/private/file-actions.cjs +1 -1
  45. package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
  46. package/dist/cjs/components/files/private/file-figure.cjs +1 -1
  47. package/dist/cjs/components/files/private/file-figure.cjs.map +1 -1
  48. package/dist/cjs/components/filter/filter.cjs +1 -1
  49. package/dist/cjs/components/filter/filter.cjs.map +1 -1
  50. package/dist/cjs/components/icon/check-props.cjs +1 -1
  51. package/dist/cjs/components/icon/check-props.cjs.map +1 -1
  52. package/dist/cjs/components/icon/index.cjs +1 -1
  53. package/dist/cjs/components/icon/index.cjs.map +1 -1
  54. package/dist/cjs/components/input/check-props.cjs +1 -1
  55. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  56. package/dist/cjs/components/input/index.cjs.map +1 -1
  57. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  58. package/dist/cjs/components/input/search.cjs.map +1 -1
  59. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  60. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  61. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  62. package/dist/cjs/components/modal/index.cjs +1 -1
  63. package/dist/cjs/components/modal/index.cjs.map +1 -1
  64. package/dist/cjs/components/pill/index.cjs.map +1 -1
  65. package/dist/cjs/components/pill-container/index.cjs +1 -1
  66. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  67. package/dist/cjs/components/popover/index.cjs.map +1 -1
  68. package/dist/cjs/components/popover/popover.cjs +1 -1
  69. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  70. package/dist/cjs/components/progress-indicator/private/step.cjs.map +1 -1
  71. package/dist/cjs/components/radio/index.cjs +1 -1
  72. package/dist/cjs/components/radio/index.cjs.map +1 -1
  73. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  74. package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
  75. package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -1
  76. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  77. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  78. package/dist/cjs/components/simple-data-table/interactive-element.cjs +1 -1
  79. package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
  80. package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
  81. package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
  82. package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
  83. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  84. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  85. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  86. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  87. package/dist/cjs/components/simple-data-table/private/link.cjs +1 -1
  88. package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -1
  89. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  90. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  91. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  92. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  93. package/dist/cjs/components/slider/index.cjs.map +1 -1
  94. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  95. package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
  96. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  97. package/dist/cjs/components/tabs/private/tab.cjs +1 -1
  98. package/dist/cjs/components/tabs/private/tab.cjs.map +1 -1
  99. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  100. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  101. package/dist/cjs/components/textarea/index.cjs +1 -1
  102. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  103. package/dist/cjs/components/toast/index.cjs.map +1 -1
  104. package/dist/cjs/components/tooltip/index.cjs +1 -3
  105. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  106. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  107. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  108. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  109. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  110. package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
  111. package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
  112. package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
  113. package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
  114. package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
  115. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  116. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  117. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  118. package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
  119. package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
  120. package/dist/cjs/utilities/color.cjs +1 -1
  121. package/dist/cjs/utilities/color.cjs.map +1 -1
  122. package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
  123. package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
  124. package/dist/cjs/utilities/get-aria-props.cjs +1 -1
  125. package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
  126. package/dist/cjs/utilities/get-data-props.cjs +1 -1
  127. package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
  128. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
  129. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
  130. package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
  131. package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
  132. package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
  133. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  134. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  135. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  136. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  137. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  138. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  139. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
  140. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
  141. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
  142. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
  143. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
  144. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
  145. package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
  146. package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
  147. package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
  148. package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
  149. package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
  150. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
  151. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
  152. package/dist/cjs/utilities/warning/required-property.cjs +1 -1
  153. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
  154. package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
  155. package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
  156. package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
  157. package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
  158. package/dist/es/components/alert/index.js +4 -5
  159. package/dist/es/components/alert/index.js.map +1 -1
  160. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  161. package/dist/es/components/button/check-props.js +1 -1
  162. package/dist/es/components/button/check-props.js.map +1 -1
  163. package/dist/es/components/button/index.js +50 -50
  164. package/dist/es/components/button/index.js.map +1 -1
  165. package/dist/es/components/button-stateful/check-props.js +1 -1
  166. package/dist/es/components/button-stateful/check-props.js.map +1 -1
  167. package/dist/es/components/button-stateful/index.js +3 -2
  168. package/dist/es/components/button-stateful/index.js.map +1 -1
  169. package/dist/es/components/carousel/index.js +155 -129
  170. package/dist/es/components/carousel/index.js.map +1 -1
  171. package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
  172. package/dist/es/components/carousel/private/carousel-item.js +1 -1
  173. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  174. package/dist/es/components/checkbox/check-props.js +1 -1
  175. package/dist/es/components/checkbox/check-props.js.map +1 -1
  176. package/dist/es/components/checkbox/index.js +102 -100
  177. package/dist/es/components/checkbox/index.js.map +1 -1
  178. package/dist/es/components/color-picker/color-picker.js +150 -151
  179. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  180. package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
  181. package/dist/es/components/color-picker/private/hsv-color.js +16 -20
  182. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  183. package/dist/es/components/color-picker/private/swatch-option.js +2 -2
  184. package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
  185. package/dist/es/components/color-picker/private/swatch.js +1 -1
  186. package/dist/es/components/color-picker/private/swatch.js.map +1 -1
  187. package/dist/es/components/combobox/combobox.js +565 -580
  188. package/dist/es/components/combobox/combobox.js.map +1 -1
  189. package/dist/es/components/combobox/index.js +6 -19
  190. package/dist/es/components/combobox/index.js.map +1 -1
  191. package/dist/es/components/combobox/private/menu.js +3 -3
  192. package/dist/es/components/combobox/private/menu.js.map +1 -1
  193. package/dist/es/components/date-picker/date-picker.js +101 -102
  194. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  195. package/dist/es/components/date-picker/private/calendar.js.map +1 -1
  196. package/dist/es/components/date-picker/private/day.js +1 -1
  197. package/dist/es/components/date-picker/private/day.js.map +1 -1
  198. package/dist/es/components/files/file.js +5 -6
  199. package/dist/es/components/files/file.js.map +1 -1
  200. package/dist/es/components/files/private/file-actions.js +2 -2
  201. package/dist/es/components/files/private/file-actions.js.map +1 -1
  202. package/dist/es/components/files/private/file-figure.js +1 -1
  203. package/dist/es/components/files/private/file-figure.js.map +1 -1
  204. package/dist/es/components/filter/filter.js +5 -1
  205. package/dist/es/components/filter/filter.js.map +1 -1
  206. package/dist/es/components/icon/check-props.js +9 -7
  207. package/dist/es/components/icon/check-props.js.map +1 -1
  208. package/dist/es/components/icon/index.js +13 -10
  209. package/dist/es/components/icon/index.js.map +1 -1
  210. package/dist/es/components/input/check-props.js +14 -13
  211. package/dist/es/components/input/check-props.js.map +1 -1
  212. package/dist/es/components/input/index.js.map +1 -1
  213. package/dist/es/components/input/private/inner-input.js.map +1 -1
  214. package/dist/es/components/input/search.js.map +1 -1
  215. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  216. package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
  217. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  218. package/dist/es/components/modal/index.js +1 -2
  219. package/dist/es/components/modal/index.js.map +1 -1
  220. package/dist/es/components/pill/index.js.map +1 -1
  221. package/dist/es/components/pill-container/index.js +10 -6
  222. package/dist/es/components/pill-container/index.js.map +1 -1
  223. package/dist/es/components/popover/index.js.map +1 -1
  224. package/dist/es/components/popover/popover.js +181 -177
  225. package/dist/es/components/popover/popover.js.map +1 -1
  226. package/dist/es/components/progress-indicator/private/step.js.map +1 -1
  227. package/dist/es/components/radio/index.js +1 -1
  228. package/dist/es/components/radio/index.js.map +1 -1
  229. package/dist/es/components/radio-group/index.js.map +1 -1
  230. package/dist/es/components/simple-data-table/cell.js +8 -5
  231. package/dist/es/components/simple-data-table/cell.js.map +1 -1
  232. package/dist/es/components/simple-data-table/index.js +97 -91
  233. package/dist/es/components/simple-data-table/index.js.map +1 -1
  234. package/dist/es/components/simple-data-table/interactive-element.js +31 -28
  235. package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
  236. package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
  237. package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
  238. package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
  239. package/dist/es/components/simple-data-table/private/head.js +65 -42
  240. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  241. package/dist/es/components/simple-data-table/private/header-cell.js +2 -1
  242. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  243. package/dist/es/components/simple-data-table/private/link.js.map +1 -1
  244. package/dist/es/components/simple-data-table/private/row.js +96 -60
  245. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  246. package/dist/es/components/simple-data-table/row-actions.js +4 -1
  247. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  248. package/dist/es/components/slider/index.js.map +1 -1
  249. package/dist/es/components/split-view/listbox.js.map +1 -1
  250. package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
  251. package/dist/es/components/tabs/index.js.map +1 -1
  252. package/dist/es/components/tabs/private/tab.js +1 -1
  253. package/dist/es/components/tabs/private/tab.js.map +1 -1
  254. package/dist/es/components/textarea/check-props.js +1 -1
  255. package/dist/es/components/textarea/check-props.js.map +1 -1
  256. package/dist/es/components/textarea/index.js +4 -2
  257. package/dist/es/components/textarea/index.js.map +1 -1
  258. package/dist/es/components/toast/index.js.map +1 -1
  259. package/dist/es/components/tooltip/index.js +107 -88
  260. package/dist/es/components/tooltip/index.js.map +1 -1
  261. package/dist/es/components/tree/private/branch.js.map +1 -1
  262. package/dist/es/components/tree/private/item.js.map +1 -1
  263. package/dist/es/components/tree/private/render-branch.js +14 -19
  264. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  265. package/dist/es/components/utilities/dialog/index.js +2 -1
  266. package/dist/es/components/utilities/dialog/index.js.map +1 -1
  267. package/dist/es/components/utilities/dialog/portal.js +5 -3
  268. package/dist/es/components/utilities/dialog/portal.js.map +1 -1
  269. package/dist/es/components/utilities/menu-list/index.js +6 -6
  270. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  271. package/dist/es/components/utilities/menu-list/item.js +42 -18
  272. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  273. package/dist/es/components/utilities/utility-icon/index.js +32 -52
  274. package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
  275. package/dist/es/utilities/color.js +1 -1
  276. package/dist/es/utilities/color.js.map +1 -1
  277. package/dist/es/utilities/dom-element-focus.js.map +1 -1
  278. package/dist/es/utilities/execution-environment.js.map +1 -1
  279. package/dist/es/utilities/get-aria-props.js +1 -1
  280. package/dist/es/utilities/get-aria-props.js.map +1 -1
  281. package/dist/es/utilities/get-data-props.js +1 -1
  282. package/dist/es/utilities/get-data-props.js.map +1 -1
  283. package/dist/es/utilities/keyboard-navigable-dialog.js +7 -7
  284. package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
  285. package/dist/es/utilities/keyboard-navigate.js +1 -1
  286. package/dist/es/utilities/keyboard-navigate.js.map +1 -1
  287. package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
  288. package/dist/es/utilities/warning/children-as-trigger.js +8 -7
  289. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  290. package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
  291. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  292. package/dist/es/utilities/warning/deprecated-property.js +8 -7
  293. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  294. package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
  295. package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
  296. package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
  297. package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
  298. package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
  299. package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
  300. package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
  301. package/dist/es/utilities/warning/one-of-required-property.js +11 -10
  302. package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
  303. package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
  304. package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
  305. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
  306. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
  307. package/dist/es/utilities/warning/required-property.js +8 -7
  308. package/dist/es/utilities/warning/required-property.js.map +1 -1
  309. package/dist/es/utilities/warning/sunset-property.js +8 -7
  310. package/dist/es/utilities/warning/sunset-property.js.map +1 -1
  311. package/dist/es/utilities/warning/warned-registry.js +10 -0
  312. package/dist/es/utilities/warning/warned-registry.js.map +1 -0
  313. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  314. package/dist/types/components/button/index.d.ts +14 -4
  315. package/dist/types/components/button/index.d.ts.map +1 -1
  316. package/dist/types/components/button-stateful/index.d.ts +5 -2
  317. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  318. package/dist/types/components/carousel/index.d.ts +7 -1
  319. package/dist/types/components/carousel/index.d.ts.map +1 -1
  320. package/dist/types/components/checkbox/index.d.ts +4 -1
  321. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  322. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  323. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  324. package/dist/types/components/combobox/index.d.ts +1 -1
  325. package/dist/types/components/combobox/index.d.ts.map +1 -1
  326. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  327. package/dist/types/components/files/file.d.ts +5 -0
  328. package/dist/types/components/files/file.d.ts.map +1 -1
  329. package/dist/types/components/icon/index.d.ts +7 -1
  330. package/dist/types/components/icon/index.d.ts.map +1 -1
  331. package/dist/types/components/input/index.d.ts +9 -6
  332. package/dist/types/components/input/index.d.ts.map +1 -1
  333. package/dist/types/components/input/search.d.ts.map +1 -1
  334. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  335. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +9 -3
  336. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  337. package/dist/types/components/modal/index.d.ts.map +1 -1
  338. package/dist/types/components/pill/index.d.ts.map +1 -1
  339. package/dist/types/components/popover/index.d.ts.map +1 -1
  340. package/dist/types/components/popover/popover.d.ts.map +1 -1
  341. package/dist/types/components/radio/index.d.ts +9 -2
  342. package/dist/types/components/radio/index.d.ts.map +1 -1
  343. package/dist/types/components/radio-group/index.d.ts +3 -3
  344. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  345. package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
  346. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  347. package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
  348. package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
  349. package/dist/types/components/simple-data-table/types.d.ts +10 -2
  350. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  351. package/dist/types/components/slider/index.d.ts +2 -2
  352. package/dist/types/components/slider/index.d.ts.map +1 -1
  353. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  354. package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
  355. package/dist/types/components/tabs/index.d.ts.map +1 -1
  356. package/dist/types/components/textarea/index.d.ts +9 -6
  357. package/dist/types/components/textarea/index.d.ts.map +1 -1
  358. package/dist/types/components/toast/index.d.ts.map +1 -1
  359. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  360. package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
  361. package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
  362. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  363. package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
  364. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  365. package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
  366. package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
  367. package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
  368. package/dist/types/types/common.d.ts.map +1 -1
  369. package/dist/types/types/components.d.ts.map +1 -1
  370. package/package.json +2 -3
  371. package/dist/cjs/icons/action/index.cjs +0 -2
  372. package/dist/cjs/icons/action/index.cjs.map +0 -1
  373. package/dist/cjs/icons/custom/index.cjs +0 -2
  374. package/dist/cjs/icons/custom/index.cjs.map +0 -1
  375. package/dist/cjs/icons/doctype/index.cjs +0 -2
  376. package/dist/cjs/icons/doctype/index.cjs.map +0 -1
  377. package/dist/cjs/icons/standard/index.cjs +0 -2
  378. package/dist/cjs/icons/standard/index.cjs.map +0 -1
  379. package/dist/cjs/icons/utility/index.cjs +0 -2
  380. package/dist/cjs/icons/utility/index.cjs.map +0 -1
  381. package/dist/es/icons/action/index.js +0 -6
  382. package/dist/es/icons/action/index.js.map +0 -1
  383. package/dist/es/icons/custom/index.js +0 -6
  384. package/dist/es/icons/custom/index.js.map +0 -1
  385. package/dist/es/icons/doctype/index.js +0 -6
  386. package/dist/es/icons/doctype/index.js.map +0 -1
  387. package/dist/es/icons/standard/index.js +0 -6
  388. package/dist/es/icons/standard/index.js.map +0 -1
  389. package/dist/es/icons/utility/index.js +0 -6
  390. package/dist/es/icons/utility/index.js.map +0 -1
  391. package/dist/types/icons/action/index.d.ts +0 -3
  392. package/dist/types/icons/action/index.d.ts.map +0 -1
  393. package/dist/types/icons/custom/index.d.ts +0 -3
  394. package/dist/types/icons/custom/index.d.ts.map +0 -1
  395. package/dist/types/icons/doctype/index.d.ts +0 -3
  396. package/dist/types/icons/doctype/index.d.ts.map +0 -1
  397. package/dist/types/icons/standard/index.d.ts +0 -3
  398. package/dist/types/icons/standard/index.d.ts.map +0 -1
  399. package/dist/types/icons/utility/index.d.ts +0 -3
  400. package/dist/types/icons/utility/index.d.ts.map +0 -1
@@ -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,CAA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BAAA,GACA,wBAAyB,EACzB,UAAW,EACJ,OACP,CAAA,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,CAA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OACP,CAAA,CAEH,EAEA,EAAc,YAAc,EAAA"}
@@ -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,CAA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"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\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,KAwQE,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,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D,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,EAAkB,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 +1 @@
1
- {"version":3,"file":"step.cjs","names":[],"sources":["../../../../../components/progress-indicator/private/step.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\nimport React from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\n// Child component\nimport Tooltip, { type TooltipAlign, type TooltipTheme } from '../../tooltip';\nimport { PROGRESS_INDICATOR_STEP } from '../../../utilities/constants';\nimport ButtonIcon from '../../icon/button-icon';\nimport {\n\ttype ProgressStep,\n\ttype ProgressIndicatorAssistiveText,\n\ttype ProgressIndicatorVariant,\n\ttype TooltipPosition,\n\ttype StepEventData,\n} from '../index';\n\n// ### Display Name\nconst displayName = PROGRESS_INDICATOR_STEP;\n\nexport interface StepProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `completedStep`: Label for a completed step. The default is `Completed Step`\n\t * * `disabledStep`: Label for disabled step. The default is `Disabled Step`\n\t * * `errorStep`: Label for a step with an error. The default is `Error Step`\n\t * * `percentage`: Label for Progress Bar. The default is `Progress: [this.props.value]%`.\n\t * * `step`: Label for a step. It will be typically followed by the number of the step such as \"Step 1\".\n\t */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/**\n\t * Id for Steps, ranging in [0, steps.length).\n\t */\n\tid?: number | string;\n\t/**\n\t * Index of step. Used for id's if no step ID exists\n\t */\n\tindex: number;\n\t/**\n\t * Determines if the step has been completed\n\t */\n\tisCompleted?: boolean;\n\t/**\n\t * Determines if the step has been disabled\n\t */\n\tisDisabled?: boolean;\n\t/**\n\t * Determines if the step contains an error\n\t */\n\tisError?: boolean;\n\t/**\n\t * Determines if the step is currently selected (active)\n\t */\n\tisSelected?: boolean;\n\t/**\n\t * Triggered when click on individual steps.\n\t */\n\tonClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: StepEventData\n\t) => void;\n\t/**\n\t * Triggered when focus on individual steps.\n\t */\n\tonFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/**\n\t * Step object. This is passed into event callbacks.\n\t */\n\tstep: ProgressStep;\n\t/**\n\t * Determines if the tooltip attached to step is always open.\n\t */\n\ttooltipIsOpen?: boolean;\n\t/**\n\t * Position strategy for the step's tooltip.\n\t */\n\ttooltipPosition?: TooltipPosition;\n\t/**\n\t * The variant of the parent progress indicator\n\t */\n\tvariant?: ProgressIndicatorVariant;\n}\n\n/**\n * Step renders a button icon and its tooltip if applied.\n * The button is applied with different css classes under different conditions.\n * Button icons have 4 types of status: completed (success), active (in progress), error (warning) and uncompleted (not approached)\n */\nclass Step extends React.Component<StepProps> {\n\tstatic displayName = displayName;\n\n\t/**\n\t * buttonIcon represents the button icon used for each step.\n\t * the button is applied with different css classes under different conditions.\n\t */\n\tbuttonIcon(renderIcon: boolean, status: string, props: StepProps) {\n\t\tconst data: StepEventData = {\n\t\t\tisSelected: !!props.isSelected,\n\t\t\tisError: !!props.isError,\n\t\t\tisCompleted: !!props.isCompleted,\n\t\t\tisDisabled: !!props.isDisabled,\n\t\t\tstep: props.step,\n\t\t};\n\n\t\tconst icon = renderIcon ? (\n\t\t\t<ButtonIcon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname={this.props.isError ? 'error' : 'success'}\n\t\t\t/>\n\t\t) : null;\n\n\t\tconst handleClick = (event: React.MouseEvent) =>\n\t\t\tprops.onClick?.(event, data);\n\t\tconst handleFocus = (event: React.FocusEvent) =>\n\t\t\tprops.onFocus?.(event, data);\n\n\t\tconst stepButton = props.isDisabled ? (\n\t\t\t<a\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-button',\n\t\t\t\t\t{ 'slds-button_icon': renderIcon },\n\t\t\t\t\t'slds-progress__marker',\n\t\t\t\t\t{ 'slds-progress__marker_icon': renderIcon },\n\t\t\t\t\t'slds-is-disabled'\n\t\t\t\t)}\n\t\t\t\taria-disabled\n\t\t\t\tstyle={{ cursor: 'not-allowed' }}\n\t\t\t\ttabIndex={0}\n\t\t\t\trole=\"button\"\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t{this.props.step.assistiveText || (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{`${props.assistiveText?.step} ${props.index + 1}: `}\n\t\t\t\t\t\t\t{props.step.label}\n\t\t\t\t\t\t\t{`- ${status}`}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-button',\n\t\t\t\t\t{ 'slds-button_icon': renderIcon },\n\t\t\t\t\t'slds-progress__marker',\n\t\t\t\t\t{ 'slds-progress__marker_icon': renderIcon }\n\t\t\t\t)}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\taria-current={this.props.isSelected ? 'step' : undefined}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t{this.props.step.assistiveText || (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{`${props.assistiveText?.step} ${props.index + 1}: `}\n\t\t\t\t\t\t\t{props.step.label}\n\t\t\t\t\t\t\t{status ? ` - ${status}` : ''}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t);\n\n\t\treturn stepButton;\n\t}\n\n\trender() {\n\t\tconst renderIcon = this.props.isCompleted || this.props.isError;\n\t\tlet status = '';\n\t\tif (this.props.isError) {\n\t\t\tstatus = this.props.assistiveText?.errorStep || '';\n\t\t} else if (this.props.isCompleted) {\n\t\t\tstatus = this.props.assistiveText?.completedStep || '';\n\t\t} else if (this.props.isDisabled) {\n\t\t\tstatus = this.props.assistiveText?.disabledStep || '';\n\t\t}\n\n\t\tconst tooltipProps: {\n\t\t\talign: TooltipAlign;\n\t\t\tid: string;\n\t\t\tcontent: React.ReactNode;\n\t\t\ttheme: TooltipTheme;\n\t\t\tposition?: TooltipPosition;\n\t\t\ttriggerStyle: React.CSSProperties;\n\t\t\tisOpen?: boolean;\n\t\t} = {\n\t\t\talign: 'top',\n\t\t\tid: `progress-indicator-tooltip-${\n\t\t\t\tthis.props.step.id ?? this.props.index\n\t\t\t}`,\n\t\t\tcontent: this.props.step.label,\n\t\t\ttheme: 'info',\n\t\t\tposition: this.props.tooltipPosition,\n\t\t\ttriggerStyle: { display: !renderIcon ? 'flex' : '' },\n\t\t};\n\n\t\t// This is mainly for dev test purpose.\n\t\t// `isOpen` is only set to true if tooltip is specified to be open\n\t\t// Do not set isOpen to false or undefined otherwise, because that will\n\t\t// disable any interaction with tooltips\n\t\tif (this.props.tooltipIsOpen) {\n\t\t\ttooltipProps.isOpen = true;\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames('slds-progress__item', {\n\t\t\t\t\t'slds-is-completed': this.props.isCompleted,\n\t\t\t\t\t'slds-is-active': this.props.isSelected && !this.props.isError,\n\t\t\t\t\t'slds-has-error': this.props.isError,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Tooltip\n\t\t\t\t\t{...tooltipProps}\n\t\t\t\t\ttrigger={this.buttonIcon(!!renderIcon, status, this.props)}\n\t\t\t\t/>\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nexport default Step;\n"],"mappings":"oTAuBA,IAAM,EAAc,EAAA,wBAuEd,EAAN,cAAmB,EAAA,QAAM,SAAqB,CAC7C,OAAO,YAAc,EAMrB,WAAW,EAAqB,EAAgB,EAAkB,CACjE,IAAM,EAAsB,CAC3B,WAAY,CAAC,CAAC,EAAM,WACpB,QAAS,CAAC,CAAC,EAAM,QACjB,YAAa,CAAC,CAAC,EAAM,YACrB,WAAY,CAAC,CAAC,EAAM,WACpB,KAAM,EAAM,IACb,EAEM,EAAO,GACZ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,SAAS,UACT,KAAM,KAAK,MAAM,QAAU,QAAU,SACrC,CAAA,EACE,KA0DJ,OAnDmB,EAAM,YACxB,EAAA,EAAA,KAAA,CAAC,IAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,cACA,CAAE,mBAAoB,CAAW,EACjC,wBACA,CAAE,6BAA8B,CAAW,EAC3C,kBACD,EACA,gBAAA,GACA,MAAO,CAAE,OAAQ,aAAc,EAC/B,SAAU,EACV,KAAK,SAXN,SAAA,CAaE,GACD,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBACd,SAAA,KAAK,MAAM,KAAK,gBAChB,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,CACE,GAAG,EAAM,eAAe,KAAK,GAAG,EAAM,MAAQ,EAAE,IAChD,EAAM,KAAK,MACX,KAAK,GACS,CAAA,CAAA,CAEZ,CAAA,CACJ,CAEH,CAAA,GAAA,EAAA,EAAA,KAAA,CAAC,SAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,cACA,CAAE,mBAAoB,CAAW,EACjC,wBACA,CAAE,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Y,EAAQ,KAAK,KAAK,CACzD,CAAA,CACE,CAAA,CAEN,CACD"}
1
+ {"version":3,"file":"step.cjs","names":[],"sources":["../../../../../components/progress-indicator/private/step.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\nimport React from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\n// Child component\nimport Tooltip, { type TooltipAlign, type TooltipTheme } from '../../tooltip';\nimport { PROGRESS_INDICATOR_STEP } from '../../../utilities/constants';\nimport ButtonIcon from '../../icon/button-icon';\nimport {\n\ttype ProgressStep,\n\ttype ProgressIndicatorAssistiveText,\n\ttype ProgressIndicatorVariant,\n\ttype TooltipPosition,\n\ttype StepEventData,\n} from '../index';\n\n// ### Display Name\nconst displayName = PROGRESS_INDICATOR_STEP;\n\nexport interface StepProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `completedStep`: Label for a completed step. The default is `Completed Step`\n\t * * `disabledStep`: Label for disabled step. The default is `Disabled Step`\n\t * * `errorStep`: Label for a step with an error. The default is `Error Step`\n\t * * `percentage`: Label for Progress Bar. The default is `Progress: [this.props.value]%`.\n\t * * `step`: Label for a step. It will be typically followed by the number of the step such as \"Step 1\".\n\t */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/**\n\t * Id for Steps, ranging in [0, steps.length).\n\t */\n\tid?: number | string;\n\t/**\n\t * Index of step. Used for id's if no step ID exists\n\t */\n\tindex: number;\n\t/**\n\t * Determines if the step has been completed\n\t */\n\tisCompleted?: boolean;\n\t/**\n\t * Determines if the step has been disabled\n\t */\n\tisDisabled?: boolean;\n\t/**\n\t * Determines if the step contains an error\n\t */\n\tisError?: boolean;\n\t/**\n\t * Determines if the step is currently selected (active)\n\t */\n\tisSelected?: boolean;\n\t/**\n\t * Triggered when click on individual steps.\n\t */\n\tonClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: StepEventData\n\t) => void;\n\t/**\n\t * Triggered when focus on individual steps.\n\t */\n\tonFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/**\n\t * Step object. This is passed into event callbacks.\n\t */\n\tstep: ProgressStep;\n\t/**\n\t * Determines if the tooltip attached to step is always open.\n\t */\n\ttooltipIsOpen?: boolean;\n\t/**\n\t * Position strategy for the step's tooltip.\n\t */\n\ttooltipPosition?: TooltipPosition;\n\t/**\n\t * The variant of the parent progress indicator\n\t */\n\tvariant?: ProgressIndicatorVariant;\n}\n\n/**\n * Step renders a button icon and its tooltip if applied.\n * The button is applied with different css classes under different conditions.\n * Button icons have 4 types of status: completed (success), active (in progress), error (warning) and uncompleted (not approached)\n */\nclass Step extends React.Component<StepProps> {\n\tstatic displayName = displayName;\n\n\t/**\n\t * buttonIcon represents the button icon used for each step.\n\t * the button is applied with different css classes under different conditions.\n\t */\n\tbuttonIcon(renderIcon: boolean, status: string, props: StepProps) {\n\t\tconst data: StepEventData = {\n\t\t\tisSelected: !!props.isSelected,\n\t\t\tisError: !!props.isError,\n\t\t\tisCompleted: !!props.isCompleted,\n\t\t\tisDisabled: !!props.isDisabled,\n\t\t\tstep: props.step,\n\t\t};\n\n\t\tconst icon = renderIcon ? (\n\t\t\t<ButtonIcon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname={this.props.isError ? 'error' : 'success'}\n\t\t\t/>\n\t\t) : null;\n\n\t\tconst handleClick = (event: React.MouseEvent) =>\n\t\t\tprops.onClick?.(event, data);\n\t\tconst handleFocus = (event: React.FocusEvent) =>\n\t\t\tprops.onFocus?.(event, data);\n\n\t\tconst stepButton = props.isDisabled ? (\n\t\t\t// eslint-disable-next-line jsx-a11y/anchor-is-valid -- SLDS disabled step marker markup uses an anchor\n\t\t\t<a\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-button',\n\t\t\t\t\t{ 'slds-button_icon': renderIcon },\n\t\t\t\t\t'slds-progress__marker',\n\t\t\t\t\t{ 'slds-progress__marker_icon': renderIcon },\n\t\t\t\t\t'slds-is-disabled'\n\t\t\t\t)}\n\t\t\t\taria-disabled\n\t\t\t\tstyle={{ cursor: 'not-allowed' }}\n\t\t\t\ttabIndex={0}\n\t\t\t\trole=\"button\"\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t{this.props.step.assistiveText || (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{`${props.assistiveText?.step} ${props.index + 1}: `}\n\t\t\t\t\t\t\t{props.step.label}\n\t\t\t\t\t\t\t{`- ${status}`}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-button',\n\t\t\t\t\t{ 'slds-button_icon': renderIcon },\n\t\t\t\t\t'slds-progress__marker',\n\t\t\t\t\t{ 'slds-progress__marker_icon': renderIcon }\n\t\t\t\t)}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\taria-current={this.props.isSelected ? 'step' : undefined}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t{this.props.step.assistiveText || (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{`${props.assistiveText?.step} ${props.index + 1}: `}\n\t\t\t\t\t\t\t{props.step.label}\n\t\t\t\t\t\t\t{status ? ` - ${status}` : ''}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t);\n\n\t\treturn stepButton;\n\t}\n\n\trender() {\n\t\tconst renderIcon = this.props.isCompleted || this.props.isError;\n\t\tlet status = '';\n\t\tif (this.props.isError) {\n\t\t\tstatus = this.props.assistiveText?.errorStep || '';\n\t\t} else if (this.props.isCompleted) {\n\t\t\tstatus = this.props.assistiveText?.completedStep || '';\n\t\t} else if (this.props.isDisabled) {\n\t\t\tstatus = this.props.assistiveText?.disabledStep || '';\n\t\t}\n\n\t\tconst tooltipProps: {\n\t\t\talign: TooltipAlign;\n\t\t\tid: string;\n\t\t\tcontent: React.ReactNode;\n\t\t\ttheme: TooltipTheme;\n\t\t\tposition?: TooltipPosition;\n\t\t\ttriggerStyle: React.CSSProperties;\n\t\t\tisOpen?: boolean;\n\t\t} = {\n\t\t\talign: 'top',\n\t\t\tid: `progress-indicator-tooltip-${\n\t\t\t\tthis.props.step.id ?? this.props.index\n\t\t\t}`,\n\t\t\tcontent: this.props.step.label,\n\t\t\ttheme: 'info',\n\t\t\tposition: this.props.tooltipPosition,\n\t\t\ttriggerStyle: { display: !renderIcon ? 'flex' : '' },\n\t\t};\n\n\t\t// This is mainly for dev test purpose.\n\t\t// `isOpen` is only set to true if tooltip is specified to be open\n\t\t// Do not set isOpen to false or undefined otherwise, because that will\n\t\t// disable any interaction with tooltips\n\t\tif (this.props.tooltipIsOpen) {\n\t\t\ttooltipProps.isOpen = true;\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames('slds-progress__item', {\n\t\t\t\t\t'slds-is-completed': this.props.isCompleted,\n\t\t\t\t\t'slds-is-active': this.props.isSelected && !this.props.isError,\n\t\t\t\t\t'slds-has-error': this.props.isError,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Tooltip\n\t\t\t\t\t{...tooltipProps}\n\t\t\t\t\ttrigger={this.buttonIcon(!!renderIcon, status, this.props)}\n\t\t\t\t/>\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nexport default Step;\n"],"mappings":"oTAuBA,IAAM,EAAc,EAAA,wBAuEd,EAAN,cAAmB,EAAA,QAAM,SAAqB,CAC7C,OAAO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AA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,CACE,GAAG,EAAM,eAAe,KAAK,GAAG,EAAM,MAAQ,EAAE,IAChD,EAAM,KAAK,MACX,EAAS,MAAM,IAAW,EACZ,CAAA,CAAA,CAEZ,CAAA,CACC,GAIV,CAEA,QAAS,CACR,IAAM,EAAa,KAAK,MAAM,aAAe,KAAK,MAAM,QACpD,EAAS,GACT,KAAK,MAAM,QACd,EAAS,KAAK,MAAM,eAAe,WAAa,GACtC,KAAK,MAAM,YACrB,EAAS,KAAK,MAAM,eAAe,eAAiB,GAC1C,KAAK,MAAM,aACrB,EAAS,KAAK,MAAM,eAAe,cAAgB,IAGpD,IAAM,EAQF,CACH,MAAO,MACP,GAAI,8BACH,KAAK,MAAM,KAAK,IAAM,KAAK,MAAM,QAElC,QAAS,KAAK,MAAM,KAAK,MACzB,MAAO,OACP,SAAU,KAAK,MAAM,gBACrB,aAAc,CAAE,QAAU,EAAsB,GAAT,MAAY,CACpD,EAUA,OAJI,KAAK,MAAM,gBACd,EAAa,OAAS,KAItB,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,sBAAuB,CAC5C,oBAAqB,KAAK,MAAM,YAChC,iBAAkB,KAAK,MAAM,YAAc,CAAC,KAAK,MAAM,QACvD,iBAAkB,KAAK,MAAM,OAC9B,CAAC,EAED,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,GAAI,EACJ,QAAS,KAAK,WAAW,CAAC,CAAC,EAAY,EAAQ,KAAK,KAAK,CACzD,CAAA,CACE,CAAA,CAEN,CACD"}
@@ -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("../../utilities/get-aria-props.cjs"),r=require("../../utilities/get-data-props.cjs"),i=require("../icon/index.cjs"),a=require("../../utilities/key-code.cjs"),ee=require("../color-picker/private/swatch.cjs"),o=require("./check-props.cjs"),s=require("./component.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d={},f={},p=e=>{let{assistiveText:p,"aria-describedby":m,"aria-labelledby":h,checked:g,className:_,defaultChecked:v,deselectable:y,disabled:b,id:x,labelId:S,labels:C,label:w,name:T,onChange:E,onFocus:D,onRequestFocus:O,requestFocus:k,tabIndex:A,value:j,variant:M=`base`,coverable:N=!1,vertical:P,visualPickerFigure:F,visualPickerFigureSelected:I,visualPickerFigureNotSelected:L,onRenderVisualPicker:R,onRenderVisualPickerSelected:z,onRenderVisualPickerNotSelected:B,size:V=`medium`,refs:H,style:U,...W}=e,G=(0,c.useId)(),K=(0,c.useRef)(!1),q=x||G,J={...d,...p},Y={...f,...C};(0,c.useEffect)(()=>{o.checkDeprecatedProps(t.RADIO,{defaultChecked:v,label:w,onRenderVisualPicker:R,onRenderVisualPickerSelected:z,onRenderVisualPickerNotSelected:B,onRequestFocus:O,requestFocus:k},s.default)},[v,w,O,k,R,z,B]);let X=n.default(W),Z=r.default(W),Q=(0,c.useCallback)((e,t)=>{K.current?K.current=!1:(K.current=!!t,E?.(e,{checked:!g}))},[g,E]),te=(0,c.useCallback)(e=>{H?.input?.(e),e&&k&&O&&O(e)},[H,k,O]),$;return $=M===`swatch`?(0,u.jsx)(`label`,{style:{border:`1px`},className:`slds-radio_button__label`,htmlFor:q,children:(0,u.jsx)(`span`,{children:(0,u.jsx)(ee.default,{label:Y.label,style:U,color:j??``})})}):M===`button-group`?(0,u.jsx)(`label`,{className:`slds-radio_button__label`,htmlFor:q,children:(0,u.jsx)(`span`,{className:`slds-radio_faux`,children:Y.label})}):M===`visual-picker`?(0,u.jsxs)(`label`,{htmlFor:q,children:[N?(0,u.jsxs)(`div`,{className:`slds-visual-picker__figure slds-visual-picker__icon slds-align_absolute-center`,children:[(0,u.jsx)(`span`,{className:`slds-is-selected`,children:I??z?.()}),(0,u.jsx)(`span`,{className:`slds-is-not-selected`,children:L??B?.()})]}):(0,u.jsx)(`span`,{className:`slds-visual-picker__figure slds-visual-picker__text slds-align_absolute-center`,children:F??R?.()}),!P&&(0,u.jsxs)(`span`,{className:`slds-visual-picker__body`,children:[Y.heading&&(0,u.jsx)(`span`,{className:`slds-text-heading_small`,children:Y.heading}),(0,u.jsx)(`span`,{className:`slds-text-title`,children:Y.label})]}),!N&&(0,u.jsx)(`span`,{className:`slds-icon_container slds-visual-picker__text-check`,children:(0,u.jsx)(i.default,{assistiveText:J,category:`utility`,name:`check`,colorVariant:`base`,size:`x-small`})})]}):(0,u.jsxs)(`label`,{className:`slds-radio__label`,htmlFor:q,id:S,children:[(0,u.jsx)(`span`,{className:`slds-radio_faux`}),(0,u.jsx)(`span`,{className:`slds-form-element__label`,children:Y.label}),J.label&&(0,u.jsx)(`span`,{className:`slds-assistive-text`,children:J.label})]}),(0,u.jsxs)(`span`,{className:(0,l.default)(M===`visual-picker`?`slds-visual-picker_${V}`:null,{"slds-radio":M===`base`||M===`swatch`,"slds-button slds-radio_button":M===`button-group`,"slds-visual-picker":M===`visual-picker`,"slds-visual-picker_vertical":M===`visual-picker`&&P},_),children:[(0,u.jsx)(`input`,{type:`radio`,id:q,name:T,value:j,checked:!!g,onFocus:D,onChange:e=>Q(e),onClick:e=>{g&&y&&Q(e)},onKeyDown:e=>{let{key:t}=e;t===a.default.SPACE&&g&&y?Q(e,!0):(t===a.default.ENTER&&g&&y||!g&&(t===a.default.SPACE||t===a.default.ENTER))&&Q(e)},disabled:b,tabIndex:A,"aria-describedby":m,"aria-labelledby":h,...X,...Z,ref:te}),$]})};p.displayName=t.RADIO,exports.default=p;
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("../../utilities/get-aria-props.cjs"),r=require("../../utilities/get-data-props.cjs"),i=require("../icon/index.cjs"),a=require("../../utilities/key-code.cjs"),ee=require("../color-picker/private/swatch.cjs"),o=require("./check-props.cjs"),s=require("./component.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d={},f={},p=e=>{let{assistiveText:p,"aria-describedby":m,"aria-labelledby":h,checked:g,className:_,defaultChecked:v,deselectable:y,disabled:b,id:x,labelId:S,labels:C,label:w,name:T,onChange:E,onFocus:D,onRequestFocus:O,requestFocus:k,tabIndex:A,value:j,variant:M=`base`,coverable:N=!1,vertical:P,visualPickerFigure:F,visualPickerFigureSelected:I,visualPickerFigureNotSelected:L,onRenderVisualPicker:R,onRenderVisualPickerSelected:z,onRenderVisualPickerNotSelected:B,size:V=`medium`,refs:H,style:U,...W}=e,G=(0,c.useId)(),K=(0,c.useRef)(!1),q=x||G,J={...d,...p},Y={...f,...C};(0,c.useEffect)(()=>{o.checkDeprecatedProps(t.RADIO,{defaultChecked:v,label:w,onRenderVisualPicker:R,onRenderVisualPickerSelected:z,onRenderVisualPickerNotSelected:B,onRequestFocus:O,requestFocus:k},s.default)},[v,w,O,k,R,z,B]);let X=n.default(W),Z=r.default(W),Q=(0,c.useCallback)((e,t)=>{K.current?K.current=!1:(K.current=!!t,E?.(e,{checked:!g}))},[g,E]),te=(0,c.useCallback)(e=>{H?.input?.(e),e&&k&&O&&O(e)},[H,k,O]),$;return $=M===`swatch`?(0,u.jsx)(`label`,{style:{border:`var(--slds-g-sizing-border-1, 1px)`},className:`slds-radio_button__label`,htmlFor:q,children:(0,u.jsx)(`span`,{children:(0,u.jsx)(ee.default,{label:Y.label,style:U,color:j??``})})}):M===`button-group`?(0,u.jsx)(`label`,{className:`slds-radio_button__label`,htmlFor:q,children:(0,u.jsx)(`span`,{className:`slds-radio_faux`,children:Y.label})}):M===`visual-picker`?(0,u.jsxs)(`label`,{htmlFor:q,children:[N?(0,u.jsxs)(`div`,{className:`slds-visual-picker__figure slds-visual-picker__icon slds-align_absolute-center`,children:[(0,u.jsx)(`span`,{className:`slds-is-selected`,children:I??z?.()}),(0,u.jsx)(`span`,{className:`slds-is-not-selected`,children:L??B?.()})]}):(0,u.jsx)(`span`,{className:`slds-visual-picker__figure slds-visual-picker__text slds-align_absolute-center`,children:F??R?.()}),!P&&(0,u.jsxs)(`span`,{className:`slds-visual-picker__body`,children:[Y.heading&&(0,u.jsx)(`span`,{className:`slds-text-heading_small`,children:Y.heading}),(0,u.jsx)(`span`,{className:`slds-text-title`,children:Y.label})]}),!N&&(0,u.jsx)(`span`,{className:`slds-icon_container slds-visual-picker__text-check`,children:(0,u.jsx)(i.default,{assistiveText:J,category:`utility`,name:`check`,colorVariant:`base`,size:`x-small`})})]}):(0,u.jsxs)(`label`,{className:`slds-radio__label`,htmlFor:q,id:S,children:[(0,u.jsx)(`span`,{className:`slds-radio_faux`}),(0,u.jsx)(`span`,{className:`slds-form-element__label`,children:Y.label}),J.label&&(0,u.jsx)(`span`,{className:`slds-assistive-text`,children:J.label})]}),(0,u.jsxs)(`span`,{className:(0,l.default)(M===`visual-picker`?`slds-visual-picker_${V}`:null,{"slds-radio":M===`base`||M===`swatch`,"slds-button slds-radio_button":M===`button-group`,"slds-visual-picker":M===`visual-picker`,"slds-visual-picker_vertical":M===`visual-picker`&&P},_),children:[(0,u.jsx)(`input`,{type:`radio`,id:q,name:T,value:j,checked:!!g,onFocus:D,onChange:e=>Q(e),onClick:e=>{g&&y&&Q(e)},onKeyDown:e=>{let{key:t}=e;t===a.default.SPACE&&g&&y?Q(e,!0):(t===a.default.ENTER&&g&&y||!g&&(t===a.default.SPACE||t===a.default.ENTER))&&Q(e)},disabled:b,tabIndex:A,"aria-describedby":m,"aria-labelledby":h,...X,...Z,ref:te}),$]})};p.displayName=t.RADIO,exports.default=p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/radio/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\tuseRef,\n\tuseId,\n\tuseCallback,\n\tuseEffect,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\nimport KEYS from '../../utilities/key-code';\nimport { RADIO } from '../../utilities/constants';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport getDataProps from '../../utilities/get-data-props';\nimport Swatch from '../../components/color-picker/private/swatch';\nimport Icon from '../icon';\nimport { checkDeprecatedProps } from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Radio variant types\n */\nexport type RadioVariant = 'base' | 'button-group' | 'swatch' | 'visual-picker';\nexport type RadioSize = 'medium' | 'large';\n\n/**\n * Assistive text for Radio\n */\nexport interface RadioAssistiveText {\n\t/** Visually hidden label */\n\tlabel?: string;\n}\n\n/**\n * Labels for Radio\n */\nexport interface RadioLabels {\n\t/** Heading for visual picker variant */\n\theading?: string;\n\t/** Label for the radio input */\n\tlabel?: string;\n}\n\n/**\n * Refs for Radio\n */\nexport interface RadioRefs {\n\t/** Ref callback for input element */\n\tinput?: (input: HTMLInputElement | null) => void;\n}\n\n/**\n * Change event data for Radio\n */\nexport interface RadioChangeData {\n\t/**\n\t * The requested checked state: `true` when the user selects the radio,\n\t * `false` when a `deselectable` radio that is checked is clicked again.\n\t */\n\tchecked: boolean;\n}\n\n/**\n * Change handler for Radio\n */\nexport type RadioChangeHandler = (\n\tevent: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>,\n\tdata: RadioChangeData\n) => void;\n\n/**\n * Props for the Radio component\n */\ninterface RadioBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: RadioAssistiveText;\n\t/** ARIA describedby attribute */\n\t'aria-describedby'?: string;\n\t/** ARIA labelledby attribute */\n\t'aria-labelledby'?: string;\n\t/**\n\t * Whether the radio is checked. Radio is controlled: update this prop from\n\t * `onChange`. Inside a `RadioGroup`/`RadioButtonGroup`, pass `value` to the\n\t * group instead and the group derives `checked` for each radio.\n\t */\n\tchecked: boolean;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Whether radio can be deselected */\n\tdeselectable?: boolean;\n\t/** Whether radio is disabled */\n\tdisabled?: boolean;\n\t/** Unique ID for the input */\n\tid?: string;\n\t/** ID for the label element */\n\tlabelId?: string;\n\t/** Text labels */\n\tlabels?: RadioLabels;\n\t/** Input name attribute */\n\tname?: string;\n\t/**\n\t * Called with the requested checked state in `data.checked`. The rendered\n\t * state only changes when `checked` is updated.\n\t */\n\tonChange: RadioChangeHandler;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * @deprecated Focus the radio through `refs.input` instead. Called with the `<input>`\n\t * when `requestFocus` is set. Still works, and warns.\n\t */\n\tonRequestFocus?: (input: HTMLInputElement) => void;\n\t/** @deprecated Focus the radio through `refs.input` instead. Still works, and warns. */\n\trequestFocus?: boolean;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Input value */\n\tvalue?: string;\n\t/** Ref callbacks */\n\trefs?: RadioRefs;\n}\n\n/** Props only the visual picker takes. */\ninterface RadioVisualPickerOnlyProps {\n\t/** Visual picker: coverable when selected */\n\tcoverable?: boolean;\n\t/** Visual picker: vertical layout */\n\tvertical?: boolean;\n\t/** Visual picker: figure content, rendered inside `.slds-visual-picker__figure` when not `coverable` */\n\tvisualPickerFigure?: React.ReactNode;\n\t/** Visual picker: coverable figure content shown when selected */\n\tvisualPickerFigureSelected?: React.ReactNode;\n\t/** Visual picker: coverable figure content shown when not selected */\n\tvisualPickerFigureNotSelected?: React.ReactNode;\n\t/** @deprecated Use `visualPickerFigure` instead. */\n\tonRenderVisualPicker?: () => React.ReactNode;\n\t/** @deprecated Use `visualPickerFigureSelected` instead. */\n\tonRenderVisualPickerSelected?: () => React.ReactNode;\n\t/** @deprecated Use `visualPickerFigureNotSelected` instead. */\n\tonRenderVisualPickerNotSelected?: () => React.ReactNode;\n\t/** Visual picker: size. Defaults to `medium`. */\n\tsize?: RadioSize;\n}\n\n/** Visual-picker-only props, rejected by the other variants. */\ntype RadioVisualPickerOnlyNever = {\n\t[K in keyof RadioVisualPickerOnlyProps]?: never;\n};\n\n/** A plain radio, or a button inside a `RadioButtonGroup`. */\ninterface RadioPlainVariantProps extends RadioVisualPickerOnlyNever {\n\t/** Radio variant */\n\tvariant?: 'base' | 'button-group';\n\tstyle?: never;\n}\n\n/** A color swatch button. `value` is the color. */\ninterface RadioSwatchVariantProps extends RadioVisualPickerOnlyNever {\n\t/** Radio variant */\n\tvariant: 'swatch';\n\t/** Custom styles for the swatch */\n\tstyle?: CSSProperties;\n}\n\n/** An option inside a `VisualPicker`. */\ninterface RadioVisualPickerVariantProps extends RadioVisualPickerOnlyProps {\n\t/** Radio variant */\n\tvariant: 'visual-picker';\n\tstyle?: never;\n}\n\ntype RadioVariantProps =\n\t| RadioPlainVariantProps\n\t| RadioSwatchVariantProps\n\t| RadioVisualPickerVariantProps;\n\n/**\n * Props for the Radio component: a union on `variant`, so a prop that a\n * variant ignores is a compile error.\n */\nexport type RadioProps = RadioBaseProps & RadioVariantProps;\n\n/**\n * Props for a `Radio` rendered as a child of `RadioGroup` or\n * `RadioButtonGroup`. The group injects `checked` (derived from its `value`)\n * and `onChange`, so neither is required here.\n */\nexport type RadioGroupItemProps = Omit<RadioBaseProps, 'checked' | 'onChange'> &\n\tRadioVariantProps &\n\tRadioGroupItemOwnProps;\n\ninterface RadioGroupItemOwnProps {\n\t/**\n\t * @deprecated Pass `value` to the `RadioGroup`/`RadioButtonGroup` instead.\n\t * Only used when the group has no `value`.\n\t */\n\tchecked?: boolean;\n\t/** Ignored inside a group: the group's `onChange` is called instead. */\n\tonChange?: RadioChangeHandler;\n}\n\nconst defaultAssistiveText: RadioAssistiveText = {};\nconst defaultLabels: RadioLabels = {};\n\n/**\n * A radio input that can have a single input checked at any one time.\n * Radios should be wrapped with a RadioGroup or RadioButtonGroup.\n */\nconst Radio = (props: RadioProps): React.ReactElement => {\n\tconst {\n\t\tassistiveText: propAssistiveText,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t'aria-labelledby': ariaLabelledBy,\n\t\tchecked,\n\t\tclassName,\n\t\t// Removed in v11. Destructured so they never reach the DOM;\n\t\t// `checkDeprecatedProps` warns about them.\n\t\tdefaultChecked,\n\t\tdeselectable,\n\t\tdisabled,\n\t\tid: propId,\n\t\tlabelId,\n\t\tlabels: propLabels,\n\t\tlabel,\n\t\tname,\n\t\tonChange,\n\t\tonFocus,\n\t\tonRequestFocus,\n\t\trequestFocus,\n\t\ttabIndex,\n\t\tvalue,\n\t\tvariant = 'base',\n\t\tcoverable = false,\n\t\tvertical,\n\t\tvisualPickerFigure,\n\t\tvisualPickerFigureSelected,\n\t\tvisualPickerFigureNotSelected,\n\t\tonRenderVisualPicker,\n\t\tonRenderVisualPickerSelected,\n\t\tonRenderVisualPickerNotSelected,\n\t\tsize = 'medium',\n\t\trefs,\n\t\tstyle,\n\t\t...rest\n\t} = props as RadioBaseProps &\n\t\tPartial<RadioVisualPickerOnlyProps> & {\n\t\t\tvariant?: RadioVariant;\n\t\t\tstyle?: CSSProperties;\n\t\t} & {\n\t\t\tdefaultChecked?: boolean;\n\t\t\tlabel?: unknown;\n\t\t};\n\tconst generatedId = useId();\n\tconst preventDuplicateRef = useRef(false);\n\n\tconst id = propId || generatedId;\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tuseEffect(() => {\n\t\tcheckDeprecatedProps(\n\t\t\tRADIO,\n\t\t\t{\n\t\t\t\tdefaultChecked,\n\t\t\t\tlabel,\n\t\t\t\tonRenderVisualPicker,\n\t\t\t\tonRenderVisualPickerSelected,\n\t\t\t\tonRenderVisualPickerNotSelected,\n\t\t\t\tonRequestFocus,\n\t\t\t\trequestFocus,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, [\n\t\tdefaultChecked,\n\t\tlabel,\n\t\tonRequestFocus,\n\t\trequestFocus,\n\t\tonRenderVisualPicker,\n\t\tonRenderVisualPickerSelected,\n\t\tonRenderVisualPickerNotSelected,\n\t]);\n\n\tconst ariaProps = getAriaProps(rest);\n\tconst dataProps = getDataProps(rest);\n\n\tconst handleChange = useCallback(\n\t\t(\n\t\t\tevent: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>,\n\t\t\tpreventDuplicate?: boolean\n\t\t) => {\n\t\t\tif (!preventDuplicateRef.current) {\n\t\t\t\tpreventDuplicateRef.current = Boolean(preventDuplicate);\n\t\t\t\tonChange?.(event, { checked: !checked });\n\t\t\t} else {\n\t\t\t\tpreventDuplicateRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[checked, onChange]\n\t);\n\n\tconst handleInputRef = useCallback(\n\t\t(input: HTMLInputElement | null) => {\n\t\t\trefs?.input?.(input);\n\t\t\tif (input && requestFocus && onRequestFocus) {\n\t\t\t\tonRequestFocus(input);\n\t\t\t}\n\t\t},\n\t\t[refs, requestFocus, onRequestFocus]\n\t);\n\n\t// Render the label based on variant\n\tlet radioLabel: React.ReactNode;\n\n\tif (variant === 'swatch') {\n\t\tradioLabel = (\n\t\t\t<label\n\t\t\t\tstyle={{ border: '1px' }}\n\t\t\t\tclassName=\"slds-radio_button__label\"\n\t\t\t\thtmlFor={id}\n\t\t\t>\n\t\t\t\t<span>\n\t\t\t\t\t<Swatch label={labels.label} style={style} color={value ?? ''} />\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t);\n\t} else if (variant === 'button-group') {\n\t\tradioLabel = (\n\t\t\t<label className=\"slds-radio_button__label\" htmlFor={id}>\n\t\t\t\t<span className=\"slds-radio_faux\">{labels.label}</span>\n\t\t\t</label>\n\t\t);\n\t} else if (variant === 'visual-picker') {\n\t\tradioLabel = (\n\t\t\t<label htmlFor={id}>\n\t\t\t\t{coverable ? (\n\t\t\t\t\t<div className=\"slds-visual-picker__figure slds-visual-picker__icon slds-align_absolute-center\">\n\t\t\t\t\t\t<span className=\"slds-is-selected\">\n\t\t\t\t\t\t\t{visualPickerFigureSelected ?? onRenderVisualPickerSelected?.()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-is-not-selected\">\n\t\t\t\t\t\t\t{visualPickerFigureNotSelected ??\n\t\t\t\t\t\t\t\tonRenderVisualPickerNotSelected?.()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<span className=\"slds-visual-picker__figure slds-visual-picker__text slds-align_absolute-center\">\n\t\t\t\t\t\t{visualPickerFigure ?? onRenderVisualPicker?.()}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!vertical && (\n\t\t\t\t\t<span className=\"slds-visual-picker__body\">\n\t\t\t\t\t\t{labels.heading && (\n\t\t\t\t\t\t\t<span className=\"slds-text-heading_small\">{labels.heading}</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span className=\"slds-text-title\">{labels.label}</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!coverable && (\n\t\t\t\t\t<span className=\"slds-icon_container slds-visual-picker__text-check\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\tcolorVariant=\"base\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</label>\n\t\t);\n\t} else {\n\t\t// Base variant\n\t\tradioLabel = (\n\t\t\t<label className=\"slds-radio__label\" htmlFor={id} id={labelId}>\n\t\t\t\t<span className=\"slds-radio_faux\" />\n\t\t\t\t<span className=\"slds-form-element__label\">{labels.label}</span>\n\t\t\t\t{assistiveText.label && (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.label}</span>\n\t\t\t\t)}\n\t\t\t</label>\n\t\t);\n\t}\n\n\treturn (\n\t\t<span\n\t\t\tclassName={classNames(\n\t\t\t\tvariant === 'visual-picker' ? `slds-visual-picker_${size}` : null,\n\t\t\t\t{\n\t\t\t\t\t'slds-radio': variant === 'base' || variant === 'swatch',\n\t\t\t\t\t'slds-button slds-radio_button': variant === 'button-group',\n\t\t\t\t\t'slds-visual-picker': variant === 'visual-picker',\n\t\t\t\t\t'slds-visual-picker_vertical':\n\t\t\t\t\t\tvariant === 'visual-picker' && vertical,\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t>\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tid={id}\n\t\t\t\tname={name}\n\t\t\t\tvalue={value}\n\t\t\t\tchecked={!!checked}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonChange={(event) => handleChange(event)}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tif (checked && deselectable) {\n\t\t\t\t\t\thandleChange(event as unknown as ChangeEvent<HTMLInputElement>);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\tconst { key } = event;\n\t\t\t\t\tif (key === KEYS.SPACE && checked && deselectable) {\n\t\t\t\t\t\thandleChange(event, true);\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t(key === KEYS.ENTER && checked && deselectable) ||\n\t\t\t\t\t\t(!checked && (key === KEYS.SPACE || key === KEYS.ENTER))\n\t\t\t\t\t) {\n\t\t\t\t\t\thandleChange(event);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tdisabled={disabled}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t{...ariaProps}\n\t\t\t\t{...dataProps}\n\t\t\t\tref={handleInputRef}\n\t\t\t/>\n\t\t\t{radioLabel}\n\t\t</span>\n\t);\n};\n\nRadio.displayName = RADIO;\n\nexport default Radio;\n"],"mappings":"glBA6MA,IAAM,EAA2C,CAAC,EAC5C,EAA6B,CAAC,EAM9B,EAAS,GAA0C,CACxD,GAAM,CACL,cAAe,EACf,mBAAoB,EACpB,kBAAmB,EACnB,UACA,YAGA,iBACA,eACA,WACA,GAAI,EACJ,UACA,OAAQ,EACR,QACA,OACA,WACA,UACA,iBACA,eACA,WACA,QACA,UAAU,OACV,YAAY,GACZ,WACA,qBACA,6BACA,gCACA,uBACA,+BACA,kCACA,OAAO,SACP,OACA,QACA,GAAG,GACA,EAQE,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,GAAA,EAAsB,EAAA,OAAA,CAAO,EAAK,EAElC,EAAK,GAAU,EACf,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,GAEjD,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,qBACC,EAAA,MACA,CACC,iBACA,QACA,uBACA,+BACA,kCACA,iBACA,cACD,EACA,EAAA,OACD,CACD,EAAG,CACF,EACA,EACA,EACA,EACA,EACA,EACA,CACD,CAAC,EAED,IAAM,EAAY,EAAA,QAAa,CAAI,EAC7B,EAAY,EAAA,QAAa,CAAI,EAE7B,GAAA,EAAe,EAAA,YAAA,EAEnB,EACA,IACI,CACC,EAAoB,QAIxB,EAAoB,QAAU,IAH9B,EAAoB,QAAU,EAAQ,EACtC,IAAW,EAAO,CAAE,QAAS,CAAC,CAAQ,CAAC,EAIzC,EACA,CAAC,EAAS,CAAQ,CACnB,EAEM,IAAA,EAAiB,EAAA,YAAA,CACrB,GAAmC,CACnC,GAAM,QAAQ,CAAK,EACf,GAAS,GAAgB,GAC5B,EAAe,CAAK,CAEtB,EACA,CAAC,EAAM,EAAc,CAAc,CACpC,EAGI,EAwEJ,MAtEA,CA2DC,EA3DG,IAAY,UAEd,EAAA,EAAA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AAK,SACL,CAAA,CACI,CAAA,CAED,KAKP,EAAA,EAAA,KAAA,CAAC,QAAD,CAAO,UAAU,oBAAoB,QAAS,EAAI,GAAI,EAAtD,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,iBAAmB,CAAA,GACnC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,EAAO,KAAY,CAAA,EAC9D,EAAc,QACd,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,KAAY,CAAA,CAE5D,KAKR,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,IAAY,gBAAkB,sBAAsB,IAAS,KAC7D,CACC,aAAc,IAAY,QAAU,IAAY,SAChD,gCAAiC,IAAY,eAC7C,qBAAsB,IAAY,gBAClC,8BACC,IAAY,iBAAmB,CACjC,EACA,CACD,EAXD,SAAA,EAaC,EAAA,EAAA,IAAA,CAAC,QAAD,CACC,KAAK,QACD,KACE,OACC,QACP,QAAS,CAAC,CAAC,EACF,UACT,SAAW,GAAU,EAAa,CAAK,EACvC,QAAU,GAAU,CACf,GAAW,GACd,EAAa,CAAiD,CAEhE,EACA,UAAY,GAAU,CACrB,GAAM,CAAE,OAAQ,EACZ,IAAQ,EAAA,QAAK,OAAS,GAAW,EACpC,EAAa,EAAO,EAAI,GAEvB,IAAQ,EAAA,QAAK,OAAS,GAAW,GACjC,CAAC,IAAY,IAAQ,EAAA,QAAK,OAAS,IAAQ,EAAA,QAAK,SAEjD,EAAa,CAAK,CAEpB,EACU,WACA,WACV,mBAAkB,EAClB,kBAAiB,EACjB,GAAI,EACJ,GAAI,EACJ,IAAK,EACL,CAAA,EACA,CACI,GAER,EAEA,EAAM,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/radio/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\tuseRef,\n\tuseId,\n\tuseCallback,\n\tuseEffect,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\nimport KEYS from '../../utilities/key-code';\nimport { RADIO } from '../../utilities/constants';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport getDataProps from '../../utilities/get-data-props';\nimport Swatch from '../../components/color-picker/private/swatch';\nimport Icon from '../icon';\nimport { checkDeprecatedProps } from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Radio variant types\n */\nexport type RadioVariant = 'base' | 'button-group' | 'swatch' | 'visual-picker';\nexport type RadioSize = 'medium' | 'large';\n\n/**\n * Assistive text for Radio\n */\nexport interface RadioAssistiveText {\n\t/** Visually hidden label */\n\tlabel?: string;\n}\n\n/**\n * Labels for Radio\n */\nexport interface RadioLabels {\n\t/** Heading for visual picker variant */\n\theading?: string;\n\t/** Label for the radio input */\n\tlabel?: string;\n}\n\n/**\n * Refs for Radio\n */\nexport interface RadioRefs {\n\t/** Ref callback for input element */\n\tinput?: (input: HTMLInputElement | null) => void;\n}\n\n/**\n * Change event data for Radio\n */\nexport interface RadioChangeData {\n\t/**\n\t * The requested checked state: `true` when the user selects the radio,\n\t * `false` when a `deselectable` radio that is checked is clicked again.\n\t */\n\tchecked: boolean;\n}\n\n/**\n * Event passed to a Radio's `onChange`: the input's `change` event when a\n * click selects it, the `click` event when a click deselects a checked\n * `deselectable` radio (a checked radio fires no `change`), or the `keydown`\n * event when Enter or Space selects or deselects it.\n */\nexport type RadioChangeEvent =\n\t| ChangeEvent<HTMLInputElement>\n\t| MouseEvent<HTMLInputElement>\n\t| KeyboardEvent<HTMLInputElement>;\n\n/**\n * Change handler for Radio\n */\nexport type RadioChangeHandler = (\n\tevent: RadioChangeEvent,\n\tdata: RadioChangeData\n) => void;\n\n/**\n * Props for the Radio component\n */\ninterface RadioBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: RadioAssistiveText;\n\t/** ARIA describedby attribute */\n\t'aria-describedby'?: string;\n\t/** ARIA labelledby attribute */\n\t'aria-labelledby'?: string;\n\t/**\n\t * Whether the radio is checked. Radio is controlled: update this prop from\n\t * `onChange`. Inside a `RadioGroup`/`RadioButtonGroup`, pass `value` to the\n\t * group instead and the group derives `checked` for each radio.\n\t */\n\tchecked: boolean;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Whether radio can be deselected */\n\tdeselectable?: boolean;\n\t/** Whether radio is disabled */\n\tdisabled?: boolean;\n\t/** Unique ID for the input */\n\tid?: string;\n\t/** ID for the label element */\n\tlabelId?: string;\n\t/** Text labels */\n\tlabels?: RadioLabels;\n\t/** Input name attribute */\n\tname?: string;\n\t/**\n\t * Called with the requested checked state in `data.checked`. The rendered\n\t * state only changes when `checked` is updated.\n\t */\n\tonChange: RadioChangeHandler;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * @deprecated Focus the radio through `refs.input` instead. Called with the `<input>`\n\t * when `requestFocus` is set. Still works, and warns.\n\t */\n\tonRequestFocus?: (input: HTMLInputElement) => void;\n\t/** @deprecated Focus the radio through `refs.input` instead. Still works, and warns. */\n\trequestFocus?: boolean;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Input value */\n\tvalue?: string;\n\t/** Ref callbacks */\n\trefs?: RadioRefs;\n}\n\n/** Props only the visual picker takes. */\ninterface RadioVisualPickerOnlyProps {\n\t/** Visual picker: coverable when selected */\n\tcoverable?: boolean;\n\t/** Visual picker: vertical layout */\n\tvertical?: boolean;\n\t/** Visual picker: figure content, rendered inside `.slds-visual-picker__figure` when not `coverable` */\n\tvisualPickerFigure?: React.ReactNode;\n\t/** Visual picker: coverable figure content shown when selected */\n\tvisualPickerFigureSelected?: React.ReactNode;\n\t/** Visual picker: coverable figure content shown when not selected */\n\tvisualPickerFigureNotSelected?: React.ReactNode;\n\t/** @deprecated Use `visualPickerFigure` instead. */\n\tonRenderVisualPicker?: () => React.ReactNode;\n\t/** @deprecated Use `visualPickerFigureSelected` instead. */\n\tonRenderVisualPickerSelected?: () => React.ReactNode;\n\t/** @deprecated Use `visualPickerFigureNotSelected` instead. */\n\tonRenderVisualPickerNotSelected?: () => React.ReactNode;\n\t/** Visual picker: size. Defaults to `medium`. */\n\tsize?: RadioSize;\n}\n\n/** Visual-picker-only props, rejected by the other variants. */\ntype RadioVisualPickerOnlyNever = {\n\t[K in keyof RadioVisualPickerOnlyProps]?: never;\n};\n\n/** A plain radio, or a button inside a `RadioButtonGroup`. */\ninterface RadioPlainVariantProps extends RadioVisualPickerOnlyNever {\n\t/** Radio variant */\n\tvariant?: 'base' | 'button-group';\n\tstyle?: never;\n}\n\n/** A color swatch button. `value` is the color. */\ninterface RadioSwatchVariantProps extends RadioVisualPickerOnlyNever {\n\t/** Radio variant */\n\tvariant: 'swatch';\n\t/** Custom styles for the swatch */\n\tstyle?: CSSProperties;\n}\n\n/** An option inside a `VisualPicker`. */\ninterface RadioVisualPickerVariantProps extends RadioVisualPickerOnlyProps {\n\t/** Radio variant */\n\tvariant: 'visual-picker';\n\tstyle?: never;\n}\n\ntype RadioVariantProps =\n\t| RadioPlainVariantProps\n\t| RadioSwatchVariantProps\n\t| RadioVisualPickerVariantProps;\n\n/**\n * Props for the Radio component: a union on `variant`, so a prop that a\n * variant ignores is a compile error.\n */\nexport type RadioProps = RadioBaseProps & RadioVariantProps;\n\n/**\n * Props for a `Radio` rendered as a child of `RadioGroup` or\n * `RadioButtonGroup`. The group injects `checked` (derived from its `value`)\n * and `onChange`, so neither is required here.\n */\nexport type RadioGroupItemProps = Omit<RadioBaseProps, 'checked' | 'onChange'> &\n\tRadioVariantProps &\n\tRadioGroupItemOwnProps;\n\ninterface RadioGroupItemOwnProps {\n\t/**\n\t * @deprecated Pass `value` to the `RadioGroup`/`RadioButtonGroup` instead.\n\t * Only used when the group has no `value`.\n\t */\n\tchecked?: boolean;\n\t/** Ignored inside a group: the group's `onChange` is called instead. */\n\tonChange?: RadioChangeHandler;\n}\n\nconst defaultAssistiveText: RadioAssistiveText = {};\nconst defaultLabels: RadioLabels = {};\n\n/**\n * A radio input that can have a single input checked at any one time.\n * Radios should be wrapped with a RadioGroup or RadioButtonGroup.\n */\nconst Radio = (props: RadioProps): React.ReactElement => {\n\tconst {\n\t\tassistiveText: propAssistiveText,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t'aria-labelledby': ariaLabelledBy,\n\t\tchecked,\n\t\tclassName,\n\t\t// Removed in v11. Destructured so they never reach the DOM;\n\t\t// `checkDeprecatedProps` warns about them.\n\t\tdefaultChecked,\n\t\tdeselectable,\n\t\tdisabled,\n\t\tid: propId,\n\t\tlabelId,\n\t\tlabels: propLabels,\n\t\tlabel,\n\t\tname,\n\t\tonChange,\n\t\tonFocus,\n\t\tonRequestFocus,\n\t\trequestFocus,\n\t\ttabIndex,\n\t\tvalue,\n\t\tvariant = 'base',\n\t\tcoverable = false,\n\t\tvertical,\n\t\tvisualPickerFigure,\n\t\tvisualPickerFigureSelected,\n\t\tvisualPickerFigureNotSelected,\n\t\tonRenderVisualPicker,\n\t\tonRenderVisualPickerSelected,\n\t\tonRenderVisualPickerNotSelected,\n\t\tsize = 'medium',\n\t\trefs,\n\t\tstyle,\n\t\t...rest\n\t} = props as RadioBaseProps &\n\t\tPartial<RadioVisualPickerOnlyProps> & {\n\t\t\tvariant?: RadioVariant;\n\t\t\tstyle?: CSSProperties;\n\t\t} & {\n\t\t\tdefaultChecked?: boolean;\n\t\t\tlabel?: unknown;\n\t\t};\n\tconst generatedId = useId();\n\tconst preventDuplicateRef = useRef(false);\n\n\tconst id = propId || generatedId;\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tuseEffect(() => {\n\t\tcheckDeprecatedProps(\n\t\t\tRADIO,\n\t\t\t{\n\t\t\t\tdefaultChecked,\n\t\t\t\tlabel,\n\t\t\t\tonRenderVisualPicker,\n\t\t\t\tonRenderVisualPickerSelected,\n\t\t\t\tonRenderVisualPickerNotSelected,\n\t\t\t\tonRequestFocus,\n\t\t\t\trequestFocus,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, [\n\t\tdefaultChecked,\n\t\tlabel,\n\t\tonRequestFocus,\n\t\trequestFocus,\n\t\tonRenderVisualPicker,\n\t\tonRenderVisualPickerSelected,\n\t\tonRenderVisualPickerNotSelected,\n\t]);\n\n\tconst ariaProps = getAriaProps(rest);\n\tconst dataProps = getDataProps(rest);\n\n\tconst handleChange = useCallback(\n\t\t(event: RadioChangeEvent, preventDuplicate?: boolean) => {\n\t\t\tif (!preventDuplicateRef.current) {\n\t\t\t\tpreventDuplicateRef.current = Boolean(preventDuplicate);\n\t\t\t\tonChange?.(event, { checked: !checked });\n\t\t\t} else {\n\t\t\t\tpreventDuplicateRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[checked, onChange]\n\t);\n\n\tconst handleInputRef = useCallback(\n\t\t(input: HTMLInputElement | null) => {\n\t\t\trefs?.input?.(input);\n\t\t\tif (input && requestFocus && onRequestFocus) {\n\t\t\t\tonRequestFocus(input);\n\t\t\t}\n\t\t},\n\t\t[refs, requestFocus, onRequestFocus]\n\t);\n\n\t// Render the label based on variant\n\tlet radioLabel: React.ReactNode;\n\n\tif (variant === 'swatch') {\n\t\tradioLabel = (\n\t\t\t<label\n\t\t\t\tstyle={{ border: 'var(--slds-g-sizing-border-1, 1px)' }}\n\t\t\t\tclassName=\"slds-radio_button__label\"\n\t\t\t\thtmlFor={id}\n\t\t\t>\n\t\t\t\t<span>\n\t\t\t\t\t<Swatch label={labels.label} style={style} color={value ?? ''} />\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t);\n\t} else if (variant === 'button-group') {\n\t\tradioLabel = (\n\t\t\t<label className=\"slds-radio_button__label\" htmlFor={id}>\n\t\t\t\t<span className=\"slds-radio_faux\">{labels.label}</span>\n\t\t\t</label>\n\t\t);\n\t} else if (variant === 'visual-picker') {\n\t\tradioLabel = (\n\t\t\t<label htmlFor={id}>\n\t\t\t\t{coverable ? (\n\t\t\t\t\t<div className=\"slds-visual-picker__figure slds-visual-picker__icon slds-align_absolute-center\">\n\t\t\t\t\t\t<span className=\"slds-is-selected\">\n\t\t\t\t\t\t\t{visualPickerFigureSelected ?? onRenderVisualPickerSelected?.()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-is-not-selected\">\n\t\t\t\t\t\t\t{visualPickerFigureNotSelected ??\n\t\t\t\t\t\t\t\tonRenderVisualPickerNotSelected?.()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<span className=\"slds-visual-picker__figure slds-visual-picker__text slds-align_absolute-center\">\n\t\t\t\t\t\t{visualPickerFigure ?? onRenderVisualPicker?.()}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!vertical && (\n\t\t\t\t\t<span className=\"slds-visual-picker__body\">\n\t\t\t\t\t\t{labels.heading && (\n\t\t\t\t\t\t\t<span className=\"slds-text-heading_small\">{labels.heading}</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span className=\"slds-text-title\">{labels.label}</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!coverable && (\n\t\t\t\t\t<span className=\"slds-icon_container slds-visual-picker__text-check\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\tcolorVariant=\"base\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</label>\n\t\t);\n\t} else {\n\t\t// Base variant\n\t\tradioLabel = (\n\t\t\t<label className=\"slds-radio__label\" htmlFor={id} id={labelId}>\n\t\t\t\t<span className=\"slds-radio_faux\" />\n\t\t\t\t<span className=\"slds-form-element__label\">{labels.label}</span>\n\t\t\t\t{assistiveText.label && (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.label}</span>\n\t\t\t\t)}\n\t\t\t</label>\n\t\t);\n\t}\n\n\treturn (\n\t\t<span\n\t\t\tclassName={classNames(\n\t\t\t\tvariant === 'visual-picker' ? `slds-visual-picker_${size}` : null,\n\t\t\t\t{\n\t\t\t\t\t'slds-radio': variant === 'base' || variant === 'swatch',\n\t\t\t\t\t'slds-button slds-radio_button': variant === 'button-group',\n\t\t\t\t\t'slds-visual-picker': variant === 'visual-picker',\n\t\t\t\t\t'slds-visual-picker_vertical':\n\t\t\t\t\t\tvariant === 'visual-picker' && vertical,\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t>\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tid={id}\n\t\t\t\tname={name}\n\t\t\t\tvalue={value}\n\t\t\t\tchecked={!!checked}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonChange={(event) => handleChange(event)}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tif (checked && deselectable) {\n\t\t\t\t\t\thandleChange(event);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\tconst { key } = event;\n\t\t\t\t\tif (key === KEYS.SPACE && checked && deselectable) {\n\t\t\t\t\t\thandleChange(event, true);\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t(key === KEYS.ENTER && checked && deselectable) ||\n\t\t\t\t\t\t(!checked && (key === KEYS.SPACE || key === KEYS.ENTER))\n\t\t\t\t\t) {\n\t\t\t\t\t\thandleChange(event);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tdisabled={disabled}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t{...ariaProps}\n\t\t\t\t{...dataProps}\n\t\t\t\tref={handleInputRef}\n\t\t\t/>\n\t\t\t{radioLabel}\n\t\t</span>\n\t);\n};\n\nRadio.displayName = RADIO;\n\nexport default Radio;\n"],"mappings":"glBAyNA,IAAM,EAA2C,CAAC,EAC5C,EAA6B,CAAC,EAM9B,EAAS,GAA0C,CACxD,GAAM,CACL,cAAe,EACf,mBAAoB,EACpB,kBAAmB,EACnB,UACA,YAGA,iBACA,eACA,WACA,GAAI,EACJ,UACA,OAAQ,EACR,QACA,OACA,WACA,UACA,iBACA,eACA,WACA,QACA,UAAU,OACV,YAAY,GACZ,WACA,qBACA,6BACA,gCACA,uBACA,+BACA,kCACA,OAAO,SACP,OACA,QACA,GAAG,GACA,EAQE,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,GAAA,EAAsB,EAAA,OAAA,CAAO,EAAK,EAElC,EAAK,GAAU,EACf,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,GAEjD,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,qBACC,EAAA,MACA,CACC,iBACA,QACA,uBACA,+BACA,kCACA,iBACA,cACD,EACA,EAAA,OACD,CACD,EAAG,CACF,EACA,EACA,EACA,EACA,EACA,EACA,CACD,CAAC,EAED,IAAM,EAAY,EAAA,QAAa,CAAI,EAC7B,EAAY,EAAA,QAAa,CAAI,EAE7B,GAAA,EAAe,EAAA,YAAA,EACnB,EAAyB,IAA+B,CACnD,EAAoB,QAIxB,EAAoB,QAAU,IAH9B,EAAoB,QAAU,EAAQ,EACtC,IAAW,EAAO,CAAE,QAAS,CAAC,CAAQ,CAAC,EAIzC,EACA,CAAC,EAAS,CAAQ,CACnB,EAEM,IAAA,EAAiB,EAAA,YAAA,CACrB,GAAmC,CACnC,GAAM,QAAQ,CAAK,EACf,GAAS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AAM,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/radio-group/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\tuseEffect,\n\tuseId,\n\tuseMemo,\n\ttype ReactElement,\n\ttype CSSProperties,\n\ttype ChangeEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport { RADIO_GROUP } from '../../utilities/constants';\nimport type {\n\tRadioChangeData,\n\tRadioChangeHandler,\n\tRadioGroupItemProps,\n} from '../radio/index';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport type { ChildrenOf } from '../../types/common';\n\n/**\n * Radio group variant types\n */\nexport type RadioGroupVariant = 'base' | 'button-group';\n\n/**\n * Assistive text for RadioGroup\n */\nexport interface RadioGroupAssistiveText {\n\t/** Label for the group (shown in legend) */\n\tlabel?: string;\n\t/** Text for required indicator */\n\trequired?: string;\n}\n\n/**\n * Labels for RadioGroup\n */\nexport interface RadioGroupLabels {\n\t/** Error message to display */\n\terror?: string;\n\t/** Label above the radio group */\n\tlabel?: string;\n}\n\n/**\n * Change event data for RadioGroup\n */\nexport interface RadioGroupChangeData {\n\t/**\n\t * The requested selection: the `value` of the radio the user selected, or\n\t * `null` when a `deselectable` radio is deselected.\n\t */\n\tvalue: string | null;\n\t/**\n\t * Requested checked state of the radio that changed.\n\t * @deprecated Read `value` instead.\n\t */\n\tchecked: boolean;\n}\n\n/**\n * Called when the user selects a radio, with the requested selection in\n * `data.value`. The rendered selection only changes when `value` is updated.\n */\nexport type RadioGroupChangeHandler = (\n\tevent: ChangeEvent<HTMLInputElement>,\n\tdata: RadioGroupChangeData\n) => void;\n\n/**\n * The group is controlled, so `onChange` is required unless the group is\n * `disabled`: without it, selecting a radio does nothing.\n */\nexport type RadioGroupChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the user selects a radio, with the requested selection in\n\t\t\t * `data.value`. The rendered selection only changes when `value` is\n\t\t\t * updated. Required unless `disabled` is set.\n\t\t\t */\n\t\t\tonChange: RadioGroupChangeHandler;\n\t }\n\t| { disabled: true; onChange?: RadioGroupChangeHandler };\n\ninterface RadioGroupBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: RadioGroupAssistiveText;\n\t/**\n\t * `Radio` elements (from `radio-group/radio`). The group passes each one\n\t * `name`, `onChange`, `aria-describedby`, `disabled` and, when `value` is\n\t * set, `checked`. A `Radio`'s own `name` wins, and its `aria-describedby`\n\t * is joined with the group's error id.\n\t */\n\tchildren: ChildrenOf<RadioGroupItemProps>;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Disable all radio inputs */\n\tdisabled?: boolean;\n\t/** ID for error message element */\n\terrorId?: string;\n\t/** Text labels */\n\tlabels?: RadioGroupLabels;\n\t/** Name attribute for all radios */\n\tname?: string;\n\t/** Whether the field is required */\n\trequired?: boolean;\n\t/**\n\t * The `value` of the selected radio, or `null` for no selection. The group\n\t * is controlled: each child radio is checked when its `value` equals this.\n\t * Leaving it `undefined` falls back to each `Radio`'s own `checked`\n\t * (deprecated).\n\t */\n\tvalue: string | null;\n}\n\n/** Radios stacked in a list. Has no wrapper element to style. */\ninterface RadioGroupBaseVariantProps {\n\t/** Group variant */\n\tvariant?: 'base';\n\tstyle?: never;\n}\n\n/** Radios rendered as a button group. */\ninterface RadioGroupButtonGroupVariantProps {\n\t/** Group variant */\n\tvariant: 'button-group';\n\t/** Custom styles for the button group */\n\tstyle?: CSSProperties;\n}\n\n/**\n * Props for the RadioGroup component: `style` styles the button-group wrapper,\n * so only `variant=\"button-group\"` accepts it.\n */\nexport type RadioGroupProps = RadioGroupBaseProps &\n\tRadioGroupChangeProps &\n\t(RadioGroupBaseVariantProps | RadioGroupButtonGroupVariantProps);\n\nconst defaultAssistiveText: RadioGroupAssistiveText = {\n\trequired: 'Required',\n};\n\nconst defaultLabels: RadioGroupLabels = {};\n\n/**\n * A styled select list that can have a single entry checked at any one time.\n * The RadioGroup component wraps Radio components, which should be used as children.\n */\nconst RadioGroup = ({\n\tassistiveText: propAssistiveText,\n\tchildren,\n\tclassName,\n\tdisabled,\n\terrorId: propErrorId,\n\tlabels: propLabels,\n\tname: propName,\n\tonChange,\n\trequired,\n\tstyle,\n\tvalue,\n\tvariant = 'base',\n}: RadioGroupProps): React.ReactElement => {\n\tconst generatedName = useId();\n\tconst generatedErrorId = useId();\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst name = propName || generatedName;\n\tconst hasError = Boolean(labels.error);\n\tconst errorId = hasError ? propErrorId || generatedErrorId : undefined;\n\n\tconst isControlled = value !== undefined;\n\n\tuseEffect(() => {\n\t\tcheckProps(RADIO_GROUP, { disabled, onChange, value }, componentDoc);\n\t});\n\n\t// Clone children with group props. With a group `value`, each radio's\n\t// `checked` is derived from it; without one (deprecated), the radio keeps\n\t// the `checked` it was given.\n\tconst enhancedChildren = useMemo(() => {\n\t\treturn React.Children.map(children, (child) => {\n\t\t\tif (React.isValidElement<RadioGroupItemProps>(child)) {\n\t\t\t\tconst childProps = child.props;\n\t\t\t\tconst childValue = childProps.value ?? null;\n\t\t\t\tconst handleChange: RadioChangeHandler = (\n\t\t\t\t\tevent,\n\t\t\t\t\tdata: RadioChangeData\n\t\t\t\t) => {\n\t\t\t\t\tonChange?.(event as ChangeEvent<HTMLInputElement>, {\n\t\t\t\t\t\tchecked: data.checked,\n\t\t\t\t\t\tvalue: data.checked ? childValue : null,\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\treturn React.cloneElement(child as ReactElement<RadioGroupItemProps>, {\n\t\t\t\t\tname: childProps.name ?? name,\n\t\t\t\t\tonChange: handleChange,\n\t\t\t\t\t'aria-describedby':\n\t\t\t\t\t\tclassNames(childProps['aria-describedby'], errorId) || undefined,\n\t\t\t\t\tdisabled: disabled || childProps.disabled,\n\t\t\t\t\t...(isControlled\n\t\t\t\t\t\t? { checked: childValue !== null && childValue === value }\n\t\t\t\t\t\t: {}),\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}, [children, name, onChange, errorId, disabled, isControlled, value]);\n\n\treturn (\n\t\t<fieldset\n\t\t\tclassName={classNames('slds-form-element', {\n\t\t\t\t'slds-has-error': hasError,\n\t\t\t})}\n\t\t>\n\t\t\t<legend\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element__legend',\n\t\t\t\t\t'slds-form-element__label',\n\t\t\t\t\t{ 'slds-assistive-text': assistiveText.label }\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{required && (\n\t\t\t\t\t<abbr className=\"slds-required\" title=\"required\">\n\t\t\t\t\t\t*\n\t\t\t\t\t\t<div className=\"slds-assistive-text\">{assistiveText.required} </div>\n\t\t\t\t\t</abbr>\n\t\t\t\t)}\n\t\t\t\t{assistiveText.label || labels.label}\n\t\t\t</legend>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element__control',\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{variant === 'button-group' ? (\n\t\t\t\t\t<div style={style} className=\"slds-radio_button-group\">\n\t\t\t\t\t\t{enhancedChildren}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\tenhancedChildren\n\t\t\t\t)}\n\n\t\t\t\t{labels.error && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{labels.error}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n};\n\nRadioGroup.displayName = RADIO_GROUP;\n\nexport default RadioGroup;\n"],"mappings":"sXA6IA,IAAM,EAAgD,CACrD,SAAU,UACX,EAEM,EAAkC,CAAC,EAMnC,GAAc,CACnB,cAAe,EACf,WACA,YACA,WACA,QAAS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,QAAA,CACV,4BACA,2BACA,CAAE,sBAAuB,EAAc,KAAM,CAC9C,EALD,SAAA,CAOE,IACA,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,gBAAgB,MAAM,WAAtC,SAAA,CAAiD,KAEhD,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sBAAf,SAAA,CAAsC,EAAc,SAAS,GAAM,CAC9D,CAAA,CAAA,CAEN,CAAA,EAAA,EAAc,OAAS,EAAO,KACxB,CACR,CAAA,GAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,6BACA,CACD,EAJD,SAAA,CAME,IAAY,gBACZ,EAAA,EAAA,IAAA,CAAC,MAAD,CAAY,QAAO,UAAU,0BAC3B,SAAA,CACG,CAAA,EAEL,EAGA,EAAO,QACP,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,EAAS,UAAU,0BAC1B,SAAA,EAAO,KACJ,CAAA,CAEF,CACI,CAAA,CAAA,GAEZ,EAEA,EAAW,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/radio-group/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\tuseEffect,\n\tuseId,\n\tuseMemo,\n\ttype ReactElement,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\nimport { RADIO_GROUP } from '../../utilities/constants';\nimport type {\n\tRadioChangeData,\n\tRadioChangeEvent,\n\tRadioChangeHandler,\n\tRadioGroupItemProps,\n} from '../radio/index';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport type { ChildrenOf } from '../../types/common';\n\n/**\n * Radio group variant types\n */\nexport type RadioGroupVariant = 'base' | 'button-group';\n\n/**\n * Assistive text for RadioGroup\n */\nexport interface RadioGroupAssistiveText {\n\t/** Label for the group (shown in legend) */\n\tlabel?: string;\n\t/** Text for required indicator */\n\trequired?: string;\n}\n\n/**\n * Labels for RadioGroup\n */\nexport interface RadioGroupLabels {\n\t/** Error message to display */\n\terror?: string;\n\t/** Label above the radio group */\n\tlabel?: string;\n}\n\n/**\n * Change event data for RadioGroup\n */\nexport interface RadioGroupChangeData {\n\t/**\n\t * The requested selection: the `value` of the radio the user selected, or\n\t * `null` when a `deselectable` radio is deselected.\n\t */\n\tvalue: string | null;\n\t/**\n\t * Requested checked state of the radio that changed.\n\t * @deprecated Read `value` instead.\n\t */\n\tchecked: boolean;\n}\n\n/**\n * Called when the user selects a radio, with the requested selection in\n * `data.value`. The rendered selection only changes when `value` is updated.\n */\nexport type RadioGroupChangeHandler = (\n\tevent: RadioChangeEvent,\n\tdata: RadioGroupChangeData\n) => void;\n\n/**\n * The group is controlled, so `onChange` is required unless the group is\n * `disabled`: without it, selecting a radio does nothing.\n */\nexport type RadioGroupChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the user selects a radio, with the requested selection in\n\t\t\t * `data.value`. The rendered selection only changes when `value` is\n\t\t\t * updated. Required unless `disabled` is set.\n\t\t\t */\n\t\t\tonChange: RadioGroupChangeHandler;\n\t }\n\t| { disabled: true; onChange?: RadioGroupChangeHandler };\n\ninterface RadioGroupBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: RadioGroupAssistiveText;\n\t/**\n\t * `Radio` elements (from `radio-group/radio`). The group passes each one\n\t * `name`, `onChange`, `aria-describedby`, `disabled` and, when `value` is\n\t * set, `checked`. A `Radio`'s own `name` wins, and its `aria-describedby`\n\t * is joined with the group's error id.\n\t */\n\tchildren: ChildrenOf<RadioGroupItemProps>;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Disable all radio inputs */\n\tdisabled?: boolean;\n\t/** ID for error message element */\n\terrorId?: string;\n\t/** Text labels */\n\tlabels?: RadioGroupLabels;\n\t/** Name attribute for all radios */\n\tname?: string;\n\t/** Whether the field is required */\n\trequired?: boolean;\n\t/**\n\t * The `value` of the selected radio, or `null` for no selection. The group\n\t * is controlled: each child radio is checked when its `value` equals this.\n\t * Leaving it `undefined` falls back to each `Radio`'s own `checked`\n\t * (deprecated).\n\t */\n\tvalue: string | null;\n}\n\n/** Radios stacked in a list. Has no wrapper element to style. */\ninterface RadioGroupBaseVariantProps {\n\t/** Group variant */\n\tvariant?: 'base';\n\tstyle?: never;\n}\n\n/** Radios rendered as a button group. */\ninterface RadioGroupButtonGroupVariantProps {\n\t/** Group variant */\n\tvariant: 'button-group';\n\t/** Custom styles for the button group */\n\tstyle?: CSSProperties;\n}\n\n/**\n * Props for the RadioGroup component: `style` styles the button-group wrapper,\n * so only `variant=\"button-group\"` accepts it.\n */\nexport type RadioGroupProps = RadioGroupBaseProps &\n\tRadioGroupChangeProps &\n\t(RadioGroupBaseVariantProps | RadioGroupButtonGroupVariantProps);\n\nconst defaultAssistiveText: RadioGroupAssistiveText = {\n\trequired: 'Required',\n};\n\nconst defaultLabels: RadioGroupLabels = {};\n\n/**\n * A styled select list that can have a single entry checked at any one time.\n * The RadioGroup component wraps Radio components, which should be used as children.\n */\nconst RadioGroup = ({\n\tassistiveText: propAssistiveText,\n\tchildren,\n\tclassName,\n\tdisabled,\n\terrorId: propErrorId,\n\tlabels: propLabels,\n\tname: propName,\n\tonChange,\n\trequired,\n\tstyle,\n\tvalue,\n\tvariant = 'base',\n}: RadioGroupProps): React.ReactElement => {\n\tconst generatedName = useId();\n\tconst generatedErrorId = useId();\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst name = propName || generatedName;\n\tconst hasError = Boolean(labels.error);\n\tconst errorId = hasError ? propErrorId || generatedErrorId : undefined;\n\n\tconst isControlled = value !== undefined;\n\n\tuseEffect(() => {\n\t\tcheckProps(RADIO_GROUP, { disabled, onChange, value }, componentDoc);\n\t});\n\n\t// Clone children with group props. With a group `value`, each radio's\n\t// `checked` is derived from it; without one (deprecated), the radio keeps\n\t// the `checked` it was given.\n\tconst enhancedChildren = useMemo(() => {\n\t\treturn React.Children.map(children, (child) => {\n\t\t\tif (React.isValidElement<RadioGroupItemProps>(child)) {\n\t\t\t\tconst childProps = child.props;\n\t\t\t\tconst childValue = childProps.value ?? null;\n\t\t\t\tconst handleChange: RadioChangeHandler = (\n\t\t\t\t\tevent,\n\t\t\t\t\tdata: RadioChangeData\n\t\t\t\t) => {\n\t\t\t\t\tonChange?.(event, {\n\t\t\t\t\t\tchecked: data.checked,\n\t\t\t\t\t\tvalue: data.checked ? childValue : null,\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\treturn React.cloneElement(child as ReactElement<RadioGroupItemProps>, {\n\t\t\t\t\tname: childProps.name ?? name,\n\t\t\t\t\tonChange: handleChange,\n\t\t\t\t\t'aria-describedby':\n\t\t\t\t\t\tclassNames(childProps['aria-describedby'], errorId) || undefined,\n\t\t\t\t\tdisabled: disabled || childProps.disabled,\n\t\t\t\t\t...(isControlled\n\t\t\t\t\t\t? { checked: childValue !== null && childValue === value }\n\t\t\t\t\t\t: {}),\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}, [children, name, onChange, errorId, disabled, isControlled, value]);\n\n\treturn (\n\t\t<fieldset\n\t\t\tclassName={classNames('slds-form-element', {\n\t\t\t\t'slds-has-error': hasError,\n\t\t\t})}\n\t\t>\n\t\t\t<legend\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element__legend',\n\t\t\t\t\t'slds-form-element__label',\n\t\t\t\t\t{ 'slds-assistive-text': assistiveText.label }\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{required && (\n\t\t\t\t\t<abbr className=\"slds-required\" title=\"required\">\n\t\t\t\t\t\t*\n\t\t\t\t\t\t<div className=\"slds-assistive-text\">{assistiveText.required} </div>\n\t\t\t\t\t</abbr>\n\t\t\t\t)}\n\t\t\t\t{assistiveText.label || labels.label}\n\t\t\t</legend>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element__control',\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{variant === 'button-group' ? (\n\t\t\t\t\t<div style={style} className=\"slds-radio_button-group\">\n\t\t\t\t\t\t{enhancedChildren}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\tenhancedChildren\n\t\t\t\t)}\n\n\t\t\t\t{labels.error && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{labels.error}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n};\n\nRadioGroup.displayName = RADIO_GROUP;\n\nexport default RadioGroup;\n"],"mappings":"sXA6IA,IAAM,EAAgD,CACrD,SAAU,UACX,EAEM,EAAkC,CAAC,EAMnC,GAAc,CACnB,cAAe,EACf,WACA,YACA,WACA,QAAS,EACT,OAAQ,EACR,KAAM,EACN,WACA,WACA,QACA,QACA,UAAU,UACgC,CAC1C,IAAM,GAAA,EAAgB,EAAA,MAAA,CAAM,EACtB,GAAA,EAAmB,EAAA,MAAA,CAAM,EAEzB,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAS,CAAE,GAAG,EAAe,GAAG,CAAW,EAE3C,EAAO,GAAY,EACnB,EAAW,EAAQ,EAAO,MAC1B,EAAU,EAAW,GAAe,EAAmB,IAAA,GAEvD,EAAe,IAAU,IAAA,IAE/B,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QAAW,EAAA,YAAa,CAAE,WAAU,WAAU,OAAM,EAAG,EAAA,OAAY,CACpE,CAAC,EAKD,IAAM,GAAA,EAAmB,EAAA,QAAA,KACjB,EAAA,QAAM,SAAS,IAAI,EAAW,GAAU,CAC9C,GAAI,EAAA,QAAM,eAAoC,CAAK,EAAG,CACrD,IAAM,EAAa,EAAM,MACnB,EAAa,EAAW,OAAS,KA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A,GAEZ,EAEA,EAAW,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/cell-context.cjs"),r=require("./private/table-context.cjs"),i=require("./private/context-helper.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=e=>{let t=(0,a.useContext)(r.default),c=(0,a.useContext)(n.default),{tabIndex:l,hasFocus:u,handleFocus:d,handleKeyDown:f}=i.default(t,c,e.fixedLayout),p=a.default.isValidElement(e.children)?e.children.props.children:e.children,m=(0,s.jsx)(`div`,{className:(0,o.default)({"slds-truncate":e.fixedLayout}),title:e.title||(typeof p==`string`?p:void 0),children:e.children}),h=(0,o.default)(e.className,{"slds-has-focus":u}),g=e=>{e&&u&&e.focus()};return e.primaryColumn?(0,s.jsx)(`th`,{className:h,ref:g,"data-label":e.label,role:t.isGrid?`gridcell`:void 0,tabIndex:l,style:e.width?{width:e.width}:void 0,onFocus:d,onKeyDown:f,children:m}):(0,s.jsx)(`td`,{className:h,"data-label":e.label,onFocus:d,onKeyDown:f,ref:g,role:t.isGrid?`gridcell`:void 0,style:e.width?{width:e.width}:void 0,tabIndex:l,headers:e.headerId,children:m})};c.displayName=t.SIMPLE_DATA_TABLE_CELL,exports.default=c;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("./private/cell-context.cjs"),r=require("./private/table-context.cjs"),i=require("./private/context-helper.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=e=>{let t=(0,a.useContext)(r.default),c=(0,a.useContext)(n.default),{tabIndex:l,hasFocus:u,handleFocus:d,handleKeyDown:f}=i.default(t,c,e.fixedLayout),p=a.default.isValidElement(e.children)?e.children.props.children:e.children,m=(0,s.jsx)(`div`,{className:(0,o.default)({"slds-truncate":e.fixedLayout}),title:e.title||(typeof p==`string`?p:void 0),children:e.children}),h=(0,o.default)(e.className,{"slds-has-focus":u}),g=e.width||c.cornerStyle?{...c.cornerStyle,width:e.width}:void 0,_=e=>{e&&u&&e.focus()};return e.primaryColumn?(0,s.jsx)(`th`,{className:h,ref:_,"data-label":e.label,role:t.isGrid?`gridcell`:void 0,tabIndex:l,style:g,onFocus:d,onKeyDown:f,children:m}):(0,s.jsx)(`td`,{className:h,"data-label":e.label,onFocus:d,onKeyDown:f,ref:_,role:t.isGrid?`gridcell`:void 0,style:g,tabIndex:l,headers:e.headerId,children:m})};c.displayName=t.SIMPLE_DATA_TABLE_CELL,exports.default=c;
2
2
  //# sourceMappingURL=cell.cjs.map