@salesforce/design-system-react 11.0.0-alpha.7 → 11.0.0-alpha.9

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 (429) hide show
  1. package/dist/cjs/components/accordion/index.cjs +1 -1
  2. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  3. package/dist/cjs/components/alert/container.cjs +1 -1
  4. package/dist/cjs/components/alert/container.cjs.map +1 -1
  5. package/dist/cjs/components/avatar/index.cjs +1 -1
  6. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  7. package/dist/cjs/components/button-stateful/check-props.cjs +2 -0
  8. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -0
  9. package/dist/cjs/components/button-stateful/component.cjs +2 -0
  10. package/dist/cjs/components/button-stateful/component.cjs.map +1 -0
  11. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  12. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  13. package/dist/cjs/components/carousel/index.cjs +1 -1
  14. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  15. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  16. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  17. package/dist/cjs/components/checkbox/index.cjs +1 -1
  18. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  19. package/dist/cjs/components/color-picker/check-props.cjs +1 -1
  20. package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
  21. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  22. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  23. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs +2 -0
  24. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -0
  25. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  26. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  27. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  28. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  29. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  30. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  31. package/dist/cjs/components/combobox/index.cjs +1 -1
  32. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  33. package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  35. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  36. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  37. package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
  38. package/dist/cjs/components/expandable-section/index.cjs +1 -1
  39. package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
  40. package/dist/cjs/components/filter/filter.cjs +1 -1
  41. package/dist/cjs/components/filter/filter.cjs.map +1 -1
  42. package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
  43. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  44. package/dist/cjs/components/index.cjs +1 -1
  45. package/dist/cjs/components/input/check-props.cjs +1 -1
  46. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  47. package/dist/cjs/components/input/index.cjs +1 -1
  48. package/dist/cjs/components/input/index.cjs.map +1 -1
  49. package/dist/cjs/components/input/private/inner-input.cjs +1 -1
  50. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  51. package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
  52. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  53. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  54. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  55. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  56. package/dist/cjs/components/modal/check-props.cjs +2 -0
  57. package/dist/cjs/components/modal/check-props.cjs.map +1 -0
  58. package/dist/cjs/components/modal/component.cjs +2 -0
  59. package/dist/cjs/components/modal/component.cjs.map +1 -0
  60. package/dist/cjs/components/modal/index.cjs +1 -1
  61. package/dist/cjs/components/modal/index.cjs.map +1 -1
  62. package/dist/cjs/components/popover/component.cjs +2 -0
  63. package/dist/cjs/components/popover/component.cjs.map +1 -0
  64. package/dist/cjs/components/popover/edit-dialog.cjs +1 -1
  65. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  66. package/dist/cjs/components/popover/index.cjs.map +1 -1
  67. package/dist/cjs/components/popover/popover.cjs +1 -1
  68. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  69. package/dist/cjs/components/radio/check-props.cjs +1 -1
  70. package/dist/cjs/components/radio/check-props.cjs.map +1 -1
  71. package/dist/cjs/components/radio/index.cjs +1 -1
  72. package/dist/cjs/components/radio/index.cjs.map +1 -1
  73. package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
  74. package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
  75. package/dist/cjs/components/radio-group/check-props.cjs +2 -0
  76. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -0
  77. package/dist/cjs/components/radio-group/component.cjs +2 -0
  78. package/dist/cjs/components/radio-group/component.cjs.map +1 -0
  79. package/dist/cjs/components/radio-group/index.cjs +1 -1
  80. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  81. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  82. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  83. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  84. package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
  85. package/dist/cjs/components/simple-data-table/column.cjs.map +1 -1
  86. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  87. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  88. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  89. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  90. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  91. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  92. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  93. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  94. package/dist/cjs/components/slider/check-props.cjs +1 -1
  95. package/dist/cjs/components/slider/check-props.cjs.map +1 -1
  96. package/dist/cjs/components/slider/index.cjs +1 -1
  97. package/dist/cjs/components/slider/index.cjs.map +1 -1
  98. package/dist/cjs/components/spinner/check-props.cjs +2 -0
  99. package/dist/cjs/components/spinner/check-props.cjs.map +1 -0
  100. package/dist/cjs/components/spinner/component.cjs +2 -0
  101. package/dist/cjs/components/spinner/component.cjs.map +1 -0
  102. package/dist/cjs/components/spinner/index.cjs +1 -1
  103. package/dist/cjs/components/spinner/index.cjs.map +1 -1
  104. package/dist/cjs/components/split-view/index.cjs +1 -1
  105. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  106. package/dist/cjs/components/split-view/listbox-check-props.cjs +1 -1
  107. package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -1
  108. package/dist/cjs/components/split-view/listbox.cjs +1 -1
  109. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  110. package/dist/cjs/components/tabs/check-props.cjs +2 -0
  111. package/dist/cjs/components/tabs/check-props.cjs.map +1 -0
  112. package/dist/cjs/components/tabs/component.cjs +2 -0
  113. package/dist/cjs/components/tabs/component.cjs.map +1 -0
  114. package/dist/cjs/components/tabs/index.cjs +1 -1
  115. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  116. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  117. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  118. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  119. package/dist/cjs/components/textarea/index.cjs +1 -1
  120. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  121. package/dist/cjs/components/toast/container.cjs +1 -1
  122. package/dist/cjs/components/toast/container.cjs.map +1 -1
  123. package/dist/cjs/components/tooltip/index.cjs +2 -2
  124. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  125. package/dist/cjs/components/tree/check-props.cjs +1 -1
  126. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  127. package/dist/cjs/components/tree/private/branch.cjs +1 -1
  128. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  129. package/dist/cjs/components/tree/private/item.cjs +1 -1
  130. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  131. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  132. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  133. package/dist/cjs/components/tree/tree.cjs +1 -1
  134. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  135. package/dist/cjs/components/vertical-navigation/check-props.cjs +2 -0
  136. package/dist/cjs/components/vertical-navigation/check-props.cjs.map +1 -0
  137. package/dist/cjs/components/vertical-navigation/component.cjs +2 -0
  138. package/dist/cjs/components/vertical-navigation/component.cjs.map +1 -0
  139. package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
  140. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  141. package/dist/cjs/components/welcome-mat/index.cjs +1 -1
  142. package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
  143. package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
  144. package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
  145. package/dist/cjs/utilities/hooks/index.cjs +1 -1
  146. package/dist/cjs/utilities/hooks/use-controllable-state.cjs +2 -0
  147. package/dist/cjs/utilities/hooks/use-controllable-state.cjs.map +1 -0
  148. package/dist/cjs/utilities/warning/required-property.cjs +2 -0
  149. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -0
  150. package/dist/es/components/accordion/index.js +10 -8
  151. package/dist/es/components/accordion/index.js.map +1 -1
  152. package/dist/es/components/alert/container.js +1 -1
  153. package/dist/es/components/alert/container.js.map +1 -1
  154. package/dist/es/components/avatar/index.js +2 -1
  155. package/dist/es/components/avatar/index.js.map +1 -1
  156. package/dist/es/components/button-stateful/check-props.js +14 -0
  157. package/dist/es/components/button-stateful/check-props.js.map +1 -0
  158. package/dist/es/components/button-stateful/component.js +20 -0
  159. package/dist/es/components/button-stateful/component.js.map +1 -0
  160. package/dist/es/components/button-stateful/index.js +102 -94
  161. package/dist/es/components/button-stateful/index.js.map +1 -1
  162. package/dist/es/components/carousel/index.js +112 -130
  163. package/dist/es/components/carousel/index.js.map +1 -1
  164. package/dist/es/components/checkbox/check-props.js +14 -8
  165. package/dist/es/components/checkbox/check-props.js.map +1 -1
  166. package/dist/es/components/checkbox/index.js +40 -33
  167. package/dist/es/components/checkbox/index.js.map +1 -1
  168. package/dist/es/components/color-picker/check-props.js +16 -11
  169. package/dist/es/components/color-picker/check-props.js.map +1 -1
  170. package/dist/es/components/color-picker/color-picker.js +185 -169
  171. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  172. package/dist/es/components/color-picker/private/color-picker-tabs.js +17 -0
  173. package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -0
  174. package/dist/es/components/color-picker/private/hsv-color.js +1 -0
  175. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  176. package/dist/es/components/combobox/check-props.js +15 -14
  177. package/dist/es/components/combobox/check-props.js.map +1 -1
  178. package/dist/es/components/combobox/combobox.js +401 -401
  179. package/dist/es/components/combobox/combobox.js.map +1 -1
  180. package/dist/es/components/combobox/index.js +4 -4
  181. package/dist/es/components/date-picker/check-props.js +15 -9
  182. package/dist/es/components/date-picker/check-props.js.map +1 -1
  183. package/dist/es/components/date-picker/date-picker.js +144 -138
  184. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  185. package/dist/es/components/date-picker/index.js.map +1 -1
  186. package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
  187. package/dist/es/components/expandable-section/index.js +32 -26
  188. package/dist/es/components/expandable-section/index.js.map +1 -1
  189. package/dist/es/components/filter/filter.js +1 -1
  190. package/dist/es/components/filter/filter.js.map +1 -1
  191. package/dist/es/components/icon/input-icon/index.js +7 -2
  192. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  193. package/dist/es/components/index.js +3 -3
  194. package/dist/es/components/input/check-props.js +19 -17
  195. package/dist/es/components/input/check-props.js.map +1 -1
  196. package/dist/es/components/input/index.js +153 -156
  197. package/dist/es/components/input/index.js.map +1 -1
  198. package/dist/es/components/input/private/inner-input.js +18 -18
  199. package/dist/es/components/input/private/inner-input.js.map +1 -1
  200. package/dist/es/components/menu-dropdown/button-trigger.js +7 -1
  201. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  202. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  203. package/dist/es/components/menu-dropdown/menu-dropdown.js +294 -269
  204. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  205. package/dist/es/components/modal/check-props.js +22 -0
  206. package/dist/es/components/modal/check-props.js.map +1 -0
  207. package/dist/es/components/modal/component.js +35 -0
  208. package/dist/es/components/modal/component.js.map +1 -0
  209. package/dist/es/components/modal/index.js +118 -104
  210. package/dist/es/components/modal/index.js.map +1 -1
  211. package/dist/es/components/popover/component.js +59 -0
  212. package/dist/es/components/popover/component.js.map +1 -0
  213. package/dist/es/components/popover/edit-dialog.js +1 -1
  214. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  215. package/dist/es/components/popover/index.js.map +1 -1
  216. package/dist/es/components/popover/popover.js +241 -193
  217. package/dist/es/components/popover/popover.js.map +1 -1
  218. package/dist/es/components/radio/check-props.js +8 -8
  219. package/dist/es/components/radio/check-props.js.map +1 -1
  220. package/dist/es/components/radio/index.js +15 -13
  221. package/dist/es/components/radio/index.js.map +1 -1
  222. package/dist/es/components/radio-button-group/index.js.map +1 -1
  223. package/dist/es/components/radio-button-group/radio.js.map +1 -1
  224. package/dist/es/components/radio-group/check-props.js +14 -0
  225. package/dist/es/components/radio-group/check-props.js.map +1 -0
  226. package/dist/es/components/radio-group/component.js +21 -0
  227. package/dist/es/components/radio-group/component.js.map +1 -0
  228. package/dist/es/components/radio-group/index.js +62 -38
  229. package/dist/es/components/radio-group/index.js.map +1 -1
  230. package/dist/es/components/setup-assistant/step.js +5 -4
  231. package/dist/es/components/setup-assistant/step.js.map +1 -1
  232. package/dist/es/components/simple-data-table/check-props.js +7 -6
  233. package/dist/es/components/simple-data-table/check-props.js.map +1 -1
  234. package/dist/es/components/simple-data-table/column.js.map +1 -1
  235. package/dist/es/components/simple-data-table/index.js +67 -49
  236. package/dist/es/components/simple-data-table/index.js.map +1 -1
  237. package/dist/es/components/simple-data-table/private/head.js +1 -1
  238. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  239. package/dist/es/components/simple-data-table/private/header-cell.js +50 -52
  240. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  241. package/dist/es/components/simple-data-table/private/row.js +43 -57
  242. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  243. package/dist/es/components/slider/check-props.js +14 -12
  244. package/dist/es/components/slider/check-props.js.map +1 -1
  245. package/dist/es/components/slider/index.js +71 -62
  246. package/dist/es/components/slider/index.js.map +1 -1
  247. package/dist/es/components/spinner/check-props.js +13 -0
  248. package/dist/es/components/spinner/check-props.js.map +1 -0
  249. package/dist/es/components/spinner/component.js +17 -0
  250. package/dist/es/components/spinner/component.js.map +1 -0
  251. package/dist/es/components/spinner/index.js +43 -29
  252. package/dist/es/components/spinner/index.js.map +1 -1
  253. package/dist/es/components/split-view/index.js +23 -22
  254. package/dist/es/components/split-view/index.js.map +1 -1
  255. package/dist/es/components/split-view/listbox-check-props.js +10 -2
  256. package/dist/es/components/split-view/listbox-check-props.js.map +1 -1
  257. package/dist/es/components/split-view/listbox.js +67 -50
  258. package/dist/es/components/split-view/listbox.js.map +1 -1
  259. package/dist/es/components/tabs/check-props.js +15 -0
  260. package/dist/es/components/tabs/check-props.js.map +1 -0
  261. package/dist/es/components/tabs/component.js +28 -0
  262. package/dist/es/components/tabs/component.js.map +1 -0
  263. package/dist/es/components/tabs/index.js +84 -69
  264. package/dist/es/components/tabs/index.js.map +1 -1
  265. package/dist/es/components/tabs/panel.js.map +1 -1
  266. package/dist/es/components/textarea/check-props.js +1 -1
  267. package/dist/es/components/textarea/check-props.js.map +1 -1
  268. package/dist/es/components/textarea/index.js +3 -2
  269. package/dist/es/components/textarea/index.js.map +1 -1
  270. package/dist/es/components/toast/container.js +1 -1
  271. package/dist/es/components/toast/container.js.map +1 -1
  272. package/dist/es/components/tooltip/index.js +120 -109
  273. package/dist/es/components/tooltip/index.js.map +1 -1
  274. package/dist/es/components/tree/check-props.js +14 -9
  275. package/dist/es/components/tree/check-props.js.map +1 -1
  276. package/dist/es/components/tree/private/branch.js +38 -35
  277. package/dist/es/components/tree/private/branch.js.map +1 -1
  278. package/dist/es/components/tree/private/item.js +6 -8
  279. package/dist/es/components/tree/private/item.js.map +1 -1
  280. package/dist/es/components/tree/private/render-branch.js +9 -10
  281. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  282. package/dist/es/components/tree/tree.js +128 -93
  283. package/dist/es/components/tree/tree.js.map +1 -1
  284. package/dist/es/components/vertical-navigation/check-props.js +13 -0
  285. package/dist/es/components/vertical-navigation/check-props.js.map +1 -0
  286. package/dist/es/components/vertical-navigation/component.js +27 -0
  287. package/dist/es/components/vertical-navigation/component.js.map +1 -0
  288. package/dist/es/components/vertical-navigation/index.js +28 -26
  289. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  290. package/dist/es/components/welcome-mat/index.js +51 -50
  291. package/dist/es/components/welcome-mat/index.js.map +1 -1
  292. package/dist/es/components/welcome-mat/info-badge.js +14 -4
  293. package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
  294. package/dist/es/utilities/hooks/index.js +2 -1
  295. package/dist/es/utilities/hooks/use-controllable-state.js +20 -0
  296. package/dist/es/utilities/hooks/use-controllable-state.js.map +1 -0
  297. package/dist/es/utilities/warning/required-property.js +15 -0
  298. package/dist/es/utilities/warning/required-property.js.map +1 -0
  299. package/dist/types/components/accordion/index.d.ts.map +1 -1
  300. package/dist/types/components/avatar/index.d.ts.map +1 -1
  301. package/dist/types/components/button-stateful/check-props.d.ts +3 -0
  302. package/dist/types/components/button-stateful/check-props.d.ts.map +1 -0
  303. package/dist/types/components/button-stateful/index.d.ts +34 -6
  304. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  305. package/dist/types/components/carousel/index.d.ts +26 -7
  306. package/dist/types/components/carousel/index.d.ts.map +1 -1
  307. package/dist/types/components/checkbox/check-props.d.ts +1 -0
  308. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  309. package/dist/types/components/checkbox/index.d.ts +38 -9
  310. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  311. package/dist/types/components/color-picker/check-props.d.ts.map +1 -1
  312. package/dist/types/components/color-picker/color-picker.d.ts +50 -11
  313. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  314. package/dist/types/components/color-picker/index.d.ts +2 -2
  315. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  316. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +14 -0
  317. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +1 -0
  318. package/dist/types/components/color-picker/private/hsv-color.d.ts.map +1 -1
  319. package/dist/types/components/color-picker/types.d.ts +9 -5
  320. package/dist/types/components/color-picker/types.d.ts.map +1 -1
  321. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  322. package/dist/types/components/combobox/combobox.d.ts +41 -6
  323. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  324. package/dist/types/components/date-picker/check-props.d.ts.map +1 -1
  325. package/dist/types/components/date-picker/date-picker.d.ts +52 -17
  326. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  327. package/dist/types/components/date-picker/index.d.ts +1 -1
  328. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  329. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +3 -1
  330. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +1 -1
  331. package/dist/types/components/expandable-section/index.d.ts +15 -3
  332. package/dist/types/components/expandable-section/index.d.ts.map +1 -1
  333. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  334. package/dist/types/components/input/check-props.d.ts.map +1 -1
  335. package/dist/types/components/input/index.d.ts +10 -4
  336. package/dist/types/components/input/index.d.ts.map +1 -1
  337. package/dist/types/components/input/private/inner-input.d.ts +2 -4
  338. package/dist/types/components/input/private/inner-input.d.ts.map +1 -1
  339. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  340. package/dist/types/components/menu-dropdown/index.d.ts +1 -1
  341. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  342. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +78 -15
  343. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  344. package/dist/types/components/modal/check-props.d.ts +3 -0
  345. package/dist/types/components/modal/check-props.d.ts.map +1 -0
  346. package/dist/types/components/modal/index.d.ts +21 -13
  347. package/dist/types/components/modal/index.d.ts.map +1 -1
  348. package/dist/types/components/popover/index.d.ts +1 -1
  349. package/dist/types/components/popover/index.d.ts.map +1 -1
  350. package/dist/types/components/popover/popover.d.ts +54 -17
  351. package/dist/types/components/popover/popover.d.ts.map +1 -1
  352. package/dist/types/components/radio/check-props.d.ts.map +1 -1
  353. package/dist/types/components/radio/index.d.ts +42 -9
  354. package/dist/types/components/radio/index.d.ts.map +1 -1
  355. package/dist/types/components/radio-button-group/index.d.ts +20 -10
  356. package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
  357. package/dist/types/components/radio-button-group/radio.d.ts +7 -2
  358. package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
  359. package/dist/types/components/radio-group/check-props.d.ts +3 -0
  360. package/dist/types/components/radio-group/check-props.d.ts.map +1 -0
  361. package/dist/types/components/radio-group/index.d.ts +51 -8
  362. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  363. package/dist/types/components/radio-group/radio.d.ts +7 -2
  364. package/dist/types/components/radio-group/radio.d.ts.map +1 -1
  365. package/dist/types/components/setup-assistant/step.d.ts +10 -2
  366. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  367. package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
  368. package/dist/types/components/simple-data-table/column.d.ts +4 -1
  369. package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
  370. package/dist/types/components/simple-data-table/index.d.ts +10 -2
  371. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  372. package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -1
  373. package/dist/types/components/simple-data-table/private/row.d.ts +4 -2
  374. package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -1
  375. package/dist/types/components/simple-data-table/types.d.ts +40 -13
  376. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  377. package/dist/types/components/slider/check-props.d.ts.map +1 -1
  378. package/dist/types/components/slider/index.d.ts +32 -17
  379. package/dist/types/components/slider/index.d.ts.map +1 -1
  380. package/dist/types/components/spinner/check-props.d.ts +3 -0
  381. package/dist/types/components/spinner/check-props.d.ts.map +1 -0
  382. package/dist/types/components/spinner/index.d.ts +18 -9
  383. package/dist/types/components/spinner/index.d.ts.map +1 -1
  384. package/dist/types/components/split-view/index.d.ts +12 -3
  385. package/dist/types/components/split-view/index.d.ts.map +1 -1
  386. package/dist/types/components/split-view/listbox-check-props.d.ts +1 -0
  387. package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -1
  388. package/dist/types/components/split-view/listbox.d.ts +41 -10
  389. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  390. package/dist/types/components/tabs/check-props.d.ts +3 -0
  391. package/dist/types/components/tabs/check-props.d.ts.map +1 -0
  392. package/dist/types/components/tabs/index.d.ts +46 -12
  393. package/dist/types/components/tabs/index.d.ts.map +1 -1
  394. package/dist/types/components/tabs/panel.d.ts +4 -0
  395. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  396. package/dist/types/components/textarea/check-props.d.ts.map +1 -1
  397. package/dist/types/components/textarea/index.d.ts +14 -6
  398. package/dist/types/components/textarea/index.d.ts.map +1 -1
  399. package/dist/types/components/toast/container.d.ts +1 -1
  400. package/dist/types/components/tooltip/index.d.ts +49 -3
  401. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  402. package/dist/types/components/tree/check-props.d.ts +1 -0
  403. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  404. package/dist/types/components/tree/private/branch.d.ts +6 -1
  405. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  406. package/dist/types/components/tree/private/item.d.ts +3 -1
  407. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  408. package/dist/types/components/tree/private/render-branch.d.ts +3 -1
  409. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  410. package/dist/types/components/tree/tree.d.ts +41 -10
  411. package/dist/types/components/tree/tree.d.ts.map +1 -1
  412. package/dist/types/components/tree/types.d.ts +23 -4
  413. package/dist/types/components/tree/types.d.ts.map +1 -1
  414. package/dist/types/components/vertical-navigation/check-props.d.ts +1 -0
  415. package/dist/types/components/vertical-navigation/check-props.d.ts.map +1 -1
  416. package/dist/types/components/vertical-navigation/index.d.ts +16 -11
  417. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  418. package/dist/types/components/welcome-mat/index.d.ts +5 -6
  419. package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
  420. package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
  421. package/dist/types/types/components.d.ts +0 -2
  422. package/dist/types/types/components.d.ts.map +1 -1
  423. package/dist/types/utilities/hooks/index.d.ts +1 -0
  424. package/dist/types/utilities/hooks/index.d.ts.map +1 -1
  425. package/dist/types/utilities/hooks/use-controllable-state.d.ts +23 -0
  426. package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +1 -0
  427. package/dist/types/utilities/warning/required-property.d.ts +3 -0
  428. package/dist/types/utilities/warning/required-property.d.ts.map +1 -0
  429. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ //#region components/tabs/component.json
2
+ var e = "tabs", t = "prod", n = "Tabs", r = [{
3
+ component: "panel",
4
+ classKey: "TabsPanel"
5
+ }], i = {
6
+ component: e,
7
+ status: t,
8
+ "display-name": "Tabs",
9
+ classKey: n,
10
+ "last-accessibility-review": {
11
+ "date-iso-8601": "2018/01/18",
12
+ "commit-sha": "ad6b6c6523ee21cada11be5f7ea4d99abc530726"
13
+ },
14
+ "SLDS-component-path": "/components/tabs",
15
+ dependencies: r,
16
+ "site-stories": [{
17
+ heading: "Default",
18
+ path: "/__examples__/default.jsx"
19
+ }, {
20
+ heading: "Scoped",
21
+ path: "/__examples__/scoped.jsx"
22
+ }],
23
+ "url-slug": "tabs"
24
+ };
25
+ //#endregion
26
+ export { n as classKey, e as component, i as default, r as dependencies, t as status };
27
+
28
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","names":[],"sources":["../../../../components/tabs/component.json"],"sourcesContent":["{\n\t\"component\": \"tabs\",\n\t\"status\": \"prod\",\n\t\"display-name\": \"Tabs\",\n\t\"classKey\": \"Tabs\",\n\t\"last-accessibility-review\": {\n\t\t\"date-iso-8601\": \"2018/01/18\",\n\t\t\"commit-sha\": \"ad6b6c6523ee21cada11be5f7ea4d99abc530726\"\n\t},\n\t\"SLDS-component-path\": \"/components/tabs\",\n\t\"dependencies\": [\n\t\t{\n\t\t\t\"component\": \"panel\",\n\t\t\t\"classKey\": \"TabsPanel\"\n\t\t}\n\t],\n\t\"site-stories\": [\n\t\t{\n\t\t\t\"heading\": \"Default\",\n\t\t\t\"path\": \"/__examples__/default.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"Scoped\",\n\t\t\t\"path\": \"/__examples__/scoped.jsx\"\n\t\t}\n\t],\n\t\"url-slug\": \"tabs\"\n}\n"],"mappings":""}
@@ -4,132 +4,147 @@ import n from "../../utilities/key-code.js";
4
4
  import r from "./private/tabs-list.js";
5
5
  import i from "./private/tab.js";
6
6
  import a from "./private/tab-panel.js";
7
- import o, { useCallback as s, useId as c, useRef as l, useState as u } from "react";
8
- import d from "classnames";
9
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import o from "./check-props.js";
8
+ import s from "./component.js";
9
+ import c, { useCallback as l, useEffect as u, useId as d, useRef as f, useState as p } from "react";
10
+ import m from "classnames";
11
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
12
  //#region components/tabs/index.tsx
11
- function m(e) {
13
+ var _ = (e, t) => e.props.value ?? String(t);
14
+ function v(e) {
12
15
  return e.nodeName === "A" && e.getAttribute("role") === "tab" || e.nodeName === "LI" && (e.classList.contains("slds-tabs_default__item") || e.classList.contains("slds-tabs_scoped__item") || e.classList.contains("slds-vertical-tabs__nav-item"));
13
16
  }
14
- function h(e) {
17
+ function y(e) {
15
18
  return !!(e.classList?.contains("slds-disabled") || e.getAttribute?.("aria-disabled") === "true");
16
19
  }
17
- function g(e) {
20
+ function b(e) {
18
21
  return !!e.props?.disabled;
19
22
  }
20
- var _ = ({ children: e, className: _, defaultSelectedIndex: v = 0, id: y, onSelect: b, selectedIndex: x, variant: S = "default" }) => {
21
- let C = c(), w = y || C, [T, E] = u(v), [D, O] = u(!1), k = l([]), A = l(null), j = o.Children.toArray(e), M = j.length, N = Number.isInteger(x) ? x : T, P = s((e) => {
22
- for (let t = e + 1; t < M; t++) {
23
- let e = k.current[t];
24
- if (e && !g(e.tab)) return t;
23
+ var x = (x) => {
24
+ let { children: S, className: C, id: w, onSelect: T, selectedIndex: E, value: D, variant: O = "default" } = x, k = d(), A = w || k;
25
+ u(() => {
26
+ o(e, {
27
+ defaultSelectedIndex: x.defaultSelectedIndex,
28
+ selectedIndex: E,
29
+ value: D
30
+ }, s);
31
+ });
32
+ let [j, M] = p(!1), N = f([]), P = f(null), F = c.Children.toArray(S), I = F.length, L = D === void 0 ? Number.isInteger(E) ? E : -1 : F.findIndex((e, t) => _(e, t) === D), R = l((e) => {
33
+ for (let t = e + 1; t < I; t++) {
34
+ let e = N.current[t];
35
+ if (e && !b(e.tab)) return t;
25
36
  }
26
37
  for (let t = 0; t < e; t++) {
27
- let e = k.current[t];
28
- if (e && !g(e.tab)) return t;
38
+ let e = N.current[t];
39
+ if (e && !b(e.tab)) return t;
29
40
  }
30
41
  return e;
31
- }, [M]), F = s((e) => {
42
+ }, [I]), z = l((e) => {
32
43
  for (let t = e - 1; t >= 0; t--) {
33
- let e = k.current[t];
34
- if (e && !g(e.tab)) return t;
44
+ let e = N.current[t];
45
+ if (e && !b(e.tab)) return t;
35
46
  }
36
- for (let t = M - 1; t > e; t--) {
37
- let e = k.current[t];
38
- if (e && !g(e.tab)) return t;
47
+ for (let t = I - 1; t > e; t--) {
48
+ let e = N.current[t];
49
+ if (e && !b(e.tab)) return t;
39
50
  }
40
51
  return e;
41
- }, [M]), I = s((e, t, n) => {
42
- t < 0 || t >= M || (b?.(e, {
52
+ }, [I]), B = l((e, t, n) => {
53
+ if (t < 0 || t >= I || t === L) return;
54
+ let r = L >= 0 ? F[L] : void 0;
55
+ T?.(e, {
56
+ value: _(F[t], t),
57
+ previousValue: r ? _(r, L) : void 0,
43
58
  selectedIndex: t,
44
- previousIndex: N
45
- }), t !== T && (E(t), O(n === !0)));
59
+ previousIndex: L
60
+ }), M(n === !0);
46
61
  }, [
47
- M,
48
- b,
49
- N,
50
- T
51
- ]), L = s((e) => {
52
- if (!m(e)) return !1;
62
+ I,
63
+ T,
64
+ L,
65
+ F
66
+ ]), V = l((e) => {
67
+ if (!v(e)) return !1;
53
68
  let t = e.parentElement;
54
69
  for (; t;) {
55
- if (t === A.current) return !0;
70
+ if (t === P.current) return !0;
56
71
  if (t.getAttribute("data-tabs")) break;
57
72
  t = t.parentElement;
58
73
  }
59
74
  return !1;
60
- }, []), R = s((e) => {
75
+ }, []), H = l((e) => {
61
76
  let t = e.target;
62
77
  do {
63
- if (L(t)) {
64
- if (h(t)) return;
78
+ if (V(t)) {
79
+ if (y(t)) return;
65
80
  let n = t.parentNode;
66
81
  n?.nodeName === "LI" && (t = n, n = t.parentNode);
67
82
  let r = Array.from(n.children).indexOf(t);
68
- I(e, r);
83
+ B(e, r);
69
84
  return;
70
85
  }
71
86
  t = t.parentNode;
72
87
  } while (t !== null);
73
- }, [L, I]), z = s((e) => {
74
- if (L(e.target)) {
75
- let r = N, i = !1;
76
- e.keyCode === n.LEFT || e.keyCode === n.UP ? (r = F(r), i = !0) : (e.keyCode === n.RIGHT || e.keyCode === n.DOWN) && (r = P(r), i = !0), i && t.trap(e), I(e, r, !0);
88
+ }, [V, B]), U = l((e) => {
89
+ if (V(e.target)) {
90
+ let r = L, i = !1;
91
+ e.keyCode === n.LEFT || e.keyCode === n.UP ? (r = z(r), i = !0) : (e.keyCode === n.RIGHT || e.keyCode === n.DOWN) && (r = R(r), i = !0), i && t.trap(e), B(e, r, !0);
77
92
  }
78
93
  }, [
94
+ V,
79
95
  L,
80
- N,
81
- F,
82
- P,
83
- I
96
+ z,
97
+ R,
98
+ B
84
99
  ]);
85
- return /* @__PURE__ */ p("div", {
86
- id: w,
87
- className: d({
88
- "slds-tabs_default": S === "default",
89
- "slds-tabs_scoped": S === "scoped",
90
- "slds-vertical-tabs": S === "vertical"
91
- }, _),
92
- onClick: R,
93
- onKeyDown: z,
100
+ return /* @__PURE__ */ g("div", {
101
+ id: A,
102
+ className: m({
103
+ "slds-tabs_default": O === "default",
104
+ "slds-tabs_scoped": O === "scoped",
105
+ "slds-vertical-tabs": O === "vertical"
106
+ }, C),
107
+ onClick: H,
108
+ onKeyDown: U,
94
109
  "data-tabs": !0,
95
- ref: A,
96
- children: [/* @__PURE__ */ f(r, {
97
- id: w,
98
- variant: S,
99
- children: j.map((e, t) => {
100
- let n = `${w}-slds-tabs_tab-${t}`, r = `${w}-slds-tabs_panel-${t}`, a = N === t;
101
- return /* @__PURE__ */ f(i, {
110
+ ref: P,
111
+ children: [/* @__PURE__ */ h(r, {
112
+ id: A,
113
+ variant: O,
114
+ children: F.map((e, t) => {
115
+ let n = `${A}-slds-tabs_tab-${t}`, r = `${A}-slds-tabs_panel-${t}`, a = L === t;
116
+ return /* @__PURE__ */ h(i, {
102
117
  ref: (n) => {
103
- k.current[t] = {
118
+ N.current[t] = {
104
119
  tab: e,
105
120
  node: n
106
- }, D && O(!1);
121
+ }, j && M(!1);
107
122
  },
108
- focus: a && D,
123
+ focus: a && j,
109
124
  selected: a,
110
125
  id: n,
111
126
  panelId: r,
112
127
  disabled: e.props.disabled,
113
- variant: S,
128
+ variant: O,
114
129
  hasError: e.props.hasError,
115
130
  assistiveText: e.props.assistiveText,
116
131
  children: e.props.label
117
132
  }, e.key ?? t);
118
133
  })
119
- }), j.map((e, t) => {
120
- let n = `${w}-slds-tabs_tab-${t}`, r = `${w}-slds-tabs_panel-${t}`;
121
- return /* @__PURE__ */ f(a, {
122
- selected: N === t,
134
+ }), F.map((e, t) => {
135
+ let n = `${A}-slds-tabs_tab-${t}`, r = `${A}-slds-tabs_panel-${t}`;
136
+ return /* @__PURE__ */ h(a, {
137
+ selected: L === t,
123
138
  id: r,
124
139
  tabId: n,
125
- variant: S,
140
+ variant: O,
126
141
  children: e
127
142
  }, e.key ?? t);
128
143
  })]
129
144
  });
130
145
  };
131
- _.displayName = e;
146
+ x.displayName = e;
132
147
  //#endregion
133
- export { _ as default };
148
+ export { x as default };
134
149
 
135
150
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/tabs/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\n\n// Child components\nimport TabsList from './private/tabs-list';\nimport Tab from './private/tab';\nimport TabPanel from './private/tab-panel';\n\nimport { TABS } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Tabs variant types\n */\nexport type TabsVariant = 'default' | 'scoped' | 'vertical';\n\n/**\n * Tab child props (TabsPanel)\n */\nexport interface TabChildProps {\n\tlabel: ReactNode;\n\tdisabled?: boolean;\n\thasError?: boolean;\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n\tchildren?: ReactNode;\n\tkey?: string | number;\n}\n\n/**\n * Data passed to the Tabs `onSelect` callback\n */\nexport interface TabsSelectData {\n\t/** Index of the tab being selected */\n\tselectedIndex: number;\n\t/** Index of the tab that was selected before this selection */\n\tpreviousIndex: number;\n}\n\n/**\n * Props for the Tabs component\n */\nexport interface TabsProps {\n\t/** TabsPanel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Default selected tab index */\n\tdefaultSelectedIndex?: number;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Called when a tab is selected by click or keyboard. Receives the triggering event and\n\t * `{ selectedIndex, previousIndex }`. When `selectedIndex` is not passed, the selection always\n\t * changes; when it is passed (controlled), update it from this callback to change tabs.\n\t */\n\tonSelect?: (\n\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\tdata: TabsSelectData\n\t) => void;\n\t/** Currently selected tab index (controlled) */\n\tselectedIndex?: number;\n\t/** Tab style variant */\n\tvariant?: TabsVariant;\n}\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node: HTMLElement): boolean {\n\treturn (\n\t\t(node.nodeName === 'A' && node.getAttribute('role') === 'tab') ||\n\t\t(node.nodeName === 'LI' &&\n\t\t\t(node.classList.contains('slds-tabs_default__item') ||\n\t\t\t\tnode.classList.contains('slds-tabs_scoped__item') ||\n\t\t\t\tnode.classList.contains('slds-vertical-tabs__nav-item')))\n\t);\n}\n\n// Determine if a tab node is disabled (from DOM)\nfunction isTabNodeDisabled(node: HTMLElement): boolean {\n\tif (node.classList?.contains('slds-disabled')) {\n\t\treturn true;\n\t}\n\tif (node.getAttribute?.('aria-disabled') === 'true') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n// Determine if a tab React element is disabled\nfunction isTabDisabled(tab: React.ReactElement<TabChildProps>): boolean {\n\treturn Boolean(tab.props?.disabled);\n}\n\n/**\n * Tabs keeps related content in a single container that is shown and hidden through navigation.\n */\nconst Tabs = ({\n\tchildren,\n\tclassName,\n\tdefaultSelectedIndex = 0,\n\tid: propId,\n\tonSelect,\n\tselectedIndex: controlledSelectedIndex,\n\tvariant = 'default',\n}: TabsProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst [internalSelectedIndex, setInternalSelectedIndex] =\n\t\tuseState(defaultSelectedIndex);\n\tconst [focus, setFocus] = useState(false);\n\tconst tabsRef = useRef<\n\t\tArray<{ tab: React.ReactElement<TabChildProps>; node: HTMLElement | null }>\n\t>([]);\n\tconst tabsNodeRef = useRef<HTMLDivElement>(null);\n\n\tconst childArray = React.Children.toArray(\n\t\tchildren\n\t) as React.ReactElement<TabChildProps>[];\n\tconst tabsCount = childArray.length;\n\n\t// Use controlled or internal state\n\tconst selectedIndex = Number.isInteger(controlledSelectedIndex)\n\t\t? controlledSelectedIndex!\n\t\t: internalSelectedIndex;\n\n\tconst getNextTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab from index to the last tab\n\t\t\tfor (let i = index + 1; i < tabsCount; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from first tab\n\t\t\tfor (let i = 0; i < index; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst getPrevTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab backwards\n\t\t\tfor (let i = index - 1; i >= 0; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from last tab\n\t\t\tfor (let i = tabsCount - 1; i > index; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst setSelected = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\t\tindex: number,\n\t\t\tshouldFocus?: boolean\n\t\t) => {\n\t\t\tif (index < 0 || index >= tabsCount) return;\n\n\t\t\tonSelect?.(event, { selectedIndex: index, previousIndex: selectedIndex });\n\n\t\t\tif (index !== internalSelectedIndex) {\n\t\t\t\tsetInternalSelectedIndex(index);\n\t\t\t\tsetFocus(shouldFocus === true);\n\t\t\t}\n\t\t},\n\t\t[tabsCount, onSelect, selectedIndex, internalSelectedIndex]\n\t);\n\n\tconst isTabFromContainer = useCallback((node: HTMLElement): boolean => {\n\t\tif (!isTabNode(node)) return false;\n\n\t\tlet nodeAncestor: HTMLElement | null = node.parentElement;\n\t\twhile (nodeAncestor) {\n\t\t\tif (nodeAncestor === tabsNodeRef.current) return true;\n\t\t\tif (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t}\n\t\treturn false;\n\t}, []);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLDivElement>) => {\n\t\t\tlet node = e.target as HTMLElement;\n\t\t\tdo {\n\t\t\t\tif (isTabFromContainer(node)) {\n\t\t\t\t\tif (isTabNodeDisabled(node)) return;\n\n\t\t\t\t\tlet parentNode = node.parentNode as HTMLElement;\n\t\t\t\t\tif (parentNode?.nodeName === 'LI') {\n\t\t\t\t\t\tnode = parentNode;\n\t\t\t\t\t\tparentNode = node.parentNode as HTMLElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst index = Array.from(parentNode.children).indexOf(node);\n\t\t\t\t\tsetSelected(e, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnode = node.parentNode as HTMLElement;\n\t\t\t} while (node !== null);\n\t\t},\n\t\t[isTabFromContainer, setSelected]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLDivElement>) => {\n\t\t\tif (isTabFromContainer(event.target as HTMLElement)) {\n\t\t\t\tlet index = selectedIndex;\n\t\t\t\tlet preventDefault = false;\n\n\t\t\t\tif (event.keyCode === KEYS.LEFT || event.keyCode === KEYS.UP) {\n\t\t\t\t\tindex = getPrevTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.RIGHT ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN\n\t\t\t\t) {\n\t\t\t\t\tindex = getNextTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t}\n\n\t\t\t\tsetSelected(event, index, true);\n\t\t\t}\n\t\t},\n\t\t[isTabFromContainer, selectedIndex, getPrevTab, getNextTab, setSelected]\n\t);\n\n\tconst renderTabsList = () => (\n\t\t<TabsList id={id} variant={variant}>\n\t\t\t{childArray.map((child, index) => {\n\t\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\t\tconst isSelected = selectedIndex === index;\n\t\t\t\tconst shouldFocus = isSelected && focus;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\t\tref={(node: HTMLElement | null) => {\n\t\t\t\t\t\t\ttabsRef.current[index] = { tab: child, node };\n\t\t\t\t\t\t\tif (focus) {\n\t\t\t\t\t\t\t\tsetFocus(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfocus={shouldFocus}\n\t\t\t\t\t\tselected={isSelected}\n\t\t\t\t\t\tid={tabId}\n\t\t\t\t\t\tpanelId={panelId}\n\t\t\t\t\t\tdisabled={child.props.disabled}\n\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\thasError={child.props.hasError}\n\t\t\t\t\t\tassistiveText={child.props.assistiveText}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child.props.label}\n\t\t\t\t\t</Tab>\n\t\t\t\t);\n\t\t\t})}\n\t\t</TabsList>\n\t);\n\n\tconst renderTabPanels = () =>\n\t\tchildArray.map((child, index) => {\n\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\tconst isSelected = selectedIndex === index;\n\n\t\t\treturn (\n\t\t\t\t<TabPanel\n\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\tselected={isSelected}\n\t\t\t\t\tid={panelId}\n\t\t\t\t\ttabId={tabId}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t>\n\t\t\t\t\t{child}\n\t\t\t\t</TabPanel>\n\t\t\t);\n\t\t});\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-tabs_default': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs': variant === 'vertical',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tdata-tabs\n\t\t\tref={tabsNodeRef}\n\t\t>\n\t\t\t{renderTabsList()}\n\t\t\t{renderTabPanels()}\n\t\t</div>\n\t);\n};\n\nTabs.displayName = TABS;\n\nexport default Tabs;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/tabs/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\n\n// Child components\nimport TabsList from './private/tabs-list';\nimport Tab from './private/tab';\nimport TabPanel from './private/tab-panel';\n\nimport { TABS } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Tabs variant types\n */\nexport type TabsVariant = 'default' | 'scoped' | 'vertical';\n\n/**\n * Tab child props (TabsPanel)\n */\nexport interface TabChildProps {\n\tlabel: ReactNode;\n\tvalue?: string;\n\tdisabled?: boolean;\n\thasError?: boolean;\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n\tchildren?: ReactNode;\n\tkey?: string | number;\n}\n\n/**\n * Data passed to the Tabs `onSelect` callback\n */\nexport interface TabsSelectData {\n\t/**\n\t * `value` of the tab being selected: the panel's `value`, or its index as a\n\t * string (`'0'`, `'1'`, ...) when the panel has no `value`.\n\t */\n\tvalue: string;\n\t/**\n\t * `value` of the tab that was selected before this selection, or `undefined`\n\t * when no tab was selected.\n\t */\n\tpreviousValue: string | undefined;\n\t/** Index of the tab being selected */\n\tselectedIndex: number;\n\t/** Index of the tab that was selected before this selection, or `-1` when no tab was selected */\n\tpreviousIndex: number;\n}\n\n/**\n * Props shared by both ways of controlling the selected tab\n */\ninterface TabsBaseProps {\n\t/** TabsPanel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Called when a tab is requested by click or arrow key. Receives the triggering event and\n\t * `{ value, previousValue, selectedIndex, previousIndex }`. Tabs is controlled: update `value`\n\t * from this callback to change tabs. It is not called for a disabled tab or for the tab that is\n\t * already selected.\n\t */\n\tonSelect: (\n\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\tdata: TabsSelectData\n\t) => void;\n\t/** Tab style variant */\n\tvariant?: TabsVariant;\n}\n\n/**\n * Select the tab by the `value` of its `TabsPanel`.\n */\ninterface TabsValueProps {\n\t/**\n\t * `value` of the selected `TabsPanel` (required, controlled). A panel without a `value` is\n\t * matched by its index as a string (`'0'`, `'1'`, ...). When no panel matches, no tab is selected.\n\t */\n\tvalue: string;\n\tselectedIndex?: never;\n}\n\n/**\n * Select the tab by index (deprecated).\n */\ninterface TabsSelectedIndexProps {\n\tvalue?: undefined;\n\t/**\n\t * @deprecated Use `value` instead (set `value` on each `TabsPanel`, or use the index as a\n\t * string). Index of the selected tab, controlled. Used only when `value` is not passed.\n\t */\n\tselectedIndex: number;\n}\n\n/**\n * Props for the Tabs component\n */\nexport type TabsProps = TabsBaseProps &\n\t(TabsValueProps | TabsSelectedIndexProps);\n\n// The value a panel is matched by: its `value`, or its index as a string.\nconst getPanelValue = (\n\tchild: React.ReactElement<TabChildProps>,\n\tindex: number\n): string => child.props.value ?? String(index);\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node: HTMLElement): boolean {\n\treturn (\n\t\t(node.nodeName === 'A' && node.getAttribute('role') === 'tab') ||\n\t\t(node.nodeName === 'LI' &&\n\t\t\t(node.classList.contains('slds-tabs_default__item') ||\n\t\t\t\tnode.classList.contains('slds-tabs_scoped__item') ||\n\t\t\t\tnode.classList.contains('slds-vertical-tabs__nav-item')))\n\t);\n}\n\n// Determine if a tab node is disabled (from DOM)\nfunction isTabNodeDisabled(node: HTMLElement): boolean {\n\tif (node.classList?.contains('slds-disabled')) {\n\t\treturn true;\n\t}\n\tif (node.getAttribute?.('aria-disabled') === 'true') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n// Determine if a tab React element is disabled\nfunction isTabDisabled(tab: React.ReactElement<TabChildProps>): boolean {\n\treturn Boolean(tab.props?.disabled);\n}\n\n/**\n * Tabs keeps related content in a single container that is shown and hidden through navigation.\n */\nconst Tabs = (props: TabsProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tid: propId,\n\t\tonSelect,\n\t\tselectedIndex: selectedIndexProp,\n\t\tvalue,\n\t\tvariant = 'default',\n\t} = props;\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tTABS,\n\t\t\t{\n\t\t\t\tdefaultSelectedIndex: (props as { defaultSelectedIndex?: number })\n\t\t\t\t\t.defaultSelectedIndex,\n\t\t\t\tselectedIndex: selectedIndexProp,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t});\n\n\tconst [focus, setFocus] = useState(false);\n\tconst tabsRef = useRef<\n\t\tArray<{ tab: React.ReactElement<TabChildProps>; node: HTMLElement | null }>\n\t>([]);\n\tconst tabsNodeRef = useRef<HTMLDivElement>(null);\n\n\tconst childArray = React.Children.toArray(\n\t\tchildren\n\t) as React.ReactElement<TabChildProps>[];\n\tconst tabsCount = childArray.length;\n\n\t// Selection is controlled: derived from `value`, or from the deprecated\n\t// `selectedIndex` when `value` is not passed. There is no internal copy.\n\tconst selectedIndex =\n\t\tvalue !== undefined\n\t\t\t? childArray.findIndex(\n\t\t\t\t\t(child, index) => getPanelValue(child, index) === value\n\t\t\t\t)\n\t\t\t: Number.isInteger(selectedIndexProp)\n\t\t\t\t? (selectedIndexProp as number)\n\t\t\t\t: -1;\n\n\tconst getNextTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab from index to the last tab\n\t\t\tfor (let i = index + 1; i < tabsCount; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from first tab\n\t\t\tfor (let i = 0; i < index; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst getPrevTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab backwards\n\t\t\tfor (let i = index - 1; i >= 0; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from last tab\n\t\t\tfor (let i = tabsCount - 1; i > index; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst setSelected = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\t\tindex: number,\n\t\t\tshouldFocus?: boolean\n\t\t) => {\n\t\t\tif (index < 0 || index >= tabsCount || index === selectedIndex) return;\n\n\t\t\tconst previous =\n\t\t\t\tselectedIndex >= 0 ? childArray[selectedIndex] : undefined;\n\t\t\tonSelect?.(event, {\n\t\t\t\tvalue: getPanelValue(childArray[index], index),\n\t\t\t\tpreviousValue: previous\n\t\t\t\t\t? getPanelValue(previous, selectedIndex)\n\t\t\t\t\t: undefined,\n\t\t\t\tselectedIndex: index,\n\t\t\t\tpreviousIndex: selectedIndex,\n\t\t\t});\n\t\t\t// Focus follows the selection once the parent updates `value`.\n\t\t\tsetFocus(shouldFocus === true);\n\t\t},\n\t\t[tabsCount, onSelect, selectedIndex, childArray]\n\t);\n\n\tconst isTabFromContainer = useCallback((node: HTMLElement): boolean => {\n\t\tif (!isTabNode(node)) return false;\n\n\t\tlet nodeAncestor: HTMLElement | null = node.parentElement;\n\t\twhile (nodeAncestor) {\n\t\t\tif (nodeAncestor === tabsNodeRef.current) return true;\n\t\t\tif (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t}\n\t\treturn false;\n\t}, []);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLDivElement>) => {\n\t\t\tlet node = e.target as HTMLElement;\n\t\t\tdo {\n\t\t\t\tif (isTabFromContainer(node)) {\n\t\t\t\t\tif (isTabNodeDisabled(node)) return;\n\n\t\t\t\t\tlet parentNode = node.parentNode as HTMLElement;\n\t\t\t\t\tif (parentNode?.nodeName === 'LI') {\n\t\t\t\t\t\tnode = parentNode;\n\t\t\t\t\t\tparentNode = node.parentNode as HTMLElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst index = Array.from(parentNode.children).indexOf(node);\n\t\t\t\t\tsetSelected(e, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnode = node.parentNode as HTMLElement;\n\t\t\t} while (node !== null);\n\t\t},\n\t\t[isTabFromContainer, setSelected]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLDivElement>) => {\n\t\t\tif (isTabFromContainer(event.target as HTMLElement)) {\n\t\t\t\tlet index = selectedIndex;\n\t\t\t\tlet preventDefault = false;\n\n\t\t\t\tif (event.keyCode === KEYS.LEFT || event.keyCode === KEYS.UP) {\n\t\t\t\t\tindex = getPrevTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.RIGHT ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN\n\t\t\t\t) {\n\t\t\t\t\tindex = getNextTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t}\n\n\t\t\t\tsetSelected(event, index, true);\n\t\t\t}\n\t\t},\n\t\t[isTabFromContainer, selectedIndex, getPrevTab, getNextTab, setSelected]\n\t);\n\n\tconst renderTabsList = () => (\n\t\t<TabsList id={id} variant={variant}>\n\t\t\t{childArray.map((child, index) => {\n\t\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\t\tconst isSelected = selectedIndex === index;\n\t\t\t\tconst shouldFocus = isSelected && focus;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\t\tref={(node: HTMLElement | null) => {\n\t\t\t\t\t\t\ttabsRef.current[index] = { tab: child, node };\n\t\t\t\t\t\t\tif (focus) {\n\t\t\t\t\t\t\t\tsetFocus(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfocus={shouldFocus}\n\t\t\t\t\t\tselected={isSelected}\n\t\t\t\t\t\tid={tabId}\n\t\t\t\t\t\tpanelId={panelId}\n\t\t\t\t\t\tdisabled={child.props.disabled}\n\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\thasError={child.props.hasError}\n\t\t\t\t\t\tassistiveText={child.props.assistiveText}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child.props.label}\n\t\t\t\t\t</Tab>\n\t\t\t\t);\n\t\t\t})}\n\t\t</TabsList>\n\t);\n\n\tconst renderTabPanels = () =>\n\t\tchildArray.map((child, index) => {\n\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\tconst isSelected = selectedIndex === index;\n\n\t\t\treturn (\n\t\t\t\t<TabPanel\n\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\tselected={isSelected}\n\t\t\t\t\tid={panelId}\n\t\t\t\t\ttabId={tabId}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t>\n\t\t\t\t\t{child}\n\t\t\t\t</TabPanel>\n\t\t\t);\n\t\t});\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-tabs_default': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs': variant === 'vertical',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tdata-tabs\n\t\t\tref={tabsNodeRef}\n\t\t>\n\t\t\t{renderTabsList()}\n\t\t\t{renderTabPanels()}\n\t\t</div>\n\t);\n};\n\nTabs.displayName = TABS;\n\nexport default Tabs;\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"panel.js","names":[],"sources":["../../../../components/tabs/panel.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode } from 'react';\n\nimport { TABS_PANEL } from '../../utilities/constants';\n\nexport interface TabsPanelProps {\n\t/**\n\t * The string or element that is handed off to the `<Tab />` component, ends up being the title and the label for the tab associated with its tab panel.\n\t */\n\tlabel: ReactNode;\n\t/**\n\t * The `children` are the actual tab panels to be rendered. They get created by [tabs/index.jsx](./index.jsx) in the `renderTabPanels` function.\n\t *\n\t * Note that the `<TabsPanel />` component inserts a `div` element around the children, because React requires exactly one \"parent\" element returned. The `<TabPanel />` component simply dips down into `children` to get the children of this wrapping `div` so that it does not get rendered in the DOM.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Disables the `<Tab />` associated with this panel so it cannot be selected.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Show an icon on the `<Tab />` next to the title that can be used to communicate when a tab contains a validation error that needs attention\n\t */\n\thasError?: boolean;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `withErrorIcon`: This text is for the error icon that will be placed next to the `<Tab />` title\n\t */\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n}\n\n/**\n * The `<TabsPanel />` component allows us to simplify the structure of the `<Tabs />` component.\n\n * Rather than require different (deeply nested) children for tabslist, with its tab(s) as well as tabpanel(s), we provide this `TabsPanel` component which takes a `label` property that will become what is shown on the `<Tab />` that will be associated with it.\n\n * The `children` of the Panel will be fed to the `<TabPanel />` component, while its `label` is handled in `<Tab />`, via `<TabsList />`.\n *\n * ```\n * <TabsPanel label=\"Tab 1\">\n * \t<div>\n * \t\t<h2 className=\"slds-text-heading_medium\">This is my tab 1 contents!</h2>\n * \t\t<p>They show when you click the first tab.</p>\n * \t</div>\n * </TabsPanel>\n * ```\n */\nconst Panel = ({ children }: TabsPanelProps) => (\n\t<div>{React.Children.toArray(children)}</div>\n);\n\nPanel.displayName = TABS_PANEL;\n\nexport default Panel;\n"],"mappings":";;;;AAoDA,IAAM,KAAS,EAAE,kBAChB,kBAAC,OAAD,EAAA,UAAM,EAAM,SAAS,QAAQ,CAAQ,EAAO,CAAA;AAG7C,EAAM,cAAc"}
1
+ {"version":3,"file":"panel.js","names":[],"sources":["../../../../components/tabs/panel.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode } from 'react';\n\nimport { TABS_PANEL } from '../../utilities/constants';\n\nexport interface TabsPanelProps {\n\t/**\n\t * The string or element that is handed off to the `<Tab />` component, ends up being the title and the label for the tab associated with its tab panel.\n\t */\n\tlabel: ReactNode;\n\t/**\n\t * Identifies this panel for the `value` prop of `<Tabs />` and the `value`/`previousValue` reported by its `onSelect`. When omitted, the panel is identified by its index as a string (`'0'`, `'1'`, ...). Rendered `id`s are always index-based.\n\t */\n\tvalue?: string;\n\t/**\n\t * The `children` are the actual tab panels to be rendered. They get created by [tabs/index.jsx](./index.jsx) in the `renderTabPanels` function.\n\t *\n\t * Note that the `<TabsPanel />` component inserts a `div` element around the children, because React requires exactly one \"parent\" element returned. The `<TabPanel />` component simply dips down into `children` to get the children of this wrapping `div` so that it does not get rendered in the DOM.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Disables the `<Tab />` associated with this panel so it cannot be selected.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Show an icon on the `<Tab />` next to the title that can be used to communicate when a tab contains a validation error that needs attention\n\t */\n\thasError?: boolean;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `withErrorIcon`: This text is for the error icon that will be placed next to the `<Tab />` title\n\t */\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n}\n\n/**\n * The `<TabsPanel />` component allows us to simplify the structure of the `<Tabs />` component.\n\n * Rather than require different (deeply nested) children for tabslist, with its tab(s) as well as tabpanel(s), we provide this `TabsPanel` component which takes a `label` property that will become what is shown on the `<Tab />` that will be associated with it.\n\n * The `children` of the Panel will be fed to the `<TabPanel />` component, while its `label` is handled in `<Tab />`, via `<TabsList />`.\n *\n * ```\n * <TabsPanel label=\"Tab 1\" value=\"tab-1\">\n * \t<div>\n * \t\t<h2 className=\"slds-text-heading_medium\">This is my tab 1 contents!</h2>\n * \t\t<p>They show when you click the first tab.</p>\n * \t</div>\n * </TabsPanel>\n * ```\n */\nconst Panel = ({ children }: TabsPanelProps) => (\n\t<div>{React.Children.toArray(children)}</div>\n);\n\nPanel.displayName = TABS_PANEL;\n\nexport default Panel;\n"],"mappings":";;;;AAwDA,IAAM,KAAS,EAAE,kBAChB,kBAAC,OAAD,EAAA,UAAM,EAAM,SAAS,QAAQ,CAAQ,EAAO,CAAA;AAG7C,EAAM,cAAc"}
@@ -9,7 +9,7 @@ process.env.NODE_ENV !== "production" && (i = function(i, a, o) {
9
9
  r(i, {
10
10
  "labels.label": a.labels?.label ?? a.label,
11
11
  "assistiveText.label": a.assistiveText?.label
12
- }, s()), typeof a.maxLength == "string" && e(i, a.maxLength, "maxLength", `\`maxLength\` as a string has been deprecated. Please pass a number instead. ${s("maxLength")}`), n(i, a.errorText, "errorText", "labels.error` and `hasError", s("labels")), n(i, a.label, "label", "labels.label", s("labels"));
12
+ }, s()), e(i, a.defaultValue !== void 0, "defaultValue", "Textarea is controlled: pass `value` and update it in `onChange`."), typeof a.maxLength == "string" && e(i, a.maxLength, "maxLength", `\`maxLength\` as a string has been deprecated. Please pass a number instead. ${s("maxLength")}`), n(i, a.errorText, "errorText", "labels.error` and `hasError", s("labels")), n(i, a.label, "label", "labels.label", s("labels"));
13
13
  });
14
14
  var a = i;
15
15
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/textarea/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/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'labels.label': props.labels?.label ?? props.label,\n\t\t\t\t'assistiveText.label': props.assistiveText?.label,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tif (typeof props.maxLength === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.maxLength,\n\t\t\t\t'maxLength',\n\t\t\t\t`\\`maxLength\\` as a string has been deprecated. Please pass a number instead. ${createDocUrl(\n\t\t\t\t\t'maxLength'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.errorText,\n\t\t\t'errorText',\n\t\t\t'labels.error` and `hasError',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.label,\n\t\t\t'label',\n\t\t\t'labels.label',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CA6B9C,AA3BA,EACC,GACA;EACC,gBAAgB,EAAM,QAAQ,SAAS,EAAM;EAC7C,uBAAuB,EAAM,eAAe;CAC7C,GACA,EAAa,CACd,GAEI,OAAO,EAAM,aAAc,YAC9B,EACC,GACA,EAAM,WACN,aACA,gFAAgF,EAC/E,WACD,GACD,GAGD,EACC,GACA,EAAM,WACN,aACA,+BACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAM,OACN,SACA,gBACA,EAAa,QAAQ,CACtB;AACD;AAGD,IAAA,IAAe"}
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/textarea/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/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'labels.label': props.labels?.label ?? props.label,\n\t\t\t\t'assistiveText.label': props.assistiveText?.label,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.defaultValue !== undefined,\n\t\t\t'defaultValue',\n\t\t\t'Textarea is controlled: pass `value` and update it in `onChange`.'\n\t\t);\n\n\t\tif (typeof props.maxLength === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.maxLength,\n\t\t\t\t'maxLength',\n\t\t\t\t`\\`maxLength\\` as a string has been deprecated. Please pass a number instead. ${createDocUrl(\n\t\t\t\t\t'maxLength'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.errorText,\n\t\t\t'errorText',\n\t\t\t'labels.error` and `hasError',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.label,\n\t\t\t'label',\n\t\t\t'labels.label',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAoC9C,AAlCA,EACC,GACA;EACC,gBAAgB,EAAM,QAAQ,SAAS,EAAM;EAC7C,uBAAuB,EAAM,eAAe;CAC7C,GACA,EAAa,CACd,GAEA,EACC,GACA,EAAM,iBAAiB,KAAA,GACvB,gBACA,mEACD,GAEI,OAAO,EAAM,aAAc,YAC9B,EACC,GACA,EAAM,WACN,aACA,gFAAgF,EAC/E,WACD,GACD,GAGD,EACC,GACA,EAAM,WACN,aACA,+BACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAM,OACN,SACA,gBACA,EAAa,QAAQ,CACtB;AACD;AAGD,IAAA,IAAe"}
@@ -44,7 +44,9 @@ var u = i((i, u) => {
44
44
  maxLength: typeof S == "string" ? parseInt(S, 10) : S,
45
45
  name: C,
46
46
  onBlur: w,
47
- onChange: T,
47
+ onChange: (e) => {
48
+ T?.(e, { value: e.target.value });
49
+ },
48
50
  onClick: E,
49
51
  onFocus: D,
50
52
  onInput: O,
@@ -60,7 +62,6 @@ var u = i((i, u) => {
60
62
  required: I,
61
63
  wrap: B,
62
64
  value: R,
63
- defaultValue: z,
64
65
  "aria-describedby": Z ? G() : K["aria-describedby"],
65
66
  ...K
66
67
  })
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/textarea/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport {\n\tuseId,\n\tuseEffect,\n\tforwardRef,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n} from 'react';\nimport classNames from 'classnames';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { TEXTAREA } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Assistive text for Textarea\n */\nexport interface TextareaAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n}\n\n/**\n * Labels for Textarea\n */\nexport interface TextareaLabels {\n\t/** Error message shown below the textarea while `hasError` is true */\n\terror?: ReactNode;\n\t/** Visible label above the textarea */\n\tlabel?: ReactNode;\n}\n\n/**\n * Props for the Textarea component\n */\nexport interface TextareaProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `label`: Visually hidden label. Use instead of `labels.label`.\n\t */\n\tassistiveText?: TextareaAssistiveText;\n\t/** aria-activedescendant for composite widgets */\n\t'aria-activedescendant'?: string;\n\t/** aria-autocomplete for suggestions */\n\t'aria-autocomplete'?: string;\n\t/** aria-controls to relate with another region */\n\t'aria-controls'?: string;\n\t/** aria-describedby for descriptions */\n\t'aria-describedby'?: string;\n\t/** aria-expanded for collapsible content */\n\t'aria-expanded'?: boolean;\n\t/** aria-haspopup for popup menus */\n\t'aria-haspopup'?: boolean;\n\t/** aria-labelledby for labels */\n\t'aria-labelledby'?: string;\n\t/** aria-owns for related elements */\n\t'aria-owns'?: string;\n\t/** aria-required for form validation */\n\t'aria-required'?: boolean;\n\t/** Autofocus on load (poor UX) */\n\tautoFocus?: boolean;\n\t/** Elements added after textarea */\n\tchildren?: ReactNode;\n\t/** CSS class for textarea element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS class for container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** Disable the textarea */\n\tdisabled?: boolean;\n\t/** @deprecated Use `labels.error` and `hasError` instead. */\n\terrorText?: string;\n\t/** Puts the textarea in an error state and shows `labels.error` */\n\thasError?: boolean;\n\t/** Unique ID */\n\tid?: string;\n\t/** @deprecated Use `labels.label` instead. */\n\tlabel?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `error`: Error message shown below the textarea while `hasError` is true\n\t * * `label`: Visible label. Use `assistiveText.label` for a visually hidden label.\n\t */\n\tlabels?: TextareaLabels;\n\t/** Maximum character count */\n\tmaxLength?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/** Change event handler */\n\tonChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLTextAreaElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Mark as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Controlled value */\n\tvalue?: string;\n\t/** Initial uncontrolled value */\n\tdefaultValue?: string;\n\t/** Text wrapping mode */\n\twrap?: 'soft' | 'hard';\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\n/**\n * A multi-line plain-text editing control.\n */\nconst Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tassistiveText,\n\t\t\tautoFocus,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tclassNameContainer,\n\t\t\tdisabled,\n\t\t\terrorText,\n\t\t\thasError: hasErrorProp,\n\t\t\tid: propId,\n\t\t\tlabel: labelProp,\n\t\t\tlabels,\n\t\t\tmaxLength,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\trole,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\twrap,\n\t\t\t...restProps\n\t\t} = props;\n\n\t\tcheckProps(TEXTAREA, { ...props }, componentDoc);\n\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\n\t\tconst getId = () => propId || generatedId;\n\t\tconst getErrorId = () => restProps['aria-describedby'] || generatedErrorId;\n\n\t\tconst ariaProps = getAriaProps(restProps);\n\n\t\tconst assistiveTextLabel = assistiveText?.label;\n\n\t\t// `label` is deprecated\n\t\tconst label = labels?.label ?? labelProp;\n\t\tconst labelText = label || assistiveTextLabel;\n\n\t\t// `errorText` is deprecated: it sets both the error state and the message\n\t\tconst hasError = hasErrorProp ?? !!errorText;\n\t\tconst errorMessage = hasError ? (labels?.error ?? errorText) : undefined;\n\n\t\tuseEffect(() => {\n\t\t\tcheckProps(\n\t\t\t\tTEXTAREA,\n\t\t\t\t{ assistiveText, errorText, label: labelProp, labels },\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}, [assistiveText, errorText, labelProp, labels]);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t},\n\t\t\t\t\tclassNameContainer as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{labelText && (\n\t\t\t\t\t<label\n\t\t\t\t\t\tclassName={classNames('slds-form-element__label', {\n\t\t\t\t\t\t\t'slds-assistive-text': assistiveTextLabel && !label,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{required && (\n\t\t\t\t\t\t\t<abbr className=\"slds-required\" title=\"required\">\n\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{labelText}\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclassName={classNames('slds-textarea', className as string)}\n\t\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tmaxLength={\n\t\t\t\t\t\t\t// Strings are still accepted at runtime for untyped callers; check-props warns.\n\t\t\t\t\t\t\ttypeof maxLength === 'string'\n\t\t\t\t\t\t\t\t? parseInt(maxLength, 10)\n\t\t\t\t\t\t\t\t: maxLength\n\t\t\t\t\t\t}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\t\tonInput={onInput}\n\t\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\trole={role}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\twrap={wrap}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\terrorMessage\n\t\t\t\t\t\t\t\t? getErrorId()\n\t\t\t\t\t\t\t\t: ((ariaProps as Record<string, unknown>)[\n\t\t\t\t\t\t\t\t\t\t'aria-describedby'\n\t\t\t\t\t\t\t\t\t] as string | undefined)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{errorMessage && (\n\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nTextarea.displayName = TEXTAREA;\n\nexport default Textarea;\n"],"mappings":";;;;;;;;AAuIA,IAAM,IAAW,GACf,GAAO,MAAQ;CACf,IAAM,EACL,kBACA,cACA,aACA,cACA,uBACA,aACA,cACA,UAAU,GACV,IAAI,GACJ,OAAO,GACP,WACA,cACA,SACA,WACA,aACA,YACA,YACA,YACA,cACA,cACA,eACA,YACA,aACA,aACA,gBACA,aACA,SACA,UACA,iBACA,SACA,GAAG,MACA;CAEJ,EAAW,GAAU,EAAE,GAAG,EAAM,GAAG,CAAY;CAE/C,IAAM,IAAc,EAAM,GACpB,IAAmB,EAAM,GAEzB,UAAc,KAAU,GACxB,UAAmB,EAAU,uBAAuB,GAEpD,IAAY,EAAa,CAAS,GAElC,IAAqB,GAAe,OAGpC,IAAQ,GAAQ,SAAS,GACzB,IAAY,KAAS,GAGrB,IAAW,KAAgB,CAAC,CAAC,GAC7B,IAAe,IAAY,GAAQ,SAAS,IAAa,KAAA;CAU/D,OARA,QAAgB;EACf,EACC,GACA;GAAE;GAAe;GAAW,OAAO;GAAW;EAAO,GACrD,CACD;CACD,GAAG;EAAC;EAAe;EAAW;EAAW;CAAM,CAAC,GAG/C,kBAAC,OAAD;EACC,WAAW,EACV,qBACA,EACC,kBAAkB,EACnB,GACA,CACD;EAPD,UAAA;GASE,KACA,kBAAC,SAAD;IACC,WAAW,EAAW,4BAA4B,EACjD,uBAAuB,KAAsB,CAAC,EAC/C,CAAC;IACD,SAAS,EAAM;IAJhB,UAAA,CAME,KACA,kBAAC,QAAD;KAAM,WAAU;KAAgB,OAAM;KAAW,UAAA;IAE3C,CAAA,GAEN,CACK;;GAER,kBAAC,OAAD;IAAK,WAAU;IACd,UAAA,kBAAC,YAAD;KACC,WAAW,EAAW,iBAAiB,CAAmB;KAC/C;KACD;KACV,IAAI,EAAM;KACV,WAEC,OAAO,KAAc,WAClB,SAAS,GAAW,EAAE,IACtB;KAEE;KACE;KACE;KACD;KACA;KACA;KACE;KACA;KACC;KACH;KACC;KACA;KACG;KACR;KACC;KACI;KACJ;KACC;KACO;KACd,oBACC,IACG,EAAW,IACT,EACF;KAGJ,GAAI;IACJ,CAAA;GACG,CAAA;GACJ,KACA,kBAAC,OAAD;IAAK,IAAI,EAAW;IAAG,WAAU;IAC/B,UAAA;GACG,CAAA;GAEL;EACG;;AAEP,CACD;AAEA,EAAS,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/textarea/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport {\n\tuseId,\n\tuseEffect,\n\tforwardRef,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n} from 'react';\nimport classNames from 'classnames';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { TEXTAREA } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Assistive text for Textarea\n */\nexport interface TextareaAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n}\n\n/**\n * Labels for Textarea\n */\nexport interface TextareaLabels {\n\t/** Error message shown below the textarea while `hasError` is true */\n\terror?: ReactNode;\n\t/** Visible label above the textarea */\n\tlabel?: ReactNode;\n}\n\n/**\n * Data passed to `onChange`\n */\nexport interface TextareaChangeData {\n\t/** The new text */\n\tvalue: string;\n}\n\n/**\n * Props removed in v11. They are ignored at runtime and warn in development.\n */\ninterface TextareaRemovedProps {\n\t/** @removed Textarea is controlled: pass `value` and update it in `onChange`. */\n\tdefaultValue?: unknown;\n}\n\n/**\n * Props for the Textarea component\n */\nexport interface TextareaProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `label`: Visually hidden label. Use instead of `labels.label`.\n\t */\n\tassistiveText?: TextareaAssistiveText;\n\t/** aria-activedescendant for composite widgets */\n\t'aria-activedescendant'?: string;\n\t/** aria-autocomplete for suggestions */\n\t'aria-autocomplete'?: string;\n\t/** aria-controls to relate with another region */\n\t'aria-controls'?: string;\n\t/** aria-describedby for descriptions */\n\t'aria-describedby'?: string;\n\t/** aria-expanded for collapsible content */\n\t'aria-expanded'?: boolean;\n\t/** aria-haspopup for popup menus */\n\t'aria-haspopup'?: boolean;\n\t/** aria-labelledby for labels */\n\t'aria-labelledby'?: string;\n\t/** aria-owns for related elements */\n\t'aria-owns'?: string;\n\t/** aria-required for form validation */\n\t'aria-required'?: boolean;\n\t/** Autofocus on load (poor UX) */\n\tautoFocus?: boolean;\n\t/** Elements added after textarea */\n\tchildren?: ReactNode;\n\t/** CSS class for textarea element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS class for container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** Disable the textarea */\n\tdisabled?: boolean;\n\t/** @deprecated Use `labels.error` and `hasError` instead. */\n\terrorText?: string;\n\t/** Puts the textarea in an error state and shows `labels.error` */\n\thasError?: boolean;\n\t/** Unique ID */\n\tid?: string;\n\t/** @deprecated Use `labels.label` instead. */\n\tlabel?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `error`: Error message shown below the textarea while `hasError` is true\n\t * * `label`: Visible label. Use `assistiveText.label` for a visually hidden label.\n\t */\n\tlabels?: TextareaLabels;\n\t/** Maximum character count */\n\tmaxLength?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/**\n\t * Called when the text changes. Textarea is controlled: update `value` from\n\t * `data.value`, or the text won't change.\n\t */\n\tonChange: (\n\t\tevent: ChangeEvent<HTMLTextAreaElement>,\n\t\tdata: TextareaChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLTextAreaElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Mark as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** The text in the textarea. Required: Textarea is controlled. */\n\tvalue: string;\n\t/** Text wrapping mode */\n\twrap?: 'soft' | 'hard';\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\n/**\n * A multi-line plain-text editing control.\n */\nconst Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tassistiveText,\n\t\t\tautoFocus,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tclassNameContainer,\n\t\t\tdisabled,\n\t\t\terrorText,\n\t\t\thasError: hasErrorProp,\n\t\t\tid: propId,\n\t\t\tlabel: labelProp,\n\t\t\tlabels,\n\t\t\tmaxLength,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\trole,\n\t\t\tvalue,\n\t\t\t// Removed in v11: destructured so it doesn't reach the DOM. check-props warns.\n\t\t\tdefaultValue: _defaultValue,\n\t\t\twrap,\n\t\t\t...restProps\n\t\t} = props as TextareaProps & TextareaRemovedProps;\n\n\t\tcheckProps(TEXTAREA, { ...props }, componentDoc);\n\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\n\t\tconst getId = () => propId || generatedId;\n\t\tconst getErrorId = () => restProps['aria-describedby'] || generatedErrorId;\n\n\t\tconst ariaProps = getAriaProps(restProps);\n\n\t\tconst assistiveTextLabel = assistiveText?.label;\n\n\t\t// `label` is deprecated\n\t\tconst label = labels?.label ?? labelProp;\n\t\tconst labelText = label || assistiveTextLabel;\n\n\t\t// `errorText` is deprecated: it sets both the error state and the message\n\t\tconst hasError = hasErrorProp ?? !!errorText;\n\t\tconst errorMessage = hasError ? (labels?.error ?? errorText) : undefined;\n\n\t\tuseEffect(() => {\n\t\t\tcheckProps(\n\t\t\t\tTEXTAREA,\n\t\t\t\t{ assistiveText, errorText, label: labelProp, labels },\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}, [assistiveText, errorText, labelProp, labels]);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t},\n\t\t\t\t\tclassNameContainer as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{labelText && (\n\t\t\t\t\t<label\n\t\t\t\t\t\tclassName={classNames('slds-form-element__label', {\n\t\t\t\t\t\t\t'slds-assistive-text': assistiveTextLabel && !label,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{required && (\n\t\t\t\t\t\t\t<abbr className=\"slds-required\" title=\"required\">\n\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{labelText}\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclassName={classNames('slds-textarea', className as string)}\n\t\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tmaxLength={\n\t\t\t\t\t\t\t// Strings are still accepted at runtime for untyped callers; check-props warns.\n\t\t\t\t\t\t\ttypeof maxLength === 'string'\n\t\t\t\t\t\t\t\t? parseInt(maxLength, 10)\n\t\t\t\t\t\t\t\t: maxLength\n\t\t\t\t\t\t}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\tonChange?.(event, { value: event.target.value });\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\t\tonInput={onInput}\n\t\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\trole={role}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\twrap={wrap}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\terrorMessage\n\t\t\t\t\t\t\t\t? getErrorId()\n\t\t\t\t\t\t\t\t: ((ariaProps as Record<string, unknown>)[\n\t\t\t\t\t\t\t\t\t\t'aria-describedby'\n\t\t\t\t\t\t\t\t\t] as string | undefined)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{errorMessage && (\n\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nTextarea.displayName = TEXTAREA;\n\nexport default Textarea;\n"],"mappings":";;;;;;;;AA2JA,IAAM,IAAW,GACf,GAAO,MAAQ;CACf,IAAM,EACL,kBACA,cACA,aACA,cACA,uBACA,aACA,cACA,UAAU,GACV,IAAI,GACJ,OAAO,GACP,WACA,cACA,SACA,WACA,aACA,YACA,YACA,YACA,cACA,cACA,eACA,YACA,aACA,aACA,gBACA,aACA,SACA,UAEA,cAAc,GACd,SACA,GAAG,MACA;CAEJ,EAAW,GAAU,EAAE,GAAG,EAAM,GAAG,CAAY;CAE/C,IAAM,IAAc,EAAM,GACpB,IAAmB,EAAM,GAEzB,UAAc,KAAU,GACxB,UAAmB,EAAU,uBAAuB,GAEpD,IAAY,EAAa,CAAS,GAElC,IAAqB,GAAe,OAGpC,IAAQ,GAAQ,SAAS,GACzB,IAAY,KAAS,GAGrB,IAAW,KAAgB,CAAC,CAAC,GAC7B,IAAe,IAAY,GAAQ,SAAS,IAAa,KAAA;CAU/D,OARA,QAAgB;EACf,EACC,GACA;GAAE;GAAe;GAAW,OAAO;GAAW;EAAO,GACrD,CACD;CACD,GAAG;EAAC;EAAe;EAAW;EAAW;CAAM,CAAC,GAG/C,kBAAC,OAAD;EACC,WAAW,EACV,qBACA,EACC,kBAAkB,EACnB,GACA,CACD;EAPD,UAAA;GASE,KACA,kBAAC,SAAD;IACC,WAAW,EAAW,4BAA4B,EACjD,uBAAuB,KAAsB,CAAC,EAC/C,CAAC;IACD,SAAS,EAAM;IAJhB,UAAA,CAME,KACA,kBAAC,QAAD;KAAM,WAAU;KAAgB,OAAM;KAAW,UAAA;IAE3C,CAAA,GAEN,CACK;;GAER,kBAAC,OAAD;IAAK,WAAU;IACd,UAAA,kBAAC,YAAD;KACC,WAAW,EAAW,iBAAiB,CAAmB;KAC/C;KACD;KACV,IAAI,EAAM;KACV,WAEC,OAAO,KAAc,WAClB,SAAS,GAAW,EAAE,IACtB;KAEE;KACE;KACR,WAAW,MAAU;MACpB,IAAW,GAAO,EAAE,OAAO,EAAM,OAAO,MAAM,CAAC;KAChD;KACS;KACA;KACA;KACE;KACA;KACC;KACH;KACC;KACA;KACG;KACR;KACC;KACI;KACJ;KACC;KACP,oBACC,IACG,EAAW,IACT,EACF;KAGJ,GAAI;IACJ,CAAA;GACG,CAAA;GACJ,KACA,kBAAC,OAAD;IAAK,IAAI,EAAW;IAAG,WAAU;IAC/B,UAAA;GACG,CAAA;GAEL;EACG;;AAEP,CACD;AAEA,EAAS,cAAc"}
@@ -7,7 +7,7 @@ var i = class extends n.Component {
7
7
  static displayName = e;
8
8
  render() {
9
9
  return /* @__PURE__ */ r("div", {
10
- className: t("slds-notify-container", this.props.className),
10
+ className: t("slds-notify_container", this.props.className),
11
11
  children: this.props.children
12
12
  });
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"container.js","names":[],"sources":["../../../../components/toast/container.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// # Toast Container Component\n\nimport React, { type ReactNode } from 'react';\nimport classNames from '../../utilities/class-names';\nimport { TOAST_CONTAINER } from '../../utilities/constants';\n\nexport interface ToastContainerProps {\n\t/**\n\t * CSS classes to be added to tag with `.slds-notify-container`. Uses `classNames` [API](https://github.com/JedWatson/classnames).\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Toast components\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * A fixed container for toast banners.\n */\n\nclass ToastContainer extends React.Component<ToastContainerProps> {\n\tstatic displayName = TOAST_CONTAINER;\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-notify-container',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default ToastContainer;\n"],"mappings":";;;;;AAwBA,IAAM,IAAN,cAA6B,EAAM,UAA+B;CACjE,OAAO,cAAc;CAErB,SAAS;EACR,OACC,kBAAC,OAAD;GACC,WAAW,EACV,yBACA,KAAK,MAAM,SACZ;GAEC,UAAA,KAAK,MAAM;EACR,CAAA;CAEP;AACD"}
1
+ {"version":3,"file":"container.js","names":[],"sources":["../../../../components/toast/container.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// # Toast Container Component\n\nimport React, { type ReactNode } from 'react';\nimport classNames from '../../utilities/class-names';\nimport { TOAST_CONTAINER } from '../../utilities/constants';\n\nexport interface ToastContainerProps {\n\t/**\n\t * CSS classes to be added to tag with `.slds-notify_container`. Uses `classNames` [API](https://github.com/JedWatson/classnames).\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Toast components\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * A fixed container for toast banners.\n */\n\nclass ToastContainer extends React.Component<ToastContainerProps> {\n\tstatic displayName = TOAST_CONTAINER;\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-notify_container',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default ToastContainer;\n"],"mappings":";;;;;AAwBA,IAAM,IAAN,cAA6B,EAAM,UAA+B;CACjE,OAAO,cAAc;CAErB,SAAS;EACR,OACC,kBAAC,OAAD;GACC,WAAW,EACV,yBACA,KAAK,MAAM,SACZ;GAEC,UAAA,KAAK,MAAM;EACR,CAAA;CAEP;AACD"}