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

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 (400) hide show
  1. package/README.md +18 -0
  2. package/dist/cjs/components/alert/index.cjs +1 -1
  3. package/dist/cjs/components/alert/index.cjs.map +1 -1
  4. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  5. package/dist/cjs/components/button/check-props.cjs +1 -1
  6. package/dist/cjs/components/button/check-props.cjs.map +1 -1
  7. package/dist/cjs/components/button/index.cjs +1 -1
  8. package/dist/cjs/components/button/index.cjs.map +1 -1
  9. package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
  10. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
  11. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  12. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  13. package/dist/cjs/components/carousel/index.cjs +1 -1
  14. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  15. package/dist/cjs/components/carousel/private/carousel-indicators.cjs.map +1 -1
  16. package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
  17. package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
  18. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  19. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  20. package/dist/cjs/components/checkbox/index.cjs +1 -1
  21. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  22. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  23. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  24. package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
  25. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  26. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  27. package/dist/cjs/components/color-picker/private/swatch-option.cjs +1 -1
  28. package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
  29. package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
  30. package/dist/cjs/components/color-picker/private/swatch.cjs.map +1 -1
  31. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  32. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  33. package/dist/cjs/components/combobox/index.cjs +1 -1
  34. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  35. package/dist/cjs/components/combobox/private/menu.cjs +1 -1
  36. package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
  37. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  38. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  39. package/dist/cjs/components/date-picker/private/calendar.cjs.map +1 -1
  40. package/dist/cjs/components/date-picker/private/day.cjs +1 -1
  41. package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
  42. package/dist/cjs/components/files/file.cjs +1 -8
  43. package/dist/cjs/components/files/file.cjs.map +1 -1
  44. package/dist/cjs/components/files/private/file-actions.cjs +1 -1
  45. package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
  46. package/dist/cjs/components/files/private/file-figure.cjs +1 -1
  47. package/dist/cjs/components/files/private/file-figure.cjs.map +1 -1
  48. package/dist/cjs/components/filter/filter.cjs +1 -1
  49. package/dist/cjs/components/filter/filter.cjs.map +1 -1
  50. package/dist/cjs/components/icon/check-props.cjs +1 -1
  51. package/dist/cjs/components/icon/check-props.cjs.map +1 -1
  52. package/dist/cjs/components/icon/index.cjs +1 -1
  53. package/dist/cjs/components/icon/index.cjs.map +1 -1
  54. package/dist/cjs/components/input/check-props.cjs +1 -1
  55. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  56. package/dist/cjs/components/input/index.cjs.map +1 -1
  57. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  58. package/dist/cjs/components/input/search.cjs.map +1 -1
  59. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  60. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  61. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  62. package/dist/cjs/components/modal/index.cjs +1 -1
  63. package/dist/cjs/components/modal/index.cjs.map +1 -1
  64. package/dist/cjs/components/pill/index.cjs.map +1 -1
  65. package/dist/cjs/components/pill-container/index.cjs +1 -1
  66. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  67. package/dist/cjs/components/popover/index.cjs.map +1 -1
  68. package/dist/cjs/components/popover/popover.cjs +1 -1
  69. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  70. package/dist/cjs/components/progress-indicator/private/step.cjs.map +1 -1
  71. package/dist/cjs/components/radio/index.cjs +1 -1
  72. package/dist/cjs/components/radio/index.cjs.map +1 -1
  73. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  74. package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
  75. package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -1
  76. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  77. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  78. package/dist/cjs/components/simple-data-table/interactive-element.cjs +1 -1
  79. package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
  80. package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
  81. package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
  82. package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
  83. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  84. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  85. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  86. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  87. package/dist/cjs/components/simple-data-table/private/link.cjs +1 -1
  88. package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -1
  89. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  90. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  91. package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
  92. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
  93. package/dist/cjs/components/slider/index.cjs.map +1 -1
  94. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  95. package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
  96. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  97. package/dist/cjs/components/tabs/private/tab.cjs +1 -1
  98. package/dist/cjs/components/tabs/private/tab.cjs.map +1 -1
  99. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  100. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  101. package/dist/cjs/components/textarea/index.cjs +1 -1
  102. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  103. package/dist/cjs/components/toast/index.cjs.map +1 -1
  104. package/dist/cjs/components/tooltip/index.cjs +1 -3
  105. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  106. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  107. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  108. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  109. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  110. package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
  111. package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
  112. package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
  113. package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
  114. package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
  115. package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
  116. package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
  117. package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
  118. package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
  119. package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
  120. package/dist/cjs/utilities/color.cjs +1 -1
  121. package/dist/cjs/utilities/color.cjs.map +1 -1
  122. package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
  123. package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
  124. package/dist/cjs/utilities/get-aria-props.cjs +1 -1
  125. package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
  126. package/dist/cjs/utilities/get-data-props.cjs +1 -1
  127. package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
  128. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
  129. package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
  130. package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
  131. package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
  132. package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
  133. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  134. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  135. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  136. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  137. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  138. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  139. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
  140. package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
  141. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
  142. package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
  143. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
  144. package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
  145. package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
  146. package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
  147. package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
  148. package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
  149. package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
  150. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
  151. package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
  152. package/dist/cjs/utilities/warning/required-property.cjs +1 -1
  153. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
  154. package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
  155. package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
  156. package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
  157. package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
  158. package/dist/es/components/alert/index.js +4 -5
  159. package/dist/es/components/alert/index.js.map +1 -1
  160. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  161. package/dist/es/components/button/check-props.js +1 -1
  162. package/dist/es/components/button/check-props.js.map +1 -1
  163. package/dist/es/components/button/index.js +50 -50
  164. package/dist/es/components/button/index.js.map +1 -1
  165. package/dist/es/components/button-stateful/check-props.js +1 -1
  166. package/dist/es/components/button-stateful/check-props.js.map +1 -1
  167. package/dist/es/components/button-stateful/index.js +3 -2
  168. package/dist/es/components/button-stateful/index.js.map +1 -1
  169. package/dist/es/components/carousel/index.js +155 -129
  170. package/dist/es/components/carousel/index.js.map +1 -1
  171. package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
  172. package/dist/es/components/carousel/private/carousel-item.js +1 -1
  173. package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
  174. package/dist/es/components/checkbox/check-props.js +1 -1
  175. package/dist/es/components/checkbox/check-props.js.map +1 -1
  176. package/dist/es/components/checkbox/index.js +102 -100
  177. package/dist/es/components/checkbox/index.js.map +1 -1
  178. package/dist/es/components/color-picker/color-picker.js +150 -151
  179. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  180. package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
  181. package/dist/es/components/color-picker/private/hsv-color.js +16 -20
  182. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  183. package/dist/es/components/color-picker/private/swatch-option.js +2 -2
  184. package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
  185. package/dist/es/components/color-picker/private/swatch.js +1 -1
  186. package/dist/es/components/color-picker/private/swatch.js.map +1 -1
  187. package/dist/es/components/combobox/combobox.js +565 -580
  188. package/dist/es/components/combobox/combobox.js.map +1 -1
  189. package/dist/es/components/combobox/index.js +6 -19
  190. package/dist/es/components/combobox/index.js.map +1 -1
  191. package/dist/es/components/combobox/private/menu.js +3 -3
  192. package/dist/es/components/combobox/private/menu.js.map +1 -1
  193. package/dist/es/components/date-picker/date-picker.js +101 -102
  194. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  195. package/dist/es/components/date-picker/private/calendar.js.map +1 -1
  196. package/dist/es/components/date-picker/private/day.js +1 -1
  197. package/dist/es/components/date-picker/private/day.js.map +1 -1
  198. package/dist/es/components/files/file.js +5 -6
  199. package/dist/es/components/files/file.js.map +1 -1
  200. package/dist/es/components/files/private/file-actions.js +2 -2
  201. package/dist/es/components/files/private/file-actions.js.map +1 -1
  202. package/dist/es/components/files/private/file-figure.js +1 -1
  203. package/dist/es/components/files/private/file-figure.js.map +1 -1
  204. package/dist/es/components/filter/filter.js +5 -1
  205. package/dist/es/components/filter/filter.js.map +1 -1
  206. package/dist/es/components/icon/check-props.js +9 -7
  207. package/dist/es/components/icon/check-props.js.map +1 -1
  208. package/dist/es/components/icon/index.js +13 -10
  209. package/dist/es/components/icon/index.js.map +1 -1
  210. package/dist/es/components/input/check-props.js +14 -13
  211. package/dist/es/components/input/check-props.js.map +1 -1
  212. package/dist/es/components/input/index.js.map +1 -1
  213. package/dist/es/components/input/private/inner-input.js.map +1 -1
  214. package/dist/es/components/input/search.js.map +1 -1
  215. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  216. package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
  217. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  218. package/dist/es/components/modal/index.js +1 -2
  219. package/dist/es/components/modal/index.js.map +1 -1
  220. package/dist/es/components/pill/index.js.map +1 -1
  221. package/dist/es/components/pill-container/index.js +10 -6
  222. package/dist/es/components/pill-container/index.js.map +1 -1
  223. package/dist/es/components/popover/index.js.map +1 -1
  224. package/dist/es/components/popover/popover.js +181 -177
  225. package/dist/es/components/popover/popover.js.map +1 -1
  226. package/dist/es/components/progress-indicator/private/step.js.map +1 -1
  227. package/dist/es/components/radio/index.js +1 -1
  228. package/dist/es/components/radio/index.js.map +1 -1
  229. package/dist/es/components/radio-group/index.js.map +1 -1
  230. package/dist/es/components/simple-data-table/cell.js +8 -5
  231. package/dist/es/components/simple-data-table/cell.js.map +1 -1
  232. package/dist/es/components/simple-data-table/index.js +97 -91
  233. package/dist/es/components/simple-data-table/index.js.map +1 -1
  234. package/dist/es/components/simple-data-table/interactive-element.js +31 -28
  235. package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
  236. package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
  237. package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
  238. package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
  239. package/dist/es/components/simple-data-table/private/head.js +65 -42
  240. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  241. package/dist/es/components/simple-data-table/private/header-cell.js +2 -1
  242. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  243. package/dist/es/components/simple-data-table/private/link.js.map +1 -1
  244. package/dist/es/components/simple-data-table/private/row.js +96 -60
  245. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  246. package/dist/es/components/simple-data-table/row-actions.js +4 -1
  247. package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
  248. package/dist/es/components/slider/index.js.map +1 -1
  249. package/dist/es/components/split-view/listbox.js.map +1 -1
  250. package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
  251. package/dist/es/components/tabs/index.js.map +1 -1
  252. package/dist/es/components/tabs/private/tab.js +1 -1
  253. package/dist/es/components/tabs/private/tab.js.map +1 -1
  254. package/dist/es/components/textarea/check-props.js +1 -1
  255. package/dist/es/components/textarea/check-props.js.map +1 -1
  256. package/dist/es/components/textarea/index.js +4 -2
  257. package/dist/es/components/textarea/index.js.map +1 -1
  258. package/dist/es/components/toast/index.js.map +1 -1
  259. package/dist/es/components/tooltip/index.js +107 -88
  260. package/dist/es/components/tooltip/index.js.map +1 -1
  261. package/dist/es/components/tree/private/branch.js.map +1 -1
  262. package/dist/es/components/tree/private/item.js.map +1 -1
  263. package/dist/es/components/tree/private/render-branch.js +14 -19
  264. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  265. package/dist/es/components/utilities/dialog/index.js +2 -1
  266. package/dist/es/components/utilities/dialog/index.js.map +1 -1
  267. package/dist/es/components/utilities/dialog/portal.js +5 -3
  268. package/dist/es/components/utilities/dialog/portal.js.map +1 -1
  269. package/dist/es/components/utilities/menu-list/index.js +6 -6
  270. package/dist/es/components/utilities/menu-list/index.js.map +1 -1
  271. package/dist/es/components/utilities/menu-list/item.js +42 -18
  272. package/dist/es/components/utilities/menu-list/item.js.map +1 -1
  273. package/dist/es/components/utilities/utility-icon/index.js +32 -52
  274. package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
  275. package/dist/es/utilities/color.js +1 -1
  276. package/dist/es/utilities/color.js.map +1 -1
  277. package/dist/es/utilities/dom-element-focus.js.map +1 -1
  278. package/dist/es/utilities/execution-environment.js.map +1 -1
  279. package/dist/es/utilities/get-aria-props.js +1 -1
  280. package/dist/es/utilities/get-aria-props.js.map +1 -1
  281. package/dist/es/utilities/get-data-props.js +1 -1
  282. package/dist/es/utilities/get-data-props.js.map +1 -1
  283. package/dist/es/utilities/keyboard-navigable-dialog.js +7 -7
  284. package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
  285. package/dist/es/utilities/keyboard-navigate.js +1 -1
  286. package/dist/es/utilities/keyboard-navigate.js.map +1 -1
  287. package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
  288. package/dist/es/utilities/warning/children-as-trigger.js +8 -7
  289. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  290. package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
  291. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  292. package/dist/es/utilities/warning/deprecated-property.js +8 -7
  293. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  294. package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
  295. package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
  296. package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
  297. package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
  298. package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
  299. package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
  300. package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
  301. package/dist/es/utilities/warning/one-of-required-property.js +11 -10
  302. package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
  303. package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
  304. package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
  305. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
  306. package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
  307. package/dist/es/utilities/warning/required-property.js +8 -7
  308. package/dist/es/utilities/warning/required-property.js.map +1 -1
  309. package/dist/es/utilities/warning/sunset-property.js +8 -7
  310. package/dist/es/utilities/warning/sunset-property.js.map +1 -1
  311. package/dist/es/utilities/warning/warned-registry.js +10 -0
  312. package/dist/es/utilities/warning/warned-registry.js.map +1 -0
  313. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  314. package/dist/types/components/button/index.d.ts +14 -4
  315. package/dist/types/components/button/index.d.ts.map +1 -1
  316. package/dist/types/components/button-stateful/index.d.ts +5 -2
  317. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  318. package/dist/types/components/carousel/index.d.ts +7 -1
  319. package/dist/types/components/carousel/index.d.ts.map +1 -1
  320. package/dist/types/components/checkbox/index.d.ts +4 -1
  321. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  322. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  323. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  324. package/dist/types/components/combobox/index.d.ts +1 -1
  325. package/dist/types/components/combobox/index.d.ts.map +1 -1
  326. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  327. package/dist/types/components/files/file.d.ts +5 -0
  328. package/dist/types/components/files/file.d.ts.map +1 -1
  329. package/dist/types/components/icon/index.d.ts +7 -1
  330. package/dist/types/components/icon/index.d.ts.map +1 -1
  331. package/dist/types/components/input/index.d.ts +9 -6
  332. package/dist/types/components/input/index.d.ts.map +1 -1
  333. package/dist/types/components/input/search.d.ts.map +1 -1
  334. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  335. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +9 -3
  336. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  337. package/dist/types/components/modal/index.d.ts.map +1 -1
  338. package/dist/types/components/pill/index.d.ts.map +1 -1
  339. package/dist/types/components/popover/index.d.ts.map +1 -1
  340. package/dist/types/components/popover/popover.d.ts.map +1 -1
  341. package/dist/types/components/radio/index.d.ts +9 -2
  342. package/dist/types/components/radio/index.d.ts.map +1 -1
  343. package/dist/types/components/radio-group/index.d.ts +3 -3
  344. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  345. package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
  346. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  347. package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
  348. package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
  349. package/dist/types/components/simple-data-table/types.d.ts +10 -2
  350. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  351. package/dist/types/components/slider/index.d.ts +2 -2
  352. package/dist/types/components/slider/index.d.ts.map +1 -1
  353. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  354. package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
  355. package/dist/types/components/tabs/index.d.ts.map +1 -1
  356. package/dist/types/components/textarea/index.d.ts +9 -6
  357. package/dist/types/components/textarea/index.d.ts.map +1 -1
  358. package/dist/types/components/toast/index.d.ts.map +1 -1
  359. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  360. package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
  361. package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
  362. package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
  363. package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
  364. package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
  365. package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
  366. package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
  367. package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
  368. package/dist/types/types/common.d.ts.map +1 -1
  369. package/dist/types/types/components.d.ts.map +1 -1
  370. package/package.json +2 -3
  371. package/dist/cjs/icons/action/index.cjs +0 -2
  372. package/dist/cjs/icons/action/index.cjs.map +0 -1
  373. package/dist/cjs/icons/custom/index.cjs +0 -2
  374. package/dist/cjs/icons/custom/index.cjs.map +0 -1
  375. package/dist/cjs/icons/doctype/index.cjs +0 -2
  376. package/dist/cjs/icons/doctype/index.cjs.map +0 -1
  377. package/dist/cjs/icons/standard/index.cjs +0 -2
  378. package/dist/cjs/icons/standard/index.cjs.map +0 -1
  379. package/dist/cjs/icons/utility/index.cjs +0 -2
  380. package/dist/cjs/icons/utility/index.cjs.map +0 -1
  381. package/dist/es/icons/action/index.js +0 -6
  382. package/dist/es/icons/action/index.js.map +0 -1
  383. package/dist/es/icons/custom/index.js +0 -6
  384. package/dist/es/icons/custom/index.js.map +0 -1
  385. package/dist/es/icons/doctype/index.js +0 -6
  386. package/dist/es/icons/doctype/index.js.map +0 -1
  387. package/dist/es/icons/standard/index.js +0 -6
  388. package/dist/es/icons/standard/index.js.map +0 -1
  389. package/dist/es/icons/utility/index.js +0 -6
  390. package/dist/es/icons/utility/index.js.map +0 -1
  391. package/dist/types/icons/action/index.d.ts +0 -3
  392. package/dist/types/icons/action/index.d.ts.map +0 -1
  393. package/dist/types/icons/custom/index.d.ts +0 -3
  394. package/dist/types/icons/custom/index.d.ts.map +0 -1
  395. package/dist/types/icons/doctype/index.d.ts +0 -3
  396. package/dist/types/icons/doctype/index.d.ts.map +0 -1
  397. package/dist/types/icons/standard/index.d.ts +0 -3
  398. package/dist/types/icons/standard/index.d.ts.map +0 -1
  399. package/dist/types/icons/utility/index.d.ts +0 -3
  400. package/dist/types/icons/utility/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","names":[],"sources":["../../../../../components/combobox/private/menu.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype CSSProperties,\n} from 'react';\nimport { dequal as isEqual } from 'dequal';\nimport classNames from 'classnames';\n\nimport Icon from '../../icon';\nimport Spinner from '../../spinner';\nimport type { TooltipProps } from '../../tooltip';\nimport type {\n\tComboboxMenuRenderMenuItemData,\n\tComboboxOption,\n\tComboboxOptionIcon,\n} from '../types';\n\nexport interface MenuAssistiveText {\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n}\n\nexport interface MenuLabels {\n\tnoOptionsFound: ReactNode | string;\n}\n\nexport interface MenuProps {\n\t/** Active descendant in menu */\n\tactiveOption?: ComboboxOption;\n\t/** Index of active descendant in menu */\n\tactiveOptionIndex?: number;\n\t/** Assistive text for accessibility */\n\tassistiveText?: MenuAssistiveText;\n\t/** CSS classes to be added to menu sub header span tag */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Sets the dialog width */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/** Id used for assistive technology */\n\tinputId?: string;\n\t/** Input value for bolding matches */\n\tinputValue?: string;\n\t/** Function to check if option is selected */\n\tisSelected: (params: {\n\t\tselection: ComboboxOption[];\n\t\toption: ComboboxOption;\n\t}) => boolean;\n\t/** Determines the height of the menu */\n\titemVisibleLength?: 5 | 7 | 10 | null;\n\t/** Text labels */\n\tlabels: MenuLabels;\n\t/** Adds loading spinner below the options */\n\thasMenuSpinner?: boolean;\n\t/** Sets a maximum width for menu */\n\tmaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Ref for menu element */\n\tmenuRef?:\n\t\tReact.RefCallback<HTMLUListElement> | React.RefObject<HTMLUListElement>;\n\t/** Renders an option's content in place of the default label and icon */\n\trenderMenuItem?: (data: ComboboxMenuRenderMenuItemData) => ReactNode;\n\t/** Callback when option is selected */\n\tonSelect: (\n\t\tevent: React.MouseEvent,\n\t\tdata: { option: ComboboxOption; selection?: ComboboxOption[] }\n\t) => void;\n\t/** Menu options */\n\toptions: ComboboxOption[];\n\t/** Selected options */\n\tselection: ComboboxOption[];\n\t/** Tooltip for disabled menu items */\n\ttooltipMenuItemDisabled?: ReactElement<Partial<TooltipProps>>;\n\t/** Menu variant */\n\tvariant?: 'icon-title-subtitle' | 'checkbox';\n}\n\nconst setBold = (label: string | undefined, searchTerm: string): ReactNode => {\n\tif (!label || label.length === 0 || !searchTerm || searchTerm.length === 0) {\n\t\treturn label;\n\t}\n\tconst position = label.toLowerCase().indexOf(searchTerm.toLowerCase());\n\tif (position > -1) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{label.substr(0, position)}\n\t\t\t\t<span key=\"bold\" className=\"slds-text-title_bold\">{`${label.substr(\n\t\t\t\t\tposition,\n\t\t\t\t\tsearchTerm.length\n\t\t\t\t)}`}</span>\n\t\t\t\t{label.substr(position + searchTerm.length)}\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn label;\n};\n\nconst renderLabel = (\n\tlabelProp: string | ((searchTerm: string) => ReactNode) | undefined,\n\tsearchTerm: string\n): ReactNode => {\n\tif (labelProp == null || typeof labelProp === 'string') {\n\t\treturn labelProp;\n\t}\n\treturn labelProp(searchTerm);\n};\n\n// Entity icons in a combobox listbox option render at \"small\" per SLDS. `Icon`\n// defaults to \"medium\", so an option icon passed without an explicit size shows\n// oversized in the menu (SLDS 2 no longer shrinks it via CSS the way SLDS 1\n// did). Clone the icon to enforce \"small\" unless the consumer set a size\n// themselves. Leaves non-<Icon> nodes untouched.\nconst sizeOptionIcon = (icon: ComboboxOptionIcon): ReactNode =>\n\ticon.props.size != null ? icon : React.cloneElement(icon, { size: 'small' });\n\n/**\n * The text of an option's label. A label render function (separator and action\n * rows only) has no text, so it returns `undefined`.\n */\nexport const getOptionLabel = (option?: ComboboxOption): string | undefined =>\n\ttypeof option?.label === 'string' ? option.label : undefined;\n\nconst Menu: React.FC<MenuProps> = ({\n\tactiveOption,\n\tactiveOptionIndex = -1,\n\tassistiveText = {},\n\tclassNameMenuSubHeader,\n\tclassNameMenu,\n\tinheritWidthOf,\n\tinputId,\n\tinputValue = '',\n\tisSelected,\n\titemVisibleLength,\n\tlabels,\n\thasMenuSpinner,\n\tmaxWidth,\n\tmenuPosition,\n\tmenuRef,\n\trenderMenuItem,\n\tonSelect,\n\toptions,\n\tselection,\n\ttooltipMenuItemDisabled,\n\tvariant = 'icon-title-subtitle',\n}) => {\n\tlet menuMaxWidth: string | undefined =\n\t\tinheritWidthOf === 'menu' ? 'inherit' : undefined;\n\tmenuMaxWidth =\n\t\tinheritWidthOf === 'menu' && maxWidth ? maxWidth : menuMaxWidth;\n\n\tconst menuOptions = options.map((optionData, index) => {\n\t\tconst active =\n\t\t\tindex === activeOptionIndex &&\n\t\t\tactiveOption &&\n\t\t\tisEqual(optionData.id, activeOption.id);\n\t\tconst selected =\n\t\t\tisSelected({\n\t\t\t\tselection,\n\t\t\t\toption: optionData,\n\t\t\t}) &&\n\t\t\toptionData.type !== 'header' &&\n\t\t\toptionData.type !== 'footer';\n\n\t\tif (optionData.type === 'separator') {\n\t\t\treturn optionData.label ? (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-dropdown__header slds-truncate\"\n\t\t\t\t\ttitle={\n\t\t\t\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined\n\t\t\t\t\t}\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-listbox__option-header',\n\t\t\t\t\t\t\tclassNameMenuSubHeader\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{typeof optionData.label === 'string'\n\t\t\t\t\t\t\t? optionData.label\n\t\t\t\t\t\t\t: optionData.label?.(inputValue)}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-has-divider_top-space\"\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'header') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-header-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{optionData.icon && sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'footer') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-footer-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{optionData.icon && sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tconst disabledProps: {\n\t\t\t'aria-describedby'?: string;\n\t\t\t'aria-disabled'?: boolean;\n\t\t\tstyle?: CSSProperties;\n\t\t} = {};\n\t\tconst tooltipId = `${inputId}-listbox-option-help-${optionData.id}`;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled && active) {\n\t\t\tdisabledProps['aria-describedby'] = tooltipId;\n\t\t}\n\t\tif (optionData.disabled) {\n\t\t\tdisabledProps['aria-disabled'] = true;\n\t\t\tdisabledProps.style = { cursor: 'default' };\n\t\t}\n\n\t\tconst labelString =\n\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined;\n\n\t\tconst menuItem: Record<string, ReactNode> = {\n\t\t\t'icon-title-subtitle': (\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-subtitle-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_has-meta',\n\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t{optionData.icon && !renderMenuItem ? (\n\t\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{optionData.icon && sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{renderMenuItem ? (\n\t\t\t\t\t\trenderMenuItem({ isSelected: selected, option: optionData })\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text',\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(labelString, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-meta slds-listbox__option-meta_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={optionData.subTitle}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(optionData.subTitle, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t),\n\t\t\tcheckbox: (\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-checkbox-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t' slds-listbox__option_plain slds-media_small slds-media_center',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-has-focus': active,\n\t\t\t\t\t\t\t'slds-is-selected': selected,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, {\n\t\t\t\t\t\t\t\t\t\tselection,\n\t\t\t\t\t\t\t\t\t\toption: optionData,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"slds-listbox__icon-selected\"\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t{renderMenuItem ? (\n\t\t\t\t\t\t\trenderMenuItem({ isSelected: selected, option: optionData })\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames('slds-truncate', {\n\t\t\t\t\t\t\t\t\t'slds-disabled-text': optionData.disabled,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{selected ? (\n\t\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t\t{assistiveText.optionSelectedInMenu}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) : null}{' '}\n\t\t\t\t\t\t\t\t{optionData.type === 'deselect' ? (\n\t\t\t\t\t\t\t\t\t<em>{labelString}</em>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tlabelString\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t),\n\t\t};\n\n\t\tlet item: ReactNode;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled) {\n\t\t\tconst tooltipPropsFromElement = tooltipMenuItemDisabled.props as {\n\t\t\t\tcontent?: ReactNode;\n\t\t\t\t[key: string]: unknown;\n\t\t\t};\n\t\t\tconst { content, ...userDefinedTooltipProps } = tooltipPropsFromElement;\n\t\t\tconst tooltipProps: Record<string, unknown> = {\n\t\t\t\talign: 'top',\n\t\t\t\tcontent: optionData.tooltipContent || content,\n\t\t\t\tid: tooltipId,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tsilenceTriggerTabbableWarning: true,\n\t\t\t\ttriggerStyle: { width: '100%' },\n\t\t\t\t...userDefinedTooltipProps,\n\t\t\t};\n\t\t\tif (active && tooltipProps.isOpen === undefined) {\n\t\t\t\ttooltipProps.isOpen = true;\n\t\t\t}\n\t\t\ttooltipProps.trigger = menuItem[variant];\n\t\t\titem = React.cloneElement(tooltipMenuItemDisabled, tooltipProps);\n\t\t} else {\n\t\t\titem = menuItem[variant];\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\tkey={`menu-option-${optionData.id}`}\n\t\t\t\trole=\"presentation\"\n\t\t\t>\n\t\t\t\t{item}\n\t\t\t</li>\n\t\t);\n\t});\n\n\treturn (\n\t\t<ul\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-listbox slds-listbox_vertical slds-dropdown slds-dropdown_fluid',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_length-with-icon-5': itemVisibleLength === 5,\n\t\t\t\t\t'slds-dropdown_length-with-icon-7': itemVisibleLength === 7,\n\t\t\t\t\t'slds-dropdown_length-with-icon-10': itemVisibleLength === 10,\n\t\t\t\t},\n\t\t\t\tclassNameMenu\n\t\t\t)}\n\t\t\tref={menuRef}\n\t\t\trole=\"presentation\"\n\t\t\tstyle={{\n\t\t\t\twidth: inheritWidthOf === 'menu' ? 'auto' : undefined,\n\t\t\t\tmaxWidth: menuMaxWidth,\n\t\t\t\tposition: menuPosition !== 'relative' ? 'relative' : undefined,\n\t\t\t}}\n\t\t>\n\t\t\t{menuOptions.length ? (\n\t\t\t\tmenuOptions\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-listbox__item slds-listbox__status\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-m-left_x-large slds-p-vertical_medium\">\n\t\t\t\t\t\t{labels.noOptionsFound}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t\t{hasMenuSpinner && (\n\t\t\t\t<li role=\"presentation\" className=\"slds-listbox__item\">\n\t\t\t\t\t<div className=\"slds-align_absolute-center slds-p-top_medium\">\n\t\t\t\t\t\t<Spinner\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.loadingMenuItems }}\n\t\t\t\t\t\t\thasContainer={false}\n\t\t\t\t\t\t\tplacement=\"inline\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t</ul>\n\t);\n};\n\nMenu.displayName = 'Menu';\n\nexport default Menu;\n"],"mappings":";;;;;;;AAiFA,IAAM,KAAW,GAA2B,MAAkC;CAC7E,IAAI,CAAC,KAAS,EAAM,WAAW,KAAK,CAAC,KAAc,EAAW,WAAW,GACxE,OAAO;CAER,IAAM,IAAW,EAAM,YAAY,CAAC,CAAC,QAAQ,EAAW,YAAY,CAAC;CAarE,OAZI,IAAW,KAEb,kBAAC,EAAM,UAAP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AAY,SACZ,IAEA,kBAAC,MAAD;GACC,WAAU;GACV,MAAK;GACL,aAAU;GAEV,UAAA,kBAAC,QAAD;IAAM,WAAU;IACd,UAAA,EAAO;GACH,CAAA;EACH,CAAA,GAEJ,KACA,kBAAC,MAAD;GAAI,MAAK;GAAe,WAAU;GACjC,UAAA,kBAAC,OAAD;IAAK,WAAU;IACd,UAAA,kBAAC,GAAD;KACC,eAAe,EAAE,OAAO,EAAc,iBAAiB;KACvD,cAAc;KACd,WAAU;KACV,MAAK;IACL,CAAA;GACG,CAAA;EACF,CAAA,CAEF;;AAEN;AAEA,EAAK,cAAc"}
1
+ {"version":3,"file":"menu.js","names":[],"sources":["../../../../../components/combobox/private/menu.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype CSSProperties,\n} from 'react';\nimport { dequal as isEqual } from 'dequal';\nimport classNames from 'classnames';\n\nimport Icon from '../../icon';\nimport Spinner from '../../spinner';\nimport type { TooltipProps } from '../../tooltip';\nimport type {\n\tComboboxMenuRenderMenuItemData,\n\tComboboxOption,\n\tComboboxOptionIcon,\n} from '../types';\n\nexport interface MenuAssistiveText {\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n}\n\nexport interface MenuLabels {\n\tnoOptionsFound: ReactNode | string;\n}\n\nexport interface MenuProps {\n\t/** Active descendant in menu */\n\tactiveOption?: ComboboxOption;\n\t/** Index of active descendant in menu */\n\tactiveOptionIndex?: number;\n\t/** Assistive text for accessibility */\n\tassistiveText?: MenuAssistiveText;\n\t/** CSS classes to be added to menu sub header span tag */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Sets the dialog width */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/** Id used for assistive technology */\n\tinputId?: string;\n\t/** Input value for bolding matches */\n\tinputValue?: string;\n\t/** Function to check if option is selected */\n\tisSelected: (params: {\n\t\tselection: ComboboxOption[];\n\t\toption: ComboboxOption;\n\t}) => boolean;\n\t/** Determines the height of the menu */\n\titemVisibleLength?: 5 | 7 | 10 | null;\n\t/** Text labels */\n\tlabels: MenuLabels;\n\t/** Adds loading spinner below the options */\n\thasMenuSpinner?: boolean;\n\t/** Sets a maximum width for menu */\n\tmaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Ref for menu element */\n\tmenuRef?:\n\t\tReact.RefCallback<HTMLUListElement> | React.RefObject<HTMLUListElement>;\n\t/** Renders an option's content in place of the default label and icon */\n\trenderMenuItem?: (data: ComboboxMenuRenderMenuItemData) => ReactNode;\n\t/** Callback when option is selected */\n\tonSelect: (\n\t\tevent: React.MouseEvent,\n\t\tdata: { option: ComboboxOption; selection?: ComboboxOption[] }\n\t) => void;\n\t/** Menu options */\n\toptions: ComboboxOption[];\n\t/** Selected options */\n\tselection: ComboboxOption[];\n\t/** Tooltip for disabled menu items */\n\ttooltipMenuItemDisabled?: ReactElement<Partial<TooltipProps>>;\n\t/** Menu variant */\n\tvariant?: 'icon-title-subtitle' | 'checkbox';\n}\n\nconst setBold = (label: string | undefined, searchTerm: string): ReactNode => {\n\tif (!label || label.length === 0 || !searchTerm || searchTerm.length === 0) {\n\t\treturn label;\n\t}\n\tconst position = label.toLowerCase().indexOf(searchTerm.toLowerCase());\n\tif (position > -1) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{label.slice(0, position)}\n\t\t\t\t<span key=\"bold\" className=\"slds-text-title_bold\">{`${label.slice(\n\t\t\t\t\tposition,\n\t\t\t\t\tposition + searchTerm.length\n\t\t\t\t)}`}</span>\n\t\t\t\t{label.slice(position + searchTerm.length)}\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn label;\n};\n\nconst renderLabel = (\n\tlabelProp: string | ((searchTerm: string) => ReactNode) | undefined,\n\tsearchTerm: string\n): ReactNode => {\n\tif (labelProp == null || typeof labelProp === 'string') {\n\t\treturn labelProp;\n\t}\n\treturn labelProp(searchTerm);\n};\n\n// Entity icons in a combobox listbox option render at \"small\" per SLDS. `Icon`\n// defaults to \"medium\", so an option icon passed without an explicit size shows\n// oversized in the menu (SLDS 2 no longer shrinks it via CSS the way SLDS 1\n// did). Clone the icon to enforce \"small\" unless the consumer set a size\n// themselves. Leaves non-<Icon> nodes untouched.\nconst sizeOptionIcon = (icon: ComboboxOptionIcon): ReactNode =>\n\ticon.props.size != null ? icon : React.cloneElement(icon, { size: 'small' });\n\n/**\n * The text of an option's label. A label render function (separator and action\n * rows only) has no text, so it returns `undefined`.\n */\nexport const getOptionLabel = (option?: ComboboxOption): string | undefined =>\n\ttypeof option?.label === 'string' ? option.label : undefined;\n\nconst Menu: React.FC<MenuProps> = ({\n\tactiveOption,\n\tactiveOptionIndex = -1,\n\tassistiveText = {},\n\tclassNameMenuSubHeader,\n\tclassNameMenu,\n\tinheritWidthOf,\n\tinputId,\n\tinputValue = '',\n\tisSelected,\n\titemVisibleLength,\n\tlabels,\n\thasMenuSpinner,\n\tmaxWidth,\n\tmenuPosition,\n\tmenuRef,\n\trenderMenuItem,\n\tonSelect,\n\toptions,\n\tselection,\n\ttooltipMenuItemDisabled,\n\tvariant = 'icon-title-subtitle',\n}) => {\n\tlet menuMaxWidth: string | undefined =\n\t\tinheritWidthOf === 'menu' ? 'inherit' : undefined;\n\tmenuMaxWidth =\n\t\tinheritWidthOf === 'menu' && maxWidth ? maxWidth : menuMaxWidth;\n\n\tconst menuOptions = options.map((optionData, index) => {\n\t\tconst active =\n\t\t\tindex === activeOptionIndex &&\n\t\t\tactiveOption &&\n\t\t\tisEqual(optionData.id, activeOption.id);\n\t\tconst selected =\n\t\t\tisSelected({\n\t\t\t\tselection,\n\t\t\t\toption: optionData,\n\t\t\t}) &&\n\t\t\toptionData.type !== 'header' &&\n\t\t\toptionData.type !== 'footer';\n\n\t\tif (optionData.type === 'separator') {\n\t\t\treturn optionData.label ? (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-dropdown__header slds-truncate\"\n\t\t\t\t\ttitle={\n\t\t\t\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined\n\t\t\t\t\t}\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-listbox__option-header',\n\t\t\t\t\t\t\tclassNameMenuSubHeader\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{typeof optionData.label === 'string'\n\t\t\t\t\t\t\t? optionData.label\n\t\t\t\t\t\t\t: optionData.label?.(inputValue)}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-has-divider_top-space\"\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'header') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-header-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus -- focus stays on the combobox input, which drives options through aria-activedescendant */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{optionData.icon && sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'footer') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-footer-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus -- focus stays on the combobox input, which drives options through aria-activedescendant */}\n\t\t\t\t\t<div\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{optionData.icon && sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tconst disabledProps: {\n\t\t\t'aria-describedby'?: string;\n\t\t\t'aria-disabled'?: boolean;\n\t\t\tstyle?: CSSProperties;\n\t\t} = {};\n\t\tconst tooltipId = `${inputId}-listbox-option-help-${optionData.id}`;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled && active) {\n\t\t\tdisabledProps['aria-describedby'] = tooltipId;\n\t\t}\n\t\tif (optionData.disabled) {\n\t\t\tdisabledProps['aria-disabled'] = true;\n\t\t\tdisabledProps.style = { cursor: 'default' };\n\t\t}\n\n\t\tconst labelString =\n\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined;\n\n\t\tconst menuItem: Record<string, ReactNode> = {\n\t\t\t'icon-title-subtitle': (\n\t\t\t\t// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus -- focus stays on the combobox input, which drives options through aria-activedescendant\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-subtitle-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_has-meta',\n\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t{optionData.icon && !renderMenuItem ? (\n\t\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{optionData.icon && sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{renderMenuItem ? (\n\t\t\t\t\t\trenderMenuItem({ isSelected: selected, option: optionData })\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text',\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(labelString, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-meta slds-listbox__option-meta_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={optionData.subTitle}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(optionData.subTitle, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t),\n\t\t\tcheckbox: (\n\t\t\t\t// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus -- focus stays on the combobox input, which drives options through aria-activedescendant\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-checkbox-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t' slds-listbox__option_plain slds-media_small slds-media_center',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-has-focus': active,\n\t\t\t\t\t\t\t'slds-is-selected': selected,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, {\n\t\t\t\t\t\t\t\t\t\tselection,\n\t\t\t\t\t\t\t\t\t\toption: optionData,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"slds-listbox__icon-selected\"\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t{renderMenuItem ? (\n\t\t\t\t\t\t\trenderMenuItem({ isSelected: selected, option: optionData })\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames('slds-truncate', {\n\t\t\t\t\t\t\t\t\t'slds-disabled-text': optionData.disabled,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{selected ? (\n\t\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t\t{assistiveText.optionSelectedInMenu}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) : null}{' '}\n\t\t\t\t\t\t\t\t{optionData.type === 'deselect' ? (\n\t\t\t\t\t\t\t\t\t<em>{labelString}</em>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tlabelString\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t),\n\t\t};\n\n\t\tlet item: ReactNode;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled) {\n\t\t\tconst tooltipPropsFromElement = tooltipMenuItemDisabled.props as {\n\t\t\t\tcontent?: ReactNode;\n\t\t\t\t[key: string]: unknown;\n\t\t\t};\n\t\t\tconst { content, ...userDefinedTooltipProps } = tooltipPropsFromElement;\n\t\t\tconst tooltipProps: Record<string, unknown> = {\n\t\t\t\talign: 'top',\n\t\t\t\tcontent: optionData.tooltipContent || content,\n\t\t\t\tid: tooltipId,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tsilenceTriggerTabbableWarning: true,\n\t\t\t\ttriggerStyle: { width: '100%' },\n\t\t\t\t...userDefinedTooltipProps,\n\t\t\t};\n\t\t\tif (active && tooltipProps.isOpen === undefined) {\n\t\t\t\ttooltipProps.isOpen = true;\n\t\t\t}\n\t\t\ttooltipProps.trigger = menuItem[variant];\n\t\t\titem = React.cloneElement(tooltipMenuItemDisabled, tooltipProps);\n\t\t} else {\n\t\t\titem = menuItem[variant];\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\tkey={`menu-option-${optionData.id}`}\n\t\t\t\trole=\"presentation\"\n\t\t\t>\n\t\t\t\t{item}\n\t\t\t</li>\n\t\t);\n\t});\n\n\treturn (\n\t\t<ul\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-listbox slds-listbox_vertical slds-dropdown slds-dropdown_fluid',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_length-with-icon-5': itemVisibleLength === 5,\n\t\t\t\t\t'slds-dropdown_length-with-icon-7': itemVisibleLength === 7,\n\t\t\t\t\t'slds-dropdown_length-with-icon-10': itemVisibleLength === 10,\n\t\t\t\t},\n\t\t\t\tclassNameMenu\n\t\t\t)}\n\t\t\tref={menuRef}\n\t\t\trole=\"presentation\"\n\t\t\tstyle={{\n\t\t\t\twidth: inheritWidthOf === 'menu' ? 'auto' : undefined,\n\t\t\t\tmaxWidth: menuMaxWidth,\n\t\t\t\tposition: menuPosition !== 'relative' ? 'relative' : undefined,\n\t\t\t}}\n\t\t>\n\t\t\t{menuOptions.length ? (\n\t\t\t\tmenuOptions\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-listbox__item slds-listbox__status\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-m-left_x-large slds-p-vertical_medium\">\n\t\t\t\t\t\t{labels.noOptionsFound}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t\t{hasMenuSpinner && (\n\t\t\t\t<li role=\"presentation\" className=\"slds-listbox__item\">\n\t\t\t\t\t<div className=\"slds-align_absolute-center slds-p-top_medium\">\n\t\t\t\t\t\t<Spinner\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.loadingMenuItems }}\n\t\t\t\t\t\t\thasContainer={false}\n\t\t\t\t\t\t\tplacement=\"inline\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t</ul>\n\t);\n};\n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,CAAC;CAED,OACC,kBAAC,MAAD;EACC,WAAW,EACV,wEACA;GACC,oCAAoC,MAAsB;GAC1D,oCAAoC,MAAsB;GAC1D,qCAAqC,MAAsB;EAC5D,GACA,CACD;EACA,KAAK;EACL,MAAK;EACL,OAAO;GACN,OAAO,MAAmB,SAAS,SAAS,KAAA;GAC5C,UAAU;GACV,UAAU,MAAiB,aAA0B,KAAA,IAAb;EACzC;EAhBD,UAAA,CAkBE,EAAY,SACZ,IAEA,kBAAC,MAAD;GACC,WAAU;GACV,MAAK;GACL,aAAU;GAEV,UAAA,kBAAC,QAAD;IAAM,WAAU;IACd,UAAA,EAAO;GACH,CAAA;EACH,CAAA,GAEJ,KACA,kBAAC,MAAD;GAAI,MAAK;GAAe,WAAU;GACjC,UAAA,kBAAC,OAAD;IAAK,WAAU;IACd,UAAA,kBAAC,GAAD;KACC,eAAe,EAAE,OAAO,EAAc,iBAAiB;KACvD,cAAc;KACd,WAAU;KACV,MAAK;IACL,CAAA;GACG,CAAA;EACF,CAAA,CAEF;;AAEN;AAEA,EAAK,cAAc"}
@@ -3,16 +3,15 @@ import { IconSettingsContext as t } from "../icon-settings/index.js";
3
3
  import n from "../../utilities/key-code.js";
4
4
  import r from "../../utilities/event.js";
5
5
  import ee from "../utilities/dialog/index.js";
6
- import i from "../../utilities/generate-id.js";
7
- import { useControllableState as te } from "../../utilities/hooks/use-controllable-state.js";
8
- import ne from "../../utilities/hooks/use-click-outside.js";
9
- import re from "../input/index.js";
10
- import ie from "../icon/input-icon/index.js";
11
- import ae from "./private/calendar-wrapper.js";
12
- import oe from "./check-props.js";
13
- import se from "./component.js";
6
+ import { useControllableState as i } from "../../utilities/hooks/use-controllable-state.js";
7
+ import te from "../../utilities/hooks/use-click-outside.js";
8
+ import ne from "../input/index.js";
9
+ import re from "../icon/input-icon/index.js";
10
+ import ie from "./private/calendar-wrapper.js";
11
+ import ae from "./check-props.js";
12
+ import oe from "./component.js";
14
13
  import a from "../../utilities/warning/low-priority-warning.js";
15
- import { useCallback as o, useContext as ce, useEffect as le, useRef as s, useState as c } from "react";
14
+ import { useCallback as o, useContext as se, useEffect as ce, useId as le, useRef as s, useState as c } from "react";
16
15
  import l from "classnames";
17
16
  import { jsx as u, jsxs as ue } from "react/jsx-runtime";
18
17
  import de from "lodash.assign";
@@ -58,162 +57,162 @@ var fe = {
58
57
  "Friday",
59
58
  "Saturday"
60
59
  ]
61
- }, me = (e) => e ? `${e.getMonth() + 1}/${e.getDate()}/${e.getFullYear()}` : "", he = (e) => (a(!1, "Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser."), new Date(e)), d = (e) => Object.prototype.toString.call(e) === "[object Date]", ge = (e) => e ? String(e.getTime()) : "null", f = (a) => {
62
- let { assistiveText: f = {}, align: p = "left", className: _e, disabled: m, dateDisabled: ve = () => !1, defaultIsOpen: ye = !1, formatter: h = me, hasError: be, hasStaticAlignment: g, id: _, input: v, isOpen: xe, isIsoWeekday: y, labels: Se = {}, menuPosition: b = "absolute", onCalendarFocus: x, onChange: S, onClose: C, onOpen: w, onRequestClose: T, onRequestOpen: E, parser: D = he, portalMount: O, relativeYearFrom: k = -10, relativeYearTo: A = 10, triggerClassName: Ce, value: we, required: j, onBlur: M, onFocus: N, onKeyDown: P } = a, F = de({}, fe, f), I = de({}, pe, Se), L = ce(t), R = s(null), z = s(null), B = s(null), Te = s(i()), V = we ?? null, H = ge(V), [U, W] = te(xe, ye), [G, K] = c(!1), [q, Ee] = c(() => ({
63
- text: h(V),
60
+ }, me = (e) => e ? `${e.getMonth() + 1}/${e.getDate()}/${e.getFullYear()}` : "", he = (e) => (a(!1, "Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser."), new Date(e)), ge = (e) => Object.prototype.toString.call(e) === "[object Date]", _e = (e) => e ? String(e.getTime()) : "null", d = (a) => {
61
+ let { assistiveText: d = {}, align: f = "left", className: ve, disabled: p, dateDisabled: ye = () => !1, defaultIsOpen: be = !1, formatter: m = me, hasError: xe, hasStaticAlignment: h, id: g, input: _, isOpen: Se, isIsoWeekday: v, labels: Ce = {}, menuPosition: y = "absolute", onCalendarFocus: b, onChange: x, onClose: S, onOpen: C, onRequestClose: w, onRequestOpen: T, parser: E = he, portalMount: D, relativeYearFrom: O = -10, relativeYearTo: k = 10, triggerClassName: we, value: Te, required: A, onBlur: j, onFocus: M, onKeyDown: N } = a, P = de({}, fe, d), F = de({}, pe, Ce), I = se(t), L = s(null), R = s(null), z = s(null), B = le(), V = Te ?? null, H = _e(V), [U, W] = i(Se, be), [G, K] = c(!1), [q, Ee] = c(() => ({
62
+ text: m(V),
64
63
  valueKey: H,
65
64
  typedKey: null
66
65
  })), [De, Oe] = c(!1);
67
66
  q.valueKey !== H && Ee({
68
- text: q.typedKey === H ? q.text : h(V),
67
+ text: q.typedKey === H ? q.text : m(V),
69
68
  valueKey: H,
70
69
  typedKey: null
71
70
  });
72
71
  let ke = q.text;
73
- le(() => {
74
- typeof oe == "function" && oe(e, a, se);
72
+ ce(() => {
73
+ typeof ae == "function" && ae(e, a, oe);
75
74
  }, []);
76
- let J = o(() => _ || Te.current, [_]), Y = o(() => !!U, [U]), Ae = o((e) => {
77
- let t = D(e);
78
- return (!d(t) || isNaN(t.getTime())) && (t = /* @__PURE__ */ new Date()), t;
79
- }, [D]), X = o((e, t) => {
80
- Y() && (T?.(e, t), W(!1), K(!1), z.current && z.current.focus());
75
+ let J = o(() => g || B, [g, B]), Y = o(() => !!U, [U]), Ae = o((e) => {
76
+ let t = E(e);
77
+ return (!ge(t) || isNaN(t.getTime())) && (t = /* @__PURE__ */ new Date()), t;
78
+ }, [E]), X = o((e, t) => {
79
+ Y() && (w?.(e, t), W(!1), K(!1), R.current && R.current.focus());
81
80
  }, [
82
- T,
81
+ w,
83
82
  Y,
84
83
  W
85
84
  ]), je = o((e) => {
86
85
  X(e, { trigger: "escape" });
87
86
  }, [X]), Me = o((e, t) => {
88
- C?.(e, { componentWillUnmount: !!t?.componentWillUnmount });
89
- }, [C]), Ne = o((e, t) => {
90
- w && w(e, t), B.current && G && B.current.focus();
91
- }, [w, G]), Z = o((e, t, n = !1) => {
92
- n || K(!1), W(!0), E?.(e, t);
93
- }, [E, W]), Pe = o((e) => {
87
+ S?.(e, { componentWillUnmount: !!t?.componentWillUnmount });
88
+ }, [S]), Ne = o((e, t) => {
89
+ C && C(e, t), z.current && G && z.current.focus();
90
+ }, [C, G]), Z = o((e, t, n = !1) => {
91
+ n || K(!1), W(!0), T?.(e, t);
92
+ }, [T, W]), Pe = o((e) => {
94
93
  K(!0), Z(e, { trigger: "icon-click" }, !0);
95
94
  }, [Z]), Fe = o((e, { date: t }) => {
96
- X(e, { trigger: "date-select" }), S && S(e, {
95
+ X(e, { trigger: "date-select" }), x && x(e, {
97
96
  date: t,
98
- formattedDate: h(t),
97
+ formattedDate: m(t),
99
98
  timezoneOffset: t.getTimezoneOffset()
100
99
  });
101
100
  }, [
102
- h,
101
+ m,
103
102
  X,
104
- S
103
+ x
105
104
  ]), Q = o((e) => {
106
- let t = e.target.value, n = t === "" ? null : D(t), r = d(n) ? n : null;
105
+ let t = e.target.value, n = t === "" ? null : E(t), r = ge(n) ? n : null;
107
106
  Ee((e) => ({
108
107
  ...e,
109
108
  text: t,
110
- typedKey: ge(r)
111
- })), X(e, { trigger: "input-change" }), S && S(e, {
109
+ typedKey: _e(r)
110
+ })), X(e, { trigger: "input-change" }), x && x(e, {
112
111
  date: r,
113
112
  formattedDate: t,
114
113
  timezoneOffset: (r ?? /* @__PURE__ */ new Date()).getTimezoneOffset()
115
114
  });
116
115
  }, [
117
116
  X,
118
- D,
119
- S
117
+ E,
118
+ x
120
119
  ]), Ie = o((e) => {
121
- e.key && !e.shiftKey && (e.key === n.DOWN || e.key === n.UP) && (r.trapEvent(e), Y() || Z(e, { trigger: "keyboard" })), (e.key === n.ESCAPE || e.key === n.ENTER) && (r.trapEvent(e), X(e, { trigger: e.key === n.ESCAPE ? "escape" : "enter" })), P && P(e, {});
120
+ e.key && !e.shiftKey && (e.key === n.DOWN || e.key === n.UP) && (r.trapEvent(e), Y() || Z(e, { trigger: "keyboard" })), (e.key === n.ESCAPE || e.key === n.ENTER) && (r.trapEvent(e), X(e, { trigger: e.key === n.ESCAPE ? "escape" : "enter" })), N && N(e, {});
122
121
  }, [
123
122
  Y,
124
123
  Z,
125
124
  X,
126
- P
125
+ N
127
126
  ]), Le = o((e) => {
128
127
  X(e, { trigger: "click-outside" });
129
128
  }, [X]);
130
- ne(R, Le, {
129
+ te(L, Le, {
131
130
  enabled: Y(),
132
131
  ignoreClass: "ignore-react-onclickoutside"
133
132
  });
134
133
  let $ = o((e) => {
135
- z.current = e, De || Oe(!0);
134
+ R.current = e, De || Oe(!0);
136
135
  }, [De]), Re = o(() => {
137
136
  let e;
138
137
  if (V) {
139
- let t = h(V);
138
+ let t = m(V);
140
139
  e = t ? Ae(t) : V;
141
140
  } else e = /* @__PURE__ */ new Date();
142
- return /* @__PURE__ */ u(ae, {
143
- abbreviatedWeekDayLabels: I.abbreviatedWeekDays,
144
- assistiveTextNextMonth: F.nextMonth,
145
- assistiveTextPreviousMonth: F.previousMonth,
146
- assistiveTextYear: F.year,
141
+ return /* @__PURE__ */ u(ie, {
142
+ abbreviatedWeekDayLabels: F.abbreviatedWeekDays,
143
+ assistiveTextNextMonth: P.nextMonth,
144
+ assistiveTextPreviousMonth: P.previousMonth,
145
+ assistiveTextYear: P.year,
147
146
  canFocusCalendar: G,
148
147
  id: J(),
149
- isIsoWeekday: y,
150
- monthLabels: I.months,
151
- onCalendarFocus: x,
152
- dateDisabled: ve,
148
+ isIsoWeekday: v,
149
+ monthLabels: F.months,
150
+ onCalendarFocus: b,
151
+ dateDisabled: ye,
153
152
  onRequestClose: je,
154
153
  onSelectDate: Fe,
155
- relativeYearFrom: k,
156
- relativeYearTo: A,
154
+ relativeYearFrom: O,
155
+ relativeYearTo: k,
157
156
  selectedDate: e,
158
157
  selectedDateRef: (e) => {
159
- B.current = e;
158
+ z.current = e;
160
159
  },
161
- todayLabel: I.today,
162
- weekDayLabels: I.weekDays
160
+ todayLabel: F.today,
161
+ weekDayLabels: F.weekDays
163
162
  });
164
163
  }, [
165
164
  V,
166
- h,
165
+ m,
167
166
  Ae,
168
- I,
169
167
  F,
168
+ P,
170
169
  G,
171
170
  J,
172
- y,
173
- x,
174
- ve,
171
+ v,
172
+ b,
173
+ ye,
175
174
  je,
176
175
  Fe,
177
- k,
178
- A
176
+ O,
177
+ k
179
178
  ]), ze = o(() => {
180
- let e = b === "relative" ? {} : { transform: "none" };
181
- if (m || !Y()) return null;
179
+ let e = y === "relative" ? {} : { transform: "none" };
180
+ if (p || !Y()) return null;
182
181
  let t = {
183
- align: `bottom ${p}`,
182
+ align: `bottom ${f}`,
184
183
  contentsClassName: l("slds-datepicker slds-dropdown", {
185
- "slds-dropdown_right": b === "relative" && p === "right",
186
- "slds-dropdown_left": b === "relative" && p === "left"
187
- }, _e),
188
- context: L,
189
- hasStaticAlignment: g,
184
+ "slds-dropdown_right": y === "relative" && f === "right",
185
+ "slds-dropdown_left": y === "relative" && f === "left"
186
+ }, ve),
187
+ context: I,
188
+ hasStaticAlignment: h,
190
189
  style: e,
191
190
  onClose: Me,
192
191
  onOpen: Ne,
193
- onRequestTargetElement: () => z.current,
194
- position: b,
195
- portalMount: O
192
+ onRequestTargetElement: () => R.current,
193
+ position: y,
194
+ portalMount: D
196
195
  };
197
196
  return /* @__PURE__ */ u(ee, {
198
197
  ...t,
199
198
  children: Re()
200
199
  });
201
200
  }, [
202
- b,
203
- m,
204
- Y,
201
+ y,
205
202
  p,
206
- _e,
207
- L,
208
- g,
203
+ Y,
204
+ f,
205
+ ve,
206
+ I,
207
+ h,
209
208
  Me,
210
209
  Ne,
211
- O,
210
+ D,
212
211
  Re
213
212
  ]), Be = o(() => {
214
213
  let e = {
215
- iconRight: /* @__PURE__ */ u(ie, {
216
- assistiveText: { icon: F.openCalendar },
214
+ iconRight: /* @__PURE__ */ u(re, {
215
+ assistiveText: { icon: P.openCalendar },
217
216
  "aria-haspopup": !0,
218
217
  "aria-expanded": Y(),
219
218
  category: "utility",
@@ -234,13 +233,13 @@ var fe = {
234
233
  onKeyDown: Ie,
235
234
  value: ke
236
235
  }, t = {
237
- disabled: m,
238
- label: I.label,
239
- onBlur: M,
240
- onFocus: N,
241
- placeholder: I.placeholder,
242
- required: j
243
- }, n = v?.props || {}, r = n, ee = r.onChange, i = r.inputRef;
236
+ disabled: p,
237
+ label: F.label,
238
+ onBlur: j,
239
+ onFocus: M,
240
+ placeholder: F.placeholder,
241
+ required: A
242
+ }, n = _?.props || {}, r = n, ee = r.onChange, i = r.inputRef;
244
243
  return {
245
244
  ...e,
246
245
  ...t,
@@ -253,7 +252,7 @@ var fe = {
253
252
  }
254
253
  };
255
254
  }, [
256
- F.openCalendar,
255
+ P.openCalendar,
257
256
  Y,
258
257
  Pe,
259
258
  $,
@@ -262,25 +261,25 @@ var fe = {
262
261
  Z,
263
262
  Ie,
264
263
  ke,
265
- m,
266
- I.label,
267
- I.placeholder,
268
- M,
269
- N,
264
+ p,
265
+ F.label,
266
+ F.placeholder,
270
267
  j,
271
- v
272
- ])(), Ve = /* @__PURE__ */ u(re, { ...Be });
268
+ M,
269
+ A,
270
+ _
271
+ ])(), Ve = /* @__PURE__ */ u(ne, { ...Be });
273
272
  return /* @__PURE__ */ ue("div", {
274
- ref: R,
273
+ ref: L,
275
274
  className: l("slds-dropdown-trigger", "slds-dropdown-trigger_click", "ignore-react-onclickoutside", {
276
- "slds-has-error": be,
275
+ "slds-has-error": xe,
277
276
  "slds-is-open": Y()
278
- }, Ce),
277
+ }, we),
279
278
  children: [Ve, ze()]
280
279
  });
281
280
  };
282
- f.displayName = e;
281
+ d.displayName = e;
283
282
  //#endregion
284
- export { f as default };
283
+ export { d as default };
285
284
 
286
285
  //# sourceMappingURL=date-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","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\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 generateId from '../../utilities/generate-id';\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 = useRef(generateId());\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.current, [idProp]);\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":";;;;;;;;;;;;;;;;;;;AAkPA,IAAM,KAA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WAAW,EACV,yBACA,+BACA,+BACA;GACC,kBAAkB;GAClB,gBAAgB,EAAU;EAC3B,GACA,EACD;EAXD,UAAA,CAaE,IACA,GAAU,CACP;;AAEP;AAEA,EAAW,cAAc"}
1
+ {"version":3,"file":"date-picker.js","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":";;;;;;;;;;;;;;;;;;AAkPA,IAAM,KAA0D;CAC/D,WAAW;CACX,cAAc;CACd,eAAe;CACf,MAAM;AACP,GAEM,KAA4C;CACjD,qBAAqB;EAAC;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;CAAK;CACrE,OAAO;CACP,QAAQ;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa;CACb,OAAO;CACP,UAAU;EACT;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD,GAEM,MAAoB,MAClB,IACJ,GAAG,EAAK,SAAS,IAAI,EAAE,GAAG,EAAK,QAAQ,EAAE,GAAG,EAAK,YAAY,MAC7D,IAGE,MAAiB,OACtB,EACC,IACA,2JACD,GACO,IAAI,KAAK,CAAG,IAGd,MAAU,MACf,OAAO,UAAU,SAAS,KAAK,CAAI,MAAM,iBAMpC,MAAc,MACnB,IAAO,OAAO,EAAK,QAAQ,CAAC,IAAI,QAI3B,KAAyC,MAAU;CACxD,IAAM,EACL,eAAe,IAAoB,CAAC,GACpC,WAAQ,QACR,eACA,aACA,yBAAqB,IACrB,oBAAgB,IAChB,eAAY,IACZ,cACA,uBACA,IAAI,GACJ,UACA,QAAQ,IACR,iBACA,QAAQ,KAAa,CAAC,GACtB,kBAAe,YACf,oBACA,aACA,YACA,WACA,mBACA,kBACA,YAAS,IACT,gBACA,sBAAmB,KACnB,oBAAiB,IACjB,sBACA,OAAO,IAEP,aACA,WACA,YACA,iBACG,GAGE,IAAgB,GAAO,CAAC,GAAG,IAAsB,CAAiB,GAClE,IAAS,GAAO,CAAC,GAAG,IAAe,EAAU,GAG7C,IAAsB,GAAW,CAAmB,GAGpD,IAAa,EAA8B,IAAI,GAC/C,IAA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