@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":"nav-dropdown.js","names":[],"sources":["../../../../components/builder-header/nav-dropdown.tsx"],"sourcesContent":["import Button from '../button';\nimport Icon from '../icon';\nimport Dropdown from '../menu-dropdown';\nimport { type MenuDropdownBaseProps } from '../menu-dropdown/menu-dropdown';\nimport type { IconCategory } from '../../types/common';\n\nimport { BUILDER_HEADER_NAV_DROPDOWN } from '../../utilities/constants';\n\nexport interface BuilderHeaderNavDropdownProps extends Omit<\n\tMenuDropdownBaseProps,\n\t'assistiveText'\n> {\n\t/**\n\t * Assistive text for accessibility. `icon` labels the leading icon.\n\t */\n\tassistiveText?: { icon?: string } & Record<string, unknown>;\n\t/**\n\t * Category of the leading icon.\n\t */\n\ticonCategory?: IconCategory;\n\t/**\n\t * Name of the leading icon.\n\t */\n\ticonName?: string;\n\t/**\n\t * Text label shown next to the icon.\n\t */\n\tlabel?: string;\n\t/** Passed to the dropdown; the trigger is built by this component. */\n\tbuttonVariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n}\n\n/**\n * A dropdown within the navigation section of the header.\n */\nconst BuilderHeaderNavDropdown = (props: BuilderHeaderNavDropdownProps) => {\n\t// Separate props we care about in order to pass others along passively to the dropdown component\n\tconst { iconCategory, iconName, label, assistiveText, ...rest } = props;\n\treturn (\n\t\t<Dropdown\n\t\t\t{...(rest as MenuDropdownBaseProps)}\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"slds-builder-header__item-action slds-media slds-media_center\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText && assistiveText.icon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory={iconCategory}\n\t\t\t\t\t\t\tcontainerClassName=\"slds-icon_container slds-icon-utility-page slds-current-color\"\n\t\t\t\t\t\t\tname={iconName}\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\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t<span className=\"slds-truncate\" title={label}>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tcontainerClassName=\"slds-icon_container slds-icon-utility-chevrondown slds-current-color slds-m-left_small\"\n\t\t\t\t\t\t\tname=\"chevrondown\"\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</Button>\n\t\t\t}\n\t\t/>\n\t);\n};\n\nBuilderHeaderNavDropdown.displayName = BUILDER_HEADER_NAV_DROPDOWN;\nexport default BuilderHeaderNavDropdown;\n"],"mappings":";;;;;;AAmCA,IAAM,KAA4B,MAAyC;CAE1E,IAAM,EAAE,iBAAc,aAAU,UAAO,kBAAe,GAAG,MAAS;CAClE,OACC,kBAAC,GAAD;EACC,GAAK;EACL,SACC,kBAAC,GAAD;GACC,WAAU;GACV,SAAQ;GAFT,UAAA,CAIC,kBAAC,QAAD;IAAM,WAAU;IACf,UAAA,kBAAC,GAAD;KACC,eAAe,EACd,OAAO,KAAiB,EAAc,KACvC;KACA,UAAU;KACV,oBAAmB;KACnB,MAAM;KACN,MAAK;IACL,CAAA;GACI,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACC,kBAAC,QAAD;KAAM,WAAU;KAAgB,OAAO;KACrC,UAAA;IACI,CAAA,GACN,kBAAC,GAAD;KACC,UAAS;KACT,oBAAmB;KACnB,MAAK;KACL,MAAK;IACL,CAAA,CACI;GACC,CAAA,CAAA;;CAET,CAAA;AAEH;AAEA,EAAyB,cAAc"}
1
+ {"version":3,"file":"nav-dropdown.js","names":[],"sources":["../../../../components/builder-header/nav-dropdown.tsx"],"sourcesContent":["import Button from '../button';\nimport Icon from '../icon';\nimport Dropdown from '../menu-dropdown';\nimport { type MenuDropdownBaseProps } from '../menu-dropdown/menu-dropdown';\nimport type { IconCategory } from '../../types/common';\n\nimport { BUILDER_HEADER_NAV_DROPDOWN } from '../../utilities/constants';\n\nexport interface BuilderHeaderNavDropdownProps extends Omit<\n\tMenuDropdownBaseProps,\n\t'assistiveText'\n> {\n\t/**\n\t * Assistive text for accessibility. `icon` labels the leading icon.\n\t */\n\tassistiveText?: {\n\t\t/** Label of the leading icon. */\n\t\ticon?: string;\n\t} & Record<string, unknown>;\n\t/**\n\t * Category of the leading icon.\n\t */\n\ticonCategory?: IconCategory;\n\t/**\n\t * Name of the leading icon.\n\t */\n\ticonName?: string;\n\t/**\n\t * Text label shown next to the icon.\n\t */\n\tlabel?: string;\n\t/** Passed to the dropdown; the trigger is built by this component. */\n\tbuttonVariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n}\n\n/**\n * A dropdown within the navigation section of the header.\n */\nconst BuilderHeaderNavDropdown = (props: BuilderHeaderNavDropdownProps) => {\n\t// Separate props we care about in order to pass others along passively to the dropdown component\n\tconst { iconCategory, iconName, label, assistiveText, ...rest } = props;\n\treturn (\n\t\t<Dropdown\n\t\t\t{...(rest as MenuDropdownBaseProps)}\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"slds-builder-header__item-action slds-media slds-media_center\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText && assistiveText.icon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory={iconCategory}\n\t\t\t\t\t\t\tcontainerClassName=\"slds-icon_container slds-icon-utility-page slds-current-color\"\n\t\t\t\t\t\t\tname={iconName}\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\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t<span className=\"slds-truncate\" title={label}>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tcontainerClassName=\"slds-icon_container slds-icon-utility-chevrondown slds-current-color slds-m-left_small\"\n\t\t\t\t\t\t\tname=\"chevrondown\"\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</Button>\n\t\t\t}\n\t\t/>\n\t);\n};\n\nBuilderHeaderNavDropdown.displayName = BUILDER_HEADER_NAV_DROPDOWN;\nexport default BuilderHeaderNavDropdown;\n"],"mappings":";;;;;;AAsCA,IAAM,KAA4B,MAAyC;CAE1E,IAAM,EAAE,iBAAc,aAAU,UAAO,kBAAe,GAAG,MAAS;CAClE,OACC,kBAAC,GAAD;EACC,GAAK;EACL,SACC,kBAAC,GAAD;GACC,WAAU;GACV,SAAQ;GAFT,UAAA,CAIC,kBAAC,QAAD;IAAM,WAAU;IACf,UAAA,kBAAC,GAAD;KACC,eAAe,EACd,OAAO,KAAiB,EAAc,KACvC;KACA,UAAU;KACV,oBAAmB;KACnB,MAAM;KACN,MAAK;IACL,CAAA;GACI,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACC,kBAAC,QAAD;KAAM,WAAU;KAAgB,OAAO;KACrC,UAAA;IACI,CAAA,GACN,kBAAC,GAAD;KACC,UAAS;KACT,oBAAmB;KACnB,MAAK;KACL,MAAK;IACL,CAAA,CACI;GACC,CAAA,CAAA;;CAET,CAAA;AAEH;AAEA,EAAyB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"nav-link.js","names":[],"sources":["../../../../components/builder-header/nav-link.tsx"],"sourcesContent":["import React, { type MouseEvent } from 'react';\nimport EventUtil from '../../utilities/event';\n\nimport Icon from '../icon';\nimport type { IconCategory } from '../../types/common';\n\nimport { BUILDER_HEADER_NAV_LINK } from '../../utilities/constants';\n\nexport interface BuilderHeaderNavLinkAssistiveText {\n\t/** Used for the icon next to the link text. */\n\ticon?: string;\n}\n\nexport interface BuilderHeaderNavLinkProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `icon`: Used for the icon next to the link text.\n\t * * _Tested with snapshot testing._\n\t */\n\tassistiveText?: BuilderHeaderNavLinkAssistiveText;\n\t/**\n\t * Name of the icon category. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon categories.\n\t */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/**\n\t * Name of the icon. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon names.\n\t */\n\ticonName?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\ticonPath?: string;\n\t/**\n\t * Text for the link.\n\t */\n\tlabel?: string;\n\t/**\n\t * Triggered when the link is clicked.\n\t */\n\tonClick?: (event: MouseEvent) => void;\n}\n\nconst defaultAssistiveText: BuilderHeaderNavLinkAssistiveText = {};\n\n/**\n * A link within the navigation section of the header.\n */\nconst BuilderHeaderNavLink = (\n\tprops: BuilderHeaderNavLinkProps\n): React.ReactElement => {\n\tconst assistiveText = {\n\t\t...defaultAssistiveText,\n\t\t...props.assistiveText,\n\t};\n\n\treturn (\n\t\t<a\n\t\t\tclassName=\"slds-builder-header__item-action slds-media slds-media_center\"\n\t\t\thref=\"#\"\n\t\t\tonClick={EventUtil.trappedHandler(props.onClick)}\n\t\t>\n\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t<Icon\n\t\t\t\t\tassistiveText={{ label: assistiveText.icon }}\n\t\t\t\t\tcategory={props.iconCategory as IconCategory}\n\t\t\t\t\tcontainerClassName=\"slds-icon_container slds-icon-utility-settings slds-current-color\"\n\t\t\t\t\tname={props.iconName}\n\t\t\t\t\tpath={props.iconPath}\n\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t/>\n\t\t\t</span>\n\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t<span className=\"slds-truncate\" title={props.label}>\n\t\t\t\t\t{props.label}\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</a>\n\t);\n};\n\nBuilderHeaderNavLink.displayName = BUILDER_HEADER_NAV_LINK;\n\nBuilderHeaderNavLink.defaultProps = {\n\tassistiveText: {},\n\ticonCategory: '' as BuilderHeaderNavLinkProps['iconCategory'],\n\ticonName: '',\n\tlabel: '',\n};\n\nexport default BuilderHeaderNavLink;\n"],"mappings":";;;;;;AA2CA,IAAM,IAA0D,CAAC,GAK3D,KACL,MACwB;CACxB,IAAM,IAAgB;EACrB,GAAG;EACH,GAAG,EAAM;CACV;CAEA,OACC,kBAAC,KAAD;EACC,WAAU;EACV,MAAK;EACL,SAAS,EAAU,eAAe,EAAM,OAAO;EAHhD,UAAA,CAKC,kBAAC,QAAD;GAAM,WAAU;GACf,UAAA,kBAAC,GAAD;IACC,eAAe,EAAE,OAAO,EAAc,KAAK;IAC3C,UAAU,EAAM;IAChB,oBAAmB;IACnB,MAAM,EAAM;IACZ,MAAM,EAAM;IACZ,MAAK;GACL,CAAA;EACI,CAAA,GACN,kBAAC,QAAD;GAAM,WAAU;GACf,UAAA,kBAAC,QAAD;IAAM,WAAU;IAAgB,OAAO,EAAM;IAC3C,UAAA,EAAM;GACF,CAAA;EACD,CAAA,CACJ;;AAEL;AAEA,EAAqB,cAAc,GAEnC,EAAqB,eAAe;CACnC,eAAe,CAAC;CAChB,cAAc;CACd,UAAU;CACV,OAAO;AACR"}
1
+ {"version":3,"file":"nav-link.js","names":[],"sources":["../../../../components/builder-header/nav-link.tsx"],"sourcesContent":["import React, { type MouseEvent } from 'react';\nimport EventUtil from '../../utilities/event';\n\nimport Icon from '../icon';\nimport type { IconCategory } from '../../types/common';\n\nimport { BUILDER_HEADER_NAV_LINK } from '../../utilities/constants';\n\nexport interface BuilderHeaderNavLinkAssistiveText {\n\t/** Used for the icon next to the link text. */\n\ticon?: string;\n}\n\nexport interface BuilderHeaderNavLinkProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `icon`: Used for the icon next to the link text.\n\t */\n\tassistiveText?: BuilderHeaderNavLinkAssistiveText;\n\t/**\n\t * Name of the icon category. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon categories.\n\t */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/**\n\t * Name of the icon. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon names.\n\t */\n\ticonName?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\ticonPath?: string;\n\t/**\n\t * Text for the link.\n\t */\n\tlabel?: string;\n\t/**\n\t * Triggered when the link is clicked.\n\t */\n\tonClick?: (event: MouseEvent) => void;\n}\n\nconst defaultAssistiveText: BuilderHeaderNavLinkAssistiveText = {};\n\n/**\n * A link within the navigation section of the header.\n */\nconst BuilderHeaderNavLink = (\n\tprops: BuilderHeaderNavLinkProps\n): React.ReactElement => {\n\tconst assistiveText = {\n\t\t...defaultAssistiveText,\n\t\t...props.assistiveText,\n\t};\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/anchor-is-valid -- SLDS builder header markup uses an anchor for nav items\n\t\t<a\n\t\t\tclassName=\"slds-builder-header__item-action slds-media slds-media_center\"\n\t\t\thref=\"#\"\n\t\t\tonClick={EventUtil.trappedHandler(props.onClick)}\n\t\t>\n\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t<Icon\n\t\t\t\t\tassistiveText={{ label: assistiveText.icon }}\n\t\t\t\t\tcategory={props.iconCategory as IconCategory}\n\t\t\t\t\tcontainerClassName=\"slds-icon_container slds-icon-utility-settings slds-current-color\"\n\t\t\t\t\tname={props.iconName}\n\t\t\t\t\tpath={props.iconPath}\n\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t/>\n\t\t\t</span>\n\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t<span className=\"slds-truncate\" title={props.label}>\n\t\t\t\t\t{props.label}\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</a>\n\t);\n};\n\nBuilderHeaderNavLink.displayName = BUILDER_HEADER_NAV_LINK;\n\nBuilderHeaderNavLink.defaultProps = {\n\tassistiveText: {},\n\ticonCategory: '' as BuilderHeaderNavLinkProps['iconCategory'],\n\ticonName: '',\n\tlabel: '',\n};\n\nexport default BuilderHeaderNavLink;\n"],"mappings":";;;;;;AA0CA,IAAM,IAA0D,CAAC,GAK3D,KACL,MACwB;CACxB,IAAM,IAAgB;EACrB,GAAG;EACH,GAAG,EAAM;CACV;CAEA,OAEC,kBAAC,KAAD;EACC,WAAU;EACV,MAAK;EACL,SAAS,EAAU,eAAe,EAAM,OAAO;EAHhD,UAAA,CAKC,kBAAC,QAAD;GAAM,WAAU;GACf,UAAA,kBAAC,GAAD;IACC,eAAe,EAAE,OAAO,EAAc,KAAK;IAC3C,UAAU,EAAM;IAChB,oBAAmB;IACnB,MAAM,EAAM;IACZ,MAAM,EAAM;IACZ,MAAK;GACL,CAAA;EACI,CAAA,GACN,kBAAC,QAAD;GAAM,WAAU;GACf,UAAA,kBAAC,QAAD;IAAM,WAAU;IAAgB,OAAO,EAAM;IAC3C,UAAA,EAAM;GACF,CAAA;EACD,CAAA,CACJ;;AAEL;AAEA,EAAqB,cAAc,GAEnC,EAAqB,eAAe;CACnC,eAAe,CAAC;CAChB,cAAc;CACd,UAAU;CACV,OAAO;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","names":[],"sources":["../../../../components/builder-header/toolbar.tsx"],"sourcesContent":["import React, { useEffect, type ReactNode } from 'react';\n\nimport { BUILDER_HEADER_TOOLBAR } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport type { ChildrenOf } from '../../types/common';\nimport ButtonGroup, { type ButtonGroupProps } from '../button-group';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nexport interface BuilderHeaderToolbarAssistiveText {\n\t/** Used for the aria-label for the actions section of the toolbar. */\n\tactions?: string;\n}\n\nexport interface BuilderHeaderToolbarProps {\n\t/**\n\t * Content rendered in the actions section of the toolbar, such as save or undo buttons.\n\t */\n\tactions?: ReactNode;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `actions`: Used for the aria-label for the actions section of the toolbar.\n\t * * _Tested with snapshot testing._\n\t */\n\tassistiveText?: BuilderHeaderToolbarAssistiveText;\n\t/**\n\t * Provide children of the type `<ButtonGroup />` to define the structure of the toolbar section.\n\t * ```\n\t * <BuilderHeader>\n\t * <BuilderHeaderToolbar>\n\t * <ButtonGroup />\n\t * <ButtonGroup />\n\t * </BuilderHeaderToolbar>\n\t * </BuilderHeader>\n\t * ```\n\t * Other children are ignored.\n\t */\n\tchildren?: ChildrenOf<ButtonGroupProps>;\n\t/** @deprecated Use `actions` instead. */\n\tonRenderActions?: () => ReactNode;\n}\n\nconst defaultAssistiveText: BuilderHeaderToolbarAssistiveText = {\n\tactions: 'Actions',\n};\n\n/**\n * The toolbar section of the header.\n */\nconst BuilderHeaderToolbar = ({\n\tactions,\n\tassistiveText = defaultAssistiveText,\n\tchildren,\n\tonRenderActions,\n}: BuilderHeaderToolbarProps): React.ReactElement => {\n\tuseEffect(() => {\n\t\tcheckProps(BUILDER_HEADER_TOOLBAR, { onRenderActions }, componentDoc);\n\t}, [onRenderActions]);\n\n\tconst mergedAssistiveText = {\n\t\t...defaultAssistiveText,\n\t\t...assistiveText,\n\t};\n\treturn (\n\t\t<div className=\"slds-builder-toolbar\" role=\"toolbar\">\n\t\t\t{React.Children.map(children, (child) => {\n\t\t\t\tif (isElementOfType<ButtonGroupProps>(child, ButtonGroup)) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"slds-builder-toolbar__item-group\"\n\t\t\t\t\t\t\t// `label` isn't a ButtonGroup prop (ButtonGroup ignores it);\n\t\t\t\t\t\t\t// the toolbar reads it as the group's accessible name\n\t\t\t\t\t\t\taria-label={(child.props as { label?: string }).label}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{child}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t})}\n\t\t\t<div\n\t\t\t\tclassName=\"slds-builder-toolbar__actions\"\n\t\t\t\taria-label={mergedAssistiveText.actions}\n\t\t\t>\n\t\t\t\t{actions ?? onRenderActions?.()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nBuilderHeaderToolbar.displayName = BUILDER_HEADER_TOOLBAR;\n\nexport default BuilderHeaderToolbar;\n"],"mappings":";;;;;;;;AA2CA,IAAM,IAA0D,EAC/D,SAAS,UACV,GAKM,KAAwB,EAC7B,YACA,mBAAgB,GAChB,aACA,yBACoD;CACpD,QAAgB;EACf,EAAW,GAAwB,EAAE,mBAAgB,GAAG,CAAY;CACrE,GAAG,CAAC,CAAe,CAAC;CAEpB,IAAM,IAAsB;EAC3B,GAAG;EACH,GAAG;CACJ;CACA,OACC,kBAAC,OAAD;EAAK,WAAU;EAAuB,MAAK;EAA3C,UAAA,CACE,EAAM,SAAS,IAAI,IAAW,MAC1B,EAAkC,GAAO,CAAW,IAEtD,kBAAC,OAAD;GACC,WAAU;GAGV,cAAa,EAAM,MAA6B;GAE/C,UAAA;EACG,CAAA,IAGA,IACP,GACD,kBAAC,OAAD;GACC,WAAU;GACV,cAAY,EAAoB;GAE/B,UAAA,KAAW,IAAkB;EAC1B,CAAA,CACD;;AAEP;AAEA,EAAqB,cAAc"}
1
+ {"version":3,"file":"toolbar.js","names":[],"sources":["../../../../components/builder-header/toolbar.tsx"],"sourcesContent":["import React, { useEffect, type ReactNode } from 'react';\n\nimport { BUILDER_HEADER_TOOLBAR } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport type { ChildrenOf } from '../../types/common';\nimport ButtonGroup, { type ButtonGroupProps } from '../button-group';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nexport interface BuilderHeaderToolbarAssistiveText {\n\t/** Used for the aria-label for the actions section of the toolbar. */\n\tactions?: string;\n}\n\nexport interface BuilderHeaderToolbarProps {\n\t/**\n\t * Content rendered in the actions section of the toolbar, such as save or undo buttons.\n\t */\n\tactions?: ReactNode;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `actions`: Used for the aria-label for the actions section of the toolbar.\n\t */\n\tassistiveText?: BuilderHeaderToolbarAssistiveText;\n\t/**\n\t * Provide children of the type `<ButtonGroup />` to define the structure of the toolbar section.\n\t * ```\n\t * <BuilderHeader>\n\t * <BuilderHeaderToolbar>\n\t * <ButtonGroup />\n\t * <ButtonGroup />\n\t * </BuilderHeaderToolbar>\n\t * </BuilderHeader>\n\t * ```\n\t * Other children are ignored.\n\t */\n\tchildren?: ChildrenOf<ButtonGroupProps>;\n\t/** @deprecated Use `actions` instead. */\n\tonRenderActions?: () => ReactNode;\n}\n\nconst defaultAssistiveText: BuilderHeaderToolbarAssistiveText = {\n\tactions: 'Actions',\n};\n\n/**\n * The toolbar section of the header.\n */\nconst BuilderHeaderToolbar = ({\n\tactions,\n\tassistiveText = defaultAssistiveText,\n\tchildren,\n\tonRenderActions,\n}: BuilderHeaderToolbarProps): React.ReactElement => {\n\tuseEffect(() => {\n\t\tcheckProps(BUILDER_HEADER_TOOLBAR, { onRenderActions }, componentDoc);\n\t}, [onRenderActions]);\n\n\tconst mergedAssistiveText = {\n\t\t...defaultAssistiveText,\n\t\t...assistiveText,\n\t};\n\treturn (\n\t\t<div className=\"slds-builder-toolbar\" role=\"toolbar\">\n\t\t\t{React.Children.map(children, (child) => {\n\t\t\t\tif (isElementOfType<ButtonGroupProps>(child, ButtonGroup)) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"slds-builder-toolbar__item-group\"\n\t\t\t\t\t\t\t// `label` isn't a ButtonGroup prop (ButtonGroup ignores it);\n\t\t\t\t\t\t\t// the toolbar reads it as the group's accessible name\n\t\t\t\t\t\t\taria-label={(child.props as { label?: string }).label}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{child}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t})}\n\t\t\t<div\n\t\t\t\tclassName=\"slds-builder-toolbar__actions\"\n\t\t\t\taria-label={mergedAssistiveText.actions}\n\t\t\t>\n\t\t\t\t{actions ?? onRenderActions?.()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nBuilderHeaderToolbar.displayName = BUILDER_HEADER_TOOLBAR;\n\nexport default BuilderHeaderToolbar;\n"],"mappings":";;;;;;;;AA0CA,IAAM,IAA0D,EAC/D,SAAS,UACV,GAKM,KAAwB,EAC7B,YACA,mBAAgB,GAChB,aACA,yBACoD;CACpD,QAAgB;EACf,EAAW,GAAwB,EAAE,mBAAgB,GAAG,CAAY;CACrE,GAAG,CAAC,CAAe,CAAC;CAEpB,IAAM,IAAsB;EAC3B,GAAG;EACH,GAAG;CACJ;CACA,OACC,kBAAC,OAAD;EAAK,WAAU;EAAuB,MAAK;EAA3C,UAAA,CACE,EAAM,SAAS,IAAI,IAAW,MAC1B,EAAkC,GAAO,CAAW,IAEtD,kBAAC,OAAD;GACC,WAAU;GAGV,cAAa,EAAM,MAA6B;GAE/C,UAAA;EACG,CAAA,IAGA,IACP,GACD,kBAAC,OAAD;GACC,WAAU;GACV,cAAY,EAAoB;GAE/B,UAAA,KAAW,IAAkB;EAC1B,CAAA,CACD;;AAEP;AAEA,EAAqB,cAAc"}
@@ -6,7 +6,7 @@ process.env.NODE_ENV;
6
6
  var r = function() {};
7
7
  process.env.NODE_ENV !== "production" && (r = function(r, i, a) {
8
8
  let o = t(a);
9
- n(r, i.requestFocus, "requestFocus", void 0, `Focus the button through \`ref\` (or \`buttonRef\`) instead: \`buttonRef.current.focus()\`. ${o()}`), n(r, i.onRequestFocus, "onRequestFocus", void 0, `Focus the button through \`ref\` (or \`buttonRef\`) instead. ${o()}`), e(r, i.tooltip, "tooltip", `Wrap the button in a \`Tooltip\` instead: \`<Tooltip content={…} trigger={<Button … />} />\`. ${o()}`);
9
+ n(r, i.requestFocus, "requestFocus", void 0, `Focus the button through \`ref\` (or \`buttonRef\`) instead: \`buttonRef.current.focus()\`. ${o()}`), n(r, i.onRequestFocus, "onRequestFocus", void 0, `Focus the button through \`ref\` (or \`buttonRef\`) instead. ${o()}`), n(r, i.onKeyPress, "onKeyPress", "onKeyDown", `\`keypress\` is a deprecated DOM event; read \`event.key\` instead. ${o("onKeyDown")}`), e(r, i.tooltip, "tooltip", `Wrap the button in a \`Tooltip\` instead: \`<Tooltip content={…} trigger={<Button … />} />\`. ${o()}`);
10
10
  });
11
11
  //#endregion
12
12
  export { r as checkRemovedProps };
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/button/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 getComponentDocFn from '../../utilities/get-component-doc';\nimport ifOneThenBothRequiredProperty from '../../utilities/warning/if-one-then-both-required-property';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport sunsetProperty from '../../utilities/warning/sunset-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/* eslint-disable max-len */\n\t\t// If iconName is set, iconCategory must also be set.\n\t\tifOneThenBothRequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops,\n\t\t\t{\n\t\t\t\ticonName: props.iconName,\n\t\t\t\ticonCategory: props.iconCategory,\n\t\t\t},\n\t\t\tcreateDocUrl('iconCategory')\n\t\t);\n\t};\n}\n\n// v11 removals and deprecations. Exported separately so the component can run these checks\n// without enabling the pre-existing `checkProps` warnings.\nexport let checkRemovedProps = function checkRemovedPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckRemovedProps = function checkRemovedPropsFunction(\n\t\tCOMPONENT,\n\t\tprops,\n\t\tjsonDoc\n\t) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.requestFocus,\n\t\t\t'requestFocus',\n\t\t\tundefined,\n\t\t\t`Focus the button through \\`ref\\` (or \\`buttonRef\\`) instead: \\`buttonRef.current.focus()\\`. ${createDocUrl()}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onRequestFocus,\n\t\t\t'onRequestFocus',\n\t\t\tundefined,\n\t\t\t`Focus the button through \\`ref\\` (or \\`buttonRef\\`) instead. ${createDocUrl()}`\n\t\t);\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.tooltip,\n\t\t\t'tooltip',\n\t\t\t`Wrap the button in a \\`Tooltip\\` instead: \\`<Tooltip content={…} trigger={<Button … />} />\\`. ${createDocUrl()}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAWA,QAAA,IAAA;AAoBA,IAAW,IAAoB,WAAqC,CAAC;AAErE,QAAA,IAAA,aAA6B,iBAC5B,IAAoB,SACnB,GACA,GACA,GACC;CACD,IAAM,IAAe,EAAkB,CAAO;CAgB9C,AAdA,EACC,GACA,EAAM,cACN,gBACA,KAAA,GACA,+FAA+F,EAAa,GAC7G,GACA,EACC,GACA,EAAM,gBACN,kBACA,KAAA,GACA,gEAAgE,EAAa,GAC9E,GACA,EACC,GACA,EAAM,SACN,WACA,iGAAiG,EAAa,GAC/G;AACD"}
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/button/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 getComponentDocFn from '../../utilities/get-component-doc';\nimport ifOneThenBothRequiredProperty from '../../utilities/warning/if-one-then-both-required-property';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport sunsetProperty from '../../utilities/warning/sunset-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/* eslint-disable max-len */\n\t\t// If iconName is set, iconCategory must also be set.\n\t\tifOneThenBothRequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops,\n\t\t\t{\n\t\t\t\ticonName: props.iconName,\n\t\t\t\ticonCategory: props.iconCategory,\n\t\t\t},\n\t\t\tcreateDocUrl('iconCategory')\n\t\t);\n\t};\n}\n\n// v11 removals and deprecations. Exported separately so the component can run these checks\n// without enabling the pre-existing `checkProps` warnings.\nexport let checkRemovedProps = function checkRemovedPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckRemovedProps = function checkRemovedPropsFunction(\n\t\tCOMPONENT,\n\t\tprops,\n\t\tjsonDoc\n\t) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.requestFocus,\n\t\t\t'requestFocus',\n\t\t\tundefined,\n\t\t\t`Focus the button through \\`ref\\` (or \\`buttonRef\\`) instead: \\`buttonRef.current.focus()\\`. ${createDocUrl()}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onRequestFocus,\n\t\t\t'onRequestFocus',\n\t\t\tundefined,\n\t\t\t`Focus the button through \\`ref\\` (or \\`buttonRef\\`) instead. ${createDocUrl()}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onKeyPress,\n\t\t\t'onKeyPress',\n\t\t\t'onKeyDown',\n\t\t\t`\\`keypress\\` is a deprecated DOM event; read \\`event.key\\` instead. ${createDocUrl('onKeyDown')}`\n\t\t);\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.tooltip,\n\t\t\t'tooltip',\n\t\t\t`Wrap the button in a \\`Tooltip\\` instead: \\`<Tooltip content={…} trigger={<Button … />} />\\`. ${createDocUrl()}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAWA,QAAA,IAAA;AAoBA,IAAW,IAAoB,WAAqC,CAAC;AAErE,QAAA,IAAA,aAA6B,iBAC5B,IAAoB,SACnB,GACA,GACA,GACC;CACD,IAAM,IAAe,EAAkB,CAAO;CAuB9C,AArBA,EACC,GACA,EAAM,cACN,gBACA,KAAA,GACA,+FAA+F,EAAa,GAC7G,GACA,EACC,GACA,EAAM,gBACN,kBACA,KAAA,GACA,gEAAgE,EAAa,GAC9E,GACA,EACC,GACA,EAAM,YACN,cACA,aACA,uEAAuE,EAAa,WAAW,GAChG,GACA,EACC,GACA,EAAM,SACN,WACA,iGAAiG,EAAa,GAC/G;AACD"}
@@ -10,69 +10,69 @@ import u from "classnames";
10
10
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
11
  //#region components/button/index.tsx
12
12
  var p = { icon: "" }, m = s((s, m) => {
13
- let { assistiveText: h = p, buttonRef: g, children: _, className: ee, disabled: v = !1, hint: y = !1, iconCategory: b, iconClassName: x, iconName: S, iconPath: C, iconPosition: w, iconSize: T = "medium", iconVariant: E, id: D, inverse: O, label: k, onBlur: A, onClick: j, onFocus: M, onKeyDown: N, onKeyPress: P, onKeyUp: F, onMouseDown: I, onMouseEnter: L, onMouseLeave: R, onMouseUp: z, onRequestFocus: B, requestFocus: V, style: H, tabIndex: U, title: W, tooltip: G, triggerClassName: te, type: K = "button", variant: q = "neutral", ...J } = s;
13
+ let { assistiveText: h = p, buttonRef: g, children: _, className: v, disabled: y = !1, hint: b = !1, iconCategory: x, iconClassName: S, iconName: C, iconPath: w, iconPosition: T, iconSize: E = "medium", iconVariant: D, id: O, inverse: k, label: A, onBlur: j, onClick: M, onFocus: ee, onKeyDown: N, onKeyPress: P, onKeyUp: F, onMouseDown: I, onMouseEnter: L, onMouseLeave: R, onMouseUp: z, onRequestFocus: B, requestFocus: V, responsive: H = !1, style: U, tabIndex: W, title: G, tooltip: K, triggerClassName: te, type: q, variant: J = "neutral", ...Y } = s, X = q ?? (s.formAction ? "submit" : "button");
14
14
  c(() => {
15
15
  a(e, {
16
+ onKeyPress: P,
16
17
  onRequestFocus: B,
17
18
  requestFocus: V,
18
- tooltip: G
19
+ tooltip: K
19
20
  }, o);
20
21
  }, [
22
+ P,
21
23
  B,
22
24
  V,
23
- G
25
+ K
24
26
  ]);
25
- let Y = l(null);
27
+ let Z = l(null);
26
28
  c(() => {
27
- V && B && Y.current && B(Y.current);
29
+ V && B && Z.current && B(Z.current);
28
30
  }, [V, B]);
29
- let X = () => {
30
- let e = q === "icon", t = E, n = E === "more", r = E === "border", i = E === "global-header", a = q !== "base" && !E && !O && q !== "link" || E === "bare", o = O && !e, s = O && e && !n && !r, c = O && n, l = O && r;
31
- return E === "global-header" && (t = "container"), u({
32
- "slds-button": q !== "link",
33
- [`slds-button_${q}`]: a,
31
+ let Q = () => {
32
+ let e = J === "icon", t = D, n = D === "more", r = D === "border", i = D === "global-header", a = J !== "base" && !D && !k && J !== "link" || D === "bare", o = k && !e, s = k && e && !n && !r, c = k && n, l = k && r;
33
+ return D === "global-header" && (t = "container"), u({
34
+ "slds-button": J !== "link",
35
+ [`slds-button_${J}`]: a,
34
36
  "slds-button_inverse": o,
35
37
  "slds-button_icon-inverse": s || c,
36
38
  "slds-button_icon-border-inverse": l,
37
39
  [`slds-button_icon-${t}`]: t && !l,
38
- "slds-global-header__button_icon": i,
39
- [`slds-button_icon-${T}`]: E && T !== "medium",
40
- "slds-button_reset": q === "link",
41
- "slds-text-link": q === "link"
42
- }, ee);
43
- }, Z = (e) => {
44
- j && j(e, { id: D });
45
- }, Q = (e) => {
46
- let n = !T || E || T === "xx-small" ? void 0 : T;
47
- return /* @__PURE__ */ d(t, {
48
- category: b || "utility",
49
- className: u({ "slds-global-header__icon": E === "global-header" }, x),
50
- hint: y,
51
- inverse: O,
52
- name: e,
53
- path: C,
54
- position: w,
55
- size: n
56
- });
57
- }, $ = () => {
58
- let e = S || C, t = {
40
+ "slds-global-actions__item-action": i,
41
+ [`slds-button_icon-${E}`]: D && E !== "medium",
42
+ "slds-button_reset": J === "link",
43
+ "slds-text-link": J === "link",
44
+ "slds-button_stretch": H
45
+ }, v);
46
+ }, ne = (e) => {
47
+ M && M(e, { id: O });
48
+ }, re = (e) => /* @__PURE__ */ d(t, {
49
+ category: x || "utility",
50
+ className: S,
51
+ hint: b,
52
+ inverse: k,
53
+ name: e,
54
+ path: w,
55
+ position: T,
56
+ size: !E || D || E === "xx-small" ? void 0 : E
57
+ }), $ = () => {
58
+ let e = C || w, t = {
59
59
  ...p,
60
60
  ...h
61
61
  }.icon;
62
62
  return e && t ? /* @__PURE__ */ d("span", {
63
63
  className: "slds-assistive-text",
64
64
  children: t
65
- }) : k;
65
+ }) : A;
66
66
  };
67
67
  return (() => {
68
- let e = n(J), a = r(J), o = i(J);
68
+ let e = n(Y), a = r(Y), o = i(Y);
69
69
  return /* @__PURE__ */ f("button", {
70
- className: X(),
71
- disabled: v,
72
- id: D,
73
- onBlur: A,
74
- onClick: Z,
75
- onFocus: M,
70
+ className: Q(),
71
+ disabled: y,
72
+ id: O,
73
+ onBlur: j,
74
+ onClick: ne,
75
+ onFocus: ee,
76
76
  onKeyDown: N,
77
77
  onKeyPress: P,
78
78
  onKeyUp: F,
@@ -81,26 +81,26 @@ var p = { icon: "" }, m = s((s, m) => {
81
81
  onMouseLeave: R,
82
82
  onMouseUp: z,
83
83
  ref: (e) => {
84
- Y.current = e, typeof m == "function" ? m(e) : m && (m.current = e), g && g(e);
84
+ Z.current = e, typeof m == "function" ? m(e) : m && (m.current = e), g && g(e);
85
85
  },
86
- tabIndex: typeof U == "string" ? parseInt(U, 10) : U,
87
- title: W,
88
- type: K,
89
- style: H,
90
- ...J,
86
+ tabIndex: typeof W == "string" ? parseInt(W, 10) : W,
87
+ title: G,
88
+ type: X,
89
+ style: U,
90
+ ...Y,
91
91
  ...e,
92
92
  ...a,
93
93
  ...o,
94
94
  children: [
95
- w === "right" ? $() : null,
96
- S || C ? Q(S) : null,
97
- E === "more" ? /* @__PURE__ */ d(t, {
95
+ T === "right" ? $() : null,
96
+ C || w ? re(C) : null,
97
+ D === "more" ? /* @__PURE__ */ d(t, {
98
98
  category: "utility",
99
99
  name: "down",
100
100
  size: "x-small",
101
- className: x
101
+ className: S
102
102
  }) : null,
103
- w === "left" || !w ? $() : null,
103
+ T === "left" || !T ? $() : null,
104
104
  _
105
105
  ]
106
106
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/button/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Button design pattern](https://lightningdesignsystem.com/components/buttons/) in React.\n\nimport React, {\n\tuseEffect,\n\tuseRef,\n\tforwardRef,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n\ttype ForwardedRef,\n\ttype ButtonHTMLAttributes,\n} from 'react';\nimport classNames from 'classnames';\n// These imports use the old JSX files for now until they're converted\nimport ButtonIcon from '../icon/button-icon/index.jsx';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport getDataProps from '../../utilities/get-data-props';\nimport getFormProps from '../../utilities/get-form-props';\nimport { BUTTON } from '../../utilities/constants';\nimport { checkRemovedProps } from './check-props';\nimport componentDoc from './component.json';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Button variant types\n */\nexport type ButtonVariant =\n\t| 'base'\n\t| 'link'\n\t| 'neutral'\n\t| 'brand'\n\t| 'outline-brand'\n\t| 'destructive'\n\t| 'success'\n\t| 'text-destructive'\n\t| 'icon';\n\n/**\n * Button icon variant types\n */\nexport type ButtonIconVariant =\n\t| 'bare'\n\t| 'container'\n\t| 'border'\n\t| 'border-filled'\n\t| 'brand'\n\t| 'more'\n\t| 'global-header';\n\n/**\n * Button icon size types\n */\nexport type ButtonIconSize =\n\t'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset';\n\n/**\n * Icon position relative to label\n */\nexport type IconPosition = 'left' | 'right';\n\n/**\n * Assistive text for button\n */\nexport interface ButtonAssistiveText {\n\ticon?: string;\n}\n\n/**\n * Props shared by every Button variant. Other `<button>` attributes (`name`,\n * `value`, `role`, `autoFocus`, ...) pass through to the element.\n */\nexport interface ButtonBaseProps extends Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t'children' | 'className' | 'onClick' | 'style' | 'tabIndex' | 'title' | 'type'\n> {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ButtonAssistiveText;\n\t/** Callback for DOM reference */\n\tbuttonRef?: (ref: HTMLButtonElement | null) => void;\n\t/** Additional CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Child elements */\n\tchildren?: ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Hint styling for icon buttons */\n\thint?: boolean;\n\t/** Icon category */\n\ticonCategory?: IconCategory;\n\t/** CSS classes for icon */\n\ticonClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Direct path to icon sprite */\n\ticonPath?: string;\n\t/** Icon position */\n\ticonPosition?: IconPosition;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Inverse colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Visible button label */\n\tlabel?: ReactNode;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Click event handler */\n\tonClick?: (\n\t\tevent: MouseEvent<HTMLButtonElement>,\n\t\tdata?: { id?: string }\n\t) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down event handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter event handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse leave event handler */\n\tonMouseLeave?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse up event handler */\n\tonMouseUp?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * @deprecated Focus the button through `ref` or `buttonRef` instead. Called with the\n\t * `<button>` when `requestFocus` is set. Still works, and warns.\n\t */\n\tonRequestFocus?: (element: HTMLButtonElement) => void;\n\t/**\n\t * @deprecated Focus the button through `ref` or `buttonRef` instead. Still works, and warns.\n\t */\n\trequestFocus?: boolean;\n\t/** Responsive width on small screens */\n\tresponsive?: boolean;\n\t/** Custom inline styles */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** HTML title attribute */\n\ttitle?: string;\n\t/** Button type attribute */\n\ttype?: ButtonType;\n}\n\n/**\n * Icon sizing and styling props, shared by the icon-capable variants.\n */\ninterface ButtonIconProps {\n\t/**\n\t * Icon size. With `iconVariant`, sizes the button container (`slds-button_icon-*`); otherwise sizes the SVG (`slds-button__icon_*`).\n\t * `xx-small` requires `iconVariant`, since SLDS only defines it for the button container (matches `lightning-button-icon`).\n\t */\n\ticonSize?: ButtonIconSize;\n\t/** Icon variant */\n\ticonVariant?: ButtonIconVariant;\n}\n\n/**\n * `variant=\"icon\"` is the icon button: it is the variant that takes `iconVariant`.\n * Other variants size the icon with `iconSize` only.\n */\nexport type ButtonProps = ButtonBaseProps &\n\t(\n\t\t| ({ /** Button variant */ variant: 'icon' } & ButtonIconProps)\n\t\t| ({\n\t\t\t\t/** Button variant */\n\t\t\t\tvariant?: Exclude<ButtonVariant, 'icon'>;\n\t\t } & Pick<ButtonIconProps, 'iconSize'> & { iconVariant?: undefined })\n\t);\n\nconst defaultAssistiveText: ButtonAssistiveText = { icon: '' };\n\n/**\n * The Button component is the Lightning Design System Button component.\n * Use for label buttons, icon buttons, or buttons with both labels and icons.\n *\n * Either a `label` or `assistiveText.icon` is required for accessibility.\n * For buttons that maintain selected/unselected states, use ButtonStateful.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) => {\n\t\tconst {\n\t\t\tassistiveText = defaultAssistiveText,\n\t\t\tbuttonRef,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled = false,\n\t\t\thint = false,\n\t\t\ticonCategory,\n\t\t\ticonClassName,\n\t\t\ticonName,\n\t\t\ticonPath,\n\t\t\ticonPosition,\n\t\t\ticonSize = 'medium',\n\t\t\ticonVariant,\n\t\t\tid,\n\t\t\tinverse,\n\t\t\tlabel,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\tonMouseUp,\n\t\t\tonRequestFocus,\n\t\t\trequestFocus,\n\t\t\tstyle,\n\t\t\ttabIndex,\n\t\t\ttitle,\n\t\t\t// Removed in v11. Destructured so it never reaches the DOM;\n\t\t\t// `checkRemovedProps` warns about it.\n\t\t\ttooltip,\n\t\t\t// Injected by `ButtonGroup` into its last child for `MenuDropdown`; a\n\t\t\t// Button has no use for it, so keep it off the DOM.\n\t\t\ttriggerClassName: _triggerClassName,\n\t\t\ttype = 'button',\n\t\t\tvariant = 'neutral',\n\t\t\t...restProps\n\t\t} = props as ButtonProps & {\n\t\t\ttooltip?: ReactNode;\n\t\t\ttriggerClassName?: unknown;\n\t\t};\n\n\t\tuseEffect(() => {\n\t\t\tcheckRemovedProps(\n\t\t\t\tBUTTON,\n\t\t\t\t{ onRequestFocus, requestFocus, tooltip },\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}, [onRequestFocus, requestFocus, tooltip]);\n\n\t\tconst internalRef = useRef<HTMLButtonElement | null>(null);\n\n\t\tuseEffect(() => {\n\t\t\tif (requestFocus && onRequestFocus && internalRef.current) {\n\t\t\t\tonRequestFocus(internalRef.current);\n\t\t\t}\n\t\t}, [requestFocus, onRequestFocus]);\n\n\t\tconst getClassName = (): string => {\n\t\t\tconst isIcon = variant === 'icon';\n\t\t\tlet computedIconVariant = iconVariant;\n\t\t\tconst iconMore = iconVariant === 'more';\n\t\t\tconst iconBorder = iconVariant === 'border';\n\t\t\tconst iconGlobalHeader = iconVariant === 'global-header';\n\n\t\t\tconst showButtonVariant =\n\t\t\t\t(variant !== 'base' &&\n\t\t\t\t\t!iconVariant &&\n\t\t\t\t\t!inverse &&\n\t\t\t\t\tvariant !== 'link') ||\n\t\t\t\ticonVariant === 'bare';\n\t\t\tconst plainInverseBtn = inverse && !isIcon;\n\t\t\tconst plainInverseIcon = inverse && isIcon && !iconMore && !iconBorder;\n\t\t\tconst moreInverseIcon = inverse && iconMore;\n\t\t\tconst borderInverseIcon = inverse && iconBorder;\n\n\t\t\t// Reset to container style for the actual button CSS\n\t\t\tif (iconVariant === 'global-header') {\n\t\t\t\tcomputedIconVariant = 'container';\n\t\t\t}\n\n\t\t\treturn classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-button': variant !== 'link',\n\t\t\t\t\t[`slds-button_${variant}`]: showButtonVariant,\n\t\t\t\t\t'slds-button_inverse': plainInverseBtn,\n\t\t\t\t\t'slds-button_icon-inverse': plainInverseIcon || moreInverseIcon,\n\t\t\t\t\t'slds-button_icon-border-inverse': borderInverseIcon,\n\t\t\t\t\t[`slds-button_icon-${computedIconVariant}`]:\n\t\t\t\t\t\tcomputedIconVariant && !borderInverseIcon,\n\t\t\t\t\t'slds-global-header__button_icon': iconGlobalHeader,\n\t\t\t\t\t[`slds-button_icon-${iconSize}`]:\n\t\t\t\t\t\ticonVariant && iconSize !== 'medium',\n\t\t\t\t\t'slds-button_reset': variant === 'link',\n\t\t\t\t\t'slds-text-link': variant === 'link',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t);\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event, { id });\n\t\t\t}\n\t\t};\n\n\t\tconst renderIcon = (name?: string): React.ReactElement => {\n\t\t\t// SLDS has no `slds-button__icon_xx-small`; xx-small only sizes the container.\n\t\t\tconst computedIconSize =\n\t\t\t\t!iconSize || iconVariant || iconSize === 'xx-small'\n\t\t\t\t\t? undefined\n\t\t\t\t\t: iconSize;\n\t\t\treturn (\n\t\t\t\t<ButtonIcon\n\t\t\t\t\tcategory={iconCategory || 'utility'}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-global-header__icon': iconVariant === 'global-header',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ticonClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\thint={hint}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={iconPath}\n\t\t\t\t\tposition={iconPosition}\n\t\t\t\t\tsize={computedIconSize}\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\tconst renderLabel = (): ReactNode => {\n\t\t\tconst iconOnly = iconName || iconPath;\n\t\t\tconst assistiveTextIcon = {\n\t\t\t\t...defaultAssistiveText,\n\t\t\t\t...assistiveText,\n\t\t\t}.icon;\n\n\t\t\treturn iconOnly && assistiveTextIcon ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveTextIcon}</span>\n\t\t\t) : (\n\t\t\t\tlabel\n\t\t\t);\n\t\t};\n\n\t\tconst renderButton = (): React.ReactElement => {\n\t\t\tconst ariaProps = getAriaProps(restProps);\n\t\t\tconst dataProps = getDataProps(restProps);\n\t\t\tconst formProps = getFormProps(restProps);\n\n\t\t\treturn (\n\t\t\t\t<button\n\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t\t\tonMouseUp={onMouseUp}\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tinternalRef.current = node;\n\t\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\t\tref(node);\n\t\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (buttonRef) {\n\t\t\t\t\t\t\tbuttonRef(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\ttabIndex={\n\t\t\t\t\t\ttypeof tabIndex === 'string' ? parseInt(tabIndex, 10) : tabIndex\n\t\t\t\t\t}\n\t\t\t\t\ttitle={title}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\t{...restProps}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t{...dataProps}\n\t\t\t\t\t{...formProps}\n\t\t\t\t>\n\t\t\t\t\t{iconPosition === 'right' ? renderLabel() : null}\n\t\t\t\t\t{iconName || iconPath ? renderIcon(iconName) : null}\n\t\t\t\t\t{iconVariant === 'more' ? (\n\t\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t\tclassName={iconClassName as string}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{iconPosition === 'left' || !iconPosition ? renderLabel() : null}\n\t\t\t\t\t{children}\n\t\t\t\t</button>\n\t\t\t);\n\t\t};\n\n\t\treturn renderButton();\n\t}\n);\n\nButton.displayName = BUTTON;\n\nexport default Button;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/button/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Button design pattern](https://lightningdesignsystem.com/components/buttons/) in React.\n\nimport React, {\n\tuseEffect,\n\tuseRef,\n\tforwardRef,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n\ttype ForwardedRef,\n\ttype ButtonHTMLAttributes,\n} from 'react';\nimport classNames from 'classnames';\n// These imports use the old JSX files for now until they're converted\nimport ButtonIcon from '../icon/button-icon/index.jsx';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport getDataProps from '../../utilities/get-data-props';\nimport getFormProps from '../../utilities/get-form-props';\nimport { BUTTON } from '../../utilities/constants';\nimport { checkRemovedProps } from './check-props';\nimport componentDoc from './component.json';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Button variant types\n */\nexport type ButtonVariant =\n\t| 'base'\n\t| 'link'\n\t| 'neutral'\n\t| 'brand'\n\t| 'outline-brand'\n\t| 'destructive'\n\t| 'success'\n\t| 'text-destructive'\n\t| 'icon';\n\n/**\n * Button icon variant types\n */\nexport type ButtonIconVariant =\n\t| 'bare'\n\t| 'container'\n\t| 'border'\n\t| 'border-filled'\n\t| 'brand'\n\t| 'more'\n\t| 'global-header';\n\n/**\n * Button icon size types\n */\nexport type ButtonIconSize =\n\t'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset';\n\n/**\n * Icon position relative to label\n */\nexport type IconPosition = 'left' | 'right';\n\n/**\n * Assistive text for button\n */\nexport interface ButtonAssistiveText {\n\t/** Visually hidden label of an icon-only button. Required when there is no `label`. */\n\ticon?: string;\n}\n\n/**\n * Props shared by every Button variant. Other `<button>` attributes (`name`,\n * `value`, `role`, `autoFocus`, ...) pass through to the element.\n */\nexport interface ButtonBaseProps extends Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t'children' | 'className' | 'onClick' | 'style' | 'tabIndex' | 'title' | 'type'\n> {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ButtonAssistiveText;\n\t/** Callback for DOM reference */\n\tbuttonRef?: (ref: HTMLButtonElement | null) => void;\n\t/** Additional CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Child elements */\n\tchildren?: ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Hint styling for icon buttons */\n\thint?: boolean;\n\t/** Icon category */\n\ticonCategory?: IconCategory;\n\t/** CSS classes for icon */\n\ticonClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Direct path to icon sprite */\n\ticonPath?: string;\n\t/** Icon position */\n\ticonPosition?: IconPosition;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Inverse colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Visible button label */\n\tlabel?: ReactNode;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Click event handler */\n\tonClick?: (\n\t\tevent: MouseEvent<HTMLButtonElement>,\n\t\tdata?: { id?: string }\n\t) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/**\n\t * @deprecated `keypress` is a deprecated DOM event. Use `onKeyDown` and read\n\t * `event.key` instead. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down event handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter event handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse leave event handler */\n\tonMouseLeave?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse up event handler */\n\tonMouseUp?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * @deprecated Focus the button through `ref` or `buttonRef` instead. Called with the\n\t * `<button>` when `requestFocus` is set. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\tonRequestFocus?: (element: HTMLButtonElement) => void;\n\t/**\n\t * @deprecated Focus the button through `ref` or `buttonRef` instead. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\trequestFocus?: boolean;\n\t/** Stretches the button to the full width of its container (`slds-button_stretch`) */\n\tresponsive?: boolean;\n\t/** Custom inline styles */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** HTML title attribute */\n\ttitle?: string;\n\t/**\n\t * Button type attribute. Defaults to `submit` when `formAction` is set, since browsers\n\t * ignore `formAction` on other types, and to `button` otherwise.\n\t */\n\ttype?: ButtonType;\n}\n\n/**\n * Icon sizing and styling props, shared by the icon-capable variants.\n */\ninterface ButtonIconProps {\n\t/**\n\t * Icon size. With `iconVariant`, sizes the button container (`slds-button_icon-*`); otherwise sizes the SVG (`slds-button__icon_*`).\n\t * `xx-small` requires `iconVariant`, since SLDS only defines it for the button container (matches `lightning-button-icon`).\n\t */\n\ticonSize?: ButtonIconSize;\n\t/**\n\t * Icon variant. `global-header` renders the SLDS global header action button\n\t * (`slds-global-actions__item-action`); place it inside a\n\t * `slds-global-actions__item` in the global header markup.\n\t */\n\ticonVariant?: ButtonIconVariant;\n}\n\n/**\n * `variant=\"icon\"` is the icon button: it is the variant that takes `iconVariant`.\n * Other variants size the icon with `iconSize` only.\n */\nexport type ButtonProps = ButtonBaseProps &\n\t(\n\t\t| ({\n\t\t\t\t/** Button variant: an icon button. */\n\t\t\t\tvariant: 'icon';\n\t\t } & ButtonIconProps)\n\t\t| ({\n\t\t\t\t/** Button variant */\n\t\t\t\tvariant?: Exclude<ButtonVariant, 'icon'>;\n\t\t } & Pick<ButtonIconProps, 'iconSize'> & {\n\t\t\t\t\t/** Only for `variant=\"icon\"`. */\n\t\t\t\t\ticonVariant?: undefined;\n\t\t\t\t})\n\t);\n\nconst defaultAssistiveText: ButtonAssistiveText = { icon: '' };\n\n/**\n * The Button component is the Lightning Design System Button component.\n * Use for label buttons, icon buttons, or buttons with both labels and icons.\n *\n * Either a `label` or `assistiveText.icon` is required for accessibility.\n * For buttons that maintain selected/unselected states, use ButtonStateful.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) => {\n\t\tconst {\n\t\t\tassistiveText = defaultAssistiveText,\n\t\t\tbuttonRef,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled = false,\n\t\t\thint = false,\n\t\t\ticonCategory,\n\t\t\ticonClassName,\n\t\t\ticonName,\n\t\t\ticonPath,\n\t\t\ticonPosition,\n\t\t\ticonSize = 'medium',\n\t\t\ticonVariant,\n\t\t\tid,\n\t\t\tinverse,\n\t\t\tlabel,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\tonMouseUp,\n\t\t\tonRequestFocus,\n\t\t\trequestFocus,\n\t\t\tresponsive = false,\n\t\t\tstyle,\n\t\t\ttabIndex,\n\t\t\ttitle,\n\t\t\t// Removed in v11. Destructured so it never reaches the DOM;\n\t\t\t// `checkRemovedProps` warns about it.\n\t\t\ttooltip,\n\t\t\t// Injected by `ButtonGroup` into its last child for `MenuDropdown`; a\n\t\t\t// Button has no use for it, so keep it off the DOM.\n\t\t\ttriggerClassName: _triggerClassName,\n\t\t\ttype: propType,\n\t\t\tvariant = 'neutral',\n\t\t\t...restProps\n\t\t} = props as ButtonProps & {\n\t\t\ttooltip?: ReactNode;\n\t\t\ttriggerClassName?: unknown;\n\t\t};\n\t\tconst type = propType ?? (props.formAction ? 'submit' : 'button');\n\n\t\tuseEffect(() => {\n\t\t\tcheckRemovedProps(\n\t\t\t\tBUTTON,\n\t\t\t\t{ onKeyPress, onRequestFocus, requestFocus, tooltip },\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}, [onKeyPress, onRequestFocus, requestFocus, tooltip]);\n\n\t\tconst internalRef = useRef<HTMLButtonElement | null>(null);\n\n\t\tuseEffect(() => {\n\t\t\tif (requestFocus && onRequestFocus && internalRef.current) {\n\t\t\t\tonRequestFocus(internalRef.current);\n\t\t\t}\n\t\t}, [requestFocus, onRequestFocus]);\n\n\t\tconst getClassName = (): string => {\n\t\t\tconst isIcon = variant === 'icon';\n\t\t\tlet computedIconVariant = iconVariant;\n\t\t\tconst iconMore = iconVariant === 'more';\n\t\t\tconst iconBorder = iconVariant === 'border';\n\t\t\tconst iconGlobalHeader = iconVariant === 'global-header';\n\n\t\t\tconst showButtonVariant =\n\t\t\t\t(variant !== 'base' &&\n\t\t\t\t\t!iconVariant &&\n\t\t\t\t\t!inverse &&\n\t\t\t\t\tvariant !== 'link') ||\n\t\t\t\ticonVariant === 'bare';\n\t\t\tconst plainInverseBtn = inverse && !isIcon;\n\t\t\tconst plainInverseIcon = inverse && isIcon && !iconMore && !iconBorder;\n\t\t\tconst moreInverseIcon = inverse && iconMore;\n\t\t\tconst borderInverseIcon = inverse && iconBorder;\n\n\t\t\t// Reset to container style for the actual button CSS\n\t\t\tif (iconVariant === 'global-header') {\n\t\t\t\tcomputedIconVariant = 'container';\n\t\t\t}\n\n\t\t\treturn classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-button': variant !== 'link',\n\t\t\t\t\t[`slds-button_${variant}`]: showButtonVariant,\n\t\t\t\t\t'slds-button_inverse': plainInverseBtn,\n\t\t\t\t\t'slds-button_icon-inverse': plainInverseIcon || moreInverseIcon,\n\t\t\t\t\t'slds-button_icon-border-inverse': borderInverseIcon,\n\t\t\t\t\t[`slds-button_icon-${computedIconVariant}`]:\n\t\t\t\t\t\tcomputedIconVariant && !borderInverseIcon,\n\t\t\t\t\t'slds-global-actions__item-action': iconGlobalHeader,\n\t\t\t\t\t[`slds-button_icon-${iconSize}`]:\n\t\t\t\t\t\ticonVariant && iconSize !== 'medium',\n\t\t\t\t\t'slds-button_reset': variant === 'link',\n\t\t\t\t\t'slds-text-link': variant === 'link',\n\t\t\t\t\t'slds-button_stretch': responsive,\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t);\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event, { id });\n\t\t\t}\n\t\t};\n\n\t\tconst renderIcon = (name?: string): React.ReactElement => {\n\t\t\t// SLDS has no `slds-button__icon_xx-small`; xx-small only sizes the container.\n\t\t\tconst computedIconSize =\n\t\t\t\t!iconSize || iconVariant || iconSize === 'xx-small'\n\t\t\t\t\t? undefined\n\t\t\t\t\t: iconSize;\n\t\t\treturn (\n\t\t\t\t<ButtonIcon\n\t\t\t\t\tcategory={iconCategory || 'utility'}\n\t\t\t\t\tclassName={iconClassName as string}\n\t\t\t\t\thint={hint}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={iconPath}\n\t\t\t\t\tposition={iconPosition}\n\t\t\t\t\tsize={computedIconSize}\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\tconst renderLabel = (): ReactNode => {\n\t\t\tconst iconOnly = iconName || iconPath;\n\t\t\tconst assistiveTextIcon = {\n\t\t\t\t...defaultAssistiveText,\n\t\t\t\t...assistiveText,\n\t\t\t}.icon;\n\n\t\t\treturn iconOnly && assistiveTextIcon ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveTextIcon}</span>\n\t\t\t) : (\n\t\t\t\tlabel\n\t\t\t);\n\t\t};\n\n\t\tconst renderButton = (): React.ReactElement => {\n\t\t\tconst ariaProps = getAriaProps(restProps);\n\t\t\tconst dataProps = getDataProps(restProps);\n\t\t\tconst formProps = getFormProps(restProps);\n\n\t\t\treturn (\n\t\t\t\t<button\n\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t// eslint-disable-next-line local/no-deprecated -- forwards the deprecated `onKeyPress` prop until 11.0\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t\t\tonMouseUp={onMouseUp}\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tinternalRef.current = node;\n\t\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\t\tref(node);\n\t\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (buttonRef) {\n\t\t\t\t\t\t\tbuttonRef(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\ttabIndex={\n\t\t\t\t\t\ttypeof tabIndex === 'string' ? parseInt(tabIndex, 10) : tabIndex\n\t\t\t\t\t}\n\t\t\t\t\ttitle={title}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\t{...restProps}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t{...dataProps}\n\t\t\t\t\t{...formProps}\n\t\t\t\t>\n\t\t\t\t\t{iconPosition === 'right' ? renderLabel() : null}\n\t\t\t\t\t{iconName || iconPath ? renderIcon(iconName) : null}\n\t\t\t\t\t{iconVariant === 'more' ? (\n\t\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t\tclassName={iconClassName as string}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{iconPosition === 'left' || !iconPosition ? renderLabel() : null}\n\t\t\t\t\t{children}\n\t\t\t\t</button>\n\t\t\t);\n\t\t};\n\n\t\treturn renderButton();\n\t}\n);\n\nButton.displayName = BUTTON;\n\nexport default Button;\n"],"mappings":"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"}
@@ -5,7 +5,7 @@ import n from "../../utilities/warning/required-property.js";
5
5
  var r = function() {};
6
6
  process.env.NODE_ENV !== "production" && (r = function(r, i, a) {
7
7
  let o = e(a);
8
- t(r, i.active, "active", "isActive", o("isActive")), n(r, i.onClick !== void 0 || !!i.disabled, "onClick", `ButtonStateful is controlled: without \`onClick\`, clicking it does nothing. Update \`isActive\` from \`data.isActive\` in \`onClick\`, or set \`disabled\`. ${o("onClick")}`);
8
+ t(r, i.active, "active", "isActive", o("isActive")), t(r, i.onKeyPress, "onKeyPress", "onKeyDown", `\`keypress\` is a deprecated DOM event; read \`event.key\` instead. ${o("onKeyDown")}`), n(r, i.onClick !== void 0 || !!i.disabled, "onClick", `ButtonStateful is controlled: without \`onClick\`, clicking it does nothing. Update \`isActive\` from \`data.isActive\` in \`onClick\`, or set \`disabled\`. ${o("onClick")}`);
9
9
  });
10
10
  var i = r;
11
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/button-stateful/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 requiredProperty from '../../utilities/warning/required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.active,\n\t\t\t'active',\n\t\t\t'isActive',\n\t\t\tcreateDocUrl('isActive')\n\t\t);\n\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick !== undefined || !!props.disabled,\n\t\t\t'onClick',\n\t\t\t`ButtonStateful is controlled: without \\`onClick\\`, clicking it does nothing. Update \\`isActive\\` from \\`data.isActive\\` in \\`onClick\\`, or set \\`disabled\\`. ${createDocUrl(\n\t\t\t\t'onClick'\n\t\t\t)}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAQA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAU9C,AARA,EACC,GACA,EAAM,QACN,UACA,YACA,EAAa,UAAU,CACxB,GAEA,EACC,GACA,EAAM,YAAY,KAAA,KAAa,CAAC,CAAC,EAAM,UACvC,WACA,gKAAgK,EAC/J,SACD,GACD;AACD;AAGD,IAAA,IAAe"}
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/button-stateful/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 requiredProperty from '../../utilities/warning/required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.active,\n\t\t\t'active',\n\t\t\t'isActive',\n\t\t\tcreateDocUrl('isActive')\n\t\t);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onKeyPress,\n\t\t\t'onKeyPress',\n\t\t\t'onKeyDown',\n\t\t\t`\\`keypress\\` is a deprecated DOM event; read \\`event.key\\` instead. ${createDocUrl('onKeyDown')}`\n\t\t);\n\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick !== undefined || !!props.disabled,\n\t\t\t'onClick',\n\t\t\t`ButtonStateful is controlled: without \\`onClick\\`, clicking it does nothing. Update \\`isActive\\` from \\`data.isActive\\` in \\`onClick\\`, or set \\`disabled\\`. ${createDocUrl(\n\t\t\t\t'onClick'\n\t\t\t)}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAQA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAkB9C,AAhBA,EACC,GACA,EAAM,QACN,UACA,YACA,EAAa,UAAU,CACxB,GAEA,EACC,GACA,EAAM,YACN,cACA,aACA,uEAAuE,EAAa,WAAW,GAChG,GAEA,EACC,GACA,EAAM,YAAY,KAAA,KAAa,CAAC,CAAC,EAAM,UACvC,WACA,gKAAgK,EAC/J,SACD,GACD;AACD;AAGD,IAAA,IAAe"}
@@ -21,7 +21,8 @@ var f = { icon: "" }, p = {
21
21
  r(e, {
22
22
  active: _,
23
23
  disabled: b,
24
- onClick: E
24
+ onClick: E,
25
+ onKeyPress: k
25
26
  }, i);
26
27
  });
27
28
  let V = !!(g ?? _), [H, U] = c(!1), W = o((e) => l(y, "slds-button", "slds-button_stateful", {
@@ -31,7 +32,7 @@ var f = { icon: "" }, p = {
31
32
  "slds-not-selected": !e,
32
33
  "slds-is-selected": e && !H,
33
34
  "slds-is-selected-clicked": e && H,
34
- "slds-max-small-button_stretch": N,
35
+ "slds-button_stretch": N,
35
36
  "slds-button_icon-border": R === "icon",
36
37
  "slds-button_icon-border-filled": R === "icon-filled"
37
38
  }), [
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/button-stateful/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\tuseState,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype ButtonHTMLAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport ButtonIcon from '../icon/button-icon';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { BUTTON_STATEFUL } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Button stateful variant types\n */\nexport type ButtonStatefulVariant =\n\t| 'base'\n\t| 'neutral'\n\t| 'brand'\n\t| 'destructive'\n\t| 'icon'\n\t| 'icon-filled'\n\t| 'inverse'\n\t| 'success'\n\t| 'text';\n\n/**\n * State configuration for stateful button\n */\nexport interface ButtonStatefulState {\n\t/** Icon component or icon name */\n\ticon?: ReactNode;\n\t/** Icon name (if not using icon prop) */\n\ticonName?: string;\n\t/** Button label */\n\tlabel?: string;\n}\n\n/**\n * Assistive text for ButtonStateful\n */\nexport interface ButtonStatefulAssistiveText {\n\t/** Text for icon */\n\ticon?: string;\n}\n\n/**\n * Click event data for ButtonStateful\n */\nexport interface ButtonStatefulClickData {\n\t/** The requested next state: the inverse of the current `isActive`. */\n\tisActive: boolean;\n}\n\nexport type ButtonStatefulClickHandler = (\n\tevent: MouseEvent<HTMLButtonElement>,\n\tdata: ButtonStatefulClickData\n) => void;\n\n/**\n * `onClick` is required unless the button is `disabled`: ButtonStateful is\n * controlled, so without it clicking does nothing.\n */\nexport type ButtonStatefulClickProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called on click with the requested next state in `data.isActive`. The\n\t\t\t * rendered state only changes when `isActive` is updated. Required\n\t\t\t * unless `disabled` is set.\n\t\t\t */\n\t\t\tonClick: ButtonStatefulClickHandler;\n\t }\n\t| { disabled: true; onClick?: ButtonStatefulClickHandler };\n\ninterface ButtonStatefulBaseProps extends Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t'children' | 'className' | 'disabled' | 'onClick' | 'tabIndex' | 'type'\n> {\n\t/**\n\t * Whether the button is in its selected state. ButtonStateful is\n\t * controlled: update this prop from `onClick`, which reports the requested\n\t * next value in `data.isActive`.\n\t */\n\tisActive: boolean;\n\t/** @deprecated Use `isActive` instead. */\n\tactive?: boolean;\n\t/** Assistive text */\n\tassistiveText?: ButtonStatefulAssistiveText;\n\t/** CSS classes */\n\tclassName?: string;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Icon component */\n\ticon?: ReactNode;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Icon size */\n\ticonSize?: string;\n\t/** HTML id */\n\tid?: string;\n\t/** Blur handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key press handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Scale to full width on small screens */\n\tresponsive?: boolean;\n\t/** Initial/unselected state */\n\tstateOne?: ButtonStatefulState;\n\t/** Selected state */\n\tstateTwo?: ButtonStatefulState;\n\t/** Deselect/hover state */\n\tstateThree?: ButtonStatefulState;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Button variant. `text` renders a stateful button with no border or background. */\n\tvariant?: ButtonStatefulVariant;\n}\n\n/**\n * Props for the ButtonStateful component\n */\nexport type ButtonStatefulProps = ButtonStatefulBaseProps &\n\tButtonStatefulClickProps;\n\nconst defaultAssistiveText: ButtonStatefulAssistiveText = { icon: '' };\n\nconst defaultStateOne: ButtonStatefulState = {\n\ticonName: 'add',\n\tlabel: 'Follow',\n};\nconst defaultStateTwo: ButtonStatefulState = {\n\ticonName: 'check',\n\tlabel: 'Following',\n};\nconst defaultStateThree: ButtonStatefulState = {\n\ticonName: 'close',\n\tlabel: 'Unfollow',\n};\n\n/**\n * The ButtonStateful component is a variant of the Lightning Design System Button component.\n * It is used for buttons that have a state of unselected or selected.\n */\nconst ButtonStateful = ({\n\tisActive: isActiveProp,\n\tactive,\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdisabled = false,\n\ticon,\n\ticonName,\n\ticonSize = 'medium',\n\tid,\n\tonBlur,\n\tonClick,\n\tonFocus,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonMouseDown,\n\tonMouseEnter,\n\tresponsive = false,\n\tstateOne = defaultStateOne,\n\tstateTwo = defaultStateTwo,\n\tstateThree = defaultStateThree,\n\ttabIndex,\n\tvariant,\n\t// Injected by `ButtonGroup` into its last child; keep it off the DOM.\n\ttriggerClassName: _triggerClassName,\n\t...rest\n}: ButtonStatefulProps & {\n\ttriggerClassName?: unknown;\n}): React.ReactElement => {\n\tuseEffect(() => {\n\t\tcheckProps(BUTTON_STATEFUL, { active, disabled, onClick }, componentDoc);\n\t});\n\n\t// `active` is the deprecated name; `isActive` wins when both are passed.\n\tconst isActive = !!(isActiveProp ?? active);\n\n\t// SLDS shows the hover/focus text (\"Unfollow\") on a focused selected button.\n\t// After a mouse click that would show the opposite of what was just chosen,\n\t// so mark the click with `slds-is-selected-clicked` until focus leaves.\n\t// Keyboard clicks (`detail === 0`) keep the focus text.\n\tconst [isClicked, setIsClicked] = useState(false);\n\n\tconst getClassName = useCallback(\n\t\t(active: boolean) =>\n\t\t\tclassNames(className, 'slds-button', 'slds-button_stateful', {\n\t\t\t\t'slds-button_neutral':\n\t\t\t\t\tvariant !== 'icon' &&\n\t\t\t\t\tvariant !== 'icon-filled' &&\n\t\t\t\t\tvariant !== 'success' &&\n\t\t\t\t\tvariant !== 'text',\n\t\t\t\t'slds-button_inverse': variant === 'inverse',\n\t\t\t\t'slds-button_success': variant === 'success',\n\t\t\t\t'slds-not-selected': !active,\n\t\t\t\t// SLDS uses one or the other: `:focus` on `slds-is-selected` would win\n\t\t\t\t'slds-is-selected': active && !isClicked,\n\t\t\t\t'slds-is-selected-clicked': active && isClicked,\n\t\t\t\t'slds-max-small-button_stretch': responsive,\n\t\t\t\t'slds-button_icon-border': variant === 'icon',\n\t\t\t\t'slds-button_icon-border-filled': variant === 'icon-filled',\n\t\t\t}),\n\t\t[className, variant, responsive, isClicked]\n\t);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLButtonElement>) => {\n\t\t\tsetIsClicked(e.detail > 0);\n\t\t\tonClick?.(e, { isActive: !isActive });\n\t\t},\n\t\t[onClick, isActive]\n\t);\n\n\tconst handleBlur = useCallback(\n\t\t(e: FocusEvent<HTMLButtonElement>) => {\n\t\t\tsetIsClicked(false);\n\t\t\tonBlur?.(e);\n\t\t},\n\t\t[onBlur]\n\t);\n\n\tconst defaultIconProps = {\n\t\tdisabled,\n\t\tsize: 'small' as const,\n\t\tclassName: 'slds-button__icon_stateful',\n\t};\n\n\tconst iconAssistiveText = { ...defaultAssistiveText, ...propAssistiveText }\n\t\t.icon;\n\n\t// Accept aria-* props\n\tlet ariaProps = getAriaProps(rest);\n\n\tif (variant === 'icon' || variant === 'icon-filled') {\n\t\tif (Object.keys(ariaProps).length === 0) {\n\t\t\tariaProps = { 'aria-live': 'polite' as const };\n\t\t}\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\t{...rest}\n\t\t\t\t{...ariaProps}\n\t\t\t\tclassName={getClassName(isActive)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\ticon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconProps,\n\t\t\t\t\t\t\t...((icon as React.ReactElement<Record<string, unknown>>).props ||\n\t\t\t\t\t\t\t\t{}),\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={iconName}\n\t\t\t\t\t\tsize={iconSize as 'x-small' | 'small' | 'medium' | 'large'}\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{iconAssistiveText ? (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{iconAssistiveText}</span>\n\t\t\t\t) : null}\n\t\t\t</button>\n\t\t);\n\t}\n\n\tconst defaultIconPropsWithPosition = {\n\t\t...defaultIconProps,\n\t\tposition: 'left' as const,\n\t};\n\n\tif (Object.keys(ariaProps).length === 0) {\n\t\tariaProps = { 'aria-live': 'assertive' as const };\n\t}\n\n\treturn (\n\t\t<button\n\t\t\t{...rest}\n\t\t\t{...ariaProps}\n\t\t\tclassName={getClassName(isActive)}\n\t\t\tdisabled={disabled}\n\t\t\tid={id}\n\t\t\tonBlur={handleBlur}\n\t\t\tonClick={handleClick}\n\t\t\tonFocus={onFocus}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonKeyPress={onKeyPress}\n\t\t\tonKeyUp={onKeyUp}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\ttabIndex={tabIndex}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t<span className=\"slds-text-not-selected\">\n\t\t\t\t{stateOne.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateOne.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((stateOne.icon as React.ReactElement<Record<string, unknown>>)\n\t\t\t\t\t\t\t\t.props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={stateOne.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateOne.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected\">\n\t\t\t\t{stateTwo.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateTwo.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((stateTwo.icon as React.ReactElement<Record<string, unknown>>)\n\t\t\t\t\t\t\t\t.props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={stateTwo.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateTwo.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected-focus\">\n\t\t\t\t{stateThree.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateThree.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((\n\t\t\t\t\t\t\t\tstateThree.icon as React.ReactElement<Record<string, unknown>>\n\t\t\t\t\t\t\t).props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={stateThree.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateThree.label}\n\t\t\t</span>\n\t\t</button>\n\t);\n};\n\nButtonStateful.displayName = BUTTON_STATEFUL;\n\nexport default ButtonStateful;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/button-stateful/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\tuseState,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype ButtonHTMLAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport ButtonIcon from '../icon/button-icon';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { BUTTON_STATEFUL } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Button stateful variant types\n */\nexport type ButtonStatefulVariant =\n\t| 'base'\n\t| 'neutral'\n\t| 'brand'\n\t| 'destructive'\n\t| 'icon'\n\t| 'icon-filled'\n\t| 'inverse'\n\t| 'success'\n\t| 'text';\n\n/**\n * State configuration for stateful button\n */\nexport interface ButtonStatefulState {\n\t/** Icon component or icon name */\n\ticon?: ReactNode;\n\t/** Icon name (if not using icon prop) */\n\ticonName?: string;\n\t/** Button label */\n\tlabel?: string;\n}\n\n/**\n * Assistive text for ButtonStateful\n */\nexport interface ButtonStatefulAssistiveText {\n\t/** Text for icon */\n\ticon?: string;\n}\n\n/**\n * Click event data for ButtonStateful\n */\nexport interface ButtonStatefulClickData {\n\t/** The requested next state: the inverse of the current `isActive`. */\n\tisActive: boolean;\n}\n\nexport type ButtonStatefulClickHandler = (\n\tevent: MouseEvent<HTMLButtonElement>,\n\tdata: ButtonStatefulClickData\n) => void;\n\n/**\n * `onClick` is required unless the button is `disabled`: ButtonStateful is\n * controlled, so without it clicking does nothing.\n */\nexport type ButtonStatefulClickProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called on click with the requested next state in `data.isActive`. The\n\t\t\t * rendered state only changes when `isActive` is updated. Required\n\t\t\t * unless `disabled` is set.\n\t\t\t */\n\t\t\tonClick: ButtonStatefulClickHandler;\n\t }\n\t| {\n\t\t\t/** Disables the button. */\n\t\t\tdisabled: true;\n\t\t\t/** Called on click. Optional while disabled. */\n\t\t\tonClick?: ButtonStatefulClickHandler;\n\t };\n\ninterface ButtonStatefulBaseProps extends Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t'children' | 'className' | 'disabled' | 'onClick' | 'tabIndex' | 'type'\n> {\n\t/**\n\t * Whether the button is in its selected state. ButtonStateful is\n\t * controlled: update this prop from `onClick`, which reports the requested\n\t * next value in `data.isActive`.\n\t */\n\tisActive: boolean;\n\t/** @deprecated Use `isActive` instead. */\n\tactive?: boolean;\n\t/** Assistive text */\n\tassistiveText?: ButtonStatefulAssistiveText;\n\t/** CSS classes */\n\tclassName?: string;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Icon component */\n\ticon?: ReactNode;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Icon size */\n\ticonSize?: string;\n\t/** HTML id */\n\tid?: string;\n\t/** Blur handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/**\n\t * @deprecated `keypress` is a deprecated DOM event. Use `onKeyDown` and read\n\t * `event.key` instead. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Stretches the button to the full width of its container (`slds-button_stretch`) */\n\tresponsive?: boolean;\n\t/** Initial/unselected state */\n\tstateOne?: ButtonStatefulState;\n\t/** Selected state */\n\tstateTwo?: ButtonStatefulState;\n\t/** Deselect/hover state */\n\tstateThree?: ButtonStatefulState;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Button variant. `text` renders a stateful button with no border or background. */\n\tvariant?: ButtonStatefulVariant;\n}\n\n/**\n * Props for the ButtonStateful component\n */\nexport type ButtonStatefulProps = ButtonStatefulBaseProps &\n\tButtonStatefulClickProps;\n\nconst defaultAssistiveText: ButtonStatefulAssistiveText = { icon: '' };\n\nconst defaultStateOne: ButtonStatefulState = {\n\ticonName: 'add',\n\tlabel: 'Follow',\n};\nconst defaultStateTwo: ButtonStatefulState = {\n\ticonName: 'check',\n\tlabel: 'Following',\n};\nconst defaultStateThree: ButtonStatefulState = {\n\ticonName: 'close',\n\tlabel: 'Unfollow',\n};\n\n/**\n * The ButtonStateful component is a variant of the Lightning Design System Button component.\n * It is used for buttons that have a state of unselected or selected.\n */\nconst ButtonStateful = ({\n\tisActive: isActiveProp,\n\tactive,\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdisabled = false,\n\ticon,\n\ticonName,\n\ticonSize = 'medium',\n\tid,\n\tonBlur,\n\tonClick,\n\tonFocus,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonMouseDown,\n\tonMouseEnter,\n\tresponsive = false,\n\tstateOne = defaultStateOne,\n\tstateTwo = defaultStateTwo,\n\tstateThree = defaultStateThree,\n\ttabIndex,\n\tvariant,\n\t// Injected by `ButtonGroup` into its last child; keep it off the DOM.\n\ttriggerClassName: _triggerClassName,\n\t...rest\n}: ButtonStatefulProps & {\n\t/** Set by `ButtonGroup` on its last child. Ignored. */\n\ttriggerClassName?: unknown;\n}): React.ReactElement => {\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tBUTTON_STATEFUL,\n\t\t\t{ active, disabled, onClick, onKeyPress },\n\t\t\tcomponentDoc\n\t\t);\n\t});\n\n\t// `active` is the deprecated name; `isActive` wins when both are passed.\n\tconst isActive = !!(isActiveProp ?? active);\n\n\t// SLDS shows the hover/focus text (\"Unfollow\") on a focused selected button.\n\t// After a mouse click that would show the opposite of what was just chosen,\n\t// so mark the click with `slds-is-selected-clicked` until focus leaves.\n\t// Keyboard clicks (`detail === 0`) keep the focus text.\n\tconst [isClicked, setIsClicked] = useState(false);\n\n\tconst getClassName = useCallback(\n\t\t(active: boolean) =>\n\t\t\tclassNames(className, 'slds-button', 'slds-button_stateful', {\n\t\t\t\t'slds-button_neutral':\n\t\t\t\t\tvariant !== 'icon' &&\n\t\t\t\t\tvariant !== 'icon-filled' &&\n\t\t\t\t\tvariant !== 'success' &&\n\t\t\t\t\tvariant !== 'text',\n\t\t\t\t'slds-button_inverse': variant === 'inverse',\n\t\t\t\t'slds-button_success': variant === 'success',\n\t\t\t\t'slds-not-selected': !active,\n\t\t\t\t// SLDS uses one or the other: `:focus` on `slds-is-selected` would win\n\t\t\t\t'slds-is-selected': active && !isClicked,\n\t\t\t\t'slds-is-selected-clicked': active && isClicked,\n\t\t\t\t'slds-button_stretch': responsive,\n\t\t\t\t'slds-button_icon-border': variant === 'icon',\n\t\t\t\t'slds-button_icon-border-filled': variant === 'icon-filled',\n\t\t\t}),\n\t\t[className, variant, responsive, isClicked]\n\t);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLButtonElement>) => {\n\t\t\tsetIsClicked(e.detail > 0);\n\t\t\tonClick?.(e, { isActive: !isActive });\n\t\t},\n\t\t[onClick, isActive]\n\t);\n\n\tconst handleBlur = useCallback(\n\t\t(e: FocusEvent<HTMLButtonElement>) => {\n\t\t\tsetIsClicked(false);\n\t\t\tonBlur?.(e);\n\t\t},\n\t\t[onBlur]\n\t);\n\n\tconst defaultIconProps = {\n\t\tdisabled,\n\t\tsize: 'small' as const,\n\t\tclassName: 'slds-button__icon_stateful',\n\t};\n\n\tconst iconAssistiveText = { ...defaultAssistiveText, ...propAssistiveText }\n\t\t.icon;\n\n\t// Accept aria-* props\n\tlet ariaProps = getAriaProps(rest);\n\n\tif (variant === 'icon' || variant === 'icon-filled') {\n\t\tif (Object.keys(ariaProps).length === 0) {\n\t\t\tariaProps = { 'aria-live': 'polite' as const };\n\t\t}\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\t{...rest}\n\t\t\t\t{...ariaProps}\n\t\t\t\tclassName={getClassName(isActive)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t// eslint-disable-next-line local/no-deprecated -- forwards the deprecated `onKeyPress` prop until 11.0\n\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\ticon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconProps,\n\t\t\t\t\t\t\t...((icon as React.ReactElement<Record<string, unknown>>).props ||\n\t\t\t\t\t\t\t\t{}),\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={iconName}\n\t\t\t\t\t\tsize={iconSize as 'x-small' | 'small' | 'medium' | 'large'}\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{iconAssistiveText ? (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{iconAssistiveText}</span>\n\t\t\t\t) : null}\n\t\t\t</button>\n\t\t);\n\t}\n\n\tconst defaultIconPropsWithPosition = {\n\t\t...defaultIconProps,\n\t\tposition: 'left' as const,\n\t};\n\n\tif (Object.keys(ariaProps).length === 0) {\n\t\tariaProps = { 'aria-live': 'assertive' as const };\n\t}\n\n\treturn (\n\t\t<button\n\t\t\t{...rest}\n\t\t\t{...ariaProps}\n\t\t\tclassName={getClassName(isActive)}\n\t\t\tdisabled={disabled}\n\t\t\tid={id}\n\t\t\tonBlur={handleBlur}\n\t\t\tonClick={handleClick}\n\t\t\tonFocus={onFocus}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\t// eslint-disable-next-line local/no-deprecated -- forwards the deprecated `onKeyPress` prop until 11.0\n\t\t\tonKeyPress={onKeyPress}\n\t\t\tonKeyUp={onKeyUp}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\ttabIndex={tabIndex}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t<span className=\"slds-text-not-selected\">\n\t\t\t\t{stateOne.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateOne.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((stateOne.icon as React.ReactElement<Record<string, unknown>>)\n\t\t\t\t\t\t\t\t.props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={stateOne.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateOne.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected\">\n\t\t\t\t{stateTwo.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateTwo.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((stateTwo.icon as React.ReactElement<Record<string, unknown>>)\n\t\t\t\t\t\t\t\t.props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={stateTwo.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateTwo.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected-focus\">\n\t\t\t\t{stateThree.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateThree.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((\n\t\t\t\t\t\t\t\tstateThree.icon as React.ReactElement<Record<string, unknown>>\n\t\t\t\t\t\t\t).props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tname={stateThree.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateThree.label}\n\t\t\t</span>\n\t\t</button>\n\t);\n};\n\nButtonStateful.displayName = BUTTON_STATEFUL;\n\nexport default ButtonStateful;\n"],"mappings":"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"}