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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/README.md +27 -1
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/accordion/panel.cjs.map +1 -1
  5. package/dist/cjs/components/alert/index.cjs +1 -1
  6. package/dist/cjs/components/alert/index.cjs.map +1 -1
  7. package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
  8. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  9. package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
  10. package/dist/cjs/components/button/check-props.cjs +1 -1
  11. package/dist/cjs/components/button/check-props.cjs.map +1 -1
  12. package/dist/cjs/components/button/index.cjs +1 -1
  13. package/dist/cjs/components/button/index.cjs.map +1 -1
  14. package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
  15. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
  16. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  17. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  18. package/dist/cjs/components/carousel/index.cjs +1 -1
  19. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  20. package/dist/cjs/components/carousel/private/carousel-indicators.cjs.map +1 -1
  21. package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
  22. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  24. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  25. package/dist/cjs/components/checkbox/index.cjs +1 -1
  26. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  27. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  28. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  29. package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
  30. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  31. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  32. package/dist/cjs/components/color-picker/private/swatch-option.cjs +1 -1
  33. package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
  34. package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
  35. package/dist/cjs/components/color-picker/private/swatch.cjs.map +1 -1
  36. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  37. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  38. package/dist/cjs/components/combobox/index.cjs +1 -1
  39. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  40. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  41. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  42. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  43. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  44. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  45. package/dist/cjs/components/date-picker/private/calendar.cjs.map +1 -1
  46. package/dist/cjs/components/date-picker/private/day.cjs +1 -1
  47. package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
  48. package/dist/cjs/components/files/file.cjs +1 -8
  49. package/dist/cjs/components/files/file.cjs.map +1 -1
  50. package/dist/cjs/components/files/private/file-actions.cjs +1 -1
  51. package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
  52. package/dist/cjs/components/files/private/file-figure.cjs +1 -1
  53. package/dist/cjs/components/files/private/file-figure.cjs.map +1 -1
  54. package/dist/cjs/components/filter/filter.cjs +1 -1
  55. package/dist/cjs/components/filter/filter.cjs.map +1 -1
  56. package/dist/cjs/components/icon/check-props.cjs +1 -1
  57. package/dist/cjs/components/icon/check-props.cjs.map +1 -1
  58. package/dist/cjs/components/icon/index.cjs +1 -1
  59. package/dist/cjs/components/icon/index.cjs.map +1 -1
  60. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  61. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  62. package/dist/cjs/components/input/check-props.cjs +1 -1
  63. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  64. package/dist/cjs/components/input/index.cjs.map +1 -1
  65. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  66. package/dist/cjs/components/input/search.cjs.map +1 -1
  67. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  68. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  69. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  70. package/dist/cjs/components/modal/index.cjs +1 -1
  71. package/dist/cjs/components/modal/index.cjs.map +1 -1
  72. package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
  73. package/dist/cjs/components/pill/index.cjs.map +1 -1
  74. package/dist/cjs/components/pill-container/index.cjs +1 -1
  75. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  76. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  77. package/dist/cjs/components/popover/index.cjs.map +1 -1
  78. package/dist/cjs/components/popover/popover.cjs +1 -1
  79. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  80. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  81. package/dist/cjs/components/progress-indicator/private/step.cjs.map +1 -1
  82. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  83. package/dist/cjs/components/radio/index.cjs +1 -1
  84. package/dist/cjs/components/radio/index.cjs.map +1 -1
  85. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
  86. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  87. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  88. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  89. package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
  90. package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -1
  91. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  92. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  93. package/dist/cjs/components/simple-data-table/interactive-element.cjs +1 -1
  94. package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
  95. package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
  96. package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
  97. package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
  98. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  99. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  100. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  101. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  102. package/dist/cjs/components/simple-data-table/private/link.cjs +1 -1
  103. package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -1
  104. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  105. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  106. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  107. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  108. package/dist/cjs/components/slider/index.cjs.map +1 -1
  109. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  110. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  111. package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
  112. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  113. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  114. package/dist/cjs/components/tabs/private/tab.cjs +1 -1
  115. package/dist/cjs/components/tabs/private/tab.cjs.map +1 -1
  116. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  117. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  118. package/dist/cjs/components/textarea/index.cjs +1 -1
  119. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  120. package/dist/cjs/components/toast/index.cjs.map +1 -1
  121. package/dist/cjs/components/tooltip/index.cjs +1 -3
  122. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  123. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  124. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  125. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  126. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  127. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  128. package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
  129. package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
  130. package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
  131. package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
  132. package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
  133. package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
  134. package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
  135. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  136. package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
  137. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  138. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  139. package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
  140. package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
  141. package/dist/cjs/utilities/color.cjs +1 -1
  142. package/dist/cjs/utilities/color.cjs.map +1 -1
  143. package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
  144. package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
  145. package/dist/cjs/utilities/get-aria-props.cjs +1 -1
  146. package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
  147. package/dist/cjs/utilities/get-component-doc.cjs +1 -1
  148. package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
  149. package/dist/cjs/utilities/get-data-props.cjs +1 -1
  150. package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
  151. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
  152. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
  153. package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
  154. package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
  155. package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
  156. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  157. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  158. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  159. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  160. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  161. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  162. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
  163. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
  164. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
  165. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
  166. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
  167. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
  168. package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
  169. package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
  170. package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
  171. package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
  172. package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
  173. package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
  174. package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
  175. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
  176. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
  177. package/dist/cjs/utilities/warning/required-property.cjs +1 -1
  178. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
  179. package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
  180. package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
  181. package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
  182. package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
  183. package/dist/es/components/accordion/index.js +7 -3
  184. package/dist/es/components/accordion/index.js.map +1 -1
  185. package/dist/es/components/accordion/panel.js.map +1 -1
  186. package/dist/es/components/alert/index.js +4 -5
  187. package/dist/es/components/alert/index.js.map +1 -1
  188. package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
  189. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  190. package/dist/es/components/builder-header/toolbar.js.map +1 -1
  191. package/dist/es/components/button/check-props.js +1 -1
  192. package/dist/es/components/button/check-props.js.map +1 -1
  193. package/dist/es/components/button/index.js +50 -50
  194. package/dist/es/components/button/index.js.map +1 -1
  195. package/dist/es/components/button-stateful/check-props.js +1 -1
  196. package/dist/es/components/button-stateful/check-props.js.map +1 -1
  197. package/dist/es/components/button-stateful/index.js +3 -2
  198. package/dist/es/components/button-stateful/index.js.map +1 -1
  199. package/dist/es/components/carousel/index.js +155 -129
  200. package/dist/es/components/carousel/index.js.map +1 -1
  201. package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
  202. package/dist/es/components/carousel/private/carousel-item.js +1 -1
  203. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  204. package/dist/es/components/checkbox/check-props.js +1 -1
  205. package/dist/es/components/checkbox/check-props.js.map +1 -1
  206. package/dist/es/components/checkbox/index.js +102 -100
  207. package/dist/es/components/checkbox/index.js.map +1 -1
  208. package/dist/es/components/color-picker/color-picker.js +150 -151
  209. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  210. package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
  211. package/dist/es/components/color-picker/private/hsv-color.js +16 -20
  212. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  213. package/dist/es/components/color-picker/private/swatch-option.js +2 -2
  214. package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
  215. package/dist/es/components/color-picker/private/swatch.js +1 -1
  216. package/dist/es/components/color-picker/private/swatch.js.map +1 -1
  217. package/dist/es/components/combobox/combobox.js +569 -582
  218. package/dist/es/components/combobox/combobox.js.map +1 -1
  219. package/dist/es/components/combobox/index.js +6 -19
  220. package/dist/es/components/combobox/index.js.map +1 -1
  221. package/dist/es/components/combobox/private/menu.js +3 -3
  222. package/dist/es/components/combobox/private/menu.js.map +1 -1
  223. package/dist/es/components/date-picker/date-picker.js +101 -102
  224. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  225. package/dist/es/components/date-picker/index.js.map +1 -1
  226. package/dist/es/components/date-picker/private/calendar.js.map +1 -1
  227. package/dist/es/components/date-picker/private/day.js +1 -1
  228. package/dist/es/components/date-picker/private/day.js.map +1 -1
  229. package/dist/es/components/files/file.js +5 -6
  230. package/dist/es/components/files/file.js.map +1 -1
  231. package/dist/es/components/files/private/file-actions.js +2 -2
  232. package/dist/es/components/files/private/file-actions.js.map +1 -1
  233. package/dist/es/components/files/private/file-figure.js +1 -1
  234. package/dist/es/components/files/private/file-figure.js.map +1 -1
  235. package/dist/es/components/filter/filter.js +5 -1
  236. package/dist/es/components/filter/filter.js.map +1 -1
  237. package/dist/es/components/icon/check-props.js +9 -7
  238. package/dist/es/components/icon/check-props.js.map +1 -1
  239. package/dist/es/components/icon/index.js +13 -10
  240. package/dist/es/components/icon/index.js.map +1 -1
  241. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  242. package/dist/es/components/icon-settings/index.js.map +1 -1
  243. package/dist/es/components/input/check-props.js +14 -13
  244. package/dist/es/components/input/check-props.js.map +1 -1
  245. package/dist/es/components/input/index.js.map +1 -1
  246. package/dist/es/components/input/private/inner-input.js.map +1 -1
  247. package/dist/es/components/input/search.js.map +1 -1
  248. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  249. package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
  250. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  251. package/dist/es/components/modal/index.js +1 -2
  252. package/dist/es/components/modal/index.js.map +1 -1
  253. package/dist/es/components/panel/filtering/group.js.map +1 -1
  254. package/dist/es/components/pill/index.js.map +1 -1
  255. package/dist/es/components/pill-container/index.js +10 -6
  256. package/dist/es/components/pill-container/index.js.map +1 -1
  257. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  258. package/dist/es/components/popover/index.js.map +1 -1
  259. package/dist/es/components/popover/popover.js +181 -177
  260. package/dist/es/components/popover/popover.js.map +1 -1
  261. package/dist/es/components/progress-indicator/index.js.map +1 -1
  262. package/dist/es/components/progress-indicator/private/step.js.map +1 -1
  263. package/dist/es/components/progress-ring/index.js.map +1 -1
  264. package/dist/es/components/radio/index.js +1 -1
  265. package/dist/es/components/radio/index.js.map +1 -1
  266. package/dist/es/components/radio-group/check-props.js.map +1 -1
  267. package/dist/es/components/radio-group/index.js.map +1 -1
  268. package/dist/es/components/scoped-notification/index.js.map +1 -1
  269. package/dist/es/components/setup-assistant/step.js.map +1 -1
  270. package/dist/es/components/simple-data-table/cell.js +8 -5
  271. package/dist/es/components/simple-data-table/cell.js.map +1 -1
  272. package/dist/es/components/simple-data-table/index.js +97 -91
  273. package/dist/es/components/simple-data-table/index.js.map +1 -1
  274. package/dist/es/components/simple-data-table/interactive-element.js +31 -28
  275. package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
  276. package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
  277. package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
  278. package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
  279. package/dist/es/components/simple-data-table/private/head.js +65 -42
  280. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  281. package/dist/es/components/simple-data-table/private/header-cell.js +2 -1
  282. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  283. package/dist/es/components/simple-data-table/private/link.js.map +1 -1
  284. package/dist/es/components/simple-data-table/private/row.js +96 -60
  285. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  286. package/dist/es/components/simple-data-table/row-actions.js +4 -1
  287. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  288. package/dist/es/components/slider/index.js.map +1 -1
  289. package/dist/es/components/split-view/header.js.map +1 -1
  290. package/dist/es/components/split-view/listbox.js.map +1 -1
  291. package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
  292. package/dist/es/components/tabs/index.js.map +1 -1
  293. package/dist/es/components/tabs/panel.js.map +1 -1
  294. package/dist/es/components/tabs/private/tab.js +1 -1
  295. package/dist/es/components/tabs/private/tab.js.map +1 -1
  296. package/dist/es/components/textarea/check-props.js +1 -1
  297. package/dist/es/components/textarea/check-props.js.map +1 -1
  298. package/dist/es/components/textarea/index.js +29 -42
  299. package/dist/es/components/textarea/index.js.map +1 -1
  300. package/dist/es/components/toast/index.js.map +1 -1
  301. package/dist/es/components/tooltip/index.js +107 -88
  302. package/dist/es/components/tooltip/index.js.map +1 -1
  303. package/dist/es/components/tree/private/branch.js.map +1 -1
  304. package/dist/es/components/tree/private/item.js.map +1 -1
  305. package/dist/es/components/tree/private/render-branch.js +14 -19
  306. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  307. package/dist/es/components/tree/tree.js.map +1 -1
  308. package/dist/es/components/trial-bar/button.js.map +1 -1
  309. package/dist/es/components/trial-bar/dropdown.js.map +1 -1
  310. package/dist/es/components/utilities/dialog/index.js +2 -1
  311. package/dist/es/components/utilities/dialog/index.js.map +1 -1
  312. package/dist/es/components/utilities/dialog/portal.js +5 -3
  313. package/dist/es/components/utilities/dialog/portal.js.map +1 -1
  314. package/dist/es/components/utilities/menu-list/index.js +6 -6
  315. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  316. package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
  317. package/dist/es/components/utilities/menu-list/item.js +42 -18
  318. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  319. package/dist/es/components/utilities/utility-icon/index.js +32 -52
  320. package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
  321. package/dist/es/utilities/color.js +1 -1
  322. package/dist/es/utilities/color.js.map +1 -1
  323. package/dist/es/utilities/dom-element-focus.js.map +1 -1
  324. package/dist/es/utilities/execution-environment.js.map +1 -1
  325. package/dist/es/utilities/get-aria-props.js +1 -1
  326. package/dist/es/utilities/get-aria-props.js.map +1 -1
  327. package/dist/es/utilities/get-component-doc.js +6 -6
  328. package/dist/es/utilities/get-component-doc.js.map +1 -1
  329. package/dist/es/utilities/get-data-props.js +1 -1
  330. package/dist/es/utilities/get-data-props.js.map +1 -1
  331. package/dist/es/utilities/keyboard-navigable-dialog.js +7 -7
  332. package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
  333. package/dist/es/utilities/keyboard-navigate.js +1 -1
  334. package/dist/es/utilities/keyboard-navigate.js.map +1 -1
  335. package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
  336. package/dist/es/utilities/warning/children-as-trigger.js +10 -8
  337. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  338. package/dist/es/utilities/warning/deprecated-property-value.js +12 -10
  339. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  340. package/dist/es/utilities/warning/deprecated-property.js +10 -8
  341. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  342. package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
  343. package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
  344. package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
  345. package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
  346. package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
  347. package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
  348. package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
  349. package/dist/es/utilities/warning/one-of-required-property.js +11 -10
  350. package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
  351. package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
  352. package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
  353. package/dist/es/utilities/warning/removal-version.js +6 -0
  354. package/dist/es/utilities/warning/removal-version.js.map +1 -0
  355. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
  356. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
  357. package/dist/es/utilities/warning/required-property.js +8 -7
  358. package/dist/es/utilities/warning/required-property.js.map +1 -1
  359. package/dist/es/utilities/warning/sunset-property.js +8 -7
  360. package/dist/es/utilities/warning/sunset-property.js.map +1 -1
  361. package/dist/es/utilities/warning/warned-registry.js +10 -0
  362. package/dist/es/utilities/warning/warned-registry.js.map +1 -0
  363. package/dist/llms/components/accordion.md +267 -0
  364. package/dist/llms/components/alert.md +228 -0
  365. package/dist/llms/components/avatar.md +167 -0
  366. package/dist/llms/components/badge.md +153 -0
  367. package/dist/llms/components/breadcrumb.md +148 -0
  368. package/dist/llms/components/builder-header.examples.md +239 -0
  369. package/dist/llms/components/builder-header.md +736 -0
  370. package/dist/llms/components/button-group.md +167 -0
  371. package/dist/llms/components/button-stateful.md +246 -0
  372. package/dist/llms/components/button.md +661 -0
  373. package/dist/llms/components/card.md +368 -0
  374. package/dist/llms/components/carousel.md +365 -0
  375. package/dist/llms/components/checkbox.md +887 -0
  376. package/dist/llms/components/color-picker.md +591 -0
  377. package/dist/llms/components/combobox.examples.md +802 -0
  378. package/dist/llms/components/combobox.md +929 -0
  379. package/dist/llms/components/date-picker.md +546 -0
  380. package/dist/llms/components/docked-composer.md +173 -0
  381. package/dist/llms/components/dynamic-icon.md +226 -0
  382. package/dist/llms/components/expandable-section.md +198 -0
  383. package/dist/llms/components/files.md +337 -0
  384. package/dist/llms/components/filter.md +775 -0
  385. package/dist/llms/components/icon-settings.md +301 -0
  386. package/dist/llms/components/icon.md +1040 -0
  387. package/dist/llms/components/input.md +746 -0
  388. package/dist/llms/components/media-object.md +125 -0
  389. package/dist/llms/components/menu-dropdown.md +732 -0
  390. package/dist/llms/components/modal.md +504 -0
  391. package/dist/llms/components/page-header.md +282 -0
  392. package/dist/llms/components/panel.md +256 -0
  393. package/dist/llms/components/pill-container.md +218 -0
  394. package/dist/llms/components/pill.md +266 -0
  395. package/dist/llms/components/popover.md +600 -0
  396. package/dist/llms/components/portal-settings.md +371 -0
  397. package/dist/llms/components/progress-bar.md +175 -0
  398. package/dist/llms/components/progress-indicator.md +399 -0
  399. package/dist/llms/components/progress-ring.md +146 -0
  400. package/dist/llms/components/radio-button-group.md +285 -0
  401. package/dist/llms/components/radio-group.md +242 -0
  402. package/dist/llms/components/radio.md +269 -0
  403. package/dist/llms/components/scoped-notification.md +156 -0
  404. package/dist/llms/components/setup-assistant.md +398 -0
  405. package/dist/llms/components/simple-data-table.examples.md +2773 -0
  406. package/dist/llms/components/simple-data-table.md +919 -0
  407. package/dist/llms/components/slider.md +217 -0
  408. package/dist/llms/components/spinner.md +232 -0
  409. package/dist/llms/components/split-view.md +350 -0
  410. package/dist/llms/components/tabs.md +311 -0
  411. package/dist/llms/components/textarea.md +331 -0
  412. package/dist/llms/components/toast.md +267 -0
  413. package/dist/llms/components/tooltip.md +470 -0
  414. package/dist/llms/components/tree.md +1011 -0
  415. package/dist/llms/components/trial-bar.md +383 -0
  416. package/dist/llms/components/vertical-navigation.md +196 -0
  417. package/dist/llms/components/visual-picker.md +362 -0
  418. package/dist/llms/components/welcome-mat.md +885 -0
  419. package/dist/llms/docs/migration-v11.md +471 -0
  420. package/dist/llms/llms-full.txt +6874 -0
  421. package/dist/llms/llms.txt +133 -0
  422. package/dist/llms/rules.md +36 -0
  423. package/dist/types/components/accordion/index.d.ts.map +1 -1
  424. package/dist/types/components/accordion/panel.d.ts +7 -7
  425. package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
  426. package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
  427. package/dist/types/components/builder-header/nav-link.d.ts +0 -1
  428. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  429. package/dist/types/components/builder-header/toolbar.d.ts +0 -1
  430. package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
  431. package/dist/types/components/button/index.d.ts +19 -6
  432. package/dist/types/components/button/index.d.ts.map +1 -1
  433. package/dist/types/components/button-stateful/index.d.ts +8 -2
  434. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  435. package/dist/types/components/carousel/index.d.ts +7 -1
  436. package/dist/types/components/carousel/index.d.ts.map +1 -1
  437. package/dist/types/components/checkbox/index.d.ts +22 -5
  438. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  439. package/dist/types/components/color-picker/color-picker.d.ts +6 -4
  440. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  441. package/dist/types/components/color-picker/types.d.ts +2 -2
  442. package/dist/types/components/combobox/combobox.d.ts +22 -0
  443. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  444. package/dist/types/components/combobox/index.d.ts +1 -1
  445. package/dist/types/components/combobox/index.d.ts.map +1 -1
  446. package/dist/types/components/date-picker/date-picker.d.ts +16 -4
  447. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  448. package/dist/types/components/date-picker/index.d.ts +2 -6
  449. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  450. package/dist/types/components/files/file.d.ts +5 -0
  451. package/dist/types/components/files/file.d.ts.map +1 -1
  452. package/dist/types/components/icon/index.d.ts +8 -1
  453. package/dist/types/components/icon/index.d.ts.map +1 -1
  454. package/dist/types/components/icon/input-icon/index.d.ts +3 -0
  455. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  456. package/dist/types/components/icon-settings/index.d.ts.map +1 -1
  457. package/dist/types/components/input/index.d.ts +10 -6
  458. package/dist/types/components/input/index.d.ts.map +1 -1
  459. package/dist/types/components/input/search.d.ts.map +1 -1
  460. package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
  461. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  462. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +13 -3
  463. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  464. package/dist/types/components/modal/index.d.ts +5 -5
  465. package/dist/types/components/modal/index.d.ts.map +1 -1
  466. package/dist/types/components/page-header/types.d.ts +3 -0
  467. package/dist/types/components/page-header/types.d.ts.map +1 -1
  468. package/dist/types/components/panel/filtering/group.d.ts +2 -0
  469. package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
  470. package/dist/types/components/pill/index.d.ts +1 -0
  471. package/dist/types/components/pill/index.d.ts.map +1 -1
  472. package/dist/types/components/popover/edit-dialog.d.ts +1 -3
  473. package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
  474. package/dist/types/components/popover/index.d.ts.map +1 -1
  475. package/dist/types/components/popover/popover.d.ts +1 -0
  476. package/dist/types/components/popover/popover.d.ts.map +1 -1
  477. package/dist/types/components/progress-indicator/index.d.ts +1 -0
  478. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  479. package/dist/types/components/progress-ring/index.d.ts +1 -0
  480. package/dist/types/components/progress-ring/index.d.ts.map +1 -1
  481. package/dist/types/components/radio/index.d.ts +11 -4
  482. package/dist/types/components/radio/index.d.ts.map +1 -1
  483. package/dist/types/components/radio-group/index.d.ts +5 -3
  484. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  485. package/dist/types/components/scoped-notification/index.d.ts +1 -0
  486. package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
  487. package/dist/types/components/setup-assistant/step.d.ts +0 -1
  488. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  489. package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
  490. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  491. package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
  492. package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
  493. package/dist/types/components/simple-data-table/types.d.ts +11 -2
  494. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  495. package/dist/types/components/slider/index.d.ts +6 -4
  496. package/dist/types/components/slider/index.d.ts.map +1 -1
  497. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  498. package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
  499. package/dist/types/components/tabs/index.d.ts +1 -0
  500. package/dist/types/components/tabs/index.d.ts.map +1 -1
  501. package/dist/types/components/tabs/panel.d.ts +2 -1
  502. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  503. package/dist/types/components/textarea/index.d.ts +12 -40
  504. package/dist/types/components/textarea/index.d.ts.map +1 -1
  505. package/dist/types/components/toast/index.d.ts.map +1 -1
  506. package/dist/types/components/tooltip/index.d.ts +5 -0
  507. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  508. package/dist/types/components/tree/tree.d.ts +5 -0
  509. package/dist/types/components/tree/tree.d.ts.map +1 -1
  510. package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
  511. package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
  512. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  513. package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
  514. package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
  515. package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
  516. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  517. package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
  518. package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
  519. package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
  520. package/dist/types/types/common.d.ts.map +1 -1
  521. package/dist/types/types/components.d.ts.map +1 -1
  522. package/package.json +9 -7
  523. package/dist/cjs/icons/action/index.cjs +0 -2
  524. package/dist/cjs/icons/action/index.cjs.map +0 -1
  525. package/dist/cjs/icons/custom/index.cjs +0 -2
  526. package/dist/cjs/icons/custom/index.cjs.map +0 -1
  527. package/dist/cjs/icons/doctype/index.cjs +0 -2
  528. package/dist/cjs/icons/doctype/index.cjs.map +0 -1
  529. package/dist/cjs/icons/standard/index.cjs +0 -2
  530. package/dist/cjs/icons/standard/index.cjs.map +0 -1
  531. package/dist/cjs/icons/utility/index.cjs +0 -2
  532. package/dist/cjs/icons/utility/index.cjs.map +0 -1
  533. package/dist/es/icons/action/index.js +0 -6
  534. package/dist/es/icons/action/index.js.map +0 -1
  535. package/dist/es/icons/custom/index.js +0 -6
  536. package/dist/es/icons/custom/index.js.map +0 -1
  537. package/dist/es/icons/doctype/index.js +0 -6
  538. package/dist/es/icons/doctype/index.js.map +0 -1
  539. package/dist/es/icons/standard/index.js +0 -6
  540. package/dist/es/icons/standard/index.js.map +0 -1
  541. package/dist/es/icons/utility/index.js +0 -6
  542. package/dist/es/icons/utility/index.js.map +0 -1
  543. package/dist/types/icons/action/index.d.ts +0 -3
  544. package/dist/types/icons/action/index.d.ts.map +0 -1
  545. package/dist/types/icons/custom/index.d.ts +0 -3
  546. package/dist/types/icons/custom/index.d.ts.map +0 -1
  547. package/dist/types/icons/doctype/index.d.ts +0 -3
  548. package/dist/types/icons/doctype/index.d.ts.map +0 -1
  549. package/dist/types/icons/standard/index.d.ts +0 -3
  550. package/dist/types/icons/standard/index.d.ts.map +0 -1
  551. package/dist/types/icons/utility/index.d.ts +0 -3
  552. package/dist/types/icons/utility/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/progress-indicator/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\tuseCallback,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\ttype ReactNode,\n} from 'react';\nimport { PROGRESS_INDICATOR } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\n// Child components\nimport Step from './private/step';\nimport Progress from './private/progress';\nimport StepVertical from './private/step-vertical';\nimport Path from './private/path';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\n\n/**\n * Progress indicator orientation\n */\nexport type ProgressIndicatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Progress indicator type\n */\nexport type ProgressIndicatorType = 'base' | 'path';\n\n/**\n * Progress indicator variant\n */\nexport type ProgressIndicatorVariant =\n\t'base' | 'modal' | 'setup-assistant' | 'shade';\n\n/**\n * Tooltip position\n */\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Status of a single step. A step has at most one status.\n */\nexport type ProgressStepStatus = 'completed' | 'disabled' | 'error';\n\n/**\n * Step object structure\n */\nexport interface ProgressStep {\n\t/** Unique identifier. Steps are matched by `id`. */\n\tid: string | number;\n\t/**\n\t * Status of the step. A step has one status, so it cannot be both `error` and `completed`.\n\t * `disabled` and `error` apply to `type=\"base\"` only; `type=\"path\"` shows `completed`.\n\t */\n\tstatus?: ProgressStepStatus;\n\t/** Tooltip label */\n\tlabel: string;\n\t/** Optional assistive text override */\n\tassistiveText?: string;\n\t/** Action shown next to the step label. Only used by the `setup-assistant` variant. */\n\tsetupAssistantAction?: ReactNode;\n\t/** Estimated time shown next to the step label. Only used by the `setup-assistant` variant. */\n\tsetupAssistantEstimatedTime?: ReactNode;\n\t/** @deprecated Use `setupAssistantAction` instead. */\n\tonRenderSetupAssistantAction?: ReactNode;\n}\n\n/**\n * Assistive text for ProgressIndicator\n */\nexport interface ProgressIndicatorAssistiveText {\n\t/** `type=\"path\"` only: read before a completed stage's name. Defaults to `Stage Complete` */\n\tcompletedStage?: string;\n\t/** Label for completed steps */\n\tcompletedStep?: string;\n\t/** `type=\"path\"` only: read before the current stage's name. Defaults to `Current Stage:` */\n\tcurrentStage?: string;\n\t/** Label for disabled steps */\n\tdisabledStep?: string;\n\t/** Label for error steps */\n\terrorStep?: string;\n\t/** Label for progress percentage */\n\tpercentage?: string;\n\t/** Label prefix for steps */\n\tstep?: string;\n}\n\n/**\n * Text labels for ProgressIndicator\n */\nexport interface ProgressIndicatorLabels {\n\t/** `type=\"path\"` only: text before the current stage's name, which shows when the path collapses on narrow screens. Include any spacing between it and the name. Defaults to `Stage: ` */\n\tstageNameBefore?: React.ReactNode;\n\t/** `type=\"path\"` only: text after the current stage's name. Include any spacing between it and the name. */\n\tstageNameAfter?: React.ReactNode;\n}\n\n/**\n * Step event data\n */\nexport interface StepEventData {\n\tisCompleted: boolean;\n\tisDisabled: boolean;\n\tisError: boolean;\n\tisSelected: boolean;\n\tstep: ProgressStep;\n}\n\n/** Props every ProgressIndicator takes. */\ninterface ProgressIndicatorBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Set `status: 'completed'` on the step. Matched by `id`. */\n\tcompletedSteps?: ProgressStep[];\n\t/** HTML id attribute */\n\tid?: string;\n\t/** **Text labels for internationalization** */\n\tlabels?: ProgressIndicatorLabels;\n\t/** Click handler for steps */\n\tonStepClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: StepEventData\n\t) => void;\n\t/** Focus handler for steps */\n\tonStepFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/**\n\t * Currently selected step: the `id` of one of the `steps` (a step object is also accepted and\n\t * matched by its `id`; one without an `id` is matched by its content, which is deprecated). The\n\t * first step is selected when nothing matches.\n\t */\n\tselectedStep: ProgressStep | ProgressStep['id'];\n\t/** Array of all steps */\n\tsteps: ProgressStep[];\n}\n\n/** Props of the step markers on a progress bar: `type=\"base\"`, any variant. */\ninterface ProgressIndicatorMarkerProps {\n\t/** @deprecated Set `status: 'disabled'` on the step. Matched by `id`. */\n\tdisabledSteps?: ProgressStep[];\n\t/** @deprecated Set `status: 'error'` on the step. Matched by `id`. */\n\terrorSteps?: ProgressStep[];\n\t/** Steps with open tooltips (for development). */\n\ttooltipIsOpenSteps?: ProgressStep[];\n\t/** Tooltip position strategy. */\n\ttooltipPosition?: TooltipPosition;\n}\n\n/**\n * Step markers on a progress bar, with each step's label in a tooltip.\n * * `base` - (default) For white backgrounds.\n * * `shade` - For shaded backgrounds. Adds a light gray border to the step markers, like `variant=\"shade\"` on `lightning-progress-indicator`.\n * * `modal` - The `shade` styling, with tooltips positioned for a modal footer.\n */\ninterface ProgressIndicatorBarProps\n\textends ProgressIndicatorBaseProps, ProgressIndicatorMarkerProps {\n\t/**\n\t * Visual pattern, like `type` on `lightning-progress-indicator`.\n\t * * `base` - (default) Step markers on a progress bar.\n\t */\n\ttype?: 'base';\n\t/** Component variant. */\n\tvariant?: Exclude<ProgressIndicatorVariant, 'setup-assistant'>;\n\t/** Orientation (horizontal or vertical). */\n\torientation?: ProgressIndicatorOrientation;\n}\n\n/** Vertical steps with a bordered list, for Setup Assistant. Always vertical. */\ninterface ProgressIndicatorSetupAssistantProps\n\textends ProgressIndicatorBaseProps, ProgressIndicatorMarkerProps {\n\ttype?: 'base';\n\t/** Vertical steps with a bordered list, for Setup Assistant. */\n\tvariant: 'setup-assistant';\n\t/** Setup Assistant is always vertical. */\n\torientation?: 'vertical';\n}\n\n/**\n * SLDS Path, with each step's label shown in its stage. Use the arrow keys to\n * move between stages. Completion comes from `status: 'completed'`; there are no\n * error, disabled, tooltip, orientation or variant props.\n */\ninterface ProgressIndicatorPathProps extends ProgressIndicatorBaseProps {\n\t/** Visual pattern: SLDS Path, with each step's label shown in its stage. */\n\ttype: 'path';\n\tdisabledSteps?: never;\n\terrorSteps?: never;\n\torientation?: never;\n\ttooltip?: never;\n\ttooltipIsOpenSteps?: never;\n\ttooltipPosition?: never;\n\tvariant?: never;\n}\n\n/**\n * Props for the ProgressIndicator component: a union on `type` and `variant`,\n * so a prop that a pattern ignores (or `orientation` that Setup Assistant\n * overrides) does not compile.\n */\nexport type ProgressIndicatorProps =\n\t| ProgressIndicatorBarProps\n\t| ProgressIndicatorSetupAssistantProps\n\t| ProgressIndicatorPathProps;\n\nconst defaultSteps: ProgressStep[] = [\n\t{ id: 0, label: 'tooltip label #1' },\n\t{ id: 1, label: 'tooltip label #2' },\n\t{ id: 2, label: 'tooltip label #3' },\n\t{ id: 3, label: 'tooltip label #4' },\n\t{ id: 4, label: 'tooltip label #5' },\n];\n\nconst defaultAssistiveText: ProgressIndicatorAssistiveText = {\n\tcompletedStage: 'Stage Complete',\n\tcompletedStep: 'Completed',\n\tcurrentStage: 'Current Stage:',\n\tdisabledStep: 'Disabled',\n\terrorStep: 'Error',\n\tstep: 'Step',\n};\n\nconst defaultLabels: ProgressIndicatorLabels = {\n\tstageNameBefore: 'Stage: ',\n};\n\n/**\n * Check if steps prop is valid\n */\nfunction checkSteps(steps?: ProgressStep[]): boolean {\n\tif (!steps) return false;\n\treturn (\n\t\tArray.isArray(steps) && steps.every((step) => step.label !== undefined)\n\t);\n}\n\n/**\n * Check if a step is one of the items, matching by `id`\n */\nfunction findStep(\n\titem: ProgressStep | undefined,\n\titems: ProgressStep | ProgressStep[] | undefined\n): boolean {\n\tif (!item || !items) return false;\n\n\tconst itemsArray = Array.isArray(items) ? items : [items];\n\n\treturn itemsArray.some((arrayItem) => arrayItem.id === item.id);\n}\n\n/**\n * Progress Indicator communicates to the user the progress of a particular process.\n */\nconst ProgressIndicator = (\n\tprops: ProgressIndicatorProps\n): React.ReactElement => {\n\tconst {\n\t\tassistiveText: propAssistiveText,\n\t\tclassName,\n\t\tcompletedSteps: propCompletedSteps,\n\t\tdisabledSteps: propDisabledSteps,\n\t\terrorSteps: propErrorSteps,\n\t\tid: propId,\n\t\tlabels: propLabels,\n\t\torientation: propOrientation = 'horizontal',\n\t\tonStepClick = () => {},\n\t\tonStepFocus = () => {},\n\t\tselectedStep,\n\t\tsteps: propSteps,\n\t\ttooltipIsOpenSteps,\n\t\ttooltipPosition: propTooltipPosition,\n\t\ttype = 'base',\n\t\tvariant = 'base',\n\t} = props as ProgressIndicatorBaseProps &\n\t\tProgressIndicatorMarkerProps & {\n\t\t\torientation?: ProgressIndicatorOrientation;\n\t\t\ttype?: ProgressIndicatorType;\n\t\t\tvariant?: ProgressIndicatorVariant;\n\t\t};\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst hasValidSteps = checkSteps(propSteps);\n\tconst allSteps = hasValidSteps ? propSteps : defaultSteps;\n\tconst completedSteps = propCompletedSteps ?? [];\n\t// A step's own `status` wins over the deprecated arrays. It is one status, so it excludes the others.\n\tconst getStatusFlags = (step: ProgressStep) =>\n\t\tstep.status === undefined\n\t\t\t? {\n\t\t\t\t\tisCompleted: findStep(step, completedSteps),\n\t\t\t\t\tisDisabled: findStep(step, propDisabledSteps),\n\t\t\t\t\tisError: findStep(step, propErrorSteps),\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tisCompleted: step.status === 'completed',\n\t\t\t\t\tisDisabled: step.status === 'disabled',\n\t\t\t\t\tisError: step.status === 'error',\n\t\t\t\t};\n\tconst selectedStepId =\n\t\ttypeof selectedStep === 'object' ? selectedStep?.id : selectedStep;\n\t// A step object without an `id` is matched the 0.10.x way, by its whole content.\n\tconst selectedStepWithoutId =\n\t\ttypeof selectedStep === 'object' && selectedStep?.id === undefined\n\t\t\t? JSON.stringify(selectedStep)\n\t\t\t: undefined;\n\tconst isSelectedStep = useCallback(\n\t\t(step: ProgressStep) =>\n\t\t\tselectedStepWithoutId === undefined\n\t\t\t\t? step.id === selectedStepId\n\t\t\t\t: JSON.stringify(step) === selectedStepWithoutId,\n\t\t[selectedStepId, selectedStepWithoutId]\n\t);\n\n\t// Check props in development. Pass whether each step array has items, not the array itself, so that\n\t// an empty array doesn't count as passed and a new array on each render doesn't re-run the check.\n\tconst hasDisabledSteps = Boolean(propDisabledSteps?.length);\n\tconst hasErrorSteps = Boolean(propErrorSteps?.length);\n\tconst hasDeprecatedCompletedSteps = Boolean(propCompletedSteps?.length);\n\tconst hasInvalidSteps = propSteps !== undefined && !hasValidSteps;\n\tconst hasTooltipIsOpenSteps = Boolean(tooltipIsOpenSteps?.length);\n\tconst hasSelectedStepWithoutId = selectedStepWithoutId !== undefined;\n\tconst hasDeprecatedSetupAssistantAction = Boolean(\n\t\tpropSteps?.some((step) => step?.onRenderSetupAssistantAction !== undefined)\n\t);\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPROGRESS_INDICATOR,\n\t\t\t{\n\t\t\t\tdisabledSteps: hasDisabledSteps,\n\t\t\t\terrorSteps: hasErrorSteps,\n\t\t\t\thasDeprecatedCompletedSteps,\n\t\t\t\thasInvalidSteps,\n\t\t\t\thasSelectedStepWithoutId,\n\t\t\t\thasDeprecatedSetupAssistantAction,\n\t\t\t\torientation: propOrientation,\n\t\t\t\ttooltipIsOpenSteps: hasTooltipIsOpenSteps,\n\t\t\t\ttooltipPosition: propTooltipPosition,\n\t\t\t\ttype,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, [\n\t\thasDisabledSteps,\n\t\thasErrorSteps,\n\t\thasDeprecatedCompletedSteps,\n\t\thasInvalidSteps,\n\t\thasSelectedStepWithoutId,\n\t\thasDeprecatedSetupAssistantAction,\n\t\thasTooltipIsOpenSteps,\n\t\tpropOrientation,\n\t\tpropTooltipPosition,\n\t\ttype,\n\t\tvariant,\n\t]);\n\n\t// Find current step index\n\tconst currentStepIndex = useMemo(() => {\n\t\tlet index = 0;\n\t\tfor (let i = 0; i < allSteps.length; i += 1) {\n\t\t\tif (isSelectedStep(allSteps[i])) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}, [allSteps, isSelectedStep]);\n\n\tif (type === 'path') {\n\t\treturn (\n\t\t\t<Path\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tclassName={className}\n\t\t\t\tselectedIndex={currentStepIndex}\n\t\t\t\tid={id}\n\t\t\t\tlabels={{ ...defaultLabels, ...propLabels }}\n\t\t\t\tonStepClick={onStepClick}\n\t\t\t\tonStepFocus={onStepFocus}\n\t\t\t\tsteps={allSteps.map((step) => ({\n\t\t\t\t\tisCompleted: getStatusFlags(step).isCompleted,\n\t\t\t\t\tisSelected: isSelectedStep(step),\n\t\t\t\t\tstep,\n\t\t\t\t}))}\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Calculate progress value\n\tconst progressValue =\n\t\tcurrentStepIndex === 0\n\t\t\t? '0'\n\t\t\t: `${100 * (currentStepIndex / (allSteps.length - 1))}`;\n\n\t// Determine orientation\n\tconst orientation =\n\t\tvariant === 'setup-assistant' ? 'vertical' : propOrientation;\n\n\t// Determine tooltip position\n\tconst tooltipPosition =\n\t\tpropTooltipPosition ||\n\t\t(variant === 'modal' ? 'absolute' : 'overflowBoundaryElement');\n\n\t// Select step component based on orientation\n\tconst StepComponent = (\n\t\torientation === 'vertical' ? StepVertical : Step\n\t) as React.ComponentType<\n\t\tReact.ComponentProps<typeof Step> &\n\t\t\tReact.ComponentProps<typeof StepVertical>\n\t>;\n\n\treturn (\n\t\t<Progress\n\t\t\tassistiveText={assistiveText}\n\t\t\tid={id}\n\t\t\torientation={orientation}\n\t\t\tvalue={progressValue}\n\t\t\tvariant={variant}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{allSteps.map((step, i) => (\n\t\t\t\t<StepComponent\n\t\t\t\t\tkey={`${id}-${step.id}`}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={id}\n\t\t\t\t\tindex={i}\n\t\t\t\t\tisSelected={isSelectedStep(step)}\n\t\t\t\t\tisDisabled={getStatusFlags(step).isDisabled}\n\t\t\t\t\tisError={getStatusFlags(step).isError}\n\t\t\t\t\tisCompleted={getStatusFlags(step).isCompleted}\n\t\t\t\t\tonClick={onStepClick}\n\t\t\t\t\tonFocus={onStepFocus}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttooltipIsOpen={findStep(step, tooltipIsOpenSteps)}\n\t\t\t\t\ttooltipPosition={tooltipPosition}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Progress>\n\t);\n};\n\nProgressIndicator.displayName = PROGRESS_INDICATOR;\n\nexport default ProgressIndicator;\n"],"mappings":"sdAkNA,IAAM,EAA+B,CACpC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,CACpC,EAEM,EAAuD,CAC5D,eAAgB,iBAChB,cAAe,YACf,aAAc,iBACd,aAAc,WACd,UAAW,QACX,KAAM,MACP,EAEM,EAAyC,CAC9C,gBAAiB,SAClB,EAKA,SAAS,EAAW,EAAiC,CAEpD,OADK,EAEJ,MAAM,QAAQ,CAAK,GAAK,EAAM,MAAO,GAAS,EAAK,QAAU,IAAA,EAAS,EAFpD,EAIpB,CAKA,SAAS,EACR,EACA,EACU,CAKV,MAJI,CAAC,GAAQ,CAAC,EAAc,IAET,MAAM,QAAQ,CAAK,EAAI,EAAQ,CAAC,CAAK,EAAA,CAEtC,KAAM,GAAc,EAAU,KAAO,EAAK,EAAE,CAC/D,CAKA,IAAM,EACL,GACwB,CACxB,GAAM,CACL,cAAe,EACf,YACA,eAAgB,EAChB,cAAe,EACf,WAAY,EACZ,GAAI,EACJ,OAAQ,EACR,YAAa,EAAkB,aAC/B,kBAAoB,CAAC,EACrB,kBAAoB,CAAC,EACrB,eACA,MAAO,EACP,qBACA,gBAAiB,EACjB,OAAO,OACP,UAAU,QACP,EAME,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,EAEf,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAgB,EAAW,CAAS,EACpC,EAAW,EAAgB,EAAY,EACvC,EAAiB,GAAsB,CAAC,EAExC,EAAkB,GACvB,EAAK,SAA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AAA,QAAD,CACgB,gBACJ,YACX,cAAe,EACX,KACJ,OAAQ,CAAE,GAAG,EAAe,GAAG,CAAW,EAC7B,cACA,cACb,MAAO,EAAS,IAAK,IAAU,CAC9B,YAAa,EAAe,CAAI,CAAC,CAAC,YAClC,WAAY,EAAe,CAAI,EAC/B,MACD,EAAE,CACF,CAAA,EAKH,IAAM,EACL,IAAqB,EAClB,IACA,GAAG,KAAO,GAAoB,EAAS,OAAS,MAG9C,EACL,IAAY,kBAAoB,WAAa,EAGxC,EACL,IACC,IAAY,QAAU,WAAa,2BAG/B,EACL,IAAgB,WAAa,EAAA,QAAe,EAAA,QAM7C,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACX,KACS,cACb,MAAO,EACE,UACE,YAEV,SAAA,EAAS,KAAK,EAAM,KACpB,EAAA,EAAA,IAAA,CAAC,EAAD,CAEgB,gBACX,KACJ,MAAO,EACP,WAAY,EAAe,CAAI,EAC/B,WAAY,EAAe,CAAI,CAAC,CAAC,WACjC,QAAS,EAAe,CAAI,CAAC,CAAC,QAC9B,YAAa,EAAe,CAAI,CAAC,CAAC,YAClC,QAAS,EACT,QAAS,EACH,OACN,cAAe,EAAS,EAAM,CAAkB,EAC/B,kBACR,SACT,EAdK,GAAG,EAAG,GAAG,EAAK,IAcnB,CACD,CACQ,CAAA,CAEZ,EAEA,EAAkB,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/progress-indicator/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\tuseCallback,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\ttype ReactNode,\n} from 'react';\nimport { PROGRESS_INDICATOR } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\n// Child components\nimport Step from './private/step';\nimport Progress from './private/progress';\nimport StepVertical from './private/step-vertical';\nimport Path from './private/path';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\n\n/**\n * Progress indicator orientation\n */\nexport type ProgressIndicatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Progress indicator type\n */\nexport type ProgressIndicatorType = 'base' | 'path';\n\n/**\n * Progress indicator variant\n */\nexport type ProgressIndicatorVariant =\n\t'base' | 'modal' | 'setup-assistant' | 'shade';\n\n/**\n * Tooltip position\n */\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Status of a single step. A step has at most one status.\n */\nexport type ProgressStepStatus = 'completed' | 'disabled' | 'error';\n\n/**\n * Step object structure\n */\nexport interface ProgressStep {\n\t/** Unique identifier. Steps are matched by `id`. */\n\tid: string | number;\n\t/**\n\t * Status of the step. A step has one status, so it cannot be both `error` and `completed`.\n\t * `disabled` and `error` apply to `type=\"base\"` only; `type=\"path\"` shows `completed`.\n\t */\n\tstatus?: ProgressStepStatus;\n\t/** Tooltip label */\n\tlabel: string;\n\t/** Optional assistive text override */\n\tassistiveText?: string;\n\t/** Action shown next to the step label. Only used by the `setup-assistant` variant. */\n\tsetupAssistantAction?: ReactNode;\n\t/** Estimated time shown next to the step label. Only used by the `setup-assistant` variant. */\n\tsetupAssistantEstimatedTime?: ReactNode;\n\t/** @deprecated Use `setupAssistantAction` instead. */\n\tonRenderSetupAssistantAction?: ReactNode;\n}\n\n/**\n * Assistive text for ProgressIndicator\n */\nexport interface ProgressIndicatorAssistiveText {\n\t/** `type=\"path\"` only: read before a completed stage's name. Defaults to `Stage Complete` */\n\tcompletedStage?: string;\n\t/** Label for completed steps */\n\tcompletedStep?: string;\n\t/** `type=\"path\"` only: read before the current stage's name. Defaults to `Current Stage:` */\n\tcurrentStage?: string;\n\t/** Label for disabled steps */\n\tdisabledStep?: string;\n\t/** Label for error steps */\n\terrorStep?: string;\n\t/** Label for progress percentage */\n\tpercentage?: string;\n\t/** Label prefix for steps */\n\tstep?: string;\n}\n\n/**\n * Text labels for ProgressIndicator\n */\nexport interface ProgressIndicatorLabels {\n\t/** `type=\"path\"` only: text before the current stage's name, which shows when the path collapses on narrow screens. Include any spacing between it and the name. Defaults to `Stage: ` */\n\tstageNameBefore?: React.ReactNode;\n\t/** `type=\"path\"` only: text after the current stage's name. Include any spacing between it and the name. */\n\tstageNameAfter?: React.ReactNode;\n}\n\n/**\n * Step event data\n */\nexport interface StepEventData {\n\tisCompleted: boolean;\n\tisDisabled: boolean;\n\tisError: boolean;\n\tisSelected: boolean;\n\tstep: ProgressStep;\n}\n\n/** Props every ProgressIndicator takes. */\ninterface ProgressIndicatorBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Set `status: 'completed'` on the step. Matched by `id`. */\n\tcompletedSteps?: ProgressStep[];\n\t/** HTML id attribute */\n\tid?: string;\n\t/** **Text labels for internationalization** */\n\tlabels?: ProgressIndicatorLabels;\n\t/** Click handler for steps */\n\tonStepClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: StepEventData\n\t) => void;\n\t/** Focus handler for steps */\n\tonStepFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/**\n\t * Currently selected step: the `id` of one of the `steps` (a step object is also accepted and\n\t * matched by its `id`; one without an `id` is matched by its content, which is deprecated). The\n\t * first step is selected when nothing matches.\n\t */\n\tselectedStep: ProgressStep | ProgressStep['id'];\n\t/** Array of all steps */\n\tsteps: ProgressStep[];\n}\n\n/** Props of the step markers on a progress bar: `type=\"base\"`, any variant. */\ninterface ProgressIndicatorMarkerProps {\n\t/** @deprecated Set `status: 'disabled'` on the step. Matched by `id`. */\n\tdisabledSteps?: ProgressStep[];\n\t/** @deprecated Set `status: 'error'` on the step. Matched by `id`. */\n\terrorSteps?: ProgressStep[];\n\t/** Steps with open tooltips (for development). */\n\ttooltipIsOpenSteps?: ProgressStep[];\n\t/** Tooltip position strategy. */\n\ttooltipPosition?: TooltipPosition;\n}\n\n/**\n * Step markers on a progress bar, with each step's label in a tooltip.\n * * `base` - (default) For white backgrounds.\n * * `shade` - For shaded backgrounds. Adds a light gray border to the step markers, like `variant=\"shade\"` on `lightning-progress-indicator`.\n * * `modal` - The `shade` styling, with tooltips positioned for a modal footer.\n */\ninterface ProgressIndicatorBarProps\n\textends ProgressIndicatorBaseProps, ProgressIndicatorMarkerProps {\n\t/**\n\t * Visual pattern, like `type` on `lightning-progress-indicator`.\n\t * * `base` - (default) Step markers on a progress bar.\n\t */\n\ttype?: 'base';\n\t/** Component variant. */\n\tvariant?: Exclude<ProgressIndicatorVariant, 'setup-assistant'>;\n\t/** Orientation (horizontal or vertical). */\n\torientation?: ProgressIndicatorOrientation;\n}\n\n/** Vertical steps with a bordered list, for Setup Assistant. Always vertical. */\ninterface ProgressIndicatorSetupAssistantProps\n\textends ProgressIndicatorBaseProps, ProgressIndicatorMarkerProps {\n\t/** Visual pattern. Setup Assistant uses the base progress indicator. */\n\ttype?: 'base';\n\t/** Vertical steps with a bordered list, for Setup Assistant. */\n\tvariant: 'setup-assistant';\n\t/** Setup Assistant is always vertical. */\n\torientation?: 'vertical';\n}\n\n/**\n * SLDS Path, with each step's label shown in its stage. Use the arrow keys to\n * move between stages. Completion comes from `status: 'completed'`; there are no\n * error, disabled, tooltip, orientation or variant props.\n */\ninterface ProgressIndicatorPathProps extends ProgressIndicatorBaseProps {\n\t/** Visual pattern: SLDS Path, with each step's label shown in its stage. */\n\ttype: 'path';\n\tdisabledSteps?: never;\n\terrorSteps?: never;\n\torientation?: never;\n\ttooltip?: never;\n\ttooltipIsOpenSteps?: never;\n\ttooltipPosition?: never;\n\tvariant?: never;\n}\n\n/**\n * Props for the ProgressIndicator component: a union on `type` and `variant`,\n * so a prop that a pattern ignores (or `orientation` that Setup Assistant\n * overrides) does not compile.\n */\nexport type ProgressIndicatorProps =\n\t| ProgressIndicatorBarProps\n\t| ProgressIndicatorSetupAssistantProps\n\t| ProgressIndicatorPathProps;\n\nconst defaultSteps: ProgressStep[] = [\n\t{ id: 0, label: 'tooltip label #1' },\n\t{ id: 1, label: 'tooltip label #2' },\n\t{ id: 2, label: 'tooltip label #3' },\n\t{ id: 3, label: 'tooltip label #4' },\n\t{ id: 4, label: 'tooltip label #5' },\n];\n\nconst defaultAssistiveText: ProgressIndicatorAssistiveText = {\n\tcompletedStage: 'Stage Complete',\n\tcompletedStep: 'Completed',\n\tcurrentStage: 'Current Stage:',\n\tdisabledStep: 'Disabled',\n\terrorStep: 'Error',\n\tstep: 'Step',\n};\n\nconst defaultLabels: ProgressIndicatorLabels = {\n\tstageNameBefore: 'Stage: ',\n};\n\n/**\n * Check if steps prop is valid\n */\nfunction checkSteps(steps?: ProgressStep[]): boolean {\n\tif (!steps) return false;\n\treturn (\n\t\tArray.isArray(steps) && steps.every((step) => step.label !== undefined)\n\t);\n}\n\n/**\n * Check if a step is one of the items, matching by `id`\n */\nfunction findStep(\n\titem: ProgressStep | undefined,\n\titems: ProgressStep | ProgressStep[] | undefined\n): boolean {\n\tif (!item || !items) return false;\n\n\tconst itemsArray = Array.isArray(items) ? items : [items];\n\n\treturn itemsArray.some((arrayItem) => arrayItem.id === item.id);\n}\n\n/**\n * Progress Indicator communicates to the user the progress of a particular process.\n */\nconst ProgressIndicator = (\n\tprops: ProgressIndicatorProps\n): React.ReactElement => {\n\tconst {\n\t\tassistiveText: propAssistiveText,\n\t\tclassName,\n\t\tcompletedSteps: propCompletedSteps,\n\t\tdisabledSteps: propDisabledSteps,\n\t\terrorSteps: propErrorSteps,\n\t\tid: propId,\n\t\tlabels: propLabels,\n\t\torientation: propOrientation = 'horizontal',\n\t\tonStepClick = () => {},\n\t\tonStepFocus = () => {},\n\t\tselectedStep,\n\t\tsteps: propSteps,\n\t\ttooltipIsOpenSteps,\n\t\ttooltipPosition: propTooltipPosition,\n\t\ttype = 'base',\n\t\tvariant = 'base',\n\t} = props as ProgressIndicatorBaseProps &\n\t\tProgressIndicatorMarkerProps & {\n\t\t\torientation?: ProgressIndicatorOrientation;\n\t\t\ttype?: ProgressIndicatorType;\n\t\t\tvariant?: ProgressIndicatorVariant;\n\t\t};\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst hasValidSteps = checkSteps(propSteps);\n\tconst allSteps = hasValidSteps ? propSteps : defaultSteps;\n\tconst completedSteps = propCompletedSteps ?? [];\n\t// A step's own `status` wins over the deprecated arrays. It is one status, so it excludes the others.\n\tconst getStatusFlags = (step: ProgressStep) =>\n\t\tstep.status === undefined\n\t\t\t? {\n\t\t\t\t\tisCompleted: findStep(step, completedSteps),\n\t\t\t\t\tisDisabled: findStep(step, propDisabledSteps),\n\t\t\t\t\tisError: findStep(step, propErrorSteps),\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tisCompleted: step.status === 'completed',\n\t\t\t\t\tisDisabled: step.status === 'disabled',\n\t\t\t\t\tisError: step.status === 'error',\n\t\t\t\t};\n\tconst selectedStepId =\n\t\ttypeof selectedStep === 'object' ? selectedStep?.id : selectedStep;\n\t// A step object without an `id` is matched the 0.10.x way, by its whole content.\n\tconst selectedStepWithoutId =\n\t\ttypeof selectedStep === 'object' && selectedStep?.id === undefined\n\t\t\t? JSON.stringify(selectedStep)\n\t\t\t: undefined;\n\tconst isSelectedStep = useCallback(\n\t\t(step: ProgressStep) =>\n\t\t\tselectedStepWithoutId === undefined\n\t\t\t\t? step.id === selectedStepId\n\t\t\t\t: JSON.stringify(step) === selectedStepWithoutId,\n\t\t[selectedStepId, selectedStepWithoutId]\n\t);\n\n\t// Check props in development. Pass whether each step array has items, not the array itself, so that\n\t// an empty array doesn't count as passed and a new array on each render doesn't re-run the check.\n\tconst hasDisabledSteps = Boolean(propDisabledSteps?.length);\n\tconst hasErrorSteps = Boolean(propErrorSteps?.length);\n\tconst hasDeprecatedCompletedSteps = Boolean(propCompletedSteps?.length);\n\tconst hasInvalidSteps = propSteps !== undefined && !hasValidSteps;\n\tconst hasTooltipIsOpenSteps = Boolean(tooltipIsOpenSteps?.length);\n\tconst hasSelectedStepWithoutId = selectedStepWithoutId !== undefined;\n\tconst hasDeprecatedSetupAssistantAction = Boolean(\n\t\tpropSteps?.some((step) => step?.onRenderSetupAssistantAction !== undefined)\n\t);\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPROGRESS_INDICATOR,\n\t\t\t{\n\t\t\t\tdisabledSteps: hasDisabledSteps,\n\t\t\t\terrorSteps: hasErrorSteps,\n\t\t\t\thasDeprecatedCompletedSteps,\n\t\t\t\thasInvalidSteps,\n\t\t\t\thasSelectedStepWithoutId,\n\t\t\t\thasDeprecatedSetupAssistantAction,\n\t\t\t\torientation: propOrientation,\n\t\t\t\ttooltipIsOpenSteps: hasTooltipIsOpenSteps,\n\t\t\t\ttooltipPosition: propTooltipPosition,\n\t\t\t\ttype,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, [\n\t\thasDisabledSteps,\n\t\thasErrorSteps,\n\t\thasDeprecatedCompletedSteps,\n\t\thasInvalidSteps,\n\t\thasSelectedStepWithoutId,\n\t\thasDeprecatedSetupAssistantAction,\n\t\thasTooltipIsOpenSteps,\n\t\tpropOrientation,\n\t\tpropTooltipPosition,\n\t\ttype,\n\t\tvariant,\n\t]);\n\n\t// Find current step index\n\tconst currentStepIndex = useMemo(() => {\n\t\tlet index = 0;\n\t\tfor (let i = 0; i < allSteps.length; i += 1) {\n\t\t\tif (isSelectedStep(allSteps[i])) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}, [allSteps, isSelectedStep]);\n\n\tif (type === 'path') {\n\t\treturn (\n\t\t\t<Path\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tclassName={className}\n\t\t\t\tselectedIndex={currentStepIndex}\n\t\t\t\tid={id}\n\t\t\t\tlabels={{ ...defaultLabels, ...propLabels }}\n\t\t\t\tonStepClick={onStepClick}\n\t\t\t\tonStepFocus={onStepFocus}\n\t\t\t\tsteps={allSteps.map((step) => ({\n\t\t\t\t\tisCompleted: getStatusFlags(step).isCompleted,\n\t\t\t\t\tisSelected: isSelectedStep(step),\n\t\t\t\t\tstep,\n\t\t\t\t}))}\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Calculate progress value\n\tconst progressValue =\n\t\tcurrentStepIndex === 0\n\t\t\t? '0'\n\t\t\t: `${100 * (currentStepIndex / (allSteps.length - 1))}`;\n\n\t// Determine orientation\n\tconst orientation =\n\t\tvariant === 'setup-assistant' ? 'vertical' : propOrientation;\n\n\t// Determine tooltip position\n\tconst tooltipPosition =\n\t\tpropTooltipPosition ||\n\t\t(variant === 'modal' ? 'absolute' : 'overflowBoundaryElement');\n\n\t// Select step component based on orientation\n\tconst StepComponent = (\n\t\torientation === 'vertical' ? StepVertical : Step\n\t) as React.ComponentType<\n\t\tReact.ComponentProps<typeof Step> &\n\t\t\tReact.ComponentProps<typeof StepVertical>\n\t>;\n\n\treturn (\n\t\t<Progress\n\t\t\tassistiveText={assistiveText}\n\t\t\tid={id}\n\t\t\torientation={orientation}\n\t\t\tvalue={progressValue}\n\t\t\tvariant={variant}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{allSteps.map((step, i) => (\n\t\t\t\t<StepComponent\n\t\t\t\t\tkey={`${id}-${step.id}`}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={id}\n\t\t\t\t\tindex={i}\n\t\t\t\t\tisSelected={isSelectedStep(step)}\n\t\t\t\t\tisDisabled={getStatusFlags(step).isDisabled}\n\t\t\t\t\tisError={getStatusFlags(step).isError}\n\t\t\t\t\tisCompleted={getStatusFlags(step).isCompleted}\n\t\t\t\t\tonClick={onStepClick}\n\t\t\t\t\tonFocus={onStepFocus}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttooltipIsOpen={findStep(step, tooltipIsOpenSteps)}\n\t\t\t\t\ttooltipPosition={tooltipPosition}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Progress>\n\t);\n};\n\nProgressIndicator.displayName = PROGRESS_INDICATOR;\n\nexport default ProgressIndicator;\n"],"mappings":"sdAmNA,IAAM,EAA+B,CACpC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,EACnC,CAAE,GAAI,EAAG,MAAO,kBAAmB,CACpC,EAEM,EAAuD,CAC5D,eAAgB,iBAChB,cAAe,YACf,aAAc,iBACd,aAAc,WACd,UAAW,QACX,KAAM,MACP,EAEM,EAAyC,CAC9C,gBAAiB,SAClB,EAKA,SAAS,EAAW,EAAiC,CAEpD,OADK,EAEJ,MAAM,QAAQ,CAAK,GAAK,EAAM,MAAO,GAAS,EAAK,QAAU,IAAA,EAAS,EAFpD,EAIpB,CAKA,SAAS,EACR,EACA,EACU,CAKV,MAJI,CAAC,GAAQ,CAAC,EAAc,IAET,MAAM,QAAQ,CAAK,EAAI,EAAQ,CAAC,CAAK,EAAA,CAEtC,KAAM,GAAc,EAAU,KAAO,EAAK,EAAE,CAC/D,CAKA,IAAM,EACL,GACwB,CACxB,GAAM,CACL,cAAe,EACf,YACA,eAAgB,EAChB,cAAe,EACf,WAAY,EACZ,GAAI,EACJ,OAAQ,EACR,YAAa,EAAkB,aAC/B,kBAAoB,CAAC,EACrB,kBAAoB,CAAC,EACrB,eACA,MAAO,EACP,qBACA,gBAAiB,EACjB,OAAO,OACP,UAAU,QACP,EAME,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,EAEf,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAgB,EAAW,CAAS,EACpC,EAAW,EAAgB,EAAY,EACvC,EAAiB,GAAsB,CAA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,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACJ,YACX,cAAe,EACX,KACJ,OAAQ,CAAE,GAAG,EAAe,GAAG,CAAW,EAC7B,cACA,cACb,MAAO,EAAS,IAAK,IAAU,CAC9B,YAAa,EAAe,CAAI,CAAC,CAAC,YAClC,WAAY,EAAe,CAAI,EAC/B,MACD,EAAE,CACF,CAAA,EAKH,IAAM,EACL,IAAqB,EAClB,IACA,GAAG,KAAO,GAAoB,EAAS,OAAS,MAG9C,EACL,IAAY,kBAAoB,WAAa,EAGxC,EACL,IACC,IAAY,QAAU,WAAa,2BAG/B,EACL,IAAgB,WAAa,EAAA,QAAe,EAAA,QAM7C,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACX,KACS,cACb,MAAO,EACE,UACE,YAEV,SAAA,EAAS,KAAK,EAAM,KACpB,EAAA,EAAA,IAAA,CAAC,EAAD,CAEgB,gBACX,KACJ,MAAO,EACP,WAAY,EAAe,CAAI,EAC/B,WAAY,EAAe,CAAI,CAAC,CAAC,WACjC,QAAS,EAAe,CAAI,CAAC,CAAC,QAC9B,YAAa,EAAe,CAAI,CAAC,CAAC,YAClC,QAAS,EACT,QAAS,EACH,OACN,cAAe,EAAS,EAAM,CAAkB,EAC/B,kBACR,SACT,EAdK,GAAG,EAAG,GAAG,EAAK,IAcnB,CACD,CACQ,CAAA,CAEZ,EAEA,EAAkB,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,EACj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AO,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
+ {"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,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,KA2DJ,OApDmB,EAAM,YAExB,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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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 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/progress-ring/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode } from 'react';\nimport classNames from 'classnames';\nimport { PROGRESS_RING } from '../../utilities/constants';\nimport Icon from '../icon';\nimport ProgressRingShape from './private/ring-shape';\n\n/**\n * Theme options for the progress ring\n */\nexport const THEME_OPTIONS = Object.freeze({\n\tACTIVE: 'active',\n\tWARNING: 'warning',\n\tEXPIRED: 'expired',\n\tCOMPLETE: 'complete',\n} as const);\n\nexport type ProgressRingTheme = 'active' | 'warning' | 'expired' | 'complete';\nexport type ProgressRingFlowDirection = 'drain' | 'fill';\nexport type ProgressRingSize = 'medium' | 'large';\n\n/**\n * CSS classes for each theme\n */\nconst THEME_CLASSES: Record<ProgressRingTheme, string> = {\n\tactive: 'slds-progress-ring_active-step',\n\twarning: 'slds-progress-ring_warning',\n\texpired: 'slds-progress-ring_expired',\n\tcomplete: 'slds-progress-ring_complete',\n};\n\n/**\n * Props shared by every ProgressRing\n */\ninterface ProgressRingBaseProps {\n\t/** HTML id attribute */\n\tid?: string;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Theme applied to the ring */\n\ttheme?: ProgressRingTheme;\n\t/** Progress percentage (0-100) */\n\tvalue: number;\n\t/** Flow direction of progress */\n\tflowDirection?: ProgressRingFlowDirection;\n\t/** Size of the progress ring */\n\tsize?: ProgressRingSize;\n}\n\n/** No icon is rendered, so a custom `icon` would be ignored. */\ninterface ProgressRingWithoutIconProps {\n\thasIcon?: false;\n\ticon?: never;\n}\n\n/** Renders the theme icon, or the custom `icon` when set. */\ninterface ProgressRingWithIconProps {\n\t/** Whether to display the theme icon */\n\thasIcon: true;\n\t/** Custom icon to display instead of the theme icon */\n\ticon?: ReactNode;\n}\n\n/**\n * Props for the ProgressRing component. `icon` is only honored with `hasIcon`,\n * so it is only accepted there.\n */\nexport type ProgressRingProps = ProgressRingBaseProps &\n\t(ProgressRingWithoutIconProps | ProgressRingWithIconProps);\n\n/**\n * Customizable progress ring displaying progress in a circular format.\n */\nconst ProgressRing = ({\n\tid,\n\tclassName,\n\ttheme,\n\ticon: propIcon,\n\thasIcon,\n\tvalue,\n\tflowDirection = 'drain',\n\tsize = 'medium',\n}: ProgressRingProps): React.ReactElement => {\n\t// Get icon based on theme or custom icon\n\tconst getIcon = (): ReactNode => {\n\t\tif (!hasIcon) return null;\n\n\t\tif (propIcon) return propIcon;\n\n\t\tswitch (theme) {\n\t\t\tcase 'warning':\n\t\t\t\treturn <Icon category=\"utility\" name=\"warning\" title=\"Warning\" />;\n\t\t\tcase 'expired':\n\t\t\t\treturn <Icon category=\"utility\" name=\"error\" title=\"Expired\" />;\n\t\t\tcase 'complete':\n\t\t\t\treturn <Icon category=\"utility\" name=\"check\" title=\"Complete\" />;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\tconst themeClass = theme ? THEME_CLASSES[theme] : '';\n\tconst percentDecimal = value / 100;\n\n\treturn (\n\t\t<ProgressRingShape\n\t\t\tid={id}\n\t\t\tsize={size}\n\t\t\tclassName={classNames(className as string, themeClass, {\n\t\t\t\t'slds-progress-ring_large': size === 'large',\n\t\t\t})}\n\t\t\tfillPercentDecimal={percentDecimal}\n\t\t\tflowDirection={flowDirection}\n\t\t>\n\t\t\t{getIcon()}\n\t\t</ProgressRingShape>\n\t);\n};\n\nProgressRing.displayName = PROGRESS_RING;\n\nexport default ProgressRing;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"+XAYA,IAAa,EAAgB,OAAO,OAAO,CAC1C,OAAQ,SACR,QAAS,UACT,QAAS,UACT,SAAU,UACX,CAAU,EASJ,EAAmD,CACxD,OAAQ,iCACR,QAAS,6BACT,QAAS,6BACT,SAAU,6BACX,EA4CM,GAAgB,CACrB,KACA,YACA,QACA,KAAM,EACN,UACA,QACA,gBAAgB,QAChB,OAAO,YACqC,CAE5C,IAAM,MAA2B,CAChC,GAAI,CAAC,EAAS,OAAO,KAErB,GAAI,EAAU,OAAO,EAErB,OAAQ,EAAR,CACC,IAAK,UACJ,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAM,SAAS,UAAU,KAAK,UAAU,MAAM,SAAW,CAAA,EACjE,IAAK,UACJ,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAM,SAAS,UAAU,KAAK,QAAQ,MAAM,SAAW,CAAA,EAC/D,IAAK,WACJ,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAM,SAAS,UAAU,KAAK,QAAQ,MAAM,UAAY,CAAA,EAChE,QACC,OAAO,IACT,CACD,EAEM,EAAa,EAAQ,EAAc,GAAS,GAC5C,EAAiB,EAAQ,IAE/B,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACK,KACE,OACN,WAAA,EAAW,EAAA,QAAA,CAAW,EAAqB,EAAY,CACtD,2BAA4B,IAAS,OACtC,CAAC,EACD,mBAAoB,EACL,gBAEd,SAAA,EAAQ,CACS,CAAA,CAErB,EAEA,EAAa,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/progress-ring/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode } from 'react';\nimport classNames from 'classnames';\nimport { PROGRESS_RING } from '../../utilities/constants';\nimport Icon from '../icon';\nimport ProgressRingShape from './private/ring-shape';\n\n/**\n * Theme options for the progress ring\n */\nexport const THEME_OPTIONS = Object.freeze({\n\tACTIVE: 'active',\n\tWARNING: 'warning',\n\tEXPIRED: 'expired',\n\tCOMPLETE: 'complete',\n} as const);\n\nexport type ProgressRingTheme = 'active' | 'warning' | 'expired' | 'complete';\nexport type ProgressRingFlowDirection = 'drain' | 'fill';\nexport type ProgressRingSize = 'medium' | 'large';\n\n/**\n * CSS classes for each theme\n */\nconst THEME_CLASSES: Record<ProgressRingTheme, string> = {\n\tactive: 'slds-progress-ring_active-step',\n\twarning: 'slds-progress-ring_warning',\n\texpired: 'slds-progress-ring_expired',\n\tcomplete: 'slds-progress-ring_complete',\n};\n\n/**\n * Props shared by every ProgressRing\n */\ninterface ProgressRingBaseProps {\n\t/** HTML id attribute */\n\tid?: string;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Theme applied to the ring */\n\ttheme?: ProgressRingTheme;\n\t/** Progress percentage (0-100) */\n\tvalue: number;\n\t/** Flow direction of progress */\n\tflowDirection?: ProgressRingFlowDirection;\n\t/** Size of the progress ring */\n\tsize?: ProgressRingSize;\n}\n\n/** No icon is rendered, so a custom `icon` would be ignored. */\ninterface ProgressRingWithoutIconProps {\n\t/** Whether to display the theme icon */\n\thasIcon?: false;\n\ticon?: never;\n}\n\n/** Renders the theme icon, or the custom `icon` when set. */\ninterface ProgressRingWithIconProps {\n\t/** Whether to display the theme icon */\n\thasIcon: true;\n\t/** Custom icon to display instead of the theme icon */\n\ticon?: ReactNode;\n}\n\n/**\n * Props for the ProgressRing component. `icon` is only honored with `hasIcon`,\n * so it is only accepted there.\n */\nexport type ProgressRingProps = ProgressRingBaseProps &\n\t(ProgressRingWithoutIconProps | ProgressRingWithIconProps);\n\n/**\n * Customizable progress ring displaying progress in a circular format.\n */\nconst ProgressRing = ({\n\tid,\n\tclassName,\n\ttheme,\n\ticon: propIcon,\n\thasIcon,\n\tvalue,\n\tflowDirection = 'drain',\n\tsize = 'medium',\n}: ProgressRingProps): React.ReactElement => {\n\t// Get icon based on theme or custom icon\n\tconst getIcon = (): ReactNode => {\n\t\tif (!hasIcon) return null;\n\n\t\tif (propIcon) return propIcon;\n\n\t\tswitch (theme) {\n\t\t\tcase 'warning':\n\t\t\t\treturn <Icon category=\"utility\" name=\"warning\" title=\"Warning\" />;\n\t\t\tcase 'expired':\n\t\t\t\treturn <Icon category=\"utility\" name=\"error\" title=\"Expired\" />;\n\t\t\tcase 'complete':\n\t\t\t\treturn <Icon category=\"utility\" name=\"check\" title=\"Complete\" />;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\tconst themeClass = theme ? THEME_CLASSES[theme] : '';\n\tconst percentDecimal = value / 100;\n\n\treturn (\n\t\t<ProgressRingShape\n\t\t\tid={id}\n\t\t\tsize={size}\n\t\t\tclassName={classNames(className as string, themeClass, {\n\t\t\t\t'slds-progress-ring_large': size === 'large',\n\t\t\t})}\n\t\t\tfillPercentDecimal={percentDecimal}\n\t\t\tflowDirection={flowDirection}\n\t\t>\n\t\t\t{getIcon()}\n\t\t</ProgressRingShape>\n\t);\n};\n\nProgressRing.displayName = PROGRESS_RING;\n\nexport default ProgressRing;\n"],"mappings":"+XAYA,IAAa,EAAgB,OAAO,OAAO,CAC1C,OAAQ,SACR,QAAS,UACT,QAAS,UACT,SAAU,UACX,CAAU,EASJ,EAAmD,CACxD,OAAQ,iCACR,QAAS,6BACT,QAAS,6BACT,SAAU,6BACX,EA6CM,GAAgB,CACrB,KACA,YACA,QACA,KAAM,EACN,UACA,QACA,gBAAgB,QAChB,OAAO,YACqC,CAE5C,IAAM,MAA2B,CAChC,GAAI,CAAC,EAAS,OAAO,KAErB,GAAI,EAAU,OAAO,EAErB,OAAQ,EAAR,CACC,IAAK,UACJ,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAM,SAAS,UAAU,KAAK,UAAU,MAAM,SAAW,CAAA,EACjE,IAAK,UACJ,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAM,SAAS,UAAU,KAAK,QAAQ,MAAM,SAAW,CAAA,EAC/D,IAAK,WACJ,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAM,SAAS,UAAU,KAAK,QAAQ,MAAM,UAAY,CAAA,EAChE,QACC,OAAO,IACT,CACD,EAEM,EAAa,EAAQ,EAAc,GAAS,GAC5C,EAAiB,EAAQ,IAE/B,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACK,KACE,OACN,WAAA,EAAW,EAAA,QAAA,CAAW,EAAqB,EAAY,CACtD,2BAA4B,IAAS,OACtC,CAAC,EACD,mBAAoB,EACL,gBAEd,SAAA,EAAQ,CACS,CAAA,CAErB,EAEA,EAAa,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../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,E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AA,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. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\tonRequestFocus?: (input: HTMLInputElement) => void;\n\t/** @deprecated Focus the radio through `refs.input` instead. Works only in the 11.0.0 release candidates, 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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,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,CAAK,CAEpB,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 +1 @@
1
- {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/radio-group/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\nimport requiredProperty from '../../utilities/warning/required-property';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t// Without a group `value`, selection falls back to `checked` on each\n\t\t// child Radio. That still works in v11 but is deprecated.\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.value === undefined ? true : undefined,\n\t\t\t'checked',\n\t\t\tundefined,\n\t\t\t`Pass \\`value\\` to RadioGroup or RadioButtonGroup instead of \\`checked\\` on each Radio, and read \\`data.value\\` in \\`onChange\\`. ${createDocUrl(\n\t\t\t\t'value'\n\t\t\t)}`\n\t\t);\n\n\t\t// React's own \"`checked` without `onChange`\" warning never fires,\n\t\t// because the group always attaches its own change handler.\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onChange !== undefined || !!props.disabled,\n\t\t\t'onChange',\n\t\t\t`RadioGroup and RadioButtonGroup are controlled: without \\`onChange\\`, selecting a radio does nothing. Update \\`value\\` from \\`data.value\\` in \\`onChange\\`, or set \\`disabled\\`. ${createDocUrl(\n\t\t\t\t'onChange'\n\t\t\t)}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"iLAQA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAI9C,EAAA,QACC,EACA,EAAM,QAAU,IAAA,IAAmB,IAAA,GACnC,UACA,IAAA,GACA,mIAAmI,EAClI,OACD,GACD,EAIA,EAAA,QACC,EACA,EAAM,WAAa,IAAA,IAAa,CAAC,CAAC,EAAM,SACxC,WACA,oLAAoL,EACnL,UACD,GACD,CACD,GAGD,IAAA,EAAe"}
1
+ {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/radio-group/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\nimport requiredProperty from '../../utilities/warning/required-property';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t// Without a group `value`, selection falls back to `checked` on each\n\t\t// child Radio. That works only in the 11.0.0 release candidates.\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.value === undefined ? true : undefined,\n\t\t\t'checked',\n\t\t\tundefined,\n\t\t\t`Pass \\`value\\` to RadioGroup or RadioButtonGroup instead of \\`checked\\` on each Radio, and read \\`data.value\\` in \\`onChange\\`. ${createDocUrl(\n\t\t\t\t'value'\n\t\t\t)}`\n\t\t);\n\n\t\t// React's own \"`checked` without `onChange`\" warning never fires,\n\t\t// because the group always attaches its own change handler.\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onChange !== undefined || !!props.disabled,\n\t\t\t'onChange',\n\t\t\t`RadioGroup and RadioButtonGroup are controlled: without \\`onChange\\`, selecting a radio does nothing. Update \\`value\\` from \\`data.value\\` in \\`onChange\\`, or set \\`disabled\\`. ${createDocUrl(\n\t\t\t\t'onChange'\n\t\t\t)}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"iLAQA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAI9C,EAAA,QACC,EACA,EAAM,QAAU,IAAA,IAAmB,IAAA,GACnC,UACA,IAAA,GACA,mIAAmI,EAClI,OACD,GACD,EAIA,EAAA,QACC,EACA,EAAM,WAAa,IAAA,IAAa,CAAC,CAAC,EAAM,SACxC,WACA,oLAAoL,EACnL,UACD,GACD,CACD,GAGD,IAAA,EAAe"}
@@ -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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AAA,EAAW,EAAA,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| {\n\t\t\t/** Disables the radio group. */\n\t\t\tdisabled: true;\n\t\t\t/** Called on change. Optional while disabled. */\n\t\t\tonChange?: RadioGroupChangeHandler;\n\t };\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":"sXAkJA,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,C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AAA,CAAC,MAAD,CAAK,GAAI,EAAS,UAAU,0BAC1B,SAAA,EAAO,KACJ,CAAA,CAEF,CACI,CAAA,CAAA,GAEZ,EAEA,EAAW,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/scoped-notification/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, { useEffect, type ReactNode, type ReactElement } from 'react';\nimport classNames from 'classnames';\nimport Icon, { type IconProps } from '../icon';\nimport { SCOPED_NOTIFICATION } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Theme options for ScopedNotification\n */\nexport type ScopedNotificationTheme = 'dark' | 'light';\n\n/**\n * Assistive text for ScopedNotification\n */\nexport interface ScopedNotificationAssistiveText {\n\t/** Assistive text for icon */\n\ticon?: string;\n}\n\n/**\n * Props for the ScopedNotification component\n */\nexport interface ScopedNotificationProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ScopedNotificationAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Content to display in the notification */\n\tchildren?: ReactNode;\n\t/** Custom `Icon`. Its own `assistiveText` wins over `assistiveText.icon`. */\n\ticon?: ReactElement<IconProps>;\n\t/** Theme for the notification */\n\ttheme?: ScopedNotificationTheme;\n}\n\n/**\n * Scoped Notification serves advisory information for the user\n * that is not important enough to justify an alert.\n */\nconst ScopedNotification = ({\n\tassistiveText,\n\tclassName,\n\tchildren,\n\ticon: propIcon,\n\ticonName,\n\ttheme,\n}: ScopedNotificationProps & {\n\t// Removed in v11. Destructured so it never reaches the DOM.\n\ticonName?: unknown;\n}): React.ReactElement => {\n\tuseEffect(() => {\n\t\tcheckProps(SCOPED_NOTIFICATION, { iconName }, componentDoc);\n\t}, [iconName]);\n\n\t// Build the icon element\n\tlet icon: ReactNode;\n\n\tif (propIcon) {\n\t\t// Clone the provided icon with merged assistive text\n\t\tconst { assistiveText: iconAssistiveText } = propIcon.props;\n\t\ticon = React.cloneElement(propIcon, {\n\t\t\tassistiveText: {\n\t\t\t\tlabel: assistiveText?.icon,\n\t\t\t\t...iconAssistiveText,\n\t\t\t},\n\t\t});\n\t} else {\n\t\t// Use default icon\n\t\ticon = (\n\t\t\t<Icon\n\t\t\t\tassistiveText={{\n\t\t\t\t\tlabel: assistiveText?.icon || 'Info',\n\t\t\t\t}}\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname=\"info\"\n\t\t\t\tcolorVariant={theme === 'dark' ? 'base' : undefined}\n\t\t\t\tsize=\"small\"\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-scoped-notification',\n\t\t\t\t'slds-media',\n\t\t\t\t'slds-media_center',\n\t\t\t\t{\n\t\t\t\t\t'slds-scoped-notification_light': theme === 'light',\n\t\t\t\t\t'slds-scoped-notification_dark': theme === 'dark',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\trole=\"status\"\n\t\t>\n\t\t\t<div className=\"slds-media__figure\">{icon}</div>\n\t\t\t<div className=\"slds-media__body\">{children}</div>\n\t\t</div>\n\t);\n};\n\nScopedNotification.displayName = SCOPED_NOTIFICATION;\n\nexport default ScopedNotification;\n"],"mappings":"qZA2CA,IAAM,GAAsB,CAC3B,gBACA,YACA,WACA,KAAM,EACN,WACA,WAIyB,EACzB,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QAAW,EAAA,oBAAqB,CAAE,UAAS,EAAG,EAAA,OAAY,CAC3D,EAAG,CAAC,CAAQ,CAAC,EAGb,IAAI,EAEJ,GAAI,EAAU,CAEb,GAAM,CAAE,cAAe,GAAsB,EAAS,MACtD,EAAO,EAAA,QAAM,aAAa,EAAU,CACnC,cAAe,CACd,MAAO,GAAe,KACtB,GAAG,CACJ,CACD,CAAC,CACF,KAEC,IACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CACd,MAAO,GAAe,MAAQ,MAC/B,EACA,SAAS,UACT,KAAK,OACL,aAAc,IAAU,OAAS,OAAS,IAAA,GAC1C,KAAK,OACL,CAAA,EAIH,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,2BACA,aACA,oBACA,CACC,iCAAkC,IAAU,QAC5C,gCAAiC,IAAU,MAC5C,EACA,CACD,EACA,KAAK,SAXN,SAAA,EAaC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,qBAAsB,SAAA,CAAU,CAAA,GAC/C,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,mBAAoB,UAAc,CAAA,CAC7C,GAEP,EAEA,EAAmB,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/scoped-notification/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, { useEffect, type ReactNode, type ReactElement } from 'react';\nimport classNames from 'classnames';\nimport Icon, { type IconProps } from '../icon';\nimport { SCOPED_NOTIFICATION } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Theme options for ScopedNotification\n */\nexport type ScopedNotificationTheme = 'dark' | 'light';\n\n/**\n * Assistive text for ScopedNotification\n */\nexport interface ScopedNotificationAssistiveText {\n\t/** Assistive text for icon */\n\ticon?: string;\n}\n\n/**\n * Props for the ScopedNotification component\n */\nexport interface ScopedNotificationProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ScopedNotificationAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Content to display in the notification */\n\tchildren?: ReactNode;\n\t/** Custom `Icon`. Its own `assistiveText` wins over `assistiveText.icon`. */\n\ticon?: ReactElement<IconProps>;\n\t/** Theme for the notification */\n\ttheme?: ScopedNotificationTheme;\n}\n\n/**\n * Scoped Notification serves advisory information for the user\n * that is not important enough to justify an alert.\n */\nconst ScopedNotification = ({\n\tassistiveText,\n\tclassName,\n\tchildren,\n\ticon: propIcon,\n\ticonName,\n\ttheme,\n}: ScopedNotificationProps & {\n\t// Removed in v11. Destructured so it never reaches the DOM.\n\t/** @deprecated Removed and ignored. Pass an `Icon` element to `icon`. */\n\ticonName?: unknown;\n}): React.ReactElement => {\n\tuseEffect(() => {\n\t\tcheckProps(SCOPED_NOTIFICATION, { iconName }, componentDoc);\n\t}, [iconName]);\n\n\t// Build the icon element\n\tlet icon: ReactNode;\n\n\tif (propIcon) {\n\t\t// Clone the provided icon with merged assistive text\n\t\tconst { assistiveText: iconAssistiveText } = propIcon.props;\n\t\ticon = React.cloneElement(propIcon, {\n\t\t\tassistiveText: {\n\t\t\t\tlabel: assistiveText?.icon,\n\t\t\t\t...iconAssistiveText,\n\t\t\t},\n\t\t});\n\t} else {\n\t\t// Use default icon\n\t\ticon = (\n\t\t\t<Icon\n\t\t\t\tassistiveText={{\n\t\t\t\t\tlabel: assistiveText?.icon || 'Info',\n\t\t\t\t}}\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname=\"info\"\n\t\t\t\tcolorVariant={theme === 'dark' ? 'base' : undefined}\n\t\t\t\tsize=\"small\"\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-scoped-notification',\n\t\t\t\t'slds-media',\n\t\t\t\t'slds-media_center',\n\t\t\t\t{\n\t\t\t\t\t'slds-scoped-notification_light': theme === 'light',\n\t\t\t\t\t'slds-scoped-notification_dark': theme === 'dark',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\trole=\"status\"\n\t\t>\n\t\t\t<div className=\"slds-media__figure\">{icon}</div>\n\t\t\t<div className=\"slds-media__body\">{children}</div>\n\t\t</div>\n\t);\n};\n\nScopedNotification.displayName = SCOPED_NOTIFICATION;\n\nexport default ScopedNotification;\n"],"mappings":"qZA2CA,IAAM,GAAsB,CAC3B,gBACA,YACA,WACA,KAAM,EACN,WACA,WAKyB,EACzB,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QAAW,EAAA,oBAAqB,CAAE,UAAS,EAAG,EAAA,OAAY,CAC3D,EAAG,CAAC,CAAQ,CAAC,EAGb,IAAI,EAEJ,GAAI,EAAU,CAEb,GAAM,CAAE,cAAe,GAAsB,EAAS,MACtD,EAAO,EAAA,QAAM,aAAa,EAAU,CACnC,cAAe,CACd,MAAO,GAAe,KACtB,GAAG,CACJ,CACD,CAAC,CACF,KAEC,IACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CACd,MAAO,GAAe,MAAQ,MAC/B,EACA,SAAS,UACT,KAAK,OACL,aAAc,IAAU,OAAS,OAAS,IAAA,GAC1C,KAAK,OACL,CAAA,EAIH,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,2BACA,aACA,oBACA,CACC,iCAAkC,IAAU,QAC5C,gCAAiC,IAAU,MAC5C,EACA,CACD,EACA,KAAK,SAXN,SAAA,EAaC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,qBAAsB,SAAA,CAAU,CAAA,GAC/C,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,mBAAoB,UAAc,CAAA,CAC7C,GAEP,EAEA,EAAmB,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"step.cjs","names":[],"sources":["../../../../components/setup-assistant/step.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype SyntheticEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport assign from 'lodash.assign';\n\n// This component's `checkProps` which issues warnings to developers about properties\n// when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport Button from '../button';\nimport ProgressRing from '../progress-ring';\n\nimport Icon, { type IconProps } from '../icon';\n\nimport { SETUP_ASSISTANT_STEP } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport generateId from '../../utilities/generate-id';\n\nexport interface StepAssistiveText {\n\t/** Button that examples a step */\n\texpandStep?: string;\n}\n\n/**\n * Data passed to `onToggleIsOpen`\n */\nexport interface StepToggleData {\n\t/** Index of the step within the Setup Assistant (set by the parent `SetupAssistant`) */\n\tindex?: number;\n\t/** Requested (next) open state: `true` to expand the step, `false` to collapse it */\n\tisOpen: boolean;\n\t/** Props of the step being toggled */\n\tstep: StepProps;\n}\n\nexport interface StepProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `expandStep`: Button that examples a step\n\t * _Tested with snapshot testing._\n\t */\n\tassistiveText?: StepAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Detailed description of the step\n\t */\n\tdescription?: string | ReactNode;\n\t/**\n\t * Estimated time for completing the step\n\t */\n\testimatedTime?: string | ReactNode;\n\t/**\n\t * Heading for the step\n\t */\n\theading?: string | ReactNode;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Dictates whether the step can be expanded / collapsed\n\t */\n\tisExpandable?: boolean;\n\t/**\n\t * Expanded state of an `isExpandable` step when it is controlled. When set, the step only expands and\n\t * collapses when this prop changes: update it from `onToggleIsOpen` (or the parent's\n\t * `onStepToggleIsOpen`). Leave it `undefined` for an uncontrolled step (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Initial expanded state of an uncontrolled `isExpandable` step (`isOpen` is `undefined`). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * A step's available action(s). Typically a Button, Button of variant \"link,\" or Checkbox of variant \"toggle\"\n\t */\n\taction?: ReactNode;\n\t/**\n\t * Step content shown when an expandable step is open. Typically a ProgressIndicator and/or ScopedNotification component\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * Content within the media figure. Expects an Icon or ProgressRing component. An Icon is rendered at size `small`.\n\t */\n\tfigure?: ReactNode;\n\t/** @deprecated Use `action` instead. */\n\tonRenderAction?: () => ReactNode;\n\t/** @deprecated Use `content` instead. */\n\tonRenderContent?: () => ReactNode;\n\t/** @deprecated Use `figure` instead. */\n\tonRenderFigure?: () => ReactNode;\n\t/**\n\t * Called when the step requests to expand / collapse, controlled or not. `data.isOpen` is the\n\t * requested (next) state. Set by the parent `SetupAssistant` from `onStepToggleIsOpen` unless the\n\t * step passes its own.\n\t */\n\tonToggleIsOpen?: (event: SyntheticEvent, data: StepToggleData) => void;\n\t/**\n\t * Percentage of step completed. No progress indicator will be shown for the step unless this is provided\n\t */\n\tprogress?: number;\n\t/**\n\t * Display number for the step. Only appears if progress indicator is enabled. Determined automatically by parent if not provided.\n\t */\n\tstepNumber?: number;\n}\n\n/** Props the parent `SetupAssistant` injects. They aren't part of the public props. */\nexport interface StepInjectedProps {\n\t/** Index of the step within the Setup Assistant */\n\tindex?: number;\n}\n\ninterface StepState {\n\tisOpen: boolean;\n}\n\nconst defaultProps: Partial<StepProps> = {\n\tassistiveText: { expandStep: 'Expand Step' },\n};\n\n/**\n * Setup Assistant Step component is used to specify individual items within the Setup Assistant\n * filled with learning and task links along with a recommended sequence that may have progress tracking\n */\nclass Step extends React.Component<StepProps & StepInjectedProps, StepState> {\n\tstatic displayName = SETUP_ASSISTANT_STEP;\n\n\tstatic defaultProps = defaultProps;\n\n\tgeneratedId: string;\n\n\tconstructor(props: StepProps & StepInjectedProps) {\n\t\tsuper(props);\n\t\tthis.generatedId = generateId();\n\t\tthis.state = {\n\t\t\tisOpen: props.defaultIsOpen ?? false,\n\t\t};\n\t\tcheckProps(SETUP_ASSISTANT_STEP, { ...this.props }, componentDoc);\n\t}\n\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\tgetIsOpen() {\n\t\treturn this.props.isOpen !== undefined\n\t\t\t? this.props.isOpen\n\t\t\t: this.state.isOpen;\n\t}\n\n\t// Controlled when `isOpen` is set: the step reports the requested state and waits for the prop.\n\ttoggleIsOpen = (event: SyntheticEvent) => {\n\t\tconst isOpen = !this.getIsOpen();\n\n\t\tif (this.props.isOpen === undefined) {\n\t\t\tthis.setState({ isOpen });\n\t\t}\n\n\t\tthis.props.onToggleIsOpen?.(event, {\n\t\t\tindex: this.props.index,\n\t\t\tisOpen,\n\t\t\tstep: this.props,\n\t\t});\n\t};\n\n\trenderMediaContent() {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<div className=\"slds-setup-assistant__step-summary-content slds-media__body\">\n\t\t\t\t\t<h3 className=\"slds-setup-assistant__step-summary-title slds-text-heading_small\">\n\t\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-button_reset\"\n\t\t\t\t\t\t\t\tlabel={this.props.heading}\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tthis.props.heading\n\t\t\t\t\t\t)}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>{this.props.description}</p>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"slds-media__figure slds-media__figure_reverse\">\n\t\t\t\t\t{this.props.action ?? this.props.onRenderAction?.() ?? null}\n\t\t\t\t\t{this.props.estimatedTime ? (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t'slds-text-align_right',\n\t\t\t\t\t\t\t\t'slds-text-color_weak',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'slds-p-top_medium':\n\t\t\t\t\t\t\t\t\t\tthis.props.action !== undefined ||\n\t\t\t\t\t\t\t\t\t\tthis.props.onRenderAction !== undefined,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this.props.estimatedTime}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\n\trenderSummary() {\n\t\tlet figure: ReactNode;\n\t\tlet progressRingTheme: 'active' | 'complete' | undefined;\n\n\t\tif (\n\t\t\tthis.props.progress !== undefined &&\n\t\t\tthis.props.progress > 0 &&\n\t\t\tthis.props.progress < 100\n\t\t) {\n\t\t\tprogressRingTheme = 'active';\n\t\t} else if (this.props.progress === 100) {\n\t\t\tprogressRingTheme = 'complete';\n\t\t}\n\n\t\tif (this.props.figure !== undefined || this.props.onRenderFigure) {\n\t\t\tconst renderedFigure =\n\t\t\t\tthis.props.figure ?? this.props.onRenderFigure?.() ?? null;\n\n\t\t\tif (isElementOfType<IconProps>(renderedFigure, Icon)) {\n\t\t\t\tconst figureProps = renderedFigure.props;\n\t\t\t\tlet containerStyle: CSSProperties = {\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\ttop: this.props.isExpandable ? '5px' : '-3px',\n\t\t\t\t};\n\n\t\t\t\tif (figureProps.containerStyle) {\n\t\t\t\t\tcontainerStyle = {\n\t\t\t\t\t\t...containerStyle,\n\t\t\t\t\t\t...figureProps.containerStyle,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst clonedFigure = React.cloneElement(renderedFigure, {\n\t\t\t\t\t...figureProps,\n\t\t\t\t\tcontainerStyle,\n\t\t\t\t\tsize: 'small',\n\t\t\t\t} as Partial<unknown>);\n\t\t\t\tfigure = <div className=\"slds-media__figure\">{clonedFigure}</div>;\n\t\t\t} else {\n\t\t\t\tfigure = renderedFigure;\n\t\t\t}\n\t\t} else if (this.props.progress !== undefined) {\n\t\t\tfigure = (\n\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t<ProgressRing\n\t\t\t\t\t\thasIcon\n\t\t\t\t\t\ticon={this.props.progress === 100 ? null : this.props.stepNumber}\n\t\t\t\t\t\tflowDirection=\"fill\"\n\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\ttheme={progressRingTheme}\n\t\t\t\t\t\tvalue={this.props.progress}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-setup-assistant__step-summary\">\n\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t{figure}\n\t\t\t\t\t{this.props.isExpandable || this.props.progress !== undefined ? (\n\t\t\t\t\t\t<div className=\"slds-media__body slds-m-top_x-small\">\n\t\t\t\t\t\t\t<div className=\"slds-media\">{this.renderMediaContent()}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.renderMediaContent()\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst assistiveText = assign(\n\t\t\t{},\n\t\t\tdefaultProps.assistiveText,\n\t\t\tthis.props.assistiveText\n\t\t);\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-setup-assistant__item',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\tid={this.getId()}\n\t\t\t>\n\t\t\t\t<article className=\"slds-setup-assistant__step\">\n\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames('slds-summary-detail', {\n\t\t\t\t\t\t\t\t'slds-is-open': this.getIsOpen(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tassistiveText={{ icon: assistiveText.expandStep }}\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-m-right_x-small slds-m-top_x-small\"\n\t\t\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\t\t\ticonClassName=\"slds-summary-detail__action-icon\"\n\t\t\t\t\t\t\t\ticonName=\"switch\"\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"slds-container_fluid\">\n\t\t\t\t\t\t\t\t<div className=\"slds-summary-detail__title\">\n\t\t\t\t\t\t\t\t\t{this.renderSummary()}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"slds-summary-detail__content\"\n\t\t\t\t\t\t\t\t\tid={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"slds-setup-assistant__step-detail\">\n\t\t\t\t\t\t\t\t\t\t{this.props.content ??\n\t\t\t\t\t\t\t\t\t\t\tthis.props.onRenderContent?.() ??\n\t\t\t\t\t\t\t\t\t\t\tnull}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.renderSummary()\n\t\t\t\t\t)}\n\t\t\t\t</article>\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nexport default Step as React.ComponentType<StepProps>;\n"],"mappings":"4gBAiIA,IAAM,EAAmC,CACxC,cAAe,CAAE,WAAY,aAAc,CAC5C,EAMM,EAAN,cAAmB,EAAA,QAAM,SAAoD,CAC5E,OAAO,YAAc,EAAA,qBAEr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K,MAAM,kBAAkB,GAC7B,IACG,CAAA,CACD,CAAA,CACD,CACD,CAAA,CAAA,CAEL,CAAA,EAAA,KAAK,cAAc,CAEZ,CAAA,CACN,CAAA,CAEN,CACD"}
1
+ {"version":3,"file":"step.cjs","names":[],"sources":["../../../../components/setup-assistant/step.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype SyntheticEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport assign from 'lodash.assign';\n\n// This component's `checkProps` which issues warnings to developers about properties\n// when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport Button from '../button';\nimport ProgressRing from '../progress-ring';\n\nimport Icon, { type IconProps } from '../icon';\n\nimport { SETUP_ASSISTANT_STEP } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport generateId from '../../utilities/generate-id';\n\nexport interface StepAssistiveText {\n\t/** Button that examples a step */\n\texpandStep?: string;\n}\n\n/**\n * Data passed to `onToggleIsOpen`\n */\nexport interface StepToggleData {\n\t/** Index of the step within the Setup Assistant (set by the parent `SetupAssistant`) */\n\tindex?: number;\n\t/** Requested (next) open state: `true` to expand the step, `false` to collapse it */\n\tisOpen: boolean;\n\t/** Props of the step being toggled */\n\tstep: StepProps;\n}\n\nexport interface StepProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `expandStep`: Button that examples a step\n\t */\n\tassistiveText?: StepAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Detailed description of the step\n\t */\n\tdescription?: string | ReactNode;\n\t/**\n\t * Estimated time for completing the step\n\t */\n\testimatedTime?: string | ReactNode;\n\t/**\n\t * Heading for the step\n\t */\n\theading?: string | ReactNode;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Dictates whether the step can be expanded / collapsed\n\t */\n\tisExpandable?: boolean;\n\t/**\n\t * Expanded state of an `isExpandable` step when it is controlled. When set, the step only expands and\n\t * collapses when this prop changes: update it from `onToggleIsOpen` (or the parent's\n\t * `onStepToggleIsOpen`). Leave it `undefined` for an uncontrolled step (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Initial expanded state of an uncontrolled `isExpandable` step (`isOpen` is `undefined`). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * A step's available action(s). Typically a Button, Button of variant \"link,\" or Checkbox of variant \"toggle\"\n\t */\n\taction?: ReactNode;\n\t/**\n\t * Step content shown when an expandable step is open. Typically a ProgressIndicator and/or ScopedNotification component\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * Content within the media figure. Expects an Icon or ProgressRing component. An Icon is rendered at size `small`.\n\t */\n\tfigure?: ReactNode;\n\t/** @deprecated Use `action` instead. */\n\tonRenderAction?: () => ReactNode;\n\t/** @deprecated Use `content` instead. */\n\tonRenderContent?: () => ReactNode;\n\t/** @deprecated Use `figure` instead. */\n\tonRenderFigure?: () => ReactNode;\n\t/**\n\t * Called when the step requests to expand / collapse, controlled or not. `data.isOpen` is the\n\t * requested (next) state. Set by the parent `SetupAssistant` from `onStepToggleIsOpen` unless the\n\t * step passes its own.\n\t */\n\tonToggleIsOpen?: (event: SyntheticEvent, data: StepToggleData) => void;\n\t/**\n\t * Percentage of step completed. No progress indicator will be shown for the step unless this is provided\n\t */\n\tprogress?: number;\n\t/**\n\t * Display number for the step. Only appears if progress indicator is enabled. Determined automatically by parent if not provided.\n\t */\n\tstepNumber?: number;\n}\n\n/** Props the parent `SetupAssistant` injects. They aren't part of the public props. */\nexport interface StepInjectedProps {\n\t/** Index of the step within the Setup Assistant */\n\tindex?: number;\n}\n\ninterface StepState {\n\tisOpen: boolean;\n}\n\nconst defaultProps: Partial<StepProps> = {\n\tassistiveText: { expandStep: 'Expand Step' },\n};\n\n/**\n * Setup Assistant Step component is used to specify individual items within the Setup Assistant\n * filled with learning and task links along with a recommended sequence that may have progress tracking\n */\nclass Step extends React.Component<StepProps & StepInjectedProps, StepState> {\n\tstatic displayName = SETUP_ASSISTANT_STEP;\n\n\tstatic defaultProps = defaultProps;\n\n\tgeneratedId: string;\n\n\tconstructor(props: StepProps & StepInjectedProps) {\n\t\tsuper(props);\n\t\tthis.generatedId = generateId();\n\t\tthis.state = {\n\t\t\tisOpen: props.defaultIsOpen ?? false,\n\t\t};\n\t\tcheckProps(SETUP_ASSISTANT_STEP, { ...this.props }, componentDoc);\n\t}\n\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\tgetIsOpen() {\n\t\treturn this.props.isOpen !== undefined\n\t\t\t? this.props.isOpen\n\t\t\t: this.state.isOpen;\n\t}\n\n\t// Controlled when `isOpen` is set: the step reports the requested state and waits for the prop.\n\ttoggleIsOpen = (event: SyntheticEvent) => {\n\t\tconst isOpen = !this.getIsOpen();\n\n\t\tif (this.props.isOpen === undefined) {\n\t\t\tthis.setState({ isOpen });\n\t\t}\n\n\t\tthis.props.onToggleIsOpen?.(event, {\n\t\t\tindex: this.props.index,\n\t\t\tisOpen,\n\t\t\tstep: this.props,\n\t\t});\n\t};\n\n\trenderMediaContent() {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<div className=\"slds-setup-assistant__step-summary-content slds-media__body\">\n\t\t\t\t\t<h3 className=\"slds-setup-assistant__step-summary-title slds-text-heading_small\">\n\t\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-button_reset\"\n\t\t\t\t\t\t\t\tlabel={this.props.heading}\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tthis.props.heading\n\t\t\t\t\t\t)}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>{this.props.description}</p>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"slds-media__figure slds-media__figure_reverse\">\n\t\t\t\t\t{this.props.action ?? this.props.onRenderAction?.() ?? null}\n\t\t\t\t\t{this.props.estimatedTime ? (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t'slds-text-align_right',\n\t\t\t\t\t\t\t\t'slds-text-color_weak',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'slds-p-top_medium':\n\t\t\t\t\t\t\t\t\t\tthis.props.action !== undefined ||\n\t\t\t\t\t\t\t\t\t\tthis.props.onRenderAction !== undefined,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this.props.estimatedTime}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\n\trenderSummary() {\n\t\tlet figure: ReactNode;\n\t\tlet progressRingTheme: 'active' | 'complete' | undefined;\n\n\t\tif (\n\t\t\tthis.props.progress !== undefined &&\n\t\t\tthis.props.progress > 0 &&\n\t\t\tthis.props.progress < 100\n\t\t) {\n\t\t\tprogressRingTheme = 'active';\n\t\t} else if (this.props.progress === 100) {\n\t\t\tprogressRingTheme = 'complete';\n\t\t}\n\n\t\tif (this.props.figure !== undefined || this.props.onRenderFigure) {\n\t\t\tconst renderedFigure =\n\t\t\t\tthis.props.figure ?? this.props.onRenderFigure?.() ?? null;\n\n\t\t\tif (isElementOfType<IconProps>(renderedFigure, Icon)) {\n\t\t\t\tconst figureProps = renderedFigure.props;\n\t\t\t\tlet containerStyle: CSSProperties = {\n\t\t\t\t\tposition: 'relative',\n\t\t\t\t\ttop: this.props.isExpandable ? '5px' : '-3px',\n\t\t\t\t};\n\n\t\t\t\tif (figureProps.containerStyle) {\n\t\t\t\t\tcontainerStyle = {\n\t\t\t\t\t\t...containerStyle,\n\t\t\t\t\t\t...figureProps.containerStyle,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst clonedFigure = React.cloneElement(renderedFigure, {\n\t\t\t\t\t...figureProps,\n\t\t\t\t\tcontainerStyle,\n\t\t\t\t\tsize: 'small',\n\t\t\t\t} as Partial<unknown>);\n\t\t\t\tfigure = <div className=\"slds-media__figure\">{clonedFigure}</div>;\n\t\t\t} else {\n\t\t\t\tfigure = renderedFigure;\n\t\t\t}\n\t\t} else if (this.props.progress !== undefined) {\n\t\t\tfigure = (\n\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t<ProgressRing\n\t\t\t\t\t\thasIcon\n\t\t\t\t\t\ticon={this.props.progress === 100 ? null : this.props.stepNumber}\n\t\t\t\t\t\tflowDirection=\"fill\"\n\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\ttheme={progressRingTheme}\n\t\t\t\t\t\tvalue={this.props.progress}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-setup-assistant__step-summary\">\n\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t{figure}\n\t\t\t\t\t{this.props.isExpandable || this.props.progress !== undefined ? (\n\t\t\t\t\t\t<div className=\"slds-media__body slds-m-top_x-small\">\n\t\t\t\t\t\t\t<div className=\"slds-media\">{this.renderMediaContent()}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.renderMediaContent()\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst assistiveText = assign(\n\t\t\t{},\n\t\t\tdefaultProps.assistiveText,\n\t\t\tthis.props.assistiveText\n\t\t);\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-setup-assistant__item',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\tid={this.getId()}\n\t\t\t>\n\t\t\t\t<article className=\"slds-setup-assistant__step\">\n\t\t\t\t\t{this.props.isExpandable ? (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames('slds-summary-detail', {\n\t\t\t\t\t\t\t\t'slds-is-open': this.getIsOpen(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tassistiveText={{ icon: assistiveText.expandStep }}\n\t\t\t\t\t\t\t\taria-controls={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\tclassName=\"slds-m-right_x-small slds-m-top_x-small\"\n\t\t\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\t\t\ticonClassName=\"slds-summary-detail__action-icon\"\n\t\t\t\t\t\t\t\ticonName=\"switch\"\n\t\t\t\t\t\t\t\tonClick={this.toggleIsOpen}\n\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"slds-container_fluid\">\n\t\t\t\t\t\t\t\t<div className=\"slds-summary-detail__title\">\n\t\t\t\t\t\t\t\t\t{this.renderSummary()}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"slds-summary-detail__content\"\n\t\t\t\t\t\t\t\t\tid={`${this.getId()}-detail-content`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"slds-setup-assistant__step-detail\">\n\t\t\t\t\t\t\t\t\t\t{this.props.content ??\n\t\t\t\t\t\t\t\t\t\t\tthis.props.onRenderContent?.() ??\n\t\t\t\t\t\t\t\t\t\t\tnull}\n\t\t\t\t\t\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SAAS,SACT,QAAS,KAAK,aACd,QAAQ,MACR,CAAA,GACD,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,uBAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACb,SAAA,KAAK,cAAc,CAChB,CAAA,GACL,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,UAAU,+BACV,GAAI,GAAG,KAAK,MAAM,EAAE,iBAEpB,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,oCACb,SAAA,KAAK,MAAM,SACX,KAAK,MAAM,kBAAkB,GAC7B,IACG,CAAA,CACD,CAAA,CACD,CACD,CAAA,CAAA,CAEL,CAAA,EAAA,KAAK,cAAc,CAEZ,CAAA,CACN,CAAA,CAEN,CACD"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"cell.cjs","names":[],"sources":["../../../../components/simple-data-table/cell.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useContext, ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport CellContext from './private/cell-context';\nimport TableContext from './private/table-context';\nimport useContextHelper from './private/context-helper';\n\nimport { SIMPLE_DATA_TABLE_CELL } from '../../utilities/constants';\n\nexport interface SimpleDataTableCellProps {\n\t/** The contents of the cell */\n\tchildren?: ReactNode;\n\t/** Class names to be added to the cell */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Use this for advanced table (selectable or sortable rows) */\n\tfixedLayout?: boolean;\n\t/** The item from the items which represents this row */\n\titem?: Record<string, unknown>;\n\t/** The primary column for a row. This is almost always the first column. */\n\tprimaryColumn?: boolean;\n\t/** The property of this item to display */\n\tproperty?: string;\n\t/** Shows on hover. Useful for truncated cells. */\n\ttitle?: string;\n\t/** Width of column. Required for advanced/fixed layout tables. */\n\twidth?: string;\n\t/** Data label for stacked layout */\n\tlabel?: string;\n\t/** Header ID for accessibility */\n\theaderId?: string;\n}\n\n/**\n * The default Cell renderer for the SimpleDataTable. To customize a column's cells,\n * pass an element of any component that takes these props as the column's child.\n */\nconst SimpleDataTableCell: React.FC<SimpleDataTableCellProps> = (props) => {\n\tconst tableContext = useContext(TableContext);\n\tconst cellContext = useContext(CellContext);\n\tconst { tabIndex, hasFocus, handleFocus, handleKeyDown } = useContextHelper(\n\t\ttableContext,\n\t\tcellContext,\n\t\tprops.fixedLayout\n\t);\n\n\tconst childText = React.isValidElement(props.children)\n\t\t? (props.children.props as { children?: string }).children\n\t\t: props.children;\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={classNames({\n\t\t\t\t'slds-truncate': props.fixedLayout,\n\t\t\t})}\n\t\t\ttitle={\n\t\t\t\tprops.title || (typeof childText === 'string' ? childText : undefined)\n\t\t\t}\n\t\t>\n\t\t\t{props.children}\n\t\t</div>\n\t);\n\n\tconst className = classNames(props.className, {\n\t\t'slds-has-focus': hasFocus,\n\t});\n\n\tconst ref = (node: HTMLTableCellElement | null) => {\n\t\tif (node && hasFocus) {\n\t\t\tnode.focus();\n\t\t}\n\t};\n\n\tif (props.primaryColumn) {\n\t\treturn (\n\t\t\t<th\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t\tdata-label={props.label}\n\t\t\t\trole={tableContext.isGrid ? 'gridcell' : undefined}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\tstyle={props.width ? { width: props.width } : undefined}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t>\n\t\t\t\t{contents}\n\t\t\t</th>\n\t\t);\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tclassName={className}\n\t\t\tdata-label={props.label}\n\t\t\tonFocus={handleFocus}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tref={ref}\n\t\t\trole={tableContext.isGrid ? 'gridcell' : undefined}\n\t\t\tstyle={props.width ? { width: props.width } : undefined}\n\t\t\ttabIndex={tabIndex}\n\t\t\theaders={props.headerId}\n\t\t>\n\t\t\t{contents}\n\t\t</td>\n\t);\n};\n\nSimpleDataTableCell.displayName = SIMPLE_DATA_TABLE_CELL;\n\nexport default SimpleDataTableCell;\n"],"mappings":"sVAuCA,IAAM,EAA2D,GAAU,CAC1E,IAAM,GAAA,EAAe,EAAA,WAAA,CAAW,EAAA,OAAY,EACtC,GAAA,EAAc,EAAA,WAAA,CAAW,EAAA,OAAW,EACpC,CAAE,WAAU,WAAU,cAAa,iBAAkB,EAAA,QAC1D,EACA,EACA,EAAM,WACP,EAEM,EAAY,EAAA,QAAM,eAAe,EAAM,QAAQ,EACjD,EAAM,SAAS,MAAgC,SAChD,EAAM,SAEH,GACL,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,CACrB,gBAAiB,EAAM,WACxB,CAAC,EACD,MACC,EAAM,QAAU,OAAO,GAAc,SAAW,EAAY,IAAA,IAG5D,SAAA,EAAM,QACH,CAAA,EAGA,GAAA,EAAY,EAAA,QAAA,CAAW,EAAM,UAAW,CAC7C,iBAAkB,CACnB,CAAC,EAEK,EAAO,GAAsC,CAC9C,GAAQ,GACX,EAAK,MAAM,CAEb,EAmBA,OAjBI,EAAM,eAER,EAAA,EAAA,IAAA,CAAC,KAAD,CACY,YACN,MACL,aAAY,EAAM,MAClB,KAAM,EAAa,OAAS,WAAa,IAAA,GAC/B,WACV,MAAO,EAAM,MAAQ,CAAE,MAAO,EAAM,KAAM,EAAI,IAAA,GAC9C,QAAS,EACT,UAAW,EAEV,SAAA,CACE,CAAA,GAKL,EAAA,EAAA,IAAA,CAAC,KAAD,CACY,YACX,aAAY,EAAM,MAClB,QAAS,EACT,UAAW,EACN,MACL,KAAM,EAAa,OAAS,WAAa,IAAA,GACzC,MAAO,EAAM,MAAQ,CAAE,MAAO,EAAM,KAAM,EAAI,IAAA,GACpC,WACV,QAAS,EAAM,SAEd,SAAA,CACE,CAAA,CAEN,EAEA,EAAoB,YAAc,EAAA"}
1
+ {"version":3,"file":"cell.cjs","names":[],"sources":["../../../../components/simple-data-table/cell.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useContext, ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport CellContext from './private/cell-context';\nimport TableContext from './private/table-context';\nimport useContextHelper from './private/context-helper';\n\nimport { SIMPLE_DATA_TABLE_CELL } from '../../utilities/constants';\n\nexport interface SimpleDataTableCellProps {\n\t/** The contents of the cell */\n\tchildren?: ReactNode;\n\t/** Class names to be added to the cell */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Use this for advanced table (selectable or sortable rows) */\n\tfixedLayout?: boolean;\n\t/** The item from the items which represents this row */\n\titem?: Record<string, unknown>;\n\t/** The primary column for a row. This is almost always the first column. */\n\tprimaryColumn?: boolean;\n\t/** The property of this item to display */\n\tproperty?: string;\n\t/** Shows on hover. Useful for truncated cells. */\n\ttitle?: string;\n\t/** Width of column. Required for advanced/fixed layout tables. */\n\twidth?: string;\n\t/** Data label for stacked layout */\n\tlabel?: string;\n\t/** Header ID for accessibility */\n\theaderId?: string;\n}\n\n/**\n * The default Cell renderer for the SimpleDataTable. To customize a column's cells,\n * pass an element of any component that takes these props as the column's child.\n */\nconst SimpleDataTableCell: React.FC<SimpleDataTableCellProps> = (props) => {\n\tconst tableContext = useContext(TableContext);\n\tconst cellContext = useContext(CellContext);\n\tconst { tabIndex, hasFocus, handleFocus, handleKeyDown } = useContextHelper(\n\t\ttableContext,\n\t\tcellContext,\n\t\tprops.fixedLayout\n\t);\n\n\tconst childText = React.isValidElement(props.children)\n\t\t? (props.children.props as { children?: string }).children\n\t\t: props.children;\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={classNames({\n\t\t\t\t'slds-truncate': props.fixedLayout,\n\t\t\t})}\n\t\t\ttitle={\n\t\t\t\tprops.title || (typeof childText === 'string' ? childText : undefined)\n\t\t\t}\n\t\t>\n\t\t\t{props.children}\n\t\t</div>\n\t);\n\n\tconst className = classNames(props.className, {\n\t\t'slds-has-focus': hasFocus,\n\t});\n\n\tconst style =\n\t\tprops.width || cellContext.cornerStyle\n\t\t\t? { ...cellContext.cornerStyle, width: props.width }\n\t\t\t: undefined;\n\n\tconst ref = (node: HTMLTableCellElement | null) => {\n\t\tif (node && hasFocus) {\n\t\t\tnode.focus();\n\t\t}\n\t};\n\n\tif (props.primaryColumn) {\n\t\treturn (\n\t\t\t<th\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t\tdata-label={props.label}\n\t\t\t\trole={tableContext.isGrid ? 'gridcell' : undefined}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\tstyle={style}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t>\n\t\t\t\t{contents}\n\t\t\t</th>\n\t\t);\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tclassName={className}\n\t\t\tdata-label={props.label}\n\t\t\tonFocus={handleFocus}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tref={ref}\n\t\t\trole={tableContext.isGrid ? 'gridcell' : undefined}\n\t\t\tstyle={style}\n\t\t\ttabIndex={tabIndex}\n\t\t\theaders={props.headerId}\n\t\t>\n\t\t\t{contents}\n\t\t</td>\n\t);\n};\n\nSimpleDataTableCell.displayName = SIMPLE_DATA_TABLE_CELL;\n\nexport default SimpleDataTableCell;\n"],"mappings":"sVAuCA,IAAM,EAA2D,GAAU,CAC1E,IAAM,GAAA,EAAe,EAAA,WAAA,CAAW,EAAA,OAAY,EACtC,GAAA,EAAc,EAAA,WAAA,CAAW,EAAA,OAAW,EACpC,CAAE,WAAU,WAAU,cAAa,iBAAkB,EAAA,QAC1D,EACA,EACA,EAAM,WACP,EAEM,EAAY,EAAA,QAAM,eAAe,EAAM,QAAQ,EACjD,EAAM,SAAS,MAAgC,SAChD,EAAM,SAEH,GACL,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,CACrB,gBAAiB,EAAM,WACxB,CAAC,EACD,MACC,EAAM,QAAU,OAAO,GAAc,SAAW,EAAY,IAAA,IAG5D,SAAA,EAAM,QACH,CAAA,EAGA,GAAA,EAAY,EAAA,QAAA,CAAW,EAAM,UAAW,CAC7C,iBAAkB,CACnB,CAAC,EAEK,EACL,EAAM,OAAS,EAAY,YACxB,CAAE,GAAG,EAAY,YAAa,MAAO,EAAM,KAAM,EACjD,IAAA,GAEE,EAAO,GAAsC,CAC9C,GAAQ,GACX,EAAK,MAAM,CAEb,EAmBA,OAjBI,EAAM,eAER,EAAA,EAAA,IAAA,CAAC,KAAD,CACY,YACN,MACL,aAAY,EAAM,MAClB,KAAM,EAAa,OAAS,WAAa,IAAA,GAC/B,WACH,QACP,QAAS,EACT,UAAW,EAEV,SAAA,CACE,CAAA,GAKL,EAAA,EAAA,IAAA,CAAC,KAAD,CACY,YACX,aAAY,EAAM,MAClB,QAAS,EACT,UAAW,EACN,MACL,KAAM,EAAa,OAAS,WAAa,IAAA,GAClC,QACG,WACV,QAAS,EAAM,SAEd,SAAA,CACE,CAAA,CAEN,EAEA,EAAoB,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/key-code.cjs"),r=require("../../utilities/execution-environment.cjs"),i=require("../../utilities/is-element-of-type.cjs"),a=require("../../utilities/generate-id.cjs"),o=require("../spinner/index.cjs"),s=require("../../utilities/key-callbacks.cjs"),c=require("./check-props.cjs"),l=require("./component.cjs"),u=require("./private/table-context.cjs"),d=require("./cell.cjs"),f=require("./column.cjs"),p=require("./private/mode.cjs"),m=require("./private/head.cjs"),h=require("./private/row.cjs"),g=require("./row-actions.cjs");let _=require("react");_=e.__toESM(_,1);let v=require("classnames");v=e.__toESM(v,1);let y=require("react/jsx-runtime"),b=require("dequal"),x=require("lodash.assign");x=e.__toESM(x,1);let S=require("memoize-one");S=e.__toESM(S,1);var C=e=>Array.isArray(e)?e.length:0,w={assistiveText:{actionsHeader:`Actions`,columnSort:`Sort by: `,columnSortedAscending:`Sorted Ascending`,columnSortedDescending:`Sorted Descending`,selectAllRows:`Select all rows`,selectRow:`Select row`,selectRowGroup:`Choose a row to select`,loadingMore:`Loading more`},hasMore:!1,loadMoreOffset:20},T=[],E=e=>e.id!==void 0&&e.id!==null,D=e=>{let t=new Set(e),n=new Set(e.filter(E).map(e=>e.id));return e=>t.has(e)||E(e)&&n.has(e.id)},O=(0,S.default)(e=>({...w.assistiveText,...e}),b.dequal),k=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},A=(e,t)=>{let n=!1;if(e===t)n=!0;else if(_.default.isValidElement(e)&&_.default.isValidElement(t))n=e.type===t.type&&e.key===t.key&&A(e.props,t.props);else if(Array.isArray(e)&&Array.isArray(t))n=e.length===t.length&&e.every((e,n)=>A(e,t[n]));else if(k(e)&&k(t)){let r=Object.keys(e);n=r.length===Object.keys(t).length&&r.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&A(e[n],t[n]))}return n},j=(0,S.default)((e,t,n,r,a,o)=>{let s=[],c=null;return _.default.Children.forEach(e,e=>{if(i.default(e,f.default)){let{children:n,...i}=e.props,c={fixedLayout:r,search:o,items:a,...i};t&&(c.id=t);let l;_.default.isValidElement(n)?(l=n.type,(0,x.default)(c,n.props)):l=d.default,s.push({Cell:l,props:c})}else if(i.default(e,g.default)){let{dropdown:t}=e.props;c=_.default.cloneElement(e,{dropdown:t&&n&&t.props.menuPosition===void 0?_.default.cloneElement(t,{menuPosition:`overflowBoundaryElement`}):t})}}),{columns:s,RowActions:c}},A),M=class extends _.default.Component{static displayName=t.SIMPLE_DATA_TABLE;static defaultProps=w;generatedId;headerRefs;scrollerRef;resizeObserver;interactiveElements;tableRef;constructor(e){super(e),this.generatedId=a.default(),this.headerRefs={action:[],column:[],select:[]},this.scrollerRef=null,this.state={activeCell:{rowIndex:1,columnIndex:+!!this.props.selectRows},activeElement:null,mode:p.default.NAVIGATION,tableHasFocus:!1,allowKeyboardNavigation:e.keyboardNavigation},this.interactiveElements={},this.changeActiveCell=this.changeActiveCell.bind(this),this.changeActiveElement=this.changeActiveElement.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.registerInteractiveElement=this.registerInteractiveElement.bind(this),c.default(t.SIMPLE_DATA_TABLE,e,l.default)}componentDidMount(){this.props.fixedHeader&&(this.toggleFixedHeaderListeners(!0),this.resizeFixedHeaders())}componentDidUpdate(e,t){this.props.fixedHeader&&(this.resizeFixedHeaders(),this.loadMoreIfNeeded(void 0)),this.state.allowKeyboardNavigation&&!t.allowKeyboardNavigation&&this.setState({tableHasFocus:!0})}componentWillUnmount(){this.toggleFixedHeaderListeners(!1)}getId(){return this.props.id||this.generatedId}getFirstInteractiveElement(e,t){return this.state.mode===p.default.ACTIONABLE&&this.interactiveElements[e]&&this.interactiveElements[e][t]?this.interactiveElements[e][t][0]:null}getTableContext=(0,S.default)((e,t,n)=>({isGrid:n,activeCell:e.activeCell,activeElement:e.activeElement,mode:e.mode,tableHasFocus:e.tableHasFocus,changeActiveCell:this.changeActiveCell,changeActiveElement:this.changeActiveElement,handleKeyDown:this.handleKeyDown,registerInteractiveElement:this.registerInteractiveElement,allowKeyboardNavigation:e.allowKeyboardNavigation??!1,setAllowKeyboardNavigation:e=>{t&&this.setState({allowKeyboardNavigation:e})}}));getSelectionMatcher=(0,S.default)(D);getDisabledSelectionMatcher=(0,S.default)(D);requestSelection=(e,t)=>{typeof this.props.onRowChange==`function`&&this.props.onRowChange(e,{selection:t})};handleToggleAll=(e,{checked:t})=>{let n=this.props.selection??T,r=this.getDisabledSelectionMatcher(this.props.disabledSelection??T),i=n.filter(r),a=this.props.items.filter(e=>!r(e)),o=(t?[...a,...i]:i).filter(e=>e.type!==`header-row`);this.requestSelection(e,o)};handleRowToggle=(e,t,n)=>{let r=this.props.selection??T,i;if(t)i=this.props.selectRows===`radio`?[e]:[...r,e];else{let t=D([e]);i=r.filter(e=>!t(e))}this.requestSelection(n,i)};resizeFixedHeaders=e=>{let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action];if(this.props.onFixedHeaderResize)this.props.onFixedHeaderResize(e,{headerRefs:t.filter(Boolean),scrollerRef:this.scrollerRef});else if(t.length>0){let e=0;r.canUseDOM&&(e=document.documentElement.scrollLeft),t.forEach(t=>{if(t&&r.canUseDOM){let n=t.getBoundingClientRect().left+e,r=0;this.scrollerRef&&(r=this.scrollerRef.getBoundingClientRect().left+e);let i=t.querySelector(`.slds-cell-fixed`);i&&(i.style.left=`${n-r}px`,i.style.width=`${t.offsetWidth}px`)}})}};loadMoreIfNeeded=(e,t=`update`)=>{if(this.props.hasMore&&this.props.onLoadMore&&this.scrollerRef){let{scrollTop:n,offsetHeight:r,scrollHeight:i}=this.scrollerRef;if(n+r>i-(this.props.loadMoreOffset??0)){let n=t;(e?.type===`scroll`||e?.type===`resize`)&&(n=e.type),this.props.onLoadMore(e,{trigger:n})}}};toggleFixedHeaderListeners=e=>{if(this.props.onToggleFixedHeaderListeners)this.props.onToggleFixedHeaderListeners({},{attach:e,resizeHandler:this.resizeFixedHeaders,scrollerRef:this.scrollerRef});else{let t=e?`addEventListener`:`removeEventListener`;typeof ResizeObserver<`u`?(this.resizeObserver?.disconnect(),this.resizeObserver=void 0,e&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeFixedHeaders(),this.loadMoreIfNeeded(void 0,`resize`)}),this.scrollerRef&&this.resizeObserver.observe(this.scrollerRef),this.tableRef&&this.resizeObserver.observe(this.tableRef))):r.canUseEventListeners&&(window[t](`resize`,this.resizeFixedHeaders),window[t](`resize`,this.loadMoreIfNeeded)),r.canUseEventListeners&&this.scrollerRef&&(this.scrollerRef[t](`scroll`,this.resizeFixedHeaders),this.scrollerRef[t](`scroll`,this.loadMoreIfNeeded))}};UNSAFE_componentWillUpdate(e){this.props.items!==e.items&&(this.interactiveElements={})}changeActiveCell(e,t){this.setState({tableHasFocus:!0,activeCell:{rowIndex:e,columnIndex:t}})}changeActiveElement(e){this.setState({activeElement:e,mode:p.default.ACTIONABLE})}handleKeyDown(e){s.default(e,{callbacks:{[n.default.UP]:{callback:()=>this.handleKeyDownUp()},[n.default.DOWN]:{callback:()=>this.handleKeyDownDown()},[n.default.LEFT]:{callback:()=>this.handleKeyDownLeft()},[n.default.RIGHT]:{callback:()=>this.handleKeyDownRight()},[n.default.ENTER]:{callback:()=>this.handleKeyDownEnter()},[n.default.ESCAPE]:{callback:()=>this.handleKeyDownEscape()},[n.default.TAB]:this.state.mode===p.default.ACTIONABLE?{callback:e=>this.handleKeyTabPress(e)}:null}})}handleKeyDownUp(){let e=Math.max(this.state.activeCell.rowIndex-1,0),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t}))}handleKeyDownDown(){let e=Math.min(this.state.activeCell.rowIndex+1,this.props.items.length),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t}))}handleKeyDownLeft(){let e=Math.max(this.state.activeCell.columnIndex-1,0),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}getCellCount(){let{columns:e,RowActions:t}=j(this.props.children,this.props.id,this.props.fixedHeader,this.props.fixedLayout,this.props.items,this.props.search);return e.length+ +!!t}handleKeyDownRight(){let e=Math.min(this.state.activeCell.columnIndex+1,this.getCellCount()-+!this.props.selectRows),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}handleKeyDownEnter(){if(this.state.mode===p.default.NAVIGATION){let{rowIndex:e,columnIndex:t}=this.state.activeCell,n=null;this.interactiveElements[e]&&this.interactiveElements[e][t]&&([n]=this.interactiveElements[e][t]),this.setState({mode:p.default.ACTIONABLE,activeElement:n})}}handleKeyDownEscape(){this.state.mode===p.default.ACTIONABLE&&this.setState({mode:p.default.NAVIGATION,activeElement:null})}moveNext(e,t,n){let r=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],i=0,a=0;e.shiftKey?n-1>=0?(a=n-1,i=t):(i=t>0?t-1:this.props.items.length,a=r.length-1):n+1<r.length?(a=n+1,i=t):(i=t<this.props.items.length?t+1:0,a=0),this.changeActiveCell(i,a)}handleNextActionable(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell,r=this.state.activeElement,i=this.interactiveElements[t]&&this.interactiveElements[t][n]?this.interactiveElements[t][n]:null;if(i){if(r){let t=i.indexOf(r);return e.shiftKey?t>0?i[t-1]:null:t<i.length-1?i[t+1]:null}return e.shiftKey?i[i.length-1]:i[0]}return null}handleKeyTabPress(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell;if(this.state.mode===p.default.ACTIONABLE){let r=this.handleNextActionable(e);if(r)this.setState({activeElement:r});else if(t===0){let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],r=0;r=e.shiftKey?n-1>=0?n-1:t.length-1:n+1<t.length?n+1:0,this.setState({mode:p.default.ACTIONABLE,activeElement:null}),t.forEach((e,t)=>{e&&(t===r?(e.tabIndex=0,e.focus()):e.tabIndex=-1)})}else this.moveNext(e,t,n),this.setState({mode:p.default.ACTIONABLE,activeElement:null})}}registerInteractiveElement(e,t,n){this.interactiveElements[e]||(this.interactiveElements[e]={});let r=this.interactiveElements[e][t]||[];r.includes(n)||(this.interactiveElements[e][t]=[...r,n])}render(){let e={},n=this.getSelectionMatcher(this.props.selection??T),r=this.getDisabledSelectionMatcher(this.props.disabledSelection??T),i=C(this.props.items),s=this.props.items.filter(e=>e.type!==`header-row`&&!r(e)),c=s.length,l=s.filter(n).length,d=this.props.selectRows&&c>0?this.props.selectRows:!1,f=d&&c===l,g=d&&c!==l&&l!==0,{columns:b,RowActions:x}=j(this.props.children,this.props.id,this.props.fixedHeader,this.props.fixedLayout,this.props.items,this.props.search),S=O(this.props.assistiveText);this.props.selectRows&&this.props.selectRows!==`radio`&&(e[`aria-multiselectable`]=`true`),this.headerRefs={action:x?this.headerRefs.action:[],column:this.headerRefs.column.slice(0,b.length),select:d?this.headerRefs.select:[]};let w=!!(this.props.fixedLayout&&this.props.keyboardNavigation),E=(0,y.jsxs)(_.default.Fragment,{children:[(0,y.jsx)(u.default.Provider,{value:this.getTableContext(this.state,this.props.keyboardNavigation,w),children:(0,y.jsxs)(`table`,{...e,className:(0,v.default)(`slds-table`,{"slds-table_fixed-layout":this.props.fixedLayout,"slds-table_header-fixed":this.props.fixedHeader,"slds-table_resizable-cols":this.props.fixedLayout,"slds-table_bordered":!this.props.unborderedRow,"slds-table_cell-buffer":!this.props.fixedLayout&&!this.props.unbufferedCell,"slds-max-medium-table_stacked":this.props.stacked,"slds-max-medium-table_stacked-horizontal":this.props.stackedHorizontal,"slds-table_striped":this.props.striped,"slds-table_col-bordered":this.props.columnBordered,"slds-no-row-hover":this.props.noRowHover,"slds-table_header-hidden":this.props.isHeadless},this.props.className),id:this.getId(),ref:e=>{e&&(this.tableRef=e)},role:w?`grid`:void 0,onBlur:e=>{this.tableRef&&!this.tableRef.contains(e.relatedTarget)&&this.setState({tableHasFocus:!1,mode:p.default.NAVIGATION,activeElement:null})},style:this.props.style,children:[(0,y.jsx)(m.default,{assistiveText:S,allSelected:f,fixedHeader:this.props.fixedHeader,fixedLayout:this.props.fixedLayout,headerRefs:(e,t)=>{t===`action`||t===`select`?e?this.headerRefs[t][0]=e:this.headerRefs[t]=[]:this.headerRefs.column[t]=e},isHidden:this.props.isHeadless,indeterminateSelected:g,canSelectRows:d,columns:b,id:`${this.getId()}-${t.SIMPLE_DATA_TABLE_HEAD}`,onToggleAll:this.handleToggleAll,onSort:this.props.onSort,showRowActions:!!x}),(0,y.jsx)(`tbody`,{children:i>0?this.props.items.map((e,i)=>{let o=this.getId()&&e.id?`${this.getId()}-${t.SIMPLE_DATA_TABLE_ROW}-${e.id}`:a.default();if(e.type===`header-row`){let t={assistiveText:S,classNameRow:e.classNameRow,columns:b,id:o,tableId:this.getId(),item:e};if(this.props.renderSubHeadingRow)return(0,y.jsx)(_.default.Fragment,{children:this.props.renderSubHeadingRow(t)},o);if(this.props.onRenderSubHeadingRow)return this.props.onRenderSubHeadingRow({...t,key:o})}return(0,y.jsx)(h.default,{assistiveText:S,canSelectRows:d,className:e.classNameRow,columns:b,fixedLayout:this.props.fixedLayout,id:o,index:i,item:e,onToggle:this.handleRowToggle,isSelected:n(e),isDisabled:r(e),rowActions:x,tableId:this.getId(),rowIndex:i+1},o)}):null})]})}),this.props.fixedHeader&&this.props.hasMore&&(0,y.jsx)(`div`,{className:`slds-is-relative slds-p-around_large`,children:(0,y.jsx)(o.default,{assistiveText:{label:this.props.assistiveText?.loadingMore},hasContainer:!1,size:`small`,variant:`brand`})})]});if(this.props.fixedHeader){let e=`1px solid var(--slds-g-color-border-1)`,t={borderTop:e,height:`100%`};this.props.joined&&(t.borderBottom=e,t.borderLeft=e,t.borderRight=e,t.borderTop=`none`,t.borderRadius=`0 0 var(--slds-g-radius-border-2) var(--slds-g-radius-border-2)`),E=(0,y.jsx)(`div`,{className:`slds-table_header-fixed_container`,style:t,onScroll:e=>{let t=e.target.scrollLeft;t>0&&(e.target.scrollLeft=0,this.scrollerRef&&(this.scrollerRef.scrollLeft=t))},children:(0,y.jsx)(`div`,{className:`slds-table_header-fixed_scroller`,ref:e=>{this.scrollerRef=e},style:{height:`100%`,overflow:`auto`},children:E})})}return E}};exports.default=M;
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/key-code.cjs"),r=require("../../utilities/execution-environment.cjs"),i=require("../../utilities/is-element-of-type.cjs"),a=require("../../utilities/generate-id.cjs"),o=require("../spinner/index.cjs"),s=require("../../utilities/key-callbacks.cjs"),c=require("./check-props.cjs"),l=require("./component.cjs"),u=require("./private/table-context.cjs"),d=require("./cell.cjs"),f=require("./column.cjs"),p=require("./private/mode.cjs"),m=require("./private/corner-style.cjs"),h=require("./private/head.cjs"),g=require("./private/row.cjs"),_=require("./row-actions.cjs");let v=require("react");v=e.__toESM(v,1);let y=require("classnames");y=e.__toESM(y,1);let b=require("react/jsx-runtime"),x=require("dequal"),S=require("lodash.assign");S=e.__toESM(S,1);let C=require("memoize-one");C=e.__toESM(C,1);var w=e=>Array.isArray(e)?e.length:0,T={assistiveText:{actionsHeader:`Actions`,columnSort:`Sort by: `,columnSortedAscending:`Sorted Ascending`,columnSortedDescending:`Sorted Descending`,selectAllRows:`Select all rows`,selectRow:`Select row`,selectRowGroup:`Choose a row to select`,loadingMore:`Loading more`},hasMore:!1,loadMoreOffset:20},E=[],D=e=>e.id!==void 0&&e.id!==null,O=e=>{let t=new Set(e),n=new Set(e.filter(D).map(e=>e.id));return e=>t.has(e)||D(e)&&n.has(e.id)},k=(0,C.default)(e=>({...T.assistiveText,...e}),x.dequal),A=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},j=(e,t)=>{let n=!1;if(e===t)n=!0;else if(v.default.isValidElement(e)&&v.default.isValidElement(t))n=e.type===t.type&&e.key===t.key&&j(e.props,t.props);else if(Array.isArray(e)&&Array.isArray(t))n=e.length===t.length&&e.every((e,n)=>j(e,t[n]));else if(A(e)&&A(t)){let r=Object.keys(e);n=r.length===Object.keys(t).length&&r.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&j(e[n],t[n]))}return n},M=(0,C.default)((e,t,n,r,a,o)=>{let s=[],c=null;return v.default.Children.forEach(e,e=>{if(i.default(e,f.default)){let{children:n,...i}=e.props,c={fixedLayout:r,search:o,items:a,...i};t&&(c.id=t);let l;v.default.isValidElement(n)?(l=n.type,(0,S.default)(c,n.props)):l=d.default,s.push({Cell:l,props:c})}else if(i.default(e,_.default)){let{dropdown:t}=e.props;c=v.default.cloneElement(e,{dropdown:t&&n&&t.props.menuPosition===void 0?v.default.cloneElement(t,{menuPosition:`overflowBoundaryElement`}):t})}}),{columns:s,RowActions:c}},j),N=class extends v.default.Component{static displayName=t.SIMPLE_DATA_TABLE;static defaultProps=T;generatedId;headerRefs;scrollerRef;resizeObserver;interactiveElements;tableRef;constructor(e){super(e),this.generatedId=a.default(),this.headerRefs={action:[],column:[],select:[]},this.scrollerRef=null,this.state={activeCell:{rowIndex:1,columnIndex:+!!this.props.selectRows},activeElement:null,mode:p.default.NAVIGATION,tableHasFocus:!1,allowKeyboardNavigation:e.keyboardNavigation},this.interactiveElements={},this.changeActiveCell=this.changeActiveCell.bind(this),this.changeActiveElement=this.changeActiveElement.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.registerInteractiveElement=this.registerInteractiveElement.bind(this),c.default(t.SIMPLE_DATA_TABLE,e,l.default)}componentDidMount(){this.props.fixedHeader&&(this.toggleFixedHeaderListeners(!0),this.resizeFixedHeaders())}componentDidUpdate(e,t){this.props.fixedHeader&&(this.resizeFixedHeaders(),this.loadMoreIfNeeded(void 0)),this.state.allowKeyboardNavigation&&!t.allowKeyboardNavigation&&this.setState({tableHasFocus:!0})}componentWillUnmount(){this.toggleFixedHeaderListeners(!1)}getId(){return this.props.id||this.generatedId}getFirstInteractiveElement(e,t){return this.state.mode===p.default.ACTIONABLE&&this.interactiveElements[e]&&this.interactiveElements[e][t]?this.interactiveElements[e][t][0]:null}getTableContext=(0,C.default)((e,t,n)=>({isGrid:n,activeCell:e.activeCell,activeElement:e.activeElement,mode:e.mode,tableHasFocus:e.tableHasFocus,changeActiveCell:this.changeActiveCell,changeActiveElement:this.changeActiveElement,handleKeyDown:this.handleKeyDown,registerInteractiveElement:this.registerInteractiveElement,allowKeyboardNavigation:e.allowKeyboardNavigation??!1,setAllowKeyboardNavigation:e=>{t&&this.setState({allowKeyboardNavigation:e})}}));getSelectionMatcher=(0,C.default)(O);getDisabledSelectionMatcher=(0,C.default)(O);requestSelection=(e,t)=>{typeof this.props.onRowChange==`function`&&this.props.onRowChange(e,{selection:t})};handleToggleAll=(e,{checked:t})=>{let n=this.props.selection??E,r=this.getDisabledSelectionMatcher(this.props.disabledSelection??E),i=n.filter(r),a=this.props.items.filter(e=>!r(e)),o=(t?[...a,...i]:i).filter(e=>e.type!==`header-row`);this.requestSelection(e,o)};handleRowToggle=(e,t,n)=>{let r=this.props.selection??E,i;if(t)i=this.props.selectRows===`radio`?[e]:[...r,e];else{let t=O([e]);i=r.filter(e=>!t(e))}this.requestSelection(n,i)};resizeFixedHeaders=e=>{let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action];if(this.props.onFixedHeaderResize)this.props.onFixedHeaderResize(e,{headerRefs:t.filter(Boolean),scrollerRef:this.scrollerRef});else if(t.length>0){let e=0;r.canUseDOM&&(e=document.documentElement.scrollLeft),t.forEach(t=>{if(t&&r.canUseDOM){let n=t.getBoundingClientRect().left+e,r=0;this.scrollerRef&&(r=this.scrollerRef.getBoundingClientRect().left+e);let i=t.querySelector(`.slds-cell-fixed`);i&&(i.style.left=`${n-r}px`,i.style.width=`${t.offsetWidth}px`)}})}};loadMoreIfNeeded=(e,t=`update`)=>{if(this.props.hasMore&&this.props.onLoadMore&&this.scrollerRef){let{scrollTop:n,offsetHeight:r,scrollHeight:i}=this.scrollerRef;if(n+r>i-(this.props.loadMoreOffset??0)){let n=t;(e?.type===`scroll`||e?.type===`resize`)&&(n=e.type),this.props.onLoadMore(e,{trigger:n})}}};toggleFixedHeaderListeners=e=>{if(this.props.onToggleFixedHeaderListeners)this.props.onToggleFixedHeaderListeners({},{attach:e,resizeHandler:this.resizeFixedHeaders,scrollerRef:this.scrollerRef});else{let t=e?`addEventListener`:`removeEventListener`;typeof ResizeObserver<`u`?(this.resizeObserver?.disconnect(),this.resizeObserver=void 0,e&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeFixedHeaders(),this.loadMoreIfNeeded(void 0,`resize`)}),this.scrollerRef&&this.resizeObserver.observe(this.scrollerRef),this.tableRef&&this.resizeObserver.observe(this.tableRef))):r.canUseEventListeners&&(window[t](`resize`,this.resizeFixedHeaders),window[t](`resize`,this.loadMoreIfNeeded)),r.canUseEventListeners&&this.scrollerRef&&(this.scrollerRef[t](`scroll`,this.resizeFixedHeaders),this.scrollerRef[t](`scroll`,this.loadMoreIfNeeded))}};UNSAFE_componentWillUpdate(e){this.props.items!==e.items&&(this.interactiveElements={})}changeActiveCell(e,t){this.setState({tableHasFocus:!0,activeCell:{rowIndex:e,columnIndex:t}})}changeActiveElement(e){this.setState({activeElement:e,mode:p.default.ACTIONABLE})}handleKeyDown(e){s.default(e,{callbacks:{[n.default.UP]:{callback:()=>this.handleKeyDownUp()},[n.default.DOWN]:{callback:()=>this.handleKeyDownDown()},[n.default.LEFT]:{callback:()=>this.handleKeyDownLeft()},[n.default.RIGHT]:{callback:()=>this.handleKeyDownRight()},[n.default.ENTER]:{callback:()=>this.handleKeyDownEnter()},[n.default.ESCAPE]:{callback:()=>this.handleKeyDownEscape()},[n.default.TAB]:this.state.mode===p.default.ACTIONABLE?{callback:e=>this.handleKeyTabPress(e)}:null}})}handleKeyDownUp(){let e=Math.max(this.state.activeCell.rowIndex-1,0),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t}))}handleKeyDownDown(){let e=Math.min(this.state.activeCell.rowIndex+1,this.props.items.length),t=this.getFirstInteractiveElement(e,this.state.activeCell.columnIndex);e!==this.state.activeCell.rowIndex&&this.setState(n=>({activeCell:{rowIndex:e,columnIndex:n.activeCell.columnIndex},activeElement:t}))}handleKeyDownLeft(){let e=Math.max(this.state.activeCell.columnIndex-1,0),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}getCellCount(){let{columns:e,RowActions:t}=M(this.props.children,this.props.id,this.props.fixedHeader,this.props.fixedLayout,this.props.items,this.props.search);return e.length+ +!!t}handleKeyDownRight(){let e=Math.min(this.state.activeCell.columnIndex+1,this.getCellCount()-+!this.props.selectRows),t=this.getFirstInteractiveElement(this.state.activeCell.rowIndex,e);e!==this.state.activeCell.columnIndex&&this.setState(n=>({activeCell:{rowIndex:n.activeCell.rowIndex,columnIndex:e},activeElement:t}))}handleKeyDownEnter(){if(this.state.mode===p.default.NAVIGATION){let{rowIndex:e,columnIndex:t}=this.state.activeCell,n=null;this.interactiveElements[e]&&this.interactiveElements[e][t]&&([n]=this.interactiveElements[e][t]),this.setState({mode:p.default.ACTIONABLE,activeElement:n})}}handleKeyDownEscape(){this.state.mode===p.default.ACTIONABLE&&this.setState({mode:p.default.NAVIGATION,activeElement:null})}moveNext(e,t,n){let r=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],i,a;e.shiftKey?n-1>=0?(a=n-1,i=t):(i=t>0?t-1:this.props.items.length,a=r.length-1):n+1<r.length?(a=n+1,i=t):(i=t<this.props.items.length?t+1:0,a=0),this.changeActiveCell(i,a)}handleNextActionable(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell,r=this.state.activeElement,i=this.interactiveElements[t]&&this.interactiveElements[t][n]?this.interactiveElements[t][n]:null;if(i){if(r){let t=i.indexOf(r);return e.shiftKey?t>0?i[t-1]:null:t<i.length-1?i[t+1]:null}return e.shiftKey?i[i.length-1]:i[0]}return null}handleKeyTabPress(e){let{rowIndex:t,columnIndex:n}=this.state.activeCell;if(this.state.mode===p.default.ACTIONABLE){let r=this.handleNextActionable(e);if(r)this.setState({activeElement:r});else if(t===0){let t=[...this.headerRefs.select,...this.headerRefs.column,...this.headerRefs.action],r=0;r=e.shiftKey?n-1>=0?n-1:t.length-1:n+1<t.length?n+1:0,this.setState({mode:p.default.ACTIONABLE,activeElement:null}),t.forEach((e,t)=>{e&&(t===r?(e.tabIndex=0,e.focus()):e.tabIndex=-1)})}else this.moveNext(e,t,n),this.setState({mode:p.default.ACTIONABLE,activeElement:null})}}registerInteractiveElement(e,t,n){this.interactiveElements[e]||(this.interactiveElements[e]={});let r=this.interactiveElements[e][t]||[];r.includes(n)||(this.interactiveElements[e][t]=[...r,n])}render(){let e={},n=this.getSelectionMatcher(this.props.selection??E),r=this.getDisabledSelectionMatcher(this.props.disabledSelection??E),i=w(this.props.items),s=this.props.items.filter(e=>e.type!==`header-row`&&!r(e)),c=s.length,l=s.filter(n).length,d=this.props.selectRows&&c>0?this.props.selectRows:!1,f=d&&c===l,_=d&&c!==l&&l!==0,{columns:x,RowActions:S}=M(this.props.children,this.props.id,this.props.fixedHeader,this.props.fixedLayout,this.props.items,this.props.search),C=k(this.props.assistiveText);this.props.selectRows&&this.props.selectRows!==`radio`&&(e[`aria-multiselectable`]=`true`),this.headerRefs={action:S?this.headerRefs.action:[],column:this.headerRefs.column.slice(0,x.length),select:d?this.headerRefs.select:[]};let T=!!(this.props.fixedLayout&&this.props.keyboardNavigation),D=(0,b.jsxs)(v.default.Fragment,{children:[(0,b.jsx)(u.default.Provider,{value:this.getTableContext(this.state,this.props.keyboardNavigation,T),children:(0,b.jsxs)(`table`,{...e,className:(0,y.default)(`slds-table`,{"slds-table_fixed-layout":this.props.fixedLayout,"slds-table_header-fixed":this.props.fixedHeader,"slds-table_resizable-cols":this.props.fixedLayout,"slds-table_bordered":!this.props.unborderedRow,"slds-table_cell-buffer":!this.props.fixedLayout&&!this.props.unbufferedCell,"slds-max-medium-table_stacked":this.props.stacked,"slds-max-medium-table_stacked-horizontal":this.props.stackedHorizontal,"slds-table_striped":this.props.striped,"slds-table_col-bordered":this.props.columnBordered,"slds-no-row-hover":this.props.noRowHover},this.props.className),id:this.getId(),ref:e=>{e&&(this.tableRef=e)},role:T?`grid`:void 0,onBlur:e=>{this.tableRef&&!this.tableRef.contains(e.relatedTarget)&&this.setState({tableHasFocus:!1,mode:p.default.NAVIGATION,activeElement:null})},style:this.props.style,children:[(0,b.jsx)(h.default,{assistiveText:C,allSelected:f,fixedHeader:this.props.fixedHeader,fixedLayout:this.props.fixedLayout,headerRefs:(e,t)=>{t===`action`||t===`select`?e?this.headerRefs[t][0]=e:this.headerRefs[t]=[]:this.headerRefs.column[t]=e},isHidden:this.props.isHeadless,isOnlyRow:i===0,indeterminateSelected:_,canSelectRows:d,columns:x,id:`${this.getId()}-${t.SIMPLE_DATA_TABLE_HEAD}`,onToggleAll:this.handleToggleAll,onSort:this.props.onSort,showRowActions:!!S}),(0,b.jsx)(`tbody`,{style:m.inheritRadius,children:i>0?this.props.items.map((e,o)=>{let s=this.getId()&&e.id?`${this.getId()}-${t.SIMPLE_DATA_TABLE_ROW}-${e.id}`:a.default();if(e.type===`header-row`){let t={assistiveText:C,classNameRow:e.classNameRow,columns:x,id:s,tableId:this.getId(),item:e};if(this.props.renderSubHeadingRow)return(0,b.jsx)(v.default.Fragment,{children:this.props.renderSubHeadingRow(t)},s);if(this.props.onRenderSubHeadingRow)return this.props.onRenderSubHeadingRow({...t,key:s})}return(0,b.jsx)(g.default,{assistiveText:C,canSelectRows:d,className:e.classNameRow,columns:x,fixedLayout:this.props.fixedLayout,id:s,index:o,item:e,onToggle:this.handleRowToggle,isSelected:n(e),isDisabled:r(e),rowActions:S,tableId:this.getId(),rowIndex:o+1,isFirstRow:this.props.isHeadless&&o===0,isLastRow:o===i-1},s)}):null})]})}),this.props.fixedHeader&&this.props.hasMore&&(0,b.jsx)(`div`,{className:`slds-is-relative slds-p-around_large`,children:(0,b.jsx)(o.default,{assistiveText:{label:this.props.assistiveText?.loadingMore},hasContainer:!1,size:`small`,variant:`brand`})})]});if(this.props.fixedHeader){let e=`1px solid var(--slds-g-color-border-1, rgb(221, 219, 218))`,t={borderTop:e,height:`100%`};this.props.joined&&(t.borderBottom=e,t.borderLeft=e,t.borderRight=e,t.borderTop=`none`,t.borderRadius=`0 0 var(--slds-g-radius-border-2, 0.25rem) var(--slds-g-radius-border-2, 0.25rem)`),D=(0,b.jsx)(`div`,{className:`slds-table_header-fixed_container`,style:t,onScroll:e=>{let t=e.target.scrollLeft;t>0&&(e.target.scrollLeft=0,this.scrollerRef&&(this.scrollerRef.scrollLeft=t))},children:(0,b.jsx)(`div`,{className:`slds-table_header-fixed_scroller`,ref:e=>{this.scrollerRef=e},style:{height:`100%`,overflow:`auto`},children:D})})}return D}};exports.default=N;
2
2
  //# sourceMappingURL=index.cjs.map