@salesforce/design-system-react 11.0.0-rc.1 → 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 (248) hide show
  1. package/README.md +10 -2
  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/builder-header/nav-dropdown.cjs.map +1 -1
  6. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  7. package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
  8. package/dist/cjs/components/button/index.cjs.map +1 -1
  9. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  10. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  11. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  12. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  13. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  14. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  15. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  16. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  17. package/dist/cjs/components/files/file.cjs.map +1 -1
  18. package/dist/cjs/components/icon/index.cjs.map +1 -1
  19. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  20. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  21. package/dist/cjs/components/input/index.cjs.map +1 -1
  22. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  23. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  24. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  25. package/dist/cjs/components/modal/index.cjs.map +1 -1
  26. package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
  27. package/dist/cjs/components/pill/index.cjs.map +1 -1
  28. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  29. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  30. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  31. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  32. package/dist/cjs/components/radio/index.cjs.map +1 -1
  33. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  35. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  36. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  37. package/dist/cjs/components/slider/index.cjs.map +1 -1
  38. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  39. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  40. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  41. package/dist/cjs/components/textarea/index.cjs +1 -1
  42. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  43. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  44. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  45. package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
  46. package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
  47. package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
  48. package/dist/cjs/utilities/get-component-doc.cjs +1 -1
  49. package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
  50. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  51. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  52. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  53. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  54. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  55. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  56. package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
  57. package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
  58. package/dist/es/components/accordion/index.js +7 -3
  59. package/dist/es/components/accordion/index.js.map +1 -1
  60. package/dist/es/components/accordion/panel.js.map +1 -1
  61. package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
  62. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  63. package/dist/es/components/builder-header/toolbar.js.map +1 -1
  64. package/dist/es/components/button/index.js.map +1 -1
  65. package/dist/es/components/button-stateful/index.js.map +1 -1
  66. package/dist/es/components/checkbox/index.js.map +1 -1
  67. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  68. package/dist/es/components/combobox/combobox.js +4 -2
  69. package/dist/es/components/combobox/combobox.js.map +1 -1
  70. package/dist/es/components/date-picker/date-picker.js +1 -1
  71. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  72. package/dist/es/components/date-picker/index.js.map +1 -1
  73. package/dist/es/components/files/file.js.map +1 -1
  74. package/dist/es/components/icon/index.js.map +1 -1
  75. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  76. package/dist/es/components/icon-settings/index.js.map +1 -1
  77. package/dist/es/components/input/index.js.map +1 -1
  78. package/dist/es/components/input/private/inner-input.js.map +1 -1
  79. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  80. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  81. package/dist/es/components/modal/index.js.map +1 -1
  82. package/dist/es/components/panel/filtering/group.js.map +1 -1
  83. package/dist/es/components/pill/index.js.map +1 -1
  84. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  85. package/dist/es/components/popover/popover.js.map +1 -1
  86. package/dist/es/components/progress-indicator/index.js.map +1 -1
  87. package/dist/es/components/progress-ring/index.js.map +1 -1
  88. package/dist/es/components/radio/index.js.map +1 -1
  89. package/dist/es/components/radio-group/check-props.js.map +1 -1
  90. package/dist/es/components/radio-group/index.js.map +1 -1
  91. package/dist/es/components/scoped-notification/index.js.map +1 -1
  92. package/dist/es/components/setup-assistant/step.js.map +1 -1
  93. package/dist/es/components/slider/index.js.map +1 -1
  94. package/dist/es/components/split-view/header.js.map +1 -1
  95. package/dist/es/components/tabs/index.js.map +1 -1
  96. package/dist/es/components/tabs/panel.js.map +1 -1
  97. package/dist/es/components/textarea/index.js +29 -44
  98. package/dist/es/components/textarea/index.js.map +1 -1
  99. package/dist/es/components/tooltip/index.js.map +1 -1
  100. package/dist/es/components/tree/tree.js.map +1 -1
  101. package/dist/es/components/trial-bar/button.js.map +1 -1
  102. package/dist/es/components/trial-bar/dropdown.js.map +1 -1
  103. package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
  104. package/dist/es/utilities/get-component-doc.js +6 -6
  105. package/dist/es/utilities/get-component-doc.js.map +1 -1
  106. package/dist/es/utilities/warning/children-as-trigger.js +9 -8
  107. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  108. package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
  109. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  110. package/dist/es/utilities/warning/deprecated-property.js +9 -8
  111. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  112. package/dist/es/utilities/warning/removal-version.js +6 -0
  113. package/dist/es/utilities/warning/removal-version.js.map +1 -0
  114. package/dist/llms/components/accordion.md +267 -0
  115. package/dist/llms/components/alert.md +228 -0
  116. package/dist/llms/components/avatar.md +167 -0
  117. package/dist/llms/components/badge.md +153 -0
  118. package/dist/llms/components/breadcrumb.md +148 -0
  119. package/dist/llms/components/builder-header.examples.md +239 -0
  120. package/dist/llms/components/builder-header.md +736 -0
  121. package/dist/llms/components/button-group.md +167 -0
  122. package/dist/llms/components/button-stateful.md +246 -0
  123. package/dist/llms/components/button.md +661 -0
  124. package/dist/llms/components/card.md +368 -0
  125. package/dist/llms/components/carousel.md +365 -0
  126. package/dist/llms/components/checkbox.md +887 -0
  127. package/dist/llms/components/color-picker.md +591 -0
  128. package/dist/llms/components/combobox.examples.md +802 -0
  129. package/dist/llms/components/combobox.md +929 -0
  130. package/dist/llms/components/date-picker.md +546 -0
  131. package/dist/llms/components/docked-composer.md +173 -0
  132. package/dist/llms/components/dynamic-icon.md +226 -0
  133. package/dist/llms/components/expandable-section.md +198 -0
  134. package/dist/llms/components/files.md +337 -0
  135. package/dist/llms/components/filter.md +775 -0
  136. package/dist/llms/components/icon-settings.md +301 -0
  137. package/dist/llms/components/icon.md +1040 -0
  138. package/dist/llms/components/input.md +746 -0
  139. package/dist/llms/components/media-object.md +125 -0
  140. package/dist/llms/components/menu-dropdown.md +732 -0
  141. package/dist/llms/components/modal.md +504 -0
  142. package/dist/llms/components/page-header.md +282 -0
  143. package/dist/llms/components/panel.md +256 -0
  144. package/dist/llms/components/pill-container.md +218 -0
  145. package/dist/llms/components/pill.md +266 -0
  146. package/dist/llms/components/popover.md +600 -0
  147. package/dist/llms/components/portal-settings.md +371 -0
  148. package/dist/llms/components/progress-bar.md +175 -0
  149. package/dist/llms/components/progress-indicator.md +399 -0
  150. package/dist/llms/components/progress-ring.md +146 -0
  151. package/dist/llms/components/radio-button-group.md +285 -0
  152. package/dist/llms/components/radio-group.md +242 -0
  153. package/dist/llms/components/radio.md +269 -0
  154. package/dist/llms/components/scoped-notification.md +156 -0
  155. package/dist/llms/components/setup-assistant.md +398 -0
  156. package/dist/llms/components/simple-data-table.examples.md +2773 -0
  157. package/dist/llms/components/simple-data-table.md +919 -0
  158. package/dist/llms/components/slider.md +217 -0
  159. package/dist/llms/components/spinner.md +232 -0
  160. package/dist/llms/components/split-view.md +350 -0
  161. package/dist/llms/components/tabs.md +311 -0
  162. package/dist/llms/components/textarea.md +331 -0
  163. package/dist/llms/components/toast.md +267 -0
  164. package/dist/llms/components/tooltip.md +470 -0
  165. package/dist/llms/components/tree.md +1011 -0
  166. package/dist/llms/components/trial-bar.md +383 -0
  167. package/dist/llms/components/vertical-navigation.md +196 -0
  168. package/dist/llms/components/visual-picker.md +362 -0
  169. package/dist/llms/components/welcome-mat.md +885 -0
  170. package/dist/llms/docs/migration-v11.md +471 -0
  171. package/dist/llms/llms-full.txt +6874 -0
  172. package/dist/llms/llms.txt +133 -0
  173. package/dist/llms/rules.md +36 -0
  174. package/dist/types/components/accordion/index.d.ts.map +1 -1
  175. package/dist/types/components/accordion/panel.d.ts +7 -7
  176. package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
  177. package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
  178. package/dist/types/components/builder-header/nav-link.d.ts +0 -1
  179. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  180. package/dist/types/components/builder-header/toolbar.d.ts +0 -1
  181. package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
  182. package/dist/types/components/button/index.d.ts +6 -3
  183. package/dist/types/components/button/index.d.ts.map +1 -1
  184. package/dist/types/components/button-stateful/index.d.ts +4 -1
  185. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  186. package/dist/types/components/checkbox/index.d.ts +19 -5
  187. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  188. package/dist/types/components/color-picker/color-picker.d.ts +6 -4
  189. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  190. package/dist/types/components/color-picker/types.d.ts +2 -2
  191. package/dist/types/components/combobox/combobox.d.ts +22 -0
  192. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  193. package/dist/types/components/date-picker/date-picker.d.ts +16 -4
  194. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  195. package/dist/types/components/date-picker/index.d.ts +2 -6
  196. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  197. package/dist/types/components/files/file.d.ts +1 -1
  198. package/dist/types/components/icon/index.d.ts +1 -0
  199. package/dist/types/components/icon/index.d.ts.map +1 -1
  200. package/dist/types/components/icon/input-icon/index.d.ts +3 -0
  201. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  202. package/dist/types/components/icon-settings/index.d.ts.map +1 -1
  203. package/dist/types/components/input/index.d.ts +2 -1
  204. package/dist/types/components/input/index.d.ts.map +1 -1
  205. package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
  206. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  207. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +4 -0
  208. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  209. package/dist/types/components/modal/index.d.ts +5 -5
  210. package/dist/types/components/page-header/types.d.ts +3 -0
  211. package/dist/types/components/page-header/types.d.ts.map +1 -1
  212. package/dist/types/components/panel/filtering/group.d.ts +2 -0
  213. package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
  214. package/dist/types/components/pill/index.d.ts +1 -0
  215. package/dist/types/components/pill/index.d.ts.map +1 -1
  216. package/dist/types/components/popover/edit-dialog.d.ts +1 -3
  217. package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
  218. package/dist/types/components/popover/popover.d.ts +1 -0
  219. package/dist/types/components/popover/popover.d.ts.map +1 -1
  220. package/dist/types/components/progress-indicator/index.d.ts +1 -0
  221. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  222. package/dist/types/components/progress-ring/index.d.ts +1 -0
  223. package/dist/types/components/progress-ring/index.d.ts.map +1 -1
  224. package/dist/types/components/radio/index.d.ts +2 -2
  225. package/dist/types/components/radio/index.d.ts.map +1 -1
  226. package/dist/types/components/radio-group/index.d.ts +2 -0
  227. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  228. package/dist/types/components/scoped-notification/index.d.ts +1 -0
  229. package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
  230. package/dist/types/components/setup-assistant/step.d.ts +0 -1
  231. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  232. package/dist/types/components/simple-data-table/types.d.ts +1 -0
  233. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  234. package/dist/types/components/slider/index.d.ts +4 -2
  235. package/dist/types/components/slider/index.d.ts.map +1 -1
  236. package/dist/types/components/tabs/index.d.ts +1 -0
  237. package/dist/types/components/tabs/index.d.ts.map +1 -1
  238. package/dist/types/components/tabs/panel.d.ts +2 -1
  239. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  240. package/dist/types/components/textarea/index.d.ts +9 -40
  241. package/dist/types/components/textarea/index.d.ts.map +1 -1
  242. package/dist/types/components/tooltip/index.d.ts +5 -0
  243. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  244. package/dist/types/components/tree/tree.d.ts +5 -0
  245. package/dist/types/components/tree/tree.d.ts.map +1 -1
  246. package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
  247. package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
  248. package/package.json +8 -5
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.cjs","names":[],"sources":["../../../../components/date-picker/date-picker.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\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside, useControllableState } from '../../utilities/hooks';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\t/**\n\t * The requested date: the selected calendar date, or the result of `parser` for typed text.\n\t * `null` when the input is cleared.\n\t */\n\tdate: Date | null;\n\t/** The formatted date, or the typed text */\n\tformattedDate: string;\n\t/** `date.getTimezoneOffset()`, or the current offset when `date` is `null` */\n\ttimezoneOffset: number;\n}\n\n/**\n * What caused the DatePicker to request opening its calendar.\n * - `input-click`: the input was clicked\n * - `icon-click`: the calendar icon button was clicked\n * - `keyboard`: Down or Up arrow was pressed in the input\n */\nexport type DatePickerRequestOpenTrigger =\n\t'input-click' | 'icon-click' | 'keyboard';\n\n/** Data passed to `onRequestOpen` */\nexport interface DatePickerRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: DatePickerRequestOpenTrigger;\n}\n\n/**\n * What caused the DatePicker to request closing its calendar.\n * - `date-select`: a date was selected in the calendar (click, Space, or Enter)\n * - `escape`: Escape was pressed in the input or in the calendar\n * - `enter`: Enter was pressed in the input\n * - `click-outside`: a mousedown/touchstart happened outside the DatePicker\n * - `input-change`: the user typed in the input\n */\nexport type DatePickerRequestCloseTrigger =\n\t'date-select' | 'escape' | 'enter' | 'click-outside' | 'input-change';\n\n/** Data passed to `onRequestClose` */\nexport interface DatePickerRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: DatePickerRequestCloseTrigger;\n}\n\n/** Data passed to `onClose` */\n/** Which way keyboard focus left the calendar grid: past the last day, or before the first. */\nexport type DatePickerFocusDirection = 'next' | 'previous';\n\nexport interface DatePickerCloseData {\n\t/**\n\t * `true` when the close was reported by the calendar dialog unmounting. The calendar\n\t * dialog is unmounted whenever the DatePicker closes, so this is currently always `true`.\n\t */\n\tcomponentWillUnmount: boolean;\n}\n\nexport type DatePickerChangeHandler = (\n\tevent: React.SyntheticEvent,\n\tdata: DatePickerChangeData\n) => void;\n\n/**\n * `onChange` is required unless the date picker is `disabled`: DatePicker is\n * controlled, so without it picking a date does nothing.\n */\nexport type DatePickerChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the user selects a date in the calendar or types in the input. `value` is\n\t\t\t * controlled: set it to `data.date` here (or keep the old value to reject the change).\n\t\t\t * Clearing the input reports `date: null`. Required unless `disabled` is set.\n\t\t\t */\n\t\t\tonChange: DatePickerChangeHandler;\n\t }\n\t| { disabled: true; onChange?: DatePickerChangeHandler };\n\ninterface DatePickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled. Receives `{ date }`. */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** Date formatting function. Called with `null` when there is no date. */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/**\n\t * Initial open state of the calendar when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the calendar is open. When set, the calendar is controlled: it never opens or closes\n\t * itself, so update it from `onRequestOpen` and `onRequestClose`. When `undefined`, the calendar\n\t * manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/**\n\t * Called when keyboard focus moves to another day. `event` is the keyboard event, or\n\t * `undefined` when focus moves because a new month rendered.\n\t */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: {\n\t\t\tdate?: Date;\n\t\t\tref?: HTMLElement;\n\t\t\tdirection?: DatePickerFocusDirection;\n\t\t}\n\t) => void;\n\t/**\n\t * Called after the calendar has closed. `event` is `undefined` because the close\n\t * is reported when the calendar dialog unmounts, not by a user event.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: DatePickerCloseData\n\t) => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the calendar requests to close. Only fires while the calendar is open.\n\t * `event` is the triggering React event; for `trigger: 'click-outside'` it is the\n\t * native `mousedown`/`touchstart` event from the document listener. It is typed as\n\t * possibly `undefined` because the internal calendar's close request has an optional event.\n\t * When `isOpen` is `undefined` the calendar also closes itself; when `isOpen` is set,\n\t * set it to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\tdata: DatePickerRequestCloseData\n\t) => void;\n\t/**\n\t * Called when the calendar requests to open (input click, icon click, or Down/Up arrow).\n\t * When `isOpen` is `undefined` the calendar also opens itself; when `isOpen` is set, set it\n\t * to `true` here. Not fired by the arrow keys while already open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\tdata: DatePickerRequestOpenData\n\t) => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Selected date, or `null` for no date. Required and controlled: the input and calendar\n\t * always reflect it, and the input's typed text is reset from it whenever it changes.\n\t * Update it from `onChange`. (`undefined` is treated as `null` and warns in development.)\n\t */\n\tvalue: Date | null;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\nexport type DatePickerProps = DatePickerBaseProps & DatePickerChangeProps;\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\nconst isDate = (date: unknown): date is Date =>\n\tObject.prototype.toString.call(date) === '[object Date]';\n\n/**\n * Stable identity of a `value`, so a parent passing `new Date(...)` on every render does not\n * re-sync the typed text. Invalid dates share one key.\n */\nconst getDateKey = (date: Date | null): string =>\n\tdate ? String(date.getTime()) : 'null';\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tdefaultIsOpen = false,\n\t\tformatter = defaultFormatter,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue: valueProp,\n\t\t// Deprecated props\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useId();\n\n\t// `value` is controlled data; `undefined` (warned in `checkProps`) means no date\n\tconst value = valueProp ?? null;\n\tconst valueKey = getDateKey(value);\n\n\t// State\n\t// The calendar's open state is ephemeral UI: controlled when `isOpen` is set\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\t// The input's text is a buffer so it can hold partial input. `valueKey` is the `value` it was\n\t// last synced from, and `typedKey` the date reported for the typed text.\n\tconst [inputBuffer, setInputBuffer] = useState<{\n\t\ttext: string;\n\t\tvalueKey: string;\n\t\ttypedKey: string | null;\n\t}>(() => ({ text: formatter(value), valueKey, typedKey: null }));\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Re-sync the typed text whenever `value` changes, unless the change is the parent accepting\n\t// the date that was just typed (so the user's text is not reformatted mid-typing)\n\tif (inputBuffer.valueKey !== valueKey) {\n\t\tsetInputBuffer({\n\t\t\ttext:\n\t\t\t\tinputBuffer.typedKey === valueKey ? inputBuffer.text : formatter(value),\n\t\t\tvalueKey,\n\t\t\ttypedKey: null,\n\t\t});\n\t}\n\tconst inputValue = inputBuffer.text;\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId, [idProp, generatedId]);\n\n\tconst getIsOpen = useCallback(() => !!isOpen, [isOpen]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (!isDate(parsedDate) || isNaN(parsedDate.getTime())) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\t\tdata: DatePickerRequestCloseData\n\t\t) => {\n\t\t\t// Only request a close while open, so `onRequestClose` never fires when\n\t\t\t// the calendar is already closed (e.g. Escape in a closed input).\n\t\t\tif (!getIsOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonRequestClose?.(event, data);\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onRequestClose, getIsOpen, setIsOpen]\n\t);\n\n\tconst handleCalendarRequestClose = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\t// The calendar's only close request is Escape (see `CalendarWrapper#handleKeyDown`)\n\t\t\thandleRequestClose(event, { trigger: 'escape' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tonClose?.(event, {\n\t\t\t\tcomponentWillUnmount: !!data?.componentWillUnmount,\n\t\t\t});\n\t\t},\n\t\t[onClose]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\t\tdata: DatePickerRequestOpenData,\n\t\t\tfromIcon = false\n\t\t) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(true);\n\t\t\tonRequestOpen?.(event, data);\n\t\t},\n\t\t[onRequestOpen, setIsOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpenFromIcon(true);\n\t\t\topenDialog(event, { trigger: 'icon-click' }, true);\n\t\t},\n\t\t[openDialog]\n\t);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\thandleRequestClose(event, { trigger: 'date-select' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst text = event.target.value;\n\t\t\t// Clearing the input requests no date. `parser` is typed to return a `Date`, but guard\n\t\t\t// against parsers that return `null` for partial input.\n\t\t\tconst parsedDate = text === '' ? null : parser(text);\n\t\t\tconst date = isDate(parsedDate) ? parsedDate : null;\n\n\t\t\tsetInputBuffer((buffer) => ({\n\t\t\t\t...buffer,\n\t\t\t\ttext,\n\t\t\t\ttypedKey: getDateKey(date),\n\t\t\t}));\n\n\t\t\t// Typing closes the calendar, through the same request path as the keyboard and mouse\n\t\t\thandleRequestClose(event, { trigger: 'input-change' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: text,\n\t\t\t\t\ttimezoneOffset: (date ?? new Date()).getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[handleRequestClose, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.key &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.key === KEYS.DOWN || event.key === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\t// Go through the same request path as clicking, so a controlled\n\t\t\t\t// DatePicker hears about keyboard opens via `onRequestOpen`\n\t\t\t\tif (!getIsOpen()) {\n\t\t\t\t\topenDialog(event, { trigger: 'keyboard' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === KEYS.ESCAPE || event.key === KEYS.ENTER) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\thandleRequestClose(event, {\n\t\t\t\t\ttrigger: event.key === KEYS.ESCAPE ? 'escape' : 'enter',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, openDialog, handleRequestClose, onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent | TouchEvent) => {\n\t\t\thandleRequestClose(event, { trigger: 'click-outside' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleCalendarRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleCalendarRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\topenDialogFromIcon(event);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst inputRenderProps = (input?.props || {}) as Record<string, unknown>;\n\n\t\t// The `input` element's props win, except `onChange` and\n\t\t// `inputRef`: the picker needs its own to track typed text and to return focus to the input\n\t\t// on close, so both are called.\n\t\tconst consumerProps = inputRenderProps;\n\t\tconst consumerOnChange = consumerProps.onChange as\n\t\t\t((...args: unknown[]) => void) | undefined;\n\t\tconst consumerInputRef = consumerProps.inputRef as\n\t\t\tReact.Ref<HTMLInputElement> | undefined;\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...inputRenderProps,\n\t\t\tonChange: (event: ChangeEvent<HTMLInputElement>, ...rest: unknown[]) => {\n\t\t\t\tconsumerOnChange?.(event, ...rest);\n\t\t\t\thandleInputChange(event);\n\t\t\t},\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tif (typeof consumerInputRef === 'function') {\n\t\t\t\t\tconsumerInputRef(component);\n\t\t\t\t} else if (consumerInputRef) {\n\t\t\t\t\t(\n\t\t\t\t\t\tconsumerInputRef as React.RefObject<HTMLInputElement | null>\n\t\t\t\t\t).current = component;\n\t\t\t\t}\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t};\n\t}, [\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\trequired,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tconst inputToRender = <Input {...(inputProps as any)} />;\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n"],"mappings":"yxBAkPA,IAAM,GAA0D,CAC/D,UAAW,aACX,aAAc,gBACd,cAAe,iBACf,KAAM,MACP,EAEM,GAA4C,CACjD,oBAAqB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EACrE,MAAO,GACP,OAAQ,CACP,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,UACD,EACA,YAAa,cACb,MAAO,QACP,SAAU,CACT,SACA,SACA,UACA,YACA,WACA,SACA,UACD,CACD,EAEM,GAAoB,GAClB,EACJ,GAAG,EAAK,SAAS,EAAI,EAAE,GAAG,EAAK,QAAQ,EAAE,GAAG,EAAK,YAAY,IAC7D,GAGE,GAAiB,IACtB,EAAA,QACC,GACA,2JACD,EACO,IAAI,KAAK,CAAG,GAGd,EAAU,GACf,OAAO,UAAU,SAAS,KAAK,CAAI,IAAM,gBAMpC,EAAc,GACnB,EAAO,OAAO,EAAK,QAAQ,CAAC,EAAI,OAI3B,EAAyC,GAAU,CACxD,GAAM,CACL,cAAe,EAAoB,CAAC,EACpC,QAAQ,OACR,YACA,WACA,oBAAqB,GACrB,iBAAgB,GAChB,YAAY,GACZ,YACA,sBACA,GAAI,GACJ,SACA,OAAQ,GACR,gBACA,OAAQ,GAAa,CAAC,EACtB,eAAe,WACf,kBACA,WACA,UACA,SACA,iBACA,gBACA,SAAS,GACT,cACA,mBAAmB,IACnB,iBAAiB,GACjB,oBACA,MA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AD,CACC,cAAe,CACd,KAAM,EAAc,YACrB,EACA,gBAAA,GACA,gBAAe,EAAU,EACzB,SAAS,UACT,KAAK,QACL,QAAU,GAA4B,CACrC,GAAmB,CAAK,CACzB,EACA,KAAK,QACL,CAAA,EAEF,SAAW,GAAuC,CACjD,EAAoB,CAAS,CAC9B,EACA,GAAI,EAAM,EACV,SAAU,EACV,QAAU,GAA8C,CACvD,EAAW,EAAO,CAAE,QAAS,aAAc,CAAC,CAC7C,EACA,UAAW,GACX,MAAO,EACR,EAEM,EAAmC,CACxC,WACA,MAAO,EAAO,MACd,SACA,UACA,YAAa,EAAO,YACpB,UACD,EAEM,EAAoB,IAAO,OAAS,CAAC,EAKrC,EAAgB,EAChB,EAAmB,EAAc,SAEjC,EAAmB,EAAc,SAGvC,MAAO,CACN,GAAG,EACH,GAAG,EACH,GAAG,EACH,UAAW,EAAsC,GAAG,IAAoB,CACvE,IAAmB,EAAO,GAAG,CAAI,EACjC,EAAkB,CAAK,CACxB,EACA,SAAW,GAAuC,CAC7C,OAAO,GAAqB,WAC/B,EAAiB,CAAS,EAChB,IACV,EAEE,QAAU,GAEb,EAAoB,CAAS,CAC9B,CACD,CACD,EAAG,CACF,EAAc,aACd,EACA,GACA,EACA,EACA,EACA,EACA,GACA,GACA,EACA,EAAO,MACP,EAAO,YACP,EACA,EACA,EACA,EACD,CAImB,CAAA,CAAc,EAG3B,IAAgB,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CAAO,GAAK,EAAqB,CAAA,EAEvD,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,IAAK,EACL,WAAA,EAAW,EAAA,QAAA,CACV,wBACA,8BACA,8BACA,CACC,iBAAkB,GAClB,eAAgB,EAAU,CAC3B,EACA,EACD,EAXD,SAAA,CAaE,GACA,GAAU,CACP,GAEP,EAEA,EAAW,YAAc,EAAA"}
1
+ {"version":3,"file":"date-picker.cjs","names":[],"sources":["../../../../components/date-picker/date-picker.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\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside, useControllableState } from '../../utilities/hooks';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\t/** Label of the next-month button. Defaults to the English text `Next month`. */\n\tnextMonth?: string;\n\t/** Label of the input's calendar button. Defaults to the English text `Open Calendar`. */\n\topenCalendar?: string;\n\t/** Label of the previous-month button. Defaults to the English text `Previous month`. */\n\tpreviousMonth?: string;\n\t/** Label of the year picklist. Defaults to the English text `Year`. */\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\t/** Seven short weekday names, starting with Sunday, for the calendar's column headings. Defaults to English (`Sun` … `Sat`). */\n\tabbreviatedWeekDays?: string[];\n\t/** Visible label above the input. */\n\tlabel?: string;\n\t/** Twelve month names, starting with January. Defaults to English. */\n\tmonths?: string[];\n\t/** Input placeholder. Defaults to the English text `Pick a Date`. */\n\tplaceholder?: string;\n\t/** The link that selects today's date. Defaults to the English text `Today`. */\n\ttoday?: string;\n\t/** Seven full weekday names, starting with Sunday, read as the column headings' titles. Defaults to English. */\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\t/**\n\t * The requested date: the selected calendar date, or the result of `parser` for typed text.\n\t * `null` when the input is cleared.\n\t */\n\tdate: Date | null;\n\t/** The formatted date, or the typed text */\n\tformattedDate: string;\n\t/** `date.getTimezoneOffset()`, or the current offset when `date` is `null` */\n\ttimezoneOffset: number;\n}\n\n/**\n * What caused the DatePicker to request opening its calendar.\n * - `input-click`: the input was clicked\n * - `icon-click`: the calendar icon button was clicked\n * - `keyboard`: Down or Up arrow was pressed in the input\n */\nexport type DatePickerRequestOpenTrigger =\n\t'input-click' | 'icon-click' | 'keyboard';\n\n/** Data passed to `onRequestOpen` */\nexport interface DatePickerRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: DatePickerRequestOpenTrigger;\n}\n\n/**\n * What caused the DatePicker to request closing its calendar.\n * - `date-select`: a date was selected in the calendar (click, Space, or Enter)\n * - `escape`: Escape was pressed in the input or in the calendar\n * - `enter`: Enter was pressed in the input\n * - `click-outside`: a mousedown/touchstart happened outside the DatePicker\n * - `input-change`: the user typed in the input\n */\nexport type DatePickerRequestCloseTrigger =\n\t'date-select' | 'escape' | 'enter' | 'click-outside' | 'input-change';\n\n/** Data passed to `onRequestClose` */\nexport interface DatePickerRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: DatePickerRequestCloseTrigger;\n}\n\n/** Data passed to `onClose` */\n/** Which way keyboard focus left the calendar grid: past the last day, or before the first. */\nexport type DatePickerFocusDirection = 'next' | 'previous';\n\nexport interface DatePickerCloseData {\n\t/**\n\t * `true` when the close was reported by the calendar dialog unmounting. The calendar\n\t * dialog is unmounted whenever the DatePicker closes, so this is currently always `true`.\n\t */\n\tcomponentWillUnmount: boolean;\n}\n\nexport type DatePickerChangeHandler = (\n\tevent: React.SyntheticEvent,\n\tdata: DatePickerChangeData\n) => void;\n\n/**\n * `onChange` is required unless the date picker is `disabled`: DatePicker is\n * controlled, so without it picking a date does nothing.\n */\nexport type DatePickerChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the user selects a date in the calendar or types in the input. `value` is\n\t\t\t * controlled: set it to `data.date` here (or keep the old value to reject the change).\n\t\t\t * Clearing the input reports `date: null`. Required unless `disabled` is set.\n\t\t\t */\n\t\t\tonChange: DatePickerChangeHandler;\n\t }\n\t| {\n\t\t\t/** Disables the date picker. */\n\t\t\tdisabled: true;\n\t\t\t/** Called on change. Optional while disabled. */\n\t\t\tonChange?: DatePickerChangeHandler;\n\t };\n\ninterface DatePickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled. Receives `{ date }`. */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** Date formatting function. Called with `null` when there is no date. */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/**\n\t * Initial open state of the calendar when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the calendar is open. When set, the calendar is controlled: it never opens or closes\n\t * itself, so update it from `onRequestOpen` and `onRequestClose`. When `undefined`, the calendar\n\t * manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/**\n\t * Called when keyboard focus moves to another day. `event` is the keyboard event, or\n\t * `undefined` when focus moves because a new month rendered.\n\t */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: {\n\t\t\tdate?: Date;\n\t\t\tref?: HTMLElement;\n\t\t\tdirection?: DatePickerFocusDirection;\n\t\t}\n\t) => void;\n\t/**\n\t * Called after the calendar has closed. `event` is `undefined` because the close\n\t * is reported when the calendar dialog unmounts, not by a user event.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: DatePickerCloseData\n\t) => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the calendar requests to close. Only fires while the calendar is open.\n\t * `event` is the triggering React event; for `trigger: 'click-outside'` it is the\n\t * native `mousedown`/`touchstart` event from the document listener. It is typed as\n\t * possibly `undefined` because the internal calendar's close request has an optional event.\n\t * When `isOpen` is `undefined` the calendar also closes itself; when `isOpen` is set,\n\t * set it to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\tdata: DatePickerRequestCloseData\n\t) => void;\n\t/**\n\t * Called when the calendar requests to open (input click, icon click, or Down/Up arrow).\n\t * When `isOpen` is `undefined` the calendar also opens itself; when `isOpen` is set, set it\n\t * to `true` here. Not fired by the arrow keys while already open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\tdata: DatePickerRequestOpenData\n\t) => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Selected date, or `null` for no date. Required and controlled: the input and calendar\n\t * always reflect it, and the input's typed text is reset from it whenever it changes.\n\t * Update it from `onChange`. (`undefined` is treated as `null` and warns in development.)\n\t */\n\tvalue: Date | null;\n\t/** @deprecated Set `required` on your own `Input` in the `input` prop. Passed to the input. */\n\trequired?: boolean;\n\t/** @deprecated Set `onBlur` on your own `Input` in the `input` prop. Passed to the input. */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** @deprecated Set `onFocus` on your own `Input` in the `input` prop. Passed to the input. */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** @deprecated Set `onKeyDown` on your own `Input` in the `input` prop. Called with `(event, {})` after the date picker's own key handling. */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\nexport type DatePickerProps = DatePickerBaseProps & DatePickerChangeProps;\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\nconst isDate = (date: unknown): date is Date =>\n\tObject.prototype.toString.call(date) === '[object Date]';\n\n/**\n * Stable identity of a `value`, so a parent passing `new Date(...)` on every render does not\n * re-sync the typed text. Invalid dates share one key.\n */\nconst getDateKey = (date: Date | null): string =>\n\tdate ? String(date.getTime()) : 'null';\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tdefaultIsOpen = false,\n\t\tformatter = defaultFormatter,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue: valueProp,\n\t\t// Deprecated props\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useId();\n\n\t// `value` is controlled data; `undefined` (warned in `checkProps`) means no date\n\tconst value = valueProp ?? null;\n\tconst valueKey = getDateKey(value);\n\n\t// State\n\t// The calendar's open state is ephemeral UI: controlled when `isOpen` is set\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\t// The input's text is a buffer so it can hold partial input. `valueKey` is the `value` it was\n\t// last synced from, and `typedKey` the date reported for the typed text.\n\tconst [inputBuffer, setInputBuffer] = useState<{\n\t\ttext: string;\n\t\tvalueKey: string;\n\t\ttypedKey: string | null;\n\t}>(() => ({ text: formatter(value), valueKey, typedKey: null }));\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Re-sync the typed text whenever `value` changes, unless the change is the parent accepting\n\t// the date that was just typed (so the user's text is not reformatted mid-typing)\n\tif (inputBuffer.valueKey !== valueKey) {\n\t\tsetInputBuffer({\n\t\t\ttext:\n\t\t\t\tinputBuffer.typedKey === valueKey ? inputBuffer.text : formatter(value),\n\t\t\tvalueKey,\n\t\t\ttypedKey: null,\n\t\t});\n\t}\n\tconst inputValue = inputBuffer.text;\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId, [idProp, generatedId]);\n\n\tconst getIsOpen = useCallback(() => !!isOpen, [isOpen]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (!isDate(parsedDate) || isNaN(parsedDate.getTime())) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\t\tdata: DatePickerRequestCloseData\n\t\t) => {\n\t\t\t// Only request a close while open, so `onRequestClose` never fires when\n\t\t\t// the calendar is already closed (e.g. Escape in a closed input).\n\t\t\tif (!getIsOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonRequestClose?.(event, data);\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onRequestClose, getIsOpen, setIsOpen]\n\t);\n\n\tconst handleCalendarRequestClose = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\t// The calendar's only close request is Escape (see `CalendarWrapper#handleKeyDown`)\n\t\t\thandleRequestClose(event, { trigger: 'escape' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tonClose?.(event, {\n\t\t\t\tcomponentWillUnmount: !!data?.componentWillUnmount,\n\t\t\t});\n\t\t},\n\t\t[onClose]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\t\tdata: DatePickerRequestOpenData,\n\t\t\tfromIcon = false\n\t\t) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(true);\n\t\t\tonRequestOpen?.(event, data);\n\t\t},\n\t\t[onRequestOpen, setIsOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpenFromIcon(true);\n\t\t\topenDialog(event, { trigger: 'icon-click' }, true);\n\t\t},\n\t\t[openDialog]\n\t);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\thandleRequestClose(event, { trigger: 'date-select' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst text = event.target.value;\n\t\t\t// Clearing the input requests no date. `parser` is typed to return a `Date`, but guard\n\t\t\t// against parsers that return `null` for partial input.\n\t\t\tconst parsedDate = text === '' ? null : parser(text);\n\t\t\tconst date = isDate(parsedDate) ? parsedDate : null;\n\n\t\t\tsetInputBuffer((buffer) => ({\n\t\t\t\t...buffer,\n\t\t\t\ttext,\n\t\t\t\ttypedKey: getDateKey(date),\n\t\t\t}));\n\n\t\t\t// Typing closes the calendar, through the same request path as the keyboard and mouse\n\t\t\thandleRequestClose(event, { trigger: 'input-change' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: text,\n\t\t\t\t\ttimezoneOffset: (date ?? new Date()).getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[handleRequestClose, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.key &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.key === KEYS.DOWN || event.key === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\t// Go through the same request path as clicking, so a controlled\n\t\t\t\t// DatePicker hears about keyboard opens via `onRequestOpen`\n\t\t\t\tif (!getIsOpen()) {\n\t\t\t\t\topenDialog(event, { trigger: 'keyboard' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Only trap Enter and Escape while the calendar is open, so a closed\n\t\t\t// DatePicker still lets Enter submit its form and Escape reach a\n\t\t\t// surrounding dialog\n\t\t\tif (\n\t\t\t\tgetIsOpen() &&\n\t\t\t\t(event.key === KEYS.ESCAPE || event.key === KEYS.ENTER)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\thandleRequestClose(event, {\n\t\t\t\t\ttrigger: event.key === KEYS.ESCAPE ? 'escape' : 'enter',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, openDialog, handleRequestClose, onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent | TouchEvent) => {\n\t\t\thandleRequestClose(event, { trigger: 'click-outside' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleCalendarRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleCalendarRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\topenDialogFromIcon(event);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst inputRenderProps = (input?.props || {}) as Record<string, unknown>;\n\n\t\t// The `input` element's props win, except `onChange` and\n\t\t// `inputRef`: the picker needs its own to track typed text and to return focus to the input\n\t\t// on close, so both are called.\n\t\tconst consumerProps = inputRenderProps;\n\t\tconst consumerOnChange = consumerProps.onChange as\n\t\t\t((...args: unknown[]) => void) | undefined;\n\t\tconst consumerInputRef = consumerProps.inputRef as\n\t\t\tReact.Ref<HTMLInputElement> | undefined;\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...inputRenderProps,\n\t\t\tonChange: (event: ChangeEvent<HTMLInputElement>, ...rest: unknown[]) => {\n\t\t\t\tconsumerOnChange?.(event, ...rest);\n\t\t\t\thandleInputChange(event);\n\t\t\t},\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tif (typeof consumerInputRef === 'function') {\n\t\t\t\t\tconsumerInputRef(component);\n\t\t\t\t} else if (consumerInputRef) {\n\t\t\t\t\t(\n\t\t\t\t\t\tconsumerInputRef as React.RefObject<HTMLInputElement | null>\n\t\t\t\t\t).current = component;\n\t\t\t\t}\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t};\n\t}, [\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\trequired,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tconst inputToRender = <Input {...(inputProps as any)} />;\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n"],"mappings":"yxBAiQA,IAAM,GAA0D,CAC/D,UAAW,aACX,aAAc,gBACd,cAAe,iBACf,KAAM,MACP,EAEM,GAA4C,CACjD,oBAAqB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EACrE,MAAO,GACP,OAAQ,CACP,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,UACD,EACA,YAAa,cACb,MAAO,QACP,SAAU,CACT,SACA,SACA,UACA,YACA,WACA,SACA,UACD,CACD,EAEM,GAAoB,GAClB,EACJ,GAAG,EAAK,SAAS,EAAI,EAAE,GAAG,EAAK,QAAQ,EAAE,GAAG,EAAK,YAAY,IAC7D,GAGE,GAAiB,IACtB,EAAA,QACC,GACA,2JACD,EACO,IAAI,KAAK,CAAG,GAGd,EAAU,GACf,OAAO,UAAU,SAAS,KAAK,CAAI,IAA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AgB,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CAAO,GAAK,EAAqB,CAAA,EAEvD,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,IAAK,EACL,WAAA,EAAW,EAAA,QAAA,CACV,wBACA,8BACA,8BACA,CACC,iBAAkB,GAClB,eAAgB,EAAU,CAC3B,EACA,EACD,EAXD,SAAA,CAaE,GACA,GAAU,CACP,GAEP,EAEA,EAAW,YAAc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/date-picker/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 { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n\tDatePickerChangeHandler,\n\tDatePickerChangeProps,\n\tDatePickerCloseData,\n\tDatePickerFocusDirection,\n\tDatePickerRequestCloseData,\n\tDatePickerRequestCloseTrigger,\n\tDatePickerRequestOpenData,\n\tDatePickerRequestOpenTrigger,\n} from './date-picker';\n\n/**\n * DatePicker wrapper preserved for markup/backwards compatibility.\n *\n * Click-outside detection now lives inside the DatePicker component itself\n * (see `date-picker.tsx`) so it can call the internal close handler directly\n * and work for both controlled and uncontrolled usage. This replaces the\n * react-onclickoutside HOC that was removed for React 19 compatibility.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":"0LA6BA,IAAM,GAAA,EAA6B,EAAA,WAAA,EACjC,EAAO,KACP,EAAA,EAAA,IAAA,CAAC,MAAD,CAAA,UACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAY,GAAI,CAAQ,CAAA,CACpB,CAAA,CAEP,EAEA,EAA2B,YAAc"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/date-picker/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 { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n\tDatePickerChangeHandler,\n\tDatePickerChangeProps,\n\tDatePickerCloseData,\n\tDatePickerFocusDirection,\n\tDatePickerRequestCloseData,\n\tDatePickerRequestCloseTrigger,\n\tDatePickerRequestOpenData,\n\tDatePickerRequestOpenTrigger,\n} from './date-picker';\n\n// This wrapper keeps the markup of the old click-outside HOC. Click-outside\n// detection now lives in `date-picker.tsx`, so it can call the internal close\n// handler directly, for controlled and uncontrolled use.\n\n/**\n * A date input with a calendar popover. The user types a date or picks one\n * from the calendar. Pass the date in `value` and update it from `onChange`.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":"0LA6BA,IAAM,GAAA,EAA6B,EAAA,WAAA,EACjC,EAAO,KACP,EAAA,EAAA,IAAA,CAAC,MAAD,CAAA,UACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAY,GAAI,CAAQ,CAAA,CACpB,CAAA,CAEP,EAEA,EAA2B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"file.cjs","names":[],"sources":["../../../../components/files/file.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Files design pattern](https://lightningdesignsystem.com/components/files/) in React.\n// Based on SLDS v2.4.0\nimport React, { type ReactElement, type ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_FILE } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport type { IconProps } from '../icon';\nimport type { MenuDropdownProps } from '../menu-dropdown';\nimport FileFigure from './private/file-figure';\nimport FileActions from './private/file-actions';\n\nconst displayName = FILES_FILE;\n\nexport interface FileAssistiveText {\n\tdownload?: string;\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * download - description for the download button if present\n\t * * image - description for the file image\n\t * * link - description for the file link\n\t * * loading - description for the loading spinner if present\n\t * * moreActions - description for the more actions dropdown if present\n\t */\n\tassistiveText?: FileAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Controls different cropping aspect ratios for the component. Inside `Files`, defaults to its `crop`; otherwise `16-by-9`.\n\t */\n\tcrop?: '16-by-9' | '4-by-3' | '1-by-1';\n\t/**\n\t * `Icon` shown in the top left corner of the file. Its `containerClassName` is added to the file's own classes.\n\t */\n\texternalIcon?: ReactElement<IconProps>;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Href attribute for image. Defaults to `#`, which does not navigate, so `onClickImage`\n\t * can handle the click without a URL.\n\t */\n\thref?: string;\n\t/**\n\t * `Icon` associated with the file. The file renders it in the preview and the title, and sets its `size` in each.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Link to thumbnail image\n\t */\n\timage?: string;\n\t/**\n\t * Controls whether file preview is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the File Component\n\t * * title - title for the file, shown under the preview and used as its name.\n\t */\n\tlabels: {\n\t\ttitle: string;\n\t};\n\t/**\n\t * `MenuDropdown` for the more actions button; doesn't show more actions button if empty.\n\t * The file styles it as an icon button; props you set on it win.\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesn't show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n\t/**\n\t * Function that is called when image is clicked; can be used instead of href for more advanced event handling\n\t */\n\tonClickImage?: (event: React.MouseEvent) => void;\n}\n\nconst defaultProps: Pick<\n\tFileProps,\n\t'assistiveText' | 'hasNoVisibleTitle' | 'href' | 'isLoading'\n> = {\n\tassistiveText: {\n\t\tdownload: 'download',\n\t\tlink: 'Preview:',\n\t\tloading: 'loading',\n\t\tmoreActions: 'more actions',\n\t},\n\thref: '#',\n\tisLoading: false,\n\thasNoVisibleTitle: false,\n};\n\n/**\n * File is a component that represents content uploaded as an attachment.\n */\nclass File extends React.Component<FileProps> {\n\tstatic displayName = displayName;\n\n\tstatic defaultProps = defaultProps;\n\n\t/**\n\t * @deprecated The more-actions button now uses SLDS's `slds-button_last`,\n\t * so this returns `null` and `File` no longer calls it. It will be removed\n\t * in a future major.\n\t */\n\tstatic injectMoreActionsStyles(): ReactNode {\n\t\treturn null;\n\t}\n\n\tgeneratedId: string;\n\n\tconstructor(props: FileProps) {\n\t\tsuper(props);\n\n\t\tthis.generatedId = generateId();\n\t}\n\n\t/**\n\t * Get the File's HTML id. Generate a new one if no ID present.\n\t */\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\thandleOnClickImage = (event: React.MouseEvent) => {\n\t\tif (this.props.href === '#') {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif (this.props.onClickImage) {\n\t\t\tthis.props.onClickImage(event);\n\t\t}\n\t};\n\n\trender() {\n\t\tconst assistiveText = {\n\t\t\t...defaultProps.assistiveText,\n\t\t\t...this.props.assistiveText,\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.getId()}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-file',\n\t\t\t\t\t'slds-file_card',\n\t\t\t\t\t!this.props.hasNoVisibleTitle ? 'slds-has-title' : null,\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<figure>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={this.props.href}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-file__crop',\n\t\t\t\t\t\t\t`slds-file__crop_${this.props.crop ?? '16-by-9'}`\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={this.handleOnClickImage}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FileFigure\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tlabels={{\n\t\t\t\t\t\t\t\ttitle: this.props.labels.title,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisLoading={this.props.isLoading}\n\t\t\t\t\t\t\timage={this.props.image}\n\t\t\t\t\t\t\ticon={this.props.icon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</a>\n\t\t\t\t\t{!this.props.hasNoVisibleTitle ? (\n\t\t\t\t\t\t<figcaption className=\"slds-file__title slds-file__title_card\">\n\t\t\t\t\t\t\t<div className=\"slds-media__figure slds-line-height_reset\">\n\t\t\t\t\t\t\t\t{this.props.icon\n\t\t\t\t\t\t\t\t\t? React.cloneElement(this.props.icon, {\n\t\t\t\t\t\t\t\t\t\t\tsize: 'x-small',\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"slds-file__text slds-truncate\"\n\t\t\t\t\t\t\t\t\ttitle={this.props.labels.title}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{this.props.labels.title}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</figcaption>\n\t\t\t\t\t) : null}\n\t\t\t\t</figure>\n\t\t\t\t{this.props.externalIcon ? (\n\t\t\t\t\t<div className=\"slds-file__external-icon\">\n\t\t\t\t\t\t{React.cloneElement(this.props.externalIcon, {\n\t\t\t\t\t\t\tcontainerClassName: classNames(\n\t\t\t\t\t\t\t\t'slds-file__icon slds-icon_container',\n\t\t\t\t\t\t\t\tthis.props.externalIcon.props.containerClassName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t<FileActions\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thasNoVisibleTitle={this.props.hasNoVisibleTitle}\n\t\t\t\t\tonClickDownload={this.props.onClickDownload}\n\t\t\t\t\tmoreActionsDropdown={this.props.moreActionsDropdown}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default File;\n"],"mappings":"uVAgBA,IAAM,EAAc,EAAA,WA+Ed,EAGF,CACH,cAAe,CACd,SAAU,WACV,KAAM,WACN,QAAS,UACT,YAAa,cACd,EACA,KAAM,IACN,UAAW,GACX,kBAAmB,EACpB,EAKM,EAAN,cAAmB,EAAA,QAAM,SAAqB,CAC7C,OAAO,YAAc,EAErB,OAAO,aAAe,EAOtB,OAAO,yBAAqC,CAC3C,OAAO,IACR,CAEA,YAEA,YAAY,EAAkB,CAC7B,MAAM,CAAK,EAEX,KAAK,YAAc,EAAA,QAAW,CAC/B,CAKA,OAAQ,CACP,OAAO,KAAK,MAAM,IAAM,KAAK,WAC9B,CAEA,mBAAsB,GAA4B,CAC7C,KAAK,M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D,CAAK,UAAU,2BACb,SAAA,EAAA,QAAM,aAAa,KAAK,MAAM,aAAc,CAC5C,oBAAA,EAAoB,EAAA,QAAA,CACnB,sCACA,KAAK,MAAM,aAAa,MAAM,kBAC/B,CACD,CAAC,CACG,CAAA,EACF,MACJ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACf,kBAAmB,KAAK,MAAM,kBAC9B,gBAAiB,KAAK,MAAM,gBAC5B,oBAAqB,KAAK,MAAM,mBAChC,CAAA,CACG,GAEP,CACD"}
1
+ {"version":3,"file":"file.cjs","names":[],"sources":["../../../../components/files/file.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Files design pattern](https://lightningdesignsystem.com/components/files/) in React.\n// Based on SLDS v2.4.0\nimport React, { type ReactElement, type ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_FILE } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport type { IconProps } from '../icon';\nimport type { MenuDropdownProps } from '../menu-dropdown';\nimport FileFigure from './private/file-figure';\nimport FileActions from './private/file-actions';\n\nconst displayName = FILES_FILE;\n\nexport interface FileAssistiveText {\n\tdownload?: string;\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * download - description for the download button if present\n\t * * image - description for the file image\n\t * * link - description for the file link\n\t * * loading - description for the loading spinner if present\n\t * * moreActions - description for the more actions dropdown if present\n\t */\n\tassistiveText?: FileAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Controls different cropping aspect ratios for the component. Inside `Files`, defaults to its `crop`; otherwise `16-by-9`.\n\t */\n\tcrop?: '16-by-9' | '4-by-3' | '1-by-1';\n\t/**\n\t * `Icon` shown in the top left corner of the file. Its `containerClassName` is added to the file's own classes.\n\t */\n\texternalIcon?: ReactElement<IconProps>;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Href attribute for image. Defaults to `#`, which does not navigate, so `onClickImage`\n\t * can handle the click without a URL.\n\t */\n\thref?: string;\n\t/**\n\t * `Icon` associated with the file. The file renders it in the preview and the title, and sets its `size` in each.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Link to thumbnail image\n\t */\n\timage?: string;\n\t/**\n\t * Controls whether file preview is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the File Component\n\t * * title - title for the file, shown under the preview and used as its name.\n\t */\n\tlabels: {\n\t\ttitle: string;\n\t};\n\t/**\n\t * `MenuDropdown` for the more actions button; doesn't show more actions button if empty.\n\t * The file styles it as an icon button; props you set on it win.\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesn't show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n\t/**\n\t * Function that is called when image is clicked; can be used instead of href for more advanced event handling\n\t */\n\tonClickImage?: (event: React.MouseEvent) => void;\n}\n\nconst defaultProps: Pick<\n\tFileProps,\n\t'assistiveText' | 'hasNoVisibleTitle' | 'href' | 'isLoading'\n> = {\n\tassistiveText: {\n\t\tdownload: 'download',\n\t\tlink: 'Preview:',\n\t\tloading: 'loading',\n\t\tmoreActions: 'more actions',\n\t},\n\thref: '#',\n\tisLoading: false,\n\thasNoVisibleTitle: false,\n};\n\n/**\n * File is a component that represents content uploaded as an attachment.\n */\nclass File extends React.Component<FileProps> {\n\tstatic displayName = displayName;\n\n\tstatic defaultProps = defaultProps;\n\n\t/**\n\t * @deprecated The more-actions button now uses SLDS's `slds-button_last`,\n\t * so this returns `null` and `File` no longer calls it. It will be removed\n\t * in 11.0.0.\n\t */\n\tstatic injectMoreActionsStyles(): ReactNode {\n\t\treturn null;\n\t}\n\n\tgeneratedId: string;\n\n\tconstructor(props: FileProps) {\n\t\tsuper(props);\n\n\t\tthis.generatedId = generateId();\n\t}\n\n\t/**\n\t * Get the File's HTML id. Generate a new one if no ID present.\n\t */\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\thandleOnClickImage = (event: React.MouseEvent) => {\n\t\tif (this.props.href === '#') {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif (this.props.onClickImage) {\n\t\t\tthis.props.onClickImage(event);\n\t\t}\n\t};\n\n\trender() {\n\t\tconst assistiveText = {\n\t\t\t...defaultProps.assistiveText,\n\t\t\t...this.props.assistiveText,\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.getId()}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-file',\n\t\t\t\t\t'slds-file_card',\n\t\t\t\t\t!this.props.hasNoVisibleTitle ? 'slds-has-title' : null,\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<figure>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={this.props.href}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-file__crop',\n\t\t\t\t\t\t\t`slds-file__crop_${this.props.crop ?? '16-by-9'}`\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={this.handleOnClickImage}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FileFigure\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tlabels={{\n\t\t\t\t\t\t\t\ttitle: this.props.labels.title,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisLoading={this.props.isLoading}\n\t\t\t\t\t\t\timage={this.props.image}\n\t\t\t\t\t\t\ticon={this.props.icon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</a>\n\t\t\t\t\t{!this.props.hasNoVisibleTitle ? (\n\t\t\t\t\t\t<figcaption className=\"slds-file__title slds-file__title_card\">\n\t\t\t\t\t\t\t<div className=\"slds-media__figure slds-line-height_reset\">\n\t\t\t\t\t\t\t\t{this.props.icon\n\t\t\t\t\t\t\t\t\t? React.cloneElement(this.props.icon, {\n\t\t\t\t\t\t\t\t\t\t\tsize: 'x-small',\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"slds-file__text slds-truncate\"\n\t\t\t\t\t\t\t\t\ttitle={this.props.labels.title}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{this.props.labels.title}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</figcaption>\n\t\t\t\t\t) : null}\n\t\t\t\t</figure>\n\t\t\t\t{this.props.externalIcon ? (\n\t\t\t\t\t<div className=\"slds-file__external-icon\">\n\t\t\t\t\t\t{React.cloneElement(this.props.externalIcon, {\n\t\t\t\t\t\t\tcontainerClassName: classNames(\n\t\t\t\t\t\t\t\t'slds-file__icon slds-icon_container',\n\t\t\t\t\t\t\t\tthis.props.externalIcon.props.containerClassName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t<FileActions\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thasNoVisibleTitle={this.props.hasNoVisibleTitle}\n\t\t\t\t\tonClickDownload={this.props.onClickDownload}\n\t\t\t\t\tmoreActionsDropdown={this.props.moreActionsDropdown}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default File;\n"],"mappings":"uVAgBA,IAAM,EAAc,EAAA,WA+Ed,EAGF,CACH,cAAe,CACd,SAAU,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4CACb,SAAA,KAAK,MAAM,KACT,EAAA,QAAM,aAAa,KAAK,MAAM,KAAM,CACpC,KAAM,SACP,CAAC,EACA,IACC,CAAA,GACL,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,mBACd,UAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,UAAU,gCACV,MAAO,KAAK,MAAM,OAAO,MAExB,SAAA,KAAK,MAAM,OAAO,KACd,CAAA,CACF,CAAA,CACM,CACT,CAAA,CACG,CAAA,CAAA,EACP,KAAK,MAAM,cACX,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,2BACb,SAAA,EAAA,QAAM,aAAa,KAAK,MAAM,aAAc,CAC5C,oBAAA,EAAoB,EAAA,QAAA,CACnB,sCACA,KAAK,MAAM,aAAa,MAAM,kBAC/B,CACD,CAAC,CACG,CAAA,EACF,MACJ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACf,kBAAmB,KAAK,MAAM,kBAC9B,gBAAiB,KAAK,MAAM,gBAC5B,oBAAqB,KAAK,MAAM,mBAChC,CAAA,CACG,GAEP,CACD"}
@@ -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 * @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?: { 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/**\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":"weAgFA,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
+ {"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 +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 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. Still works, 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\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":"klBAmCA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YAoOZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,EAOM,GAAA,EAAQ,EAAA,WAAA,EAEZ,CACC,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,EACjB,mBAAoB,EACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,GACnB,YAAa,GACb,gBAAiB,GACjB,cAAe,GACf,eACA,YACA,aACA,gBACA,WAAW,GACX,YACA,wBACA,gBACA,kBACA,cAAa,GACb,SAAU,EACV,UAAW,EACX,GAAI,GACJ,iBACA,oBACA,SAAU,EACV,WAAW,GACX,QACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,cACA,WACA,YACA,YACA,eACA,WAAW,GACX,WAAW,GACX,QACA,OACA,YACA,kBACA,cACA,QAAO,OACP,QACA,UAAU,QAEX,KACI,CACJ,IAAM,IAAA,EAAc,EAAA,MAAA,CAAM,EACpB,IAAA,EAAmB,EAAA,MAAA,CAAM,EACzB,IAAA,EAAwB,EAAA,MAAA,CAAM,EAC9B,EAAK,IAAU,GACf,GAAU,EAAY,GAAmB,IAAA,GACzC,GAAe,EAAiB,GAAwB,IAAA,GACxD,GACL,CAAC,EAAiB,GAAc,EAAO,CAAC,CACtC,OAAQ,GAAmB,EAAQ,CAAE,CAAC,CACtC,KAAK,GAAG,GAAK,IAAA,GAEV,GAAA,EAAc,EAAA,OAAA,CAAO,CAC1B,aAAc,IACd,aAAc,IACd,WAAY,GACZ,QAAS,IACV,CA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AAD,CACC,wBAAuB,EACvB,oBAAmB,EACnB,gBAAe,EACf,kBAAiB,GACjB,mBAAkB,GAClB,gBAAe,EACf,gBAAe,EACf,YAAW,GACX,gBAAe,GACD,eACd,WAAA,EAAW,EAAA,QAAA,CAAW,CACrB,qBAAsB,IAAY,EAClC,yBAA0B,IAAY,GAAW,CAClD,CAAC,EACD,eAAgB,CACf,UAAW,4BACZ,EACU,WACK,gBACC,kBACJ,cACR,KACM,WACC,YACQ,oBACT,WACC,YACD,WACC,YACD,WACJ,OACE,SACR,SAAU,GACD,UACA,UACA,UACE,YACA,YACC,cACH,WACC,YACA,YACG,eACb,SAAU,EACA,WACA,WACJ,QACS,gBACf,KAAM,IAAY,EAAU,SAAW,GAChC,QACE,UACH,OACI,YACV,MAAO,EACP,CAAA,EACA,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAc,UAAU,0BAC/B,SAAA,CACG,CAAA,EAEL,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAS,UAAU,0BAC1B,SAAA,CACG,CAAA,EAEL,EACG,GAEP,CACD,EAEA,EAAM,YAAc,EAAA"}
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":"klBAmCA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YAqOZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,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A,UACE,YACA,YACC,cACH,WACC,YACA,YACG,eACb,SAAU,EACA,WACA,WACJ,QACS,gBACf,KAAM,IAAY,EAAU,SAAW,GAChC,QACE,UACH,OACI,YACV,MAAO,EACP,CAAA,EACA,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAc,UAAU,0BAC/B,SAAA,CACG,CAAA,EAEL,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAS,UAAU,0BAC1B,SAAA,CACG,CAAA,EAEL,EACG,GAEP,CACD,EAEA,EAAM,YAAc,EAAA"}
@@ -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\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. Still works, 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,EA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,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":"button-trigger.cjs","names":[],"sources":["../../../../components/menu-dropdown/button-trigger.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// # Dropdown Trigger Component (Simple Button Flavor) --- SLDS for React\n\nimport React, { forwardRef, type ReactElement, type ReactNode } from 'react';\nimport classnames from 'classnames';\n\nimport Button, { type ButtonProps } from '../button';\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport mergeProps, { renderTrigger } from '../../utilities/merge-props';\nimport type { TriggerRender } from '../../types/common';\n\n/**\n * Props MenuDropdown passes to a `trigger` that isn't a `Button`. The trigger `div` handles\n * clicks, focus, keys and hover, so the trigger only needs to be focusable and take `ref`.\n */\nexport interface MenuDropdownTriggerProps {\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup': true;\n\t/** Includes the class MenuDropdown uses to ignore clicks on the trigger when closing */\n\tclassName?: string;\n\tdisabled?: boolean;\n\tref: (element: HTMLElement | null) => void;\n\ttabIndex?: number;\n}\n\n/**\n * Props MenuDropdown passes to its default trigger that aren't part of the public type.\n */\nexport interface ButtonTriggerInjectedProps {\n\t/** MenuDropdown's `trigger` */\n\ttrigger?: TriggerRender<MenuDropdownTriggerProps>;\n}\n\nexport interface ButtonTriggerProps {\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** A `Button` element whose props override the ones MenuDropdown passes */\n\tchildren?: ReactElement<ButtonProps>;\n\t/** CSS classes to be added to triggering button */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** A unique ID for accessibility support */\n\tid?: string;\n\t/** Informs the trigger on the open/close state of the dropdown menu */\n\tisOpen?: boolean;\n\t/** The dropdown menu to render */\n\tmenu?: ReactNode;\n\t/** Called when the trigger button loses focus */\n\tonBlur?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Triggered when the trigger button is clicked */\n\tonClick?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when the trigger button gains focus */\n\tonFocus?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Called when a key is pressed */\n\tonKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\n\t/** Called when mouse clicks down on the trigger button */\n\tonMouseDown?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hovers over the trigger button */\n\tonMouseEnter?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hover leaves the trigger button */\n\tonMouseLeave?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Determines if mouse hover or click opens the dropdown menu */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/** The ref of the actual triggering button */\n\ttriggerRef?: (element: HTMLButtonElement | null) => void;\n\t/** CSS classes to be added to wrapping trigger div */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon category passed from MenuDropdown */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/** Icon name passed from MenuDropdown */\n\ticonName?: string;\n\t/** Icon position passed from MenuDropdown */\n\ticonPosition?: 'left' | 'right';\n\t/** Icon size passed from MenuDropdown */\n\ticonSize?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\t/** Icon variant passed from MenuDropdown */\n\ticonVariant?: 'bare' | 'container' | 'border' | 'border-filled' | 'more';\n\t/** Button variant passed from MenuDropdown */\n\tvariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n\t/** Whether to show hint styling */\n\thint?: boolean;\n\t/** Whether the button is inverse */\n\tinverse?: boolean;\n\t/** Button label */\n\tlabel?: string | ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Button style */\n\tstyle?: React.CSSProperties;\n}\n\n/**\n * The Dropdown Button Trigger renders the default trigger button for the dropdown menu.\n * If this component has a `Button` child, the child's props override the ones MenuDropdown passes.\n * Passing this component (or a custom trigger with its `displayName`) as a child of MenuDropdown\n * is deprecated: pass the `Button` or other element as MenuDropdown's `trigger` instead.\n */\nconst ButtonTrigger = forwardRef<\n\tHTMLDivElement,\n\tButtonTriggerProps & ButtonTriggerInjectedProps\n>((props, ref) => {\n\tconst {\n\t\tassistiveText,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tid,\n\t\tinverse,\n\t\tisOpen,\n\t\tlabel,\n\t\tonBlur,\n\t\tmenu,\n\t\tonClick,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\topenOn: openOnProp,\n\t\tstyle,\n\t\ttabIndex,\n\t\ttrigger,\n\t\ttriggerRef,\n\t\ttriggerClassName,\n\t\tvariant,\n\t} = props;\n\n\tconst openOn = openOnProp === 'hover' ? 'click' : openOnProp;\n\n\t// The `trigger` element, or (deprecated) the Button child of this component\n\tconst buttonElement: ReactNode =\n\t\ttrigger === undefined\n\t\t\t? React.Children.toArray(children).find((child) =>\n\t\t\t\t\tisElementOfType<ButtonProps>(child, Button)\n\t\t\t\t)\n\t\t\t: (trigger as ReactNode);\n\n\tconst buttonDefaults: Record<string, unknown> = {\n\t\tassistiveText,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tinverse,\n\t\tlabel,\n\t\tstyle,\n\t\ttabIndex,\n\t\tvariant,\n\t\t'aria-expanded': isOpen,\n\t\t'aria-haspopup': true,\n\t};\n\n\tlet renderedTrigger: ReactNode;\n\tif (trigger !== undefined && !isElementOfType(trigger as ReactNode, Button)) {\n\t\trenderedTrigger = renderTrigger(trigger, {\n\t\t\t'aria-expanded': isOpen,\n\t\t\t'aria-haspopup': true,\n\t\t\tclassName: classnames(className as string) || undefined,\n\t\t\tdisabled,\n\t\t\tref: triggerRef as (element: HTMLElement | null) => void,\n\t\t\ttabIndex,\n\t\t});\n\t} else {\n\t\t// The Button's own props override MenuDropdown's\n\t\tconst childProps = isElementOfType<ButtonProps>(buttonElement, Button)\n\t\t\t? (buttonElement.props as Record<string, unknown>)\n\t\t\t: {};\n\t\t// A labelled Button keeps its label. Otherwise the Dropdown's\n\t\t// `assistiveText.icon` makes Button render icon-only.\n\t\tconst buttonProps =\n\t\t\tchildProps.label && childProps.assistiveText === undefined\n\t\t\t\t? { assistiveText: { icon: '' }, ...childProps }\n\t\t\t\t: childProps;\n\t\tconst consumerButtonRef = buttonProps.buttonRef as ButtonProps['buttonRef'];\n\t\trenderedTrigger = (\n\t\t\t<Button\n\t\t\t\t{...(mergeProps(buttonDefaults, buttonProps) as ButtonProps)}\n\t\t\t\tbuttonRef={\n\t\t\t\t\tconsumerButtonRef\n\t\t\t\t\t\t? (element: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\tconsumerButtonRef(element);\n\t\t\t\t\t\t\t\ttriggerRef?.(element);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: triggerRef\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- wrapper delegates events from the focusable trigger it contains\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classnames(\n\t\t\t\t`slds-dropdown-trigger slds-dropdown-trigger_${openOn}`,\n\t\t\t\t{\n\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t},\n\t\t\t\ttriggerClassName as string | string[] | Record<string, boolean>\n\t\t\t)}\n\t\t\tid={id}\n\t\t\tonBlur={onBlur}\n\t\t\tonClick={onClick}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonFocus={onFocus}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\tonMouseLeave={onMouseLeave}\n\t\t>\n\t\t\t{renderedTrigger}\n\t\t\t{menu}\n\t\t</div>\n\t);\n});\n\nButtonTrigger.displayName = MENU_DROPDOWN_TRIGGER;\n\nexport default ButtonTrigger as React.ForwardRefExoticComponent<\n\tButtonTriggerProps & React.RefAttributes<HTMLDivElement>\n>;\n"],"mappings":"6VAqGA,IAAM,GAAA,EAAgB,EAAA,WAAA,EAGnB,EAAO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,EACA,CACG,GAEP,CAAC,EAED,EAAc,YAAc,EAAA"}
1
+ {"version":3,"file":"button-trigger.cjs","names":[],"sources":["../../../../components/menu-dropdown/button-trigger.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// # Dropdown Trigger Component (Simple Button Flavor) --- SLDS for React\n\nimport React, { forwardRef, type ReactElement, type ReactNode } from 'react';\nimport classnames from 'classnames';\n\nimport Button, { type ButtonProps } from '../button';\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport mergeProps, { renderTrigger } from '../../utilities/merge-props';\nimport type { TriggerRender } from '../../types/common';\n\n/**\n * Props MenuDropdown passes to a `trigger` that isn't a `Button`. The trigger `div` handles\n * clicks, focus, keys and hover, so the trigger only needs to be focusable and take `ref`.\n */\nexport interface MenuDropdownTriggerProps {\n\t/** Whether the menu is open. */\n\t'aria-expanded'?: boolean;\n\t/** Always `true`: the trigger opens a menu. */\n\t'aria-haspopup': true;\n\t/** Includes the class MenuDropdown uses to ignore clicks on the trigger when closing */\n\tclassName?: string;\n\t/** MenuDropdown's `disabled`. */\n\tdisabled?: boolean;\n\t/** Callback ref for the trigger's focusable element. MenuDropdown uses it for focus and positioning. */\n\tref: (element: HTMLElement | null) => void;\n\t/** MenuDropdown's `tabIndex`. */\n\ttabIndex?: number;\n}\n\n/**\n * Props MenuDropdown passes to its default trigger that aren't part of the public type.\n */\nexport interface ButtonTriggerInjectedProps {\n\t/** MenuDropdown's `trigger` */\n\ttrigger?: TriggerRender<MenuDropdownTriggerProps>;\n}\n\nexport interface ButtonTriggerProps {\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** A `Button` element whose props override the ones MenuDropdown passes */\n\tchildren?: ReactElement<ButtonProps>;\n\t/** CSS classes to be added to triggering button */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** A unique ID for accessibility support */\n\tid?: string;\n\t/** Informs the trigger on the open/close state of the dropdown menu */\n\tisOpen?: boolean;\n\t/** The dropdown menu to render */\n\tmenu?: ReactNode;\n\t/** Called when the trigger button loses focus */\n\tonBlur?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Triggered when the trigger button is clicked */\n\tonClick?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when the trigger button gains focus */\n\tonFocus?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Called when a key is pressed */\n\tonKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\n\t/** Called when mouse clicks down on the trigger button */\n\tonMouseDown?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hovers over the trigger button */\n\tonMouseEnter?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hover leaves the trigger button */\n\tonMouseLeave?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Determines if mouse hover or click opens the dropdown menu */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/** The ref of the actual triggering button */\n\ttriggerRef?: (element: HTMLButtonElement | null) => void;\n\t/** CSS classes to be added to wrapping trigger div */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon category passed from MenuDropdown */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/** Icon name passed from MenuDropdown */\n\ticonName?: string;\n\t/** Icon position passed from MenuDropdown */\n\ticonPosition?: 'left' | 'right';\n\t/** Icon size passed from MenuDropdown */\n\ticonSize?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\t/** Icon variant passed from MenuDropdown */\n\ticonVariant?: 'bare' | 'container' | 'border' | 'border-filled' | 'more';\n\t/** Button variant passed from MenuDropdown */\n\tvariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n\t/** Whether to show hint styling */\n\thint?: boolean;\n\t/** Whether the button is inverse */\n\tinverse?: boolean;\n\t/** Button label */\n\tlabel?: string | ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Tab index */\n\ttabIndex?: number;\n\t/** Button style */\n\tstyle?: React.CSSProperties;\n}\n\n/**\n * The Dropdown Button Trigger renders the default trigger button for the dropdown menu.\n * If this component has a `Button` child, the child's props override the ones MenuDropdown passes.\n * Passing this component (or a custom trigger with its `displayName`) as a child of MenuDropdown\n * is deprecated: pass the `Button` or other element as MenuDropdown's `trigger` instead.\n */\nconst ButtonTrigger = forwardRef<\n\tHTMLDivElement,\n\tButtonTriggerProps & ButtonTriggerInjectedProps\n>((props, ref) => {\n\tconst {\n\t\tassistiveText,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tid,\n\t\tinverse,\n\t\tisOpen,\n\t\tlabel,\n\t\tonBlur,\n\t\tmenu,\n\t\tonClick,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\topenOn: openOnProp,\n\t\tstyle,\n\t\ttabIndex,\n\t\ttrigger,\n\t\ttriggerRef,\n\t\ttriggerClassName,\n\t\tvariant,\n\t} = props;\n\n\tconst openOn = openOnProp === 'hover' ? 'click' : openOnProp;\n\n\t// The `trigger` element, or (deprecated) the Button child of this component\n\tconst buttonElement: ReactNode =\n\t\ttrigger === undefined\n\t\t\t? React.Children.toArray(children).find((child) =>\n\t\t\t\t\tisElementOfType<ButtonProps>(child, Button)\n\t\t\t\t)\n\t\t\t: (trigger as ReactNode);\n\n\tconst buttonDefaults: Record<string, unknown> = {\n\t\tassistiveText,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tinverse,\n\t\tlabel,\n\t\tstyle,\n\t\ttabIndex,\n\t\tvariant,\n\t\t'aria-expanded': isOpen,\n\t\t'aria-haspopup': true,\n\t};\n\n\tlet renderedTrigger: ReactNode;\n\tif (trigger !== undefined && !isElementOfType(trigger as ReactNode, Button)) {\n\t\trenderedTrigger = renderTrigger(trigger, {\n\t\t\t'aria-expanded': isOpen,\n\t\t\t'aria-haspopup': true,\n\t\t\tclassName: classnames(className as string) || undefined,\n\t\t\tdisabled,\n\t\t\tref: triggerRef as (element: HTMLElement | null) => void,\n\t\t\ttabIndex,\n\t\t});\n\t} else {\n\t\t// The Button's own props override MenuDropdown's\n\t\tconst childProps = isElementOfType<ButtonProps>(buttonElement, Button)\n\t\t\t? (buttonElement.props as Record<string, unknown>)\n\t\t\t: {};\n\t\t// A labelled Button keeps its label. Otherwise the Dropdown's\n\t\t// `assistiveText.icon` makes Button render icon-only.\n\t\tconst buttonProps =\n\t\t\tchildProps.label && childProps.assistiveText === undefined\n\t\t\t\t? { assistiveText: { icon: '' }, ...childProps }\n\t\t\t\t: childProps;\n\t\tconst consumerButtonRef = buttonProps.buttonRef as ButtonProps['buttonRef'];\n\t\trenderedTrigger = (\n\t\t\t<Button\n\t\t\t\t{...(mergeProps(buttonDefaults, buttonProps) as ButtonProps)}\n\t\t\t\tbuttonRef={\n\t\t\t\t\tconsumerButtonRef\n\t\t\t\t\t\t? (element: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\tconsumerButtonRef(element);\n\t\t\t\t\t\t\t\ttriggerRef?.(element);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: triggerRef\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- wrapper delegates events from the focusable trigger it contains\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classnames(\n\t\t\t\t`slds-dropdown-trigger slds-dropdown-trigger_${openOn}`,\n\t\t\t\t{\n\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t},\n\t\t\t\ttriggerClassName as string | string[] | Record<string, boolean>\n\t\t\t)}\n\t\t\tid={id}\n\t\t\tonBlur={onBlur}\n\t\t\tonClick={onClick}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonFocus={onFocus}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\tonMouseLeave={onMouseLeave}\n\t\t>\n\t\t\t{renderedTrigger}\n\t\t\t{menu}\n\t\t</div>\n\t);\n});\n\nButtonTrigger.displayName = MENU_DROPDOWN_TRIGGER;\n\nexport default ButtonTrigger as React.ForwardRefExoticComponent<\n\tButtonTriggerProps & React.RefAttributes<HTMLDivElement>\n>;\n"],"mappings":"6VA0GA,IAAM,GAAA,EAAgB,EAAA,WAAA,EAGnB,EAAO,IAAQ,CACjB,GAAM,CACL,gBACA,WACA,YACA,WACA,OACA,eACA,WACA,eACA,WACA,cACA,KACA,UACA,SACA,QACA,SACA,OACA,UACA,UACA,YACA,cACA,eACA,eACA,OAAQ,EACR,QACA,WACA,UACA,aACA,mBACA,WACG,EAEE,EAAS,IAAe,QAAU,QAAU,EAG5C,EACL,IAAY,IAAA,GACT,EAAA,QAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,KAAM,GACvC,EAAA,QAA6B,EAAO,EAAA,OAAM,CAC3C,EACE,EAEC,EAA0C,CAC/C,gBACA,YACA,WACA,OACA,eACA,WACA,eACA,WACA,cACA,UACA,QACA,QACA,WACA,UACA,gBAAiB,EACjB,gBAAiB,EAClB,EAEI,EACJ,GAAI,IAAY,IAAA,IAAa,CAAC,EAAA,QAAgB,EAAsB,EAAA,OAAM,EACzE,EAAkB,EAAA,cAAc,EAAS,CACxC,gBAAiB,EACjB,gBAAiB,GACjB,WAAA,EAAW,EAAA,QAAA,CAAW,CAAmB,GAAK,IAAA,GAC9C,WACA,IAAK,EACL,UACD,CAAC,MACK,CAEN,IAAM,EAAa,EAAA,QAA6B,EAAe,EAAA,OAAM,EACjE,EAAc,MACf,CAAC,EAGE,EACL,EAAW,O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