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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/README.md +27 -1
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/accordion/panel.cjs.map +1 -1
  5. package/dist/cjs/components/alert/index.cjs +1 -1
  6. package/dist/cjs/components/alert/index.cjs.map +1 -1
  7. package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
  8. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  9. package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
  10. package/dist/cjs/components/button/check-props.cjs +1 -1
  11. package/dist/cjs/components/button/check-props.cjs.map +1 -1
  12. package/dist/cjs/components/button/index.cjs +1 -1
  13. package/dist/cjs/components/button/index.cjs.map +1 -1
  14. package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
  15. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
  16. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  17. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  18. package/dist/cjs/components/carousel/index.cjs +1 -1
  19. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  20. package/dist/cjs/components/carousel/private/carousel-indicators.cjs.map +1 -1
  21. package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
  22. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  24. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  25. package/dist/cjs/components/checkbox/index.cjs +1 -1
  26. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  27. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  28. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  29. package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
  30. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  31. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  32. package/dist/cjs/components/color-picker/private/swatch-option.cjs +1 -1
  33. package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
  34. package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
  35. package/dist/cjs/components/color-picker/private/swatch.cjs.map +1 -1
  36. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  37. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  38. package/dist/cjs/components/combobox/index.cjs +1 -1
  39. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  40. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  41. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  42. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  43. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  44. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  45. package/dist/cjs/components/date-picker/private/calendar.cjs.map +1 -1
  46. package/dist/cjs/components/date-picker/private/day.cjs +1 -1
  47. package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
  48. package/dist/cjs/components/files/file.cjs +1 -8
  49. package/dist/cjs/components/files/file.cjs.map +1 -1
  50. package/dist/cjs/components/files/private/file-actions.cjs +1 -1
  51. package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
  52. package/dist/cjs/components/files/private/file-figure.cjs +1 -1
  53. package/dist/cjs/components/files/private/file-figure.cjs.map +1 -1
  54. package/dist/cjs/components/filter/filter.cjs +1 -1
  55. package/dist/cjs/components/filter/filter.cjs.map +1 -1
  56. package/dist/cjs/components/icon/check-props.cjs +1 -1
  57. package/dist/cjs/components/icon/check-props.cjs.map +1 -1
  58. package/dist/cjs/components/icon/index.cjs +1 -1
  59. package/dist/cjs/components/icon/index.cjs.map +1 -1
  60. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  61. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  62. package/dist/cjs/components/input/check-props.cjs +1 -1
  63. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  64. package/dist/cjs/components/input/index.cjs.map +1 -1
  65. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  66. package/dist/cjs/components/input/search.cjs.map +1 -1
  67. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  68. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  69. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  70. package/dist/cjs/components/modal/index.cjs +1 -1
  71. package/dist/cjs/components/modal/index.cjs.map +1 -1
  72. package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
  73. package/dist/cjs/components/pill/index.cjs.map +1 -1
  74. package/dist/cjs/components/pill-container/index.cjs +1 -1
  75. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  76. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  77. package/dist/cjs/components/popover/index.cjs.map +1 -1
  78. package/dist/cjs/components/popover/popover.cjs +1 -1
  79. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  80. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  81. package/dist/cjs/components/progress-indicator/private/step.cjs.map +1 -1
  82. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  83. package/dist/cjs/components/radio/index.cjs +1 -1
  84. package/dist/cjs/components/radio/index.cjs.map +1 -1
  85. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
  86. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  87. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  88. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  89. package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
  90. package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -1
  91. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  92. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  93. package/dist/cjs/components/simple-data-table/interactive-element.cjs +1 -1
  94. package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
  95. package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
  96. package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
  97. package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
  98. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  99. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  100. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  101. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  102. package/dist/cjs/components/simple-data-table/private/link.cjs +1 -1
  103. package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -1
  104. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  105. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  106. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  107. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  108. package/dist/cjs/components/slider/index.cjs.map +1 -1
  109. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  110. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  111. package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
  112. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  113. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  114. package/dist/cjs/components/tabs/private/tab.cjs +1 -1
  115. package/dist/cjs/components/tabs/private/tab.cjs.map +1 -1
  116. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  117. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  118. package/dist/cjs/components/textarea/index.cjs +1 -1
  119. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  120. package/dist/cjs/components/toast/index.cjs.map +1 -1
  121. package/dist/cjs/components/tooltip/index.cjs +1 -3
  122. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  123. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  124. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  125. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  126. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  127. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  128. package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
  129. package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
  130. package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
  131. package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
  132. package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
  133. package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
  134. package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
  135. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  136. package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
  137. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  138. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  139. package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
  140. package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
  141. package/dist/cjs/utilities/color.cjs +1 -1
  142. package/dist/cjs/utilities/color.cjs.map +1 -1
  143. package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
  144. package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
  145. package/dist/cjs/utilities/get-aria-props.cjs +1 -1
  146. package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
  147. package/dist/cjs/utilities/get-component-doc.cjs +1 -1
  148. package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
  149. package/dist/cjs/utilities/get-data-props.cjs +1 -1
  150. package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
  151. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
  152. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
  153. package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
  154. package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
  155. package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
  156. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  157. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  158. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  159. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  160. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  161. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  162. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
  163. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
  164. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
  165. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
  166. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
  167. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
  168. package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
  169. package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
  170. package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
  171. package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
  172. package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
  173. package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
  174. package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
  175. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
  176. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
  177. package/dist/cjs/utilities/warning/required-property.cjs +1 -1
  178. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
  179. package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
  180. package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
  181. package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
  182. package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
  183. package/dist/es/components/accordion/index.js +7 -3
  184. package/dist/es/components/accordion/index.js.map +1 -1
  185. package/dist/es/components/accordion/panel.js.map +1 -1
  186. package/dist/es/components/alert/index.js +4 -5
  187. package/dist/es/components/alert/index.js.map +1 -1
  188. package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
  189. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  190. package/dist/es/components/builder-header/toolbar.js.map +1 -1
  191. package/dist/es/components/button/check-props.js +1 -1
  192. package/dist/es/components/button/check-props.js.map +1 -1
  193. package/dist/es/components/button/index.js +50 -50
  194. package/dist/es/components/button/index.js.map +1 -1
  195. package/dist/es/components/button-stateful/check-props.js +1 -1
  196. package/dist/es/components/button-stateful/check-props.js.map +1 -1
  197. package/dist/es/components/button-stateful/index.js +3 -2
  198. package/dist/es/components/button-stateful/index.js.map +1 -1
  199. package/dist/es/components/carousel/index.js +155 -129
  200. package/dist/es/components/carousel/index.js.map +1 -1
  201. package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
  202. package/dist/es/components/carousel/private/carousel-item.js +1 -1
  203. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  204. package/dist/es/components/checkbox/check-props.js +1 -1
  205. package/dist/es/components/checkbox/check-props.js.map +1 -1
  206. package/dist/es/components/checkbox/index.js +102 -100
  207. package/dist/es/components/checkbox/index.js.map +1 -1
  208. package/dist/es/components/color-picker/color-picker.js +150 -151
  209. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  210. package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
  211. package/dist/es/components/color-picker/private/hsv-color.js +16 -20
  212. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  213. package/dist/es/components/color-picker/private/swatch-option.js +2 -2
  214. package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
  215. package/dist/es/components/color-picker/private/swatch.js +1 -1
  216. package/dist/es/components/color-picker/private/swatch.js.map +1 -1
  217. package/dist/es/components/combobox/combobox.js +569 -582
  218. package/dist/es/components/combobox/combobox.js.map +1 -1
  219. package/dist/es/components/combobox/index.js +6 -19
  220. package/dist/es/components/combobox/index.js.map +1 -1
  221. package/dist/es/components/combobox/private/menu.js +3 -3
  222. package/dist/es/components/combobox/private/menu.js.map +1 -1
  223. package/dist/es/components/date-picker/date-picker.js +101 -102
  224. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  225. package/dist/es/components/date-picker/index.js.map +1 -1
  226. package/dist/es/components/date-picker/private/calendar.js.map +1 -1
  227. package/dist/es/components/date-picker/private/day.js +1 -1
  228. package/dist/es/components/date-picker/private/day.js.map +1 -1
  229. package/dist/es/components/files/file.js +5 -6
  230. package/dist/es/components/files/file.js.map +1 -1
  231. package/dist/es/components/files/private/file-actions.js +2 -2
  232. package/dist/es/components/files/private/file-actions.js.map +1 -1
  233. package/dist/es/components/files/private/file-figure.js +1 -1
  234. package/dist/es/components/files/private/file-figure.js.map +1 -1
  235. package/dist/es/components/filter/filter.js +5 -1
  236. package/dist/es/components/filter/filter.js.map +1 -1
  237. package/dist/es/components/icon/check-props.js +9 -7
  238. package/dist/es/components/icon/check-props.js.map +1 -1
  239. package/dist/es/components/icon/index.js +13 -10
  240. package/dist/es/components/icon/index.js.map +1 -1
  241. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  242. package/dist/es/components/icon-settings/index.js.map +1 -1
  243. package/dist/es/components/input/check-props.js +14 -13
  244. package/dist/es/components/input/check-props.js.map +1 -1
  245. package/dist/es/components/input/index.js.map +1 -1
  246. package/dist/es/components/input/private/inner-input.js.map +1 -1
  247. package/dist/es/components/input/search.js.map +1 -1
  248. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  249. package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
  250. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  251. package/dist/es/components/modal/index.js +1 -2
  252. package/dist/es/components/modal/index.js.map +1 -1
  253. package/dist/es/components/panel/filtering/group.js.map +1 -1
  254. package/dist/es/components/pill/index.js.map +1 -1
  255. package/dist/es/components/pill-container/index.js +10 -6
  256. package/dist/es/components/pill-container/index.js.map +1 -1
  257. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  258. package/dist/es/components/popover/index.js.map +1 -1
  259. package/dist/es/components/popover/popover.js +181 -177
  260. package/dist/es/components/popover/popover.js.map +1 -1
  261. package/dist/es/components/progress-indicator/index.js.map +1 -1
  262. package/dist/es/components/progress-indicator/private/step.js.map +1 -1
  263. package/dist/es/components/progress-ring/index.js.map +1 -1
  264. package/dist/es/components/radio/index.js +1 -1
  265. package/dist/es/components/radio/index.js.map +1 -1
  266. package/dist/es/components/radio-group/check-props.js.map +1 -1
  267. package/dist/es/components/radio-group/index.js.map +1 -1
  268. package/dist/es/components/scoped-notification/index.js.map +1 -1
  269. package/dist/es/components/setup-assistant/step.js.map +1 -1
  270. package/dist/es/components/simple-data-table/cell.js +8 -5
  271. package/dist/es/components/simple-data-table/cell.js.map +1 -1
  272. package/dist/es/components/simple-data-table/index.js +97 -91
  273. package/dist/es/components/simple-data-table/index.js.map +1 -1
  274. package/dist/es/components/simple-data-table/interactive-element.js +31 -28
  275. package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
  276. package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
  277. package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
  278. package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
  279. package/dist/es/components/simple-data-table/private/head.js +65 -42
  280. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  281. package/dist/es/components/simple-data-table/private/header-cell.js +2 -1
  282. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  283. package/dist/es/components/simple-data-table/private/link.js.map +1 -1
  284. package/dist/es/components/simple-data-table/private/row.js +96 -60
  285. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  286. package/dist/es/components/simple-data-table/row-actions.js +4 -1
  287. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  288. package/dist/es/components/slider/index.js.map +1 -1
  289. package/dist/es/components/split-view/header.js.map +1 -1
  290. package/dist/es/components/split-view/listbox.js.map +1 -1
  291. package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
  292. package/dist/es/components/tabs/index.js.map +1 -1
  293. package/dist/es/components/tabs/panel.js.map +1 -1
  294. package/dist/es/components/tabs/private/tab.js +1 -1
  295. package/dist/es/components/tabs/private/tab.js.map +1 -1
  296. package/dist/es/components/textarea/check-props.js +1 -1
  297. package/dist/es/components/textarea/check-props.js.map +1 -1
  298. package/dist/es/components/textarea/index.js +29 -42
  299. package/dist/es/components/textarea/index.js.map +1 -1
  300. package/dist/es/components/toast/index.js.map +1 -1
  301. package/dist/es/components/tooltip/index.js +107 -88
  302. package/dist/es/components/tooltip/index.js.map +1 -1
  303. package/dist/es/components/tree/private/branch.js.map +1 -1
  304. package/dist/es/components/tree/private/item.js.map +1 -1
  305. package/dist/es/components/tree/private/render-branch.js +14 -19
  306. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  307. package/dist/es/components/tree/tree.js.map +1 -1
  308. package/dist/es/components/trial-bar/button.js.map +1 -1
  309. package/dist/es/components/trial-bar/dropdown.js.map +1 -1
  310. package/dist/es/components/utilities/dialog/index.js +2 -1
  311. package/dist/es/components/utilities/dialog/index.js.map +1 -1
  312. package/dist/es/components/utilities/dialog/portal.js +5 -3
  313. package/dist/es/components/utilities/dialog/portal.js.map +1 -1
  314. package/dist/es/components/utilities/menu-list/index.js +6 -6
  315. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  316. package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
  317. package/dist/es/components/utilities/menu-list/item.js +42 -18
  318. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  319. package/dist/es/components/utilities/utility-icon/index.js +32 -52
  320. package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
  321. package/dist/es/utilities/color.js +1 -1
  322. package/dist/es/utilities/color.js.map +1 -1
  323. package/dist/es/utilities/dom-element-focus.js.map +1 -1
  324. package/dist/es/utilities/execution-environment.js.map +1 -1
  325. package/dist/es/utilities/get-aria-props.js +1 -1
  326. package/dist/es/utilities/get-aria-props.js.map +1 -1
  327. package/dist/es/utilities/get-component-doc.js +6 -6
  328. package/dist/es/utilities/get-component-doc.js.map +1 -1
  329. package/dist/es/utilities/get-data-props.js +1 -1
  330. package/dist/es/utilities/get-data-props.js.map +1 -1
  331. package/dist/es/utilities/keyboard-navigable-dialog.js +7 -7
  332. package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
  333. package/dist/es/utilities/keyboard-navigate.js +1 -1
  334. package/dist/es/utilities/keyboard-navigate.js.map +1 -1
  335. package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
  336. package/dist/es/utilities/warning/children-as-trigger.js +10 -8
  337. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  338. package/dist/es/utilities/warning/deprecated-property-value.js +12 -10
  339. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  340. package/dist/es/utilities/warning/deprecated-property.js +10 -8
  341. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  342. package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
  343. package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
  344. package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
  345. package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
  346. package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
  347. package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
  348. package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
  349. package/dist/es/utilities/warning/one-of-required-property.js +11 -10
  350. package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
  351. package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
  352. package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
  353. package/dist/es/utilities/warning/removal-version.js +6 -0
  354. package/dist/es/utilities/warning/removal-version.js.map +1 -0
  355. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
  356. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
  357. package/dist/es/utilities/warning/required-property.js +8 -7
  358. package/dist/es/utilities/warning/required-property.js.map +1 -1
  359. package/dist/es/utilities/warning/sunset-property.js +8 -7
  360. package/dist/es/utilities/warning/sunset-property.js.map +1 -1
  361. package/dist/es/utilities/warning/warned-registry.js +10 -0
  362. package/dist/es/utilities/warning/warned-registry.js.map +1 -0
  363. package/dist/llms/components/accordion.md +267 -0
  364. package/dist/llms/components/alert.md +228 -0
  365. package/dist/llms/components/avatar.md +167 -0
  366. package/dist/llms/components/badge.md +153 -0
  367. package/dist/llms/components/breadcrumb.md +148 -0
  368. package/dist/llms/components/builder-header.examples.md +239 -0
  369. package/dist/llms/components/builder-header.md +736 -0
  370. package/dist/llms/components/button-group.md +167 -0
  371. package/dist/llms/components/button-stateful.md +246 -0
  372. package/dist/llms/components/button.md +661 -0
  373. package/dist/llms/components/card.md +368 -0
  374. package/dist/llms/components/carousel.md +365 -0
  375. package/dist/llms/components/checkbox.md +887 -0
  376. package/dist/llms/components/color-picker.md +591 -0
  377. package/dist/llms/components/combobox.examples.md +802 -0
  378. package/dist/llms/components/combobox.md +929 -0
  379. package/dist/llms/components/date-picker.md +546 -0
  380. package/dist/llms/components/docked-composer.md +173 -0
  381. package/dist/llms/components/dynamic-icon.md +226 -0
  382. package/dist/llms/components/expandable-section.md +198 -0
  383. package/dist/llms/components/files.md +337 -0
  384. package/dist/llms/components/filter.md +775 -0
  385. package/dist/llms/components/icon-settings.md +301 -0
  386. package/dist/llms/components/icon.md +1040 -0
  387. package/dist/llms/components/input.md +746 -0
  388. package/dist/llms/components/media-object.md +125 -0
  389. package/dist/llms/components/menu-dropdown.md +732 -0
  390. package/dist/llms/components/modal.md +504 -0
  391. package/dist/llms/components/page-header.md +282 -0
  392. package/dist/llms/components/panel.md +256 -0
  393. package/dist/llms/components/pill-container.md +218 -0
  394. package/dist/llms/components/pill.md +266 -0
  395. package/dist/llms/components/popover.md +600 -0
  396. package/dist/llms/components/portal-settings.md +371 -0
  397. package/dist/llms/components/progress-bar.md +175 -0
  398. package/dist/llms/components/progress-indicator.md +399 -0
  399. package/dist/llms/components/progress-ring.md +146 -0
  400. package/dist/llms/components/radio-button-group.md +285 -0
  401. package/dist/llms/components/radio-group.md +242 -0
  402. package/dist/llms/components/radio.md +269 -0
  403. package/dist/llms/components/scoped-notification.md +156 -0
  404. package/dist/llms/components/setup-assistant.md +398 -0
  405. package/dist/llms/components/simple-data-table.examples.md +2773 -0
  406. package/dist/llms/components/simple-data-table.md +919 -0
  407. package/dist/llms/components/slider.md +217 -0
  408. package/dist/llms/components/spinner.md +232 -0
  409. package/dist/llms/components/split-view.md +350 -0
  410. package/dist/llms/components/tabs.md +311 -0
  411. package/dist/llms/components/textarea.md +331 -0
  412. package/dist/llms/components/toast.md +267 -0
  413. package/dist/llms/components/tooltip.md +470 -0
  414. package/dist/llms/components/tree.md +1011 -0
  415. package/dist/llms/components/trial-bar.md +383 -0
  416. package/dist/llms/components/vertical-navigation.md +196 -0
  417. package/dist/llms/components/visual-picker.md +362 -0
  418. package/dist/llms/components/welcome-mat.md +885 -0
  419. package/dist/llms/docs/migration-v11.md +471 -0
  420. package/dist/llms/llms-full.txt +6874 -0
  421. package/dist/llms/llms.txt +133 -0
  422. package/dist/llms/rules.md +36 -0
  423. package/dist/types/components/accordion/index.d.ts.map +1 -1
  424. package/dist/types/components/accordion/panel.d.ts +7 -7
  425. package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
  426. package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
  427. package/dist/types/components/builder-header/nav-link.d.ts +0 -1
  428. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  429. package/dist/types/components/builder-header/toolbar.d.ts +0 -1
  430. package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
  431. package/dist/types/components/button/index.d.ts +19 -6
  432. package/dist/types/components/button/index.d.ts.map +1 -1
  433. package/dist/types/components/button-stateful/index.d.ts +8 -2
  434. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  435. package/dist/types/components/carousel/index.d.ts +7 -1
  436. package/dist/types/components/carousel/index.d.ts.map +1 -1
  437. package/dist/types/components/checkbox/index.d.ts +22 -5
  438. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  439. package/dist/types/components/color-picker/color-picker.d.ts +6 -4
  440. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  441. package/dist/types/components/color-picker/types.d.ts +2 -2
  442. package/dist/types/components/combobox/combobox.d.ts +22 -0
  443. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  444. package/dist/types/components/combobox/index.d.ts +1 -1
  445. package/dist/types/components/combobox/index.d.ts.map +1 -1
  446. package/dist/types/components/date-picker/date-picker.d.ts +16 -4
  447. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  448. package/dist/types/components/date-picker/index.d.ts +2 -6
  449. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  450. package/dist/types/components/files/file.d.ts +5 -0
  451. package/dist/types/components/files/file.d.ts.map +1 -1
  452. package/dist/types/components/icon/index.d.ts +8 -1
  453. package/dist/types/components/icon/index.d.ts.map +1 -1
  454. package/dist/types/components/icon/input-icon/index.d.ts +3 -0
  455. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  456. package/dist/types/components/icon-settings/index.d.ts.map +1 -1
  457. package/dist/types/components/input/index.d.ts +10 -6
  458. package/dist/types/components/input/index.d.ts.map +1 -1
  459. package/dist/types/components/input/search.d.ts.map +1 -1
  460. package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
  461. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  462. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +13 -3
  463. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  464. package/dist/types/components/modal/index.d.ts +5 -5
  465. package/dist/types/components/modal/index.d.ts.map +1 -1
  466. package/dist/types/components/page-header/types.d.ts +3 -0
  467. package/dist/types/components/page-header/types.d.ts.map +1 -1
  468. package/dist/types/components/panel/filtering/group.d.ts +2 -0
  469. package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
  470. package/dist/types/components/pill/index.d.ts +1 -0
  471. package/dist/types/components/pill/index.d.ts.map +1 -1
  472. package/dist/types/components/popover/edit-dialog.d.ts +1 -3
  473. package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
  474. package/dist/types/components/popover/index.d.ts.map +1 -1
  475. package/dist/types/components/popover/popover.d.ts +1 -0
  476. package/dist/types/components/popover/popover.d.ts.map +1 -1
  477. package/dist/types/components/progress-indicator/index.d.ts +1 -0
  478. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  479. package/dist/types/components/progress-ring/index.d.ts +1 -0
  480. package/dist/types/components/progress-ring/index.d.ts.map +1 -1
  481. package/dist/types/components/radio/index.d.ts +11 -4
  482. package/dist/types/components/radio/index.d.ts.map +1 -1
  483. package/dist/types/components/radio-group/index.d.ts +5 -3
  484. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  485. package/dist/types/components/scoped-notification/index.d.ts +1 -0
  486. package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
  487. package/dist/types/components/setup-assistant/step.d.ts +0 -1
  488. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  489. package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
  490. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  491. package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
  492. package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
  493. package/dist/types/components/simple-data-table/types.d.ts +11 -2
  494. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  495. package/dist/types/components/slider/index.d.ts +6 -4
  496. package/dist/types/components/slider/index.d.ts.map +1 -1
  497. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  498. package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
  499. package/dist/types/components/tabs/index.d.ts +1 -0
  500. package/dist/types/components/tabs/index.d.ts.map +1 -1
  501. package/dist/types/components/tabs/panel.d.ts +2 -1
  502. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  503. package/dist/types/components/textarea/index.d.ts +12 -40
  504. package/dist/types/components/textarea/index.d.ts.map +1 -1
  505. package/dist/types/components/toast/index.d.ts.map +1 -1
  506. package/dist/types/components/tooltip/index.d.ts +5 -0
  507. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  508. package/dist/types/components/tree/tree.d.ts +5 -0
  509. package/dist/types/components/tree/tree.d.ts.map +1 -1
  510. package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
  511. package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
  512. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  513. package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
  514. package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
  515. package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
  516. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  517. package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
  518. package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
  519. package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
  520. package/dist/types/types/common.d.ts.map +1 -1
  521. package/dist/types/types/components.d.ts.map +1 -1
  522. package/package.json +9 -7
  523. package/dist/cjs/icons/action/index.cjs +0 -2
  524. package/dist/cjs/icons/action/index.cjs.map +0 -1
  525. package/dist/cjs/icons/custom/index.cjs +0 -2
  526. package/dist/cjs/icons/custom/index.cjs.map +0 -1
  527. package/dist/cjs/icons/doctype/index.cjs +0 -2
  528. package/dist/cjs/icons/doctype/index.cjs.map +0 -1
  529. package/dist/cjs/icons/standard/index.cjs +0 -2
  530. package/dist/cjs/icons/standard/index.cjs.map +0 -1
  531. package/dist/cjs/icons/utility/index.cjs +0 -2
  532. package/dist/cjs/icons/utility/index.cjs.map +0 -1
  533. package/dist/es/icons/action/index.js +0 -6
  534. package/dist/es/icons/action/index.js.map +0 -1
  535. package/dist/es/icons/custom/index.js +0 -6
  536. package/dist/es/icons/custom/index.js.map +0 -1
  537. package/dist/es/icons/doctype/index.js +0 -6
  538. package/dist/es/icons/doctype/index.js.map +0 -1
  539. package/dist/es/icons/standard/index.js +0 -6
  540. package/dist/es/icons/standard/index.js.map +0 -1
  541. package/dist/es/icons/utility/index.js +0 -6
  542. package/dist/es/icons/utility/index.js.map +0 -1
  543. package/dist/types/icons/action/index.d.ts +0 -3
  544. package/dist/types/icons/action/index.d.ts.map +0 -1
  545. package/dist/types/icons/custom/index.d.ts +0 -3
  546. package/dist/types/icons/custom/index.d.ts.map +0 -1
  547. package/dist/types/icons/doctype/index.d.ts +0 -3
  548. package/dist/types/icons/doctype/index.d.ts.map +0 -1
  549. package/dist/types/icons/standard/index.d.ts +0 -3
  550. package/dist/types/icons/standard/index.d.ts.map +0 -1
  551. package/dist/types/icons/utility/index.d.ts +0 -3
  552. package/dist/types/icons/utility/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-actions.cjs","names":[],"sources":["../../../../../components/files/private/file-actions.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// # FileActions Component\n\n// Implements the [FileActions design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_ACTIONS } from '../../../utilities/constants';\nimport Button from '../../button';\nimport Icon from '../../icon';\nimport type { MenuDropdownProps } from '../../menu-dropdown';\n\nexport interface FileActionsAssistiveText {\n\tdownload?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileActionsProps {\n\t/**\n\t * Assistive text for the file component\n\t */\n\tassistiveText?: FileActionsAssistiveText;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Dropdown for More Actions; doesn't show More actions button if empty\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesnt show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n}\n\n/**\n * A carousel allows multiple pieces of featured content to occupy an allocated amount of space.\n */\nconst FileActions = (props: FileActionsProps) => {\n\tconst assistiveText = props.assistiveText ?? {};\n\tconst { moreActionsDropdown } = props;\n\tconst actions = (\n\t\t<div className=\"slds-file__actions-menu\">\n\t\t\t<div className=\"slds-button-group\" role=\"group\">\n\t\t\t\t{typeof props.onClickDownload === 'function' ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\ticonSize=\"x-small\"\n\t\t\t\t\t\tonClick={props.onClickDownload}\n\t\t\t\t\t\ttitle=\"Download\"\n\t\t\t\t\t\tclassName=\"slds-button_icon-inverse\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.download }}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"download\"\n\t\t\t\t\t\t\tsize=\"xx-small\"\n\t\t\t\t\t\t\tinverse={props.hasNoVisibleTitle}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) : null}\n\t\t\t\t{moreActionsDropdown\n\t\t\t\t\t? React.cloneElement(moreActionsDropdown, {\n\t\t\t\t\t\t\tassistiveText: {\n\t\t\t\t\t\t\t\ticon: assistiveText.moreActions,\n\t\t\t\t\t\t\t\t...moreActionsDropdown.props.assistiveText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toverlay: moreActionsDropdown.props.overlay ?? false,\n\t\t\t\t\t\t\tbuttonVariant: moreActionsDropdown.props.buttonVariant ?? 'icon',\n\t\t\t\t\t\t\tbuttonInverse:\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.buttonInverse ??\n\t\t\t\t\t\t\t\tprops.hasNoVisibleTitle,\n\t\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\t\t'dsr-file__more-actions-dropdown',\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.className\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\ttriggerClassName: classNames(\n\t\t\t\t\t\t\t\t'dsr-file__more-actions',\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.triggerClassName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})\n\t\t\t\t\t: null}\n\t\t\t</div>\n\t\t</div>\n\t);\n\tif (\n\t\ttypeof props.onClickDownload === 'function' ||\n\t\tprops.moreActionsDropdown\n\t) {\n\t\tif (!props.hasNoVisibleTitle) {\n\t\t\treturn actions;\n\t\t}\n\t\treturn (\n\t\t\t<div className=\"slds-file__title slds-file__title_scrim\">{actions}</div>\n\t\t);\n\t}\n\treturn null;\n};\n\nFileActions.displayName = FILES_ACTIONS;\n\nexport default FileActions;\n"],"mappings":"uSA0CA,IAAM,EAAe,GAA4B,CAChD,IAAM,EAAgB,EAAM,eAAiB,CAAC,EACxC,CAAE,uBAAwB,EAC1B,GACL,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BACd,UAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oBAAoB,KAAK,QAAxC,SAAA,CACE,OAAO,EAAM,iBAAoB,YACjC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,KAAK,SACL,QAAQ,OACR,SAAS,UACT,QAAS,EAAM,gBACf,MAAM,WACN,UAAU,2BAEV,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,QAAS,EAC/C,SAAS,UACT,KAAK,WACL,KAAK,WACL,QAAS,EAAM,iBACf,CAAA,CACM,CAAA,EACL,KACH,EACE,EAAA,QAAM,aAAa,EAAqB,CACxC,cAAe,CACd,KAAM,EAAc,YACpB,GAAG,EAAoB,MAAM,aAC9B,EACA,QAAS,EAAoB,MAAM,SAAW,GAC9C,cAAe,EAAoB,MAAM,eAAiB,OAC1D,cACC,EAAoB,MAAM,eAC1B,EAAM,kBACP,WAAA,EAAW,EAAA,QAAA,CACV,kCACA,EAAoB,MAAM,SAC3B,EACA,kBAAA,EAAkB,EAAA,QAAA,CACjB,yBACA,EAAoB,MAAM,gBAC3B,CACD,CAAC,EACA,IACC,GACD,CAAA,EAaN,OAVC,OAAO,EAAM,iBAAoB,YACjC,EAAM,oBAED,EAAM,mBAIV,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0CAA2C,SAAA,CAAa,CAAA,EAHhE,EAMF,IACR,EAEA,EAAY,YAAc,EAAA"}
1
+ {"version":3,"file":"file-actions.cjs","names":[],"sources":["../../../../../components/files/private/file-actions.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// # FileActions Component\n\n// Implements the [FileActions design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_ACTIONS } from '../../../utilities/constants';\nimport Button from '../../button';\nimport Icon from '../../icon';\nimport type { MenuDropdownProps } from '../../menu-dropdown';\n\nexport interface FileActionsAssistiveText {\n\tdownload?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileActionsProps {\n\t/**\n\t * Assistive text for the file component\n\t */\n\tassistiveText?: FileActionsAssistiveText;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Dropdown for More Actions; doesn't show More actions button if empty\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesnt show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n}\n\n/**\n * A carousel allows multiple pieces of featured content to occupy an allocated amount of space.\n */\nconst FileActions = (props: FileActionsProps) => {\n\tconst assistiveText = props.assistiveText ?? {};\n\tconst { moreActionsDropdown } = props;\n\tconst actions = (\n\t\t<div className=\"slds-file__actions-menu\">\n\t\t\t<div className=\"slds-button-group\" role=\"group\">\n\t\t\t\t{typeof props.onClickDownload === 'function' ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\ticonSize=\"x-small\"\n\t\t\t\t\t\tonClick={props.onClickDownload}\n\t\t\t\t\t\ttitle=\"Download\"\n\t\t\t\t\t\tclassName=\"slds-button_icon-inverse\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.download }}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"download\"\n\t\t\t\t\t\t\tsize=\"xx-small\"\n\t\t\t\t\t\t\tinverse={props.hasNoVisibleTitle}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) : null}\n\t\t\t\t{moreActionsDropdown\n\t\t\t\t\t? React.cloneElement(moreActionsDropdown, {\n\t\t\t\t\t\t\tassistiveText: {\n\t\t\t\t\t\t\t\ticon: assistiveText.moreActions,\n\t\t\t\t\t\t\t\t...moreActionsDropdown.props.assistiveText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toverlay: moreActionsDropdown.props.overlay ?? false,\n\t\t\t\t\t\t\t// SLDS clips `.slds-file__title_scrim` (`overflow: hidden`), so\n\t\t\t\t\t\t\t// render the menu outside the file instead of inside the scrim.\n\t\t\t\t\t\t\tmenuPosition:\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.menuPosition ??\n\t\t\t\t\t\t\t\t'overflowBoundaryElement',\n\t\t\t\t\t\t\tbuttonVariant: moreActionsDropdown.props.buttonVariant ?? 'icon',\n\t\t\t\t\t\t\tbuttonInverse:\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.buttonInverse ??\n\t\t\t\t\t\t\t\tprops.hasNoVisibleTitle,\n\t\t\t\t\t\t\t// The trigger wraps the button, so SLDS's\n\t\t\t\t\t\t\t// `.slds-button-group .slds-button:first-child` would round\n\t\t\t\t\t\t\t// its left corners; `slds-button_last` rounds the right ones.\n\t\t\t\t\t\t\ttriggerClassName: classNames(\n\t\t\t\t\t\t\t\t'slds-button_last',\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.triggerClassName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})\n\t\t\t\t\t: null}\n\t\t\t</div>\n\t\t</div>\n\t);\n\tif (\n\t\ttypeof props.onClickDownload === 'function' ||\n\t\tprops.moreActionsDropdown\n\t) {\n\t\tif (!props.hasNoVisibleTitle) {\n\t\t\treturn actions;\n\t\t}\n\t\treturn (\n\t\t\t<div className=\"slds-file__title slds-file__title_scrim\">{actions}</div>\n\t\t);\n\t}\n\treturn null;\n};\n\nFileActions.displayName = FILES_ACTIONS;\n\nexport default FileActions;\n"],"mappings":"uSA0CA,IAAM,EAAe,GAA4B,CAChD,IAAM,EAAgB,EAAM,eAAiB,CAAC,EACxC,CAAE,uBAAwB,EAC1B,GACL,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BACd,UAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oBAAoB,KAAK,QAAxC,SAAA,CACE,OAAO,EAAM,iBAAoB,YACjC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,KAAK,SACL,QAAQ,OACR,SAAS,UACT,QAAS,EAAM,gBACf,MAAM,WACN,UAAU,2BAEV,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,QAAS,EAC/C,SAAS,UACT,KAAK,WACL,KAAK,WACL,QAAS,EAAM,iBACf,CAAA,CACM,CAAA,EACL,KACH,EACE,EAAA,QAAM,aAAa,EAAqB,CACxC,cAAe,CACd,KAAM,EAAc,YACpB,GAAG,EAAoB,MAAM,aAC9B,EACA,QAAS,EAAoB,MAAM,SAAW,GAG9C,aACC,EAAoB,MAAM,cAC1B,0BACD,cAAe,EAAoB,MAAM,eAAiB,OAC1D,cACC,EAAoB,MAAM,eAC1B,EAAM,kBAIP,kBAAA,EAAkB,EAAA,QAAA,CACjB,mBACA,EAAoB,MAAM,gBAC3B,CACD,CAAC,EACA,IACC,GACD,CAAA,EAaN,OAVC,OAAO,EAAM,iBAAoB,YACjC,EAAM,oBAED,EAAM,mBAIV,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0CAA2C,SAAA,CAAa,CAAA,EAHhE,EAMF,IACR,EAEA,EAAY,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../spinner/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({isLoading:e=!1,assistiveText:t={},image:a,labels:o={},icon:s})=>e?(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`span`,{className:`slds-assistive-text`,children:t.link}),(0,i.jsx)(n.default,{size:`medium`,variant:`base`,assistiveText:{label:t.loading},containerStyle:{zIndex:`1`}})]}):a?(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`span`,{className:`slds-assistive-text`,children:t.link}),(0,i.jsx)(`img`,{alt:t.image||o.title,src:a})]}):(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`span`,{className:`slds-assistive-text`,children:t.link}),(0,i.jsx)(`span`,{className:`slds-file__icon slds-icon_container`,title:o.title,children:s?r.default.cloneElement(s,{size:null}):null})]});a.displayName=t.FILES_FIGURE,exports.default=a;
1
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../spinner/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({isLoading:e=!1,assistiveText:t={},image:a,labels:o={},icon:s})=>e?(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`span`,{className:`slds-assistive-text`,children:t.link}),(0,i.jsx)(n.default,{size:`medium`,variant:`base`,assistiveText:{label:t.loading},style:{zIndex:`1`}})]}):a?(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`span`,{className:`slds-assistive-text`,children:t.link}),(0,i.jsx)(`img`,{alt:t.image||o.title,src:a})]}):(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`span`,{className:`slds-assistive-text`,children:t.link}),(0,i.jsx)(`span`,{className:`slds-file__icon slds-icon_container`,title:o.title,children:s?r.default.cloneElement(s,{size:null}):null})]});a.displayName=t.FILES_FIGURE,exports.default=a;
2
2
  //# sourceMappingURL=file-figure.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-figure.cjs","names":[],"sources":["../../../../../components/files/private/file-figure.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// # FileFigure Component\n\n// Implements the [FileFigure design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\n\nimport { FILES_FIGURE } from '../../../utilities/constants';\n\nimport Spinner from '../../spinner';\nimport type { IconProps, IconSize } from '../../icon';\n\nexport interface FileFigureAssistiveText {\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n}\n\nexport interface FileFigureProps {\n\tassistiveText?: FileFigureAssistiveText;\n\t/**\n\t * Icon for the file, shown when there is no image and it is not loading.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * Image/Figure for the file\n\t */\n\timage?: string;\n\t/**\n\t * Whether the file figure is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the file figure component\n\t */\n\tlabels?: {\n\t\ttitle?: string;\n\t};\n}\n\n/**\n * A file can have a image, an icon or a loading animation as its thumbnail\n */\nconst FileFigure = ({\n\tisLoading = false,\n\tassistiveText = {},\n\timage,\n\tlabels = {},\n\ticon,\n}: FileFigureProps) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<Spinner\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\tassistiveText={{ label: assistiveText.loading }}\n\t\t\t\t\tcontainerStyle={{ zIndex: '1' }}\n\t\t\t\t/>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\tif (image) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<img alt={assistiveText.image || labels.title} src={image} />\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t<span\n\t\t\t\tclassName=\"slds-file__icon slds-icon_container\"\n\t\t\t\ttitle={labels.title}\n\t\t\t>\n\t\t\t\t{icon\n\t\t\t\t\t? // The container sizes the icon, so drop the icon's own size class\n\t\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\t\ticon as ReactElement<\n\t\t\t\t\t\t\t\tOmit<IconProps, 'size'> & { size?: IconSize | null }\n\t\t\t\t\t\t\t>,\n\t\t\t\t\t\t\t{ size: null }\n\t\t\t\t\t\t)\n\t\t\t\t\t: null}\n\t\t\t</span>\n\t\t</React.Fragment>\n\t);\n};\n\nFileFigure.displayName = FILES_FIGURE;\n\nexport default FileFigure;\n"],"mappings":"yNA6CA,IAAM,GAAc,CACnB,YAAY,GACZ,gBAAgB,CAAC,EACjB,QACA,SAAS,CAAC,EACV,UAEI,GAEF,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,IAAW,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,KAAK,SACL,QAAQ,OACR,cAAe,CAAE,MAAO,EAAc,OAAQ,EAC9C,eAAgB,CAAE,OAAQ,GAAI,CAC9B,CAAA,CACc,CAAA,CAAA,EAGd,GAEF,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,IAAW,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,IAAK,EAAc,OAAS,EAAO,MAAO,IAAK,CAAQ,CAAA,CAC7C,CAAA,CAAA,GAIjB,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,IAAW,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,UAAU,sCACV,MAAO,EAAO,MAEb,SAAA,EAEC,EAAA,QAAM,aACL,EAGA,CAAE,KAAM,IAAK,CACd,EACC,IACE,CAAA,CACS,CAAA,CAAA,EAIlB,EAAW,YAAc,EAAA"}
1
+ {"version":3,"file":"file-figure.cjs","names":[],"sources":["../../../../../components/files/private/file-figure.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// # FileFigure Component\n\n// Implements the [FileFigure design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\n\nimport { FILES_FIGURE } from '../../../utilities/constants';\n\nimport Spinner from '../../spinner';\nimport type { IconProps, IconSize } from '../../icon';\n\nexport interface FileFigureAssistiveText {\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n}\n\nexport interface FileFigureProps {\n\tassistiveText?: FileFigureAssistiveText;\n\t/**\n\t * Icon for the file, shown when there is no image and it is not loading.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * Image/Figure for the file\n\t */\n\timage?: string;\n\t/**\n\t * Whether the file figure is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the file figure component\n\t */\n\tlabels?: {\n\t\ttitle?: string;\n\t};\n}\n\n/**\n * A file can have a image, an icon or a loading animation as its thumbnail\n */\nconst FileFigure = ({\n\tisLoading = false,\n\tassistiveText = {},\n\timage,\n\tlabels = {},\n\ticon,\n}: FileFigureProps) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<Spinner\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\tassistiveText={{ label: assistiveText.loading }}\n\t\t\t\t\tstyle={{ zIndex: '1' }}\n\t\t\t\t/>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\tif (image) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<img alt={assistiveText.image || labels.title} src={image} />\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t<span\n\t\t\t\tclassName=\"slds-file__icon slds-icon_container\"\n\t\t\t\ttitle={labels.title}\n\t\t\t>\n\t\t\t\t{icon\n\t\t\t\t\t? // The container sizes the icon, so drop the icon's own size class\n\t\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\t\ticon as ReactElement<\n\t\t\t\t\t\t\t\tOmit<IconProps, 'size'> & { size?: IconSize | null }\n\t\t\t\t\t\t\t>,\n\t\t\t\t\t\t\t{ size: null }\n\t\t\t\t\t\t)\n\t\t\t\t\t: null}\n\t\t\t</span>\n\t\t</React.Fragment>\n\t);\n};\n\nFileFigure.displayName = FILES_FIGURE;\n\nexport default FileFigure;\n"],"mappings":"yNA6CA,IAAM,GAAc,CACnB,YAAY,GACZ,gBAAgB,CAAC,EACjB,QACA,SAAS,CAAC,EACV,UAEI,GAEF,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,IAAW,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,KAAK,SACL,QAAQ,OACR,cAAe,CAAE,MAAO,EAAc,OAAQ,EAC9C,MAAO,CAAE,OAAQ,GAAI,CACrB,CAAA,CACc,CAAA,CAAA,EAGd,GAEF,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,IAAW,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,IAAK,EAAc,OAAS,EAAO,MAAO,IAAK,CAAQ,CAAA,CAC7C,CAAA,CAAA,GAIjB,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,EAAc,IAAW,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,UAAU,sCACV,MAAO,EAAO,MAEb,SAAA,EAEC,EAAA,QAAM,aACL,EAGA,CAAE,KAAM,IAAK,CACd,EACC,IACE,CAAA,CACS,CAAA,CAAA,EAIlB,EAAW,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs"),r=require("../../utilities/generate-id.cjs"),i=require("../../utilities/hooks/use-controllable-state.cjs"),a=require("../popover/index.cjs"),o=require("./private/error-id-context.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u={editFilter:`Edit filter:`,editFilterHeading:`Choose filter criteria`},d=({align:e=`left`,assistiveText:t,children:d,className:f,isError:p=!1,id:m,isLocked:h=!1,isNew:g=!1,isPermanent:_=!1,onChange:v,onRemove:y,onClick:b,popover:x,predicate:S=`New Filter`,property:C})=>{let w=(0,s.useMemo)(()=>r.default(),[]),T=m||w,E=(0,s.useContext)(o.default),D=p?E:void 0,O=x?.props,[k,A]=i.useControllableState(O?.isOpen,O?.defaultIsOpen??!1),j=(0,s.useMemo)(()=>({...u,...t,removeFilter:t?.removeFilter||`Remove Filter: ${C} ${S}`}),[t,C,S]),M=(0,s.useCallback)(()=>{A(!0),b?.()},[b,A]),N=(0,s.useCallback)(()=>{A(!1)},[A]),P=(0,s.useCallback)(e=>{A(!1),v?.(e,{id:T})},[v,T]),F=(0,s.useCallback)(e=>{y?.(e,{id:T})},[y,T]),I=(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h4`,{className:`slds-assistive-text`,id:`${T}-popover-heading`,children:j.editFilterHeading}),d,(0,l.jsx)(`div`,{className:`slds-m-top_small slds-text-align_right`,children:(0,l.jsx)(n.default,{className:`slds-col_bump-left`,label:`Done`,onClick:P})})]}),L={ariaLabelledby:`${T}-popover-heading`,align:e,body:I,heading:``,id:T,offset:e===`right`?`0px -35px`:void 0,onClose:N,onRequestClose:N,position:`overflowBoundaryElement`,className:`slds-grow`,...x?.props||{},isOpen:k,children:void 0},R=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`slds-assistive-text`,children:j.editFilter}),C?(0,l.jsx)(`span`,{className:`slds-show slds-text-body_small`,children:C}):null,(0,l.jsx)(`span`,{className:`slds-show`,children:S})]});return(0,l.jsxs)(`div`,{className:(0,c.default)(`slds-filters__item`,`slds-grid`,`slds-grid_vertical-align-center`,{"slds-is-locked":h,"slds-is-new":g,"slds-has-error":p},f),children:[!h&&(d||x)?(0,l.jsx)(a.default,{...L,silenceDeprecatedPropertyWarning:!0,children:(0,l.jsx)(`button`,{className:`slds-button_reset slds-grow slds-has-blur-focus`,onClick:M,"aria-describedby":D,type:`button`,children:R})}):(0,l.jsxs)(`button`,{"aria-describedby":D,className:`slds-button_reset slds-grow slds-has-blur-focus`,disabled:!0,type:`button`,children:[(0,l.jsx)(`span`,{className:`slds-show slds-text-body_small`,children:C}),(0,l.jsx)(`span`,{className:`slds-show`,children:S})]}),!_&&!h&&(0,l.jsx)(n.default,{assistiveText:{icon:j.removeFilter},hint:!0,iconCategory:`utility`,iconName:`delete`,iconSize:`small`,iconVariant:`bare`,onClick:F,title:j.removeFilter,variant:`icon`})]})};d.displayName=t.FILTER,exports.default=d;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs"),r=require("../../utilities/generate-id.cjs"),i=require("../../utilities/hooks/use-controllable-state.cjs"),a=require("../popover/index.cjs"),o=require("./private/error-id-context.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u={editFilter:`Edit filter:`,editFilterHeading:`Choose filter criteria`},d=({align:e=`left`,assistiveText:t,children:d,className:f,isError:p=!1,id:m,isLocked:h=!1,isNew:g=!1,isPermanent:_=!1,onChange:v,onRemove:y,onClick:b,popover:x,predicate:S=`New Filter`,property:C})=>{let w=(0,s.useMemo)(()=>r.default(),[]),T=m||w,E=(0,s.useContext)(o.default),D=p?E:void 0,O=x?.props,[k,A]=i.useControllableState(O?.isOpen,O?.defaultIsOpen??!1),j=(0,s.useMemo)(()=>({...u,...t,removeFilter:t?.removeFilter||`Remove Filter: ${C} ${S}`}),[t,C,S]),M=(0,s.useCallback)(()=>{A(!0),b?.()},[b,A]),N=(0,s.useCallback)(()=>{A(!1)},[A]),P=(0,s.useCallback)(e=>{A(!1),v?.(e,{id:T})},[v,T,A]),F=(0,s.useCallback)(e=>{y?.(e,{id:T})},[y,T]),I=(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h4`,{className:`slds-assistive-text`,id:`${T}-popover-heading`,children:j.editFilterHeading}),d,(0,l.jsx)(`div`,{className:`slds-m-top_small slds-text-align_right`,children:(0,l.jsx)(n.default,{className:`slds-col_bump-left`,label:`Done`,onClick:P})})]}),L={ariaLabelledby:`${T}-popover-heading`,align:e,body:I,heading:``,id:T,offset:e===`right`?`0px -35px`:void 0,onClose:N,onRequestClose:N,position:`overflowBoundaryElement`,className:`slds-grow`,...x?.props||{},isOpen:k,children:void 0},R=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`slds-assistive-text`,children:j.editFilter}),C?(0,l.jsx)(`span`,{className:`slds-show slds-text-body_small`,children:C}):null,(0,l.jsx)(`span`,{className:`slds-show`,children:S})]});return(0,l.jsxs)(`div`,{className:(0,c.default)(`slds-filters__item`,`slds-grid`,`slds-grid_vertical-align-center`,{"slds-is-locked":h,"slds-is-new":g,"slds-has-error":p},f),children:[!h&&(d||x)?(0,l.jsx)(a.default,{...L,silenceDeprecatedPropertyWarning:!0,children:(0,l.jsx)(`button`,{className:`slds-button_reset slds-grow slds-has-blur-focus`,onClick:M,"aria-describedby":D,type:`button`,children:R})}):(0,l.jsxs)(`button`,{"aria-describedby":D,className:`slds-button_reset slds-grow slds-has-blur-focus`,disabled:!0,type:`button`,children:[(0,l.jsx)(`span`,{className:`slds-show slds-text-body_small`,children:C}),(0,l.jsx)(`span`,{className:`slds-show`,children:S})]}),!_&&!h&&(0,l.jsx)(n.default,{assistiveText:{icon:j.removeFilter},hint:!0,iconCategory:`utility`,iconName:`delete`,iconSize:`small`,iconVariant:`bare`,onClick:F,title:j.removeFilter,variant:`icon`})]})};d.displayName=t.FILTER,exports.default=d;
2
2
  //# sourceMappingURL=filter.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.cjs","names":[],"sources":["../../../../components/filter/filter.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, { useCallback, useContext, useMemo } from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Popover from '../popover';\n\nimport { FILTER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { useControllableState } from '../../utilities/hooks';\nimport FilterErrorIdContext from './private/error-id-context';\n\nimport {\n\tFilterAssistiveText,\n\tFilterChangeHandler,\n\tFilterRemoveHandler,\n} from './types';\n\nexport interface FilterProps {\n\t/** Aligns the popover with the respective side of the trigger */\n\talign?: 'left' | 'right';\n\t/** Assistive text for accessibility */\n\tassistiveText?: FilterAssistiveText;\n\t/** Contents of popover - dropdowns and inputs that set filter criteria */\n\tchildren?: React.ReactNode;\n\t/** Custom CSS classes for slds-filters__item node */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Error message for a Filter inside a `PanelFilterList`. The list shows it below the\n\t * filter and sets `isError`. A standalone Filter doesn't render it.\n\t */\n\terrorLabel?: string;\n\t/**\n\t * Applies error state styling. Inside a `PanelFilterList` with `errorLabel`, the filter is\n\t * also described by the error message.\n\t */\n\tisError?: boolean;\n\t/** Unique ID for keyboard navigation and ARIA support */\n\tid?: string;\n\t/** If true, the filter will not display an editing popover when clicked */\n\tisLocked?: boolean;\n\t/** Applies new filter styling */\n\tisNew?: boolean;\n\t/** If true, the filter will not include a remove button */\n\tisPermanent?: boolean;\n\t/** Callback when Done within the Popover is clicked */\n\tonChange?: FilterChangeHandler;\n\t/** Callback when \"Remove Filter\" button is clicked */\n\tonRemove?: FilterRemoveHandler;\n\t/** Callback when Filter is clicked */\n\tonClick?: () => void;\n\t/** Custom Popover component with overridable props */\n\tpopover?: React.ReactElement;\n\t/** The filter predicate (e.g., \"is PURPLE\") */\n\tpredicate?: React.ReactNode;\n\t/** The filter property (e.g., \"Hair Color\") */\n\tproperty?: React.ReactNode;\n}\n\nconst defaultAssistiveText: FilterAssistiveText = {\n\teditFilter: 'Edit filter:',\n\teditFilterHeading: 'Choose filter criteria',\n};\n\n/**\n * A Filter is a popover with custom trigger. It can be used by Panel Filtering.\n * Menus within a Filter Popover will need to not have \"portal mounts\" and be inline.\n */\nconst Filter: React.FC<FilterProps> = ({\n\talign = 'left',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tclassName,\n\tisError = false,\n\tid: idProp,\n\tisLocked = false,\n\tisNew = false,\n\tisPermanent = false,\n\tonChange,\n\tonRemove,\n\tonClick,\n\tpopover,\n\tpredicate = 'New Filter',\n\tproperty,\n}) => {\n\t// Generate stable ID\n\tconst generatedId = useMemo(() => generateId(), []);\n\tconst id = idProp || generatedId;\n\t// Only describe the filter by an error element that is rendered\n\tconst errorId = useContext(FilterErrorIdContext);\n\tconst errorDescribedBy = isError ? errorId : undefined;\n\n\t// Popover state: controlled when the custom popover sets `isOpen`, otherwise internal and seeded\n\t// from its `defaultIsOpen`\n\tconst popoverOpenProps = popover?.props as\n\t\t{ isOpen?: boolean; defaultIsOpen?: boolean } | undefined;\n\tconst [popoverIsOpen, setPopoverIsOpen] = useControllableState(\n\t\tpopoverOpenProps?.isOpen,\n\t\tpopoverOpenProps?.defaultIsOpen ?? false\n\t);\n\n\t// Merge assistive text with defaults\n\tconst assistiveText = useMemo<FilterAssistiveText>(\n\t\t() => ({\n\t\t\t...defaultAssistiveText,\n\t\t\t...assistiveTextProp,\n\t\t\tremoveFilter:\n\t\t\t\tassistiveTextProp?.removeFilter ||\n\t\t\t\t`Remove Filter: ${property} ${predicate}`,\n\t\t}),\n\t\t[assistiveTextProp, property, predicate]\n\t);\n\n\t// Handle filter click\n\tconst handleFilterClick = useCallback(() => {\n\t\tsetPopoverIsOpen(true);\n\t\tonClick?.();\n\t}, [onClick, setPopoverIsOpen]);\n\n\t// Handle popover close\n\tconst handleClose = useCallback(() => {\n\t\tsetPopoverIsOpen(false);\n\t}, [setPopoverIsOpen]);\n\n\t// Handle change (Done button clicked)\n\tconst handleChange = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tsetPopoverIsOpen(false);\n\t\t\tonChange?.(event, { id });\n\t\t},\n\t\t[onChange, id]\n\t);\n\n\t// Handle remove\n\tconst handleRemove = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonRemove?.(event, { id });\n\t\t},\n\t\t[onRemove, id]\n\t);\n\n\t// Build popover body\n\tconst popoverBody = (\n\t\t<div>\n\t\t\t<h4 className=\"slds-assistive-text\" id={`${id}-popover-heading`}>\n\t\t\t\t{assistiveText.editFilterHeading}\n\t\t\t</h4>\n\t\t\t{children}\n\t\t\t<div className=\"slds-m-top_small slds-text-align_right\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\tlabel=\"Done\"\n\t\t\t\t\tonClick={handleChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\t// Build popover props\n\tconst popoverProps = {\n\t\tariaLabelledby: `${id}-popover-heading`,\n\t\talign,\n\t\tbody: popoverBody,\n\t\theading: '',\n\t\tid,\n\t\toffset: align === 'right' ? '0px -35px' : undefined,\n\t\tonClose: handleClose,\n\t\tonRequestClose: handleClose,\n\t\tposition: 'overflowBoundaryElement' as const,\n\t\tclassName: 'slds-grow',\n\t\t// Merge with custom popover props if provided\n\t\t...(popover?.props || {}),\n\t\tisOpen: popoverIsOpen,\n\t\t// Remove children from merged props\n\t\tchildren: undefined,\n\t};\n\n\t// Trigger button content\n\tconst triggerContent = (\n\t\t<>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.editFilter}</span>\n\t\t\t{property ? (\n\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t) : null}\n\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-filters__item',\n\t\t\t\t'slds-grid',\n\t\t\t\t'slds-grid_vertical-align-center',\n\t\t\t\t{\n\t\t\t\t\t'slds-is-locked': isLocked,\n\t\t\t\t\t'slds-is-new': isNew,\n\t\t\t\t\t'slds-has-error': isError,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{!isLocked && (children || popover) ? (\n\t\t\t\t// @ts-expect-error - Popover props are complex with overrides\n\t\t\t\t<Popover {...popoverProps} silenceDeprecatedPropertyWarning>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\t\tonClick={handleFilterClick}\n\t\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{triggerContent}\n\t\t\t\t\t</button>\n\t\t\t\t</Popover>\n\t\t\t) : (\n\t\t\t\t<button\n\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\tdisabled\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t\t\t</button>\n\t\t\t)}\n\t\t\t{!isPermanent && !isLocked && (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: assistiveText.removeFilter }}\n\t\t\t\t\thint\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"delete\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\ticonVariant=\"bare\"\n\t\t\t\t\tonClick={handleRemove}\n\t\t\t\t\ttitle={assistiveText.removeFilter}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nFilter.displayName = FILTER;\n\nexport default Filter;\n"],"mappings":"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"}
1
+ {"version":3,"file":"filter.cjs","names":[],"sources":["../../../../components/filter/filter.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, { useCallback, useContext, useMemo } from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Popover from '../popover';\n\nimport { FILTER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { useControllableState } from '../../utilities/hooks';\nimport FilterErrorIdContext from './private/error-id-context';\n\nimport {\n\tFilterAssistiveText,\n\tFilterChangeHandler,\n\tFilterRemoveHandler,\n} from './types';\n\nexport interface FilterProps {\n\t/** Aligns the popover with the respective side of the trigger */\n\talign?: 'left' | 'right';\n\t/** Assistive text for accessibility */\n\tassistiveText?: FilterAssistiveText;\n\t/** Contents of popover - dropdowns and inputs that set filter criteria */\n\tchildren?: React.ReactNode;\n\t/** Custom CSS classes for slds-filters__item node */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Error message for a Filter inside a `PanelFilterList`. The list shows it below the\n\t * filter and sets `isError`. A standalone Filter doesn't render it.\n\t */\n\terrorLabel?: string;\n\t/**\n\t * Applies error state styling. Inside a `PanelFilterList` with `errorLabel`, the filter is\n\t * also described by the error message.\n\t */\n\tisError?: boolean;\n\t/** Unique ID for keyboard navigation and ARIA support */\n\tid?: string;\n\t/** If true, the filter will not display an editing popover when clicked */\n\tisLocked?: boolean;\n\t/** Applies new filter styling */\n\tisNew?: boolean;\n\t/** If true, the filter will not include a remove button */\n\tisPermanent?: boolean;\n\t/** Callback when Done within the Popover is clicked */\n\tonChange?: FilterChangeHandler;\n\t/** Callback when \"Remove Filter\" button is clicked */\n\tonRemove?: FilterRemoveHandler;\n\t/** Callback when Filter is clicked */\n\tonClick?: () => void;\n\t/** Custom Popover component with overridable props */\n\tpopover?: React.ReactElement;\n\t/** The filter predicate (e.g., \"is PURPLE\") */\n\tpredicate?: React.ReactNode;\n\t/** The filter property (e.g., \"Hair Color\") */\n\tproperty?: React.ReactNode;\n}\n\nconst defaultAssistiveText: FilterAssistiveText = {\n\teditFilter: 'Edit filter:',\n\teditFilterHeading: 'Choose filter criteria',\n};\n\n/**\n * A Filter is a popover with custom trigger. It can be used by Panel Filtering.\n * Menus within a Filter Popover will need to not have \"portal mounts\" and be inline.\n */\nconst Filter: React.FC<FilterProps> = ({\n\talign = 'left',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tclassName,\n\tisError = false,\n\tid: idProp,\n\tisLocked = false,\n\tisNew = false,\n\tisPermanent = false,\n\tonChange,\n\tonRemove,\n\tonClick,\n\tpopover,\n\tpredicate = 'New Filter',\n\tproperty,\n}) => {\n\t// Generate stable ID\n\tconst generatedId = useMemo(() => generateId(), []);\n\tconst id = idProp || generatedId;\n\t// Only describe the filter by an error element that is rendered\n\tconst errorId = useContext(FilterErrorIdContext);\n\tconst errorDescribedBy = isError ? errorId : undefined;\n\n\t// Popover state: controlled when the custom popover sets `isOpen`, otherwise internal and seeded\n\t// from its `defaultIsOpen`\n\tconst popoverOpenProps = popover?.props as\n\t\t{ isOpen?: boolean; defaultIsOpen?: boolean } | undefined;\n\tconst [popoverIsOpen, setPopoverIsOpen] = useControllableState(\n\t\tpopoverOpenProps?.isOpen,\n\t\tpopoverOpenProps?.defaultIsOpen ?? false\n\t);\n\n\t// Merge assistive text with defaults\n\tconst assistiveText = useMemo<FilterAssistiveText>(\n\t\t() => ({\n\t\t\t...defaultAssistiveText,\n\t\t\t...assistiveTextProp,\n\t\t\tremoveFilter:\n\t\t\t\tassistiveTextProp?.removeFilter ||\n\t\t\t\t`Remove Filter: ${property} ${predicate}`,\n\t\t}),\n\t\t[assistiveTextProp, property, predicate]\n\t);\n\n\t// Handle filter click\n\tconst handleFilterClick = useCallback(() => {\n\t\tsetPopoverIsOpen(true);\n\t\tonClick?.();\n\t}, [onClick, setPopoverIsOpen]);\n\n\t// Handle popover close\n\tconst handleClose = useCallback(() => {\n\t\tsetPopoverIsOpen(false);\n\t}, [setPopoverIsOpen]);\n\n\t// Handle change (Done button clicked)\n\tconst handleChange = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tsetPopoverIsOpen(false);\n\t\t\tonChange?.(event, { id });\n\t\t},\n\t\t[onChange, id, setPopoverIsOpen]\n\t);\n\n\t// Handle remove\n\tconst handleRemove = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonRemove?.(event, { id });\n\t\t},\n\t\t[onRemove, id]\n\t);\n\n\t// Build popover body\n\tconst popoverBody = (\n\t\t<div>\n\t\t\t<h4 className=\"slds-assistive-text\" id={`${id}-popover-heading`}>\n\t\t\t\t{assistiveText.editFilterHeading}\n\t\t\t</h4>\n\t\t\t{children}\n\t\t\t<div className=\"slds-m-top_small slds-text-align_right\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\tlabel=\"Done\"\n\t\t\t\t\tonClick={handleChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\t// Build popover props\n\tconst popoverProps = {\n\t\tariaLabelledby: `${id}-popover-heading`,\n\t\talign,\n\t\tbody: popoverBody,\n\t\theading: '',\n\t\tid,\n\t\toffset: align === 'right' ? '0px -35px' : undefined,\n\t\tonClose: handleClose,\n\t\tonRequestClose: handleClose,\n\t\tposition: 'overflowBoundaryElement' as const,\n\t\tclassName: 'slds-grow',\n\t\t// Merge with custom popover props if provided\n\t\t...(popover?.props || {}),\n\t\tisOpen: popoverIsOpen,\n\t\t// Remove children from merged props\n\t\tchildren: undefined,\n\t};\n\n\t// Trigger button content\n\tconst triggerContent = (\n\t\t<>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.editFilter}</span>\n\t\t\t{property ? (\n\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t) : null}\n\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-filters__item',\n\t\t\t\t'slds-grid',\n\t\t\t\t'slds-grid_vertical-align-center',\n\t\t\t\t{\n\t\t\t\t\t'slds-is-locked': isLocked,\n\t\t\t\t\t'slds-is-new': isNew,\n\t\t\t\t\t'slds-has-error': isError,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{!isLocked && (children || popover) ? (\n\t\t\t\t// @ts-expect-error - Popover props are complex with overrides\n\t\t\t\t<Popover {...popoverProps} silenceDeprecatedPropertyWarning>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\t\tonClick={handleFilterClick}\n\t\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{triggerContent}\n\t\t\t\t\t</button>\n\t\t\t\t</Popover>\n\t\t\t) : (\n\t\t\t\t<button\n\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\tdisabled\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t\t\t</button>\n\t\t\t)}\n\t\t\t{!isPermanent && !isLocked && (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: assistiveText.removeFilter }}\n\t\t\t\t\thint\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"delete\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\ticonVariant=\"bare\"\n\t\t\t\t\tonClick={handleRemove}\n\t\t\t\t\ttitle={assistiveText.removeFilter}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nFilter.displayName = FILTER;\n\nexport default Filter;\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs");var n=function(){};process.env.NODE_ENV!==`production`&&(n=function(n,r,i){if(typeof r.assistiveText==`string`){let a=t.default(i);e.default(n,r.assistiveText,`assistiveText`,`\`assistiveText\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \`assistiveText.label\` instead. ${a(`assistiveText`)}`)}});var r=n;exports.default=r;
1
+ const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/deprecated-property.cjs");var r=function(){};process.env.NODE_ENV!==`production`&&(r=function(r,i,a){if(typeof i.assistiveText==`string`){let n=t.default(a);e.default(r,i.assistiveText,`assistiveText`,`\`assistiveText\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \`assistiveText.label\` instead. ${n(`assistiveText`)}`)}n.default(r,i.productTheme,`productTheme`,void 0,"It hard-codes legacy product brand colors that SLDS 2 themes don't define, and is removed before 11.0.0. Set the background color yourself with `style` or `className`: `<Icon style={{ backgroundColor: '#00857d' }} />`.")});var i=r;exports.default=i;
2
2
  //# sourceMappingURL=check-props.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/icon/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport 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\tif (typeof props.assistiveText === 'string') {\n\t\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText,\n\t\t\t\t'assistiveText',\n\t\t\t\t`\\`assistiveText\\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \\`assistiveText.label\\` instead. ${createDocUrl(\n\t\t\t\t\t'assistiveText'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"kHAOA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,GAAI,OAAO,EAAM,eAAkB,SAAU,CAC5C,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,EAAM,cACN,gBACA,mKAAmK,EAClK,eACD,GACD,CACD,CACD,GAGD,IAAA,EAAe"}
1
+ {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/icon/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport 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\tif (typeof props.assistiveText === 'string') {\n\t\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText,\n\t\t\t\t'assistiveText',\n\t\t\t\t`\\`assistiveText\\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \\`assistiveText.label\\` instead. ${createDocUrl(\n\t\t\t\t\t'assistiveText'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.productTheme,\n\t\t\t'productTheme',\n\t\t\tundefined,\n\t\t\t\"It hard-codes legacy product brand colors that SLDS 2 themes don't define, and is removed before 11.0.0. Set the background color yourself with `style` or `className`: `<Icon style={{ backgroundColor: '#00857d' }} />`.\"\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"+KAQA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,GAAI,OAAO,EAAM,eAAkB,SAAU,CAC5C,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,EAAM,cACN,gBACA,mKAAmK,EAClK,eACD,GACD,CACD,CAEA,EAAA,QACC,EACA,EAAM,aACN,eACA,IAAA,GACA,4NACD,CACD,GAGD,IAAA,EAAe"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../utilities/utility-icon/index.cjs"),r=require("../../utilities/class-names.cjs"),i=require("../../utilities/product-tokens/icon-backgrounds.cjs"),a=require("./check-props.cjs"),o=require("./component.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l={assistiveText:{},category:`standard`,colorVariant:`default`,size:`medium`},u=({category:e=l.category,className:u,colorVariant:d=l.colorVariant,containerClassName:f,containerStyle:p,icon:m,inverse:h,name:g,path:_,size:v=l.size,title:y,productTheme:b,assistiveText:x=l.assistiveText,style:S})=>{let C=S;b&&i.default[b]&&(C={backgroundColor:i.default[b],...S}),(0,s.useEffect)(()=>{a.default(t.ICON,{assistiveText:x},o.default)},[x]);let w=typeof x==`object`?x?.label??l.assistiveText.label:void 0,T=g?g.replace(/_/g,`-`):``,E=r.default({"slds-icon_container":e!==`utility`,"slds-icon_container_circle":e===`action`,[`slds-icon-${e}-${T}`]:e!==`utility`&&e!==`doctype`&&!_},f);return(0,c.jsxs)(`span`,{className:E,style:p,title:y,children:[(0,c.jsx)(n.default,{"aria-hidden":!0,category:e,className:r.default(u,`slds-icon`,{"slds-icon_xx-small":v===`xx-small`,"slds-icon_x-small":v===`x-small`,"slds-icon_small":v===`small`,"slds-icon_large":v===`large`,"slds-icon-text-default":d==="default"&&e===`utility`?!h:h,"slds-icon-text-success":d===`success`,"slds-icon-text-warning":d===`warning`,"slds-icon-text-error":d===`error`,"slds-icon-text-light":d===`light`}),icon:m,name:g,path:_,style:C}),w?(0,c.jsx)(`span`,{className:`slds-assistive-text`,children:w}):null]})};u.displayName=t.ICON,exports.default=u;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../utilities/utility-icon/index.cjs"),r=require("../../utilities/class-names.cjs"),i=require("../../utilities/product-tokens/icon-backgrounds.cjs"),a=require("./check-props.cjs"),o=require("./component.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l={assistiveText:{},category:`standard`,colorVariant:`default`,size:`medium`},u=({category:e=l.category,className:u,colorVariant:d=l.colorVariant,containerClassName:f,containerStyle:p,icon:m,inverse:h,name:g,path:_,size:v=l.size,title:y,productTheme:b,assistiveText:x=l.assistiveText,style:S})=>{let C=S,w=b&&i.default[b];w&&(C={backgroundColor:w,...S}),(0,s.useEffect)(()=>{a.default(t.ICON,{assistiveText:x,productTheme:b},o.default)},[x,b]);let T=typeof x==`object`?x?.label??l.assistiveText.label:void 0,E=g?g.replace(/_/g,`-`):``,D=r.default({"slds-icon_container":e!==`utility`,"slds-icon_container_circle":e===`action`,[`slds-icon-${e}-${E}`]:e!==`utility`&&e!==`doctype`&&!_},f);return(0,c.jsxs)(`span`,{className:D,style:p,title:y,children:[(0,c.jsx)(n.default,{"aria-hidden":!0,category:e,className:r.default(u,`slds-icon`,{"slds-icon_xx-small":v===`xx-small`,"slds-icon_x-small":v===`x-small`,"slds-icon_small":v===`small`,"slds-icon_large":v===`large`,"slds-icon-text-default":d==="default"&&e===`utility`?!h:h,"slds-icon-text-success":d===`success`,"slds-icon-text-warning":d===`warning`,"slds-icon-text-error":d===`error`,"slds-icon-text-light":d===`light`}),icon:m,name:g,path:_,style:C}),T?(0,c.jsx)(`span`,{className:`slds-assistive-text`,children:T}):null]})};u.displayName=t.ICON,exports.default=u;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/icon/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useEffect, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport UtilityIcon, {\n\ttype InlineIconData,\n} from '../utilities/utility-icon/index';\nimport IconBackgrounds from '../../utilities/product-tokens/icon-backgrounds';\nimport { ICON } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Icon color variant types\n */\nexport type { IconCategory };\n\nexport type IconColorVariant =\n\t'base' | 'default' | 'error' | 'light' | 'warning' | 'success';\n\n/**\n * Icon size types\n */\nexport type IconSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Product theme types for icon backgrounds\n */\nexport type ProductTheme =\n\t| 'global-setup'\n\t| 'service-cloud'\n\t| 'industry-cloud'\n\t| 'sales-cloud'\n\t| 'commerce-cloud'\n\t| 'community-cloud'\n\t| 'marketing-cloud'\n\t| 'quip';\n\n/**\n * Props for the Icon component\n */\nexport interface IconProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: { label?: string };\n\t/** Icon category from SLDS */\n\tcategory?: IconCategory;\n\t/** CSS classes for the SVG element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Icon color variant */\n\tcolorVariant?: IconColorVariant;\n\t/** CSS classes for the container span */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Styles for the container span */\n\tcontainerStyle?: CSSProperties;\n\t/** Custom SVG icon data */\n\ticon?: InlineIconData;\n\t/** Invert colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Name of the icon */\n\tname?: string;\n\t/** Direct path to the icon sprite */\n\tpath?: string;\n\t/** Background theme color (only for standard category) */\n\tproductTheme?: ProductTheme;\n\t/** Size of the icon */\n\tsize?: IconSize;\n\t/** Custom styles for the SVG */\n\tstyle?: CSSProperties;\n\t/** HTML title attribute for the container */\n\ttitle?: string;\n}\n\nconst defaultProps: Required<\n\tPick<IconProps, 'assistiveText' | 'category' | 'colorVariant' | 'size'>\n> = {\n\tassistiveText: {},\n\tcategory: 'standard',\n\tcolorVariant: 'default',\n\tsize: 'medium',\n};\n\n/**\n * The Icon component is the Lightning Design System Icon component and should be used for naked icons.\n * For icons that are buttons, use the Button component with `variant='icon'`.\n */\nconst Icon = ({\n\tcategory = defaultProps.category,\n\tclassName,\n\tcolorVariant = defaultProps.colorVariant,\n\tcontainerClassName,\n\tcontainerStyle,\n\ticon,\n\tinverse,\n\tname,\n\tpath,\n\tsize = defaultProps.size,\n\ttitle,\n\tproductTheme,\n\tassistiveText = defaultProps.assistiveText,\n\tstyle,\n}: IconProps): React.ReactElement => {\n\tlet styleOverride = style;\n\tif (productTheme && IconBackgrounds[productTheme]) {\n\t\tstyleOverride = {\n\t\t\tbackgroundColor: IconBackgrounds[productTheme],\n\t\t\t...style,\n\t\t};\n\t}\n\n\tuseEffect(() => {\n\t\tcheckProps(ICON, { assistiveText }, componentDoc);\n\t}, [assistiveText]);\n\n\t// A string `assistiveText` was removed in v11; it is ignored and warns.\n\tconst mergedAssistiveText =\n\t\ttypeof assistiveText === 'object'\n\t\t\t? (assistiveText?.label ?? defaultProps.assistiveText.label)\n\t\t\t: undefined;\n\n\tconst kebabCaseName = name ? name.replace(/_/g, '-') : '';\n\n\tconst containerClasses = classNames(\n\t\t{\n\t\t\t'slds-icon_container': category !== 'utility',\n\t\t\t'slds-icon_container_circle': category === 'action',\n\t\t\t[`slds-icon-${category}-${kebabCaseName}`]:\n\t\t\t\tcategory !== 'utility' && category !== 'doctype' && !path,\n\t\t},\n\t\tcontainerClassName as string\n\t);\n\n\treturn (\n\t\t<span className={containerClasses} style={containerStyle} title={title}>\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden={true}\n\t\t\t\tcategory={category}\n\t\t\t\tclassName={\n\t\t\t\t\tclassNames(className, 'slds-icon', {\n\t\t\t\t\t\t'slds-icon_xx-small': size === 'xx-small',\n\t\t\t\t\t\t'slds-icon_x-small': size === 'x-small',\n\t\t\t\t\t\t'slds-icon_small': size === 'small',\n\t\t\t\t\t\t// medium intentionally not present\n\t\t\t\t\t\t'slds-icon_large': size === 'large',\n\t\t\t\t\t\t// Color logic for utility vs other categories\n\t\t\t\t\t\t'slds-icon-text-default':\n\t\t\t\t\t\t\tcolorVariant === 'default' && category === 'utility'\n\t\t\t\t\t\t\t\t? !inverse\n\t\t\t\t\t\t\t\t: inverse,\n\t\t\t\t\t\t'slds-icon-text-success': colorVariant === 'success',\n\t\t\t\t\t\t'slds-icon-text-warning': colorVariant === 'warning',\n\t\t\t\t\t\t'slds-icon-text-error': colorVariant === 'error',\n\t\t\t\t\t\t'slds-icon-text-light': colorVariant === 'light',\n\t\t\t\t\t}) as string\n\t\t\t\t}\n\t\t\t\ticon={icon}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\tstyle={styleOverride}\n\t\t\t/>\n\t\t\t{mergedAssistiveText ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{mergedAssistiveText}</span>\n\t\t\t) : null}\n\t\t</span>\n\t);\n};\n\nIcon.displayName = ICON;\n\nexport default Icon;\n"],"mappings":"weA0EA,IAAM,EAEF,CACH,cAAe,CAAC,EAChB,SAAU,WACV,aAAc,UACd,KAAM,QACP,EAMM,GAAQ,CACb,WAAW,EAAa,SACxB,YACA,eAAe,EAAa,aAC5B,qBACA,iBACA,OACA,UACA,OACA,OACA,OAAO,EAAa,KACpB,QACA,eACA,gBAAgB,EAAa,cAC7B,WACoC,CACpC,IAAI,EAAgB,EAChB,GAAgB,EAAA,QAAgB,KACnC,EAAgB,CACf,gBAAiB,EAAA,QAAgB,GACjC,GAAG,CACJ,IAGD,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QAAW,EAAA,KAAM,CAAE,eAAc,EAAG,EAAA,OAAY,CACjD,EAAG,CAAC,CAAa,CAAC,EAGlB,IAAM,EACL,OAAO,GAAkB,SACrB,GAAe,OAAS,EAAa,cAAc,MACpD,IAAA,GAEE,EAAgB,EAAO,EAAK,QAAQ,KAAM,GAAG,EAAI,GAEjD,EAAmB,EAAA,QACxB,CACC,sBAAuB,IAAa,UACpC,6BAA8B,IAAa,UAC1C,aAAa,EAAS,GAAG,KACzB,IAAa,WAAa,IAAa,WAAa,CAAC,CACvD,EACA,CACD,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAW,EAAkB,MAAO,EAAuB,QAAjE,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAa,GACH,WACV,UACC,EAAA,QAAW,EAAW,YAAa,CAClC,qBAAsB,IAAS,WAC/B,oBAAqB,IAAS,UAC9B,kBAAmB,IAAS,QAE5B,kBAAmB,IAAS,QAE5B,yBACC,IAAiB,WAAa,IAAa,UACxC,CAAC,EACD,EACJ,yBAA0B,IAAiB,UAC3C,yBAA0B,IAAiB,UAC3C,uBAAwB,IAAiB,QACzC,uBAAwB,IAAiB,OAC1C,CAAC,EAEI,OACA,OACA,OACN,MAAO,CACP,CAAA,EACA,GACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,CAA0B,CAAA,EAC9D,IACC,GAER,EAEA,EAAK,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/icon/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useEffect, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport UtilityIcon, {\n\ttype InlineIconData,\n} from '../utilities/utility-icon/index';\nimport IconBackgrounds from '../../utilities/product-tokens/icon-backgrounds';\nimport { ICON } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Icon color variant types\n */\nexport type { IconCategory };\n\nexport type IconColorVariant =\n\t'base' | 'default' | 'error' | 'light' | 'warning' | 'success';\n\n/**\n * Icon size types\n */\nexport type IconSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Product theme types for icon backgrounds\n * @deprecated Removed before 11.0.0. Set the background color with `style` or `className`.\n */\nexport type ProductTheme =\n\t| 'global-setup'\n\t| 'service-cloud'\n\t| 'industry-cloud'\n\t| 'sales-cloud'\n\t| 'commerce-cloud'\n\t| 'community-cloud'\n\t| 'marketing-cloud'\n\t| 'quip';\n\n/**\n * Props for the Icon component\n */\nexport interface IconProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: {\n\t\t/** Visually hidden label read in place of the icon. Leave unset for a decorative icon. */\n\t\tlabel?: string;\n\t};\n\t/** Icon category from SLDS */\n\tcategory?: IconCategory;\n\t/** CSS classes for the SVG element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Icon color variant */\n\tcolorVariant?: IconColorVariant;\n\t/** CSS classes for the container span */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Styles for the container span */\n\tcontainerStyle?: CSSProperties;\n\t/** Custom SVG icon data */\n\ticon?: InlineIconData;\n\t/** Invert colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Name of the icon */\n\tname?: string;\n\t/** Direct path to the icon sprite */\n\tpath?: string;\n\t/**\n\t * Background theme color (only for standard category)\n\t * @deprecated Removed before 11.0.0. These legacy product brand colors aren't\n\t * SLDS 2 theme values; set the background color yourself with `style` or\n\t * `className`, for example `style={{ backgroundColor: '#00857d' }}`.\n\t */\n\tproductTheme?: ProductTheme;\n\t/** Size of the icon */\n\tsize?: IconSize;\n\t/** Custom styles for the SVG */\n\tstyle?: CSSProperties;\n\t/** HTML title attribute for the container */\n\ttitle?: string;\n}\n\nconst defaultProps: Required<\n\tPick<IconProps, 'assistiveText' | 'category' | 'colorVariant' | 'size'>\n> = {\n\tassistiveText: {},\n\tcategory: 'standard',\n\tcolorVariant: 'default',\n\tsize: 'medium',\n};\n\n/**\n * The Icon component is the Lightning Design System Icon component and should be used for naked icons.\n * For icons that are buttons, use the Button component with `variant='icon'`.\n */\nconst Icon = ({\n\tcategory = defaultProps.category,\n\tclassName,\n\tcolorVariant = defaultProps.colorVariant,\n\tcontainerClassName,\n\tcontainerStyle,\n\ticon,\n\tinverse,\n\tname,\n\tpath,\n\tsize = defaultProps.size,\n\ttitle,\n\tproductTheme,\n\tassistiveText = defaultProps.assistiveText,\n\tstyle,\n}: IconProps): React.ReactElement => {\n\tlet styleOverride = style;\n\t// eslint-disable-next-line local/no-deprecated -- honors the deprecated `productTheme` prop until it is removed\n\tconst productBackground = productTheme && IconBackgrounds[productTheme];\n\tif (productBackground) {\n\t\tstyleOverride = {\n\t\t\tbackgroundColor: productBackground,\n\t\t\t...style,\n\t\t};\n\t}\n\n\tuseEffect(() => {\n\t\tcheckProps(ICON, { assistiveText, productTheme }, componentDoc);\n\t}, [assistiveText, productTheme]);\n\n\t// A string `assistiveText` was removed in v11; it is ignored and warns.\n\tconst mergedAssistiveText =\n\t\ttypeof assistiveText === 'object'\n\t\t\t? (assistiveText?.label ?? defaultProps.assistiveText.label)\n\t\t\t: undefined;\n\n\tconst kebabCaseName = name ? name.replace(/_/g, '-') : '';\n\n\tconst containerClasses = classNames(\n\t\t{\n\t\t\t'slds-icon_container': category !== 'utility',\n\t\t\t'slds-icon_container_circle': category === 'action',\n\t\t\t[`slds-icon-${category}-${kebabCaseName}`]:\n\t\t\t\tcategory !== 'utility' && category !== 'doctype' && !path,\n\t\t},\n\t\tcontainerClassName as string\n\t);\n\n\treturn (\n\t\t<span className={containerClasses} style={containerStyle} title={title}>\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden={true}\n\t\t\t\tcategory={category}\n\t\t\t\tclassName={\n\t\t\t\t\tclassNames(className, 'slds-icon', {\n\t\t\t\t\t\t'slds-icon_xx-small': size === 'xx-small',\n\t\t\t\t\t\t'slds-icon_x-small': size === 'x-small',\n\t\t\t\t\t\t'slds-icon_small': size === 'small',\n\t\t\t\t\t\t// medium intentionally not present\n\t\t\t\t\t\t'slds-icon_large': size === 'large',\n\t\t\t\t\t\t// Color logic for utility vs other categories\n\t\t\t\t\t\t'slds-icon-text-default':\n\t\t\t\t\t\t\tcolorVariant === 'default' && category === 'utility'\n\t\t\t\t\t\t\t\t? !inverse\n\t\t\t\t\t\t\t\t: inverse,\n\t\t\t\t\t\t'slds-icon-text-success': colorVariant === 'success',\n\t\t\t\t\t\t'slds-icon-text-warning': colorVariant === 'warning',\n\t\t\t\t\t\t'slds-icon-text-error': colorVariant === 'error',\n\t\t\t\t\t\t'slds-icon-text-light': colorVariant === 'light',\n\t\t\t\t\t}) as string\n\t\t\t\t}\n\t\t\t\ticon={icon}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\tstyle={styleOverride}\n\t\t\t/>\n\t\t\t{mergedAssistiveText ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{mergedAssistiveText}</span>\n\t\t\t) : null}\n\t\t</span>\n\t);\n};\n\nIcon.displayName = ICON;\n\nexport default Icon;\n"],"mappings":"weAmFA,IAAM,EAEF,CACH,cAAe,CAAC,EAChB,SAAU,WACV,aAAc,UACd,KAAM,QACP,EAMM,GAAQ,CACb,WAAW,EAAa,SACxB,YACA,eAAe,EAAa,aAC5B,qBACA,iBACA,OACA,UACA,OACA,OACA,OAAO,EAAa,KACpB,QACA,eACA,gBAAgB,EAAa,cAC7B,WACoC,CACpC,IAAI,EAAgB,EAEd,EAAoB,GAAgB,EAAA,QAAgB,GACtD,IACH,EAAgB,CACf,gBAAiB,EACjB,GAAG,CACJ,IAGD,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QAAW,EAAA,KAAM,CAAE,gBAAe,cAAa,EAAG,EAAA,OAAY,CAC/D,EAAG,CAAC,EAAe,CAAY,CAAC,EAGhC,IAAM,EACL,OAAO,GAAkB,SACrB,GAAe,OAAS,EAAa,cAAc,MACpD,IAAA,GAEE,EAAgB,EAAO,EAAK,QAAQ,KAAM,GAAG,EAAI,GAEjD,EAAmB,EAAA,QACxB,CACC,sBAAuB,IAAa,UACpC,6BAA8B,IAAa,UAC1C,aAAa,EAAS,GAAG,KACzB,IAAa,WAAa,IAAa,WAAa,CAAC,CACvD,EACA,CACD,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAW,EAAkB,MAAO,EAAuB,QAAjE,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAa,GACH,WACV,UACC,EAAA,QAAW,EAAW,YAAa,CAClC,qBAAsB,IAAS,WAC/B,oBAAqB,IAAS,UAC9B,kBAAmB,IAAS,QAE5B,kBAAmB,IAAS,QAE5B,yBACC,IAAiB,WAAa,IAAa,UACxC,CAAC,EACD,EACJ,yBAA0B,IAAiB,UAC3C,yBAA0B,IAAiB,UAC3C,uBAAwB,IAAiB,QACzC,uBAAwB,IAAiB,OAC1C,CAAC,EAEI,OACA,OACA,OACN,MAAO,CACP,CAAA,EACA,GACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBAAuB,SAAA,CAA0B,CAAA,EAC9D,IACC,GAER,EAEA,EAAK,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../../components/icon/input-icon/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// ### React\nimport React, { type ButtonHTMLAttributes, type MouseEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// A simple javascript utility for conditionally joining classNames together.\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\n// ## Children\nimport UtilityIcon from '../../utilities/utility-icon';\nimport type { UtilityIconProps } from '../../utilities/utility-icon';\nimport Button from '../../button';\nimport type { IconCategory } from '../../../types/common';\n\n// ## Constants\nimport { ICON_INPUT } from '../../../utilities/constants';\n\ninterface InputIconBaseProps {\n\t/**\n\t * Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)\n\t */\n\tcategory?: IconCategory;\n\t/**\n\t * This is only needed if an input contains two icons, the Input component handles this prop for you.\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.\n\t */\n\tname?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\tpath?: string;\n\t/**\n\t * Changes styles of the InputIcon.\n\t */\n\tvariant?: 'base' | 'combobox';\n}\n\n/** A clickable icon, rendered as an icon `Button`. */\nexport interface InputIconClickableProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<\n\t\t\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\t\t'children' | 'className' | 'onClick' | 'style' | 'title' | 'type'\n\t\t> {\n\t/** Assistive text for the icon button */\n\tassistiveText: { icon: string };\n\t/** This event fires when the icon is clicked. */\n\tonClick: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Receives the button node */\n\tbuttonRef?: (node: HTMLButtonElement | null) => void;\n\ttype?: 'button' | 'submit' | 'reset';\n}\n\n/** A decorative icon, rendered as a `UtilityIcon`. */\nexport interface InputIconDecorativeProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<UtilityIconProps, 'category' | 'name' | 'path' | 'onClick'> {\n\tonClick?: undefined;\n\t/** Tooltip text */\n\ttitle?: string;\n}\n\n/** Props for InputIcon: `onClick` selects between a button and a decorative icon. */\nexport type InputIconProps = InputIconClickableProps | InputIconDecorativeProps;\n\n/**\n * A wrapper for icons that will be rendered inside of an Input\n *\n * If the `onClick` function prop is provided, the `design-system-react/components/button` component is used.\n * If not, the icon will be an instance of `design-system-react/components/utilities/utility-icon`.\n * Checkout out the appropriate component to see what props can be passed along via the `{...props}` rest operator\n */\nconst InputIcon = ({\n\tcategory = 'utility',\n\tvariant = 'base',\n\ticonPosition,\n\tname,\n\tpath,\n\tonClick,\n\t...restProps\n}: InputIconProps): React.ReactElement => {\n\tconst rest = restProps as Record<string, unknown>;\n\t// SLDS 1 let clicks pass through a decorative icon to the input with\n\t// `.slds-input-has-icon .slds-input__icon:not(button)`; SLDS 2 dropped it.\n\tconst passThroughStyle = {\n\t\tpointerEvents: 'none' as const,\n\t\t...(rest.style as React.CSSProperties | undefined),\n\t};\n\n\tconst variants: Record<'combobox' | 'base', React.ReactElement> = {\n\t\tcombobox: (\n\t\t\t<span\n\t\t\t\tclassName=\"slds-icon_container slds-input__icon slds-input__icon_right\"\n\t\t\t\tstyle={{ pointerEvents: 'none' }}\n\t\t\t>\n\t\t\t\t<UtilityIcon\n\t\t\t\t\taria-hidden\n\t\t\t\t\tcategory={category}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-icon slds-icon_x-small slds-icon-text-default'\n\t\t\t\t\t)}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={path}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</span>\n\t\t),\n\t\tbase: (\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden\n\t\t\t\tcategory={category}\n\t\t\t\tclassName={classNames('slds-input__icon slds-icon-text-default', {\n\t\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t\t})}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={passThroughStyle}\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn isFunction(onClick) ? (\n\t\t<Button\n\t\t\tclassName={classNames('slds-input__icon', {\n\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t})}\n\t\t\ticonCategory={category}\n\t\t\ticonName={name}\n\t\t\ticonPath={path}\n\t\t\tonClick={onClick}\n\t\t\tvariant=\"icon\"\n\t\t\t{...rest}\n\t\t/>\n\t) : (\n\t\tvariants[variant]\n\t);\n};\n\nInputIcon.displayName = ICON_INPUT;\n\nexport default InputIcon;\n"],"mappings":"yWAmFA,IAAM,GAAa,CAClB,WAAW,UACX,UAAU,OACV,eACA,OACA,OACA,UACA,GAAG,KACsC,CACzC,IAAM,EAAO,EAGP,EAAmB,CACxB,cAAe,OACf,GAAI,EAAK,KACV,EAEM,EAA4D,CACjE,UACC,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,UAAU,8DACV,MAAO,CAAE,cAAe,MAAO,EAE/B,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACU,WACV,WAAA,EAAW,EAAA,QAAA,CACV,oDACD,EACM,OACA,OACN,GAAI,CACJ,CAAA,CACI,CAAA,EAEP,MACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACU,WACV,WAAA,EAAW,EAAA,QAAA,CAAW,0CAA2C,EAC/D,oBAAoB,KAAiB,CACvC,CAAC,EACK,OACA,OACN,GAAI,EACJ,MAAO,CACP,CAAA,CAEH,EAEA,OAAA,EAAO,EAAA,QAAA,CAAW,CAAO,GACxB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,mBAAoB,EACxC,oBAAoB,KAAiB,CACvC,CAAC,EACD,aAAc,EACd,SAAU,EACV,SAAU,EACD,UACT,QAAQ,OACR,GAAI,CACJ,CAAA,EAED,EAAS,EAEX,EAEA,EAAU,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../../components/icon/input-icon/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// ### React\nimport React, { type ButtonHTMLAttributes, type MouseEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// A simple javascript utility for conditionally joining classNames together.\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\n// ## Children\nimport UtilityIcon from '../../utilities/utility-icon';\nimport type { UtilityIconProps } from '../../utilities/utility-icon';\nimport Button from '../../button';\nimport type { IconCategory } from '../../../types/common';\n\n// ## Constants\nimport { ICON_INPUT } from '../../../utilities/constants';\n\ninterface InputIconBaseProps {\n\t/**\n\t * Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)\n\t */\n\tcategory?: IconCategory;\n\t/**\n\t * This is only needed if an input contains two icons, the Input component handles this prop for you.\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.\n\t */\n\tname?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\tpath?: string;\n\t/**\n\t * Changes styles of the InputIcon.\n\t */\n\tvariant?: 'base' | 'combobox';\n}\n\n/** A clickable icon, rendered as an icon `Button`. */\nexport interface InputIconClickableProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<\n\t\t\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\t\t'children' | 'className' | 'onClick' | 'style' | 'title' | 'type'\n\t\t> {\n\t/** Assistive text for the icon button */\n\tassistiveText: {\n\t\t/** Label of the icon button. */\n\t\ticon: string;\n\t};\n\t/** This event fires when the icon is clicked. */\n\tonClick: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Receives the button node */\n\tbuttonRef?: (node: HTMLButtonElement | null) => void;\n\t/** The button's `type`. */\n\ttype?: 'button' | 'submit' | 'reset';\n}\n\n/** A decorative icon, rendered as a `UtilityIcon`. */\nexport interface InputIconDecorativeProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<UtilityIconProps, 'category' | 'name' | 'path' | 'onClick'> {\n\t/** Unset for a decorative icon; pass `onClick` for a button. */\n\tonClick?: undefined;\n\t/** Tooltip text */\n\ttitle?: string;\n}\n\n/** Props for InputIcon: `onClick` selects between a button and a decorative icon. */\nexport type InputIconProps = InputIconClickableProps | InputIconDecorativeProps;\n\n/**\n * A wrapper for icons that will be rendered inside of an Input\n *\n * If the `onClick` function prop is provided, the `design-system-react/components/button` component is used.\n * If not, the icon will be an instance of `design-system-react/components/utilities/utility-icon`.\n * Checkout out the appropriate component to see what props can be passed along via the `{...props}` rest operator\n */\nconst InputIcon = ({\n\tcategory = 'utility',\n\tvariant = 'base',\n\ticonPosition,\n\tname,\n\tpath,\n\tonClick,\n\t...restProps\n}: InputIconProps): React.ReactElement => {\n\tconst rest = restProps as Record<string, unknown>;\n\t// SLDS 1 let clicks pass through a decorative icon to the input with\n\t// `.slds-input-has-icon .slds-input__icon:not(button)`; SLDS 2 dropped it.\n\tconst passThroughStyle = {\n\t\tpointerEvents: 'none' as const,\n\t\t...(rest.style as React.CSSProperties | undefined),\n\t};\n\n\tconst variants: Record<'combobox' | 'base', React.ReactElement> = {\n\t\tcombobox: (\n\t\t\t<span\n\t\t\t\tclassName=\"slds-icon_container slds-input__icon slds-input__icon_right\"\n\t\t\t\tstyle={{ pointerEvents: 'none' }}\n\t\t\t>\n\t\t\t\t<UtilityIcon\n\t\t\t\t\taria-hidden\n\t\t\t\t\tcategory={category}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-icon slds-icon_x-small slds-icon-text-default'\n\t\t\t\t\t)}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={path}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</span>\n\t\t),\n\t\tbase: (\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden\n\t\t\t\tcategory={category}\n\t\t\t\tclassName={classNames('slds-input__icon slds-icon-text-default', {\n\t\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t\t})}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={passThroughStyle}\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn isFunction(onClick) ? (\n\t\t<Button\n\t\t\tclassName={classNames('slds-input__icon', {\n\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t})}\n\t\t\ticonCategory={category}\n\t\t\ticonName={name}\n\t\t\ticonPath={path}\n\t\t\tonClick={onClick}\n\t\t\tvariant=\"icon\"\n\t\t\t{...rest}\n\t\t/>\n\t) : (\n\t\tvariants[variant]\n\t);\n};\n\nInputIcon.displayName = ICON_INPUT;\n\nexport default InputIcon;\n"],"mappings":"yWAwFA,IAAM,GAAa,CAClB,WAAW,UACX,UAAU,OACV,eACA,OACA,OACA,UACA,GAAG,KACsC,CACzC,IAAM,EAAO,EAGP,EAAmB,CACxB,cAAe,OACf,GAAI,EAAK,KACV,EAEM,EAA4D,CACjE,UACC,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,UAAU,8DACV,MAAO,CAAE,cAAe,MAAO,EAE/B,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACU,WACV,WAAA,EAAW,EAAA,QAAA,CACV,oDACD,EACM,OACA,OACN,GAAI,CACJ,CAAA,CACI,CAAA,EAEP,MACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACU,WACV,WAAA,EAAW,EAAA,QAAA,CAAW,0CAA2C,EAC/D,oBAAoB,KAAiB,CACvC,CAAC,EACK,OACA,OACN,GAAI,EACJ,MAAO,CACP,CAAA,CAEH,EAEA,OAAA,EAAO,EAAA,QAAA,CAAW,CAAO,GACxB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,mBAAoB,EACxC,oBAAoB,KAAiB,CACvC,CAAC,EACD,aAAc,EACd,SAAU,EACV,SAAU,EACD,UACT,QAAQ,OACR,GAAI,CACJ,CAAA,EAED,EAAS,EAEX,EAEA,EAAU,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/icon-settings/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, { createContext, type ReactNode } from 'react';\nimport { ICON_SETTINGS } from '../../utilities/constants';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Context value shape for IconSettings\n */\nexport interface IconSettingsContextValue {\n\t/** Path to the root icon folder */\n\ticonPath?: string;\n\t/** Function to generate custom icon paths */\n\tonRequestIconPath?: (data: { category: IconCategory; name: string }) => string;\n\t/** Path to the action sprite */\n\tactionSprite?: string;\n\t/** Path to the custom sprite */\n\tcustomSprite?: string;\n\t/** Path to the doctype sprite */\n\tdoctypeSprite?: string;\n\t/** Path to the standard sprite */\n\tstandardSprite?: string;\n\t/** Path to the utility sprite */\n\tutilitySprite?: string;\n}\n\n/**\n * Props for the IconSettings component\n */\nexport interface IconSettingsProps extends IconSettingsContextValue {\n\t/** Child components that will have access to icon settings */\n\tchildren: ReactNode;\n}\n\n/**\n * Context for sharing icon settings across the component tree\n */\nexport const IconSettingsContext = createContext<IconSettingsContextValue>({});\n\n/**\n * The Icon Settings component allows for the path to the icons to be specified in all child\n * components and is recommended to be used at the root of the application.\n *\n * **Individual sprites**\n * If you are using webpack it is advised to use the sprite properties\n * {actionSprite, standardSprite...} to specify the individual sprite paths so that webpack can\n * easily re-write the paths.\n *\n * ```tsx\n * import actionSprite from '......';\n *\n * <IconSettings actionSprite={actionSprite} ......>\n * <App />\n * </IconSettings>\n * ```\n *\n * **Root icon path**\n * Otherwise use the iconPath to specify the root path to where the icon files will be located\n * in your application such as `/assets/icons`.\n */\nconst IconSettings = ({\n\ticonPath,\n\tonRequestIconPath,\n\tactionSprite,\n\tcustomSprite,\n\tdoctypeSprite,\n\tstandardSprite,\n\tutilitySprite,\n\tchildren,\n}: IconSettingsProps): React.ReactElement => {\n\tconst contextValue: IconSettingsContextValue = {\n\t\ticonPath,\n\t\tonRequestIconPath,\n\t\tactionSprite,\n\t\tcustomSprite,\n\t\tdoctypeSprite,\n\t\tstandardSprite,\n\t\tutilitySprite,\n\t};\n\n\treturn (\n\t\t<IconSettingsContext.Provider value={contextValue}>\n\t\t\t{children}\n\t\t</IconSettingsContext.Provider>\n\t);\n};\n\nIconSettings.displayName = ICON_SETTINGS;\n\nexport default IconSettings;\n\n"],"mappings":"6QAsCA,IAAa,GAAA,EAAsB,EAAA,cAAA,CAAwC,CAAC,CAAC,EAuBvE,GAAgB,CACrB,WACA,oBACA,eACA,eACA,gBACA,iBACA,gBACA,cAC4C,CAC5C,IAAM,EAAyC,CAC9C,WACA,oBACA,eACA,eACA,gBACA,iBACA,eACD,EAEA,OACC,EAAA,EAAA,IAAA,CAAC,EAAoB,SAArB,CAA8B,MAAO,EACnC,UAC4B,CAAA,CAEhC,EAEA,EAAa,YAAc,EAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/icon-settings/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, { createContext, type ReactNode } from 'react';\nimport { ICON_SETTINGS } from '../../utilities/constants';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Context value shape for IconSettings\n */\nexport interface IconSettingsContextValue {\n\t/** Path to the root icon folder */\n\ticonPath?: string;\n\t/** Function to generate custom icon paths */\n\tonRequestIconPath?: (data: {\n\t\tcategory: IconCategory;\n\t\tname: string;\n\t}) => string;\n\t/** Path to the action sprite */\n\tactionSprite?: string;\n\t/** Path to the custom sprite */\n\tcustomSprite?: string;\n\t/** Path to the doctype sprite */\n\tdoctypeSprite?: string;\n\t/** Path to the standard sprite */\n\tstandardSprite?: string;\n\t/** Path to the utility sprite */\n\tutilitySprite?: string;\n}\n\n/**\n * Props for the IconSettings component\n */\nexport interface IconSettingsProps extends IconSettingsContextValue {\n\t/** Child components that will have access to icon settings */\n\tchildren: ReactNode;\n}\n\n/**\n * Context for sharing icon settings across the component tree\n */\nexport const IconSettingsContext = createContext<IconSettingsContextValue>({});\n\n/**\n * The Icon Settings component allows for the path to the icons to be specified in all child\n * components and is recommended to be used at the root of the application.\n *\n * **Individual sprites**\n * If your bundler rewrites asset paths, import each sprite and pass it in a\n * sprite prop (`actionSprite`, `customSprite`, `doctypeSprite`, `standardSprite`,\n * `utilitySprite`). With Vite:\n *\n * ```tsx\n * import actionSprite from '@salesforce-ux/design-system/assets/icons/action-sprite/svg/symbols.svg?url';\n * import utilitySprite from '@salesforce-ux/design-system/assets/icons/utility-sprite/svg/symbols.svg?url';\n *\n * <IconSettings actionSprite={actionSprite} utilitySprite={utilitySprite}>\n * <App />\n * </IconSettings>\n * ```\n *\n * **Root icon path**\n * Otherwise use the iconPath to specify the root path to where the icon files will be located\n * in your application such as `/assets/icons`.\n */\nconst IconSettings = ({\n\ticonPath,\n\tonRequestIconPath,\n\tactionSprite,\n\tcustomSprite,\n\tdoctypeSprite,\n\tstandardSprite,\n\tutilitySprite,\n\tchildren,\n}: IconSettingsProps): React.ReactElement => {\n\tconst contextValue: IconSettingsContextValue = {\n\t\ticonPath,\n\t\tonRequestIconPath,\n\t\tactionSprite,\n\t\tcustomSprite,\n\t\tdoctypeSprite,\n\t\tstandardSprite,\n\t\tutilitySprite,\n\t};\n\n\treturn (\n\t\t<IconSettingsContext.Provider value={contextValue}>\n\t\t\t{children}\n\t\t</IconSettingsContext.Provider>\n\t);\n};\n\nIconSettings.displayName = ICON_SETTINGS;\n\nexport default IconSettings;\n"],"mappings":"6QAyCA,IAAa,GAAA,EAAsB,EAAA,cAAA,CAAwC,CAAC,CAAC,EAwBvE,GAAgB,CACrB,WACA,oBACA,eACA,eACA,gBACA,iBACA,gBACA,cAC4C,CAC5C,IAAM,EAAyC,CAC9C,WACA,oBACA,eACA,eACA,gBACA,iBACA,eACD,EAEA,OACC,EAAA,EAAA,IAAA,CAAC,EAAoB,SAArB,CAA8B,MAAO,EACnC,UAC4B,CAAA,CAEhC,EAEA,EAAa,YAAc,EAAA"}
@@ -1,2 +1,2 @@
1
- require("../../utilities/constants.cjs");const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/only-one-of-properties.cjs");var r=function(){};process.env.NODE_ENV!==`production`&&(r=function(r,i={},a){let o=t.default(a);r===`SLDSInput`&&(e.default(r,i.defaultValue!==void 0,`defaultValue`,"Input is controlled: pass `value` and update it in `onChange`."),e.default(r,i.assistiveText&&i.assistiveText.fieldLevelHelpButton,`assistiveText.fieldLevelHelpButton`,`Pass a \`Tooltip\` to \`fieldLevelHelpTooltip\` and set its \`assistiveText.triggerLearnMoreIcon\`. ${o(`fieldLevelHelpTooltip`)}`),n.default(r,{"assistiveText.label":i.assistiveText&&i.assistiveText.label,label:i.label},o(`assistiveText`)),n.default(r,{fixedTextLeft:i.fixedTextLeft,fixedTextRight:i.fixedTextRight},o(`assistiveText`)))});var i=r;exports.default=i;
1
+ require("../../utilities/constants.cjs");const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/deprecated-property.cjs"),r=require("../../utilities/warning/only-one-of-properties.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a={},o){let s=t.default(o);i===`SLDSInput`&&(n.default(i,a.onKeyPress,`onKeyPress`,`onKeyDown`,`\`keypress\` is a deprecated DOM event; read \`event.key\` instead. ${s(`onKeyDown`)}`),e.default(i,a.defaultValue!==void 0,`defaultValue`,"Input is controlled: pass `value` and update it in `onChange`."),e.default(i,a.assistiveText&&a.assistiveText.fieldLevelHelpButton,`assistiveText.fieldLevelHelpButton`,`Pass a \`Tooltip\` to \`fieldLevelHelpTooltip\` and set its \`assistiveText.triggerLearnMoreIcon\`. ${s(`fieldLevelHelpTooltip`)}`),r.default(i,{"assistiveText.label":a.assistiveText&&a.assistiveText.label,label:a.label},s(`assistiveText`)),r.default(i,{fixedTextLeft:a.fixedTextLeft,fixedTextRight:a.fixedTextRight},s(`assistiveText`)))});var a=i;exports.default=a;
2
2
  //# sourceMappingURL=check-props.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/input/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\n// import oneOfRequiredProperty from '../../../utilities/warning/one-of-required-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\nimport { INPUT } from '../../utilities/constants';\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\tif (COMPONENT === INPUT) {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.defaultValue !== undefined,\n\t\t\t\t'defaultValue',\n\t\t\t\t'Input is controlled: pass `value` and update it in `onChange`.'\n\t\t\t);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText && props.assistiveText.fieldLevelHelpButton,\n\t\t\t\t'assistiveText.fieldLevelHelpButton',\n\t\t\t\t`Pass a \\`Tooltip\\` to \\`fieldLevelHelpTooltip\\` and set its \\`assistiveText.triggerLearnMoreIcon\\`. ${createDocUrl(\n\t\t\t\t\t'fieldLevelHelpTooltip'\n\t\t\t\t)}`\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\t'assistiveText.label':\n\t\t\t\t\t\tprops.assistiveText && props.assistiveText.label,\n\t\t\t\t\tlabel: props.label,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\tfixedTextLeft: props.fixedTextLeft,\n\t\t\t\t\tfixedTextRight: props.fixedTextRight,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\t/*\n\t\t\t* Once we support horizontal labels, then I think we can enable this check\n\t\t\t*\n\t\t\tif (!props.inlineEditTrigger) {\n\t\t\t\toneOfRequiredProperty(COMPONENT, {\n\t\t\t\t\tassistiveText: props.assistiveText,\n\t\t\t\t\tlabel: props.label\n\t\t\t\t});\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"2NAYA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAQ,CAAC,EAAG,EAAS,CACxE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE1C,IAAA,cACH,EAAA,QACC,EACA,EAAM,eAAiB,IAAA,GACvB,eACA,gEACD,EAEA,EAAA,QACC,EACA,EAAM,eAAiB,EAAM,cAAc,qBAC3C,qCACA,uGAAuG,EACtG,uBACD,GACD,EAEA,EAAA,QACC,EACA,CACC,sBACC,EAAM,eAAiB,EAAM,cAAc,MAC5C,MAAO,EAAM,KACd,EACA,EAAa,eAAe,CAC7B,EAEA,EAAA,QACC,EACA,CACC,cAAe,EAAM,cACrB,eAAgB,EAAM,cACvB,EACA,EAAa,eAAe,CAC7B,EAaF,GAGD,IAAA,EAAe"}
1
+ {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/input/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\n// import oneOfRequiredProperty from '../../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nimport { INPUT } from '../../utilities/constants';\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\tif (COMPONENT === INPUT) {\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.onKeyPress,\n\t\t\t\t'onKeyPress',\n\t\t\t\t'onKeyDown',\n\t\t\t\t`\\`keypress\\` is a deprecated DOM event; read \\`event.key\\` instead. ${createDocUrl('onKeyDown')}`\n\t\t\t);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.defaultValue !== undefined,\n\t\t\t\t'defaultValue',\n\t\t\t\t'Input is controlled: pass `value` and update it in `onChange`.'\n\t\t\t);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText && props.assistiveText.fieldLevelHelpButton,\n\t\t\t\t'assistiveText.fieldLevelHelpButton',\n\t\t\t\t`Pass a \\`Tooltip\\` to \\`fieldLevelHelpTooltip\\` and set its \\`assistiveText.triggerLearnMoreIcon\\`. ${createDocUrl(\n\t\t\t\t\t'fieldLevelHelpTooltip'\n\t\t\t\t)}`\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\t'assistiveText.label':\n\t\t\t\t\t\tprops.assistiveText && props.assistiveText.label,\n\t\t\t\t\tlabel: props.label,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\tfixedTextLeft: props.fixedTextLeft,\n\t\t\t\t\tfixedTextRight: props.fixedTextRight,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\t/*\n\t\t\t* Once we support horizontal labels, then I think we can enable this check\n\t\t\t*\n\t\t\tif (!props.inlineEditTrigger) {\n\t\t\t\toneOfRequiredProperty(COMPONENT, {\n\t\t\t\t\tassistiveText: props.assistiveText,\n\t\t\t\t\tlabel: props.label\n\t\t\t\t});\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"wRAaA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAQ,CAAC,EAAG,EAAS,CACxE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE1C,IAAA,cACH,EAAA,QACC,EACA,EAAM,WACN,aACA,YACA,uEAAuE,EAAa,WAAW,GAChG,EAEA,EAAA,QACC,EACA,EAAM,eAAiB,IAAA,GACvB,eACA,gEACD,EAEA,EAAA,QACC,EACA,EAAM,eAAiB,EAAM,cAAc,qBAC3C,qCACA,uGAAuG,EACtG,uBACD,GACD,EAEA,EAAA,QACC,EACA,CACC,sBACC,EAAM,eAAiB,EAAM,cAAc,MAC5C,MAAO,EAAM,KACd,EACA,EAAa,eAAe,CAC7B,EAEA,EAAA,QACC,EACA,CACC,cAAe,EAAM,cACrB,eAAgB,EAAM,cACvB,EACA,EAAa,eAAe,CAC7B,EAaF,GAGD,IAAA,EAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/input/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\tuseId,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\nimport type { InputIconProps } from '../icon/input-icon';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props shared by every Input variant and label form\n */\nexport interface InputBaseProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned `InputIcon`. The input sets its `iconPosition` to `left` unless the element sets one. */\n\ticonLeft?: ReactElement<InputIconProps> | null;\n\t/** Right-aligned `InputIcon`. The input sets its `iconPosition` to `right` unless the element sets one. */\n\ticonRight?: ReactElement<InputIconProps> | null;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Maximum character length */\n\tmaxLength?: number;\n\t/** Minimum character length */\n\tminLength?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Called with the requested value when the user types or, for the counter\n\t * variant, presses the increment/decrement buttons. Input is controlled: set\n\t * `value` from `data.value` (or `data.number`) to accept the change.\n\t */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/**\n\t * The input's value. Input is controlled: update `value` in `onChange`.\n\t * The counter variant steps from this value. (`defaultValue` was removed\n\t * in v11.)\n\t */\n\tvalue?: string | number;\n}\n\n/** The plain input, and the default. Counter-only props are not accepted. */\ninterface InputBaseVariantProps {\n\t/** Input variant */\n\tvariant?: 'base';\n\tmaxValue?: never;\n\tminValue?: never;\n\tstep?: never;\n}\n\n/** A number input with increment and decrement buttons. Its `type` is always `number`. */\ninterface InputCounterVariantProps {\n\t/** Input variant */\n\tvariant: 'counter';\n\t/** Maximum value */\n\tmaxValue?: number;\n\t/** Minimum value */\n\tminValue?: number;\n\t/** Step size */\n\tstep?: number;\n}\n\n/** A visible `label`, or `assistiveText.label` for a visually hidden one, not both. */\ntype InputLabelProps =\n\t| {\n\t\t\t/** Label text above input */\n\t\t\tlabel?: string;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText & { label?: never };\n\t }\n\t| {\n\t\t\tlabel?: undefined;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText;\n\t };\n\n/** Fixed text on one side of the input, not both. */\ntype InputFixedTextProps =\n\t| {\n\t\t\t/** Fixed text/node on the left */\n\t\t\tfixedTextLeft?: ReactNode;\n\t\t\tfixedTextRight?: never;\n\t }\n\t| {\n\t\t\tfixedTextLeft?: never;\n\t\t\t/** Fixed text/node on the right */\n\t\t\tfixedTextRight?: ReactNode;\n\t };\n\n/**\n * Props for the Input component: a union on `variant` (counter-only props),\n * with `label`/`assistiveText.label` and `fixedTextLeft`/`fixedTextRight`\n * exclusive.\n */\nexport type InputProps = InputBaseProps &\n\t(InputBaseVariantProps | InputCounterVariantProps) &\n\tInputLabelProps &\n\tInputFixedTextProps;\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported by `checkProps`.\n */\ninterface InputRemovedProps {\n\tdefaultValue?: unknown;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\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\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t}: InputProps & InputRemovedProps,\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `value`, so a held-down counter button steps from the value the\n\t\t// parent rendered after the previous step rather than a stale closure.\n\t\tconst valueRef = useRef(value);\n\t\tuseEffect(() => {\n\t\t\tvalueRef.current = value;\n\t\t}, [value]);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\t// The counter steps from the `value` prop only; it never reads or writes\n\t\t// the DOM value.\n\t\tconst toNumber = (currentValue: string | number | undefined): number =>\n\t\t\tcurrentValue === undefined || currentValue === ''\n\t\t\t\t? 0\n\t\t\t\t: Number(currentValue);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = toNumber(valueRef.current);\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStep(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[maxValue, minValue, onChange, step, stopStepping]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = toNumber(value);\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.key === KEYS.ENTER) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement<InputIconProps>(propIconLeft)\n\t\t\t\t? React.cloneElement(propIconLeft, {\n\t\t\t\t\t\ticonPosition: propIconLeft.props.iconPosition ?? 'left',\n\t\t\t\t\t})\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement<InputIconProps>(propIconRight)\n\t\t\t\t? React.cloneElement(propIconRight, {\n\t\t\t\t\t\ticonPosition: propIconRight.props.iconPosition ?? 'right',\n\t\t\t\t\t})\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\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': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={propInputRef}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\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\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/input/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\tuseId,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype InputEvent,\n\ttype SubmitEvent,\n\ttype SyntheticEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\nimport type { InputIconProps } from '../icon/input-icon';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props shared by every Input variant and label form\n */\nexport interface InputBaseProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned `InputIcon`. The input sets its `iconPosition` to `left` unless the element sets one. */\n\ticonLeft?: ReactElement<InputIconProps> | null;\n\t/** Right-aligned `InputIcon`. The input sets its `iconPosition` to `right` unless the element sets one. */\n\ticonRight?: ReactElement<InputIconProps> | null;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Maximum character length */\n\tmaxLength?: number;\n\t/** Minimum character length */\n\tminLength?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Called with the requested value when the user types or, for the counter\n\t * variant, presses the increment/decrement buttons. Input is controlled: set\n\t * `value` from `data.value` (or `data.number`) to accept the change.\n\t */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: InputEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * @deprecated `keypress` is a deprecated DOM event. Use `onKeyDown` and read\n\t * `event.key` instead. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: SubmitEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/**\n\t * The input's value. Input is controlled: update `value` in `onChange`.\n\t * The counter variant steps from this value. (`defaultValue` was removed\n\t * in v11.)\n\t */\n\tvalue?: string | number;\n}\n\n/** The plain input, and the default. Counter-only props are not accepted. */\ninterface InputBaseVariantProps {\n\t/** Input variant */\n\tvariant?: 'base';\n\tmaxValue?: never;\n\tminValue?: never;\n\tstep?: never;\n}\n\n/** A number input with increment and decrement buttons. Its `type` is always `number`. */\ninterface InputCounterVariantProps {\n\t/** Input variant */\n\tvariant: 'counter';\n\t/** Maximum value */\n\tmaxValue?: number;\n\t/** Minimum value */\n\tminValue?: number;\n\t/** Step size */\n\tstep?: number;\n}\n\n/** A visible `label`, or `assistiveText.label` for a visually hidden one, not both. */\ntype InputLabelProps =\n\t| {\n\t\t\t/** Label text above input */\n\t\t\tlabel?: string;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText & { label?: never };\n\t }\n\t| {\n\t\t\t/** Unset when the label is visually hidden in `assistiveText.label`. */\n\t\t\tlabel?: undefined;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText;\n\t };\n\n/** Fixed text on one side of the input, not both. */\ntype InputFixedTextProps =\n\t| {\n\t\t\t/** Fixed text/node on the left */\n\t\t\tfixedTextLeft?: ReactNode;\n\t\t\tfixedTextRight?: never;\n\t }\n\t| {\n\t\t\tfixedTextLeft?: never;\n\t\t\t/** Fixed text/node on the right */\n\t\t\tfixedTextRight?: ReactNode;\n\t };\n\n/**\n * Props for the Input component: a union on `variant` (counter-only props),\n * with `label`/`assistiveText.label` and `fixedTextLeft`/`fixedTextRight`\n * exclusive.\n */\nexport type InputProps = InputBaseProps &\n\t(InputBaseVariantProps | InputCounterVariantProps) &\n\tInputLabelProps &\n\tInputFixedTextProps;\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported by `checkProps`.\n */\ninterface InputRemovedProps {\n\tdefaultValue?: unknown;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\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\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t}: InputProps & InputRemovedProps,\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `value`, so a held-down counter button steps from the value the\n\t\t// parent rendered after the previous step rather than a stale closure.\n\t\tconst valueRef = useRef(value);\n\t\tuseEffect(() => {\n\t\t\tvalueRef.current = value;\n\t\t}, [value]);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\t// The counter steps from the `value` prop only; it never reads or writes\n\t\t// the DOM value.\n\t\tconst toNumber = (currentValue: string | number | undefined): number =>\n\t\t\tcurrentValue === undefined || currentValue === ''\n\t\t\t\t? 0\n\t\t\t\t: Number(currentValue);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = toNumber(valueRef.current);\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStep(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[maxValue, minValue, onChange, step, stopStepping]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = toNumber(value);\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.key === KEYS.ENTER) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement<InputIconProps>(propIconLeft)\n\t\t\t\t? React.cloneElement(propIconLeft, {\n\t\t\t\t\t\ticonPosition: propIconLeft.props.iconPosition ?? 'left',\n\t\t\t\t\t})\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement<InputIconProps>(propIconRight)\n\t\t\t\t? React.cloneElement(propIconRight, {\n\t\t\t\t\t\ticonPosition: propIconRight.props.iconPosition ?? 'right',\n\t\t\t\t\t})\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\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': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={propInputRef}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\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\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"inner-input.cjs","names":[],"sources":["../../../../../components/input/private/inner-input.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 type {\n\tReactNode,\n\tChangeEvent,\n\tFocusEvent,\n\tKeyboardEvent,\n\tMouseEvent,\n\tFormEvent,\n\tCSSProperties,\n\tAriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Spinner from '../../spinner';\nimport getAriaProps from '../../../utilities/get-aria-props';\n\nconst COUNTER = 'counter';\n\n/**\n * Input type options\n */\nexport type InnerInputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InnerInputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for InnerInput\n */\nexport interface InnerInputAssistiveText {\n\t/** Text for loading spinner */\n\tspinner?: string;\n}\n\n/**\n * Container props for the wrapper div\n */\nexport interface InnerInputContainerProps {\n\tclassName?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Props for the InnerInput component\n */\nexport interface InnerInputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InnerInputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** CSS classes for the input element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the container div */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Props for the container div */\n\tcontainerProps?: InnerInputContainerProps;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute (required) */\n\tid: string;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically */\n\tisStatic?: boolean;\n\t/** Label text */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for number input */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for number input */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for number input */\n\tstep?: number;\n\t/** Custom styles for input */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Input type */\n\ttype?: InnerInputType;\n\t/** The input's value. Controlled: the parent updates it in `onChange`. */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InnerInputVariant;\n}\n\nconst defaultAssistiveText: InnerInputAssistiveText = {\n\tspinner: 'Loading ...',\n};\n\n// Type for aria props returned from getAriaProps\ninterface AriaPropsResult {\n\t'aria-activedescendant'?: string;\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t'aria-controls'?: string;\n\t'aria-describedby'?: string;\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t'aria-labelledby'?: string;\n\t'aria-owns'?: string;\n\t'aria-required'?: boolean;\n}\n\n/**\n * Internal input component used by Input and Combobox.\n * This component's API is not public.\n */\nconst InnerInput = ({\n\t'aria-activedescendant': ariaActivedescendant,\n\t'aria-autocomplete': ariaAutocomplete,\n\t'aria-controls': ariaControls,\n\t'aria-describedby': ariaDescribedby,\n\t'aria-expanded': ariaExpanded,\n\t'aria-haspopup': ariaHaspopup,\n\t'aria-labelledby': ariaLabelledby,\n\t'aria-owns': ariaOwns,\n\t'aria-required': ariaRequired,\n\tassistiveText: propAssistiveText,\n\tautoComplete,\n\tclassName,\n\tcontainerClassName,\n\tcontainerProps = {},\n\tdisabled,\n\tfixedTextLeft,\n\tfixedTextRight,\n\thasSpinner,\n\ticonLeft,\n\ticonRight,\n\tid,\n\tinlineEditTrigger,\n\tinputRef,\n\tisStatic,\n\tmaxLength,\n\tmaxValue,\n\tminLength,\n\tminValue,\n\tname,\n\tonBlur,\n\tonChange,\n\tonClick,\n\tonFocus,\n\tonInput,\n\tonInvalid,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonSelect,\n\tonSubmit,\n\tplaceholder,\n\treadOnly,\n\trequired,\n\trole,\n\tstep,\n\tstyle,\n\ttabIndex,\n\ttype = 'text',\n\tvalue,\n\tvariant,\n}: InnerInputProps) => {\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\tconst ariaProps: AriaPropsResult = getAriaProps({\n\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t'aria-controls': ariaControls,\n\t\t'aria-describedby': ariaDescribedby,\n\t\t'aria-expanded': ariaExpanded,\n\t\t'aria-haspopup': ariaHaspopup,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t'aria-owns': ariaOwns,\n\t\t'aria-required': ariaRequired,\n\t\tassistiveText,\n\t\ttype,\n\t});\n\n\tconst loadingStatusIconId = `${id}-loading-status-icon`;\n\n\t// Add spinner to aria-describedby if present\n\tif (hasSpinner && ariaProps['aria-describedby']) {\n\t\tariaProps['aria-describedby'] =\n\t\t\t`${loadingStatusIconId} ${ariaProps['aria-describedby']}`;\n\t} else if (hasSpinner) {\n\t\tariaProps['aria-describedby'] = loadingStatusIconId;\n\t}\n\n\tconst { className: containerPropsClassName, ...restContainerProps } =\n\t\tcontainerProps;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(containerPropsClassName, containerClassName, {\n\t\t\t\t'slds-input-has-icon': variant !== COUNTER && (iconLeft || iconRight),\n\t\t\t\t'slds-input-has-icon_left': iconLeft && !iconRight,\n\t\t\t\t'slds-input-has-icon_right': !iconLeft && iconRight,\n\t\t\t\t'slds-input-has-icon_left-right':\n\t\t\t\t\tvariant !== COUNTER && iconLeft && iconRight,\n\t\t\t\t'slds-input-has-fixed-addon': fixedTextLeft || fixedTextRight,\n\t\t\t\t'slds-has-divider_bottom': isStatic,\n\t\t\t})}\n\t\t\t{...restContainerProps}\n\t\t>\n\t\t\t{iconLeft}\n\t\t\t{fixedTextLeft && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextLeft}</span>\n\t\t\t)}\n\n\t\t\t{!isStatic && (\n\t\t\t\t<input\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-input',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-text-align_left': variant === COUNTER && readOnly,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tmin={minValue}\n\t\t\t\t\tminLength={minLength !== undefined ? Number(minLength) : undefined}\n\t\t\t\t\tmax={maxValue}\n\t\t\t\t\tmaxLength={maxLength !== undefined ? Number(maxLength) : undefined}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tstep={step}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\ttabIndex={tabIndex !== undefined ? Number(tabIndex) : undefined}\n\t\t\t\t\ttype={type}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\tvalue={value}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{hasSpinner ? (\n\t\t\t\t<div className=\"slds-input__icon-group slds-input__icon-group_right\">\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tassistiveText={{ label: assistiveText.spinner }}\n\t\t\t\t\t\tid={loadingStatusIconId}\n\t\t\t\t\t\tplacement=\"input\"\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t/>\n\t\t\t\t\t{iconRight}\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\ticonRight\n\t\t\t)}\n\n\t\t\t{fixedTextRight && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextRight}</span>\n\t\t\t)}\n\n\t\t\t{isStatic && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={classNames('slds-form-element__static', 'slds-grid', {\n\t\t\t\t\t\t'slds-grid_align-spread': variant !== COUNTER,\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tonClick as unknown as (event: MouseEvent<HTMLSpanElement>) => void\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{value}\n\t\t\t\t\t{inlineEditTrigger}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nInnerInput.displayName = 'SLDSInnerInput';\n\nexport default InnerInput;\n"],"mappings":"oOAkBA,IAAM,EAAU,UAsJV,GAAgD,CACrD,QAAS,aACV,EAmBM,GAAc,CACnB,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,cAAe,EACf,eACA,YACA,qBACA,iBAAiB,CAAC,EAClB,WACA,gBACA,iBACA,aACA,WACA,YACA,KACA,oBACA,WACA,WACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,aACA,YACA,aACA,UACA,WACA,WACA,cACA,WACA,WACA,OACA,OACA,QACA,WACA,OAAO,OACP,QACA,aACsB,CACtB,IAAM,EAAgB,CAAE,GAAG,GAAsB,GAAG,CAAkB,EAEhE,EAA6B,EAAA,QAAa,CAC/C,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,gBACA,MACD,CAAC,EAEK,EAAsB,GAAG,EAAG,sBAG9B,GAAc,EAAU,oBAC3B,EAAU,oBACT,GAAG,EAAoB,GAAG,EAAU,sBAC3B,IACV,EAAU,oBAAsB,GAGjC,GAAM,CAAE,UAAW,GAAyB,GAAG,IAC9C,EAED,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,GAAyB,EAAoB,CAClE,sBAAuB,IAAY,IAAY,GAAY,GAC3D,2BAA4B,GAAY,CAAC,EACzC,4BAA6B,CAAC,GAAY,EAC1C,iCACC,IAAY,GAAW,GAAY,EACpC,6BAA8B,GAAiB,EAC/C,0BAA2B,CAC5B,CAAC,EACD,GAAI,GAVL,SAAA,CAYE,EACA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAoB,CAAA,EAGhE,CAAC,IACD,EAAA,EAAA,IAAA,CAAC,QAAD,CACe,eACd,WAAA,EAAW,EAAA,QAAA,CACV,aACA,CACC,uBAAwB,IAAY,GAAW,CAChD,EACA,CACD,EACU,WACN,KACJ,IAAK,EACL,UAAW,IAAc,IAAA,GAAgC,IAAA,GAApB,OAAO,CAAS,EACrD,IAAK,EACL,UAAW,IAAc,IAAA,GAAgC,IAAA,GAApB,OAAO,CAAS,EAC/C,OACE,SACE,WACD,UACA,UACA,UACE,aACA,YACC,aACH,UACC,WACA,WACG,cACH,WACV,IAAK,EACK,WACJ,OACA,OACC,QACP,SAAU,IAAa,IAAA,GAA+B,IAAA,GAAnB,OAAO,CAAQ,EAC5C,OACN,GAAI,EACG,OACP,CAAA,EAGD,GACA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sDAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,OAAQ,EAC9C,GAAI,EACJ,UAAU,QACV,KAAK,UACL,QAAQ,OACR,CAAA,EACA,CACG,CAEL,CAAA,EAAA,EAGA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAqB,CAAA,EAGjE,IACA,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,4BAA6B,YAAa,CAC/D,yBAA0B,IAAY,CACvC,CAAC,EAEA,UALF,SAAA,CAQE,EACA,CACI,GAEH,GAEP,EAEA,EAAW,YAAc"}
1
+ {"version":3,"file":"inner-input.cjs","names":[],"sources":["../../../../../components/input/private/inner-input.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 type {\n\tReactNode,\n\tChangeEvent,\n\tFocusEvent,\n\tKeyboardEvent,\n\tMouseEvent,\n\tInputEvent,\n\tSubmitEvent,\n\tSyntheticEvent,\n\tCSSProperties,\n\tAriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Spinner from '../../spinner';\nimport getAriaProps from '../../../utilities/get-aria-props';\n\nconst COUNTER = 'counter';\n\n/**\n * Input type options\n */\nexport type InnerInputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InnerInputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for InnerInput\n */\nexport interface InnerInputAssistiveText {\n\t/** Text for loading spinner */\n\tspinner?: string;\n}\n\n/**\n * Container props for the wrapper div\n */\nexport interface InnerInputContainerProps {\n\tclassName?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Props for the InnerInput component\n */\nexport interface InnerInputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InnerInputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** CSS classes for the input element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the container div */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Props for the container div */\n\tcontainerProps?: InnerInputContainerProps;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute (required) */\n\tid: string;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically */\n\tisStatic?: boolean;\n\t/** Label text */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for number input */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for number input */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: InputEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * @deprecated `keypress` is a deprecated DOM event. Use `onKeyDown` and read\n\t * `event.key` instead. Works only in the 11.0.0 release candidates, and warns.\n\t */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: SubmitEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for number input */\n\tstep?: number;\n\t/** Custom styles for input */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Input type */\n\ttype?: InnerInputType;\n\t/** The input's value. Controlled: the parent updates it in `onChange`. */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InnerInputVariant;\n}\n\nconst defaultAssistiveText: InnerInputAssistiveText = {\n\tspinner: 'Loading ...',\n};\n\n// Type for aria props returned from getAriaProps\ninterface AriaPropsResult {\n\t'aria-activedescendant'?: string;\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t'aria-controls'?: string;\n\t'aria-describedby'?: string;\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t'aria-labelledby'?: string;\n\t'aria-owns'?: string;\n\t'aria-required'?: boolean;\n}\n\n/**\n * Internal input component used by Input and Combobox.\n * This component's API is not public.\n */\nconst InnerInput = ({\n\t'aria-activedescendant': ariaActivedescendant,\n\t'aria-autocomplete': ariaAutocomplete,\n\t'aria-controls': ariaControls,\n\t'aria-describedby': ariaDescribedby,\n\t'aria-expanded': ariaExpanded,\n\t'aria-haspopup': ariaHaspopup,\n\t'aria-labelledby': ariaLabelledby,\n\t'aria-owns': ariaOwns,\n\t'aria-required': ariaRequired,\n\tassistiveText: propAssistiveText,\n\tautoComplete,\n\tclassName,\n\tcontainerClassName,\n\tcontainerProps = {},\n\tdisabled,\n\tfixedTextLeft,\n\tfixedTextRight,\n\thasSpinner,\n\ticonLeft,\n\ticonRight,\n\tid,\n\tinlineEditTrigger,\n\tinputRef,\n\tisStatic,\n\tmaxLength,\n\tmaxValue,\n\tminLength,\n\tminValue,\n\tname,\n\tonBlur,\n\tonChange,\n\tonClick,\n\tonFocus,\n\tonInput,\n\tonInvalid,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonSelect,\n\tonSubmit,\n\tplaceholder,\n\treadOnly,\n\trequired,\n\trole,\n\tstep,\n\tstyle,\n\ttabIndex,\n\ttype = 'text',\n\tvalue,\n\tvariant,\n}: InnerInputProps) => {\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\tconst ariaProps: AriaPropsResult = getAriaProps({\n\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t'aria-controls': ariaControls,\n\t\t'aria-describedby': ariaDescribedby,\n\t\t'aria-expanded': ariaExpanded,\n\t\t'aria-haspopup': ariaHaspopup,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t'aria-owns': ariaOwns,\n\t\t'aria-required': ariaRequired,\n\t\tassistiveText,\n\t\ttype,\n\t});\n\n\tconst loadingStatusIconId = `${id}-loading-status-icon`;\n\n\t// Add spinner to aria-describedby if present\n\tif (hasSpinner && ariaProps['aria-describedby']) {\n\t\tariaProps['aria-describedby'] =\n\t\t\t`${loadingStatusIconId} ${ariaProps['aria-describedby']}`;\n\t} else if (hasSpinner) {\n\t\tariaProps['aria-describedby'] = loadingStatusIconId;\n\t}\n\n\tconst { className: containerPropsClassName, ...restContainerProps } =\n\t\tcontainerProps;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(containerPropsClassName, containerClassName, {\n\t\t\t\t'slds-input-has-icon': variant !== COUNTER && (iconLeft || iconRight),\n\t\t\t\t'slds-input-has-icon_left': iconLeft && !iconRight,\n\t\t\t\t'slds-input-has-icon_right': !iconLeft && iconRight,\n\t\t\t\t'slds-input-has-icon_left-right':\n\t\t\t\t\tvariant !== COUNTER && iconLeft && iconRight,\n\t\t\t\t'slds-input-has-fixed-addon': fixedTextLeft || fixedTextRight,\n\t\t\t\t'slds-has-divider_bottom': isStatic,\n\t\t\t})}\n\t\t\t{...restContainerProps}\n\t\t>\n\t\t\t{iconLeft}\n\t\t\t{fixedTextLeft && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextLeft}</span>\n\t\t\t)}\n\n\t\t\t{!isStatic && (\n\t\t\t\t<input\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-input',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-text-align_left': variant === COUNTER && readOnly,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tmin={minValue}\n\t\t\t\t\tminLength={minLength !== undefined ? Number(minLength) : undefined}\n\t\t\t\t\tmax={maxValue}\n\t\t\t\t\tmaxLength={maxLength !== undefined ? Number(maxLength) : undefined}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t// eslint-disable-next-line local/no-deprecated -- forwards the deprecated `onKeyPress` prop until 11.0\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tstep={step}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\ttabIndex={tabIndex !== undefined ? Number(tabIndex) : undefined}\n\t\t\t\t\ttype={type}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\tvalue={value}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{hasSpinner ? (\n\t\t\t\t<div className=\"slds-input__icon-group slds-input__icon-group_right\">\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tassistiveText={{ label: assistiveText.spinner }}\n\t\t\t\t\t\tid={loadingStatusIconId}\n\t\t\t\t\t\tplacement=\"input\"\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t/>\n\t\t\t\t\t{iconRight}\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\ticonRight\n\t\t\t)}\n\n\t\t\t{fixedTextRight && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextRight}</span>\n\t\t\t)}\n\n\t\t\t{isStatic && (\n\t\t\t\t// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- static display text; the inline edit trigger is the focusable control\n\t\t\t\t<span\n\t\t\t\t\tclassName={classNames('slds-form-element__static', 'slds-grid', {\n\t\t\t\t\t\t'slds-grid_align-spread': variant !== COUNTER,\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tonClick as unknown as (event: MouseEvent<HTMLSpanElement>) => void\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{value}\n\t\t\t\t\t{inlineEditTrigger}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nInnerInput.displayName = 'SLDSInnerInput';\n\nexport default InnerInput;\n"],"mappings":"oOAoBA,IAAM,EAAU,UAyJV,GAAgD,CACrD,QAAS,aACV,EAmBM,GAAc,CACnB,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,cAAe,EACf,eACA,YACA,qBACA,iBAAiB,CAAC,EAClB,WACA,gBACA,iBACA,aACA,WACA,YACA,KACA,oBACA,WACA,WACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,aACA,YACA,aACA,UACA,WACA,WACA,cACA,WACA,WACA,OACA,OACA,QACA,WACA,OAAO,OACP,QACA,aACsB,CACtB,IAAM,EAAgB,CAAE,GAAG,GAAsB,GAAG,CAAkB,EAEhE,EAA6B,EAAA,QAAa,CAC/C,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,gBACA,MACD,CAAC,EAEK,EAAsB,GAAG,EAAG,sBAG9B,GAAc,EAAU,oBAC3B,EAAU,oBACT,GAAG,EAAoB,GAAG,EAAU,sBAC3B,IACV,EAAU,oBAAsB,GAGjC,GAAM,CAAE,UAAW,GAAyB,GAAG,IAC9C,EAED,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,GAAyB,EAAoB,CAClE,sBAAuB,IAAY,IAAY,GAAY,GAC3D,2BAA4B,GAAY,CAAC,EACzC,4BAA6B,CAAC,GAAY,EAC1C,iCACC,IAAY,GAAW,GAAY,EACpC,6BAA8B,GAAiB,EAC/C,0BAA2B,CAC5B,CAAC,EACD,GAAI,GAVL,SAAA,CAYE,EACA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAoB,CAAA,EAGhE,CAAC,IACD,EAAA,EAAA,IAAA,CAAC,QAAD,CACe,eACd,WAAA,EAAW,EAAA,QAAA,CACV,aACA,CACC,uBAAwB,IAAY,GAAW,CAChD,EACA,CACD,EACU,WACN,KACJ,IAAK,EACL,UAAW,IAAc,IAAA,GAAgC,IAAA,GAApB,OAAO,CAAS,EACrD,IAAK,EACL,UAAW,IAAc,IAAA,GAAgC,IAAA,GAApB,OAAO,CAAS,EAC/C,OACE,SACE,WACD,UACA,UACA,UACE,aACA,YAEC,aACH,UACC,WACA,WACG,cACH,WACV,IAAK,EACK,WACJ,OACA,OACC,QACP,SAAU,IAAa,IAAA,GAA+B,IAAA,GAAnB,OAAO,CAAQ,EAC5C,OACN,GAAI,EACG,OACP,CAAA,EAGD,GACA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sDAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,OAAQ,EAC9C,GAAI,EACJ,UAAU,QACV,KAAK,UACL,QAAQ,OACR,CAAA,EACA,CACG,CAEL,CAAA,EAAA,EAGA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAqB,CAAA,EAGjE,IAEA,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,4BAA6B,YAAa,CAC/D,yBAA0B,IAAY,CACvC,CAAC,EAEA,UALF,SAAA,CAQE,EACA,CACI,GAEH,GAEP,EAEA,EAAW,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"search.cjs","names":[],"sources":["../../../../components/input/search.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 KeyboardEvent } from 'react';\n\nimport Input, {\n\ttype InputBaseProps,\n\ttype InputProps,\n\ttype InputAssistiveText,\n} from './index';\nimport InputIcon from '../icon/input-icon/index';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\nimport { SEARCH } from '../../utilities/constants';\n\n/**\n * Assistive text for Search component\n */\nexport interface SearchAssistiveText extends InputAssistiveText {\n\t/** Label for the search input */\n\tlabel?: string;\n}\n\n/**\n * Props for the Search component\n */\nexport interface SearchProps extends Omit<\n\tInputBaseProps,\n\t'assistiveText' | 'iconLeft' | 'iconRight'\n> {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SearchAssistiveText;\n\t/** Adds a clear button to the right of the input */\n\tclearable?: boolean;\n\t/** Handler for clear button click */\n\tonClear?: (event: React.MouseEvent) => void;\n\t/** Handler for search (enter key or search icon click) */\n\tonSearch?: (\n\t\tevent: KeyboardEvent<HTMLInputElement> | React.MouseEvent\n\t) => void;\n}\n\nconst handleKeyDown = (\n\tevent: KeyboardEvent<HTMLInputElement>,\n\tonSearch?: (event: KeyboardEvent<HTMLInputElement> | React.MouseEvent) => void\n) => {\n\tif (event.key === KEYS.ENTER && onSearch && !EventUtil.isComposing(event)) {\n\t\tEventUtil.trapImmediate(event);\n\t\tonSearch(event);\n\t}\n};\n\n/**\n * A `Search` is an `Input` which renders the search icon by default.\n * It can be cleared, too. All `Input` props not specified as props\n * already may be used with this component and will override defaults.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Search = ({\n\tassistiveText,\n\tclearable = false,\n\tonClear,\n\tonSearch,\n\tplaceholder,\n\t...props\n}: SearchProps) => {\n\tcheckProps(\n\t\tSEARCH,\n\t\t{ assistiveText, clearable, onClear, onSearch, placeholder, ...props },\n\t\tcomponentDoc\n\t);\n\n\tconst mergedAssistiveText: InputAssistiveText = {\n\t\tlabel: assistiveText?.label,\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tassistiveText={mergedAssistiveText}\n\t\t\ticonLeft={\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{ icon: 'Search' }}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"search\"\n\t\t\t\t\tonClick={onSearch}\n\t\t\t\t/>\n\t\t\t}\n\t\t\ticonRight={\n\t\t\t\tclearable ? (\n\t\t\t\t\t<InputIcon\n\t\t\t\t\t\tassistiveText={{ icon: 'Clear' }}\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tname=\"clear\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t\t}\n\t\t\tonKeyDown={\n\t\t\t\tonSearch\n\t\t\t\t\t? (event) =>\n\t\t\t\t\t\t\thandleKeyDown(event as KeyboardEvent<HTMLInputElement>, onSearch)\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tplaceholder={placeholder}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nSearch.displayName = SEARCH;\n\nexport default Search;\n"],"mappings":"8XA4CA,IAAM,GACL,EACA,IACI,CACA,EAAM,MAAQ,EAAA,QAAK,OAAS,GAAY,CAAC,EAAA,QAAU,YAAY,CAAK,IACvE,EAAA,QAAU,cAAc,CAAK,EAC7B,EAAS,CAAK,EAEhB,EASM,GAAU,CACf,gBACA,YAAY,GACZ,UACA,WACA,cACA,GAAG,KACe,CAClB,EAAA,QACC,EAAA,OACA,CAAE,gBAAe,YAAW,UAAS,WAAU,cAAa,GAAG,CAAM,EACrE,EAAA,OACD,EAEA,IAAM,EAA0C,CAC/C,MAAO,GAAe,KACvB,EAEA,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,EACf,UACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,QAAS,EAChC,SAAS,UACT,KAAK,SACL,QAAS,CACT,CAAA,EAEF,UACC,GACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,OAAQ,EAC/B,SAAS,UACT,KAAK,QACL,QAAS,CACT,CAAA,EACE,KAEL,UACC,EACI,GACD,EAAc,EAA0C,CAAQ,EAChE,IAAA,GAES,cACb,GAAI,CACJ,CAAA,CAEH,EAEA,EAAO,YAAc,EAAA"}
1
+ {"version":3,"file":"search.cjs","names":[],"sources":["../../../../components/input/search.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 KeyboardEvent } from 'react';\n\nimport Input, { type InputBaseProps, type InputAssistiveText } from './index';\nimport InputIcon from '../icon/input-icon/index';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\nimport { SEARCH } from '../../utilities/constants';\n\n/**\n * Assistive text for Search component\n */\nexport interface SearchAssistiveText extends InputAssistiveText {\n\t/** Label for the search input */\n\tlabel?: string;\n}\n\n/**\n * Props for the Search component\n */\nexport interface SearchProps extends Omit<\n\tInputBaseProps,\n\t'assistiveText' | 'iconLeft' | 'iconRight'\n> {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SearchAssistiveText;\n\t/** Adds a clear button to the right of the input */\n\tclearable?: boolean;\n\t/** Handler for clear button click */\n\tonClear?: (event: React.MouseEvent) => void;\n\t/** Handler for search (enter key or search icon click) */\n\tonSearch?: (\n\t\tevent: KeyboardEvent<HTMLInputElement> | React.MouseEvent\n\t) => void;\n}\n\nconst handleKeyDown = (\n\tevent: KeyboardEvent<HTMLInputElement>,\n\tonSearch?: (event: KeyboardEvent<HTMLInputElement> | React.MouseEvent) => void\n) => {\n\tif (event.key === KEYS.ENTER && onSearch && !EventUtil.isComposing(event)) {\n\t\tEventUtil.trapImmediate(event);\n\t\tonSearch(event);\n\t}\n};\n\n/**\n * A `Search` is an `Input` which renders the search icon by default.\n * It can be cleared, too. All `Input` props not specified as props\n * already may be used with this component and will override defaults.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Search = ({\n\tassistiveText,\n\tclearable = false,\n\tonClear,\n\tonSearch,\n\tplaceholder,\n\t...props\n}: SearchProps) => {\n\tcheckProps(\n\t\tSEARCH,\n\t\t{ assistiveText, clearable, onClear, onSearch, placeholder, ...props },\n\t\tcomponentDoc\n\t);\n\n\tconst mergedAssistiveText: InputAssistiveText = {\n\t\tlabel: assistiveText?.label,\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tassistiveText={mergedAssistiveText}\n\t\t\ticonLeft={\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{ icon: 'Search' }}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"search\"\n\t\t\t\t\tonClick={onSearch}\n\t\t\t\t/>\n\t\t\t}\n\t\t\ticonRight={\n\t\t\t\tclearable ? (\n\t\t\t\t\t<InputIcon\n\t\t\t\t\t\tassistiveText={{ icon: 'Clear' }}\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tname=\"clear\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t\t}\n\t\t\tonKeyDown={\n\t\t\t\tonSearch\n\t\t\t\t\t? (event) =>\n\t\t\t\t\t\t\thandleKeyDown(event as KeyboardEvent<HTMLInputElement>, onSearch)\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tplaceholder={placeholder}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nSearch.displayName = SEARCH;\n\nexport default Search;\n"],"mappings":"8XAwCA,IAAM,GACL,EACA,IACI,CACA,EAAM,MAAQ,EAAA,QAAK,OAAS,GAAY,CAAC,EAAA,QAAU,YAAY,CAAK,IACvE,EAAA,QAAU,cAAc,CAAK,EAC7B,EAAS,CAAK,EAEhB,EASM,GAAU,CACf,gBACA,YAAY,GACZ,UACA,WACA,cACA,GAAG,KACe,CAClB,EAAA,QACC,EAAA,OACA,CAAE,gBAAe,YAAW,UAAS,WAAU,cAAa,GAAG,CAAM,EACrE,EAAA,OACD,EAEA,IAAM,EAA0C,CAC/C,MAAO,GAAe,KACvB,EAEA,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,EACf,UACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,QAAS,EAChC,SAAS,UACT,KAAK,SACL,QAAS,CACT,CAAA,EAEF,UACC,GACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,OAAQ,EAC/B,SAAS,UACT,KAAK,QACL,QAAS,CACT,CAAA,EACE,KAEL,UACC,EACI,GACD,EAAc,EAA0C,CAAQ,EAChE,IAAA,GAES,cACb,GAAI,CACJ,CAAA,CAEH,EAEA,EAAO,YAAc,EAAA"}